summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojo/gears.xd.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/dojo-1.6/dojo/gears.xd.js')
-rw-r--r--js/dojo-1.6/dojo/gears.xd.js70
1 files changed, 70 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojo/gears.xd.js b/js/dojo-1.6/dojo/gears.xd.js
new file mode 100644
index 0000000..f3eca49
--- /dev/null
+++ b/js/dojo-1.6/dojo/gears.xd.js
@@ -0,0 +1,70 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojo.gears"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojo.gears"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.gears"] = true;
+dojo.provide("dojo.gears");
+
+
+dojo.getObject("gears", true, dojo);
+
+dojo.gears._gearsObject = function(){
+ // summary:
+ // factory method to get a Google Gears plugin instance to
+ // expose in the browser runtime environment, if present
+ var factory;
+ var results;
+
+ var gearsObj = dojo.getObject("google.gears");
+ if(gearsObj){ return gearsObj; } // already defined elsewhere
+
+ if(typeof GearsFactory != "undefined"){ // Firefox
+ factory = new GearsFactory();
+ }else{
+ if(dojo.isIE){
+ // IE
+ try{
+ factory = new ActiveXObject("Gears.Factory");
+ }catch(e){
+ // ok to squelch; there's no gears factory. move on.
+ }
+ }else if(navigator.mimeTypes["application/x-googlegears"]){
+ // Safari?
+ factory = document.createElement("object");
+ factory.setAttribute("type", "application/x-googlegears");
+ factory.setAttribute("width", 0);
+ factory.setAttribute("height", 0);
+ factory.style.display = "none";
+ document.documentElement.appendChild(factory);
+ }
+ }
+
+ // still nothing?
+ if(!factory){ return null; }
+
+ // define the global objects now; don't overwrite them though if they
+ // were somehow set internally by the Gears plugin, which is on their
+ // dev roadmap for the future
+ dojo.setObject("google.gears.factory", factory);
+ return dojo.getObject("google.gears");
+};
+
+/*=====
+dojo.gears.available = {
+ // summary: True if client is using Google Gears
+};
+=====*/
+// see if we have Google Gears installed, and if
+// so, make it available in the runtime environment
+// and in the Google standard 'google.gears' global object
+dojo.gears.available = (!!dojo.gears._gearsObject())||0;
+
+}
+
+}};});