* added $wgEnableAPI
[mediawiki.git] / skins / common / upload.js
blob160fbf27a289bec743cdd2387d4f6d94339dba1d
1 function licenseSelectorCheck() {
2         var selector = document.getElementById("wpLicense");
3         if (selector.selectedIndex > 0 &&
4                 selector.options[selector.selectedIndex].value == "" ) {
5                 // Browser is broken, doesn't respect disabled attribute on <option>
6                 selector.selectedIndex = 0;
7         }
10 function licenseSelectorFixup() {
11         // for MSIE/Mac; non-breaking spaces cause the <option> not to render
12         // but, for some reason, setting the text to itself works
13         var selector = document.getElementById("wpLicense");
14         var ua = navigator.userAgent;
15         var isMacIe = (ua.indexOf("MSIE") != -1) && (ua.indexOf("Mac") != -1);
16         if (isMacIe) {
17                 for (var i = 0; i < selector.options.length; i++) {
18                         selector.options[i].text = selector.options[i].text;
19                 }
20         }
23 addOnloadHook(licenseSelectorFixup);