1 /*global Bootstrap, evalInstalledApps, appList:true, wrapper, viewPort */
4 * Home screen application is launched after system is completely booted up and provides access to available applications as well as to selected information from
5 * car CAN bus (via {{#crossLink "Bootstrap/carIndicator:property"}}{{/crossLink}} object). Hover and click on elements in images below to navigate to components of Home screen application.
7 * <img id="Image-Maps_1201312180420487" src="../assets/img/homescreen.png" usemap="#Image-Maps_1201312180420487" border="0" width="649" height="1152" alt="" />
8 * <map id="_Image-Maps_1201312180420487" name="Image-Maps_1201312180420487">
9 * <area shape="rect" coords="0,0,573,78" href="../classes/topbaricons.html" alt="top bar icons" title="Top bar icons" />
10 * <area shape="rect" coords="0,77,644,132" href="../classes/clock.html" alt="clock" title="Clock" />
11 * <area shape="rect" coords="0,994,644,1147" href="../classes/bottompanel.html" alt="bottom panel" title="Bottom panel" />
12 * <area shape="rect" coords="0,159,644,961" href="../classes/actionCatcher.html" alt="Action catcher" title="Action catcher" />
13 * <area shape="rect" coords="573,1,644,76" href="../modules/Settings.html" alt="Settings" title="Settings" />
15 * @module HomescreenApplication
16 * @main HomescreenApplication
20 * Provides inicialization of application and startup animations.
31 if (typeof tizen !== 'undefined') {
35 if (!window.intelIVI) {
38 var animationOngoing = false;
41 * Initialize plugins, register events for Homescreen app.
45 var init = function() {
50 bootstrap = new Bootstrap(function(status) {
51 $('#dateTime').ClockPlugin('init', 60);
52 $('#dateTime').ClockPlugin('startTimer');
54 $('#bottomPanel').bottomPanel('init', true);
55 $("#topBarIcons").topBarIconsPlugin('init', 'dashboard');
58 window.intelIVI.main.init();
60 bootstrap.carIndicator.addListener({
61 onBatteryStatusChanged: function(newValue) {
62 var newBatteryStatus = newValue.toString() + "%";
63 $('#batteryStatus').html(newBatteryStatus);
64 var newBatteryRange = "~" + Math.round(((newValue / 100) * bootstrap.carIndicator.status.fullBatteryRange)).toString() + " MI";
65 $('#batteryRange').html(newBatteryRange);
67 onOutsideTempChanged: function(newValue) {
68 $("#weatherStatus").html(newValue + "°C");
70 onInsideTempChanged: function(newValue) {
71 $("#fanStatus").html(newValue + "°C");
73 onSpeedChanged: function(newValue) {
74 $("#homeScrSpeed").html(newValue);
76 onFullBatteryRange: function() {
80 bootstrap.themeEngine.addStatusListener(function() {
87 /* fixed webkit animation bugs */
88 window.setTimeout(function() {
89 window.setInterval(function() {
90 $("#innerRing").removeClass("rollLeft");
91 $("#outerRing").removeClass("rollRight");
92 window.setTimeout(function() {
93 $("#innerRing").addClass("rollLeft");
94 $("#outerRing").addClass("rollRight");
99 window.setTimeout(function() {
100 window.setInterval(function() {
101 $('#wrapper .step9').removeClass('liveBg');
102 window.setTimeout(function() {
103 $('#wrapper .step9').addClass('liveBg');
108 /* end fixed webkit animation bugs */
113 // debug mode - window.setTimeout("init()", 20000);
118 * Store state of audio plugin before application closing.
119 * @method window.onbeforeunload
122 window.onbeforeunload = function() {
124 $('#audioPlayer').audioAPI('setStatusAll');
128 * Provides inicialization of application content and starts animation.
129 * @class intelIVI.main
132 window.intelIVI.main = (window.intelIVI.main || {
135 * Calls initialization of content.
141 var viewPort = window.intelIVI.corpus.init();
142 document.body.appendChild(viewPort);
143 window.intelIVI.utility.startAnimation(1);
146 * Provides reloading of content.
150 counterEnd: function() {
152 window.location.reload();
156 function untouchable(param) {
159 setTimeout(function() {
160 animationOngoing = false;
165 * Provides initialization of animated application components.
166 * @class intelIVI.utility
169 window.intelIVI.utility = (window.intelIVI.utility || {
171 * Starts initial animations on Homescreen.
172 * @method startAnimation
175 startAnimation: function(index) {
177 $('#wrapper .step' + (index - 2)).css('opacity', '0');
178 $('#wrapper .step' + index).css('opacity', '0.4');
180 $('#indicator').addClass('showI');
181 window.intelIVI.utility.showContent(1);
185 setTimeout(function() {
187 window.intelIVI.utility.startAnimation(index);
191 * Shows animated content pies one by one.
192 * @method showContent
195 showContent: function(index) {
197 $('#content_ul .sector' + index).css('opacity', '1');
199 $('#bottomPanel').addClass('showBP');
200 $('#dateTime').addClass('showDT');
201 $('#topBarIcons').addClass('showTBI');
204 $('#wrapper .step9').css('opacity', '0.4');
205 $('#wrapper .step9').addClass('liveBg');
208 setTimeout(function() {
210 window.intelIVI.utility.showContent(index);
216 * Provides initialization of pie.
217 * @class intelIVI.corpus
220 window.intelIVI.corpus = (window.intelIVI.corpus || {
222 * Create HTML elements of pie.
228 for (i = 1; i < 10; i++) {
229 var viewPortBg = document.createElement('div');
230 viewPortBg.className = "backGround step" + i;
232 wrapper.appendChild(viewPortBg);
235 wrapper.appendChild(viewPort);