X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=js%2Finserts.js;h=dd78a9f607be68de748e56c8bfde841f26093e8a;hb=89cb648e9d031fa624e7814f89e90ccba2042124;hp=156882bf27891c43a254568ea6911568940928a3;hpb=3dc7f60a71b28453a8318c1d4b23b94a090f2171;p=fa-stable.git
diff --git a/js/inserts.js b/js/inserts.js
index 156882bf..dd78a9f6 100644
--- a/js/inserts.js
+++ b/js/inserts.js
@@ -13,22 +13,13 @@ var _hotkeys = {
'alt': false, // whether is the Alt key pressed
'focus': -1 // currently selected indeks of document.links
};
+var _validate = {}; // validation functions
function debug(msg) {
box = document.getElementById('msgbox')
box.innerHTML= box.innerHTML+'
'+msg
}
-function progbar() {
- box = document.getElementById('msgbox');
- box.innerHTML= "
"
- +""
- +"!["
- +user.loadtxt+"]("+user.theme+"images/progressbar.gif) |
";
- box.style.display = 'block';
-}
-
function save_focus(e) {
_focus = e.name||e.id;
var h = document.getElementById('hints');
@@ -165,26 +156,6 @@ function _set_combo_select(e) {
Behaviour definitions
*/
var inserts = {
- 'form': function(e) {
- e.onkeydown = function(ev) {
- ev = ev||window.event;
- key = ev.keyCode||ev.which;
- if((ev.ctrlKey && key == 13) || key == 27) {
- ev.cancelBubble = true;
- if(ev.stopPropagation) ev.stopPropagation();
- // activate submit/escape form
- for (var i=0; i47 && key<58) || (key>64 && key<91))) {
var n = _hotkeys.focus;
var l = document.links;
@@ -379,6 +356,27 @@ function setHotKeys() {
}
return stopEv(ev);
}
+ if((ev.ctrlKey && key == 13) || key == 27) {
+ _hotkeys.alt = false; // cancel link selection
+ _hotkeys.focus = -1;
+ ev.cancelBubble = true;
+ if(ev.stopPropagation) ev.stopPropagation();
+ // activate submit/escape form
+ for(var j=0; j=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;
}
}
-
+
Behaviour.register(inserts);
Behaviour.addLoadEvent(setFocus);