Skip to content

Commit

Permalink
Merge remote branch 'upstream/master' into sms
Browse files Browse the repository at this point in the history
  • Loading branch information
vingtetun committed Feb 24, 2012
2 parents 0b0ef79 + e201429 commit 5ac59c9
Show file tree
Hide file tree
Showing 244 changed files with 1,003 additions and 1,899 deletions.
2 changes: 1 addition & 1 deletion apps/browser/browser.html
Expand Up @@ -16,7 +16,7 @@
<form id="browser-address">
<input type="url" id="browser-url" value="http://www.google.com/m"></input>
</form>
<span id="browser-tab-button">3</span>
<span id="browser-tab-button">9</span>
<input type="button" value="" id="browser-menu-button" class="browser-button" alt="Menu" title=""></input>
</div>
<iframe id="browser-content" mozbrowser>
Expand Down
1 change: 1 addition & 0 deletions apps/browser/js/browser.js
Expand Up @@ -76,6 +76,7 @@ var Browser = {

this.navigate(url);
urlbar.value = url;
urlbar.blur();
evt.preventDefault();
break;

Expand Down
64 changes: 47 additions & 17 deletions apps/browser/style/browser.css
@@ -1,3 +1,18 @@
@font-face {
font-family: 'Open Sans';
src: url('fonts/Open-Sans.woff');
}
@font-face {
font-family: 'Open Sans';
font-weight: bold;
src: url('fonts/Open-Sans-Bold.woff');
}
@font-face {
font-family: 'Open Sans';
font-weight: 600;
src: url('fonts/Open-Sans-Semibold.woff');
}

html, body {
height: 100%;
padding: 0;
Expand All @@ -11,6 +26,7 @@ body {
width: 100%;
height: 100%;
background-color: #000;
font-family: 'Open Sans';
}

#browser-tab {
Expand Down Expand Up @@ -41,16 +57,18 @@ body {
}

#browser-url {
font-family: 'Open Sans';
-moz-box-flex: 1;
border: solid 3px #9ca1a6;
border-radius: 22px;
height: 44px;
margin: 10px 2px;
padding: 0 0 0 40px;
font-size: 20px;
font-size: 18px;
background-image: url('images/favicon.png');
background-repeat: no-repeat;
background-position: 14px 12px;
font-weight: 600;
}

#browser-url.loading {
Expand All @@ -62,18 +80,22 @@ body {
-moz-apperance: none;
border: none;
display: block;
margin: 10px 0;
width: 44px;
height: 44px;
margin: 0;
padding: 0;
width: 56px;
height: 64px;
}

#browser-back-button {
background-image: url("images/back.png");
}

#browser-back-button:active {
background-image: url("images/back-pressed.png");
}

#browser-menu-button {
background-image: url("images/menu.png");
margin: 10px 4px;
}

input::-moz-focus-inner {
Expand All @@ -82,17 +104,25 @@ input::-moz-focus-inner {

#browser-tab-button {
display: block;
height: 44px;
width: 44px;
padding: 0;
border-radius: 22px;
border: solid 3px #c9cfd5;
margin: 10px 2px 10px 10px;
height: 64px;
width: 54px;
margin: 0;
font-weight: bold;
font-size: 29px;
font-size: 24px;
text-align: center;
font-family: Helvetica, Sans-serif;
color: #555;
padding: 16px 0;
}

#browser-tab-button::after {
display: block;
width: 1px;
content: ' ';
height: 44px;
background-color: rgba(0, 0, 0, 0.1);
position: absolute;
top: 22px;
right: 56px;
}

#browser-back-button[disabled] {
Expand Down Expand Up @@ -169,14 +199,14 @@ input::-moz-focus-inner {

#browser-menu li a {
display: block;
font-family: Helvetica, Sans-serif;
font-size: 20px;
padding: 20px 20px 20px 44px;
font-size: 22px;
padding: 19px 19px 19px 44px;
border-bottom: solid 1px #d0cecf;
text-decoration: none;
color: #4f5357;
background-repeat: no-repeat;
background-position: -15px 0;
background-position: 5px 20px;
font-weight: 600;
}

#menu-refresh a {
Expand Down
Binary file added apps/browser/style/fonts/Open-Sans-Bold.woff
Binary file not shown.
Binary file added apps/browser/style/fonts/Open-Sans-Semibold.woff
Binary file not shown.
Binary file added apps/browser/style/fonts/Open-Sans.woff
Binary file not shown.
Binary file modified apps/browser/style/images/back-disabled.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/browser/style/images/back-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/bookmark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/downloads.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/forward.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/browser/style/images/menu-pressed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/refresh.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/browser/style/images/settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/dialer/dialer.html
Expand Up @@ -8,6 +8,7 @@
<script type="application/javascript" src="../../webapi.js"></script>
<script type="application/javascript" src="js/contacts.js"></script>
<script type="application/javascript" src="js/dialer.js"></script>
<script type="application/javascript" src="js/recents.js"></script>
</head>

<body>
Expand Down
20 changes: 9 additions & 11 deletions apps/dialer/js/contacts.js
Expand Up @@ -54,9 +54,11 @@ var Contacts = {
'</span></div>';
}

content += '<div class="contact" id="' + contact.id + '">' +
' <span class="display-name">' + displayName + '</span>' +
'</div>';
content += '<div class="contact" id="' + contact.id + '">';
for (var key in contact.name) {
content += '<span>' + contact.name[key] + '</span> ';
}
content += '</div>';
}

var contactsContainer = document.getElementById('contacts-container');
Expand Down Expand Up @@ -397,16 +399,15 @@ var ContactDetails = {
render: function cd_render() {
var names = '';
for (var key in this._contact.name) {
names += '<div>' +
' ' + this.inputFragment('text', this._contact.name[key]) +
'</div>';
names += ' ' + this._contact.name[key];
}
document.getElementById('contact-name').innerHTML = names;

var addAttr = 'data-action="add" onclick="ContactDetails.execute(event)"';
var phones = '';
this._contact.phones.forEach(function phoneIterator(phone) {
phones += '<div data-number="' + phone + '">' +
'<span>phone</span>' +
' ' + this.inputFragment('tel', phone) +
'</div>';
}, this);
Expand All @@ -417,7 +418,7 @@ var ContactDetails = {

var emails = '';
this._contact.emails.forEach(function emailIterator(email) {
emails += '<div>' + this.inputFragment('email', email) + '</div>';
emails += '<div><span>email</span>' + this.inputFragment('email', email) + '</div>';
}, this);
emails += '<div ' + addAttr + '>' +
' Add email' +
Expand All @@ -427,10 +428,7 @@ var ContactDetails = {
inputFragment: function cd_inputFragment(type, value, disabled) {
disabled = (typeof disabled == 'undefined') ? true : disabled;

return '<div class="delete-button"' +
' onclick="ContactDetails.remove(this.parentNode)">' +
'</div>' +
'<input type="' + type + '" value="' + value +
return '<input type="' + type + '" value="' + value +
' " data-action="autoscroll"' +
' ' + (disabled ? 'disabled="disabled"' : '') +
' onfocus="ContactDetails.execute(event)" />';
Expand Down
14 changes: 10 additions & 4 deletions apps/dialer/js/dialer.js
Expand Up @@ -244,9 +244,17 @@ var CallHandler = {
this.currentCall.answer();
},
end: function ch_end() {
// XXX: workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=729503
if (this.currentCall && (this.currentCall.state != 'dialing')) {
if (this.currentCall) {
// XXX: workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=729503
var toDisconnect = false;
if (this.currentCall.state == 'dialing')
toDisconnect = true;

this.currentCall.hangUp();

if (toDisconnect) {
this.disconnected();
}
} else {
this.disconnected();
}
Expand Down Expand Up @@ -326,8 +334,6 @@ var CallHandler = {
},

toggleCallScreen: function ch_toggleScreen() {
document.getElementById('tabs').classList.toggle('oncall');
document.getElementById('views').classList.toggle('oncall');
document.getElementById('call-screen').classList.toggle('oncall');
},
toggleMute: function ch_toggleMute() {
Expand Down
43 changes: 43 additions & 0 deletions apps/dialer/js/recents.js
@@ -0,0 +1,43 @@
'use strict';

var Recents = {
get view() {
delete this.view;
return this.view = document.getElementById('recents-view');
},

setup: function re_setup() {
content = '';

this.last.forEach(function recentIterator(recent) {
content += '<div class="recent" data-number="' + recent.number + '"' +
'onclick="CallHandler.call(this.dataset.number)">' +
'<img src="style/fake/photo.png" alt="fake" />' +
'<div class="name">' + recent.name + '</div>' +
'<div class="number">' + recent.number + '</div>' +
'<div class="timestamp">' + recent.timestamp + '</div>' +
'</div>';
});

this.view.innerHTML = content;
},

// XXX: fake content for the demo
last: [
{name: 'Rebecca Mendes', number: '1-555-765-655', timestamp: '2 hours ago'},
{name: 'Herman Meyer', number: '1-543-323-325', timestamp: '4 hours ago'},
{name: 'Jordan Campbell', number: '1-555-765-655', timestamp: '1 day ago'},
{name: 'Simon Hall', number: '1-555-765-655', timestamp: '1 day ago'},
{name: 'Timon Horton', number: '1-555-765-655', timestamp: '2 days ago'},
{name: 'Beau Baird', number: '1-555-765-655', timestamp: '2 days ago'},
{name: 'Ali Chase', number: '1-555-765-643', timestamp: '2 days ago'},
{name: 'Hi Avila', number: '1-555-779-655', timestamp: '3 days ago'},
{name: 'Reuben Dalton', number: '1-533-765-655', timestamp: '4 days ago'},
{name: 'Wang Cote', number: '1-555-765-665', timestamp: '5 days ago'}
]
};

window.addEventListener('load', function recentsSetup(evt) {
window.removeEventListener('load', recentsSetup);
Recents.setup();
});

0 comments on commit 5ac59c9

Please sign in to comment.