r95940 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95939‎ | r95940 | r95941 >
Date:06:44, 1 September 2011
Author:wikinaut
Status:deferred
Tags:
Comment:
new version 0.204 fixes the non-colouring problem in class=plainlinks span tags; adds blank spans left and right of the added links, useful for RTL and LTR users
Modified paths:
  • /trunk/tools/viaf/viaf.user.js (modified) (history)

Diff [purge]

Index: trunk/tools/viaf/viaf.user.js
@@ -4,7 +4,7 @@
55 // @require https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
66 // @require http://svn.wikimedia.org/svnroot/mediawiki/trunk/tools/viaf/jquery.cookie.js
77 // @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
99 // @include *
1010 // ==/UserScript==
1111
@@ -29,6 +29,9 @@
3030 * imported as a new project to svn.wikimedia.org;
3131 * updated the require paths to pull required javascripts from there
3232 * 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
3336 ***/
3437
3538 // wrapper see http://www.mediawiki.org/wiki/JQuery
@@ -42,7 +45,7 @@
4346 var maxVIAFNumbers = 30;
4447
4548 // Script update checker source: http://a32.me/2009/11/greasemonkey/
46 -var VERSION = "0.203";
 49+var VERSION = "0.204";
4750 var SCRIPT_NAME = "viaf"
4851 var SCRIPT_URL = "http://$$$yourhost$$$/"+SCRIPT_NAME+".user.js"
4952
@@ -134,14 +137,14 @@
135138 var viaf = $this.attr( "viaf" );
136139
137140 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>" ) );
146149
147150 // add a space as the last character after the last added links
148151 newLink.unshift( $("<span> </span>") );

Follow-up revisions

RevisionCommit summaryAuthorDate
r96026follow-up to r95940 which was not correctly working because links were not setwikinaut18:55, 1 September 2011

Status & tagging log