Binary files /tmp/AZvFkHBybD/unity-webapps-googleplus-2.4.11.1/128/unity-webapps-google-plus.png and /tmp/lKuMCWdJzo/unity-webapps-googleplus-2.4.11.2/128/unity-webapps-google-plus.png differ Binary files /tmp/AZvFkHBybD/unity-webapps-googleplus-2.4.11.1/48/unity-webapps-google-plus.png and /tmp/lKuMCWdJzo/unity-webapps-googleplus-2.4.11.2/48/unity-webapps-google-plus.png differ Binary files /tmp/AZvFkHBybD/unity-webapps-googleplus-2.4.11.1/52/unity-webapps-google-plus.png and /tmp/lKuMCWdJzo/unity-webapps-googleplus-2.4.11.2/52/unity-webapps-google-plus.png differ Binary files /tmp/AZvFkHBybD/unity-webapps-googleplus-2.4.11.1/64/unity-webapps-google-plus.png and /tmp/lKuMCWdJzo/unity-webapps-googleplus-2.4.11.2/64/unity-webapps-google-plus.png differ diff -Nru unity-webapps-googleplus-2.4.11.1/GooglePlus.user.js unity-webapps-googleplus-2.4.11.2/GooglePlus.user.js --- unity-webapps-googleplus-2.4.11.1/GooglePlus.user.js 2013-04-10 20:57:09.000000000 +0000 +++ unity-webapps-googleplus-2.4.11.2/GooglePlus.user.js 2013-06-24 19:56:02.000000000 +0000 @@ -18,29 +18,76 @@ return true; } +function getNodeOr(candidateXPaths, parent, xpathType, getValueFunc) { + var value; + var found; + var i; + + for (i = 0; i < candidateXPaths.length; ++i) { + found = document.evaluate(candidateXPaths[i], + parent, null, xpathType, null); + if (found) { + value = getValueFunc(found); + if (value) { + break; + } + } + } + return value; +} + function getPosts() { var container = document.getElementById('contentPane'); - var unreadItems = document.evaluate('//div[@guidedhelpid="streamcontent"]/div/div[contains(@id,"update-")]', - container, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + var unreadItems = getNodeOr(['//div[@guidedhelpid="streamcontent"]/div/div/div/div[contains(@id,"update-")]'], + container, + XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, + function (found) { return found.snapshotLength !== 0 ? found : null; }); - if (!unreadItems.snapshotLength) { - unreadItems = document.evaluate('//div[@guidedhelpid="streamcontent"]/div/div/div[contains(@id,"update-")]', - container, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); + unreadItems = unreadItems || []; + + function find_icon() { + return function (found) { + return (found.singleNodeValue && found.singleNodeValue.src) ? found : null; + }; + } + + function find_text() { + return function (found) { + return (found.singleNodeValue && found.singleNodeValue.textContent) ? found : null; + }; } - var i, node, icon, author, body, res = []; + var i, node, icon, author, body, res = [], bodyNode; for (i = 0; i < unreadItems.snapshotLength; i++) { node = unreadItems.snapshotItem(i); - icon = document.evaluate('div/div/a/img', node, - null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.src; - author = document.evaluate('div/div/div/header/h3/a', node, - null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent; - body = document.evaluate('div/div/div[3]/div/div', node, - null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue.textContent; - - res.push({ icon: icon, - author: author, - body: body }); + + icon = getNodeOr( + ['div/div/div/div/a/img', 'div/div/div/a/img'], + node, + XPathResult.ANY_UNORDERED_NODE_TYPE, + find_icon() + ).singleNodeValue.src; + + author = getNodeOr( + ['div/div/div/div/div/header/h3/a', 'div/div/div/div/header/h3/a'], + node, + XPathResult.ANY_UNORDERED_NODE_TYPE, + find_text() + ).singleNodeValue.textContent; + + bodyNode = getNodeOr( + ['div[2]/div/div[2]/div/div/div/div[2]'], + node, + XPathResult.ANY_UNORDERED_NODE_TYPE, + find_text() + ); + if (bodyNode) { + body = bodyNode.singleNodeValue.textContent; + + res.push({ icon: icon, + author: author, + body: body }); + } } return res; } @@ -94,9 +141,8 @@ tabActive = true; }; - var checkMessangesCount = wrapCallback(function () { + var checkMessagesCount = wrapCallback(function () { var i, unreadItems = filterReaded(getPosts()); - var unread = String(unreadItems.length); if (tabActive) { markAsRead(unreadItems); @@ -105,8 +151,8 @@ } }); - checkMessangesCount(); - setInterval(checkMessangesCount, 1000); + checkMessagesCount(); + setInterval(checkMessagesCount, 1000); doMainMenuIntegration(document); @@ -154,11 +200,11 @@ } Unity.init({ name: appName, iconUrl: img, - crop: true, + crop: true, domain: 'plus.google.com', - force: true, + force: true, homepage: String(window.location), - onInit: function(){} }); + onInit: function () {} }); } }); request.open("POST", "https://plus.google.com/u/0/_/games/getGamesModel?hl=en&ozv=es_oz_20121009.17_p3&avw=ggs%3A2&_reqid=820537&rt=j", true); @@ -171,24 +217,24 @@ } if (isCorrectPage() && !unsafeWindow._alreadyOnPage) { - previous = ''; + var previous = ''; unsafeWindow._alreadyOnPage = true; /* TODO: uncomment after lp:~zaspire/unity-firefox-extension/context-reinitialization merged setInterval(wrapCallback(function wait() { // It's change location without reloading page if (!getAppNameNode() || !getAppNameNode().textContent.length) { - return; + return; } var appName = getAppNameNode().textContent; - if (previous == appName) - return; - previous = appName; - getImg(appName); - localStorage.setItem(appName, true); + if (previous == appName) + return; + previous = appName; + getImg(appName); + localStorage.setItem(appName, true); }), 2000);*/ Unity.init({ name: "Google+", - domain: 'plus.google.com', - homepage: 'https://plus.google.com/', + domain: 'plus.google.com', + homepage: 'https://plus.google.com/', iconUrl: "icon://unity-webapps-google-plus", onInit: wrapCallback(messagingIndicatorSetup) }); } diff -Nru unity-webapps-googleplus-2.4.11.1/debian/bzr-builddeb.conf unity-webapps-googleplus-2.4.11.2/debian/bzr-builddeb.conf --- unity-webapps-googleplus-2.4.11.1/debian/bzr-builddeb.conf 1970-01-01 00:00:00.000000000 +0000 +++ unity-webapps-googleplus-2.4.11.2/debian/bzr-builddeb.conf 2013-06-24 19:56:02.000000000 +0000 @@ -0,0 +1,2 @@ +[BUILDDEB] +native = True diff -Nru unity-webapps-googleplus-2.4.11.1/debian/changelog unity-webapps-googleplus-2.4.11.2/debian/changelog --- unity-webapps-googleplus-2.4.11.1/debian/changelog 2013-04-10 20:57:09.000000000 +0000 +++ unity-webapps-googleplus-2.4.11.2/debian/changelog 2013-06-24 19:56:32.000000000 +0000 @@ -1,3 +1,10 @@ +unity-webapps-googleplus (2.4.11.2) quantal-proposed; urgency=low + + * Unity integration broken by site redesign. (LP: #1193388) + * Icons updated to match the G+ website. (LP: #1194224) + + -- Robert Bruce Park Mon, 24 Jun 2013 11:12:59 -0700 + unity-webapps-googleplus (2.4.11.1) quantal-proposed; urgency=low * Upstream bug fix release (LP: #1097833) diff -Nru unity-webapps-googleplus-2.4.11.1/manifest.json unity-webapps-googleplus-2.4.11.2/manifest.json --- unity-webapps-googleplus-2.4.11.1/manifest.json 2013-04-10 20:57:09.000000000 +0000 +++ unity-webapps-googleplus-2.4.11.2/manifest.json 2013-06-24 19:56:02.000000000 +0000 @@ -1 +1 @@ -{"includes":["https://plus.google.com/*"],"requires":["utils.js","google-common.js"],"name":"GooglePlus","scripts":["GooglePlus.user.js"],"maintainer":"Webapps Team ","license":"GPL-3","manifest-version":"1.0","integration-version":"2.4.12","package-name":"GooglePlus","description":"Unity Webapp for GooglePlus"} +{"includes":["https://plus.google.com/*"],"requires":["utils.js","google-common.js"],"name":"GooglePlus","scripts":["GooglePlus.user.js"],"maintainer":"Webapps Team ","manifest-version":"1.0","integration-version":"2.2","package-name":"GooglePlus","icons":{"128":"128/unity-webapps-google-plus.png","48":"48/unity-webapps-google-plus.png","52":"52/unity-webapps-google-plus.png","64":"64/unity-webapps-google-plus.png"},"domain":"plus.google.com","homepage":"https://plus.google.com/","license":"GPL-3"} \ No newline at end of file