forked from lubuwest/Friendiqa
version v0.6
This commit is contained in:
parent
bdc28e632e
commit
8482bde3ed
86 changed files with 7064 additions and 3208 deletions
|
@ -57,7 +57,8 @@ function beautify(newsitemobject,msg){
|
|||
if (newsitemobject.friendica_activities_self.indexOf(2)!=-1){self.disliked=1}
|
||||
}
|
||||
var friendica_activities={self:self}
|
||||
var attachmentList=[];
|
||||
var imageAttachmentList=[];
|
||||
var videoAttachmentList=[];
|
||||
var videoformats=["mp4", "avi", "webm","ogg","mp3"]
|
||||
try{if(newsitemobject.attachments){
|
||||
var attachArray=newsitemobject.attachments;
|
||||
|
@ -71,7 +72,7 @@ function beautify(newsitemobject,msg){
|
|||
else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
|
||||
}
|
||||
else {attachhelper.url=attachArray[image].url}
|
||||
attachmentList.push(attachhelper)
|
||||
imageAttachmentList.push(attachhelper)
|
||||
//print("Attachhelper "+attachhelper.url)
|
||||
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url,"")
|
||||
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
|
||||
|
@ -87,7 +88,7 @@ function beautify(newsitemobject,msg){
|
|||
var videohelperstringposition=videotext.indexOf("."+videoformats[format]);
|
||||
videohelper.url=videotext.substring(videotext.lastIndexOf("http",videohelperstringposition),videohelperstringposition+4);
|
||||
videotext=videotext.substring(videohelperstringposition+4,videotext.length)
|
||||
if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=videohelper.url)){attachmentList.push(videohelper)}
|
||||
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=videohelper.url)){videoAttachmentList.push(videohelper)}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +102,7 @@ function beautify(newsitemobject,msg){
|
|||
ptvideohelper.url=ptvideotext.substring(ptvideotext.lastIndexOf("http",ptvideohelperstringposition),ptposend)+"-480.mp4";
|
||||
ptvideohelper.url=ptvideohelper.url.replace("/videos/watch","/static/webseed");
|
||||
ptvideotext=ptvideotext.substring(ptposend,ptvideotext.length)
|
||||
if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=ptvideohelper.url)){attachmentList.push(ptvideohelper)}
|
||||
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ptvideohelper.url)){videoAttachmentList.push(ptvideohelper)}
|
||||
}
|
||||
}
|
||||
if (newsitemobject.text.indexOf("youtube.com/watch?v")>-1){
|
||||
|
@ -112,11 +113,11 @@ function beautify(newsitemobject,msg){
|
|||
var ythelper={mimetype:"video/youtube"}
|
||||
ythelper.url=yttext.substring(ythelperstringposition+8,ytposend);
|
||||
yttext=yttext.substring(ytposend,yttext.length);
|
||||
if ((attachmentList.length==0) || (attachmentList[attachmentList.length-1].url!=ythelper.url)){attachmentList.push(ythelper)}
|
||||
if ((videoAttachmentList.length==0) || (videoAttachmentList[videoAttachmentList.length-1].url!=ythelper.url)){videoAttachmentList.push(ythelper)}
|
||||
}
|
||||
}
|
||||
newsitemobject.attachmentList=attachmentList;
|
||||
|
||||
newsitemobject.videoAttachmentList=videoAttachmentList;
|
||||
newsitemobject.imageAttachmentList=imageAttachmentList;
|
||||
if ((msg.options.hasOwnProperty("hide_nsfw"))&&(msg.options.hide_nsfw==1)&&(newsitemobject.text.indexOf("#nsfw")>-1)){
|
||||
newsitemobject.nsfw=true
|
||||
} else{newsitemobject.nsfw=false}
|
||||
|
@ -152,9 +153,9 @@ else{
|
|||
if (j==0){newsitemobject.indent=0}else{
|
||||
for (var k=msg.model.count-1;k>-1;k--){
|
||||
if (newsitemobject.in_reply_to_status_id==msg.model.get(k).newsitemobject.id){
|
||||
newsitemobject.indent=msg.model.get(k).newsitemobject.indent+1;
|
||||
newsitemobject.indent=(msg.model.get(k).newsitemobject.indent||0)+1;
|
||||
if (newsitemobject.indent>6){newsitemobject.indent=6};
|
||||
break}
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue