Index: trunk/tools/viaf/viaf.user.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | // @require https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js |
6 | 6 | // @require http://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/viaf/jquery.cookie.js |
7 | 7 | // @require http://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/viaf/jquery.ba-replacetext.js |
8 | | -// @description locate VIAF numbers in texts and urls on web pages. (c) T.Gries Version 0.203 201108242100 |
| 8 | +// @description locate VIAF numbers in texts and urls on web pages. (c) T.Gries Version 0.204 201109010840 |
9 | 9 | // @include * |
10 | 10 | // ==/UserScript== |
11 | 11 | |
— | — | @@ -29,6 +29,9 @@ |
30 | 30 | * imported as a new project to svn.wikimedia.org; |
31 | 31 | * updated the require paths to pull required javascripts from there |
32 | 32 | * detection of VIAF, VIAF2 .. VIAF9 |
| 33 | + * 20110901 moved <span> inside <a> tag to fix the non-colouring problem |
| 34 | + * in span class=plainlinks; added blank spans left and right |
| 35 | + * of addedlinks for LTR/RTL pages |
33 | 36 | ***/ |
34 | 37 | |
35 | 38 | // wrapper see http://www.mediawiki.org/wiki/JQuery |
— | — | @@ -42,7 +45,7 @@ |
43 | 46 | var maxVIAFNumbers = 30; |
44 | 47 | |
45 | 48 | // Script update checker source: http://a32.me/2009/11/greasemonkey/ |
46 | | -var VERSION = "0.203"; |
| 49 | +var VERSION = "0.204"; |
47 | 50 | var SCRIPT_NAME = "viaf" |
48 | 51 | var SCRIPT_URL = "http://$$$yourhost$$$/"+SCRIPT_NAME+".user.js" |
49 | 52 | |
— | — | @@ -134,14 +137,14 @@ |
135 | 138 | var viaf = $this.attr( "viaf" ); |
136 | 139 | |
137 | 140 | var newLink = new Array(); |
138 | | - newLink.unshift( $( "<span> <a href='http://viaf.org/viaf/"+viaf+"/' class='addedlink viaf' viaf='"+viaf+"'>VIAF</a></span>" ) ); |
139 | | - newLink.unshift( $( "<span> <a href='http://www.librarything.de/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"' class='addedlink viaf' viaf='"+viaf+"'>LT de</a></span>" ) ); |
140 | | - newLink.unshift( $( "<span> <a href='http://www.librarything.com/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"' class='addedlink viaf' viaf='"+viaf+"'>en</a></span>" ) ); |
141 | | - newLink.unshift( $( "<span> <a href='http://ru.librarything.com/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"' class='addedlink viaf' viaf='"+viaf+"'>ru</a></span>" ) ); |
142 | | - newLink.unshift( $( "<span> <a href='http://yi.librarything.com/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"' class='addedlink viaf' viaf='"+viaf+"'>yi</a></span>" ) ); |
143 | | - newLink.unshift( $( "<span> <a href='http://toolserver.org/%7Eapper/pd/person/viaf/"+viaf+"' class='addedlink viaf' viaf='"+viaf+"'>TS</a></span>" ) ); |
144 | | - newLink.unshift( $( "<span> <a href='http://www.google.com/search?num=100&q=viaf+"+viaf+"' class='addedlink viaf' viaf='"+viaf+"'>G</a></span>" ) ); |
145 | | - // newLink.unshift( $( "<label class='show-summary'><input type='checkbox' class='show-summary-checkbox' checked='checked'><span id='show-summary-text'></span></label>" ) ); |
| 141 | + newLink.unshift( $( "<span> </span><a href='http://viaf.org/viaf/"+viaf+"/'><span class='addedlink viaf' viaf='"+viaf+"'>VIAF</span></a><span> </span>" ) ); |
| 142 | + newLink.unshift( $( "<span> </span><a href='http://www.librarything.de/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"'><span class='addedlink viaf' viaf='"+viaf+"'>LT de</span></a><span> </span>" ) ); |
| 143 | + newLink.unshift( $( "<span> </span><a href='http://www.librarything.com/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"'><span class='addedlink viaf' viaf='"+viaf+"'>en</span></a><span> </span>" ) ); |
| 144 | + newLink.unshift( $( "<span> </span><a href='http://ru.librarything.com/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"'><span class='addedlink viaf' viaf='"+viaf+"'>ru</span></a><span> </span>" ) ); |
| 145 | + newLink.unshift( $( "<span> </span><a href='http://yi.librarything.com/commonknowledge/search.php?f=13&exact=1&q=VIAF%3A"+viaf+"'><span class='addedlink viaf' viaf='"+viaf+"'>yi</span></a><span> </span>" ) ); |
| 146 | + newLink.unshift( $( "<span> </span><a href='http://toolserver.org/%7Eapper/pd/person/viaf/"+viaf+"'><span class='addedlink viaf' viaf='"+viaf+"'>TS</span></a><span> </span>" ) ); |
| 147 | + newLink.unshift( $( "<span> </span><a href='http://www.google.com/search?num=100&q=viaf+"+viaf+"'><span class='addedlink viaf' viaf='"+viaf+"'>G</span></a><span> </span>" ) ); |
| 148 | + // newLink.unshift( $( "<span> </span><label class='show-summary'><input type='checkbox' class='show-summary-checkbox' checked='checked'><span id='show-summary-text'></span></label><span> </span>" ) ); |
146 | 149 | |
147 | 150 | // add a space as the last character after the last added links |
148 | 151 | newLink.unshift( $("<span> </span>") ); |