fix for https://quitter.no/notice/824574
This commit is contained in:
parent
227d15b739
commit
40edfae0a2
|
@ -1934,9 +1934,6 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// image attachment thumbnails
|
|
||||||
var attachmentsBuild = buildAttachmentHTML(obj.attachments);
|
|
||||||
|
|
||||||
// requeets get's a context element and a identifying class
|
// requeets get's a context element and a identifying class
|
||||||
// uri used is the repeate-notice's uri for repeats, not the repetED notice's uri (necessary if someone deletes a repeat)
|
// uri used is the repeate-notice's uri for repeats, not the repetED notice's uri (necessary if someone deletes a repeat)
|
||||||
var URItoUse = obj.uri;
|
var URItoUse = obj.uri;
|
||||||
|
@ -1989,7 +1986,7 @@ function buildQueetHtml(obj, idInStream, extraClasses, requeeted_by, isConversat
|
||||||
</small>\
|
</small>\
|
||||||
</div>\
|
</div>\
|
||||||
<div class="queet-text">' + $.trim(obj.statusnet_html) + '</div>\
|
<div class="queet-text">' + $.trim(obj.statusnet_html) + '</div>\
|
||||||
<div class="queet-thumbs thumb-num-' + attachmentsBuild.num + '">' + attachmentsBuild.html + '</div>\
|
' + buildAttachmentHTML(obj.attachments) + '\
|
||||||
<div class="stream-item-footer">\
|
<div class="stream-item-footer">\
|
||||||
' + queetActions + '\
|
' + queetActions + '\
|
||||||
</div>\
|
</div>\
|
||||||
|
@ -2019,7 +2016,9 @@ function buildAttachmentHTML(attachments){
|
||||||
var attachmentNum = 0;
|
var attachmentNum = 0;
|
||||||
if(typeof attachments != "undefined") {
|
if(typeof attachments != "undefined") {
|
||||||
$.each(attachments, function(){
|
$.each(attachments, function(){
|
||||||
if(typeof this.thumb_url != 'undefined' && this.thumb_url !== null) { // if there's a thumb_url we assume this is a image or video
|
if(typeof this.thumb_url != 'undefined'
|
||||||
|
&& this.thumb_url !== null
|
||||||
|
&& isLocalURL(this.thumb_url)) { // if there's a local thumb_url we assume this is a image or video
|
||||||
var bigThumbW = 1000;
|
var bigThumbW = 1000;
|
||||||
var bigThumbH = 3000;
|
var bigThumbH = 3000;
|
||||||
if(bigThumbW > window.siteMaxThumbnailSize) {
|
if(bigThumbW > window.siteMaxThumbnailSize) {
|
||||||
|
@ -2075,8 +2074,5 @@ function buildAttachmentHTML(attachments){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return {
|
return '<div class="queet-thumbs thumb-num-' + attachmentNum + '">' + attachment_html + '</div>';
|
||||||
html: attachment_html,
|
|
||||||
num: attachmentNum
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,6 +300,22 @@ function localStorageIsEnabled() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ·
|
||||||
|
·
|
||||||
|
· Is this a local URL?
|
||||||
|
·
|
||||||
|
· · · · · · · · · */
|
||||||
|
|
||||||
|
function isLocalURL(url) {
|
||||||
|
if(url.substring(0,window.siteInstanceURL.length) == window.siteInstanceURL) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ·
|
/* ·
|
||||||
·
|
·
|
||||||
· Check for hidden items and show the new queets bar if there are any
|
· Check for hidden items and show the new queets bar if there are any
|
||||||
|
@ -812,13 +828,9 @@ function searchForUpdatedNoticeData(obj) {
|
||||||
// attachments might have been added/changed/have had time to be processed
|
// attachments might have been added/changed/have had time to be processed
|
||||||
if(streamItemFoundInFeed.attr('data-attachments') != JSON.stringify(obj.attachments)) {
|
if(streamItemFoundInFeed.attr('data-attachments') != JSON.stringify(obj.attachments)) {
|
||||||
streamItemFoundInFeed.attr('data-attachments',JSON.stringify(obj.attachments));
|
streamItemFoundInFeed.attr('data-attachments',JSON.stringify(obj.attachments));
|
||||||
// we might want to add thumbnails
|
|
||||||
if(queetFoundInFeed.find('.queet-thumbs').hasClass('thumb-num-0')) {
|
|
||||||
var attachmentsHTMLBuild = buildAttachmentHTML(obj.attachments);
|
var attachmentsHTMLBuild = buildAttachmentHTML(obj.attachments);
|
||||||
queetFoundInFeed.find('.queet-thumbs').removeClass('thumb-num-0');
|
queetFoundInFeed.find('.queet-thumbs').remove();
|
||||||
queetFoundInFeed.find('.queet-thumbs').addClass('thumb-num-' + attachmentsHTMLBuild.num);
|
queetFoundInFeed.find('.stream-item-footer').before(attachmentsHTMLBuild);
|
||||||
queetFoundInFeed.find('.queet-thumbs').html(attachmentsHTMLBuild.html);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set favorite data
|
// set favorite data
|
||||||
|
|
Loading…
Reference in New Issue
Block a user