Skip to content

Commit

Permalink
Ignore .DS_Store
Browse files Browse the repository at this point in the history
  • Loading branch information
clintharrison committed Aug 5, 2012
1 parent fec6783 commit df60e8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.DS_Store
12 changes: 12 additions & 0 deletions doi-bookmarklet.js
@@ -0,0 +1,12 @@
(function() {
var proxyUrl = "";
var selection = document.getSelection ? document.getSelection().toString() : document.selection.createRange().text;
var regex = /\w?(?:doi:|hdl:(?:\/\/)?)\s*([0-9./a-z]+)\w?/i;
var match = regex.exec(selection);
if (match != null) {
var doi = match[1];
var tempAnchor = document.createElement('a');
tempAnchor.href = proxyUrl;
document.location = tempAnchor.protocol + '//dx.doi.org.' + tempAnchor.host + '/' + doi;
}
})();

0 comments on commit df60e8b

Please sign in to comment.