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
|
@ -36,19 +36,66 @@ import "qrc:/js/helper.js" as Helperjs
|
|||
import "qrc:/qml/genericqml"
|
||||
import "qrc:/qml/newsqml"
|
||||
|
||||
Rectangle {
|
||||
Page {
|
||||
id:conversationList
|
||||
property var news:[]
|
||||
color: "white"
|
||||
// color: "white"
|
||||
//function backRequested(){pageStack.pop()}
|
||||
// width:root.width
|
||||
// height: root.height-7*mm
|
||||
|
||||
function getDateDiffString (seconds){
|
||||
var timestring="";
|
||||
if (seconds<60) {timestring= Math.round(seconds) + " " +qsTr("seconds");}
|
||||
else if (seconds<90){timestring= Math.round(seconds/60) + " " +qsTr("minute") ;}
|
||||
else if (seconds<3600){timestring= Math.round(seconds/60) + " " +qsTr("minutes");}
|
||||
else if (seconds<5400){timestring= Math.round(seconds/3600) + " " +qsTr("hour");}
|
||||
else if (seconds<86400){timestring= Math.round(seconds/3600) + " " +qsTr("hours");}
|
||||
else if (seconds<129600){timestring= Math.round(seconds/86400) + " " +qsTr("day");}
|
||||
else if (seconds<3888000){timestring= Math.round(seconds/86400) + " " +qsTr("days");}
|
||||
else if (seconds<5832000){timestring= Math.round(seconds/3888000) + " " +qsTr("month");}
|
||||
else if (seconds<69984000){timestring= Math.round(seconds/3888000) + " " +qsTr("months");}
|
||||
else {timestring= Math.round(seconds/46656000) + " " + qsTr("years");}
|
||||
|
||||
return timestring;
|
||||
}
|
||||
|
||||
function getActivitiesView(newsitemobject){
|
||||
var likeText="";var dislikeText="";var attendyesText="";var attendnoText="";var attendmaybeText=""; var self={};
|
||||
try{if (newsitemobject.messagetype==0&&newsitemobject.hasOwnProperty('friendica_activities')){
|
||||
if (newsitemobject.friendica_activities.like.length>0){
|
||||
if (newsitemobject.friendica_activities.like.length==1){likeText= newsitemobject.friendica_activities.like[0].name+" "+ qsTr("likes this.")}
|
||||
else {likeText= newsitemobject.friendica_activities.like.length+" "+ qsTr("like this.")}
|
||||
}
|
||||
if (newsitemobject.friendica_activities.dislike.length>0){
|
||||
if (newsitemobject.friendica_activities.dislike.length==1){dislikeText= newsitemobject.friendica_activities.dislike[0].name+" "+ qsTr("doesn't like this.")}
|
||||
else {dislikeText= newsitemobject.friendica_activities.dislike.length+" "+ qsTr("don't like this.")}
|
||||
}
|
||||
if (newsitemobject.friendica_activities.attendyes.length>0){
|
||||
if (newsitemobject.friendica_activities.attendyes.length==1){attendyesText=newsitemobject.friendica_activities.attendyes[0].name+" "+ qsTr("will attend.")}
|
||||
else {attendyesText= newsitemobject.friendica_activities.attendyes.length+" "+ qsTr("persons will attend.")}
|
||||
}
|
||||
if (newsitemobject.friendica_activities.attendno.length>0){
|
||||
if (newsitemobject.friendica_activities.attendno.length==1){attendnoText= newsitemobject.friendica_activities.attendno[0].name+" "+ qsTr("will not attend.")}
|
||||
else {attendnoText= newsitemobject.friendica_activities.attendno.length+" "+ qsTr("persons will not attend.")}
|
||||
}
|
||||
if (newsitemobject.friendica_activities.attendmaybe.length>0){
|
||||
if (newsitemobject.friendica_activities.attendmaybe.length==1){attendmaybeText= newsitemobject.friendica_activities.attendmaybe[0].name+" "+ qsTr("may attend.")}
|
||||
else {attendmaybeText= newsitemobject.friendica_activities.attendmaybe.length+" "+ qsTr("persons may attend.")}
|
||||
}
|
||||
//var friendica_activities_self=JSON.parse(newsitemobject.friendica_activities_self);
|
||||
}} catch(e){print("Activities "+e+ " "+JSON.stringify(newsitemobject.friendica_activities))}
|
||||
return {likeText:likeText,dislikeText:dislikeText,attendyesText:attendyesText,attendnoText:attendnoText,attendmaybeText:attendmaybeText}
|
||||
}
|
||||
|
||||
|
||||
ListView {
|
||||
id: conversationView
|
||||
property string viewtype: "conversation"
|
||||
x:3*mm
|
||||
y:8*mm
|
||||
width: conversationList.width-4*mm
|
||||
height:conversationList.height-10*mm
|
||||
//x:3*mm
|
||||
//y:8*mm
|
||||
width: conversationList.width//-4*mm
|
||||
height:conversationList.height//-20*mm
|
||||
clip: true
|
||||
spacing: 0
|
||||
footer: MessageSend{conversation:true}
|
||||
|
@ -58,7 +105,7 @@ Rectangle {
|
|||
BusyIndicator{
|
||||
id: conversationBusy
|
||||
anchors.horizontalCenter: conversationView.horizontalCenter
|
||||
anchors.top:conversationList.top
|
||||
anchors.top:conversationView.top
|
||||
anchors.topMargin: 2*mm
|
||||
width:10*mm
|
||||
height: 10*mm
|
||||
|
@ -69,7 +116,7 @@ Rectangle {
|
|||
target:newstab
|
||||
onConversationChanged:{
|
||||
if(newstab.conversation.length==0){
|
||||
newsStack.pop()
|
||||
rootstackView.pop()
|
||||
} else { conversationBusy.running=false;
|
||||
conversationModel.clear();
|
||||
var currentTime= new Date();
|
||||
|
@ -88,16 +135,16 @@ Rectangle {
|
|||
|
||||
MButton {
|
||||
id: closeButton
|
||||
height: 6*mm
|
||||
width: 8*mm
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 1*mm
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1*mm
|
||||
width: 2*root.fontFactor*osSettings.bigFontSize;
|
||||
text: "\uf057"
|
||||
onClicked: {
|
||||
//newsView.positionViewAtIndex(newsStack.conversationIndex,ListView.Beginning);
|
||||
newstab.conversation=[];
|
||||
if (rootstackView.depth>1){ rootstackView.pop()}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue