Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
60
gaia/apps/communications/dialer/js/add_contact_menu.js
Executable file
60
gaia/apps/communications/dialer/js/add_contact_menu.js
Executable file
|
|
@ -0,0 +1,60 @@
|
|||
'use strict';
|
||||
|
||||
/* exported AddContactMenu */
|
||||
|
||||
/* globals LazyLoader, MozActivity, OptionMenu */
|
||||
|
||||
var AddContactMenu = (function() {
|
||||
|
||||
var _createNewContact = function(phoneNumber) {
|
||||
launchActivity('new', phoneNumber);
|
||||
};
|
||||
|
||||
var _addToExistingContact = function(phoneNumber) {
|
||||
launchActivity('update', phoneNumber);
|
||||
};
|
||||
|
||||
var launchActivity = function(name, phoneNumber) {
|
||||
try {
|
||||
/* jshint nonew: false */
|
||||
new MozActivity({
|
||||
name: name,
|
||||
data: {
|
||||
type: 'webcontacts/contact',
|
||||
params: {
|
||||
'tel': phoneNumber
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Error while creating activity');
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
show: function(phoneNumber) {
|
||||
var params = {
|
||||
items: [{
|
||||
l10nId: 'createNewContact',
|
||||
method: _createNewContact,
|
||||
params: [phoneNumber]
|
||||
},{
|
||||
l10nId: 'addToExistingContact',
|
||||
method: _addToExistingContact,
|
||||
params: [phoneNumber]
|
||||
},{ // Last item is the Cancel button
|
||||
l10nId: 'cancel',
|
||||
incomplete: true
|
||||
}],
|
||||
header: phoneNumber
|
||||
};
|
||||
|
||||
LazyLoader.load(['/shared/js/option_menu.js',
|
||||
'/shared/style/action_menu.css'], function() {
|
||||
/* jshint nonew: false */
|
||||
new OptionMenu(params).show();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}());
|
||||
Loading…
Reference in a new issue