Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7170 from dscravag/nightly2

Nightly 2012-12-24
  • Loading branch information...
commit 63f7b9ca0cacde66db5af5e79641ab728c757e23 2 parents e790b7f + 2d8eee9
@dscravag dscravag authored
Showing with 6,380 additions and 5,705 deletions.
  1. +20 −39 apps/clock/index.html
  2. +80 −47 apps/clock/js/alarm.js
  3. +10 −1 apps/clock/js/utils.js
  4. +138 −91 apps/clock/style/alarm.css
  5. +80 −102 apps/clock/style/clock.css
  6. BIN  apps/clock/style/images/add_alarm.png
  7. BIN  apps/clock/style/images/alarm_indicator.png
  8. BIN  apps/clock/style/images/alarm_off.png
  9. BIN  apps/clock/style/images/alarm_on.png
  10. BIN  apps/clock/style/images/alarm_sep.png
  11. BIN  apps/clock/style/images/analog_clock_background1_big.png
  12. BIN  apps/clock/style/images/analog_clock_background1_small.png
  13. BIN  apps/clock/style/images/analog_clock_background2_big.png
  14. BIN  apps/clock/style/images/analog_clock_background2_small.png
  15. BIN  apps/clock/style/images/analog_clock_background3_big.png
  16. BIN  apps/clock/style/images/analog_clock_background3_small.png
  17. BIN  apps/clock/style/images/analog_clock_background4_big.png
  18. BIN  apps/clock/style/images/analog_clock_background4_small.png
  19. BIN  apps/clock/style/images/analog_clock_marks1.png
  20. BIN  apps/clock/style/images/analog_clock_marks2.png
  21. BIN  apps/clock/style/images/analog_clock_marks3.png
  22. BIN  apps/clock/style/images/analog_clock_marks4.png
  23. BIN  apps/clock/style/images/background.png
  24. BIN  apps/clock/style/images/digital_bk.png
  25. BIN  apps/clock/style/images/digital_clock_bg.png
  26. BIN  apps/clock/style/images/edit_background.png
  27. BIN  apps/clock/style/images/picker_label.png
  28. +1 −1  apps/communications/contacts/index.html
  29. +16 −15 apps/communications/dialer/index.html
  30. +17 −21 apps/communications/dialer/js/dialer.js
  31. +1 −1  apps/communications/dialer/js/keypad.js
  32. +2 −4 apps/communications/dialer/js/lazy_l10n.js
  33. +12 −11 apps/communications/dialer/js/oncall.js
  34. +77 −15 apps/communications/dialer/js/recents.js
  35. +39 −11 apps/communications/dialer/js/ussd.js
  36. +5 −1 apps/communications/dialer/js/ussd_ui.js
  37. +7 −1 apps/communications/dialer/style/dialer.css
  38. BIN  apps/communications/dialer/style/images/ActionIcon_40x40_bluetooth.png
  39. BIN  apps/communications/dialer/style/images/ActionIcon_40x40_bluetooth_active.png
  40. BIN  apps/communications/dialer/style/images/ActionIcon_40x40_mute.png
  41. BIN  apps/communications/dialer/style/images/ActionIcon_40x40_mute_active.png
  42. BIN  apps/communications/dialer/style/images/ActionIcon_40x40_speaker.png
  43. BIN  apps/communications/dialer/style/images/dialer_icon_delete.png
  44. BIN  apps/communications/dialer/style/images/dialer_icon_delete_active.png
  45. BIN  apps/communications/dialer/style/images/incoming-connected.png
  46. BIN  apps/communications/dialer/style/images/incoming-refused.png
  47. BIN  apps/communications/dialer/style/images/incoming.png
  48. BIN  apps/communications/dialer/style/images/outgoing-connected.png
  49. BIN  apps/communications/dialer/style/images/outgoing-refused.png
  50. BIN  apps/communications/dialer/style/images/recents.png
  51. +28 −18 apps/communications/dialer/style/keypad.css
  52. +50 −27 apps/communications/dialer/style/oncall.css
  53. +28 −28 apps/communications/ftu/css/style.css
  54. +20 −20 apps/communications/ftu/index.html
  55. +80 −144 apps/communications/ftu/js/ui.js
  56. +1 −1  apps/communications/ftu/js/wifi.js
  57. +8 −0 apps/communications/ftu/locales/ftu.en-US.properties
  58. +3 −2 apps/communications/manifest.webapp
  59. +29 −24 apps/costcontrol/fte.html
  60. +12 −0 apps/costcontrol/handle_gaps.html
  61. +537 −59 apps/costcontrol/index.html
  62. +108 −138 apps/costcontrol/js/app.js
  63. +151 −0 apps/costcontrol/js/common.js
  64. +276 −0 apps/costcontrol/js/config_manager.js
  65. +426 −0 apps/costcontrol/js/costcontrol.js
  66. +0 −10 apps/costcontrol/js/defaults.js
  67. +161 −0 apps/costcontrol/js/fte.js
  68. +202 −0 apps/costcontrol/js/message_handler.js
  69. +247 −0 apps/costcontrol/js/mindgap.js
  70. +0 −1,136 apps/costcontrol/js/service/cost_control_service.js
  71. +0 −82 apps/costcontrol/js/service/service_utils.js
  72. +255 −0 apps/costcontrol/js/settings/autosettings.js
  73. +13 −20 apps/costcontrol/js/{views/limit_dialog.js → settings/limitdialog.js}
  74. +207 −0 apps/costcontrol/js/settings/settings.js
  75. +0 −296 apps/costcontrol/js/utils/autosettings.js
  76. +28 −19 apps/costcontrol/js/utils/debug.js
  77. +30 −3 apps/costcontrol/js/utils/formatting.js
  78. +59 −0 apps/costcontrol/js/utils/toolkit.js
  79. +109 −0 apps/costcontrol/js/view_manager.js
  80. +287 −463 apps/costcontrol/js/views/balance.js
  81. +0 −812 apps/costcontrol/js/views/data_usage.js
  82. +610 −0 apps/costcontrol/js/views/datausage.js
  83. +0 −174 apps/costcontrol/js/views/fte.js
  84. +0 −247 apps/costcontrol/js/views/settings.js
  85. +87 −69 apps/costcontrol/js/views/telephony.js
  86. +0 −110 apps/costcontrol/js/views/view_manager.js
  87. +0 −8 apps/costcontrol/js/views/vmanagers.js
  88. +218 −391 apps/costcontrol/js/widget.js
  89. +5 −0 apps/costcontrol/locales/costcontrol.en-US.properties
  90. +9 −6 apps/costcontrol/manifest.webapp
  91. +15 −0 apps/costcontrol/message_handler.html
  92. +0 −23 apps/costcontrol/service.html
  93. +0 −516 apps/costcontrol/settings.html
  94. +11 −4 apps/costcontrol/style/app.css
  95. BIN  apps/costcontrol/style/images/app/icons/checked.png
  96. BIN  apps/costcontrol/style/images/app/ui/datausage/pattern-3g.png
  97. BIN  apps/costcontrol/style/images/app/ui/datausage/pattern.png
  98. +1 −1  apps/costcontrol/style/views/datalimits.css
  99. +37 −77 apps/costcontrol/style/views/datausage.css
  100. +1 −1  apps/costcontrol/style/views/firsttime.css
  101. +9 −1 apps/costcontrol/style/views/settings.css
  102. +3 −3 apps/costcontrol/style/views/telephony.css
  103. +9 −9 apps/costcontrol/style/views/topup.css
  104. +21 −11 apps/costcontrol/widget.html
  105. +26 −7 apps/email/js/message-cards.js
  106. +2 −0  apps/email/locales/email.en-US.properties
  107. +4 −0 apps/email/style/message-cards.css
  108. +9 −27 apps/homescreen/index.html
  109. +20 −11 apps/homescreen/js/bookmark.js
  110. +7 −5 apps/homescreen/js/grid.js
  111. +14 −14 apps/homescreen/js/homescreen.js
  112. +11 −0 apps/homescreen/js/message.js
  113. +26 −0 apps/homescreen/js/save-bookmark.js
  114. +4 −1 apps/homescreen/manifest.webapp
  115. +45 −0 apps/homescreen/save-bookmark.html
  116. +20 −0 apps/homescreen/style/bookmark.css
  117. +0 −26 apps/homescreen/style/homescreen.css
  118. +11 −19 apps/settings/index.html
  119. +144 −70 apps/settings/js/apps.js
  120. +54 −4 apps/settings/js/call.js
  121. +0 −4 apps/settings/js/carrier.js
  122. +5 −4 apps/settings/js/connectivity.js
  123. +9 −1 apps/settings/js/icc.js
  124. +1 −1  apps/settings/js/phone_lock.js
  125. +2 −3 apps/settings/locales/settings.en-US.properties
  126. +58 −0 apps/settings/resources/permissions_table.json
  127. +6 −1 apps/settings/style/icons.css
  128. BIN  apps/settings/style/images/icons_sprite.png
  129. +15 −9 apps/sms/js/sms.js
  130. +1 −0  apps/sms/style/sms.css
  131. +2 −6 apps/system/index.html
  132. +1 −1  apps/system/js/app_install_manager.js
  133. +1 −1  apps/system/js/applications.js
  134. +9 −5 apps/system/js/attention_screen.js
  135. +1 −1  apps/system/js/background_service.js
  136. +46 −0 apps/system/js/cards_view.js
  137. +9 −0 apps/system/js/cost_control.js
  138. +2 −1  apps/system/js/crash_reporter.js
  139. +2 −2 apps/system/js/error.js
  140. +9 −25 apps/system/js/lockscreen.js
  141. +4 −2 apps/system/js/permission_manager.js
  142. +25 −18 apps/system/js/sound_manager.js
  143. +64 −33 apps/system/js/statusbar.js
  144. +41 −11 apps/system/js/window_manager.js
  145. +16 −8 apps/system/js/wrapper.js
  146. BIN  apps/system/style/statusbar/images/icons.png
  147. +3 −0  apps/system/style/statusbar/statusbar.css
  148. +73 −0 apps/system/test/unit/mobile_operator_test.js
  149. +15 −0 apps/system/test/unit/mock_mobile_operator.js
  150. +21 −0 apps/system/test/unit/mock_navigator_moz_mobile_connection.js
  151. +55 −0 apps/system/test/unit/mock_navigator_moz_telephony.js
  152. +363 −21 apps/system/test/unit/statusbar_test.js
  153. +6 −3 build/applications-data.js
  154. +2 −1  build/settings.py
  155. +2 −2 build/utils.js
  156. +0 −1  external-apps/mochitest/origin
  157. +1 −1  shared/js/l10n.js
  158. +43 −3 apps/system/js/mobile_info.js → shared/js/mobile_operator.js
  159. +8 −38 shared/locales/permissions/permissions.en-US.properties
  160. +1 −0  test_apps/uitest/index.html
  161. +124 −0 test_apps/uitest/js/identity.js
  162. +41 −0 test_apps/uitest/tests/identity.html
