From c5a5f989a9bf91927e6bb627f9f789800ce02fad Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Fri, 1 Feb 2013 15:24:33 +0100 Subject: Allow to list contact groups in (paged) list (yet incomplete) --- skins/larry/addressbook.css | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'skins') diff --git a/skins/larry/addressbook.css b/skins/larry/addressbook.css index ff3951497..bd2b05b26 100644 --- a/skins/larry/addressbook.css +++ b/skins/larry/addressbook.css @@ -141,6 +141,17 @@ font-weight: bold; } +#contacts-table .group td.name { + background-position: 6px -1555px; +} + +#contacts-table .group.selected td.name, +#contacts-table .group.unfocused td.name { + background-position: 6px -1579px; + font-weight: bold; +} + + #contact-frame { position: absolute; top: 0; -- cgit v1.2.3 From 86552ffc8f0f76651747a1faaed9bbda6d015f98 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 7 Feb 2013 15:35:30 +0100 Subject: Finish hierarchical groups browsing in LDAP address books; add according UI elements and styles to the skins; adapt habavior of the compose address book widget --- program/js/app.js | 84 +++++++++++++++++++++++-------- program/lib/Roundcube/rcube_ldap.php | 23 ++++----- program/steps/addressbook/func.inc | 32 +++++++++--- program/steps/addressbook/list.inc | 5 ++ program/steps/addressbook/show.inc | 5 +- program/steps/mail/list_contacts.inc | 29 +++++++++-- skins/classic/addressbook.css | 31 ++++++++++++ skins/classic/images/contactgroup.png | Bin 0 -> 1038 bytes skins/classic/mail.css | 8 +++ skins/classic/templates/addressbook.html | 2 +- skins/classic/templates/contact.html | 2 +- skins/larry/addressbook.css | 31 ++++++++++-- skins/larry/ie7hacks.css | 1 + skins/larry/images/contactgroup.png | Bin 0 -> 2104 bytes skins/larry/images/listicons.png | Bin 25486 -> 32360 bytes skins/larry/mail.css | 13 +++++ skins/larry/templates/addressbook.html | 2 +- skins/larry/templates/contact.html | 2 +- 18 files changed, 217 insertions(+), 53 deletions(-) create mode 100644 skins/classic/images/contactgroup.png create mode 100644 skins/larry/images/contactgroup.png (limited to 'skins') diff --git a/program/js/app.js b/program/js/app.js index 0445004f2..31a96b5a0 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -251,7 +251,7 @@ function rcube_webmail() } } else if (this.env.action == 'compose') { - this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel', 'toggle-editor', 'list-adresses', 'search', 'reset-search', 'extwin']; + this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel', 'toggle-editor', 'list-adresses', 'pushgroup', 'search', 'reset-search', 'extwin']; if (this.env.drafts_mailbox) this.env.compose_commands.push('savedraft') @@ -324,6 +324,8 @@ function rcube_webmail() this.enable_command('add', 'import', this.env.writable_source); this.enable_command('list', 'listgroup', 'pushgroup', 'listsearch', 'advanced-search', true); + this.env.address_group_stack = []; + if (this.gui_objects.contactslist) { this.contact_list = new rcube_list_widget(this.gui_objects.contactslist, {multiselect:true, draggable:this.gui_objects.folderlist?true:false, keyboard:true}); @@ -1081,7 +1083,11 @@ function rcube_webmail() break; case 'pushgroup': - // TODO: so some magic stuff here + // add group ID to stack + this.env.address_group_stack.push(props.id); + if (obj && event) + rcube_event.cancel(event); + case 'listgroup': this.reset_qsearch(); this.list_contacts(props.source, props.id); @@ -3061,7 +3067,13 @@ function rcube_webmail() this.compose_recipient_select = function(list) { - this.enable_command('add-recipient', list.selection.length > 0); + var id, n, recipients = 0; + for (n=0; n < list.selection.length; n++) { + id = list.selection[n]; + if (this.env.contactdata[id]) + recipients++; + } + this.enable_command('add-recipient', recipients); }; this.compose_add_recipient = function(field) @@ -4030,7 +4042,7 @@ function rcube_webmail() if (this.preview_timer) clearTimeout(this.preview_timer); - var n, id, sid, ref = this, writable = false, + var n, id, sid, contact, ref = this, writable = false, source = this.env.source ? this.env.address_sources[this.env.source] : null; if (id = list.get_single_selection()) @@ -4044,29 +4056,35 @@ function rcube_webmail() // we'll also need to know sources used in selection for copy // and group-addmember operations (drag&drop) this.env.selection_sources = []; - if (!source) { - for (n in list.selection) { + + if (source) { + this.env.selection_sources.push(this.env.source); + } + + for (n in list.selection) { + contact = list.data[list.selection[n]]; + if (!source) { sid = String(list.selection[n]).replace(/^[^-]+-/, ''); if (sid && this.env.address_sources[sid]) { - writable = writable || !this.env.address_sources[sid].readonly; + writable = writable || (!this.env.address_sources[sid].readonly && !contact.readonly); this.env.selection_sources.push(sid); } } - this.env.selection_sources = $.unique(this.env.selection_sources); - } - else { - this.env.selection_sources.push(this.env.source); - writable = !source.readonly; + else { + writable = writable || (!source.readonly && !contact.readonly); + } } + + this.env.selection_sources = $.unique(this.env.selection_sources); } // if a group is currently selected, and there is at least one contact selected // thend we can enable the group-remove-selected command - this.enable_command('group-remove-selected', this.env.group && list.selection.length > 0); + this.enable_command('group-remove-selected', this.env.group && list.selection.length > 0 && writable); this.enable_command('compose', this.env.group || list.selection.length > 0); this.enable_command('export-selected', list.selection.length > 0); this.enable_command('edit', id && writable); - this.enable_command('delete', list.selection.length && writable); + this.enable_command('delete', list.selection.length > 0 && writable); return false; }; @@ -4094,11 +4112,29 @@ function rcube_webmail() else if (!this.env.search_request) folder = group ? 'G'+src+group : src; - this.select_folder(folder, '', true); - this.env.source = src; this.env.group = group; + // truncate groups listing stack + var index = $.inArray(this.env.group, this.env.address_group_stack); + if (index < 0) + this.env.address_group_stack = []; + else + this.env.address_group_stack = this.env.address_group_stack.slice(0,index); + + // make sure the current group is on top of the stack + if (this.env.group) { + this.env.address_group_stack.push(this.env.group); + + // mark the first group on the stack as selected in the directory list + folder = 'G'+src+this.env.address_group_stack[0]; + } + else if (this.gui_objects.addresslist_title) { + $(this.gui_objects.addresslist_title).html(this.get_label('contacts')); + } + + this.select_folder(folder, '', true); + // load contacts remotely if (this.gui_objects.contactslist) { this.list_contacts_remote(src, group, page); @@ -4160,16 +4196,20 @@ function rcube_webmail() this.enable_command('compose', this.env.group ? true : false); }; + this.set_group_prop = function(prop) + { + if (this.gui_objects.addresslist_title) + $(this.gui_objects.addresslist_title).html(prop.name); + + this.triggerEvent('groupupdate', prop); + }; + // load contact record this.load_contact = function(cid, action, framed) { var win, url = {}, target = window, rec = this.contact_list.data[cid]; - if (rec && rec.type == 'group') { - alert('group ' + cid) - } - if (win = this.get_frame_window(this.env.contentframe)) { url._framed = 1; target = win; @@ -4178,7 +4218,9 @@ function rcube_webmail() // load dummy content, unselect selected row(s) if (!cid) this.contact_list.clear_selection(); - this.enable_command('delete', 'compose', 'export-selected', cid); + + this.enable_command('compose', rec.email); + this.enable_command('export-selected', rec._type != 'group'); } else if (framed) return false; diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php index e54e65984..72904901d 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -924,7 +924,7 @@ class rcube_ldap extends rcube_addressbook // We have a connection but no result set, attempt to get one. if (empty($this->filter)) { // The filter is not set, set it. - $this->filter = $this->prop['filter']; + $this->filter = $prop['filter']; } $count = (int) $this->_exec_search($prop, true); @@ -1299,7 +1299,7 @@ class rcube_ldap extends rcube_addressbook // change the group membership of the contact if ($this->groups) { $group_ids = $this->get_record_groups($dn); - foreach ($group_ids as $group_id) + foreach ($group_ids as $group_id => $group_prop) { $this->remove_from_group($group_id, $dn); $this->add_to_group($group_id, $newdn); @@ -1365,7 +1365,7 @@ class rcube_ldap extends rcube_addressbook if ($this->groups) { $dn = self::dn_encode($dn); $group_ids = $this->get_record_groups($dn); - foreach ($group_ids as $group_id) { + foreach ($group_ids as $group_id => $group_prop) { $this->remove_from_group($group_id, $dn); } } @@ -1735,11 +1735,11 @@ class rcube_ldap extends rcube_addressbook // list regular groups configuration as special filter if (!empty($this->prop['groups']['filter'])) { $id = '__groups__'; - $groups[$id] = array('ID' => $id, 'name' => rcube_label('groups')) + $this->prop['groups']; + $groups[$id] = array('ID' => $id, 'name' => rcube_label('groups'), 'virtual' => true) + $this->prop['groups']; } foreach ($this->prop['group_filters'] as $id => $prop) { - $groups[$id] = $prop + array('ID' => $id, 'name' => ucfirst($id)); + $groups[$id] = $prop + array('ID' => $id, 'name' => ucfirst($id), 'virtual' => true); } return $groups; @@ -1830,7 +1830,7 @@ class rcube_ldap extends rcube_addressbook $dn = self::dn_decode($group_id); $this->_debug("C: Read Group [dn: $dn]"); - if ($result = @ldap_read($this->conn, $dn, '(objectClass=*)', array('dn','objectClass','member','uniqueMember','memberURL',$name_attr))) { + if ($result = @ldap_read($this->conn, $dn, '(objectClass=*)', array('dn','objectClass','member','uniqueMember','memberURL',$name_attr,$this->fieldmap['email']))) { $list = ldap_get_entries($this->conn, $result); $entry = $list[0]; $group_name = is_array($entry[$name_attr]) ? $entry[$name_attr][0] : $entry[$name_attr]; @@ -1858,10 +1858,7 @@ class rcube_ldap extends rcube_addressbook */ function get_group($group_id) { - if (($group_cache = $this->cache->get('groups')) === null) - $group_cache = $this->_fetch_groups(); - - $group_data = $group_cache[$group_id]; + $group_data = $this->get_group_entry($group_id); unset($group_data['dn'], $group_data['member_attr']); return $group_data; @@ -2040,7 +2037,7 @@ class rcube_ldap extends rcube_addressbook $this->_debug("C: Search [$filter][dn: $base_dn]"); - $res = @ldap_search($this->conn, $base_dn, $filter, array($name_attr)); + $res = @ldap_search($this->conn, $base_dn, $filter, array('dn', $name_attr)); if ($res === false) { $this->_debug("S: ".ldap_error($this->conn)); @@ -2053,8 +2050,8 @@ class rcube_ldap extends rcube_addressbook for ($i=0; $i<$ldap_data["count"]; $i++) { $group_name = $ldap_data[$i][$name_attr][0]; - $group_id = self::dn_encode($group_name); - $groups[$group_id] = $group_id; + $group_id = self::dn_encode($ldap_data[$i]['dn']); + $groups[$group_id] = array('ID' => $group_id, 'name' => $group_name, 'dn' => $ldap_data[$i]['dn']); } return $groups; } diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index f921c8cda..4d4bf2246 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -343,6 +343,8 @@ function rcmail_js_contacts_list($result, $prefix='') while ($row = $result->next()) { $row['CID'] = $row['ID']; + $row['email'] = reset(rcube_addressbook::get_col_values('email', $row, true)); + $source_id = $OUTPUT->get_env('source'); $a_row_cols = array(); $classes = array($row['_type'] ? $row['_type'] : 'person'); @@ -367,7 +369,7 @@ function rcmail_js_contacts_list($result, $prefix='') 'href' => '#list', 'rel' => $row['ID'], 'title' => rcube_label('listgroup'), - 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this)", JS_OBJECT_NAME, $source_id, $row['CID']), + 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", JS_OBJECT_NAME, $source_id, $row['CID']), ), '»'); } break; @@ -383,11 +385,25 @@ function rcmail_js_contacts_list($result, $prefix='') if ($row['readonly']) $classes[] = 'readonly'; - $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols, join(' ', $classes), $row); + $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols, join(' ', $classes), array_intersect_key($row, array('ID'=>1,'readonly'=>1,'_type'=>1,'email'=>1,'name'=>1))); } } +function rcmail_contacts_list_title($attrib) +{ + global $OUTPUT; + + $attrib += array('label' => 'contacts', 'id' => 'rcmabooklisttitle', 'tag' => 'span'); + unset($attrib['name']); + + $OUTPUT->add_gui_object('addresslist_title', $attrib['id']); + $OUTPUT->add_label('contacts'); + + return html::tag($attrib['tag'], $attrib, rcube_label($attrib['label']), html::$common_attrib); +} + + // similar function as /steps/settings/identities.inc::rcmail_identity_frame() function rcmail_contact_frame($attrib) { @@ -456,7 +472,7 @@ function rcmail_get_type_label($type) function rcmail_contact_form($form, $record, $attrib = null) { - global $RCMAIL, $CONFIG; + global $RCMAIL; // Allow plugins to modify contact form content $plugin = $RCMAIL->plugins->exec_hook('contact_form', array( @@ -465,7 +481,7 @@ function rcmail_contact_form($form, $record, $attrib = null) $form = $plugin['form']; $record = $plugin['record']; $edit_mode = $RCMAIL->action != 'show'; - $del_button = $attrib['deleteicon'] ? html::img(array('src' => $CONFIG['skin_path'] . $attrib['deleteicon'], 'alt' => rcube_label('delete'))) : rcube_label('delete'); + $del_button = $attrib['deleteicon'] ? html::img(array('src' => $RCMAIL->output->get_skin_file($attrib['deleteicon']), 'alt' => rcube_label('delete'))) : rcube_label('delete'); unset($attrib['deleteicon']); $out = ''; @@ -731,12 +747,15 @@ function rcmail_contact_form($form, $record, $attrib = null) function rcmail_contact_photo($attrib) { - global $SOURCE_ID, $CONTACTS, $CONTACT_COLTYPES, $RCMAIL, $CONFIG; + global $SOURCE_ID, $CONTACTS, $CONTACT_COLTYPES, $RCMAIL; if ($result = $CONTACTS->get_result()) $record = $result->first(); - $photo_img = $attrib['placeholder'] ? $CONFIG['skin_path'] . $attrib['placeholder'] : 'program/resources/blank.gif'; + $photo_img = $attrib['placeholder'] ? $RCMAIL->output->get_skin_file($attrib['placeholder']) : 'program/resources/blank.gif'; + if ($record['_type'] == 'group' && $attrib['placeholdergroup']) + $photo_img = $RCMAIL->output->get_skin_file($attrib['placeholdergroup']); + $RCMAIL->output->set_env('photo_placeholder', $photo_img); unset($attrib['placeholder']); @@ -820,6 +839,7 @@ $OUTPUT->add_handlers(array( 'directorylist' => 'rcmail_directory_list', // 'groupslist' => 'rcmail_contact_groups', 'addresslist' => 'rcmail_contacts_list', + 'addresslisttitle' => 'rcmail_contacts_list_title', 'addressframe' => 'rcmail_contact_frame', 'recordscountdisplay' => 'rcmail_rowcount_display', 'searchform' => array($OUTPUT, 'search_form') diff --git a/program/steps/addressbook/list.inc b/program/steps/addressbook/list.inc index 1bb28658b..6f3a3e0f3 100644 --- a/program/steps/addressbook/list.inc +++ b/program/steps/addressbook/list.inc @@ -81,6 +81,11 @@ else { $OUTPUT->show_message('contactsearchonly', 'notice'); $OUTPUT->command('command', 'advanced-search'); } + + if ($CONTACTS->group_id) { + $OUTPUT->command('set_group_prop', array('ID' => $CONTACTS->group_id) + + array_intersect_key((array)$CONTACTS->get_group($CONTACTS->group_id), array('name'=>1,'email'=>1))); + } } // update message count display diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc index 16be89f94..b5870f463 100644 --- a/program/steps/addressbook/show.inc +++ b/program/steps/addressbook/show.inc @@ -215,8 +215,11 @@ function rcmail_contact_record_groups($contact_id) $checkbox = new html_checkbox(array('name' => '_gid[]', 'class' => 'groupmember', 'disabled' => $CONTACTS->readonly)); - foreach ($GROUPS as $group) { + foreach (array_merge($GROUPS, $members) as $group) { $gid = $group['ID']; + if ($seen[$gid]++) + continue; + $table->add(null, $checkbox->show($members[$gid] ? $gid : null, array('value' => $gid, 'id' => 'ff_gid' . $gid))); $table->add(null, html::label('ff_gid' . $gid, Q($group['name']))); diff --git a/program/steps/mail/list_contacts.inc b/program/steps/mail/list_contacts.inc index 7e3b349cd..a48109fed 100644 --- a/program/steps/mail/list_contacts.inc +++ b/program/steps/mail/list_contacts.inc @@ -73,8 +73,11 @@ else { $CONTACTS->set_pagesize($page_size); $CONTACTS->set_page($page); + if ($group_id = get_input_value('_gid', RCUBE_INPUT_GPC)) { + $CONTACTS->set_group($group_id); + } // list groups of this source (on page one) - if ($CONTACTS->groups && $CONTACTS->list_page == 1) { + else if ($CONTACTS->groups && $CONTACTS->list_page == 1) { foreach ($CONTACTS->list_groups() as $group) { $CONTACTS->reset(); $CONTACTS->set_group($group['ID']); @@ -89,6 +92,19 @@ else { 'contactgroup' => html::span(array('title' => $email), Q($group['name']))), 'group'); } } + // make virtual groups clickable to list their members + else if ($group_prop['virtual']) { + $row_id = 'G'.$group['ID']; + $OUTPUT->command('add_contact_row', $row_id, array( + 'contactgroup' => html::a(array( + 'href' => '#list', + 'rel' => $row['ID'], + 'title' => rcube_label('listgroup'), + 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", JS_OBJECT_NAME, $source, $group['ID']), + ), Q($group['name']) . ' ' . html::span('action', '»'))), + 'group', + array('ID' => $group['ID'], 'name' => $group['name'], 'virtual' => true)); + } // show group with count else if (($result = $CONTACTS->count()) && $result->count) { $row_id = 'E'.$group['ID']; @@ -97,10 +113,12 @@ else { 'contactgroup' => Q($group['name'] . ' (' . intval($result->count) . ')')), 'group'); } } + + $CONTACTS->reset(); + $CONTACTS->set_group(0); } // get contacts for this user - $CONTACTS->set_group(0); $result = $CONTACTS->list_records($afields); } } @@ -118,10 +136,13 @@ else if (!empty($result) && $result->count > 0) { foreach ($emails as $i => $email) { $row_id = $row['ID'].$i; $jsresult[$row_id] = format_email_recipient($email, $name); + $classname = $row['_type'] == 'group' ? 'group' : 'person'; + $keyname = $row['_type'] == 'group' ? 'contactgroup' : 'contact'; + $OUTPUT->command('add_contact_row', $row_id, array( - 'contact' => html::span(array('title' => $email), Q($name ? $name : $email) . + $keyname => html::span(array('title' => $email), Q($name ? $name : $email) . ($name && count($emails) > 1 ? ' ' . html::span('email', Q($email)) : '') - )), 'person'); + )), $classname); } } } diff --git a/skins/classic/addressbook.css b/skins/classic/addressbook.css index 5afa4592f..415142e0c 100644 --- a/skins/classic/addressbook.css +++ b/skins/classic/addressbook.css @@ -224,6 +224,37 @@ -o-text-overflow: ellipsis; } +#contacts-table .contact.readonly td +{ + font-style: italic; +} + +#contacts-table td.name +{ + width: 95%; +} + +#contacts-table td.action +{ + width: 12px; + padding: 0px 6px 0 4px; + text-align: right; +} + +#contacts-table td.action a +{ + font-size: 16px; + font-weight: bold; + font-style: normal; + text-decoration: none; + color: #333; +} + +#contacts-table .selected td.action a +{ + color: #fff; +} + #contacts-box { position: absolute; diff --git a/skins/classic/images/contactgroup.png b/skins/classic/images/contactgroup.png new file mode 100644 index 000000000..c46383255 Binary files /dev/null and b/skins/classic/images/contactgroup.png differ diff --git a/skins/classic/mail.css b/skins/classic/mail.css index 8be35aaa6..d0ea4b369 100644 --- a/skins/classic/mail.css +++ b/skins/classic/mail.css @@ -1666,6 +1666,14 @@ input.from_address -o-text-overflow: ellipsis; } +#contacts-table td span.email +{ + display: inline; + color: #ccc; + font-style: italic; + margin-left: 0.5em; +} + #abookcountbar { margin-top: 4px; diff --git a/skins/classic/templates/addressbook.html b/skins/classic/templates/addressbook.html index 9d959d5ef..4d809095b 100644 --- a/skins/classic/templates/addressbook.html +++ b/skins/classic/templates/addressbook.html @@ -74,7 +74,7 @@
-
+
diff --git a/skins/classic/templates/contact.html b/skins/classic/templates/contact.html index d74a78b27..8be112b49 100644 --- a/skins/classic/templates/contact.html +++ b/skins/classic/templates/contact.html @@ -13,7 +13,7 @@
:
-
+
diff --git a/skins/larry/addressbook.css b/skins/larry/addressbook.css index bd2b05b26..8d8a61b88 100644 --- a/skins/larry/addressbook.css +++ b/skins/larry/addressbook.css @@ -75,10 +75,6 @@ text-overflow: ellipsis; } -#contacts-table .contact.readonly td { - font-style: italic; -} - #directorylist li.addressbook a { background-position: 6px -766px; } @@ -131,6 +127,28 @@ left: 20px; } +#contacts-table .contact.readonly td { + font-style: italic; +} + +#contacts-table td.name { + width: 95%; +} + +#contacts-table td.action { + width: 24px; + padding: 4px; +} + +#contacts-table td.action a { + display: block; + width: 16px; + height: 14px; + text-indent: -5000px; + overflow: hidden; + background: url(images/listicons.png) -2px -1180px no-repeat; +} + #contacts-table .contact td.name { background-position: 6px -1603px; } @@ -151,6 +169,11 @@ font-weight: bold; } +#addresslist .boxtitle { + padding-right: 95px; + overflow: hidden; + text-overflow: ellipsis; +} #contact-frame { position: absolute; diff --git a/skins/larry/ie7hacks.css b/skins/larry/ie7hacks.css index 6d7af4787..fc4713361 100644 --- a/skins/larry/ie7hacks.css +++ b/skins/larry/ie7hacks.css @@ -41,6 +41,7 @@ a.deletebutton, .boxfooter .listbutton .inner, .attachmentslist li a.delete, .attachmentslist li a.cancelupload, +#contacts-table td.action a, .previewheader .iconlink, .minimal #taskbar .button-inner { /* workaround for text-indent which also offsets the background image */ diff --git a/skins/larry/images/contactgroup.png b/skins/larry/images/contactgroup.png new file mode 100644 index 000000000..8303cf02f Binary files /dev/null and b/skins/larry/images/contactgroup.png differ diff --git a/skins/larry/images/listicons.png b/skins/larry/images/listicons.png index f4505d4fa..5e48f1737 100644 Binary files a/skins/larry/images/listicons.png and b/skins/larry/images/listicons.png differ diff --git a/skins/larry/mail.css b/skins/larry/mail.css index c99370830..e61fe3046 100644 --- a/skins/larry/mail.css +++ b/skins/larry/mail.css @@ -1224,6 +1224,19 @@ div.message-partheaders .headers-table td.header { text-overflow: ellipsis; } +#contacts-table td.contactgroup a { + color: #376572; + text-decoration: none; +} + +#contacts-table td.contactgroup a span { + display: inline-block; + font-size: 16px; + font-weight: bold; + line-height: 11px; + margin-left: 0.3em; +} + #contacts-table tr:first-child td { border-top: 0; } diff --git a/skins/larry/templates/addressbook.html b/skins/larry/templates/addressbook.html index 401640f1f..d9e491f99 100644 --- a/skins/larry/templates/addressbook.html +++ b/skins/larry/templates/addressbook.html @@ -50,7 +50,7 @@
-

