Merge lp:~abreu-alexandre/unity-webapps-yahoomail/yahoomail-fix-refresh-issue into lp:unity-webapps-yahoomail

Proposed by Alexandre Abreu
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 34
Merged at revision: 34
Proposed branch: lp:~abreu-alexandre/unity-webapps-yahoomail/yahoomail-fix-refresh-issue
Merge into: lp:unity-webapps-yahoomail
Diff against target: 97 lines (+4/-61)
1 file modified
YahooMail.user.js (+4/-61)
To merge this branch: bzr merge lp:~abreu-alexandre/unity-webapps-yahoomail/yahoomail-fix-refresh-issue
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Maxim Ermilov (community) Approve
Review via email: mp+162940@code.launchpad.net

Commit message

YahooMail does not really let itself being integrated in the messaging menu. The email counts is only being updated upon the user clicking and browsing the site synchronously which does not really comply with the model that is being followed for 'message based integration scripts'. The script is simplified to offer minimal integration and remove messaging menu integration overall.

Description of the change

YahooMail does not really let itself being integrated in the messaging menu. The email counts is only being updated upon the user clicking and browsing the site synchronously which does not really comply with the model that is being followed for 'message based integration scripts'. The script is simplified to offer minimal integration and remove messaging menu integration overall.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Maxim Ermilov (zaspire) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'YahooMail.user.js'
2--- YahooMail.user.js 2013-05-01 22:51:58 +0000
3+++ YahooMail.user.js 2013-05-08 08:29:27 +0000
4@@ -16,10 +16,7 @@
5 *
6 */
7 function selfTest() {
8- if (!getComposeMessageNode() || !getCheckMailNode()) {
9- return;
10- }
11- if (!checkMessagesCount().length) {
12+ if (!getComposeMessageNode()) {
13 return;
14 }
15
16@@ -30,45 +27,6 @@
17 return document.getElementById('main-btn-new').firstChild;
18 }
19
20-function getCheckMailNode() {
21- return document.getElementById('btn-checkmail');
22-}
23-
24-function checkMessagesCount() {
25- var container = document.getElementById('Inbox');
26- var indicators = [];
27-
28- var i, count = document.getElementById('inbox-count').textContent;
29-
30- if (!count.length) {
31- count = '0';
32- }
33-
34- function activateNode() {
35- launchClickEvent(this);
36- }
37- indicators.push({ name: _("Inbox"),
38- count: count,
39- callback: activateNode.bind(container) });
40-
41- var snapshot = document.evaluate('//ul[@id="custom-folders"]/li/a',
42- document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
43- for (i = 0; i < snapshot.snapshotLength; i++) {
44- var node = snapshot.snapshotItem(i);
45- count = '0';
46- if (node.lastChild.textContent.length) {
47- count = node.lastChild.textContent;
48- }
49-
50- if (node.firstChild.textContent.length) {
51- indicators.push({ name: node.firstChild.textContent,
52- callback: activateNode.bind(node.parentNode),
53- count: count });
54- }
55- }
56- return indicators;
57-}
58-
59 function isCorrectPage() {
60 var i, ids = ['inbox-count', 'Inbox'];
61
62@@ -82,28 +40,12 @@
63 }
64
65 function messagingIndicatorSetup() {
66- var _indicators = [];
67- var checkMessagesCountWrapper = function () {
68- _indicators = checkMessagesCount();
69- return _indicators;
70- };
71-
72- var indicatorsController = new Indicators(checkMessagesCountWrapper);
73- setInterval(function () {
74- getCheckMailNode().click();
75- }, 3000);
76- window.onfocus = function () {
77- for (var i = 0; i < _indicators.length; i++) {
78- indicatorsController.visited(_indicators[i].name);
79- }
80- };
81-
82 function composeNewMessage() {
83 var compose = getComposeMessageNode();
84 launchClickEvent(compose);
85 }
86- Unity.MessagingIndicator.addAction(_("Compose New Message"),
87- wrapCallback(composeNewMessage));
88+ Unity.Launcher.addAction(_("Compose New Message"),
89+ wrapCallback(composeNewMessage));
90
91 selfTest();
92 }
93@@ -116,3 +58,4 @@
94 onInit: wrapCallback(messagingIndicatorSetup) });
95
96 }
97+

Subscribers

People subscribed via source and target branches

to all changes: