3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
7 // Copyright 2007 Google Inc. All Rights Reserved.
\r
9 // Sets up google.gears.*, which is *the only* supported way to access Gears.
\r
11 // Circumvent this file at your own risk!
\r
13 // In the future, Gears may automatically define google.gears.* without this
\r
14 // file. Gears may use these objects to transparently fix bugs and compatibility
\r
15 // issues. Applications that use the code below will continue to work seamlessly
\r
16 // when that happens.
\r
19 // We are already defined. Hooray!
\r
20 if (window.google && google.gears) {
\r
27 if (typeof GearsFactory != 'undefined') {
\r
28 factory = new GearsFactory();
\r
32 factory = new ActiveXObject('Gears.Factory');
\r
35 if (navigator.mimeTypes["application/x-googlegears"]) {
\r
36 factory = document.createElement("object");
\r
37 factory.style.display = "none";
\r
40 factory.type = "application/x-googlegears";
\r
41 document.documentElement.appendChild(factory);
\r
46 // *Do not* define any objects if Gears is not installed. This mimics the
\r
47 // behavior of Gears defining the objects in the future.
\r
52 // Now set up the objects, being careful not to overwrite anything.
\r
53 if (!window.google) {
\r
57 if (!google.gears) {
\r
58 google.gears = {factory: factory};
\r
62 if (!window.google || !google.gears) {
\r
63 location.href = "http://gears.google.com/?action=install&message=Google%20Gears%20is%20required%20for%20this%20application" +
\r
64 "&return="+window.location.href;
\r