From 990d35855b2b0309103a2268f4fc14530d29d107 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Thu, 8 Mar 2012 08:35:15 +0100 Subject: [PATCH] Backed out changeset b5a3e22944f9 (bug 711157) --HG-- rename : browser/base/content/abouthome/snippet1.png => browser/base/content/aboutHome-snippet1.png rename : browser/base/content/abouthome/snippet2.png => browser/base/content/aboutHome-snippet2.png rename : browser/base/content/abouthome/aboutHome.css => browser/base/content/aboutHome.css rename : browser/base/content/abouthome/aboutHome.js => browser/base/content/aboutHome.js rename : browser/base/content/abouthome/aboutHome.xhtml => browser/base/content/aboutHome.xhtml --- .../content/aboutHome-restore-icon-small.png | Bin 0 -> 2321 bytes .../base/content/aboutHome-restore-icon.png | Bin 0 -> 4550 bytes .../snippet1.png => aboutHome-snippet1.png} | Bin .../snippet2.png => aboutHome-snippet2.png} | Bin browser/base/content/aboutHome.css | 384 ++++++++++++++++++ .../base/content/{abouthome => }/aboutHome.js | 31 +- .../content/{abouthome => }/aboutHome.xhtml | 67 +-- browser/base/content/abouthome/aboutHome.css | 362 ----------------- browser/base/content/abouthome/addons.png | Bin 1444 -> 0 bytes browser/base/content/abouthome/bookmarks.png | Bin 1276 -> 0 bytes browser/base/content/abouthome/downloads.png | Bin 898 -> 0 bytes browser/base/content/abouthome/history.png | Bin 1654 -> 0 bytes browser/base/content/abouthome/mozilla.png | Bin 2684 -> 0 bytes browser/base/content/abouthome/noise.png | Bin 10972 -> 0 bytes .../base/content/abouthome/restore-large.png | Bin 2841 -> 0 bytes browser/base/content/abouthome/restore.png | Bin 1796 -> 0 bytes browser/base/content/abouthome/settings.png | Bin 1557 -> 0 bytes browser/base/content/abouthome/sync.png | Bin 1879 -> 0 bytes browser/base/content/browser-syncui.js | 16 + browser/base/content/browser.js | 67 ++- .../base/content/test/browser_aboutHome.js | 111 +++++ browser/base/jar.mn | 22 +- browser/components/about/AboutRedirector.cpp | 2 +- browser/components/nsBrowserContentHandler.js | 2 +- .../en-US/chrome/browser/aboutHome.dtd | 16 +- 25 files changed, 611 insertions(+), 469 deletions(-) create mode 100644 browser/base/content/aboutHome-restore-icon-small.png create mode 100644 browser/base/content/aboutHome-restore-icon.png rename browser/base/content/{abouthome/snippet1.png => aboutHome-snippet1.png} (100%) rename browser/base/content/{abouthome/snippet2.png => aboutHome-snippet2.png} (100%) create mode 100644 browser/base/content/aboutHome.css rename browser/base/content/{abouthome => }/aboutHome.js (95%) rename browser/base/content/{abouthome => }/aboutHome.xhtml (58%) delete mode 100644 browser/base/content/abouthome/aboutHome.css delete mode 100644 browser/base/content/abouthome/addons.png delete mode 100644 browser/base/content/abouthome/bookmarks.png delete mode 100644 browser/base/content/abouthome/downloads.png delete mode 100644 browser/base/content/abouthome/history.png delete mode 100644 browser/base/content/abouthome/mozilla.png delete mode 100644 browser/base/content/abouthome/noise.png delete mode 100644 browser/base/content/abouthome/restore-large.png delete mode 100644 browser/base/content/abouthome/restore.png delete mode 100644 browser/base/content/abouthome/settings.png delete mode 100644 browser/base/content/abouthome/sync.png diff --git a/browser/base/content/aboutHome-restore-icon-small.png b/browser/base/content/aboutHome-restore-icon-small.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b80682e5f4a46023977fb26b65e36095832cce GIT binary patch literal 2321 zcmV+s3GViZP)GvA;l1I=4ca?U9XI9r$ z@4P%@2>I34p^1l937C~ zas0Pg&5=F_h6t=+2Dmwv;dwv<#BN8`djPeMJ-*&6rw354xU1R?{Q4@NU2@&0spa;s z`L)_dJt(#em;r9_yuf{n`0^JHh?zEC7e!RqaHeUvV#ZyPo3^^CwB@*p8Gi_F@fi4T zD*q~$3`_SswDa^`iazxfMe{w5>(2Vy6kY!{g&q5n0uJ5~AM|PPqAw`&ocBhr zhyBrFJ1?eGVYLJ7&0GU>+uy-lQrli}RcWI=Gxd%B1-(P7$_D-ey;ayd1Rur_gIMH* z9U2fd6oNm+DIA`;eFVXdI6BCbDD==Z=AETuPDvLnT+%Kj`{wuE53Iof|B9kcef^l= z!DRqHq zTv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p|I4Waj zJZw9&o8MVR>yVBUr`PW5Q)A2|})xRyFyMtHS{P@*$eIx%u5Ubq6RR=8z2+XVmn(h5gv&7+*`{ zkkG0&i(?v3vc?DS{)eKVm>m{?%UD`0V=PXP4{<_`tEIJ7Z6$GO3c0QnTJ)=<2W#l#lQ=PIwfS5IS4VBhgi(A5C61!gGPiHyWgb1^!hpHo`sI*tTwOP zbc*6cF7%R0(~s9Mh{ehQjsuaW(><{rg~r6!PWhG``+o2qX)Yc_tFJ{FXVvb(5CLy zYT1BUhW1ss!M|kRhBb?vtc=z4GiX@pEejQ^0-fmhNIF;y2e9ZHKuxO3oCedm$+z%Q kuG&>ACJABN+5Z<{0HClKKcZXS%>V!Z07*qoM6N<$f^3WY_y7O^ literal 0 HcmV?d00001 diff --git a/browser/base/content/abouthome/snippet1.png b/browser/base/content/aboutHome-snippet1.png similarity index 100% rename from browser/base/content/abouthome/snippet1.png rename to browser/base/content/aboutHome-snippet1.png diff --git a/browser/base/content/abouthome/snippet2.png b/browser/base/content/aboutHome-snippet2.png similarity index 100% rename from browser/base/content/abouthome/snippet2.png rename to browser/base/content/aboutHome-snippet2.png diff --git a/browser/base/content/aboutHome.css b/browser/base/content/aboutHome.css new file mode 100644 index 00000000000..e96bf05a671 --- /dev/null +++ b/browser/base/content/aboutHome.css @@ -0,0 +1,384 @@ +%if 0 +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License + * Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" + * basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is aboutHome.xhtml. + * + * The Initial Developer of the Original Code is the Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Marco Bonardo (original author) + * Mihai Sucan + * Stephen Horlander + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +%endif + +html { + font-family: sans-serif; + background: -moz-Field; + color: -moz-FieldText; + height: 100%; +} + +body { + display: inline-block; + position: relative; + margin: 0; + width: 100%; + height: 100%; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +#brandStart { + text-align: center; + height: 19%; + max-height: 256px; + min-height: 92px; +} + +#brandStartSpacer { + height: 6.5%; +} + +#brandStartLogo { + height: 100%; +} + +#searchContainer { + height: 15%; + min-height: 90px; +} + +#searchContainer::before { + content: " "; + display: block; + height: 23%; +} + +#searchForm { + display: table; + width: 100%; + max-width: 1830px; + margin: 0 auto; +} + +@media all and (max-height: 700px) { + #searchContainer { height: 20% } +} + +@media all and (max-height: 500px) { + #searchContainer { height: 25% } +} + +@media all and (max-height: 370px) { + #searchContainer { height: 30% } +} + +#searchLogoContainer { + display: table-cell; + width: 30%; + text-align: end; + line-height: 32px; +} + +#searchEngineLogo { + -moz-margin-end: 2.5%; + vertical-align: middle; +} + +#searchInputContainer { + display: table-cell; + width: 38%; + max-width: 700px; + min-width: 150px; +} + +#searchText { + width: 100%; + height: 24px; + padding: 3px 6px; + border-radius: 2px; + border: 1px solid rgb(150,150,150); + border-top-color: rgb(100,100,100); + box-shadow: 0 1px 0 rgba(255,255,255,0.5); + font-size: 1.2em; +} + +#searchButtons { + display: table-cell; + width: 31%; + -moz-padding-start: 13px; + vertical-align: top; +} + +@media all and (max-width: 470px) { + #searchLogoContainer { width: 10% } + #searchButtons { width: 11% } + #searchInputContainer { width: 40% } +} + +@media all and (min-width: 470px) and (max-width: 600px) { + #searchLogoContainer { width: 15% } + #searchButtons { width: 16%; white-space: nowrap } + #searchInputContainer { width: 45% } +} + +@media all and (min-width: 600px) and (max-width: 850px) { + #searchLogoContainer { width: 20% } + #searchButtons { width: 21%; white-space: nowrap } + #searchInputContainer { width: 49% } +} + +#searchSubmit { + background: -moz-linear-gradient(#f1f1f1, #dfdfdf); + padding: 4px 8px; + height: 32px; + border: 1px solid #ccc; + border-top-color: #ccc; + border-bottom-color: #999; + -moz-border-start-color: #afafaf; + -moz-border-end-color: #999; + box-shadow: 1px 1px 0 #e7e7e7, + 0 1px 0 #fcfcfc inset, + 0 -1px 0 #d7d7d7 inset; + font-size: 1em; + color: #000; + cursor: pointer; +} + +body[dir=rtl] #searchSubmit { + box-shadow: -1px 1px 0 #e7e7e7, + 0 1px 0 #fcfcfc inset, + 0 -1px 0 #d7d7d7 inset; +} + +#searchSubmit:active { + background: -moz-linear-gradient(#c5c5c5, #c5c5c5); + box-shadow: 1px 1px 0 #e7e7e7; +} + +body[dir=rtl] #searchSubmit:active { + box-shadow: -1px 1px 0 #e7e7e7; +} + +#contentContainer { + height: 30%; + background-image: -moz-radial-gradient(center top, ellipse farthest-side, rgba(16,83,130,.5), rgba(16,83,130,0) 75%), + -moz-radial-gradient(center top, ellipse farthest-side, rgba(180,218,244,.5), rgba(180,218,244,0)), + -moz-radial-gradient(center top, ellipse farthest-side, rgba(180,218,244,.3), rgba(180,218,244,0)); + background-size: 100% 5px, + 100% 50px, + 100% 100%; + background-repeat: no-repeat; +} + +@media all and (max-height: 400px) { + #contentContainer { height: 20% } +} + +#snippetContainer { + position: relative; + top: -24px; + text-align: center; +} + +#snippets { + display: inline-block; + padding: 14px; + width: 30%; + max-width: 600px; + background-image: -moz-linear-gradient(rgba(255,255,255,.8), rgba(255,255,255,.1)); + background-color: rgb(250,250,250); + border-radius: 4px; + box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, + 0 -2px 0 rgba(0,0,0,.1) inset, + 0 0 10px rgba(255,255,255,.5) inset, + 0 0 0 1px rgba(0,0,0,.1), + 0 2px 4px rgba(0,0,0,.2); + color: rgb(60,60,60); + font-size: .85em; + cursor: pointer; +} + +#snippets:empty { + visibility: hidden; +} + +@media all and (max-width: 470px) { + #snippets { width: 65% } +} + +@media all and (min-width: 470px) and (max-width: 850px) { + #snippets { width: 45% } +} + +#snippets:hover { + background-color: rgb(255,255,255); + box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, + 0 -2px 0 rgba(0,0,0,.1) inset, + 0 0 10px rgba(255,255,255,.5) inset, + 0 0 5px rgba(0,0,0,.1), + 0 0 0 1px rgba(0,0,0,.1), + 0 2px 4px rgba(0,0,0,.2); +} + +#snippets:hover:active { + background-color: rgb(210,210,210); + box-shadow: 0 2px 3px rgba(0,0,0,.3) inset, + 0 1px 0 rgba(255,255,255,.5); +} + +#defaultSnippet1, +#defaultSnippet2 { + display: table-row; + text-align: start; +} + +#defaultSnippet1::before, +#defaultSnippet2::before { + display: table-cell; + vertical-align: middle; + -moz-padding-end: 1em; +} + +#defaultSnippet1::before { + content: url("chrome://browser/content/aboutHome-snippet1.png"); +} +#defaultSnippet2::before { + content: url("chrome://browser/content/aboutHome-snippet2.png"); +} + +#sessionRestoreContainer { + padding-top: 1.5%; + text-align: center; +} + +@media all and (max-height: 500px) { + #sessionRestoreContainer { + position: relative; + top: -15px; + padding-top: 0; + } +} + +#restorePreviousSession { + padding: 10px; + border: 0; + border-radius: 4px; + box-shadow: 0 0 0 1px rgba(9,37,59,0), + 0 1px 2px rgba(9,37,59,0), + 0 0 10px rgba(255,255,255,0), + 0 -3px 0 rgba(180,194,212,0) inset; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.25s; + -moz-transition-timing-function: ease-out; + background: transparent; + color: rgb(50,50,50); + font-weight: bold; + font-size: 1em; + cursor: pointer; +} + +#restorePreviousSession::before { + display: inline-block; + content: url("chrome://browser/content/aboutHome-restore-icon.png"); + -moz-margin-end: 10px; + vertical-align: middle; + height: 66px; /* Needed to avoid a blank space under the image */ +} + +body[dir=rtl] #restorePreviousSession::before { + -moz-transform: scaleX(-1); +} + +@media all and (max-height: 500px) { + #restorePreviousSession::before { + content: url("chrome://browser/content/aboutHome-restore-icon-small.png"); + height: 41px; + } +} + +@media all and (max-width: 500px) { + #restorePreviousSession::before { + content: url("chrome://browser/content/aboutHome-restore-icon-small.png"); + height: 41px; + } +} + +#restorePreviousSession:disabled { + display: none; +} + +#restorePreviousSession:hover { + background-image: -moz-linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.2)); + border-radius: 4px; + box-shadow: 0 0 0 1px rgba(9,37,59,.2), + 0 1px 2px rgba(9,37,59,.2), + 0 0 10px rgba(255,255,255,.4), + 0 -3px 0 rgba(180,194,212,.3) inset; +} + +#restorePreviousSession:hover:active { + background-image: -moz-linear-gradient(rgba(255,255,255,.0), rgba(255,255,255,.2)); + background-color: rgba(23,75,115,.1); + box-shadow: 0 0 0 1px rgba(9,37,59,.2), + 0 1px 2px rgba(9,37,59,.4) inset, + 0 1px 5px rgba(9,37,59,.15) inset; +} + +#bottomSection { + position: absolute; + color: rgb(150,150,150); + font-size: .8em; + width: 100%; + text-align: center; + bottom: 2%; +} + +#syncLinksContainer { + padding-top: 1em; +} + +.sync-link { + padding: 1em; +} + +@media all and (max-height: 370px) { + #bottomSection { + visibility: hidden; + } +} diff --git a/browser/base/content/abouthome/aboutHome.js b/browser/base/content/aboutHome.js similarity index 95% rename from browser/base/content/abouthome/aboutHome.js rename to browser/base/content/aboutHome.js index 96ffd85530f..54ae14b1410 100644 --- a/browser/base/content/abouthome/aboutHome.js +++ b/browser/base/content/aboutHome.js @@ -22,7 +22,6 @@ * Contributor(s): * Marco Bonardo (original author) * Mihai Sucan - * Frank Yan * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -156,12 +155,6 @@ function onLoad(event) document.getElementById("searchText").focus(); loadSnippets(); - - fitToWidth(); - window.addEventListener("resize", fitToWidth); - window.addEventListener("unload", function() { - window.removeEventListener("resize", fitToWidth); - }); } @@ -267,7 +260,7 @@ function showSnippets() let defaultSnippetsElt = document.getElementById("defaultSnippets"); let entries = defaultSnippetsElt.querySelectorAll("span"); // Choose a random snippet. Assume there is always at least one. - let randIndex = Math.floor(Math.random() * entries.length); + let randIndex = Math.round(Math.random() * (entries.length - 1)); let entry = entries[randIndex]; // Inject url in the eventual link. if (DEFAULT_SNIPPETS_URLS[randIndex]) { @@ -276,17 +269,27 @@ function showSnippets() // up in the translation. if (links.length == 1) { links[0].href = DEFAULT_SNIPPETS_URLS[randIndex]; + activateSnippetsButtonClick(entry); } } // Move the default snippet to the snippets element. snippetsElt.appendChild(entry); } -function fitToWidth() { - if (window.scrollMaxX) { - document.body.setAttribute("narrow", "true"); - } else if (document.body.hasAttribute("narrow")) { - document.body.removeAttribute("narrow"); - fitToWidth(); +/** + * Searches a single link element in aElt and binds its href to the click + * action of the snippets button. + * + * @param aElt + * Element to search the link into. + */ +function activateSnippetsButtonClick(aElt) { + let links = aElt.getElementsByTagName("a"); + if (links.length == 1) { + document.getElementById("snippets") + .addEventListener("click", function(aEvent) { + if (aEvent.target.nodeName != "a") + window.location = links[0].href; + }, false); } } diff --git a/browser/base/content/abouthome/aboutHome.xhtml b/browser/base/content/aboutHome.xhtml similarity index 58% rename from browser/base/content/abouthome/aboutHome.xhtml rename to browser/base/content/aboutHome.xhtml index 02fa09c63b2..b6fb4ea7c4b 100644 --- a/browser/base/content/abouthome/aboutHome.xhtml +++ b/browser/base/content/aboutHome.xhtml @@ -25,7 +25,6 @@ # Marco Bonardo (original author) # Mihai Sucan # Stephen Horlander -# Frank Yan # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -61,48 +60,52 @@ + href="chrome://browser/content/aboutHome.css"/>