From d2212dda734bb8c4b899faab848fa1bd7c1bf66e Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Sun, 19 Sep 2010 08:01:47 -0400 Subject: [PATCH] Fixed bug in maildirmake function: http://www.howtoforge.com/forums/showthread.php?t=48890 --- interface/web/js/scrigo.js.php | 70 ++++++++++++++++++++++++---------- 1 files changed, 49 insertions(+), 21 deletions(-) diff --git a/interface/web/js/scrigo.js.php b/interface/web/js/scrigo.js.php index 1eac710..cd72445 100644 --- a/interface/web/js/scrigo.js.php +++ b/interface/web/js/scrigo.js.php @@ -6,13 +6,21 @@ redirect = ''; +function reportError(request) { + /* Error reporting is disabled by default as some browsers like safari + sometimes throw errors when a ajax request is delayed even if the + ajax request worked. */ + + /*alert(request);*/ +} + function loadContentRefresh(pagename) { var pageContentCallbackRefresh = { success: function(o) { document.getElementById('pageContent').innerHTML = o.responseText; }, failure: function(o) { - alert('Ajax Request was not successful.'+pagename); + reportError('Ajax Request was not successful.'+pagename); } } @@ -36,7 +44,7 @@ loadMenus(); }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful.'+module); } } var submitFormObj = YAHOO.util.Connect.asyncRequest('GET', 'capp.php?mod='+module, cappCallback); @@ -61,7 +69,7 @@ loadMenus(); }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful.110'); } } @@ -84,8 +92,9 @@ loadContent(redirect); redirect = ''; } + document.getElementById('footer').innerHTML = 'Powered by <a href="http://www.ispconfig.org" target="_blank">ISPConfig</a>'; */ - document.getElementById('footer').innerHTML = 'Powered by <a href="http://www.ispconfig.org" target="_blank">ISPConfig <?php echo ISPC_APP_VERSION ?></a>'; + } function submitForm(formname,target) { @@ -104,7 +113,7 @@ }, failure: function(o) { var parts = o.responseText.split(':'); - alert('Ajax Request was not successful. '+parts[1]); + reportError('Ajax Request was not successful. 111'); } } @@ -144,7 +153,7 @@ } }, failure: function(o) { - alert('Ajax Request was not successful. 1'); + reportError('Ajax Request was not successful. 112'); } } @@ -172,7 +181,7 @@ } }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful. 113'); } } @@ -206,7 +215,7 @@ */ }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful. 114'); } } @@ -237,7 +246,10 @@ if(flag)break; } */ - document.pageForm.username.focus(); + try { + document.pageForm.username.focus(); + } catch (e) { + } } @@ -248,7 +260,7 @@ document.getElementById('sideNav').innerHTML = o.responseText; }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful. 115'); } } @@ -259,7 +271,7 @@ document.getElementById('topNav').innerHTML = o.responseText; }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful. 116'); } } @@ -272,13 +284,6 @@ document.pageForm.next_tab.value = tab; submitForm('pageForm',target); } - - - -function reportError(request) - { - alert('Sorry. There was an error.'); - } function del_record(link,confirmation) { if(window.confirm(confirmation)) { @@ -292,12 +297,34 @@ document.getElementById(elementid).innerHTML = o.responseText; }, failure: function(o) { - alert('Ajax Request was not successful.'); + reportError('Ajax Request was not successful. 118'); } } var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback); +} + +function loadOptionInto(elementid,pagename) { + var itemContentCallback = { + success: function(o) { + var teste = o.responseText; + var elemente = teste.split('#'); + el=document.getElementById(elementid); + el.innerHTML=''; + for (var i = 0; i < elemente.length; ++i){ + + var foo2 = document.createElement("option"); + foo2.appendChild(document.createTextNode(elemente[i])); + foo2.value=elemente[i]; + el.appendChild(foo2); + } + }, + failure: function(o) { + reportError('Ajax Request was not successful. 119'); + } + } + var pageContentObject2 = YAHOO.util.Connect.asyncRequest('GET', pagename, itemContentCallback); } function keepalive() { @@ -306,7 +333,7 @@ setTimeout( keepalive, 1000000 ); }, failure: function(o) { - alert('Sorry. There was an error.'); + reportError('Session expired. Please login again.'); } } @@ -437,11 +464,12 @@ function addAdditionalTemplate(){ var tpl_add = document.getElementById('template_additional').value; - if(tpl_add != '') { + var tpl_list = document.getElementById('template_additional_list').innerHTML; var addTemplate = document.getElementById('tpl_add_select').value.split('|',2); var addTplId = addTemplate[0]; var addTplText = addTemplate[1]; + if(addTplId > 0) { var newVal = tpl_add + '/' + addTplId + '/'; newVal = newVal.replace('//', '/'); var newList = tpl_list + '<br>' + addTplText; -- Gitblit v1.9.1