projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added helper function for setting page_security for multiusage pages.
[fa-stable.git]
/
js
/
behaviour.js
diff --git
a/js/behaviour.js
b/js/behaviour.js
index d86df13b2c924e361f6088fb08432ece5bade5fb..a5ed0480fa74a9b3845fe734b11c79f95672de0d 100644
(file)
--- a/
js/behaviour.js
+++ b/
js/behaviour.js
@@
-1,7
+1,7
@@
/*
Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work
of Simon Willison (see comments by Simon below).
/*
Behaviour v1.1 by Ben Nolan, June 2005. Based largely on the work
of Simon Willison (see comments by Simon below).
-
+ Small fixes by J.Dobrowolski for Front Accounting May 2008
Description:
Uses css selectors to apply javascript behaviours to enable
Description:
Uses css selectors to apply javascript behaviours to enable
@@
-53,14
+53,17
@@
var Behaviour = {
apply : function(){
for (h=0;sheet=Behaviour.list[h];h++){
for (selector in sheet){
apply : function(){
for (h=0;sheet=Behaviour.list[h];h++){
for (selector in sheet){
- list = document.getElementsBySelector(selector);
+ var sels = selector.split(',');
+ for (var n = 0; n < sels.length; n++) {
+ list = document.getElementsBySelector(sels[n]);
- if (!list){
+
if (!list){
continue;
continue;
- }
+
}
- for (i=0;element=list[i];i++){
+
for (i=0;element=list[i];i++){
sheet[selector](element);
sheet[selector](element);
+ }
}
}
}
}
}
}
@@
-165,7
+168,9
@@
document.getElementsBySelector = function(selector) {
continue; // Skip to next token
}
// Code to deal with attribute selectors
continue; // Skip to next token
}
// Code to deal with attribute selectors
- if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
+/* Original reg expression /^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/
+ was replaced by new RegExp() cuz compressor fault */
+ if (token.match(new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$'))) {
var tagName = RegExp.$1;
var attrName = RegExp.$2;
var attrOperator = RegExp.$3;
var tagName = RegExp.$1;
var attrName = RegExp.$2;
var attrOperator = RegExp.$3;