summaryrefslogtreecommitdiff
path: root/skins/larry
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-12-30 16:02:24 +0000
committerthomascube <thomas@roundcube.net>2011-12-30 16:02:24 +0000
commitf5521a4a6d2132f8fe49c66858326e00e9a68b84 (patch)
treee23dc14633efc5ea53479670617859fa0a9cde5d /skins/larry
parente193a0272ecdc15badda1d851d95a2ac6b50a9aa (diff)
Add button to clone file upload fields for mutli-file uploads
Diffstat (limited to 'skins/larry')
-rw-r--r--skins/larry/mail.css7
-rw-r--r--skins/larry/ui.js26
2 files changed, 32 insertions, 1 deletions
diff --git a/skins/larry/mail.css b/skins/larry/mail.css
index 464082237..efee660d5 100644
--- a/skins/larry/mail.css
+++ b/skins/larry/mail.css
@@ -1110,5 +1110,12 @@ div.message-part blockquote blockquote blockquote {
border-bottom: 1px solid #ddd;
}
+#uploadform a.iconlink {
+ margin-left: 1em;
+ text-indent: -1000px;
+}
+#uploadform form div {
+ margin: 4px 0;
+}
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index c24915eef..8038aa78e 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -532,6 +532,17 @@ function rcube_mail_ui()
$dialog.dialog('close');
return;
}
+
+ // add icons to clone file input field
+ if (rcmail.env.action = 'compose' && !$dialog.data('extended')) {
+ $('<a>')
+ .addClass('iconlink add')
+ .attr('href', '#add')
+ .html('Add')
+ .appendTo($('input[type="file"]', $dialog).parent())
+ .click(add_uploadfile);
+ $dialog.data('extended', true);
+ }
$dialog.dialog({
modal: true,
@@ -543,14 +554,27 @@ function rcube_mail_ui()
catch(e){ } // ignore errors
$dialog.dialog('destroy').hide();
+ $('div.addline', $dialog).remove();
},
width: 480
}).show();
if (!document.all)
- $('input[type=file]', $dialog).click();
+ $('input[type=file]', $dialog).first().click();
+ }
+
+ function add_uploadfile(e)
+ {
+ var div = $(this).parent();
+ var clone = div.clone().addClass('addline').insertAfter(div);
+ clone.children('.iconlink').click(add_uploadfile);
+ clone.children('input').val('');
+
+ if (!document.all)
+ $('input[type=file]', clone).click();
}
+
/**
*
*/