mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 13:45:46 +00:00
Back em out on this CLOSED TREE for causing tinderbox to report mochitest-browser-chrome is failing
This commit is contained in:
parent
6a5521c32e
commit
649ff29eed
@ -334,7 +334,6 @@ class Automation(object):
|
||||
part = """\
|
||||
user_pref("browser.console.showInPanel", true);
|
||||
user_pref("browser.dom.window.dump.enabled", true);
|
||||
user_pref("browser.firstrun.show.localepicker", false);
|
||||
user_pref("dom.allow_scripts_to_close_windows", true);
|
||||
user_pref("dom.disable_open_during_load", false);
|
||||
user_pref("dom.max_script_run_time", 0); // no slow script dialogs
|
||||
|
@ -116,7 +116,7 @@ protected:
|
||||
|
||||
// Update the selected locale used by the chrome registry, and fire a
|
||||
// notification about this change
|
||||
virtual nsresult UpdateSelectedLocale() = 0;
|
||||
virtual void UpdateSelectedLocale() = 0;
|
||||
|
||||
static void LogMessage(const char* aMsg, ...);
|
||||
static void LogMessageWithContext(nsIURI* aURL, PRUint32 aLineNumber, PRUint32 flags,
|
||||
|
@ -368,9 +368,12 @@ nsChromeRegistryChrome::Observe(nsISupports *aSubject, const char *aTopic,
|
||||
|
||||
if (pref.EqualsLiteral(MATCH_OS_LOCALE_PREF) ||
|
||||
pref.EqualsLiteral(SELECTED_LOCALE_PREF)) {
|
||||
rv = UpdateSelectedLocale();
|
||||
if (NS_SUCCEEDED(rv) && mProfileLoaded)
|
||||
FlushAllCaches();
|
||||
if (!mProfileLoaded) {
|
||||
rv = SelectLocaleFromPref(prefs);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
FlushAllCaches();
|
||||
}
|
||||
else if (pref.EqualsLiteral(SELECTED_SKIN_PREF)) {
|
||||
nsXPIDLCString provider;
|
||||
@ -423,12 +426,11 @@ nsChromeRegistryChrome::CheckForNewChrome()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsChromeRegistryChrome::UpdateSelectedLocale()
|
||||
void nsChromeRegistryChrome::UpdateSelectedLocale()
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
|
||||
if (prefs) {
|
||||
rv = SelectLocaleFromPref(prefs);
|
||||
nsresult rv = SelectLocaleFromPref(prefs);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIObserverService> obsSvc =
|
||||
mozilla::services::GetObserverService();
|
||||
@ -437,8 +439,6 @@ nsresult nsChromeRegistryChrome::UpdateSelectedLocale()
|
||||
"selected-locale-has-changed", nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -83,7 +83,7 @@ class nsChromeRegistryChrome : public nsChromeRegistry
|
||||
PRUint32 number, void *arg);
|
||||
|
||||
nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
|
||||
NS_OVERRIDE nsresult UpdateSelectedLocale();
|
||||
NS_OVERRIDE void UpdateSelectedLocale();
|
||||
NS_OVERRIDE nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
|
||||
const nsCString& aProvider,
|
||||
const nsCString& aPath);
|
||||
|
@ -278,9 +278,9 @@ nsChromeRegistryContent::GetXULOverlays(nsIURI *aChromeURL,
|
||||
CONTENT_NOT_IMPLEMENTED();
|
||||
}
|
||||
|
||||
nsresult nsChromeRegistryContent::UpdateSelectedLocale()
|
||||
void nsChromeRegistryContent::UpdateSelectedLocale()
|
||||
{
|
||||
CONTENT_NOT_IMPLEMENTED();
|
||||
CONTENT_NOTREACHED();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -89,7 +89,7 @@ class nsChromeRegistryContent : public nsChromeRegistry
|
||||
void RegisterResource(const ResourceMapping& aResource);
|
||||
void RegisterOverride(const OverrideMapping& aOverride);
|
||||
|
||||
NS_OVERRIDE nsresult UpdateSelectedLocale();
|
||||
NS_OVERRIDE void UpdateSelectedLocale();
|
||||
NS_OVERRIDE nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
|
||||
const nsCString& aProvider,
|
||||
const nsCString& aPath);
|
||||
|
@ -215,9 +215,6 @@ pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LO
|
||||
pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/mobile/");
|
||||
pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/mobile/api/%API_VERSION%/search/guid:%IDS%?src=mobile&appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%");
|
||||
|
||||
/* preference for the locale picker */
|
||||
pref("extensions.getLocales.get.url", "");
|
||||
|
||||
/* blocklist preferences */
|
||||
pref("extensions.blocklist.enabled", true);
|
||||
pref("extensions.blocklist.interval", 86400);
|
||||
@ -646,9 +643,6 @@ pref("urlclassifier.updatecachemax", 4194304);
|
||||
pref("browser.safebrowsing.malware.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
|
||||
#endif
|
||||
|
||||
// True if this is the first time we are showing about:firstrun
|
||||
pref("browser.firstrun.show.uidiscovery", true);
|
||||
pref("browser.firstrun.show.localepicker", true);
|
||||
|
||||
// prevent focus to show/hide the virtual keyboard if the action is not
|
||||
// initiated by a user
|
||||
pref("content.ime.strict_policy", true);
|
||||
|
@ -62,32 +62,30 @@
|
||||
<div id="wrapper">
|
||||
<div id="header"><div id="logo"><img src="chrome://branding/content/logo.png"/></div>&aboutHome.header;</div>
|
||||
|
||||
<div id="content" hidden="true">
|
||||
<div id="recentTabs" class="section-box">
|
||||
<h1>&aboutHome.recentTabs;</h1>
|
||||
<div id="loadingTabs" class="loading">
|
||||
<img src="chrome://browser/skin/images/throbber.png"/>
|
||||
</div>
|
||||
<div id="recentTabs" class="section-box">
|
||||
<h1>&aboutHome.recentTabs;</h1>
|
||||
<div id="loadingTabs" class="loading">
|
||||
<img src="chrome://browser/skin/images/throbber.png"/>
|
||||
</div>
|
||||
|
||||
<div id="remoteTabs" class="section-row" onclick="openRemoteTabs();" role="button">
|
||||
<div>
|
||||
<img class="favicon" src="chrome://browser/skin/images/remotetabs-32.png"/>
|
||||
<div>&aboutHome.remoteTabs;</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="remoteTabs" class="section-row" onclick="openRemoteTabs();" role="button">
|
||||
<div>
|
||||
<img class="favicon" src="chrome://browser/skin/images/remotetabs-32.png"/>
|
||||
<div>&aboutHome.remoteTabs;</div>
|
||||
</div>
|
||||
|
||||
<div id="newAddons" class="section-box">
|
||||
<h1>&aboutHome.recommendedAddons2;</h1>
|
||||
<div id="loadingAddons" class="loading">
|
||||
<img src="chrome://browser/skin/images/throbber.png"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer-wrapper">
|
||||
<span id="feedback" style="width: &aboutHome.footerWidth;" class="section-row" pref="app.feedbackURL" onclick="openLink(this);" role="button">&aboutHome.giveFeedback;</span><span id="support" style="width: &aboutHome.footerWidth;" class="section-row" pref="app.support.baseURL" onclick="openLink(this);" role="button">&aboutHome.getHelp;</span>
|
||||
</div>
|
||||
|
||||
<div id="newAddons" class="section-box">
|
||||
<h1>&aboutHome.recommendedAddons2;</h1>
|
||||
<div id="loadingAddons" class="loading">
|
||||
<img src="chrome://browser/skin/images/throbber.png"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer-wrapper">
|
||||
<span id="feedback" style="width: &aboutHome.footerWidth;" class="section-row" pref="app.feedbackURL" onclick="openLink(this);" role="button">&aboutHome.giveFeedback;</span><span id="support" style="width: &aboutHome.footerWidth;" class="section-row" pref="app.support.baseURL" onclick="openLink(this);" role="button">&aboutHome.getHelp;</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- l10n hack -->
|
||||
@ -127,14 +125,6 @@
|
||||
function init() {
|
||||
initTabs();
|
||||
initAddons();
|
||||
|
||||
let prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService).QueryInterface(Ci.nsIPrefBranch2);
|
||||
if (prefs.getBoolPref("browser.firstrun.show.uidiscovery")) {
|
||||
startDiscovery();
|
||||
prefs.setBoolPref("browser.firstrun.show.uidiscovery", false);
|
||||
} else {
|
||||
endDiscovery();
|
||||
}
|
||||
}
|
||||
|
||||
function uninit() {
|
||||
@ -393,34 +383,6 @@
|
||||
function uninitAddons() {
|
||||
getChromeWin().Services.obs.removeObserver(updateAddons, "recommended-addons-cache-updated");
|
||||
}
|
||||
|
||||
function startDiscovery() {
|
||||
let win = getChromeWin();
|
||||
let [leftWidth, rightWidth] = win.Browser.computeSidebarVisibility();
|
||||
if (leftWidth > 0 || rightWidth > 0) {
|
||||
endDiscovery();
|
||||
return;
|
||||
}
|
||||
|
||||
let doc = win.document;
|
||||
let broadcaster = doc.getElementById("bcast_uidiscovery");
|
||||
|
||||
doc.addEventListener("animationend", endDiscovery, false);
|
||||
doc.addEventListener("PanBegin", endDiscovery, false);
|
||||
broadcaster.setAttribute("mode", "discovery");
|
||||
}
|
||||
|
||||
function endDiscovery() {
|
||||
let doc = getChromeWin().document;
|
||||
let broadcaster = doc.getElementById("bcast_uidiscovery");
|
||||
|
||||
broadcaster.removeAttribute("mode");
|
||||
doc.removeEventListener("animationend", endDiscovery, false);
|
||||
doc.removeEventListener("PanBegin", endDiscovery, false);
|
||||
setTimeout(function() {
|
||||
document.getElementById("content").removeAttribute("hidden");
|
||||
}, 0);
|
||||
}
|
||||
]]></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -266,7 +266,7 @@ var Browser = {
|
||||
ViewableAreaObserver.update();
|
||||
|
||||
// Restore the previous scroll position
|
||||
let restorePosition = Browser.controlsPosition || { hideSidebars: true };
|
||||
let restorePosition = Browser.controlsPosition;
|
||||
if (restorePosition.hideSidebars) {
|
||||
restorePosition.hideSidebars = false;
|
||||
Browser.hideSidebars();
|
||||
@ -378,11 +378,6 @@ var Browser = {
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("UIReady", true, false);
|
||||
window.dispatchEvent(event);
|
||||
|
||||
// if we have an opener this was not the first window opened and will not
|
||||
// receive an initial resize event. instead we fire the resize handler manually
|
||||
if (window.opener)
|
||||
resizeHandler({ target: window });
|
||||
},
|
||||
|
||||
_alertShown: function _alertShown() {
|
||||
|
@ -536,7 +536,7 @@
|
||||
<vbox id="syncsetup-simple" class="syncsetup-page" flex="1">
|
||||
<scrollbox id="sync-message" class="prompt-message" orient="vertical" flex="1">
|
||||
<description class="syncsetup-desc syncsetup-center" flex="1">&sync.setup.jpake;</description>
|
||||
<description class="syncsetup-center link" flex="1" onclick="WeaveGlue.openTutorial();">&sync.setup.tutorial;</description>
|
||||
<description class="syncsetup-center syncsetup-link" flex="1" onclick="WeaveGlue.openTutorial();">&sync.setup.tutorial;</description>
|
||||
<separator/>
|
||||
<vbox align="center" flex="1">
|
||||
<description id="syncsetup-code1" class="syncsetup-code">....</description>
|
||||
@ -544,7 +544,7 @@
|
||||
<description id="syncsetup-code3" class="syncsetup-code">....</description>
|
||||
</vbox>
|
||||
<separator/>
|
||||
<description class="syncsetup-center link" flex="1" onclick="WeaveGlue.openManual();">&sync.fallback;</description>
|
||||
<description class="syncsetup-center syncsetup-link" flex="1" onclick="WeaveGlue.openManual();">&sync.fallback;</description>
|
||||
<separator flex="1"/>
|
||||
</scrollbox>
|
||||
<hbox class="prompt-buttons" pack="center">
|
||||
|
BIN
mobile/chrome/content/firstrun/facebook.png
Normal file
BIN
mobile/chrome/content/firstrun/facebook.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
mobile/chrome/content/firstrun/features.png
Normal file
BIN
mobile/chrome/content/firstrun/features.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
184
mobile/chrome/content/firstrun/firstrun.xhtml
Normal file
184
mobile/chrome/content/firstrun/firstrun.xhtml
Normal file
@ -0,0 +1,184 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd" >
|
||||
%globalDTD;
|
||||
<!ENTITY % firstrunDTD SYSTEM "chrome://browser/locale/firstrun.dtd" >
|
||||
%firstrunDTD;
|
||||
]>
|
||||
|
||||
<!-- ***** 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 Mozilla Communicator client code, released
|
||||
- March 31, 1998.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Henrik Gemal <mozilla@gemal.dk>
|
||||
- Daniel Veditz <dveditz@netscape.com>
|
||||
- Alexey Chernyak <alexeyc@bigfoot.com>
|
||||
- Steffen Wilberg <steffen.wilberg@web.de>
|
||||
-
|
||||
- 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 ***** -->
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="viewport" content="width=480; initial-scale=.6667; user-scalable=0;" />
|
||||
<title>&firstrun.title;</title>
|
||||
<link rel="icon" type="image/png" href="chrome://branding/content/favicon32.png" />
|
||||
<link rel="stylesheet" href="chrome://browser/skin/firstRun.css" type="text/css"/>
|
||||
</head>
|
||||
|
||||
<body id="firstrun" dir="&locale.dir;" class="">
|
||||
<div id="wrapper">
|
||||
<div id="header">
|
||||
<a href="http://mozilla.com/m"><img src="chrome://browser/content/firstrun/mozilla.png" width="64" height="17"/></a>
|
||||
</div>
|
||||
|
||||
<div id="head">
|
||||
<h1><img src="chrome://branding/content/logoWordmark.png"/></h1>
|
||||
<p>&firstrun.heading2;</p>
|
||||
</div>
|
||||
|
||||
<div id="content" hidden="true">
|
||||
<h2></h2>
|
||||
<ul id="recommended">
|
||||
<li id="sync"><a href="javascript:loadSync();"><b>&firstrun.sync2.title;</b> <span>&firstrun.sync2.description;</span></a></li>
|
||||
<li id="addons"><a href="javascript:loadAddons();"><b>&firstrun.addons2.title;</b> <span>&firstrun.addons2.description;</span></a></li>
|
||||
<li id="home"><a href="about:home"><b>&firstrun.home2.title;</b> <span>&firstrun.home2.description;</span></a></li>
|
||||
</ul>
|
||||
|
||||
<p id="features"><a id="featuresURL"><span>&firstrun.features;</span><img id="nav-arrow" src="chrome://browser/content/firstrun/nav-arrow.png" /></a></p>
|
||||
<script type="application/javascript;version=1.8"><![CDATA[
|
||||
let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
|
||||
let gChromeWin = null;
|
||||
|
||||
let links = [
|
||||
{id: "releaseNotesURL", pref: "app.releaseNotesURL"},
|
||||
{id: "featuresURL", pref: "app.featuresURL"},
|
||||
{id: "faqURL", pref: "app.faqURL"},
|
||||
{id: "privacyURL", pref: "app.privacyURL"}
|
||||
];
|
||||
|
||||
function getChromeWin() {
|
||||
if (!gChromeWin) {
|
||||
gChromeWin = window
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIWebNavigation)
|
||||
.QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow)
|
||||
.QueryInterface(Ci.nsIDOMChromeWindow);
|
||||
}
|
||||
return gChromeWin;
|
||||
}
|
||||
|
||||
function loadSync() {
|
||||
let win = getChromeWin();
|
||||
// If Sync is not setup, we'll open the setup dialog. Otherwise,
|
||||
// we show the remote tabs view
|
||||
win.BrowserUI.doCommand("cmd_remoteTabs");
|
||||
}
|
||||
|
||||
function loadAddons() {
|
||||
let win = getChromeWin();
|
||||
win.BrowserUI.showPanel("addons-container");
|
||||
}
|
||||
|
||||
function init() {
|
||||
setupLinks();
|
||||
startDiscovery();
|
||||
}
|
||||
|
||||
function startDiscovery() {
|
||||
let win = getChromeWin();
|
||||
let [leftWidth, rightWidth] = win.Browser.computeSidebarVisibility();
|
||||
if (leftWidth > 0 || rightWidth > 0) {
|
||||
endDiscovery();
|
||||
return;
|
||||
}
|
||||
|
||||
let doc = win.document;
|
||||
let broadcaster = doc.getElementById("bcast_uidiscovery");
|
||||
|
||||
doc.addEventListener("animationend", endDiscovery, false);
|
||||
doc.addEventListener("PanBegin", endDiscovery, false);
|
||||
broadcaster.setAttribute("mode", "discovery");
|
||||
}
|
||||
|
||||
function endDiscovery() {
|
||||
let doc = getChromeWin().document;
|
||||
let broadcaster = doc.getElementById("bcast_uidiscovery");
|
||||
|
||||
broadcaster.removeAttribute("mode");
|
||||
doc.removeEventListener("animationend", endDiscovery, false);
|
||||
doc.removeEventListener("PanBegin", endDiscovery, false);
|
||||
document.getElementById("content").removeAttribute("hidden");
|
||||
}
|
||||
|
||||
function setupLinks() {
|
||||
try {
|
||||
let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
|
||||
links.forEach(function(link) {
|
||||
let element = document.getElementById(link.id);
|
||||
if (element) {
|
||||
let url = formatter.formatURLPref(link.pref);
|
||||
element.setAttribute("href", url);
|
||||
}
|
||||
});
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", init, false);
|
||||
]]></script>
|
||||
</div>
|
||||
|
||||
<div id="footer">
|
||||
|
||||
<ul class="nav">
|
||||
<li><a id="faqURL">&firstrun.faq;</a></li>
|
||||
<li><a id="privacyURL">&firstrun.privacy;</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="follow">
|
||||
<p>&firstrun.follow;</p>
|
||||
<ul>
|
||||
<li id="follow-twitter"><a href="http://twitter.com/mozmobile"><img src="chrome://browser/content/firstrun/twitter.png" height="41" width="42" /></a></li>
|
||||
<li id="follow-facebook"><a href="http://www.facebook.com/firefoxformobile"><img src="chrome://browser/content/firstrun/facebook.png" height="41" width="42" /></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
mobile/chrome/content/firstrun/mozilla.png
Normal file
BIN
mobile/chrome/content/firstrun/mozilla.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 663 B |
BIN
mobile/chrome/content/firstrun/nav-arrow.png
Normal file
BIN
mobile/chrome/content/firstrun/nav-arrow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
mobile/chrome/content/firstrun/twitter.png
Normal file
BIN
mobile/chrome/content/firstrun/twitter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
@ -42,8 +42,6 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Geometry.jsm");
|
||||
|
||||
// Maximum delay in ms between the two taps of a double-tap
|
||||
const kDoubleClickInterval = 400;
|
||||
|
||||
|
@ -1,365 +0,0 @@
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
Cu.import("resource:///modules/LocaleRepository.jsm");
|
||||
|
||||
let stringPrefs = [
|
||||
{ selector: "#continue-in-button", pref: "continueIn", data: ["CURRENT_LANGUAGE"] },
|
||||
{ selector: "#change-language", pref: "choose", data: null },
|
||||
{ selector: "#picker-title", pref: "chooseLanguage", data: null },
|
||||
{ selector: "#continue-button", pref: "continue", data: null },
|
||||
{ selector: "#cancel-button", pref: "cancel", data: null },
|
||||
{ selector: "#intalling-message", pref: "installing", data: ["CURRENT_LANGUAGE"] },
|
||||
{ selector: "#cancel-install-button", pref: "cancel", data: null },
|
||||
{ selector: "#installing-error", pref: "installerror", data: null },
|
||||
{ selector: "#install-continue", pref: "continue", data: null }
|
||||
];
|
||||
|
||||
let LocaleUI = {
|
||||
_strings: null,
|
||||
|
||||
get strings() {
|
||||
if (!this._strings)
|
||||
this._strings = Services.strings.createBundle("chrome://browser/locale/localepicker.properties");
|
||||
return this._strings;
|
||||
},
|
||||
|
||||
set strings(aVal) {
|
||||
this._strings = aVal;
|
||||
},
|
||||
|
||||
get _mainPage() {
|
||||
delete this._mainPage;
|
||||
return this._mainPage = document.getElementById("main-page");
|
||||
},
|
||||
|
||||
get _pickerPage() {
|
||||
delete this._pickerPage;
|
||||
return this._pickerPage = document.getElementById("picker-page");
|
||||
},
|
||||
|
||||
get _installerPage() {
|
||||
delete this._installerPage;
|
||||
return this._installerPage = document.getElementById("installer-page");
|
||||
},
|
||||
|
||||
get _deck() {
|
||||
delete this._deck;
|
||||
return this._deck = document.getElementById("language-deck");
|
||||
},
|
||||
|
||||
_currentInstall: null, // used to cancel an install
|
||||
|
||||
get selectedPanel() {
|
||||
return this._deck.selectedPanel;
|
||||
},
|
||||
|
||||
set selectedPanel(aPanel) {
|
||||
this._deck.selectedPanel = aPanel;
|
||||
},
|
||||
|
||||
get list() {
|
||||
delete this.list;
|
||||
return this.list = document.getElementById("language-list");
|
||||
},
|
||||
|
||||
_createItem: function(aId, aText, aLocale) {
|
||||
let item = document.createElement("richlistitem");
|
||||
item.setAttribute("id", aId);
|
||||
|
||||
let description = document.createElement("description");
|
||||
description.appendChild(document.createTextNode(aText));
|
||||
description.setAttribute('flex', 1);
|
||||
item.appendChild(description);
|
||||
item.setAttribute("locale", getTargetLanguage(aLocale.addon));
|
||||
|
||||
if (aLocale) {
|
||||
item.locale = aLocale.addon;
|
||||
let checkbox = document.createElement("image");
|
||||
checkbox.classList.add("checkbox");
|
||||
item.appendChild(checkbox);
|
||||
} else {
|
||||
item.classList.add("message");
|
||||
}
|
||||
return item;
|
||||
},
|
||||
|
||||
addLocales: function(aLocales) {
|
||||
let fragment = document.createDocumentFragment();
|
||||
let selectedItem = null;
|
||||
let bestMatch = NO_MATCH;
|
||||
|
||||
for each (let locale in aLocales) {
|
||||
let targetLang = getTargetLanguage(locale.addon);
|
||||
if (document.querySelector('[locale="' + targetLang + '"]'))
|
||||
continue;
|
||||
|
||||
let item = this._createItem(targetLang, locale.addon.name, locale);
|
||||
let match = localesMatch(targetLang, this.language);
|
||||
if (match > bestMatch) {
|
||||
bestMatch = match;
|
||||
selectedItem = item;
|
||||
}
|
||||
fragment.appendChild(item);
|
||||
}
|
||||
this.list.appendChild(fragment);
|
||||
if (selectedItem && !this.list.selectedItem);
|
||||
this.list.selectedItem = selectedItem;
|
||||
},
|
||||
|
||||
loadLocales: function() {
|
||||
while (this.list.firstChild)
|
||||
this.list.removeChild(this.list.firstChild);
|
||||
this.addLocales(this.availableLocales);
|
||||
LocaleRepository.getLocales(this.addLocales.bind(this));
|
||||
},
|
||||
|
||||
showPicker: function() {
|
||||
LocaleUI.selectedPanel = LocaleUI._pickerPage;
|
||||
LocaleUI.loadLocales();
|
||||
},
|
||||
|
||||
closePicker: function() {
|
||||
if (this._currentInstall) {
|
||||
Services.prefs.setBoolPref("intl.locale.matchOS", false);
|
||||
Services.prefs.setCharPref("general.useragent.locale", getTargetLanguage(this._currentInstall));
|
||||
}
|
||||
this.selectedPanel = this._mainPage;
|
||||
},
|
||||
|
||||
_language: "",
|
||||
|
||||
set language(aVal) {
|
||||
if (aVal == this._language)
|
||||
return;
|
||||
|
||||
Services.prefs.setBoolPref("intl.locale.matchOS", false);
|
||||
Services.prefs.setCharPref("general.useragent.locale", aVal);
|
||||
this._language = aVal;
|
||||
|
||||
this.strings = null;
|
||||
this.updateStrings();
|
||||
},
|
||||
|
||||
get language() {
|
||||
return this._language;
|
||||
},
|
||||
|
||||
set installStatus(aVal) {
|
||||
this._installerPage.selectedPanel = document.getElementById("installer-page-" + aVal);
|
||||
},
|
||||
|
||||
clearInstallError: function() {
|
||||
this.installStatus = "installing";
|
||||
this.selectedPanel = this._pickerPage;
|
||||
},
|
||||
|
||||
selectLanguage: function(aEvent) {
|
||||
let locale = this.list.selectedItem.locale;
|
||||
if (locale.install)
|
||||
this.updateStrings(locale);
|
||||
else {
|
||||
this.language = getTargetLanguage(locale);
|
||||
if (this._currentInstall)
|
||||
this._currentInstall = null;
|
||||
}
|
||||
},
|
||||
|
||||
installAddon: function() {
|
||||
let locale = LocaleUI.list.selectedItem.locale;
|
||||
LocaleUI._currentInstall = locale;
|
||||
|
||||
if (locale.install) {
|
||||
LocaleUI.selectedPanel = LocaleUI._installerPage;
|
||||
locale.install.addListener(installListener);
|
||||
locale.install.install();
|
||||
} else {
|
||||
this.closePicker();
|
||||
}
|
||||
},
|
||||
|
||||
cancelPicker: function() {
|
||||
if (this._currentInstall)
|
||||
this._currentInstall = null;
|
||||
// restore the last known "good" locale
|
||||
this.language = this.defaultLanguage;
|
||||
this.updateStrings();
|
||||
this.closePicker();
|
||||
},
|
||||
|
||||
closeWindow : function() {
|
||||
// Trying to close this window and open a new one results in a corrupt UI.
|
||||
if (false && LocaleUI._currentInstall) {
|
||||
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
|
||||
|
||||
if (cancelQuit.data == false) {
|
||||
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
|
||||
appStartup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eForceQuit);
|
||||
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", false);
|
||||
}
|
||||
} else {
|
||||
let argString = null;
|
||||
if (window.arguments) {
|
||||
argString = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
|
||||
argString.data = window.arguments.join(",");
|
||||
}
|
||||
let win = Services.ww.openWindow(window, "chrome://browser/content/browser.xul", "_blank", "chrome,dialog=no,all", argString);
|
||||
window.close();
|
||||
}
|
||||
},
|
||||
|
||||
cancelInstall: function () {
|
||||
if (LocaleUI._currentInstall) {
|
||||
let addonInstall = LocaleUI._currentInstall.install;
|
||||
try { addonInstall.cancel(); }
|
||||
catch(ex) { }
|
||||
LocaleUI._currentInstall = null;
|
||||
|
||||
this.language = this.defaultLanguage;
|
||||
}
|
||||
},
|
||||
|
||||
updateStrings: function (aAddon) {
|
||||
stringPrefs.forEach(function(aPref) {
|
||||
if (!aPref.element)
|
||||
aPref.element = document.querySelector(aPref.selector);
|
||||
|
||||
let string = "";
|
||||
try {
|
||||
string = getString(aPref.pref, aPref.data, aAddon);
|
||||
} catch(ex) { }
|
||||
aPref.element.textContent = string;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the target language for a locale addon
|
||||
// For now this returns the targetLocale, although if and addon doesn't
|
||||
// specify a targetLocale we could attempt to guess the locale from the addon's name
|
||||
function getTargetLanguage(aAddon) {
|
||||
return aAddon.targetLocale;
|
||||
}
|
||||
|
||||
// Gets a particular string for the passed in locale
|
||||
// Parameters: aStringName - The name of the string property to get
|
||||
// aDataset - an array of properties to use in a formatted string
|
||||
// aAddon - An addon to attempt to get dataset properties from
|
||||
function getString(aStringName, aDataSet, aAddon) {
|
||||
if (aDataSet) {
|
||||
let databundle = aDataSet.map(function(aData) {
|
||||
switch (aData) {
|
||||
case "CURRENT_LANGUAGE" :
|
||||
if (aAddon)
|
||||
return aAddon.name;
|
||||
try { return LocaleUI.strings.GetStringFromName("name"); }
|
||||
catch(ex) { return null; }
|
||||
break;
|
||||
default :
|
||||
}
|
||||
return "";
|
||||
});
|
||||
if (databundle.some(function(aItem) aItem === null))
|
||||
throw("String not found");
|
||||
return LocaleUI.strings.formatStringFromName(aStringName, databundle, databundle.length);
|
||||
}
|
||||
|
||||
return LocaleUI.strings.GetStringFromName(aStringName);
|
||||
}
|
||||
|
||||
let installListener = {
|
||||
onNewInstall: function(install) { },
|
||||
onDownloadStarted: function(install) { },
|
||||
onDownloadProgress: function(install) { },
|
||||
onDownloadEnded: function(install) { },
|
||||
onDownloadCancelled: function(install) {
|
||||
LocaleUI.cancelInstall();
|
||||
LocaleUI.showPicker();
|
||||
},
|
||||
onDownloadFailed: function(install) {
|
||||
LocaleUI.cancelInstall();
|
||||
LocaleUI.installStatus = "error";
|
||||
},
|
||||
onInstallStarted: function(install) { },
|
||||
onInstallEnded: function(install, addon) {
|
||||
LocaleUI.updateStrings(LocaleUI._currentInstall);
|
||||
LocaleUI.closePicker();
|
||||
},
|
||||
onInstallCancelled: function(install) {
|
||||
LocaleUI.cancelInstall();
|
||||
LocaleUI.showPicker();
|
||||
},
|
||||
onInstallFailed: function(install) {
|
||||
LocaleUI.cancelInstall();
|
||||
LocaleUI.installStatus = "error";
|
||||
},
|
||||
onExternalInstall: function(install, existingAddon, needsRestart) { }
|
||||
}
|
||||
|
||||
const PERFECT_MATCH = 2;
|
||||
const GOOD_MATCH = 1;
|
||||
const NO_MATCH = 0;
|
||||
//Compares two locales of the form AB or AB-CD
|
||||
//returns GOOD_MATCH if AB == AB in both locales, PERFECT_MATCH if AB-CD == AB-CD
|
||||
function localesMatch(aLocale1, aLocale2) {
|
||||
if (aLocale1 == aLocale2)
|
||||
return PERFECT_MATCH;
|
||||
|
||||
let short1 = aLocale1.split("-")[0];
|
||||
let short2 = aLocale2.split("-")[0];
|
||||
return (short1 == short2) ? GOOD_MATCH : NO_MATCH;
|
||||
}
|
||||
|
||||
function start() {
|
||||
let mouseModule = new MouseModule();
|
||||
|
||||
let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry);
|
||||
chrome.QueryInterface(Ci.nsIToolkitChromeRegistry);
|
||||
let availableLocales = chrome.getLocalesForPackage("browser");
|
||||
|
||||
let localeService = Cc["@mozilla.org/intl/nslocaleservice;1"].getService(Ci.nsILocaleService);
|
||||
let systemLocale = localeService.getSystemLocale().getCategory("NSILOCALE_CTYPE");
|
||||
let matchingLocale = "";
|
||||
|
||||
let bestMatch = NO_MATCH;
|
||||
|
||||
let strings = Services.strings.createBundle("chrome://browser/content/languages.properties");
|
||||
LocaleUI.availableLocales = [];
|
||||
while (availableLocales.hasMore()) {
|
||||
let locale = availableLocales.getNext();
|
||||
|
||||
let label = locale;
|
||||
try { label = strings.GetStringFromName(locale); }
|
||||
catch (e) { }
|
||||
LocaleUI.availableLocales.push({addon: { id: locale, name: label, targetLocale: locale }});
|
||||
|
||||
// see if we have a locale that looks like the system locale
|
||||
// if it is not the current locale, switch to it
|
||||
let match = localesMatch(systemLocale, locale);
|
||||
if (match > bestMatch) {
|
||||
bestMatch = match;
|
||||
matchingLocale = locale;
|
||||
}
|
||||
}
|
||||
|
||||
if (matchingLocale != chrome.getSelectedLocale("browser"))
|
||||
LocaleUI.language = matchingLocale;
|
||||
else {
|
||||
LocaleUI._language = chrome.getSelectedLocale("browser");
|
||||
LocaleUI.updateStrings();
|
||||
}
|
||||
|
||||
// update the page strings and show the correct page
|
||||
LocaleUI.defaultLanguage = LocaleUI._language;
|
||||
window.addEventListener("resize", resizeHandler, false);
|
||||
}
|
||||
|
||||
function resizeHandler() {
|
||||
let elements = document.getElementsByClassName("window-width");
|
||||
for (let i = 0; i < elements.length; i++)
|
||||
elements[i].setAttribute("width", Math.min(800, window.innerWidth));
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/platform.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/localePicker.css" type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="start();"
|
||||
width="480"
|
||||
height="800">
|
||||
<script src="chrome://browser/content/Util.js" type="application/javascript;version=1.8"/>
|
||||
<script src="chrome://browser/content/input.js" type="application/javascript;version=1.8"/>
|
||||
<script src="chrome://browser/content/localePicker.js" type="application/javascript;version=1.8"/>
|
||||
<deck id="language-deck" flex="1">
|
||||
<vbox id="main-page" class="pane" flex="1">
|
||||
<spacer flex="1"/>
|
||||
<button class="continue" id="continue-in-button" onclick="LocaleUI.closeWindow();" crop="center"/>
|
||||
<description id="change-language" class="link" onclick="LocaleUI.showPicker();" role="button"/>
|
||||
</vbox>
|
||||
|
||||
<vbox id="picker-page" class="pane" flex="1">
|
||||
<description id="picker-title"/>
|
||||
<richlistbox id="language-list" onclick="LocaleUI.selectLanguage(event);" flex="1" class="window-width"/>
|
||||
<hbox class="footer">
|
||||
<button id="cancel-button" class="cancel" onclick="LocaleUI.cancelPicker();" crop="center"/>
|
||||
<button id="continue-button" class="continue" onclick="LocaleUI.installAddon();" crop="center"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<deck id="installer-page" class="pane" flex="1">
|
||||
<vbox id="installer-page-installing" flex="1" pack="center" align="center">
|
||||
<description id="intalling-message" class="install-message"/>
|
||||
<button id="cancel-install-button" class="cancel" onclick="LocaleUI.cancelInstall();" crop="center"/>
|
||||
</vbox>
|
||||
<vbox id="installer-page-error" flex="1" pack="center" align="center">
|
||||
<description id="installing-error" class="install-message"/>
|
||||
<button id="install-continue" class="continue" onclick="LocaleUI.clearInstallError();" crop="center"/>
|
||||
</vbox>
|
||||
</deck>
|
||||
|
||||
</deck>
|
||||
</window>
|
@ -2,6 +2,12 @@
|
||||
|
||||
chrome.jar:
|
||||
% content browser %content/
|
||||
content/firstrun/firstrun.xhtml (content/firstrun/firstrun.xhtml)
|
||||
content/firstrun/mozilla.png (content/firstrun/mozilla.png)
|
||||
content/firstrun/features.png (content/firstrun/features.png)
|
||||
content/firstrun/twitter.png (content/firstrun/twitter.png)
|
||||
content/firstrun/facebook.png (content/firstrun/facebook.png)
|
||||
content/firstrun/nav-arrow.png (content/firstrun/nav-arrow.png)
|
||||
|
||||
* content/about.xhtml (content/about.xhtml)
|
||||
content/config.xul (content/config.xul)
|
||||
@ -9,8 +15,6 @@ chrome.jar:
|
||||
content/aboutCertError.xhtml (content/aboutCertError.xhtml)
|
||||
content/aboutCertError.css (content/aboutCertError.css)
|
||||
content/aboutHome.xhtml (content/aboutHome.xhtml)
|
||||
content/localePicker.xul (content/localePicker.xul)
|
||||
content/localePicker.js (content/localePicker.js)
|
||||
* content/aboutRights.xhtml (content/aboutRights.xhtml)
|
||||
content/blockedSite.xhtml (content/blockedSite.xhtml)
|
||||
content/languages.properties (content/languages.properties)
|
||||
|
@ -194,19 +194,16 @@ BrowserCLH.prototype = {
|
||||
// Default to the saved homepage
|
||||
let defaultURL = getHomePage();
|
||||
|
||||
// Override the default if we have a new profile
|
||||
if (needHomepageOverride() == "new profile")
|
||||
defaultURL = "about:firstrun";
|
||||
|
||||
// Override the default if we have a URL passed on command line
|
||||
if (uris.length > 0) {
|
||||
defaultURL = uris[0].spec;
|
||||
uris = uris.slice(1);
|
||||
}
|
||||
|
||||
// Show the locale selector if we have a new profile
|
||||
if (needHomepageOverride() == "new profile" && Services.prefs.getBoolPref("browser.firstrun.show.localepicker")) {
|
||||
win = openWindow(null, "chrome://browser/content/localePicker.xul", "_blank", "chrome,dialog=no,all", defaultURL);
|
||||
aCmdLine.preventDefault = true;
|
||||
return;
|
||||
}
|
||||
|
||||
win = openWindow(null, "chrome://browser/content/browser.xul", "_blank", "chrome,dialog=no,all", defaultURL);
|
||||
}
|
||||
|
||||
|
12
mobile/locales/en-US/chrome/firstrun.dtd
Normal file
12
mobile/locales/en-US/chrome/firstrun.dtd
Normal file
@ -0,0 +1,12 @@
|
||||
<!ENTITY firstrun.title "Welcome to &brandShortName;">
|
||||
<!ENTITY firstrun.heading2 "Welcome to &brandShortName;">
|
||||
<!ENTITY firstrun.sync2.title "Sync Up">
|
||||
<!ENTITY firstrun.sync2.description "Login with your Sync account info and share your history, passwords, bookmarks & tabs between your desktop and mobile">
|
||||
<!ENTITY firstrun.addons2.title "Customize">
|
||||
<!ENTITY firstrun.addons2.description "Discover and install add-ons to add new functionality to your &brandShortName;">
|
||||
<!ENTITY firstrun.home2.title "Browse">
|
||||
<!ENTITY firstrun.home2.description "Skip all this and go to your personalized Start page to start browsing the web">
|
||||
<!ENTITY firstrun.features "See More Features">
|
||||
<!ENTITY firstrun.faq "FAQ">
|
||||
<!ENTITY firstrun.privacy "Privacy Policy">
|
||||
<!ENTITY firstrun.follow "Follow us on:">
|
@ -1,10 +0,0 @@
|
||||
title=Select a language
|
||||
continueIn=Continue in %S
|
||||
name=English
|
||||
choose=Choose a different language
|
||||
chooseLanguage=Choose a Language
|
||||
cancel=Cancel
|
||||
continue=Continue
|
||||
installing=Installing %S
|
||||
installerror=Error installing language
|
||||
list.loading=Loading...
|
@ -8,7 +8,7 @@
|
||||
locale/@AB_CD@/browser/browser.dtd (%chrome/browser.dtd)
|
||||
locale/@AB_CD@/browser/browser.properties (%chrome/browser.properties)
|
||||
locale/@AB_CD@/browser/config.dtd (%chrome/config.dtd)
|
||||
locale/@AB_CD@/browser/localepicker.properties (%chrome/localepicker.properties)
|
||||
locale/@AB_CD@/browser/firstrun.dtd (%chrome/firstrun.dtd)
|
||||
locale/@AB_CD@/browser/region.properties (%chrome/region.properties)
|
||||
locale/@AB_CD@/browser/preferences.dtd (%chrome/preferences.dtd)
|
||||
locale/@AB_CD@/browser/checkbox.dtd (%chrome/checkbox.dtd)
|
||||
|
@ -1,334 +0,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 Mozilla Mobile Browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mark Finkle <mfinkle@mozilla.com>
|
||||
* Wes Johnston <wjohnston@mozilla.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
let EXPORTED_SYMBOLS = ["LocaleRepository"];
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var gServiceURL = Services.prefs.getCharPref("extensions.getLocales.get.url");
|
||||
|
||||
// A map between XML keys to LocaleSearchResult keys for string values
|
||||
// that require no extra parsing from XML
|
||||
const STRING_KEY_MAP = {
|
||||
name: "name",
|
||||
target_locale: "targetLocale",
|
||||
version: "version",
|
||||
icon: "iconURL",
|
||||
homepage: "homepageURL",
|
||||
support: "supportURL"
|
||||
};
|
||||
|
||||
var LocaleRepository = {
|
||||
loggingEnabled: false,
|
||||
|
||||
log: function(aMessage) {
|
||||
if (this.loggingEnabled)
|
||||
dump(aMessage + "\n");
|
||||
},
|
||||
|
||||
_getUniqueDescendant: function _getUniqueDescendant(aElement, aTagName) {
|
||||
let elementsList = aElement.getElementsByTagName(aTagName);
|
||||
return (elementsList.length == 1) ? elementsList[0] : null;
|
||||
},
|
||||
|
||||
_getTextContent: function _getTextContent(aElement) {
|
||||
let textContent = aElement.textContent.trim();
|
||||
return (textContent.length > 0) ? textContent : null;
|
||||
},
|
||||
|
||||
_getDescendantTextContent: function _getDescendantTextContent(aElement, aTagName) {
|
||||
let descendant = this._getUniqueDescendant(aElement, aTagName);
|
||||
return (descendant != null) ? this._getTextContent(descendant) : null;
|
||||
},
|
||||
|
||||
getLocales: function getLocales(aCallback) {
|
||||
if (!gServiceURL) {
|
||||
aCallback([]);
|
||||
return;
|
||||
}
|
||||
let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
|
||||
request.mozBackgroundRequest = true;
|
||||
request.open("GET", gServiceURL, true);
|
||||
request.overrideMimeType("text/xml");
|
||||
|
||||
let self = this;
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState == 4) {
|
||||
if (request.status == 200) {
|
||||
self.log("---- got response")
|
||||
let documentElement = request.responseXML.documentElement;
|
||||
let elements = documentElement.getElementsByTagName("addon");
|
||||
let totalResults = elements.length;
|
||||
let parsedTotalResults = parseInt(documentElement.getAttribute("total_results"));
|
||||
if (parsedTotalResults >= totalResults)
|
||||
totalResults = parsedTotalResults;
|
||||
|
||||
// TODO: Create a real Skip object from installed locales
|
||||
self._parseLocales(elements, totalResults, { ids: [], sourceURIs: [] }, aCallback);
|
||||
} else {
|
||||
Cu.reportError("Locale Repository: Error getting locale from AMO [" + request.status + "]");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
request.send(null);
|
||||
},
|
||||
|
||||
_parseLocale: function _parseLocale(aElement, aSkip) {
|
||||
let skipIDs = (aSkip && aSkip.ids) ? aSkip.ids : [];
|
||||
let skipSourceURIs = (aSkip && aSkip.sourceURIs) ? aSkip.sourceURIs : [];
|
||||
|
||||
let guid = this._getDescendantTextContent(aElement, "guid");
|
||||
if (guid == null || skipIDs.indexOf(guid) != -1)
|
||||
return null;
|
||||
|
||||
let addon = new LocaleSearchResult(guid);
|
||||
let result = {
|
||||
addon: addon,
|
||||
xpiURL: null,
|
||||
xpiHash: null
|
||||
};
|
||||
|
||||
let self = this;
|
||||
for (let node = aElement.firstChild; node; node = node.nextSibling) {
|
||||
if (!(node instanceof Ci.nsIDOMElement))
|
||||
continue;
|
||||
|
||||
let localName = node.localName;
|
||||
|
||||
// Handle case where the wanted string value is located in text content
|
||||
// but only if the content is not empty
|
||||
if (localName in STRING_KEY_MAP) {
|
||||
addon[STRING_KEY_MAP[localName]] = this._getTextContent(node) || addon[STRING_KEY_MAP[localName]];
|
||||
continue;
|
||||
}
|
||||
|
||||
// Handle cases that aren't as simple as grabbing the text content
|
||||
switch (localName) {
|
||||
case "type":
|
||||
// Map AMO's type id to corresponding string
|
||||
let id = parseInt(node.getAttribute("id"));
|
||||
switch (id) {
|
||||
case 5:
|
||||
addon.type = "language";
|
||||
break;
|
||||
default:
|
||||
WARN("Unknown type id when parsing addon: " + id);
|
||||
}
|
||||
break;
|
||||
case "authors":
|
||||
let authorNodes = node.getElementsByTagName("author");
|
||||
Array.forEach(authorNodes, function(aAuthorNode) {
|
||||
let name = self._getDescendantTextContent(aAuthorNode, "name");
|
||||
if (name == null)
|
||||
name = self._getTextContent(aAuthorNode);
|
||||
let link = self._getDescendantTextContent(aAuthorNode, "link");
|
||||
if (name == null && link == null)
|
||||
return;
|
||||
|
||||
let author = { name: name, link: link };
|
||||
if (addon.creator == null) {
|
||||
addon.creator = author;
|
||||
} else {
|
||||
if (addon.developers == null)
|
||||
addon.developers = [];
|
||||
|
||||
addon.developers.push(author);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "status":
|
||||
let repositoryStatus = parseInt(node.getAttribute("id"));
|
||||
if (!isNaN(repositoryStatus))
|
||||
addon.repositoryStatus = repositoryStatus;
|
||||
break;
|
||||
case "all_compatible_os":
|
||||
let nodes = node.getElementsByTagName("os");
|
||||
addon.isPlatformCompatible = Array.some(nodes, function(aNode) {
|
||||
let text = aNode.textContent.toLowerCase().trim();
|
||||
return text == "all" || text == Services.appinfo.OS.toLowerCase();
|
||||
});
|
||||
break;
|
||||
case "install":
|
||||
// No os attribute means the xpi is compatible with any os
|
||||
if (node.hasAttribute("os") && node.getAttribute("os")) {
|
||||
let os = node.getAttribute("os").trim().toLowerCase();
|
||||
// If the os is not ALL and not the current OS then ignore this xpi
|
||||
if (os != "all" && os != Services.appinfo.OS.toLowerCase())
|
||||
break;
|
||||
}
|
||||
|
||||
let xpiURL = this._getTextContent(node);
|
||||
if (xpiURL == null)
|
||||
break;
|
||||
|
||||
if (skipSourceURIs.indexOf(xpiURL) != -1)
|
||||
return null;
|
||||
|
||||
result.xpiURL = xpiURL;
|
||||
addon.sourceURI = NetUtil.newURI(xpiURL);
|
||||
|
||||
let size = parseInt(node.getAttribute("size"));
|
||||
addon.size = (size >= 0) ? size : null;
|
||||
|
||||
let xpiHash = node.getAttribute("hash");
|
||||
if (xpiHash != null)
|
||||
xpiHash = xpiHash.trim();
|
||||
result.xpiHash = xpiHash ? xpiHash : null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
_parseLocales: function _parseLocales(aElements, aTotalResults, aSkip, aCallback) {
|
||||
let self = this;
|
||||
let results = [];
|
||||
for (let i = 0; i < aElements.length; i++) {
|
||||
let element = aElements[i];
|
||||
|
||||
// Ignore add-ons not compatible with this Application
|
||||
let tags = this._getUniqueDescendant(element, "compatible_applications");
|
||||
if (tags == null)
|
||||
continue;
|
||||
|
||||
let applications = tags.getElementsByTagName("appID");
|
||||
let compatible = Array.some(applications, function(aAppNode) {
|
||||
if (self._getTextContent(aAppNode) != Services.appinfo.ID)
|
||||
return false;
|
||||
|
||||
let parent = aAppNode.parentNode;
|
||||
let minVersion = self._getDescendantTextContent(parent, "min_version");
|
||||
let maxVersion = self._getDescendantTextContent(parent, "max_version");
|
||||
if (minVersion == null || maxVersion == null)
|
||||
return false;
|
||||
|
||||
let currentVersion = Services.appinfo.version;
|
||||
return (Services.vc.compare(minVersion, currentVersion) <= 0 && Services.vc.compare(currentVersion, maxVersion) <= 0);
|
||||
});
|
||||
|
||||
if (!compatible)
|
||||
continue;
|
||||
|
||||
// Add-on meets all requirements, so parse out data
|
||||
let result = this._parseLocale(element, aSkip);
|
||||
if (result == null)
|
||||
continue;
|
||||
|
||||
// Ignore add-on missing a required attribute
|
||||
let requiredAttributes = ["id", "name", "version", "type", "targetLocale"];
|
||||
if (requiredAttributes.some(function(aAttribute) !result.addon[aAttribute]))
|
||||
continue;
|
||||
|
||||
// Add only if the add-on is compatible with the platform
|
||||
if (!result.addon.isPlatformCompatible)
|
||||
continue;
|
||||
|
||||
// Add only if there was an xpi compatible with this OS
|
||||
if (!result.xpiURL)
|
||||
continue;
|
||||
|
||||
results.push(result);
|
||||
|
||||
// Ignore this add-on from now on by adding it to the skip array
|
||||
aSkip.ids.push(result.addon.id);
|
||||
}
|
||||
|
||||
// Immediately report success if no AddonInstall instances to create
|
||||
let pendingResults = results.length;
|
||||
if (pendingResults == 0) {
|
||||
aCallback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create an AddonInstall for each result
|
||||
let self = this;
|
||||
results.forEach(function(aResult) {
|
||||
let addon = aResult.addon;
|
||||
let callback = function(aInstall) {
|
||||
aResult.addon.install = aInstall;
|
||||
pendingResults--;
|
||||
if (pendingResults == 0)
|
||||
aCallback(results);
|
||||
}
|
||||
|
||||
if (aResult.xpiURL) {
|
||||
AddonManager.getInstallForURL(aResult.xpiURL, callback,
|
||||
"application/x-xpinstall", aResult.xpiHash,
|
||||
addon.name, addon.iconURL, addon.version);
|
||||
} else {
|
||||
callback(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function LocaleSearchResult(aId) {
|
||||
this.id = aId;
|
||||
}
|
||||
|
||||
LocaleSearchResult.prototype = {
|
||||
id: null,
|
||||
type: null,
|
||||
targetLocale: null,
|
||||
name: null,
|
||||
addon: null,
|
||||
version: null,
|
||||
iconURL: null,
|
||||
install: null,
|
||||
sourceURI: null,
|
||||
repositoryStatus: null,
|
||||
size: null,
|
||||
updateDate: null,
|
||||
isCompatible: true,
|
||||
isPlatformCompatible: true,
|
||||
providesUpdatesSecurely: true,
|
||||
blocklistState: Ci.nsIBlocklistService.STATE_NOT_BLOCKED,
|
||||
appDisabled: false,
|
||||
userDisabled: false,
|
||||
scope: AddonManager.SCOPE_PROFILE,
|
||||
isActive: true,
|
||||
pendingOperations: AddonManager.PENDING_NONE,
|
||||
permissions: 0
|
||||
};
|
@ -43,7 +43,6 @@ VPATH = @srcdir@
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXTRA_JS_MODULES = \
|
||||
LocaleRepository.jsm \
|
||||
linuxTypes.jsm \
|
||||
video.jsm \
|
||||
$(NULL)
|
||||
|
@ -51,8 +51,6 @@ html {
|
||||
float: right;
|
||||
margin-top: -24px;
|
||||
margin-right: -34px;
|
||||
/* Trick to ensure this is shown above the opacity transform happening to content*/
|
||||
-moz-transform: translate(0,0);
|
||||
}
|
||||
|
||||
#header {
|
||||
@ -216,16 +214,6 @@ body[dir="rtl"] {
|
||||
-moz-margin-start: 0 !important;
|
||||
}
|
||||
|
||||
#content {
|
||||
opacity: 1;
|
||||
-moz-transition: opacity 500ms;
|
||||
}
|
||||
|
||||
#content[hidden] {
|
||||
display: block;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#footer-wrapper {
|
||||
font-size: 18px;
|
||||
margin-top: 24px;
|
||||
|
@ -1453,6 +1453,10 @@ setting {
|
||||
min-width: 5.5em;
|
||||
}
|
||||
|
||||
.syncsetup-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.syncsetup-label {
|
||||
color: #fff;
|
||||
}
|
||||
|
253
mobile/themes/core/firstRun.css
Normal file
253
mobile/themes/core/firstRun.css
Normal file
@ -0,0 +1,253 @@
|
||||
/* ***** 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 Mozilla Mobile Browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Gavin Sharp <gavin@gavinsharp.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
html {
|
||||
font-family: "Nokia Sans", Tahoma, sans-serif !important;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: 16px;
|
||||
color: #444;
|
||||
border-top: 4px solid #1e4262;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 19px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0489b7;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
width: 96%;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#header {
|
||||
text-align: right;
|
||||
height: 30px;
|
||||
padding: 0;
|
||||
margin: 0 8px 20px;
|
||||
}
|
||||
|
||||
#header a {
|
||||
display: inline-block;
|
||||
padding: 4px 6px 2px 6px;
|
||||
background: #1e4262;
|
||||
-moz-border-radius-bottomright: 4px;
|
||||
-moz-border-radius-bottomleft: 4px;
|
||||
}
|
||||
|
||||
#head, #content, #footer {
|
||||
margin: 0 8px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#content {
|
||||
opacity: 1;
|
||||
-moz-transition: opacity 1s linear;
|
||||
}
|
||||
|
||||
#content[hidden] {
|
||||
display: block;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#head p {
|
||||
font-size: xx-large;
|
||||
}
|
||||
|
||||
#footer {
|
||||
border-top: 2px solid #e7e7e7;
|
||||
padding: 10px;
|
||||
color: #999;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#footer ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#footer .nav li {
|
||||
list-style: none;
|
||||
float: left;
|
||||
margin: 0 1em 0 0;
|
||||
padding-right: 1em;
|
||||
border-right: 1px solid #e7e7e7;
|
||||
}
|
||||
|
||||
#footer .nav li:last-child {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#footer #follow {
|
||||
float: right;
|
||||
padding-bottom: 10px
|
||||
}
|
||||
|
||||
#footer #follow p {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#footer #follow ul {
|
||||
display: inline;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#footer #follow ul li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#footer #follow img {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#firstrun #header {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#firstrun #head h1 {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#firstrun #head p {
|
||||
margin: 0 0 10px 245px;
|
||||
padding-top: 18px;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li {
|
||||
float: left;
|
||||
width: 32%;
|
||||
list-style-type: none;
|
||||
margin-right: 2%;
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li a {
|
||||
display: block;
|
||||
padding: 20px 0;
|
||||
-moz-border-radius: 10px;
|
||||
background: #d8ecf1;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li a:active {
|
||||
text-decoration: none;
|
||||
background: #b5d7e0;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li b {
|
||||
display: block;
|
||||
padding: 90px 10px 0 10px;
|
||||
background-repeat: no-repeat;
|
||||
background-image: url("chrome://browser/content/firstrun/features.png");
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li span {
|
||||
display: block;
|
||||
padding: 0 10px;
|
||||
min-height: 150px;
|
||||
}
|
||||
|
||||
@media (max-width: 499px) {
|
||||
#firstrun ul#recommended li span {
|
||||
min-height: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li#sync b {
|
||||
background-position: 50% 0;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li#addons b {
|
||||
background-position: 50% -150px;
|
||||
}
|
||||
|
||||
#firstrun ul#recommended li#home b {
|
||||
background-position: 50% -280px;
|
||||
}
|
||||
|
||||
#firstrun #features {
|
||||
clear: both;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#firstrun #features a {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#firstrun #features a span {
|
||||
vertical-align: 35%;
|
||||
}
|
||||
|
||||
#firstrun #features a #nav-arrow {
|
||||
-moz-margin-start: 5px;
|
||||
}
|
||||
|
||||
#firstrun[dir="rtl"] #features a #nav-arrow {
|
||||
-moz-transform: scaleX(-1);
|
||||
}
|
||||
|
||||
#firstrun #demo {
|
||||
text-align: center;
|
||||
}
|
@ -1430,6 +1430,10 @@ setting {
|
||||
min-width: 5.5em;
|
||||
}
|
||||
|
||||
.syncsetup-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.syncsetup-label {
|
||||
color: @color_text_default@;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
%define color_text_button #000
|
||||
%define color_text_disabled #808080
|
||||
%define color_text_placeholder #808080
|
||||
%define color_text_as_link #febc2b
|
||||
|
||||
%define color_background_highlight #febc2b
|
||||
%define color_background_highlight_overlay rgba(254, 188, 43, 0.8)
|
||||
|
@ -1,90 +0,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 Mozilla Mobile Browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Wes Johnston <wjohnston@mozilla.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
%filter substitution
|
||||
%include defines.inc
|
||||
|
||||
.pane {
|
||||
-moz-box-pack: center;
|
||||
-moz-box-align: center;
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#main-page {
|
||||
background-image: url("chrome://branding/content/logo.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
#picker-title {
|
||||
font-weight: bold;
|
||||
font-size: @font_normal@;
|
||||
}
|
||||
|
||||
.link {
|
||||
padding: @padding_xlarge@ 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
richlistbox {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#installer-page {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
richlistitem {
|
||||
height: @touch_row@;
|
||||
font-size: @font_normal@;
|
||||
border-bottom: @border_width_tiny@ solid gray;
|
||||
padding: 0px @padding_normal@;
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
richlistitem .checkbox {
|
||||
width: 46px;
|
||||
height: 46px;
|
||||
list-style-image: url("chrome://browser/skin/images/radio-unselected-hdpi.png");
|
||||
}
|
||||
|
||||
richlistitem[selected] .checkbox {
|
||||
list-style-image: url("chrome://browser/skin/images/radio-selected-hdpi.png");
|
||||
}
|
@ -45,8 +45,6 @@
|
||||
:root {
|
||||
font-family: "Nokia Sans", Tahoma, sans-serif !important;
|
||||
font-size: @font_normal@ !important;
|
||||
background-color: @color_background_default@; /* force */
|
||||
color: @color_text_default@; /* force */
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
@ -98,11 +96,6 @@ textbox[disabled="true"] {
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: @color_text_as_link@;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* sidebars spacer --------------------------------------------------------- */
|
||||
.sidebar-spacer {
|
||||
background-color: #767973;
|
||||
|
@ -12,12 +12,12 @@ chrome.jar:
|
||||
* skin/browser.css (browser.css)
|
||||
* skin/content.css (content.css)
|
||||
skin/config.css (config.css)
|
||||
skin/firstRun.css (firstRun.css)
|
||||
* skin/forms.css (forms.css)
|
||||
skin/header.css (header.css)
|
||||
* skin/notification.css (notification.css)
|
||||
* skin/platform.css (platform.css)
|
||||
skin/touchcontrols.css (touchcontrols.css)
|
||||
* skin/localePicker.css (localePicker.css)
|
||||
% override chrome://global/skin/about.css chrome://browser/skin/about.css
|
||||
% override chrome://global/skin/media/videocontrols.css chrome://browser/skin/touchcontrols.css
|
||||
|
||||
@ -132,12 +132,12 @@ chrome.jar:
|
||||
* skin/gingerbread/browser.css (gingerbread/browser.css)
|
||||
* skin/gingerbread/content.css (gingerbread/content.css)
|
||||
skin/gingerbread/config.css (config.css)
|
||||
skin/gingerbread/firstRun.css (firstRun.css)
|
||||
* skin/gingerbread/forms.css (gingerbread/forms.css)
|
||||
skin/gingerbread/header.css (header.css)
|
||||
* skin/gingerbread/notification.css (notification.css)
|
||||
* skin/gingerbread/platform.css (gingerbread/platform.css)
|
||||
skin/gingerbread/touchcontrols.css (touchcontrols.css)
|
||||
* skin/gingerbread/localePicker.css (gingerbread/localePicker.css)
|
||||
% override chrome://global/skin/about.css chrome://browser/skin/about.css
|
||||
% override chrome://global/skin/media/videocontrols.css chrome://browser/skin/touchcontrols.css
|
||||
|
||||
@ -249,12 +249,12 @@ chrome.jar:
|
||||
* skin/honeycomb/browser.css (browser.css)
|
||||
* skin/honeycomb/content.css (content.css)
|
||||
skin/honeycomb/config.css (config.css)
|
||||
skin/honeycomb/firstRun.css (firstRun.css)
|
||||
* skin/honeycomb/forms.css (forms.css)
|
||||
skin/honeycomb/header.css (header.css)
|
||||
* skin/honeycomb/notification.css (notification.css)
|
||||
* skin/honeycomb/platform.css (platform.css)
|
||||
skin/honeycomb/touchcontrols.css (touchcontrols.css)
|
||||
* skin/honeycomb/localePicker.css (localePicker.css)
|
||||
% override chrome://global/skin/about.css chrome://browser/skin/about.css
|
||||
% override chrome://global/skin/media/videocontrols.css chrome://browser/skin/touchcontrols.css
|
||||
|
||||
|
@ -1,90 +0,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 Mozilla Mobile Browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Wes Johnston <wjohnston@mozilla.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
%filter substitution
|
||||
%include defines.inc
|
||||
|
||||
.pane {
|
||||
-moz-box-pack: center;
|
||||
-moz-box-align: center;
|
||||
-moz-box-flex: 1;
|
||||
}
|
||||
|
||||
#main-page {
|
||||
background-image: url("chrome://branding/content/logo.png");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
#picker-title {
|
||||
font-weight: bold;
|
||||
font-size: @font_normal@;
|
||||
}
|
||||
|
||||
.link {
|
||||
padding: @padding_xlarge@ 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
richlistbox {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#installer-page {
|
||||
background-color: black;
|
||||
color: white;
|
||||
}
|
||||
|
||||
richlistitem {
|
||||
height: @touch_row@;
|
||||
font-size: @font_normal@;
|
||||
border-bottom: @border_width_tiny@ solid gray;
|
||||
padding: 0px @padding_normal@;
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
richlistitem .checkbox {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
list-style-image: url("chrome://browser/skin/images/check-unselected-30.png");
|
||||
}
|
||||
|
||||
richlistitem[selected] .checkbox {
|
||||
list-style-image: url("chrome://browser/skin/images/check-selected-30.png");
|
||||
}
|
@ -45,8 +45,6 @@
|
||||
:root {
|
||||
font-family: "Nokia Sans", Tahoma, sans-serif !important;
|
||||
font-size: @font_normal@ !important;
|
||||
background-color: white; /* force */
|
||||
color: black; /* force */
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
@ -100,11 +98,6 @@ textbox[disabled="true"] {
|
||||
background-color: lightgray;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: blue;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* sidebars spacer --------------------------------------------------------- */
|
||||
.sidebar-spacer {
|
||||
background-color: #767973;
|
||||
@ -588,10 +581,6 @@ dialog {
|
||||
margin: @padding_normal@;
|
||||
}
|
||||
|
||||
.prompt-message .link {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.prompt-title {
|
||||
text-align: center;
|
||||
font-size: @font_xnormal@;
|
||||
|
Loading…
x
Reference in New Issue
Block a user