User talk:Blackcat
JavaScript validation: new section
← Older revision
Revision as of 23:24, 16 March 2013
Line 213:
Line 213:
È tornato: il CU su it.wiki conferma. [https://commons.wikimedia.org/wiki/Special:Contributions/Giorgio_Recchia qua i riferimenti].--[[User:L736E|L736E]] ([[User talk:L736E|talk]]) 20:18, 15 March 2013 (UTC)
È tornato: il CU su it.wiki conferma. [https://commons.wikimedia.org/wiki/Special:Contributions/Giorgio_Recchia qua i riferimenti].--[[User:L736E|L736E]] ([[User talk:L736E|talk]]) 20:18, 15 March 2013 (UTC)
+
+
== JavaScript validation ==
+
+
Hi Blackcat, to ensure the JavaScript and CSS you are trying to save works, you may use
+
+
// Add a CSS validator to promote correct syntax (adds a tab)
+
if (mw.config.get( 'wgTitle' ).match(/\.css$/i) && ($.inArray( mw.config.get( 'wgNamespaceNumber' ), [ 2 , 8 ]) > -1)) {
+
importScript('MediaWiki:Gadget-CSSValidate.js');
+
}
+
+
// Add a JS validator to promote correct syntax (see [[Help:JSValidator]])
+
if (/\.js(?:\/.+)?$/.test(mw.config.get('wgPageName')) && ($.inArray( mw.config.get('wgNamespaceNumber'), [ 8, 2 ]) > -1)) {
+
importScript('MediaWiki:JSValidator.js');
+
}
+
+
in [[User:Blackcat/common.js|your personal JavaScript file]]. Further info at [[Help:JSValidator]].
+
+
+
Reason:
+
[[Commons:Village pump#'Request rotation' not working?]], which was caused by [//commons.wikimedia.org/w/index.php?title=MediaWiki%3ARotateRequest.js&diff=92559800&oldid=92500967 that edit]. When testing the button immediately after updating the scripy, the test may return wrong results because the script is still in cache. One day, I will provide these tools as a gadget and hope that they satisfy Krinkle so they aren't removed again. -- ''[[User:Rillke|Rillke]]''[[User talk:Rillke|(q?)]] 23:24, 16 March 2013 (UTC)
http://commons.wikimedia.org/w/index.php?title=User_talk:Blackcat&diff=92715779&oldid=92640932