rbrindley: branch 2.0 r4766 - in /branches/2.0/config: js/ stylesheets/
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Apr 30 15:44:03 CDT 2009
Author: rbrindley
Date: Thu Apr 30 15:44:00 2009
New Revision: 4766
URL: http://svn.digium.com/svn-view/asterisk-gui?view=rev&rev=4766
Log:
- voice menu's advanced edit now checks for a minimal format of something like:
exten=XXX,N,App() ;basically just if each line contains '='
- if there is a format error in voice menu's advanced edit, an error is now properly
displayed and the window is no longer stuck at 'saving...'
Modified:
branches/2.0/config/js/astman.js
branches/2.0/config/js/menus.js
branches/2.0/config/stylesheets/schwing.css
Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=4766&r1=4765&r2=4766
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Thu Apr 30 15:44:00 2009
@@ -1415,7 +1415,7 @@
x.callActions(ct.cb);
//}
}catch(err){
- top.log.error(err.description);
+ top.log.error(err.message);
}
},
Modified: branches/2.0/config/js/menus.js
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/js/menus.js?view=diff&rev=4766&r1=4765&r2=4766
==============================================================================
--- branches/2.0/config/js/menus.js (original)
+++ branches/2.0/config/js/menus.js Thu Apr 30 15:44:00 2009
@@ -63,6 +63,9 @@
show_VMenuEdit_Advanced : function(){
parent.ASTGUI.dialog.waitWhile('Loading ..') ;
+ if (EDIT_VMENU === '') {
+ EDIT_VMENU = top.pbx.voice_menus.next();
+ }
$('#edit_VM_Advanced_DIV').showWithBg();
$('#div_vmenu_edit').hideWithBg();
_$('edit_VM_Advanced_DIV_Title').innerHTML = '[' + EDIT_VMENU + ']' ;
@@ -81,20 +84,29 @@
parent.ASTGUI.dialog.waitWhile('Saving ..') ;
try{
- ASTGUI.miscFunctions.empty_context({ filename:'extensions.conf', context : EDIT_VMENU, cb : function(){
- var x = new listOfActions('extensions.conf');
-
- var vmenu_lines = ASTGUI.getFieldValue('edit_VM_Advanced_details') ;
- vmenu_lines = vmenu_lines.split('\n');
- vmenu_lines.each( function(this_line){
- x.new_action( 'append', EDIT_VMENU , this_line.beforeChar('=') , this_line.afterChar('=') );
- });
- x.callActions( function(){
- ASTGUI.dialog.waitWhile('Updated VoiceMenu information <BR> Reloading GUI ... ');
- setTimeout( function(){ window.location.reload(); } , 2000 );
- });
- }});
+ ASTGUI.miscFunctions.empty_context({ filename:'extensions.conf', context : EDIT_VMENU, cb : function(){}});
+ var x = new listOfActions('extensions.conf');
+
+ var vmenu_lines = ASTGUI.getFieldValue('edit_VM_Advanced_details') ;
+ vmenu_lines = vmenu_lines.split('\n');
+ vmenu_lines.each( function(this_line){
+ if (!this_line.contains('=') && !this_line[0] !== ';') {
+ parent.ASTGUI.dialog.hide();
+ parent.ASTGUI.feedback({ msg:'All lines must be "exten=XXX,N,App()" format', showfor: 5});
+ $('#edit_VM_Advanced_details').addClass('inputValidationFailed').focus();
+ throw('error');
+ }
+ x.new_action( 'append', EDIT_VMENU , this_line.beforeChar('=') , this_line.afterChar('=') );
+ });
+ x.callActions( function(){
+ ASTGUI.dialog.waitWhile('Updated VoiceMenu information <BR> Reloading GUI ... ');
+ setTimeout( function(){ window.location.reload(); } , 2000 );
+ });
}catch(err){
+ if (err === 'error') {
+ return;
+ }
+
alert("Error saving VoiceMenu");
window.location.reload();
}
Modified: branches/2.0/config/stylesheets/schwing.css
URL: http://svn.digium.com/svn-view/asterisk-gui/branches/2.0/config/stylesheets/schwing.css?view=diff&rev=4766&r1=4765&r2=4766
==============================================================================
--- branches/2.0/config/stylesheets/schwing.css (original)
+++ branches/2.0/config/stylesheets/schwing.css Thu Apr 30 15:44:00 2009
@@ -17,12 +17,15 @@
background-color:#FFC58A;
}
-input.inputValidationFailed {
- font-size : 115%;
+input.inputValidationFailed, textarea.inputValidationFailed {
font-weight:bold;
border:2px solid #541B1F;
padding : 1px 0px 2px 2px;
background-color:#F3A68F;
+}
+
+input.inputValidationFailed {
+ font-size : 115%;
}
.input8 {
@@ -545,4 +548,4 @@
.ac_over {
background-color: #0A246A;
color: white;
-}
+}
More information about the asterisk-gui-commits
mailing list