Changeset 572 for trunk/admin/js/voip/functions.js
- Timestamp:
- 01/07/09 15:19:37 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/js/voip/functions.js
r395 r572 59 59 } 60 60 61 function LTrim(value) 62 { 63 var w_space = String.fromCharCode(32); 64 var strTemp = ""; 65 var iTemp = 0; 66 67 if(v_length < 1) 68 return ""; 69 70 var v_length = value ? value.length : 0; 71 72 while(iTemp < v_length) 73 { 74 if(value && value.charAt(iTemp) != w_space) 75 { 76 strTemp = value.substring(iTemp,v_length); 77 break; 78 } 79 iTemp++; 80 } 81 return strTemp; 82 } 83 84 61 85 function SearchOu() 62 86 { … … 73 97 for(var i = 0; i < element.options.length ; i++ ) 74 98 if( element.options[i].selected ) 75 organization = element.options[i].value; 76 77 organization = 'ou=' + organization; 99 organization = 'ou=' + element.options[i].value; 78 100 79 101 _conn.go('$this.bovoip.getGroupsLdap', CompleteSelect, organization); … … 83 105 { 84 106 var select_voip = document.getElementById('groups_voip'); 85 for( var i = 0 ; i < select_voip.options.length; i++ )107 for( var i = 0 ; i < select_voip.options.length; i++ ) 86 108 select_voip.options[i].selected = true; 87 109 } … … 103 125 } 104 126 } 127 128 function validateEmail() 129 { 130 if( arguments.length > 0 ) 131 { 132 var element = arguments[0]; 133 var validate = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 134 135 if(LTrim(element.value) != "" && element.value != "") 136 { 137 if(!validate.test(element.value)) 138 { 139 alert('Email field is not valid' + '.'); 140 element.focus(); 141 return false; 142 } 143 } 144 } 145 } 105 146 106 147 function Voip() … … 113 154 Voip.prototype.remove = removeGroup; 114 155 Voip.prototype.select_ = Selected; 156 Voip.prototype.validateEmail = validateEmail; 115 157 window.voip = new Voip; 116 158
Note: See TracChangeset
for help on using the changeset viewer.