diff options
author | Armen Kesablyan | 2012-05-17 14:01:38 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-05-17 14:01:38 -0700 |
commit | 6c8f3525b839e82cf43df43700a0160ee2c5458f (patch) | |
tree | 3fb801fa54b759c5568d75bb467e02652ce77c3e /js/document/templates/preview/banner.html | |
parent | e8ae5db7ce7023b638375cbc27a3f7b7a2f77b23 (diff) | |
parent | 342c97ac9b727b22a7b0bfefca4d2a168bc3055b (diff) | |
download | ninja-6c8f3525b839e82cf43df43700a0160ee2c5458f.tar.gz |
Merge branch 'refs/heads/dom-architecture' into binding
Conflicts:
css/ninja.css
scss/imports/scss/_toolbar.scss
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'js/document/templates/preview/banner.html')
-rwxr-xr-x | js/document/templates/preview/banner.html | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/js/document/templates/preview/banner.html b/js/document/templates/preview/banner.html new file mode 100755 index 00000000..5838ec91 --- /dev/null +++ b/js/document/templates/preview/banner.html | |||
@@ -0,0 +1,64 @@ | |||
1 | <!DOCTYPE html> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | |||
8 | <html> | ||
9 | |||
10 | <head> | ||
11 | |||
12 | <style type="text/css"> | ||
13 | |||
14 | html, body { | ||
15 | width: 100%; | ||
16 | height: 100%; | ||
17 | margin: 0; | ||
18 | padding: 0; | ||
19 | background: #333; | ||
20 | } | ||
21 | |||
22 | .preview { | ||
23 | position: absolute; | ||
24 | top: 50%; | ||
25 | left: 50%; | ||
26 | margin: 0; | ||
27 | padding: 0; | ||
28 | border: 1px solid #000; | ||
29 | background: #FFF; | ||
30 | -webkit-box-shadow: 0 0 16px #000; | ||
31 | } | ||
32 | |||
33 | </style> | ||
34 | |||
35 | <script type="text/javascript"> | ||
36 | // | ||
37 | window.addEventListener('load', loadBanner, false); | ||
38 | // | ||
39 | function loadBanner (e) { | ||
40 | var iframe = document.getElementsByTagName('iframe')[0]; | ||
41 | iframe.src = qs('url'); | ||
42 | iframe.style.width = qs('width')+'px'; | ||
43 | iframe.style.height = qs('height')+'px'; | ||
44 | iframe.style.marginLeft = -1*qs('width')/2+'px'; | ||
45 | iframe.style.marginTop = -1*qs('height')/2+'px'; | ||
46 | } | ||
47 | /* | ||
48 | Taken from: | ||
49 | http://stackoverflow.com/questions/7731778/jquery-get-query-string-parameters | ||
50 | */ | ||
51 | function qs(key) { | ||
52 | key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars | ||
53 | var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)")); | ||
54 | return match && decodeURIComponent(match[1]); | ||
55 | } | ||
56 | </script> | ||
57 | |||
58 | </head> | ||
59 | |||
60 | <body> | ||
61 | <iframe class="preview"></iframe> | ||
62 | </body> | ||
63 | |||
64 | </html> \ No newline at end of file | ||