Merge lp:~hmiguellima/ubuntu-facebook-app/hlima-initial into lp:ubuntu-facebook-app

Proposed by Hugo Miguel Barbarrica Rodrigues Lima
Status: Merged
Approved by: Michael Hall
Approved revision: 24
Merged at revision: 5
Proposed branch: lp:~hmiguellima/ubuntu-facebook-app/hlima-initial
Merge into: lp:ubuntu-facebook-app
Diff against target: 1558 lines (+1074/-63)
24 files modified
AuthModel.qml (+1/-0)
CommentsPanel.qml (+236/-0)
LoginPopup.qml (+3/-1)
NewsPage.qml (+46/-40)
StatusUpdatePopup.qml (+138/-0)
ThreadView.qml (+132/-0)
app-theme.qmltheme (+322/-0)
artwork/PageHeaderBaseDivider@18.sci (+5/-0)
artwork/PageHeaderBaseDividerLight@18.sci (+5/-0)
artwork/TabLeftSelected@8.sci (+7/-0)
artwork/TabLeftUnselected@8.sci (+7/-0)
artwork/TabMiddleSelected@8.sci (+7/-0)
artwork/TabMiddleUnselected@8.sci (+7/-0)
artwork/TabRightSelected@8.sci (+7/-0)
artwork/TabRightUnselected@8.sci (+7/-0)
artwork/ubuntushape_medium_radius_idle@18.sci (+5/-0)
artwork/ubuntushape_medium_radius_pressed@18.sci (+5/-0)
artwork/ubuntushape_medium_radius_shape@18.sci (+5/-0)
artwork/ubuntushape_small_radius_idle@18.sci (+5/-0)
artwork/ubuntushape_small_radius_pressed@18.sci (+5/-0)
artwork/ubuntushape_small_radius_shape@18.sci (+5/-0)
auth.js (+18/-13)
facebook.js (+49/-0)
ubuntu-facebook-app.qml (+47/-9)
To merge this branch: bzr merge lp:~hmiguellima/ubuntu-facebook-app/hlima-initial
Reviewer Review Type Date Requested Status
Michael Hall Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+163079@code.launchpad.net

Commit message

Initial development:

- List comments and likes
- Post a comment
- Like / Unlike post

Description of the change

Initial devel (comments and likes)

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:21
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~hmiguellima/ubuntu-facebook-app/hlima-initial/+merge/163079/+edit-commit-message

http://91.189.93.125:8080/job/ubuntu-facebook-app-ci/1/
Executed test runs:
    SUCCESS: http://91.189.93.125:8080/job/ubuntu-facebook-app-quantal-amd64-ci/1
    SUCCESS: http://91.189.93.125:8080/job/ubuntu-facebook-app-raring-amd64-ci/1

Click here to trigger a rebuild:
http://91.189.93.125:8080/job/ubuntu-facebook-app-ci/1/rebuild

review: Needs Fixing (continuous-integration)
22. By Hugo Miguel Barbarrica Rodrigues Lima

Header styling

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
23. By Hugo Miguel Barbarrica Rodrigues Lima

Status update component UI

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
24. By Hugo Miguel Barbarrica Rodrigues Lima

Send post (wall)

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Hall (mhall119) wrote :

