User:Ainz Ooal Gown/mobilemorelinks/article.js: Difference between revisions
Appearance
Content deleted Content added
Rewritten Tags: Mobile edit Mobile web edit Advanced mobile edit |
Updated Tags: Mobile edit Mobile web edit Advanced mobile edit |
||
Line 25: | Line 25: | ||
iabot = '//tools.wmflabs.org/iabot/index.php?page=runbotsingle&wiki=' + mwDBname + '&pagesearch=' + pageName , |
iabot = '//tools.wmflabs.org/iabot/index.php?page=runbotsingle&wiki=' + mwDBname + '&pagesearch=' + pageName , |
||
copy = '//tools.wmflabs.org/copyvios?action=search&use_engine=1&use_links=1&lang=' + contentLanguage + '&project=' + noticeProject +'&title=' + encodedPageName , |
copy = '//tools.wmflabs.org/copyvios?action=search&use_engine=1&use_links=1&lang=' + contentLanguage + '&project=' + noticeProject +'&title=' + encodedPageName , |
||
citebot = '//tools.wmflabs.org/citations/process_page.php?slow=on&edit=on&page=' + pageName |
citebot = '//tools.wmflabs.org/citations/process_page.php?slow=on&edit=on&page=' + pageName , |
||
peerreview = '//dispenser.info.tm/~dispenser/view/Peer_reviewer#page:' + encodedPageName , |
|||
disambiguate = '//dispenser.info.tm/~dispenser/cgi-bin/dablinks.py?page=' + encodedPageName + '&lang=' + contentLanguage , |
|||
checklinks = '//dispenser.info.tm/~dispenser/cgi-bin/webchecklinks.py?page=' + encodedPageName + '&lang=' + contentLanguage ; |
|||
// Buttons start here |
// Buttons start here |
||
var refillBtn = new OO.ui.ButtonWidget({ |
var refillBtn = new OO.ui.ButtonWidget({ |
||
Line 48: | Line 51: | ||
flags: 'progressive', |
flags: 'progressive', |
||
icon: 'robot' |
icon: 'robot' |
||
}), |
|||
peerreviewBtn = new OO.ui.ButtonWidget( { |
|||
label: 'Peer reviewer', |
|||
href: peerreview |
|||
}), |
|||
disambiguateBtn = new OO.ui.ButtonWidget( { |
|||
label: 'Disambiguate links', |
|||
href: disambiguate , |
|||
icon: 'articleDisambiguation' |
|||
}), |
|||
checklinksBtn = new OO.ui.ButtonWidget( { |
|||
label: 'Check external links', |
|||
href: checklinks , |
|||
icon: 'linkExternal' |
|||
}); |
}); |
||
//Change link order here |
//Change link order here |
||
$("#page-secondary-actions").append( copyBtn.$element, refillBtn.$element, citebotBtn.$element, iabotBtn.$element ); |
$("#page-secondary-actions").append( checklinksBtn.$element, copyBtn.$element, disambiguateBtn.$element, refillBtn.$element, citebotBtn.$element, iabotBtn.$element, peerreviewBtn.$element ); |
||
} |
} |
||
} |
} |
Revision as of 17:32, 12 August 2019
// Only loads in Draft and Main namespace on Wikipedia project wikis
$.when(mw.loader.using(['mediawiki.util', 'oojs-ui-core','oojs-ui.styles.icons-editing-citation','oojs-ui.styles.icons-content'])).then( function () {
//JavaScript variables
var namespaceNumber = mw.config.get( 'wgNamespaceNumber' ),
serverName = mw.config.get( 'wgServerName' ),
siteName = mw.config.get( 'wgSiteName' ),
contentLanguage = mw.config.get( 'wgContentLanguage' ),
noticeProject = mw.config.get( 'wgNoticeProject' ),
articleId = mw.config.get( 'wgArticleId' ),
mwDBname = mw.config.get( 'wgDBname' ),
pageName = mw.config.get( 'wgPageName' ),
escapedPageName = pageName.replace( /[!'"()*]/g, escape ),
encodedTitle = encodeURIComponent( mw.config.get( 'wgTitle' ) ),
encodedPageName = encodeURIComponent( pageName );
// Don't run this script if it's a main page.
if (pageName === "Main_Page" //Main Page
) {
return;
}
//Namespace module
if ((pageName.indexOf('Draft:') !== -1) || (namespaceNumber == 0) && ( articleId && articleId !== 0 ) ) {
var articledraft = function($) {
// Button links
var refill = '//tools.wmflabs.org/refill/ng/result.php?method-wiki=Fix+page&addblankmetadata=on&wiki=' + contentLanguage + '&usedomainaswork=on&page=' + encodedPageName ,
iabot = '//tools.wmflabs.org/iabot/index.php?page=runbotsingle&wiki=' + mwDBname + '&pagesearch=' + pageName ,
copy = '//tools.wmflabs.org/copyvios?action=search&use_engine=1&use_links=1&lang=' + contentLanguage + '&project=' + noticeProject +'&title=' + encodedPageName ,
citebot = '//tools.wmflabs.org/citations/process_page.php?slow=on&edit=on&page=' + pageName ,
peerreview = '//dispenser.info.tm/~dispenser/view/Peer_reviewer#page:' + encodedPageName ,
disambiguate = '//dispenser.info.tm/~dispenser/cgi-bin/dablinks.py?page=' + encodedPageName + '&lang=' + contentLanguage ,
checklinks = '//dispenser.info.tm/~dispenser/cgi-bin/webchecklinks.py?page=' + encodedPageName + '&lang=' + contentLanguage ;
// Buttons start here
var refillBtn = new OO.ui.ButtonWidget({
label: 'Expand bare references',
href: refill ,
flags: 'progressive' ,
icon: 'references'
}),
copyBtn = new OO.ui.ButtonWidget({
label: 'Copyright violation detector',
href: copy
}),
citebotBtn = new OO.ui.ButtonWidget({
label: 'Fix citations',
href: citebot ,
flags: 'progressive' ,
icon: 'reference'
}),
iabotBtn = new OO.ui.ButtonWidget( {
label: 'Fix dead links',
href: iabot ,
flags: 'progressive',
icon: 'robot'
}),
peerreviewBtn = new OO.ui.ButtonWidget( {
label: 'Peer reviewer',
href: peerreview
}),
disambiguateBtn = new OO.ui.ButtonWidget( {
label: 'Disambiguate links',
href: disambiguate ,
icon: 'articleDisambiguation'
}),
checklinksBtn = new OO.ui.ButtonWidget( {
label: 'Check external links',
href: checklinks ,
icon: 'linkExternal'
});
//Change link order here
$("#page-secondary-actions").append( checklinksBtn.$element, copyBtn.$element, disambiguateBtn.$element, refillBtn.$element, citebotBtn.$element, iabotBtn.$element, peerreviewBtn.$element );
}
}
$(document).ready(articledraft) ;
}
);