Permalink
Browse files

Ignore .DS_Store

  • Loading branch information...
1 parent fec6783 commit df60e8b13afb4e782c8d98c8e930e699cbc6d1b4 @clintharrison committed Aug 5, 2012
Showing with 13 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +12 −0 doi-bookmarklet.js
View
@@ -0,0 +1 @@
+.DS_Store
View
@@ -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.