From 8e7dd9be6b830373b34d3d141d2942a05595088d Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Thu, 23 Sep 2010 09:26:00 -0400 Subject: [PATCH] Bug 596612 - "tabs open on synced computers should be indicated in awesomelist results" [r=mark.finkle] --- mobile/chrome/content/bindings.xml | 24 +++++++++++++++++++- mobile/chrome/jar.mn | 2 +- mobile/themes/core/browser.css | 23 ++++++++++++++++++- mobile/themes/core/images/remotetabs-24.png | Bin 0 -> 399 bytes mobile/themes/core/jar.mn | 1 + 5 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 mobile/themes/core/images/remotetabs-24.png diff --git a/mobile/chrome/content/bindings.xml b/mobile/chrome/content/bindings.xml index 5aa76dc6fe30..bc3e29051074 100644 --- a/mobile/chrome/content/bindings.xml +++ b/mobile/chrome/content/bindings.xml @@ -76,7 +76,7 @@ - + @@ -288,6 +288,7 @@ if (item._empty || item.getAttribute("url") != url) { item.setAttribute("url", url); item.removeAttribute("badge"); + item.removeAttribute("remote"); } let isBookmark = ((type == "bookmark") || (type == "tag")); @@ -320,6 +321,7 @@ noResultsItem.removeAttribute("src"); noResultsItem.removeAttribute("tags"); noResultsItem.removeAttribute("badge"); + noResultsItem.removeAttribute("remote"); } ]]> @@ -386,6 +388,10 @@ window.clearTimeout(this._badgesTimeout); this._badgesTimeout = window.setTimeout(function(self) { +#ifdef MOZ_SERVICES_SYNC + let remoteItems = RemoteTabsList.panel._getRemoteTabs(); +#endif + for (let i = 0; i < self._items.childNodes.length; i++) { let item = self._items.childNodes[i]; if (!item.hasAttribute("url")) @@ -413,6 +419,22 @@ break; } } + +#ifdef MOZ_SERVICES_SYNC + // once we have check badges, check if the tab is in the remote list + if (!Weave.Service.isLoggedIn) + return; + + for (let i = 0; i < remoteItems.length; i++) { + let remoteURI = remoteItems[i].uri; + if (remoteURI) { + let itemHost = Services.io.newURI(currentURL, null, null); + let remoteHost = Services.io.newURI(remoteURI, null, null); + if (itemHost.equals(remoteHost)) + item.setAttribute("remote", "true"); + } + } +#endif } }, 300, this); ]]> diff --git a/mobile/chrome/jar.mn b/mobile/chrome/jar.mn index 67ab0607efba..9a3654a4f1d2 100644 --- a/mobile/chrome/jar.mn +++ b/mobile/chrome/jar.mn @@ -21,7 +21,7 @@ chrome.jar: * content/browser-ui.js (content/browser-ui.js) content/content.js (content/content.js) content/commandUtil.js (content/commandUtil.js) - content/bindings.xml (content/bindings.xml) +* content/bindings.xml (content/bindings.xml) content/tabs.xml (content/tabs.xml) content/bindings/checkbox.xml (content/bindings/checkbox.xml) content/bindings/browser.xml (content/bindings/browser.xml) diff --git a/mobile/themes/core/browser.css b/mobile/themes/core/browser.css index d46ecc365d61..72c7086505ec 100644 --- a/mobile/themes/core/browser.css +++ b/mobile/themes/core/browser.css @@ -760,10 +760,26 @@ placeitem[src=""] .bookmark-item-container > image { background: url(images/star-24.png) no-repeat 100% 2px; } +.autocomplete-item-container[remote="true"] { + background: url(images/remotetabs-24.png) no-repeat 100% 2px; +} + +.autocomplete-item-container[favorite="true"][remote="true"] { + background: url(images/remotetabs-24.png) no-repeat 100% 2px, url(images/star-24.png) no-repeat 96% 2px; +} + .autocomplete-item-container[favorite="true"]:-moz-locale-dir(rtl) { background: url(images/star-24.png) no-repeat left 2px; } +.autocomplete-item-container[remote="true"]:-moz-locale-dir(rtl) { + background: url(images/remotetabs-24.png) no-repeat left 2px; +} + +.autocomplete-item-container[favorite="true"][remote="true"]:-moz-locale-dir(rtl) { + background: url(images/remotetabs-24.png) no-repeat left 2px, url(images/star-24.png) no-repeat 4% 2px; +} + .autocomplete-item-url, .bookmark-item-url { color: blue; @@ -771,10 +787,15 @@ placeitem[src=""] .bookmark-item-container > image { -moz-margin-end: 24px; } -.autocomplete-item-container[favorite="true"] .autocomplete-item-label { +.autocomplete-item-container[favorite="true"] .autocomplete-item-label, +.autocomplete-item-container[remote="true"] .autocomplete-item-label { -moz-padding-end: 30px; } +.autocomplete-item-container[favorite="true"][remote="true"] { + -moz-padding-end: 48px; +} + .autocomplete-item-tags, .bookmark-item-tags { content: attr(tags); diff --git a/mobile/themes/core/images/remotetabs-24.png b/mobile/themes/core/images/remotetabs-24.png new file mode 100644 index 0000000000000000000000000000000000000000..a4d10897d5b0c7ff758d2e8c05802b7721a14821 GIT binary patch literal 399 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*O%l>?NMQuI#rs#koX{e4|$V0h+?^>EamTar|wV zVHUHYz#PH6%S%e8eiklMtZccTXn(4%U4G&LuKfo*r=D6;C~c#ur20*eqch~*0i_Fv z&SZ&~xsEct(!8LZ(brsT{|hVYFfQ2k zB<9@nj)*NG@87XAI6w7ST=VL}yem^bnENnIKA>VCq)_?pK;=bir$!nWj{LgF-clhq?xy?(a6xXe6{oGXJTJ*WO@DJxw z*Vi34X5GBb9X82~;fUM)E9tE&JNr6x&*m@`C}=Xo`b19h2)d*+(T3^9cP0H?r3TxR p$$vxdOxP3pnqi&kJ*7uq7^`2-eyx_*@ERCe44$rjF6*2UngGzNr4IlA literal 0 HcmV?d00001 diff --git a/mobile/themes/core/jar.mn b/mobile/themes/core/jar.mn index 993ee6362263..1870faac0171 100644 --- a/mobile/themes/core/jar.mn +++ b/mobile/themes/core/jar.mn @@ -72,6 +72,7 @@ chrome.jar: skin/images/console-active-64.png (images/console-active-64.png) skin/images/newtab-default-64.png (images/newtab-default-64.png) skin/images/newtab-active-64.png (images/newtab-active-64.png) + skin/images/remotetabs-24.png (images/remotetabs-24.png) skin/images/remotetabs-32.png (images/remotetabs-32.png) skin/images/remotetabs-48.png (images/remotetabs-48.png) skin/images/tab-32.png (images/tab-32.png)