pari: trunk r487 - /trunk/config/menus.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Mar 26 11:21:22 MST 2007


Author: pari
Date: Mon Mar 26 13:21:21 2007
New Revision: 487

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=487
Log:
Show the list of default sound files from /var/lib/asterisk/sounds/

Modified:
    trunk/config/menus.html

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=487&r1=486&r2=487
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Mon Mar 26 13:21:21 2007
@@ -962,9 +962,40 @@
 	var opt = { method: 'get', asynchronous: true,
 		onComplete: function(originalRequest){
 			_$('sysinfohtml').innerHTML = originalRequest.responseText;
+			// Add Default sound files to the list of sound files
+			var j = _$('sound_files').innerHTML ;
+			var sndfiles = j.split("<br>") ;
+			var New_OPTION = document.createElement('option');
+			New_OPTION.text = "Default Sounds"  ;
+			New_OPTION.value = ""  ;
+			New_OPTION.style.fontWeight = "bold";
+			try {
+				_$('combosel_sounds').add(New_OPTION, null); // W3C way
+			}catch(ex) {
+				_$('combosel_sounds').add(New_OPTION); // IE way
+			}
+			var file_name;
+			for( var i =0 ; i < sndfiles.length ; i++){
+				if( typeof sndfiles[i] == "undefined"  || sndfiles[i] == "" ){
+					continue;
+				}
+				sndfiles[i] = sndfiles[i].replace(/^\s*|\s*$/g,'') ;
+				if( sndfiles[i] == "" ){ continue; }
+				file_name = sndfiles[i].stripTags() ;
+				file_name = file_name.substr(0,(file_name.length - 4) ) ;
+				New_OPTION = document.createElement('option');
+				New_OPTION.text =  file_name  ;
+				New_OPTION.value = file_name ;
+				try {
+					_$('combosel_sounds').add(New_OPTION, null); // W3C way
+				}catch(ex) {
+					_$('combosel_sounds').add(New_OPTION); // IE way
+				}
+			}
+			// Add Recorded Voiemenus to the list of sound files
 			var k = _$('rec_files').innerHTML ;
 			var recfiles = k.split("<br>") ;
-			var New_OPTION = document.createElement('option');
+			New_OPTION = document.createElement('option');
 			New_OPTION.text = "Recorded Voicemenus"  ;
 			New_OPTION.value = ""  ;
 			New_OPTION.style.fontWeight = "bold";



More information about the asterisk-gui-commits mailing list