From 321093886fd708696c28118893443aa598c6b97f Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sat, 13 Mar 2010 16:48:21 -0500 Subject: Assigned an identifier for the representative user and group profile --- lib/userprofile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/userprofile.php b/lib/userprofile.php index 2c3b1ea45..ca060842b 100644 --- a/lib/userprofile.php +++ b/lib/userprofile.php @@ -71,7 +71,8 @@ class UserProfile extends Widget { if (Event::handle('StartProfilePageProfileSection', array(&$this->out, $this->profile))) { - $this->out->elementStart('div', 'entity_profile vcard author'); + $this->out->elementStart('div', array('id' => 'i', + 'class' => 'entity_profile vcard author')); $this->out->element('h2', null, _('User profile')); if (Event::handle('StartProfilePageProfileElements', array(&$this->out, $this->profile))) { -- cgit v1.2.3-54-g00ecf From 53bed00f9028523ba003956ed88f9549ec203e3b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 14 Mar 2010 14:11:21 -0400 Subject: Added rel=external to geo location link --- lib/noticelist.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/noticelist.php b/lib/noticelist.php index 811b7e4f1..0d4cd4dd9 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -443,7 +443,8 @@ class NoticeListItem extends Widget $name); } else { $xstr = new XMLStringer(false); - $xstr->elementStart('a', array('href' => $url)); + $xstr->elementStart('a', array('href' => $url, + 'rel' => 'external')); $xstr->element('abbr', array('class' => 'geo', 'title' => $latlon), $name); -- cgit v1.2.3-54-g00ecf From 3c5586d4bd2b00a2c3a140830fcc7b3e15898242 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 14 Mar 2010 15:01:24 -0400 Subject: Using rel=external instead of class=external for jOverlay title link --- lib/attachmentlist.php | 6 ++---- theme/base/css/display.css | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index fe38281af..b503bfb45 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -248,9 +248,7 @@ class Attachment extends AttachmentListItem $this->out->elementStart('div', array('id' => 'attachment_view', 'class' => 'hentry')); $this->out->elementStart('div', 'entry-title'); - $this->out->elementStart('a', $this->linkAttr()); - $this->out->element('span', null, $this->linkTitle()); - $this->out->elementEnd('a'); + $this->out->element('a', $this->linkAttr(), $this->linkTitle()); $this->out->elementEnd('div'); $this->out->elementStart('div', 'entry-content'); @@ -296,7 +294,7 @@ class Attachment extends AttachmentListItem } function linkAttr() { - return array('class' => 'external', 'href' => $this->attachment->url); + return array('rel' => 'external', 'href' => $this->attachment->url); } function linkTitle() { diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 782d3dc71..a2e4cdf2a 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -1326,7 +1326,7 @@ margin-bottom:0; padding:11px; min-height:auto; } -#jOverlayContent .external span { +#jOverlayContent .entry-title { display:block; margin-bottom:11px; } -- cgit v1.2.3-54-g00ecf From c11064a5398db824f2623c5763b3fdfdf8ae3c39 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 25 Mar 2010 14:15:54 -0700 Subject: Updated 'more' anchor for attachments to do an XHR GET Conflicts: lib/attachmentlist.php plugins/OStatus/classes/Ostatus_profile.php Merge tried to delete things that it seems it shouldn't, very confusing order. Hope rest of the cherry-picking isn't a problem. --- js/util.js | 110 +++++++++++++++------------- lib/attachmentlist.php | 53 ++++++++++++++ plugins/OStatus/classes/Ostatus_profile.php | 18 ++++- theme/base/css/display.css | 9 ++- theme/default/css/display.css | 3 +- theme/identica/css/display.css | 3 +- 6 files changed, 141 insertions(+), 55 deletions(-) (limited to 'lib') diff --git a/js/util.js b/js/util.js index f82ca992c..79fd40deb 100644 --- a/js/util.js +++ b/js/util.js @@ -399,58 +399,70 @@ var SN = { // StatusNet return; } - $.fn.jOverlay.options = { - method : 'GET', - data : '', - url : '', - color : '#000', - opacity : '0.6', - zIndex : 9999, - center : false, - imgLoading : $('address .url')[0].href+'theme/base/images/illustrations/illu_progress_loading-01.gif', - bgClickToClose : true, - success : function() { - $('#jOverlayContent').append(''); - $('#jOverlayContent button').click($.closeOverlay); - }, - timeout : 0, - autoHide : true, - css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'} - }; - - notice.find('a.attachment').click(function() { - var attachId = ($(this).attr('id').substring('attachment'.length + 1)); - if (attachId) { - $().jOverlay({url: $('address .url')[0].href+'attachment/' + attachId + '/ajax'}); - return false; - } - }); + var attachment_more = notice.find('.attachment.more'); + if (attachment_more.length > 0) { + attachment_more.click(function() { + $.get($(this).attr('href')+'/ajax', null, function(data) { + notice.find('.entry-title .entry-content').html($(data).find('#attachment_view .entry-content').html()); + }); - if ($('#shownotice').length == 0) { - var t; - notice.find('a.thumbnail').hover( - function() { - var anchor = $(this); - $('a.thumbnail').children('img').hide(); - anchor.closest(".entry-title").addClass('ov'); - - if (anchor.children('img').length === 0) { - t = setTimeout(function() { - $.get($('address .url')[0].href+'attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) { - anchor.append(data); - }); - }, 500); - } - else { - anchor.children('img').show(); - } + return false; + }); + } + else { + $.fn.jOverlay.options = { + method : 'GET', + data : '', + url : '', + color : '#000', + opacity : '0.6', + zIndex : 9999, + center : false, + imgLoading : $('address .url')[0].href+'theme/base/images/illustrations/illu_progress_loading-01.gif', + bgClickToClose : true, + success : function() { + $('#jOverlayContent').append(''); + $('#jOverlayContent button').click($.closeOverlay); }, - function() { - clearTimeout(t); - $('a.thumbnail').children('img').hide(); - $(this).closest('.entry-title').removeClass('ov'); + timeout : 0, + autoHide : true, + css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'} + }; + + notice.find('a.attachment').click(function() { + var attachId = ($(this).attr('id').substring('attachment'.length + 1)); + if (attachId) { + $().jOverlay({url: $('address .url')[0].href+'attachment/' + attachId + '/ajax'}); + return false; } - ); + }); + + if ($('#shownotice').length == 0) { + var t; + notice.find('a.thumbnail').hover( + function() { + var anchor = $(this); + $('a.thumbnail').children('img').hide(); + anchor.closest(".entry-title").addClass('ov'); + + if (anchor.children('img').length === 0) { + t = setTimeout(function() { + $.get($('address .url')[0].href+'attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) { + anchor.append(data); + }); + }, 500); + } + else { + anchor.children('img').show(); + } + }, + function() { + clearTimeout(t); + $('a.thumbnail').children('img').hide(); + $(this).closest('.entry-title').removeClass('ov'); + } + ); + } } }, diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index b503bfb45..c6261dea5 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -359,6 +359,59 @@ class Attachment extends AttachmentListItem } } + protected function showHtmlFile(File $attachment) + { + $body = $this->scrubHtmlFile($attachment); + if ($body) { + $this->out->raw($body); + } + } + + /** + * @return mixed false on failure, HTML fragment string on success + */ + protected function scrubHtmlFile(File $attachment) + { + $path = File::path($attachment->filename); + if (!file_exists($path) || !is_readable($path)) { + common_log(LOG_ERR, "Missing local HTML attachment $path"); + return false; + } + $raw = file_get_contents($path); + + // Normalize... + $dom = new DOMDocument(); + if(!$dom->loadHTML($raw)) { + common_log(LOG_ERR, "Bad HTML in local HTML attachment $path"); + return false; + } + + // Remove