summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-26 21:20:04 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-26 21:20:04 -0400
commitaf700ea27703bbec5aa1078a84f9fd44c0260322 (patch)
treea227167390948f5791b8190435fbb9cfdbd0bc38 /js/util.js
parent4edb1c6e0cfcaee256757ed20b4ff8d482158906 (diff)
Let's you upload a file with a notice and have it shown with other attachments.
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/util.js b/js/util.js
index b1b6ec82b..85ab48b4c 100644
--- a/js/util.js
+++ b/js/util.js
@@ -17,6 +17,17 @@
*/
$(document).ready(function(){
+ $('input#notice_data-attach').toggle();
+ $('label[for=notice_data-attach]').text('Upload a file as an attachment?');
+ $('label[for=notice_data-attach]').click(function () {
+ if ('Upload a file as an attachment?' == $(this).text()) {
+ $(this).text('Upload: ');
+ $('input#notice_data-attach').slideDown('fast');
+ } else {
+ $('input#notice_data-attach').slideUp('fast', function() {$('label[for=notice_data-attach]').text('Upload a file as an attachment?');});
+ }
+ });
+
$('a.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
$("a.thumbnail").hover(
function() {
@@ -227,6 +238,7 @@ $(document).ready(function(){
}
}
$("#notice_data-text").val("");
+ $("#notice_data-attach").val("");
counter();
}
$("#form_notice").removeClass("processing");