User:Mehdi/common.js

mw.loader.load("//fa.wikipedia.org/w/index.php?title=MediaWiki:Tofawiki.js&action=raw&ctype=text/javascript");

importScript('User:Gadget850/wiki-toolbox.js');

mw.loader.load("//meta.wikimedia.org/w/index.php?title=User:Mehdi/global.js&action=raw&ctype=text/javascript");

mw.loader.load("//fa.wikipedia.org/w/index.php?title=MediaWiki:Gadget-fixtopbar.css&action=raw&ctype=text/css","text/css");

importScript("User:Ebraminio/ArticleTranslator.js");

/**

* Extra buttons in toolbar

* @stats File:Krinkle_InsertWikiEditorButton.js

* You can see Original script in :commons:User:Krinkle/common.js

*/

//

if (!mw.libs.getInsertWikiEditorButton) {

mw.libs.getInsertWikiEditorButton = $.ajax({ dataType: 'script', cache: true,

url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript'

});

}

mw.libs.getInsertWikiEditorButton.then(function () {

//CommonsCat

krInsertWikiEditorButton({

id: 'Commonscat',

icon: '//upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/22px-Commons-logo.svg.png',

label: 'Commons Cat',

insertBefore: '{{Commons category}}\n',

insertAfter: '',

sampleText: '',

autoSummary: { summary: '+ Linked to Commons by adding {{Commons category}}', position: 'replace' }

});

// Link to commons + External Links

krInsertWikiEditorButton({

id: 'Commonscat2',

icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/89/Commons_2.0-logo.svg/22px-Commons_2.0-logo.svg.png',

label: 'ExternalLinks+CommonCat',

insertBefore: '\n== External Links ==\n{{Commons category}}\n',

insertAfter: '',

sampleText: '',

autoSummary: { summary: 'New section & +Linked to Commons by adding {{Commons category}}', position: 'replace' }

});

});

//