From: Robin Millette Date: Mon, 1 Jun 2009 19:52:52 +0000 (-0400) Subject: Re-added some javascript to toggle upload field. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0cbd72e0927cbe9b605e34d7bbd86d2046ea0c49;p=quix0rs-gnu-social.git Re-added some javascript to toggle upload field. --- diff --git a/js/util.js b/js/util.js index 20f17f6e76..acf44a17c7 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() { diff --git a/lib/noticeform.php b/lib/noticeform.php index 5a6c7cf38c..805cd56b13 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -148,6 +148,7 @@ class NoticeForm extends Form $this->out->element('dd', array('id' => 'notice_text-count'), '140'); $this->out->elementEnd('dl'); + $this->out->element('br', array('style' => 'clear:both')); $this->out->element('label', array('for' => 'notice_data-attach'), _('Attach')); $this->out->element('input', array('id' => 'notice_data-attach', 'type' => 'file',