3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">// Copyright 2007 Google Inc. All Rights Reserved.
\r
10 // Sets up google.gears.*, which is *the only* supported way to access Gears.
\r
12 // Circumvent this file at your own risk!
\r
14 // In the future, Gears may automatically define google.gears.* without this
\r
15 // file. Gears may use these objects to transparently fix bugs and compatibility
\r
16 // issues. Applications that use the code below will continue to work seamlessly
\r
17 // when that happens.
\r
20 // We are already defined. Hooray!
\r
21 if (window.google && google.gears) {
\r
28 if (typeof GearsFactory != 'undefined') {
\r
29 factory = new GearsFactory();
\r
33 factory = new ActiveXObject('Gears.Factory');
\r
36 if (navigator.mimeTypes["application/x-googlegears"]) {
\r
37 factory = document.createElement("object");
\r
38 factory.style.display = "none";
\r
41 factory.type = "application/x-googlegears";
\r
42 document.documentElement.appendChild(factory);
\r
47 // *Do not* define any objects if Gears is not installed. This mimics the
\r
48 // behavior of Gears defining the objects in the future.
\r
53 // Now set up the objects, being careful not to overwrite anything.
\r
54 if (!window.google) {
\r
58 if (!google.gears) {
\r
59 google.gears = {factory: factory};
\r
63 if (!window.google || !google.gears) {
\r
64 location.href = "http://gears.google.com/?action=install&message=Google%20Gears%20is%20required%20for%20this%20application" +
\r
65 "&return="+window.location.href;
\r