diff --git a/js/boot_editor.js b/js/boot_editor.js new file mode 100644 index 00000000..afa1652e --- /dev/null +++ b/js/boot_editor.js @@ -0,0 +1,422 @@ +/** + * Copyright (C) 2013 KO GmbH + * + * @licstart + * The JavaScript code in this page is free software: you can redistribute it + * and/or modify it under the terms of the GNU Affero General Public License + * (GNU AGPL) as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. The code is distributed + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU AGPL for more details. + * + * As additional permission under GNU AGPL version 3 section 7, you + * may distribute non-source (e.g., minimized or compacted) forms of + * that code without the copy of the GNU GPL normally required by + * section 4, provided you include this license notice and a URL + * through which recipients can access the Corresponding Source. + * + * As a special exception to the AGPL, any HTML file which merely makes function + * calls to this code, and for that purpose includes it by reference shall be + * deemed a separate work for copyright law purposes. In addition, the copyright + * holders of this code give you permission to combine this code with free + * software libraries that are released under the GNU LGPL. You may copy and + * distribute such a system following the terms of the GNU AGPL for this code + * and the LGPL for the libraries. If you modify this code, you may extend this + * exception to your version of the code, but you are not obligated to do so. + * If you do not wish to do so, delete this exception statement from your + * version. + * + * This license applies to this entire compilation. + * @licend + * @source: http://www.webodf.org/ + * @source: http://gitorious.org/webodf/webodf/ + */ + +/* + * bootstrap the editor in different ways. + * this file is meant to be included from HTML and used + * by users who do not want to know much about the inner + * complexity. + * so we need to make it really easy. + * + * including this file will result in the namespace/object + * "webodfEditor" to be available from the HTML side. + * calling webodfEditor.boot() will start the editor. + * the method can also take some parameters to specify + * behaviour. see documentation of that method. + * + */ + +/*global runtime, require, document, alert, gui, window, SessionList, SessionListView, FileReader, Uint8Array */ + +// define the namespace/object we want to provide +// this is the first line of API, the user gets. +var webodfEditor = (function () { + "use strict"; + + var editorInstance = null, + booting = false, + loadedFilename; + + /** + * wait for a network connection through nowjs to establish. + * call the callback when done, when finally failed, or + * when a timeout reached. + * the parameter to the callback is a string with the possible + * values: + * "unavailable", "timeout", "ready" + * + * @param {!function(!string)} callback + * @return {undefined} + */ + function waitForNetwork(callback) { + var net = runtime.getNetwork(), accumulated_waiting_time = 0; + function later_cb() { + if (net.networkStatus === "unavailable") { + runtime.log("connection to server unavailable."); + callback("unavailable"); + return; + } + if (net.networkStatus !== "ready") { + if (accumulated_waiting_time > 8000) { + // game over + runtime.log("connection to server timed out."); + callback("timeout"); + return; + } + accumulated_waiting_time += 100; + runtime.getWindow().setTimeout(later_cb, 100); + } else { + runtime.log("connection to collaboration server established."); + callback("ready"); + } + } + later_cb(); + } + + /** + * extract document url from the url-fragment + * + * @return {?string} + */ + function guessDocUrl() { + var pos, docUrl = String(document.location); + // If the URL has a fragment (#...), try to load the file it represents + pos = docUrl.indexOf('#'); + if (pos !== -1) { + docUrl = docUrl.substr(pos + 1); + } else { + docUrl = "welcome.odt"; + } + return docUrl || null; + } + + function fileSelectHandler(evt) { + var file, files, reader; + files = (evt.target && evt.target.files) || + (evt.dataTransfer && evt.dataTransfer.files); + function onloadend() { + if (reader.readyState === 2) { + runtime.registerFile(file.name, reader.result); + loadedFilename = file.name; + editorInstance.loadDocument(file.name); + } + } + if (files && files.length === 1) { + file = files[0]; + reader = new FileReader(); + reader.onloadend = onloadend; + reader.readAsArrayBuffer(file); + } else { + alert("File could not be opened in this browser."); + } + } + + function enhanceRuntime() { + var openedFiles = {}, + read = runtime.read, + getFileSize = runtime.getFileSize; + runtime.read = function (path, offset, length, callback) { + var array; + if (openedFiles.hasOwnProperty(path)) { + array = new Uint8Array(openedFiles[path], offset, length); + callback(undefined, array); + } else { + return read(path, offset, length, callback); + } + }; + runtime.getFileSize = function (path, callback) { + if (openedFiles.hasOwnProperty(path)) { + return callback(openedFiles[path].byteLength); + } else { + return getFileSize(path, callback); + } + }; + runtime.registerFile = function (path, data) { + openedFiles[path] = data; + }; + } + + function createFileLoadForm() { + var form = document.createElement("form"), + input = document.createElement("input"); + form.appendChild(input); + form.style.display = "none"; + input.id = "fileloader"; + input.setAttribute("type", "file"); + input.addEventListener("change", fileSelectHandler, false); + document.body.appendChild(form); + } + + function load() { + var form = document.getElementById("fileloader"); + if (!form) { + enhanceRuntime(); + createFileLoadForm(); + form = document.getElementById("fileloader"); + } + form.click(); + } + + function save() { + editorInstance.saveDocument(loadedFilename); + } + + /** + * create a new editor instance, and start the editor with + * the given document. + * + * @param {!string} docUrl + * @param {?Object} editorOptions + * @param {?function(!Object)} editorReadyCallback + */ + function createLocalEditor(docUrl, editorOptions, editorReadyCallback) { + var pos; + booting = true; + editorOptions = editorOptions || {}; + editorOptions.memberid = "localuser"; + editorOptions.loadCallback = load; + editorOptions.saveCallback = save; + + runtime.assert(docUrl, "docUrl needs to be specified"); + runtime.assert(editorInstance === null, "cannot boot with instanciated editor"); + + document.getElementById("mainContainer").style.display = ""; + + document.dojoAnchor.require({}, ["webodf/editor/Editor"], + function (Editor) { + runtime.assert(Editor!==undefined, "requiring does not work."); + editorInstance = new Editor(editorOptions); + editorInstance.initAndLoadDocument(docUrl, function (editorSession) { + editorSession.sessionController.setUndoManager(new gui.TrivialUndoManager()); + editorSession.startEditing(); + editorReadyCallback(editorInstance); + }); + } + ); + } + + /** + * assume the network connection is established, create a new editor instance, + * and start the editor on the network. + * + * @param {!string} sessionId + * @param {!string} userid + * @param {?string} token + * @param {?Object} editorOptions + * @param {?function(!Object)} editorReadyCallback + */ + function createNetworkedEditor(sessionId, userid, token, editorOptions, editorReadyCallback) { + + runtime.assert(sessionId, "sessionId needs to be specified"); + runtime.assert(editorInstance === null, "cannot boot with instanciated editor"); + + editorOptions = editorOptions || {}; + editorOptions.memberid = userid + "___" + Date.now(); + editorOptions.networked = true; + editorOptions.networkSecurityToken = token; + + require({ }, ["webodf/editor/Editor"], + function (Editor) { + // TODO: the networkSecurityToken needs to be retrieved via now.login + // (but this is to be implemented later) + editorInstance = new Editor(editorOptions); + + // load the document and get called back when it's live + editorInstance.loadSession(sessionId, function (editorSession) { + editorSession.startEditing(); + editorReadyCallback(editorInstance); + }); + } + ); + } + + + /** + * start the login process by offering a login/password prompt. + * the login is validated via nowjs namespace. + * on success a list of sessions is offered. + * when the user selects a session the callback is called + * with the sessionId as parameter + * + * @param {!function(!string, !string, ?string)} callback + * @returns {undefined} + */ + function startLoginProcess(callback) { + var userid, token, + net = runtime.getNetwork(); + + booting = true; + + runtime.assert(editorInstance === null, "cannot boot with instanciated editor"); + + function enterSession(selectedSessionId) { + document.getElementById("sessionListContainer").style.display = "none"; + document.getElementById("mainContainer").style.display = ""; + + callback(selectedSessionId, userid, token); + } + + function showSessions() { + var sessionListDiv = document.getElementById("sessionList"), + sessionList = new SessionList(net), + sessionListView = new SessionListView(sessionList, sessionListDiv, enterSession); + + // hide login view + document.getElementById("loginContainer").style.display = "none"; + + // show session list + document.getElementById("sessionListContainer").style.display = ""; + } + + function loginSuccess(userData) { + runtime.log("connected:" + userData.full_name); + userid = userData.uid; + token = userData.securityToken || null; + + showSessions(); + } + + function loginFail(result) { + alert("Login failed: " + result); + } + + function onLoginSubmit() { + net.login(document.loginForm.login.value, document.loginForm.password.value, loginSuccess, loginFail); + + // block the submit button, we already dealt with the input + return false; + } + + // bring up the login form + document.loginForm.Submit.onclick = onLoginSubmit; + document.getElementById("loginContainer").style.display = ""; + } + + /** + * make a guess about the document (# in URL) + * also guess about local/collaborative (depending on nowjs) + * + * @param {?Object} args + * + * args: + * + * collaborative: if set to true: connect to the network and start a + * collaborative editor. in that case the document url + * is ignored. and user needs to select a session. + * + * if set to the string "auto": it will try the above + * but fall back to non-collaborative mode [default] + * + * docUrl: if given it is used as the url to the document to load + * + * callback: callback to be called as soon as the document is loaded + * + */ + function boot(args) { + var editorOptions = {}, loginProcedure = startLoginProcess; + runtime.assert(!booting, "editor creation already in progress"); + + args = args || {}; + + if (args.collaborative === undefined) { + args.collaborative = "auto"; + } else { + args.collaborative = String(args.collaborative).toLowerCase(); + } + if (args.docUrl === undefined) { + args.docUrl = guessDocUrl(); + } + + if (args.saveCallback) { + editorOptions.saveCallback = args.saveCallback; + } + if (args.cursorAddedCallback) { + editorOptions.cursorAddedCallback = args.cursorAddedCallback; + } + if (args.cursorRemovedCallback) { + editorOptions.cursorRemovedCallback = args.cursorRemovedCallback; + } + if (args.registerCallbackForShutdown) { + editorOptions.registerCallbackForShutdown = args.registerCallbackForShutdown; + } else { + editorOptions.registerCallbackForShutdown = function (callback) { + window.onunload = callback; + }; + } + + if (args.loginProcedure) { + loginProcedure = args.loginProcedure; + } + + // start the editor with network + function handleNetworkedSituation() { + loginProcedure(function (sessionId, userid, token) { + createNetworkedEditor(sessionId, userid, token, editorOptions, function (ed) { + if (args.callback) { + args.callback(ed); + } + } + ); + }); + } + + // start the editor without network + function handleNonNetworkedSituation() { + createLocalEditor(args.docUrl, editorOptions, function (editor) { + if (args.callback) { + args.callback(editor); + } + }); + } + + if (args.collaborative === "auto") { + runtime.log("detecting network..."); + waitForNetwork(function (state) { + if (state === "ready") { + runtime.log("... network available."); + handleNetworkedSituation(); + } else { + runtime.log("... no network available (" + state + ")."); + handleNonNetworkedSituation(); + } + }); + } else if ((args.collaborative === "true") || + (args.collaborative === "1") || + (args.collaborative === "yes")) { + runtime.log("starting collaborative editor."); + waitForNetwork(function (state) { + if (state === "ready") { + handleNetworkedSituation(); + } + }); + } else { + runtime.log("starting local editor."); + handleNonNetworkedSituation(); + } + } + + // exposed API + return { boot: boot }; +}()); + diff --git a/js/dojo-amalgamation.js b/js/dojo-amalgamation.js new file mode 100644 index 00000000..1c077655 --- /dev/null +++ b/js/dojo-amalgamation.js @@ -0,0 +1,1712 @@ +//>>built +(function(e,j){var i,l,c=function(){},g=function(a){for(var d in a)return 0;return 1},h={}.toString,b=function(a){return"[object Function]"==h.call(a)},f=function(a){return"[object String]"==h.call(a)},a=function(a){return"[object Array]"==h.call(a)},k=function(a,d){if(a)for(var b=0;b")]),!a.def||d?ha:a.cjs&&a.cjs.exports;if(!a.executed){if(!a.def)return ha;var k=a.mid,f=a.deps||[],m,c=[],g=0;for(a.executed=4;ge.attributes.length); +j.clearElement=function(e){e.innerHTML="";return e};j.normalize=function(e,l){var c=e.match(/[\?:]|[^:\?]*/g),g=0,h=function(b){var f=c[g++];if(":"==f)return 0;if("?"==c[g++]){if(!b&&j(f))return h();h(!0);return h(b)}return f||0};return(e=h())&&l(e)};j.load=function(e,l,c){e?l([e],c):c()};return j})},"dojo/_base/config":function(){define(["../has","require"],function(e,j){var i={},l=j.rawConfig,c;for(c in l)i[c]=l[c];return i})},"dojo/_base/array":function(){define(["./kernel","../has","./lang"], +function(e,j,i){function l(a){return h[a]=new Function("item","index","array",a)}function c(a){var b=!a;return function(d,f,m){var c=0,g=d&&d.length||0,e;g&&"string"==typeof d&&(d=d.split(""));"string"==typeof f&&(f=h[f]||l(f));if(m)for(;ce? +(e=h+e,0>e&&(e=d)):e=e>=h?h+c:e;for(h&&"string"==typeof m&&(m=m.split(""));e!=l;e+=k)if(m[e]==g)return e;return-1}}var h={},b,f={every:c(!1),some:c(!0),indexOf:g(!0),lastIndexOf:g(!1),forEach:function(a,b,d){var f=0,m=a&&a.length||0;m&&"string"==typeof a&&(a=a.split(""));"string"==typeof b&&(b=h[b]||l(b));if(d)for(;f=t&&(t=0,r.ioPublish&&e.publish&&(!a||a&&!1!==a.ioArgs.args.ioPublish)&&e.publish("/dojo/io/stop"))},t=0;p.after(m,"_onAction",function(){t-=1});p.after(m,"_onInFlight",u);e._ioCancelAll=m.cancelAll;e._ioNotifyStart=function(a){r.ioPublish&& +e.publish&&!1!==a.ioArgs.args.ioPublish&&(t||e.publish("/dojo/io/start"),t+=1,e.publish("/dojo/io/send",[a]))};e._ioWatch=function(b,d,f,k){b.ioArgs.options=b.ioArgs.args;a.mixin(b,{response:b.ioArgs,isValid:function(){return d(b)},isReady:function(){return f(b)},handleResponse:function(){return k(b)}});m(b);u(b)};e._ioAddQueryToUrl=function(a){if(a.query.length)a.url+=(-1==a.url.indexOf("?")?"?":"&")+a.query,a.query=null};e.xhr=function(a,b,d){var f,k=e._ioSetArgs(b,function(){f&&f.cancel()},v,s), +m=k.ioArgs;"postData"in b?m.query=b.postData:"putData"in b?m.query=b.putData:"rawBody"in b?m.query=b.rawBody:(2a?(g=l(h),h=""):(g=l(h.slice(0,a)),h=l(h.slice(a+1)));"string"==typeof c[g]&&(c[g]=[c[g]]);e.isArray(c[g])?c[g].push(h):c[g]=h}return c}}})},"dojo/dom":function(){define(["./sniff","./_base/lang","./_base/window"],function(e,j,i){if(7>=e("ie"))try{document.execCommand("BackgroundImageCache",!1,!0)}catch(l){}var c={};c.byId=e("ie")?function(c,e){if("string"!=typeof c)return c;var b=e||i.doc,f=c&&b.getElementById(c);if(f&&(f.attributes.id.value==c||f.id==c))return f;b=b.all[c];if(!b|| +b.nodeName)b=[b];for(var a=0;f=b[a++];)if(f.attributes&&f.attributes.id&&f.attributes.id.value==c||f.id==c)return f}:function(c,e){return("string"==typeof c?(e||i.doc).getElementById(c):c)||null};c.isDescendant=function(g,e){try{g=c.byId(g);for(e=c.byId(e);g;){if(g==e)return!0;g=g.parentNode}}catch(b){}return!1};c.setSelectable=function(g,h){g=c.byId(g);if(e("mozilla"))g.style.MozUserSelect=h?"":"none";else if(e("khtml")||e("webkit"))g.style.KhtmlUserSelect=h?"auto":"none";else if(e("ie"))for(var b= +g.unselectable=h?"":"on",f=g.getElementsByTagName("*"),a=0,k=f.length;a"file|submit|image|reset|button".indexOf(d)&&!a.disabled){var p=h,m=k,a=c.fieldToObject(a);if(null!==a){var n=p[m];"string"==typeof n?p[m]=[n,a]:e.isArray(n)?n.push(a):p[m]=a}if("image"==d)h[k+".x"]=h[k+".y"]=h[k].x=h[k].y=0}}return h},toQuery:function(g){return i.objectToQuery(c.toObject(g))},toJson:function(g, +e){return l.stringify(c.toObject(g),null,e?4:0)}};return c})},"dojo/json":function(){define(["./has"],function(e){var j="undefined"!=typeof JSON;e.add("json-parse",j);e.add("json-stringify",j&&'{"a":1}'==JSON.stringify({a:0},function(e,c){return c||1}));if(e("json-stringify"))return JSON;var i=function(e){return('"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};return{parse:e("json-parse")?JSON.parse: +function(e,c){if(c&&!/^([\s\[\{]*(?:"(?:\\.|[^"])+"|-?\d[\d\.]*(?:[Ee][+-]?\d+)?|null|true|false|)[\s\]\}]*(?:,|:|$))+$/.test(e))throw new SyntaxError("Invalid characters in JSON");return eval("("+e+")")},stringify:function(e,c,g){function h(f,a,k){c&&(f=c(k,f));var d;d=typeof f;if("number"==d)return isFinite(f)?f+"":"null";if("boolean"==d)return f+"";if(null===f)return"null";if("string"==typeof f)return i(f);if("function"==d||"undefined"==d)return b;if("function"==typeof f.toJSON)return h(f.toJSON(k), +a,k);if(f instanceof Date)return'"{FullYear}-{Month+}-{Date}T{Hours}:{Minutes}:{Seconds}Z"'.replace(/\{(\w+)(\+)?\}/g,function(a,b,d){a=f["getUTC"+b]()+(d?1:0);return 10>a?"0"+a:a});if(f.valueOf()!==f)return h(f.valueOf(),a,k);var e=g?a+g:"",m=g?" ":"",n=g?"\n":"";if(f instanceof Array){for(var m=f.length,o=[],k=0;k");}}})},"dojo/promise/tracer":function(){define(["../_base/lang","./Promise","../Evented"],function(e,j,i){function l(e){setTimeout(function(){g.apply(c,e)},0)}var c=new i,g=c.emit; +c.emit=null;j.prototype.trace=function(){var c=e._toArray(arguments);this.then(function(b){l(["resolved",b].concat(c))},function(b){l(["rejected",b].concat(c))},function(b){l(["progress",b].concat(c))});return this};j.prototype.traceRejected=function(){var c=e._toArray(arguments);this.otherwise(function(b){l(["rejected",b].concat(c))});return this};return c})},"dojo/Evented":function(){define("dojo/Evented",["./aspect","./on"],function(e,j){function i(){}var l=e.after;i.prototype={on:function(c,g){return j.parse(this, +c,g,function(c,b){return l(c,"on"+b,g,!0)})},emit:function(c,g){var e=[this];e.push.apply(e,arguments);return j.emit.apply(j,e)}};return i})},"dojo/aspect":function(){define("dojo/aspect",[],function(){function e(b,f,a,k){var d=b[f],c="around"==f,m;if(c){var g=a(function(){return d.advice(this,arguments)});m={remove:function(){m.cancelled=!0},advice:function(a,b){return m.cancelled?d.advice(a,b):g.apply(a,b)}}}else m={remove:function(){var a=m.previous,d=m.next;if(!d&&!a)delete b[f];else if(a?a.next= +d:b[f]=d,d)d.previous=a},id:l++,advice:a,receiveArguments:k};if(d&&!c)if("after"==f){for(a=d;a;)d=a,a=a.next;d.next=m;m.previous=d}else{if("before"==f)b[f]=m,m.next=d,d.previous=m}else b[f]=m;return m}function j(b){return function(f,a,k,d){var c=f[a],m;if(!c||c.target!=f){f[a]=m=function(){for(var a=l,b=arguments,d=m.before;d;)b=d.advice.apply(this,b)||b,d=d.next;if(m.around)var f=m.around.advice(this,b);for(d=m.after;d&&d.idi("jscript"))&&!i("config-_allow_leaks")){"undefined"==typeof _dojoIEListeners_&&(_dojoIEListeners_=[]);var f=a[b];if(!f||!f.listeners){var k=f,f=Function("event","var callee = arguments.callee; for(var i = 0; ia||304===a||1223===a||!a}})},"dojo/errors/RequestError":function(){define(["./create"],function(e){return e("RequestError",function(e,i){this.response=i})})},"dojo/errors/RequestTimeoutError":function(){define(["./create","./RequestError"],function(e, +j){return e("RequestTimeoutError",null,j,{dojoType:"timeout"})})},"dojo/request/xhr":function(){define(["../errors/RequestError","./watch","./handlers","./util","../has"],function(e,j,i,l,c){function g(a,b){var d=a.xhr;a.status=a.xhr.status;a.text=d.responseText;if("xml"===a.options.handleAs)a.data=d.responseXML;if(!b)try{i(a)}catch(f){b=f}b?this.reject(b):l.checkStatus(d.status)?this.resolve(a):(b=new e("Unable to load "+a.url+" status: "+d.status,a),this.reject(b))}function h(m,n,i){var v=l.parseArgs(m, +l.deepCreate(p,n),c("native-formdata")&&n&&n.data&&n.data instanceof FormData),m=v.url,n=v.options,s,u=l.deferred(v,k,b,f,g,function(){s&&s()}),t=v.xhr=h._create();if(!t)return u.cancel(new e("XHR was not created")),i?u:u.promise;v.getHeader=function(a){return this.xhr.getResponseHeader(a)};a&&(s=a(t,u,v));var y=n.data,z=!n.sync,I=n.method;try{t.open(I,m,z,n.user||d,n.password||d);if(n.withCredentials)t.withCredentials=n.withCredentials;var J=n.headers,N;if(J)for(var E in J)"content-type"===E.toLowerCase()? +N=J[E]:J[E]&&t.setRequestHeader(E,J[E]);N&&!1!==N&&t.setRequestHeader("Content-Type",N);(!J||!("X-Requested-With"in J))&&t.setRequestHeader("X-Requested-With","XMLHttpRequest");l.notify&&l.notify.emit("send",v,u.promise.cancel);t.send(y)}catch(S){u.reject(S)}j(u);t=null;return i?u:u.promise}c.add("native-xhr",function(){return"undefined"!==typeof XMLHttpRequest});c.add("dojo-force-activex-xhr",function(){return c("activex")&&!document.addEventListener&&"file:"===window.location.protocol});c.add("native-xhr2", +function(){if(c("native-xhr")){var a=new XMLHttpRequest;return"undefined"!==typeof a.addEventListener&&("undefined"===typeof opera||"undefined"!==typeof a.upload)}});c.add("native-formdata",function(){return"function"===typeof FormData});var b,f,a,k;c("native-xhr2")?(b=function(){return!this.isFulfilled()},k=function(a,b){b.xhr.abort()},a=function(a,b,d){function f(){b.handleResponse(d)}function c(a){a=new e("Unable to load "+d.url+" status: "+a.target.status,d);b.handleResponse(d,a)}function k(a){if(a.lengthComputable)d.loaded= +a.loaded,d.total=a.total,b.progress(d)}a.addEventListener("load",f,!1);a.addEventListener("error",c,!1);a.addEventListener("progress",k,!1);return function(){a.removeEventListener("load",f,!1);a.removeEventListener("error",c,!1);a.removeEventListener("progress",k,!1)}}):(b=function(a){return a.xhr.readyState},f=function(a){return 4===a.xhr.readyState},k=function(a,b){var d=b.xhr,f=typeof d.abort;("function"===f||"object"===f||"unknown"===f)&&d.abort()});var d,p={data:null,query:null,sync:!1,method:"GET", +headers:{"Content-Type":"application/x-www-form-urlencoded"}};h._create=function(){throw Error("XMLHTTP not available");};if(c("native-xhr")&&!c("dojo-force-activex-xhr"))h._create=function(){return new XMLHttpRequest};else if(c("activex"))try{new ActiveXObject("Msxml2.XMLHTTP"),h._create=function(){return new ActiveXObject("Msxml2.XMLHTTP")}}catch(m){try{new ActiveXObject("Microsoft.XMLHTTP"),h._create=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}catch(n){}}l.addCommonMethods(h);return h})}, +"dojo/request/handlers":function(){define(["../json","../_base/kernel","../_base/array","../has"],function(e,j,i,l){function c(f){var a=b[f.options.handleAs];f.data=a?a(f):f.data||f.text;return f}l.add("activex","undefined"!==typeof ActiveXObject);var g;if(l("activex")){var h=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML.DOMDocument"];g=function(b){var a=b.data;if(!a||!a.documentElement){var c=b.text;i.some(h,function(b){try{var f=new ActiveXObject(b);f.async= +!1;f.loadXML(c);a=f}catch(m){return!1}return!0})}return a}}var b={javascript:function(b){return j.eval(b.text||"")},json:function(b){return e.parse(b.text||null)},xml:g};c.register=function(f,a){b[f]=a};return c})},"dojo/main":function(){define("./_base/kernel,./has,require,./sniff,./_base/lang,./_base/array,./_base/config,./ready,./_base/declare,./_base/connect,./_base/Deferred,./_base/json,./_base/Color,./has!dojo-firebug?./_firebug/firebug,./_base/browser,require".split(","),function(e,j,i,l,c, +g,h,b){h.isDebug&&i(["./_firebug/firebug"]);var f=h.require;f&&(f=g.map(c.isArray(f)?f:[f],function(a){return a.replace(/\./g,"/")}),e.isAsync?i(f):b(1,function(){i(f)}));return e})},"dojo/ready":function(){define(["./_base/kernel","./has","require","./domReady","./_base/lang"],function(e,j,i,l,c){var g=0,h,b=[],f=0,a=function(){if(g&&!f&&b.length){f=1;var d=b.shift();try{d()}finally{f=0}f=0;b.length&&h(a)}};i.on("idle",a);h=function(){i.idle()&&a()};var j=e.ready=e.addOnLoad=function(a,f,k){var g= +c._toArray(arguments);"number"!=typeof a?(k=f,f=a,a=1E3):g.shift();k=k?c.hitch.apply(e,g):function(){f()};k.priority=a;for(g=0;g=b[g].priority;g++);b.splice(g,0,k);h()},k=e.config.addOnLoad;if(k)j[c.isArray(k)?"apply":"call"](e,k);l(function(){g=1;e._postLoad=e.config.afterOnLoad=!0;b.length&&h(a)});return j})},"dojo/domReady":function(){define(["./has"],function(e){function j(a){h?a(l):b.push(a)}var i=this,l=document,c={loaded:1,complete:1},g="string"!=typeof l.readyState,h=!!c[l.readyState]; +if(g)l.readyState="loading";if(!h){var b=[],f=[],a=function(a){a=a||i.event;if(!(h||"readystatechange"==a.type&&!c[l.readyState])){h=1;if(g)l.readyState="complete";for(;b.length;)b.shift()(l)}},k=function(d,f){d.addEventListener(f,a,!1);b.push(function(){d.removeEventListener(f,a,!1)})};if(!e("dom-addeventlistener")){var k=function(d,f){f="on"+f;d.attachEvent(f,a);b.push(function(){d.detachEvent(f,a)})},d=l.createElement("div");try{d.doScroll&&null===i.frameElement&&f.push(function(){try{return d.doScroll("left"), +1}catch(a){}})}catch(p){}}k(l,"DOMContentLoaded");k(i,"load");"onreadystatechange"in l?k(l,"readystatechange"):g||f.push(function(){return c[l.readyState]});if(f.length){var m=function(){if(!h){for(var b=f.length;b--;)if(f[b]()){a("poller");return}setTimeout(m,30)}};m()}}j.load=function(a,b,d){j(d)};return j})},"dojo/_base/declare":function(){define(["./kernel","../has","./lang"],function(e,j,i){function l(a,b){throw Error("declare"+(b?" "+b:"")+": "+a);}function c(a,b,d){var f,c,k,m,g,e,h,i=this._inherited= +this._inherited||{};"string"==typeof a&&(f=a,a=b,b=d);d=0;m=a.callee;(f=f||m.nom)||l("can't deduce a name to call inherited()",this.declaredClass);g=this.constructor._meta;k=g.bases;h=i.p;if(f!=z){if(i.c!==m&&(h=0,e=k[0],g=e._meta,g.hidden[f]!==m)){(c=g.chains)&&"string"==typeof c[f]&&l("calling chained method with inherited: "+f,this.declaredClass);do if(g=e._meta,c=e.prototype,g&&(c[f]===m&&c.hasOwnProperty(f)||g.hidden[f]===m))break;while(e=k[++h]);h=e?h:-1}if(e=k[++h])if(c=e.prototype,e._meta&& +c.hasOwnProperty(f))d=c[f];else{m=s[f];do if(c=e.prototype,(d=c[f])&&(e._meta?c.hasOwnProperty(f):d!==m))break;while(e=k[++h])}d=e&&d||s[f]}else{if(i.c!==m&&(h=0,(g=k[0]._meta)&&g.ctor!==m)){c=g.chains;for((!c||"manual"!==c.constructor)&&l("calling chained constructor with inherited",this.declaredClass);(e=k[++h])&&!((g=e._meta)&&g.ctor===m););h=e?h:-1}for(;(e=k[++h])&&!(d=(g=e._meta)?g.ctor:e););d=e&&d}i.c=d;i.p=h;if(d)return!0===b?d:d.apply(this,b||a)}function g(a,b){return"string"==typeof a?this.__inherited(a, +b,!0):this.__inherited(a,!0)}function h(a,b,d){var f=this.getInherited(a,b);if(f)return f.apply(this,d||b||a)}function b(a){for(var b=this.constructor._meta.bases,d=0,f=b.length;dd||90d||111d||192d||222f?f-48:!a.shiftKey&&65<=f&&90>=f?f+32:k[f]||f}d=p(a,{type:"keypress",faux:!0,charCode:f});b.call(a.currentTarget,d);if(h("ie"))try{a.keyCode=d.keyCode}catch(c){}}}),f=j(a,"keypress",function(a){var d=a.charCode,a=p(a,{charCode:32<=d?d:0,faux:!0});return b.call(this,a)});return{remove:function(){d.remove();f.remove()}}}:h("opera")?function(a,b){return j(a,"keypress",function(a){var d=a.which;3==d&&(d=99);d=32>d&&!a.shiftKey?0:d;a.ctrlKey&&!a.shiftKey&&65<=d&&90>=d&&(d+=32);return b.call(this,p(a, +{charCode:d}))})}:function(b,d){return j(b,"keypress",function(b){a(b);return d.call(this,b)})};var n={_keypress:m,connect:function(a,b,d,c,k){var m=arguments,g=[],e=0;g.push("string"==typeof m[0]?null:m[e++],m[e++]);var h=m[e+1];g.push("string"==typeof h||"function"==typeof h?m[e++]:null,m[e++]);for(h=m.length;ee("ie")){var b=a.getBoundingClientRect(),d=b.left,b=b.top;7>e("ie")&&(d+=a.clientLeft,b+=a.clientTop);return{x:0>d?0:d,y:0>b?0:b}}return{x:0,y:0}};b.fixIeBiDiScrollLeft=function(a,f){var f=f||j.doc,d=e("ie");if(d&&!b.isBodyLtr(f)){var c= +e("quirks"),g=c?j.body(f):f.documentElement,h=j.global;6==d&&!c&&h.frameElement&&g.scrollHeight>g.clientHeight&&(a+=g.clientLeft);return 8>d||c?a+g.clientWidth-g.scrollWidth:-a}return a};b.position=function(a,f){var a=i.byId(a),d=j.body(a.ownerDocument),c=a.getBoundingClientRect(),c={x:c.left,y:c.top,w:c.right-c.left,h:c.bottom-c.top};if(e("ie")){var g=b.getIeDocumentElementOffset(a.ownerDocument);c.x-=g.x+(e("quirks")?d.clientLeft+d.offsetLeft:0);c.y-=g.y+(e("quirks")?d.clientTop+d.offsetTop:0)}f&& +(d=b.docScroll(a.ownerDocument),c.x+=d.x,c.y+=d.y);return c};b.getMarginSize=function(a,f){var a=i.byId(a),d=b.getMarginExtents(a,f||l.getComputedStyle(a)),c=a.getBoundingClientRect();return{w:c.right-c.left+d.w,h:c.bottom-c.top+d.h}};b.normalizeEvent=function(a){if(!("layerX"in a))a.layerX=a.offsetX,a.layerY=a.offsetY;if(!e("dom-addeventlistener")){var f=a.target,f=f&&f.ownerDocument||document,d=e("quirks")?f.body:f.documentElement,c=b.getIeDocumentElementOffset(f);a.pageX=a.clientX+b.fixIeBiDiScrollLeft(d.scrollLeft|| +0,f)-c.x;a.pageY=a.clientY+(d.scrollTop||0)-c.y}};return b})},"dojo/dom-style":function(){define(["./sniff","./dom"],function(e,j){function i(b,d,f){d=d.toLowerCase();if(e("ie")){if("auto"==f){if("height"==d)return b.offsetHeight;if("width"==d)return b.offsetWidth}if("fontweight"==d)switch(f){case 700:return"bold";default:return"normal"}}d in a||(a[d]=k.test(d));return a[d]?g(b,f):f}var l,c={};l=e("webkit")?function(a){var b;if(1==a.nodeType){var d=a.ownerDocument.defaultView;b=d.getComputedStyle(a, +null);if(!b&&a.style)a.style.display="",b=d.getComputedStyle(a,null)}return b||{}}:e("ie")&&(9>e("ie")||e("quirks"))?function(a){return 1==a.nodeType&&a.currentStyle?a.currentStyle:{}}:function(a){return 1==a.nodeType?a.ownerDocument.defaultView.getComputedStyle(a,null):{}};c.getComputedStyle=l;var g;g=e("ie")?function(a,b){if(!b)return 0;if("medium"==b)return 4;if(b.slice&&"px"==b.slice(-2))return parseFloat(b);var d=a.style,f=a.runtimeStyle,c=d.left,k=f.left;f.left=a.currentStyle.left;try{d.left= +b,b=d.pixelLeft}catch(g){b=0}d.left=c;f.left=k;return b}:function(a,b){return parseFloat(b)||0};c.toPixelValue=g;var h=function(a,b){try{return a.filters.item("DXImageTransform.Microsoft.Alpha")}catch(d){return b?{}:null}},b=9>e("ie")||e("ie")&&e("quirks")?function(a){try{return h(a).Opacity/100}catch(b){return 1}}:function(a){return l(a).opacity},f=9>e("ie")||e("ie")&&e("quirks")?function(a,b){var d=100*b,c=1==b;a.style.zoom=c?"":1;if(h(a))h(a,1).Opacity=d;else{if(c)return b;a.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+ +d+")"}h(a,1).Enabled=!c;if("tr"==a.tagName.toLowerCase())for(d=a.firstChild;d;d=d.nextSibling)"td"==d.tagName.toLowerCase()&&f(d,b);return b}:function(a,b){return a.style.opacity=b},a={left:!0,top:!0},k=/margin|padding|width|height|max|min|offset/,d=e("ie")?"styleFloat":"cssFloat",p={cssFloat:d,styleFloat:d,"float":d};c.get=function(a,d){var f=j.byId(a),k=arguments.length;if(2==k&&"opacity"==d)return b(f);var d=p[d]||d,g=c.getComputedStyle(f);return 1==k?g:i(f,d,g[d]||f.style[d])};c.set=function(a, +b,d){var k=j.byId(a),g=arguments.length,e="opacity"==b,b=p[b]||b;if(3==g)return e?f(k,d):k.style[b]=d;for(var h in b)c.set(a,h,b[h]);return c.getComputedStyle(k)};return c})},"dojo/mouse":function(){define(["./_base/kernel","./on","./has","./dom","./_base/window"],function(e,j,i,l,c){function g(c,b){var f=function(a,f){return j(a,c,function(d){if(b)return b(d,f);if(!l.isDescendant(d.relatedTarget,a))return f.call(this,d)})};f.bubble=function(a){return g(c,function(b,d){var f=a(b.target),c=b.relatedTarget; +if(f&&f!=(c&&1==c.nodeType&&a(c)))return d.call(f,b)})};return f}i.add("dom-quirks",c.doc&&"BackCompat"==c.doc.compatMode);i.add("events-mouseenter",c.doc&&"onmouseenter"in c.doc.createElement("div"));i.add("events-mousewheel",c.doc&&"onmousewheel"in c.doc);c=i("dom-quirks")&&i("ie")||!i("dom-addeventlistener")?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(c,b){return c.button&b},isLeft:function(c){return c.button&1},isMiddle:function(c){return c.button&4},isRight:function(c){return c.button&2}}:{LEFT:0, +MIDDLE:1,RIGHT:2,isButton:function(c,b){return c.button==b},isLeft:function(c){return 0==c.button},isMiddle:function(c){return 1==c.button},isRight:function(c){return 2==c.button}};e.mouseButtons=c;e=i("events-mousewheel")?"mousewheel":function(c,b){return j(c,"DOMMouseScroll",function(f){f.wheelDelta=-f.detail;b.call(this,f)})};return{_eventHandler:g,enter:g("mouseover"),leave:g("mouseout"),wheel:e,isLeft:c.isLeft,isMiddle:c.isMiddle,isRight:c.isRight}})},"dojo/keys":function(){define(["./_base/kernel", +"./sniff"],function(e,j){return e.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:j("webkit")?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108, +NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,UP_DPAD:175,DOWN_DPAD:176,LEFT_DPAD:177,RIGHT_DPAD:178,copyKey:j("mac")&&!j("air")?j("safari")?91:224:17}})},"dojo/_base/Color":function(){define(["./kernel","./lang","./array","./config"],function(e,j,i,l){var c=e.Color=function(c){c&&this.setColor(c)};c.named={black:[0,0,0],silver:[192,192,192],gray:[128, +128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:l.transparentColor||[0,0,0,0]};j.extend(c,{r:255,g:255,b:255,a:1,_set:function(c,e,b,f){this.r=c;this.g=e;this.b=b;this.a=f},setColor:function(g){j.isString(g)?c.fromString(g,this):j.isArray(g)?c.fromArray(g,this):(this._set(g.r,g.g,g.b,g.a),g instanceof c|| +this.sanitize());return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+i.map(["r","g","b"],function(c){c=this[c].toString(16);return 2>c.length?"0"+c:c},this).join("")},toCss:function(c){var e=this.r+", "+this.g+", "+this.b;return(c?"rgba("+e+", "+this.a:"rgb("+e)+")"},toString:function(){return this.toCss(!0)}});c.blendColors=e.blendColors=function(g,e,b,f){var a=f||new c;i.forEach(["r", +"g","b","a"],function(f){a[f]=g[f]+(e[f]-g[f])*b;"a"!=f&&(a[f]=Math.round(a[f]))});return a.sanitize()};c.fromRgb=e.colorFromRgb=function(g,e){var b=g.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return b&&c.fromArray(b[1].split(/\s*,\s*/),e)};c.fromHex=e.colorFromHex=function(g,e){var b=e||new c,f=4==g.length?4:8,a=(1<>=f;b[c]=4==f?17*d:d});b.a=1;return b};c.fromArray=e.colorFromArray=function(g, +e){var b=e||new c;b._set(Number(g[0]),Number(g[1]),Number(g[2]),Number(g[3]));if(isNaN(b.a))b.a=1;return b.sanitize()};c.fromString=e.colorFromString=function(g,e){var b=c.named[g];return b&&c.fromArray(b,e)||c.fromRgb(g,e)||c.fromHex(g,e)};return c})},"dojo/_base/browser":function(){require.has&&require.has.add("config-selectorEngine","acme");define("../ready,./kernel,./connect,./unload,./window,./event,./html,./NodeList,../query,./xhr,./fx".split(","),function(e){return e})},"dojo/_base/unload":function(){define(["./kernel", +"./lang","../on"],function(e,j,i){var l=window,c={addOnWindowUnload:function(c,h){if(!e.windowUnloaded)i(l,"unload",e.windowUnloaded=function(){});i(l,"unload",j.hitch(c,h))},addOnUnload:function(c,e){i(l,"beforeunload",j.hitch(c,e))}};e.addOnWindowUnload=c.addOnWindowUnload;e.addOnUnload=c.addOnUnload;return c})},"dojo/_base/html":function(){define("./kernel,../dom,../dom-style,../dom-attr,../dom-prop,../dom-class,../dom-construct,../dom-geometry".split(","),function(e,j,i,l,c,g,h,b){e.byId=j.byId; +e.isDescendant=j.isDescendant;e.setSelectable=j.setSelectable;e.getAttr=l.get;e.setAttr=l.set;e.hasAttr=l.has;e.removeAttr=l.remove;e.getNodeProp=l.getNodeProp;e.attr=function(b,a,c){return 2==arguments.length?l["string"==typeof a?"get":"set"](b,a):l.set(b,a,c)};e.hasClass=g.contains;e.addClass=g.add;e.removeClass=g.remove;e.toggleClass=g.toggle;e.replaceClass=g.replace;e._toDom=e.toDom=h.toDom;e.place=h.place;e.create=h.create;e.empty=function(b){h.empty(b)};e._destroyElement=e.destroy=function(b){h.destroy(b)}; +e._getPadExtents=e.getPadExtents=b.getPadExtents;e._getBorderExtents=e.getBorderExtents=b.getBorderExtents;e._getPadBorderExtents=e.getPadBorderExtents=b.getPadBorderExtents;e._getMarginExtents=e.getMarginExtents=b.getMarginExtents;e._getMarginSize=e.getMarginSize=b.getMarginSize;e._getMarginBox=e.getMarginBox=b.getMarginBox;e.setMarginBox=b.setMarginBox;e._getContentBox=e.getContentBox=b.getContentBox;e.setContentSize=b.setContentSize;e._isBodyLtr=e.isBodyLtr=b.isBodyLtr;e._docScroll=e.docScroll= +b.docScroll;e._getIeDocumentElementOffset=e.getIeDocumentElementOffset=b.getIeDocumentElementOffset;e._fixIeBiDiScrollLeft=e.fixIeBiDiScrollLeft=b.fixIeBiDiScrollLeft;e.position=b.position;e.marginBox=function(f,a){return a?b.setMarginBox(f,a):b.getMarginBox(f)};e.contentBox=function(f,a){return a?b.setContentSize(f,a):b.getContentBox(f)};e.coords=function(f,a){e.deprecated("dojo.coords()","Use dojo.position() or dojo.marginBox().");var f=j.byId(f),c=i.getComputedStyle(f),c=b.getMarginBox(f,c),d= +b.position(f,a);c.x=d.x;c.y=d.y;return c};e.getProp=c.get;e.setProp=c.set;e.prop=function(b,a,k){return 2==arguments.length?c["string"==typeof a?"get":"set"](b,a):c.set(b,a,k)};e.getStyle=i.get;e.setStyle=i.set;e.getComputedStyle=i.getComputedStyle;e.__toPixelValue=e.toPixelValue=i.toPixelValue;e.style=function(b,a,c){switch(arguments.length){case 1:return i.get(b);case 2:return i["string"==typeof a?"get":"set"](b,a)}return i.set(b,a,c)};return e})},"dojo/dom-attr":function(){define("exports,./sniff,./_base/lang,./dom,./dom-style,./dom-prop".split(","), +function(e,j,i,l,c,g){function h(a,b){var d=a.getAttributeNode&&a.getAttributeNode(b);return d&&d.specified}var b={innerHTML:1,className:1,htmlFor:j("ie"),value:1},f={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"};e.has=function(a,c){var d=c.toLowerCase();return b[g.names[d]||c]||h(l.byId(a),f[d]||c)};e.get=function(a,c){var a=l.byId(a),d=c.toLowerCase(),e=g.names[d]||c,m=a[e];if(b[e]&&"undefined"!=typeof m||"href"!=e&&("boolean"==typeof m||i.isFunction(m)))return m;d=f[d]|| +c;return h(a,d)?a.getAttribute(d):null};e.set=function(a,k,d){a=l.byId(a);if(2==arguments.length){for(var h in k)e.set(a,h,k[h]);return a}h=k.toLowerCase();var m=g.names[h]||k,j=b[m];if("style"==m&&"string"!=typeof d)return c.set(a,d),a;if(j||"boolean"==typeof d||i.isFunction(d))return g.set(a,k,d);a.setAttribute(f[h]||k,d);return a};e.remove=function(a,b){l.byId(a).removeAttribute(f[b.toLowerCase()]||b)};e.getNodeProp=function(a,b){var a=l.byId(a),d=b.toLowerCase(),c=g.names[d]||b;if(c in a&&"href"!= +c)return a[c];d=f[d]||b;return h(a,d)?a.getAttribute(d):null}})},"dojo/dom-prop":function(){define("exports,./_base/kernel,./sniff,./_base/lang,./dom,./dom-style,./dom-construct,./_base/connect".split(","),function(e,j,i,l,c,g,h,b){var f={},a=0,k=j._scopeName+"attrid";e.names={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"};e.get=function(a,b){var a=c.byId(a),f=b.toLowerCase();return a[e.names[f]|| +b]};e.set=function(d,j,m){d=c.byId(d);if(2==arguments.length&&"string"!=typeof j){for(var n in j)e.set(d,n,j[n]);return d}n=j.toLowerCase();n=e.names[n]||j;if("style"==n&&"string"!=typeof m)return g.set(d,m),d;if("innerHTML"==n)return i("ie")&&d.tagName.toLowerCase()in{col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1}?(h.empty(d),d.appendChild(h.toDom(m,d.ownerDocument))):d[n]=m,d;if(l.isFunction(m)){var o=d[k];o||(o=a++,d[k]=o);f[o]||(f[o]={});var r=f[o][n];if(r)b.disconnect(r);else try{delete d[n]}catch(q){}m? +f[o][n]=b.connect(d,n,m):d[n]=null;return d}d[n]=m;return d}})},"dojo/dom-construct":function(){define("exports,./_base/kernel,./sniff,./_base/window,./dom,./dom-attr,./on".split(","),function(e,j,i,l,c,g,h){function b(a,b){var d=b.parentNode;d&&d.insertBefore(a,b)}var f={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]}, +a=/<\s*([\w\:]+)/,k={},d=0,p="__"+j._scopeName+"ToDomId",m;for(m in f)if(f.hasOwnProperty(m))j=f[m],j.pre="option"==m?'', +_buttonInputDisabled:g("ie")?"disabled":"",baseClass:"dijitTextBox",postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&"input"==this.templateString.toLowerCase()||("hidden"==a||"file"==a)&&this.templateString==this.constructor.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},postCreate:function(){this.inherited(arguments);9>g("ie")&&this.defer(function(){try{var a=i.getComputedStyle(this.domNode);if(a){var b=a.fontFamily; +if(b){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(a=0;ab?1:al("ie")||l("ie")&&l("quirks"))){c.preventDefault();var e=c.srcElement,b=e.ownerDocument.createEventObject();b.keyCode=i.ESCAPE;b.shiftKey=c.shiftKey;e.fireEvent("onkeypress", +b)}}})})},"dijit/form/_TextBoxMixin":function(){define("dojo/_base/array,dojo/_base/declare,dojo/dom,dojo/_base/event,dojo/keys,dojo/_base/lang,dojo/on,../main".split(","),function(e,j,i,l,c,g,h,b){var f=j("dijit.form._TextBoxMixin",null,{trim:!1,uppercase:!1,lowercase:!1,propercase:!1,maxLength:"",selectOnClick:!1,placeHolder:"",_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,b,d){var c;void 0!==a&&(c=this.filter(a),"string"!=typeof d&& +(d=null!==c&&("number"!=typeof c||!isNaN(c))?this.filter(this.format(c,this.constraints)):""));if(null!=d&&("number"!=typeof d||!isNaN(d))&&this.textbox.value!=d)this.textbox.value=d,this._set("displayedValue",this.get("displayedValue"));"auto"==this.textDir&&this.applyTextDir(this.focusNode,d);this.inherited(arguments,[c,b])},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},_setDisplayedValueAttr:function(a){null==a?a="":"string"!=typeof a&&(a=""+a);this.textbox.value= +a;this._setValueAttr(this.get("value"),void 0);this._set("displayedValue",this.get("displayedValue"));"auto"==this.textDir&&this.applyTextDir(this.focusNode,a)},format:function(a){return null==a?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},onInput:function(){},__skipInputEvent:!1,_onInput:function(a){"auto"==this.textDir&&this.applyTextDir(this.focusNode,this.focusNode.value);this._processInput(a)},_processInput:function(){this._refreshState();this._set("displayedValue", +this.get("displayedValue"))},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);this.own(h(this.textbox,"keydown, keypress, paste, cut, input, compositionend",g.hitch(this,function(a){var b;if("keydown"==a.type){b=a.keyCode;switch(b){case c.SHIFT:case c.ALT:case c.CTRL:case c.META:case c.CAPS_LOCK:case c.NUM_LOCK:case c.SCROLL_LOCK:return}if(!a.ctrlKey&&!a.metaKey&&!a.altKey){switch(b){case c.NUMPAD_0:case c.NUMPAD_1:case c.NUMPAD_2:case c.NUMPAD_3:case c.NUMPAD_4:case c.NUMPAD_5:case c.NUMPAD_6:case c.NUMPAD_7:case c.NUMPAD_8:case c.NUMPAD_9:case c.NUMPAD_MULTIPLY:case c.NUMPAD_PLUS:case c.NUMPAD_ENTER:case c.NUMPAD_MINUS:case c.NUMPAD_PERIOD:case c.NUMPAD_DIVIDE:return}if(65<= +b&&90>=b||48<=b&&57>=b||b==c.SPACE)return;b=!1;for(var d in c)if(c[d]===a.keyCode){b=!0;break}if(!b)return}}(b=32<=a.charCode?String.fromCharCode(a.charCode):a.charCode)||(b=65<=a.keyCode&&90>=a.keyCode||48<=a.keyCode&&57>=a.keyCode||a.keyCode==c.SPACE?String.fromCharCode(a.keyCode):a.keyCode);b||(b=229);if("keypress"==a.type){if("string"!=typeof b)return;if("a"<=b&&"z">=b||"A"<=b&&"Z">=b||"0"<=b&&"9">=b||" "===b)if(a.ctrlKey||a.metaKey||a.altKey)return}if("input"==a.type){if(this.__skipInputEvent){this.__skipInputEvent= +!1;return}}else this.__skipInputEvent=!0;var f={faux:!0},e;for(e in a)"layerX"!=e&&"layerY"!=e&&(d=a[e],"function"!=typeof d&&"undefined"!=typeof d&&(f[e]=d));g.mixin(f,{charOrCode:b,_wasConsumed:!1,preventDefault:function(){f._wasConsumed=!0;a.preventDefault()},stopPropagation:function(){a.stopPropagation()}});!1===this.onInput(f)&&(f.preventDefault(),f.stopPropagation());f._wasConsumed||this.defer(function(){this._onInput(f)})})))},_blankValue:"",filter:function(a){if(null===a)return this._blankValue; +if("string"!=typeof a)return a;this.trim&&(a=g.trim(a));this.uppercase&&(a=a.toUpperCase());this.lowercase&&(a=a.toLowerCase());this.propercase&&(a=a.replace(/[^\s]+/g,function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}));return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),!0)},_onBlur:function(a){this.disabled||(this._setBlurValue(),this.inherited(arguments))},_isTextSelected:function(){return this.textbox.selectionStart!=this.textbox.selectionEnd},_onFocus:function(a){if(!this.disabled&& +!this.readOnly){if(this.selectOnClick&&"mouse"==a)this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);this._selectOnClickHandle=null;this._isTextSelected()||f.selectInputText(this.textbox)}),this.defer(function(){if(this._selectOnClickHandle)this.disconnect(this._selectOnClickHandle),this._selectOnClickHandle=null},500);this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}, +_setTextDirAttr:function(a){if(!this._created||this.textDir!=a)this._set("textDir",a),this.applyTextDir(this.focusNode,this.focusNode.value)}});f._setSelectionRange=b._setSelectionRange=function(a,b,d){a.setSelectionRange&&a.setSelectionRange(b,d)};f.selectInputText=b.selectInputText=function(a,b,d){a=i.byId(a);isNaN(b)&&(b=0);isNaN(d)&&(d=a.value?a.value.length:0);try{a.focus(),f._setSelectionRange(a,b,d)}catch(c){}};return f})},"url:dijit/form/templates/TextBox.html":'