Merge lp:~abreu-alexandre/webapps-core/link-share-webpage-title into lp:webapps-core

Proposed by Alexandre Abreu
Status: Merged
Approved by: David Barth
Approved revision: 138
Merge reported by: David Barth
Merged at revision: not available
Proposed branch: lp:~abreu-alexandre/webapps-core/link-share-webpage-title
Merge into: lp:webapps-core
Diff against target: 97 lines (+11/-4)
5 files modified
webapp-facebook/unity-webapps-facebook/HubSharer.qml (+2/-0)
webapp-facebook/unity-webapps-facebook/Share.qml (+2/-0)
webapp-facebook/unity-webapps-facebook/ShareComponent.qml (+3/-0)
webapp-facebook/unity-webapps-facebook/facebook.user.js (+1/-1)
webapp-twitter/unity-webapps-twitter/share.user.js (+3/-3)
To merge this branch: bzr merge lp:~abreu-alexandre/webapps-core/link-share-webpage-title
Reviewer Review Type Date Requested Status
David Barth (community) Approve
Review via email: mp+297205@code.launchpad.net

Commit message

Add web page title as part of the Links sharing operation

Description of the change

Add web page title as part of the Links sharing operation

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'webapp-facebook/unity-webapps-facebook/HubSharer.qml'
2--- webapp-facebook/unity-webapps-facebook/HubSharer.qml 2016-04-29 20:17:48 +0000
3+++ webapp-facebook/unity-webapps-facebook/HubSharer.qml 2016-06-13 15:06:03 +0000
4@@ -26,6 +26,7 @@
5
6 property string contentType
7 property string fileToShare
8+ property string text
9
10 function _callback(accessToken,
11 fileToShare,
12@@ -79,6 +80,7 @@
13 visible: true
14
15 fileToShare: main.fileToShare
16+ text: main.text
17 contentType: main.contentType
18 callback: _callback
19
20
21=== modified file 'webapp-facebook/unity-webapps-facebook/Share.qml'
22--- webapp-facebook/unity-webapps-facebook/Share.qml 2016-02-26 18:47:52 +0000
23+++ webapp-facebook/unity-webapps-facebook/Share.qml 2016-06-13 15:06:03 +0000
24@@ -27,6 +27,7 @@
25 anchors.fill: parent
26
27 property string fileToShare
28+ property string text
29 property string contentType
30 property var callback
31
32@@ -61,6 +62,7 @@
33
34 resourceToShare: root.fileToShare
35 contentType: root.contentType
36+ text: root.text
37
38 onCancelled: root.cancelled()
39 onShare: callback(root.accessToken,
40
41=== modified file 'webapp-facebook/unity-webapps-facebook/ShareComponent.qml'
42--- webapp-facebook/unity-webapps-facebook/ShareComponent.qml 2016-02-26 18:47:52 +0000
43+++ webapp-facebook/unity-webapps-facebook/ShareComponent.qml 2016-06-13 15:06:03 +0000
44@@ -26,6 +26,7 @@
45 property string accountProviderDisplayName
46 property string contentType
47 property string resourceToShare
48+ property string text
49
50 signal cancelled()
51 signal share(string userMessage)
52@@ -169,6 +170,8 @@
53 font.pixelSize: FontUtils.sizeToPixels("medium")
54 font.weight: Font.Light
55 focus: true
56+
57+ text: shareComponent.text
58 }
59 }
60 }
61
62=== modified file 'webapp-facebook/unity-webapps-facebook/facebook.user.js'
63--- webapp-facebook/unity-webapps-facebook/facebook.user.js 2016-02-26 18:58:26 +0000
64+++ webapp-facebook/unity-webapps-facebook/facebook.user.js 2016-06-13 15:06:03 +0000
65@@ -36,7 +36,7 @@
66 api.launchEmbeddedUI(
67 "HubSharer",
68 uploadLink,
69- {"fileToShare": items[0], contentType: type});
70+ {"fileToShare": items[0].url, text: items[0].text, contentType: type});
71 });
72 }
73 });
74
75=== modified file 'webapp-twitter/unity-webapps-twitter/share.user.js'
76--- webapp-twitter/unity-webapps-twitter/share.user.js 2015-04-16 14:59:02 +0000
77+++ webapp-twitter/unity-webapps-twitter/share.user.js 2016-06-13 15:06:03 +0000
78@@ -47,7 +47,7 @@
79 });
80 } else if (type === hub.ContentType.Links) {
81 transfer.items(function(items) {
82- uploadLink(items[0].url)
83+ uploadLink(items[0].url, items[0].text)
84 });
85 }
86 });
87@@ -55,8 +55,8 @@
88 hub.onShareRequested(_shareRequested);
89
90
91-function uploadLink(url) {
92- window.location.href = 'https://www.twitter.com/share?url=' + url
93+function uploadLink(url, text) {
94+ window.location.href = 'https://www.twitter.com/share?url=' + url + '&text=' + text
95 if (activeTransfer) {
96 activeTransfer.setState(
97 hub.ContentTransfer.State.Finalized)

Subscribers

People subscribed via source and target branches

to all changes: