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 --- theme/base/css/display.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'theme') 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 56deca63d0d73b965bc7dba11ef025a7c1ad3234 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 16 Mar 2010 19:34:20 +0100 Subject: Removed dangling stylesheet --- theme/base/css/thickbox.css | 163 -------------------------------------------- 1 file changed, 163 deletions(-) delete mode 100644 theme/base/css/thickbox.css (limited to 'theme') diff --git a/theme/base/css/thickbox.css b/theme/base/css/thickbox.css deleted file mode 100644 index d24b9bedf..000000000 --- a/theme/base/css/thickbox.css +++ /dev/null @@ -1,163 +0,0 @@ -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -*{padding: 0; margin: 0;} - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_window { - font: 12px Arial, Helvetica, sans-serif; - color: #333333; -} - -#TB_secondLine { - font: 10px Arial, Helvetica, sans-serif; - color:#666666; -} - -#TB_window a:link {color: #666666;} -#TB_window a:visited {color: #666666;} -#TB_window a:hover {color: #000;} -#TB_window a:active {color: #666666;} -#TB_window a:focus{color: #666666;} - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_overlay { - position: fixed; - z-index:100; - top: 0px; - left: 0px; - height:100%; - width:100%; -} - -.TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;} -.TB_overlayBG { - background-color:#000; - filter:alpha(opacity=75); - -moz-opacity: 0.75; - opacity: 0.75; -} - -* html #TB_overlay { /* ie6 hack */ - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -#TB_window { - position: fixed; - background: #ffffff; - z-index: 102; - color:#000000; - display:none; - border: 4px solid #525252; - text-align:left; - top:50%; - left:50%; -} - -* html #TB_window { /* ie6 hack */ -position: absolute; -margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); -} - -#TB_window img#TB_Image { - display:block; - margin: 15px 0 0 15px; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - border-top: 1px solid #666; - border-left: 1px solid #666; -} - -#TB_caption{ - height:25px; - padding:7px 30px 10px 25px; - float:left; -} - -#TB_closeWindow{ - height:25px; - padding:11px 25px 10px 0; - float:right; -} - -#TB_closeAjaxWindow{ - padding:7px 10px 5px 0; - margin-bottom:1px; - text-align:right; - float:right; -} - -#TB_ajaxWindowTitle{ - float:left; - padding:7px 0 5px 10px; - margin-bottom:1px; -} - -#TB_title{ - background-color:#e8e8e8; - height:27px; -} - -#TB_ajaxContent{ - clear:both; - padding:2px 15px 15px 15px; - overflow:auto; - text-align:left; - line-height:1.4em; -} - -#TB_ajaxContent.TB_modal{ - padding:15px; -} - -#TB_ajaxContent p{ - padding:5px 0px 5px 0px; -} - -#TB_load{ - position: fixed; - display:none; - height:13px; - width:208px; - z-index:103; - top: 50%; - left: 50%; - margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ -} - -* html #TB_load { /* ie6 hack */ -position: absolute; -margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); -} - -#TB_HideSelect{ - z-index:99; - position:fixed; - top: 0; - left: 0; - background-color:#fff; - border:none; - filter:alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; - height:100%; - width:100%; -} - -* html #TB_HideSelect { /* ie6 hack */ - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -#TB_iframeContent{ - clear:both; - border:none; - margin-bottom:-1px; - margin-top:1px; - _margin-bottom:1px; -} -- 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 'theme') 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