99,8 → 99,8 |
//TODOC: HOW TO DOC THIS? |
dojo.version = { |
// summary: version number of this instance of dojo. |
major: 0, minor: 4, patch: 2, flag: "", |
revision: Number("$Rev: 7616 $".match(/[0-9]+/)[0]), |
major: 0, minor: 4, patch: 3, flag: "", |
revision: Number("$Rev: 8617 $".match(/[0-9]+/)[0]), |
toString: function(){ |
with(dojo.version){ |
return major + "." + minor + "." + patch + flag + " (" + revision + ")"; // String |
1390,8 → 1390,10 |
return true; |
} |
|
dojo.hostenv._djInitFired = false; |
// BEGIN DOMContentLoaded, from Dean Edwards (http://dean.edwards.name/weblog/2006/06/again/) |
function dj_load_init(e){ |
dojo.hostenv._djInitFired = true; |
// allow multiple calls, only first one will take effect |
// A bug in khtml calls events callbacks for document for event which isnt supported |
// for example a created contextmenu event calls DOMContentLoaded, workaround |
2222,6 → 2224,22 |
|
/** Prevent the browser from caching this by adding a query string argument to the URL */ |
preventCache: false, |
|
jsonFilter: function(value){ |
if( (this.mimetype == "text/json-comment-filtered")|| |
(this.mimetype == "application/json-comment-filtered") |
){ |
var cStartIdx = value.indexOf("\/*"); |
var cEndIdx = value.lastIndexOf("*\/"); |
if((cStartIdx == -1)||(cEndIdx == -1)){ |
dojo.debug("your JSON wasn't comment filtered!"); // FIXME: throw exception instead? |
return ""; |
} |
return value.substring(cStartIdx+2, cEndIdx); |
} |
dojo.debug("please consider using a mimetype of text/json-comment-filtered to avoid potential security issues with JSON endpoints"); |
return value; |
}, |
|
// events stuff |
load: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){ |
2892,13 → 2910,16 |
dojo.provide("dojo.lang.func"); |
|
|
dojo.lang.hitch = function(/*Object*/thisObject, /*Function|String*/method){ |
dojo.lang.hitch = function(/*Object*/thisObject, /*Function|String*/method /*, ...*/){ |
// summary: |
// Returns a function that will only ever execute in the a given scope |
// (thisObject). This allows for easy use of object member functions |
// in callbacks and other places in which the "this" keyword may |
// otherwise not reference the expected scope. Note that the order of |
// arguments may be reversed in a future version. |
// otherwise not reference the expected scope. Any number of default |
// positional arguments may be passed as parameters beyond "method". |
// Each of these values will be used to "placehold" (similar to curry) |
// for the hitched function. Note that the order of arguments may be |
// reversed in a future version. |
// thisObject: the scope to run the method in |
// method: |
// a function to be "bound" to thisObject or the name of the method in |
2907,12 → 2928,18 |
// dojo.lang.hitch(foo, "bar")(); // runs foo.bar() in the scope of foo |
// dojo.lang.hitch(foo, myFunction); // returns a function that runs myFunction in the scope of foo |
|
// FIXME: |
// should this be extended to "fixate" arguments in a manner similar |
// to dojo.lang.curry, but without the default execution of curry()? |
var args = []; |
for(var x=2; x<arguments.length; x++){ |
args.push(arguments[x]); |
} |
var fcn = (dojo.lang.isString(method) ? thisObject[method] : method) || function(){}; |
return function(){ |
return fcn.apply(thisObject, arguments); // Function |
var ta = args.concat([]); // make a copy |
for(var x=0; x<arguments.length; x++){ |
ta.push(arguments[x]); |
} |
return fcn.apply(thisObject, ta); // Function |
// return fcn.apply(thisObject, arguments); // Function |
}; |
} |
|
4492,6 → 4519,7 |
function doLoad(kwArgs, http, url, query, useCache) { |
if( ((http.status>=200)&&(http.status<300))|| // allow any 2XX response code |
(http.status==304)|| // get it out of the cache |
(http.status==1223)|| // Internet Explorer mangled the status code |
(location.protocol=="file:" && (http.status==0 || http.status==undefined))|| |
(location.protocol=="chrome:" && (http.status==0 || http.status==undefined)) |
){ |
4515,9 → 4543,9 |
dojo.debug(http.responseText); |
ret = null; |
} |
}else if(kwArgs.mimetype == "text/json" || kwArgs.mimetype == "application/json"){ |
}else if(kwArgs.mimetype.substr(0, 9) == "text/json" || kwArgs.mimetype.substr(0, 16) == "application/json"){ |
try{ |
ret = dj_eval("("+http.responseText+")"); |
ret = dj_eval("("+kwArgs.jsonFilter(http.responseText)+")"); |
}catch(e){ |
dojo.debug(e); |
dojo.debug(http.responseText); |
4631,8 → 4659,19 |
// FIXME: we need to determine when form values need to be |
// multi-part mime encoded and avoid using this transport for those |
// requests. |
var mlc = kwArgs["mimetype"].toLowerCase()||""; |
return hasXmlHttp |
&& dojo.lang.inArray(["text/plain", "text/html", "application/xml", "text/xml", "text/javascript", "text/json", "application/json"], (kwArgs["mimetype"].toLowerCase()||"")) |
&& ( |
( |
dojo.lang.inArray([ |
"text/plain", "text/html", "application/xml", |
"text/xml", "text/javascript" |
], mlc |
) |
) || ( |
mlc.substr(0, 9) == "text/json" || mlc.substr(0, 16) == "application/json" |
) |
) |
&& !( kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]) ); //boolean |
} |
|
5312,7 → 5351,6 |
}else{ |
var ao = interpolateArgs(arguments, true); |
} |
/* |
if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){ |
if(dojo.render.html.ie){ |
ao.srcFunc = "onkeydown"; |
5320,7 → 5358,6 |
} |
ao.srcFunc = "onkeypress"; |
} |
*/ |
|
if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){ |
var tmpAO = {}; |
7986,8 → 8023,8 |
dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*String*/value) { |
// summary |
// Get the computed style value for style "property" on "node" (IE). |
node = dojo.byId(node); // FIXME: remove ability to access nodes by id for this time-critical function |
if(!node || !node.style){return value;} |
node = dojo.byId(node); // FIXME: remove ability to access nodes by id for this time-critical function |
if(!node || !node.currentStyle){return value;} |
// FIXME: standardize on camel-case input to improve speed |
return node.currentStyle[dojo.html.toCamelCase(property)]; // String |
} |