]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/_base/_loader/hostenv_ff_ext.js
2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(typeof window
!="undefined"){
13 d
.baseUrl
=d
.config
.baseUrl
;
17 var tv
=parseFloat(_2
);
18 d
.isMozilla
=d
.isMoz
=tv
;
20 d
.isFF
=parseFloat(_1
.split("Firefox/")[1])||undefined;
22 d
.isQuirks
=document
.compatMode
=="BackCompat";
23 d
.locale
=dojo
.config
.locale
||n
.language
.toLowerCase();
25 return new XMLHttpRequest();
28 d
._loadUri=function(_4
,cb
){
29 var _5
=["file:","chrome:","resource:"].some(function(_6
){
30 return String(_4
).indexOf(_6
)==0;
33 var l
=Components
.classes
["@mozilla.org/moz/jssubscript-loader;1"].getService(Components
.interfaces
.mozIJSSubScriptLoader
);
34 var _7
=l
.loadSubScript(_4
,d
.global
);
40 return _3
.apply(d
,arguments
);
43 d
._isDocumentOk=function(_8
){
45 return (_9
>=200&&_9
<300)||_9
==304||_9
==1223||(!_9
&&(location
.protocol
=="file:"||location
.protocol
=="chrome:"));
48 d
._getText=function(_b
,_c
){
51 _b
=(new dojo
._Url(_b
)).toString();
53 if(d
.config
.cacheBust
){
55 _b
+=(_b
.indexOf("?")==-1?"?":"&")+String(d
.config
.cacheBust
).replace(/\W+/g,"");
57 var _e
=["file:","chrome:","resource:"].some(function(_f
){
58 return String(_b
).indexOf(_f
)==0;
61 var _10
=Components
.classes
["@mozilla.org/network/io-service;1"].getService(Components
.interfaces
.nsIIOService
);
62 var _11
=Components
.classes
["@mozilla.org/scriptableinputstream;1"].getService(Components
.interfaces
.nsIScriptableInputStream
);
63 var _12
=_10
.newChannel(_b
,null,null);
66 var str
=_11
.read(_13
.available());
71 _d
.open("GET",_b
,false);
74 if(!d
._isDocumentOk(_d
)){
75 var err
=Error("Unable to load "+_b
+" status:"+_d
.status
);
77 err
.responseText
=_d
.responseText
;
87 return _d
.responseText
;
90 d
._windowUnloaders
=[];
91 d
.windowUnloaded=function(){
92 var mll
=d
._windowUnloaders
;
97 d
.addOnWindowUnload=function(obj
,_14
){
98 d
._onto(d
._windowUnloaders
,obj
,_14
);
102 dojo
._defaultContext
=[window
,document
];
103 dojo
.pushContext=function(g
,d
){
104 var old
=[dojo
.global
,dojo
.doc
];
108 n
=dojo
._defaultContext
;
111 if(!d
&&dojo
.isString(g
)){
112 var t
=document
.getElementById(g
);
113 if(t
.contentDocument
){
114 n
=[t
.contentWindow
,t
.contentDocument
];
119 dojo
.setContext
.apply(dojo
,n
);
122 dojo
.popContext=function(){
127 dojo
.setContext
.apply(dojo
,_15
.pop());
130 dojo
._inContext=function(g
,d
,f
){
131 var a
=dojo
._toArray(arguments
);
136 dojo
.pushContext(g
,d
);
142 dojo
._initFired
=false;
143 dojo
._loadInit=function(e
){
144 dojo
._initFired
=true;
145 var _17
=(e
&&e
.type
)?e
.type
.toLowerCase():"load";
146 if(arguments
.callee
.initialized
||(_17
!="domcontentloaded"&&_17
!="load")){
149 arguments
.callee
.initialized
=true;
150 if(dojo
._inFlightCount
==0){
151 dojo
._modulesLoaded();
154 if(!dojo
.config
.afterOnLoad
){
155 window
.addEventListener("DOMContentLoaded",function(e
){
161 var mp
=dojo
.config
["modulePaths"];
164 dojo
.registerModulePath(_18
,mp
[_18
]);
168 if(dojo
.config
.isDebug
){
169 console
.log=function(m
){
170 var s
=Components
.classes
["@mozilla.org/consoleservice;1"].getService(Components
.interfaces
.nsIConsoleService
);
171 s
.logStringMessage(m
);
173 console
.debug=function(){