Friendiqa v0.3
This commit is contained in:
parent
585e329bcb
commit
bda2d9f7b5
63 changed files with 2746 additions and 1357 deletions
|
@ -39,12 +39,11 @@ import "qrc:/js/smiley.js" as Smileyjs
|
|||
import "qrc:/qml/genericqml"
|
||||
|
||||
|
||||
Flickable{
|
||||
Rectangle{
|
||||
color:"white"
|
||||
width:root.width-5*mm
|
||||
height:root.height-12*mm
|
||||
contentHeight: messageColumn.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
id:messageSend
|
||||
//anchors.fill: parent
|
||||
property string parentId: ""
|
||||
property string reply_to_user:""
|
||||
property alias bodyMessage: bodyField.text
|
||||
|
@ -57,15 +56,17 @@ Flickable{
|
|||
property var group_allow:login.permissions[2]
|
||||
property var group_deny:login.permissions[3]
|
||||
|
||||
function attachImage(url){
|
||||
function attachImage(url){ print("attachImage "+url)
|
||||
var imageAttachmentObject=Qt.createQmlObject('import QtQuick 2.0; Image {id:imageAttachment'+attachImageURLs.length+'; source:"'+
|
||||
url.toString()+'"; x:2*mm; width: 45*mm; height: 45*mm;fillMode: Image.PreserveAspectFit;MouseArea{anchors.fill:parent;onClicked:{attachImageURLs.splice(attachImageURLs.indexOf("'+
|
||||
url+'"),1); imageAttachment'+attachImageURLs.length+'.destroy()}}}',messageColumn,"attachedImage");
|
||||
}
|
||||
|
||||
function statusUpdate(title,status,in_reply_to_status_id,attachImageURL) {
|
||||
xhr.url= login.server + "/api/statuses/update.json";
|
||||
//xhr.url= login.server + "/api/statuses/update.json";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/statuses/update");
|
||||
xhr.clearParams();
|
||||
xhr.setParam("source", "Friendiqa");
|
||||
xhr.setParam("status", status);
|
||||
|
@ -80,17 +81,27 @@ Flickable{
|
|||
}
|
||||
|
||||
function dmUpdate(title,text,replyto,screen_name,attachImageURL) {
|
||||
xhr.url= login.server + "/api/direct_messages/new.json";
|
||||
//xhr.url= login.server + "/api/direct_messages/new.json";
|
||||
xhr.setLogin(login.username+":"+Qt.atob(login.password));
|
||||
xhr.setUrl(login.server);
|
||||
xhr.setApi("/api/direct_messages/new");
|
||||
xhr.clearParams();
|
||||
xhr.setParam("text", text);
|
||||
xhr.setParam("screen_name", screen_name);
|
||||
if (parentId!="") {xhr.setParam("replyto", replyto)};
|
||||
if (title!=="") {xhr.setParam("title", title)};
|
||||
//if (title!=="") {xhr.setParam("title", title)};
|
||||
xhr.post();
|
||||
}
|
||||
|
||||
Column {
|
||||
Flickable{
|
||||
anchors.fill: parent
|
||||
contentHeight: messageColumn.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
id:messageSend
|
||||
|
||||
|
||||
|
||||
Column {
|
||||
id:messageColumn
|
||||
spacing: 0.5*mm
|
||||
width: parent.width
|
||||
|
@ -98,7 +109,7 @@ Flickable{
|
|||
id: titleField
|
||||
width: parent.width
|
||||
placeholderText: qsTr("Title (optional)")
|
||||
visible: messageSend.parentId === ""
|
||||
visible: parentId === ""
|
||||
}
|
||||
|
||||
Rectangle{
|
||||
|
@ -236,3 +247,4 @@ Flickable{
|
|||
}
|
||||
Component.onCompleted: if(attachImageURLs.length>0){attachImage(attachImageURLs[0])}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue