| | |
| | | var cappCallback = { |
| | | success: function(o) { |
| | | if(o.responseText != '') { |
| | | if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { |
| | | var parts = o.responseText.split(":"); |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(':'); |
| | | loadContent(parts[1]); |
| | | } else { |
| | | alert(o.responseText); |
| | |
| | | |
| | | var submitFormCallback = { |
| | | success: function(o) { |
| | | if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { |
| | | var parts = o.responseText.split(":"); |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(':'); |
| | | //alert(parts[1]); |
| | | loadContent(parts[1]); |
| | | //redirect = parts[1]; |
| | |
| | | } |
| | | } |
| | | |
| | | //* Validate form. TODO: username and password with strip(); |
| | | var frm = document.getElementById(formname); |
| | | var userNameObj = frm.username; |
| | | if(userNameObj.value == ''){ |
| | | userNameObj.focus(); |
| | | return; |
| | | } |
| | | var passwordObj = frm.passwort; |
| | | if(passwordObj.value == ''){ |
| | | passwordObj.focus(); |
| | | return; |
| | | } |
| | | YAHOO.util.Connect.setForm(formname); |
| | | var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', 'content.php', submitFormCallback); |
| | | /* |
| | |
| | | |
| | | var submitFormCallback = { |
| | | success: function(o) { |
| | | if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { |
| | | var parts = o.responseText.split(":"); |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(':'); |
| | | //alert(parts[1]); |
| | | loadContent(parts[1]); |
| | | //redirect = parts[1]; |
| | |
| | | */ |
| | | } |
| | | |
| | | function submitUploadForm(formname,target) { |
| | | |
| | | var submitFormCallback = { |
| | | success: function(o) { |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(':'); |
| | | //alert(parts[1]); |
| | | loadContent(parts[1]); |
| | | //redirect = parts[1]; |
| | | //window.setTimeout('loadContent(redirect)', 1000); |
| | | } else { |
| | | document.getElementById('pageContent').innerHTML = o.responseText; |
| | | } |
| | | }, |
| | | upload: function(o) { |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(':'); |
| | | //alert(parts[1]); |
| | | loadContent(parts[1]); |
| | | //redirect = parts[1]; |
| | | //window.setTimeout('loadContent(redirect)', 1000); |
| | | } else { |
| | | document.getElementById('pageContent').innerHTML = o.responseText; |
| | | } |
| | | }, |
| | | failure: function(o) { |
| | | alert('Ajax Request was not successful. 1'); |
| | | } |
| | | } |
| | | |
| | | YAHOO.util.Connect.setForm(formname,true); |
| | | var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', target, submitFormCallback); |
| | | /* |
| | | if(redirect != '') { |
| | | loadContent(redirect); |
| | | redirect = ''; |
| | | } |
| | | */ |
| | | } |
| | | |
| | | function loadContent(pagename) { |
| | | var pageContentCallback2 = { |
| | | success: function(o) { |
| | | //alert(o.responseText); |
| | | if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { |
| | | var parts = o.responseText.split(":"); |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(':'); |
| | | loadContent(parts[1]); |
| | | } else { |
| | | document.getElementById('pageContent').innerHTML = o.responseText; |
| | |
| | | |
| | | var pageContentCallback = { |
| | | success: function(o) { |
| | | if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { |
| | | if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = o.responseText.split(":"); |
| | | loadContent(parts[1]); |
| | | } else { |