Permalink
Browse files

Merge pull request #7315 from dscravag/nightly2

Nightly 2013-01-07
  • Loading branch information...
dscravag committed Jan 7, 2013
2 parents b506bdb + efa7bc1 commit e24d0662013b3ec7e7bbd58bd7e7eece60276f80
Showing with 244 additions and 484 deletions.
  1. +0 −17 apps/browser/default_data/init.json
  2. BIN apps/browser/default_data/servicos_e_downloads.png
  3. BIN apps/browser/default_data/site_vivo.jpg
  4. BIN apps/browser/default_data/vivo_busca.png
  5. +1 −1 apps/browser/js/browser.js
  6. +1 −2 apps/communications/contacts/index.html
  7. +11 −12 apps/communications/contacts/js/contacts.js
  8. +1 −1 apps/communications/contacts/js/contacts_details.js
  9. +53 −91 apps/communications/contacts/js/value_selector.js
  10. +3 −6 apps/communications/contacts/oauth2/dialogs_end.html
  11. +1 −3 apps/communications/contacts/oauth2/flow.html
  12. +4 −0 apps/communications/contacts/oauth2/js/dialogs_end_init.js
  13. +3 −0 apps/communications/contacts/oauth2/js/flow_init.js
  14. +8 −0 apps/communications/contacts/style/contacts.css
  15. +0 −119 apps/communications/contacts/style/custom_dialog.css
  16. +0 −155 apps/communications/contacts/style/value_selector.css
  17. +17 −0 apps/communications/contacts/test/unit/contact_details_test.js
  18. +2 −2 apps/communications/dialer/js/dialer.js
  19. +3 −1 apps/communications/ftu/js/sim_manager.js
  20. +1 −1 apps/homescreen/index.html
  21. +5 −1 apps/homescreen/js/homescreen.js
  22. +5 −0 apps/homescreen/style/grid.css
  23. +7 −5 apps/system/js/notifications.js
  24. +3 −1 apps/system/js/update_manager.js
  25. +2 −1 apps/system/style/notifications/notifications.css
  26. +3 −1 apps/system/test/unit/app_install_manager_test.js
  27. +2 −1 apps/system/test/unit/mock_app.js
  28. +8 −8 apps/system/test/unit/mock_apps_mgmt.js
  29. +5 −0 apps/system/test/unit/mock_manifest_helper.js
  30. +24 −48 apps/system/test/unit/updatable_test.js
  31. +9 −7 apps/system/test/unit/update_manager_test.js
  32. +23 −0 build/applications-data.js
  33. +39 −0 build/ua-override-prefs.js
@@ -1,17 +0,0 @@
-{
- "bookmarks": [
- { "title": "Vivo Busca",
- "uri": "http://www.google.com.br/m/search?client=ms-hms-tef-br",
- "iconUri": "/default_data/vivo_busca.png"
- },
- { "title": "Serviços e Downloads",
- "uri": "http://vds.vivo.com.br",
- "iconUri": "/default_data/servicos_e_downloads.png"
- },
- {
- "title": "Site Vivo",
- "uri": "http://www.vivo.com.br/conteudosmartphone",
- "iconUri": "/default_data/site_vivo.jpg"
- }
- ]
-}
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -180,7 +180,7 @@ var Browser = {
console.log('Populating default data.');
// Fetch default data
var xhr = new XMLHttpRequest();
- xhr.open('GET', '/default_data/init.json', true);
+ xhr.open('GET', '/js/init.json', true);
xhr.addEventListener('load', (function browser_defaultDataListener() {
if (!(xhr.status === 200 | xhr.status === 0))
return;
@@ -77,7 +77,6 @@
<script defer src="/contacts/js/fb/fb_link.js"></script>
<script defer src="/contacts/js/fb/fb_messaging.js"></script>
<script defer type="text/javascript" src="/contacts/js/value_selector.js"></script>
- <link rel="stylesheet" type="text/css" href="/contacts/style/value_selector.css">
</head>
<body role="application" class="hide app-contacts">
@@ -243,7 +242,7 @@ <h2 data-l10n-id="social-network" id="social-label">Social Network</h2>
<h2>#type#</h2>
<div class="item">
<div class="item-body-exp">
- <a href="javascript: void(0);" class="action action-block">
+ <a href="#" class="action action-block">
<span role="button" class="icon-address" data-l10n-id="legendAddress">Address</span>
<b>
<span>#streetAddress#</span>
@@ -1,4 +1,4 @@
-'use strict';
+'use strict';
var _ = navigator.mozL10n.get;
var TAG_OPTIONS;
@@ -247,21 +247,20 @@ var Contacts = (function() {
break;
default:
// if more than one required type of data
- var prompt1 = new ValueSelector(selectDataStr);
+ var prompt1 = new ValueSelector();
for (var i = 0; i < dataSet.length; i++) {
var data = dataSet[i].value,
carrier = dataSet[i].carrier || '';
- prompt1.addToList(data + ' ' + carrier, function(itemData) {
- return function() {
- prompt1.hide();
- result[type] = itemData;
- ActivityHandler.postPickSuccess(result);
- }
- }(data));
-
+ prompt1.addToList(data + ' ' + carrier);
}
+
+ prompt1.onchange = function onchange(itemData) {
+ prompt1.hide();
+ result[type] = itemData;
+ ActivityHandler.postPickSuccess(result);
+ };
prompt1.show();
- }
+ } // switch
};
var contactListClickHandler = function originalHandler(id) {
@@ -632,7 +631,7 @@ var Contacts = (function() {
var getFirstContacts = function c_getFirstContacts() {
var onerror = function() {
console.error('Error getting first contacts');
- }
+ };
contacts.List.getAllContacts(onerror, function(contacts) {
firstContacts = contacts;
if (readyToPaint) {
@@ -339,7 +339,7 @@ contacts.Details = (function() {
var telField = {
value: utils.text.escapeHTML(currentTel.value, true) || '',
type: escapedType || TAG_OPTIONS['phone-type'][0].value,
- carrier: utils.text.escapeHTML(currentTel.carrier, true) || '',
+ carrier: utils.text.escapeHTML(currentTel.carrier || '', true) || '',
i: tel
};
var template = utils.templates.render(phonesTemplate, telField);
@@ -1,140 +1,102 @@
/*
How to:
- var prompt1 = new ValueSelector('Dummy title 1', [
+ var prompt1 = new ValueSelector([
{
label: 'Dummy element',
- callback: function() {
- alert('Define an action here!');
- }
}
]);
- prompt1.addToList('Another button', function(){alert('Another action');});
+ prompt1.addToList('Another button');
+ prompt1.onchange = function() {alert('Another action');}
prompt1.show();
*/
-function ValueSelector(title, list) {
- var init, show, hide, render, setTitle, emptyList, addToList,
- data, el;
+function ValueSelector(list) {
+ var data, el, select;
+ var self = this;
- init = function() {
- var strPopup, body, section, btnCancel;
+ function init() {
+ var strPopup, body, section;
// Model. By having dummy data in the model,
// it make it easier for othe developers to catch up to speed
data = {
- title: 'No Title',
list: [
{
- label: 'Dummy element',
- callback: function() {
- alert('Define an action here!');
- }
+ label: 'Dummy element'
}
]
};
body = document.body;
+ el = body.querySelector('section.valueselector');
+ if (el === null) {
+ el = document.createElement('section');
+ el.className = 'valueselector';
+ strPopup = '<form>';
+ strPopup += ' <select name="selector_name">';
+ strPopup += ' <option>Dummy element</option>';
+ strPopup += ' </select>';
+ strPopup += '</form>';
+
+ el.innerHTML += strPopup;
+ body.appendChild(el);
+ }
- el = document.createElement('section');
- el.setAttribute('class', 'valueselector');
- el.setAttribute('role', 'region');
-
- strPopup = '<div role="dialog">';
- strPopup += ' <div class="center">';
- strPopup += ' <h3>No Title</h3>';
- strPopup += ' <ul>';
- strPopup += ' <li>';
- strPopup += ' <label>';
- strPopup += ' <input type="radio" name="option">';
- strPopup += ' <span>Dummy element</span>';
- strPopup += ' </label>';
- strPopup += ' </li>';
- strPopup += ' </ul>';
- strPopup += ' </div>';
- strPopup += ' <menu>';
- strPopup += ' <button>' + _('cancel') + '</button>';
- strPopup += ' </menu>';
- strPopup += '</div>';
-
- el.innerHTML += strPopup;
- body.appendChild(el);
-
- btnCancel = el.querySelector('button');
- btnCancel.addEventListener('click', function() {
- hide();
+ select = el.querySelector('select');
+ select.addEventListener('change', function() {
+ if (typeof self.onchange === 'function') {
+ window.setTimeout(function handle_onchange() {
+ // Wait a few milisecs to give feedback to the user
+ self.onchange(select.value);
+ }, 200);
+ }
});
// Empty dummy data
emptyList();
- // Apply optional actions while initializing
- if (typeof title === 'string') {
- setTitle(title);
- }
-
if (Array.isArray(list)) {
data.list = list;
}
}
- show = function() {
+ this.show = function() {
render();
+
el.classList.add('visible');
- }
- hide = function() {
+ // And now focus it to force the system to pop up the options
+ select.focus();
+ };
+
+ this.hide = function() {
+ // Avoid consuming resources
el.classList.remove('visible');
- }
+ };
- render = function() {
- var title = el.querySelector('h3'),
- list = el.querySelector('ul');
-
- title.innerHTML = data.title;
-
- list.innerHTML = '';
- for (var i = 0; i < data.list.length; i++) {
- var li = document.createElement('li'),
- label = document.createElement('label'),
- input = document.createElement('input'),
- span = document.createElement('span'),
- text = document.createTextNode(data.list[i].label);
-
- span.appendChild(text);
- span.addEventListener('click', data.list[i].callback, false);
- input.setAttribute('type', 'radio');
- input.setAttribute('name', 'option');
- label.appendChild(input);
- label.appendChild(span);
- li.appendChild(label);
- list.appendChild(li);
- }
- }
+ function render() {
+ select.innerHTML = '';
+ select.value = '';
+ var totalOptions = data.list.length;
- setTitle = function(str) {
- data.title = str;
+ select.setAttribute('size', totalOptions);
+
+ for (var i = 0; i < totalOptions; i++) {
+ var option = new Option(data.list[i].label, data.list[i].label);
+ select.add(option);
+ }
}
- emptyList = function() {
+ function emptyList() {
data.list = [];
}
- addToList = function(label, callback) {
+ this.addToList = function(label) {
data.list.push({
- label: label,
- callback: callback
+ label: label
});
- }
+ };
init();
-
- return{
- init: init,
- show: show,
- hide: hide,
- setTitle: setTitle,
- addToList: addToList,
- List: list
- };
}
@@ -13,13 +13,10 @@
<html>
<head>
<meta charset="UTF-8">
- <script src="oauth2/js/parameters.js"></script>
+ <script src="js/parameters.js"></script>
+ <script src="js/dialogs_end_init.js"></script>
</head>
<body>
- <script>
- window.opener.postMessage('closed',
- fb.oauthflow.params['contactsAppOrigin']);
- window.close();
- </script>
+ </body>
</html>
@@ -16,8 +16,6 @@
<body>
<script src="js/flow.js"></script>
<script src="js/parameters.js"></script>
- <script>
- fb.oauthflow.init();
- </script>
+ <script src="js/flow_init.js"></script>
</body>
</html>
@@ -0,0 +1,4 @@
+'use strict';
+
+window.opener.postMessage('closed', fb.oauthflow.params['contactsAppOrigin']);
+window.close();
@@ -0,0 +1,3 @@
+'use strict';
+
+fb.oauthflow.init();
@@ -473,3 +473,11 @@ section[role="region"] > header .icon.icon-settings
.remark {
color: #d20000;
}
+
+.valueselector {
+ position: fixed;
+ top: -100%;
+ left: -100%;
+ opacity: 0;
+}
+
Oops, something went wrong.

0 comments on commit e24d066

Please sign in to comment.