User:PC-XT/Advisor.js: Difference between revisions

Content deleted Content added
{{Please check ISBN}} is placed after the ISBN, not used as a replacement
m get rid of warnings by using mw.config.get
Line 122:
// It is convenient to embed in a help popup.
ct.hlink = function (toWhat, text) {
var wgServer = windowmw.config.get('wgServer') || 'http://en.wikipedia.org';
var wgArticlePath = windowmw.config.get('wgArticlePath') || '/wiki/$1';
var url = (wgServer + wgArticlePath).replace('$1', toWhat);
return '<a href="' + url + '" target="_blank">' + (text || toWhat) + '</a>';
Line 618:
// Wikipedia.
 
if (!ct.noDefaultRules && (!windowmw.config.get('wgContentLanguage') || (windowmw.config.get('wgContentLanguage') === 'en'))) { // switch to turn off default rules for replacement by custom ones // from this line on, a level of indent is spared
 
// === Linking rules ===
Line 1,136:
ct.rules.push(function (s) {
var exceptions = {};
var wgTitle = windowmw.config.get('wgTitle') || '';
if (exceptions[wgTitle]) {
return [];
Line 1,181:
 
ct.rules.push(function (s) {
var wgTitle = windowmw.config.get('wgTitle') || '';
var reTitle = /^(a|the) (.*)$/i;
if (!reTitle.test(wgTitle) || (s.indexOf('DEFAULTSORT') !== -1)) {
Line 1,480:
});
 
} // end if (windowmw.config.get('wgContentLanguage') === 'en') // end of default rules