diff options
| author | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
|---|---|---|
| committer | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
| commit | b62676ca5d3d6f6ba3f019ea3f99722e165a98d8 (patch) | |
| tree | 86722cb80f07d4569f90088eeaea2fc2f6e2ef94 /js/dojo-1.6/dojo/lib | |
Diffstat (limited to 'js/dojo-1.6/dojo/lib')
| -rw-r--r-- | js/dojo-1.6/dojo/lib/backCompat.js | 283 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/backCompat.xd.js | 287 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/kernel.js | 26 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/kernel.xd.js | 30 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/main-browser.js | 61 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/main-browser.xd.js | 65 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/plugins/i18n.js | 94 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/plugins/i18n.xd.js | 98 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/plugins/text.js | 70 | ||||
| -rw-r--r-- | js/dojo-1.6/dojo/lib/plugins/text.xd.js | 74 |
10 files changed, 1088 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojo/lib/backCompat.js b/js/dojo-1.6/dojo/lib/backCompat.js new file mode 100644 index 0000000..f12a046 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/backCompat.js @@ -0,0 +1,283 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+// AMD module id = dojo/lib/backCompat
+//
+// This module defines those dojo properties/methods that are defined by
+// dojo/_base/_loader/loader and are still needed when loading with and
+// AMD loader (when loading with an AMD loader, dojo/_base/_loader/loader
+// is never loaded).
+//
+// note: this module is relevant only when loading dojo with an AMD loader;
+// it is never evaluated otherwise.
+
+define(["require", "dojo/_base/_loader/bootstrap"], function(require, dojo){
+ // the following dojo properties do not exist in the AMD-loaded version of dojo 1.x:
+ var names= [
+ "_moduleHasPrefix",
+ "_loadPath",
+ "_loadUri",
+ "_loadUriAndCheck",
+ "loaded",
+ "_callLoaded",
+ "_getModuleSymbols",
+ "_loadModule",
+ "require",
+ "provide",
+ "platformRequire",
+ "requireIf",
+ "requireAfterIf",
+ "registerModulePath"
+ ], i, name;
+ for(i = 0; i<names.length;){
+ name = names[i++];
+ dojo[name] = (function(name) {
+ return function(){
+ console.warn("dojo." + name + " not available when using an AMD loader.");
+ };
+ })(name);
+ }
+
+ // define dojo.addOnLoad in terms of the DOMContentLoaded detection available from the AMD loaders
+ // (requirejs and bdBuild). Note that the behavior of this feature is slightly different compared to the dojo
+ // v1.x sync loader. There, the onload queue is fired upon detecting both DOMContentLoaded *and* all
+ // demanded modules have arrived. It is impossible to simulate this behavior with requirejs since it does
+ // not publish its internal status (it is possible with bdLoad).
+ // TODO: consider taking ownership of this API back from the loader.
+ // TODO: consider requesting requirejs publish more enough internal state to determine if all demanded
+ // modules have been defined.
+ var
+ argsToArray = function(args) {
+ var result = [], i;
+ for(i = 0; i<args.length;){
+ result.push(args[i++]);
+ }
+ return result;
+ },
+
+ simpleHitch = function(context, callback){
+ if(callback){
+ return (typeof callback=="string") ?
+ function(){context[callback]();} :
+ function(){callback.call(context);};
+ }else{
+ return context;
+ }
+ };
+ dojo.ready = dojo.addOnLoad = function(context, callback){
+ require.ready(callback ? simpleHitch(context, callback) : context);
+ };
+ dojo.addOnLoad(function() {
+ dojo.postLoad = dojo.config.afterOnLoad = true;
+ });
+ var dca = dojo.config.addOnLoad;
+ if(dca){
+ dojo.addOnLoad[(dca instanceof Array ? "apply" : "call")](dojo, dca);
+ }
+
+ // TODO: in the dojo 1.x sync loader the array dojo._loaders holds the queue of callbacks to be executed
+ // upon DOMContentLoaded. This queue is manipulated directly by dojo/uacss, dojo/parser, dijit/_base/wia
+ // and others (at least in dojox). This is also impossible to simulate universally across all AMD loaders.
+ // The following will at least accept client code accessing dojo._loaders , dojo._loaders.unshift, and
+ // dojo._loaders.splice--which is all that exists in the current dojo/dijit code stacks.
+ var
+ loaders = dojo._loaders = [],
+ runLoaders = function(){
+ var temp= loaders.slice(0);
+ Array.prototype.splice.apply(loaders, [0, loaders.length]);
+ while(temp.length){
+ temp.shift().call();
+ };
+ };
+ loaders.unshift = function() {
+ Array.prototype.unshift.apply(loaders, argsToArray(arguments));
+ require.ready(runLoaders);
+ };
+ loaders.splice = function() {
+ Array.prototype.splice.apply(loaders, argsToArray(arguments));
+ require.ready(runLoaders);
+ };
+
+ //TODO: put unload handling in a separate module
+ var unloaders = dojo._unloaders = [];
+ dojo.unloaded = function(){
+ while(unloaders.length){
+ unloaders.pop().call();
+ }
+ };
+
+ //TODO: kill this low-value function when it is exorcised from dojo
+ dojo._onto = function(arr, obj, fn){
+ arr.push(fn ? simpleHitch(obj, fn) : obj);
+ };
+
+ //TODO: kill this when the bootstrap is rewritten to not include DOMContentLoaded detection
+ // (it should probably be just a module) for now, just sink the detection; leverage the
+ // AMD loaders to handle DOMContentLoaded detection
+ dojo._modulesLoaded = function(){};
+
+ //TODO: kill this when we understand its purpose relative to AMD
+ dojo.loadInit = function(init){
+ init();
+ };
+
+ var amdModuleName= function(moduleName){
+ return moduleName.replace(/\./g, "/");
+ };
+
+ dojo.getL10nName = function(moduleName, bundleName, locale){
+ locale = locale ? locale.toLowerCase() : dojo.locale;
+ moduleName = "i18n!" + amdModuleName(moduleName);
+ return (/root/i.test(locale)) ?
+ (moduleName + "/nls/" + bundleName) :
+ (moduleName + "/nls/" + locale + "/" + bundleName);
+ };
+
+ dojo.requireLocalization = function(moduleName, bundleName, locale){
+ // NOTE: locales other than the locale specified in dojo.locale need to be specifically
+ // declared as a module dependency when using AMD.
+ if(require.vendor!="altoviso.com"){
+ locale = !locale || locale.toLowerCase() === dojo.locale ? "root" : locale;
+ }
+ return require(dojo.getL10nName(moduleName, bundleName, locale));
+ };
+
+ dojo.i18n= {
+ getLocalization: dojo.requireLocalization,
+ normalizeLocale: function(locale){
+ var result = locale ? locale.toLowerCase() : dojo.locale;
+ if(result == "root"){
+ result = "ROOT";
+ }
+ return result;
+ }
+ };
+
+ //TODO: dojo._Url seems rarely used and long to be part of the boostrap; consider moving
+ //note: this routine cut and paste from dojo/_base/_loader/loader
+ var
+ ore = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),
+ ire = new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");
+ dojo._Url = function(){
+ var n = null,
+ _a = arguments,
+ uri = [_a[0]];
+ // resolve uri components relative to each other
+ for(var i = 1; i<_a.length; i++){
+ if(!_a[i]){ continue; }
+
+ // Safari doesn't support this.constructor so we have to be explicit
+ // FIXME: Tracked (and fixed) in Webkit bug 3537.
+ // http://bugs.webkit.org/show_bug.cgi?id=3537
+ var relobj = new dojo._Url(_a[i]+""),
+ uriobj = new dojo._Url(uri[0]+"");
+
+ if(
+ relobj.path == "" &&
+ !relobj.scheme &&
+ !relobj.authority &&
+ !relobj.query
+ ){
+ if(relobj.fragment != n){
+ uriobj.fragment = relobj.fragment;
+ }
+ relobj = uriobj;
+ }else if(!relobj.scheme){
+ relobj.scheme = uriobj.scheme;
+
+ if(!relobj.authority){
+ relobj.authority = uriobj.authority;
+
+ if(relobj.path.charAt(0) != "/"){
+ var path = uriobj.path.substring(0,
+ uriobj.path.lastIndexOf("/") + 1) + relobj.path;
+
+ var segs = path.split("/");
+ for(var j = 0; j < segs.length; j++){
+ if(segs[j] == "."){
+ // flatten "./" references
+ if(j == segs.length - 1){
+ segs[j] = "";
+ }else{
+ segs.splice(j, 1);
+ j--;
+ }
+ }else if(j > 0 && !(j == 1 && segs[0] == "") &&
+ segs[j] == ".." && segs[j-1] != ".."){
+ // flatten "../" references
+ if(j == (segs.length - 1)){
+ segs.splice(j, 1);
+ segs[j - 1] = "";
+ }else{
+ segs.splice(j - 1, 2);
+ j -= 2;
+ }
+ }
+ }
+ relobj.path = segs.join("/");
+ }
+ }
+ }
+
+ uri = [];
+ if(relobj.scheme){
+ uri.push(relobj.scheme, ":");
+ }
+ if(relobj.authority){
+ uri.push("//", relobj.authority);
+ }
+ uri.push(relobj.path);
+ if(relobj.query){
+ uri.push("?", relobj.query);
+ }
+ if(relobj.fragment){
+ uri.push("#", relobj.fragment);
+ }
+ }
+
+ this.uri = uri.join("");
+
+ // break the uri into its main components
+ var r = this.uri.match(ore);
+
+ this.scheme = r[2] || (r[1] ? "" : n);
+ this.authority = r[4] || (r[3] ? "" : n);
+ this.path = r[5]; // can never be undefined
+ this.query = r[7] || (r[6] ? "" : n);
+ this.fragment = r[9] || (r[8] ? "" : n);
+
+ if(this.authority != n){
+ // server based naming authority
+ r = this.authority.match(ire);
+
+ this.user = r[3] || n;
+ this.password = r[4] || n;
+ this.host = r[6] || r[7]; // ipv6 || ipv4
+ this.port = r[9] || n;
+ }
+ };
+
+ dojo._Url.prototype.toString = function(){ return this.uri; };
+
+ dojo.moduleUrl = function(module, url){
+ if(!module){
+ //TODO: don't understand why this would ever be so, but that's the logic in loader
+ return null;
+ }
+ module = amdModuleName(module) + (url ? ("/" + url) : "");
+ var
+ type= "",
+ match= module.match(/(.+)(\.[^\/]*)$/);
+ if (match) {
+ module= match[1];
+ type= match[2];
+ }
+ return new dojo._Url(require.nameToUrl(module, type)); // dojo._Url
+ };
+
+ return dojo;
+});
diff --git a/js/dojo-1.6/dojo/lib/backCompat.xd.js b/js/dojo-1.6/dojo/lib/backCompat.xd.js new file mode 100644 index 0000000..61be9a2 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/backCompat.xd.js @@ -0,0 +1,287 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {
+defineResource: function(dojo, dijit, dojox){// AMD module id = dojo/lib/backCompat
+//
+// This module defines those dojo properties/methods that are defined by
+// dojo/_base/_loader/loader and are still needed when loading with and
+// AMD loader (when loading with an AMD loader, dojo/_base/_loader/loader
+// is never loaded).
+//
+// note: this module is relevant only when loading dojo with an AMD loader;
+// it is never evaluated otherwise.
+
+define(["require", "dojo/_base/_loader/bootstrap"], function(require, dojo){
+ // the following dojo properties do not exist in the AMD-loaded version of dojo 1.x:
+ var names= [
+ "_moduleHasPrefix",
+ "_loadPath",
+ "_loadUri",
+ "_loadUriAndCheck",
+ "loaded",
+ "_callLoaded",
+ "_getModuleSymbols",
+ "_loadModule",
+ "require",
+ "provide",
+ "platformRequire",
+ "requireIf",
+ "requireAfterIf",
+ "registerModulePath"
+ ], i, name;
+ for(i = 0; i<names.length;){
+ name = names[i++];
+ dojo[name] = (function(name) {
+ return function(){
+ console.warn("dojo." + name + " not available when using an AMD loader.");
+ };
+ })(name);
+ }
+
+ // define dojo.addOnLoad in terms of the DOMContentLoaded detection available from the AMD loaders
+ // (requirejs and bdBuild). Note that the behavior of this feature is slightly different compared to the dojo
+ // v1.x sync loader. There, the onload queue is fired upon detecting both DOMContentLoaded *and* all
+ // demanded modules have arrived. It is impossible to simulate this behavior with requirejs since it does
+ // not publish its internal status (it is possible with bdLoad).
+ // TODO: consider taking ownership of this API back from the loader.
+ // TODO: consider requesting requirejs publish more enough internal state to determine if all demanded
+ // modules have been defined.
+ var
+ argsToArray = function(args) {
+ var result = [], i;
+ for(i = 0; i<args.length;){
+ result.push(args[i++]);
+ }
+ return result;
+ },
+
+ simpleHitch = function(context, callback){
+ if(callback){
+ return (typeof callback=="string") ?
+ function(){context[callback]();} :
+ function(){callback.call(context);};
+ }else{
+ return context;
+ }
+ };
+ dojo.ready = dojo.addOnLoad = function(context, callback){
+ require.ready(callback ? simpleHitch(context, callback) : context);
+ };
+ dojo.addOnLoad(function() {
+ dojo.postLoad = dojo.config.afterOnLoad = true;
+ });
+ var dca = dojo.config.addOnLoad;
+ if(dca){
+ dojo.addOnLoad[(dca instanceof Array ? "apply" : "call")](dojo, dca);
+ }
+
+ // TODO: in the dojo 1.x sync loader the array dojo._loaders holds the queue of callbacks to be executed
+ // upon DOMContentLoaded. This queue is manipulated directly by dojo/uacss, dojo/parser, dijit/_base/wia
+ // and others (at least in dojox). This is also impossible to simulate universally across all AMD loaders.
+ // The following will at least accept client code accessing dojo._loaders , dojo._loaders.unshift, and
+ // dojo._loaders.splice--which is all that exists in the current dojo/dijit code stacks.
+ var
+ loaders = dojo._loaders = [],
+ runLoaders = function(){
+ var temp= loaders.slice(0);
+ Array.prototype.splice.apply(loaders, [0, loaders.length]);
+ while(temp.length){
+ temp.shift().call();
+ };
+ };
+ loaders.unshift = function() {
+ Array.prototype.unshift.apply(loaders, argsToArray(arguments));
+ require.ready(runLoaders);
+ };
+ loaders.splice = function() {
+ Array.prototype.splice.apply(loaders, argsToArray(arguments));
+ require.ready(runLoaders);
+ };
+
+ //TODO: put unload handling in a separate module
+ var unloaders = dojo._unloaders = [];
+ dojo.unloaded = function(){
+ while(unloaders.length){
+ unloaders.pop().call();
+ }
+ };
+
+ //TODO: kill this low-value function when it is exorcised from dojo
+ dojo._onto = function(arr, obj, fn){
+ arr.push(fn ? simpleHitch(obj, fn) : obj);
+ };
+
+ //TODO: kill this when the bootstrap is rewritten to not include DOMContentLoaded detection
+ // (it should probably be just a module) for now, just sink the detection; leverage the
+ // AMD loaders to handle DOMContentLoaded detection
+ dojo._modulesLoaded = function(){};
+
+ //TODO: kill this when we understand its purpose relative to AMD
+ dojo.loadInit = function(init){
+ init();
+ };
+
+ var amdModuleName= function(moduleName){
+ return moduleName.replace(/\./g, "/");
+ };
+
+ dojo.getL10nName = function(moduleName, bundleName, locale){
+ locale = locale ? locale.toLowerCase() : dojo.locale;
+ moduleName = "i18n!" + amdModuleName(moduleName);
+ return (/root/i.test(locale)) ?
+ (moduleName + "/nls/" + bundleName) :
+ (moduleName + "/nls/" + locale + "/" + bundleName);
+ };
+
+ dojo.requireLocalization = function(moduleName, bundleName, locale){
+ // NOTE: locales other than the locale specified in dojo.locale need to be specifically
+ // declared as a module dependency when using AMD.
+ if(require.vendor!="altoviso.com"){
+ locale = !locale || locale.toLowerCase() === dojo.locale ? "root" : locale;
+ }
+ return require(dojo.getL10nName(moduleName, bundleName, locale));
+ };
+
+ dojo.i18n= {
+ getLocalization: dojo.requireLocalization,
+ normalizeLocale: function(locale){
+ var result = locale ? locale.toLowerCase() : dojo.locale;
+ if(result == "root"){
+ result = "ROOT";
+ }
+ return result;
+ }
+ };
+
+ //TODO: dojo._Url seems rarely used and long to be part of the boostrap; consider moving
+ //note: this routine cut and paste from dojo/_base/_loader/loader
+ var
+ ore = new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),
+ ire = new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");
+ dojo._Url = function(){
+ var n = null,
+ _a = arguments,
+ uri = [_a[0]];
+ // resolve uri components relative to each other
+ for(var i = 1; i<_a.length; i++){
+ if(!_a[i]){ continue; }
+
+ // Safari doesn't support this.constructor so we have to be explicit
+ // FIXME: Tracked (and fixed) in Webkit bug 3537.
+ // http://bugs.webkit.org/show_bug.cgi?id=3537
+ var relobj = new dojo._Url(_a[i]+""),
+ uriobj = new dojo._Url(uri[0]+"");
+
+ if(
+ relobj.path == "" &&
+ !relobj.scheme &&
+ !relobj.authority &&
+ !relobj.query
+ ){
+ if(relobj.fragment != n){
+ uriobj.fragment = relobj.fragment;
+ }
+ relobj = uriobj;
+ }else if(!relobj.scheme){
+ relobj.scheme = uriobj.scheme;
+
+ if(!relobj.authority){
+ relobj.authority = uriobj.authority;
+
+ if(relobj.path.charAt(0) != "/"){
+ var path = uriobj.path.substring(0,
+ uriobj.path.lastIndexOf("/") + 1) + relobj.path;
+
+ var segs = path.split("/");
+ for(var j = 0; j < segs.length; j++){
+ if(segs[j] == "."){
+ // flatten "./" references
+ if(j == segs.length - 1){
+ segs[j] = "";
+ }else{
+ segs.splice(j, 1);
+ j--;
+ }
+ }else if(j > 0 && !(j == 1 && segs[0] == "") &&
+ segs[j] == ".." && segs[j-1] != ".."){
+ // flatten "../" references
+ if(j == (segs.length - 1)){
+ segs.splice(j, 1);
+ segs[j - 1] = "";
+ }else{
+ segs.splice(j - 1, 2);
+ j -= 2;
+ }
+ }
+ }
+ relobj.path = segs.join("/");
+ }
+ }
+ }
+
+ uri = [];
+ if(relobj.scheme){
+ uri.push(relobj.scheme, ":");
+ }
+ if(relobj.authority){
+ uri.push("//", relobj.authority);
+ }
+ uri.push(relobj.path);
+ if(relobj.query){
+ uri.push("?", relobj.query);
+ }
+ if(relobj.fragment){
+ uri.push("#", relobj.fragment);
+ }
+ }
+
+ this.uri = uri.join("");
+
+ // break the uri into its main components
+ var r = this.uri.match(ore);
+
+ this.scheme = r[2] || (r[1] ? "" : n);
+ this.authority = r[4] || (r[3] ? "" : n);
+ this.path = r[5]; // can never be undefined
+ this.query = r[7] || (r[6] ? "" : n);
+ this.fragment = r[9] || (r[8] ? "" : n);
+
+ if(this.authority != n){
+ // server based naming authority
+ r = this.authority.match(ire);
+
+ this.user = r[3] || n;
+ this.password = r[4] || n;
+ this.host = r[6] || r[7]; // ipv6 || ipv4
+ this.port = r[9] || n;
+ }
+ };
+
+ dojo._Url.prototype.toString = function(){ return this.uri; };
+
+ dojo.moduleUrl = function(module, url){
+ if(!module){
+ //TODO: don't understand why this would ever be so, but that's the logic in loader
+ return null;
+ }
+ module = amdModuleName(module) + (url ? ("/" + url) : "");
+ var
+ type= "",
+ match= module.match(/(.+)(\.[^\/]*)$/);
+ if (match) {
+ module= match[1];
+ type= match[2];
+ }
+ return new dojo._Url(require.nameToUrl(module, type)); // dojo._Url
+ };
+
+ return dojo;
+});
+
+}};});
diff --git a/js/dojo-1.6/dojo/lib/kernel.js b/js/dojo-1.6/dojo/lib/kernel.js new file mode 100644 index 0000000..f4e18f6 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/kernel.js @@ -0,0 +1,26 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+// AMD module id = dojo/lib/kernel
+//
+// This module ensures the dojo object is initialized by...
+//
+// * dojo/_base/_loader/bootstrap
+// * dojo/lib/backCompat
+// * dojo/_base/_loader/hostenv_browser
+//
+// This is roughly equivalent to the work that dojo.js does by injecting
+// bootstrap, loader, and hostenv_browser.
+//
+// note: this module is relevant only when loading dojo with an AMD loader;
+// it is never evaluated otherwise.
+
+// for now, we publish dojo into the global namespace because so many tests and apps expect it.
+define(["dojo/_base/_loader/hostenv_browser"], function(dojo_){
+ dojo= dojo_;
+ return dojo_;
+});
diff --git a/js/dojo-1.6/dojo/lib/kernel.xd.js b/js/dojo-1.6/dojo/lib/kernel.xd.js new file mode 100644 index 0000000..df744b3 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/kernel.xd.js @@ -0,0 +1,30 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {
+defineResource: function(dojo, dijit, dojox){// AMD module id = dojo/lib/kernel
+//
+// This module ensures the dojo object is initialized by...
+//
+// * dojo/_base/_loader/bootstrap
+// * dojo/lib/backCompat
+// * dojo/_base/_loader/hostenv_browser
+//
+// This is roughly equivalent to the work that dojo.js does by injecting
+// bootstrap, loader, and hostenv_browser.
+//
+// note: this module is relevant only when loading dojo with an AMD loader;
+// it is never evaluated otherwise.
+
+// for now, we publish dojo into the global namespace because so many tests and apps expect it.
+define(["dojo/_base/_loader/hostenv_browser"], function(dojo_){
+ dojo= dojo_;
+ return dojo_;
+});
+
+}};});
diff --git a/js/dojo-1.6/dojo/lib/main-browser.js b/js/dojo-1.6/dojo/lib/main-browser.js new file mode 100644 index 0000000..6ead354 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/main-browser.js @@ -0,0 +1,61 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+// AMD module id = dojo
+//
+// This is a package main module for the dojo package implemented so that the *absolute minimal*
+// changes are made to the dojo 1.x code. It is by no means optimal and should/will be replaced with
+// a less naive design--particularly as dojo v2.0 evolves.
+//
+// There are a few key design weaknesses in this implementation:
+//
+// * generally, v1.x bootstrap, tests, and apps assume dojo is global
+//
+// * the v1.x dojo/_base modules assume dojo is defined before they are defined
+// and their factory functions go about populating dojo--which is really part of defining
+// dojo. This leads to the appearance of a circular dependency and is a somewhat obtuse
+// design since the dojo object must be delivered to them under a different module
+// name (dojo/lib/kernel).
+//
+// * bootstrap modules tend to incorporate unrelated features (e.g., hostenv_browser includes
+// DOMContentLoad detection, thereby making it impossible to build out this feature if a
+// particular app does not need it).
+//
+// * The back compatibility layer requires/contains some non-optimal code that needs to be improved.
+//
+// As 1.7 and 2.0 evolve, these items will be addressed with more robust implementation.
+//
+// The boot sequence is as follows:
+//
+// dojo (this module) depends on...
+// dojo/lib/kernel which depends on...
+// dojo/_base/_loader/hostenv_browser which depends on...
+// dojo/lib/backCompat which depends on...
+// dojo/_base/_loader/bootstrap which depends on nothing
+//
+// This module further depends on the fairly ordinary modules in dojo/_base; each of these
+// modules depends on dojo/lib/kernel (at least) which provide the dojo object for them to augment.
+
+define("dojo", [
+ "dojo/lib/kernel",
+ "dojo/_base/lang",
+ "dojo/_base/array",
+ "dojo/_base/declare",
+ "dojo/_base/connect",
+ "dojo/_base/Deferred",
+ "dojo/_base/json",
+ "dojo/_base/Color",
+ "dojo/_base/window",
+ "dojo/_base/event",
+ "dojo/_base/html",
+ "dojo/_base/NodeList",
+ "dojo/_base/query",
+ "dojo/_base/xhr",
+ "dojo/_base/fx"
+], function(dojo){
+ return dojo;
+});
diff --git a/js/dojo-1.6/dojo/lib/main-browser.xd.js b/js/dojo-1.6/dojo/lib/main-browser.xd.js new file mode 100644 index 0000000..5708684 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/main-browser.xd.js @@ -0,0 +1,65 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {
+defineResource: function(dojo, dijit, dojox){// AMD module id = dojo
+//
+// This is a package main module for the dojo package implemented so that the *absolute minimal*
+// changes are made to the dojo 1.x code. It is by no means optimal and should/will be replaced with
+// a less naive design--particularly as dojo v2.0 evolves.
+//
+// There are a few key design weaknesses in this implementation:
+//
+// * generally, v1.x bootstrap, tests, and apps assume dojo is global
+//
+// * the v1.x dojo/_base modules assume dojo is defined before they are defined
+// and their factory functions go about populating dojo--which is really part of defining
+// dojo. This leads to the appearance of a circular dependency and is a somewhat obtuse
+// design since the dojo object must be delivered to them under a different module
+// name (dojo/lib/kernel).
+//
+// * bootstrap modules tend to incorporate unrelated features (e.g., hostenv_browser includes
+// DOMContentLoad detection, thereby making it impossible to build out this feature if a
+// particular app does not need it).
+//
+// * The back compatibility layer requires/contains some non-optimal code that needs to be improved.
+//
+// As 1.7 and 2.0 evolve, these items will be addressed with more robust implementation.
+//
+// The boot sequence is as follows:
+//
+// dojo (this module) depends on...
+// dojo/lib/kernel which depends on...
+// dojo/_base/_loader/hostenv_browser which depends on...
+// dojo/lib/backCompat which depends on...
+// dojo/_base/_loader/bootstrap which depends on nothing
+//
+// This module further depends on the fairly ordinary modules in dojo/_base; each of these
+// modules depends on dojo/lib/kernel (at least) which provide the dojo object for them to augment.
+
+define("dojo", [
+ "dojo/lib/kernel",
+ "dojo/_base/lang",
+ "dojo/_base/array",
+ "dojo/_base/declare",
+ "dojo/_base/connect",
+ "dojo/_base/Deferred",
+ "dojo/_base/json",
+ "dojo/_base/Color",
+ "dojo/_base/window",
+ "dojo/_base/event",
+ "dojo/_base/html",
+ "dojo/_base/NodeList",
+ "dojo/_base/query",
+ "dojo/_base/xhr",
+ "dojo/_base/fx"
+], function(dojo){
+ return dojo;
+});
+
+}};});
diff --git a/js/dojo-1.6/dojo/lib/plugins/i18n.js b/js/dojo-1.6/dojo/lib/plugins/i18n.js new file mode 100644 index 0000000..a4c992a --- /dev/null +++ b/js/dojo-1.6/dojo/lib/plugins/i18n.js @@ -0,0 +1,94 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+//
+// dojo i18n! plugin
+//
+// We choose to include our own plugin in hopes of leveraging functionality already contained in dojo
+// and thereby reducing the size of the plugin compared to various loader implementations. Naturally, this
+// allows AMD loaders to be used without their plugins.
+
+// CAUTION, this module may return improper results if the AMD loader does not support toAbsMid and client
+// code passes relative plugin resource module ids. In that case, you should consider using the i18n! plugin
+// that comes with your loader.
+
+define(["dojo"], function(dojo) {
+ var
+ nlsRe=
+ // regexp for reconstructing the master bundle name from parts of the regexp match
+ // nlsRe.exec("foo/bar/baz/nls/en-ca/foo") gives:
+ // ["foo/bar/baz/nls/en-ca/foo", "foo/bar/baz/nls/", "/", "/", "en-ca", "foo"]
+ // nlsRe.exec("foo/bar/baz/nls/foo") gives:
+ // ["foo/bar/baz/nls/foo", "foo/bar/baz/nls/", "/", "/", "foo", ""]
+ // so, if match[5] is blank, it means this is the top bundle definition.
+ // courtesy of http://requirejs.org
+ /(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/,
+
+ getAvailableLocales= function(
+ root,
+ locale,
+ bundlePath,
+ bundleName
+ ){
+ // return a vector of module ids containing all available locales with respect to the target locale
+ // For example, assuming:
+ // * the root bundle indicates specific bundles for "fr" and "fr-ca",
+ // * bundlePath is "myPackage/nls"
+ // * bundleName is "myBundle"
+ // Then a locale argument of "fr-ca" would return
+ // ["myPackage/nls/myBundle", "myPackage/nls/fr/myBundle", "myPackage/nls/fr-ca/myBundle"]
+ // Notice that bundles are returned least-specific to most-specific, starting with the root.
+
+ for(var result= [bundlePath + bundleName], localeParts= locale.split("-"), current= "", i= 0; i<localeParts.length; i++){
+ current+= localeParts[i];
+ if(root[current]){
+ result.push(bundlePath + current + "/" + bundleName);
+ }
+ }
+ return result;
+ },
+
+ cache= {};
+
+ return {
+ load: function(id, require, load){
+ // note: id may be relative
+ var
+ match= nlsRe.exec(id),
+ bundlePath= (require.toAbsMid && require.toAbsMid(match[1])) || match[1],
+ bundleName= match[5] || match[4],
+ bundlePathAndName= bundlePath + bundleName,
+ locale= (match[5] && match[4]) || dojo.locale,
+ target= bundlePathAndName + "/" + locale;
+
+ // if we've already resolved this request, just return it
+ if (cache[target]) {
+ load(cache[target]);
+ return;
+ }
+
+ // get the root bundle which instructs which other bundles are required to contruct the localized bundle
+ require([bundlePathAndName], function(root){
+ var
+ current= cache[bundlePathAndName + "/"]= dojo.clone(root.root),
+ availableLocales= getAvailableLocales(root, locale, bundlePath, bundleName);
+ require(availableLocales, function(){
+ for (var i= 1; i<availableLocales.length; i++){
+ cache[bundlePathAndName + "/" + availableLocales[i]]= current= dojo.mixin(dojo.clone(current), arguments[i]);
+ }
+ // target may not have been resolve (e.g., maybe only "fr" exists when "fr-ca" was requested)
+ cache[target]= current;
+ load(current);
+ });
+ });
+ },
+
+ cache: function(mid, value){
+ cache[mid]= value;
+ }
+ };
+});
diff --git a/js/dojo-1.6/dojo/lib/plugins/i18n.xd.js b/js/dojo-1.6/dojo/lib/plugins/i18n.xd.js new file mode 100644 index 0000000..aa85cfb --- /dev/null +++ b/js/dojo-1.6/dojo/lib/plugins/i18n.xd.js @@ -0,0 +1,98 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {
+defineResource: function(dojo, dijit, dojox){//
+// dojo i18n! plugin
+//
+// We choose to include our own plugin in hopes of leveraging functionality already contained in dojo
+// and thereby reducing the size of the plugin compared to various loader implementations. Naturally, this
+// allows AMD loaders to be used without their plugins.
+
+// CAUTION, this module may return improper results if the AMD loader does not support toAbsMid and client
+// code passes relative plugin resource module ids. In that case, you should consider using the i18n! plugin
+// that comes with your loader.
+
+define(["dojo"], function(dojo) {
+ var
+ nlsRe=
+ // regexp for reconstructing the master bundle name from parts of the regexp match
+ // nlsRe.exec("foo/bar/baz/nls/en-ca/foo") gives:
+ // ["foo/bar/baz/nls/en-ca/foo", "foo/bar/baz/nls/", "/", "/", "en-ca", "foo"]
+ // nlsRe.exec("foo/bar/baz/nls/foo") gives:
+ // ["foo/bar/baz/nls/foo", "foo/bar/baz/nls/", "/", "/", "foo", ""]
+ // so, if match[5] is blank, it means this is the top bundle definition.
+ // courtesy of http://requirejs.org
+ /(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/,
+
+ getAvailableLocales= function(
+ root,
+ locale,
+ bundlePath,
+ bundleName
+ ){
+ // return a vector of module ids containing all available locales with respect to the target locale
+ // For example, assuming:
+ // * the root bundle indicates specific bundles for "fr" and "fr-ca",
+ // * bundlePath is "myPackage/nls"
+ // * bundleName is "myBundle"
+ // Then a locale argument of "fr-ca" would return
+ // ["myPackage/nls/myBundle", "myPackage/nls/fr/myBundle", "myPackage/nls/fr-ca/myBundle"]
+ // Notice that bundles are returned least-specific to most-specific, starting with the root.
+
+ for(var result= [bundlePath + bundleName], localeParts= locale.split("-"), current= "", i= 0; i<localeParts.length; i++){
+ current+= localeParts[i];
+ if(root[current]){
+ result.push(bundlePath + current + "/" + bundleName);
+ }
+ }
+ return result;
+ },
+
+ cache= {};
+
+ return {
+ load: function(id, require, load){
+ // note: id may be relative
+ var
+ match= nlsRe.exec(id),
+ bundlePath= (require.toAbsMid && require.toAbsMid(match[1])) || match[1],
+ bundleName= match[5] || match[4],
+ bundlePathAndName= bundlePath + bundleName,
+ locale= (match[5] && match[4]) || dojo.locale,
+ target= bundlePathAndName + "/" + locale;
+
+ // if we've already resolved this request, just return it
+ if (cache[target]) {
+ load(cache[target]);
+ return;
+ }
+
+ // get the root bundle which instructs which other bundles are required to contruct the localized bundle
+ require([bundlePathAndName], function(root){
+ var
+ current= cache[bundlePathAndName + "/"]= dojo.clone(root.root),
+ availableLocales= getAvailableLocales(root, locale, bundlePath, bundleName);
+ require(availableLocales, function(){
+ for (var i= 1; i<availableLocales.length; i++){
+ cache[bundlePathAndName + "/" + availableLocales[i]]= current= dojo.mixin(dojo.clone(current), arguments[i]);
+ }
+ // target may not have been resolve (e.g., maybe only "fr" exists when "fr-ca" was requested)
+ cache[target]= current;
+ load(current);
+ });
+ });
+ },
+
+ cache: function(mid, value){
+ cache[mid]= value;
+ }
+ };
+});
+
+}};});
diff --git a/js/dojo-1.6/dojo/lib/plugins/text.js b/js/dojo-1.6/dojo/lib/plugins/text.js new file mode 100644 index 0000000..fa87eaa --- /dev/null +++ b/js/dojo-1.6/dojo/lib/plugins/text.js @@ -0,0 +1,70 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+//
+// dojo text! plugin
+//
+// We choose to include our own plugin in hopes of leveraging functionality already contained in dojo
+// and thereby reducing the size of the plugin compared to various loader implementations. Naturally, this
+// allows AMD loaders to be used without their plugins.
+
+// CAUTION, this module may return improper results if the AMD loader does not support toAbsMid and client
+// code passes relative plugin resource module ids. In that case, you should consider using the text! plugin
+// that comes with your loader.
+
+define(["dojo", "dojo/cache"], function(dojo){
+ var
+ cached= {},
+
+ cache= function(cacheId, url, value){
+ cached[cacheId]= value;
+ dojo.cache({toString:function(){return url;}}, value);
+ },
+
+ strip= function(text){
+ //note: this function courtesy of James Burke (https://github.com/jrburke/requirejs)
+ //Strips <?xml ...?> declarations so that external SVG and XML
+ //documents can be added to a document without worry. Also, if the string
+ //is an HTML document, only the part inside the body tag is returned.
+ if(text){
+ text= text.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
+ var matches= text.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
+ if(matches){
+ text= matches[1];
+ }
+ }else{
+ text = "";
+ }
+ return text;
+ };
+
+ return {
+ load:function(id, require, load){
+ var match, cacheId, url, parts= id.split("!");
+ if(require.toAbsMid){
+ match= parts[0].match(/(.+)(\.[^\/]*)$/);
+ cacheId= match ? require.toAbsMid(match[1]) + match[2] : require.toAbsMid(parts[0]);
+ if(cacheId in cached){
+ load(parts[1]=="strip" ? strip(cached[cacheId]) : cached[cacheId]);
+ return;
+ }
+ }
+ url= require.toUrl(parts[0]);
+ dojo.xhrGet({
+ url:url,
+ load:function(text){
+ cacheId && cache(cacheId, url, text);
+ load(parts[1]=="strip" ? strip(text) : text);
+ }
+ });
+ },
+
+ cache:function(cacheId, mid, type, value) {
+ cache(cacheId, require.nameToUrl(mid) + type, value);
+ }
+ };
+});
diff --git a/js/dojo-1.6/dojo/lib/plugins/text.xd.js b/js/dojo-1.6/dojo/lib/plugins/text.xd.js new file mode 100644 index 0000000..fc83071 --- /dev/null +++ b/js/dojo-1.6/dojo/lib/plugins/text.xd.js @@ -0,0 +1,74 @@ +/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {
+defineResource: function(dojo, dijit, dojox){//
+// dojo text! plugin
+//
+// We choose to include our own plugin in hopes of leveraging functionality already contained in dojo
+// and thereby reducing the size of the plugin compared to various loader implementations. Naturally, this
+// allows AMD loaders to be used without their plugins.
+
+// CAUTION, this module may return improper results if the AMD loader does not support toAbsMid and client
+// code passes relative plugin resource module ids. In that case, you should consider using the text! plugin
+// that comes with your loader.
+
+define(["dojo", "dojo/cache"], function(dojo){
+ var
+ cached= {},
+
+ cache= function(cacheId, url, value){
+ cached[cacheId]= value;
+ dojo.cache({toString:function(){return url;}}, value);
+ },
+
+ strip= function(text){
+ //note: this function courtesy of James Burke (https://github.com/jrburke/requirejs)
+ //Strips <?xml ...?> declarations so that external SVG and XML
+ //documents can be added to a document without worry. Also, if the string
+ //is an HTML document, only the part inside the body tag is returned.
+ if(text){
+ text= text.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, "");
+ var matches= text.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);
+ if(matches){
+ text= matches[1];
+ }
+ }else{
+ text = "";
+ }
+ return text;
+ };
+
+ return {
+ load:function(id, require, load){
+ var match, cacheId, url, parts= id.split("!");
+ if(require.toAbsMid){
+ match= parts[0].match(/(.+)(\.[^\/]*)$/);
+ cacheId= match ? require.toAbsMid(match[1]) + match[2] : require.toAbsMid(parts[0]);
+ if(cacheId in cached){
+ load(parts[1]=="strip" ? strip(cached[cacheId]) : cached[cacheId]);
+ return;
+ }
+ }
+ url= require.toUrl(parts[0]);
+ dojo.xhrGet({
+ url:url,
+ load:function(text){
+ cacheId && cache(cacheId, url, text);
+ load(parts[1]=="strip" ? strip(text) : text);
+ }
+ });
+ },
+
+ cache:function(cacheId, mid, type, value) {
+ cache(cacheId, require.nameToUrl(mid) + type, value);
+ }
+ };
+});
+
+}};});
|
