Permalink
Browse files

Merge pull request #4911 from vingtetun/merge-nightly

Merge nightly
  • Loading branch information...
2 parents 53ca519 + c42c323 commit 322e73388b6790cd9e98f342150e9493cb623992 @vingtetun vingtetun committed Sep 19, 2012
Showing with 15,705 additions and 2,696 deletions.
  1. +23 −31 apps/browser/index.html
  2. +27 −44 apps/browser/js/authentication_dialog.js
  3. +36 −24 apps/browser/js/browser.js
  4. +13 −7 apps/browser/locales/browser.de.properties
  5. +8 −3 apps/browser/locales/browser.en-US.properties
  6. +4 −3 apps/browser/locales/browser.fr.properties
  7. +7 −1 apps/browser/locales/browser.it.properties
  8. +31 −25 apps/browser/locales/browser.nb-NO.properties
  9. +35 −29 apps/browser/locales/browser.pt-BR.properties
  10. +99 −25 apps/browser/style/browser.css
  11. BIN apps/browser/style/images/header-divider.png
  12. +6 −4 apps/calculator/js/calculator.js
  13. +4 −2 apps/calendar/index.html
  14. +1 −1 apps/calendar/js/app.js
  15. +49 −0 apps/calendar/js/controllers/time.js
  16. +1 −2 apps/calendar/js/templates/day.js
  17. +110 −0 apps/calendar/js/views/day.js
  18. +333 −0 apps/calendar/js/views/day_child.js
  19. +2 −0 apps/calendar/js/views/month.js
  20. +37 −296 apps/calendar/js/views/months_day.js
  21. +54 −7 apps/calendar/js/views/time_header.js
  22. +40 −0 apps/calendar/js/views/time_parent.js
  23. +118 −0 apps/calendar/style/day_views.css
  24. +0 −93 apps/calendar/style/events.css
  25. +3 −28 apps/calendar/style/ui.css
  26. +78 −0 apps/calendar/test/unit/controllers/time_test.js
  27. +531 −0 apps/calendar/test/unit/views/day_child_test.js
  28. +209 −0 apps/calendar/test/unit/views/day_test.js
  29. +31 −387 apps/calendar/test/unit/views/months_day_test.js
  30. +43 −8 apps/calendar/test/unit/views/time_header_test.js
  31. +55 −0 apps/calendar/test/unit/views/time_parent_test.js
  32. +2 −6 apps/clock/index.html
  33. +15 −16 apps/clock/js/alarm.js
  34. +20 −18 apps/clock/locales/clock.ar.properties
  35. +18 −16 apps/clock/locales/clock.de.properties
  36. +15 −13 apps/clock/locales/clock.en-US.properties
  37. +15 −13 apps/clock/locales/clock.fr.properties
  38. +17 −15 apps/clock/locales/clock.it.properties
  39. +19 −17 apps/clock/locales/clock.pt-BR.properties
  40. +1 −0 apps/clock/style/clock.css
  41. +3 −0 apps/communications/contacts/config.json
  42. +3 −3 apps/communications/contacts/fb_import.html
  43. +5 −1 apps/communications/contacts/index.html
  44. +1 −2 apps/communications/contacts/js/contacts.js
  45. +5 −1 apps/communications/contacts/js/contacts_details.js
  46. +33 −3 apps/communications/contacts/js/contacts_list.js
  47. +9 −0 apps/communications/contacts/js/fb/fb_import.js
  48. +38 −0 apps/communications/contacts/js/fb/fb_init.js
  49. +1 −1 apps/communications/contacts/js/fb/fb_oauth.js
  50. +11 −6 apps/communications/contacts/js/fb_extensions.js
  51. +51 −0 apps/communications/contacts/js/utilities/config.js
  52. +10 −9 apps/communications/contacts/locales/contacts.de.properties
  53. +3 −2 apps/communications/contacts/locales/contacts.en-US.properties
  54. +1 −0 apps/communications/contacts/locales/contacts.fr.properties
  55. +4 −4 apps/communications/contacts/style/contacts.css
  56. +2 −1 apps/communications/dialer/js/handled_call.js
  57. +13 −0 apps/communications/dialer/js/keypad.js
  58. +9 −10 apps/communications/dialer/js/recents.js
  59. +2 −18 apps/communications/dialer/js/utils.js
  60. +9 −3 apps/communications/dialer/style/commslog.css
  61. +2 −1 apps/communications/manifest.webapp
  62. +2 −1 apps/costcontrol/manifest.webapp
  63. +68 −23 apps/email/js/ext/gaia-email-opt.js
  64. +190 −0 apps/fm/test/unit/api_test.js
  65. +6 −0 apps/gallery/js/MetadataParser.js
  66. +8 −6 apps/gallery/js/gallery.js
  67. +1 −1 apps/keyboard/js/keyboard.js
  68. +1 −0 apps/pdfjs/manifest.webapp
  69. +19 −7 apps/settings/index.html
  70. +24 −5 apps/settings/js/settings.js
  71. +45 −31 apps/settings/js/wifi.js
  72. +75 −58 apps/settings/locales/settings.ar.properties
  73. +122 −105 apps/settings/locales/settings.ca.properties
  74. +69 −52 apps/settings/locales/settings.de.properties
  75. +128 −111 apps/settings/locales/settings.el.properties
  76. +17 −9 apps/settings/locales/settings.en-US.properties
  77. +73 −56 apps/settings/locales/settings.es.properties
  78. +14 −10 apps/settings/locales/settings.fr.properties
  79. +34 −17 apps/settings/locales/settings.it.properties
  80. +73 −56 apps/settings/locales/settings.nb-NO.properties
  81. +74 −57 apps/settings/locales/settings.pt-BR.properties
  82. +120 −103 apps/settings/locales/settings.ru.properties
  83. +118 −101 apps/settings/locales/settings.tr.properties
  84. +132 −115 apps/settings/locales/settings.zh-TW.properties
  85. BIN apps/settings/style/images/{settings_brightness.png → settings_display.png}
  86. +11 −1 apps/settings/style/lists.css
  87. +1 −1 apps/sms/js/sms.js
  88. +2 −1 apps/sms/manifest.webapp
  89. +6 −3 apps/system/index.html
  90. +4 −2 apps/system/js/lockscreen.js
  91. +116 −0 apps/system/js/operator_variant/operator_variant.js
  92. +3 −5 apps/system/js/statusbar.js
  93. +111 −38 apps/system/js/window_manager.js
  94. +59 −41 apps/system/locales/system.ar.properties
  95. +67 −49 apps/system/locales/system.ca.properties
  96. +38 −20 apps/system/locales/system.de.properties
  97. +67 −49 apps/system/locales/system.el.properties
  98. +9 −7 apps/system/locales/system.en-US.properties
  99. +47 −29 apps/system/locales/system.es.properties
  100. +10 −8 apps/system/locales/system.fr.properties
  101. +30 −12 apps/system/locales/system.it.properties
  102. +51 −33 apps/system/locales/system.nb-NO.properties
  103. +52 −34 apps/system/locales/system.pt-BR.properties
  104. +69 −51 apps/system/locales/system.ru.properties
  105. +68 −50 apps/system/locales/system.tr.properties
  106. +59 −41 apps/system/locales/system.zh-TW.properties
  107. +3 −2 apps/system/manifest.webapp
  108. +11,021 −0 apps/system/serviceproviders.xml
  109. +5 −18 apps/system/style/list_menu/list_menu.css
  110. +24 −1 apps/system/style/system/system.css
  111. +13 −10 build/permissions.js
  112. +7 −1 shared/js/mediadb.js
  113. +0 −2 shared/locales/date/date.en-US.properties
  114. +3 −0 shared/locales/date/date.es.properties
  115. +3 −0 shared/locales/date/date.pt-BR.properties
  116. +3 −0 shared/locales/date/date.zh-TW.properties
  117. +2 −1 showcase_apps/tasks/index.html
  118. +0 −12 showcase_apps/tasks/locale/tasks.ar.properties
  119. +0 −12 showcase_apps/tasks/locale/tasks.pt-BR.properties
  120. +0 −12 showcase_apps/tasks/locale/tasks.ru.properties
  121. +0 −12 showcase_apps/tasks/locale/tasks.zh-TW.properties
  122. +1 −14 showcase_apps/tasks/{locale/l10n.ini → locales/locales.ini}
  123. 0 showcase_apps/tasks/{locale → locales}/tasks.ca.properties
  124. 0 showcase_apps/tasks/{locale → locales}/tasks.de.properties
  125. 0 showcase_apps/tasks/{locale → locales}/tasks.el.properties
  126. 0 showcase_apps/tasks/{locale → locales}/tasks.en-US.properties
  127. 0 showcase_apps/tasks/{locale → locales}/tasks.es.properties
  128. 0 showcase_apps/tasks/{locale → locales}/tasks.fr.properties
  129. 0 showcase_apps/tasks/{locale → locales}/tasks.it.properties
  130. 0 showcase_apps/tasks/{locale → locales}/tasks.tr.properties
  131. +2 −1 test_apps/uitest/manifest.webapp
