source: trunk/web/addons/job_monarch/lib/extjs/examples/tasks/gears.js @ 619

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

lib/:

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