{"dojo.behavior._":{"meta":{"requires":{"common":["dojo.behavior.common"]}}},"dojo.behavior.common":{"meta":{"requires":{"common":["dojo.event.*","dojo.experimental"]},"functions":{"dojo.behavior":{"meta":{"initialized":true,"summary":"","src":" function arrIn(obj, name){\n\t\tif(!obj[name]){ obj[name] = []; }\n\t\treturn obj[name];\n\t}\n\tfunction forIn(obj, scope, func){\n\t\tvar tmpObj = {};\n\t\tfor(var x in obj){\n\t\t\tif(typeof tmpObj[x] == \"undefined\"){\n\t\t\t\tif(!func){\n\t\t\t\t\tscope(obj[x], x);\n\t\t\t\t}else{\n\t\t\t\t\tfunc.call(scope, obj[x], x);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\/\/ FIXME: need a better test so we don't exclude nightly Safari's!\n\tthis.behaviors = {};\n\tthis.add = function(behaviorObj){\n\t\t\/*\tbehavior objects are specified in the following format:\n\t\t *\n\t\t *\t{ \n\t\t *\t \t\"#id\": {\n\t\t *\t\t\t\"found\": function(element){\n\t\t *\t\t\t\t\/\/ ...\n\t\t *\t\t\t},\n\t\t *\n\t\t *\t\t\t\"onblah\": {targetObj: foo, targetFunc: \"bar\"},\n\t\t *\n\t\t *\t\t\t\"onblarg\": \"\/foo\/bar\/baz\/blarg\",\n\t\t *\n\t\t *\t\t\t\"onevent\": function(evt){\n\t\t *\t\t\t},\n\t\t *\n\t\t *\t\t\t\"onotherevent: function(evt){\n\t\t *\t\t\t\t\/\/ ...\n\t\t *\t\t\t}\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\"#id2\": {\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\"#id3\": function(element){\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\/\/ publish the match on a topic\n\t\t *\t\t\"#id4\": \"\/found\/topic\/name\",\n\t\t *\n\t\t *\t\t\/\/ match all direct descendants\n\t\t *\t\t\"#id4 > *\": function(element){\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\/\/ match the first child node that's an element\n\t\t *\t\t\"#id4 > @firstElement\": { ... },\n\t\t *\n\t\t *\t\t\/\/ match the last child node that's an element\n\t\t *\t\t\"#id4 > @lastElement\": { ... },\n\t\t *\n\t\t *\t\t\/\/ all elements of type tagname\n\t\t *\t\t\"tagname\": {\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\/\/ maps to roughly:\n\t\t *\t\t\/\/\tdojo.lang.forEach(body.getElementsByTagName(\"tagname1\"), function(node){\n\t\t *\t\t\/\/\t\tdojo.lang.forEach(node.getElementsByTagName(\"tagname2\"), function(node2){\n\t\t *\t\t\/\/\t\t\tdojo.lang.forEach(node2.getElementsByTagName(\"tagname3\", function(node3){\n\t\t *\t\t\/\/\t\t\t\t\/\/ apply rules\n\t\t *\t\t\/\/\t\t\t});\n\t\t *\t\t\/\/\t\t});\n\t\t *\t\t\/\/\t});\n\t\t *\t\t\"tagname1 tagname2 tagname3\": {\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\".classname\": {\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\n\t\t *\t\t\"tagname.classname\": {\n\t\t *\t\t\t\/\/ ...\n\t\t *\t\t},\n\t\t *\t}\n\t\t *\n\t\t *\tThe \"found\" method is a generalized handler that's called as soon\n\t\t *\tas the node matches the selector. Rules for values that follow also\n\t\t *\tapply to the \"found\" key.\n\t\t *\t\n\t\t *\tThe \"on*\" handlers are attached with dojo.event.connect(). If the\n\t\t *\tvalue is not a function but is rather an object, it's assumed to be\n\t\t *\tthe \"other half\" of a dojo.event.kwConnect() argument object. It\n\t\t *\tmay contain any\/all properties of such a connection modifier save\n\t\t *\tfor the sourceObj and sourceFunc properties which are filled in by\n\t\t *\tthe system automatically. If a string is instead encountered, the\n\t\t *\tnode publishes the specified event on the topic contained in the\n\t\t *\tstring value.\n\t\t *\n\t\t *\tIf the value corresponding to the ID key is a function and not a\n\t\t *\tlist, it's treated as though it was the value of \"found\".\n\t\t *\n\t\t *\/\n\t\tvar tmpObj = {};\n\t\tforIn(behaviorObj, this, function(behavior, name){\n\t\t\tvar tBehavior = arrIn(this.behaviors, name);\n\t\t\tif((dojo.lang.isString(behavior))||(dojo.lang.isFunction(behavior))){\n\t\t\t\tbehavior = { found: behavior };\n\t\t\t}\n\t\t\tforIn(behavior, function(rule, ruleName){\n\t\t\t\tarrIn(tBehavior, ruleName).push(rule);\n\t\t\t});\n\t\t});\n\t}\n\tthis.apply = function(){\n\t\tdojo.profile.start(\"dojo.behavior.apply\");\n\t\tvar r = dojo.render.html;\n\t\t\/\/ note, we apply one way for fast queries and one way for slow\n\t\t\/\/ iteration. So be it.\n\t\tvar safariGoodEnough = (!r.safari);\n\t\tif(r.safari){\n\t\t\t\/\/ Anything over release #420 should work the fast way\n\t\t\tvar uas = r.UA.split(\"AppleWebKit\/\")[1];\n\t\t\tif(parseInt(uas.match(\/[0-9.]{3,}\/)) >= 420){\n\t\t\t\tsafariGoodEnough = true;\n\t\t\t}\n\t\t}\n\t\tif((dj_undef(\"behaviorFastParse\", djConfig) ? (safariGoodEnough) : djConfig[\"behaviorFastParse\"])){\n\t\t\tthis.applyFast();\n\t\t}else{\n\t\t\tthis.applySlow();\n\t\t}\n\t\tdojo.profile.end(\"dojo.behavior.apply\");\n\t}\n\tthis.matchCache = {};\n\tthis.elementsById = function(id, handleRemoved){\n\t\tvar removed = [];\n\t\tvar added = [];\n\t\tarrIn(this.matchCache, id);\n\t\tif(handleRemoved){\n\t\t\tvar nodes = this.matchCache[id];\n\t\t\tfor(var x=0; x= 420){\n\t\t\t\tsafariGoodEnough = true;\n\t\t\t}\n\t\t}\n\t\tif((dj_undef(\"behaviorFastParse\", djConfig) ? (safariGoodEnough) : djConfig[\"behaviorFastParse\"])){\n\t\t\tthis.applyFast();\n\t\t}else{\n\t\t\tthis.applySlow();\n\t\t}\n\t\tdojo.profile.end(\"dojo.behavior.apply\");","instance":"dojo.behavior"}},"dojo.behavior.elementsById":{"meta":{"summary":"","parameters":{"id":{"type":""},"handleRemoved":{"type":""}},"src":" \tvar removed = [];\n\t\tvar added = [];\n\t\tarrIn(this.matchCache, id);\n\t\tif(handleRemoved){\n\t\t\tvar nodes = this.matchCache[id];\n\t\t\tfor(var x=0; x 0 && val2 && val2.length > 0\n\t\t\t&& val1.toLowerCase() == val2.toLowerCase()){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tthis.decorateInputTitles = function(node){\n\t\tvar elms=node.getElementsByTagName(\"input\");\n\t\tif(!elms){return;}\n\t\tvar forms={};\n\t\tfor(var i=0;i 0) {return;}\n\t\tif(!dojo.html.hasClass(node, this.titleClass)){\n\t\t\tdojo.html.prependClass(node, this.titleClass);\n\t\t}\n\t\tnode.value=title;\n\t}\n\tthis.nodeFocused = function(evt){\n\t\tif(!evt){return;}\n\t\tvar node=evt.target;\n\t\tnode.removeAttribute(\"prevesc\");\n\t\tdojo.html.removeClass(node, this.titleClass);\n\t\t\/\/ skip decoration if node has valid value\n\t\tvar value=node.value;\n\t\tvar title=node.getAttribute(\"title\");\n\t\tif (!equals(value,title) && value.length > 0){return;}\n\t\tnode.value=\"\";\n\t}\n\tthis.nodeBlurred = function(evt){\n\t\tif(!evt){return;}\n\t\tvar node=evt.target;\n\t\tif (this.processing[node]){\n\t\t\tthis.cleanupBlurProcess(node);\n\t\t\treturn;\n\t\t}\n\t\tthis.checkNodeValue(node);\n\t\tthis.decorateInput(node);\n\t}\n\tthis.nodeKeyPressed = function(evt){\n\t\tif(!evt){return;}\n\t\tvar node=evt.target;\n\t\tif (evt.keyCode == evt.KEY_ESCAPE) {\n\t\t\tthis.checkNodeValue(node);\n\t\t} else if (this.processing[node]){\n\t\t\tthis.cleanupBlurProcess(node);\n\t\t\treturn;\n\t\t} else {return;}\n\t\tnode.blur();\n\t}\n\tthis.checkNodeValue = function(node){\n\t\t\/\/ prevesc is set to handle two subsequent escape key presses\n\t\tif (!node.getAttribute(\"prevesc\")){\n\t\t\tvar value=node.value;\n\t\t\tvar title=node.getAttribute(\"title\");\n\t\t\tif (value && value.length > 0 && !equals(value,title)){\n\t\t\t\tnode.setAttribute(\"prevesc\",\"1\");\n\t\t\t\tnode.value=\"\";\n\t\t\t\t\/\/ this helps prevent flickering of old value when blurring focus\n\t\t\t\tthis.processing[node]=true;\n\t\t\t\tnode.blur();\n\t\t\t}\n\t\t}\n\t}\n\tthis.cleanupBlurProcess = function(node){\n\t\tdelete this.processing[node];\n\t\tsetTimeout(function(){node.focus();}, 10);\n\t}\n\tthis.clearDecorations = function(evt){\n\t\tif(!evt){return;}\n\t\tvar form=evt.target;\n\t\tif(!form) { return; }\n\t\tvar elms=form.getElementsByTagName(\"input\");\n\t\tfor(var i=0;i 0) {return;}\n\t\tif(!dojo.html.hasClass(node, this.titleClass)){\n\t\t\tdojo.html.prependClass(node, this.titleClass);\n\t\t}\n\t\tnode.value=title;","instance":"dojo.behavior.form"}},"dojo.behavior.form.nodeFocused":{"meta":{"summary":"","parameters":{"evt":{"type":""}},"src":" \tif(!evt){return;}\n\t\tvar node=evt.target;\n\t\tnode.removeAttribute(\"prevesc\");\n\t\tdojo.html.removeClass(node, this.titleClass);\n\t\t\/\/ skip decoration if node has valid value\n\t\tvar value=node.value;\n\t\tvar title=node.getAttribute(\"title\");\n\t\tif (!equals(value,title) && value.length > 0){return;}\n\t\tnode.value=\"\";","instance":"dojo.behavior.form"}},"dojo.behavior.form.nodeBlurred":{"meta":{"summary":"","parameters":{"evt":{"type":""}},"src":" \tif(!evt){return;}\n\t\tvar node=evt.target;\n\t\tif (this.processing[node]){\n\t\t\tthis.cleanupBlurProcess(node);\n\t\t\treturn;\n\t\t}\n\t\tthis.checkNodeValue(node);\n\t\tthis.decorateInput(node);","instance":"dojo.behavior.form"}},"dojo.behavior.form.nodeKeyPressed":{"meta":{"summary":"","parameters":{"evt":{"type":""}},"src":" \tif(!evt){return;}\n\t\tvar node=evt.target;\n\t\tif (evt.keyCode == evt.KEY_ESCAPE) {\n\t\t\tthis.checkNodeValue(node);\n\t\t} else if (this.processing[node]){\n\t\t\tthis.cleanupBlurProcess(node);\n\t\t\treturn;\n\t\t} else {return;}\n\t\tnode.blur();","instance":"dojo.behavior.form"}},"dojo.behavior.form.checkNodeValue":{"meta":{"summary":"","parameters":{"node":{"type":""}},"src":" \tif (!node.getAttribute(\"prevesc\")){\n\t\t\tvar value=node.value;\n\t\t\tvar title=node.getAttribute(\"title\");\n\t\t\tif (value && value.length > 0 && !equals(value,title)){\n\t\t\t\tnode.setAttribute(\"prevesc\",\"1\");\n\t\t\t\tnode.value=\"\";\n\t\t\t\t\/\/ this helps prevent flickering of old value when blurring focus\n\t\t\t\tthis.processing[node]=true;\n\t\t\t\tnode.blur();\n\t\t\t}\n\t\t}","instance":"dojo.behavior.form"}},"dojo.behavior.form.cleanupBlurProcess":{"meta":{"summary":"","parameters":{"node":{"type":""}},"src":" \tdelete this.processing[node];\n\t\tsetTimeout(function(){node.focus();}, 10);","instance":"dojo.behavior.form"}},"dojo.behavior.form.clearDecorations":{"meta":{"summary":"","parameters":{"evt":{"type":""}},"src":" \tif(!evt){return;}\n\t\tvar form=evt.target;\n\t\tif(!form) { return; }\n\t\tvar elms=form.getElementsByTagName(\"input\");\n\t\tfor(var i=0;i