0.1.6
- Fix for issue #10 - Hashtag search added - Coversation with sections
This commit is contained in:
parent
affa006211
commit
b241a857a5
13 changed files with 71 additions and 38 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,4 @@
|
|||
|
||||
*.user
|
||||
harbour-tooter.pro.user
|
||||
harbour-tooter.pro.user
|
||||
|
|
|
@ -44,6 +44,7 @@ CONFIG += sailfishapp_i18n
|
|||
# following TRANSLATIONS line. And also do not forget to
|
||||
# modify the localized app name in the the .desktop file.
|
||||
TRANSLATIONS += \
|
||||
translations/harbour-tooter-es.ts \
|
||||
translations/harbour-tooter-fr.ts \
|
||||
translations/harbour-tooter-nl.ts \
|
||||
translations/harbour-tooter-oc.ts
|
||||
|
|
|
@ -75,6 +75,8 @@ WorkerScript.onMessage = function(msg) {
|
|||
for (var j = 0; j < data[i].length; j ++) {
|
||||
item = parseToot(data[i][j]);
|
||||
item['id'] = item['status_id']
|
||||
if (typeof item['attachments'] === "undefined")
|
||||
item['attachments'] = [];
|
||||
items.push(item)
|
||||
console.log(JSON.stringify(data[i][j]))
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ Page {
|
|||
if ( xhr.status === 200 ) {
|
||||
console.log(xhr.responseText)
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
if (response.date_published)
|
||||
//if (response.date_published)
|
||||
//articleDate = new Date(response.date_published.replace(/^(\w+) (\w+) (\d+) ([\d:]+) \+0000 (\d+)$/,"$1, $2 $3 $5 $4 GMT"));
|
||||
if (response.title)
|
||||
articleTitle = response.title;
|
||||
|
|
|
@ -37,6 +37,13 @@ Page {
|
|||
right: parent.right
|
||||
}
|
||||
model: mdl
|
||||
section {
|
||||
property: 'section'
|
||||
delegate: SectionHeader {
|
||||
height: Theme.itemSizeExtraSmall
|
||||
text: Format.formatDate(section, Formatter.DateMedium)
|
||||
}
|
||||
}
|
||||
delegate: VisualContainer {}
|
||||
onCountChanged: {
|
||||
for (var i = 0; i < mdl.count; i++){
|
||||
|
@ -55,6 +62,12 @@ Page {
|
|||
DockedPanel {
|
||||
id: panel
|
||||
open: true
|
||||
onExpandedChanged: {
|
||||
if (!expanded) {
|
||||
show()
|
||||
}
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
height: toot.height + btnContentWarning.height + Theme.paddingMedium + (warningContent.visible ? warningContent.height : 0)
|
||||
dock: Dock.Bottom
|
||||
|
|
|
@ -87,11 +87,21 @@ Page {
|
|||
onOpenDrawer: infoPanel.open = setDrawer
|
||||
}
|
||||
MyList{
|
||||
property string search;
|
||||
id: tlSearch;
|
||||
property string search;
|
||||
onSearchChanged: {
|
||||
mdl = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
|
||||
if (search[0] === "#") {
|
||||
tlSearch.type = "timelines/tag/"+search.substring(1)
|
||||
loadData("append")
|
||||
}
|
||||
}
|
||||
onTypeChanged: {
|
||||
console.log("type changed")
|
||||
}
|
||||
title: qsTr("Search")
|
||||
type: "search"
|
||||
mdl: Logic.modelTLsearch
|
||||
type: ""
|
||||
mdl: ListModel {}
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
onOpenDrawer: infoPanel.open = setDrawer
|
||||
|
@ -108,8 +118,8 @@ Page {
|
|||
}
|
||||
}
|
||||
ViewPlaceholder {
|
||||
enabled: Logic.modelTLsearch.count === 0
|
||||
text: "Not implemented"
|
||||
enabled: tlSearch.mdl === 0
|
||||
text: "Only #hastag search works"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,7 +174,7 @@ Page {
|
|||
console.log(JSON.stringify(test))
|
||||
console.log(JSON.stringify(test.length))
|
||||
if (test.length === 5 && (test[3] === "tags" || test[3] === "tag") ) {
|
||||
tlSearch.search = "#"+test[4]
|
||||
tlSearch.search = "#"+decodeURIComponent(test[4])
|
||||
slideshow.positionViewAtIndex(3, ListView.SnapToItem)
|
||||
navigation.navigateTo('search')
|
||||
|
||||
|
|
|
@ -17,8 +17,10 @@ Item {
|
|||
}
|
||||
//console.log(JSON.stringify(model.get(0)))
|
||||
}
|
||||
|
||||
switch(model.count){
|
||||
var count = 0
|
||||
if (model && model.count)
|
||||
count = model.count
|
||||
switch(count){
|
||||
case 1:
|
||||
placeholder1.width = holder.width
|
||||
placeholder1.height = placeholder1.width*hRatio
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick 2.2
|
||||
import Sailfish.Silica 1.0
|
||||
import "../../lib/API.js" as Logic
|
||||
import "."
|
||||
|
@ -25,6 +25,7 @@ SilicaListView {
|
|||
}
|
||||
|
||||
|
||||
|
||||
signal openDrawer (bool setDrawer)
|
||||
onOpenDrawer: {
|
||||
//console.log("Open drawer: " + setDrawer)
|
||||
|
@ -92,7 +93,8 @@ SilicaListView {
|
|||
}
|
||||
}
|
||||
|
||||
delegate: VisualContainer {} //Toot {}
|
||||
delegate: VisualContainer {
|
||||
} //Toot {}
|
||||
|
||||
add: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 800 }
|
||||
|
@ -160,14 +162,7 @@ SilicaListView {
|
|||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
var msg = {
|
||||
'action' : type,
|
||||
'params' : [ ],
|
||||
'model' : model,
|
||||
'mode' : "append",
|
||||
'conf' : Logic.conf
|
||||
};
|
||||
worker.sendMessage(msg);
|
||||
loadData("prepend")
|
||||
}
|
||||
|
||||
Timer {
|
||||
|
@ -193,6 +188,7 @@ SilicaListView {
|
|||
'mode' : mode,
|
||||
'conf' : Logic.conf
|
||||
};
|
||||
worker.sendMessage(msg);
|
||||
if (type !== "")
|
||||
worker.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ Item {
|
|||
}
|
||||
Column {
|
||||
anchors {
|
||||
left: icon.left
|
||||
left: icon.right
|
||||
leftMargin: Theme.paddingLarge
|
||||
right: parent.right
|
||||
rightMargin: Theme.paddingLarge
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick 2.2
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
BackgroundItem {
|
||||
|
||||
id: delegate
|
||||
signal send (string notice)
|
||||
signal navigateTo(string link)
|
||||
width: parent.width
|
||||
height: miniHeader.height + (attachments && attachments.count ? media.height + Theme.paddingLarge + Theme.paddingMedium: Theme.paddingLarge) + lblContent.height + Theme.paddingLarge + (ministatus.visible ? ministatus.height : 0)
|
||||
height: mnu.height + miniHeader.height + (typeof attachments !== "undefined" && attachments.count ? media.height + Theme.paddingLarge + Theme.paddingMedium: Theme.paddingLarge) + lblContent.height + Theme.paddingLarge + (ministatus.visible ? ministatus.height : 0)
|
||||
MiniStatus {
|
||||
id: ministatus
|
||||
anchors {
|
||||
|
@ -108,25 +109,14 @@ BackgroundItem {
|
|||
"profileImage": ""
|
||||
})
|
||||
} else {
|
||||
pageStack.push(Qt.resolvedUrl("Browser.qml"), {"href" : href})
|
||||
pageStack.push(Qt.resolvedUrl("../Browser.qml"), {"href" : link})
|
||||
}
|
||||
|
||||
/*if (link[0] === "@") {
|
||||
pageStack.push(Qt.resolvedUrl("../Profile.qml"), {
|
||||
"name": "",
|
||||
"username": link.substring(1),
|
||||
"profileImage": ""
|
||||
})
|
||||
} else if (link[0] === "#") {
|
||||
|
||||
|
||||
} else {
|
||||
pageStack.push(Qt.resolvedUrl("../Browser.qml"), {"href" : link})
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
text: content.replace(new RegExp("<a ", 'g'), '<a style="text-decoration: none; color:'+Theme.highlightColor+'" ')
|
||||
text: content.replace(new RegExp("<a ", 'g'), '<a style="text-decoration: none; color:'+(pressed ? Theme.secondaryColor : Theme.highlightColor)+'" ')
|
||||
textFormat: Text.RichText
|
||||
linkColor : Theme.highlightColor
|
||||
wrapMode: Text.Wrap
|
||||
|
@ -145,6 +135,16 @@ BackgroundItem {
|
|||
model: typeof attachments !== "undefined" ? attachments : []
|
||||
height: 100
|
||||
}
|
||||
ContextMenu {
|
||||
id: mnu
|
||||
MenuItem {
|
||||
text: "Toggle bold font"
|
||||
}
|
||||
MenuItem {
|
||||
text: "Remove"
|
||||
onClicked: model.remove(model.index)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -163,5 +163,9 @@ BackgroundItem {
|
|||
}
|
||||
onPressAndHold: {
|
||||
console.log(lblContent.text)
|
||||
mnu.show(delegate)
|
||||
}
|
||||
onDoubleClicked: {
|
||||
console.log("double click")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,3 +16,6 @@
|
|||
- Toot rendering reverted to the HTML
|
||||
- Translations added: FR, NL, OC, ES
|
||||
|
||||
* Tue Jun 20 2017 Dusko Angirevic <dysko@me.com> 0.1.6-1
|
||||
- Hashtag search added
|
||||
- Coversation with sections
|
||||
|
|
|
@ -13,7 +13,7 @@ Name: harbour-tooter
|
|||
%{!?qtc_make:%define qtc_make make}
|
||||
%{?qtc_builddir:%define _builddir %qtc_builddir}
|
||||
Summary: Tooter
|
||||
Version: 0.1.5
|
||||
Version: 0.1.6
|
||||
Release: 1
|
||||
Group: Qt/Qt
|
||||
License: LICENSE
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: harbour-tooter
|
||||
Summary: Tooter
|
||||
Version: 0.1.5
|
||||
Version: 0.1.6
|
||||
Release:
|
||||
# The contents of the Group field should be one of the groups listed here:
|
||||
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
|
||||
|
|
Loading…
Reference in a new issue