X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=js%2Finserts.js;h=a6d08dd952c70fe8e264c81a6f9828d1f8f2b340;hb=90c08330ed36df13b13b7bf8577a70699acf85d3;hp=1026fbf623276bfec5a80ef8cb6d0e0235890a38;hpb=4415553f170c38216804b08de6ce383f1e61d6b8;p=fa-stable.git diff --git a/js/inserts.js b/js/inserts.js index 1026fbf6..a6d08dd9 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -14,21 +14,6 @@ var _hotkeys = { 'focus': -1 // currently selected indeks of document.links }; -function debug(msg) { - box = document.getElementById('msgbox') - box.innerHTML= box.innerHTML+'
'+msg -} - -function progbar() { - box = document.getElementById('msgbox'); - box.innerHTML= "
" - +"
" - +""
-		+user.loadtxt+"

"; - box.style.display = 'block'; -} - function save_focus(e) { _focus = e.name||e.id; var h = document.getElementById('hints'); @@ -200,17 +185,36 @@ var inserts = { e.style.display = 'block'; }, // '.ajaxsubmit,.editbutton,.navibutton': // much slower on IE7 - 'button.ajaxsubmit,input.ajaxsubmit,input.editbutton,button.navibutton': + 'button.ajaxsubmit,input.ajaxsubmit,input.editbutton,button.editbutton,button.navibutton': function(e) { - e.onclick = function() { - if (this.getAttribute('aspect') == 'process') - progbar(); - save_focus(this); - JsHttpRequest.request(this); - return false; - } + e.onclick = function() { + save_focus(e); + if (e.getAttribute('aspect') == 'process') + JsHttpRequest.request(this, null, 30000); + else + JsHttpRequest.request(this); + return false; + } + }, +/* 'button': function(e) { + if (e.name) { + var func = _validate[e.name]; + var old = e.onclick; + if(func) { + if (typeof old != 'function') { + e.onclick = func; + } else { + e.onclick = function() { + if(func()) + { old(); return true;} + else + return false; + } + } + } + } }, - '.amount': function(e) { +*/ '.amount': function(e) { if(e.onblur==undefined) { e.onblur = function() { var dec = this.getAttribute("dec"); @@ -296,11 +300,11 @@ var inserts = { } }, -*/ '#msgbox': function(e) { +*//* '#msgbox': function(e) { // this is to avoid changing div height after ajax update in IE7 e.style.display = e.innerHTML.length ? 'block' : 'none'; } -/* TODO +*//* TODO 'a.date_picker': function(e) { // this un-hides data picker for js enabled browsers e.href = date_picker(this.getAttribute('rel')); @@ -378,14 +382,17 @@ function setHotKeys() { _hotkeys.alt = false; if (_hotkeys.focus>=0) { var link = document.links[_hotkeys.focus]; - if (link.target=='_blank') { -// window.open(link.href,'','toolbar=no,scrollbar=no,resizable=yes,menubar=no,width=900,height=500'); - openWindow(link.href,'_blank'); - } else - window.location = link.href; + if(link.onclick) + link.onclick(); + else + if (link.target=='_blank') { + window.open(link.href,'','toolbar=no,scrollbar=no,resizable=yes,menubar=no,width=900,height=500'); + openWindow(link.href,'_blank'); + } else + window.location = link.href; } - } return stopEv(ev); + } } return true; }