diff --git a/spring-js/src/main/resources/META-INF/dojo/data/ItemFileReadStore.js b/spring-js/src/main/resources/META-INF/dojo/data/ItemFileReadStore.js new file mode 100644 index 00000000..71e41889 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/ItemFileReadStore.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.ItemFileReadStore"]){dojo._hasResource["dojo.data.ItemFileReadStore"]=true;dojo.provide("dojo.data.ItemFileReadStore");dojo.require("dojo.data.util.filter");dojo.require("dojo.data.util.simpleFetch");dojo.require("dojo.date.stamp");dojo.declare("dojo.data.ItemFileReadStore",null,{constructor:function(_1){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._jsonFileUrl=_1.url;this._jsonData=_1.data;this._datatypeMap=_1.typeMap||{};if(!this._datatypeMap["Date"]){this._datatypeMap["Date"]={type:Date,deserialize:function(_2){return dojo.date.stamp.fromISOString(_2);}};}this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(_1.urlPreventCache!==undefined){this.urlPreventCache=_1.urlPreventCache?true:false;}if(_1.clearOnClose){this.clearOnClose=true;}},url:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,_assertIsItem:function(_3){if(!this.isItem(_3)){throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");}},_assertIsAttribute:function(_4){if(typeof _4!=="string"){throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");}},getValue:function(_5,_6,_7){var _8=this.getValues(_5,_6);return (_8.length>0)?_8[0]:_7;},getValues:function(_9,_a){this._assertIsItem(_9);this._assertIsAttribute(_a);return _9[_a]||[];},getAttributes:function(_b){this._assertIsItem(_b);var _c=[];for(var _d in _b){if((_d!==this._storeRefPropName)&&(_d!==this._itemNumPropName)&&(_d!==this._rootItemPropName)&&(_d!==this._reverseRefMap)){_c.push(_d);}}return _c;},hasAttribute:function(_e,_f){return this.getValues(_e,_f).length>0;},containsValue:function(_10,_11,_12){var _13=undefined;if(typeof _12==="string"){_13=dojo.data.util.filter.patternToRegExp(_12,false);}return this._containsValue(_10,_11,_12,_13);},_containsValue:function(_14,_15,_16,_17){return dojo.some(this.getValues(_14,_15),function(_18){if(_18!==null&&!dojo.isObject(_18)&&_17){if(_18.toString().match(_17)){return true;}}else{if(_16===_18){return true;}}});},isItem:function(_19){if(_19&&_19[this._storeRefPropName]===this){if(this._arrayOfAllItems[_19[this._itemNumPropName]]===_19){return true;}}return false;},isItemLoaded:function(_1a){return this.isItem(_1a);},loadItem:function(_1b){this._assertIsItem(_1b.item);},getFeatures:function(){return this._features;},getLabel:function(_1c){if(this._labelAttr&&this.isItem(_1c)){return this.getValue(_1c,this._labelAttr);}return undefined;},getLabelAttributes:function(_1d){if(this._labelAttr){return [this._labelAttr];}return null;},_fetchItems:function(_1e,_1f,_20){var _21=this;var _22=function(_23,_24){var _25=[];if(_23.query){var _26=_23.queryOptions?_23.queryOptions.ignoreCase:false;var _27={};for(var key in _23.query){var _29=_23.query[key];if(typeof _29==="string"){_27[key]=dojo.data.util.filter.patternToRegExp(_29,_26);}}for(var i=0;i<_24.length;++i){var _2b=true;var _2c=_24[i];if(_2c===null){_2b=false;}else{for(var key in _23.query){var _29=_23.query[key];if(!_21._containsValue(_2c,key,_29,_27[key])){_2b=false;}}}if(_2b){_25.push(_2c);}}_1f(_25,_23);}else{for(var i=0;i<_24.length;++i){var _2d=_24[i];if(_2d!==null){_25.push(_2d);}}_1f(_25,_23);}};if(this._loadFinished){_22(_1e,this._getItemsArray(_1e.queryOptions));}else{if(this._jsonFileUrl){if(this._loadInProgress){this._queuedFetches.push({args:_1e,filter:_22});}else{this._loadInProgress=true;var _2e={url:_21._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache};var _2f=dojo.xhrGet(_2e);_2f.addCallback(function(_30){try{_21._getItemsFromLoadedData(_30);_21._loadFinished=true;_21._loadInProgress=false;_22(_1e,_21._getItemsArray(_1e.queryOptions));_21._handleQueuedFetches();}catch(e){_21._loadFinished=true;_21._loadInProgress=false;_20(e,_1e);}});_2f.addErrback(function(_31){_21._loadInProgress=false;_20(_31,_1e);});}}else{if(this._jsonData){try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;_22(_1e,this._getItemsArray(_1e.queryOptions));}catch(e){_20(e,_1e);}}else{_20(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),_1e);}}}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var i=0;i= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.data.ItemFileWriteStore"]){dojo._hasResource["dojo.data.ItemFileWriteStore"]=true;dojo.provide("dojo.data.ItemFileWriteStore");dojo.require("dojo.data.ItemFileReadStore");dojo.declare("dojo.data.ItemFileWriteStore",dojo.data.ItemFileReadStore,{constructor:function(_1){this._features["dojo.data.api.Write"]=true;this._features["dojo.data.api.Notification"]=true;this._pending={_newItems:{},_modifiedItems:{},_deletedItems:{}};if(!this._datatypeMap["Date"].serialize){this._datatypeMap["Date"].serialize=function(_2){return dojo.date.stamp.toISOString(_2,{zulu:true});};}if(_1&&(_1.referenceIntegrity===false)){this.referenceIntegrity=false;}this._saveInProgress=false;},referenceIntegrity:true,_assert:function(_3){if(!_3){throw new Error("assertion failed in ItemFileWriteStore");}},_getIdentifierAttribute:function(){var _4=this.getFeatures()["dojo.data.api.Identity"];return _4;},newItem:function(_5,_6){this._assert(!this._saveInProgress);if(!this._loadFinished){this._forceLoad();}if(typeof _5!="object"&&typeof _5!="undefined"){throw new Error("newItem() was passed something other than an object");}var _7=null;var _8=this._getIdentifierAttribute();if(_8===Number){_7=this._arrayOfAllItems.length;}else{_7=_5[_8];if(typeof _7==="undefined"){throw new Error("newItem() was not passed an identity for the new item");}if(dojo.isArray(_7)){throw new Error("newItem() was not passed an single-valued identity");}}if(this._itemsByIdentity){this._assert(typeof this._itemsByIdentity[_7]==="undefined");}this._assert(typeof this._pending._newItems[_7]==="undefined");this._assert(typeof this._pending._deletedItems[_7]==="undefined");var _9={};_9[this._storeRefPropName]=this;_9[this._itemNumPropName]=this._arrayOfAllItems.length;if(this._itemsByIdentity){this._itemsByIdentity[_7]=_9;_9[_8]=[_7];}this._arrayOfAllItems.push(_9);var _a=null;if(_6&&_6.parent&&_6.attribute){_a={item:_6.parent,attribute:_6.attribute,oldValue:undefined};var _b=this.getValues(_6.parent,_6.attribute);if(_b&&_b.length>0){var _c=_b.slice(0,_b.length);if(_b.length===1){_a.oldValue=_b[0];}else{_a.oldValue=_b.slice(0,_b.length);}_c.push(_9);this._setValueOrValues(_6.parent,_6.attribute,_c,false);_a.newValue=this.getValues(_6.parent,_6.attribute);}else{this._setValueOrValues(_6.parent,_6.attribute,_9,false);_a.newValue=_9;}}else{_9[this._rootItemPropName]=true;this._arrayOfTopLevelItems.push(_9);}this._pending._newItems[_7]=_9;for(var _d in _5){if(_d===this._storeRefPropName||_d===this._itemNumPropName){throw new Error("encountered bug in ItemFileWriteStore.newItem");}var _e=_5[_d];if(!dojo.isArray(_e)){_e=[_e];}_9[_d]=_e;if(this.referenceIntegrity){for(var i=0;i<_e.length;i++){var val=_e[i];if(this.isItem(val)){this._addReferenceToMap(val,_9,_d);}}}}this.onNew(_9,_a);return _9;},_removeArrayElement:function(_11,_12){var _13=dojo.indexOf(_11,_12);if(_13!=-1){_11.splice(_13,1);return true;}return false;},deleteItem:function(_14){this._assert(!this._saveInProgress);this._assertIsItem(_14);var _15=_14[this._itemNumPropName];var _16=this.getIdentity(_14);if(this.referenceIntegrity){var _17=this.getAttributes(_14);if(_14[this._reverseRefMap]){_14["backup_"+this._reverseRefMap]=dojo.clone(_14[this._reverseRefMap]);}dojo.forEach(_17,function(_18){dojo.forEach(this.getValues(_14,_18),function(_19){if(this.isItem(_19)){if(!_14["backupRefs_"+this._reverseRefMap]){_14["backupRefs_"+this._reverseRefMap]=[];}_14["backupRefs_"+this._reverseRefMap].push({id:this.getIdentity(_19),attr:_18});this._removeReferenceFromMap(_19,_14,_18);}},this);},this);var _1a=_14[this._reverseRefMap];if(_1a){for(var _1b in _1a){var _1c=null;if(this._itemsByIdentity){_1c=this._itemsByIdentity[_1b];}else{_1c=this._arrayOfAllItems[_1b];}if(_1c){for(var _1d in _1a[_1b]){var _1e=this.getValues(_1c,_1d)||[];var _1f=dojo.filter(_1e,function(_20){return !(this.isItem(_20)&&this.getIdentity(_20)==_16);},this);this._removeReferenceFromMap(_14,_1c,_1d);if(_1f.length<_1e.length){this._setValueOrValues(_1c,_1d,_1f,true);}}}}}}this._arrayOfAllItems[_15]=null;_14[this._storeRefPropName]=null;if(this._itemsByIdentity){delete this._itemsByIdentity[_16];}this._pending._deletedItems[_16]=_14;if(_14[this._rootItemPropName]){this._removeArrayElement(this._arrayOfTopLevelItems,_14);}this.onDelete(_14);return true;},setValue:function(_21,_22,_23){return this._setValueOrValues(_21,_22,_23,true);},setValues:function(_24,_25,_26){return this._setValueOrValues(_24,_25,_26,true);},unsetAttribute:function(_27,_28){return this._setValueOrValues(_27,_28,[],true);},_setValueOrValues:function(_29,_2a,_2b,_2c){this._assert(!this._saveInProgress);this._assertIsItem(_29);this._assert(dojo.isString(_2a));this._assert(typeof _2b!=="undefined");var _2d=this._getIdentifierAttribute();if(_2a==_2d){throw new Error("ItemFileWriteStore does not have support for changing the value of an item's identifier.");}var _2e=this._getValueOrValues(_29,_2a);var _2f=this.getIdentity(_29);if(!this._pending._modifiedItems[_2f]){var _30={};for(var key in _29){if((key===this._storeRefPropName)||(key===this._itemNumPropName)||(key===this._rootItemPropName)){_30[key]=_29[key];}else{if(key===this._reverseRefMap){_30[key]=dojo.clone(_29[key]);}else{_30[key]=_29[key].slice(0,_29[key].length);}}}this._pending._modifiedItems[_2f]=_30;}var _32=false;if(dojo.isArray(_2b)&&_2b.length===0){_32=delete _29[_2a];_2b=undefined;if(this.referenceIntegrity&&_2e){var _33=_2e;if(!dojo.isArray(_33)){_33=[_33];}for(var i=0;i<_33.length;i++){var _35=_33[i];if(this.isItem(_35)){this._removeReferenceFromMap(_35,_29,_2a);}}}}else{var _36;if(dojo.isArray(_2b)){var _37=_2b;_36=_2b.slice(0,_2b.length);}else{_36=[_2b];}if(this.referenceIntegrity){if(_2e){var _33=_2e;if(!dojo.isArray(_33)){_33=[_33];}var map={};dojo.forEach(_33,function(_39){if(this.isItem(_39)){var id=this.getIdentity(_39);map[id.toString()]=true;}},this);dojo.forEach(_36,function(_3b){if(this.isItem(_3b)){var id=this.getIdentity(_3b);if(map[id.toString()]){delete map[id.toString()];}else{this._addReferenceToMap(_3b,_29,_2a);}}},this);for(var rId in map){var _3e;if(this._itemsByIdentity){_3e=this._itemsByIdentity[rId];}else{_3e=this._arrayOfAllItems[rId];}this._removeReferenceFromMap(_3e,_29,_2a);}}else{for(var i=0;i<_36.length;i++){var _35=_36[i];if(this.isItem(_35)){this._addReferenceToMap(_35,_29,_2a);}}}}_29[_2a]=_36;_32=true;}if(_2c){this.onSet(_29,_2a,_2e,_2b);}return _32;},_addReferenceToMap:function(_3f,_40,_41){var _42=this.getIdentity(_40);var _43=_3f[this._reverseRefMap];if(!_43){_43=_3f[this._reverseRefMap]={};}var _44=_43[_42];if(!_44){_44=_43[_42]={};}_44[_41]=true;},_removeReferenceFromMap:function(_45,_46,_47){var _48=this.getIdentity(_46);var _49=_45[this._reverseRefMap];var _4a;if(_49){for(_4a in _49){if(_4a==_48){delete _49[_4a][_47];if(this._isEmpty(_49[_4a])){delete _49[_4a];}}}if(this._isEmpty(_49)){delete _45[this._reverseRefMap];}}},_dumpReferenceMap:function(){var i;for(i=0;i0){_63=false;}}}return _63;},save:function(_65){this._assert(!this._saveInProgress);this._saveInProgress=true;var _66=this;var _67=function(){_66._pending={_newItems:{},_modifiedItems:{},_deletedItems:{}};_66._saveInProgress=false;if(_65&&_65.onComplete){var _68=_65.scope||dojo.global;_65.onComplete.call(_68);}};var _69=function(){_66._saveInProgress=false;if(_65&&_65.onError){var _6a=_65.scope||dojo.global;_65.onError.call(_6a);}};if(this._saveEverything){var _6b=this._getNewFileContentString();this._saveEverything(_67,_69,_6b);}if(this._saveCustom){this._saveCustom(_67,_69);}if(!this._saveEverything&&!this._saveCustom){_67();}},revert:function(){this._assert(!this._saveInProgress);var _6c;for(_6c in this._pending._modifiedItems){var _6d=this._pending._modifiedItems[_6c];var _6e=null;if(this._itemsByIdentity){_6e=this._itemsByIdentity[_6c];}else{_6e=this._arrayOfAllItems[_6c];}_6d[this._storeRefPropName]=this;_6e[this._storeRefPropName]=null;var _6f=_6e[this._itemNumPropName];this._arrayOfAllItems[_6f]=_6d;if(_6e[this._rootItemPropName]){var i;for(i=0;i= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.data.api.Identity"]){dojo._hasResource["dojo.data.api.Identity"]=true;dojo.provide("dojo.data.api.Identity");dojo.require("dojo.data.api.Read");dojo.declare("dojo.data.api.Identity",dojo.data.api.Read,{getFeatures:function(){return {"dojo.data.api.Read":true,"dojo.data.api.Identity":true};},getIdentity:function(_1){throw new Error("Unimplemented API: dojo.data.api.Identity.getIdentity");var _2=null;return _2;},getIdentityAttributes:function(_3){throw new Error("Unimplemented API: dojo.data.api.Identity.getIdentityAttributes");return null;},fetchItemByIdentity:function(_4){if(!this.isItemLoaded(_4.item)){throw new Error("Unimplemented API: dojo.data.api.Identity.fetchItemByIdentity");}}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/api/Notification.js b/spring-js/src/main/resources/META-INF/dojo/data/api/Notification.js new file mode 100644 index 00000000..7a2f06e0 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/api/Notification.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.api.Notification"]){dojo._hasResource["dojo.data.api.Notification"]=true;dojo.provide("dojo.data.api.Notification");dojo.require("dojo.data.api.Read");dojo.declare("dojo.data.api.Notification",dojo.data.api.Read,{getFeatures:function(){return {"dojo.data.api.Read":true,"dojo.data.api.Notification":true};},onSet:function(_1,_2,_3,_4){throw new Error("Unimplemented API: dojo.data.api.Notification.onSet");},onNew:function(_5,_6){throw new Error("Unimplemented API: dojo.data.api.Notification.onNew");},onDelete:function(_7){throw new Error("Unimplemented API: dojo.data.api.Notification.onDelete");}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/api/Read.js b/spring-js/src/main/resources/META-INF/dojo/data/api/Read.js new file mode 100644 index 00000000..f8aa32fd --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/api/Read.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.api.Read"]){dojo._hasResource["dojo.data.api.Read"]=true;dojo.provide("dojo.data.api.Read");dojo.require("dojo.data.api.Request");dojo.declare("dojo.data.api.Read",null,{getValue:function(_1,_2,_3){var _4=null;throw new Error("Unimplemented API: dojo.data.api.Read.getValue");return _4;},getValues:function(_5,_6){var _7=[];throw new Error("Unimplemented API: dojo.data.api.Read.getValues");return _7;},getAttributes:function(_8){var _9=[];throw new Error("Unimplemented API: dojo.data.api.Read.getAttributes");return _9;},hasAttribute:function(_a,_b){throw new Error("Unimplemented API: dojo.data.api.Read.hasAttribute");return false;},containsValue:function(_c,_d,_e){throw new Error("Unimplemented API: dojo.data.api.Read.containsValue");return false;},isItem:function(_f){throw new Error("Unimplemented API: dojo.data.api.Read.isItem");return false;},isItemLoaded:function(_10){throw new Error("Unimplemented API: dojo.data.api.Read.isItemLoaded");return false;},loadItem:function(_11){if(!this.isItemLoaded(_11.item)){throw new Error("Unimplemented API: dojo.data.api.Read.loadItem");}},fetch:function(_12){var _13=null;throw new Error("Unimplemented API: dojo.data.api.Read.fetch");return _13;},getFeatures:function(){return {"dojo.data.api.Read":true};},close:function(_14){throw new Error("Unimplemented API: dojo.data.api.Read.close");},getLabel:function(_15){throw new Error("Unimplemented API: dojo.data.api.Read.getLabel");return undefined;},getLabelAttributes:function(_16){throw new Error("Unimplemented API: dojo.data.api.Read.getLabelAttributes");return null;}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/api/Request.js b/spring-js/src/main/resources/META-INF/dojo/data/api/Request.js new file mode 100644 index 00000000..8afbeb8f --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/api/Request.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.api.Request"]){dojo._hasResource["dojo.data.api.Request"]=true;dojo.provide("dojo.data.api.Request");dojo.declare("dojo.data.api.Request",null,{abort:function(){throw new Error("Unimplemented API: dojo.data.api.Request.abort");}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/api/Write.js b/spring-js/src/main/resources/META-INF/dojo/data/api/Write.js new file mode 100644 index 00000000..9c512322 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/api/Write.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.api.Write"]){dojo._hasResource["dojo.data.api.Write"]=true;dojo.provide("dojo.data.api.Write");dojo.require("dojo.data.api.Read");dojo.declare("dojo.data.api.Write",dojo.data.api.Read,{getFeatures:function(){return {"dojo.data.api.Read":true,"dojo.data.api.Write":true};},newItem:function(_1,_2){var _3;throw new Error("Unimplemented API: dojo.data.api.Write.newItem");return _3;},deleteItem:function(_4){throw new Error("Unimplemented API: dojo.data.api.Write.deleteItem");return false;},setValue:function(_5,_6,_7){throw new Error("Unimplemented API: dojo.data.api.Write.setValue");return false;},setValues:function(_8,_9,_a){throw new Error("Unimplemented API: dojo.data.api.Write.setValues");return false;},unsetAttribute:function(_b,_c){throw new Error("Unimplemented API: dojo.data.api.Write.clear");return false;},save:function(_d){throw new Error("Unimplemented API: dojo.data.api.Write.save");},revert:function(){throw new Error("Unimplemented API: dojo.data.api.Write.revert");return false;},isDirty:function(_e){throw new Error("Unimplemented API: dojo.data.api.Write.isDirty");return false;}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/util/filter.js b/spring-js/src/main/resources/META-INF/dojo/data/util/filter.js new file mode 100644 index 00000000..8268d9b7 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/util/filter.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.util.filter"]){dojo._hasResource["dojo.data.util.filter"]=true;dojo.provide("dojo.data.util.filter");dojo.data.util.filter.patternToRegExp=function(_1,_2){var _3="^";var c=null;for(var i=0;i<_1.length;i++){c=_1.charAt(i);switch(c){case "\\":_3+=c;i++;_3+=_1.charAt(i);break;case "*":_3+=".*";break;case "?":_3+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":_3+="\\";default:_3+=c;}}_3+="$";if(_2){return new RegExp(_3,"mi");}else{return new RegExp(_3,"m");}};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/util/simpleFetch.js b/spring-js/src/main/resources/META-INF/dojo/data/util/simpleFetch.js new file mode 100644 index 00000000..21813be1 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/util/simpleFetch.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.util.simpleFetch"]){dojo._hasResource["dojo.data.util.simpleFetch"]=true;dojo.provide("dojo.data.util.simpleFetch");dojo.require("dojo.data.util.sorter");dojo.data.util.simpleFetch.fetch=function(_1){_1=_1||{};if(!_1.store){_1.store=this;}var _2=this;var _3=function(_4,_5){if(_5.onError){var _6=_5.scope||dojo.global;_5.onError.call(_6,_4,_5);}};var _7=function(_8,_9){var _a=_9.abort||null;var _b=false;var _c=_9.start?_9.start:0;var _d=(_9.count&&(_9.count!==Infinity))?(_c+_9.count):_8.length;_9.abort=function(){_b=true;if(_a){_a.call(_9);}};var _e=_9.scope||dojo.global;if(!_9.store){_9.store=_2;}if(_9.onBegin){_9.onBegin.call(_e,_8.length,_9);}if(_9.sort){_8.sort(dojo.data.util.sorter.createSortFunction(_9.sort,_2));}if(_9.onItem){for(var i=_c;(i<_8.length)&&(i<_d);++i){var _10=_8[i];if(!_b){_9.onItem.call(_e,_10,_9);}}}if(_9.onComplete&&!_b){var _11=null;if(!_9.onItem){_11=_8.slice(_c,_d);}_9.onComplete.call(_e,_11,_9);}};this._fetchItems(_1,_7,_3);return _1;};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/data/util/sorter.js b/spring-js/src/main/resources/META-INF/dojo/data/util/sorter.js new file mode 100644 index 00000000..af381665 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/data/util/sorter.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.data.util.sorter"]){dojo._hasResource["dojo.data.util.sorter"]=true;dojo.provide("dojo.data.util.sorter");dojo.data.util.sorter.basicComparator=function(a,b){var _3=0;if(a>b||typeof a==="undefined"||a===null){_3=1;}else{if(a= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.date.locale"]){dojo._hasResource["dojo.date.locale"]=true;dojo.provide("dojo.date.locale");dojo.require("dojo.date");dojo.require("dojo.cldr.supplemental");dojo.require("dojo.regexp");dojo.require("dojo.string");dojo.require("dojo.i18n");dojo.requireLocalization("dojo.cldr","gregorian",null,"de,en,en-au,en-ca,en-gb,es,es-es,fr,ROOT,it,it-it,ja,ko,ko-kr,pt,pt-br,zh,zh-cn,zh-tw");(function(){function formatPattern(_1,_2,_3,_4){return _4.replace(/([a-z])\1*/ig,function(_5){var s,_7;var c=_5.charAt(0);var l=_5.length;var _a=["abbr","wide","narrow"];switch(c){case "G":s=_2[(l<4)?"eraAbbr":"eraNames"][_1.getFullYear()<0?0:1];break;case "y":s=_1.getFullYear();switch(l){case 1:break;case 2:if(!_3){s=String(s);s=s.substr(s.length-2);break;}default:_7=true;}break;case "Q":case "q":s=Math.ceil((_1.getMonth()+1)/3);_7=true;break;case "M":var m=_1.getMonth();if(l<3){s=m+1;_7=true;}else{var _c=["months","format",_a[l-3]].join("-");s=_2[_c][m];}break;case "w":var _d=0;s=dojo.date.locale._getWeekOfYear(_1,_d);_7=true;break;case "d":s=_1.getDate();_7=true;break;case "D":s=dojo.date.locale._getDayOfYear(_1);_7=true;break;case "E":var d=_1.getDay();if(l<3){s=d+1;_7=true;}else{var _f=["days","format",_a[l-3]].join("-");s=_2[_f][d];}break;case "a":var _10=(_1.getHours()<12)?"am":"pm";s=_2[_10];break;case "h":case "H":case "K":case "k":var h=_1.getHours();switch(c){case "h":s=(h%12)||12;break;case "H":s=h;break;case "K":s=(h%12);break;case "k":s=h||24;break;}_7=true;break;case "m":s=_1.getMinutes();_7=true;break;case "s":s=_1.getSeconds();_7=true;break;case "S":s=Math.round(_1.getMilliseconds()*Math.pow(10,l-3));_7=true;break;case "v":case "z":s=dojo.date.getTimezoneName(_1);if(s){break;}l=4;case "Z":var _12=_1.getTimezoneOffset();var tz=[(_12<=0?"+":"-"),dojo.string.pad(Math.floor(Math.abs(_12)/60),2),dojo.string.pad(Math.abs(_12)%60,2)];if(l==4){tz.splice(0,0,"GMT");tz.splice(3,0,":");}s=tz.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+_4);}if(_7){s=dojo.string.pad(s,l);}return s;});};dojo.date.locale.format=function(_14,_15){_15=_15||{};var _16=dojo.i18n.normalizeLocale(_15.locale);var _17=_15.formatLength||"short";var _18=dojo.date.locale._getGregorianBundle(_16);var str=[];var _1a=dojo.hitch(this,formatPattern,_14,_18,_15.fullYear);if(_15.selector=="year"){var _1b=_14.getFullYear();if(_16.match(/^zh|^ja/)){_1b+="年";}return _1b;}if(_15.selector!="time"){var _1c=_15.datePattern||_18["dateFormat-"+_17];if(_1c){str.push(_processPattern(_1c,_1a));}}if(_15.selector!="date"){var _1d=_15.timePattern||_18["timeFormat-"+_17];if(_1d){str.push(_processPattern(_1d,_1a));}}var _1e=str.join(" ");return _1e;};dojo.date.locale.regexp=function(_1f){return dojo.date.locale._parseInfo(_1f).regexp;};dojo.date.locale._parseInfo=function(_20){_20=_20||{};var _21=dojo.i18n.normalizeLocale(_20.locale);var _22=dojo.date.locale._getGregorianBundle(_21);var _23=_20.formatLength||"short";var _24=_20.datePattern||_22["dateFormat-"+_23];var _25=_20.timePattern||_22["timeFormat-"+_23];var _26;if(_20.selector=="date"){_26=_24;}else{if(_20.selector=="time"){_26=_25;}else{_26=_24+" "+_25;}}var _27=[];var re=_processPattern(_26,dojo.hitch(this,_buildDateTimeRE,_27,_22,_20));return {regexp:re,tokens:_27,bundle:_22};};dojo.date.locale.parse=function(_29,_2a){var _2b=dojo.date.locale._parseInfo(_2a);var _2c=_2b.tokens,_2d=_2b.bundle;var re=new RegExp("^"+_2b.regexp+"$",_2b.strict?"":"i");var _2f=re.exec(_29);if(!_2f){return null;}var _30=["abbr","wide","narrow"];var _31=[1970,0,1,0,0,0,0];var _32="";var _33=dojo.every(_2f,function(v,i){if(!i){return true;}var _36=_2c[i-1];var l=_36.length;switch(_36.charAt(0)){case "y":if(l!=2&&_2a.strict){_31[0]=v;}else{if(v<100){v=Number(v);var _38=""+new Date().getFullYear();var _39=_38.substring(0,2)*100;var _3a=Math.min(Number(_38.substring(2,4))+20,99);var num=(v<_3a)?_39+v:_39-100+v;_31[0]=num;}else{if(_2a.strict){return false;}_31[0]=v;}}break;case "M":if(l>2){var _3c=_2d["months-format-"+_30[l-3]].concat();if(!_2a.strict){v=v.replace(".","").toLowerCase();_3c=dojo.map(_3c,function(s){return s.replace(".","").toLowerCase();});}v=dojo.indexOf(_3c,v);if(v==-1){return false;}}else{v--;}_31[1]=v;break;case "E":case "e":var _3e=_2d["days-format-"+_30[l-3]].concat();if(!_2a.strict){v=v.toLowerCase();_3e=dojo.map(_3e,function(d){return d.toLowerCase();});}v=dojo.indexOf(_3e,v);if(v==-1){return false;}break;case "D":_31[1]=0;case "d":_31[2]=v;break;case "a":var am=_2a.am||_2d.am;var pm=_2a.pm||_2d.pm;if(!_2a.strict){var _42=/\./g;v=v.replace(_42,"").toLowerCase();am=am.replace(_42,"").toLowerCase();pm=pm.replace(_42,"").toLowerCase();}if(_2a.strict&&v!=am&&v!=pm){return false;}_32=(v==pm)?"p":(v==am)?"a":"";break;case "K":if(v==24){v=0;}case "h":case "H":case "k":if(v>23){return false;}_31[3]=v;break;case "m":_31[4]=v;break;case "s":_31[5]=v;break;case "S":_31[6]=v;}return true;});var _43=+_31[3];if(_32==="p"&&_43<12){_31[3]=_43+12;}else{if(_32==="a"&&_43==12){_31[3]=0;}}var _44=new Date(_31[0],_31[1],_31[2],_31[3],_31[4],_31[5],_31[6]);if(_2a.strict){_44.setFullYear(_31[0]);}var _45=_2c.join("");if(!_33||(_45.indexOf("M")!=-1&&_44.getMonth()!=_31[1])||(_45.indexOf("d")!=-1&&_44.getDate()!=_31[2])){return null;}return _44;};function _processPattern(_46,_47,_48,_49){var _4a=function(x){return x;};_47=_47||_4a;_48=_48||_4a;_49=_49||_4a;var _4c=_46.match(/(''|[^'])+/g);var _4d=_46.charAt(0)=="'";dojo.forEach(_4c,function(_4e,i){if(!_4e){_4c[i]="";}else{_4c[i]=(_4d?_48:_47)(_4e);_4d=!_4d;}});return _49(_4c.join(""));};function _buildDateTimeRE(_50,_51,_52,_53){_53=dojo.regexp.escapeString(_53);if(!_52.strict){_53=_53.replace(" a"," ?a");}return _53.replace(/([a-z])\1*/ig,function(_54){var s;var c=_54.charAt(0);var l=_54.length;var p2="",p3="";if(_52.strict){if(l>1){p2="0"+"{"+(l-1)+"}";}if(l>2){p3="0"+"{"+(l-2)+"}";}}else{p2="0?";p3="0{0,2}";}switch(c){case "y":s="\\d{2,4}";break;case "M":s=(l>2)?"\\S+?":p2+"[1-9]|1[0-2]";break;case "D":s=p2+"[1-9]|"+p3+"[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-6]";break;case "d":s="[12]\\d|"+p2+"[1-9]|3[01]";break;case "w":s=p2+"[1-9]|[1-4][0-9]|5[0-3]";break;case "E":s="\\S+";break;case "h":s=p2+"[1-9]|1[0-2]";break;case "k":s=p2+"\\d|1[01]";break;case "H":s=p2+"\\d|1\\d|2[0-3]";break;case "K":s=p2+"[1-9]|1\\d|2[0-4]";break;case "m":case "s":s="[0-5]\\d";break;case "S":s="\\d{"+l+"}";break;case "a":var am=_52.am||_51.am||"AM";var pm=_52.pm||_51.pm||"PM";if(_52.strict){s=am+"|"+pm;}else{s=am+"|"+pm;if(am!=am.toLowerCase()){s+="|"+am.toLowerCase();}if(pm!=pm.toLowerCase()){s+="|"+pm.toLowerCase();}if(s.indexOf(".")!=-1){s+="|"+s.replace(/\./g,"");}}s=s.replace(/\./g,"\\.");break;default:s=".*";}if(_50){_50.push(_54);}return "("+s+")";}).replace(/[\xa0 ]/g,"[\\s\\xa0]");};})();(function(){var _5c=[];dojo.date.locale.addCustomFormats=function(_5d,_5e){_5c.push({pkg:_5d,name:_5e});};dojo.date.locale._getGregorianBundle=function(_5f){var _60={};dojo.forEach(_5c,function(_61){var _62=dojo.i18n.getLocalization(_61.pkg,_61.name,_5f);_60=dojo.mixin(_60,_62);},this);return _60;};})();dojo.date.locale.addCustomFormats("dojo.cldr","gregorian");dojo.date.locale.getNames=function(_63,_64,use,_66){var _67;var _68=dojo.date.locale._getGregorianBundle(_66);var _69=[_63,use,_64];if(use=="standAlone"){var key=_69.join("-");_67=_68[key];if(_67[0]==1){_67=undefined;}}_69[1]="format";return (_67||_68[_69.join("-")]).concat();};dojo.date.locale.isWeekend=function(_6b,_6c){var _6d=dojo.cldr.supplemental.getWeekend(_6c);var day=(_6b||new Date()).getDay();if(_6d.end<_6d.start){_6d.end+=7;if(day<_6d.start){day+=7;}}return day>=_6d.start&&day<=_6d.end;};dojo.date.locale._getDayOfYear=function(_6f){return dojo.date.difference(new Date(_6f.getFullYear(),0,1,_6f.getHours()),_6f)+1;};dojo.date.locale._getWeekOfYear=function(_70,_71){if(arguments.length==1){_71=0;}var _72=new Date(_70.getFullYear(),0,1).getDay();var adj=(_72-_71+7)%7;var _74=Math.floor((dojo.date.locale._getDayOfYear(_70)+adj-1)/7);if(_72==_71){_74++;}return _74;};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/date/stamp.js b/spring-js/src/main/resources/META-INF/dojo/date/stamp.js new file mode 100644 index 00000000..47e32e39 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/date/stamp.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.date.stamp"]){dojo._hasResource["dojo.date.stamp"]=true;dojo.provide("dojo.date.stamp");dojo.date.stamp.fromISOString=function(_1,_2){if(!dojo.date.stamp._isoRegExp){dojo.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;}var _3=dojo.date.stamp._isoRegExp.exec(_1);var _4=null;if(_3){_3.shift();if(_3[1]){_3[1]--;}if(_3[6]){_3[6]*=1000;}if(_2){_2=new Date(_2);dojo.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(_5){return _2["get"+_5]();}).forEach(function(_6,_7){if(_3[_7]===undefined){_3[_7]=_6;}});}_4=new Date(_3[0]||1970,_3[1]||0,_3[2]||1,_3[3]||0,_3[4]||0,_3[5]||0,_3[6]||0);var _8=0;var _9=_3[7]&&_3[7].charAt(0);if(_9!="Z"){_8=((_3[8]||0)*60)+(Number(_3[9])||0);if(_9!="-"){_8*=-1;}}if(_9){_8-=_4.getTimezoneOffset();}if(_8){_4.setTime(_4.getTime()+_8*60000);}}return _4;};dojo.date.stamp.toISOString=function(_a,_b){var _=function(n){return (n<10)?"0"+n:n;};_b=_b||{};var _e=[];var _f=_b.zulu?"getUTC":"get";var _10="";if(_b.selector!="time"){var _11=_a[_f+"FullYear"]();_10=["0000".substr((_11+"").length)+_11,_(_a[_f+"Month"]()+1),_(_a[_f+"Date"]())].join("-");}_e.push(_10);if(_b.selector!="date"){var _12=[_(_a[_f+"Hours"]()),_(_a[_f+"Minutes"]()),_(_a[_f+"Seconds"]())].join(":");var _13=_a[_f+"Milliseconds"]();if(_b.milliseconds){_12+="."+(_13<100?"0":"")+_(_13);}if(_b.zulu){_12+="Z";}else{if(_b.selector!="time"){var _14=_a.getTimezoneOffset();var _15=Math.abs(_14);_12+=(_14>0?"-":"+")+_(Math.floor(_15/60))+":"+_(_15%60);}}_e.push(_12);}return _e.join("T");};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/Avatar.js b/spring-js/src/main/resources/META-INF/dojo/dnd/Avatar.js new file mode 100644 index 00000000..f0df6a1e --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/Avatar.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.Avatar"]){dojo._hasResource["dojo.dnd.Avatar"]=true;dojo.provide("dojo.dnd.Avatar");dojo.require("dojo.dnd.common");dojo.declare("dojo.dnd.Avatar",null,{constructor:function(_1){this.manager=_1;this.construct();},construct:function(){var a=dojo.doc.createElement("table");a.className="dojoDndAvatar";a.style.position="absolute";a.style.zIndex=1999;a.style.margin="0px";var b=dojo.doc.createElement("tbody");var tr=dojo.doc.createElement("tr");tr.className="dojoDndAvatarHeader";var td=dojo.doc.createElement("td");td.innerHTML=this._generateText();tr.appendChild(td);dojo.style(tr,"opacity",0.9);b.appendChild(tr);var k=Math.min(5,this.manager.nodes.length);var _7=this.manager.source,_8;for(var i=0;i= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.dnd.Container"]){dojo._hasResource["dojo.dnd.Container"]=true;dojo.provide("dojo.dnd.Container");dojo.require("dojo.dnd.common");dojo.require("dojo.parser");dojo.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(_1,_2){this.node=dojo.byId(_1);if(!_2){_2={};}this.creator=_2.creator||null;this.skipForm=_2.skipForm;this.parent=_2.dropParent&&dojo.byId(_2.dropParent);this.map={};this.current=null;this.containerState="";dojo.addClass(this.node,"dojoDndContainer");if(!(_2&&_2._skipStartup)){this.startup();}this.events=[dojo.connect(this.node,"onmouseover",this,"onMouseOver"),dojo.connect(this.node,"onmouseout",this,"onMouseOut"),dojo.connect(this.node,"ondragstart",this,"onSelectStart"),dojo.connect(this.node,"onselectstart",this,"onSelectStart")];},creator:function(){},getItem:function(_3){return this.map[_3];},setItem:function(_4,_5){this.map[_4]=_5;},delItem:function(_6){delete this.map[_6];},forInItems:function(f,o){o=o||dojo.global;var m=this.map,e=dojo.dnd._empty;for(var i in m){if(i in e){continue;}f.call(o,m[i],i,this);}return o;},clearItems:function(){this.map={};},getAllNodes:function(){return dojo.query("> .dojoDndItem",this.parent);},sync:function(){var _c={};this.getAllNodes().forEach(function(_d){if(_d.id){var _e=this.getItem(_d.id);if(_e){_c[_d.id]=_e;return;}}else{_d.id=dojo.dnd.getUniqueId();}var _f=_d.getAttribute("dndType"),_10=_d.getAttribute("dndData");_c[_d.id]={data:_10||_d.innerHTML,type:_f?_f.split(/\s*,\s*/):["text"]};},this);this.map=_c;return this;},insertNodes:function(_11,_12,_13){if(!this.parent.firstChild){_13=null;}else{if(_12){if(!_13){_13=this.parent.firstChild;}}else{if(_13){_13=_13.nextSibling;}}}if(_13){for(var i=0;i<_11.length;++i){var t=this._normalizedCreator(_11[i]);this.setItem(t.node.id,{data:t.data,type:t.type});this.parent.insertBefore(t.node,_13);}}else{for(var i=0;i<_11.length;++i){var t=this._normalizedCreator(_11[i]);this.setItem(t.node.id,{data:t.data,type:t.type});this.parent.appendChild(t.node);}}return this;},destroy:function(){dojo.forEach(this.events,dojo.disconnect);this.clearItems();this.node=this.parent=this.current=null;},markupFactory:function(_16,_17){_16._skipStartup=true;return new dojo.dnd.Container(_17,_16);},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()=="table"){var c=this.parent.getElementsByTagName("tbody");if(c&&c.length){this.parent=c[0];}}}this.defaultCreator=dojo.dnd._defaultCreator(this.parent);this.sync();},onMouseOver:function(e){var n=e.relatedTarget;while(n){if(n==this.node){break;}try{n=n.parentNode;}catch(x){n=null;}}if(!n){this._changeState("Container","Over");this.onOverEvent();}n=this._getChildByEvent(e);if(this.current==n){return;}if(this.current){this._removeItemClass(this.current,"Over");}if(n){this._addItemClass(n,"Over");}this.current=n;},onMouseOut:function(e){for(var n=e.relatedTarget;n;){if(n==this.node){return;}try{n=n.parentNode;}catch(x){n=null;}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null;}this._changeState("Container","");this.onOutEvent();},onSelectStart:function(e){if(!this.skipForm||!dojo.dnd.isFormElement(e)){dojo.stopEvent(e);}},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(_1e,_1f){var _20="dojoDnd"+_1e;var _21=_1e.toLowerCase()+"State";dojo.removeClass(this.node,_20+this[_21]);dojo.addClass(this.node,_20+_1f);this[_21]=_1f;},_addItemClass:function(_22,_23){dojo.addClass(_22,"dojoDndItem"+_23);},_removeItemClass:function(_24,_25){dojo.removeClass(_24,"dojoDndItem"+_25);},_getChildByEvent:function(e){var _27=e.target;if(_27){for(var _28=_27.parentNode;_28;_27=_28,_28=_27.parentNode){if(_28==this.parent&&dojo.hasClass(_27,"dojoDndItem")){return _27;}}}return null;},_normalizedCreator:function(_29,_2a){var t=(this.creator||this.defaultCreator).call(this,_29,_2a);if(!dojo.isArray(t.type)){t.type=["text"];}if(!t.node.id){t.node.id=dojo.dnd.getUniqueId();}dojo.addClass(t.node,"dojoDndItem");return t;}});dojo.dnd._createNode=function(tag){if(!tag){return dojo.dnd._createSpan;}return function(_2d){var n=dojo.doc.createElement(tag);n.innerHTML=_2d;return n;};};dojo.dnd._createTrTd=function(_2f){var tr=dojo.doc.createElement("tr");var td=dojo.doc.createElement("td");td.innerHTML=_2f;tr.appendChild(td);return tr;};dojo.dnd._createSpan=function(_32){var n=dojo.doc.createElement("span");n.innerHTML=_32;return n;};dojo.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};dojo.dnd._defaultCreator=function(_34){var tag=_34.tagName.toLowerCase();var c=tag=="tbody"||tag=="thead"?dojo.dnd._createTrTd:dojo.dnd._createNode(dojo.dnd._defaultCreatorNodes[tag]);return function(_37,_38){var _39=_37&&dojo.isObject(_37),_3a,_3b,n;if(_39&&_37.tagName&&_37.nodeType&&_37.getAttribute){_3a=_37.getAttribute("dndData")||_37.innerHTML;_3b=_37.getAttribute("dndType");_3b=_3b?_3b.split(/\s*,\s*/):["text"];n=_37;}else{_3a=(_39&&_37.data)?_37.data:_37;_3b=(_39&&_37.type)?_37.type:["text"];n=(_38=="avatar"?dojo.dnd._createSpan:c)(String(_3a));}n.id=dojo.dnd.getUniqueId();return {node:n,data:_3a,type:_3b};};};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/Manager.js b/spring-js/src/main/resources/META-INF/dojo/dnd/Manager.js new file mode 100644 index 00000000..1b183fcc --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/Manager.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.Manager"]){dojo._hasResource["dojo.dnd.Manager"]=true;dojo.provide("dojo.dnd.Manager");dojo.require("dojo.dnd.common");dojo.require("dojo.dnd.autoscroll");dojo.require("dojo.dnd.Avatar");dojo.declare("dojo.dnd.Manager",null,{constructor:function(){this.avatar=null;this.source=null;this.nodes=[];this.copy=true;this.target=null;this.canDropFlag=false;this.events=[];},OFFSET_X:16,OFFSET_Y:16,overSource:function(_1){if(this.avatar){this.target=(_1&&_1.targetState!="Disabled")?_1:null;this.canDropFlag=Boolean(this.target);this.avatar.update();}dojo.publish("/dnd/source/over",[_1]);},outSource:function(_2){if(this.avatar){if(this.target==_2){this.target=null;this.canDropFlag=false;this.avatar.update();dojo.publish("/dnd/source/over",[null]);}}else{dojo.publish("/dnd/source/over",[null]);}},startDrag:function(_3,_4,_5){this.source=_3;this.nodes=_4;this.copy=Boolean(_5);this.avatar=this.makeAvatar();dojo.body().appendChild(this.avatar.node);dojo.publish("/dnd/start",[_3,_4,this.copy]);this.events=[dojo.connect(dojo.doc,"onmousemove",this,"onMouseMove"),dojo.connect(dojo.doc,"onmouseup",this,"onMouseUp"),dojo.connect(dojo.doc,"onkeydown",this,"onKeyDown"),dojo.connect(dojo.doc,"onkeyup",this,"onKeyUp")];var c="dojoDnd"+(_5?"Copy":"Move");dojo.addClass(dojo.body(),c);},canDrop:function(_7){var _8=Boolean(this.target&&_7);if(this.canDropFlag!=_8){this.canDropFlag=_8;this.avatar.update();}},stopDrag:function(){dojo.removeClass(dojo.body(),"dojoDndCopy");dojo.removeClass(dojo.body(),"dojoDndMove");dojo.forEach(this.events,dojo.disconnect);this.events=[];this.avatar.destroy();this.avatar=null;this.source=this.target=null;this.nodes=[];},makeAvatar:function(){return new dojo.dnd.Avatar(this);},updateAvatar:function(){this.avatar.update();},onMouseMove:function(e){var a=this.avatar;if(a){dojo.dnd.autoScrollNodes(e);var s=a.node.style;s.left=(e.pageX+this.OFFSET_X)+"px";s.top=(e.pageY+this.OFFSET_Y)+"px";var _c=Boolean(this.source.copyState(dojo.dnd.getCopyKeyState(e)));if(this.copy!=_c){this._setCopyStatus(_c);}}},onMouseUp:function(e){if(this.avatar&&(!("mouseButton" in this.source)||(dojo.isSafari&&dojo.dnd._isMac&&this.source.mouseButton==2?e.button==0:this.source.mouseButton==e.button))){if(this.target&&this.canDropFlag){var _e=Boolean(this.source.copyState(dojo.dnd.getCopyKeyState(e))),_f=[this.source,this.nodes,_e,this.target];dojo.publish("/dnd/drop/before",_f);dojo.publish("/dnd/drop",_f);}else{dojo.publish("/dnd/cancel");}this.stopDrag();}},onKeyDown:function(e){if(this.avatar){switch(e.keyCode){case dojo.keys.CTRL:var _11=Boolean(this.source.copyState(true));if(this.copy!=_11){this._setCopyStatus(_11);}break;case dojo.keys.ESCAPE:dojo.publish("/dnd/cancel");this.stopDrag();break;}}},onKeyUp:function(e){if(this.avatar&&e.keyCode==dojo.keys.CTRL){var _13=Boolean(this.source.copyState(false));if(this.copy!=_13){this._setCopyStatus(_13);}}},_setCopyStatus:function(_14){this.copy=_14;this.source._markDndStatus(this.copy);this.updateAvatar();dojo.removeClass(dojo.body(),"dojoDnd"+(this.copy?"Move":"Copy"));dojo.addClass(dojo.body(),"dojoDnd"+(this.copy?"Copy":"Move"));}});dojo.dnd._manager=null;dojo.dnd.manager=function(){if(!dojo.dnd._manager){dojo.dnd._manager=new dojo.dnd.Manager();}return dojo.dnd._manager;};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/Moveable.js b/spring-js/src/main/resources/META-INF/dojo/dnd/Moveable.js new file mode 100644 index 00000000..320ab7bb --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/Moveable.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.Moveable"]){dojo._hasResource["dojo.dnd.Moveable"]=true;dojo.provide("dojo.dnd.Moveable");dojo.require("dojo.dnd.Mover");dojo.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(_1,_2){this.node=dojo.byId(_1);if(!_2){_2={};}this.handle=_2.handle?dojo.byId(_2.handle):null;if(!this.handle){this.handle=this.node;}this.delay=_2.delay>0?_2.delay:0;this.skip=_2.skip;this.mover=_2.mover?_2.mover:dojo.dnd.Mover;this.events=[dojo.connect(this.handle,"onmousedown",this,"onMouseDown"),dojo.connect(this.handle,"ondragstart",this,"onSelectStart"),dojo.connect(this.handle,"onselectstart",this,"onSelectStart")];},markupFactory:function(_3,_4){return new dojo.dnd.Moveable(_4,_3);},destroy:function(){dojo.forEach(this.events,dojo.disconnect);this.events=this.node=this.handle=null;},onMouseDown:function(e){if(this.skip&&dojo.dnd.isFormElement(e)){return;}if(this.delay){this.events.push(dojo.connect(this.handle,"onmousemove",this,"onMouseMove"));this.events.push(dojo.connect(this.handle,"onmouseup",this,"onMouseUp"));this._lastX=e.pageX;this._lastY=e.pageY;}else{this.onDragDetected(e);}dojo.stopEvent(e);},onMouseMove:function(e){if(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e);}dojo.stopEvent(e);},onMouseUp:function(e){dojo.disconnect(this.events.pop());dojo.disconnect(this.events.pop());dojo.stopEvent(e);},onSelectStart:function(e){if(!this.skip||!dojo.dnd.isFormElement(e)){dojo.stopEvent(e);}},onDragDetected:function(e){new this.mover(this.node,e,this);},onMoveStart:function(_a){dojo.publish("/dnd/move/start",[_a]);dojo.addClass(dojo.body(),"dojoMove");dojo.addClass(this.node,"dojoMoveItem");},onMoveStop:function(_b){dojo.publish("/dnd/move/stop",[_b]);dojo.removeClass(dojo.body(),"dojoMove");dojo.removeClass(this.node,"dojoMoveItem");},onFirstMove:function(_c){},onMove:function(_d,_e){this.onMoving(_d,_e);var s=_d.node.style;s.left=_e.l+"px";s.top=_e.t+"px";this.onMoved(_d,_e);},onMoving:function(_10,_11){},onMoved:function(_12,_13){}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/Mover.js b/spring-js/src/main/resources/META-INF/dojo/dnd/Mover.js new file mode 100644 index 00000000..ce98e83e --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/Mover.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.Mover"]){dojo._hasResource["dojo.dnd.Mover"]=true;dojo.provide("dojo.dnd.Mover");dojo.require("dojo.dnd.common");dojo.require("dojo.dnd.autoscroll");dojo.declare("dojo.dnd.Mover",null,{constructor:function(_1,e,_3){this.node=dojo.byId(_1);this.marginBox={l:e.pageX,t:e.pageY};this.mouseButton=e.button;var h=this.host=_3,d=_1.ownerDocument,_6=dojo.connect(d,"onmousemove",this,"onFirstMove");this.events=[dojo.connect(d,"onmousemove",this,"onMouseMove"),dojo.connect(d,"onmouseup",this,"onMouseUp"),dojo.connect(d,"ondragstart",dojo,"stopEvent"),dojo.connect(d,"onselectstart",dojo,"stopEvent"),_6];if(h&&h.onMoveStart){h.onMoveStart(this);}},onMouseMove:function(e){dojo.dnd.autoScroll(e);var m=this.marginBox;this.host.onMove(this,{l:m.l+e.pageX,t:m.t+e.pageY});dojo.stopEvent(e);},onMouseUp:function(e){if(dojo.isSafari&&dojo.dnd._isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button){this.destroy();}dojo.stopEvent(e);},onFirstMove:function(){var s=this.node.style,l,t,h=this.host;switch(s.position){case "relative":case "absolute":l=Math.round(parseFloat(s.left));t=Math.round(parseFloat(s.top));break;default:s.position="absolute";var m=dojo.marginBox(this.node);var b=dojo.doc.body;var bs=dojo.getComputedStyle(b);var bm=dojo._getMarginBox(b,bs);var bc=dojo._getContentBox(b,bs);l=m.l-(bc.l-bm.l);t=m.t-(bc.t-bm.t);break;}this.marginBox.l=l-this.marginBox.l;this.marginBox.t=t-this.marginBox.t;if(h&&h.onFirstMove){h.onFirstMove(this);}dojo.disconnect(this.events.pop());},destroy:function(){dojo.forEach(this.events,dojo.disconnect);var h=this.host;if(h&&h.onMoveStop){h.onMoveStop(this);}this.events=this.node=this.host=null;}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/Selector.js b/spring-js/src/main/resources/META-INF/dojo/dnd/Selector.js new file mode 100644 index 00000000..408a651d --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/Selector.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.Selector"]){dojo._hasResource["dojo.dnd.Selector"]=true;dojo.provide("dojo.dnd.Selector");dojo.require("dojo.dnd.common");dojo.require("dojo.dnd.Container");dojo.declare("dojo.dnd.Selector",dojo.dnd.Container,{constructor:function(_1,_2){if(!_2){_2={};}this.singular=_2.singular;this.autoSync=_2.autoSync;this.selection={};this.anchor=null;this.simpleSelection=false;this.events.push(dojo.connect(this.node,"onmousedown",this,"onMouseDown"),dojo.connect(this.node,"onmouseup",this,"onMouseUp"));},singular:false,getSelectedNodes:function(){var t=new dojo.NodeList();var e=dojo.dnd._empty;for(var i in this.selection){if(i in e){continue;}t.push(dojo.byId(i));}return t;},selectNone:function(){return this._removeSelection()._removeAnchor();},selectAll:function(){this.forInItems(function(_6,id){this._addItemClass(dojo.byId(id),"Selected");this.selection[id]=1;},this);return this._removeAnchor();},deleteSelectedNodes:function(){var e=dojo.dnd._empty;for(var i in this.selection){if(i in e){continue;}var n=dojo.byId(i);this.delItem(i);dojo._destroyElement(n);}this.anchor=null;this.selection={};return this;},forInSelectedItems:function(f,o){o=o||dojo.global;var s=this.selection,e=dojo.dnd._empty;for(var i in s){if(i in e){continue;}f.call(o,this.getItem(i),i,this);}},sync:function(){dojo.dnd.Selector.superclass.sync.call(this);if(this.anchor){if(!this.getItem(this.anchor.id)){this.anchor=null;}}var t=[],e=dojo.dnd._empty;for(var i in this.selection){if(i in e){continue;}if(!this.getItem(i)){t.push(i);}}dojo.forEach(t,function(i){delete this.selection[i];},this);return this;},insertNodes:function(_14,_15,_16,_17){var _18=this._normalizedCreator;this._normalizedCreator=function(_19,_1a){var t=_18.call(this,_19,_1a);if(_14){if(!this.anchor){this.anchor=t.node;this._removeItemClass(t.node,"Selected");this._addItemClass(this.anchor,"Anchor");}else{if(this.anchor!=t.node){this._removeItemClass(t.node,"Anchor");this._addItemClass(t.node,"Selected");}}this.selection[t.node.id]=1;}else{this._removeItemClass(t.node,"Selected");this._removeItemClass(t.node,"Anchor");}return t;};dojo.dnd.Selector.superclass.insertNodes.call(this,_15,_16,_17);this._normalizedCreator=_18;return this;},destroy:function(){dojo.dnd.Selector.superclass.destroy.call(this);this.selection=this.anchor=null;},markupFactory:function(_1c,_1d){_1c._skipStartup=true;return new dojo.dnd.Selector(_1d,_1c);},onMouseDown:function(e){if(this.autoSync){this.sync();}if(!this.current){return;}if(!this.singular&&!dojo.dnd.getCopyKeyState(e)&&!e.shiftKey&&(this.current.id in this.selection)){this.simpleSelection=true;dojo.stopEvent(e);return;}if(!this.singular&&e.shiftKey){if(!dojo.dnd.getCopyKeyState(e)){this._removeSelection();}var c=this.getAllNodes();if(c.length){if(!this.anchor){this.anchor=c[0];this._addItemClass(this.anchor,"Anchor");}this.selection[this.anchor.id]=1;if(this.anchor!=this.current){var i=0;for(;i= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.dnd.Source"]){dojo._hasResource["dojo.dnd.Source"]=true;dojo.provide("dojo.dnd.Source");dojo.require("dojo.dnd.Selector");dojo.require("dojo.dnd.Manager");dojo.declare("dojo.dnd.Source",dojo.dnd.Selector,{isSource:true,horizontal:false,copyOnly:false,selfCopy:false,selfAccept:true,skipForm:false,withHandles:false,autoSync:false,delay:0,accept:["text"],constructor:function(_1,_2){dojo.mixin(this,dojo.mixin({},_2));var _3=this.accept;if(_3.length){this.accept={};for(var i=0;i<_3.length;++i){this.accept[_3[i]]=1;}}this.isDragging=false;this.mouseDown=false;this.targetAnchor=null;this.targetBox=null;this.before=true;this._lastX=0;this._lastY=0;this.sourceState="";if(this.isSource){dojo.addClass(this.node,"dojoDndSource");}this.targetState="";if(this.accept){dojo.addClass(this.node,"dojoDndTarget");}if(this.horizontal){dojo.addClass(this.node,"dojoDndHorizontal");}this.topics=[dojo.subscribe("/dnd/source/over",this,"onDndSourceOver"),dojo.subscribe("/dnd/start",this,"onDndStart"),dojo.subscribe("/dnd/drop",this,"onDndDrop"),dojo.subscribe("/dnd/cancel",this,"onDndCancel")];},checkAcceptance:function(_5,_6){if(this==_5){return !this.copyOnly||this.selfAccept;}for(var i=0;i<_6.length;++i){var _8=_5.getItem(_6[i].id).type;var _9=false;for(var j=0;j<_8.length;++j){if(_8[j] in this.accept){_9=true;break;}}if(!_9){return false;}}return true;},copyState:function(_b,_c){if(_b){return true;}if(arguments.length<2){_c=this==dojo.dnd.manager().target;}if(_c){if(this.copyOnly){return this.selfCopy;}}else{return this.copyOnly;}return false;},destroy:function(){dojo.dnd.Source.superclass.destroy.call(this);dojo.forEach(this.topics,dojo.unsubscribe);this.targetAnchor=null;},markupFactory:function(_d,_e){_d._skipStartup=true;return new dojo.dnd.Source(_e,_d);},onMouseMove:function(e){if(this.isDragging&&this.targetState=="Disabled"){return;}dojo.dnd.Source.superclass.onMouseMove.call(this,e);var m=dojo.dnd.manager();if(this.isDragging){var _11=false;if(this.current){if(!this.targetBox||this.targetAnchor!=this.current){this.targetBox={xy:dojo.coords(this.current,true),w:this.current.offsetWidth,h:this.current.offsetHeight};}if(this.horizontal){_11=(e.pageX-this.targetBox.xy.x)<(this.targetBox.w/2);}else{_11=(e.pageY-this.targetBox.xy.y)<(this.targetBox.h/2);}}if(this.current!=this.targetAnchor||_11!=this.before){this._markTargetAnchor(_11);m.canDrop(!this.current||m.source!=this||!(this.current.id in this.selection));}}else{if(this.mouseDown&&this.isSource&&(Math.abs(e.pageX-this._lastX)>this.delay||Math.abs(e.pageY-this._lastY)>this.delay)){var _12=this.getSelectedNodes();if(_12.length){m.startDrag(this,_12,this.copyState(dojo.dnd.getCopyKeyState(e),true));}}}},onMouseDown:function(e){if(this._legalMouseDown(e)&&(!this.skipForm||!dojo.dnd.isFormElement(e))){this.mouseDown=true;this.mouseButton=e.button;this._lastX=e.pageX;this._lastY=e.pageY;dojo.dnd.Source.superclass.onMouseDown.call(this,e);}},onMouseUp:function(e){if(this.mouseDown){this.mouseDown=false;dojo.dnd.Source.superclass.onMouseUp.call(this,e);}},onDndSourceOver:function(_15){if(this!=_15){this.mouseDown=false;if(this.targetAnchor){this._unmarkTargetAnchor();}}else{if(this.isDragging){var m=dojo.dnd.manager();m.canDrop(this.targetState!="Disabled"&&(!this.current||m.source!=this||!(this.current.id in this.selection)));}}},onDndStart:function(_17,_18,_19){if(this.autoSync){this.sync();}if(this.isSource){this._changeState("Source",this==_17?(_19?"Copied":"Moved"):"");}var _1a=this.accept&&this.checkAcceptance(_17,_18);this._changeState("Target",_1a?"":"Disabled");if(this==_17){dojo.dnd.manager().overSource(this);}this.isDragging=true;},onDndDrop:function(_1b,_1c,_1d,_1e){if(this==_1e){this.onDrop(_1b,_1c,_1d);}this.onDndCancel();},onDndCancel:function(){if(this.targetAnchor){this._unmarkTargetAnchor();this.targetAnchor=null;}this.before=true;this.isDragging=false;this.mouseDown=false;delete this.mouseButton;this._changeState("Source","");this._changeState("Target","");},onDrop:function(_1f,_20,_21){if(this!=_1f){this.onDropExternal(_1f,_20,_21);}else{this.onDropInternal(_20,_21);}},onDropExternal:function(_22,_23,_24){var _25=this._normalizedCreator;if(this.creator){this._normalizedCreator=function(_26,_27){return _25.call(this,_22.getItem(_26.id).data,_27);};}else{if(_24){this._normalizedCreator=function(_28,_29){var t=_22.getItem(_28.id);var n=_28.cloneNode(true);n.id=dojo.dnd.getUniqueId();return {node:n,data:t.data,type:t.type};};}else{this._normalizedCreator=function(_2c,_2d){var t=_22.getItem(_2c.id);_22.delItem(_2c.id);return {node:_2c,data:t.data,type:t.type};};}}this.selectNone();if(!_24&&!this.creator){_22.selectNone();}this.insertNodes(true,_23,this.before,this.current);if(!_24&&this.creator){_22.deleteSelectedNodes();}this._normalizedCreator=_25;},onDropInternal:function(_2f,_30){var _31=this._normalizedCreator;if(this.current&&this.current.id in this.selection){return;}if(_30){if(this.creator){this._normalizedCreator=function(_32,_33){return _31.call(this,this.getItem(_32.id).data,_33);};}else{this._normalizedCreator=function(_34,_35){var t=this.getItem(_34.id);var n=_34.cloneNode(true);n.id=dojo.dnd.getUniqueId();return {node:n,data:t.data,type:t.type};};}}else{if(!this.current){return;}this._normalizedCreator=function(_38,_39){var t=this.getItem(_38.id);return {node:_38,data:t.data,type:t.type};};}this._removeSelection();this.insertNodes(true,_2f,this.before,this.current);this._normalizedCreator=_31;},onDraggingOver:function(){},onDraggingOut:function(){},onOverEvent:function(){dojo.dnd.Source.superclass.onOverEvent.call(this);dojo.dnd.manager().overSource(this);if(this.isDragging&&this.targetState!="Disabled"){this.onDraggingOver();}},onOutEvent:function(){dojo.dnd.Source.superclass.onOutEvent.call(this);dojo.dnd.manager().outSource(this);if(this.isDragging&&this.targetState!="Disabled"){this.onDraggingOut();}},_markTargetAnchor:function(_3b){if(this.current==this.targetAnchor&&this.before==_3b){return;}if(this.targetAnchor){this._removeItemClass(this.targetAnchor,this.before?"Before":"After");}this.targetAnchor=this.current;this.targetBox=null;this.before=_3b;if(this.targetAnchor){this._addItemClass(this.targetAnchor,this.before?"Before":"After");}},_unmarkTargetAnchor:function(){if(!this.targetAnchor){return;}this._removeItemClass(this.targetAnchor,this.before?"Before":"After");this.targetAnchor=null;this.targetBox=null;this.before=true;},_markDndStatus:function(_3c){this._changeState("Source",_3c?"Copied":"Moved");},_legalMouseDown:function(e){if(!this.withHandles){return true;}for(var _3e=e.target;_3e&&!dojo.hasClass(_3e,"dojoDndItem");_3e=_3e.parentNode){if(dojo.hasClass(_3e,"dojoDndHandle")){return true;}}return false;}});dojo.declare("dojo.dnd.Target",dojo.dnd.Source,{constructor:function(_3f,_40){this.isSource=false;dojo.removeClass(this.node,"dojoDndSource");},markupFactory:function(_41,_42){_41._skipStartup=true;return new dojo.dnd.Target(_42,_41);}});dojo.declare("dojo.dnd.AutoSource",dojo.dnd.Source,{constructor:function(_43,_44){this.autoSync=true;},markupFactory:function(_45,_46){_45._skipStartup=true;return new dojo.dnd.AutoSource(_46,_45);}});} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/TimedMoveable.js b/spring-js/src/main/resources/META-INF/dojo/dnd/TimedMoveable.js new file mode 100644 index 00000000..0dc751a4 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/TimedMoveable.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.TimedMoveable"]){dojo._hasResource["dojo.dnd.TimedMoveable"]=true;dojo.provide("dojo.dnd.TimedMoveable");dojo.require("dojo.dnd.Moveable");(function(){var _1=dojo.dnd.Moveable.prototype.onMove;dojo.declare("dojo.dnd.TimedMoveable",dojo.dnd.Moveable,{timeout:40,constructor:function(_2,_3){if(!_3){_3={};}if(_3.timeout&&typeof _3.timeout=="number"&&_3.timeout>=0){this.timeout=_3.timeout;}},markupFactory:function(_4,_5){return new dojo.dnd.TimedMoveable(_5,_4);},onMoveStop:function(_6){if(_6._timer){clearTimeout(_6._timer);_1.call(this,_6,_6._leftTop);}dojo.dnd.Moveable.prototype.onMoveStop.apply(this,arguments);},onMove:function(_7,_8){_7._leftTop=_8;if(!_7._timer){var _t=this;_7._timer=setTimeout(function(){_7._timer=null;_1.call(_t,_7,_7._leftTop);},this.timeout);}}});})();} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/autoscroll.js b/spring-js/src/main/resources/META-INF/dojo/dnd/autoscroll.js new file mode 100644 index 00000000..f537ecb4 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/autoscroll.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.autoscroll"]){dojo._hasResource["dojo.dnd.autoscroll"]=true;dojo.provide("dojo.dnd.autoscroll");dojo.dnd.getViewport=function(){var d=dojo.doc,dd=d.documentElement,w=window,b=dojo.body();if(dojo.isMozilla){return {w:dd.clientWidth,h:w.innerHeight};}else{if(!dojo.isOpera&&w.innerWidth){return {w:w.innerWidth,h:w.innerHeight};}else{if(!dojo.isOpera&&dd&&dd.clientWidth){return {w:dd.clientWidth,h:dd.clientHeight};}else{if(b.clientWidth){return {w:b.clientWidth,h:b.clientHeight};}}}}return null;};dojo.dnd.V_TRIGGER_AUTOSCROLL=32;dojo.dnd.H_TRIGGER_AUTOSCROLL=32;dojo.dnd.V_AUTOSCROLL_VALUE=16;dojo.dnd.H_AUTOSCROLL_VALUE=16;dojo.dnd.autoScroll=function(e){var v=dojo.dnd.getViewport(),dx=0,dy=0;if(e.clientXv.w-dojo.dnd.H_TRIGGER_AUTOSCROLL){dx=dojo.dnd.H_AUTOSCROLL_VALUE;}}if(e.clientYv.h-dojo.dnd.V_TRIGGER_AUTOSCROLL){dy=dojo.dnd.V_AUTOSCROLL_VALUE;}}window.scrollBy(dx,dy);};dojo.dnd._validNodes={"div":1,"p":1,"td":1};dojo.dnd._validOverflow={"auto":1,"scroll":1};dojo.dnd.autoScrollNodes=function(e){for(var n=e.target;n;){if(n.nodeType==1&&(n.tagName.toLowerCase() in dojo.dnd._validNodes)){var s=dojo.getComputedStyle(n);if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){var b=dojo._getContentBox(n,s),t=dojo._abs(n,true);var w=Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL,b.w/2),h=Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL,b.h/2),rx=e.pageX-t.x,ry=e.pageY-t.y,dx=0,dy=0;if(dojo.isSafari||dojo.isOpera){rx+=dojo.body().scrollLeft,ry+=dojo.body().scrollTop;}if(rx>0&&rxb.w-w){dx=w;}}}if(ry>0&&ryb.h-h){dy=h;}}}var _14=n.scrollLeft,_15=n.scrollTop;n.scrollLeft=n.scrollLeft+dx;n.scrollTop=n.scrollTop+dy;if(_14!=n.scrollLeft||_15!=n.scrollTop){return;}}}try{n=n.parentNode;}catch(x){n=null;}}dojo.dnd.autoScroll(e);};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/common.js b/spring-js/src/main/resources/META-INF/dojo/dnd/common.js new file mode 100644 index 00000000..d8d7a224 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/common.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.common"]){dojo._hasResource["dojo.dnd.common"]=true;dojo.provide("dojo.dnd.common");dojo.dnd._isMac=navigator.appVersion.indexOf("Macintosh")>=0;dojo.dnd._copyKey=dojo.dnd._isMac?"metaKey":"ctrlKey";dojo.dnd.getCopyKeyState=function(e){return e[dojo.dnd._copyKey];};dojo.dnd._uniqueId=0;dojo.dnd.getUniqueId=function(){var id;do{id=dojo._scopeName+"Unique"+(++dojo.dnd._uniqueId);}while(dojo.byId(id));return id;};dojo.dnd._empty={};dojo.dnd.isFormElement=function(e){var t=e.target;if(t.nodeType==3){t=t.parentNode;}return " button textarea input select option ".indexOf(" "+t.tagName.toLowerCase()+" ")>=0;};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/dnd/move.js b/spring-js/src/main/resources/META-INF/dojo/dnd/move.js new file mode 100644 index 00000000..ca37c1fa --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/dnd/move.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.dnd.move"]){dojo._hasResource["dojo.dnd.move"]=true;dojo.provide("dojo.dnd.move");dojo.require("dojo.dnd.Mover");dojo.require("dojo.dnd.Moveable");dojo.declare("dojo.dnd.move.constrainedMoveable",dojo.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(_1,_2){return new dojo.dnd.move.constrainedMoveable(_2,_1);},constructor:function(_3,_4){if(!_4){_4={};}this.constraints=_4.constraints;this.within=_4.within;},onFirstMove:function(_5){var c=this.constraintBox=this.constraints.call(this,_5);c.r=c.l+c.w;c.b=c.t+c.h;if(this.within){var mb=dojo.marginBox(_5.node);c.r-=mb.w;c.b-=mb.h;}},onMove:function(_8,_9){var c=this.constraintBox,s=_8.node.style;s.left=(_9.l= 2.1 OR the modified BSD license. + see: http://dojotoolkit.org/license for details +*/ + + +if(!dojo._hasResource["dojo.fx.easing"]){dojo._hasResource["dojo.fx.easing"]=true;dojo.provide("dojo.fx.easing");dojo.fx.easing={linear:function(n){return n;},quadIn:function(n){return Math.pow(n,2);},quadOut:function(n){return n*(n-2)*-1;},quadInOut:function(n){n=n*2;if(n<1){return Math.pow(n,2)/2;}return -1*((--n)*(n-2)-1)/2;},cubicIn:function(n){return Math.pow(n,3);},cubicOut:function(n){return Math.pow(n-1,3)+1;},cubicInOut:function(n){n=n*2;if(n<1){return Math.pow(n,3)/2;}n-=2;return (Math.pow(n,3)+2)/2;},quartIn:function(n){return Math.pow(n,4);},quartOut:function(n){return -1*(Math.pow(n-1,4)-1);},quartInOut:function(n){n=n*2;if(n<1){return Math.pow(n,4)/2;}n-=2;return -1/2*(Math.pow(n,4)-2);},quintIn:function(n){return Math.pow(n,5);},quintOut:function(n){return Math.pow(n-1,5)+1;},quintInOut:function(n){n=n*2;if(n<1){return Math.pow(n,5)/2;}n-=2;return (Math.pow(n,5)+2)/2;},sineIn:function(n){return -1*Math.cos(n*(Math.PI/2))+1;},sineOut:function(n){return Math.sin(n*(Math.PI/2));},sineInOut:function(n){return -1*(Math.cos(Math.PI*n)-1)/2;},expoIn:function(n){return (n==0)?0:Math.pow(2,10*(n-1));},expoOut:function(n){return (n==1)?1:(-1*Math.pow(2,-10*n)+1);},expoInOut:function(n){if(n==0){return 0;}if(n==1){return 1;}n=n*2;if(n<1){return Math.pow(2,10*(n-1))/2;}--n;return (-1*Math.pow(2,-10*n)+2)/2;},circIn:function(n){return -1*(Math.sqrt(1-Math.pow(n,2))-1);},circOut:function(n){n=n-1;return Math.sqrt(1-Math.pow(n,2));},circInOut:function(n){n=n*2;if(n<1){return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);}n-=2;return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);},backIn:function(n){var s=1.70158;return Math.pow(n,2)*((s+1)*n-s);},backOut:function(n){n=n-1;var s=1.70158;return Math.pow(n,2)*((s+1)*n+s)+1;},backInOut:function(n){var s=1.70158*1.525;n=n*2;if(n<1){return (Math.pow(n,2)*((s+1)*n-s))/2;}n-=2;return (Math.pow(n,2)*((s+1)*n+s)+2)/2;},elasticIn:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;n=n-1;return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);},elasticOut:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;},elasticInOut:function(n){if(n==0){return 0;}n=n*2;if(n==2){return 1;}var p=0.3*1.5;var s=p/4;if(n<1){n-=1;return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));}n-=1;return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;},bounceIn:function(n){return (1-dojo.fx.easing.bounceOut(1-n));},bounceOut:function(n){var s=7.5625;var p=2.75;var l;if(n<(1/p)){l=s*Math.pow(n,2);}else{if(n<(2/p)){n-=(1.5/p);l=s*Math.pow(n,2)+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*Math.pow(n,2)+0.9375;}else{n-=(2.625/p);l=s*Math.pow(n,2)+0.984375;}}}return l;},bounceInOut:function(n){if(n<0.5){return dojo.fx.easing.bounceIn(n*2)/2;}return (dojo.fx.easing.bounceOut(n*2-1)/2)+0.5;}};} \ No newline at end of file diff --git a/spring-js/src/main/resources/META-INF/dojo/io/iframe.js b/spring-js/src/main/resources/META-INF/dojo/io/iframe.js new file mode 100644 index 00000000..02d25884 --- /dev/null +++ b/spring-js/src/main/resources/META-INF/dojo/io/iframe.js @@ -0,0 +1,8 @@ +/* + Copyright (c) 2004-2008, 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 +*/ + + +if(!dojo._hasResource["dojo.io.iframe"]){dojo._hasResource["dojo.io.iframe"]=true;dojo.provide("dojo.io.iframe");dojo.io.iframe={create:function(_1,_2,_3){if(window[_1]){return window[_1];}if(window.frames[_1]){return window.frames[_1];}var _4=null;var _5=_3;if(!_5){if(dojo.config["useXDomain"]&&!dojo.config["dojoBlankHtmlUrl"]){console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds,"+" please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl"+" to the path on your domain to blank.html");}_5=(dojo.config["dojoBlankHtmlUrl"]||dojo.moduleUrl("dojo","resources/blank.html"));}var _6=dojo.isIE?"