MediaWiki:Common.js: различия между версиями
>Edward Chernenko м test |
>Edward Chernenko ага |
||
| Строка 139: | Строка 139: | ||
{ | { | ||
var label = document.getElementById("wpReason"); | var label = document.getElementById("wpReason"); | ||
if(label == null || !window.location.href.match("action=delete")) | if(label == null || !window.location.href.match("action=delete")) | ||
return; | return; | ||
label = document.getElementById("contentSub"); | label = document.getElementById("contentSub"); | ||
if(label == null) | if(label == null) | ||
return; | return; | ||
var comboString = "<select id='stdReasons' onchange='onStdReasonChange()'>\n <option value=''><выберите из списка></option>"; | |||
var request; | var request; | ||
| Строка 179: | Строка 169: | ||
for(i = 0; i < lines.length; i++) | for(i = 0; i < lines.length; i++) | ||
{ | { | ||
comboString += (lines[i].indexOf("-- ") == 0) ? | |||
(" <option value = '" + lines[i].substring(3) + "'>" + lines[i].substring(3) + "</option>\n") : | |||
(" <optgroup label='" + lines[i] + "' />\n"); | |||
} | } | ||
comboString += "</select>\n<br />"; | |||
label.innerHTML = comboString + label.innerHTML; | |||
} | } | ||
} | } | ||