User:VarunFEB2003/common.js: Difference between revisions

Content deleted Content added
No edit summary
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(19 intermediate revisions by 3 users not shown)
Line 1:
importScript("User:UBX/LiveEditCounter.js");
var customizeToolbar = function() {
importScript( 'User:EquazcionVarunFEB2003/NewSectionSummaryhideBeta.js' ); // Backlink: [[User:EquazcionVarunFEB2003/NewSectionSummary.jshideBeta]]
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } );
};
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready
).then( customizeToolbar );
}
} );
}
 
console.log("common.js: Starting");
 
// Make sure the utilities module is loaded (will only load if not already)
mw.loader.using( 'mediawiki.util', function () {
console.log("common.js: Modules loaded");
 
// Wait for the page to be parsed
$( document ).ready( function () {
console.log("common.js: Document ready");
 
// Start of your code that manipulates the page
 
var element = document.getElementById('pt-betafeatures');
if (element) {
element.remove();
}
 
// End of your code that manipulates the page
 
console.log("common.js: Complete");
} ); // document ready
} ); // modules loaded
 
importScript("User:Another_Article/workflowstudyclient.js");
importScript('User:Jackmcbarn/editProtectedHelper.js'); // Linkback: [[User:Jackmcbarn/editProtectedHelper.js]]
Line 50 ⟶ 13:
// importScript('User:VarunFEB2003/IndianMilitaryBadges.js');
// importScript('User:VarunFEB2003/IndianMilitaryUtility.js');
importScriptURImw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:MusikAnimal/customWatchlists.js');
importScript("User:Writ Keeper/Scripts/SearchNamespace.js");
importScript("User:Writ Keeper/Scripts/googleTitle.js");
Line 73 ⟶ 36:
importScript( 'User:Equazcion/BetterTwinklePrefs.js' ); // Backlink: [[User:Equazcion/BetterTwinklePrefs.js]]
importScript('User:Equazcion/NoEditSandbox.js'); //Linkback: [[User:Equazcion/NoEditSandbox]]
importScript( 'User:Equazcion/NewSectionSummary.js' ); // Backlink: [[User:Equazcion/NewSectionSummary.js]]
importScript( 'User:APerson/delsort.js' ); // Backlink: [[User:APerson/delsort.js]]
mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript" );
importScript( 'User:Andy M. Wang/pageswap.js' ); // Backlink: [[User:Andy M. Wang/pageswap]]
 
addOnloadHook$(function () {
mw.util.addPortletLink(
"p-tb", // toolbox portlet
"http://dispenser.homenet.org//~dispenser/cgi-bin/dab_solver.py?page="+wgPageName+"&commonfixes=on",
"Dabfix" // link label
)});
addOnloadHook$(function () {
mw.util.addPortletLink(
"p-tb", // toolbox portlet
"http://en.wikipedia.org/wiki/"+wgPageName+"?action=purge&forcerecursivelinkupdate",
"Force Purge" // link label
)});
addOnloadHook$(function () {
mw.util.addPortletLink(
"p-tb", // toolbox portlet
"http://en.wikipedia.org/wiki/User:VarunFEB2003/Statussig?action=edit",
Line 159 ⟶ 122:
krInsertWikiEditorButton({
id: 'mw-customeditbutton-anotherspecialbutton',
icon: 'https://upload.wikimedia.org/wikipedia/commonsen/ad/a5d7/Button_align_rightFont_button.png',
label: 'Right align',
insertBefore: '<span style="color: Red">',
Line 256 ⟶ 219:
});
});
 
/* [[User:Technical 13/Scripts/Edit counter]] */
var editPage = 'Edit count';// Name of the subpage to save this as in your userspace. This is optional and [[/Edit count]] is the default page.
var tableClass = 'collapsible';// Any classes that you wish to have added to the template. This is optional.
var tableStyle = 'width: 668px;';// Any additional CSS you wish to add to the overall table's appearance. This is optional.
mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Technical_13/Scripts/Edit_counter.js&action=raw&ctype=text/javascript' );