This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
/
index.htm
107 lines (97 loc) · 3.88 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<!--
* Copyright 2010-2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<html>
<head>
<meta name="x-blackberry-defaultHoverEffect" content="false" />
<link rel="stylesheet" type="text/css" href="bbui.css"></link>
<script type="text/javascript" src="bbui.js"></script>
<script type="text/javascript" src="local:///chrome/webworks.js"></script>
<script type="text/javascript">
var webworksreadyFired = false,
darkColoring = false,
darkScreenColor = 'black';
document.addEventListener('webworksready', function(e) {
// This is code to ensure that if webworksready is fired multiple times we still only init() one time
if (webworksreadyFired) return;
webworksreadyFired = true;
var config;
// Toggle our coloring for testing
if (darkColoring) {
config = {controlsDark: true,
listsDark: true,
bb10ForPlayBook: true};
} else {
config = {controlsDark: false,
listsDark: false,
coloredTitleBar: true,
bb10ForPlayBook: true};
}
// Handle styling of the screen before it is displayed
config.onscreenready = function(element, id) {
if (darkColoring && bb.device.isBB10) {
var screen = element.querySelector('[data-bb-type=screen]');
if (screen) {
screen.style['background-color'] = darkScreenColor;
}
}
if (id == 'dataOnLoad') {
dataOnLoad_initialLoad(element);
} else if (id == 'masterDetail') {
masterDetail_initialLoad(element);
} else if (id == 'dataOnTheFly') {
dataOnTheFly_onScreenReady(element);
}
// Remove all titles "except" input and pill buttons screen if running on BB10
if (bb.device.isBB10 && (id != 'input') && (id != 'pillButtons') && (id != 'titlePillButtons')) {
var titles = element.querySelectorAll('[data-bb-type=title]');
if (titles.length > 0) {
titles[0].parentNode.removeChild(titles[0]);
}
}
// Initialize our title pill buttons screen
if (bb.device.isBB10 && (id == 'titlePillButtons')) {
titlePillButtons_Init(element);
}
};
// Handle styling of the screen after it is displayed
config.ondomready = function(element, id, params) {
if (id == 'dataOnTheFly') {
dataOnTheFly_initialLoad(element);
}
};
// You must call init on bbUI before any other code loads.
// If you want default functionality simply don't pass any parameters.. bb.init();
bb.init(config);
if (darkColoring && bb.device.isBB10) {
document.body.style['background-color'] = darkScreenColor;
document.body.style['color'] = 'white';
}
bb.pushScreen('menu.htm', 'menu');
}, false);
// Fire the webworksready event for PlayBook and BBOS
window.addEventListener('load',function() {
if (navigator.userAgent.indexOf('BB10') < 0) {
var evt = document.createEvent('Events');
evt.initEvent('webworksready', true, true);
document.dispatchEvent(evt);
}
});
</script>
</head>
<body>
</body>
</html>