From 76ede3d16e81b09a58a12781e27b591a9e888360 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 31 Jul 2012 12:21:45 +0200 Subject: [PATCH] Implemented app settings in popup. --- css/contacts.css | 4 ++-- js/contacts.js | 10 ++++++++-- settings.php | 2 +- templates/index.php | 11 ++++++----- templates/settings.php | 3 +-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/css/contacts.css b/css/contacts.css index ddae27da..5350fdd5 100644 --- a/css/contacts.css +++ b/css/contacts.css @@ -14,8 +14,8 @@ #bottomcontrols { padding: 0; bottom:0px; height:2.8em; width: 20em; margin:0; background:#eee; border-top:1px solid #ccc; position:fixed; -moz-box-shadow: 0 -3px 3px -3px #000; -webkit-box-shadow: 0 -3px 3px -3px #000; box-shadow: 0 -3px 3px -3px #000;} #bottomcontrols img { margin-top: 0.35em; } #uploadprogressbar { display: none; padding: 0; bottom: 3em; height:2em; width: 20em; margin:0; background:#eee; border:1px solid #ccc; position:fixed; } -#contacts_newcontact, #contacts_import, #chooseaddressbook { float: left; margin: 0.2em 0 0 1em; border: 0 none; border-radius: 0; -moz-box-shadow: none; box-shadow: none; outline: 0 none; } -#chooseaddressbook { float: right; margin: 0.2em 1em 0 0; } +#contacts_newcontact, #bottomcontrols .settings { float: left; margin: 0.2em 0 0 1em; border: 0 none; border-radius: 0; -moz-box-shadow: none; box-shadow: none; outline: 0 none; } +#bottomcontrols .settings { float: right; margin: 0.2em 1em 0 0; } #actionbar { clear: both; height: 30px;} #contacts_deletecard {position:relative; float:left; background:url('%webroot%/core/img/actions/delete.svg') no-repeat center; } #contacts_downloadcard {position:relative; float:left; background:url('%webroot%/core/img/actions/download.svg') no-repeat center; } diff --git a/js/contacts.js b/js/contacts.js index 34961360..b79608a8 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -279,7 +279,7 @@ Contacts={ $('#contacts_deletecard').tipsy({gravity: 'ne'}); $('#contacts_downloadcard').tipsy({gravity: 'ne'}); $('#contacts_propertymenu_button').tipsy(); - $('#contacts_newcontact, #contacts_import, #chooseaddressbook').tipsy({gravity: 'sw'}); + $('#contacts_newcontact, #contacts_import, #bottomcontrols .settings').tipsy({gravity: 'sw'}); $('body').click(function(e){ if(!$(e.target).is('#contacts_propertymenu_button')) { @@ -1745,7 +1745,13 @@ $(document).ready(function(){ OCCategories.changed = Contacts.UI.Card.categoriesChanged; OCCategories.app = 'contacts'; - $('#chooseaddressbook').on('click keydown', Contacts.UI.Addressbooks.overview); + //$('#chooseaddressbook').on('click keydown', Contacts.UI.Addressbooks.overview); + $('#bottomcontrols .settings').on('click keydown', function() { + OC.appSettings('contacts'); + }); + $('#bottomcontrols .import').click(function() { + $('#import_upload_start').trigger('click'); + }); $('#contacts_newcontact').on('click keydown', Contacts.UI.Card.editNew); var ninjahelp = $('#ninjahelp'); diff --git a/settings.php b/settings.php index a0794993..5f639399 100644 --- a/settings.php +++ b/settings.php @@ -3,4 +3,4 @@ $tmpl = new OCP\Template( 'contacts', 'settings'); $tmpl->assign('addressbooks', OC_Contacts_Addressbook::all(OCP\USER::getUser()), false); -return $tmpl->fetchPage(); +$tmpl->printPage(); diff --git a/templates/index.php b/templates/index.php index b2dde126..7ff139e3 100644 --- a/templates/index.php +++ b/templates/index.php @@ -11,19 +11,20 @@
-
- - + + + + +
+ inc('part.contact'); diff --git a/templates/settings.php b/templates/settings.php index f520559d..c42de12f 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -1,6 +1,5 @@ -
+
- t('Contacts'); ?> t('CardDAV syncing addresses'); ?> (t('more info'); ?>)
t('Primary address (Kontact et al)'); ?>