View
59 apps/clock/index.html
@@ -30,43 +30,22 @@
<script type="application/javascript" src="js/timer.js"></script>
</head>
- <body class="hidden">
+ <body>
<div id="views">
<div id="alarm-view" class="active view">
<div id="clock-view">
-
<div id="analog-clock">
- <div id="analog-clock-background-cache1" class="analog-clock-background-cache"></div>
- <div id="analog-clock-background-cache2" class="analog-clock-background-cache"></div>
- <div id="analog-clock-background-cache3" class="analog-clock-background-cache"></div>
- <div id="analog-clock-background-cache4" class="analog-clock-background-cache"></div>
<div id="analog-clock-container">
- <svg id="analog-clock-svg" viewBox="-50 -50 100 150">
- <defs> <!-- Define a filter for drop-shadows -->
- <filter id="shadow" x="-50%" y="-50%" width="200%" height="200%">
- <feOffset result="offOut" in="SourceAlpha" dx="0" dy="0.6"/>
- <feGaussianBlur result="blurOut" in="offOut" stdDeviation="0.8"/>
- <feBlend in="SourceGraphic" in2="blurOut" mode="normal"/>
- </filter> <!-- Define gradients for hands color -->
- <linearGradient id="hourhand-gradient" x1="0%" y1="0%" x2="100%" y2="0%">
- <stop offset="0%" style="stop-color:#3a3e40;stop-opacity:1"/>
- <stop offset="100%" style="stop-color:#14191b;stop-opacity:1"/>
- </linearGradient>
- <linearGradient id="minutehand-gradient" x1="0%" y1="0%" x2="100%" y2="0%">
- <stop offset="0%" style="stop-color:#5e696d;stop-opacity:1"/>
- <stop offset="100%" style="stop-color:#4f5b5f;stop-opacity:1"/>
- </linearGradient>
- </defs>
- <g id="analog-clock-svg-body">
- <!-- Draw hands pointing straight up. We rotate them in the code. -->
- <g id="hands" filter="url(#shadow)"> <!-- Add shadows to the hands -->
- <rect id="hourhand" x="-1.3" y="0" width="2.6" height="26" rx="0.4" ry="0.4" fill="url(#hourhand-gradient)" stroke="url(#hourhand-gradient)" stroke-width="0"/>
- <rect id="minutehand" x="-1.3" y="0" width="2.6" height="40" rx="0.4" ry="0.4" fill="url(#minutehand-gradient)" stroke="url(#minutehand-gradient)" stroke-width="0"/>
- <circle id="minutehandCentralPoint" cx="0" cy="0" r="2.7"/> <!-- the minute hand central point -->
- <line id="secondhand" x1="0" y1="8" x2="0" y2="-41"/>
- <circle id="secondhandCentralPoint" cx="0" cy="0" r="1.4"/> <!-- the second hand central point -->
- </g>
- </g>
+ <svg id="analog-clock-svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1" viewBox="0 0 270 270">
+ <circle id="minutehandCentralPoint" cx="135" cy="135" r="9"/>
+ <rect id="hourhand" x="131" y="135" width="8" height="92"/>
+ <rect id="minutehand" x="131" y="135" width="8" height="113"/>
+ <!-- This is the second hand path, Thanks illustrator! -->
+ <path id="secondhand"
+ d="M142.103,135c0-3.562-3.103-6.495-6.103-6.936V0h-2v128.095c-3,0.53-5.897,3.415-5.897,6.905
+ s2.897,6.375,5.897,6.905V161h2v-19.064C139,141.495,142.103,138.562,142.103,135z"/>
</svg>
</div>
</div>
@@ -148,7 +127,7 @@
<!-- Alarm -->
<section id="alarm" class="view skin-organic" role="region" data-title="Alarm">
<header>
- <a href="#alarm-view"><span class="icon icon-back">back</span></a>
+ <a href="#alarm-view" id="alarm-clock-container"><span class="icon icon-back" id="alarm-back" >back</span></a>
<menu type="toolbar">
<a id="alarm-done" href="#alarm-view" data-l10n-id="done">Done</a>
</menu>
@@ -156,6 +135,8 @@ <h1 id="alarm-title"></h1>
</header>
<ul id="edit-alarm" class="tableView">
<li class="picker">
+ <div id="value-indicator-left"></div>
+ <div id="value-indicator-right"></div>
<div id="picker-bar">
<div id="picker-container">
<div id="value-indicator-bottom"></div>
@@ -175,11 +156,11 @@ <h1 id="alarm-title"></h1>
<div id="picker-bar-gradient"></div>
</div>
</li>
- <li class="singleline">
+ <li class="singleline field">
<span class="view-alarm-lbl" data-l10n-id="label">Label</span>
<input type="text" class="right" data-l10n-id="alarm" name="alarm.label" placeholder="Alarm"/>
</li>
- <li class="singleline">
+ <li class="singleline field">
<span class="view-alarm-lbl" data-l10n-id="repeat">Repeat</span>
<select id="repeat-select" multiple="true" class="abstract-menu">
<option value="0" data-l10n-id="weekday-1-long">Monday</option>
@@ -193,7 +174,7 @@ <h1 id="alarm-title"></h1>
<a id="repeat-menu" data-l10n-id="never" class="abstract-menu">Never</a>
<p></p>
</li>
- <li class="singleline">
+ <li class="singleline field">
<span class="view-alarm-lbl" data-l10n-id="sound">Sound</span>
<select id="sound-select" class="abstract-menu">
<option value="ac_classic_clock_alarm.opus" data-l10n-id="ac_classic_clock_alarm_opus"></option>
@@ -208,8 +189,8 @@ <h1 id="alarm-title"></h1>
<a id="sound-menu" class="abstract-menu">Classic</a>
<p></p>
</li>
- <li class="singleline">
- <span class="view-alarm-lbl" data-l10n-id="snooze">Snooze</span>
+ <li class="singleline field">
+ <span class="view-alarm-lbl snooze-lbl" data-l10n-id="snooze">Snooze</span>
<select id="snooze-select" class="abstract-menu">
<option data-l10n-id="nMinutes" data-l10n-args='{"n": "5"}' value="5"> 5 minutes</option>
<option data-l10n-id="nMinutes" data-l10n-args='{"n": "10"}' value="10">10 minutes</option>
@@ -219,7 +200,7 @@ <h1 id="alarm-title"></h1>
<a id="snooze-menu" class="abstract-menu" data-l10n-id="nMinutes" data-l10n-args='{"n": "5"}'>5 minutes</a>
<p></p>
</li>
- <li id="alarm-delete-button">
+ <li id="alarm-delete-button" class="singleline">
<a id="alarm-delete" href="#alarm-view" data-l10n-id="delete">Delete</a>
</li>
</ul>
View
127 apps/clock/js/alarm.js
@@ -4,16 +4,11 @@ var _ = navigator.mozL10n.get;
var ClockView = {
- _clockMode: '', /* digital or analog */
+ _clockMode: 'analog', /* digital or analog */
_analogGestureDetector: null,
_digitalGestureDetector: null,
- get clockView() {
- delete this.clockView;
- return this.clockView = document.getElementById('clock-view');
- },
-
get digitalClock() {
delete this.digitalClock;
return this.digitalClock = document.getElementById('digital-clock');
@@ -24,12 +19,6 @@ var ClockView = {
return this.analogClock = document.getElementById('analog-clock');
},
- get analogClockSVGBody() {
- delete this.analogClockSVGBody;
- return this.analogClockSVGBody =
- document.getElementById('analog-clock-svg-body');
- },
-
get time() {
delete this.time;
return this.time = document.getElementById('clock-time');
@@ -57,11 +46,13 @@ var ClockView = {
},
init: function cv_init() {
+ this.container = document.getElementById('analog-clock-container');
+
+ this.resizeAnalogClock();
+
this.updateDaydate();
this.updateAnalogClock();
- this._clockMode = 'analog';
- this.resizeAnalogClock();
this.analogClock.classList.add('visible'); /* analog clock is default */
this.digitalClock.classList.remove('visible');
this.digitalClockBackground.classList.remove('visible');
@@ -79,7 +70,8 @@ var ClockView = {
var d = new Date();
var f = new navigator.mozL10n.DateTimeFormat();
var format = navigator.mozL10n.get('dateFormat');
- this.dayDate.textContent = f.localeFormat(d, format);
+ var formated = f.localeFormat(d, format);
+ this.dayDate.innerHTML = formated.replace(/([0-9]+)/, '<b>$1</b>');
var self = this;
var remainMillisecond = (24 - d.getHours()) * 3600 * 1000 -
@@ -110,10 +102,11 @@ var ClockView = {
var sec = now.getSeconds(); // Seconds
var min = now.getMinutes(); // Minutes
var hour = (now.getHours() % 12) + min / 60; // Fractional hours
- this.setTransform('secondhand', sec * 6); // 6 degrees per second
+ var lastHour = (now.getHours() - 1 % 12) + min / 60;
+ this.setTransform('secondhand', sec * 6, (sec - 1) * 6); // 6 degrees per second
// Inverse angle 180 degrees for rect hands
- this.setTransform('minutehand', min * 6 - 180); // 6 degrees per minute
- this.setTransform('hourhand', hour * 30 - 180); // 30 degrees per hour
+ this.setTransform('minutehand', min * 6 - 180, (min - 1) * 6 - 180); // 6 degrees per minute
+ this.setTransform('hourhand', hour * 30 - 180, (lastHour) * 30 - 180); // 30 degrees per hour
// Update the clock again in 1 minute
var self = this;
@@ -123,11 +116,30 @@ var ClockView = {
}, (1000 - now.getMilliseconds()));
},
- setTransform: function cv_setTransform(id, angle) {
+ setTransform: function cv_setTransform(id, angle, from) {
+ !this.rotation && (this.rotation = {});
// Get SVG elements for the hands of the clock
var hand = document.getElementById(id);
// Set an SVG attribute on them to move them around the clock face
- hand.setAttribute('transform', 'rotate(' + angle + ',0,0)');
+ if (!this.rotation[id]) {
+ this.rotation[id] = document.createElementNS('http://www.w3.org/2000/svg', 'animateTransform');
+ }
+ if (!hand) { return; }
+
+ // In order to repaint once see, i use this trick. See Bug 817993
+ var rotate = this.rotation[id];
+ // don't repaint unless hand has changed
+ if (rotate.getAttribute('to') == angle + ',135,135')
+ return;
+
+ rotate.setAttribute('attributeName', 'transform');
+ rotate.setAttribute('attributeType', 'xml');
+ rotate.setAttribute('type', 'rotate');
+ rotate.setAttribute('from', from + ',135,135');
+ rotate.setAttribute('to', angle + ',135,135');
+ rotate.setAttribute('dur', '0.001s');
+ rotate.setAttribute('fill', 'freeze');
+ hand.appendChild(rotate);
},
handleEvent: function cv_handleEvent(evt) {
@@ -191,29 +203,9 @@ var ClockView = {
},
resizeAnalogClock: function cv_resizeAnalogClock() {
- this.resizeAnalogClockBackground();
- // Remove previous style
- for (var i = 1; i <= 4; i++) {
- var oldStyle = 'alarm' + i;
- if (this.analogClockSVGBody.classList.contains(oldStyle))
- this.analogClockSVGBody.classList.remove(oldStyle);
- }
var type = this.calAnalogClockType(AlarmList.getAlarmCount());
- var newStyle = 'alarm' + type;
- this.analogClockSVGBody.classList.add(newStyle);
- },
-
- resizeAnalogClockBackground: function cv_resizeAnalogClockBackground() {
- // Disable previous background
- for (var i = 1; i <= 4; i++) {
- var id = 'analog-clock-background-cache' + i;
- var element = document.getElementById(id);
- if (element.classList.contains('visible'))
- element.classList.remove('visible');
- }
- var type = this.calAnalogClockType(AlarmList.getAlarmCount());
- var id = 'analog-clock-background-cache' + type;
- document.getElementById(id).classList.add('visible');
+ this.container.className = 'marks' + type;
+ document.getElementById('alarms').className = 'tableView count' + type;
},
showHideAlarmSetIndicator: function cv_showHideAlarmSetIndicator(enabled) {
@@ -222,7 +214,29 @@ var ClockView = {
} else {
this.hourState.classList.remove('alarm-set-indicator');
}
+ },
+
+ hide: function cv_hide() {
+ var self = this;
+ // Set a time out to add a delay so the clock is hidden
+ // after the edit mode is shown
+ setTimeout(function() {
+ self.digitalClock.className = '';
+ self.analogClock.className = '';
+ }, 500);
+ },
+
+ show: function cv_show() {
+ var self = this;
+ self.digitalClock.className = '';
+ self.analogClock.className = '';
+ if (self._clockMode == 'analog') {
+ self.analogClock.className = 'visible';
+ } else {
+ self.digitalClock.className = 'visible';
+ }
}
+
};
var BannerView = {
@@ -300,6 +314,7 @@ var AlarmList = {
},
handleEvent: function al_handleEvent(evt) {
+
var link = evt.target;
var currentTarget = evt.currentTarget;
if (!link)
@@ -309,6 +324,7 @@ var AlarmList = {
case 'click':
switch (link.id) {
case 'alarm-new':
+ ClockView.hide();
AlarmEditView.load();
break;
@@ -318,6 +334,7 @@ var AlarmList = {
break;
case 'alarm-item':
+ ClockView.hide();
AlarmEditView.load(this.getAlarmFromList(
parseInt(link.dataset.id)));
}
@@ -354,7 +371,7 @@ var AlarmList = {
var time = getLocaleTime(d);
content += '<li>' +
' <label class="alarmList">' +
- ' <input id="input-enable" data-type="switch"' +
+ ' <input id="input-enable"' +
'" data-id="' + alarm.id +
'" type="checkbox"' + isChecked + '>' +
' <span></span>' +
@@ -367,16 +384,15 @@ var AlarmList = {
' <span class="hour24-state">' + time.p + '</span>' +
' </div>' +
' <div class="alarmList-detail">' +
- ' <div class="label ' + paddingTop + '">' +
+ ' <div class="label">' +
escapeHTML(alarm.label) + '</div>' +
- ' <div class="repeat ' + hiddenSummary + '">' +
+ ' <div class="repeat">' +
summaryRepeat + '</div>' +
' </div>' +
' </div>' +
' </a>' +
'</li>';
});
-
this.alarms.innerHTML = content;
if (this._previousAlarmCount != this.getAlarmCount()) {
this._previousAlarmCount = this.getAlarmCount();
@@ -463,6 +479,8 @@ var AlarmManager = {
} else {
nextAlarmFireTime = getNextAlarmFireTime(alarm);
}
+ if (!navigator.mozAlarms)
+ return;
var request = navigator.mozAlarms.add(nextAlarmFireTime, 'ignoreTimezone',
{ id: alarm.id }); // give the alarm id for the request
var self = this;
@@ -554,7 +572,8 @@ var AlarmManager = {
updateAlarmStatusBar: function am_updateAlarmStatusBar() {
if (!('mozSettings' in navigator))
return;
-
+ if (!navigator.mozAlarms)
+ return;
var request = navigator.mozAlarms.getAll();
request.onsuccess = function(e) {
var hasAlarmEnabled = !!e.target.result.length;
@@ -669,8 +688,14 @@ var AlarmEditView = {
return this.deleteElement = document.getElementById('alarm-delete-button');
},
+ get backButton() {
+ delete this.backElement;
+ return this.backElement = document.getElementById('alarm-back');
+ },
+
init: function aev_init() {
document.getElementById('alarm-done').addEventListener('click', this);
+ document.getElementById('alarm-clock-container').addEventListener('click', this);
this.repeatMenu.addEventListener('click', this);
this.repeatSelect.addEventListener('change', this);
this.soundMenu.addEventListener('click', this);
@@ -679,6 +704,7 @@ var AlarmEditView = {
this.snoozeMenu.addEventListener('click', this);
this.snoozeSelect.addEventListener('change', this);
this.deleteButton.addEventListener('click', this);
+ this.backButton.addEventListener('click', this);
},
initTimePicker: function aev_initTimePicker() {
@@ -727,12 +753,14 @@ var AlarmEditView = {
},
handleEvent: function aev_handleEvent(evt) {
+
var input = evt.target;
if (!input)
return;
switch (input.id) {
case 'alarm-done':
+ ClockView.show();
if (!this.save()) {
evt.preventDefault();
return false;
@@ -773,8 +801,13 @@ var AlarmEditView = {
}
break;
case 'alarm-delete':
+ ClockView.show();
this.delete();
break;
+ case 'alarm-clock-container':
+ case 'alarm-back':
+ ClockView.show();
+ break;
}
},
View
11 apps/clock/js/utils.js
@@ -45,7 +45,7 @@ function summarizeDaysOfWeek(bitStr) {
weekdays.push(_('weekday-' + ((i + 1) % 7) + '-short'));
}
}
- summary = weekdays.join(', ');
+ summary = weekdays.join('<span class="comma">,</span> ');
}
return summary;
}
@@ -223,6 +223,7 @@ var ValuePicker = (function() {
};
VP.prototype.updateUI = function(index, ignorePicker) {
+ this.resetUI();
if (true !== ignorePicker) {
this.element.style.top =
(this._lower - index) * this._space + 'px';
@@ -238,6 +239,14 @@ var ValuePicker = (function() {
this.element.removeEventListener('mousemove', this.mousemoveHandler, false);
};
+ VP.prototype.resetUI = function() {
+ var actives = this.element.querySelectorAll(".active");
+ for (var i = 0; i < actives.length; i++) {
+ actives[i].classList.remove('active');
+ }
+ this._pickerUnits[this._currentIndex].classList.add('active');
+ };
+
function cloneEvent(evt) {
if ('touches' in evt) {
evt = evt.touches[0];
View
229 apps/clock/style/alarm.css
@@ -73,12 +73,14 @@ a.button.right {
}
a.button.right.plus {
- width: 2.75rem;
- height: 2.75rem;
- background-image: url(images/add_alarm.png);
- background-size: 100%;
- background-repeat: no-repeat;
+ background: url(images/add_alarm.png) no-repeat center;
+ padding: 2.2rem 1.5rem;
+ height: 2.5rem;
+ width: 3.2rem;
border: none;
+ margin: 0;
+ right: 0;
+ top: 0;
}
a.button.right.done-button {
@@ -106,8 +108,8 @@ a.abstract-menu {
padding-left: 7.50rem;
outline: 0;
color: black;
- font: 1.50rem/1.81rem 'MozTT',sans-serif;
- padding-top: 1.25rem;
+ font: 1.9rem 'MozTT',sans-serif;
+ padding-top: 1.05rem;
padding-bottom: 1.25rem;
}
@@ -122,14 +124,15 @@ select.abstract-menu {
text-align: center;
text-decoration: none;
width: 100%;
+ line-height: 4.2rem;
}
#alarm-delete-button {
background: -moz-linear-gradient(bottom, #900010, #c90010);
border: none;
- height: 3.44rem;
+ height: 4.2rem;
overflow: hidden;
- margin: 1.5rem 1.5rem 1rem;
+ margin: 0.3rem 0 0;
text-shadow: -1px -1px 0 #830B0B;
border-radius: 0.19rem 0.19rem 0.19rem 0.19rem;
}
@@ -202,15 +205,19 @@ body.hidden #alarm-view {
}
li.singleline {
- height: 4rem;
+ height: 4.67rem;
border-top: none;
border-bottom: 0.06rem solid #cbcbcc;
- padding-left: 5%;
- padding-right: 5%;
+ padding-left: 1.2rem;
+ padding-right: 1.2rem;
overflow: hidden;
-moz-box-sizing: border-box;
}
+li.singleline.field:active {
+ background: #B1F1FF;
+}
+
li.multiline {
height: 22.19rem;
border-top: none;
@@ -224,10 +231,14 @@ li.multiline:active {
}
li.picker {
- height: 21.88rem;
+ position: relative;
+ height: 16.71rem;
padding-top: 0.31rem;
+ padding-bottom: 0.5rem;
border-top: none;
border-bottom: none;
+ width: 27rem;
+ margin: 0 auto;
}
li.picker:active {
@@ -236,11 +247,14 @@ li.picker:active {
}
.view-alarm-lbl {
- color: #7d7d7d;
- font: 1.50rem/1.50rem 'MozTT',sans-serif;
- top: 1.38rem;
- height: auto;
+ font: 1.40rem 'MozTT',sans-serif;
pointer-events: none;
+ margin-top: 1.4rem;
+ color: #505859;
+}
+
+.snooze-lbl {
+ margin-top: 1.5rem;
}
/* Table View */
@@ -257,23 +271,18 @@ ul {
ul li { /* 6rem, including a 0.13rem border */
position: relative;
- height: 6.25rem;
- border-top: 0.06rem solid #cbcbcc;
+ height: 5.8rem;
color: #555;
}
ul li:active {
background-color: rgba(0, 0, 0, .07);
- text-shadow: #999 0 -0.06rem 0;
color: #222;
}
ul li > a {
display: block;
- padding-top: 1rem;
padding-bottom: 1rem;
- height: 4.25rem; /* -moz-calc(100% - 2.50rem); */
- line-height: 4.25rem; /* -moz-calc(100% - 2.50rem); */
text-decoration: none;
outline: 0;
color: #555;
@@ -284,7 +293,6 @@ ul li > a, ul li > span, ul li > small { /* text ellipsis */
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
- position: absolute;
width: -moz-calc(100% - 8.13rem);
}
@@ -301,25 +309,39 @@ ul li > small {
}
.alarmList-time {
- float: left;
- width: 41%;
- padding-top: 0.75rem;
text-align: left;
+ width: 41%;
}
.alarmList-detail {
- float: left;
- width: 50%;
+ position: absolute;
text-align: left;
- margin-left: -0.19rem;
+ width: 50%;
+ top: 0;
}
#alarms label {
position: absolute;
- right: 0;
- top: 50%;
- margin-top: -2.5rem;
z-index: 0;
+ right: 0;
+ height: 5.8rem;
+}
+
+#alarms label input[type="checkbox"] + span {
+ background: url(images/alarm_off.png) no-repeat center top;
+ width: 3.4rem;
+ height: 3.4rem;
+}
+#alarms label input[type="checkbox"]:checked + span {
+ border-color: #00acce;
+ background: url(images/alarm_on.png) no-repeat center top;;
+}
+
+#alarms label span {
+ left: auto;
+ right: 0.5rem;
+ top: 1.2rem;
+ margin: 0;
}
/* fake input boxes for checkboxes & radio buttons */
@@ -381,7 +403,7 @@ select, input, textarea {
background:none;
border:0.13rem solid white;
border-radius: 0.31rem;
- font-size: 1em;
+ font-size: 1.9rem;
}
select:focus, input:focus, textarea:focus {
@@ -393,10 +415,13 @@ select.right {
}
input.right {
- width: -moz-calc(100% - 12.50rem);
- margin: 0.37rem 0.50rem 0.19rem 7.50rem;
- height: 3.13rem;
- font: 1.50rem/1.88rem 'MozTT',sans-serif;
+ font: 1.9rem 'MozTT',sans-serif;
+ margin: 0.37rem 0.5rem 0.19rem 6.6rem;
+ width: -moz-calc(100% - 8.5rem);
+ border: 0.06rem solid #CBCBCC;
+ padding: 0.4rem 1rem;
+ background: #FFFFFF;
+ height: 2.8rem;
color: black;
}
/* ----------- Input Error ---------- */
@@ -430,18 +455,27 @@ input ~ *:empty {
max-height: 52%;
position: absolute;
bottom: 0rem;
- padding-left: 5%;
- padding-right: 5%;
+ padding-left: 1.5rem;
+ padding-right: 1.5rem;
background-color: transparent;
background-image: none;
}
+#alarms li {
+ background: url(images/alarm_sep.png) top no-repeat;
+ padding-top: 0.2rem;
+ padding-left: 0.8rem;
+}
+
+#digital-clock-background.visible ~ #alarms.count4 li:first-child {
+ background: none;
+}
+
#edit-alarm.tableView {
- background: url(images/edit_background.png) repeat scroll center center;
+ background: url(images/edit_background.png) no-repeat center center;
background-size: 100% 100%;
- width: 100%;
- padding-left: 0;
- padding-right: 0;
+ padding-left: 1.5rem;
+ padding-right: 1.5rem;
}
li img {
@@ -451,8 +485,6 @@ li img {
}
.description {
- position: relative;
- float: left;
width: 100%;
height: auto;
line-height: normal;
@@ -460,41 +492,48 @@ li img {
}
.alarmList-time span.time {
+ font: lighter 2.8rem 'MozTT', sans-serif;
+ margin-right: 0.4rem;
+ color: #CFE2E5;
height: auto;
- font: 2.50rem/2.50rem 'MozTT', sans-serif;
- color: black;
}
.alarmList-time span.hour24-state {
height: auto;
- font: 1.38rem/1.38rem 'MozTT', sans-serif;
- color: #25292a;
+ font: 1.4rem 'MozTT', sans-serif;
+ color: #5C6466;
margin-left: -0.25rem;
- text-transform:lowercase;
+ text-transform: uppercase;
}
.alarmList-detail .label {
- height: auto;
- font: 1.50rem/1.50rem 'MozTT', sans-serif;
- color: black;
+ font: 1.4rem 'MozTT', sans-serif;
text-overflow: ellipsis;
- padding-top: 0.31rem;
+ position: absolute;
+ overflow: hidden;
+ color: #737D80;
+ left: 12.5rem;
+ width: 11rem;
+ top: 1.6rem;
}
.alarmList-detail .repeat {
- height: auto;
- font: 1.50rem/1.50rem 'MozTT', sans-serif;
- color: #646768;
+ font: 1.4rem 'MozTT', sans-serif;
+ text-transform: capitalize;
text-overflow: ellipsis;
- padding-top: 0.44rem;
+ position: absolute;
+ overflow: hidden;
+ color: #A1B0B1;
+ width: 23.6rem;
+ top: 3.4rem;
}
-.alarmList-detail .hiddenSummary {
- display: none;
+.alarmList-detail .comma {
+ color: #454B4C;
}
-.alarmList-detail .paddingTop {
- padding-top: 1.19rem;
+.alarmList-detail .hiddenSummary {
+ display: none;
}
.lebal {
@@ -512,13 +551,8 @@ li img {
-moz-border-bottom-colors: #CBCBCC #FFFFFF;
}
-#picker-bar.format12h {
- width: 85%;
-}
-
-#picker-bar.format24h {
- width: 60%;
-}
+#picker-bar.format12h {}
+#picker-bar.format24h {}
#picker-bar-gradient {
-moz-border-top-colors:
@@ -548,36 +582,44 @@ li img {
width: 100%;
height: 100%;
position: relative;
- padding-top: 8.28rem;
+ padding-top: 5.95rem;
}
#value-indicator-wrapper {
- -moz-border-top-colors:
- rgba(0, 0, 0, 0.05) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.15)
- rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.3)
- rgba(0, 0, 0, 0.35);
-
- -moz-border-bottom-colors:
- rgba(0, 0, 0, 0.05) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.15)
- rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.3)
- rgba(0, 0, 0, 0.35);
-
- border-top: solid 0.44rem;
- border-bottom: solid 0.44rem;
+ background: url(/style/images/picker_label.png) no-repeat -6px 0;
position: absolute;
- height: 4.50rem;
+ top: 5.6rem;
+ height: 6rem;
width: 100%;
pointer-events: none;
}
+#value-indicator-left,
+#value-indicator-right {
+ background: url(/style/images/picker_label.png) no-repeat 0 0;
+ position: absolute;
+ width: 0.6rem;
+ height: 6rem;
+ top: 5.6rem;
+}
+
+#value-indicator-left {
+ left: -0.5rem;
+}
+
+#value-indicator-right {
+ background-position: top right;
+ right: -0.5rem;
+}
+
#value-indicator-hover-time {
+ font: lighter 1.88rem/3.75rem 'MozTT',sans-serif;
pointer-events: none;
- background-color: #00A5C5;
- color: #FFF;
position: absolute;
- height: 100%;
- font: 1.88rem/3.75rem 'MozTT',sans-serif;
text-align: center;
+ line-height: 5.6rem;
+ height: 100%;
+ color: #FFF;
}
#picker-bar.format12h #value-indicator-hover-time {
@@ -590,10 +632,9 @@ li img {
#value-indicator-hover {
pointer-events: none;
- background-color: #00A5C5;
position: absolute;
- width: 34%;
height: 100%;
+ width: 34%;
right:0;
}
@@ -655,13 +696,19 @@ div.animation-on {
.picker-unit {
position: relative;
- font: 2.13rem/5.3rem 'MozTT',sans-serif;
+ font: 2.2rem 'MozTT',sans-serif;
color: black;
text-align: center;
vertical-align: middle;
width: 100%;
height: 5.3rem;
+ line-height: 5.3rem;
pointer-events: none;
+ /*-moz-transition: font-size 0.5s ease;*/
+}
+.picker-unit.active {
+ color: #FFFFFF;
+ font-size: 3.2rem;
}
#picker-bar-background {
View
182 apps/clock/style/clock.css
@@ -1,4 +1,5 @@
html, body {
+ background: #000000;
width: 100%;
height: 100%;
overflow: hidden;
@@ -91,6 +92,7 @@ html, body {
}
#views {
+ background: url(images/background.png) no-repeat;
position: fixed;
top: 0;
left: 0;
@@ -304,55 +306,22 @@ html, body {
width: 100%;
height: -moz-calc(100% - 0.13rem);
color: black;
- background-image: url(images/clock_background_small.png);
- background-size: cover;
- background-position: center;
- border-bottom: 0.13rem solid #ACACAC;
- text-align: center;
}
#analog-clock {
display: none;
width: 100%;
height: 100%;
- background-size: cover;
- background-position: center center;
}
#analog-clock.visible {
display: block;
}
-.analog-clock-background-cache {
- position: absolute;
- width: 100%;
- height: 100%;
- background-size: cover;
- background-position: center center;
- display: none;
- pointer-events: none;
-}
-
.visible {
display: block;
}
-#analog-clock-background-cache1 {
- background-image: url(images/analog_clock_background1_small.png);
-}
-
-#analog-clock-background-cache2 {
- background-image: url(images/analog_clock_background2_small.png);
-}
-
-#analog-clock-background-cache3 {
- background-image: url(images/analog_clock_background3_small.png);
-}
-
-#analog-clock-background-cache4 {
- background-image: url(images/analog_clock_background4_small.png);
-}
-
#digital-clock-background {
height: 100%;
overflow: hidden;
@@ -361,11 +330,9 @@ html, body {
}
#digital-clock-background.visible {
- height: 48%;
- background-size: 100% 100%;
- background-image: url(images/digital_clock_bg.png);
- box-shadow: 0 0.25rem 0.37rem -0.37rem black;
+ height: 22.1rem; /* 48%; */
display: block;
+ background: url(images/digital_bk.png) no-repeat;
}
#digital-clock {
@@ -378,72 +345,112 @@ html, body {
}
#digital-clock-display {
+ text-align: center;
position: absolute;
width: 100%;
margin: auto;
}
#clock-time {
- font: 100 9.38rem/11.88rem 'MozTT', sans-serif;
- color: #26292a;
+ letter-spacing: -0.5rem;
+ font: lighter 11rem 'MozTT', sans-serif;
+ color: #CFE2E6;
pointer-events: none;
}
#clock-hour24-state {
- font: 100 3.13rem/3.13rem 'MozTT', sans-serif;
- color: #313334;
- text-transform:lowercase;
+ font: 3.7rem 'MozTT', sans-serif;
+ color: #5C6466;
+ text-transform: uppercase;
pointer-events: none;
+ position: relative;
}
#clock-hour24-state.alarm-set-indicator::after {
+ background: url("images/alarm_indicator.png") no-repeat;
position: absolute;
+ height: 1.8rem;
+ width: 1.8rem;
+ top: -4.2rem;
+ left: 1.6rem;
content: "";
- background-image: url("images/alarm_indicator.png");
- background-size: 100% auto;
- width: 3.44rem;
- height: 3.44rem;
- margin-top: 1.63rem;
- margin-left: -2.50rem;
}
#clock-day-date {
+ font: lighter normal 21px 'MozTT', sans-serif;
+ text-transform: capitalize;
+ margin: 2.6rem 0 0 1.5rem;
+ line-height: 1.7rem;
position: absolute;
+ color: #737D80;
width: 100%;
- margin: auto;
- font: normal 1.56rem 'MozTT', sans-serif;
- line-height: 6.13rem;
top: 0;
}
+#clock-day-date b {
+ font-family: MozTT;
+ font-weight: normal;
+}
+
#analog-clock-container {
- width: 100%;
- height: -moz-calc(100% - 5.9rem);
- margin: 5.9rem auto auto;
- position: absolute;
+ position: relative;
+ background-repeat: no-repeat;
+ margin: 8.8rem auto 0;
+}
+
+/*270x270*/
+#analog-clock-container.marks1 {
+ background-image: url(images/analog_clock_marks1.png);
+ width: 27rem; height: 27rem;
+}
+#analog-clock-container.marks1 svg {
+ width: 27rem; height: 27rem;
+}
+
+/*248x248*/
+#analog-clock-container.marks2 {
+ background-image: url(images/analog_clock_marks2.png);
+ width: 24.8rem; height: 24.8rem;
+ margin-top: 6.9rem;
+}
+#analog-clock-container.marks2 svg {
+ width: 24.8rem; height: 24.8rem;
+}
+
+/*198x198*/
+#analog-clock-container.marks3 {
+ background-image: url(images/analog_clock_marks3.png);
+ width: 19.8rem; height: 19.8rem;
+ margin-top: 6.2rem;
+}
+#analog-clock-container.marks3 svg {
+ width: 19.8rem; height: 19.8rem;
+}
+
+/*148x148*/
+#analog-clock-container.marks4 {
+ background-image: url(images/analog_clock_marks4.png);
+ width: 14.8rem; height: 14.8rem;
+ margin-top: 5.8rem;
+}
+#analog-clock-container.marks4 svg {
+ width: 14.8rem; height: 14.8rem;
}
+
/* These CSS styles all apply to the SVG clock elements */
#analog-clock-svg { /* styles for everything in the clock */
- stroke: black; /* black lines */
stroke-linecap: butt; /* with butt ends */
fill: transparent; /* on a transparent background */
}
-#hands {
- pointer-events: none;
+#hourhand, #minutehand, #minutehandCentralPoint {
+ fill: #CFE2E6;
+ stroke-width: 0rem;
}
-#secondhand { /* narrow blue second hand */
- stroke-width: 0.05rem;
- stroke: #00abcd;
+#secondhand, #secondhandCentralPoint { /* narrow blue second hand */
+ fill: #597980;
}
#minutehandCentralPoint { /* dark-gray central point*/
stroke-width: 0rem;
- stroke: #4f5b5f;
- fill: #4f5b5f;
-}
-#secondhandCentralPoint { /* blue central point */
- stroke-width: 0rem;
- stroke: #00abcd;
- fill: #00abcd;
}
/* from building blocks, core.css - [role=dialog]*/
.banner {
@@ -512,33 +519,6 @@ body.hidden *[data-l10n-id] {
html {
font-size: 10px;
}
- #analog-clock-svg-body.alarm1 {
- transform: matrix(1,0,0,1,0,0);
- }
- #analog-clock-svg-body.alarm2 {
- transform: matrix(0.85,0,0,0.85,0,-7);
- }
- #analog-clock-svg-body.alarm3 {
- transform: matrix(0.65,0,0,0.65,0,-16.5);
- }
- #analog-clock-svg-body.alarm4 {
- transform: matrix(0.46,0,0,0.46,0,-25.5);
- }
- #analog-clock-background-cache1 {
- background-image: url(images/analog_clock_background1_small.png);
- }
- #analog-clock-background-cache2 {
- background-image: url(images/analog_clock_background2_small.png);
- }
- #analog-clock-background-cache3 {
- background-image: url(images/analog_clock_background3_small.png);
- }
- #analog-clock-background-cache4 {
- background-image: url(images/analog_clock_background4_small.png);
- }
- #clock-view {
- background-image: url(images/clock_background_small.png);
- }
}
/* 480x800 phones */
@@ -559,18 +539,16 @@ body.hidden *[data-l10n-id] {
transform: matrix(0.52,0,0,0.52,0,-21.5);
}
#analog-clock-background-cache1 {
- background-image: url(images/analog_clock_background1_big.png);
+ background-image: url(images/analog_clock_background1@2x.png);
}
#analog-clock-background-cache2 {
- background-image: url(images/analog_clock_background2_big.png);
+ background-image: url(images/analog_clock_background2@2x.png);
}
#analog-clock-background-cache3 {
- background-image: url(images/analog_clock_background3_big.png);
+ background-image: url(images/analog_clock_background3@2x.png);
}
#analog-clock-background-cache4 {
- background-image: url(images/analog_clock_background4_big.png);
- }
- #clock-view {
- background-image: url(images/clock_background_big.png);
+ background-image: url(images/analog_clock_background4@2xpng);
}
+ #clock-view { }
}
View
BIN  apps/clock/style/images/add_alarm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/alarm_indicator.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/alarm_off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/alarm_on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/alarm_sep.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/analog_clock_background1_big.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background1_small.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background2_big.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background2_small.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background3_big.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background3_small.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background4_big.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_background4_small.png
Deleted file not rendered
View
BIN  apps/clock/style/images/analog_clock_marks1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/analog_clock_marks2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/analog_clock_marks3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/analog_clock_marks4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/digital_bk.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/digital_clock_bg.png
Deleted file not rendered
View
BIN  apps/clock/style/images/edit_background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  apps/clock/style/images/picker_label.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  apps/communications/contacts/index.html
@@ -518,7 +518,7 @@ <h2 data-l10n-id="facebook">Facebook</h2>
</li>
<li id="fb-update-option">
<!-- icon-error/icon-sync -->
- <button data-l10n-id="fb-update-friends" id="import-fb" class="icon">
+ <button data-l10n-id="fbUpdateFriends" id="import-fb" class="icon">
Update imported friends
</button>
<p id="renew-pwd-msg" data-l10n-id="renewPwdMsg" class="fb-error"></p>
View
31 apps/communications/dialer/index.html
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="pragma" content="no-cache">
<title>Dialer</title>
+
<!-- Localization -->
<script defer type="application/javascript" src="/dialer/js/lazy_l10n.js"></script>
<link rel="resource" type="application/l10n" href="/dialer/locales/locales.ini">
@@ -13,22 +14,26 @@
<script type="application/javascript" src="/shared/js/l10n_date.js"></script>
-->
+ <!-- Call log resources -->
+ <script defer type="application/javascript" src="/dialer/js/recents.js"></script>
+ <!-- Making sure the shared resources will be copy into the zip
+ <link rel="stylesheet" type="text/css" href="/shared/style/headers.css">
+ <link rel="stylesheet" type="text/css" href="/shared/style/switches.css">
+ <link rel="stylesheet" type="text/css" href="/shared/style/edit_mode.css">
+ <link rel="stylesheet" type="text/css" href="/shared/style/action_menu.css">
+ -->
+
+ <!-- App CSS -->
<link rel="stylesheet" type="text/css" href="/dialer/style/dialer.css">
<link rel="stylesheet" type="text/css" href="/dialer/style/keypad.css">
- <link rel="stylesheet" type="text/css" href="/dialer/style/commslog.css">
- <link rel="stylesheet" type="text/css" href="/dialer/style/fixed_header.css">
<!-- Stable BB -->
- <link rel="stylesheet" type="text/css" href="/shared/style/headers.css">
<link rel="stylesheet" type="text/css" href="/shared/style_unstable/tabs.css">
- <link rel="stylesheet" type="text/css" href="/shared/style/switches.css">
- <link rel="stylesheet" type="text/css" href="/shared/style/edit_mode.css">
- <link rel="stylesheet" type="text/css" href="/shared/style/action_menu.css">
<link rel="stylesheet" type="text/css" href="/shared/style/confirm.css">
<!-- Unstable BB -->
<link rel="stylesheet" type="text/css" href="/shared/style_unstable/lists.css">
-
+
<!-- Shared js -->
<script type="text/javascript" src="/shared/js/async_storage.js"></script>
<script defer type="application/javascript" src="/shared/js/settings_listener.js"></script>
@@ -36,21 +41,17 @@
<!-- App js -->
<script defer type="application/javascript" src="/contacts/js/confirm_dialog.js"></script>
- <script defer type="application/javascript" src="/dialer/js/fixed_header.js"></script>
- <script defer type="application/javascript" src="/dialer/js/utils.js"></script>
<script defer type="application/javascript" src="/shared/js/simple_phone_matcher.js"></script>
<script defer type="application/javascript" src="/dialer/js/contacts.js"></script>
<script defer type="application/javascript" src="/dialer/js/keypad.js"></script>
- <script defer type="application/javascript" src="/dialer/js/dialer.js"></script>
- <script defer type="application/javascript" src="/dialer/js/recents_db.js"></script>
- <script defer type="application/javascript" src="/dialer/js/recents.js"></script>
<script defer type="application/javascript" src="/dialer/js/ussd.js"></script>
+ <script defer type="application/javascript" src="/dialer/js/dialer.js"></script>
<script defer type="application/javascript" src="/contacts/js/fb/fb_data.js"></script>
<script defer type="application/javascript" src="/contacts/js/fb/fb_contact_utils.js"></script>
</head>
<body role="application">
<section id="views" role="tablist" data-items="3" class="bottom">
- <article class="view" role="tab" id="recents-view">
+ <article class="view hidden" role="tab" id="recents-view">
<a id="option-recents" href="#recents-view" class="icon icon-recents">recents</a>
<div role="tabpanel">
<section role="region">
@@ -217,7 +218,7 @@ <h1 data-l10n-id="callLog"></h1>
</article>
</section>
- <form id="edit-mode" role="dialog" data-type="edit">
+ <form id="edit-mode" role="dialog" data-type="edit" hidden>
<section>
<header id="edit-mode-header">
<button id="recents-icon-close">
@@ -235,7 +236,7 @@ <h1 id="header-edit-mode-text" data-l10n-id="edit">Edit</h1>
</menu>
</form>
- <form id="add-contact-action-menu" role="dialog" data-type="action">
+ <form id="add-contact-action-menu" role="dialog" data-type="action" hidden>
   <header data-l10n-id="addNewNumber"> Add New Number </header>
   <menu>
<button id="call-menuitem" data-l10n-id="call"> Call </button>
View
38 apps/communications/dialer/js/dialer.js
@@ -1,21 +1,6 @@
'use strict';
var CallHandler = (function callHandler() {
- var telephony = navigator.mozTelephony;
- if (!telephony)
- return;
- telephony.oncallschanged = function oncallschanged() {
- if (callScreenWindowLoaded) {
- if (telephony.calls.length === 0)
- // Calls might be ended before callscreen registers call-related
- // events. We send a message to notify callscreen of exiting when
- // there are no calls.
- sendCommandToCallScreen('*', 'exitCallScreen');
- }
- };
-
- var conn = navigator.mozMobileConnection;
-
var callScreenWindow = null;
var callScreenWindowLoaded = false;
var currentActivity = null;
@@ -103,19 +88,22 @@ var CallHandler = (function callHandler() {
/* === Recents support === */
function handleRecentAddRequest(entry) {
- RecentsDBManager.init(function() {
- RecentsDBManager.add(entry, function() {
- RecentsDBManager.close();
-
- if (Recents) {
+ Recents.load(function recentsLoaded() {
+ RecentsDBManager.init(function() {
+ RecentsDBManager.add(entry, function() {
+ RecentsDBManager.close();
Recents.refresh();
- }
+ });
});
});
}
/* === Incoming and STK calls === */
function newCall() {
+ // We need to query mozTelephony a first time here
+ // see bug 823958
+ var telephony = navigator.mozTelephony;
+
openCallScreen();
}
window.navigator.mozSetMessageHandler('telephony-new-call', newCall);
@@ -215,6 +203,8 @@ var CallHandler = (function callHandler() {
function startDial(number) {
var sanitizedNumber = number.replace(/-/g, '');
+
+ var telephony = navigator.mozTelephony;
if (telephony) {
var call = telephony.dial(sanitizedNumber);
@@ -308,6 +298,8 @@ var CallHandler = (function callHandler() {
'call_screen', 'attention');
callScreenWindow.onload = function onload() {
callScreenWindowLoaded = true;
+
+ var telephony = navigator.mozTelephony;
if (telephony.calls.length === 0) {
// Calls might be ended before callscreen is comletedly loaded,
// so that callscreen will miss call-related events. We send a
@@ -346,6 +338,10 @@ var CallHandler = (function callHandler() {
callScreenWindowLoaded = false;
}
+ /* === USSD === */
+ window.navigator.mozSetMessageHandler('ussd-received',
+ UssdManager.openUI.bind(UssdManager));
+
return {
call: call
};
View
2  apps/communications/dialer/js/keypad.js
@@ -351,7 +351,7 @@ var KeypadManager = {
},
hangUpCallFromKeypad: function hk_hangUpCallFromKeypad(event) {
- CallScreen.views.classList.remove('show');
+ CallScreen.body.classList.remove('showKeypad');
OnCallHandler.end();
},
View
6 apps/communications/dialer/js/lazy_l10n.js
@@ -16,14 +16,12 @@ var LazyL10n = {
// Adding the l10n JS files to the DOM
// the l10n resources
- var derahs = 'shared'; // Ugly, waiting for bug 822108
-
var l10nScript = document.createElement('script');
- l10nScript.src = '/' + derahs + '/js/l10n.js';
+ l10nScript.src = '/shared/js/l10n.js';
document.head.appendChild(l10nScript);
var l10nDateScript = document.createElement('script');
- l10nDateScript.src = '/' + derahs + '/js/l10n_date.js';
+ l10nDateScript.src = '/shared/js/l10n_date.js';
document.head.appendChild(l10nDateScript);
this._inDOM = true;
View
23 apps/communications/dialer/js/oncall.js
@@ -4,6 +4,7 @@ var CallScreen = {
_ticker: null,
_screenLock: null,
+ body: document.body,
screen: document.getElementById('call-screen'),
views: document.getElementById('views'),
@@ -51,7 +52,6 @@ var CallScreen = {
this.calls.addEventListener('click',
OnCallHandler.toggleCalls);
-
},
setCallerContactImage: function cs_setCallerContactImage(image_url, force) {
@@ -85,14 +85,14 @@ var CallScreen = {
showKeypad: function cs_showKeypad() {
KeypadManager.render('oncall');
- this.views.classList.add('show');
+ this.body.classList.add('showKeypad');
},
hideKeypad: function cs_hideKeypad() {
KeypadManager.restorePhoneNumber();
KeypadManager.restoreAdditionalContactInfo();
KeypadManager.formatPhoneNumber();
- this.views.classList.remove('show');
+ this.body.classList.remove('showKeypad');
},
render: function cs_render(layout_type) {
@@ -131,7 +131,7 @@ var CallScreen = {
showIncoming: function cs_showIncoming() {
// Hiding the keypad
- this.views.classList.remove('show');
+ this.body.classList.remove('showKeypad');
this.callToolbar.classList.add('transparent');
this.incomingContainer.classList.add('displayed');
@@ -391,19 +391,20 @@ var OnCallHandler = (function onCallHandler() {
displayed = !displayed;
animating = true;
- CallScreen.screen.classList.remove('animate');
- CallScreen.screen.classList.toggle('prerender');
+ var callScreen = CallScreen.screen;
+ callScreen.classList.remove('animate');
+ callScreen.classList.toggle('prerender');
window.addEventListener('MozAfterPaint', function ch_finishAfterPaint() {
window.removeEventListener('MozAfterPaint', ch_finishAfterPaint);
window.setTimeout(function cs_transitionNextLoop() {
- CallScreen.screen.classList.add('animate');
- CallScreen.screen.classList.toggle('displayed');
- CallScreen.screen.classList.toggle('prerender');
+ callScreen.classList.add('animate');
+ callScreen.classList.toggle('displayed');
+ callScreen.classList.toggle('prerender');
- CallScreen.screen.addEventListener('transitionend', function trWait() {
- CallScreen.screen.removeEventListener('transitionend', trWait);
+ callScreen.addEventListener('transitionend', function trWait() {
+ callScreen.removeEventListener('transitionend', trWait);
animating = false;
View
92 apps/communications/dialer/js/recents.js
@@ -76,6 +76,12 @@ var Recents = {
getElementById('add-contact-action-menu');
},
+ get recentsEditMenu() {
+ delete this.recentsEditMenu;
+ return this.recentsEditMenu = document.
+ getElementById('edit-mode');
+ },
+
get callMenuItem() {
delete this.callMenuItem;
return this.callMenuItem = document.
@@ -100,17 +106,65 @@ var Recents = {
getElementById('cancel-action-menu');
},
- load: function re_load() {
- if (this._loaded)
+ load: function re_load(callback) {
+ if (this._loaded) {
+ if (callback) {
+ callback();
+ }
return;
+ }
this._loaded = true;
- LazyL10n.get(function localized() {
- var headerSelector = '#recents-container h2';
- FixedHeader.init('#recents-container',
- '#fixed-container', headerSelector);
- Recents.init();
+ // Time to load the external css/js
+ var stylesheets = [
+ '/dialer/style/commslog.css',
+ '/dialer/style/fixed_header.css',
+ '/shared/style/headers.css',
+ '/shared/style/switches.css',
+ '/shared/style/edit_mode.css',
+ '/shared/style/action_menu.css'
+ ];
+ stylesheets.forEach(function cssIterator(url) {
+ var link = document.createElement('link');
+ link.rel = 'stylesheet';
+ link.href = url;
+ document.head.appendChild(link);
+ });
+
+ var scripts = [
+ '/dialer/js/fixed_header.js',
+ '/dialer/js/utils.js',
+ '/dialer/js/recents_db.js',
+ ];
+
+ var scriptLoadCount = 0;
+ var scriptLoaded = (function() {
+ scriptLoadCount++;
+
+ // All the scripts are now loaded
+ if (scriptLoadCount === scripts.length) {
+ var headerSelector = '#recents-container h2';
+ FixedHeader.init('#recents-container',
+ '#fixed-container', headerSelector);
+
+
+ this.init();
+ this.recentsView.classList.remove('hidden');
+ this.addContactActionMenu.hidden = false;
+ this.recentsEditMenu.hidden = false;
+
+ if (callback) {
+ callback();
+ }
+ }
+ }).bind(this);
+
+ scripts.forEach(function scriptIterator(url) {
+ var script = document.createElement('script');
+ script.src = url;
+ script.onload = scriptLoaded;
+ document.head.appendChild(script);
});
},
@@ -188,14 +242,13 @@ var Recents = {
// Refresh can be called on an unloaded Recents
refresh: function re_refresh() {
- if (!this._loaded) {
- this.load();
- }
-
- RecentsDBManager.init(function() {
- RecentsDBManager.get(function(recents) {
- LazyL10n.get(function localized() {
- Recents.render(recents);
+ this.load(function loaded() {
+ RecentsDBManager.init(function() {
+ RecentsDBManager.get(function(recents) {
+ // We need l10n to be loaded before rendering
+ LazyL10n.get(function localized() {
+ Recents.render(recents);
+ });
});
});
});
@@ -670,6 +723,11 @@ var Recents = {
},
updateContactDetails: function re_updateContactDetails() {
+ // If we're not loaded yet, nothing to update
+ if (!this._loaded) {
+ return;
+ }
+
var itemSelector = '.log-item:not(.hide)',
callLogItems = document.querySelectorAll(itemSelector);
for (var i = 0; i < callLogItems.length; i++) {
@@ -800,6 +858,10 @@ var Recents = {
},
updateHighlighted: function re_updateHighlighted() {
+ // No need to update if we're not loaded yet
+ if (!this._loaded)
+ return;
+
var itemSelector = '.log-item.highlighted',
items = document.querySelectorAll(itemSelector),
itemsLength = items.length;
View
50 apps/communications/dialer/js/ussd.js
@@ -135,22 +135,49 @@ var UssdManager = {
this.postMessage(message);
},
- openUI: function um_openUI() {
- var urlBase = this._origin + '/dialer/ussd.html';
+ openUI: function um_openUI(ussd) {
+ if (this._popup) {
+ return;
+ }
+
LazyL10n.get((function localized(_) {
this._ = _;
+
+ // The MMI UI might be opened for one of these reasons:
+ // 1. The dialer requested the send of a new MMI/USSD message.
+ // In this case, 'openUI' is called with no parameters.
+ // 2. The platform sent a system message indicating that a new incoming
+ // USSD has being received.
+ var urlBase = '/dialer/ussd.html';
+ if (!ussd) {
+ // The #send hash makes the 'sending' screen appear.
+ urlBase += '#send';
+ }
+
this._popup = window.open(urlBase,
- this._operator ? this._operator : this._('USSD'),
- 'attention');
+ this._operator ? this._operator : this._('USSD'), 'attention');
+
// To control cases where the success or error is received
// even before the new USSD window has been opened and/or
// initialized.
- this._popup.addEventListener('load',
- this.uiReady.bind(this));
+ this._popup.addEventListener('ready', this.uiReady.bind(this));
+
+ if (!ussd) {
+ return;
+ }
+ // The message containing the received USSD won't be delivered until
+ // the UI notifies about its successfull load.
+ var message = {
+ type: 'ussdreceived',
+ message: ussd.message,
+ sessionEnded: ussd.sessionEnded
+ };
+ this.postMessage(message);
}).bind(this));
},
uiReady: function um_uiReady() {
+ this._popup.removeEventListener('ready', this.uiReady);
this._popup.ready = true;
if (this._closedOnVisibilityChange) {
this.notifyLast();
@@ -189,6 +216,10 @@ var UssdManager = {
this._closedOnVisibilityChange = false;
},
+ handleIncomingUssd: function um_handleIncomingUssd(ussd) {
+ this.openUI(ussd);
+ },
+
handleEvent: function um_handleEvent(evt) {
if (!evt.type)
return;
@@ -233,11 +264,6 @@ var UssdManager = {
}
};
-window.addEventListener('load', function us_startup(evt) {
- window.removeEventListener('load', us_startup);
- UssdManager.init();
-});
-
window.addEventListener('mozvisibilitychange',
function us_handleVisibility(ev) {
if (document.mozHidden) {
@@ -250,3 +276,5 @@ window.addEventListener('mozvisibilitychange',
}
}