MediaWiki:Common.js: различия между версиями

Материал из RSB-Doc
Перейти к навигации Перейти к поиску
Eme (обсуждение | вклад)
Нет описания правки
Eme (обсуждение | вклад)
Нет описания правки
Строка 15: Строка 15:




function CPopUpGetCategoryName()
function CPopUp_GetCategory_Settings()
{
{
var selectedCategoryName;
this.selectedCategoryName;
var categoryListCode;
this.categoryListCode;
var xmlHttpObj;
this.xmlHttpObj;
var popUp;
this.popUp;
var url = "http://transfer.softlab.ru/extensions/CategoryTree/GeOnlytCategoryTree.php";
this.url = "http://transfer.softlab.ru/extensions/CategoryTree/GeOnlytCategoryTree.php";
 
var docH = document.body.clientHeight;
var docW = document.body.clientWidth;
var ppH = 300;
var ppW = 240;
 
this.Show = function(){
popUp = window.createPopup();
popUp.document.body.style.backgroundColor = "#eeeeee";
popUp.document.body.style.border = "solid #000000 1px";
popUp.show(docW/2, docH/2, ppW, ppH, document.body);
GetCategoryList();
}
 
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(){
alert(1);
if(xmlHttpObj!=null & categoryListCode == null)
{
xmlHttpObj.onreadystatechange = this.IncomingRequest;
xmlHttpObj.open("GET", url, true);
xmlHttpObj.send();
}
else
popUp.document.write(categoryListCode);
}
 
xmlHttpObj = this.GetXMLHTTPObj();
}
}

Версия от 14:48, 19 декабря 2007

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 CPopUp_GetCategory_Settings()
{
this.selectedCategoryName;
this.categoryListCode;
this.xmlHttpObj;
this.popUp;
this.url = "http://transfer.softlab.ru/extensions/CategoryTree/GeOnlytCategoryTree.php";
}