]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/gears.js.uncompressed.js
1 define("dojo/gears", ["./_base/kernel", "./_base/lang", "./_base/sniff"],
2 function(dojo
, lang
, has
) {
8 lang
.getObject("gears", true, dojo
);
10 dojo
.gears
._gearsObject = function(){
12 // factory method to get a Google Gears plugin instance to
13 // expose in the browser runtime environment, if present
16 var gearsObj
= lang
.getObject("google.gears");
17 if(gearsObj
){ return gearsObj
; } // already defined elsewhere
19 if(typeof GearsFactory
!= "undefined"){ // Firefox
20 factory
= new GearsFactory();
25 factory
= new ActiveXObject("Gears.Factory");
27 // ok to squelch; there's no gears factory. move on.
29 }else if(navigator
.mimeTypes
["application/x-googlegears"]){
31 factory
= document
.createElement("object");
32 factory
.setAttribute("type", "application/x-googlegears");
33 factory
.setAttribute("width", 0);
34 factory
.setAttribute("height", 0);
35 factory
.style
.display
= "none";
36 document
.documentElement
.appendChild(factory
);
41 if(!factory
){ return null; }
43 // define the global objects now; don't overwrite them though if they
44 // were somehow set internally by the Gears plugin, which is on their
45 // dev roadmap for the future
46 lang
.setObject("google.gears.factory", factory
);
47 return lang
.getObject("google.gears");
51 dojo.gears.available = {
52 // summary: True if client is using Google Gears
55 // see if we have Google Gears installed, and if
56 // so, make it available in the runtime environment
57 // and in the Google standard 'google.gears' global object
58 dojo
.gears
.available
= (!!dojo
.gears
._gearsObject())||0;