Preparing data for attachments display implementation
This commit is contained in:
parent
7c71abd7a3
commit
a3bd2834b7
2 changed files with 28 additions and 2 deletions
|
@ -224,7 +224,20 @@ function parseToot (data){
|
||||||
console.log(tag)
|
console.log(tag)
|
||||||
item['content'] = item['content'].replaceAll('#'+tag, '<a href="#'+tag+'">'+tag+'</a>')
|
item['content'] = item['content'].replaceAll('#'+tag, '<a href="#'+tag+'">'+tag+'</a>')
|
||||||
}*/
|
}*/
|
||||||
|
item['attachments'] = [];
|
||||||
|
for(var i = 0; i < data['media_attachments'].length ; i++){
|
||||||
|
var attachments = data['media_attachments'][i];
|
||||||
|
console.log(JSON.stringify(attachments))
|
||||||
|
item['content'] = item['content'].replaceAll(attachments['text_url'], '')
|
||||||
|
item['attachments'].push({
|
||||||
|
id: attachments['id'],
|
||||||
|
id: attachments['id'],
|
||||||
|
type: attachments['type'],
|
||||||
|
url: attachments['remote_url'] !=="" ? attachments['remote_url'] : attachments['url'] ,
|
||||||
|
preview_url: attachments['preview_url']
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log(JSON.stringify(item['attachments']))
|
||||||
item['content'] = item['content'].split(" ")
|
item['content'] = item['content'].split(" ")
|
||||||
for(var i = 0; i < item['content'].length ; i++){
|
for(var i = 0; i < item['content'].length ; i++){
|
||||||
if(item['content'][i][0] === "#"){
|
if(item['content'][i][0] === "#"){
|
||||||
|
|
|
@ -6,7 +6,7 @@ BackgroundItem {
|
||||||
signal send (string notice)
|
signal send (string notice)
|
||||||
signal navigateTo(string link)
|
signal navigateTo(string link)
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: miniHeader.height + lblContent.height + Theme.paddingLarge + (ministatus.visible ? ministatus.height : 0) +Theme.paddingLarge
|
height: miniHeader.height + media.height + lblContent.height + Theme.paddingLarge + (ministatus.visible ? ministatus.height : 0) +Theme.paddingLarge
|
||||||
MiniStatus {
|
MiniStatus {
|
||||||
id: ministatus
|
id: ministatus
|
||||||
anchors {
|
anchors {
|
||||||
|
@ -114,6 +114,19 @@ BackgroundItem {
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: (pressed ? Theme.highlightColor : (highlight ? Theme.primaryColor : Theme.secondaryColor))
|
color: (pressed ? Theme.highlightColor : (highlight ? Theme.primaryColor : Theme.secondaryColor))
|
||||||
}
|
}
|
||||||
|
Label {
|
||||||
|
id: media
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
leftMargin: Theme.paddingMedium
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: Theme.horizontalPageMargin
|
||||||
|
top: lblContent.bottom
|
||||||
|
topMargin: Theme.paddingSmall
|
||||||
|
bottomMargin: Theme.paddingLarge
|
||||||
|
}
|
||||||
|
text: attachments.count + "Aaa"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue