projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added german translation for install wizard.
[fa-stable.git]
/
js
/
inserts.js
diff --git
a/js/inserts.js
b/js/inserts.js
index a6365d7578d42beb5270ff288b2254b330c9a13b..4513d2e84de8c57b758c48c588c1fc4cf3df85d3 100644
(file)
--- a/
js/inserts.js
+++ b/
js/inserts.js
@@
-11,7
+11,8
@@
var _focus;
var _hotkeys = {
'alt': false, // whether is the Alt key pressed
var _focus;
var _hotkeys = {
'alt': false, // whether is the Alt key pressed
- 'focus': -1 // currently selected indeks of document.links
+ 'list': false, // list of all elements with hotkey used recently
+ 'focus': -1 // currently selected list element
};
function save_focus(e) {
};
function save_focus(e) {
@@
-26,7
+27,7
@@
function save_focus(e) {
function _expand(tabobj) {
var ul = tabobj.parentNode.parentNode;
function _expand(tabobj) {
var ul = tabobj.parentNode.parentNode;
- var alltabs=ul.getElementsByTagName("
input
");
+ var alltabs=ul.getElementsByTagName("
button
");
var frm = tabobj.form;
if (ul.getAttribute("rel")){
var frm = tabobj.form;
if (ul.getAttribute("rel")){
@@
-219,10
+220,11
@@
var inserts = {
function(e) {
e.onclick = function() {
save_focus(e);
function(e) {
e.onclick = function() {
save_focus(e);
- if (e.getAttribute('aspect') == 'process')
- JsHttpRequest.request(this, null, 60000);
- else
- JsHttpRequest.request(this);
+ var asp = e.getAttribute('aspect')
+ if (asp && asp.indexOf('process') !== -1)
+ JsHttpRequest.request(this, null, 60000);
+ else
+ JsHttpRequest.request(this);
return false;
}
},
return false;
}
},
@@
-264,7
+266,7
@@
var inserts = {
}
}
},
}
}
},
- 'button[aspect
=selector], button[aspect=abort], input[aspect=
selector]': function(e) {
+ 'button[aspect
*selector], button[aspect*abort], input[aspect*
selector]': function(e) {
e.onclick = function() {
passBack(this.getAttribute('rel'));
return false;
e.onclick = function() {
passBack(this.getAttribute('rel'));
return false;
@@
-300,7
+302,7
@@
var inserts = {
'a.printlink': function(l) {
l.onclick = function() {
save_focus(this);
'a.printlink': function(l) {
l.onclick = function() {
save_focus(this);
- JsHttpRequest.request(this);
+ JsHttpRequest.request(this
, null, 60000
);
return false;
}
},
return false;
}
},
@@
-318,11
+320,11
@@
var inserts = {
'ul.ajaxtabs': function(ul) {
var ulist=ul.getElementsByTagName("li");
for (var x=0; x<ulist.length; x++){ //loop through each LI e
'ul.ajaxtabs': function(ul) {
var ulist=ul.getElementsByTagName("li");
for (var x=0; x<ulist.length; x++){ //loop through each LI e
- var
ulistlink=ulist[x].getElementsByTagName("input
")[0];
- if(
ulistlink
.onclick==undefined) {
+ var
tab=ulist[x].getElementsByTagName("button
")[0];
+ if(
tab
.onclick==undefined) {
// ? var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
// ? var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
- var url =
ulistlink
.form.action
-
ulistlink
.onclick=function(){
+ var url =
tab
.form.action
+
tab
.onclick=function(){
_expand(this);
return false;
}
_expand(this);
return false;
}
@@
-381,24
+383,25
@@
function setHotKeys() {
return stopEv(ev);
}
else if (ev.altKey && !ev.ctrlKey && ((key>47 && key<58) || (key>64 && key<91))) {
return stopEv(ev);
}
else if (ev.altKey && !ev.ctrlKey && ((key>47 && key<58) || (key>64 && key<91))) {
+ key = String.fromCharCode(key);
var n = _hotkeys.focus;
var n = _hotkeys.focus;
- var l = document.
links
;
+ var l = document.
getElementsBySelector('[accesskey='+key+']')
;
var cnt = l.length;
var cnt = l.length;
-
key = String.fromCharCode(key)
;
+
_hotkeys.list = l
;
for (var i=0; i<cnt; i++) {
n = (n+1)%cnt;
// check also if the link is visible
if (l[n].accessKey==key && l[n].scrollWidth) {
_hotkeys.focus = n;
// The timeout is needed to prevent unpredictable behaviour on IE.
for (var i=0; i<cnt; i++) {
n = (n+1)%cnt;
// check also if the link is visible
if (l[n].accessKey==key && l[n].scrollWidth) {
_hotkeys.focus = n;
// The timeout is needed to prevent unpredictable behaviour on IE.
- var tmp = function() {
document.links
[_hotkeys.focus].focus();};
+ var tmp = function() {
l
[_hotkeys.focus].focus();};
setTimeout(tmp, 0);
break;
}
}
return stopEv(ev);
}
setTimeout(tmp, 0);
break;
}
}
return stopEv(ev);
}
- if((ev.ctrlKey && key == 13) ||
(key == 27 && ev.altKey)
) {
+ if((ev.ctrlKey && key == 13) ||
key == 27
) {
_hotkeys.alt = false; // cancel link selection
_hotkeys.focus = -1;
ev.cancelBubble = true;
_hotkeys.alt = false; // cancel link selection
_hotkeys.focus = -1;
ev.cancelBubble = true;
@@
-409,13
+412,19
@@
function setHotKeys() {
for (var i=0; i<form.elements.length; i++){
var el = form.elements[i];
var asp = el.getAttribute('aspect');
for (var i=0; i<form.elements.length; i++){
var el = form.elements[i];
var asp = el.getAttribute('aspect');
- if (el.className!='editbutton' && asp=='selector' && (key==13 || key==27)) {
+
+
+ if (el.className!='editbutton' && (asp && asp.indexOf('selector') !== -1) && (key==13 || key==27)) {
passBack(key==13 ? el.getAttribute('rel') : false);
ev.returnValue = false;
return false;
}
passBack(key==13 ? el.getAttribute('rel') : false);
ev.returnValue = false;
return false;
}
- if ((asp=='default' && key==13)||(asp=='cancel' && key==27)) {
- JsHttpRequest.request(el);
+ if (((asp && asp.indexOf('default') !== -1) && key==13)||((asp && asp.indexOf('cancel') !== -1) && key==27)) {
+
+ if (asp.indexOf('process') !== -1)
+ JsHttpRequest.request(el, null, 60000);
+ else
+ JsHttpRequest.request(el);
ev.returnValue = false;
return false;
}
ev.returnValue = false;
return false;
}
@@
-438,7
+447,7
@@
function setHotKeys() {
if (key == 18) {
_hotkeys.alt = false;
if (_hotkeys.focus>=0) {
if (key == 18) {
_hotkeys.alt = false;
if (_hotkeys.focus>=0) {
- var link =
document.links
[_hotkeys.focus];
+ var link =
_hotkeys.list
[_hotkeys.focus];
if(link.onclick)
link.onclick();
else
if(link.onclick)
link.onclick();
else