Init notice_data-attach UI for form_notice

This commit is contained in:
Sarven Capadisli 2009-06-05 00:00:04 -04:00
parent 4f5630099f
commit b708b81065
4 changed files with 23 additions and 12 deletions

View File

@ -17,17 +17,6 @@
*/ */
$(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?');});
}
});
// count character on keyup // count character on keyup
function counter(event){ function counter(event){
var maxLength = 140; var maxLength = 140;

View File

@ -148,7 +148,6 @@ 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',

View File

@ -452,6 +452,22 @@ float:left;
font-size:1.3em; font-size:1.3em;
margin-bottom:7px; margin-bottom:7px;
} }
#form_notice label[for=notice_data-attach] {
text-indent:-9999px;
display:block;
}
#form_notice label[for=notice_data-attach],
#form_notice #notice_data-attach {
position:absolute;
top:25px;
right:49px;
width:16px;
height:16px;
cursor:pointer;
}
#form_notice #notice_data-attach {
text-indent:-279px;
}
#form_notice #notice_submit label { #form_notice #notice_submit label {
display:none; display:none;
} }

View File

@ -82,6 +82,13 @@ color:#333;
#form_notice.warning #notice_text-count { #form_notice.warning #notice_text-count {
color:#000; color:#000;
} }
#form_notice label[for=notice_data-attach] {
background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%;
}
#form_notice #notice_data-attach {
opacity:0;
}
#form_notice.processing #notice_action-submit { #form_notice.processing #notice_action-submit {
background:#fff url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%; background:#fff url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
cursor:wait; cursor:wait;