~autra/webapps-applications/deezer

« back to all changes in this revision

Viewing changes to src/GooglePlus/GooglePlus.user.js

  • Committer: autra
  • Date: 2013-04-11 12:34:24 UTC
  • mfrom: (406.1.108 trunk)
  • Revision ID: autra@autra-optiplex-380-20130411123424-3b0xa9ppaytxx3hr
sync from parent

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
function getPosts() {
22
22
    var container = document.getElementById('contentPane');
23
 
    var unreadItems = document.evaluate('//div[@guidedhelpid="streamcontent"]/div/div/div[contains(@id,"update-")]',
 
23
    var unreadItems = document.evaluate('//div[@guidedhelpid="streamcontent"]/div/div[contains(@id,"update-")]',
24
24
                                        container, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
25
25
 
 
26
    if (!unreadItems.snapshotLength) {
 
27
        unreadItems = document.evaluate('//div[@guidedhelpid="streamcontent"]/div/div/div[contains(@id,"update-")]',
 
28
                                        container, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
 
29
    }
 
30
 
26
31
    var i, node, icon, author, body, res = [];
27
32
    for (i = 0; i < unreadItems.snapshotLength; i++) {
28
33
        node = unreadItems.snapshotItem(i);
93
98
        var i, unreadItems = filterReaded(getPosts());
94
99
        var unread = String(unreadItems.length);
95
100
 
96
 
        Unity.MessagingIndicator.showIndicator(_("Unread"), { count: unread });
97
101
        if (tabActive) {
98
102
            markAsRead(unreadItems);
99
103
        } else {