-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
187 lines (163 loc) · 7.63 KB
/
index.html
File metadata and controls
187 lines (163 loc) · 7.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<html>
<head>
<meta name="dc.identifier" content="10.1155/2013/938169">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="tooltip.js"></script>
<script src="doipopup.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="css/font.css">
<link rel="apple-touch-icon" sizes="57x57" href="https://assets.crossref.org/favicon/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://assets.crossref.org/favicon/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://assets.crossref.org/favicon/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://assets.crossref.org/favicon/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://assets.crossref.org/favicon/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://assets.crossref.org/favicon/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://assets.crossref.org/favicon/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://assets.crossref.org/favicon/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://assets.crossref.org/favicon/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="https://assets.crossref.org/favicon/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="https://assets.crossref.org/favicon/manifest.json">
<link rel="mask-icon" href="https://assets.crossref.org/favicon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="Crossref">
<meta name="application-name" content="Crossref">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="https://assets.crossref.org/favicon/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<div class="navbar navbar-inverse">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">
<span>
<img src="https://assets.crossref.org/logo/crossref-logo-landscape-200.png" alt="Crossref logo">
</span>
</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/CrossRef/doi-popup">
Source on Github
</a>
</li>
</ul>
</div>
</div>
<div class="container">
<div class="row" style="margin-top: 5em;">
<center>
<h3>DOI Popup Proof of Concept</h3>
<p class="lead" style="margin-top: 2em; margin-bottom: 3.5em;">
Display licenses, full-text links and ORCIDs for Crossref DOIs.*
</p>
<p style="margin-bottom: 6em;">
<a class="btn btn-primary btn-sm" id="doi-link-explicit">
<img src="img/crossref-logo-icon-only.svg" class="doi-image">Crossref doi: 10.1155/2013/564864</a>
</p>
</center>
<small>* Where the DOI's publisher has deposited information with a DOI registration agency.</small>
<hr>
</div>
<div class="row">
<h3>Try it with your own DOIs</h3>
<p>Generate a DOI popup for your own DOIs. Try it out with the form below:</p>
<form class="form-inline">
<input style="width: 30em;" class="form-control" id="doi-try-doi" type="text" placeholder="10.5555/12345678"></input>
<a id="doi-try" class="form-control btn btn-success">Create Popup</a>
</form>
<div class="well"><center id="doi-try-gen"></center></div>
<script type="text/javascript">
$(document).ready(function() {
$('#doi-try').on('click', function() {
var val = $('#doi-try-doi').val();
if (val) {
$('#doi-try-gen').html('<a class="btn btn-primary" id="doi-try-popup"><img src="img/crossref-logo-icon-only.svg" class="doi-image">Crossref doi: ' + val + '</a>');
$('#doi-try-popup').doiPopup({doi: $('#doi-try-doi').val()});
}
});
});
</script>
<h3>Using the plugin</h3>
<p>
The DOI popup is a jQuery plugin compatible with Bootstrap. In fact, the plugin extends Bootstrap's
<code>tooltip.js</code>, so if you don't currently include Bootstrap in your site, you will need to include <code>tooltip.js</code>
and some CSS. If you want to style the popup yourself, you can exclude the premade CSS.
</p>
<p>Required bits:</p>
<ol>
<li>jQuery. If you don't already, include jQuery on your page.</li>
<li><code>tooltip.js</code>. Include this if you don't have the Bootstrap javascript.</li>
<li><code>doipopup.js</code>. Javascript for the popup plugin itself.</li>
<li>CSS. You'll need bootstrap CSS and also <code>doipopup.css</code> if you want the plugin
to look like it does on this site.</li>
<li>Images from the <code>img</code> directory. Put these wherever you like - their location
can be specified as an option.</li>
</ol>
<p>Now you can create the popup, passing in a DOI:</p>
<pre>$('#my-doi-popup-button').doiPopup({doi: '10.5555/12345678'});</pre>
<p>Alternatively, when no DOI is passed, the popup will attempt to look up a DOI from
any available <code>dc.identifier</code> meta tag on the page:</p>
<pre>$('#my-doi-popup-button').doiPopup();</pre>
<h4>Specifying Custom Options</h4>
<p>The plugin's behaviour can be customised by passing additional options to the <code>doiPopup</code>
method. For example, set a custom image path, and custom content type labels:</p>
<pre>$('#my-doi-popup-buttom').doiPopup({
imageLocation: '//cdn.mydomain.com/doipopup/img',
contentTypeLabels: {'application/vnd.me.custom-xml+xml': 'Custom XML'}
});</pre>
<h4>Options List</h4>
<table class="table table-striped">
<tr>
<th>Option</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>doi</td>
<td>String</td>
<td>If specified, the DOI that will be looked up when the popup is shown.
If not specified, DOI will be taken from the first <code>meta</code> tag with name <code>dc.identifier</code></td>
</tr>
<tr>
<td>imageLocation</td>
<td>String</td>
<td>Path to location of images used by the popup. Defaults to <code>img</code>.</td>
</tr>
<tr>
<td>metadataContentType</td>
<td>String</td>
<td>Content type requested when performing DOI content negotiation. Defaults
to <code>application/vnd.citationstyles.csl+json</code>.
</td>
</tr>
<tr>
<td>metadataParser</td>
<td>Function</td>
<td>Function that will parse DOI content negotation response. Must return
a map with keys <code>authors</code>, <code>title</code>, <code>licenses</code> and <code>resources</code>. Defaults to a function that parses CSL JSON.</td>
</tr>
<tr>
<td>licenseLabels</td>
<td>Map</td>
<td>Map of license URLs to image filenames. Defaults to map of CC licenses</td>
</tr>
<tr>
<td>contentTypeLabels</td>
<td>Map</td>
<td>Map of content types (MIME types) to friendly labels.</td>
</tr>
</table>
<p>All options are optional!</p>
</div>
</div>
<script>
$(document).ready(function() {
$('#doi-link-explicit').doiPopup({doi: '10.1155/2013/564864'});
});
</script>
</body>
</html>