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 var checkAnimationConfig = function() {
88 var animation = Configuration.get("animationEnabled");
89 if (animation === undefined || animation) {
90 $(".rollRight").css("-webkit-animation-play-state", "running");
91 $(".rollLeft").css("-webkit-animation-play-state", "running");
92 $(".liveBg").css("-webkit-animation-play-state", "running");
94 $(".rollRight").css("-webkit-animation-play-state", "paused");
95 $(".rollLeft").css("-webkit-animation-play-state", "paused");
96 $(".liveBg").css("-webkit-animation-play-state", "paused");
100 /* fixed webkit animation bugs */
101 window.setTimeout(function() {
102 checkAnimationConfig();
103 Configuration.addUpdateListener(function() {
104 checkAnimationConfig();
107 /* end fixed webkit animation bugs */
112 // debug mode - window.setTimeout("init()", 20000);
117 * Store state of audio plugin before application closing.
118 * @method window.onbeforeunload
121 window.onbeforeunload = function() {
123 $('#audioPlayer').audioAPI('setStatusAll');
127 * Provides inicialization of application content and starts animation.
128 * @class intelIVI.main
131 window.intelIVI.main = (window.intelIVI.main || {
134 * Calls initialization of content.
140 var viewPort = window.intelIVI.corpus.init();
141 document.body.appendChild(viewPort);
142 window.intelIVI.utility.startAnimation(1);
145 * Provides reloading of content.
149 counterEnd: function() {
151 window.location.reload();
155 function untouchable(param) {
158 setTimeout(function() {
159 animationOngoing = false;
164 * Provides initialization of animated application components.
165 * @class intelIVI.utility
168 window.intelIVI.utility = (window.intelIVI.utility || {
170 * Starts initial animations on Homescreen.
171 * @method startAnimation
174 startAnimation: function(index) {
176 $('#wrapper .step' + (index - 2)).css('opacity', '0');
177 $('#wrapper .step' + index).css('opacity', '0.4');
179 $('#indicator').addClass('showI');
180 window.intelIVI.utility.showContent(1);
184 setTimeout(function() {
186 window.intelIVI.utility.startAnimation(index);
190 * Shows animated content pies one by one.
191 * @method showContent
194 showContent: function(index) {
196 $('#content_ul .sector' + index).css('opacity', '1');
198 $('#bottomPanel').addClass('showBP');
199 $('#dateTime').addClass('showDT');
200 $('#topBarIcons').addClass('showTBI');
203 $('#wrapper .step9').css('opacity', '0.4');
204 $('#wrapper .step9').addClass('liveBg');
207 setTimeout(function() {
209 window.intelIVI.utility.showContent(index);
215 * Provides initialization of pie.
216 * @class intelIVI.corpus
219 window.intelIVI.corpus = (window.intelIVI.corpus || {
221 * Create HTML elements of pie.
227 for (i = 1; i < 10; i++) {
228 var viewPortBg = document.createElement('div');
229 viewPortBg.className = "backGround step" + i;
231 wrapper.appendChild(viewPortBg);
234 wrapper.appendChild(viewPort);