Changeset 293 for trunk/style/global.js
- Timestamp:
- Dec 27, 2009, 9:35:07 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/style/global.js
r228 r293 35 35 } 36 36 37 onload = function()37 function confirmAction(theMessage) 38 38 { 39 if (document.getElementsByClassName == undefined) 39 // TODO: Confirmation is not required in the configuration file 40 // or browser is Opera (crappy js implementation) 41 if (typeof(window.opera) != 'undefined') 40 42 { 41 document.getElementsByClassName = function(className) 42 { 43 var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)"); 44 var allElements = document.getElementsByTagName("*"); 45 var results = []; 46 47 var element; 48 for (var i = 0; (element = allElements[i]) != null; i++) 49 { 50 var elementClass = element.className; 51 if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass)) 52 results.push(element); 53 } 54 55 return results; 56 } 57 43 return true; 58 44 } 59 45 60 arr = document.getElementsByClassName('textedit'); 61 for(i = 0; i < arr.length; i++) 62 { 63 ResizeTextArea(arr[i]); 64 } 46 var is_confirmed = confirm(theMessage); 47 48 return is_confirmed; 65 49 } 66 67 function CheckAll()68 {69 ch = document.getElementById('CheckAll');70 arr = document.getElementsByClassName('CheckBox');71 for(i = 0; i < arr.length; i++)72 {73 arr[i].checked = ch.checked;74 }75 }76 77 function UpdateVersion(versions,versionselected)78 {79 //elSel.clear;80 var elSel = document.getElementById('Version');81 for (i = elSel.length - 1; i>=0; i--) {82 elSel.remove(i);83 }84 85 var elSel = document.getElementById('Version');86 for(i = 0; i < versions.length; i++)87 {88 var elOptNew = document.createElement('option');89 elOptNew.text = versions[i];90 elOptNew.value = versions[i];91 if (versions[i] == versionselected)92 elOptNew.selected = true;93 try {94 elSel.add(elOptNew, null); // standards compliant; doesn't work in IE95 }96 catch(ex) {97 elSel.add(elOptNew); // IE only98 }99 }100 }
Note:
See TracChangeset
for help on using the changeset viewer.