Browse Source

Improved phonebook import

master
Igor Zhukov 11 years ago
parent
commit
a7dd922498
  1. 6
      app/js/services.js
  2. 68
      app/partials/mobile/contacts_modal.html
  3. 39
      app/partials/mobile/phonebook_modal.html

6
app/js/services.js

@ -339,7 +339,7 @@ angular.module('myApp.services', []) @@ -339,7 +339,7 @@ angular.module('myApp.services', [])
};
function isAvailable () {
if (Config.Navigator.ffos && Config.Modes.packed) {
if (Config.Navigator.mobile && Config.Navigator.ffos && Config.Modes.packed) {
try {
return navigator.mozContacts && navigator.mozContacts.getAll;
} catch (e) {
@ -352,9 +352,9 @@ angular.module('myApp.services', []) @@ -352,9 +352,9 @@ angular.module('myApp.services', [])
function openPhonebookImport () {
return $modal.open({
templateUrl: 'partials/phonebook_modal.html',
templateUrl: 'partials/mobile/phonebook_modal.html',
controller: 'PhonebookModalController',
windowClass: 'phonebook_modal_window'
windowClass: 'phonebook_modal_window page_modal mobile_modal'
});
}

68
app/partials/mobile/contacts_modal.html

@ -1,44 +1,44 @@ @@ -1,44 +1,44 @@
<div class="contacts_modal_wrap">
<div class="tg_page_head tg_modal_head">
<div class="navbar navbar-static-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<ul class="nav navbar-nav navbar-quick-nav">
<li class="navbar-quick-right" ng-if="!action || action == 'edit'" ng-switch="action">
<a ng-switch-when="edit" ng-click="toggleEdit(false)">
Cancel
</a>
<a ng-switch-default ng-click="toggleEdit(true)">
Edit
</a>
</li>
<li>
<a ng-click="$dismiss()" class="navbar-quick-media-back">
<i class="icon icon-back"></i>
<div class="navbar-quick-back-title">
<h4 ng-switch="action">
<div ng-switch-when="new_group" ng-switch="selectedCount > 0">
<span ng-switch-when="true">
<ng-pluralize count="selectedCount" when="{'one': '1 participant', 'other': '{} participants'}">
</ng-pluralize>
</span>
<span ng-switch-default>New Group</span>
</div>
<span ng-switch-default>Contacts</span>
</h4>
</div>
</a>
</li>
</ul>
</div>
<div class="navbar navbar-static-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<ul class="nav navbar-nav navbar-quick-nav">
<li class="navbar-quick-right" ng-if="!action || action == 'edit'" ng-switch="action">
<a ng-switch-when="edit" ng-click="toggleEdit(false)">
Cancel
</a>
<a ng-switch-default ng-click="toggleEdit(true)">
Edit
</a>
</li>
<li>
<a ng-click="$dismiss()" class="navbar-quick-media-back">
<i class="icon icon-back"></i>
<div class="navbar-quick-back-title">
<h4 ng-switch="action">
<div ng-switch-when="new_group" ng-switch="selectedCount > 0">
<span ng-switch-when="true">
<ng-pluralize count="selectedCount" when="{'one': '1 participant', 'other': '{} participants'}">
</ng-pluralize>
</span>
<span ng-switch-default>New Group</span>
</div>
<span ng-switch-default>Contacts</span>
</h4>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="modal-body mobile_modal_body">

39
app/partials/phonebook_modal.html → app/partials/mobile/phonebook_modal.html

@ -1,12 +1,35 @@ @@ -1,12 +1,35 @@
<div class="contacts_modal_wrap" my-modal-position>
<div class="contacts_modal_wrap">
<a class="modal-close-button" ng-click="$dismiss()"><i></i></a>
<div class="tg_page_head tg_modal_head">
<div class="navbar navbar-static-top navbar-inverse">
<div class="container">
<div class="modal-body">
<div class="navbar-header">
<div class="contacts_modal_header">
<h4 class="contacts_modal_title">Phonebook</h4>
<ul class="nav navbar-nav navbar-quick-nav">
<li class="navbar-quick-right">
<a ng-click="toggleSelection()" ng-switch="selectedCount > 0">
<span ng-switch-when="true">Deselect all</span>
<span ng-switch-default>Select all</span>
</a>
</li>
<li>
<a ng-click="$dismiss()" class="navbar-quick-media-back">
<i class="icon icon-back"></i>
<div class="navbar-quick-back-title">
<h4>Phonebook</h4>
</div>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="modal-body mobile_modal_body">
<div class="contacts_modal_search">
<input class="form-control contacts_modal_search_field no_outline" my-focused type="search" placeholder="Search" ng-model="search.query"/>
@ -54,11 +77,7 @@ @@ -54,11 +77,7 @@
</div>
<div class="modal-footer contacts_modal_panel" ng-show="multiSelect">
<a class="btn btn-link pull-left" ng-click="toggleSelection()" ng-switch="selectedCount > 0">
<span ng-switch-when="true">Deselect all</span>
<span ng-switch-default>Select all</span>
</a>
<button class="btn btn-primary pull-right" ng-class="{disabled: !selectedCount || progress.enabled}" ng-disabled="!selectedCount || progress.enabled" ng-click="submitSelected()" type="submit" ng-switch="progress.enabled">
<button class="btn btn-primary" ng-class="{disabled: !selectedCount || progress.enabled}" ng-disabled="!selectedCount || progress.enabled" ng-click="submitSelected()" type="submit" ng-switch="progress.enabled">
<span ng-switch-when="true">Importing<span my-loading-dots></span></span>
<span ng-switch-default>Import contacts</span>
</button>
Loading…
Cancel
Save