Tried it on my Nexus 7, looking pretty good, everything seems to work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AuthModel.qml'
2--- AuthModel.qml 2013-03-30 01:52:44 +0000
3+++ AuthModel.qml 2013-05-30 02:57:26 +0000
4@@ -1,6 +1,7 @@
5 import QtQuick 2.0
6 import QtQuick.LocalStorage 2.0
7 import Ubuntu.OnlineAccounts 0.1
8+import "facebook.js" as FacebookFuncs
9 import "auth.js" as AuthFuncs
10
11 Item {
12
13=== added file 'CommentsPanel.qml'
14--- CommentsPanel.qml 1970-01-01 00:00:00 +0000
15+++ CommentsPanel.qml 2013-05-30 02:57:26 +0000
16@@ -0,0 +1,236 @@
17+import QtQuick 2.0
18+import Ubuntu.Components 0.1
19+import Ubuntu.Components.ListItems 0.1
20+import Friends 0.1
21+import "facebook.js" as FacebookFuncs
22+
23+Rectangle {
24+ color: "#F6F7F8"
25+ height: likeLabels.height + replyPanel.height + units.gu(2)
26+
27+ property int commentsCountProp
28+ property bool liked: column_13
29+
30+ FriendsDispatcher {
31+ id: friends
32+ onSendComplete: {
33+ if (success) {
34+ commentField.text = '';
35+ console.log ("Send completed successfully");
36+ } else {
37+ console.log ("Send failed: " + errorMessage);
38+ }
39+ commentField.enabled = true;
40+ postButton.enabled = true;
41+ loadingIndicator.visible = false;
42+ }
43+
44+ onLikeComplete: {
45+ if (success) {
46+ liked = true;
47+ } else {
48+ console.log ("Like failed: " + errorMessage);
49+ }
50+ likeLinkMouseArea.enabled = true;
51+ likeLink.color = "#7CA1E4";
52+ }
53+ onUnlikeComplete: {
54+ if (success) {
55+ liked = false;
56+ } else {
57+ console.log ("UnLike failed: " + errorMessage);
58+ }
59+ likeLinkMouseArea.enabled = true;
60+ likeLink.color = "#7CA1E4";
61+ }
62+
63+ }
64+
65+ Row {
66+ id: likeLabels
67+ anchors.left: parent.left
68+ anchors.top: parent.top
69+ spacing: units.gu(1)
70+ anchors.leftMargin: units.gu(1)
71+ anchors.topMargin: units.gu(1)
72+
73+ Label {
74+ id: likeLink
75+ text: (liked?"Unlike":"Like")
76+ color: "#7CA1E4"
77+ MouseArea {
78+ id: likeLinkMouseArea
79+ anchors.top: parent.top
80+ anchors.left: parent.left
81+ anchors.right: parent.right
82+ height: likeLabels.height + units.gu(1)
83+
84+ onClicked: {
85+ likeLinkMouseArea.enabled = false;
86+ likeLink.color = "#A6A7A8";
87+ if (liked) {
88+ friends.unlikeAsync(accountId, postMessageId);
89+ console.log('unlike accountId:' + accountId + ', messageId' + postMessageId);
90+ }
91+ else {
92+ friends.likeAsync(accountId, postMessageId);
93+ console.log('like accountId:' + accountId + ', messageId' + postMessageId);
94+ }
95+ }
96+ }
97+ }
98+
99+ Label {
100+ text: "-"
101+ }
102+
103+ Label {
104+ text: "Comment"
105+ color: "#7CA1E4"
106+ MouseArea {
107+ anchors.top: parent.top
108+ anchors.left: parent.left
109+ anchors.right: parent.right
110+ height: likeLabels.height + units.gu(1)
111+
112+ onClicked: openReplyPanel()
113+ }
114+ }
115+ }
116+
117+ Row {
118+ anchors.right: parent.right
119+ anchors.top: parent.top
120+ anchors.rightMargin: units.gu(1)
121+ anchors.topMargin: units.gu(1)
122+
123+ spacing: units.gu(1)
124+
125+ Row {
126+ visible: (postLikes > 0)
127+ Image {
128+ source: Qt.resolvedUrl("images/like.png")
129+ }
130+
131+ Label {
132+ text: postLikes
133+ }
134+ }
135+
136+
137+ Row {
138+ id: commentsCountWidget
139+ visible: false
140+
141+ Image {
142+ source: Qt.resolvedUrl("images/comment.png")
143+ }
144+
145+ Label {
146+ text: commentsCountProp
147+ }
148+ }
149+ }
150+
151+
152+ Item {
153+ anchors.top: likeLabels.bottom
154+ anchors.left: parent.left
155+ anchors.right: parent.right
156+ id: replyPanel
157+ visible: false
158+ height: (visible?childrenRect.height+units.gu(1):0)
159+
160+ TextArea {
161+ id: commentField
162+ anchors.top: parent.top
163+ anchors.topMargin: units.gu(1)
164+ anchors.left: parent.left
165+ anchors.leftMargin: units.gu(1)
166+ anchors.right: postButton.left
167+ anchors.rightMargin: units.gu(1)
168+ placeholderText: "Write a comment"
169+ font.pixelSize: FontUtils.sizeToPixels("medium")
170+ font.family: "Ubuntu"
171+ Keys.onReturnPressed: postButton.clicked(null)
172+ Keys.onEscapePressed: text = ""
173+ autoSize: true
174+ maximumLineCount: 0
175+ }
176+
177+ Button {
178+ id: postButton
179+ anchors.top: parent.top
180+ anchors.topMargin: units.gu(1)
181+ anchors.right: parent.right
182+ anchors.rightMargin: units.gu(1)
183+ text: "Post"
184+
185+ onClicked: {
186+ console.log ("Reply to " + postMessageId + " from " + accountId + ": " + commentField.text);
187+ loadingIndicator.visible = true
188+ postButton.enabled = false
189+ commentField.enabled = false
190+ friends.sendReplyAsync(accountId, postMessageId, commentField.text);
191+ }
192+ }
193+
194+ Item {
195+ id: loadingIndicator
196+ visible: true
197+ anchors.top: commentField.bottom
198+ anchors.left: parent.left
199+ anchors.leftMargin: units.gu(1)
200+ anchors.right: parent.right
201+ anchors.rightMargin: units.gu(1)
202+ height: units.gu(8)
203+
204+ ActivityIndicator {
205+ anchors.centerIn: parent
206+ running: visible
207+ }
208+ }
209+
210+ Loader {
211+ id: threadView
212+ anchors.top: commentField.bottom
213+ anchors.left: parent.left
214+ anchors.leftMargin: units.gu(1)
215+ anchors.right: parent.right
216+ anchors.rightMargin: units.gu(1)
217+
218+ property alias loadingIndicator: loadingIndicator
219+
220+ source: (replyPanel.visible?'ThreadView.qml':'')
221+ }
222+ }
223+
224+ MouseArea {
225+ anchors.top: parent.top
226+ anchors.left: likeLabels.right
227+ anchors.right: parent.right
228+ height: likeLabels.height + units.gu(1)
229+
230+ onClicked: openReplyPanel()
231+ }
232+
233+ Component.onCompleted: {
234+ console.log('CommentsPanel loaded');
235+ console.log('PostMessageId:'+postMessageId);
236+ FacebookFuncs.getCommentCount(token, postMessageId).done(function(commentsCount) {
237+ console.log('FacebookFuncs.getCommentCount:'+commentsCount);
238+ if (commentsCount>0) {
239+ commentsCountWidget.visible=true;
240+ commentsCountProp=commentsCount;
241+ }
242+ }).fail(function(e) {
243+ console.log('FacebookFuncs.getCommentCount:'+e);
244+ });
245+ }
246+
247+ function openReplyPanel() {
248+ replyPanel.visible = ! replyPanel.visible;
249+ if (replyPanel.visible)
250+ loadingIndicator.visible=true;
251+ }
252+}
253
254=== modified file 'LoginPopup.qml'
255--- LoginPopup.qml 2013-03-30 01:52:44 +0000
256+++ LoginPopup.qml 2013-05-30 02:57:26 +0000
257@@ -42,7 +42,9 @@
258 title: "Facebook login"
259 doneButton: true
260 anchors.fill: parent
261- contentsWidth: units.gu(45)
262+
263+ contentsWidth: facebookMainView.width
264+ contentsHeight: facebookMainView.height
265
266 Component.onCompleted: {
267 __rightButton.visible = false;
268
269=== modified file 'NewsPage.qml'
270--- NewsPage.qml 2013-04-18 22:44:25 +0000
271+++ NewsPage.qml 2013-05-30 02:57:26 +0000
272@@ -2,11 +2,13 @@
273 import Ubuntu.Components 0.1
274 import Ubuntu.Components.ListItems 0.1
275 import Friends 0.1
276+import "facebook.js" as FacebookFuncs
277
278 Page {
279 id: newsPage
280
281- property int accountId: -1
282+ property int accountId: facebookMainView.accountId
283+ property string token: facebookMainView.token
284
285 FriendsUtils {
286 id: friendsUtils
287@@ -19,6 +21,9 @@
288 ListView {
289 id: listView
290 anchors.fill: parent
291+ anchors.leftMargin: units.gu(1)
292+ anchors.rightMargin: units.gu(1)
293+
294 cacheBuffer: parent.height
295 opacity: 0.0
296
297@@ -28,13 +33,31 @@
298
299 delegate: Rectangle {
300 id: tile
301- height: childrenRect.height + units.gu(2)
302+ height: childrenRect.height
303 width: parent.width
304 color: "#FFFFFF"
305
306- anchors {
307- margins: units.gu(1)
308- }
309+ property string postService: column_0
310+ property string postAccountId: column_1
311+ property string postMessageId: column_2
312+ property string postStream: column_3
313+ property string postSender: column_4
314+ property bool postFromMe: column_7
315+ property string postTimeString: friendsUtils.createTimeString(column_8)
316+ property string postMessage: column_9
317+ property string postAvatar: column_10
318+ property string postUrl: column_11
319+ property int postLikes: column_12 > 0 ? column_12 : postLiked ? 1 : 0
320+ property bool postLiked: column_13
321+ property string postLinkPicture: column_14
322+ property string postLinkName: column_15
323+ property string postLLinkUrl: column_16
324+ property string postDesc: column_17
325+ property string postLinkCaption: column_18
326+ property string postLinkIcon: column_19
327+ property string postLocation: column_20
328+ property string postLatitude: column_21
329+ property string postLongitude: column_22
330
331 UbuntuShape {
332 id: avatarImage
333@@ -49,7 +72,7 @@
334 }
335 image: Image {
336 anchors.fill: parent
337- source: Qt.resolvedUrl(column_10)
338+ source: Qt.resolvedUrl(postAvatar)
339 asynchronous: true
340 fillMode: Image.PreserveAspectFit
341 }
342@@ -81,7 +104,7 @@
343 }
344 Label {
345 id: senderName
346- text: column_4
347+ text: postSender
348 fontSize: "medium"
349 font.bold: true
350 font.family: "Ubuntu"
351@@ -90,7 +113,7 @@
352
353 Label {
354 id: message
355- text: column_9
356+ text: postMessage
357 onLinkActivated: Qt.openUrlExternally(link)
358 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
359 width: parent.width - units.gu(3)
360@@ -99,28 +122,15 @@
361 }
362
363 Image {
364- source: Qt.resolvedUrl(column_14.replace("_s.jpg", "_b.jpg"))
365+ source: Qt.resolvedUrl(postLinkPicture.replace("_s.jpg", "_b.jpg"))
366 asynchronous: true
367 fillMode: Image.PreserveAspectCrop
368- width: tile.width
369- height: tile.width * (implicitHeight/implicitWidth)
370- x: 0 - newsItem.x
371+ width: tile.width + units.gu(2)
372+ height: (tile.width + units.gu(2)) * (implicitHeight/implicitWidth)
373+ x: 0 - newsItem.x - units.gu(1)
374 y: messageColumn.height + units.gu(2)
375 }
376
377- /*
378- Label {
379- id: imageComment
380- color: "#a0a0a0"
381- width: parent.width - units.gu(3)
382- wrapMode: Text.WrapAtWordBoundaryOrAnywhere
383- text: decorateLinks(column_18)
384- onLinkActivated: Qt.openUrlExternally(link)
385- fontSize: "small"
386- font.family: "Ubuntu"
387- }
388- */
389-
390 Row {
391 anchors.right: parent.right
392 anchors.rightMargin: units.gu(1)
393@@ -129,33 +139,29 @@
394
395 Label {
396 id: time
397- text: friendsUtils.createTimeString(column_8)
398+ text: friendsUtils.createTimeString(postTimeString)
399 fontSize: "small"
400 font.family: "Ubuntu"
401 }
402 }
403 }
404
405- Row {
406+
407+
408+ Loader {
409 id: actionsBar
410-
411 anchors.top: newsItem.bottom
412 anchors.left: parent.left
413 anchors.right: parent.right
414- anchors.leftMargin: units.gu(1)
415- spacing: units.gu(1)
416-
417- Button {
418- width: parent.width * 0.31
419- text: "like"
420- }
421-
422- Button {
423- width: parent.width * 0.31
424- text: "comments"
425- }
426+ property int postLikes: (column_12 > 0 ? column_12 : column_13 ? 1 : 0)
427+ property string postMessageId: column_2
428+ property string token: newsPage.token
429+
430+ visible: (index > listView.indexAt(listView.contentX, listView.contentY)-4) && (index < listView.indexAt(listView.contentX, listView.contentY)+4)
431+ source: (visible?'CommentsPanel.qml':'')
432 }
433
434+
435 ThinDivider {
436 id: divider
437 height: units.gu(2)
438
439=== added file 'StatusUpdatePopup.qml'
440--- StatusUpdatePopup.qml 1970-01-01 00:00:00 +0000
441+++ StatusUpdatePopup.qml 2013-05-30 02:57:26 +0000
442@@ -0,0 +1,138 @@
443+/*
444+ * Copyright 2013 Canonical Ltd.
445+ *
446+ *
447+ * This program is free software; you can redistribute it and/or modify
448+ * it under the terms of the GNU Lesser General Public License as published by
449+ * the Free Software Foundation; version 3.
450+ *
451+ * This program is distributed in the hope that it will be useful,
452+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
453+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
454+ * GNU Lesser General Public License for more details.
455+ *
456+ * You should have received a copy of the GNU Lesser General Public License
457+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
458+ */
459+
460+import QtQuick 2.0
461+import Ubuntu.Components 0.1
462+import Ubuntu.Components.ListItems 0.1 as ListItem
463+import Friends 0.1
464+import Ubuntu.Components.Popups 0.1
465+import "facebook.js" as FacebookFuncs
466+
467+Item {
468+ id: statusPopup
469+
470+ property int accountId: facebookMainView.accountId
471+ property string token: facebookMainView.token
472+
473+ FriendsDispatcher {
474+ id: friends
475+
476+ onSendComplete: {
477+ if (success) {
478+ activitySpinner.visible = false;
479+ entryArea.text = "";
480+ console.log ("Send completed successfully");
481+ statusSheet.hide()
482+ } else {
483+ activitySpinner.visible = false;
484+ console.log ("Send failed: " + errorMessage);
485+ }
486+ }
487+ }
488+
489+ Component {
490+ id: statusComponent
491+
492+ ComposerSheet {
493+ id: statusSheet
494+ title: "Write Post"
495+
496+ anchors.fill: parent
497+
498+ contentsWidth: facebookMainView.width
499+ contentsHeight: facebookMainView.height
500+
501+ onConfirmClicked: {
502+ activitySpinner.visible = true
503+ friends.sendForAccountAsync(accountId, postField.text);
504+ }
505+
506+ Item {
507+ width: parent.width
508+ height: parent.height
509+
510+ UbuntuShape {
511+ id: avatarImage
512+ radius: "medium"
513+ height: units.dp(48)
514+ width: units.dp(48)
515+
516+ anchors {
517+ left: parent.left
518+ top: parent.top
519+ leftMargin: units.gu(1)
520+ topMargin: units.gu(1)
521+ }
522+
523+ image: Image {
524+ anchors.fill: parent
525+ source: FacebookFuncs.getProfilePictureUrl(token)
526+ asynchronous: true
527+ fillMode: Image.PreserveAspectFit
528+ }
529+ }
530+
531+ TextArea {
532+ id: postField
533+
534+ anchors {
535+ top: parent.top
536+ topMargin: units.gu(1)
537+ left: avatarImage.right
538+ leftMargin: units.gu(1)
539+ right: parent.right
540+ rightMargin: units.gu(1)
541+ }
542+
543+ placeholderText: "What's on your mind?"
544+ font.pixelSize: FontUtils.sizeToPixels("medium")
545+ font.family: "Ubuntu"
546+ autoSize: true
547+ maximumLineCount: 0
548+ }
549+
550+ ActivityIndicator {
551+ id: activitySpinner
552+ anchors.centerIn: postField
553+ visible: false
554+ running: visible
555+ }
556+
557+ }
558+
559+ Component.onCompleted: {
560+ }
561+ }
562+ }
563+
564+ Timer {
565+ id: initTimer
566+ interval: 500
567+ repeat: false
568+ triggeredOnStart: false
569+ running: false
570+
571+ onTriggered: {
572+ PopupUtils.open(statusComponent);
573+ console.log("StatusUpdatePopup.open")
574+ }
575+ }
576+
577+ function open() {
578+ initTimer.start();
579+ }
580+}
581
582=== added file 'ThreadView.qml'
583--- ThreadView.qml 1970-01-01 00:00:00 +0000
584+++ ThreadView.qml 2013-05-30 02:57:26 +0000
585@@ -0,0 +1,132 @@
586+import QtQuick 2.0
587+import Ubuntu.Components 0.1
588+import Friends 0.1
589+
590+Item {
591+ id: threadView
592+ height: threadListView.height
593+
594+ property int commentsCount: 0
595+
596+ StreamModel {
597+ id: streamModel
598+ stream: "reply_to/"+postMessageId
599+ }
600+
601+
602+ FriendsUtils {
603+ id: friendsUtils
604+ }
605+
606+ Column {
607+ id: threadListView
608+ width: parent.width
609+ Repeater {
610+ width: parent.width
611+ model: streamModel
612+ delegate: Item {
613+ id: threadItem
614+ width: parent.width
615+ anchors {
616+ left: parent.left
617+ bottomMargin: units.gu(2)
618+ }
619+ height: status_update_content.height
620+
621+ UbuntuShape {
622+ id: avatarImage
623+ radius: "small"
624+ height: units.dp(32)
625+ width: units.dp(32)
626+ anchors {
627+ left: parent.left
628+ top: parent.top
629+ leftMargin: units.gu(1)
630+ topMargin: units.gu(1)
631+ }
632+ image: Image {
633+ source: Qt.resolvedUrl(column_10)
634+ asynchronous: true
635+ fillMode: Image.PreserveAspectFit
636+ }
637+ }
638+
639+ Item {
640+ id: status_update_content
641+ anchors {
642+ left: avatarImage.right
643+ right: parent.right
644+ top: parent.top
645+ topMargin: units.gu(1)
646+ leftMargin: units.gu(1)
647+ bottomMargin: units.gu(1)
648+ rightMargin: units.gu(1)
649+ }
650+ width: parent.width - avatarImage.width
651+ height: childrenRect.height + units.gu(1)
652+
653+ Column {
654+ width: parent.width
655+ spacing: 0
656+ anchors {
657+ left: parent.left;
658+ right: parent.right
659+ bottomMargin: units.gu(2)
660+ }
661+ Label {
662+ text: column_4
663+ fontSize: "small"
664+ font.bold: true
665+ width: parent.width
666+ }
667+ Label {
668+ id: messageText
669+ text: column_9
670+ wrapMode: Text.WrapAtWordBoundaryOrAnywhere
671+ width: parent.width - units.gu(3)
672+ fontSize: "small"
673+ onLinkActivated: {
674+ console.log(link + " link activated");
675+ Qt.openUrlExternally(link);
676+ }
677+ }
678+ }
679+ Row {
680+ anchors.right: parent.right
681+ anchors.rightMargin: units.gu(1)
682+ anchors.top: parent.top
683+ spacing: units.gu(1)
684+
685+ Text {
686+ id: time
687+ text: friendsUtils.createTimeString(column_8)
688+ font.family: "Ubuntu"
689+ font.pointSize: 8
690+ color: "gray"
691+ }
692+ }
693+ }
694+ }
695+ }
696+ }
697+
698+ Timer {
699+ id: waitTimer
700+ interval: 500
701+ repeat: true
702+ triggeredOnStart: false
703+ running: false
704+ onTriggered: {
705+ if (commentsCount !== streamModel.count)
706+ commentsCount=streamModel.count;
707+ else {
708+ waitTimer.stop()
709+ loadingIndicator.visible = false;
710+ }
711+ }
712+ }
713+
714+ Component.onCompleted: {
715+ waitTimer.start()
716+ }
717+}
718
719=== added file 'app-theme.qmltheme'
720--- app-theme.qmltheme 1970-01-01 00:00:00 +0000
721+++ app-theme.qmltheme 2013-05-30 02:57:26 +0000
722@@ -0,0 +1,322 @@
723+@qml-import(Ubuntu.Components 0.1);
724+@qml-import(qmltheme 0.1);
725+@qml-mapping(.button, , ButtonDelegate);
726+@qml-mapping(.toolbar, , ToolbarDelegate);
727+@qml-mapping(.toolbar-button, , ToolbarButtonDelegate);
728+@qml-mapping(.dark-button, , ButtonDelegate);
729+@qml-mapping(.transparent-button, , TransparentButtonDelegate);
730+@qml-mapping(.checkbox, , CheckBoxDelegate);
731+@qml-mapping(.switch, , SwitchDelegate);
732+@qml-mapping(.tabs, , TabsDelegate);
733+@qml-mapping(.new-tabs, , NewTabsDelegate);
734+@qml-mapping(.tab-button, , TabButtonDelegate);
735+@qml-mapping(.custom-button, , ButtonDelegate);
736+@qml-mapping(.scrollbar, , ScrollbarDelegate);
737+@qml-mapping (.popover .foreground, , PopoverForegroundDelegate);
738+@qml-mapping (.sheet .foreground, , SheetForegroundDelegate);
739+@qml-mapping (.dialog .foreground, , DialogForegroundDelegate);
740+@qml-mapping (.pointer, , PointerDelegate);
741+@qml-mapping(.textfield, , TextAreaDelegate);
742+@qml-mapping(.textarea, , TextAreaDelegate);
743+@qml-mapping(.mainview, , MainViewDelegate);
744+@qml-mapping(.header, , HeaderDelegate);
745+@qml-mapping(.activityindicator, , ActivityIndicatorDelegate);
746+
747+.activityindicator {
748+ source: url(artwork/spinner.png);
749+}
750+
751+.UbuntuShape-radius-small {
752+ gradientColor: Qt.rgba(0.95, 0.95, 0.91, 0.4);
753+ maskSource: url("artwork/ubuntushape_small_radius_shape.sci");
754+ borderSource: url("artwork/ubuntushape_small_radius_idle.sci");
755+ borderPressed: url("artwork/ubuntushape_small_radius_pressed.sci");
756+}
757+
758+.UbuntuShape-radius-medium {
759+ gradientColor: Qt.rgba(0.95, 0.95, 0.91, 0.4);
760+ maskSource: url("artwork/ubuntushape_medium_radius_shape.sci");
761+ borderSource: url("artwork/ubuntushape_medium_radius_idle.sci");
762+ borderPressed: url("artwork/ubuntushape_medium_radius_pressed.sci");
763+}
764+
765+.button, .custom-button {
766+ color: "#cccccc";
767+ borderSource: url("artwork/ubuntushape_small_radius_idle.sci");
768+ borderPressed: url("artwork/ubuntushape_small_radius_pressed.sci");
769+}
770+
771+.toolbar {
772+ color: "white";
773+ barOpacity: 0.9;
774+ triggerSize: units.gu(2);
775+ hintSize: units.gu(2);
776+}
777+
778+.toolbar-button {
779+ iconWidth: units.gu(2);
780+ iconHeight: units.gu(2);
781+}
782+
783+.toolbar-button .label {
784+ fontSize: "xx-small";
785+ color: "#888888";
786+}
787+
788+.transparent-button {
789+}
790+
791+.checkbox {
792+ checkedColor: "#DD4814";
793+ uncheckedColor: Qt.rgba(0.0, 0.0, 0.0, 0.1);
794+ checkMarkSource: url("artwork/CheckMark.png");
795+ backgroundColorAnimation: ColorAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing };
796+}
797+
798+.switch {
799+ crossSource: url("artwork/Cross.png");
800+ checkMarkSource: url("artwork/CheckMark.png");
801+ selectedImageOpacity: 1.0;
802+ unselectedImageOpacity: 0.4;
803+ thumbSpacing: units.dp(2);
804+ checkedThumbColor: "#DD4814";
805+ uncheckedThumbColor: "#bbbbbb";
806+ thumbColorAnimation: ColorAnimation { duration: UbuntuAnimation.SnapDuration; easing: UbuntuAnimation.StandardEasing };
807+ moveThumbAnimation: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
808+ backgroundColor: Qt.rgba(0.78, 0.78, 0.78, 0.1);
809+}
810+
811+.tabs {
812+ buttonsExpanded: false;
813+ separator: Rectangle {
814+ color: "white";
815+ height: units.dp(1);
816+ };
817+ horizontalPadding: units.gu(1);
818+ minimumButtonWidth: units.gu(8);
819+}
820+
821+.tab-button {
822+ backgroundLeft: item.selected ? url("artwork/TabLeftSelected.sci") : url("artwork/TabLeftUnselected.sci");
823+ backgroundRight: item.selected ? url("artwork/TabRightSelected.sci") : url("artwork/TabRightUnselected.sci");
824+ backgroundMiddle: item.selected ? url("artwork/TabMiddleSelected.sci") : url("artwork/TabMiddleUnselected.sci");
825+}
826+
827+
828+.mainview {
829+ backgroundColor: "#ededf0";
830+ backgroundSource: url("artwork/background_paper.png");
831+}
832+
833+.header {
834+ backgroundColor: "#3a599c";
835+ backgroundSource: url("images/facebook.png");
836+ contentHeight: units.gu(14);
837+ separatorSource: url("artwork/PageHeaderBaseDividerLight.sci");
838+ separatorBottomSource: url("artwork/PageHeaderBaseDividerBottom.png");
839+}
840+
841+.dark-button {
842+ color: "#cccccc";
843+ borderSource: url("artwork/ubuntushape_small_radius_idle.sci");
844+ borderPressed: url("artwork/ubuntushape_small_radius_pressed.sci");
845+}
846+
847+/*
848+ Popups (Popover, Dialog, Sheet)
849+*/
850+.pointer {
851+ source: (item.direction === "left") ? url(artwork/LeftArrow.png) :
852+ (item.direction === "right") ? url(artwork/RightArrow.png) :
853+ (item.direction === "up") ? url(artwork/UpArrow.png) : url(artwork/DownArrow.png);
854+ longAxis: units.gu(2);
855+ shortAxis: units.gu(1);
856+}
857+
858+.popover {
859+ edgeMargins: units.gu(2);
860+ callerMargin: units.gu(1);
861+ fadingAnimation: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
862+}
863+
864+.popover .foreground {
865+ minimumWidth: units.gu(40);
866+ color: "white";
867+ radius: "medium";
868+}
869+
870+.popover .pointer {
871+ opacity: 1.0;
872+}
873+
874+.sheet {
875+ fadingAnimation: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
876+}
877+.sheet .foreground {
878+ headerColor: "darkgray";
879+ headerHeight: units.gu(8);
880+ backgroundColor: "lightgray";
881+ buttonContainerWidth: units.gu(14);
882+}
883+
884+.dialog {
885+ edgeMargins: units.gu(2);
886+ callerMargin: units.gu(1);
887+ fadingAnimation: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
888+}
889+.dialog .background {
890+ dim: true;
891+ color: QuickUtils.rootObject.width > units.gu(60) ? Qt.rgba(0, 0, 0, 0.6) : Qt.rgba(0, 0, 0, 0.9);
892+ opacity: 1.0;
893+}
894+.dialog .foreground {
895+ minimumWidth: units.gu(38);
896+ minimumHeight: units.gu(32);
897+ margins: units.gu(4);
898+ itemSpacing: units.gu(2);
899+ radius: "medium";
900+ visible: QuickUtils.rootObject.width > units.gu(60);
901+ color: visible ? Qt.rgba(0, 0, 0, 0.7) : "transparent";
902+}
903+.dialog .foreground .title {
904+ fontSize: "large";
905+ color: Qt.rgba(1, 1, 1, 0.9);
906+ style: Text.Normal;
907+}
908+
909+.dialog .foreground .label {
910+ fontSize: "medium";
911+ color: Qt.rgba(1, 1, 1, 0.6);
912+ wrapMode: Text.Wrap;
913+}
914+
915+/*
916+ Label does not have any QML mapping, therefore the engine will not assign any
917+ style rule or delegate to the Rule object. Instead a QtObject based style rule
918+ will be used with all declared properties as variant.
919+*/
920+.label {
921+ fontSize: "medium";
922+ color: "#757373";
923+}
924+
925+/* Note: the following could be done using
926+.row-label.title {
927+ fontSize: "medium";
928+}
929+
930+*/
931+.row-label {
932+ fontSize: "medium";
933+ color: "#757373";
934+ styleColor: "white";
935+ style: Text.Raised;
936+}
937+
938+.scrollbar {
939+ interactive: false;
940+ overlay: true;
941+ overlayOpacityWhenShown: 0.6;
942+ overlayOpacityWhenHidden: 0.0;
943+
944+ scrollbarFadeInAnimation: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
945+ scrollbarFadeOutPause: 300;
946+ scrollbarFadeOutAnimation: UbuntuNumberAnimation { duration: UbuntuAnimation.SlowDuration };
947+
948+ sliderAnimation: UbuntuNumberAnimation {};
949+ thumbConnectorFading: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
950+ thumbFading: UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration };
951+ backwardThumbReleased : (item.align === Qt.AlignLeading || item.align === Qt.AlignTrailing) ? url("artwork/ScrollbarTopIdle.png") : url("artwork/ScrollbarLeftIdle.png");
952+ backwardThumbPressed: (item.align === Qt.AlignLeading || item.align === Qt.AlignTrailing) ? url("artwork/ScrollbarTopPressed.png") : url("artwork/ScrollbarLeftPressed.png");
953+ forwardThumbReleased: (item.align === Qt.AlignLeading || item.align === Qt.AlignTrailing) ? url("artwork/ScrollbarBottomIdle.png") : url("artwork/ScrollbarRightIdle.png");
954+ forwardThumbPressed: (item.align === Qt.AlignLeading || item.align === Qt.AlignTrailing) ? url("artwork/ScrollbarBottomPressed.png") : url("artwork/ScrollbarRightPressed.png");
955+ scrollAreaThickness: units.gu(0.5);
956+ sliderRadius: units.gu(0.5);
957+ thumbConnectorMargin: units.dp(3);
958+ sliderColor: Qt.rgba(0.5, 0.5, 0.5, 0.7);
959+ thumbConnectorColor: "white";
960+}
961+
962+/* TextField default theme
963+ Clear button, hint and cursor are declared in atomic form (not hierarchically) so they can be reused.
964+*/
965+
966+/* clear button */
967+.textfield .clear-button {
968+ iconSource: url("artwork/icon_clear.png");
969+}
970+
971+/* hint */
972+.textfield .label {
973+ color: Qt.rgba(0.5, 0.5, 0.5, 0.5);
974+ fontSize: "medium";
975+ elide: Text.ElideRight;
976+}
977+
978+/* cursor */
979+@qml-mapping(.cursor, , EditorCursorDelegate);
980+@qml-import(Ubuntu.Components 0.1);
981+.cursor {
982+ color: Qt.rgba(0.4, 0.4, 0.4, 1.0);
983+ opacity: 1.0;
984+ width: units.dp(1);
985+ blinking: true;
986+ blinkTimeoutShown: 800;
987+ blinkTimeoutHidden: 400;
988+}
989+
990+/*
991+ TextArea styling
992+*/
993+.textfield, .textarea{
994+ radius: "small";
995+ backgroundColor: (item.focus || item.highlighted) ? "white" : Qt.rgba(0, 0, 0, 0.1);
996+ errorColor: "red";
997+ backgroundOpacity: item.enabled ? 1.0 : 0.1;
998+ color: (item.enabled) ? "#757373" : "darkgray";
999+ selectedTextColor: "#F3F3E7";
1000+ selectionColor: "#19B6EE";
1001+ font: Qt.font({family: "Ubuntu", pixelSize: FontUtils.sizeToPixels("medium")});
1002+ frameSpacing: units.gu(1);
1003+ overlaySpacing: units.gu(0.5);
1004+ passwordCharacter: "\u2022";
1005+}
1006+/* hint */
1007+.textarea .label {
1008+ color: Qt.rgba(0.5, 0.5, 0.5, 0.5);
1009+ fontSize: "medium";
1010+ elide: Text.ElideRight;
1011+ wrapMode: Text.WordWrap;
1012+}
1013+/* selection cursors */
1014+@qml-mapping (.left-pin, EditorCursorStyle, SelectionCursorDelegate);
1015+@qml-mapping (.right-pin, EditorCursorStyle, SelectionCursorDelegate);
1016+.textarea .left-pin, .textarea .right-pin {
1017+ color: Qt.rgba(0.4, 0.4, 0.4, 1.0);
1018+ opacity: 1.0;
1019+ width: units.dp(1);
1020+ blinking: false;
1021+ pinSize: units.gu(1.2);
1022+ pinSensingOffset: units.dp(4);
1023+ pinColor: "blue";
1024+}
1025+
1026+/* scrollbars */
1027+.textarea .scrollbar {
1028+ interactive: false;
1029+}
1030+
1031+/* sliders */
1032+@qml-mapping(.slider, , SliderDelegate);
1033+.slider {
1034+ backgroundColor: "#c0c0c0";
1035+ backgroundOpacity: 0.1;
1036+ thumbColor: "#bbbbbb";
1037+ thumbOpacity: 1.0;
1038+ thumbSpacing: units.dp(2);
1039+}
1040+.slider .label {
1041+ fontSize: "medium";
1042+ color: "white";
1043+ font: Qt.font({family: "Ubuntu", weight: Font.Bold, pixelSize: FontUtils.sizeToPixels(fontSize)});
1044+}
1045
1046=== added directory 'artwork'
1047=== added file 'artwork/CheckMark@18.png'
1048Binary files artwork/CheckMark@18.png 1970-01-01 00:00:00 +0000 and artwork/CheckMark@18.png 2013-05-30 02:57:26 +0000 differ
1049=== added file 'artwork/Cross@18.png'
1050Binary files artwork/Cross@18.png 1970-01-01 00:00:00 +0000 and artwork/Cross@18.png 2013-05-30 02:57:26 +0000 differ
1051=== added file 'artwork/DownArrow@18.png'
1052Binary files artwork/DownArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/DownArrow@18.png 2013-05-30 02:57:26 +0000 differ
1053=== added file 'artwork/LeftArrow@18.png'
1054Binary files artwork/LeftArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/LeftArrow@18.png 2013-05-30 02:57:26 +0000 differ
1055=== added file 'artwork/PageHeaderBaseDivider@18.png'
1056Binary files artwork/PageHeaderBaseDivider@18.png 1970-01-01 00:00:00 +0000 and artwork/PageHeaderBaseDivider@18.png 2013-05-30 02:57:26 +0000 differ
1057=== added file 'artwork/PageHeaderBaseDivider@18.sci'
1058--- artwork/PageHeaderBaseDivider@18.sci 1970-01-01 00:00:00 +0000
1059+++ artwork/PageHeaderBaseDivider@18.sci 2013-05-30 02:57:26 +0000
1060@@ -0,0 +1,5 @@
1061+border.top: 4
1062+border.bottom: 4
1063+border.left: 0
1064+border.right: 0
1065+source: PageHeaderBaseDivider@18.png
1066
1067=== added file 'artwork/PageHeaderBaseDividerBottom@18.png'
1068Binary files artwork/PageHeaderBaseDividerBottom@18.png 1970-01-01 00:00:00 +0000 and artwork/PageHeaderBaseDividerBottom@18.png 2013-05-30 02:57:26 +0000 differ
1069=== added file 'artwork/PageHeaderBaseDividerLight@18.png'
1070Binary files artwork/PageHeaderBaseDividerLight@18.png 1970-01-01 00:00:00 +0000 and artwork/PageHeaderBaseDividerLight@18.png 2013-05-30 02:57:26 +0000 differ
1071=== added file 'artwork/PageHeaderBaseDividerLight@18.sci'
1072--- artwork/PageHeaderBaseDividerLight@18.sci 1970-01-01 00:00:00 +0000
1073+++ artwork/PageHeaderBaseDividerLight@18.sci 2013-05-30 02:57:26 +0000
1074@@ -0,0 +1,5 @@
1075+border.top: 4
1076+border.bottom: 0
1077+border.left: 0
1078+border.right: 0
1079+source: PageHeaderBaseDividerLight@18.png
1080
1081=== added file 'artwork/RightArrow@18.png'
1082Binary files artwork/RightArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/RightArrow@18.png 2013-05-30 02:57:26 +0000 differ
1083=== added file 'artwork/ScrollbarBottomIdle@8.png'
1084Binary files artwork/ScrollbarBottomIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarBottomIdle@8.png 2013-05-30 02:57:26 +0000 differ
1085=== added file 'artwork/ScrollbarBottomPressed@8.png'
1086Binary files artwork/ScrollbarBottomPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarBottomPressed@8.png 2013-05-30 02:57:26 +0000 differ
1087=== added file 'artwork/ScrollbarLeftIdle@8.png'
1088Binary files artwork/ScrollbarLeftIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarLeftIdle@8.png 2013-05-30 02:57:26 +0000 differ
1089=== added file 'artwork/ScrollbarLeftPressed@8.png'
1090Binary files artwork/ScrollbarLeftPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarLeftPressed@8.png 2013-05-30 02:57:26 +0000 differ
1091=== added file 'artwork/ScrollbarRightIdle@8.png'
1092Binary files artwork/ScrollbarRightIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarRightIdle@8.png 2013-05-30 02:57:26 +0000 differ
1093=== added file 'artwork/ScrollbarRightPressed@8.png'
1094Binary files artwork/ScrollbarRightPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarRightPressed@8.png 2013-05-30 02:57:26 +0000 differ
1095=== added file 'artwork/ScrollbarTopIdle@8.png'
1096Binary files artwork/ScrollbarTopIdle@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarTopIdle@8.png 2013-05-30 02:57:26 +0000 differ
1097=== added file 'artwork/ScrollbarTopPressed@8.png'
1098Binary files artwork/ScrollbarTopPressed@8.png 1970-01-01 00:00:00 +0000 and artwork/ScrollbarTopPressed@8.png 2013-05-30 02:57:26 +0000 differ
1099=== added file 'artwork/TabLeftSelected@8.png'
1100Binary files artwork/TabLeftSelected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabLeftSelected@8.png 2013-05-30 02:57:26 +0000 differ
1101=== added file 'artwork/TabLeftSelected@8.sci'
1102--- artwork/TabLeftSelected@8.sci 1970-01-01 00:00:00 +0000
1103+++ artwork/TabLeftSelected@8.sci 2013-05-30 02:57:26 +0000
1104@@ -0,0 +1,7 @@
1105+source: TabLeftSelected@8.png
1106+border.left: 9
1107+border.right: 2
1108+border.top: 9
1109+border.bottom: 0
1110+horizontalTileMode: Stretch
1111+verticalTileMode: Stretch
1112
1113=== added file 'artwork/TabLeftUnselected@8.png'
1114Binary files artwork/TabLeftUnselected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabLeftUnselected@8.png 2013-05-30 02:57:26 +0000 differ
1115=== added file 'artwork/TabLeftUnselected@8.sci'
1116--- artwork/TabLeftUnselected@8.sci 1970-01-01 00:00:00 +0000
1117+++ artwork/TabLeftUnselected@8.sci 2013-05-30 02:57:26 +0000
1118@@ -0,0 +1,7 @@
1119+source: TabLeftUnselected@8.png
1120+border.left: 9
1121+border.right: 2
1122+border.top: 9
1123+border.bottom: 0
1124+horizontalTileMode: Stretch
1125+verticalTileMode: Stretch
1126
1127=== added file 'artwork/TabMiddleSelected@8.png'
1128Binary files artwork/TabMiddleSelected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabMiddleSelected@8.png 2013-05-30 02:57:26 +0000 differ
1129=== added file 'artwork/TabMiddleSelected@8.sci'
1130--- artwork/TabMiddleSelected@8.sci 1970-01-01 00:00:00 +0000
1131+++ artwork/TabMiddleSelected@8.sci 2013-05-30 02:57:26 +0000
1132@@ -0,0 +1,7 @@
1133+source: TabMiddleSelected@8.png
1134+border.left: 1
1135+border.right: 2
1136+border.top: 2
1137+border.bottom: 0
1138+horizontalTileMode: Stretch
1139+verticalTileMode: Stretch
1140
1141=== added file 'artwork/TabMiddleUnselected@8.png'
1142Binary files artwork/TabMiddleUnselected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabMiddleUnselected@8.png 2013-05-30 02:57:26 +0000 differ
1143=== added file 'artwork/TabMiddleUnselected@8.sci'
1144--- artwork/TabMiddleUnselected@8.sci 1970-01-01 00:00:00 +0000
1145+++ artwork/TabMiddleUnselected@8.sci 2013-05-30 02:57:26 +0000
1146@@ -0,0 +1,7 @@
1147+source: TabMiddleUnselected@8.png
1148+border.left: 1
1149+border.right: 2
1150+border.top: 2
1151+border.bottom: 0
1152+horizontalTileMode: Stretch
1153+verticalTileMode: Stretch
1154
1155=== added file 'artwork/TabRightSelected@8.png'
1156Binary files artwork/TabRightSelected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabRightSelected@8.png 2013-05-30 02:57:26 +0000 differ
1157=== added file 'artwork/TabRightSelected@8.sci'
1158--- artwork/TabRightSelected@8.sci 1970-01-01 00:00:00 +0000
1159+++ artwork/TabRightSelected@8.sci 2013-05-30 02:57:26 +0000
1160@@ -0,0 +1,7 @@
1161+source: TabRightSelected@8.png
1162+border.left: 1
1163+border.right: 9
1164+border.top: 10
1165+border.bottom: 0
1166+horizontalTileMode: Stretch
1167+verticalTileMode: Stretch
1168
1169=== added file 'artwork/TabRightUnselected@8.png'
1170Binary files artwork/TabRightUnselected@8.png 1970-01-01 00:00:00 +0000 and artwork/TabRightUnselected@8.png 2013-05-30 02:57:26 +0000 differ
1171=== added file 'artwork/TabRightUnselected@8.sci'
1172--- artwork/TabRightUnselected@8.sci 1970-01-01 00:00:00 +0000
1173+++ artwork/TabRightUnselected@8.sci 2013-05-30 02:57:26 +0000
1174@@ -0,0 +1,7 @@
1175+source: TabRightUnselected@8.png
1176+border.left: 1
1177+border.right: 9
1178+border.top: 10
1179+border.bottom: 0
1180+horizontalTileMode: Stretch
1181+verticalTileMode: Stretch
1182
1183=== added file 'artwork/TextFieldClear@8.png'
1184Binary files artwork/TextFieldClear@8.png 1970-01-01 00:00:00 +0000 and artwork/TextFieldClear@8.png 2013-05-30 02:57:26 +0000 differ
1185=== added file 'artwork/UpArrow@18.png'
1186Binary files artwork/UpArrow@18.png 1970-01-01 00:00:00 +0000 and artwork/UpArrow@18.png 2013-05-30 02:57:26 +0000 differ
1187=== added file 'artwork/background_paper@30.png'
1188Binary files artwork/background_paper@30.png 1970-01-01 00:00:00 +0000 and artwork/background_paper@30.png 2013-05-30 02:57:26 +0000 differ
1189=== added file 'artwork/chevron@18.png'
1190Binary files artwork/chevron@18.png 1970-01-01 00:00:00 +0000 and artwork/chevron@18.png 2013-05-30 02:57:26 +0000 differ
1191=== added file 'artwork/icon_clear@20.png'
1192Binary files artwork/icon_clear@20.png 1970-01-01 00:00:00 +0000 and artwork/icon_clear@20.png 2013-05-30 02:57:26 +0000 differ
1193=== added file 'artwork/spinner@30.png'
1194Binary files artwork/spinner@30.png 1970-01-01 00:00:00 +0000 and artwork/spinner@30.png 2013-05-30 02:57:26 +0000 differ
1195=== added file 'artwork/spinner@8.png'
1196Binary files artwork/spinner@8.png 1970-01-01 00:00:00 +0000 and artwork/spinner@8.png 2013-05-30 02:57:26 +0000 differ
1197=== added file 'artwork/toolbar_dropshadow@20.png'
1198Binary files artwork/toolbar_dropshadow@20.png 1970-01-01 00:00:00 +0000 and artwork/toolbar_dropshadow@20.png 2013-05-30 02:57:26 +0000 differ
1199=== added file 'artwork/ubuntushape_medium_radius_idle@18.png'
1200Binary files artwork/ubuntushape_medium_radius_idle@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_medium_radius_idle@18.png 2013-05-30 02:57:26 +0000 differ
1201=== added file 'artwork/ubuntushape_medium_radius_idle@18.sci'
1202--- artwork/ubuntushape_medium_radius_idle@18.sci 1970-01-01 00:00:00 +0000
1203+++ artwork/ubuntushape_medium_radius_idle@18.sci 2013-05-30 02:57:26 +0000
1204@@ -0,0 +1,5 @@
1205+border.left: 44
1206+border.top: 54
1207+border.bottom: 44
1208+border.right: 52
1209+source: ubuntushape_medium_radius_idle@18.png
1210\ No newline at end of file
1211
1212=== added file 'artwork/ubuntushape_medium_radius_pressed@18.png'
1213Binary files artwork/ubuntushape_medium_radius_pressed@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_medium_radius_pressed@18.png 2013-05-30 02:57:26 +0000 differ
1214=== added file 'artwork/ubuntushape_medium_radius_pressed@18.sci'
1215--- artwork/ubuntushape_medium_radius_pressed@18.sci 1970-01-01 00:00:00 +0000
1216+++ artwork/ubuntushape_medium_radius_pressed@18.sci 2013-05-30 02:57:26 +0000
1217@@ -0,0 +1,5 @@
1218+border.left: 44
1219+border.top: 54
1220+border.bottom: 44
1221+border.right: 52
1222+source: ubuntushape_medium_radius_pressed@18.png
1223\ No newline at end of file
1224
1225=== added file 'artwork/ubuntushape_medium_radius_shape@18.png'
1226Binary files artwork/ubuntushape_medium_radius_shape@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_medium_radius_shape@18.png 2013-05-30 02:57:26 +0000 differ
1227=== added file 'artwork/ubuntushape_medium_radius_shape@18.sci'
1228--- artwork/ubuntushape_medium_radius_shape@18.sci 1970-01-01 00:00:00 +0000
1229+++ artwork/ubuntushape_medium_radius_shape@18.sci 2013-05-30 02:57:26 +0000
1230@@ -0,0 +1,5 @@
1231+border.left: 44
1232+border.top: 54
1233+border.bottom: 44
1234+border.right: 52
1235+source: ubuntushape_medium_radius_shape@18.png
1236\ No newline at end of file
1237
1238=== added file 'artwork/ubuntushape_small_radius_idle@18.png'
1239Binary files artwork/ubuntushape_small_radius_idle@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_small_radius_idle@18.png 2013-05-30 02:57:26 +0000 differ
1240=== added file 'artwork/ubuntushape_small_radius_idle@18.sci'
1241--- artwork/ubuntushape_small_radius_idle@18.sci 1970-01-01 00:00:00 +0000
1242+++ artwork/ubuntushape_small_radius_idle@18.sci 2013-05-30 02:57:26 +0000
1243@@ -0,0 +1,5 @@
1244+border.left: 20
1245+border.top: 32
1246+border.bottom: 32
1247+border.right: 20
1248+source: ubuntushape_small_radius_idle@18.png
1249\ No newline at end of file
1250
1251=== added file 'artwork/ubuntushape_small_radius_pressed@18.png'
1252Binary files artwork/ubuntushape_small_radius_pressed@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_small_radius_pressed@18.png 2013-05-30 02:57:26 +0000 differ
1253=== added file 'artwork/ubuntushape_small_radius_pressed@18.sci'
1254--- artwork/ubuntushape_small_radius_pressed@18.sci 1970-01-01 00:00:00 +0000
1255+++ artwork/ubuntushape_small_radius_pressed@18.sci 2013-05-30 02:57:26 +0000
1256@@ -0,0 +1,5 @@
1257+border.left: 20
1258+border.top: 32
1259+border.bottom: 32
1260+border.right: 20
1261+source: ubuntushape_small_radius_pressed@18.png
1262\ No newline at end of file
1263
1264=== added file 'artwork/ubuntushape_small_radius_shape@18.png'
1265Binary files artwork/ubuntushape_small_radius_shape@18.png 1970-01-01 00:00:00 +0000 and artwork/ubuntushape_small_radius_shape@18.png 2013-05-30 02:57:26 +0000 differ
1266=== added file 'artwork/ubuntushape_small_radius_shape@18.sci'
1267--- artwork/ubuntushape_small_radius_shape@18.sci 1970-01-01 00:00:00 +0000
1268+++ artwork/ubuntushape_small_radius_shape@18.sci 2013-05-30 02:57:26 +0000
1269@@ -0,0 +1,5 @@
1270+border.left: 20
1271+border.top: 32
1272+border.bottom: 32
1273+border.right: 20
1274+source: ubuntushape_small_radius_shape@18.png
1275\ No newline at end of file
1276
1277=== modified file 'auth.js'
1278--- auth.js 2013-03-19 03:40:58 +0000
1279+++ auth.js 2013-05-30 02:57:26 +0000
1280@@ -51,10 +51,6 @@
1281 })
1282 }
1283
1284-function getFaceApiUrl() {
1285- return "https://graph.facebook.com/";
1286-}
1287-
1288 // Reads the auth token and checks its validity with Facebook
1289 function validateToken() {
1290 var token=getAuthToken();
1291@@ -69,18 +65,24 @@
1292
1293 var req=new XMLHttpRequest();
1294 req.onreadystatechange = function() {
1295- if ( (req.readyState == req.DONE) && (req.status == 200) ) {
1296- var result = JSON.parse(req.responseText);
1297- if (result.error === null) {
1298- console.log("validateToken:invalid token");
1299+ if (req.readyState == req.DONE) {
1300+ try {
1301+ var result = JSON.parse(req.responseText);
1302+ if (result.error) {
1303+ console.log("validateToken:"+result.error.message);
1304+ invalidAuth();
1305+ } else {
1306+ console.log("validateToken:valid token");
1307+ validAuth(token, getAccountId());
1308+ }
1309+ } catch (e) {
1310+ console.log("validateToken:"+e);
1311 invalidAuth();
1312- } else {
1313- console.log("validateToken:valid token");
1314- validAuth(token, getAccountId());
1315 }
1316 }
1317 }
1318- req.open("GET", getFaceApiUrl()+"me?access_token="+token, true);
1319+
1320+ req.open("GET", FacebookFuncs.getFaceApiUrl()+"me?access_token="+token, true);
1321 req.send();
1322 }
1323
1324@@ -97,7 +99,10 @@
1325 }
1326
1327 function getAuthToken() {
1328- return getSetting("authtoken");
1329+ var authToken=getSetting("authtoken");
1330+
1331+ console.log("Facebook AuthToken:"+authToken)
1332+ return authToken;
1333 }
1334
1335 function getAccountId() {
1336
1337=== removed file 'avatar@8.png'
1338Binary files avatar@8.png 2013-02-12 16:18:48 +0000 and avatar@8.png 1970-01-01 00:00:00 +0000 differ
1339=== added file 'facebook.js'
1340--- facebook.js 1970-01-01 00:00:00 +0000
1341+++ facebook.js 2013-05-30 02:57:26 +0000
1342@@ -0,0 +1,49 @@
1343+// Facebook Graph API Functions
1344+
1345+function getFaceApiUrl() {
1346+ return "https://graph.facebook.com/";
1347+}
1348+
1349+function Promise() {
1350+ var self=this;
1351+
1352+ this.done = function(callback) {
1353+ self.doneCallback=callback;
1354+ return self;
1355+ };
1356+
1357+ this.fail = function(callback) {
1358+ self.failCallback=callback;
1359+ return self;
1360+ }
1361+}
1362+
1363+function getCommentCount(token, postId) {
1364+ var req=new XMLHttpRequest();
1365+ var promise = new Promise();
1366+
1367+ req.onreadystatechange = function() {
1368+ if (req.readyState == req.DONE) {
1369+ try {
1370+ var result = JSON.parse(req.responseText);
1371+ if (result.error) {
1372+ if (promise.failCallback) promise.failCallback();
1373+ } else {
1374+ if (promise.doneCallback && result.data.length>0) promise.doneCallback(result.data[0].comments.count);
1375+ }
1376+ } catch (e) {
1377+ if (promise.failCallback) promise.failCallback(e);
1378+ }
1379+ }
1380+ }
1381+
1382+ var requestUrl=getFaceApiUrl()+"fql?q=select+likes.count%2C+comments.count+FROM+stream+WHERE+post_id%3D'"+postId+"'&access_token="+token;
1383+ req.open("GET", requestUrl, true);
1384+ req.send();
1385+
1386+ return promise;
1387+}
1388+
1389+function getProfilePictureUrl(token) {
1390+ return getFaceApiUrl()+'/me/picture?access_token='+token;
1391+}
1392
1393=== added directory 'images'
1394=== added file 'images/avatar@8.png'
1395Binary files images/avatar@8.png 1970-01-01 00:00:00 +0000 and images/avatar@8.png 2013-05-30 02:57:26 +0000 differ
1396=== added file 'images/comment.png'
1397Binary files images/comment.png 1970-01-01 00:00:00 +0000 and images/comment.png 2013-05-30 02:57:26 +0000 differ
1398=== added file 'images/facebook.png'
1399Binary files images/facebook.png 1970-01-01 00:00:00 +0000 and images/facebook.png 2013-05-30 02:57:26 +0000 differ
1400=== added file 'images/go-top@30.png'
1401Binary files images/go-top@30.png 1970-01-01 00:00:00 +0000 and images/go-top@30.png 2013-05-30 02:57:26 +0000 differ
1402=== added file 'images/like.png'
1403Binary files images/like.png 1970-01-01 00:00:00 +0000 and images/like.png 2013-05-30 02:57:26 +0000 differ
1404=== added file 'images/new@30.png'
1405Binary files images/new@30.png 1970-01-01 00:00:00 +0000 and images/new@30.png 2013-05-30 02:57:26 +0000 differ
1406=== added file 'images/reload@30.png'
1407Binary files images/reload@30.png 1970-01-01 00:00:00 +0000 and images/reload@30.png 2013-05-30 02:57:26 +0000 differ
1408=== added file 'images/search@30.png'
1409Binary files images/search@30.png 1970-01-01 00:00:00 +0000 and images/search@30.png 2013-05-30 02:57:26 +0000 differ
1410=== modified file 'ubuntu-facebook-app.qml'
1411--- ubuntu-facebook-app.qml 2013-04-17 21:24:49 +0000
1412+++ ubuntu-facebook-app.qml 2013-05-30 02:57:26 +0000
1413@@ -14,6 +14,10 @@
1414 height: units.gu(75)
1415 state: "loading"
1416
1417+
1418+ property int accountId: -1
1419+ property string token
1420+
1421 signal refresh()
1422 signal invalidAuth()
1423
1424@@ -23,15 +27,20 @@
1425 onAuthenticated: authModel.saveAccountInfo(token, accountId);
1426 }
1427
1428+ StatusUpdatePopup {
1429+ id: statusPopup
1430+ }
1431+
1432 Tabs {
1433 id: tabNav
1434 height: 0
1435 width: 0
1436+ visible: false
1437
1438 // News tab
1439 Tab {
1440 id: newsTab
1441- title: i18n.tr("Facebook News")
1442+ title: i18n.tr("News")
1443 page: NewsPage {
1444 id: newsPage
1445 anchors.margins: units.gu(2)
1446@@ -42,7 +51,7 @@
1447 // Events tab
1448 Tab {
1449 id: eventsTab
1450- title: i18n.tr("Facebook Events")
1451+ title: i18n.tr("Events")
1452 page: EventsPage {
1453 id: eventsPage
1454 anchors.margins: units.gu(2)
1455@@ -53,7 +62,7 @@
1456 // Wall tab
1457 Tab {
1458 id: wallTab
1459- title: i18n.tr("Facebook Wall")
1460+ title: i18n.tr("Wall")
1461 page: WallPage {
1462 id: wallPage
1463 anchors.margins: units.gu(2)
1464@@ -64,21 +73,30 @@
1465
1466 ToolbarActions {
1467 id: mainActions
1468+ lock: true
1469+ active: tabNav.visible
1470+
1471+ Action {
1472+ id: statusUpdateAction
1473+ iconSource: Qt.resolvedUrl("images/new.png")
1474+ text: i18n.tr("Status")
1475+ onTriggered: {
1476+ updateStatus();
1477+ }
1478+ }
1479 Action {
1480 id: refreshAccountAction
1481- iconSource: Qt.resolvedUrl("refresh.png")
1482+ iconSource: Qt.resolvedUrl("images/reload.png")
1483 text: i18n.tr("Refresh")
1484 onTriggered: {
1485- mainActions.active = false;
1486 facebookMainView.refresh();
1487 }
1488 }
1489 Action {
1490 id: resetAccountAction
1491- iconSource: Qt.resolvedUrl("avatar.png")
1492+ iconSource: Qt.resolvedUrl("images/avatar.png")
1493 text: i18n.tr("Logout")
1494 onTriggered: {
1495- mainActions.active = false;
1496 authModel.resetAccountInfo();
1497 }
1498 }
1499@@ -96,6 +114,10 @@
1500 target: loadingPane
1501 visible: true
1502 }
1503+ PropertyChanges {
1504+ target: tabNav
1505+ visible: false
1506+ }
1507 },
1508
1509 State {
1510@@ -104,6 +126,10 @@
1511 target: loadingPane
1512 visible: false
1513 }
1514+ PropertyChanges {
1515+ target: tabNav
1516+ visible: true
1517+ }
1518 },
1519
1520 State {
1521@@ -112,6 +138,10 @@
1522 target: loadingPane
1523 visible: false
1524 }
1525+ PropertyChanges {
1526+ target: tabNav
1527+ visible: false
1528+ }
1529 }
1530 ]
1531
1532@@ -125,8 +155,9 @@
1533 }
1534
1535 onValidAuth: {
1536- console.log("Facebook::accountId::"+accountId);
1537- newsPage.accountId = accountId
1538+ console.log("Facebook::accountId:"+accountId);
1539+ facebookMainView.accountId = accountId;
1540+ facebookMainView.token = token;
1541 facebookMainView.state = "validauth"
1542 }
1543 }
1544@@ -143,7 +174,14 @@
1545 }
1546 }
1547
1548+
1549 Component.onCompleted: {
1550+ Theme.loadTheme(Qt.resolvedUrl("app-theme.qmltheme"));
1551 initTimer.start();
1552 }
1553+
1554+ function updateStatus() {
1555+ statusPopup.open();
1556+ }
1557+
1558 }

Subscribers

People subscribed via source and target branches