MediaWiki:Common.js
Замечание: Возможно, после публикации вам придётся очистить кэш своего браузера, чтобы увидеть изменения.
- Firefox / Safari: Удерживая клавишу Shift, нажмите на панели инструментов Обновить либо нажмите Ctrl+F5 или Ctrl+R (⌘+R на Mac)
- Google Chrome: Нажмите Ctrl+Shift+R (⌘+Shift+R на Mac)
- Edge: Удерживая Ctrl, нажмите Обновить либо нажмите Ctrl+F5
- Opera: Нажмите Ctrl+F5.
var auto_comment = 0;
var popUpGetCategoryName = 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>');
}
}
function CPopUpGetCategoryName()
{
var selectedCategoryName;
var categoryListCode;
var xmlHttpObj;
var popUp;
this.Show = function(){
popUp = window.createPopup();
popUp.document.body.style.backgroundColor = "#eeeeee";
popUp.document.body.style.border = "solid #000000 1px";
popUp.show(100, 200, 700, 300, document.body);
}
this.GetXMLHTTPObj = function(){
sajax_init_object();
}
this.IncomingRequest = function(){
if (xmlHttpObj!=null & xmlHttpObj.readyState == 4){// если запрос завершен
if (xmlHttpObj.status == 200) { // если он завершен без ошибок
categoryListCode = xmlHttpObj.responseText;
popUp.document.write(categoryListCode);
}else{
alert("Произошла ошибка "+ xmlHttpObj.status+":\n" + xmlHttpObj.statusText);
}
}
}
this.GetCategoryList = function(){
if(xmlHttpObj!=null & categoryListCode == null)
{
xmlHttpObj.onreadystatechange = this.IncomingRequest;
xmlHttpObj.open("GET", url, true);
xmlHttpObj.send();
}
else
popUp.document.write(categoryListCode);
}
xmlHttpObj = this.GetXMLHTTPObj();
}