mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
reverting back to dojo 0.3.1 from the nightly - still requires more testing to make sure i haven't broken anything but the nightly was unstable and i feel more comfortable on the released version.
extracting dojo from 3rd-party so it's no longer cluttering up the source tree and putting it in source/web/scripts/ajax/dojo instead of source/web/scripts/ajax playing around with some dojo effects for delete - fixed a bug when deleting the last repeat instance removing some no longer used files (dojogenerator and dwr.jar) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3834 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
97
source/web/scripts/ajax/dojo.js
vendored
97
source/web/scripts/ajax/dojo.js
vendored
@@ -1,97 +0,0 @@
|
||||
if(typeof dojo == "undefined"){
|
||||
dj_usingBootstrap = true; //Needed for bootstrap2.js to work properly.
|
||||
(function(){
|
||||
var hostEnv = "browser";
|
||||
var isRhino = false;
|
||||
var isSpidermonkey = false;
|
||||
var isDashboard = false;
|
||||
if((typeof this["load"] == "function")&&((typeof this["Packages"] == "function")||(typeof this["Packages"] == "object"))){
|
||||
var isRhino = true;
|
||||
hostEnv = "rhino";
|
||||
}else if(typeof this["load"] == "function"){
|
||||
isSpidermonkey = true;
|
||||
hostEnv = "spidermonkey";
|
||||
}else if(window.widget){
|
||||
isDashboard = true;
|
||||
hostEnv = "dashboard";
|
||||
}
|
||||
var tmps = ["bootstrap1.js", "loader.js", "hostenv_"+hostEnv+".js"];
|
||||
|
||||
if((this["djConfig"])&&((djConfig["forceXDomain"])||(djConfig["useXDomain"]))){
|
||||
tmps.push("loader_xd.js");
|
||||
}
|
||||
|
||||
if(hostEnv == "dashboard"){
|
||||
tmps.splice(1, 0, "hostenv_browser.js");
|
||||
}
|
||||
|
||||
tmps.push("bootstrap2.js");
|
||||
|
||||
if((this["djConfig"])&&(djConfig["baseScriptUri"])){
|
||||
var root = djConfig["baseScriptUri"];
|
||||
}else if((this["djConfig"])&&(djConfig["baseRelativePath"])){
|
||||
var root = djConfig["baseRelativePath"];
|
||||
}else{
|
||||
var root = "./";
|
||||
if(isSpidermonkey){
|
||||
// auto-detect the base path via an exception. Hack!
|
||||
try{ throw new Error(""); }catch(e){ root = e.fileName.split("dojo.js")[0]; };
|
||||
}
|
||||
if(!this["djConfig"]){
|
||||
djConfig = { baseRelativePath: root };
|
||||
}
|
||||
|
||||
// attempt to figure out the path to dojo if it isn't set in the config
|
||||
if((this["document"])&&(this["document"]["getElementsByTagName"])){
|
||||
var scripts = document.getElementsByTagName("script");
|
||||
var rePkg = /(__package__|dojo)\.js([\?\.]|$)/i;
|
||||
for(var i = 0; i < scripts.length; i++) {
|
||||
var src = scripts[i].getAttribute("src");
|
||||
if(!src) { continue; }
|
||||
var m = src.match(rePkg);
|
||||
if(m) {
|
||||
root = src.substring(0, m.index);
|
||||
if(!this["djConfig"]) { djConfig = {}; }
|
||||
djConfig["baseScriptUri"] = djConfig["baseRelativePath"] = root;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((this["djConfig"])&&((djConfig["isDebug"])||(djConfig["debugAtAllCosts"]))){
|
||||
tmps.push("debug.js");
|
||||
}
|
||||
|
||||
if((this["djConfig"])&&(djConfig["debugAtAllCosts"])&&(!isRhino)&&(!isDashboard)){
|
||||
tmps.push("browser_debug.js");
|
||||
}
|
||||
|
||||
//Support compatibility packages. Right now this only allows setting one
|
||||
//compatibility package. Might need to revisit later down the line to support
|
||||
//more than one.
|
||||
if((this["djConfig"])&&(djConfig["compat"])){
|
||||
tmps.push("compat/" + djConfig["compat"] + ".js");
|
||||
}
|
||||
|
||||
var loaderRoot = root;
|
||||
if((this["djConfig"])&&(djConfig["baseLoaderUri"])){
|
||||
loaderRoot = djConfig["baseLoaderUri"];
|
||||
}
|
||||
|
||||
for(var x=0; x < tmps.length; x++){
|
||||
var spath = loaderRoot+"src/"+tmps[x];
|
||||
if(isRhino||isSpidermonkey){
|
||||
load(spath);
|
||||
} else {
|
||||
try {
|
||||
document.write("<scr"+"ipt type='text/javascript' src='"+spath+"'></scr"+"ipt>");
|
||||
} catch (e) {
|
||||
var script = document.createElement("script");
|
||||
script.src = spath;
|
||||
document.getElementsByTagName("head")[0].appendChild(script);
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
};
|
Reference in New Issue
Block a user