summaryrefslogtreecommitdiff
path: root/skins/larry
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-03-06 11:11:37 +0100
committerAleksander Machniak <alec@alec.pl>2013-03-06 11:11:37 +0100
commitbc2c4380b5b754a3b13cc7d6663b2b81d2577e2e (patch)
tree7a3c360113d21a5f7c6d0e90b252ce5965dd3589 /skins/larry
parentac37746c2ae187edaf38c7a660213e216f90b035 (diff)
Add attachment menu with Open and Download options (#1488975)
Diffstat (limited to 'skins/larry')
-rw-r--r--skins/larry/images/buttons.gifbin13054 -> 14997 bytes
-rw-r--r--skins/larry/images/buttons.pngbin36693 -> 48308 bytes
-rw-r--r--skins/larry/mail.css2
-rw-r--r--skins/larry/styles.css13
-rw-r--r--skins/larry/templates/message.html8
-rw-r--r--skins/larry/templates/messagepreview.html8
-rw-r--r--skins/larry/ui.js42
7 files changed, 67 insertions, 6 deletions
diff --git a/skins/larry/images/buttons.gif b/skins/larry/images/buttons.gif
index d8a33d6b2..8a4a78ee4 100644
--- a/skins/larry/images/buttons.gif
+++ b/skins/larry/images/buttons.gif
Binary files differ
diff --git a/skins/larry/images/buttons.png b/skins/larry/images/buttons.png
index 4438d9cbc..0ec061a78 100644
--- a/skins/larry/images/buttons.png
+++ b/skins/larry/images/buttons.png
Binary files differ
diff --git a/skins/larry/mail.css b/skins/larry/mail.css
index c99370830..e6529d118 100644
--- a/skins/larry/mail.css
+++ b/skins/larry/mail.css
@@ -868,7 +868,7 @@ div.more-headers {
}
div.hide-headers {
- background-position: center -1589px;
+ background-position: center -1600px;
}
#all-headers {
diff --git a/skins/larry/styles.css b/skins/larry/styles.css
index 044a09e05..1e3e6f7d5 100644
--- a/skins/larry/styles.css
+++ b/skins/larry/styles.css
@@ -2219,7 +2219,7 @@ ul.toolbarmenu li span.conversation {
display: block;
color: #333;
font-weight: bold;
- padding: 8px 4px 3px 30px;
+ padding: 8px 15px 3px 30px;
text-shadow: 0px 1px 1px #fff;
text-decoration: none;
white-space: nowrap;
@@ -2227,6 +2227,17 @@ ul.toolbarmenu li span.conversation {
text-overflow: ellipsis;
}
+.attachmentslist li a.drop {
+ background: url(images/buttons.png) no-repeat scroll center -1570px;
+ width: 14px;
+ height: 26px;
+ cursor: pointer;
+ position: absolute;
+ right: 0;
+ top: 0;
+ padding: 0;
+}
+
#compose-attachments ul li {
padding-right: 28px;
}
diff --git a/skins/larry/templates/message.html b/skins/larry/templates/message.html
index b4ceb6a6c..36e0efa0a 100644
--- a/skins/larry/templates/message.html
+++ b/skins/larry/templates/message.html
@@ -73,6 +73,14 @@
</div><!-- end mainscreen -->
+<div id="attachmentmenu" class="popupmenu dropdown">
+ <ul class="toolbarmenu">
+ <li><roundcube:button command="open-attachment" id="attachmenuopen" type="link" label="open" class="icon" classAct="icon active" innerclass="icon extwin" /></li>
+ <li><roundcube:button command="download-attachment" id="attachmenudownload" type="link" label="download" class="icon" classAct="icon active" innerclass="icon download" /></li>
+ <roundcube:container name="attachmentmenu" id="attachmentmenu" />
+ </ul>
+</div>
+
<roundcube:include file="/includes/footer.html" />
</body>
diff --git a/skins/larry/templates/messagepreview.html b/skins/larry/templates/messagepreview.html
index aef282ac9..dbfe2dc7b 100644
--- a/skins/larry/templates/messagepreview.html
+++ b/skins/larry/templates/messagepreview.html
@@ -51,6 +51,14 @@
</div>
</div>
+<div id="attachmentmenu" class="popupmenu dropdown">
+ <ul class="toolbarmenu">
+ <li><roundcube:button command="open-attachment" id="attachmenuopen" type="link" label="open" class="icon" classAct="icon active" innerclass="icon extwin" /></li>
+ <li><roundcube:button command="download-attachment" id="attachmenudownload" type="link" label="download" class="icon" classAct="icon active" innerclass="icon download" /></li>
+ <roundcube:container name="attachmentmenu" id="attachmentmenu" />
+ </ul>
+</div>
+
<roundcube:include file="/includes/footer.html" />
</body>
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index d2638bbca..6b2a5c7d0 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -17,6 +17,7 @@ function rcube_mail_ui()
var popupconfig = {
forwardmenu: { editable:1 },
searchmenu: { editable:1, callback:searchmenu },
+ attachmentmenu: { },
listoptions: { editable:1 },
dragmessagemenu: { sticky:1 },
groupmenu: { above:1 },
@@ -81,8 +82,8 @@ function rcube_mail_ui()
/*** mail task ***/
if (rcmail.env.task == 'mail') {
- rcmail.addEventListener('menu-open', show_listoptions);
- rcmail.addEventListener('menu-save', save_listoptions);
+ rcmail.addEventListener('menu-open', menu_open);
+ rcmail.addEventListener('menu-save', menu_save);
rcmail.addEventListener('responseafterlist', function(e){ switch_view_mode(rcmail.env.threading ? 'thread' : 'list') });
var dragmenu = $('#dragmessagemenu');
@@ -95,6 +96,11 @@ function rcube_mail_ui()
rcmail.addEventListener('aftershow-headers', function() { layout_messageview(); });
rcmail.addEventListener('afterhide-headers', function() { layout_messageview(); });
$('#previewheaderstoggle').click(function(e){ toggle_preview_headers(this); return false });
+
+ // add menu link for each attachment
+ $('#attachment-list > li').each(function() {
+ $(this).append($('<a class="drop">').click(function() { attachmentmenu(this); }));
+ });
}
else if (rcmail.env.action == 'compose') {
rcmail.addEventListener('aftertoggle-editor', function(){ window.setTimeout(function(){ layout_composeview() }, 200); });
@@ -436,7 +442,7 @@ function rcube_mail_ui()
{
var obj = popups[popup],
config = popupconfig[popup],
- ref = $('#'+popup+'link'),
+ ref = $(config.link ? config.link : '#'+popup+'link'),
above = config.above;
if (!obj) {
@@ -452,7 +458,7 @@ function rcube_mail_ui()
else if (config.toggle && show && obj.is(':visible'))
show = false;
- if (show && ref) {
+ if (show && ref.length) {
var parent = ref.parent(),
win = $(window),
pos;
@@ -575,6 +581,19 @@ function rcube_mail_ui()
/**** popup callbacks ****/
+ function menu_open(p)
+ {
+ if (p && p.props && p.props.menu == 'attachmentmenu')
+ show_popupmenu('attachmentmenu');
+ else
+ show_listoptions();
+ }
+
+ function menu_save(prop)
+ {
+ save_listoptions();
+ }
+
function searchmenu(show)
{
if (show && rcmail.env.search_mods) {
@@ -605,6 +624,21 @@ function rcube_mail_ui()
}
}
+ function attachmentmenu(elem)
+ {
+ var id = elem.parentNode.id.replace(/^attach/, '');
+
+ $('#attachmenuopen').unbind('click').attr('onclick', '').click(function(e) {
+ return rcmail.command('open-attachment', id, this);
+ });
+
+ $('#attachmenudownload').unbind('click').attr('onclick', '').click(function() {
+ rcmail.command('download-attachment', id, this);
+ });
+
+ popupconfig.attachmentmenu.link = elem;
+ rcmail.command('menu-open', {menu: 'attachmentmenu', id: id});
+ }
function spellmenu(show)
{