+
diff --git a/skins/larry/templates/contact.html b/skins/larry/templates/contact.html index d252049cd..59fe6f79f 100644 --- a/skins/larry/templates/contact.html +++ b/skins/larry/templates/contact.html @@ -13,7 +13,7 @@
:
-
+

-- cgit v1.2.3 From de98a897f618c4d251a4d3a5e3d2e4f2bb9a441b Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 7 Feb 2013 17:18:54 +0100 Subject: Add link to pop the address group stack; add animations when pushing/popping lists (in larry skin) --- program/js/app.js | 31 ++++++++++++++++++++++++++----- program/steps/addressbook/func.inc | 2 ++ skins/larry/addressbook.css | 7 +++++++ skins/larry/images/listicons.png | Bin 32360 -> 26384 bytes skins/larry/styles.css | 4 ++++ skins/larry/ui.js | 33 ++++++++++++++++++++++++++++++++- 6 files changed, 71 insertions(+), 6 deletions(-) (limited to 'skins') diff --git a/program/js/app.js b/program/js/app.js index 31a96b5a0..f9b72cdc2 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -251,6 +251,7 @@ function rcube_webmail() } } else if (this.env.action == 'compose') { + this.env.address_group_stack = []; this.env.compose_commands = ['send-attachment', 'remove-attachment', 'send', 'cancel', 'toggle-editor', 'list-adresses', 'pushgroup', 'search', 'reset-search', 'extwin']; if (this.env.drafts_mailbox) @@ -318,13 +319,13 @@ function rcube_webmail() break; case 'addressbook': + this.env.address_group_stack = []; + if (this.gui_objects.folderlist) this.env.contactfolders = $.extend($.extend({}, this.env.address_sources), this.env.contactgroups); this.enable_command('add', 'import', this.env.writable_source); - this.enable_command('list', 'listgroup', 'pushgroup', 'listsearch', 'advanced-search', true); - - this.env.address_group_stack = []; + this.enable_command('list', 'listgroup', 'pushgroup', 'popgroup', 'listsearch', 'advanced-search', true); if (this.gui_objects.contactslist) { this.contact_list = new rcube_list_widget(this.gui_objects.contactslist, @@ -1093,6 +1094,14 @@ function rcube_webmail() this.list_contacts(props.source, props.id); break; + case 'popgroup': + if (this.env.address_group_stack.length > 1) { + this.env.address_group_stack.pop(); + this.reset_qsearch(); + this.list_contacts(props.source, this.env.address_group_stack[this.env.address_group_stack.length-1]); + } + break; + case 'import': if (this.env.action == 'import' && this.gui_objects.importform) { var file = document.getElementById('rcmimportfile'); @@ -4198,8 +4207,20 @@ function rcube_webmail() this.set_group_prop = function(prop) { - if (this.gui_objects.addresslist_title) - $(this.gui_objects.addresslist_title).html(prop.name); + if (this.gui_objects.addresslist_title) { + var boxtitle = $(this.gui_objects.addresslist_title).html(''); // clear contents + + // add link to pop back to parent group + if (this.env.address_group_stack.length > 1) { + $('...') + .addClass('poplink') + .appendTo(boxtitle) + .click(function(e){ return ref.command('popgroup','',this); }); + boxtitle.append(' » '); + } + + boxtitle.append($(''+prop.name+'')); + } this.triggerEvent('groupupdate', prop); }; diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 4d4bf2246..60a19845e 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -372,6 +372,8 @@ function rcmail_js_contacts_list($result, $prefix='') 'onclick' => sprintf("return %s.command('pushgroup',{'source':'%s','id':'%s'},this,event)", JS_OBJECT_NAME, $source_id, $row['CID']), ), '»'); } + else + $val = ' '; break; default: diff --git a/skins/larry/addressbook.css b/skins/larry/addressbook.css index 8d8a61b88..090e54c7b 100644 --- a/skins/larry/addressbook.css +++ b/skins/larry/addressbook.css @@ -175,6 +175,13 @@ text-overflow: ellipsis; } +#addresslist .boxtitle a.poplink { + color: #004458; + font-size: 14px; + line-height: 12px; + text-decoration: none; +} + #contact-frame { position: absolute; top: 0; diff --git a/skins/larry/images/listicons.png b/skins/larry/images/listicons.png index 5e48f1737..e4ffef660 100644 Binary files a/skins/larry/images/listicons.png and b/skins/larry/images/listicons.png differ diff --git a/skins/larry/styles.css b/skins/larry/styles.css index 613a08aa1..335641394 100644 --- a/skins/larry/styles.css +++ b/skins/larry/styles.css @@ -995,6 +995,10 @@ table.listing tr.droptarget td { background-color: #e8e798; } +.listbox table.listing { + background-color: #d9ecf4; +} + table.listing, table.layout { border: 0; diff --git a/skins/larry/ui.js b/skins/larry/ui.js index d2638bbca..dad109319 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -175,6 +175,8 @@ function rcube_mail_ui() /*** addressbook task ***/ else if (rcmail.env.task == 'addressbook') { rcmail.addEventListener('afterupload-photo', show_uploadform); + rcmail.addEventListener('beforepushgroup', push_contactgroup); + rcmail.addEventListener('beforepopgroup', pop_contactgroup); if (rcmail.env.action == '') { new rcube_splitter({ id:'addressviewsplitterd', p1:'#addressview-left', p2:'#addressview-right', @@ -745,6 +747,35 @@ function rcube_mail_ui() }); } + function push_contactgroup(p) + { + // lets the contacts list swipe to the left, nice! + var table = $('#contacts-table'), + scroller = table.parent().css('overflow', 'hidden'); + + table.clone() + .css({ position:'absolute', top:'0', left:'0', width:table.width()+'px', 'z-index':10 }) + .appendTo(scroller) + .animate({ left: -(table.width()+5) + 'px' }, 300, 'swing', function(){ + $(this).remove(); + scroller.css('overflow', 'auto') + }); + } + + function pop_contactgroup(p) + { + // lets the contacts list swipe to the left, nice! + var table = $('#contacts-table'), + scroller = table.parent().css('overflow', 'hidden'), + clone = table.clone().appendTo(scroller); + + table.css({ position:'absolute', top:'0', left:-(table.width()+5) + 'px', width:table.width()+'px', height:table.height()+'px', 'z-index':10 }) + .animate({ left:'0' }, 300, 'linear', function(){ + clone.remove(); + $(this).css({ position:'relative', left:'0', width:'100%', height:'auto', 'z-index':1 }); + scroller.css('overflow', 'auto') + }); + } function show_uploadform() { @@ -755,7 +786,7 @@ function rcube_mail_ui() $dialog.dialog('close'); return; } - + // add icons to clone file input field if (rcmail.env.action == 'compose' && !$dialog.data('extended')) { $('') -- cgit v1.2.3 From e11e7e786b01672962a9819c1fd0a65402ce4f30 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Sun, 16 Jun 2013 20:25:39 +0200 Subject: Add UI elements for message import to classic skin --- skins/classic/functions.js | 1 + skins/classic/mail.css | 3 +++ skins/classic/templates/mail.html | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'skins') diff --git a/skins/classic/functions.js b/skins/classic/functions.js index 5dd332ab7..d10812c57 100644 --- a/skins/classic/functions.js +++ b/skins/classic/functions.js @@ -967,6 +967,7 @@ function rcube_init_mail_ui() rcmail.addEventListener('responseaftergetunread', rcube_render_mailboxlist); rcmail.addEventListener('responseaftercheck-recent', rcube_render_mailboxlist); rcmail.addEventListener('aftercollapse-folder', rcube_render_mailboxlist); + rcmail.addEventListener('afterimport-messages', function(){ rcmail_ui.show_popup('uploadform', false); }); new rcmail_scroller('#mailboxlist-content', '#mailboxlist-title', '#mailboxlist-footer'); } diff --git a/skins/classic/mail.css b/skins/classic/mail.css index 7c350ca3d..b99c599b4 100644 --- a/skins/classic/mail.css +++ b/skins/classic/mail.css @@ -1600,16 +1600,19 @@ input.from_address vertical-align: middle; } +#upload-form, #attachment-form { padding: 6px; } +#upload-form div, #attachment-form div { padding: 2px; } +#upload-form div.buttons, #attachment-form div.buttons { margin-top: 4px; diff --git a/skins/classic/templates/mail.html b/skins/classic/templates/mail.html index c7010e87c..c3b4004cc 100644 --- a/skins/classic/templates/mail.html +++ b/skins/classic/templates/mail.html @@ -140,7 +140,8 @@
  • -
  • +
  • +
@@ -204,5 +205,7 @@
+ + -- cgit v1.2.3