MediaWiki:Common.js: различия между версиями
Перейти к навигации
Перейти к поиску
YuSer (обсуждение | вклад) Нет описания правки |
YuSer (обсуждение | вклад) Нет описания правки |
||
| Строка 29: | Строка 29: | ||
} | } | ||
importScript('MediaWiki:Test.js'); | importScript('MediaWiki:Test.js'); | ||
Версия от 16:21, 3 декабря 2008
var loadedScripts = {}; // included-scripts tracker
function importScriptURI(url) {
if (loadedScripts[url]) {
return null;
}
loadedScripts[url] = true;
var s = document.createElement('script');
s.setAttribute('src',url);
s.setAttribute('type','text/javascript');
document.getElementsByTagName('head')[0].appendChild(s);
return s;
}
function importScript(page){
importScriptURI('http://transfer/index.php?action=raw&ctype=text/javascript&title='+encodeURIComponent(page.replace(/ /g,'_')));
alert('ok');
}
var auto_comment = 0;
if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0)
{
if (wgCanonicalNamespace != "Special")
{
document.write('<script type="text/javascript" src="/index.php' +
'?title=MediaWiki:Onlyifediting.js&action=raw' +
'&ctype=text/javascript&dontcountme=s"></script>');
}
}
importScript('MediaWiki:Test.js');