| | |
| | | if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = jqXHR.responseText.split(':'); |
| | | loadContent(parts[1]); |
| | | } else if (jqXHR.responseText.indexOf('URL_REDIRECT:') > -1) { |
| | | var newUrl= jqXHR.responseText.substr(jqXHR.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length); |
| | | document.location.href = newUrl; |
| | | } else { |
| | | alert(jqXHR.responseText); |
| | | //alert(jqXHR.responseText); |
| | | } |
| | | } |
| | | loadMenus(); |
| | |
| | | |
| | | } |
| | | |
| | | function submitForm(formname,target) { |
| | | function submitForm(formname,target) { |
| | | var submitFormObj = jQuery.ajax({ type: "POST", |
| | | url: target, |
| | | data: jQuery('#'+formname).serialize(), |
| | |
| | | */ |
| | | } |
| | | |
| | | function submitFormConfirm(formname,target,confirmation) { |
| | | if(window.confirm(confirmation)) { |
| | | var submitFormObj = jQuery.ajax({ type: "POST", |
| | | url: target, |
| | | data: jQuery('#'+formname).serialize(), |
| | | dataType: "html", |
| | | success: function(data, textStatus, jqXHR) { |
| | | if(jqXHR.responseText.indexOf('HEADER_REDIRECT:') > -1) { |
| | | var parts = jqXHR.responseText.split(':'); |
| | | //alert(parts[1]); |
| | | loadContent(parts[1]); |
| | | //redirect = parts[1]; |
| | | //window.setTimeout('loadContent(redirect)', 1000); |
| | | } else { |
| | | jQuery('#pageContent').html(jqXHR.responseText); |
| | | } |
| | | }, |
| | | error: function(jqXHR, textStatus, errorThrown) { |
| | | var parts = jqXHR.responseText.split(':'); |
| | | reportError('Ajax Request was not successful. 111'); |
| | | }, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | function submitUploadForm(formname,target) { |
| | | var handleResponse = function(loadedFrame) { |
| | | var response, responseStr = loadedFrame.contentWindow.document.body.innerHTML; |
| | |
| | | |
| | | var frame_id = 'ajaxUploader-iframe-' + Math.round(new Date().getTime() / 1000); |
| | | jQuery('body').after('<iframe width="0" height="0" style="display:none;" name="'+frame_id+'" id="'+frame_id+'"/>'); |
| | | var submitFormObj = jQuery('input[type="file"]').closest("form").attr({target: frame_id, action: target}).submit(); |
| | | jQuery('input[type="file"]').closest("form").attr({target: frame_id, action: target}).submit(); |
| | | jQuery('#'+frame_id).load(function() { |
| | | var msg = handleResponse(this); |
| | | jQuery('#errorMsg').remove(); |
| | | jQuery('#OKMsg').remove(); |
| | | jQuery('input[name="id"]').before(msg); |
| | | jQuery(this).remove(); |
| | | }); |
| | | //jQuery('#'+frame_id).remove(); |
| | | |
| | | |
| | | /* |
| | | if(redirect != '') { |
| | |
| | | } |
| | | |
| | | function del_record(link,confirmation) { |
| | | if(window.confirm(confirmation)) { |
| | | loadContent(link); |
| | | } |
| | | } |
| | | |
| | | function confirm_action(link,confirmation) { |
| | | if(window.confirm(confirmation)) { |
| | | loadContent(link); |
| | | } |
| | |
| | | } |
| | | return rv; |
| | | } |
| | | |
| | | function loadwebip(elementid,pagename) { |
| | | var pageContentObject2 = jQuery.ajax({ type: "GET", |
| | | url: pagename, |
| | | dataType: "html", |
| | | success: function(data, textStatus, jqXHR) { |
| | | var teste = jqXHR.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); |
| | | } |
| | | }, |
| | | error: function() { |
| | | reportError('Ajax Request was not successful. 119'); |
| | | }, |
| | | }); |
| | | var ruby = document.getElementById('ruby'); |
| | | ruby.style.display = 'none'; |
| | | } |
| | | |
| | | |