Markup cleanup for attachments

This commit is contained in:
Sarven Capadisli 2009-05-25 15:53:19 -04:00
parent a11d6260cc
commit 01dad57298
6 changed files with 12 additions and 32 deletions

View File

@ -176,10 +176,8 @@ class AttachmentAction extends Action
function showContent()
{
$this->elementStart('ul', array('class' => 'attachments'));
$ali = new Attachment($this->attachment, $this);
$cnt = $ali->show();
$this->elementEnd('ul');
}
/**

View File

@ -67,7 +67,7 @@ class Attachment_ajaxAction extends AttachmentAction
*/
function showCore()
{
$this->elementStart('div', array('id' => 'ajaxcore'));
$this->elementStart('div', array('id' => 'core'));
if (Event::handle('StartShowContentBlock', array($this))) {
$this->showContentBlock();
Event::handle('EndShowContentBlock', array($this));

View File

@ -17,12 +17,6 @@
*/
$(document).ready(function(){
// attachments and attachment pages not used at the moment except for attachment_ajax version
// $('.attachments').click(function() {$().jOverlay({zIndex:999, success:function(html) {$('.attachment').click(function() {$().jOverlay({url:$(this).attr('href') + '/ajax'}); return false; });
// }, url:$(this).attr('href') + '/ajax'}); return false; });
//FIXME
//need to link to proper url depending on site config (path name and theme, for instance)
$('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() {

View File

@ -80,9 +80,9 @@ class AttachmentList extends Widget
function show()
{
// $this->out->elementStart('div', array('id' =>'attachments_primary'));
$this->out->elementStart('div', array('id' =>'content'));
$this->out->element('h2', null, _('Attachments'));
$this->out->elementStart('dl', array('id' =>'attachment'));
$this->out->element('dt', null, _('Attachments'));
$this->out->elementStart('dd');
$this->out->elementStart('ul', array('class' => 'attachments'));
$atts = new File;
@ -92,8 +92,9 @@ class AttachmentList extends Widget
$item->show();
}
$this->out->elementEnd('dd');
$this->out->elementEnd('ul');
$this->out->elementEnd('div');
$this->out->elementEnd('dl');
return count($att);
}
@ -195,14 +196,10 @@ class AttachmentListItem extends Widget
}
function showLink() {
$attr = $this->linkAttr();
$text = $this->linkTitle();
$this->out->elementStart('h4');
$this->out->elementStart('a', $attr);
$this->out->element('span', null, $text);
$this->out->elementStart('a', $this->linkAttr());
$this->out->element('span', null, $this->linkTitle());
$this->showRepresentation();
$this->out->elementEnd('a');
$this->out->elementEnd('h4');
}
function showNoticeAttachment()

View File

@ -180,9 +180,9 @@ class NoticeListItem extends Widget
{
$this->showStart();
$this->showNotice();
$this->showNoticeAttachments();
$this->showNoticeInfo();
$this->showNoticeOptions();
$this->showNoticeAttachments();
$this->showEnd();
}
@ -214,18 +214,6 @@ class NoticeListItem extends Widget
return intval($file_oembed->c);
}
function showNoticeAttachmentsIcon()
{
if (!($this->isUsedInList() && ($count = $this->attachmentCount()))) {
return;
}
$href = common_local_url('shownotice', array('notice' => $this->notice->id)) . '#attachments';
$this->out->elementStart('p', 'entry-attachments');
$this->out->element('a', array('href' => $href, 'title' => "# of attachments: $count"), $count === 1 ? '' : $count);
$this->out->elementEnd('p');
}
function showNoticeInfo()
{
$this->out->elementStart('div', 'entry-content');

View File

@ -861,6 +861,9 @@ top:11px;
left:0;
z-index:99;
}
#shownotice .notice .attachment img {
position:static;
}
.notice-options {