View
@@ -27,6 +27,9 @@
data-l10n-id="enter-search-or-address" />
<input type="image" id="url-button" value="" />
</form>
+ <span id="tabs-badge"></span>
+ <button id="awesomescreen-cancel-button"></button>
+ <div id="throbber"></div>
</menu>
<div id="frames">
@@ -64,35 +67,6 @@
</div>
<div id="screen">
- <div id="authentication-dialog">
- <div id="authentication-dialog-http-authentication">
- <div class="authentication-dialog-buttons">
- <h3 l10n-id="login-to-site">Log in to site</h3>
- <button id="authentication-dialog-http-authentication-ok" data-l10n-id="ok">OK</button>
- <button id="authentication-dialog-http-authentication-cancel" data-l10n-id="cancel">
- Cancel
- </button>
- </div>
- <div class="authentication-dialog-message-container">
- <div>
- <span id="authentication-dialog-http-authentication-message"></span>
- </div>
- <div>
- <span data-l10n-id="username">Username</span>
- </div>
- <div>
- <input id="authentication-dialog-username-input" />
- </div>
- <div>
- <span data-l10n-id="password">Password</span>
- </div>
- <div>
- <input id="authentication-dialog-password-input" type="password" />
- </div>
- </div>
- </div>
- </div>
-
<div id="modal-dialog">
<div id="modal-dialog-table">
<div id="modal-dialog-tablecell">
@@ -155,12 +129,11 @@ <h3 data-l10n-id="bookmarks">Bookmarks</h3>
<div id="tray">
<menu type="toolbar" id="tray-toolbar">
+ <button type="button" id="new-tab-button"></button>
<button type="button" id="settings-button"></button>
</menu>
<div id="tabs-list"></div>
</div>
- <div id="throbber"></div>
- <div id="tabs-badge"></div>
<section id="bookmark-entry-sheet" role="region" class="hidden skin-dark">
<header>
@@ -181,6 +154,25 @@ <h1 data-l10n-id="edit-bookmark">Edit Bookmark</h1>
<input type="hidden" id="bookmark-previous-url"></input>
</section>
+ <section id="http-authentication-dialog" role="region" class="hidden skin-dark">
+ <header>
+ <button id="http-authentication-cancel">
+ <span class="icon icon-close">close</span>
+ </button>
+ <menu type="toolbar">
+ <button id="http-authentication-ok" data-l10n-id="login">Login</button>
+ </menu>
+ <h1 l10n-id="login-to-a-website">Login to a website</h1>
+ </header>
+ <span id="http-authentication-message"></span>
+ <label data-l10n-id="username">Username
+ <input type="text" id="http-authentication-username" />
+ </label>
+ <label data-l10n-id="password">Password
+ <input id="http-authentication-password" type="password" />
+ </label>
+ </section>
+
<div id="settings">
<header id="settings-header">
<menu type="toolbar">
@@ -4,33 +4,27 @@
'use strict';
var AuthenticationDialog = {
- // Used for element id access.
- // e.g., 'authentication-dialog-alert-ok'
- prefix: 'authentication-dialog-',
-
- // DOM
- elements: {},
_confirmed: {},
// Get all elements when inited.
getAllElements: function ad_getAllElements() {
- var elementsID = ['http-authentication', 'username-input', 'password-input',
- 'http-authentication-message', 'http-authentication-ok',
- 'http-authentication-cancel'];
var toCamelCase = function toCamelCase(str) {
return str.replace(/\-(.)/g, function replacer(str, p1) {
return p1.toUpperCase();
});
};
- elementsID.forEach(function createElementRef(name) {
- this.elements[toCamelCase(name)] =
- document.getElementById(this.prefix + name);
- }, this);
+ var elementIDs = [
+ 'http-authentication-dialog', 'http-authentication-username',
+ 'http-authentication-password', 'http-authentication-message',
+ 'http-authentication-ok', 'http-authentication-cancel'];
- this.screen = document.getElementById('screen');
+ // Loop and add element with camel style name to Modal Dialog attribute.
+ elementIDs.forEach(function createElementRef(name) {
+ this[toCamelCase(name)] = document.getElementById(name);
+ }, this);
},
currentEvents: {},
@@ -42,29 +36,25 @@ var AuthenticationDialog = {
this.boundToWindow = bindToWindow || false;
- for (var id in elements) {
- if (elements[id].tagName.toLowerCase() == 'button') {
- elements[id].addEventListener('click', this);
- }
- }
+ this.httpAuthenticationOk.addEventListener('click', this);
+ this.httpAuthenticationCancel.addEventListener('click', this);
},
// Default event handler
handleEvent: function ad_handleEvent(evt, origin) {
- var elements = this.elements;
switch (evt.type) {
case 'mozbrowserusernameandpasswordrequired':
evt.preventDefault();
this.currentEvents[origin] = evt;
- // Show modal dialog only if
+ // Show authentication dialog only if
// the frame is currently displayed.
this.show(origin);
break;
case 'click':
- if (evt.currentTarget === elements.httpAuthenticationCancel) {
+ if (evt.currentTarget === this.httpAuthenticationCancel) {
this.cancelHandler();
} else {
this.confirmHandler();
@@ -73,72 +63,65 @@ var AuthenticationDialog = {
}
},
- // Show relative dialog and set message/input value well
+ // Show dialog and set message
show: function ad_show(origin) {
this.currentOrigin = origin;
var evt = this.currentEvents[origin];
var message = evt.detail.message;
- var elements = this.elements;
- this.screen.classList.add('authentication-dialog');
- elements.httpAuthentication.classList.add('visible');
+ this.httpAuthenticationDialog.classList.remove('hidden');
var _ = navigator.mozL10n.get;
// XXX: We don't have a better way to detect login failed.
if (this._confirmed[origin]) {
message = _('the-username-or-password-is-incorrect');
- elements.httpAuthenticationMessage.classList.add('error');
+ this.httpAuthenticationMessage.classList.add('error');
} else {
var l10nArgs = { host: evt.detail.host };
message = _('http-authentication-message', l10nArgs);
- elements.httpAuthenticationMessage.classList.remove('error');
+ this.httpAuthenticationMessage.classList.remove('error');
}
- elements.httpAuthenticationMessage.textContent = message;
+ this.httpAuthenticationMessage.textContent = message;
- elements.usernameInput.value = '';
- elements.passwordInput.value = '';
- elements.usernameInput.focus();
+ this.httpAuthenticationUsername.value = '';
+ this.httpAuthenticationPassword.value = '';
+ this.httpAuthenticationUsername.focus();
},
hide: function ad_hide() {
var evt = this.currentEvents[this.currentOrigin];
if (!evt)
return;
- this.elements.httpAuthentication.classList.remove('visible');
+ this.httpAuthenticationDialog.classList.add('hidden');
this.currentOrigin = null;
- this.screen.classList.remove('authentication-dialog');
},
- // When user clicks OK button on alert/confirm/prompt
+ // When user clicks OK button on authentication dialog
confirmHandler: function ad_confirmHandler() {
- var elements = this.elements;
-
var evt = this.currentEvents[this.currentOrigin];
- evt.detail.authenticate(elements.usernameInput.value,
- elements.passwordInput.value);
- elements.httpAuthentication.classList.remove('visible');
+ evt.detail.authenticate(this.httpAuthenticationUsername.value,
+ this.httpAuthenticationPassword.value);
+ this.httpAuthenticationDialog.classList.add('hidden');
// To remember we had ever logged in.
this._confirmed[this.currentOrigin] = true;
delete this.currentEvents[this.currentOrigin];
- this.screen.classList.remove('authentication-dialog');
},
- // When user clicks cancel button on confirm/prompt or
+ // When user clicks cancel button on authentication dialog or
// when the user try to escape the dialog with the escape key
cancelHandler: function ad_cancelHandler() {
var evt = this.currentEvents[this.currentOrigin];
- var elements = this.elements;
evt.detail.cancel();
if (this._confirmed[this.currentOrigin])
delete this._confirmed[this.currentOrigin];
delete this.currentEvents[this.currentOrigin];
- this.screen.classList.remove('authentication-dialog');
+ this.httpAuthenticationDialog.classList.add('hidden');
},
originHasEvent: function(origin) {
View
@@ -28,6 +28,8 @@ var Browser = {
'/start.html',
ABOUT_PAGE_URL: document.location.protocol + '//' + document.location.host +
'/about.html',
+ UPPER_SCROLL_THRESHOLD: 50, // hide address bar
+ LOWER_SCROLL_THRESHOLD: 5, // show address bar
urlButtonMode: null,
inTransition: false,
@@ -64,6 +66,7 @@ var Browser = {
this.historyTab.addEventListener('click', this.showHistoryTab.bind(this));
this.settingsButton.addEventListener('click',
this.showSettingsScreen.bind(this));
+ this.newTabButton.addEventListener('click', this.handleNewTab.bind(this));
this.settingsDoneButton.addEventListener('click',
this.showPageScreen.bind(this));
this.aboutFirefoxButton.addEventListener('click',
@@ -88,6 +91,8 @@ var Browser = {
this.hideBookmarkEntrySheet.bind(this));
this.bookmarkEntrySheetDone.addEventListener('click',
this.saveBookmark.bind(this));
+ this.awesomescreenCancelButton.addEventListener('click',
+ this.handleAwesomescreenCancel.bind(this));
this.tabsSwipeMngr.browser = this;
['mousedown', 'pan', 'tap', 'swipe'].forEach(function(evt) {
@@ -140,7 +145,8 @@ var Browser = {
'bookmark-menu-remove', 'bookmark-menu-cancel', 'bookmark-menu-edit',
'bookmark-entry-sheet', 'bookmark-entry-sheet-cancel',
'bookmark-entry-sheet-done', 'bookmark-title', 'bookmark-url',
- 'bookmark-previous-url', 'bookmark-menu-add-home'];
+ 'bookmark-previous-url', 'bookmark-menu-add-home', 'new-tab-button',
+ 'awesomescreen-cancel-button'];
// Loop and add element with camel style name to Modal Dialog attribute.
elementIDs.forEach(function createElementRef(name) {
@@ -187,27 +193,27 @@ var Browser = {
// Tabs badge is the button at the top right, used to show the number of tabs
// and to create new ones
handleTabsBadgeClicked: function browser_handleTabsBadgeClicked(e) {
- if (this.inTransition) {
- return;
- }
- if (this.currentScreen === this.TABS_SCREEN) {
- this.inTransition = true;
- var tabId = this.createTab();
- this.showNewTabAnimation((function browser_showNewTabAnimation() {
- this.selectTab(tabId);
- this.showAwesomeScreen();
- }).bind(this));
+ if (this.inTransition)
return;
- }
- if (this.currentScreen === this.AWESOME_SCREEN &&
- this.previousScreen === this.PAGE_SCREEN) {
+ this.showTabScreen();
+ },
+
+ handleAwesomescreenCancel: function browser_handleAwesomescreenCancel(e) {
+ if (this.previousScreen === this.PAGE_SCREEN) {
this.showPageScreen();
- return;
- }
- if (this.currentScreen === this.AWESOME_SCREEN) {
+ } else {
this.deleteTab(this.currentTab.id);
+ this.showTabScreen();
}
- this.showTabScreen();
+ },
+
+ handleNewTab: function browserHandleNewTab(e) {
+ this.inTransition = true;
+ var tabId = this.createTab();
+ this.showNewTabAnimation((function browser_showNewTabAnimation() {
+ this.selectTab(tabId);
+ this.showAwesomeScreen();
+ }).bind(this));
},
// Each browser gets their own listener
@@ -222,6 +228,8 @@ var Browser = {
if (!tab.url || tab.crashed) {
return;
}
+ // If address bar is hidden then show it
+ this.mainScreen.classList.remove('address-hidden');
tab.loading = true;
if (isCurrentTab && this.currentScreen === this.PAGE_SCREEN) {
this.throbber.classList.add('loading');
@@ -356,6 +364,14 @@ var Browser = {
this.handleCrashedTab(tab);
}
break;
+
+ case 'mozbrowserscroll':
+ if (evt.detail.top < this.LOWER_SCROLL_THRESHOLD) {
+ this.mainScreen.classList.remove('address-hidden');
+ } else if (evt.detail.top > this.UPPER_SCROLL_THRESHOLD) {
+ this.mainScreen.classList.add('address-hidden');
+ }
+ break;
}
}).bind(this);
},
@@ -536,9 +552,7 @@ var Browser = {
},
showBookmarkMenu: function browser_showBookmarkMenu() {
- // Hack until tabsBadge refactored in #1222
this.bookmarkMenu.classList.remove('hidden');
- this.tabsBadge.style.display = 'none';
if (!this.currentTab.url)
return;
Places.getBookmark(this.currentTab.url, (function(bookmark) {
@@ -555,8 +569,6 @@ var Browser = {
},
hideBookmarkMenu: function browser_hideBookmarkMenu() {
- // Hack until tabsBadge refactored in #1222
- this.tabsBadge.style.display = 'block';
this.bookmarkMenu.classList.add('hidden');
},
@@ -1011,7 +1023,7 @@ var Browser = {
var browserEvents = ['loadstart', 'loadend', 'locationchange',
'titlechange', 'iconchange', 'contextmenu',
'securitychange', 'openwindow', 'close',
- 'showmodalprompt', 'error',
+ 'showmodalprompt', 'error', 'scroll',
'usernameandpasswordrequired'];
browserEvents.forEach(function attachBrowserEvent(type) {
iframe.addEventListener('mozbrowser' + type,
@@ -1244,7 +1256,7 @@ var Browser = {
TRANSITION_SPEED: 1.8,
TRANSITION_FRACTION: 0.75,
- DEFAULT_TRANSITION: '0.2s ease-in-out',
+ DEFAULT_TRANSITION: 'transform 0.2s ease-in-out, height 0.2s ease-in-out',
gestureDetector: null,
browser: null,
Oops, something went wrong.

0 comments on commit 322e733

Please sign in to comment.