1 kukit
=new function(){var ku
=this;ku
.isDevelMode
=false;var _isKineticStylesheet=function(node
){var rel
=node
.rel
;if(node
.getAttribute("data-rel")!=null){rel
=node
.getAttribute("data-rel")}
2 if(rel
=="kinetic-stylesheet"){return true}
3 if(rel
=="kukit"||rel
=="k-stylesheet"){return true}
4 return false};var _RuleSheetLink=function(href
,res_type
){this.href
=href
;this.res_type
=res_type
};ku
.Engine=function(){this.initialize=function(){this.documentRules
=new kukit
.rd
.MethodTable();this._ruleProcessorClasses
={};this._ruleProcessorClasses
.kss
=kukit
.kssp
.KssRuleProcessor
;this._ruleProcessors
=[];this.bindScheduler
=new kukit
.ut
.SerializeScheduler();this.stateVariables
={};this.requestManager
=new kukit
.rm
.RequestManager();this.binderInfoRegistry
=new kukit
.er
.BinderInfoRegistry();this.loadScheduler
=new kukit
.rd
.LoadActions();this.initializedOnDOMLoad
=false;this.setupEventsQueue
=[];this.setupEventsInProgress
=false;this.baseUrl
=this.calculateBase()};this.calculateBase=function(){var base
='';try{var _dummy
=document
;_dummy
=window
} catch(e
){return base
}
5 base
=kukit
.ut
.calculateBase(document
,window
.location
.href
);return base
};this.getRuleSheetLinks=function(){var nodes
=document
.getElementsByTagName("link");var results
=[];for(var i
=0;i
<nodes
.length
;i
++){if(_isKineticStylesheet(nodes
[i
])){var res_type
=null;if((nodes
[i
].type
=='text/css')||(nodes
[i
].type
=='text/kss')){res_type
='kss'}
6 var newRuleLink
=new _RuleSheetLink(nodes
[i
].href
,res_type
);results
[results
.length
]=newRuleLink
}}
7 return results
};this.createRuleProcessor=function(rulelink
){var _RuleProcessorClass
=this._ruleProcessorClasses
[rulelink
.res_type
];if(_RuleProcessorClass
){var ruleprocessor
=new _RuleProcessorClass(rulelink
.href
);this._ruleProcessors
[this._ruleProcessors
.length
]=ruleprocessor
;return ruleprocessor
}
8 return null};this.getRules=function(){var rules
=[];var ruleProcessors
=this._ruleProcessors
;for(var j
=0;j
<ruleProcessors
.length
;j
++){var ruleProcessor
=ruleProcessors
[j
];for(var i
=0;i
<ruleProcessor
.rules
.length
;i
++){rules
.push(ruleProcessor
.rules
[i
])}}
9 return rules
};this.getRuleProcessors=function(){return this._ruleProcessors
};this.setupEvents=function(inNodes
){if(this.setupEventsInProgress
){this.setupEventsQueue
=this.setupEventsQueue
.concat(inNodes
)} else{this.doSetupEvents(inNodes
)}};this.beginSetupEventsCollection=function(){this.setupEventsInProgress
=true};this.finishSetupEventsCollection=function(){this.setupEventsInProgress
=false;var setupEventsQueue
=this.setupEventsQueue
;this.setupEventsQueue
=[];this.doSetupEvents(setupEventsQueue
)};this.doSetupEvents=function(inNodes
){var self
=this;var deferredEventsSetup=function(){self
._setupEvents(inNodes
)};var found
=false;if(!inNodes
){found
=true} else{for(var i
=0;i
<inNodes
.length
;i
++){var node
=inNodes
[i
];if(node
.nodeType
==1){if(!found
){found
=true}}}}
10 if(found
){var remark
='';this.bindScheduler
.addPre(deferredEventsSetup
,remark
)}};this._setupEvents=function(inNodes
){var phase
;if(typeof(inNodes
)=='undefined'){phase
=1} else{phase
=2}
11 this.binderInfoRegistry
.startBindingPhase();var rules
=this.getRules();var ruletable
=new kukit
.rd
.RuleTable(this.loadScheduler
);for(var y
=0;y
<rules
.length
;y
++){rules
[y
].mergeForSelectedNodes(ruletable
,phase
,inNodes
)}
12 if(phase
==1){this.documentRules
.bindall(phase
)}
13 ruletable
.bindall(phase
);this.binderInfoRegistry
.processBindingEvents()};this.initializeRules=function(){if(window
.kukitRulesInitializing
||window
.kukitRulesInitialized
){return}
14 kukit
.engine
=this;window
.kukitRulesInitializing
=true;var rulelinks
=this.getRuleSheetLinks();for(var i
=0;i
<rulelinks
.length
;i
++){var rulelink
=rulelinks
[i
];var ruleprocessor
=this.createRuleProcessor(rulelink
);if(ruleprocessor
){ruleprocessor
.load();ruleprocessor
.parse()}}
15 this.setupEvents();window
.kukitRulesInitializing
=false;window
.kukitRulesInitialized
=true};this.initialize
.apply(this,arguments
)};ku
.initializeRules=function(){kukit
.bootstrap()};ku
.bootstrap=function(){var engine
=new kukit
.Engine();engine
.initializeRules()};ku
.bootstrapFromDOMLoad=function(){var engine
=new kukit
.Engine();engine
.initializedOnDOMLoad
=true;engine
.initializeRules()}}();if(typeof(kukit
)=='undefined'){var kukit
={}}
16 kukit
.E
='Unknown message (kss optimized for production mode)';try{kukit
.HAVE_SAFARI
=navigator
.vendor
&&navigator
.vendor
.indexOf('Apple')!=-1;kukit
.HAVE_IE
=eval("_SARISSA_IS_IE")} catch(e
){}
17 kukit
.readCookie=function(name
){var nameEQ
=name
+"=";var ca
=document
.cookie
.split(';');for(var i
=0;i
<ca
.length
;i
++){var c
=ca
[i
];while(c
.charAt(0)==' ') c
=c
.substring(1,c
.length
);if(c
.indexOf(nameEQ
)==0) return c
.substring(nameEQ
.length
,c
.length
)}
18 return null};kukit
._null=function(){};kukit
._COOKIE_LOGLEVEL
='__kss_loglevel';kukit
._logger
=new function(){this.updateLogLevel=function(){this._setupHandlers()};this._setupHandlers=function(){this.logDebug
=kukit
._null
;this.log
=kukit
._null
;this.logWarning
=kukit
._null
;this.logError
=kukit
._null
;this.logFatal
=kukit
._null
}}();kukit
.logDebug=function(message
){kukit
._logger
.logDebug(message
)};kukit
.log=function(message
){kukit
._logger
.log(message
)};kukit
.logWarning=function(message
){kukit
._logger
.logWarning(message
)};kukit
.logError=function(message
){kukit
._logger
.logError(message
)};kukit
.logFatal=function(message
){kukit
._logger
.logFatal(message
)};kukit
.setLogLevel=function(level
){};kukit
._logger
.updateLogLevel();kukit
.ut
=new function(){var ut
=this;ut
.FifoQueue=function(){this.initialize=function(){this.reset()};this.reset=function(){this.elements
=new Array()};this.push=function(obj
){this.elements
.push(obj
)};this.pop=function(){return this.elements
.shift()};this.empty=function(){return!this.elements
.length
};this.size=function(){return this.elements
.length
};this.front=function(){return this.elements
[0]};this.initialize
.apply(this,arguments
)};ut
.SortedQueue=function(){this.initialize=function(comparefunc
){if(comparefunc
){this.comparefunc
=comparefunc
}
19 this.reset()};this.comparefunc=function(a
,b
){if(a
<b
){return-1} else if(a
>b
){return+1} else{return 0}};this.reset=function(){this.elements
=new Array()};this.push=function(obj
){var i
=0;var length
=this.elements
.length
;while(i
<length
&&this.comparefunc(this.elements
[i
],obj
)==-1){i
++}
20 this.elements
.splice(i
,0,obj
)};this.pop=function(){return this.elements
.shift()};this.popn=function(n
){return this.elements
.splice(0,n
)};this.empty=function(){return!this.elements
.length
};this.size=function(){return this.elements
.length
};this.get=function(n
){return this.elements
[n
]};this.front=function(){return this.elements
[0]};this.initialize
.apply(this,arguments
)};ut
.evalBool=function(value
,errname
){if(value
=='true'||value
=='True'||value
=='1'){value
=true} else if(value
=='false'||value
=='False'||value
=='0'||value
==''){value
=false}
21 return value
};ut
.evalInt=function(value
,errname
){value
=parseInt(value
);return value
};ut
.evalList=function(value
,errname
){value
=value
.replace(/^ +/,'');value
=value
.replace(/ +$/,'');if(value==''){value=[]} else{value=value.split(/ *, */
)}
22 return value
};ut
.TimerCounter=function(){this.initialize=function(delay
,func
,restart
){this.delay
=delay
;this.func
=func
;if(typeof(restart
)=='undefined'){restart
=false}
23 this.restart
=restart
;this.timer
=null};this.start=function(){if(this.timer
){throw new Error(kukit
.E
)}
24 var self
=this;var func=function(){self
.timeout()};this.timer
=setTimeout(func
,this.delay
)};this.timeout=function(){this.func();if(this.restart
){this.timer
=null;this.start()}};this.clear=function(){if(this.timer
){window
.clearTimeout(this.timer
);this.timer
=null}
25 this.restart
=false};this.initialize
.apply(this,arguments
)};ut
.Scheduler=function(){this.initialize=function(func
){this.func
=func
;this.timer
=null;this.nextWake
=null};this.setNextWake=function(ts
){if(this.nextWake
){this.clear()}
27 var now
=(new Date()).valueOf();if(ts
>now
){this.nextWake
=ts
;var self
=this;var func=function(){self
.timeout()};this.timer
=setTimeout(func
,ts
-now
)} else{this.func()}};this.setNextWakeAtLeast=function(ts
){if(!ts
||!this.nextWake
||ts
<this.nextWake
){this.setNextWake(ts
)} else{var now
=(new Date()).valueOf()}};this.timeout=function(){this.timer
=null;this.nextWake
=null;this.func()};this.clear=function(){if(this.nextWake
){window
.clearTimeout(this.timer
);this.timer
=null;this.nextWake
=null}};this.initialize
.apply(this,arguments
)};ut
.SerializeScheduler=function(){this.initialize=function(){this.items
=[];this.lock
=false};this.addPre=function(func
,remark
){this.items
.push({func
:func
,remark
:remark
});this.execute()};this.addPost=function(func
,remark
){this.items
.unshift({func
:func
,remark
:remark
});this.execute()};this.execute=function(){if(!this.lock
){this.lock
=true;while(true){var item
=this.items
.pop();if(!item
){break}
28 try{item
.func()} catch(e
){this.lock
=false;throw e
}}
29 this.lock
=false}};this.initialize
.apply(this,arguments
)};ut
.registerEventListener=function(elem
,event
,func
){if(elem
.addEventListener
){elem
.addEventListener(event
,func
,false);return true} else if(elem
.attachEvent
){var result
=elem
.attachEvent("on"+event
,func
);return result
}
30 return false};if(typeof(window
)!='undefined'){ut
.registerEventListener(window
,"load",kukit
.bootstrap
)}
31 ut
.DictCollector=function(){this.initialize=function(){this.result
={}};this.add=function(key
,value
){this.result
[key
]=value
};this.initialize
.apply(this,arguments
)};ut
.TupleCollector=function(){this.initialize=function(){this.result
=[]};this.add=function(key
,value
){this.result
.push([key
,value
])};this.initialize
.apply(this,arguments
)};ut
.calculateBase=function(documentInstance
,pageLocation
){var base
='';var nodes
=documentInstance
.getElementsByTagName("link");if(nodes
.length
>0){for(var i
=0;i
<nodes
.length
;i
++){var link
=nodes
[i
];if((link
.rel
=='kss-base-url')||(link
.rel
=='alternate'&&link
.getAttribute('data-kss-base-url')!=null)){var base
=link
.href
;if(!/\/$/.test(base
)){base
=base
+'/'}}}}
32 if(!base
){nodes
=documentInstance
.getElementsByTagName("base");if(nodes
.length
!=0){var base
=nodes
[0].href
} else{var base
=pageLocation
}}
33 var pieces
=base
.split('/');pieces
.pop();base
=pieces
.join('/')+'/';return base
}}();kukit
.err
=new function(){var err
=this;var ErrorAnnotation=function(){this.constructError=function(e
,name
,message
,kw
){this.kw
=kw
;if(!e
){e
=new Error(kukit
.E
)}
34 e
.name
=name
;e
.info
=this;return e
}};var setErrorInfo=function(e
,name
,message
,kw
){return new ErrorAnnotation().constructError(e
,name
,message
,kw
)};err
.explicitError=function(errorcommand
){var kw
={'errorcommand':errorcommand
};return setErrorInfo(null,'ExplicitError',kukit
.E
,kw
)};err
.responseParsingError=function(message
){return setErrorInfo(null,'ResponseParsingError',message
)};err
.parsingError=function(message
,cursor
){var kw
={};return setErrorInfo(null,'ParsingError',message
,kw
)}}();kukit
.op
=new function(){var op
=this;op
.Oper=function(){this.initialize=function(dict
){this.node
=null;this.parms
={};this.eventRule
=null;this.binder
=null;this.orignode
=null;this.action
=null;this.browserevent
=null;this.clone=function(dict
,restricted
){var newoper
=new kukit
.op
.Oper(this);newoper
.unrestrictedUpdate(dict
,restricted
);return newoper
};this.update=function(dict
){this.unrestrictedUpdate(dict
,true)};this.unrestrictedUpdate=function(dict
,restricted
){if(typeof(dict
)=='undefined'){return}
35 for(var key
in dict
){var value
=dict
[key
];if(typeof(value
)!='function'){this[key
]=value
}}};this.unrestrictedUpdate(dict
)};this.clone=function(dict
,restricted
){var newoper
=new kukit
.op
.Oper(this);newoper
.unrestrictedUpdate(dict
,restricted
);return newoper
};this.update=function(dict
){this.unrestrictedUpdate(dict
,true)};this.unrestrictedUpdate=function(dict
,restricted
){if(typeof(dict
)=='undefined'){return}
36 for(var key
in dict
){var value
=dict
[key
];if(typeof(value
)!='function'){this[key
]=value
}}};this.logDebug=function(){};this.executeClientAction=function(name
){var nodes
=null;for(key
in this.kssParms
){switch(key
){case 'kssSelector':{nodes
=this.kssParms
[key
]} break;default:{throw new Error(kukit
.E
)} break}}
37 var executeActions
=kukit
.actionsGlobalRegistry
.get(name
);if(nodes
!=null){for(var i
=0;i
<nodes
.length
;i
++){this.node
=nodes
[i
];executeActions(this)}} else{executeActions(this)}};this.executeDefaultAction=function(name
,optional
){var namespace=this.binder
.__eventNamespace__
;var kssevent
=kukit
.eventsGlobalRegistry
.get(namespace,name
);var methodName
=kssevent
.defaultActionMethodName
;var success
=false;if(!methodName
){} else{if(typeof(this.defaultParameters
)!='undefined'){this.parms
=this.defaultParameters
} else{this.parms
={}}
38 this.binder
.callMethod(namespace,name
,this,methodName
);success
=true}
39 return success
};this.executeServerAction=function(name
){for(key
in this.kssParms
){if(key
=='kssSubmitForm'){var formQuery
=this.kssParms
[key
];if(typeof(formQuery
)=='string'){var locator
=new kukit
.fo
.NamedFormLocator(formQuery
);var collector
=new kukit
.ut
.TupleCollector();formQuery
=kukit
.fo
.getAllFormVars(locator
,collector
)}}}
40 var sa
=new kukit
.sa
.ServerAction(name
,this)};this.getEventName=function(){return this.eventRule
.kssSelector
.name
};this.getEventNamespace=function(){return this.eventRule
.kssSelector
.namespace};this.hasExecuteActions=function(){if(this.eventRule
){if(this.eventRule
.actions
.hasActions())
41 return true;var kssevent
=kukit
.eventsGlobalRegistry
.get(this.getEventNamespace(),this.getEventName());var methodName
=kssevent
.defaultActionMethodName
;return(typeof methodName
!='undefined')} else
42 return false};this.makeExecuteActionsHook=function(filter
){if(!this.hasExecuteActions()){return function(){}}
43 var eventName
=this.getEventName();var self
=this;var func_to_bind=function(dict
){var newoper
=self
.clone(dict
,true);if(filter
&&!filter(newoper
)) return false;newoper
.binder
.triggerEvent(eventName
,newoper
);return true};return func_to_bind
};this.evaluateParameters=function(mandatory
,defaults
,errname
,allow_excess
){var newParameters
={};for(var i
=0;i
<mandatory
.length
;i
++){var next
=mandatory
[i
];newParameters
[next
]=this.parms
[next
]}
44 for(var key
in defaults
){var val
=this.parms
[key
];if(typeof(val
)=='undefined'){newParameters
[key
]=defaults
[key
]} else{newParameters
[key
]=val
}}
45 for(var key
in this.parms
){if(typeof(newParameters
[key
])=='undefined'){newParameters
[key
]=this.parms
[key
]}}
46 this.parms
=newParameters
};this.completeParms=function(mandatory
,defaults
,errname
,allow_excess
){this.evaluateParameters(mandatory
,defaults
,errname
,allow_excess
)};this.evalBool=function(key
,errname
){var value
=this.parms
[key
];this.parms
[key
]=kukit
.ut
.evalBool(value
,kukit
.E
)};this.evalInt=function(key
,errname
){var value
=this.parms
[key
];this.parms
[key
]=kukit
.ut
.evalInt(value
,kukit
.E
)};this.evalList=function(key
,errname
){var value
=this.parms
[key
];this.parms
[key
]=kukit
.ut
.evalList(value
,kukit
.E
)};this.initialize
.apply(this,arguments
)}}();kukit
.tk
=new function(){var tk
=this;tk
._TokenBase=function(){this.emitError=function(msg
){throw new Error(kukit
.E
)};this.updateFinished=function(){if(!this.finished
&&this.cursor
.text
.length
==this.cursor
.pos
){if(this.isTopLevelParser
){this.finished
=true} else{this.emitError(kukit
.E
)}}}};tk
._ParserBase=function(){this.initialize=function(){};this.emitAndReturn=function(token
){this.finished
=true;return token
};this.nextStep=function(){var table
=this.table
;var cursor
=this.cursor
;var best_pos
=cursor
.text
.length
;var best_symbol
=null;for(var symbol
in table
){var pos
=cursor
.text
.indexOf(symbol
,cursor
.pos
);if(pos
!=-1&&pos
<best_pos
){best_pos
=pos
;best_symbol
=symbol
}};if(best_pos
>cursor
.pos
){this.result
.push(new tk
.Fraction(cursor
,best_pos
));cursor
.pos
=best_pos
};if(best_symbol
){var tokens
=table
[best_symbol
].call(this);if(typeof(tokens
)!='undefined'){if(typeof(tokens
.length
)=='undefined'){tokens
=[tokens
]};for(var i
=0;i
<tokens
.length
;i
++){this.result
.push(tokens
[i
])}}}};this.process=function(){this.txt
='';for(var i
=0;i
<this.result
.length
;i
++){this.txt
+=this.result
[i
].txt
}};this.expectToken=function(context
,token
){var i
=context
.nextTokenIndex
;if(token
){var symbol
=token
.prototype.symbol
;if(i
>=this.result
.length
){this.emitError(kukit
.E
)} else if(this.result
[i
].symbol
!=symbol
){this.emitError(kukit
.E
)}} else{if(i
>=this.result
.length
){this.emitError(kukit
.E
)}}
47 context
.token
=this.result
[i
];context
.nextTokenIndex
+=1};this.resultIsNullOrNotToken=function(token
,currentValue
){return(!token
||currentValue
.symbol
!=token
.prototype.symbol
)};this.notInTokens=function(context
,token1
,token2
,token3
,token4
){var i
=context
.nextTokenIndex
;var currentValue
=this.result
[i
];return!((i
>=this.result
.length
)||(this.resultIsNullOrNotToken(token1
,currentValue
)&&this.resultIsNullOrNotToken(token2
,currentValue
)&&this.resultIsNullOrNotToken(token3
,currentValue
)&&this.resultIsNullOrNotToken(token4
,currentValue
)))};this.digestTxt=function(context
,token1
,token2
,token3
,token4
){this.digestExactTxt(context
,token1
,token2
,token3
,token4
);context
.txt
=this.removeWhitespacesAndTrim(context
.txt
)};this.digestExactTxt=function(context
,token1
,token2
,token3
,token4
){var result
='';while(this.notInTokens(context
,token1
,token2
,token3
,token4
)){result
+=this.result
[context
.nextTokenIndex
].txt
;context
.nextTokenIndex
++}
48 context
.txt
=result
};this.removeWhitespaces=function(txt
){if(txt
!=' '){txt
=txt
.replace(/[\r\n\t ]+/g,' ')}
49 return txt
};this.removeWhitespacesAndTrim=function(txt
){txt
=this.removeWhitespaces(txt
);if(txt
&&txt
.charAt(0)==' '){txt
=txt
.substr(1)}
50 txt
=txt
.replace(/ $/,'');return txt
}};tk
._ParserBase
.prototype=new tk
._TokenBase();tk
.Fraction=function(){this.initialize=function(cursor
,endpos
){this.txt
=cursor
.text
.substring(cursor
.pos
,endpos
);this.startpos
=cursor
.pos
;this.endpos
=cursor
.pos
;this.finished
=true};this.initialize
.apply(this,arguments
)};tk
.Fraction
.prototype.symbol
='fraction';tk
.mkToken=function(symbol
,txt
){f=function(cursor
){this.cursor
=cursor
;this.startpos
=cursor
.pos
;if(cursor
.text
.substr(cursor
.pos
,txt
.length
)!=txt
){this.emitError(kukit
.E
)} else{cursor
.pos
+=txt
.length
;this.finished
=true}
51 this.endpos
=cursor
.pos
};f
.prototype=new tk
._TokenBase();f
.prototype.symbol
=symbol
;f
.prototype.txt
=txt
;return f
};tk
.mkParser=function(symbol
,table
,_class
){f=function(cursor
,tokenClass
,isTopLevelParser
){this.table
=table
;this.cursor
=cursor
;this.startpos
=cursor
.pos
;this.finished
=false;this.isTopLevelParser
=isTopLevelParser
;this.result
=[];if(tokenClass
){this.result
.push(new tokenClass(this.cursor
))}
52 this.updateFinished();while(!this.finished
){this.nextStep();this.updateFinished()}
53 this.endpos
=cursor
.pos
;this.initialize
.apply(this,arguments
);this.process()};f
.prototype=new tk
._ParserBase();var _prototype
=new _class();for(key
in _prototype
){f
.prototype[key
]=_prototype
[key
]}
54 f
.prototype.symbol
=symbol
;return f
};tk
.Cursor=function(){this.initialize=function(txt
){this.text
=txt
;this.pos
=0};this.makeMarker=function(pos
){var cursor
=new tk
.Cursor();cursor
.text
=this.text
;cursor
.pos
=pos
;cursor
.calcRowCol();return cursor
};this.getRowCol=function(pos
){if(typeof(pos
)=='undefined'){pos
=this.pos
}
55 var index
=0;var row
=1;var next
=0;while(true){next
=this.text
.indexOf('\n',index
);if(next
==-1||next
>=pos
){break}
57 var col
=pos
-index
+1;return{'row':row
,'col':col
}};this.calcRowCol=function(pos
){var rowcol
=this.getRowCol();this.row
=rowcol
.row
;this.col
=rowcol
.col
};this.initialize
.apply(this,arguments
)}}();kukit
.pr
=new function(){var pr
=this;pr
.ValueProviderRegistry=function(){this.initialize=function(){this.content
={}};this.register=function(name
,func
,returnType
){if(typeof(func
)=='undefined'){throw new Error(kukit
.E
)}
58 this.content
[name
]=func
;func
.prototype.returnType
=returnType
};this.exists=function(name
){var entry
=this.content
[name
];return(typeof(entry
)!='undefined')};this.get=function(name
){var func
=this.content
[name
];if(!func
){throw new Error(kukit
.E
)}
59 return func
};this.initialize
.apply(this,arguments
)}}();kukit
.dummy
=new function(){var _IdentityPP=function(){this.check=function(args
){};this.eval=function(args
,node
){return args
[0]}};var _FormVarPP=function(){this.check=function(args
){};this.eval=function(args
,node
){return kukit
.fo
.getFormVar(new kukit
.fo
.NamedFormLocator(args
[0]),args
[1])}};var _CurrentFormVarPP=function(){this.check=function(args
){};this.eval=function(args
,node
){if(args
.length
==1){return kukit
.fo
.getFormVar(new kukit
.fo
.CurrentFormLocator(node
),args
[0])} else{return kukit
.fo
.getValueOfFormElement(node
)}}};var _CurrentFormVarFromKssAttrPP=function(){this.check=function(args
){};this.eval=function(args
,node
){var argname
=args
[0];var recurseParents
=false;if(args
.length
==2){recurseParents
=kukit
.ut
.evalBool(args
[1],kukit
.E
)}
60 var formvarname
=kukit
.dom
.getRecursiveAttribute(node
,argname
,recurseParents
,kukit
.dom
.getKssAttribute
);return kukit
.fo
.getFormVar(new kukit
.fo
.CurrentFormLocator(node
),formvarname
)}};var _NodeAttrPP=function(){this.check=function(args
){};this.eval=function(args
,node
){var argname
=args
[0]};this.eval=function(args
,node
){var argname
=args
[0];var recurseParents
=false;if(args
.length
==2){recurseParents
=args
[1];recurseParents
=kukit
.ut
.evalBool(recurseParents
,kukit
.E
)}
61 return kukit
.dom
.getRecursiveAttribute(node
,argname
,recurseParents
,kukit
.dom
.getAttribute
)}};var _KssAttrPP=function(){this.check=function(args
){};this.eval=function(args
,node
){var argname
=args
[0];var recurseParents
=false};this.eval=function(args
,node
){var argname
=args
[0];var recurseParents
=false;if(args
.length
==2){recurseParents
=args
[1];recurseParents
=kukit
.ut
.evalBool(recurseParents
,kukit
.E
)}
62 return kukit
.dom
.getRecursiveAttribute(node
,argname
,recurseParents
,kukit
.dom
.getKssAttribute
)}};var _NodeContentPP=function(){this.check=function(args
){};this.eval=function(args
,node
){var recursive
=false;if(args
.length
==1){recursive
=args
[0]}
63 return kukit
.dom
.textContent(node
,recursive
)}};var _StateVarPP=function(){this.check=function(args
){};this.eval=function(args
,node
){var key
=args
[0];var value
=kukit
.engine
.stateVariables
[key
];if(typeof(value
)=='undefined'){throw new Error(kukit
.E
)}
64 return value
}};var _PassPP=function(){this.check=function(args
){};this.eval=function(args
,node
,defaultParameters
){var key
=args
[0];var value
=defaultParameters
[key
];if(typeof(value
)=='undefined'){throw new Error(kukit
.E
)}
65 return value
}};var _UrlPP=function(){this.check=function(args
){}};_UrlPP
.prototype=new _IdentityPP();var _AliasPP=function(){this.check=function(args
){}};_AliasPP
.prototype=new _IdentityPP();kukit
.pprovidersGlobalRegistry
=new kukit
.pr
.ValueProviderRegistry();kukit
.pprovidersGlobalRegistry
.register('',_IdentityPP
);kukit
.pprovidersGlobalRegistry
.register('currentFormVar',_CurrentFormVarPP
);kukit
.pprovidersGlobalRegistry
.register('currentFormVarFromKssAttr',_CurrentFormVarFromKssAttrPP
);kukit
.pprovidersGlobalRegistry
.register('formVar',_FormVarPP
);kukit
.pprovidersGlobalRegistry
.register('kssAttr',_KssAttrPP
);kukit
.pprovidersGlobalRegistry
.register('stateVar',_StateVarPP
);kukit
.pprovidersGlobalRegistry
.register('pass',_PassPP
);kukit
.pprovidersGlobalRegistry
.register('nodeContent',_NodeContentPP
);kukit
.pprovidersGlobalRegistry
.register('nodeAttr',_NodeAttrPP
);kukit
.pprovidersGlobalRegistry
.register('url',_UrlPP
,'url');kukit
.pprovidersGlobalRegistry
.register('alias',_AliasPP
,'alias')}();kukit
.rd
=new function(){var rd
=this;rd
.KssSelector=function(){this.initialize=function(isEvent
,css
,name
,namespace,id
,ppid
){this.isEventSelector
=isEvent
;this.isMethodSelector
=!isEvent
;this.css
=css
;this.name
=name
;this.namespace=namespace;this.className
=null;this.id
=id
;this.ppid
=ppid
;this.setClassName()};this.setClassName=function(){try{this.className
=kukit
.eventsGlobalRegistry
.get(this.namespace,this.name
).className
} catch(e
){throw kukit
.err
.parsingError(e
.message
)}};this.prepareId=function(){if(this.ppid
==null){if(this.id
==null&&this.ppid
==null){this.id
=kukit
.er
.makeId(this.namespace,this.className
)}
66 this.mergeId
=kukit
.er
.makeMergeId(this.id
,this.namespace,this.name
)}};this.getId=function(node
){if(this.id
){return this.id
} else{var id
=this.ppid
.pprovider
.eval(this.ppid
.args
,node
,{});if(!id
){}
67 return id
}};this.getMergeId=function(node
){if(this.mergeId
){return this.mergeId
} else{var id
=this.getId(node
);this.mergeId
=kukit
.er
.makeMergeId(id
,this.namespace,this.name
)}};this.initialize
.apply(this,arguments
)};rd
.KssTextValue=function(txt
){this.initialize=function(txt
){this.txt
=txt
};this.check=function(registry
){this.pprovider
=new(kukit
.pprovidersGlobalRegistry
.get(''))()};this.evaluate=function(node
,defaultParameters
){return this.pprovider
.eval([this.txt
],node
,defaultParameters
)};this.initialize
.apply(this,arguments
)};rd
.KssTextValue
.prototype.isMethod
=false;rd
.KssMethodValue=function(){this.initialize=function(methodName
,args
){this.methodName
=methodName
;this.args
=args
};this.check=function(registry
){var f
=kukit
.pprovidersGlobalRegistry
.get(this.methodName
);this.pprovider
=new f();for(var i
=0;i
<this.args
.length
;i
++){var arg
=this.args
[i
];if(arg
.check
){arg
.check()}}};this.evaluate=function(node
,defaultParameters
){var newArgs
=[];for(var i
=0;i
<this.args
.length
;i
++){var arg
=this.args
[i
];if(arg
.evaluate
){newArgs
.push(arg
.evaluate(node
,defaultParameters
))} else{newArgs
.push(arg
)}}
68 return this.pprovider
.eval(newArgs
,node
,defaultParameters
)};this.initialize
.apply(this,arguments
)};rd
.KssMethodValue
.prototype.isMethod
=true;rd
.KssEventValue=function(methodName
,arg
){this.methodName
=methodName
;this.arg
=arg
;this.check=function(){}};rd
.KssEventValue
.prototype.isMethod
=true;rd
.EventRuleNr
=0;rd
.EventRule=function(){this.initialize=function(kssSelector
,parms
,actions
){if(typeof(parms
)=='undefined'){this.kssSelector
=kssSelector
} else{this.index
=rd
.EventRuleNr
;this.mergedIndex
=null;rd
.EventRuleNr
=this.index
+1;this.kssSelector
=kssSelector
;this.parms
=parms
;this.actions
=actions
}};this.getIndex=function(){if(this.mergedIndex
){return this.mergedIndex
} else{return this.index
}};this.mergeForSelectedNodes=function(ruletable
,phase
,inNodes
){if(this.kssSelector
.isEventSelector
){var nodes
=kukit
.dom
.cssQuery(this.kssSelector
.css
,inNodes
);var counter
=0;for(var y
=0;y
<nodes
.length
;y
++){var node
=nodes
[y
];if(typeof(node
._kukitMark
)=='undefined'){ruletable
.add(node
,this);counter
+=1}}} else if(typeof(inNodes
)=='undefined'){kukit
.engine
.documentRules
.add(this)}};this.getBinderInfo=function(node
){var id
=this.kssSelector
.getId(node
);return kukit
.engine
.binderInfoRegistry
.getOrCreateBinderInfo(this.kssSelector
.id
,this.kssSelector
.className
,this.kssSelector
.namespace)};this.bind=function(node
){this.store(node
);var oper
=new kukit
.op
.Oper();var binderInfo
=this.getBinderInfo(node
);oper
.node
=node
;oper
.eventRule
=this;oper
.binder
=binderInfo
.binder
;oper
.parms
=this.parms
;binderInfo
.bindOper(oper
)};this.store=function(node
){if(node
==null){return}
69 if(typeof(node
.kukitEventRules
)=='undefined'){var rules
=[];node
.kukitEventRules
=rules
}
70 node
.kukitEventRules
.push(this)};this.isMerged=function(){return(this.mergedIndex
!=null)};this.cloneForMerge=function(){var merged
=new rd
.EventRule(this.kssSelector
);merged
.actions
=new rd
.ActionSet();merged
.parms
={};merged
.mergedIndex
='X';merged
.merge(this);merged
.mergedIndex
=this.getIndex();return merged
};this.merge=function(other
){this.mergedIndex
=this.mergedIndex
+','+other
.getIndex();for(var key
in other
.parms
){this.parms
[key
]=other
.parms
[key
]}
71 this.actions
.merge(other
.actions
)};this.mergeIntoDict=function(dict
,key
){var mergedRule
=dict
[key
];if(typeof(mergedRule
)=='undefined'){dict
[key
]=this} else{if(!mergedRule
.isMerged()){mergedRule
=mergedRule
.cloneForMerge();dict
[key
]=mergedRule
}
72 mergedRule
.merge(this)}};this.initialize
.apply(this,arguments
)};rd
.ActionSet=function(){this.initialize=function(){this.content
={}};this.hasActions=function(){for(var name
in this.content
){return true}
73 return false};this.merge=function(other
){for(var key
in other
.content
){var action
=this.content
[key
];var action2
=other
.content
[key
];if(typeof(action
)=='undefined'){if(action2
.type
!='X'){action
=new _Action();this.content
[key
]=action
} else{throw new Error(kukit
.E
)}}
74 if(action2
.type
!='X'){action
.merge(action2
)} else{this.deleteAction(key
)}}};this.execute=function(oper
){for(var key
in this.content
){var action
=this.content
[key
];if(action
.type
!='E'){action
.execute(oper
)}}
75 if(typeof(this.content
['default'])=='undefined'){var name
=oper
.eventRule
.kssSelector
.name
;oper
=oper
.clone({'parms':{}});oper
.executeDefaultAction(name
,true)}};this.getOrCreateAction=function(name
,valuesByReturnType
){var nameOverride
;if(valuesByReturnType
.alias
){nameOverride
=name
;name
=valuesByReturnType
.alias
.args
[0]}
76 var action
=this.content
[name
];if(typeof(action
)=='undefined'){action
=new _Action();action
.setName(name
,nameOverride
);this.content
[name
]=action
}
77 if(valuesByReturnType
.selection
){action
.parms
.kssSelector
=valuesByReturnType
.selection
}
78 if(valuesByReturnType
.formquery
){action
.parms
.kssSubmitForm
=valuesByReturnType
.formquery
}
79 if(valuesByReturnType
.url
){action
.parms
.kssUrl
=valuesByReturnType
.url
}
80 return action
};this.getActionOrNull=function(name
){var action
=this.content
[name
];if(typeof(action
)=='undefined'){action
=null}
81 return action
};this.deleteAction=function(name
){var action
=this.content
[name
];delete this.content
[name
]};this.getDefaultAction=function(){return this.getActionOrNull('default')};this.getErrorActionFor=function(action
){return this.getActionOrNull(action
.error
)};this.initialize
.apply(this,arguments
)};var _Action=function(){this.initialize=function(){this.name
=null;this.error
=null;this.parms
={};this.type
=null;this.nameOverride
=null};this.getExecutingName
=function getExecutingName(){return this.nameOverride
||this.name
};this.setName=function(name
,nameOverride
){if(typeof(nameOverride
)=='undefined'||name
==nameOverride
){nameOverride
=null}
82 this.name
=name
;if(nameOverride
!=null){this.nameOverride
=nameOverride
}
83 if(name
=='default'){this.setType('D')}};this.setType=function(type
){this.type
=type
};this.setError=function(error
){this.error
=error
};this.merge=function(other
){if(other
.name
!=null){this.setName(other
.name
,other
.nameOverride
)}
84 if(other
.type
!=null){this.setType(other
.type
)}
85 if(other
.error
!=null){this.setError(other
.error
)}
86 for(var key
in other
.parms
){this.parms
[key
]=other
.parms
[key
]}};var _defaultStringHandling
={'kssSelector':'css','kssSubmitForm':'form'};this.makeActionOper=function(oper
){var parms
={};var kssParms
={};if(typeof(oper
.defaultParameters
)=='undefined'){oper
.defaultParameters
={}}
87 for(var key
in this.parms
){var value
=this.parms
[key
].evaluate(oper
.node
,oper
.defaultParameters
);var providerName
=_defaultStringHandling
[key
];if(providerName
&&typeof(value
)=='string'){var providerClass
=kukit
.pprovidersGlobalRegistry
.get(providerName
);var provider
=new providerClass();value
=provider
.eval([value
],oper
.node
,oper
.defaultParameters
)}
88 if(key
.match(/^kss/)){kssParms
[key
]=value
} else{parms
[key
]=value
}}
89 var anOper
=oper
.clone({'parms':parms
,'kssParms':kssParms
,'action':this});return anOper
};this.execute=function(oper
){oper
=this.makeActionOper(oper
);switch(this.type
){case 'D':{var name
=oper
.eventRule
.kssSelector
.name
;oper
.executeDefaultAction(name
)} break;case 'S':{oper
.executeServerAction(this.name
)} break;case 'C':{oper
.executeClientAction(this.getExecutingName())} break;case 'E':{oper
.executeClientAction(this.name
)} break}};this.initialize
.apply(this,arguments
)};rd
.LoadActions=function(){this.initialize=function(){this.items
=[]};this.empty=function(){return(this.size()==0)};this.size=function(){return this.items
.length
};this.push=function(f
){if(this.items
.length
>=100){throw('Infinite recursion, stack full')}
90 this.items
.push(f
)};this.execute=function(){var f
=this.items
.shift();if(f
){f();return true} else{return false}};this.executeAll=function(){var i
=0;while(true){var success
=this.execute();if(!success
){break}
92 return i
};this.initialize
.apply(this,arguments
)};rd
.RuleTable=function(){this.initialize=function(loadScheduler
){this.loadScheduler
=loadScheduler
;this.nodes
={}};this.add=function(node
,eventRule
){var nodehash
=rd
.hashNode(node
);var nodeval
=this.nodes
[nodehash
];if(typeof(nodeval
)=='undefined'){nodeval
={'node':node
,'val':{}};this.nodes
[nodehash
]=nodeval
}
93 eventRule
.mergeIntoDict(nodeval
.val
,eventRule
.kssSelector
.getMergeId(node
))};this.bindall=function(phase
){var counter
=0;for(var nodehash
in this.nodes
){var nodeval
=this.nodes
[nodehash
];nodeval
.node
._kukitMark
=phase
;for(var id
in nodeval
.val
){var eventRule
=nodeval
.val
[id
];eventRule
.bind(nodeval
.node
)}
95 var loadactions
=this.loadScheduler
;if(!loadactions
.empty()){var count
=loadactions
.executeAll()}};this.initialize
.apply(this,arguments
)};rd
.uid
=0;rd
.hashNode=function(node
){if(node
==null){return '<<DOCUMENT>>'}
96 var id
=node
.uniqueID
;if(typeof(id
)=='undefined'){id
=rd
.uid
;node
.uniqueID
=id
;rd
.uid
++}
97 return id
};rd
.MethodTable=function(){this.initialize=function(){this.content
={};this.content
['document']={};this.content
['behaviour']={}};this.add=function(eventRule
){var category
=eventRule
.kssSelector
.css
;var dict
=this.content
[category
];eventRule
.mergeIntoDict(dict
,eventRule
.kssSelector
.getMergeId())};this.getMergedRule=function(category
,name
,binder
){var dict
=this.content
[category
];var namespace=binder
.__eventNamespace__
;var id
=binder
.__binderId__
;var mergeId
=kukit
.er
.makeMergeId(id
,namespace,name
);var mergedRule
=dict
[mergeId
];if(typeof(mergedRule
)=='undefined'){mergedRule
=null}
98 return mergedRule
};this.bindall=function(){var documentRules
=this.content
['document'];var counter
=0;for(var mergeId
in documentRules
){documentRules
[mergeId
].bind(null);counter
+=1}};this.initialize
.apply(this,arguments
)}}();kukit
.kssp
=new function(){var kssp
=this;kssp
.openComment
=kukit
.tk
.mkToken('openComment',"\/\*");kssp
.closeComment
=kukit
.tk
.mkToken('closeComment',"\*\/");kssp
.openBrace
=kukit
.tk
.mkToken('openBrace',"{");kssp
.closeBrace
=kukit
.tk
.mkToken('closeBrace',"}");kssp
.openBracket
=kukit
.tk
.mkToken('openBracket',"[");kssp
.closeBracket
=kukit
.tk
.mkToken('closeBracket',"]");kssp
.openParent
=kukit
.tk
.mkToken('openParent',"(");kssp
.closeParent
=kukit
.tk
.mkToken('closeParent',")");kssp
.semicolon
=kukit
.tk
.mkToken('semicolon',";");kssp
.colon
=kukit
.tk
.mkToken('colon',":");kssp
.quote
=kukit
.tk
.mkToken('quote',"'");kssp
.dquote
=kukit
.tk
.mkToken('dquote','"');kssp
.backslash
=kukit
.tk
.mkToken('backslash','\x5c');kssp
.comma
=kukit
.tk
.mkToken('comma',",");kssp
.equals
=kukit
.tk
.mkToken('equals',"=");var _emitAndReturn=function(){return this.emitAndReturn()};var _mkEmitAndReturnToken=function(klass
){return function(){var token
=new klass(this.cursor
);return this.emitAndReturn(token
)}};var _mkReturnToken=function(klass
){return function(){return new klass(this.cursor
)}};var _returnComment=function(){return new kssp
.Comment(this.cursor
,kssp
.openComment
)};var _returnString=function(){return new kssp
.String(this.cursor
,kssp
.quote
)};var _returnString2=function(){return new kssp
.String2(this.cursor
,kssp
.dquote
)};var _returnMethodArgs=function(){return new kssp
.MethodArgs(this.cursor
,kssp
.openParent
)};var _returnBackslashed=function(){return new kssp
.Backslashed(this.cursor
,kssp
.backslash
)};var _Document=function(){this.process=function(){this.eventRules
=[];var context
={'nextTokenIndex':0};while(context
.nextTokenIndex
<this.result
.length
){this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
);var key
=context
.txt
;if(!key
){break}
99 this.expectToken(context
,kssp
.Block
);var block
=context
.token
;var rules
=block
.parseSelectors(key
);this.addRules(rules
)}
100 this.result
=[];this.txt
=''};this.addRules=function(rules
){for(var i
=0;i
<rules
.length
;i
++){this.eventRules
.push(rules
[i
])}}};kssp
.Document
=kukit
.tk
.mkParser('document',{"\/\*":_returnComment
,"{": function(){return new kssp
.Block(this.cursor
,kssp
.openBrace
)}},_Document
);var _Comment=function(){this.process=function(){this.result
=[];this.txt
=' '}};kssp
.Comment
=kukit
.tk
.mkParser('comment',{"\*\/":_mkEmitAndReturnToken(kssp
.closeComment
)},_Comment
);var _Block=function(){this.process=function(){this.eventFullNames
={};this.actions
=new kukit
.rd
.ActionSet();var context
={'nextTokenIndex':1};while(context
.nextTokenIndex
<this.result
.length
-1){this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
);var key
=context
.txt
;if(!key
){break}
101 this.expectToken(context
,kssp
.colon
);this.expectToken(context
,kssp
.MultiPropValue
);this.addDeclaration(key
,context
.token
.values
);if(context
.nextTokenIndex
==this.result
.length
-1) break;this.expectToken(context
,kssp
.semicolon
)}
102 this.result
=[];this.txt
=''};this.parseSelectors=function(key
){var cursor
=new kukit
.tk
.Cursor(key
+' ');var parser
=new kssp
.KssSelectors(cursor
,null,true);var results
=[];var hasFullNames
=false;for(var eventFullName
in this.eventFullNames
){var hasFullNames
=true;var found
=false;for(var i
=0;i
<parser
.selectors
.length
;++i
){var fullName
='';var kssSelector
=parser
.selectors
[i
];if(kssSelector
.namespace){fullName
=kssSelector
.namespace+'-'}
103 fullName
+=kssSelector
.name
;if(fullName
==eventFullName
){var eventParameters
=this.eventFullNames
[fullName
];var eventRule
;if(typeof(eventParameters
)!='undefined'){eventRule
=new kukit
.rd
.EventRule(kssSelector
,eventParameters
,this.actions
)}
104 else{eventRule
=new kukit
.rd
.EventRule(kssSelector
,{},this.actions
)}
105 results
.push(eventRule
);found
=true}}
106 if(!found
){this.emitError(kukit
.E
)}}
107 if(!hasFullNames
){for(var i
=0;i
<parser
.selectors
.length
;++i
){var kssSelector
=parser
.selectors
[i
];eventRule
=new kukit
.rd
.EventRule(kssSelector
,{},this.actions
);results
.push(eventRule
)}}
108 return results
};this.addEventDeclaration=function(key
,splitkey
,values
){var eventNamespace
;var eventName
;var eventKey
;var eventFullName
;if(splitkey
.length
==3){eventName
=splitkey
[1];eventKey
=splitkey
[2];eventFullName
=eventName
} else{eventNamespace
=splitkey
[1];eventName
=splitkey
[2];eventKey
=splitkey
[3];eventFullName
=eventNamespace
+'-'+eventName
}
109 var allowedReturnTypes
;var value
=this.preprocessValues(values
,allowedReturnTypes
,kukit
.E
).string
;var eventParameters
=this.eventFullNames
[eventFullName
];if(typeof(eventParameters
)=='undefined'){this.eventFullNames
[eventFullName
]={};eventParameters
=this.eventFullNames
[eventFullName
]}
110 eventParameters
[eventKey
]=value
.txt
};this.addActionDeclaration=function(key
,splitkey
,values
){var atab
={'server':'S','client':'C','cancel':'X'};var actionType
=atab
[splitkey
[1]];var allowedReturnTypes
;var valuesByReturnType
=this.preprocessValues(values
,allowedReturnTypes
,kukit
.E
);var value
=valuesByReturnType
.string
;var action
=this.actions
.getOrCreateAction(value
.txt
,valuesByReturnType
);if(actionType
=='X'&&action
.type
!=null){this.actions
.deleteAction(value
.txt
)} else{action
.setType(actionType
)}};this.addActionError=function(action
,key
,values
){var allowedReturnTypes
;var value
=this.preprocessValues(values
,allowedReturnTypes
,kukit
.E
).string
;action
.setError(value
.txt
);var err_action
=this.actions
.getOrCreateAction(value
.txt
,{});err_action
.setType('E')};this.addActionParameter=function(action
,key
,values
){var value
;if(key
.substr(0,3)=='kss'){value
=values
[0];this.preprocessValues(values
,allowedReturnTypes
,kukit
.E
,true)} else{var allowedReturnTypes
;var valuesByReturnType
=this.preprocessValues(values
,allowedReturnTypes
,kukit
.E
);value
=valuesByReturnType
.string
}
111 action
.parms
[key
]=value
};this.addDeclaration=function(key
,values
){var splitkey
=key
.split('-');var name
=splitkey
[0];if(name
=='evt'){this.addEventDeclaration(key
,splitkey
,values
)} else if(name
=='action'){this.addActionDeclaration(key
,splitkey
,values
)} else{var actionName
;var actionKey
;if(splitkey
.length
==2){actionName
=splitkey
[0];actionKey
=splitkey
[1]} else{actionName
=splitkey
[0]+'-'+splitkey
[1];actionKey
=splitkey
[2]}
112 var action
=this.actions
.getOrCreateAction(actionName
,{});if(actionKey
=='error'){this.addActionError(action
,key
,values
)} else{this.addActionParameter(action
,actionKey
,values
)}}};this.preprocessValues=function(values
,allowedReturnTypes
,errInfo
,noStringRequired
){var valuesByReturnType
={};for(var i
=0;i
<values
.length
;i
++){var value
=values
[i
];try{value
.check()} catch(e
){this.emitError(kukit
.E
)}
113 var returnType
=(typeof(value
.pprovider
)!='undefined')&&value
.pprovider
.returnType
;if(!returnType
){returnType
='string'}
114 valuesByReturnType
[returnType
]=value
}
115 return valuesByReturnType
}};kssp
.Block
=kukit
.tk
.mkParser('block',{";":_mkReturnToken(kssp
.semicolon
),":": function(){return [new kssp
.colon(this.cursor
),new kssp
.MultiPropValue(this.cursor
)]},"}":_mkEmitAndReturnToken(kssp
.closeBrace
)},_Block
);var _PropValue=function(){this.process=function(){this.values
=[];var context
={'nextTokenIndex':0};this.txt
='';var txtCarry
='';while(context
.nextTokenIndex
<this.result
.length
){if(this.notInTokens(context
,kukit
.kssp
.String
)){if(txtCarry
){this.produceTxt(txtCarry
);txtCarry
=''}
116 this.expectToken(context
,kukit
.kssp
.String
);this.produceTxt(context
.token
.txt
)} else if(this.notInTokens(context
,kukit
.kssp
.MethodArgs
)){if(!txtCarry
){this.emitError(kukit
.E
)}
117 this.expectToken(context
,kukit
.kssp
.MethodArgs
);this.addValue(new kukit
.rd
.KssMethodValue(txtCarry
,context
.token
.args
),txtCarry
);txtCarry
=''} else{this.digestTxt(context
,kukit
.tk
.Fraction
,kukit
.kssp
.Comment
);var words
=context
.txt
.split(' ');if(txtCarry
){this.produceTxt(txtCarry
);txtCarry
=''}
118 if(words
.length
>0){for(var i
=0;i
<words
.length
-1;i
++){this.produceTxt(words
[i
])}
119 txtCarry
=words
[words
.length
-1]}}}
120 if(txtCarry
){this.produceTxt(txtCarry
)}
121 this.result
=[]};this.initialize=function(){this.multiword_allowed
=false;this.valueClass
=kukit
.rd
.KssMethodValue
};this.produceTxt=function(txt
){this.addValue(new kukit
.rd
.KssTextValue(txt
),txt
)};this.addValue=function(value
,errInfo
){if(this.value
){this.emitError(kukit
.E
)}
122 this.value
=value
};this.initialize
.apply(this,arguments
)};kssp
.PropValue
=kukit
.tk
.mkParser('propValue',{";":_emitAndReturn
,"}":_emitAndReturn
,")":_emitAndReturn
,"]":_emitAndReturn
,",":_emitAndReturn
,"'":_returnString
,'"':_returnString2
,"\/\*":_returnComment
,"(":_returnMethodArgs
},_PropValue
);var _MultiPropValue=function(){this.addValue=function(value
,errInfo
){this.values
.push(value
)};this.initialize=function(){this.multiword_allowed
=true}};_MultiPropValue
.prototype=new _PropValue();kssp
.MultiPropValue
=kukit
.tk
.mkParser('multiPropValue',{";":_emitAndReturn
,"}":_emitAndReturn
,")":_emitAndReturn
,",":_emitAndReturn
,"'":_returnString
,'"':_returnString2
,"\/\*":_returnComment
,"(":_returnMethodArgs
},_MultiPropValue
);var _EventValue=function(){this.initialize=function(){this.multiword_allowed
=false};this.process=function(){var context
={'nextTokenIndex':0};this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
);this.txt
='';var txt
=context
.txt
;if(this.notInTokens(context
,kssp
.String
)){if(txt
){this.emitError(kukit
.E
)}
123 this.expectToken(context
,kssp
.String
);this.produceTxt(context
.token
.txt
)} else if(this.notInTokens(context
,kssp
.openParent
)){this.expectToken(context
,kssp
.openParent
);this.expectToken(context
,kssp
.PropValue
);this.value
=new kukit
.rd
.KssEventValue(txt
,context
.token
.value
);this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
);if(context
.txt
){this.emitError(kukit
.E
)}
124 this.expectToken(context
,kssp
.closeParent
)} else{if(!this.multiword_allowed
&&txt
.indexOf(' ')!=-1){this.emitError(kukit
.E
)}
125 this.produceTxt(txt
)}
126 if(context
.nextTokenIndex
<this.result
.length
){this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
);if(context
.nextTokenIndex
<this.result
.length
||context
.txt
){this.emitError(kukit
.E
)}}
127 this.result
=[]};this.produceTxt=function(txt
){this.value
=new kukit
.rd
.KssEventValue(txt
,null)};this.initialize
.apply(this,arguments
)};kssp
.EventValue
=kukit
.tk
.mkParser('propValue',{"{":_emitAndReturn
," ":_emitAndReturn
,"\t":_emitAndReturn
,"\n":_emitAndReturn
,"\r":_emitAndReturn
,"\/\*":_emitAndReturn
,":":_emitAndReturn
,"(": function(){return [new kssp
.openParent(this.cursor
),new kssp
.PropValue(this.cursor
)]},")":_mkEmitAndReturnToken(kssp
.closeParent
)},_EventValue
);var _String=function(){this.process=function(){this.txt
='';for(var i
=1;i
<this.result
.length
-1;i
++){this.txt
+=this.result
[i
].txt
}}};kssp
.String
=kukit
.tk
.mkParser('string',{"'":_mkEmitAndReturnToken(kssp
.quote
),'\x5c':_returnBackslashed
},_String
);kssp
.String2
=kukit
.tk
.mkParser('string',{'"':_mkEmitAndReturnToken(kssp
.dquote
),'\x5c':_returnBackslashed
},_String
);var _StringInSelector=function(){this.process=function(){this.txt
='';for(var i
=0;i
<this.result
.length
;i
++){this.txt
+=this.result
[i
].txt
}}};kssp
.StringInSelector
=kukit
.tk
.mkParser('string',{"'":_mkEmitAndReturnToken(kssp
.quote
),'\x5c':_returnBackslashed
},_StringInSelector
);kssp
.String2InSelector
=kukit
.tk
.mkParser('string',{'"':_mkEmitAndReturnToken(kssp
.dquote
),'\x5c':_returnBackslashed
},_StringInSelector
);var _Backslashed=function(){this.nextStep=function(table
){var cursor
=this.cursor
;var length
=cursor
.text
.length
;if(length
<cursor
.pos
+1){this.emitError(kukit
.E
)} else{this.result
.push(new kukit
.tk
.Fraction(cursor
,cursor
.pos
+1));this.cursor
.pos
+=1;this.finished
=true}};this.process=function(){this.txt
=this.result
[1].txt
}};kssp
.Backslashed
=kukit
.tk
.mkParser('backslashed',{},_Backslashed
);var _MethodArgs=function(){this.process=function(){this.args
=[];var context
={'nextTokenIndex':1};while(context
.nextTokenIndex
<this.result
.length
-1){this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
);var value
=context
.txt
;if(!value
){if(context
.nextTokenIndex
==this.result
.length
-1) break;this.expectToken(context
,kssp
.String
);value
=context
.token
.txt
} else{if(value
.indexOf(' ')!=-1){this.emitError(kukit
.E
)}}
128 var valueClass
;var args
;var providedValue
;if(this.notInTokens(context
,kssp
.MethodArgs
)){this.expectToken(context
,kssp
.MethodArgs
);valueClass
=kukit
.rd
.KssMethodValue
;args
=context
.token
.args
;providedValue
=new valueClass(value
,args
)} else{providedValue
=value
}
129 this.args
.push(providedValue
);if(context
.nextTokenIndex
==this.result
.length
-1) break;this.expectToken(context
,kssp
.comma
)}
130 this.result
=[];this.txt
=''}};kssp
.MethodArgs
=kukit
.tk
.mkParser('methodargs',{"'":_returnString
,'"':_returnString2
,",":_mkReturnToken(kssp
.comma
),")":_mkEmitAndReturnToken(kssp
.closeParent
),"(":_returnMethodArgs
,"\/\*":_returnComment
},_MethodArgs
);var _KssSelectors=function(){this.process=function(){this.selectors
=[];var context
={'nextTokenIndex':0};while(context
.nextTokenIndex
<this.result
.length
){this.digestTxt(context
,kukit
.tk
.Fraction
,kssp
.Comment
,kssp
.String
,kssp
.String2
);var cursor
=new kukit
.tk
.Cursor(context
.txt
+' ');var parser
=new kssp
.KssSelector(cursor
,null,true);this.selectors
.push(parser
.kssSelector
);if(context
.nextTokenIndex
==this.result
.length
) break;this.expectToken(context
,kssp
.comma
);if(context
.nextTokenIndex
==this.result
.length
){this.emitError(kukit
.E
)}};this.result
=[];this.txt
=''}};kssp
.KssSelectors
=kukit
.tk
.mkParser('kssselectors',{"'": function(){return new kssp
.StringInSelector(this.cursor
,kssp
.quote
)},'"': function(){return new kssp
.String2InSelector(this.cursor
,kssp
.dquote
)},",":_mkReturnToken(kssp
.comma
),"{":_emitAndReturn
,"\/\*":_returnComment
},_KssSelectors
);var _KssSelector=function(){this.process=function(){var name
;var namespace=null;var id
=null;var tokenIndex
=this.result
.length
-1;var cycle
=true;while(cycle
&&tokenIndex
>=0){var token
=this.result
[tokenIndex
];switch(token
.symbol
){case kukit
.tk
.Fraction
.prototype.symbol
:{if(token
.txt
.match(/^[\r\n\t ]*$/)!=null){tokenIndex
-=1} else{this.emitError(kukit
.E
)}} break;case kssp
.Comment
.prototype.symbol
:{tokenIndex
-=1} break;default:{cycle
=false} break}}
131 tokenIndex
-=2;if(tokenIndex
<0||(this.result
[tokenIndex
+2].symbol
!=kssp
.EventValue
.prototype.symbol
)||(this.result
[tokenIndex
+1].symbol
!=kssp
.colon
.prototype.symbol
)||(this.result
[tokenIndex
].symbol
!=kukit
.tk
.Fraction
.prototype.symbol
)){this.emitError(kukit
.E
)}
132 var lasttoken
=this.result
[tokenIndex
];var commatoken
=this.result
[tokenIndex
+1];var pseudotoken
=this.result
[tokenIndex
+2];var txt
=lasttoken
.txt
;if(txt
.match(/[\r\n\t ]$/)!=null){this.emitError(kukit
.E
)}
133 if(!pseudotoken
.value
.methodName
){this.emitError(kukit
.E
)}
134 css
=this.cursor
.text
.substring(this.startpos
,commatoken
.startpos
);var singleword
=css
.replace(/[\r\n\t ]/g,' ');if(singleword
&&singleword
.charAt(0)==' '){singleword
=singleword
.substring(1)}
135 var isEvent
=(singleword
!='document'&&singleword
!='behaviour');if(!isEvent
){css
=singleword
}
136 var id
=null;var ppid
=null;if(pseudotoken
.value
.arg
){if(pseudotoken
.value
.arg
.isMethod
){ppid
=pseudotoken
.value
.arg
;ppid
.check(kukit
.pprovidersGlobalRegistry
)} else{id
=pseudotoken
.value
.arg
.txt
}}
137 var name
=pseudotoken
.value
.methodName
;var splitname
=name
.split('-');var namespace=null;if(splitname
.length
>2){this.emitError(kukit
.E
)} else if(splitname
.length
==2){name
=splitname
[1];namespace=splitname
[0]}
138 this.kssSelector
=new kukit
.rd
.KssSelector(isEvent
,css
,name
,namespace,id
,ppid
,kukit
.eventsGlobalRegistry
);this.txt
='';this.result
=[]}};kssp
.KssSelector
=kukit
.tk
.mkParser('kssselector',{":": function(){return [new kssp
.colon(this.cursor
),new kssp
.EventValue(this.cursor
)]},"{":_emitAndReturn
,"\/\*":_returnComment
},_KssSelector
);kssp
.KssRuleProcessor=function(href
){this.initialize=function(){this.href
=href
;this.loaded
=false;this.rules
=[]};this.load=function(){var domDoc
=new XMLHttpRequest();domDoc
.open("GET",this.href
,false);domDoc
.send(null);this.txt
=domDoc
.responseText
;this.loaded
=true};this.parse=function(){var cursor
=new kukit
.tk
.Cursor(this.txt
);var parser
=new kssp
.Document(cursor
,null,true);for(var i
=0;i
<parser
.eventRules
.length
;i
++){var rule
=parser
.eventRules
[i
];rule
.kssSelector
.prepareId();this.rules
.push(rule
)}};this.initialize
.apply(this,arguments
)}}();kukit
.er
=new function(){var er
=this;var _eventClassCounter
=0;var _EventRegistry=function(){this.initialize=function(){this.content
={};this.classes
={};this.eventSets
=[]};this.registerBinder=function(klass
){if(typeof(klass
)=='undefined'){throw new Error(kukit
.E
)}
139 if(klass
.__decorated_for_kss__
){return}
140 var binder_prototype
=new _EventBinder();for(var key
in binder_prototype
){klass
.prototype[key
]=binder_prototype
[key
]}
141 className
=''+_eventClassCounter
;_eventClassCounter
+=1;klass
.prototype.__className__
=className
;this.classes
[className
]=klass
;klass
.__decorated_for_kss__
=true};this.existsBinder=function(className
){var klass
=this.classes
[className
];return(typeof(klass
)!='undefined')};this.getBinderClass=function(className
){var klass
=this.classes
[className
];if(!klass
){throw new Error(kukit
.E
)}
142 return klass
};this._register=function(namespace,eventName
,klass
,bindMethodName
,defaultActionMethodName
,iterName
){if(typeof(defaultActionMethodName
)=='undefined'){throw new Error(kukit
.E
)}
143 this.registerBinder(klass
);if(!eventName
){throw new Error(kukit
.E
)}
144 var key
=this._getKey(namespace,eventName
);var entry
=this.content
[key
];if(typeof(entry
)!='undefined'){if(key
[0]=='-'){key
=key
.substring(1)}
145 throw new Error(kukit
.E
)}
146 if(!er
.getBindIterator(iterName
)){throw new Error(kukit
.E
)}
147 this.content
[key
]={'className':className
,'bindMethodName':bindMethodName
,'defaultActionMethodName':defaultActionMethodName
,'iterName':iterName
}};this._registerEventSet=function(namespace,names
,iterName
,bindMethodName
){this.eventSets
.push({'namespace':namespace,'names':names
,'iterName':iterName
,'bindMethodName':bindMethodName
})};this.register=function(namespace,eventName
,klass
,bindMethodName
,defaultActionMethodName
){this._register(namespace,eventName
,klass
,bindMethodName
,defaultActionMethodName
,'EachLegacy');this._registerEventSet(namespace,[eventName
],'EachLegacy',bindMethodName
)};this.unregister=function(namespace,eventName
){var key
=this._getKey(namespace,eventName
);delete this.content
[key
];var found
=null;for(var i
=0;i
<this.eventSets
.length
;i
++){var eventSet
=this.eventSets
[i
];if(eventSet
['namespace']==namespace){found
=i
;break}}
148 if(found
!=null){this.eventSets
.splice(found
,1)}};this.registerForAllEvents=function(namespace,eventNames
,klass
,bindMethodName
,defaultActionMethodName
,iterName
){if(typeof(eventNames
)=='string'){eventNames
=[eventNames
]}
149 for(var i
=0;i
<eventNames
.length
;i
++){var eventName
=eventNames
[i
];this._register(namespace,eventName
,klass
,bindMethodName
,defaultActionMethodName
,iterName
)}
150 this._registerEventSet(namespace,eventNames
,iterName
,bindMethodName
)};this._getKey=function(namespace,eventName
){if(namespace==null){namespace=''} else if(namespace.split('-')>1){throw new Error(kukit
.E
)}
151 return namespace+'-'+eventName
};this.exists=function(namespace,eventName
){var key
=this._getKey(namespace,eventName
);var entry
=this.content
[key
];return(typeof(entry
)!='undefined')};this.get=function(namespace,eventName
){var key
=this._getKey(namespace,eventName
);var entry
=this.content
[key
];if(typeof(entry
)=='undefined'){throw new Error(kukit
.E
)}
152 return entry
};this.getBinderClassByEventNamespace=function(namespace,eventName
){return this.getBinderClass(this.get(namespace,eventName
).className
)};this.initialize
.apply(this,arguments
)};kukit
.eventsGlobalRegistry
=new _EventRegistry();var _eventRegistry=function(){this.register=function(namespace,eventName
,klass
,bindMethodName
,defaultActionMethodName
){kukit
.eventsGlobalRegistry
.register(namespace,eventName
,klass
,bindMethodName
,defaultActionMethodName
)}};var _LateBinder=function(){this.initialize=function(binder
,name
,node
){this.binder
=binder
;this.name
=name
;this.node
=node
;this.boundEvent
=null};this.executeActions=function(){if(!this.boundEvent
){if(kukit
.hasFirebug
){kukit
.log(this.node
)}
153 var info
=kukit
.engine
.binderInfoRegistry
.getBinderInfoById(this.binder
.__binderId__
);var oper
=info
.bound
.getBoundOperForNode(this.name
,this.node
);if(oper
){oper
.parms
={};this.boundEvent=function(){this.binder
.triggerEvent(this.name
,oper
)}} else{this.boundEvent=function(){}}}
154 this.boundEvent()};this.initialize
.apply(this,arguments
)};var _EventBinder=function(){this.continueEvent=function(name
,node
,defaultParameters
){var oper
=new kukit
.op
.Oper();oper
.node
=node
;if(node
){var info
=kukit
.engine
.binderInfoRegistry
.getBinderInfoById(this.__binderId__
);var newOper
=info
.bound
.getBoundOperForNode(name
,node
);if(newOper
){oper
=newOper
}} else{oper
.eventRule
=kukit
.engine
.documentRules
.getMergedRule('document',name
,this)}
155 var behav_eventRule
=kukit
.engine
.documentRules
.getMergedRule('behaviour',name
,this);if(behav_eventRule
){if(!oper
.eventRule
){oper
.eventRule
=behav_eventRule
} else{}}
156 if(typeof(defaultParameters
)!='undefined'){oper
.defaultParameters
=defaultParameters
} else{oper
.defaultParameters
={}}
157 this.triggerEvent(name
,oper
)};this.__continueEvent__=function(name
,node
,defaultParameters
){this.continueEvent(name
,node
,defaultParameters
)};this.continueEventAllNodes=function(name
,defaultParameters
){var executed
=0;var oper
=new kukit
.op
.Oper();var info
=kukit
.engine
.binderInfoRegistry
.getBinderInfoById(this.__binderId__
);var opers
=info
.bound
.getBoundOpers(name
);for(var i
=0;i
<opers
.length
;i
++){var oper
=opers
[i
];var newOper
=oper
.clone();if(typeof(defaultParameters
)!='undefined'){newOper
.defaultParameters
=defaultParameters
} else{newOper
.defaultParameters
={}}
158 this.triggerEvent(name
,newOper
);executed
+=1}};this.__continueEvent_allNodes__=function(name
,defaultParameters
){this.continueEventAllNodes(name
,defaultParameters
)};this.makeFuncToBind=function(name
,node
){var executor
=new er
._LateBinder(this,name
,node
);return function(){executor
.executeActions()}};this.__makeFuncToBind__=function(name
,node
){this.makeFuncToBind(name
,node
)};this.triggerEvent=function(name
,oper
){oper
.binder
=this;if(oper
.eventRule
){oper
.eventRule
.actions
.execute(oper
)} else{var namespace=this.__eventNamespace__
;var success
=oper
.executeDefaultAction(name
,true);if(!success
){throw new Error(kukit
.E
)}}};this._EventBinder_triggerEvent=function(name
,oper
){this.triggerEvent(name
,oper
)};this.callMethod=function(namespace,name
,oper
,methodName
){var method
=this[methodName
];if(!method
){throw new Error(kukit
.E
)}
159 oper
.binder
=this;method
.call(this,name
,oper
)};this._EventBinder_callMethod=function(namespace,name
,oper
,methodName
){this.callMethod(namespace,name
,oper
,methodName
)}};er
.BinderInfoRegistry=function(){this.initialize=function(){this.info
={}};this.getOrCreateBinderInfo=function(id
,className
,namespace){var binderInfo
=this.info
[id
];if(typeof(binderInfo
)=='undefined'){var binderClass
=kukit
.eventsGlobalRegistry
.getBinderClass(className
);var binder
=new binderClass();binderInfo
=this.info
[id
]=new _BinderInfo(binder
);binder
.__binderId__
=id
;binder
.__binderClassName__
=className
;binder
.__eventNamespace__
=namespace} else if(binderInfo
.getBinder().__binderClassName__
!=className
){throw new Error(kukit
.E
)}
160 return binderInfo
};this.getBinderInfoById=function(id
){var binderInfo
=this.info
[id
];if(typeof(binderInfo
)=='undefined'){throw new Error(kukit
.E
)}
161 return binderInfo
};this.getSingletonBinderInfoByName=function(namespace,name
){var className
=kukit
.eventsGlobalRegistry
.get(namespace,name
).className
;var id
=er
.makeId(namespace,className
);var binderInfo
=this.info
[id
];if(typeof(binderInfo
)=='undefined'){throw new Error(kukit
.E
)}
162 return binderInfo
};this.startBindingPhase=function(){for(var id
in this.info
){var binderInfo
=this.info
[id
];binderInfo
.startBindingPhase()}};this.processBindingEvents=function(){for(var id
in this.info
){var binderInfo
=this.info
[id
];binderInfo
.processBindingEvents()}};this.initialize
.apply(this,arguments
)};var _BinderInfo=function(){this.initialize=function(binder
){this.binder
=binder
;this.bound
=new _OperRegistry();this.getBinder=function(){return this.binder
};this.startBindingPhase=function(){this.binding
=new _OperRegistry()};this.bindOper=function(oper
){this.bound
.checkOperBindable(oper
);this.binding
.bindOper(oper
)};this.processBindingEvents=function(){this.binding
.processBindingEvents(this.binder
);this.binding
.propagateTo(this.bound
);this.binding
=null};this.startBindingPhase()};this.getBinder=function(){return this.binder
};this.startBindingPhase=function(){this.binding
=new _OperRegistry()};this.bindOper=function(oper
){this.bound
.checkOperBindable(oper
);this.binding
.bindOper(oper
)};this.processBindingEvents=function(){this.binding
.processBindingEvents(this.binder
);this.binding
.propagateTo(this.bound
);this.binding
=null};this.initialize
.apply(this,arguments
)};var _iterators
={};_iterators
['EachLegacy']=function(eventSet
,binder
){for(var i
=0;i
<eventSet
.names
.length
;i
++){var rulesPerName
=this.infoPerName
[eventSet
.names
[i
]];if(typeof(rulesPerName
)!='undefined'){for(var nodeHash
in rulesPerName
){var oper
=rulesPerName
[nodeHash
];var eventName
=oper
.getEventName();var funcToBind
=oper
.makeExecuteActionsHook();this.callBindMethod(eventSet
,binder
,eventName
,funcToBind
,oper
)}}}};_iterators
['Each']=function(eventSet
,binder
){for(var i
=0;i
<eventSet
.names
.length
;i
++){var rulesPerName
=this.infoPerName
[eventSet
.names
[i
]];if(typeof(rulesPerName
)!='undefined'){for(var nodeHash
in rulesPerName
){var oper
=rulesPerName
[nodeHash
];this.callBindMethod(eventSet
,binder
,oper
)}}}};_iterators
['Opers']=function(eventSet
,binder
){var opers
=[];for(var i
=0;i
<eventSet
.names
.length
;i
++){var rulesPerName
=this.infoPerName
[eventSet
.names
[i
]];if(typeof(rulesPerName
)!='undefined'){for(var nodeHash
in rulesPerName
){opers
.push(rulesPerName
[nodeHash
])}}}
163 this.callBindMethod(eventSet
,binder
,opers
)};_iterators
['Node']=function(eventSet
,binder
){for(var nodeHash
in this.infoPerNode
){var rulesPerNode
=this.infoPerNode
[nodeHash
];var filteredRules
={};var operFound
=false;for(var i
=0;i
<eventSet
.names
.length
;i
++){var name
=eventSet
.names
[i
];var oper
=rulesPerNode
[name
];if(typeof(oper
)!='undefined'){filteredRules
[name
]=oper
;operFound
=oper
}}
164 if(operFound
){this.callBindMethod(eventSet
,binder
,filteredRules
,operFound
.node
)}}};_iterators
['AllNodes']=function(eventSet
,binder
){var items
=[];var hasResult
=false;for(var nodeHash
in this.infoPerNode
){var rulesPerNode
=this.infoPerNode
[nodeHash
];var filteredRules
={};var operFound
=false;for(var i
=0;i
<eventSet
.names
.length
;i
++){var name
=eventSet
.names
[i
];var oper
=rulesPerNode
[name
];if(typeof(oper
)!='undefined'){filteredRules
[name
]=oper
;operFound
=oper
}}
165 if(operFound
){var item
={node
:operFound
.node
,opersByEventName
:filteredRules
};items
.push(item
);hasResult
=true}}
166 if(hasResult
){this.callBindMethod(eventSet
,binder
,items
)}};er
.getBindIterator=function(iterName
){var canonical
=iterName
.substring(0,1).toUpperCase()+iterName
.substring(1);if(canonical
=='Allnodes'){canonical
='AllNodes'}
167 if(iterName
!=canonical
){iterName
=canonical
}
168 return _iterators
[iterName
]};var _OperRegistry=function(){this.initialize=function(){this.infoPerName
={};this.infoPerNode
={}};this.propagateTo=function(newreg
){for(var key
in this.infoPerName
){var rulesPerName
=this.infoPerName
[key
];for(var name
in rulesPerName
){var oper
=rulesPerName
[name
];newreg
.bindOper(oper
)}}};this.checkOperBindable=function(oper
,name
,nodeHash
){var info
=this.infoPerName
;if(typeof(nodeHash
)=='undefined'){name
=oper
.eventRule
.kssSelector
.name
;nodeHash
=kukit
.rd
.hashNode(oper
.node
)}
169 var rulesPerName
=info
[name
];if(typeof(rulesPerName
)=='undefined'){rulesPerName
=info
[name
]={}} else if(typeof(rulesPerName
[nodeHash
])!='undefined'){throw new Error(kukit
.E
)}
170 return rulesPerName
};this.bindOper=function(oper
){var name
=oper
.eventRule
.kssSelector
.name
;var nodeHash
=kukit
.rd
.hashNode(oper
.node
);var rulesPerName
=this.checkOperBindable(oper
,name
,nodeHash
);rulesPerName
[nodeHash
]=oper
;var rulesPerNode
=this.infoPerNode
[nodeHash
];if(typeof(rulesPerNode
)=='undefined'){rulesPerNode
=this.infoPerNode
[nodeHash
]={}}
171 rulesPerNode
[name
]=oper
};this.processBindingEvents=function(binder
){var eventRegistry
=kukit
.eventsGlobalRegistry
;for(var i
=0;i
<eventRegistry
.eventSets
.length
;i
++){var eventSet
=eventRegistry
.eventSets
[i
];if(eventSet
.bindMethodName
){if(binder
.__eventNamespace__
==eventSet
.namespace){var iterator
=er
.getBindIterator(eventSet
.iterName
);iterator
.call(this,eventSet
,binder
)}}}};this.getBoundOperForNode=function(name
,node
){var rulesPerName
=this.infoPerName
[name
];if(typeof(rulesPerName
)=='undefined'){return null}
172 var nodeHash
=kukit
.rd
.hashNode(node
);var oper
=rulesPerName
[nodeHash
];if(typeof(oper
)=='undefined'){return null}
173 return oper
};this.getBoundOpers=function(name
){var opers
=[];var rulesPerName
=this.infoPerName
[name
];if(typeof(rulesPerName
)!='undefined'){for(var nodeHash
in rulesPerName
){opers
.push(rulesPerName
[nodeHash
])}}
174 return opers
};this.callBindMethod=function(eventSet
,binder
,p1
,p2
,p3
,p4
,p5
,p6
){var method
=binder
[eventSet
.bindMethodName
];method
.call(binder
,p1
,p2
,p3
,p4
,p5
,p6
)};this.initialize
.apply(this,arguments
)};er
.makeId=function(namespace,name
){if(namespace==null){namespace=''}
175 return '@'+namespace+'@'+name
};er
.makeMergeId=function(id
,namespace,name
){if(namespace==null){namespace=''}
176 return id
+'@'+namespace+'@'+name
}}();kukit
.ar
=new function(){var ar
=this;var _ActionRegistry=function(){this.initialize=function(){this.content
={}};this.register=function(name
,func
){if(this.content
[name
]){return}
177 this.content
[name
]=func
};this.exists=function(name
){var entry
=this.content
[name
];return(typeof(entry
)!='undefined')};this.get=function(name
){var func
=this.content
[name
];if(!func
){throw Error(kukit
.E
)}
178 return func
};this.initialize
.apply(this,arguments
)};kukit
.actionsGlobalRegistry
=new _ActionRegistry();ar
.actionRegistry=function(){this.register=function(name
,func
){kukit
.actionsGlobalRegistry
.register(name
,func
)}}}();kukit
.dom
=new function(){var dom
=this;dom
.getPreviousSiblingTag=function(node
){var toNode
=node
.previousSibling
;while((toNode
!=null)&&(toNode
.nodeType
!=1)){toNode
=toNode
.previousSibling
}
179 return toNode
};dom
.getNextSiblingTag=function(node
){var toNode
=node
.nextSibling
;while((toNode
!=null)&&(toNode
.nodeType
!=1)){toNode
=toNode
.nextSibling
}
180 return toNode
};dom
.insertBefore=function(nodes
,parentNode
,toNode
){for(var i
=0;i
<nodes
.length
;i
++){parentNode
.insertBefore(nodes
[i
],toNode
)}};dom
.appendChildren=function(nodes
,toNode
){for(var i
=0;i
<nodes
.length
;i
++){toNode
.appendChild(nodes
[i
])}};dom
.clearChildNodes=function(node
){Sarissa
.clearChildNodes(node
)};dom
.parseHTMLNodes=function(txt
){var node
=document
.createElement('div');node
.innerHTML
=txt
;var resultNodes
=[];for(var i
=0;i
<node
.childNodes
.length
;i
++){resultNodes
.push(node
.childNodes
.item(i
))}
181 return resultNodes
};dom
.cssQuery=function(selector
,inNodes
){if(typeof(inNodes
)!='undefined'&&inNodes
==null){throw new Error(kukit
.E
)}
182 return _cssQuery(selector
,inNodes
)};var _USE_BASE2
=(typeof(base2
)!='undefined');if(_USE_BASE2
){var _USE_BASE2_LEGACY
=(typeof(base2
.DOM
.Document
.querySelectorAll
)=='undefined');if(!_USE_BASE2_LEGACY
){var _cssQuery=function(selector
,inNodes
){var results
=base2
.DOM
.Document
.querySelectorAll(document
,selector
);var nodes
=[];for(var i
=0;i
<results
.length
;i
++){nodes
.push(results
.item(i
))}
183 return nodes
}} else{var _cssQuery=function(selector
,inNodes
){var results
=base2
.DOM
.Document
.matchAll(document
,selector
);var nodes
=[];for(var i
=0;i
<results
.length
;i
++){nodes
.push(results
.item(i
))}
184 return nodes
}}} else{var _cssQuery=function(selector
,inNodes
){var results
=cssQuery(selector
);return results
}};dom
.focus=function(node
){tagName
=node
.tagName
.toLowerCase();if((tagName
=='input')||(tagName
=='select')||(tagName
=='textarea')){node
.focus()}};dom
.blur=function(node
){tagName
=node
.tagName
.toLowerCase();if((tagName
=='input')||(tagName
=='select')||(tagName
=='textarea')){node
.blur()}};dom
.textContent=function(node
,recursive
){var value
=_textContent(node
,recursive
);value
=value
.replace(/\r\n/g,' ');value
=value
.replace(/[\r\n]/g,' ');return value
};var _textContent=function(node
,recursive
){if(typeof(recursive
)=='undefined'){recursive
=false}
185 var value
='';var childnodes
=node
.childNodes
;for(var i
=0;i
<childnodes
.length
;i
++){var child
=childnodes
[i
];if(child
.nodeType
==3){value
+=child
.nodeValue
} else if(recursive
&&child
.nodeType
==1){value
+=dom
.textContent(child
,true)}}
186 return value
};dom
.getAttribute=function(node
,attrname
){if(attrname
.toLowerCase()=='style'){throw new Error('Style attribute is not allowed with getAttribute')}
187 try{var value
=node
.getAttribute(attrname
)}
188 catch(e
){var value
=null}
189 if(!value
){if(attrname
.toLowerCase()=='class'){value
=node
.className
} else if(attrname
.toLowerCase()=='for'){value
=node
.htmlFor
}}
190 return value
};dom
.setAttribute=function(node
,attrname
,value
){if(attrname
.toLowerCase()=='style'){throw new Error('Style attribute is not allowed with setAttribute')}
191 else if(attrname
.toLowerCase()=='class'){node
.className
=value
} else if(attrname
.toLowerCase()=='for'){node
.htmlFor
=value
;node
.setAttribute(attrname
,value
)} else if(attrname
.toLowerCase()=='value'){node
.value
=value
} else if(attrname
.toLowerCase()=='checked'){value
=!(value
==''||value
=='false'||value
=='False');node
.checked
=value
} else{node
.setAttribute(attrname
,value
)}};var _kssAttrNamespace
='kssattr';var _kssNamespacePrefix
='kss';var _getKssValueFromEncodings=function(encodings
,prefix
){prefix
=prefix
+'-';var prefixLength
=prefix
.length
;for(var i
=0;i
<encodings
.length
;i
++){var encoding
=encodings
[i
];if(encoding
.substr(0,prefixLength
)==prefix
){return encoding
.substr(prefixLength
)}}
192 return null};var _getKssClassAttribute=function(node
,attrname
){var klass
=dom
.getAttribute(node
,'class');if(klass
){var splitclass
=klass
.split(/ +/);return _getKssValueFromEncodings(splitclass
,'kssattr-'+attrname
)}
193 return null};dom
.getKssAttribute=function(node
,attrname
){var fullName
=_kssAttrNamespace
+':'+attrname
;var result
=dom
.getAttribute(node
,fullName
);if(!result
){result
=_getKssClassAttribute(node
,attrname
)}
194 return result
};dom
.setKssAttribute=function(node
,attrname
,value
){var fullName
=_kssAttrNamespace
+':'+attrname
;dom
.setAttribute(node
,fullName
,value
)};dom
.getKssValue=function(node
,keyType
,key
){var namespacedName
=_kssNamespacePrefix
+'-'+keyType
;var attrName
=namespacedName
+':'+key
;var result
=node
.getAttribute(attrName
);if(!result
){result
=null;var klass
=dom
.getAttribute(node
,'class');var encodings
;if(klass
){encodings
=klass
.split(/ +/)} else{encodings
=[]}
195 var id
=dom
.getAttribute(node
,'id');if(id
){encodings
.unshift(id
)}
196 var prefix
=namespacedName
+'-'+key
;return _getKssValueFromEncodings(encodings
,prefix
)}
197 return result
};dom
.setKssValue=function(node
,keyType
,key
,value
){var namespacedName
=_kssNamespacePrefix
+'-'+keyType
;var attrName
=namespacedName
+':'+key
;node
.setAttribute(attrName
,value
)};dom
.locateMarkup=function(node
,recurseParents
,getter
,p1
,p2
,p3
,p4
,p5
){var value
=getter(node
,p1
,p2
,p3
,p4
,p5
);var element
=node
;if(recurseParents
){while(!value
){element
=element
.parentNode
;if(!element
||!element
.getAttribute
){break}
198 value
=getter(element
,p1
,p2
,p3
,p4
,p5
)}}
199 if(typeof(value
)=='undefined'){value
=null}
200 return{value
:value
,node
:element
}};dom
.getRecursiveAttribute=function(node
,attrname
,recurseParents
,getter
){return dom
.locateMarkup(node
,recurseParents
,getter
,attrname
).value
};var _getIframeDocument=function(framename
){var iframe
=document
.getElementById(framename
);var doc
=iframe
.contentWindow
||iframe
.contentDocument
;if(doc
.document
){doc
=doc
.document
}
201 return doc
};dom
.EmbeddedContentLoadedScheduler=function(){this.initialize=function(framename
,func
,autodetect
){this.framename
=framename
;this.func
=func
;this.autodetect
=autodetect
;var self
=this;var f=function(){self
.check()};this.counter
=new kukit
.ut
.TimerCounter(250,f
,true);this.counter
.start()};this.check=function(){var doc
=_getIframeDocument(this.framename
);if(doc
['_'+'embeddedContentLoadedInitDone']){this.counter
.restart
=false}
202 if(typeof doc
['_'+'kssReadyForLoadEvent']!='undefined'){this.counter
.restart
=false}
203 if(this.autodetect
&&this.counter
.restart
){if(doc
.location
.href
=='about:blank'){return}
204 if(/KHTML|WebKit/i.test(navigator
.userAgent
)){if(/loaded|complete/.test(doc
.readyState
)){this.counter
.restart
=false}} else if(typeof doc
.getElementsByTagName
!='undefined'&&(doc
.getElementsByTagName('body')[0]!=null||doc
.body
!=null)){this.counter
.restart
=false}}
205 if(!this.counter
.restart
){doc
['_'+'embeddedContentLoadedInitDone']=true;this.func()}};this.initialize
.apply(this,arguments
)};dom
.getNsTags=function(dom_obj
,tagName
){tags
=dom_obj
.getElementsByTagName(tagName
);return tags
};var _hasClassName=function(node
,class_name
){return new RegExp('\\b'+class_name
+'\\b').test(node
.className
)};dom
.addClassName=function(node
,class_name
){if(!node
.className
){node
.className
=class_name
} else if(!_hasClassName(node
,class_name
)){var className
=node
.className
+" "+class_name
;node
.className
=className
.split(/\s+/).join(' ')}};dom
.removeClassName=function(node
,class_name
){var className
=node
.className
;if(className
){className
=className
.replace(new RegExp('\\b'+class_name
+'\\b'),'');className
=className
.replace(/\s+/g,' ');node
.className
=className
.replace(/\s+$/g,'')}};dom
.createCookie=function(name
,value
,days
){if(days
){var date
=new Date();date
.setTime(date
.getTime()+(days
* 24 * 60 * 60 * 1000));var expires
="; expires="+date
.toGMTString()}
206 else var expires
="";document
.cookie
=name
+"="+value
+expires
+"; path=/"};dom
.readCookie
=kukit
.readCookie
;dom
.eraseCookie=function(name
){createCookie(name
,"",-1)}}();kukit
.cr
=new function(){var cr
=this;var _CommandRegistry=function(){this.initialize=function(){this.commands
={}};this.registerFromAction=function(srcname
,factory
,name
){if(typeof(name
)=='undefined'){name
=srcname
}
207 var f
=kukit
.actionsGlobalRegistry
.get(srcname
);factory(name
,f
)};this.register=function(name
,klass
){if(this.commands
[name
]){return}
208 this.commands
[name
]=klass
};this.get=function(name
){var klass
=this.commands
[name
];return klass
};this.initialize
.apply(this,arguments
)};kukit
.commandsGlobalRegistry
=new _CommandRegistry();cr
.commandRegistry
={};cr
.commandRegistry
.registerFromAction=function(srcname
,factory
,name
){kukit
.commandsGlobalRegistry
.registerFromAction(srcname
,factory
,name
)};cr
.makeCommand=function(selector
,name
,type
,parms
,transport
){var commandClass
=kukit
.commandsGlobalRegistry
.get(name
);var command
=new commandClass();command
.selector
=selector
;command
.name
=name
;command
.selectorType
=type
;command
.parms
=parms
;command
.transport
=transport
;return command
};var _executeCommand=function(oper
){var newoper
=oper
.clone({'parms':this.parms
,'orignode':oper
.node
,'node':null});this.executeOnScope(newoper
)};var _executeCommandOnSelector=function(oper
){var selectorType
=this.selectorType
||kukit
.selectorTypesGlobalRegistry
.defaultSelectorType
;var providerClass
=kukit
.pprovidersGlobalRegistry
.get(selectorType
);if(providerClass
.prototype.returnType
!='selection'){kukit
.E
='Undefined selector type ['+selectorType
+'], ';kukit
.E
='it exists as provider but it does not return a selection.';throw new Error(kukit
.E
)}
209 var provider
=new providerClass();var args
=[this.selector
];var nodes
=provider
.eval(args
,oper
.orignode
,{});for(var i
=0;i
<nodes
.length
;i
++){oper
.node
=nodes
[i
];this.executeOnSingleNode(oper
)}};cr
.makeSelectorCommand=function(name
,executeOnSingleNode
){var commandClass=function(){this.execute
=_executeCommand
;this.executeOnScope
=_executeCommandOnSelector
;this.executeOnSingleNode
=executeOnSingleNode
};kukit
.commandsGlobalRegistry
.register(name
,commandClass
)};cr
.makeGlobalCommand=function(name
,executeOnce
){var commandClass=function(){this.execute
=_executeCommand
;this.executeOnScope
=executeOnce
;this.executeOnSingleNode
=executeOnce
};kukit
.commandsGlobalRegistry
.register(name
,commandClass
)}}();kukit
.sa
=new function(){var sa
=this;sa
.ServerActionBase=function(){this.initialize=function(name
,oper
){this.oper
=oper
;this.url
=oper
.kssParms
.kssUrl
;if(typeof(this.url
)=='undefined'){this.url
=name
}
210 this.url
=this.calculateAbsoluteURL(this.url
);this.notifyServer()};this.calculateAbsoluteURL=function(url
){if(url
.match(RegExp("/^https?:\/\//"))){return url
}
211 var absoluteMatch
=url
.match(RegExp(/^(\/)(.*)/));var path
=kukit
.engine
.baseUrl
;if(absoluteMatch
){var base
=path
.match(RegExp(/^(.*:\/\/[^\/]*)(\/?)/))[1];url
=base
+url
;return url
}
212 if(!path
.match(RegExp("/$"))){path
+='/'}
213 url
=path
+url
;return url
};this.notifyServer=function(){var self
=this;var sendHook=function(queueItem
){self
.oper
.queueItem
=queueItem
;self
.reallyNotifyServer()};var timeoutHook=function(queueItem
){self
.oper
.queueItem
=queueItem
;self
.processError('timeout')};kukit
.engine
.requestManager
.notifyServer(sendHook
,this.url
,timeoutHook
)};this.reallyNotifyServer=function(){var domDoc
=new XMLHttpRequest();var self
=this;var notifyServer_done=function(){self
.notifyServer_done(domDoc
)};var query
=new kukit
.fo
.FormQuery();for(var key
in this.oper
.parms
){query
.appendElem(key
,this.oper
.parms
[key
])}
214 var submitForm
=this.oper
.kssParms
.kssSubmitForm
;if(submitForm
){for(var i
=0;i
<submitForm
.length
;i
++){var item
=submitForm
[i
];query
.appendElem(item
[0],item
[1])}}
215 var encoded
=query
.encode();var ts
=new Date().getTime();var tsurl
=this.url
+"?kukitTimeStamp="+ts
;domDoc
.open("POST",tsurl
,true);domDoc
.onreadystatechange
=notifyServer_done
;domDoc
.setRequestHeader("Content-Type","application/x-www-form-urlencoded");domDoc
.send(encoded
)};this.notifyServer_done=function(domDoc
){if(domDoc
.readyState
==4){var success
=this.oper
.queueItem
.receivedResult();if(success
){try{this.processResult(domDoc
)} catch(e
){if(e
.name
=='ResponseParsingError'){this.processError(kukit
.E
)} else if(e
.name
=='ExplicitError'){this.processError(e
.info
.kw
.errorcommand
)} else{throw e
}}}}};this.processResult=function(domDoc
){var dom
;var commandstags
=[];if(domDoc
.responseXML
){dom
=domDoc
.responseXML
;commandstags
=kukit
.dom
.getNsTags(dom
,'commands');if(commandstags
.length
!=1){dom
=null}}
216 if(dom
==null){var payload
=domDoc
.getResponseHeader('X-KSSCOMMANDS');if(payload
){try{dom
=(new DOMParser()).parseFromString(payload
,"text/xml")} catch(e
){throw kukit
.err
.responseParsingError(kukit
.E
)}
217 commandstags
=kukit
.dom
.getNsTags(dom
,'commands');if(commandstags
.length
!=1){dom
=null}}
218 if(dom
==null){var payload
=domDoc
.getResponseHeader('X-KSSCOMMANDS');if(payload
){try{dom
=(new DOMParser()).parseFromString(payload
,"text/xml")} catch(e
){throw kukit
.err
.responseParsingError(kukit
.E
)}
219 commandstags
=kukit
.dom
.getNsTags(dom
,'commands');if(commandstags
.length
!=1){dom
=null}} else{throw kukit
.err
.responseParsingError(kukit
.E
)}}
220 if(dom
==null){throw kukit
.err
.responseParsingError(msg
)}
221 var commands
=kukit
.dom
.getNsTags(dom
,'command');if(commands
.length
==0){return}
222 var command_processor
=new kukit
.cp
.CommandProcessor();command_processor
.parseCommands(commands
,domDoc
);kukit
.engine
.beginSetupEventsCollection();command_processor
.executeCommands(this.oper
);kukit
.engine
.finishSetupEventsCollection()};this.processError=function(errorcommand
){var error_action
=null;if(this.oper
.eventRule
){var error_action
=this.oper
.eventRule
.actions
.getErrorActionFor(this.oper
.action
)}
223 if(error_action
){error_action
.execute(this.oper
)} else{throw kukit
.err
.responseParsingError(kukit
.E
)}}
224 if(dom
==null){throw kukit
.err
.responseParsingError(msg
)}
225 var commands
=kukit
.dom
.getNsTags(dom
,'command');if(commands
.length
==0){return}
226 var command_processor
=new kukit
.cp
.CommandProcessor();command_processor
.parseCommands(commands
,domDoc
);kukit
.engine
.beginSetupEventsCollection();command_processor
.executeCommands(this.oper
);kukit
.engine
.finishSetupEventsCollection()};this.processError=function(errorcommand
){var error_action
=null;if(this.oper
.eventRule
){var error_action
=this.oper
.eventRule
.actions
.getErrorActionFor(this.oper
.action
)}
227 if(error_action
){error_action
.execute(this.oper
)} else{}}};sa
.ServerAction=function(){this.initialize
.apply(this,arguments
)};sa
.ServerAction
.prototype=new sa
.ServerActionBase()}();kukit
.rm
=new function(){var rm
=this;rm
._rid
=0;var _RequestItem=function(){this.initialize=function(sendHook
,url
,timeoutHook
,timeout
,now
){if(typeof(now
)=='undefined'){now
=(new Date()).valueOf()}
228 this.sent
=now
;this.expire
=now
+timeout
;this.handled
=false;this.sendHook
=sendHook
;this.url
=url
;this.timeoutHook
=timeoutHook
;this.rid
=rm
._rid
;rm
._rid
++;if(rm
._rid
>=10000000000){rm
._rid
=0}};this.callTimeoutHook=function(){if(this.timeoutHook
){this.timeoutHook(this)}};this.setReceivedCallback=function(func
){this._receivedCallback
=func
};this.receivedResult=function(now
){var result
=this._receivedCallback(this,now
);this._receivedCallback
=null;return result
};this.initialize
.apply(this,arguments
)};rm
.TestRequestItem=function(){kukit
.logWarning('Use class [rm.TestRequestItem] only in tests !');this.initialize
.apply(this,arguments
)};rm
.TestRequestItem
.prototype=new _RequestItem();var _TimerQueue=function(){this.initialize=function(callback
){this.callback
=callback
;this.queue
=new kukit
.ut
.SortedQueue(this._sentSort
);this.count
=0};this._sentSort=function(a
,b
){if(a
.expire
<b
.expire
) return-1;else if(a
.expire
>b
.expire
) return+1;else return 0};this.push=function(item
){this.queue
.push(item
);this.count
+=1};this.pop=function(item
){if(typeof(item
)=='undefined'||item
.handled
){return false} else{item
.handled
=true;this.count
-=1;return true}};this.handleExpiration=function(now
){if(typeof(now
)=='undefined'){now
=(new Date()).valueOf()}
229 var to
;for(to
=0;to
<this.queue
.size();to
++){var item
=this.queue
.get(to
);if(!item
.handled
){if(item
.expire
>now
){break} else{item
.handled
=true;this.count
-=1;this.callback(item
)}}}
230 this.queue
.popn(to
);var front
=this.queue
.front();var next_expire
=null;if(front
){next_expire
=front
.expire
}
231 return next_expire
};this.initialize
.apply(this,arguments
)};rm
.TestTimerQueue=function(){kukit
.logWarning('Use class [rm.TestTimerQueue] only in tests !');this.initialize
.apply(this,arguments
)};rm
.TestTimerQueue
.prototype=new _TimerQueue();rm
.RequestManager=function(){this.initialize=function(name
,maxNr
,schedulerClass
,sendingTimeout
){this.waitingQueue
=new kukit
.ut
.FifoQueue();this.sentNr
=0;var self
=this;var timeoutItem=function(item
){self
.timeoutItem(item
)};this.timerQueue
=new _TimerQueue(timeoutItem
);if(typeof(name
)=='undefined'){name
=null}
232 this.name
=name
;var nameString
='';if(name
!=null){nameString
='['+name
+'] '}
233 this.nameString
=nameString
;if(typeof(maxNr
)=='undefined'||maxNr
==null){maxNr
=4}
234 this.maxNr
=maxNr
;var checkTimeout=function(){self
.checkTimeout()};if(typeof(schedulerClass
)=='undefined'){schedulerClass
=kukit
.ut
.Scheduler
}
235 this.timeoutScheduler
=new schedulerClass(checkTimeout
);this.spinnerEvents
={'off':[],'on':[]};this.spinnerState
=false;if(typeof(sendingTimeout
)!='undefined'&&sendingTimeout
!=null){this.sendingTimeout
=sendingTimeout
}};this.setSpinnerState=function(newState
){if(this.spinnerState
!=newState
){this.spinnerState
=newState
;var events
=this.spinnerEvents
[newState
?'on':'off'];for(var i
=0;i
<events
.length
;i
++){events
[i
]()}}};this.pushWaitingRequest=function(item
,now
){this.waitingQueue
.push(item
);this.checkTimeout(now
)};this.popWaitingRequest=function(){var q
=this.waitingQueue
;while(!q
.empty()&&q
.front().handled
){q
.pop()}
236 if(!q
.empty()){return q
.pop()} else{return null}};this.pushSentRequest=function(item
,now
){this.sentNr
+=1;this.setSpinnerState(true);this.checkTimeout(now
);var self
=this;var func=function(item
,now
){return self
.receiveItem(item
,now
)};item
.setReceivedCallback(func
);item
.sendHook(item
)};this.checkTimeout=function(now
){var nextWake
=this.timerQueue
.handleExpiration(now
);if(nextWake
){nextWake
+=50} else{this.setSpinnerState(false)}
237 this.timeoutScheduler
.setNextWakeAtLeast(nextWake
)};this.popSentRequest=function(item
){var success
=this.timerQueue
.pop(item
);this.sentNr
-=1;return success
};this.isSentRequestQueueFull=function(){return(this.sentNr
>=this.maxNr
)};this.receivedResult=function(item
,now
){var success
=this.popSentRequest(item
);var waiting
=this.popWaitingRequest();if(waiting
!=null){this.pushSentRequest(waiting
,now
)} else{this.setSpinnerState(false)}
238 return success
};this.receiveItem=function(item
,now
){var success
=this.receivedResult(item
,now
);return success
};this.timeoutItem=function(item
){item
.callTimeoutHook()};this.notifyServer=function(sendHook
,url
,timeoutHook
,timeout
,now
){if(typeof(timeout
)=='undefined'){timeout
=this.sendingTimeout
}
239 var item
=new _RequestItem(sendHook
,url
,timeoutHook
,timeout
,now
);this.timerQueue
.push(item
);if(!this.isSentRequestQueueFull()){this.pushSentRequest(item
,now
)} else{this.pushWaitingRequest(item
,now
)}};this.registerSpinnerEvent=function(func
,state
){this.spinnerEvents
[state
?'on':'off'].push(func
)};this.initialize
.apply(this,arguments
)};rm
.RequestManager
.prototype.sendingTimeout
=8000}();kukit
.cp
=new function(){var cp
=this;cp
.CommandProcessor=function(){this.initialize=function(){this.commands
=new Array()};this.parseCommands=function(commands
,transport
){for(var y
=0;y
<commands
.length
;y
++){var command
=commands
[y
];this.parseCommand(command
,transport
);var lastcommand
=this.commands
[this.commands
.length
-1];if(lastcommand
.name
=='error'){throw kukit
.err
.explicitError(lastcommand
)}}};this.parseCommand=function(command
,transport
){var selector
="";var params
={};var name
="";selector
=command
.getAttribute("selector");name
=command
.getAttribute("name");type
=command
.getAttribute("selectorType");if(name
==null)
240 name
="";var childNodes
=command
.childNodes
;for(var n
=0;n
<childNodes
.length
;n
++){var childNode
=childNodes
[n
];if(childNode
.nodeType
!=1)
241 continue;if(childNode
.localName
){if(childNode
.localName
.toLowerCase()!="param"){throw new Error('Bad payload, expected param')}} else{if(childNode
.nodeName
.toLowerCase()!="param"){throw new Error('Bad payload, expected param (IE)')}}
242 var data
=childNode
.getAttribute('name');if(data
!=null){var childCount
=childNode
.childNodes
.length
;var result
;if(childCount
==0){result
=''} else{result
=childNode
.firstChild
.nodeValue
}
243 params
[data
]=result
} else{throw new Error('Bad payload, expected attribute "name"')}}
244 var command
=new kukit
.cr
.makeCommand(selector
,name
,type
,params
,transport
);this.addCommand(command
)};this.addCommand=function(command
){this.commands
[this.commands
.length
]=command
};this.executeCommands=function(oper
){if(typeof(oper
)=='undefined'||oper
==null){oper
=new kukit
.op
.Oper()}
245 var commands
=this.commands
;for(var y
=0;y
<commands
.length
;y
++){var command
=commands
[y
];command
.execute(oper
)}};this.initialize
.apply(this,arguments
)}}();kukit
.sr
=new function(){var sr
=this;sr
.pproviderSelRegistry
=new kukit
.pr
.ValueProviderRegistry();var _AnyPP=function(){this.check=function(args
){};this.eval=function(args
,node
,defaultParameters
){var f
=kukit
.selectorTypesGlobalRegistry
.get(this.selector_type
);return f(args
[0],node
,defaultParameters
,node
)}};sr
.pproviderSelRegistry
.register('',_AnyPP
);sr
.makeAnyPP=function(selector_type
){var pp=function(){};pp
.prototype=new _AnyPP();pp
.prototype.selector_type
=selector_type
;return pp
};var _PassnodePP=function(){this.check=function(args
){};this.eval=function(args
,node
,defaultParameters
){var value
=defaultParameters
[args
[0]];if(typeof(value
)=='undefined'){throw new Error(kukit
.E
)}
246 nodes
=[value
];return nodes
}};sr
.pproviderSelRegistry
.register('passnode',_PassnodePP
,'selection');var _SelectorTypeRegistry=function(){this.initialize=function(){this.mapping
={}};this.register=function(name
,func
){if(typeof(func
)=='undefined'){throw new Error('Func is mandatory.')}
247 this.mapping
[name
]=func
;var pp
=sr
.makeAnyPP(name
);kukit
.pprovidersGlobalRegistry
.register(name
,pp
,'selection')};this.get=function(name
){if(!name
){name
=this.defaultSelectorType
}
248 var result
=this.mapping
[name
];return result
};this.initialize
.apply(this,arguments
)};_SelectorTypeRegistry
.prototype.defaultSelectorType
='css';kukit
.selectorTypesGlobalRegistry
=new _SelectorTypeRegistry();kukit
.selectorTypesGlobalRegistry
.register('htmlid', function(expr
,node
){var nodes
=[];var node
=document
.getElementById(expr
);if(node
){nodes
.push(node
)}
249 return nodes
});kukit
.selectorTypesGlobalRegistry
.register('css', function(expr
,node
){var nodes
=kukit
.dom
.cssQuery(expr
);return nodes
});kukit
.selectorTypesGlobalRegistry
.register('samenode', function(expr
,node
){nodes
=[node
];return nodes
});kukit
.selectorTypesGlobalRegistry
.register('parentnode', function(expr
,node
){var selectednodes
=kukit
.dom
.cssQuery(expr
);var parentnodes
=[];var parentnode
=node
.parentNode
;while(parentnode
.parentNode
){parentnodes
.push(parentnode
);parentnode
=parentnode
.parentNode
}
250 var results
=[];for(var i
=0;i
<selectednodes
.length
;i
++){var inchain
=false;for(var j
=0;j
<parentnodes
.length
;j
++){if(selectednodes
[i
]===parentnodes
[j
]){inchain
=true}}
251 if(inchain
){results
.push(selectednodes
[i
])}}
252 return results
})}();kukit
.fo
=new function(){var fo
=this;var _dictPrefix
='';var _dictSeparator
='.';var _dictPostfix
=':record';var _FormQueryElem=function(){this.initialize=function(name
,value
){this.name
=name
;this.value
=value
};this.encode=function(){return this.name
+"="+encodeURIComponent(this.value
)};this.initialize
.apply(this,arguments
)};fo
.FormQuery=function(){this.initialize=function(){this.l
=[]};this.appendElem=function(name
,value
){if(value
==null){}
253 else if(typeof(value
)=='string'){var elem
=new _FormQueryElem(name
,value
);this.l
.push(elem
)}
254 else if(typeof(value
)=='object'&&typeof(value
.length
)=='number'&&typeof(value
.pop
)=='function'){for(var i
=0;i
<value
.length
;i
++){var elem
=new _FormQueryElem(name
,value
[i
]);this.l
.push(elem
)}}
255 else if(typeof(value
)=='object'){for(var key
in value
){var qkey
=_dictPrefix
+name
+_dictSeparator
;qkey
+=key
+_dictPostfix
;var elem
=new _FormQueryElem(qkey
,value
[key
]);this.l
.push(elem
)}}};this.encode=function(){var poster
=[];for(var i
=0;i
<this.l
.length
;i
++){poster
[poster
.length
]=this.l
[i
].encode()}
256 return poster
.join("&")};this.toDict=function(){var d
={};for(var i
=0;i
<this.l
.length
;i
++){var elem
=this.l
[i
];d
[elem
.name
]=elem
.value
}
257 return d
};this.initialize
.apply(this,arguments
)};var findContainer=function(node
,func
){while(node
!=null){if(func(node
)){return node
}
258 node
=node
.parentNode
}
259 return null};fo
.CurrentFormLocator=function(){this.initialize=function(target
){this.target
=target
};this.queryForm=function(){return findContainer(this.target
, function(node
){if(!node
.nodeName
){return false}
260 if(node
.nodeName
.toLowerCase()=="form"){return true} else{return false}})};this.getForm=function(){var form
=this.queryForm();if(!form
){return null}
261 return form
};this.initialize
.apply(this,arguments
)};fo
.NamedFormLocator=function(){this.initialize=function(formname
){this.formname
=formname
};this.queryForm=function(){return document
.forms
[this.formname
]};this.initialize
.apply(this,arguments
)};fo
.NamedFormLocator
.prototype=new fo
.CurrentFormLocator();fo
.getValueOfFormElement=function(element
){this.fieldUpdateRegistry
.doUpdate(element
);if(element
.disabled
){return null}
262 if(element
.selectedIndex
!=undefined){if(!element
.multiple
){if(element
.selectedIndex
<0){value
=""} else{var option
=element
.options
[element
.selectedIndex
];value
=option
.value
||option
.text
}} else{var value
=[];for(i
=0;i
<element
.options
.length
;i
++){var option
=element
.options
[i
];if(option
.selected
){value
.push(option
.value
||option
.text
)}}}} else if(typeof element
.length
!='undefined'&&((typeof element
[0]!='undefined'&&element
[0].type
=="radio")||(typeof element
.item(0)!='undefined'&&element
.item(0).type
=="radio"))){var radioList
=element
;value
=null;for(var i
=0;i
<radioList
.length
;i
++){var radio
=radioList
[i
]||radioList
.item(i
);if(radio
.checked
){value
=radio
.value
}}} else if(element
.type
=="radio"||element
.type
=="checkbox"){if(element
.checked
){value
=element
.value
} else{value
=null}} else if((element
.tagName
.toLowerCase()=='textarea')||(element
.tagName
.toLowerCase()=='input'&&element
.type
!='submit'&&element
.type
!='reset')){value
=element
.value
} else{value
=null}
263 return value
};fo
.getFormVar=function(locator
,name
){var form
=locator
.getForm();if(!form
)
264 return null;var value
=null;var element
=form
[name
];if(element
){var value
=fo
.getValueOfFormElement(element
)}
265 return value
};fo
.getAllFormVars=function(locator
,collector
){var form
=locator
.getForm();if(!form
)
266 return collector
.result
;var elements
=form
.elements
;for(var y
=0;y
<elements
.length
;y
++){var element
=elements
[y
];var value
=fo
.getValueOfFormElement(element
);if(value
!=null){collector
.add(element
.name
,value
)}}
267 return collector
.result
};var _FieldUpdateRegistry=function(){this.initialize=function(){this.editors
={}};this.register=function(node
,editor
){var hash
=kukit
.rd
.hashNode(node
);if(typeof(this.editors
[hash
])!='undefined'){throw new Error(kukit
.E
)}
268 this.editors
[hash
]=editor
;editor
.doInit()};this.doUpdate=function(node
){var hash
=kukit
.rd
.hashNode(node
);var editor
=this.editors
[hash
];if(typeof(editor
)!='undefined'){editor
.doUpdate(node
)}};this.initialize
.apply(this,arguments
)};this.fieldUpdateRegistry
=new _FieldUpdateRegistry();var _FormValueProvider=function(){this.check=function(args
){};this.eval=function(args
,node
){var locator
=new fo
.NamedFormLocator(args
[0]);var collector
=new kukit
.ut
.TupleCollector();return fo
.getAllFormVars(locator
,collector
)}};kukit
.pprovidersGlobalRegistry
.register('form',_FormValueProvider
,'formquery');var _CurrentFormValueProvider=function(){this.check=function(args
){};this.eval=function(args
,node
){var locator
=new fo
.CurrentFormLocator(node
);var collector
=new kukit
.ut
.TupleCollector();return fo
.getAllFormVars(locator
,collector
)}};kukit
.pprovidersGlobalRegistry
.register('currentForm',_CurrentFormValueProvider
,'formquery');fo
.getCurrentForm=function(target
){return new fo
.CurrentFormLocator(target
).getForm()};fo
.getFormVarFromCurrentForm=function(target
,name
){return fo
.getFormVar(new fo
.CurrentFormLocator(target
),name
)};fo
.getFormVarFromNamedForm=function(formname
,name
){return fo
.getFormVar(new fo
.NamedFormLocator(formname
),name
)};fo
.getAllFormVarsFromCurrentForm=function(target
){return fo
.getAllFormVars(new fo
.CurrentFormLocator(target
),new kukit
.ut
.DictCollector())};fo
.getAllFormVarsFromNamedForm=function(formname
){return fo
.getAllFormVars(new fo
.NamedFormLocator(formname
),new kukit
.ut
.DictCollector())}}();kukit
.pl
=new function(){var pl
=this;pl
.getTargetForBrowserEvent=function(e
){if(!e
) var e
=window
.event
;var target
=null;if(e
.target
){target
=e
.target
} else if(e
.srcElement
){target
=e
.srcElement
}
269 return target
};pl
.registerBrowserEvent=function(oper
,filter
,eventName
){var func_to_bind
=oper
.makeExecuteActionsHook(filter
);if(!eventName
)
270 eventName
=oper
.getEventName();var func=function(e
){var target
=pl
.getTargetForBrowserEvent(e
);if(oper
.parms
.allowbubbling
||target
==oper
.node
){var exc
;var success
;try{success
=func_to_bind({'browserevent':e
})} catch(exc1
){exc
=exc1
}
271 if(success
||exc
){if(oper
.parms
.preventdefault
){if(e
.preventDefault
)
272 e
.preventDefault();try{e
.returnValue
=false} catch(exc2
){}}
273 if(oper
.parms
.preventbubbling
){if(!e
) var e
=window
.event
;e
.cancelBubble
=true;if(e
.stopPropagation
) e
.stopPropagation()}}
274 if(exc
!=null){throw exc
}}};kukit
.ut
.registerEventListener(oper
.node
,eventName
,func
);if(oper
.parms
.preventdefault
&&kukit
.HAVE_SAFARI
&&(oper
.parms
.allowbubbling
||eventName
=='click'&&oper
.node
.tagName
.toLowerCase()=='a')){oper
.node
.onclick
=function cancelClickSafari(){return false}}};pl
.NativeEventBinder=function(){this.__bind__node=function(name
,func_to_bind
,oper
){this.__bind__(name
,func_to_bind
,oper
)};this.__bind__nodeorwindow=function(name
,func_to_bind
,oper
){if(oper
.node
==null){oper
.node
=window
}
275 this.__bind__(name
,func_to_bind
,oper
)};this.__bind__window=function(name
,func_to_bind
,oper
){oper
.node
=window
;this.__bind__(name
,func_to_bind
,oper
)};this.__bind__nodeordocument=function(name
,func_to_bind
,oper
){if(oper
.node
==null){oper
.node
=document
}
276 this.__bind__(name
,func_to_bind
,oper
)};this.__bind__=function(name
,func_to_bind
,oper
){oper
.evaluateParameters([],{'preventdefault':'','allowbubbling':'','preventbubbling':''});oper
.evalBool('preventdefault');oper
.evalBool('allowbubbling');oper
.evalBool('preventbubbling');if(oper
.parms
.preventdefault
){if(name
!='click'){throw new Error(kukit
.E
)}}
277 pl
.registerBrowserEvent(oper
,null,name
)};this.__bind_key__=function(name
,func_to_bind
,oper
){oper
.evaluateParameters([],{'preventdefault':'true','allowbubbling':'','preventbubbling':'','keycodes':''});oper
.evalList('keycodes');oper
.evalBool('preventdefault');oper
.evalBool('allowbubbling');oper
.evalBool('preventbubbling');var selected_keycodes_only
=false;if(oper
.parms
.keycodes
.length
>0){var keycodes
={};for(var i
=0;i
<oper
.parms
.keycodes
.length
;i
++){var keyCode
=oper
.parms
.keycodes
[i
];keycodes
[keyCode
]=true}
278 selected_keycodes_only
=true}
279 var filter=function(oper
){var keyCode
=oper
.browserevent
.keyCode
;if(keyCode
==0){keyCode
=oper
.browserevent
.charCode
} else{if(keyCode
>=65&&keyCode
<=90&&oper
.browserevent
.shiftKey
==false){keyCode
=keyCode
+32}}
280 if(keyCode
){keyCode
=keyCode
.toString()} else{kukit
.logWarning(keyCode
);keyCode
='0'}
281 kukit
.log(keyCode
);oper
.defaultParameters
={keycode
:keyCode
};if(selected_keycodes_only
){if(keyCode
=='0'){return false} else{return keycodes
[keyCode
]}} else{return true}};pl
.registerBrowserEvent(oper
,filter
)}};pl
.TimeoutEventBinder=function(){this.initialize=function(){this.counters
={}};this.__bind__=function(name
,func_to_bind
,oper
){oper
.evaluateParameters(['delay'],{'repeat':'true'});oper
.evalBool('repeat');var key
=oper
.eventRule
.getIndex();if(!(oper
.parms
.repeat
&&this.counters
[key
])){var f=function(){if(oper
.node
!=null&&!oper
.node
.parentNode
){this.clear()} else{func_to_bind()}};var delay
=oper
.parms
.delay
;var repeat
=oper
.parms
.repeat
;var counter
=new kukit
.ut
.TimerCounter(delay
,f
,repeat
);this.counters
[key
]=counter
;counter
.start()}};this.initialize
.apply(this,arguments
)};pl
.LoadEventBinder=function(){this.processParameters=function(oper
,iload
){if(!oper
){return}
282 if(iload
){oper
.evaluateParameters(['autodetect'],{'initial':'true','insert':'true'});oper
.evalBool('autodetect')} else{oper
.evaluateParameters([],{'initial':'true','insert':'true'})}
283 oper
.evalBool('initial');oper
.evalBool('insert');var phase
;if(oper
.node
==null){phase
=1} else{phase
=oper
.node
._kukitMark
}
284 if(phase
==1&&!oper
.parms
.initial
){return}
285 if(phase
==2&&!oper
.parms
.insert
){return}
286 return oper
};this.__bind__=function(opers_by_eventName
){var loadoper
=opers_by_eventName
.load
;var iloadoper
=opers_by_eventName
.iload
;loadoper
=this.processParameters(loadoper
);iloadoper
=this.processParameters(iloadoper
,true);var anyoper
=loadoper
||iloadoper
;if(!anyoper
){return}
287 if(anyoper
.node
!=null&&anyoper
.node
.tagName
.toLowerCase()=='iframe'){if(loadoper
&&!iloadoper
){iloadoper
=loadoper
;loadoper
=null;iloadoper
.parms
.autodetect
=false}} else{if(iloadoper
){throw new Error(kukit
.E
)}}
288 if(loadoper
){var func_to_bind
=loadoper
.makeExecuteActionsHook();var remark
='';kukit
.engine
.bindScheduler
.addPost(func_to_bind
,remark
)}
289 if(iloadoper
){var phase
=iloadoper
.node
._kukitMark
;if(phase
==2||(phase
==1&&kukit
.engine
.initializedOnDOMLoad
)){var g=function(){var f=function(){var func_to_bind
=iloadoper
.makeExecuteActionsHook();var remark
='';kukit
.engine
.bindScheduler
.addPost(func_to_bind
,remark
)};new kukit
.dom
.EmbeddedContentLoadedScheduler(iloadoper
.node
.id
,f
,iloadoper
.parms
.autodetect
)};var remark
='';kukit
.engine
.bindScheduler
.addPost(g
,remark
)} else{var func_to_bind
=iloadoper
.makeExecuteActionsHook();var remark
='';kukit
.engine
.bindScheduler
.addPost(func_to_bind
,remark
)}}}};pl
.SpinnerEventBinder=function(){this.initialize=function(){this.state
=false;var self
=this;var _timeoutSetState=function(spinnerevent
){self
.timeoutSetState(spinnerevent
)};this.scheduler
=new kukit
.ut
.Scheduler(_timeoutSetState
)};this.__bind__=function(name
,func_to_bind
,oper
){oper
.evaluateParameters([],{'laziness':0});oper
.evalInt('laziness');var state_to_bind
=(name
=='spinneron');var self
=this;var func=function(){self
.setState(func_to_bind
,state_to_bind
,oper
.parms
.laziness
)};kukit
.engine
.requestManager
.registerSpinnerEvent(func
,state_to_bind
)};this.setState=function(func_to_bind
,state
,laziness
){this.func_to_bind
=func_to_bind
;this.state
=state
;var now
=(new Date()).valueOf();var wakeUp
=now
+laziness
;this.scheduler
.setNextWakeAtLeast(wakeUp
)};this.timeoutSetState=function(){var func
=this.func_to_bind
;func()};this.initialize
.apply(this,arguments
)}}();kukit
.eventsGlobalRegistry
.register(null,'blur',kukit
.pl
.NativeEventBinder
,'__bind__nodeorwindow',null);kukit
.eventsGlobalRegistry
.register(null,'focus',kukit
.pl
.NativeEventBinder
,'__bind__nodeorwindow',null);kukit
.eventsGlobalRegistry
.register(null,'resize',kukit
.pl
.NativeEventBinder
,'__bind__nodeorwindow',null);kukit
.eventsGlobalRegistry
.register(null,'click',kukit
.pl
.NativeEventBinder
,'__bind__nodeordocument',null);kukit
.eventsGlobalRegistry
.register(null,'dblclick',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'mousedown',kukit
.pl
.NativeEventBinder
,'__bind__nodeordocument',null);kukit
.eventsGlobalRegistry
.register(null,'mouseup',kukit
.pl
.NativeEventBinder
,'__bind__nodeordocument',null);kukit
.eventsGlobalRegistry
.register(null,'mousemove',kukit
.pl
.NativeEventBinder
,'__bind__nodeordocument',null);kukit
.eventsGlobalRegistry
.register(null,'mouseover',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'mouseout',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'change',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'reset',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'select',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'submit',kukit
.pl
.NativeEventBinder
,'__bind__node',null);kukit
.eventsGlobalRegistry
.register(null,'keydown',kukit
.pl
.NativeEventBinder
,'__bind_key__',null);kukit
.eventsGlobalRegistry
.register(null,'keypress',kukit
.pl
.NativeEventBinder
,'__bind_key__',null);kukit
.eventsGlobalRegistry
.register(null,'keyup',kukit
.pl
.NativeEventBinder
,'__bind_key__',null);kukit
.eventsGlobalRegistry
.register(null,'timeout',kukit
.pl
.TimeoutEventBinder
,'__bind__',null);kukit
.eventsGlobalRegistry
.registerForAllEvents(null,['load','iload'],kukit
.pl
.LoadEventBinder
,'__bind__',null,'Node');kukit
.eventsGlobalRegistry
.register(null,'spinneron',kukit
.pl
.SpinnerEventBinder
,'__bind__',null);kukit
.eventsGlobalRegistry
.register(null,'spinneroff',kukit
.pl
.SpinnerEventBinder
,'__bind__',null);kukit
.actionsGlobalRegistry
.register('error', function(oper
){throw new Error('The builtin error action should never execute.')});kukit
.commandsGlobalRegistry
.registerFromAction('error',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register('logDebug', function(oper
){var name
='[logDebug] action';oper
.evaluateParameters([],{'message':'[logDebug] action'},name
);var message
=oper
.parms
.message
;kukit
.logDebug(message
)});kukit
.commandsGlobalRegistry
.registerFromAction('logDebug',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register('log', function(oper
){oper
.evaluateParameters([],{'message':'Log action'},'log action');var message
=oper
.parms
.message
;kukit
.log(message
)});kukit
.commandsGlobalRegistry
.registerFromAction('log',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register('alert', function(oper
){oper
.evaluateParameters([],{'message':'Alert action'},'alert action');var message
=oper
.parms
.message
;alert(message
)});kukit
.commandsGlobalRegistry
.registerFromAction('alert',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register('replaceInnerHTML', function(oper
){oper
.evaluateParameters(['html'],{'withKssSetup':true});oper
.evalBool('withKssSetup');var node
=oper
.node
;node
.innerHTML
=oper
.parms
.html
;var insertedNodes
=[];for(var i
=0;i
<node
.childNodes
.length
;i
++){insertedNodes
.push(node
.childNodes
[i
])}
290 if(oper
.parms
.withKssSetup
){kukit
.engine
.setupEvents(insertedNodes
)}});kukit
.commandsGlobalRegistry
.registerFromAction('replaceInnerHTML',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('replaceHTML', function(oper
){oper
.evaluateParameters(['html'],{'withKssSetup':true});oper
.evalBool('withKssSetup');var node
=oper
.node
;var elements
=kukit
.dom
.parseHTMLNodes(oper
.parms
.html
);var length
=elements
.length
;if(length
>0){var parentNode
=node
.parentNode
;var insertedNodes
=[];var next
=elements
[length
-1];parentNode
.replaceChild(next
,node
);insertedNodes
.push(next
);for(var i
=length
-2;i
>=0;i
--){var inserted
=parentNode
.insertBefore(elements
[i
],next
);insertedNodes
.push(inserted
);next
=inserted
}
291 if(oper
.parms
.withKssSetup
){kukit
.engine
.setupEvents(insertedNodes
)}}});kukit
.commandsGlobalRegistry
.registerFromAction('replaceHTML',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('setAttribute', function(oper
){oper
.evaluateParameters(['name','value'],{});if(oper
.parms
.name
.toLowerCase()=='style'){throw new Error(kukit
.E
)}
292 kukit
.dom
.setAttribute(oper
.node
,oper
.parms
.name
,oper
.parms
.value
)});kukit
.commandsGlobalRegistry
.registerFromAction('setAttribute',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('setKssAttribute', function(oper
){oper
.evaluateParameters(['name','value'],{});kukit
.dom
.setKssAttribute(oper
.node
,oper
.parms
.name
,oper
.parms
.value
)});kukit
.commandsGlobalRegistry
.registerFromAction('setKssAttribute',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('setStyle', function(oper
){oper
.evaluateParameters(['name','value'],{});oper
.node
.style
[oper
.parms
.name
]=oper
.parms
.value
});kukit
.commandsGlobalRegistry
.registerFromAction('setStyle',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('addClass', function(oper
){oper
.evaluateParameters(['value'],{});kukit
.dom
.addClassName(oper
.node
,oper
.parms
.value
)});kukit
.commandsGlobalRegistry
.registerFromAction('addClass',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('removeClass', function(oper
){oper
.evaluateParameters(['value'],{});kukit
.dom
.removeClassName(oper
.node
,oper
.parms
.value
)});kukit
.commandsGlobalRegistry
.registerFromAction('removeClass',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('insertHTMLAfter', function(oper
){oper
.evaluateParameters(['html'],{'withKssSetup':true});oper
.evalBool('withKssSetup');var content
=kukit
.dom
.parseHTMLNodes(oper
.parms
.html
);var parentNode
=oper
.node
.parentNode
;var toNode
=kukit
.dom
.getNextSiblingTag(oper
.node
);if(toNode
==null){kukit
.dom
.appendChildren(content
,parentNode
)} else{kukit
.dom
.insertBefore(content
,parentNode
,toNode
)}
293 if(oper
.parms
.withKssSetup
){kukit
.engine
.setupEvents(content
)}});kukit
.commandsGlobalRegistry
.registerFromAction('insertHTMLAfter',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('insertHTMLBefore', function(oper
){oper
.evaluateParameters(['html'],{'withKssSetup':true});oper
.evalBool('withKssSetup');var content
=kukit
.dom
.parseHTMLNodes(oper
.parms
.html
);var toNode
=oper
.node
;var parentNode
=toNode
.parentNode
;kukit
.dom
.insertBefore(content
,parentNode
,toNode
);if(oper
.parms
.withKssSetup
){kukit
.engine
.setupEvents(content
)}});kukit
.commandsGlobalRegistry
.registerFromAction('insertHTMLBefore',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('insertHTMLAsLastChild', function(oper
){oper
.evaluateParameters(['html'],{'withKssSetup':true});oper
.evalBool('withKssSetup');var content
=kukit
.dom
.parseHTMLNodes(oper
.parms
.html
);kukit
.dom
.appendChildren(content
,oper
.node
);if(oper
.parms
.withKssSetup
){kukit
.engine
.setupEvents(content
)}});kukit
.commandsGlobalRegistry
.registerFromAction('insertHTMLAsLastChild',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('insertHTMLAsFirstChild', function(oper
){oper
.evaluateParameters(['html'],{'withKssSetup':true});oper
.evalBool('withKssSetup');var content
=kukit
.dom
.parseHTMLNodes(oper
.parms
.html
);var parentNode
=oper
.node
;var toNode
=parentNode
.firstChild
;if(toNode
==null){kukit
.dom
.appendChildren(content
,parentNode
)} else{kukit
.dom
.insertBefore(content
,parentNode
,toNode
)}
294 if(oper
.parms
.withKssSetup
){kukit
.engine
.setupEvents(content
)}});kukit
.commandsGlobalRegistry
.registerFromAction('insertHTMLAsFirstChild',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('deleteNodeAfter', function(oper
){var parentNode
=oper
.node
.parentNode
;var toNode
=kukit
.dom
.getNextSiblingTag(oper
.node
);if(toNode
!=null){parentNode
.removeChild(toNode
)}});kukit
.commandsGlobalRegistry
.registerFromAction('deleteNodeAfter',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('deleteNodeBefore', function(oper
){var parentNode
=oper
.node
.parentNode
;var toNode
=kukit
.dom
.getPreviousSiblingTag(oper
.node
);parentNode
.removeChild(toNode
)});kukit
.commandsGlobalRegistry
.registerFromAction('deleteNodeBefore',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('deleteNode', function(oper
){var parentNode
=oper
.node
.parentNode
;parentNode
.removeChild(oper
.node
)});kukit
.commandsGlobalRegistry
.registerFromAction('deleteNode',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('clearChildNodes', function(oper
){oper
.evaluateParameters([],{'none':false});kukit
.dom
.clearChildNodes(oper
.node
)});kukit
.commandsGlobalRegistry
.registerFromAction('clearChildNodes',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('focus', function(oper
){oper
.evaluateParameters([],{'none':false});kukit
.dom
.focus(oper
.node
)});kukit
.commandsGlobalRegistry
.registerFromAction('focus',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('blur', function(oper
){oper
.evaluateParameters([],{'none':false});kukit
.dom
.blur(oper
.node
)});kukit
.commandsGlobalRegistry
.registerFromAction('blur',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('moveNodeAfter', function(oper
){var node
=oper
.node
;var parentNode
=node
.parentNode
;parentNode
.removeChild(node
);var toNode
=document
.getElementById(oper
.parms
.html_id
);var nextNode
=kukit
.dom
.getNextSiblingTag(toNode
);if(nextNode
==null){toNode
.parentNode
.appendChild(node
)} else{parentNode
.insertBefore(node
,nextNode
)}});kukit
.commandsGlobalRegistry
.registerFromAction('moveNodeAfter',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('moveNodeBefore', function(oper
){var node
=oper
.node
;var toNode
=document
.getElementById(oper
.parms
.html_id
);var parentNode
=toNode
.parentNode
;parentNode
.insertBefore(node
,toNode
)});kukit
.commandsGlobalRegistry
.registerFromAction('moveNodeBefore',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('moveNodeAsLastChild', function(oper
){var node
=oper
.node
;var parentNode
=document
.getElementById(oper
.parms
.html_id
);parentNode
.appendChild(node
)});kukit
.commandsGlobalRegistry
.registerFromAction('moveNodeAsLastChild',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('copyChildNodesFrom', function(oper
){var fromNode
=document
.getElementById(oper
.parms
.html_id
);Sarissa
.copyChildNodes(fromNode
,oper
.node
)});kukit
.commandsGlobalRegistry
.registerFromAction('copyChildNodesFrom',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('copyChildNodesTo', function(oper
){toNode
=document
.getElementById(oper
.parms
.html_id
);Sarissa
.copyChildNodes(oper
.node
,toNode
)});kukit
.commandsGlobalRegistry
.registerFromAction('copyChildNodesTo',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('setStateVar', function(oper
){kukit
.engine
.stateVariables
[oper
.parms
.varname
]=oper
.parms
.value
});kukit
.commandsGlobalRegistry
.registerFromAction('setStateVar',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register('continueEvent', function(oper
){oper
.evaluateParameters(['name'],{'allnodes':'false'},'',true);oper
.evalBool('allnodes','continueEvent');var parms
=oper
.parms
;var binder
=oper
.binder
;var allNodes
=parms
.allnodes
;var actionParameters
={};for(var key
in parms
){if(key
!='name'&&key
!='allnodes'){actionParameters
[key
]=parms
[key
]}}
295 if(parms
.allnodes
){binder
.continueEventAllNodes(parms
.name
,actionParameters
)} else{binder
.continueEvent(parms
.name
,oper
.orignode
,actionParameters
)}});kukit
.commandsGlobalRegistry
.registerFromAction('continueEvent',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register('executeCommand', function(oper
){oper
.evaluateParameters(['name','selector'],{'selectorType':null},'',true);var parms
=oper
.parms
;var actionParameters
={};for(var key
in parms
){if(key
!='name'&&key
!='selector'&&key
!='selectorType'){actionParameters
[key
]=parms
[key
]}}
296 var command
=new kukit
.cr
.makeCommand(parms
.selector
,parms
.name
,parms
.selectorType
,actionParameters
);command
.execute(oper
)});kukit
.actionsGlobalRegistry
.register('toggleClass', function(oper
){kukit
.actionsGlobalRegistry
.BBB_classParms(oper
);var node
=oper
.node
;var className
=oper
.parms
.value
;var nodeclass
=kukit
.dom
.getAttribute(node
,'class');var classFoundAtIndex
=-1;var parts
=nodeclass
.split(' ');for(var i
=0;i
<parts
.length
;i
++){if(parts
[i
]==className
){classFoundAtIndex
=i
}}
297 if(classFoundAtIndex
==-1){parts
.push(className
)} else{parts
.splice(classFoundAtIndex
,1)}
298 kukit
.dom
.setAttribute(node
,'class',parts
.join(' '))});kukit
.commandsGlobalRegistry
.registerFromAction('toggleClass',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('setActionServerTimeout', function(oper
){oper
.evaluateParameters(['value'],{},'',true);oper
.evalInt('value');var value
=oper
.parms
.value
;kukit
.engine
.requestManager
.sendingTimeout
=value
});kukit
.commandsGlobalRegistry
.registerFromAction('replaceInnerHTML',kukit
.cr
.makeSelectorCommand
,'setHtmlAsChild');kukit
.commandsGlobalRegistry
.registerFromAction('replaceHTML',kukit
.cr
.makeSelectorCommand
,'replaceNode');kukit
.commandsGlobalRegistry
.registerFromAction('insertHTMLAfter',kukit
.cr
.makeSelectorCommand
,'addAfter');kukit
.commandsGlobalRegistry
.registerFromAction('deleteNodeAfter',kukit
.cr
.makeSelectorCommand
,'removeNextSibling');kukit
.commandsGlobalRegistry
.registerFromAction('deleteNodeBefore',kukit
.cr
.makeSelectorCommand
,'removePreviousSibling');kukit
.commandsGlobalRegistry
.registerFromAction('deleteNode',kukit
.cr
.makeSelectorCommand
,'removeNode');kukit
.commandsGlobalRegistry
.registerFromAction('clearChildNodes',kukit
.cr
.makeSelectorCommand
,'clearChildren');kukit
.commandsGlobalRegistry
.registerFromAction('copyChildNodesFrom',kukit
.cr
.makeSelectorCommand
,'copyChildrenFrom');kukit
.commandsGlobalRegistry
.registerFromAction('copyChildNodesTo',kukit
.cr
.makeSelectorCommand
,'copyChildrenTo');kukit
.commandsGlobalRegistry
.registerFromAction('setStateVar',kukit
.cr
.makeGlobalCommand
,'setStatevar');kukit
.actionsGlobalRegistry
.register('addClassName', function(oper
){kukit
.actionsGlobalRegistry
.BBB_classParms(oper
);kukit
.actionsGlobalRegistry
.get('addClass')(oper
)});kukit
.commandsGlobalRegistry
.registerFromAction('addClassName',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register('removeClassName', function(oper
){kukit
.actionsGlobalRegistry
.BBB_classParms(oper
);kukit
.actionsGlobalRegistry
.get('removeClass')(oper
)});kukit
.commandsGlobalRegistry
.registerFromAction('removeClassName',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.BBB_classParms=function(oper
){var old
;var has_old
;if(typeof(oper
.parms
.className
)!='undefined'){old
=oper
.parms
.className
;has_old
=true}
299 if(typeof(oper
.parms
.name
)!='undefined'){old
=oper
.parms
.name
;has_old
=true}
300 if(has_old
){if(typeof(oper
.parms
.value
)=='undefined'){oper
.parms
={value
:old
}} else{oper
.parms
={}}}};kukit
.plone
={};if(window
.jq
){jq(function(){kukit
.log('KSS started by jQuery DOMLoad event.');kukit
.bootstrapFromDOMLoad()})}
301 kukit
.actionsGlobalRegistry
.register("plone-initKupu", function(oper
){kukit
.logDebug('Enter plone-initKupu');oper
.evaluateParameters([],{},'plone-initKupu action');if(oper
.node
.tagName
.toLowerCase()!='iframe'){throw kukit
.E
}
302 var divnode
=oper
.node
.parentNode
.parentNode
.parentNode
.parentNode
;var id
=divnode
.id
;if(!id
){throw kukit
.E
}
303 var prefix
='#'+id
+' ';var textarea
=getFromSelector(prefix
+'textarea.kupu-editor-textarea');kukit
.fo
.fieldUpdateRegistry
.register(textarea
,{editor
:null,node
:textarea
,doInit: function(){kukit
.log('Setup Kupu initialization on load event.');var self
=this;initKupuOnLoad=function(){kukit
.log('Initialize Kupu from onload event.');self
.editor
=initPloneKupu(id
)};this.editor
=initPloneKupu(id
);jq(window
).load(initKupuOnLoad
)},doUpdate: function(){this.editor
.saveDataToField(this.node
.form
,this.node
);this.editor
._initialized
=true}});kukit
.logDebug('plone-initKupu action done.')});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initKupu',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-followLink", function(oper
){oper
.evaluateParameters([],{},'plone-followLink action');var url
=oper
.node
.href
;if(url
.substr(0,7)=="http://"){window
.location
.replace(url
)} else if(url
.substr(0,13)=="javascript://"){eval(url
.substr(13))}});kukit
.commandsGlobalRegistry
.registerFromAction('plone-followLink',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-submitCurrentForm", function(oper
){oper
.evaluateParameters([],{},'plone-submitCurrentForm action');window
.onbeforeunload
=null;var form
=new kukit
.fo
.CurrentFormLocator(oper
.node
).getForm();form
.submit()});kukit
.commandsGlobalRegistry
.registerFromAction('plone-submitCurrentForm',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-initFormTabs", function(oper
){oper
.evaluateParameters([],{},'plone-initFormTabs action');if(oper
.node
.tagName
.toLowerCase()!='form'){throw kukit
.E
}
304 var form
=oper
.node
;ploneFormTabbing
.initializeForm(form
)});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initFormTabs',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-initFormProtection", function(oper
){oper
.evaluateParameters([],{},'plone-initFormProtection action');if(oper
.node
.tagName
.toLowerCase()!='form'){throw kukit
.E
}
305 var form
=oper
.node
;if(!window
.onbeforeunload
){window
.onbeforeunload
=new BeforeUnloadHandler().execute
}
306 var tool
=window
.onbeforeunload
.tool
;tool
.addForm(form
)});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initFormProtection',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-formProtectionCheck",
307 function(oper
){oper
.evaluateParameters([],{},'plone-formProtectionCheck action');var binderInfo
=kukit
.engine
.binderInfoRegistry
.getSingletonBinderInfoByName('plone','formProtectionChecked');var binderInstance
=binderInfo
.getBinderInstance();var message
;if(window
.onbeforeunload
){var tool
=window
.onbeforeunload
.tool
;message
=tool
.execute()}
308 var result
=true;if(message
){var confirmMsg
='Are you sure you want to navigate away from this';confirmMsg
+=' page?\n\n'+message
+'\n\nPress OK to continue,';confirmMsg
+=' or Cancel to stay on the current page.';result
=confirm(confirmMsg
)}
309 if(result
){var action
='formProtectionChecked'} else{var action
='formProtectionFailed'}
310 binderInstance
.__continueEvent__(action
,oper
.node
,{})});kukit
.commandsGlobalRegistry
.registerFromAction('plone-formProtectionCheck',kukit
.cr
.makeSelectorCommand
);kukit
.plone
.FormProtectionCheckedEvents=function(){};kukit
.plone
.FormProtectionCheckedEvents
.prototype.__default_failed__=function(name
,oper
){};kukit
.eventsGlobalRegistry
.register('plone','formProtectionChecked',kukit
.plone
.FormProtectionCheckedEvents
,null,null);kukit
.eventsGlobalRegistry
.register('plone','formProtectionFailed',kukit
.plone
.FormProtectionCheckedEvents
,null,'__default_failed__');kukit
.actionsGlobalRegistry
.register("plone-initLockingProtection",
311 function(oper
){oper
.evaluateParameters([],{},'plone-initLockingProtection action');if(oper
.node
.tagName
.toLowerCase()!='form'){throw kukit
.E
}
312 plone
.UnlockHandler
.init()});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initLockingProtection',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-removeLockProtection",
313 function(oper
){oper
.evaluateParameters([],{},'plone-removeLockProtection action');plone
.UnlockHandler
.cleanup()});kukit
.commandsGlobalRegistry
.registerFromAction('plone-removeLockProtection',kukit
.cr
.makeGlobalCommand
);kukit
.actionsGlobalRegistry
.register("plone-initShiftDetection",
314 function(oper
){oper
.evaluateParameters([],{},'plone-initShiftDetection action');kukit
.engine
.stateVariables
['plone-shiftdown']=false;jq(document
).keydown(function(e
){if(e
.keyCode
==16)
315 kukit
.engine
.stateVariables
['plone-shiftdown']=true});jq(document
).keyup(function(e
){if(e
.keyCode
==16)
316 kukit
.engine
.stateVariables
['plone-shiftdown']=false})});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initShiftDetection',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-initCheckBoxSelection",
317 function(oper
){oper
.evaluateParameters([],{},'plone-initCheckBoxSelection action');kukit
.engine
.stateVariables
['plone-foldercontents-firstcheckeditem']=null});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initCheckBoxSelection',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-createCheckBoxSelection",
318 function(oper
){var actionMsg
='plone-createCheckBoxSelection action';oper
.evaluateParameters(['group'],{},actionMsg
);var node
=oper
.node
;var firstItemVarName
='plone-foldercontents-firstcheckeditem';var firstItem
=kukit
.engine
.stateVariables
[firstItemVarName
];if(firstItem
&&kukit
.engine
.stateVariables
['plone-shiftdown']){var group
=oper
.parms
.group
;var allNodes
=jq(group
);var start
=allNodes
.index(firstItem
);var end
=allNodes
.index(firstItem
);if(start
>end
){var temp
=start
;start
=end
;end
=temp
}
319 allNodes
.slice(start
,end
).attr('checked',firstItem
.checked
)}
320 else{kukit
.engine
.stateVariables
[firstItemVarName
]=node
}});kukit
.commandsGlobalRegistry
.registerFromAction('plone-createCheckBoxSelection',kukit
.cr
.makeSelectorCommand
);kukit
.actionsGlobalRegistry
.register("plone-initDragAndDrop",
321 function(oper
){oper
.evaluateParameters(['table'],{},'plone-initDragAndDrop action');var table
=oper
.parms
.table
;ploneDnDReorder
.table
=jq(table
);if(!ploneDnDReorder
.table
.length
)
322 return;ploneDnDReorder
.rows
=jq(table
+" > tr,"+table
+" > tbody > tr");jq(table
+" > tr > td.draggable,"+table
+" > tbody > tr > td.draggable").not('.notDraggable').mousedown(ploneDnDReorder
.doDown
).mouseup(ploneDnDReorder
.doUp
).addClass("draggingHook").css("cursor","ns-resize").html('⣿')});kukit
.commandsGlobalRegistry
.registerFromAction('plone-initDragAndDrop',kukit
.cr
.makeSelectorCommand
);if(typeof(Effect
)!="undefined"){kukit
.HASEFFECTS
=1} else{kukit
.HASEFFECTS
=0}
323 if(kukit
.HASEFFECTS
&&typeof(Effect
.Transitions
)!="undefined"){kukit
.actionsGlobalRegistry
.register("effect", function(oper
){oper
.evaluateParameters([],{'type':'fade'},'scriptaculous effect');var node
=oper
.node
;if(oper
.parms
.type
=='fade'){new Effect
.Fade(node
)} else if(oper
.parms
.type
=='appear'){new Effect
.Appear(node
)} else if(oper
.parms
.type
=='puff'){new Effect
.Puff(node
)} else if(oper
.parms
.type
=='blinddown'){new Effect
.BlindDown(node
)} else if(oper
.parms
.type
=='blindup'){new Effect
.BlindUp(node
)}});kukit
.commandsGlobalRegistry
.registerFromAction('effect',kukit
.cr
.makeSelectorCommand
);this.$=function $(){var results
=[],element
;for(var i
=0;i
<arguments
.length
;i
++){element
=arguments
[i
];if(typeof element
=='string')
324 element
=document
.getElementById(element
);results
.push(Element
.extend(element
))}
325 return results
.length
<2?results
[0]:results
}}
326 kukit
.actionsGlobalRegistry
.register("bindActionMenus", function(oper
){initializeMenus();kukit
.logDebug('Plone menus initialized')});kukit
.log('Plone legacy [initializeMenus] action registered.');kukit
.plonelegacy
={};if(typeof(scanforlinks
)=='undefined'){kukit
.plonelegacy
.bindExternalLinks=function(){}}
327 else{kukit
.plonelegacy
.bindExternalLinks=function(){scanforlinks()}}
328 kukit
.actionsGlobalRegistry
.register("bindExternalLinks", function(oper
){kukit
.plonelegacy
.bindExternalLinks();kukit
.logDebug('Plone external links bound.')});kukit
.log('Plone legacy [bindExternalLinks] action registered.');kukit
.actionsGlobalRegistry
.register("initializeCollapsible", function(oper
){activateCollapsibles()});kukit
.log('Plone legacy [initializeCollapsible] action registered.');kukit
.actionsGlobalRegistry
.register("createTableOfContents", function(oper
){createTableOfContents()});kukit
.commandsGlobalRegistry
.registerFromAction('createTableOfContents',kukit
.cr
.makeGlobalCommand
);kukit
.log('Plone [createTableOfContents] action registered.');