* (bug 2316) Add "caption" attribute to <gallery> tag
[lhc/web/wiklou.git] / skins / common / upload.js
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 }
8 }
9
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 }
21 }
22
23 addOnloadHook(licenseSelectorFixup);