source: trunk/web/addons/job_monarch/lib/extjs-30/examples/tasks/gears.js @ 647

Last change on this file since 647 was 625, checked in by ramonb, 15 years ago

lib/extjs-30:

  • new ExtJS 3.0
File size: 1.8 KB
Line 
1/*!
2 * Ext JS Library 3.0.0
3 * Copyright(c) 2006-2009 Ext JS, LLC
4 * licensing@extjs.com
5 * http://www.extjs.com/license
6 */
7// Copyright 2007 Google Inc. All Rights Reserved.
8//
9// Sets up google.gears.*, which is *the only* supported way to access Gears.
10//
11// Circumvent this file at your own risk!
12//
13// In the future, Gears may automatically define google.gears.* without this
14// file. Gears may use these objects to transparently fix bugs and compatibility
15// issues. Applications that use the code below will continue to work seamlessly
16// when that happens.
17
18(function() {
19  // We are already defined. Hooray!
20  if (window.google && google.gears) {
21    return;
22  }
23
24  var factory = null;
25
26  // Firefox
27  if (typeof GearsFactory != 'undefined') {
28    factory = new GearsFactory();
29  } else {
30    // IE
31    try {
32      factory = new ActiveXObject('Gears.Factory');
33    } catch (e) {
34      // Safari
35      if (navigator.mimeTypes["application/x-googlegears"]) {
36        factory = document.createElement("object");
37        factory.style.display = "none";
38        factory.width = 0;
39        factory.height = 0;
40        factory.type = "application/x-googlegears";
41        document.documentElement.appendChild(factory);
42      }
43    }
44  }
45
46  // *Do not* define any objects if Gears is not installed. This mimics the
47  // behavior of Gears defining the objects in the future.
48  if (!factory) {
49    return;
50  }
51
52  // Now set up the objects, being careful not to overwrite anything.
53  if (!window.google) {
54    window.google = {};
55  }
56
57  if (!google.gears) {
58    google.gears = {factory: factory};
59  }
60})();
61
62if (!window.google || !google.gears) {
63    location.href = "http://gears.google.com/?action=install&message=Google%20Gears%20is%20required%20for%20this%20application" +
64                "&return="+window.location.href;
65}
Note: See TracBrowser for help on using the repository browser.