pari: trunk r384 - in /trunk/config: numberplan.html
scripts/astman.js
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Tue Feb 27 10:13:50 MST 2007
Author: pari
Date: Tue Feb 27 11:13:50 2007
New Revision: 384
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=384
Log:
huh! substr() is broken in IE svn diff numberplan.html
Modified:
trunk/config/numberplan.html
trunk/config/scripts/astman.js
Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?view=diff&rev=384&r1=383&r2=384
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Tue Feb 27 11:13:50 2007
@@ -553,9 +553,16 @@
var c = eval('(' + b + ')');
for( var d in c ){
if ( c.hasOwnProperty(d) && c[d]['context'] && (c[d]['context'] == asterisk_guiTDPrefix + d ) ) {
- trunks_desc[d] = new Object();
- trunks_desc[d].comment = (c[d]['trunkname']) ? c[d]['trunkname'] : d ;
- $('trunks').innerHTML += "<option value='" + d + "'>" + trunks_desc[d].comment +"</option>";
+ trunks_desc[d] = new Object();
+ trunks_desc[d].comment = (c[d]['trunkname']) ? c[d]['trunkname'] : d ;
+ var New_OPTION = document.createElement('option');
+ New_OPTION.text = trunks_desc[d].comment ;
+ New_OPTION.value =d ;
+ try {
+ $('trunks').add(New_OPTION, null); // W3C way
+ }catch(ex) {
+ $('trunks').add(New_OPTION); // IE way
+ }
}
}
parent.astmanEngine.config2list("extensions.conf", $('extensions'), widgets , numplan_callbacks);
Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=384&r1=383&r2=384
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Tue Feb 27 11:13:50 2007
@@ -107,8 +107,18 @@
for( var s=0; s < a.length; s++ ){
var b = a[s].subfields ;
json_data += '"' + a[s].categoryname + '" : {' ;
- for ( var y in b ){ if ( b.hasOwnProperty(y) ){ json_data += '"' + y + '":"' + b[y] + '",' ; } }
- if( json_data.substr(-1) =="," ){ json_data = json_data.substring( 0 , (json_data.length - 1) ); } // if last character is a comma remove it
+ var hascomma = 0;
+ for ( var y in b ){
+ if ( b.hasOwnProperty(y) ){
+ if(hascomma){
+ json_data += ', "' + y + '":"' + b[y] + '"' ;
+ }else{
+ json_data += '"' + y + '":"' + b[y] + '"' ;
+ hascomma = 1;
+ }
+ }
+ }
+ //if( json_data.substr(-1) =="," ){ json_data = json_data.substring( 0 , (json_data.length - 1) ); } // if last character is a comma remove it - But this does not work in IE - substr( ) is broken in IE
if( s < a.length - 1 ){ json_data += ' },' ; }else{ json_data += ' }}' ; }
}
}
More information about the asterisk-gui-commits
mailing list