User:Iritscen/vector.js: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(Undo revision 26170 by Iritscen (talk))
(replacing deprecated globals with mw.config variables, replacing addOnloadHook() with $(), replacing importScript() with mw.loader.load())
Line 2: Line 2:
// The onlyinclude and pre tags below allow me to transclude the enclosed code onto the XEB docs page
// The onlyinclude and pre tags below allow me to transclude the enclosed code onto the XEB docs page
//<onlyinclude><pre>
//<onlyinclude><pre>
if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload")
if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit' || mw.config.get('wgPageName') === 'Special:Upload')
{
{
   XEBOrder="0,1,U,S,F,I1,I2,J1,J2,D,C,D1,4,A,R1,R2,2,3,K,T,Y1,Y2,Z,E1,5,AI,G,8,P,T1,O,H,FS,9,V,N,B,BF,BV";
   XEBOrder="0,1,U,S,F,I1,I2,J1,J2,D,C,D1,4,A,R1,R2,2,3,K,T,Y1,Y2,Z,E1,5,AI,G,8,P,T1,O,H,FS,9,V,N,B,BF,BV";
Line 8: Line 8:
   //myButtons=[];
   //myButtons=[];


   importScript('MediaWiki:Common.js/edit.js');
   mw.loader.load('/w/index.php?title=MediaWiki:Common.js/edit.js&action=raw&ctype=text/javascript');
}//</pre></onlyinclude>
}//</pre></onlyinclude>


Line 14: Line 14:
if (wgPageName == "User:Iritscen/TestSpace" || wgPageName == "User:Iritscen/TestSpace2")
if (wgPageName == "User:Iritscen/TestSpace" || wgPageName == "User:Iritscen/TestSpace2")
{
{
   importScript("User:Iritscen/TestSpace.js");
   mw.loader.load('/w/index.php?title=User:Iritscen/TestSpace.js&action=raw&ctype=text/javascript');
}
}


// Alter the sidebar to include any handy links that only we want to see
// Alter the sidebar to include any handy links that only we want to see
// This code is disabled but left in place since it is referred to on [[MediaWiki:Common]]
// This code is disabled but left in place since it is referred to on [[MediaWiki:Common]]
/*addOnloadHook(function()
/*$(function()
{
{
     ModifySidebar("sep", "navigation", "", "");
     ModifySidebar("sep", "navigation", "", "");
     ModifySidebar("add", "navigation", "Slaves of War", "http://wiki.oni2.net/Oni2:Slaves_of_War");
     ModifySidebar("add", "navigation", "Slaves of War", "http://wiki.oni2.net/Oni2:Slaves_of_War");
});*/
});*/

Revision as of 03:38, 5 August 2017

// Load XEB to augment the editing toolbar; see [[XEB]] for documentation
// The onlyinclude and pre tags below allow me to transclude the enclosed code onto the XEB docs page
//<onlyinclude><pre>
if (mw.config.get('wgAction') === 'edit' || mw.config.get('wgAction') === 'submit' || mw.config.get('wgPageName') === 'Special:Upload')
{
   XEBOrder="0,1,U,S,F,I1,I2,J1,J2,D,C,D1,4,A,R1,R2,2,3,K,T,Y1,Y2,Z,E1,5,AI,G,8,P,T1,O,H,FS,9,V,N,B,BF,BV";

   //myButtons=[];

   mw.loader.load('/w/index.php?title=MediaWiki:Common.js/edit.js&action=raw&ctype=text/javascript');
}//</pre></onlyinclude>

// Use test JS if we're on a test page
if (wgPageName == "User:Iritscen/TestSpace" || wgPageName == "User:Iritscen/TestSpace2")
{
   mw.loader.load('/w/index.php?title=User:Iritscen/TestSpace.js&action=raw&ctype=text/javascript');
}

// Alter the sidebar to include any handy links that only we want to see
// This code is disabled but left in place since it is referred to on [[MediaWiki:Common]]
/*$(function()
{
    ModifySidebar("sep", "navigation", "", "");
    ModifySidebar("add", "navigation", "Slaves of War", "http://wiki.oni2.net/Oni2:Slaves_of_War");
});*/