Re-added some javascript to toggle upload field.

This commit is contained in:
Robin Millette 2009-06-01 15:52:52 -04:00
parent 4bd195b80f
commit 0cbd72e092
2 changed files with 12 additions and 0 deletions

View File

@ -17,6 +17,17 @@
*/ */
$(document).ready(function(){ $(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.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
$("a.thumbnail").hover( $("a.thumbnail").hover(
function() { function() {

View File

@ -148,6 +148,7 @@ class NoticeForm extends Form
$this->out->element('dd', array('id' => 'notice_text-count'), $this->out->element('dd', array('id' => 'notice_text-count'),
'140'); '140');
$this->out->elementEnd('dl'); $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('label', array('for' => 'notice_data-attach'), _('Attach'));
$this->out->element('input', array('id' => 'notice_data-attach', $this->out->element('input', array('id' => 'notice_data-attach',
'type' => 'file', 'type' => 'file',