From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- lib/dojo/_base/window.js | 104 +---------------------------------------------- 1 file changed, 2 insertions(+), 102 deletions(-) (limited to 'lib/dojo/_base/window.js') diff --git a/lib/dojo/_base/window.js b/lib/dojo/_base/window.js index 143bad610..7082cb077 100644 --- a/lib/dojo/_base/window.js +++ b/lib/dojo/_base/window.js @@ -4,105 +4,5 @@ see: http://dojotoolkit.org/license for details */ - -if(!dojo._hasResource["dojo._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojo._base.window"] = true; -dojo.provide("dojo._base.window"); - - -/*===== -dojo.doc = { - // summary: - // Alias for the current document. 'dojo.doc' can be modified - // for temporary context shifting. Also see dojo.withDoc(). - // description: - // Refer to dojo.doc rather - // than referring to 'window.document' to ensure your code runs - // correctly in managed contexts. - // example: - // | n.appendChild(dojo.doc.createElement('div')); -} -=====*/ -dojo.doc = window["document"] || null; - -dojo.body = function(){ - // summary: - // Return the body element of the document - // return the body object associated with dojo.doc - // example: - // | dojo.body().appendChild(dojo.doc.createElement('div')); - - // Note: document.body is not defined for a strict xhtml document - // Would like to memoize this, but dojo.doc can change vi dojo.withDoc(). - return dojo.doc.body || dojo.doc.getElementsByTagName("body")[0]; // Node -}; - -dojo.setContext = function(/*Object*/globalObject, /*DocumentElement*/globalDocument){ - // summary: - // changes the behavior of many core Dojo functions that deal with - // namespace and DOM lookup, changing them to work in a new global - // context (e.g., an iframe). The varibles dojo.global and dojo.doc - // are modified as a result of calling this function and the result of - // `dojo.body()` likewise differs. - dojo.global = globalObject; - dojo.doc = globalDocument; -}; - -dojo.withGlobal = function( /*Object*/globalObject, - /*Function*/callback, - /*Object?*/thisObject, - /*Array?*/cbArguments){ - // summary: - // Invoke callback with globalObject as dojo.global and - // globalObject.document as dojo.doc. - // description: - // Invoke callback with globalObject as dojo.global and - // globalObject.document as dojo.doc. If provided, globalObject - // will be executed in the context of object thisObject - // When callback() returns or throws an error, the dojo.global - // and dojo.doc will be restored to its previous state. - - var oldGlob = dojo.global; - try{ - dojo.global = globalObject; - return dojo.withDoc.call(null, globalObject.document, callback, thisObject, cbArguments); - }finally{ - dojo.global = oldGlob; - } -}; - -dojo.withDoc = function( /*DocumentElement*/documentObject, - /*Function*/callback, - /*Object?*/thisObject, - /*Array?*/cbArguments){ - // summary: - // Invoke callback with documentObject as dojo.doc. - // description: - // Invoke callback with documentObject as dojo.doc. If provided, - // callback will be executed in the context of object thisObject - // When callback() returns or throws an error, the dojo.doc will - // be restored to its previous state. - - var oldDoc = dojo.doc, - oldLtr = dojo._bodyLtr, - oldQ = dojo.isQuirks; - - try{ - dojo.doc = documentObject; - delete dojo._bodyLtr; // uncache - dojo.isQuirks = dojo.doc.compatMode == "BackCompat"; // no need to check for QuirksMode which was Opera 7 only - - if(thisObject && typeof callback == "string"){ - callback = thisObject[callback]; - } - - return callback.apply(thisObject, cbArguments || []); - }finally{ - dojo.doc = oldDoc; - delete dojo._bodyLtr; // in case it was undefined originally, and set to true/false by the alternate document - if(oldLtr !== undefined){ dojo._bodyLtr = oldLtr; } - dojo.isQuirks = oldQ; - } -}; - -} +//>>built +define("dojo/_base/window",["./kernel","../has","./sniff"],function(_1,_2){_1.doc=this["document"]||null;_1.body=function(){return _1.doc.body||_1.doc.getElementsByTagName("body")[0];};_1.setContext=function(_3,_4){_1.global=_5.global=_3;_1.doc=_5.doc=_4;};_1.withGlobal=function(_6,_7,_8,_9){var _a=_1.global;try{_1.global=_5.global=_6;return _1.withDoc.call(null,_6.document,_7,_8,_9);}finally{_1.global=_5.global=_a;}};_1.withDoc=function(_b,_c,_d,_e){var _f=_1.doc,_10=_1.isQuirks,_11=_1.isIE,_12,_13,_14;try{_1.doc=_5.doc=_b;_1.isQuirks=_2.add("quirks",_1.doc.compatMode=="BackCompat",true,true);if(_2("ie")){if((_14=_b.parentWindow)&&_14.navigator){_12=parseFloat(_14.navigator.appVersion.split("MSIE ")[1])||undefined;_13=_b.documentMode;if(_13&&_13!=5&&Math.floor(_12)!=_13){_12=_13;}_1.isIE=_2.add("ie",_12,true,true);}}if(_d&&typeof _c=="string"){_c=_d[_c];}return _c.apply(_d,_e||[]);}finally{_1.doc=_5.doc=_f;_1.isQuirks=_2.add("quirks",_10,true,true);_1.isIE=_2.add("ie",_11,true,true);}};var _5={global:_1.global,doc:_1.doc,body:_1.body,setContext:_1.setContext,withGlobal:_1.withGlobal,withDoc:_1.withDoc};return _5;}); \ No newline at end of file -- cgit v1.2.3