pari: trunk r314 - in /trunk/config: menus.html scripts/astman.js

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Feb 1 00:15:50 MST 2007


Author: pari
Date: Thu Feb  1 01:15:50 2007
New Revision: 314

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=314
Log:
tweak: A single document.write instead of multiple, slight performance improvement

Modified:
    trunk/config/menus.html
    trunk/config/scripts/astman.js

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=314&r1=313&r2=314
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Thu Feb  1 01:15:50 2007
@@ -523,16 +523,17 @@
 
 
 function generate_fields(key){
-			document.write('<select  class="input8" style="font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"   id=\'keypress_'+ key + '_action\' onchange="key_action(this.value, \'' + key + '\')">\n');
-			document.write('<option value="disabled">Disabled</option>\n');
-			document.write('<option value="gotomenu">Goto Menu</option>\n');
-			document.write('<option value="gotoextension">Goto Extension</option>\n');
-			document.write('<option value="Custom">Custom</option>\n');
-			document.write('<option value="Hangup">Hangup</option>\n');
-			document.write('<option value="PlayInvalid">Play Invalid</option>\n');
-			document.write('</select>&nbsp;<input type="text" class="input8" size=16 style="display:none;font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;" id="keypress_' + key+ '_text" onchange="enable_savecancel()">\n');
-			document.write('<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_menus" onchange="enable_savecancel()" class="input8"></select>\n');
-			document.write('<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_exts" onchange="enable_savecancel()" class="input8"></select>\n');
+			var t = '<select  class="input8" style="font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"   id=\'keypress_'+ key + '_action\' onchange="key_action(this.value, \'' + key + '\')">\n';
+			t += '<option value="disabled">Disabled</option>\n' ;
+			t += '<option value="gotomenu">Goto Menu</option>\n';
+			t += '<option value="gotoextension">Goto Extension</option>\n';
+			t += '<option value="Custom">Custom</option>\n';
+			t += '<option value="Hangup">Hangup</option>\n';
+			t += '<option value="PlayInvalid">Play Invalid</option>\n';
+			t += '</select>&nbsp;<input type="text" class="input8" size=16 style="display:none;font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;" id="keypress_' + key+ '_text" onchange="enable_savecancel()">\n';
+			t += '<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_menus" onchange="enable_savecancel()" class="input8"></select>\n';
+			t += '<select  style="display:none; font-family: Verdana, Arial, Helvetica, Sans-Serif;font-size: 11px;"  id="keypress_'+ key + '_exts" onchange="enable_savecancel()" class="input8"></select>\n';
+			return t;
 }
 
 function step_onselect(){
@@ -1314,11 +1315,12 @@
 													<SCRIPT LANGUAGE="JavaScript">
 													<!--
 													for (var k=0; k< keys.length; k++){
-														document.write("<TR bgcolor='#FFFFFF'>\n");
-														document.write("<TD width=35 align=center><font style=\"font-size: 10pt\">"+keys[k]+"</font></TD>\n");
-														document.write("<TD>");
-														generate_fields( keys[k] ) ;
-														document.write("\n </TD></TR>\n\n");											
+														var p =  generate_fields( keys[k] )  ; 
+														document.write("<TR bgcolor='#FFFFFF'>\n"
+														+ "<TD width=35 align=center><font style=\"font-size: 10pt\">"+keys[k]+"</font></TD>\n"
+														+ "<TD>" 
+														+ p
+														+ "\n </TD></TR>\n\n" );
 													}
 													//-->
 													</SCRIPT>

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=314&r1=313&r2=314
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Thu Feb  1 01:15:50 2007
@@ -69,14 +69,15 @@
 }
 
 function showdiv_statusmessage(){
-		document.write ("<div ID=\"status_message\"  STYLE=\"display:none; position: absolute; left: 170; top: 190; width:350; height:115;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;\">");
-		document.write ("<BR><BR>");
-		document.write ("		<TABLE border=0 cellpadding=0 cellspacing=3 align=\"center\">");
-		document.write ("					<TR>	<TD><img src=\"images/loading.gif\"></TD>");
-		document.write ("								<TD valign=\"middle\" align=\"center\">&nbsp;&nbsp;<div id=\"message_text\"></div></TD>");
-		document.write ("					</TR>");
-		document.write ("		</TABLE>");
-		document.write ("	</div>");
+		var t = "<div ID=\"status_message\"  STYLE=\"display:none; position: absolute; left: 170; top: 190; width:350; height:115;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid;\">\n";
+		t += "<BR><BR>\n";
+		t += "		<TABLE border=0 cellpadding=0 cellspacing=3 align=\"center\">\n";
+		t += "					<TR>	<TD><img src=\"images/loading.gif\"></TD>\n";
+		t += "								<TD valign=\"middle\" align=\"center\">&nbsp;&nbsp;<div id=\"message_text\"></div></TD>\n";
+		t += "					</TR>\n";
+		t += "		</TABLE>\n";
+		t += "	</div>\n";
+		document.write(t);
 }
 
 



More information about the asterisk-gui-commits mailing list