Merge lp:~justinmcp/unity-webapps-livemail/outlook-message-fixes into lp:unity-webapps-livemail

Proposed by Justin McPherson
Status: Merged
Merged at revision: 46
Proposed branch: lp:~justinmcp/unity-webapps-livemail/outlook-message-fixes
Merge into: lp:unity-webapps-livemail
Diff against target: 124 lines (+31/-14)
5 files modified
LiveMail.user.js (+17/-6)
LiveMailmaillivecom.desktop (+2/-2)
debian/changelog (+6/-0)
debian/install (+5/-5)
manifest.json (+1/-1)
To merge this branch: bzr merge lp:~justinmcp/unity-webapps-livemail/outlook-message-fixes
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
WebApps Pending
Review via email: mp+212552@code.launchpad.net

Commit message

Adjust webapp for changes in page.

Description of the change

Will also no longer display messages count (that it would not ever be able to find).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
47. By Justin McPherson

Rename and fix icon details.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== renamed file '128/unity-webapps-hotmail.png' => '128/unity-webapps-outlook.png'
2=== renamed file '48/unity-webapps-hotmail.png' => '48/unity-webapps-outlook.png'
3=== renamed file '52/unity-webapps-hotmail.png' => '52/unity-webapps-outlook.png'
4=== renamed file '64/unity-webapps-hotmail.png' => '64/unity-webapps-outlook.png'
5=== modified file 'LiveMail.user.js'
6--- LiveMail.user.js 2013-09-12 13:05:29 +0000
7+++ LiveMail.user.js 2014-04-30 07:22:32 +0000
8@@ -11,11 +11,20 @@
9
10 window.Unity = external.getUnityObject(1);
11 function isOutlook() {
12- return document.getElementById('folderListControlUl');
13+ return document.getElementById('inboxControl0f') !== null;
14 }
15
16 function getOutlookInboxCountNode() {
17- return document.evaluate('//ul[@id="folderListControlUl"]/li[1]', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
18+ return document.evaluate('//*[@id="inboxControl0f"]//*[contains(@title, "Inbox")]', document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;
19+}
20+
21+function getOutlookInboxCount() {
22+ var node = getOutlookInboxCountNode();
23+ var match = node.title.match(/.*\s+(\d*)/);
24+ if (match === null) {
25+ return '0';
26+ }
27+ return match[1];
28 }
29
30 function getHotmailInboxCountNode() {
31@@ -32,7 +41,7 @@
32
33 try {
34 if (isOutlook()) {
35- inboxCount = getOutlookInboxCountNode().getAttribute('count');
36+ inboxCount = getOutlookInboxCount();
37 } else {
38 inboxCount = getHotmailInboxCountNode().textContent.match(/\d+/)[0];
39 messageCount = getHotmailMessagesCountNode().textContent.match(/\d+/)[0];
40@@ -56,7 +65,7 @@
41
42 function isCorrectPage() {
43 if (isOutlook()) {
44- return getOutlookInboxCountNode();
45+ return getOutlookInboxCountNode() !== null;
46 }
47
48 // fall back on hotmail
49@@ -67,7 +76,9 @@
50 var checkMessagesCount = wrapCallback(function () {
51 var d = getMailDataForPage();
52 Unity.MessagingIndicator.showIndicator("Inbox", { count: d.inbox });
53- Unity.MessagingIndicator.showIndicator("Messenger", { count: d.messages });
54+ if (!isOutlook()) {
55+ Unity.MessagingIndicator.showIndicator("Messenger", { count: d.messages });
56+ }
57 });
58
59 checkMessagesCount();
60@@ -84,6 +95,6 @@
61 Unity.init({ name: "LiveMail",
62 domain: 'mail.live.com',
63 homepage: 'http://mail.live.com',
64- iconUrl: "icon://unity-webapps-hotmail",
65+ iconUrl: "icon://unity-webapps-outlook",
66 onInit: wrapCallback(messagingIndicatorSetup) });
67 }, 1000);
68
69=== modified file 'LiveMailmaillivecom.desktop'
70--- LiveMailmaillivecom.desktop 2013-09-24 16:17:48 +0000
71+++ LiveMailmaillivecom.desktop 2014-04-30 07:22:32 +0000
72@@ -1,9 +1,9 @@
73 [Desktop Entry]
74 Name=LiveMail
75 Type=Application
76-Icon=unity-webapps-livemail
77+Icon=unity-webapps-outlook
78 MimeType=
79 Actions=S0;S1;S2;S3;S4;S5;S6;S7;S8;S9;S10;
80 Exec=unity-webapps-runner -n 'TGl2ZU1haWw=' -d 'mail.live.com' %u
81 StartupWMClass=LiveMailmaillivecom
82-
83\ No newline at end of file
84+
85
86=== modified file 'debian/changelog'
87--- debian/changelog 2013-09-24 22:19:17 +0000
88+++ debian/changelog 2014-04-30 07:22:32 +0000
89@@ -1,3 +1,9 @@
90+unity-webapps-livemail (2.4.17+13.10.20130924.2-0ubuntu2) saucy; urgency=medium
91+
92+ * Rename and fix icon details.
93+
94+ -- Justin McPherson <justin.mcpherson@canonical.com> Wed, 30 Apr 2014 17:13:43 +1000
95+
96 unity-webapps-livemail (2.4.16+13.10.20130924.2-0ubuntu1) saucy; urgency=low
97
98 [ Alexandre Abreu ]
99
100=== modified file 'debian/install'
101--- debian/install 2013-09-24 16:17:48 +0000
102+++ debian/install 2014-04-30 07:22:32 +0000
103@@ -1,9 +1,9 @@
104 LiveMail.user.js usr/share/unity-webapps/userscripts/unity-webapps-livemail
105-128/unity-webapps-hotmail.png usr/share/icons/unity-webapps-applications/128/apps
106-48/unity-webapps-hotmail.png usr/share/icons/hicolor/48x48/apps
107-48/unity-webapps-hotmail.png usr/share/icons/unity-webapps-applications/48/apps
108-52/unity-webapps-hotmail.png usr/share/icons/unity-webapps-applications/52/apps
109-64/unity-webapps-hotmail.png usr/share/icons/unity-webapps-applications/64/apps
110+128/unity-webapps-outlook.png usr/share/icons/unity-webapps-applications/128/apps
111+48/unity-webapps-outlook.png usr/share/icons/hicolor/48x48/apps
112+48/unity-webapps-outlook.png usr/share/icons/unity-webapps-applications/48/apps
113+52/unity-webapps-outlook.png usr/share/icons/unity-webapps-applications/52/apps
114+64/unity-webapps-outlook.png usr/share/icons/unity-webapps-applications/64/apps
115 manifest.json usr/share/unity-webapps/userscripts/unity-webapps-livemail
116
117 LiveMailmaillivecom.desktop usr/share/applications
118
119=== modified file 'manifest.json'
120--- manifest.json 2013-03-26 15:50:21 +0000
121+++ manifest.json 2014-04-30 07:22:32 +0000
122@@ -1,1 +1,1 @@
123-{"includes":["http://*.live.com/*","https://*.live.com/*"],"requires":["utils.js"],"name":"LiveMail","scripts":["LiveMail.user.js"],"maintainer":"Webapps Team <webapps@lists.launchpad.net>","manifest-version":"1.0","integration-version":"2.3","package-name":"LiveMail","icons":{"128":"128/unity-webapps-hotmail.png","48":"48/unity-webapps-hotmail.png","52":"52/unity-webapps-hotmail.png","64":"64/unity-webapps-hotmail.png"},"domain":"mail.live.com","homepage":"http://mail.live.com", "license": "GPL-3"}
124+{"includes":["http://*.live.com/*","https://*.live.com/*"],"requires":["utils.js"],"name":"LiveMail","scripts":["LiveMail.user.js"],"maintainer":"Webapps Team <webapps@lists.launchpad.net>","manifest-version":"1.0","integration-version":"2.3","package-name":"LiveMail","icons":{"128":"128/unity-webapps-outlook.png","48":"48/unity-webapps-outlook.png","52":"52/unity-webapps-outlook.png","64":"64/unity-webapps-outlook.png"},"domain":"mail.live.com","homepage":"http://mail.live.com", "license": "GPL-3"}

Subscribers

People subscribed via source and target branches

to all changes: