From Wikipedia, the free encyclopedia
Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump . The code will be executed when previewing this page under some skins, including Monobook.
Template:Script doc auto Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button. Firefox: hold down the Shift key while clicking Reload (or press Ctrl-Shift-R). Google Chrome and Safari users can just click the Reload button. For details and instructions about other browsers, see Wikipedia:Bypass your cache .
function localScript ( name )
{
mw . loader . load ( '/w/index.php?title=User:Wargo/' + name + '.js&action=raw&ctype=text/javascript' );
}
//localScript('ooui');
//localScript('ve-gadget-n');
/*localScript('RCFilters');
localScript('MySidebar');
localScript('Masowo_na_TO');*/
//localScript('drh');
/*mw.loader.using('mediawiki.util', 'jquery.ui').done(function(){
localScript('MTS');
});*/
mw . loader . using ( 'mediawiki.util' ). done ( function (){
mw . util . addCSS ( '.oo-ui-icon-kropidlo {background-image: url(https://commons.wikimedia.org/w/thumb.php?f=Broom%20icon.svg&w=22);}' );
});
for2017WTE = function ()
{
function ve_sk_cmd ()
{
ve_sk_cmd . parent . call ( this , 've_sk' );
}
OO . inheritClass ( ve_sk_cmd , ve . ui . Command );
// eslint-disable-next-line no-unused-vars
ve_sk_cmd . prototype . execute = function ( surface )
{
alert ( "s" );
return true ;
};
ve_sk_cmd . prototype . isExecutable = function ()
{
return ( ve . init . target . getSurface (). getMode () === 'source' );
};
ve . ui . commandRegistry . register ( new ve_sk_cmd ());
function sk4nwe_cmd ()
{
sk4nwe_cmd . parent . apply ( this , arguments );
}
OO . inheritClass ( sk4nwe_cmd , ve . ui . Tool );
mw . loader . using ( [ 'ext.visualEditor.mediawiki' ] ). then ( function () {
function addGroup ( target ) {
console . log ( 's' );
target . static . toolbarGroups . push ( {
name : 'mytoolgroup' ,
label : 'My Group' ,
include : [ { group : 'mytoolgroup' } ],
} );
}
for ( var n in ve . init . mw . targetFactory . registry ) {
addGroup ( ve . init . mw . targetFactory . lookup ( n ) );
}
ve . init . mw . targetFactory . on ( 'register' , function ( name , target ) {
addGroup ( target );
} );
} );
sk4nwe_cmd . static . name = 'codecleaner' ;
sk4nwe_cmd . static . group = 'mytoolgroup' ;
sk4nwe_cmd . static . autoAddToCatchall = false ;
sk4nwe_cmd . static . autoAddToGroup = true ;
sk4nwe_cmd . static . icon = 'kropidlo' ;
sk4nwe_cmd . static . title = 'SK' ;
sk4nwe_cmd . static . commandName = 've_sk' ;
ve . ui . toolFactory . register ( sk4nwe_cmd );
ve . ui . triggerRegistry . register (
've_sk' , {
mac : new ve . ui . Trigger ( 'cmd+shift+1' ),
pc : new ve . ui . Trigger ( 'ctrl+shift+1' )
}
);
};
mw . loader . using ( 'ext.visualEditor.desktopArticleTarget.init' ). done ( function (){
mw . libs . ve . addPlugin ( function () {
mw . loader . using ( [ 'ext.visualEditor.core' ] ). done ( function () {
for2017WTE ();
});
});
});