DOI Popup Proof of Concept

Display licenses, full-text links and ORCIDs for Crossref DOIs.*

Crossref doi: 10.1155/2013/564864

* Where the DOI's publisher has deposited information with a DOI registration agency.

Try it with your own DOIs

Generate a DOI popup for your own DOIs. Try it out with the form below:

Create Popup

Using the plugin

The DOI popup is a jQuery plugin compatible with Bootstrap. In fact, the plugin extends Bootstrap's tooltip.js, so if you don't currently include Bootstrap in your site, you will need to include tooltip.js and some CSS. If you want to style the popup yourself, you can exclude the premade CSS.

Required bits:

  1. jQuery. If you don't already, include jQuery on your page.
  2. tooltip.js. Include this if you don't have the Bootstrap javascript.
  3. doipopup.js. Javascript for the popup plugin itself.
  4. CSS. You'll need bootstrap CSS and also doipopup.css if you want the plugin to look like it does on this site.
  5. Images from the img directory. Put these wherever you like - their location can be specified as an option.

Now you can create the popup, passing in a DOI:

$('#my-doi-popup-button').doiPopup({doi: '10.5555/12345678'});

Alternatively, when no DOI is passed, the popup will attempt to look up a DOI from any available dc.identifier meta tag on the page:

$('#my-doi-popup-button').doiPopup();

Specifying Custom Options

The plugin's behaviour can be customised by passing additional options to the doiPopup method. For example, set a custom image path, and custom content type labels:

$('#my-doi-popup-buttom').doiPopup({
  imageLocation: '//cdn.mydomain.com/doipopup/img',
  contentTypeLabels: {'application/vnd.me.custom-xml+xml': 'Custom XML'}
});

Options List

Option Type Description
doi String If specified, the DOI that will be looked up when the popup is shown. If not specified, DOI will be taken from the first meta tag with name dc.identifier
imageLocation String Path to location of images used by the popup. Defaults to img.
metadataContentType String Content type requested when performing DOI content negotiation. Defaults to application/vnd.citationstyles.csl+json.
metadataParser Function Function that will parse DOI content negotation response. Must return a map with keys authors, title, licenses and resources. Defaults to a function that parses CSL JSON.
licenseLabels Map Map of license URLs to image filenames. Defaults to map of CC licenses
contentTypeLabels Map Map of content types (MIME types) to friendly labels.

All options are optional!