diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-10-14 17:18:10 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-10-14 17:18:10 +0000 |
| commit | 74f334ee5ae5764294d2d0e876d38b3f069d29da (patch) | |
| tree | d26051e08a3bb1befcfa0cb8babff5b87f60cf51 | |
| parent | 4fa41eb99d4ce16e08958acd128b38baca179e53 (diff) | |
- Make icons skinable
- Show vcard icon on messages list when message is of type vcard
git-svn-id: https://svn.roundcube.net/trunk@4093 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | plugins/vcard_attachments/package.xml | 19 | ||||
| -rw-r--r-- | plugins/vcard_attachments/skins/default/vcard.png | bin | 0 -> 493 bytes | |||
| -rw-r--r-- | plugins/vcard_attachments/skins/default/vcard_add_contact.png (renamed from plugins/vcard_attachments/vcard_add_contact.png) | bin | 1361 -> 1361 bytes | |||
| -rw-r--r-- | plugins/vcard_attachments/vcard_attachments.php | 9 | ||||
| -rw-r--r-- | plugins/vcard_attachments/vcardattach.js | 12 |
5 files changed, 33 insertions, 7 deletions
diff --git a/plugins/vcard_attachments/package.xml b/plugins/vcard_attachments/package.xml index 64a92defb..b140f0002 100644 --- a/plugins/vcard_attachments/package.xml +++ b/plugins/vcard_attachments/package.xml @@ -19,11 +19,11 @@ <email>alec@alec.pl</email> <active>yes</active> </lead> - <date></date> - <time></time> + <date>2010-10-14</date> + <time>19:00</time> <version> - <release></release> - <api>2.0</api> + <release>3.0</release> + <api>3.0</api> </version> <stability> <release>stable</release> @@ -32,6 +32,8 @@ <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> <notes> - Exec contact_create hook when adding contact (#1486964) +- Make icons skinable +- Display vcard icon on messages list when message is of type vcard </notes> <contents> <dir baseinstalldir="/" name="/"> @@ -43,13 +45,20 @@ <tasks:replace from="@name@" to="name" type="package-info"/> <tasks:replace from="@package_version@" to="version" type="package-info"/> </file> + <file name="localization/cs_CZ.inc" role="data"></file> <file name="localization/en_US.inc" role="data"></file> <file name="localization/de_CH.inc" role="data"></file> <file name="localization/de_DE.inc" role="data"></file> + <file name="localization/es_ES.inc" role="data"></file> + <file name="localization/et_EE.inc" role="data"></file> + <file name="localization/ja_JP.inc" role="data"></file> + <file name="localization/es_ES.inc" role="data"></file> <file name="localization/pl_PL.inc" role="data"></file> <file name="localization/ru_RU.inc" role="data"></file> <file name="localization/sv_SE.inc" role="data"></file> - <file name="vcard_add_contact.png" role="data"></file> + <file name="localization/zh_TW.inc" role="data"></file> + <file name="skins/default/vcard_add_contact.png" role="data"></file> + <file name="skins/default/vcard.png" role="data"></file> </dir> <!-- / --> </contents> diff --git a/plugins/vcard_attachments/skins/default/vcard.png b/plugins/vcard_attachments/skins/default/vcard.png Binary files differnew file mode 100644 index 000000000..8bf6b1b72 --- /dev/null +++ b/plugins/vcard_attachments/skins/default/vcard.png diff --git a/plugins/vcard_attachments/vcard_add_contact.png b/plugins/vcard_attachments/skins/default/vcard_add_contact.png Binary files differindex 478c1f3f2..478c1f3f2 100644 --- a/plugins/vcard_attachments/vcard_add_contact.png +++ b/plugins/vcard_attachments/skins/default/vcard_add_contact.png diff --git a/plugins/vcard_attachments/vcard_attachments.php b/plugins/vcard_attachments/vcard_attachments.php index a4c1795b7..3fb3bf9ad 100644 --- a/plugins/vcard_attachments/vcard_attachments.php +++ b/plugins/vcard_attachments/vcard_attachments.php @@ -21,6 +21,11 @@ class vcard_attachments extends rcube_plugin $this->add_hook('message_load', array($this, 'message_load')); $this->add_hook('template_object_messagebody', array($this, 'html_output')); } + else if (!$rcmail->output->framed && (!$rcmail->action || $rcmail->action == 'list')) { + $icon = 'plugins/vcard_attachments/' .$this->local_skin_path(). '/vcard.png'; + $rcmail->output->set_env('vcard_icon', $icon); + $this->include_script('vcardattach.js'); + } $this->register_action('plugin.savevcard', array($this, 'save_vcard')); } @@ -57,6 +62,7 @@ class vcard_attachments extends rcube_plugin function html_output($p) { $attach_script = false; + $icon = 'plugins/vcard_attachments/' .$this->local_skin_path(). '/vcard_add_contact.png'; foreach ($this->vcard_parts as $part) { $vcards = rcube_vcard::import($this->message->get_part_content($part)); @@ -83,8 +89,7 @@ class vcard_attachments extends rcube_plugin 'href' => "#", 'onclick' => "return plugin_vcard_save_contact('".JQ($part.':'.$idx)."')", 'title' => $this->gettext('addvcardmsg')), - html::img(array('src' => $this->url('vcard_add_contact.png'), - 'style' => "vertical-align:middle"))) + html::img(array('src' => $icon, 'style' => "vertical-align:middle"))) . ' ' . html::span(null, Q($display))); } diff --git a/plugins/vcard_attachments/vcardattach.js b/plugins/vcard_attachments/vcardattach.js index 507bbdf99..ef19190e7 100644 --- a/plugins/vcard_attachments/vcardattach.js +++ b/plugins/vcard_attachments/vcardattach.js @@ -9,3 +9,15 @@ function plugin_vcard_save_contact(mime_id) return false; } + +function plugin_vcard_insertrow(data) +{ + var ctype = data.row.ctype; + if (ctype == 'text/vcard' || ctype == 'text/x-vcard' || ctype == 'text/directory') { + $('#rcmrow'+data.uid+' > td.attachment').html('<img src="'+rcmail.env.vcard_icon+'" alt="">'); + } +} + +if (window.rcmail && rcmail.gui_objects.messagelist) { + rcmail.addEventListener('insertrow', function(data, evt) { plugin_vcard_insertrow(data); }); +} |
