Bugs fixed; version up
[sdk/tools/web-simulator.git] / web / index.html
1 <!--
2  *  Copyright 2011 Research In Motion Limited.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15 -->
16 <!DOCTYPE html>
17 <html manifest="cache.manifest">
18     <head>
19         <link href="ripple.css" type="text/css" rel="stylesheet" />
20         <script>
21             window.onload = function () {
22                 var supportedBrowser, resultWindow, params = {}, url;
23                 supportedBrowser = /(Chrome|Chromium)\/(\S+)/;
24                 window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(string, key, value) {
25                     params[key] = value;
26                 });
27
28                 url = "ripple.html";
29
30                 if (params['platform'] !== undefined) {
31                     if (params['url'] !== undefined) {
32                         url += "?url=" + params['url'] + "&platform=" + params['platform'];
33                     }
34                     else {
35                         url += "?platform=" + params['platform'];
36                     }
37                 }
38                 else {
39                     if (params['url'] !== undefined) {
40                         url += "?url=" + params['url'];
41                     }
42                 }
43
44                 if (!supportedBrowser.test(navigator.userAgent)) {
45                     resultWindow = document.getElementById("browser-check-result-window");
46                     resultWindow.style.display = "block";
47                     document.getElementById("browserInfo").innerHTML = navigator.userAgent;
48                 }
49                 else {
50                     document.location.assign(url);
51                 }
52             }
53         </script>
54     </head>
55     <body style="background-color: #EFEFEF">
56       <center>
57         <div class="wrong-browser" id="browser-check-result-window"  >
58           <br/><br/>
59           <h2 style="text-align:center">Unsupported Browser</h2>
60           <p><img style="float:left; padding:0px 10px 175px" src="images/dontPanic.png" />Currently only Chrome and Chromium based browsers are 
61             supported by the Web Simulator. </p>
62           <p>You can download Chrome from 
63             <a href="https://www.google.com/chrome">https://www.google.com/chrome</a></p>
64           <p>This browser reported: <span style="color: blue;" id="browserInfo"></span></p>
65
66         </div>
67       </center>
68     </body>
69 </html>