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
627 changed files with 9982925 additions and 369 deletions
42
gaia/apps/communications/build/build.js
Executable file
42
gaia/apps/communications/build/build.js
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
'use strict';
|
||||
|
||||
/* jshint node: true */
|
||||
|
||||
var utils = require('utils');
|
||||
var importBuild = require('import-config.js');
|
||||
var DEBUG = false;
|
||||
|
||||
var CommAppBuilder = function() {
|
||||
};
|
||||
|
||||
// Set destination directory and application directory
|
||||
CommAppBuilder.prototype.setOptions = function(options) {
|
||||
this.stageDir = utils.getFile(options.STAGE_APP_DIR);
|
||||
this.appDir = utils.getFile(options.APP_DIR);
|
||||
this.gaia = utils.gaia.getInstance(options);
|
||||
this.gaia.stageDir = this.stageDir;
|
||||
this.gaia.gaiaDir = options.GAIA_DIR;
|
||||
this.webapp = options.webapp;
|
||||
};
|
||||
|
||||
CommAppBuilder.prototype.generateManifest = function() {
|
||||
var manifestObject = importBuild.generateManifest(this.webapp, this.gaia);
|
||||
var file = utils.getFile(this.stageDir.path, 'manifest.webapp');
|
||||
var args = DEBUG ? [manifestObject, undefined, 2] : [manifestObject];
|
||||
utils.writeContent(file, JSON.stringify.apply(JSON, args));
|
||||
};
|
||||
|
||||
CommAppBuilder.prototype.generateAll = function() {
|
||||
this.generateManifest();
|
||||
importBuild.generateConfig('communications', 'contacts', this.gaia);
|
||||
};
|
||||
|
||||
CommAppBuilder.prototype.execute = function(options) {
|
||||
this.setOptions(options);
|
||||
this.generateAll();
|
||||
};
|
||||
|
||||
exports.execute = function(options) {
|
||||
utils.copyToStage(options);
|
||||
(new CommAppBuilder()).execute(options);
|
||||
};
|
||||
13
gaia/apps/communications/contacts/elements/confirm.html
Executable file
13
gaia/apps/communications/contacts/elements/confirm.html
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
<element name="confirmation-message" extends="form">
|
||||
<template>
|
||||
<section>
|
||||
<h1>Confirmation title</h1>
|
||||
<p>Confirmation message</p>
|
||||
</section>
|
||||
<menu>
|
||||
<button>Action 1</button>
|
||||
<button>Action 2</button>
|
||||
</menu>
|
||||
</template>
|
||||
</element>
|
||||
|
||||
98
gaia/apps/communications/contacts/elements/details.html
Executable file
98
gaia/apps/communications/contacts/elements/details.html
Executable file
|
|
@ -0,0 +1,98 @@
|
|||
<element name="view-contact-details" extends="section">
|
||||
<template>
|
||||
<gaia-header id='details-view-header' action="back">
|
||||
<h1 id='contact-name-title'><bdi class="ellipsis-dir-fix"></bdi></h1>
|
||||
<div class='favorite-indicator'></div>
|
||||
<button id="edit-contact-button" data-icon="edit-contact" data-l10n-id="editButton"></button>
|
||||
</gaia-header>
|
||||
|
||||
<article id="contact-detail-wrapper" class="view-body">
|
||||
<div id="cover-img"></div>
|
||||
<section id="contact-detail" class="view-body-inner">
|
||||
<li data-phone id='phone-details-template-#i#' data-template role="region" aria-label="Phone" data-l10n-id="phoneDetail">
|
||||
<h2>
|
||||
<span data-l10n-id="#type_l10n_id#">#type#</span>
|
||||
<span class="carrier-wrapper" hidden>
|
||||
<span data-l10n-id="separator"></span>
|
||||
<span class="carrier">#carrier#</span>
|
||||
</span>
|
||||
</h2>
|
||||
<div class="item">
|
||||
<div class="item-body-exp">
|
||||
<div class="button activity call-action icon icon-call" id="call-or-pick-#i#">
|
||||
<b aria-label="Call" data-l10n-id="makeCall"><bdi class="ellipsis-dir-fix">#value#</bdi></b>
|
||||
<span class="js-sim-indication"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-media pull-right">
|
||||
<button id="send-sms-button-#i#" class="activity send-sms icon icon-message" data-l10n-id="send-sms-button" aria-label="SMS"></button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li data-social class="social-actions" id="social-template-#i#" data-template role="region">
|
||||
<h2 data-l10n-id="social-network" id="social-label">Social Network</h2>
|
||||
<button id="share_button" data-l10n-id="share-contact" class="activity icon icon-share">
|
||||
Share
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li class="duplicate-actions" id="duplicate-contacts-template" data-template role="region">
|
||||
<h2 data-l10n-id="organise-contacts">Organize Contacts</h2>
|
||||
<button id="find-merge-button" data-l10n-id="find-merge-contacts" class="activity icon icon-find-and-merge">
|
||||
Find duplicate contacts
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li data-address id='address-details-template-#i#' data-template role="region" aria-label="Address" data-l10n-id="addressDetail">
|
||||
<h2 data-l10n-id="#type_l10n_id#">#type#</h2>
|
||||
<div class="item">
|
||||
<div class="item-body-exp">
|
||||
<a href="#" class="action action-block">
|
||||
<b>
|
||||
<span class="force-align" dir="auto">#streetAddress#</span>
|
||||
#postalCode#
|
||||
#locality#
|
||||
#countryName#
|
||||
</b>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li data-mail id='email-details-template-#i#' data-template role="region" aria-label="Email" data-l10n-id="emailDetail">
|
||||
<h2 data-l10n-id="#type_l10n_id#"></h2>
|
||||
<div class="item">
|
||||
<div class="item-body-exp">
|
||||
<button id="email-or-pick-#i#" class="activity icon icon-email">
|
||||
<b aria-label="Email" data-l10n-id="composeEmail" dir="ltr">#value#</b>
|
||||
</button>
|
||||
</div>
|
||||
<div class="item-media pull-right">
|
||||
<button id="send-sms-to-email-button-#i#" class="activity send-sms icon icon-message" data-l10n-id="send-sms-button" aria-label="SMS"></button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li id="dates-template-#i#" data-template role="region" aria-label="Date" data-l10n-id="dateDetail">
|
||||
<h2 data-l10n-id="#type_l10n_id#">#type#</h2>
|
||||
<p><strong>#date#</strong></p>
|
||||
</li>
|
||||
|
||||
<p data-comment id='note-details-template-#i#' data-template class="comment-notes">#note#</p>
|
||||
<div id='contact-detail-inner'>
|
||||
<h1 id='org-title' class="force-align" dir="auto"></h1>
|
||||
<ul id='details-list' role="presentation">
|
||||
</ul>
|
||||
<ul role="presentation">
|
||||
<li role="presentation">
|
||||
<button id='toggle-favorite' class="fillflow-row icon icon-fav">
|
||||
Add as favorite
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
</template>
|
||||
</element>
|
||||
18
gaia/apps/communications/contacts/elements/email_details.html
Executable file
18
gaia/apps/communications/contacts/elements/email_details.html
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
<!-- bug 1060080: taken from details.html, should be unified -->
|
||||
<element name="email-details" extends="section">
|
||||
<template>
|
||||
<li data-mail id='email-details-template-#i#' data-template role="region" aria-label="Email" data-l10n-id="emailDetail">
|
||||
<h2 data-l10n-id="#type_l10n_id#">#type#</h2>
|
||||
<div class="item">
|
||||
<div class="item-body-exp">
|
||||
<button id="email-or-pick-#i#" class="activity icon icon-email">
|
||||
<b aria-label="Email" data-l10n-id="composeEmail" dir="ltr">#value#</b>
|
||||
</button>
|
||||
</div>
|
||||
<div class="item-media pull-right">
|
||||
<button id="send-sms-to-email-button-#i#" class="activity send-sms icon icon-message" data-l10n-id="send-sms-button" aria-label="SMS"></button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</element>
|
||||
212
gaia/apps/communications/contacts/elements/form.html
Executable file
212
gaia/apps/communications/contacts/elements/form.html
Executable file
|
|
@ -0,0 +1,212 @@
|
|||
<element name="view-contact-form" extends="section">
|
||||
<template>
|
||||
<gaia-header id="contact-form-header" action="close">
|
||||
<h1 id='contact-form-title' data-l10n-id="addContact"></h1>
|
||||
<button id="save-button" data-l10n-id="done">Done</button>
|
||||
</gaia-header>
|
||||
<progress id="throbber" value="0" max="100" class="pack-activity hide"></progress>
|
||||
|
||||
<div id='add-phone-#i#' role="listitem" data-template class='phone-template field-template' data-index="#i#">
|
||||
<fieldset class="fillflow-row">
|
||||
<div class="two_fields first-row">
|
||||
<legend class="action" role="combobox" aria-haspopup="true" aria-labelledby="tel_type_#i#">
|
||||
<span aria-hidden="true" data-taglist="phone-type" name="tel" data-value="#type_value#"
|
||||
id="tel_type_#i#" data-field="type" data-l10n-id="#type_l10n_id#">
|
||||
#type#
|
||||
</span>
|
||||
</legend>
|
||||
<p class="setbox-item">
|
||||
<input placeholder="Carrier" data-field="carrier" data-l10n-id="carrier" name="tel[#i#][carrier]" class="textfield" type="text" x-inputmode="latin-prose" value="#carrier#" id="carrier_#i#" dir="auto">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
</div>
|
||||
<section class="second-row">
|
||||
<p class="setbox-item">
|
||||
<bdi>
|
||||
<input placeholder="Phone" data-field="value" data-l10n-id="tel" name="tel[#i#][value]" class="textfield" type="tel" value="#value#" id="number_#i#">
|
||||
<button type="reset">Clear</button>
|
||||
</bdi>
|
||||
</p>
|
||||
</section>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id='add-email-#i#' role="listitem" data-template class='email-template field-template' data-index="#i#">
|
||||
<fieldset class="fillflow-row">
|
||||
<legend class="action first-row" role="combobox" aria-haspopup="true" aria-labelledby="email_type_#i#">
|
||||
<span aria-hidden="true" data-taglist="email-type" name="email[#i#][type]" data-value="#type_value#" id="email_type_#i#" data-field="type" data-l10n-id="#type_l10n_id#">#type#</span>
|
||||
</legend>
|
||||
<section>
|
||||
<p class="setbox-item second-row">
|
||||
<input placeholder="Email" data-field="value" data-l10n-id="email" name="email[#i#][value]" class="textfield" type="email" value="#value#" id="email_#i#">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
</section>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id='add-address-#i#' role="listitem" data-template class='address-template field-template' data-index="#i#">
|
||||
<fieldset class="fillflow-row">
|
||||
<section>
|
||||
<p class="setbox-item first-row">
|
||||
<input placeholder="Street" data-field="streetAddress" data-l10n-id="streetAddress" name="adr[#i#][streetAddress]" class="textfield" type="text" x-inputmode="latin-prose" value="#streetAddress#" id="streetAddress_#i#" dir="auto">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
<div class="two_fields second-row">
|
||||
<legend class="action" role="combobox" aria-haspopup="true" aria-labelledby="address_type_#i#">
|
||||
<span aria-hidden="true" data-taglist="address-type" name="adr[#i#][type]" data-value="#type_value#" id="address_type_#i#" data-field="type" data-l10n-id="#type_l10n_id#">#type#</span>
|
||||
</legend>
|
||||
<p class="setbox-item">
|
||||
<input placeholder="City" data-field="locality" data-l10n-id="locality" name="adr[#i#][locality]" class="textfield" type="text" x-inputmode="latin-prose" value="#locality#" id="locality_#i#" dir="auto">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
</div>
|
||||
<div class="two_fields third-row">
|
||||
<p class="setbox-item">
|
||||
<input placeholder="Country" data-field="countryName" data-l10n-id="countryName" name="adr[#i#][countryName]" class="textfield" type="text" x-inputmode="latin-prose" value="#countryName#" id="countryName_#i#" dir="auto">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
<p class="setbox-item">
|
||||
<input placeholder="Zip Code" data-field="postalCode" data-l10n-id="postalCode" name="adr[#i#][postalCode]" class="textfield" type="text" x-inputmode="verbatim" value="#postalCode#" id="postalCode_#i#" dir="auto">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id='add-date-#i#' role="listitem" data-template class='date-template field-template' data-exclusive="true" data-custom="false" data-index="#i#">
|
||||
<fieldset class="fillflow-row first-row">
|
||||
<div class="two_fields">
|
||||
<legend class="action" role="combobox" aria-haspopup="true" aria-labelledby="date_type_#i#">
|
||||
<span aria-hidden="true" data-taglist="date-type" name="date[#i#][type]" data-value="#type_value#" id="date_type_#i#" data-field="type" data-l10n-id="#type_l10n_id#">#type#</span>
|
||||
</legend>
|
||||
<section>
|
||||
<p class="setbox-item">
|
||||
<span aria-hidden="true" id="date-text_#i#" class="datetime placeholder">
|
||||
Date
|
||||
</span>
|
||||
<input placeholder="date" data-field="#type#" data-l10n-id="date" name="date[#i#][value]" type="date" id="date_#i#" aria-labelledby="date-text_#i#">
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id='add-note-#i#' role="listitem" data-template class='note-template field-template' data-index="#i#">
|
||||
<dl role="presentation" class="setbox fillflow-row first-row">
|
||||
<dd class="setbox-body">
|
||||
<p class="setbox-item">
|
||||
<textarea placeholder="Comment" data-field="note"
|
||||
data-l10n-id="comment" name="comment[#i#]" class="textfield"
|
||||
type="text" x-inputmode="latin-prose" id="note_#i#">
|
||||
#note#
|
||||
</textarea>
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
||||
<article class="view-body">
|
||||
<div class="view-body-inner">
|
||||
<form id="contact-form" action="#" class="fill-flow">
|
||||
<input name="id" id="contact-form-id" type="hidden" value="">
|
||||
<section class="item first">
|
||||
<div id="thumbnail-action" href="#" class="item-media fillflow-media">
|
||||
<div role="button" id="photo-button" class="bb-button">
|
||||
<p>
|
||||
<span class="icon icon-addimage"></span>
|
||||
<em data-l10n-id="addPhoto">Add photo</em>
|
||||
</p>
|
||||
<p class="edit-photo">
|
||||
<em data-l10n-id="edit-picture">Edit Picture</em>
|
||||
</p>
|
||||
<img id="thumbnail-photo" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-body-exp with-overflow">
|
||||
<p class="fillflow-row input-container">
|
||||
<input placeholder="Name" data-field="givenName" data-l10n-id="givenName" name="givenName" class="textfield" type="text" x-inputmode="latin-prose" value="" id="givenName" dir="auto" autocorrect="off" autocapitalize="on" spellcheck="false" x-inputmode="verbatim">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
<p class="fillflow-row input-container">
|
||||
<input placeholder="Last name" data-field="familyName" data-l10n-id="familyName" name="familyName" class="textfield" type="text" x-inputmode="latin-prose" value="" id="familyName" dir="auto" autocorrect="off" autocapitalize="on" spellcheck="false" x-inputmode="verbatim">
|
||||
<button type="reset">Clear</button>
|
||||
</p>
|
||||
</div>
|
||||
<div class="with-overflow">
|
||||
<p class="fillflow-row">
|
||||
<input placeholder="Company Name" data-field="org" data-l10n-id="org" name="org" class="textfield" type="text" x-inputmode="verbatim" value="" id="org" dir="auto">
|
||||
<button type="reset" id="clear-org">Clear</button>
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<ul role="presentation">
|
||||
<li role="region" aria-label="Phones" data-l10n-id="phones">
|
||||
<section>
|
||||
<div id="contacts-form-phones" role="list"></div>
|
||||
</section>
|
||||
<button data-field-type="tel" id='add-new-phone' data-l10n-id="addPhone" class="fillflow-row action action-add icon icon-add">
|
||||
Add phone number
|
||||
</button>
|
||||
<hr>
|
||||
</li>
|
||||
|
||||
<li role="region" aria-label="Emails" data-l10n-id="emails">
|
||||
<section>
|
||||
<div id="contacts-form-emails" role="list"></div>
|
||||
</section>
|
||||
|
||||
<button data-field-type="email" id='add-new-email' data-l10n-id="addEmail" class="fillflow-row action action-add icon icon-add">
|
||||
Add email address
|
||||
</button>
|
||||
<hr>
|
||||
</li>
|
||||
|
||||
<li role="region" aria-label="Addresses" data-l10n-id="addresses">
|
||||
<section>
|
||||
<div id="contacts-form-addresses" role="list"></div>
|
||||
</section>
|
||||
|
||||
<button data-field-type="adr" id='add-new-address' data-l10n-id="addAddress" class="fillflow-row action action-add icon icon-add">
|
||||
Add new address
|
||||
</button>
|
||||
<hr>
|
||||
</li>
|
||||
|
||||
<li role="region" aria-label="Dates" data-l10n-id="dates">
|
||||
<section>
|
||||
<div id="contacts-form-dates" role="list"></div>
|
||||
</section>
|
||||
|
||||
<button data-field-type="date" id='add-new-date' data-l10n-id="addDate" class="fillflow-row action action-add icon icon-add">
|
||||
Add Date
|
||||
</button>
|
||||
<hr>
|
||||
</li>
|
||||
|
||||
<li role="region" aria-label="Notes" data-l10n-id="notes">
|
||||
<section>
|
||||
<div id="contacts-form-notes" role="list"></div>
|
||||
</section>
|
||||
|
||||
<button data-field-type="note" id='add-new-note' data-l10n-id="addComment" class="fillflow-row action action-add icon icon-add">
|
||||
Add comment
|
||||
</button>
|
||||
<hr>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
<footer class="tail-actions hide">
|
||||
<button id='delete-contact' class="fillflow-row action action-delete danger">
|
||||
<b data-l10n-id="deleteContact">Delete contact</b>
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
</element>
|
||||
13
gaia/apps/communications/contacts/elements/ice.html
Executable file
13
gaia/apps/communications/contacts/elements/ice.html
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
<element name="ice-view" extends="section">
|
||||
<template>
|
||||
<gaia-header id="ice-header" action="back">
|
||||
<h1 data-l10n-id="ice_contacts"></h1>
|
||||
</gaia-header>
|
||||
<arcticle class="view-body">
|
||||
<section id="ice-list" data-type="list" class="active">
|
||||
<ol id="ice-group" role="">
|
||||
</ol>
|
||||
</section>
|
||||
</arcticle>
|
||||
</template>
|
||||
</element>
|
||||
22
gaia/apps/communications/contacts/elements/multiple_select.html
Executable file
22
gaia/apps/communications/contacts/elements/multiple_select.html
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
<element name="multiple-select-view" extends="section">
|
||||
<template>
|
||||
<template id="contactToImportTemplate">
|
||||
<li>
|
||||
<aside class="pack-end" aria-hidden="true">
|
||||
<span data-type="img"></span>
|
||||
</aside>
|
||||
<p>Name</p>
|
||||
<p>Org</p>
|
||||
</li>
|
||||
</template>
|
||||
<gaia-header id="multiple-select-view-header" action="close">
|
||||
<h1 id="multiple-select-view-title">Filename</h1>
|
||||
<button id="save-button" data-l10n-id="importAll">Import all</button>
|
||||
</gaia-header>
|
||||
|
||||
<article class="view-body">
|
||||
<ol id="multiple-select-container" class="view-body-inner" data-type="list">
|
||||
</ol>
|
||||
</article>
|
||||
</template>
|
||||
</element>
|
||||
15
gaia/apps/communications/contacts/elements/overlay.html
Executable file
15
gaia/apps/communications/contacts/elements/overlay.html
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
<element name="confirm-form" extends="form">
|
||||
<template>
|
||||
<section id="progress-activity" class="hide">
|
||||
<h1 id="progress-title"></h1>
|
||||
<p role="status">
|
||||
<span id="progress-msg"></span>
|
||||
<progress id="progress-element" class="pack-activity" value="0" max="100"></progress>
|
||||
</p>
|
||||
</section>
|
||||
<menu>
|
||||
<button data-l10n-id="cancel" id="cancel-overlay">Cancel</button>
|
||||
</menu>
|
||||
</template>
|
||||
</element>
|
||||
|
||||
25
gaia/apps/communications/contacts/elements/phone_details.html
Executable file
25
gaia/apps/communications/contacts/elements/phone_details.html
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
<!-- bug 1060080: taken from details.html, should be unified -->
|
||||
<element name="phone-details" extends="section">
|
||||
<template>
|
||||
<li data-phone id='phone-details-template-#i#' data-template role="region" aria-label="Phone" data-l10n-id="phoneDetail">
|
||||
<h2>
|
||||
<span data-l10n-id="#type_l10n_id#">#type#</span>
|
||||
<span class="carrier-wrapper" hidden>
|
||||
<span data-l10n-id="separator"></span>
|
||||
<span class="carrier">#carrier#</span>
|
||||
</span>
|
||||
</h2>
|
||||
<div class="item">
|
||||
<div class="item-body-exp">
|
||||
<div class="button activity call-action icon icon-call" id="call-or-pick-#i#">
|
||||
<b aria-label="Call" data-l10n-id="makeCall"><bdi class="ellipsis-dir-fix">#value#</bdi></b>
|
||||
<span class="js-sim-indication"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-media pull-right">
|
||||
<button id="send-sms-button-#i#" class="activity send-sms icon icon-message" data-l10n-id="send-sms-button" aria-label="SMS"></button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
</element>
|
||||
7
gaia/apps/communications/contacts/elements/screenshot.html
Executable file
7
gaia/apps/communications/contacts/elements/screenshot.html
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
<element name="view-screenshot" extends="section">
|
||||
<template>
|
||||
<article id="view-screenshot-body">
|
||||
</article>
|
||||
</template>
|
||||
</element>
|
||||
|
||||
26
gaia/apps/communications/contacts/elements/search.html
Executable file
26
gaia/apps/communications/contacts/elements/search.html
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
<element name="search-view" extends="section">
|
||||
<template>
|
||||
<form id="searchview-container" class="search" role="search">
|
||||
<p>
|
||||
<label role="presentation">
|
||||
<input type="search" name="search" class="textfield" x-inputmode="verbatim"
|
||||
id="search-contact" placeholder="Search" data-l10n-id="search-contact">
|
||||
<button type="reset">Clear</button>
|
||||
</label>
|
||||
</p>
|
||||
<button id="cancel-search" data-l10n-id="cancel" type="submit">Cancel</button>
|
||||
</form>
|
||||
|
||||
<section id="groups-list-search">
|
||||
<ol id="search-list" data-type="list" class="active" role="listbox">
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<section id="search-process">
|
||||
<p id="no-result" class="hide" data-l10n-id="noResults">No contacts found</p>
|
||||
<p id="search-progress" class="hidden" role="status">
|
||||
<progress class="small"></progress>
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
</element>
|
||||
130
gaia/apps/communications/contacts/elements/settings.html
Executable file
130
gaia/apps/communications/contacts/elements/settings.html
Executable file
|
|
@ -0,0 +1,130 @@
|
|||
<element name="settings" extends="article">
|
||||
<template>
|
||||
<section data-theme="organic" id="view-settings" role="region" class="skin-organic view view-bottom theme-settings">
|
||||
<gaia-header>
|
||||
<h1 data-l10n-id="settings"></h1>
|
||||
<button id="settings-close" data-l10n-id="done">Done</button>
|
||||
</gaia-header>
|
||||
|
||||
<article class="view-body" id="settings-article">
|
||||
<section role="region" class="view-body-inner">
|
||||
<ul data-type="list" role="presentation">
|
||||
<li id="settingsOrder" role="checkbox">
|
||||
<gaia-switch name="order.lastname">
|
||||
<label data-l10n-id="contactsOrderBy"></label>
|
||||
</gaia-switch>
|
||||
</li>
|
||||
</ul>
|
||||
<gaia-subheader skin="organic" id="transfer-contacts-header">
|
||||
<span data-l10n-id="transferContactsTitle">Transfer Contacts</span>
|
||||
</gaia-subheader>
|
||||
<ul data-type="list" id="sources" role="listbox" aria-labelledby="transfer-contacts-header">
|
||||
<li role="presentation" id="importContacts" data-source="sim">
|
||||
<button role="option" class="icon icon-import" data-l10n-id="importContactsButton">
|
||||
Import Contacts
|
||||
</button>
|
||||
</li>
|
||||
<li role="presentation" id="exportContacts" data-source="sd">
|
||||
<button role="option" class="icon icon-export" data-l10n-id="exportContactsButton">
|
||||
Export Contacts
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<gaia-subheader skin="organic" id="contacts-management-header">
|
||||
<span data-l10n-id="ContactManagementTitle">Contacts Management</span>
|
||||
</gaia-subheader>
|
||||
<ul data-type="list" id="contactsManagement" role="listbox" aria-labelledby="contacts-management-header">
|
||||
<li role="presentation">
|
||||
<button role="option" id="set-ice" class="action" data-l10n-id="setICEButton">
|
||||
Set ICE Contacts
|
||||
</button>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<button role="option" id="bulkDelete" class="action" data-l10n-id="bulkDeleteButton">
|
||||
Delete Contacts
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
</section>
|
||||
<section data-theme="organic" id="import-settings" role="region" class="skin-organic view view-right theme-settings">
|
||||
<gaia-header id="import-settings-header" action="back">
|
||||
<h1 id='import-settings-title'></h1>
|
||||
</gaia-header>
|
||||
<article class="view-body">
|
||||
<section role="region" class="view-body-inner">
|
||||
<ul role="listbox" data-type="list" id="import-options">
|
||||
<li role="presentation" id="import-sd-option" data-source="sd">
|
||||
<button role="option" class="icon icon-sd" >
|
||||
<span data-l10n-id="importMemoryCard">Memory card</span>
|
||||
<p><span></span><time></time></p>
|
||||
</button>
|
||||
<p class="error-message"></p>
|
||||
</li>
|
||||
<li role="presentation" id="import-gmail-option" class="importService" data-source="gmail">
|
||||
<button role="option" class="icon icon-gmail">
|
||||
<span data-l10n-id="importGmail">Gmail</span>
|
||||
<p><span></span><time></time></p>
|
||||
</button>
|
||||
</li>
|
||||
<li role="presentation" id="import-live-option" class="importService" data-source="live">
|
||||
<button role="option" class="icon icon-live">
|
||||
<span data-l10n-id="importOutlook">Outlook</span>
|
||||
<p><span></span><time></time></p>
|
||||
</button>
|
||||
<p class="error-message" data-l10n-id="genericNoConnection"></p>
|
||||
</li>
|
||||
</ul>
|
||||
<ul role="listbox" data-type="list" id="export-options">
|
||||
<li role="presentation" id="export-sd-option" data-source="sd">
|
||||
<button role="option" class="icon icon-sd" data-l10n-id="memoryCard">
|
||||
Memory card
|
||||
</button>
|
||||
<p class="error-message"></p>
|
||||
</li>
|
||||
<li role="presentation" id="export-bluetooth-option" data-source="bluetooth">
|
||||
<button role="option" class="icon icon-bluetooth" data-l10n-id="bluetooth">
|
||||
Bluetooth
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
</section>
|
||||
<section data-theme="organic" id="ice-settings" role="region" class="skin-organic view view-right theme-settings">
|
||||
<gaia-header id="ice-settings-header" action="back">
|
||||
<h1 id='ice-settings-title' data-l10n-id="ICESettingTitle"></h1>
|
||||
</gaia-header>
|
||||
<article class="view-body">
|
||||
<section role="region" class="view-body-inner">
|
||||
<p class="description" data-l10n-id="ICEDescription">
|
||||
Add two contacts for making “In Case of Emergency” calls.
|
||||
</p>
|
||||
<ul data-type="list" role="listbox" aria-multiselectable="true">
|
||||
<li role="option" id="ice-contacts-1-switch" class="ice-contacts-switch">
|
||||
<gaia-switch name="ice-contact-1-enabled">
|
||||
<label data-l10n-id="ICEContact1"></label>
|
||||
</gaia-switch>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<button role="option" id="select-ice-contact-1" class="icon icon-view" data-l10n-id="ICESelectContact" disabled>
|
||||
Select a contact
|
||||
</button>
|
||||
</li>
|
||||
<li role="option" id="ice-contacts-2-switch" class="ice-contacts-switch">
|
||||
<gaia-switch name="ice-contact-2-enabled">
|
||||
<label data-l10n-id="ICEContact2"></label>
|
||||
</gaia-switch>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<button role="option" id="select-ice-contact-2" class="icon icon-view" data-l10n-id="ICESelectContact" disabled>
|
||||
Select a contact
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</article>
|
||||
</section>
|
||||
</template>
|
||||
</element>
|
||||
6
gaia/apps/communications/contacts/elements/status.html
Executable file
6
gaia/apps/communications/contacts/elements/status.html
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
<element name="status-message" extends="section">
|
||||
<template>
|
||||
<p></p>
|
||||
</template>
|
||||
</element>
|
||||
|
||||
19
gaia/apps/communications/contacts/elements/tag.html
Executable file
19
gaia/apps/communications/contacts/elements/tag.html
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
<element name="view-select-tag" extends="section">
|
||||
<template>
|
||||
<gaia-header id="settings-header" action="back">
|
||||
<h1 data-l10n-id="label"></h1>
|
||||
<button id="settings-done" data-l10n-id="done">Done</button>
|
||||
</gaia-header>
|
||||
|
||||
<article class="view-body">
|
||||
<form class="view-body-inner">
|
||||
<ul id="tags-list" class="selection-list compact" role="listbox">
|
||||
</ul>
|
||||
<p>
|
||||
<input class="textfield tagItem" type="text" placeholder="Custom Tag" value="" id='custom-tag' data-l10n-id="customTag" dir="auto">
|
||||
<button id="custom-tag-reset" type="reset">Clear</button>
|
||||
</p>
|
||||
</form>
|
||||
</article>
|
||||
</template>
|
||||
</element>
|
||||
107
gaia/apps/communications/contacts/fb_link.html
Executable file
107
gaia/apps/communications/contacts/fb_link.html
Executable file
|
|
@ -0,0 +1,107 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
|
||||
<meta name="theme-color" content="#00b7b7">
|
||||
|
||||
<title>Facebook Link</title>
|
||||
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/templates.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/image_square.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/image_thumbnail.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/event_listeners.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/misc.js"></script>
|
||||
|
||||
<script defer type="text/javascript" src="oauth2/js/flow.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/pages/import/js/parameters.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/facebook/fb_utils.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/facebook/fb_query.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/shared/js/async_storage.js"></script>
|
||||
<script type="text/javascript" src="/shared/js/contacts/import/import_status_data.js"></script>
|
||||
<script type="text/javascript" src="/shared/js/text_normalizer.js"></script>
|
||||
<script type="text/javascript" src="/shared/js/binary_search.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/lazy_loader.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/pages/import/js/oauth20.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/fb/fb_request.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/facebook/fb_data.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/fb/fb_reader_utils.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/facebook/fb_contact_utils.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/facebook/fb_contact.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/pages/import/js/curtain.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/facebook/facebook_connector.js"></script>
|
||||
<script defer type="text/javascript" src="/facebook/js/fb_sync.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/image_loader.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/status.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/dom.js"></script>
|
||||
|
||||
<script defer type="text/javascript" src="js/fb/fb_link.js"></script>
|
||||
|
||||
<!-- starts up the functionality -->
|
||||
<script defer src="js/fb/fb_link_init.js"></script>
|
||||
|
||||
<meta name="defaultLanguage" content="en-US">
|
||||
<meta name="availableLanguages" content="en-US">
|
||||
<link rel="localization" href="/shared/locales/import_contacts/import_contacts.{locale}.properties">
|
||||
<script type="text/javascript" src="/shared/js/l10n.js"></script>
|
||||
|
||||
<!-- Building Blocks -->
|
||||
<link href="/shared/style/buttons.css" rel="stylesheet">
|
||||
<link href="/shared/style/confirm.css" rel="stylesheet">
|
||||
<link href="/shared/style/lists.css" rel="stylesheet">
|
||||
<link href="/shared/style/status.css" rel="stylesheet">
|
||||
|
||||
<!-- Web Components -->
|
||||
<script defer src="/shared/elements/config.js"></script>
|
||||
<!-- <link rel="stylesheet" type="text/css" href="/shared/elements/gaia-icons/gaia-icons.css" /> -->
|
||||
<link rel="stylesheet" type="text/css" href="app://theme.gaiamobile.org/shared/elements/gaia-theme/gaia-theme.css" />
|
||||
<script defer src="/shared/elements/gaia-header/dist/gaia-header.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="/shared/pages/import/style/import.css">
|
||||
<link rel="stylesheet" href="/shared/pages/import/style/facebook.css">
|
||||
<link rel="stylesheet" href="style/status.css">
|
||||
|
||||
<link rel="import" href="elements/status.html">
|
||||
</head>
|
||||
|
||||
<body role="application" class="theme-communications skin-comms">
|
||||
<section role="region" id="content" class="link">
|
||||
|
||||
<gaia-header id="link-header" action="close">
|
||||
<h1 data-l10n-id="fbFriends"></h1>
|
||||
</gaia-header>
|
||||
|
||||
<section id="main">
|
||||
<!-- Contacts List Section -->
|
||||
<section id="mainContent" class="link-list" data-state="selection" data-type="list">
|
||||
<ol id="friends-list">
|
||||
<li data-template data-uuid="#uid#">
|
||||
<a href="#">
|
||||
<aside class="pack-end">
|
||||
<span data-type="img" data-src="https://graph.facebook.com/#uid#/picture?width=#picwidth#&height=#picheight#"></span>
|
||||
</aside>
|
||||
<p>#name#</p>
|
||||
<p>#email#</p>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</section> <!-- mainContent -->
|
||||
|
||||
<form role="dialog" data-type="confirm" class="no-overlay">
|
||||
<menu>
|
||||
<button id="view-all" data-l10n-id="viewAll" class="full">
|
||||
View all Facebook Friends
|
||||
</button>
|
||||
</menu>
|
||||
</form>
|
||||
|
||||
</section> <!-- main -->
|
||||
|
||||
</section> <!-- role="region" -->
|
||||
|
||||
<section is="status-message" id="statusMsg" role="status"></section>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
263
gaia/apps/communications/contacts/index.html
Executable file
263
gaia/apps/communications/contacts/index.html
Executable file
|
|
@ -0,0 +1,263 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
|
||||
<meta charset="utf-8">
|
||||
<meta name="theme-group" content="theme-communications">
|
||||
<meta name="theme-color" content="var(--header-background)">
|
||||
<title> Contacts </title>
|
||||
|
||||
<!-- Building Blocks -->
|
||||
<link href="/shared/style/input_areas.css" rel="stylesheet">
|
||||
<link href="/shared/style/lists.css" rel="stylesheet">
|
||||
<link href="/shared/style/scrolling.css" rel="stylesheet">
|
||||
<link href="/shared/style/buttons.css" rel="stylesheet">
|
||||
<link href="/shared/style/progress_activity.css" rel="stylesheet">
|
||||
<link href="/shared/style/status.css" rel="stylesheet">
|
||||
<link href="/shared/style/switches.css" rel="stylesheet">
|
||||
<link href="/shared/style/confirm.css" rel="stylesheet">
|
||||
<link href="/shared/style/action_menu.css" rel="stylesheet">
|
||||
<link href="/shared/style/edit_mode.css" rel="stylesheet">
|
||||
<link href="/shared/style/animations.css" rel="stylesheet">
|
||||
|
||||
<link href="/contacts/style/app.css" rel="stylesheet">
|
||||
<link href="/contacts/style/contacts.css" rel="stylesheet">
|
||||
<link href="/contacts/style/overlay.css" rel="stylesheet">
|
||||
<link href="/shared/pages/import/style/search.css" rel="stylesheet">
|
||||
<link href="/shared/pages/import/style/curtain_frame.css" rel="stylesheet">
|
||||
<link href="/contacts/style/status.css" rel="stylesheet">
|
||||
<link href="/contacts/style/fb_extensions.css" rel="stylesheet">
|
||||
<link href="/contacts/style/match_service.css" rel="stylesheet">
|
||||
<link href="/shared/style/contacts.css" rel="stylesheet">
|
||||
<link href="/shared/style/contacts/contacts_buttons.css" rel="stylesheet">
|
||||
|
||||
<!-- <link rel="stylesheet" type="text/css" href="/shared/elements/gaia-icons/gaia-icons.css" /> -->
|
||||
<link rel="stylesheet" type="text/css" href="app://theme.gaiamobile.org/shared/elements/gaia-theme/gaia-theme.css" />
|
||||
|
||||
<!-- For contacts import/export:
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/sdcard.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/vcard_parser.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/vcard_reader.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/import_from_vcard.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/import_sim_contacts.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/confirm.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/image_utils.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/image_thumbnail.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/contacts_shortcuts.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/overlay.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/utilities/status.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/import/import_status_data.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/date_time_helper.js"></script>
|
||||
<script defer type="text/javascript" src="/shared/js/contacts/utilities/ice_store.js"></script>
|
||||
|
||||
<script defer src="/shared/js/mime_mapper.js"></script>
|
||||
<script defer src="/shared/js/contacts/import/utilities/misc.js"></script>
|
||||
|
||||
<script defer src="/shared/js/l10n.js"></script>
|
||||
<script defer src="/contacts/js/activities.js"></script>
|
||||
<script defer src="/shared/js/contact_photo_helper.js"></script>
|
||||
|
||||
<script defer src="/shared/js/async_storage.js"></script>
|
||||
<script defer src="/shared/js/contacts/import/utilities/config.js"></script>
|
||||
<script defer src="/contacts/js/utilities/cookie.js"></script>
|
||||
<script defer src="/contacts/js/utilities/extract_params.js"></script>
|
||||
<script defer src="/contacts/js/utilities/performance_helper.js"></script>
|
||||
<script defer src="/contacts/js/utilities/mozContact.js"></script>
|
||||
<script defer src="/contacts/js/fb/fb_init.js"></script>
|
||||
<script defer src="/shared/js/contacts/utilities/event_listeners.js"></script>
|
||||
<script defer src="/contacts/js/navigation.js"></script>
|
||||
<script defer src="/contacts/js/views/list.js"></script>
|
||||
<script defer src="/contacts/js/contacts.js"></script>
|
||||
<script defer src="/shared/js/contacts/utilities/image_loader.js"></script>
|
||||
<script defer src="/contacts/js/fb_loader.js"></script>
|
||||
<script defer src="/shared/js/advanced_telemetry_helper.js"></script>
|
||||
<script defer src="/shared/js/settings_listener.js"></script>
|
||||
-->
|
||||
|
||||
<!-- Web Components -->
|
||||
<script defer src="/shared/elements/config.js"></script>
|
||||
<script defer src="/shared/js/component_utils.js"></script>
|
||||
<script defer src="/shared/elements/gaia_subheader/script.js"></script>
|
||||
<script defer src="/shared/elements/gaia-header/dist/gaia-header.js"></script>
|
||||
|
||||
<link rel="localization" href="/shared/elements/gaia_menu/locales/gaia_menu.{locale}.properties">
|
||||
<link rel="localization" href="/shared/elements/gaia_sim_picker/locales/gaia_sim_picker.{locale}.properties">
|
||||
<!--
|
||||
<link rel="stylesheet" type="text/css" href="/shared/elements/gaia_menu/style.css">
|
||||
<link rel="stylesheet" type="text/css" href="/shared/elements/gaia_sim_picker/style.css">
|
||||
<script defer src="/shared/elements/gaia_menu/script.js"></script>
|
||||
<script defer src="/shared/elements/gaia_sim_picker/script.js"></script>
|
||||
<script defer src="/shared/elements/gaia_switch/script.js"></script>
|
||||
-->
|
||||
|
||||
<script defer src="/shared/js/lazy_loader.js"></script>
|
||||
<script defer src="/contacts/js/utilities/performance_helper.js"></script>
|
||||
<script defer src="/contacts/js/cache.js"></script>
|
||||
<script defer src='/contacts/js/bootstrap.js'></script>
|
||||
|
||||
<meta name="defaultLanguage" content="en-US">
|
||||
<meta name="availableLanguages" content="en-US">
|
||||
<link rel="localization" href="locales/contacts.{locale}.properties">
|
||||
<link rel="localization" href="/shared/locales/date/date.{locale}.properties">
|
||||
<link rel="localization" href="/shared/locales/phone_types/phone_types.{locale}.properties">
|
||||
<link rel="localization" href="/shared/locales/telephony/telephony.{locale}.properties">
|
||||
<link rel="localization" href="/shared/locales/import_contacts/import_contacts.{locale}.properties">
|
||||
|
||||
<!-- For the build system to include in zip:
|
||||
<link href="/shared/js/tag_visibility_monitor.js">
|
||||
<link href="/shared/js/contact2vcard.js">
|
||||
<link href="/shared/js/device_storage/get_storage_if_available.js">
|
||||
<link href="/shared/js/device_storage/get_unused_filename.js">
|
||||
<link href="/shared/js/fb/fb_request.js">
|
||||
<link href="/shared/js/fb/fb_data_reader.js">
|
||||
<link href="/shared/js/setImmediate.js">
|
||||
<link href="/shared/js/sim_settings_helper.js">
|
||||
<link href="/shared/js/nfc_utils.js">
|
||||
<link href="/shared/js/contacts/sms_integration.js">
|
||||
<link href="/shared/js/contacts/contacts_buttons.js">
|
||||
|
||||
<link href="/shared/js/contacts/import/facebook/fb_data.js">
|
||||
<link href="/shared/js/contacts/import/facebook/fb_utils.js">
|
||||
<link href="/shared/js/contacts/import/facebook/fb_query.js">
|
||||
<link href="/shared/js/contacts/import/facebook/fb_contact_utils.js">
|
||||
<link href="/shared/js/contacts/import/facebook/fb_contact.js">
|
||||
|
||||
<link href="/shared/js/dialer/telephony_messages.js">
|
||||
|
||||
<link href="/shared/pages/import/js/parameters.js">
|
||||
|
||||
<link href="/shared/js/utilities.js">
|
||||
-->
|
||||
|
||||
<link rel="import" href="elements/confirm.html">
|
||||
<link rel="import" href="elements/details.html">
|
||||
<link rel="import" href="elements/phone_details.html">
|
||||
<link rel="import" href="elements/email_details.html">
|
||||
<link rel="import" href="elements/form.html">
|
||||
<link rel="import" href="elements/overlay.html">
|
||||
<link rel="import" href="elements/screenshot.html">
|
||||
<link rel="import" href="elements/search.html">
|
||||
<link rel="import" href="elements/settings.html">
|
||||
<link rel="import" href="elements/status.html">
|
||||
<link rel="import" href="elements/tag.html">
|
||||
<link rel="import" href="elements/ice.html">
|
||||
<link rel="import" href="elements/multiple_select.html">
|
||||
<!--
|
||||
<link href="/shared/pages/import/oauth.html">
|
||||
<link href="/shared/pages/import/curtain.html">
|
||||
<link href="/shared/pages/import/import.html">
|
||||
-->
|
||||
</head>
|
||||
|
||||
<body role="application" class="app-contacts skin-comms theme-communications">
|
||||
|
||||
<!-- Contacts List Section -->
|
||||
<section id='view-contacts-list' role="region" data-state="active" class="view view-noscroll view-contacts-list">
|
||||
<gaia-header id="contacts-list-header">
|
||||
<h1 id="app-title" data-l10n-id="contacts"></h1>
|
||||
<button id="add-contact-button" data-icon="add" data-l10n-id="addButton"></button>
|
||||
<button id="settings-button" data-icon="settings" data-l10n-id="settingsButton"></button>
|
||||
</gaia-header>
|
||||
|
||||
<article class="view-body">
|
||||
<div id="no-contacts" class="hide">
|
||||
<div class="info">
|
||||
<p data-l10n-id="no-contacts">no contacts</p>
|
||||
<p data-l10n-id="start-adding">start adding them now</p>
|
||||
</div>
|
||||
</div>
|
||||
<nav data-type="scrollbar">
|
||||
<p></p>
|
||||
<ol>
|
||||
<li data-anchor="search-container" data-img="magnifier_icon_big.png">
|
||||
<a href="#"><span class="pack-icon-search">Search</span></a>
|
||||
</li>
|
||||
<li class="hide" data-anchor="group-ice" data-img="icon_ice_shortcut.png">
|
||||
<a href="#"><span class="pack-icon-ice">ICE</span></a>
|
||||
</li>
|
||||
<li data-anchor="group-favorites" data-img="star_icon_big.png">
|
||||
<a href="#"><span class="pack-icon-favorites">Favorites</span></a>
|
||||
</li>
|
||||
<li data-anchor="group-A" data-letter="A"><a href="#">A</a></li>
|
||||
<li data-anchor="group-B" data-letter="B"><a href="#">B</a></li>
|
||||
<li data-anchor="group-C" data-letter="C"><a href="#">C</a></li>
|
||||
<li data-anchor="group-D" data-letter="D"><a href="#">D</a></li>
|
||||
<li data-anchor="group-E" data-letter="E"><a href="#">E</a></li>
|
||||
<li data-anchor="group-F" data-letter="F"><a href="#">F</a></li>
|
||||
<li data-anchor="group-G" data-letter="G"><a href="#">G</a></li>
|
||||
<li data-anchor="group-H" data-letter="H"><a href="#">H</a></li>
|
||||
<li data-anchor="group-I" data-letter="I"><a href="#">I</a></li>
|
||||
<li data-anchor="group-J" data-letter="J"><a href="#">J</a></li>
|
||||
<li data-anchor="group-K" data-letter="K"><a href="#">K</a></li>
|
||||
<li data-anchor="group-L" data-letter="L"><a href="#">L</a></li>
|
||||
<li data-anchor="group-M" data-letter="M"><a href="#">M</a></li>
|
||||
<li data-anchor="group-N" data-letter="N"><a href="#">N</a></li>
|
||||
<li data-anchor="group-O" data-letter="O"><a href="#">O</a></li>
|
||||
<li data-anchor="group-P" data-letter="P"><a href="#">P</a></li>
|
||||
<li data-anchor="group-Q" data-letter="Q"><a href="#">Q</a></li>
|
||||
<li data-anchor="group-R" data-letter="R"><a href="#">R</a></li>
|
||||
<li data-anchor="group-S" data-letter="S"><a href="#">S</a></li>
|
||||
<li data-anchor="group-T" data-letter="T"><a href="#">T</a></li>
|
||||
<li data-anchor="group-U" data-letter="U"><a href="#">U</a></li>
|
||||
<li data-anchor="group-V" data-letter="V"><a href="#">V</a></li>
|
||||
<li data-anchor="group-W" data-letter="W"><a href="#">W</a></li>
|
||||
<li data-anchor="group-X" data-letter="X"><a href="#">X</a></li>
|
||||
<li data-anchor="group-Y" data-letter="Y"><a href="#">Y</a></li>
|
||||
<li data-anchor="group-Z" data-letter="Z"><a href="#">Z</a></li>
|
||||
<li data-anchor="group-#" data-letter="#"><a href="#">#</a></li>
|
||||
</ol>
|
||||
</nav>
|
||||
<div id="groups-container-box">
|
||||
<div id="groups-container" class="view-body-inner">
|
||||
<div id="groups-container-background">
|
||||
<form id="search-container" class="search" role="search">
|
||||
<p>
|
||||
<label id="search-start">
|
||||
<input type="search" name="search" class="textfield" x-inputmode="verbatim"
|
||||
placeholder="Search" data-l10n-id="search-contact">
|
||||
</label>
|
||||
</p>
|
||||
</form>
|
||||
<section id="groups-list" data-type="list" class="active">
|
||||
<!-- Group template here -->
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
<form id="selectable-form" role="dialog" data-type="edit" class="hide">
|
||||
<section role="region" class="theme-settings">
|
||||
<gaia-header id="selectable-form-header" action="close">
|
||||
<h1 id="edit-title" data-l10n-id="contacts"></h1>
|
||||
<button type="button" id="select-action"></button>
|
||||
</gaia-header>
|
||||
</section>
|
||||
<menu id="select-all-wrapper">
|
||||
<button id="deselect-all" class="edit-button" data-l10n-id="deselectAll" disabled>
|
||||
Deselect all
|
||||
</button>
|
||||
<button id="select-all" class="edit-button" data-l10n-id="selectAll">
|
||||
Select all
|
||||
</button>
|
||||
</menu>
|
||||
</form>
|
||||
<section is="search-view" id="search-view" class="view"></section>
|
||||
<section is="view-screenshot" id='view-screenshot' role="region" class="view hide"></section>
|
||||
<section is="view-contact-details" id='view-contact-details' role="region" class="view view-right view-contact-profile view-noscroll"></section>
|
||||
<section is="view-contact-form" id='view-contact-form' role="region" class="view view-bottom view-edit-contact"></section>
|
||||
<section is="view-select-tag" id="view-select-tag" role="region" class="view view-right view-select-tag"></section>
|
||||
<form id="action-menu" role="dialog" data-type="action" class="hide">
|
||||
<header id="org-title" data-l10n-id="select_recipient"> Select recipient </header>
|
||||
<menu id="value-menu" type="toolbar">
|
||||
</menu>
|
||||
</form>
|
||||
<article is="settings" id="settings-wrapper"></article>
|
||||
<form is="confirm-form" data-type="confirm" id="loading-overlay" class="hide no-opacity" role="dialog"></form>
|
||||
<section is="status-message" id="statusMsg" role="status" class="hidden"></section>
|
||||
<form is="confirmation-message" id="confirmation-message" class="hide" role="dialog" data-type="confirm"></form>
|
||||
<section is="ice-view" id="ice-view" role="region" class="view view-right hidden"></section>
|
||||
<section is="multiple-select-view" id="multiple-select-view" role="region" class="view hidden"></section>
|
||||
<gaia-sim-picker id="sim-picker" tabindex="-1"></gaia-sim-picker>
|
||||
</body>
|
||||
</html>
|
||||
85
gaia/apps/communications/contacts/js/action_menu.js
Executable file
85
gaia/apps/communications/contacts/js/action_menu.js
Executable file
|
|
@ -0,0 +1,85 @@
|
|||
/* exported ActionMenu */
|
||||
'use strict';
|
||||
|
||||
function ActionMenu(title) {
|
||||
var data;
|
||||
var contactActionMenu;
|
||||
var listContainer;
|
||||
var btnCancel;
|
||||
var titleId = title;
|
||||
|
||||
function init() {
|
||||
contactActionMenu = document.getElementById('action-menu');
|
||||
// Prevent submit in the form
|
||||
contactActionMenu.addEventListener('submit', function(evt) {
|
||||
evt.preventDefault();
|
||||
});
|
||||
|
||||
if (titleId) {
|
||||
contactActionMenu.querySelector('#org-title').setAttribute(
|
||||
'data-l10n-id', titleId);
|
||||
}
|
||||
listContainer = document.getElementById('value-menu');
|
||||
|
||||
data = {
|
||||
list: []
|
||||
};
|
||||
}
|
||||
|
||||
this.show = function() {
|
||||
render(this);
|
||||
contactActionMenu.classList.remove('hide');
|
||||
};
|
||||
|
||||
this.hide = function() {
|
||||
contactActionMenu.classList.add('hide');
|
||||
emptyList();
|
||||
listContainer.innerHTML = '';
|
||||
};
|
||||
|
||||
function render(self) {
|
||||
for (var i = 0, l = data.list.length; i < l; i++) {
|
||||
var button = document.createElement('button');
|
||||
navigator.mozL10n.setAttributes(button,
|
||||
data.list[i].labelL10n.id,
|
||||
data.list[i].labelL10n.args);
|
||||
|
||||
// Set callback function on each button element.
|
||||
var callback = data.list[i].callback;
|
||||
if (callback) {
|
||||
button.addEventListener('click', callback, false);
|
||||
}
|
||||
|
||||
listContainer.appendChild(button);
|
||||
}
|
||||
|
||||
btnCancel = document.createElement('button');
|
||||
btnCancel.setAttribute('data-l10n-id', 'cancel');
|
||||
|
||||
btnCancel.addEventListener('click', function() {
|
||||
self.hide();
|
||||
});
|
||||
|
||||
var lastButtonWrapper = document.createElement('span');
|
||||
lastButtonWrapper.className = 'last-button-container';
|
||||
listContainer.appendChild(lastButtonWrapper);
|
||||
lastButtonWrapper.appendChild(btnCancel);
|
||||
}
|
||||
|
||||
function emptyList() {
|
||||
data.list = [];
|
||||
}
|
||||
|
||||
this.addToList = function (labelL10n, callback) {
|
||||
var self = this;
|
||||
data.list.push({
|
||||
labelL10n: labelL10n,
|
||||
callback: function() {
|
||||
callback();
|
||||
self.hide();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
}
|
||||
370
gaia/apps/communications/contacts/js/activities.js
Executable file
370
gaia/apps/communications/contacts/js/activities.js
Executable file
|
|
@ -0,0 +1,370 @@
|
|||
/* globals ConfirmDialog, Contacts, LazyLoader, utils, ActionMenu, HeaderUI,
|
||||
ContactToVcardBlob, VcardFilename, VcardActivityHandler, MainNavigation */
|
||||
/* exported ActivityHandler */
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Per RFC 6350, text/vcard is the canonical MIME media type for vCards, but
|
||||
* there are also deprecated types as well. Whenever we disambiguate what an
|
||||
* activity is requesting based on its MIME media type, we need to check if it
|
||||
* is any of these, and not just text/vcard.
|
||||
*/
|
||||
const VCARD_MIME_TYPES = [
|
||||
'text/vcard',
|
||||
'text/x-vcard',
|
||||
'text/directory'
|
||||
];
|
||||
|
||||
var ActivityHandler = {
|
||||
_currentActivity: null,
|
||||
|
||||
_launchedAsInlineActivity: (window.location.search == '?pick'),
|
||||
|
||||
mozContactParam: null,
|
||||
|
||||
_actionMenu: null,
|
||||
|
||||
get currentlyHandling() {
|
||||
return !!this._currentActivity;
|
||||
},
|
||||
|
||||
get activityName() {
|
||||
if (!this._currentActivity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._currentActivity.source.name;
|
||||
},
|
||||
|
||||
get activityDataType() {
|
||||
if (!this._currentActivity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._currentActivity.source.data.type;
|
||||
},
|
||||
|
||||
get activityData() {
|
||||
if (!this._currentActivity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._currentActivity.source.data;
|
||||
},
|
||||
|
||||
get activityContactProperties() {
|
||||
if (!this._currentActivity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this._currentActivity.source.data.contactProperties;
|
||||
},
|
||||
|
||||
/* checks first if we are handling an activity, then if it is
|
||||
* of the same type of any of the items from the list provided.
|
||||
* @param list Array with types of activities to be checked
|
||||
*/
|
||||
currentActivityIs: function(list) {
|
||||
return this.currentlyHandling && list.indexOf(this.activityName) !== -1;
|
||||
},
|
||||
|
||||
/* checks first if we are handling an activity, then checks that
|
||||
* it is NOT of the same type of any of the items from the list provided.
|
||||
* @param list Array with types of activities to be checked
|
||||
*/
|
||||
currentActivityIsNot: function(list) {
|
||||
return this.currentlyHandling && list.indexOf(this.activityName) === -1;
|
||||
},
|
||||
|
||||
isCancelable: function() {
|
||||
return new Promise(resolve => {
|
||||
resolve(!!this.currentlyHandling);
|
||||
});
|
||||
},
|
||||
|
||||
launch_activity: function ah_launch(activity, action) {
|
||||
if (this._launchedAsInlineActivity) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._currentActivity = activity;
|
||||
this.isCancelable().then(isCancelable => {
|
||||
HeaderUI.updateHeader(isCancelable);
|
||||
});
|
||||
|
||||
var hash = action;
|
||||
var param, params = [];
|
||||
if (activity.source &&
|
||||
activity.source.data &&
|
||||
activity.source.data.params) {
|
||||
var originalParams = activity.source.data.params;
|
||||
for (var i in originalParams) {
|
||||
param = originalParams[i];
|
||||
params.push(i + '=' + param);
|
||||
}
|
||||
hash += '?' + params.join('&');
|
||||
}
|
||||
document.location.hash = hash;
|
||||
},
|
||||
|
||||
handle: function ah_handle(activity) {
|
||||
const VCARD_DEPS = '/contacts/js/activities_vcard.js';
|
||||
switch (activity.source.name) {
|
||||
case 'new':
|
||||
this.launch_activity(activity, 'view-contact-form');
|
||||
break;
|
||||
case 'import':
|
||||
case 'open':
|
||||
LazyLoader.load(VCARD_DEPS, () => {
|
||||
VcardActivityHandler.handle(activity, this);
|
||||
});
|
||||
break;
|
||||
case 'update':
|
||||
this.launch_activity(activity, 'add-parameters');
|
||||
break;
|
||||
case 'pick':
|
||||
if (!this._launchedAsInlineActivity) {
|
||||
return;
|
||||
}
|
||||
this._currentActivity = activity;
|
||||
this.isCancelable().then(isCancelable => {
|
||||
HeaderUI.updateHeader(isCancelable);
|
||||
});
|
||||
MainNavigation.home();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
importContactsFromFile: function ah_importContactFromVcard(activity) {
|
||||
var self = this;
|
||||
if (activity.source &&
|
||||
activity.source.data &&
|
||||
activity.source.data.blob) {
|
||||
LazyLoader.load([
|
||||
document.querySelector('#loading-overlay'),
|
||||
'/shared/js/contacts/import/utilities/import_from_vcard.js',
|
||||
'/shared/js/contacts/import/utilities/overlay.js'
|
||||
], function loaded() {
|
||||
Contacts.loadFacebook(function() {
|
||||
utils.importFromVcard(activity.source.data.blob,
|
||||
function imported(numberOfContacts, id) {
|
||||
if (numberOfContacts === 1) {
|
||||
activity.source.data.params = {id: id};
|
||||
self.launch_activity(activity, 'view-contact-details');
|
||||
} else {
|
||||
self.launch_activity(activity, 'view-contact-list');
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this._currentActivity.postError('wrong parameters');
|
||||
this._currentActivity = null;
|
||||
}
|
||||
},
|
||||
|
||||
dataPickHandler: function ah_dataPickHandler(theContact) {
|
||||
var type, dataSet, noDataStr;
|
||||
var result = {};
|
||||
var self = this;
|
||||
|
||||
// Keeping compatibility with previous implementation. If
|
||||
// we want to get the full contact, just pass the parameter
|
||||
// 'fullContact' equal true.
|
||||
if (this.activityDataType === 'webcontacts/contact' &&
|
||||
this.activityData.fullContact === true) {
|
||||
result = utils.misc.toMozContact(theContact);
|
||||
this.postPickSuccess(result);
|
||||
return;
|
||||
}
|
||||
|
||||
// Was this a request for vCard export as a blob? Check all supported MIME
|
||||
// types.
|
||||
var isVcardDataType = VCARD_MIME_TYPES.some((mime) => {
|
||||
return this.activityDataType.indexOf(mime) !== -1;
|
||||
});
|
||||
|
||||
if (isVcardDataType) {
|
||||
// Normalize the type to text/vcard so other places that check MIME types
|
||||
// (ex: the Facebook guards) experience a consistent MIME type.
|
||||
this._currentActivity.source.data.type = 'text/vcard';
|
||||
LazyLoader.load([
|
||||
'/shared/js/text_normalizer.js',
|
||||
'/shared/js/contact2vcard.js',
|
||||
'/shared/js/setImmediate.js'
|
||||
], function lvcard() {
|
||||
ContactToVcardBlob([theContact], function blobReady(vcardBlob) {
|
||||
VcardFilename(theContact).then(filename => {
|
||||
self.postPickSuccess({
|
||||
name: filename,
|
||||
blob: vcardBlob
|
||||
});
|
||||
});
|
||||
}, {
|
||||
// Some MMS gateways prefer this MIME type for vcards
|
||||
type: 'text/x-vcard'
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this.activityDataType) {
|
||||
case 'webcontacts/tel':
|
||||
type = 'contact';
|
||||
dataSet = theContact.tel;
|
||||
noDataStr = 'no_contact_phones';
|
||||
break;
|
||||
case 'webcontacts/contact':
|
||||
type = 'number';
|
||||
dataSet = theContact.tel;
|
||||
noDataStr = 'no_contact_phones';
|
||||
break;
|
||||
case 'webcontacts/email':
|
||||
type = 'email';
|
||||
dataSet = theContact.email;
|
||||
noDataStr = 'no_contact_email';
|
||||
break;
|
||||
case 'webcontacts/select':
|
||||
type = 'select';
|
||||
var data = [];
|
||||
if (this.activityContactProperties.indexOf('tel') !== -1) {
|
||||
if (theContact.tel && theContact.tel.length) {
|
||||
data = data.concat(theContact.tel);
|
||||
}
|
||||
}
|
||||
if (this.activityContactProperties.indexOf('email') !== -1) {
|
||||
if (theContact.email && theContact.email.length) {
|
||||
data = data.concat(theContact.email);
|
||||
}
|
||||
}
|
||||
|
||||
dataSet = data;
|
||||
noDataStr = 'no_contact_data_available';
|
||||
break;
|
||||
}
|
||||
var hasData = dataSet && dataSet.length;
|
||||
var numOfData = hasData ? dataSet.length : 0;
|
||||
|
||||
|
||||
result.name = theContact.name;
|
||||
switch (numOfData) {
|
||||
case 0:
|
||||
// If no required type of data
|
||||
var dismiss = {
|
||||
title: 'ok',
|
||||
callback: function() {
|
||||
ConfirmDialog.hide();
|
||||
}
|
||||
};
|
||||
ConfirmDialog.show(null, noDataStr, dismiss);
|
||||
break;
|
||||
case 1:
|
||||
// if one required type of data
|
||||
if (this.activityDataType == 'webcontacts/tel' ||
|
||||
this.activityDataType == 'webcontacts/select') {
|
||||
result = this.pickContactsResult(theContact);
|
||||
} else {
|
||||
result[type] = dataSet[0].value;
|
||||
}
|
||||
|
||||
this.postPickSuccess(result);
|
||||
break;
|
||||
default:
|
||||
// if more than one required type of data
|
||||
LazyLoader.load('/contacts/js/action_menu.js', function() {
|
||||
if (!self._actionMenu) {
|
||||
self._actionMenu = new ActionMenu();
|
||||
} else {
|
||||
// To be sure that the action menu is empty
|
||||
self._actionMenu.hide();
|
||||
}
|
||||
|
||||
var itemData;
|
||||
var capture = function(itemData) {
|
||||
return function() {
|
||||
if (self.activityDataType == 'webcontacts/tel' ||
|
||||
self.activityDataType == 'webcontacts/select') {
|
||||
result = self.pickContactsResult(theContact, itemData);
|
||||
} else {
|
||||
result[type] = itemData;
|
||||
}
|
||||
self._actionMenu.hide();
|
||||
self.postPickSuccess(result);
|
||||
};
|
||||
};
|
||||
for (var i = 0, l = dataSet.length; i < l; i++) {
|
||||
itemData = dataSet[i].value;
|
||||
var carrier = dataSet[i].carrier || '';
|
||||
self._actionMenu.addToList(
|
||||
{
|
||||
id: 'pick_destination',
|
||||
args: {destination: itemData, carrier: carrier}
|
||||
},
|
||||
capture(itemData)
|
||||
);
|
||||
}
|
||||
self._actionMenu.show();
|
||||
});
|
||||
} // switch
|
||||
},
|
||||
|
||||
pickContactsResult:
|
||||
function ah_pickContactsResult(theContact, itemData) {
|
||||
var pickResult = {};
|
||||
var contact = utils.misc.toMozContact(theContact);
|
||||
|
||||
if (this.activityDataType == 'webcontacts/tel') {
|
||||
pickResult = contact;
|
||||
|
||||
if (itemData) {
|
||||
pickResult.tel = this.filterDestinationForActivity(
|
||||
itemData, pickResult.tel);
|
||||
}
|
||||
} else if (this.activityDataType == 'webcontacts/select') {
|
||||
pickResult.contact = contact;
|
||||
|
||||
if (!itemData) {
|
||||
pickResult.select = pickResult.contact.tel;
|
||||
|
||||
if (!pickResult.select || !pickResult.select.length) {
|
||||
pickResult.select = pickResult.contact.email;
|
||||
}
|
||||
} else {
|
||||
pickResult.select = this.filterDestinationForActivity(
|
||||
itemData, pickResult.contact.tel);
|
||||
|
||||
if (!pickResult.select || !pickResult.select.length) {
|
||||
pickResult.select = this.filterDestinationForActivity(
|
||||
itemData, pickResult.contact.email);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pickResult;
|
||||
},
|
||||
|
||||
filterDestinationForActivity:
|
||||
function ah_filterDestinationForActivity(itemData, dataSet) {
|
||||
return dataSet.filter(function isSamePhone(item) {
|
||||
return item.value == itemData;
|
||||
});
|
||||
},
|
||||
|
||||
postNewSuccess: function ah_postNewSuccess(contact) {
|
||||
this._currentActivity.postResult({ contact: contact });
|
||||
this._currentActivity = null;
|
||||
},
|
||||
|
||||
postPickSuccess: function ah_postPickSuccess(result) {
|
||||
this._currentActivity.postResult(result);
|
||||
this._currentActivity = null;
|
||||
},
|
||||
|
||||
postCancel: function ah_postCancel() {
|
||||
this._currentActivity.postError('canceled');
|
||||
this._currentActivity = null;
|
||||
}
|
||||
};
|
||||
66
gaia/apps/communications/contacts/js/activities_vcard.js
Executable file
66
gaia/apps/communications/contacts/js/activities_vcard.js
Executable file
|
|
@ -0,0 +1,66 @@
|
|||
'use strict';
|
||||
/* global LazyLoader, VCardReader, Contacts */
|
||||
/* exported VcardActivityHandler */
|
||||
|
||||
var VcardActivityHandler = (function() {
|
||||
var handle = function(activity, parentHandler) {
|
||||
const DEPENDENCIES = '/shared/js/contacts/import/utilities/vcard_reader.js';
|
||||
LazyLoader.load(DEPENDENCIES, function () {
|
||||
getvCardReader(activity.source.data.blob).then(readvCard, (err) => {
|
||||
console.error('Error while getting vCard reader:', err);
|
||||
Contacts.cancel();
|
||||
});
|
||||
});
|
||||
|
||||
function getvCardReader(blob) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var fileReader = new FileReader();
|
||||
fileReader.readAsText(blob);
|
||||
fileReader.onloadend = function() {
|
||||
resolve(new VCardReader(fileReader.result));
|
||||
};
|
||||
fileReader.onerror = function() {
|
||||
console.error('The blob could not be read as a file.');
|
||||
reject(fileReader.error);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function readvCard(vCardReader) {
|
||||
var cursor = vCardReader.getAll();
|
||||
cursor.onsuccess = function(event) {
|
||||
var contact = event.target.result;
|
||||
render([contact], activity, cursor);
|
||||
};
|
||||
}
|
||||
|
||||
function getFileName(path) {
|
||||
var barIndex = path.lastIndexOf('/');
|
||||
if (barIndex > -1) {
|
||||
path = path.substring(barIndex + 1);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
function render(contacts, activity, cursor) {
|
||||
parentHandler.launch_activity(activity, 'multiple-select-view');
|
||||
const DEPENDENCIES = [
|
||||
'/contacts/js/views/multiple_select.js'
|
||||
];
|
||||
LazyLoader.load(DEPENDENCIES, function() {
|
||||
var name;
|
||||
if (activity.source.data.filename) {
|
||||
name = getFileName(activity.source.data.filename);
|
||||
} else {
|
||||
name = activity.source.data.src;
|
||||
}
|
||||
Contacts.MultipleSelect.init();
|
||||
Contacts.MultipleSelect.render(contacts, cursor, name);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
handle: handle
|
||||
};
|
||||
})();
|
||||
90
gaia/apps/communications/contacts/js/bootstrap.js
vendored
Executable file
90
gaia/apps/communications/contacts/js/bootstrap.js
vendored
Executable file
|
|
@ -0,0 +1,90 @@
|
|||
/* global Cache */
|
||||
/* global LazyLoader */
|
||||
/* global utils */
|
||||
|
||||
|
||||
'use strict';
|
||||
|
||||
(function(exports) {
|
||||
|
||||
/** Script loader **/
|
||||
|
||||
function loadScripts() {
|
||||
var dependencies = [
|
||||
'/contacts/services/contacts.js',
|
||||
'/contacts/js/activities.js',
|
||||
'/shared/js/contacts/utilities/event_listeners.js',
|
||||
'/contacts/js/navigation.js',
|
||||
'/contacts/js/main_navigation.js',
|
||||
'/contacts/js/views/list.js',
|
||||
'/contacts/js/header_ui.js'
|
||||
];
|
||||
|
||||
// If the cache is enabled, we push lazy loading l10n to the extreme,
|
||||
// cause we will be applying the transalations manually from the cached
|
||||
// content.
|
||||
// Otherwise, we load the l10n scripts along with the rest of the JS
|
||||
// scripts. This will avoid the non localized text to appear in the screen.
|
||||
if (!Cache.active) {
|
||||
dependencies.push('/shared/js/l10n.js');
|
||||
}
|
||||
|
||||
LazyLoader.load(dependencies, () => {
|
||||
['/shared/js/async_storage.js',
|
||||
'/shared/js/contacts/import/utilities/config.js',
|
||||
'/contacts/js/utilities/extract_params.js',
|
||||
'/contacts/js/utilities/cookie.js',
|
||||
'/shared/js/contact_photo_helper.js'].forEach((src) => {
|
||||
var scriptNode = document.createElement('script');
|
||||
scriptNode.src = src;
|
||||
scriptNode.setAttribute('defer', true);
|
||||
document.head.appendChild(scriptNode);
|
||||
});
|
||||
return LazyLoader.load('/contacts/js/contacts.js');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap process
|
||||
* -----------------
|
||||
* In order to provide an acceptable start up time, the contacts app
|
||||
* keeps a cached version of the list view HTML in localStorage. We
|
||||
* initially load only the scripts that are needed to recover the cached
|
||||
* HTML from localStorage and to apply it as part of the contacts list view.
|
||||
* Once we have done this and have shown the cached version of the list in
|
||||
* the screen, we load the rest of required JS files and continue the normal
|
||||
* start up process.
|
||||
*
|
||||
* For now, the cache is evicted in the following scenarios:
|
||||
* - oncontactchange event (addition, edition or deletion of contacts).
|
||||
* - ICE contacts enabled/disabled.
|
||||
* - Facebook import enabled/disabled/sync.
|
||||
* - Import from external source (Gmail, Hotmail, Sdcard...).
|
||||
* - Favorites added/removed.
|
||||
* - Change in the way we display contacts (order by last name).
|
||||
* - Locale change (from RTL to LTR and viceversa).
|
||||
*/
|
||||
|
||||
window.addEventListener('DOMContentLoaded', function ondomloaded() {
|
||||
utils.PerformanceHelper.domLoaded();
|
||||
window.removeEventListener('DOMContentLoaded', ondomloaded);
|
||||
|
||||
var firstPaintFired = false;
|
||||
|
||||
Cache.apply('firstChunk').then(() => {
|
||||
// Once the first chunk is applied correctly, display the
|
||||
// list panel and fire the visually complete event.
|
||||
document.getElementById('view-contacts-list').classList.add('current');
|
||||
utils.PerformanceHelper.visuallyComplete();
|
||||
firstPaintFired = true;
|
||||
});
|
||||
|
||||
window.onload = () => {
|
||||
if (!firstPaintFired) {
|
||||
utils.PerformanceHelper.visuallyComplete();
|
||||
}
|
||||
loadScripts();
|
||||
};
|
||||
});
|
||||
|
||||
})(window);
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue