v0.6.3 Dark Mode
This commit is contained in:
parent
06499466be
commit
66e5c33b00
56 changed files with 1869 additions and 1283 deletions
|
@ -64,19 +64,21 @@ function beautify(newsitemobject,msg){
|
|||
var attachArray=newsitemobject.attachments;
|
||||
for (var image in attachArray){
|
||||
var attachhelper={mimetype:attachArray[image].mimetype}
|
||||
var attachhelperstring=Qt.btoa(attachArray[image].url)
|
||||
var attachhelperstring="<img" //Qt.btoa(attachArray[image].url)
|
||||
var helperstringposition=newsitemobject.statusnet_html.indexOf(attachhelperstring);
|
||||
if (helperstringposition>-1){attachhelper.url=newsitemobject.statusnet_html.substring(newsitemobject.statusnet_html.lastIndexOf("http",helperstringposition),helperstringposition+attachhelperstring.length);
|
||||
if (attachArray[image].mimetype=="image/jpeg"){attachhelper.url=attachhelper.url+".jpg"}
|
||||
else if (attachArray[image].mimetype=="image/gif"){attachhelper.url=attachhelper.url+".gif"}
|
||||
else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
|
||||
}
|
||||
else {attachhelper.url=attachArray[image].url}
|
||||
|
||||
// if (helperstringposition>-1){attachhelper.url=newsitemobject.statusnet_html.substring(newsitemobject.statusnet_html.lastIndexOf("http",helperstringposition),helperstringposition+attachhelperstring.length);
|
||||
// if (attachArray[image].mimetype=="image/jpeg"){attachhelper.url=attachhelper.url+".jpg"}
|
||||
// else if (attachArray[image].mimetype=="image/gif"){attachhelper.url=attachhelper.url+".gif"}
|
||||
// else if (attachArray[image].mimetype=="image/png"){attachhelper.url=attachhelper.url+".png"}
|
||||
// }
|
||||
// else {
|
||||
attachhelper.url=attachArray[image].url
|
||||
// }
|
||||
if (helperstringposition>-1){var removeme=newsitemobject.statusnet_html.substring(helperstringposition,newsitemobject.statusnet_html.indexOf('">',helperstringposition)+2);}
|
||||
//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","")
|
||||
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4),"")
|
||||
newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(removeme,"")
|
||||
//newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4)+".jpeg","")
|
||||
//newsitemobject.statusnet_html=newsitemobject.statusnet_html.replace(attachhelper.url.substring(0,attachhelper.url.length-4),"")
|
||||
|
||||
imageAttachmentList.push(attachhelper)
|
||||
}
|
||||
|
@ -138,18 +140,19 @@ if(msg.deleteId!==undefined)
|
|||
msg.model.sync()
|
||||
}
|
||||
else{
|
||||
if(msg.method=="refresh" ||(msg.method=="conversation"&&msg.news.length>0)){msg.model.clear()};
|
||||
if(msg.method=="refresh" || msg.method=="contact" ||(msg.method=="conversation"&&msg.news.length>0)){msg.model.clear()};
|
||||
msg.model.sync()
|
||||
for (var j=0;j<msg.news.length;j++){
|
||||
|
||||
//for (var j=0;j<msg.news.length;j++){
|
||||
for (var j in msg.news){
|
||||
let data=({})
|
||||
if (msg.news[j]) {
|
||||
var newsitemobject=msg.news[j];
|
||||
newsitemobject=beautify(newsitemobject,msg);
|
||||
|
||||
if (newsitemobject.hasOwnProperty("currentconversation")&&(newsitemobject.currentconversation.length>0)){
|
||||
newsitemobject.lastcomment=beautify(newsitemobject.currentconversation[newsitemobject.currentconversation.length-1],msg);
|
||||
newsitemobject.lastcomment.indent=1
|
||||
//print("Currentconversation" + newsitemobject.currentconversation.length+JSON.stringify(newsitemobject.lastcomment))
|
||||
}
|
||||
}
|
||||
|
||||
if (msg.method=="conversation"){
|
||||
if (j==0){newsitemobject.indent=0}else{
|
||||
|
@ -160,19 +163,17 @@ else{
|
|||
}
|
||||
}
|
||||
}}
|
||||
|
||||
var data=({"newsitemobject": newsitemobject})
|
||||
data=({"newsitemobject": newsitemobject})
|
||||
}
|
||||
|
||||
if(msg.method=="append") {
|
||||
msg.model.insert(j, data)}
|
||||
else{
|
||||
msg.model.append(data)
|
||||
}
|
||||
}
|
||||
|
||||
if (j==msg.news.length){
|
||||
|
||||
//if (j==msg.news.length){
|
||||
msg.model.sync()
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -350,7 +350,7 @@ function updateglobaloptions(database,key,value){
|
|||
var db=Sql.LocalStorage.openDatabaseSync(database[0],database[1],database[2],database[3]);
|
||||
db.transaction( function(tx) {
|
||||
var result = tx.executeSql('SELECT * from globaloptions where k="'+key+'"'); // check for key
|
||||
if(result.rows.length === 1) {// use update
|
||||
if(result.rows.length > 0) {// use update
|
||||
result = tx.executeSql('UPDATE globaloptions SET v="'+value+'" WHERE k="'+key+'"')
|
||||
} else {// use insert
|
||||
result = tx.executeSql('INSERT INTO globaloptions (k,v) VALUES (?,?)', [key,value])
|
||||
|
@ -412,7 +412,7 @@ function cleanContacts(login,database,callback){
|
|||
//print(login.username+" älteste news: "+ oldestnewsTime);
|
||||
var result = tx.executeSql('SELECT * from contacts WHERE username="'+login.username+'" AND isFriend=0 AND imageAge<'+oldestnewsTime); // check for friends
|
||||
//print ("Contact result length: "+ result.rows.length)
|
||||
for (var i=0;i<result.rows.length;i++){
|
||||
for (var i=0;i<result.rows.length;i++){//print("rm "+result.rows.item(i).profile_image)
|
||||
filesystem.rmFile(result.rows.item(i).profile_image);
|
||||
var deleters = tx.executeSql('DELETE from contacts WHERE username="'+login.username+'" AND url="'+result.rows.item(i).url+'"');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue