User:Iritscen/vector.js: Difference between revisions
Jump to navigation
Jump to search
(wait, why do I need to even look at what page I'm on if I'm no longer instructing MW to load a script?) |
(does "await" work or doesn't it?) |
||
Line 15: | Line 15: | ||
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"); | ||
});*/ | });*/ | ||
function sleep(ms) { | |||
return new Promise(resolve => setTimeout(resolve, ms)); | |||
} | |||
async function demo() { | |||
console.log('Taking a break...'); | |||
await sleep(2000); | |||
console.log('Two second later'); | |||
} | |||
demo(); |
Revision as of 04:55, 15 February 2018
// Add handy buttons to my editing toolbar; see [[XEB]] for documentation 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"; // Use test JS if we're on a test page if (mw.config.get('wgPageName') === 'User:Iritscen/TestSpace' || mw.config.get('wgPageName') === 'User:Iritscen/TestSpace2') { mw.loader.load('/w/index.php?title=User:Iritscen/TestSpace.js&action=raw&ctype=text/javascript'); } // Add handy links to my sidebar // 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"); });*/ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async function demo() { console.log('Taking a break...'); await sleep(2000); console.log('Two second later'); } demo();