Bug 676047 - "[Rapid Release] Mobile: Lightbox promo in product to promote Firefox Aurora" [r=mark.finkle]

This commit is contained in:
Sriram Ramasubramanian 2011-09-06 11:47:00 -04:00
Родитель 7f690e40b3
Коммит 263c146dbb
8 изменённых файлов: 194 добавлений и 0 удалений

Просмотреть файл

@ -453,6 +453,7 @@ pref("app.support.baseURL", "http://support.mozilla.com/mobile");
pref("app.feedbackURL", "http://input.mozilla.com/feedback/");
pref("app.privacyURL", "http://www.mozilla.com/%LOCALE%/m/privacy.html");
pref("app.creditsURL", "http://www.mozilla.org/credits/");
pref("app.channelURL", "http://www.mozilla.org/%LOCALE%/firefox/channel/");
#if MOZ_UPDATE_CHANNEL == beta
pref("app.featuresURL", "http://www.mozilla.com/%LOCALE%/mobile/beta/features/");
pref("app.faqURL", "http://www.mozilla.com/%LOCALE%/mobile/beta/faq/");

Просмотреть файл

@ -102,6 +102,27 @@
<span id="text-notabs">&aboutHome.noTabs;</span>
<span id="text-noaddons">&aboutHome.noAddons;</span>
</div>
<!-- Lightbox -->
<div id="lightbox">
<div id="lightbox-background"></div>
<div id="lightbox-wrapper">
<div id="lightbox-container">
<img id="lightbox-logo" src="chrome://browser/skin/images/aurora-lightbox-logo.png"/>
<div id="lightbox-message">
<p class="title">&aboutHome.getInBeforeBeta;</p>
<p class="message">&aboutHome.tryAurora;</p>
</div>
<a id="lightbox-link">
<div id="lightbox-button">
<p class="title">&aboutHome.downloadAurora;</p>
<p class="sub-title">&aboutHome.forAndroid;</p>
</div>
</a>
<img id="lightbox-close" src="chrome://browser/skin/images/aurora-lightbox-close.png" alt="Aurora Close"/>
</div>
</div>
</div>
<script type="application/javascript;version=1.8"><![CDATA[
let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
@ -148,6 +169,8 @@
} else {
endDiscovery();
}
initLightbox();
}
function uninit() {
@ -429,6 +452,45 @@
document.getElementById("content").removeAttribute("hidden");
}, 0);
}
function initLightbox() {
let prefs = getChromeWin().Services.prefs;
let channel = prefs.getCharPref("app.update.channel");
let startupCount = 0;
try {
startupCount = prefs.getIntPref("app.promo.aurora");
if(startupCount != 6)
prefs.setIntPref("app.promo.aurora", ++startupCount);
} catch(e) {
prefs.setIntPref("app.promo.aurora", 1);
}
// This should appear only on "beta" channel on the fifth launch.
if ((channel == "beta") && (startupCount == 5)) {
let close = document.getElementById("lightbox-close");
close.addEventListener("click", function() {
document.getElementById("lightbox").style.display = "none";
}, false);
let link = document.getElementById("lightbox-link");
link.addEventListener("click", function(event) {
event.preventDefault();
document.getElementById("lightbox").style.display = "none";
let BrowserUI = getChromeWin().BrowserUI;
let owner = getChromeWin().Browser.selectedTab;
let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
let linkUrl = formatter.formatURLPref("app.channelURL");
BrowserUI.newTab(linkUrl, owner);
}, false);
// Giving a chance for any page transitions to happen, if any, before displaying the lightbox
setTimeout(function() {
document.getElementById("lightbox").style.display = "block";
}, 300);
}
}
]]></script>
</body>
</html>

Просмотреть файл

@ -9,3 +9,13 @@
<!ENTITY aboutHome.noTabs "No tabs from last time">
<!ENTITY aboutHome.noAddons "No recommended add-ons">
<!ENTITY aboutHome.getLocale "Change Language">
<!ENTITY aboutHome.getInBeforeBeta "Get in before Beta.">
<!ENTITY aboutHome.tryAurora "Try Firefox Aurora and help shape the future of Firefox.">
<!-- LOCALIZATION NOTE:
(aboutHome.downloadAurora): First line of a multi-line button. Treat as a title.
-->
<!ENTITY aboutHome.downloadAurora "Download Aurora">
<!-- LOCALIZATION NOTE:
(aboutHome.forAndroid): Second line of a multi-line button. Treat as a subtitle.
-->
<!ENTITY aboutHome.forAndroid "for Android">

Просмотреть файл

@ -254,6 +254,117 @@ body[dir="rtl"] {
margin: 0;
}
/* Lightbox for Aurora */
#lightbox {
position: fixed;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
display: none;
}
#lightbox-background {
background-color: #000;
width: 100%;
height: 100%;
opacity: 0.4;
}
#lightbox-wrapper {
background: transparent;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
position: fixed;
}
#lightbox-container {
max-width: 300px;
margin: 40px auto;
background: #000 url("images/aurora-lightbox-bg.jpg") center top no-repeat;
border-radius: 6px;
padding: 26px 0px 0px;
border: 1px solid #000;
box-shadow: rgba(0, 0, 0, 0.75) 0px 0px 10px 2px;
position: relative;
}
#lightbox-logo {
width: 65%;
max-width: 195px;
display: block;
margin: 0px auto;
}
#lightbox-message {
width: 100%;
padding: 34px 0px 18px;
text-align: center;
}
#lightbox-message > p,
#lightbox-button > p {
font-family: Georgia;
margin: 0px;
padding: 0px;
}
#lightbox-message > p.title ,
#lightbox-button > p.title {
font-size: 24px;
line-height: 24px;
color: #fff;
padding-bottom: 10px;
}
#lightbox-message > p.message,
#lightbox-button > p.sub-title {
font-size: 16px;
line-height: 20px;
}
#lightbox-message > p.message {
color: #c0b5b5;
}
#lightbox-container a,
#lightbox-container a:hover,
#lightbox-container a:visited {
outline: 0px;
border: 0px;
text-decoration: none;
display: block;
}
#lightbox-button {
background: -moz-linear-gradient(center top , #84C63C 0%, #489615 100%) repeat scroll 0 0 transparent;
margin: 10px;
text-align: center;
border-radius: 4px;
padding: 18px 0px;
box-shadow: rgba(0, 0, 0, 0) 0px 0px, inset rgba(0, 0, 0, 0.1) 0px -3px;
}
#lightbox-button > p.title,
#lightbox-button > p.sub-title {
text-shadow: rgba(136, 136, 136, 0.39) 0px 0px 0px -1px;
}
#lightbox-button > p.sub-title {
font-style: italic;
color: #fff;
}
#lightbox-close {
position: absolute;
top: 15px;
right: 15px;
width: 16px;
height: 16px;
}
@media (max-width: 399px) {
#support {
margin-top: 8px;

Двоичные данные
mobile/themes/core/images/aurora-lightbox-bg.jpg Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
mobile/themes/core/images/aurora-lightbox-close.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичные данные
mobile/themes/core/images/aurora-lightbox-logo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 28 KiB

Просмотреть файл

@ -139,6 +139,9 @@ chrome.jar:
skin/images/handle-end.png (images/handle-end.png)
skin/images/homescreen-blank-hdpi.png (images/homescreen-blank-hdpi.png)
skin/images/homescreen-default-hdpi.png (images/homescreen-default-hdpi.png)
skin/images/aurora-lightbox-bg.jpg (images/aurora-lightbox-bg.jpg)
skin/images/aurora-lightbox-logo.png (images/aurora-lightbox-logo.png)
skin/images/aurora-lightbox-close.png (images/aurora-lightbox-close.png)
chrome.jar:
% skin browser classic/1.0 %skin/gingerbread/ os=Android osversion=2.3 osversion=2.3.3 osversion=2.3.4 osversion=2.3.5 osversion=2.3.6 osversion=2.3.7
@ -273,6 +276,9 @@ chrome.jar:
skin/gingerbread/images/errorpage-larry-black.png (images/errorpage-larry-black.png)
skin/gingerbread/images/homescreen-blank-hdpi.png (images/homescreen-blank-hdpi.png)
skin/gingerbread/images/homescreen-default-hdpi.png (images/homescreen-default-hdpi.png)
skin/gingerbread/images/aurora-lightbox-bg.jpg (images/aurora-lightbox-bg.jpg)
skin/gingerbread/images/aurora-lightbox-logo.png (images/aurora-lightbox-logo.png)
skin/gingerbread/images/aurora-lightbox-close.png (images/aurora-lightbox-close.png)
chrome.jar:
% skin browser classic/1.0 %skin/honeycomb/ os=Android osversion>=3.0
@ -417,6 +423,10 @@ chrome.jar:
skin/honeycomb/images/urlbar-border-bottom.png (honeycomb/images/urlbar-border-bottom.png)
skin/honeycomb/images/urlbar-border-side-active.png (honeycomb/images/urlbar-border-side-active.png)
skin/honeycomb/images/urlbar-border-bottom-active.png (honeycomb/images/urlbar-border-bottom-active.png)
skin/honeycomb/images/aurora-lightbox-bg.jpg (images/aurora-lightbox-bg.jpg)
skin/honeycomb/images/aurora-lightbox-logo.png (images/aurora-lightbox-logo.png)
skin/honeycomb/images/aurora-lightbox-close.png (images/aurora-lightbox-close.png)
skin/honeycomb/images/menu-top-insideglow.png (honeycomb/images/menu-top-insideglow.png)
skin/honeycomb/images/menu-top-insideglow-green.png (honeycomb/images/menu-top-insideglow-green.png)
skin/honeycomb/images/menu-top-insideglow-grey.png (honeycomb/images/menu-top-insideglow-grey.png)