mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 01:27:30 +09:00
Remove the Sync promotion in the add-on install doorhanger
This commit is contained in:
parent
f63e8fe562
commit
e4aefd00f9
7 changed files with 0 additions and 308 deletions
|
|
@ -631,10 +631,6 @@ statuspanel[inactive][previoustype=overLink] {
|
||||||
-moz-box-align: end;
|
-moz-box-align: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-inner-arrowcontentfooter[footertype="promobox"] {
|
|
||||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* highlighter */
|
/* highlighter */
|
||||||
%include highlighter.css
|
%include highlighter.css
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,6 @@
|
||||||
|
|
||||||
<panel id="editBookmarkPanel"
|
<panel id="editBookmarkPanel"
|
||||||
type="arrow"
|
type="arrow"
|
||||||
footertype="promobox"
|
|
||||||
orient="vertical"
|
orient="vertical"
|
||||||
ignorekeys="true"
|
ignorekeys="true"
|
||||||
consumeoutsideclicks="true"
|
consumeoutsideclicks="true"
|
||||||
|
|
|
||||||
|
|
@ -1764,195 +1764,6 @@
|
||||||
</implementation>
|
</implementation>
|
||||||
</binding>
|
</binding>
|
||||||
|
|
||||||
<binding id="promobox">
|
|
||||||
<content>
|
|
||||||
<xul:hbox class="panel-promo-box" align="start" flex="1">
|
|
||||||
<xul:hbox align="center" flex="1">
|
|
||||||
<xul:image class="panel-promo-icon"/>
|
|
||||||
<xul:description anonid="promo-message" class="panel-promo-message" flex="1">
|
|
||||||
<xul:description anonid="promo-link"
|
|
||||||
class="plain text-link inline-link"
|
|
||||||
onclick="document.getBindingParent(this).onLinkClick();"/>
|
|
||||||
</xul:description>
|
|
||||||
</xul:hbox>
|
|
||||||
<xul:toolbarbutton class="panel-promo-closebutton close-icon"
|
|
||||||
oncommand="document.getBindingParent(this).onCloseButtonCommand();"
|
|
||||||
tooltiptext="&closeNotification.tooltip;"/>
|
|
||||||
</xul:hbox>
|
|
||||||
</content>
|
|
||||||
|
|
||||||
<implementation implements="nsIDOMEventListener">
|
|
||||||
<constructor><![CDATA[
|
|
||||||
this._panel.addEventListener("popupshowing", this, false);
|
|
||||||
]]></constructor>
|
|
||||||
|
|
||||||
<destructor><![CDATA[
|
|
||||||
this._panel.removeEventListener("popupshowing", this, false);
|
|
||||||
]]></destructor>
|
|
||||||
|
|
||||||
<field name="_panel" readonly="true"><![CDATA[
|
|
||||||
let node = this.parentNode;
|
|
||||||
while(node && node.localName != "panel") {
|
|
||||||
node = node.parentNode;
|
|
||||||
}
|
|
||||||
node;
|
|
||||||
]]></field>
|
|
||||||
<field name="_promomessage" readonly="true">
|
|
||||||
document.getAnonymousElementByAttribute(this, "anonid", "promo-message");
|
|
||||||
</field>
|
|
||||||
<field name="_promolink" readonly="true">
|
|
||||||
document.getAnonymousElementByAttribute(this, "anonid", "promo-link");
|
|
||||||
</field>
|
|
||||||
<field name="_brandBundle" readonly="true">
|
|
||||||
Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
|
||||||
</field>
|
|
||||||
<property name="_viewsLeftMap">
|
|
||||||
<getter><![CDATA[
|
|
||||||
let viewsLeftMap = {};
|
|
||||||
try {
|
|
||||||
viewsLeftMap = JSON.parse(Services.prefs.getCharPref("browser.syncPromoViewsLeftMap"));
|
|
||||||
} catch (ex) {
|
|
||||||
// If the old preference exists, migrate it to the new one.
|
|
||||||
try {
|
|
||||||
let oldPref = Services.prefs.getIntPref("browser.syncPromoViewsLeft");
|
|
||||||
Services.prefs.clearUserPref("browser.syncPromoViewsLeft");
|
|
||||||
viewsLeftMap.bookmarks = oldPref;
|
|
||||||
viewsLeftMap.passwords = oldPref;
|
|
||||||
Services.prefs.setCharPref("browser.syncPromoViewsLeftMap",
|
|
||||||
JSON.stringify(viewsLeftMap));
|
|
||||||
} catch (ex2) {}
|
|
||||||
}
|
|
||||||
return viewsLeftMap;
|
|
||||||
]]></getter>
|
|
||||||
</property>
|
|
||||||
<property name="_viewsLeft">
|
|
||||||
<getter><![CDATA[
|
|
||||||
let views = 5;
|
|
||||||
let map = this._viewsLeftMap;
|
|
||||||
if (this._notificationType in map) {
|
|
||||||
views = map[this._notificationType];
|
|
||||||
}
|
|
||||||
return views;
|
|
||||||
]]></getter>
|
|
||||||
<setter><![CDATA[
|
|
||||||
let map = this._viewsLeftMap;
|
|
||||||
map[this._notificationType] = val;
|
|
||||||
Services.prefs.setCharPref("browser.syncPromoViewsLeftMap",
|
|
||||||
JSON.stringify(map));
|
|
||||||
return val;
|
|
||||||
]]></setter>
|
|
||||||
</property>
|
|
||||||
<property name="_notificationType">
|
|
||||||
<getter><![CDATA[
|
|
||||||
// Use the popupid attribute to identify the notification type,
|
|
||||||
// otherwise just rely on the panel id for common arrowpanels.
|
|
||||||
let type = this._panel.firstChild.getAttribute("popupid") ||
|
|
||||||
this._panel.id;
|
|
||||||
if (type.startsWith("password-"))
|
|
||||||
return "passwords";
|
|
||||||
if (type == "editBookmarkPanel")
|
|
||||||
return "bookmarks";
|
|
||||||
if (type == "addon-install-complete") {
|
|
||||||
if (!Services.prefs.prefHasUserValue("services.sync.username"))
|
|
||||||
return "addons";
|
|
||||||
if (!Services.prefs.getBoolPref("services.sync.engine.addons"))
|
|
||||||
return "addons-sync-disabled";
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
]]></getter>
|
|
||||||
</property>
|
|
||||||
<property name="_notificationMessage">
|
|
||||||
<getter><![CDATA[
|
|
||||||
return gNavigatorBundle.getFormattedString(
|
|
||||||
"syncPromoNotification." + this._notificationType + ".description",
|
|
||||||
[this._brandBundle.GetStringFromName("syncBrandShortName")]
|
|
||||||
);
|
|
||||||
]]></getter>
|
|
||||||
</property>
|
|
||||||
<property name="_notificationLink">
|
|
||||||
<getter><![CDATA[
|
|
||||||
if (this._notificationType == "addons-sync-disabled") {
|
|
||||||
return "https://forum.palemoon.org/viewforum.php?f=52";
|
|
||||||
}
|
|
||||||
return "http://www.palemoon.org/sync/";
|
|
||||||
]]></getter>
|
|
||||||
</property>
|
|
||||||
<method name="onCloseButtonCommand">
|
|
||||||
<body><![CDATA[
|
|
||||||
this._viewsLeft = 0;
|
|
||||||
this.hidden = true;
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
<method name="onLinkClick">
|
|
||||||
<body><![CDATA[
|
|
||||||
// Open a new selected tab and close the current panel.
|
|
||||||
gBrowser.loadOneTab(this._promolink.getAttribute("href"),
|
|
||||||
{ inBackground: false });
|
|
||||||
this._panel.hidePopup();
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
<method name="handleEvent">
|
|
||||||
<parameter name="event"/>
|
|
||||||
<body><![CDATA[
|
|
||||||
if (event.type != "popupshowing" || event.target != this._panel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// A previous notification may have unhidden this.
|
|
||||||
this.hidden = true;
|
|
||||||
|
|
||||||
// Only handle supported notification panels.
|
|
||||||
if (!this._notificationType) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let viewsLeft = this._viewsLeft;
|
|
||||||
if (viewsLeft) {
|
|
||||||
// XXX: Short-circuit this for now.
|
|
||||||
// TO-DO: Clean up this code for sync promotion
|
|
||||||
this._viewsLeft = 0;
|
|
||||||
viewsLeft = 0;
|
|
||||||
return;
|
|
||||||
// XXX
|
|
||||||
|
|
||||||
if (Services.prefs.prefHasUserValue("services.sync.username") &&
|
|
||||||
this._notificationType != "addons-sync-disabled") {
|
|
||||||
// If the user has already setup Sync, don't show the notification.
|
|
||||||
this._viewsLeft = 0;
|
|
||||||
// Be sure to hide the panel, in case it was visible and the user
|
|
||||||
// decided to setup Sync after noticing it.
|
|
||||||
viewsLeft = 0;
|
|
||||||
// The panel is still hidden, just bail out.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this._viewsLeft = viewsLeft - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
this._promolink.setAttribute("href", this._notificationLink);
|
|
||||||
this._promolink.value = gNavigatorBundle.getString("syncPromoNotification.learnMoreLinkText");
|
|
||||||
|
|
||||||
this.hidden = false;
|
|
||||||
|
|
||||||
// HACK: The description element doesn't wrap correctly in panels,
|
|
||||||
// thus set a width on it, based on the available space, before
|
|
||||||
// setting its textContent. Then set its height as well, to
|
|
||||||
// fix wrong height calculation on Linux (bug 659578).
|
|
||||||
this._panel.addEventListener("popupshown", function panelShown() {
|
|
||||||
this._panel.removeEventListener("popupshown", panelShown, true);
|
|
||||||
// Previous popupShown events may close the panel or change
|
|
||||||
// its contents, so ensure this is still valid.
|
|
||||||
if (this._panel.state != "open" || !this._notificationType)
|
|
||||||
return;
|
|
||||||
this._promomessage.width = this._promomessage.getBoundingClientRect().width;
|
|
||||||
this._promomessage.firstChild.textContent = this._notificationMessage;
|
|
||||||
this._promomessage.height = this._promomessage.getBoundingClientRect().height;
|
|
||||||
}.bind(this), true);
|
|
||||||
}
|
|
||||||
]]></body>
|
|
||||||
</method>
|
|
||||||
</implementation>
|
|
||||||
</binding>
|
|
||||||
|
|
||||||
<binding id="toolbarbutton-badged" display="xul:button"
|
<binding id="toolbarbutton-badged" display="xul:button"
|
||||||
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
|
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
|
||||||
<content>
|
<content>
|
||||||
|
|
|
||||||
|
|
@ -363,26 +363,6 @@ restartButton=Restart
|
||||||
# menu, set this to "true". Otherwise, you can leave it as "false".
|
# menu, set this to "true". Otherwise, you can leave it as "false".
|
||||||
browser.menu.showCharacterEncoding=false
|
browser.menu.showCharacterEncoding=false
|
||||||
|
|
||||||
# LOCALIZATION NOTE (syncPromoNotification.bookmarks.label): This appears in
|
|
||||||
# the add bookmark star panel. %S will be replaced by syncBrandShortName.
|
|
||||||
# The final space separates this text from the Learn More link.
|
|
||||||
syncPromoNotification.bookmarks.description=You can access your bookmarks on all your devices with %S.\u0020
|
|
||||||
# LOCALIZATION NOTE (syncPromoNotification.passwords.label): This appears in
|
|
||||||
# the remember password panel. %S will be replaced by syncBrandShortName.
|
|
||||||
# The final space separates this text from the Learn More link.
|
|
||||||
syncPromoNotification.passwords.description=You can access your passwords on all your devices with %S.\u0020
|
|
||||||
syncPromoNotification.learnMoreLinkText=Learn More
|
|
||||||
# LOCALIZATION NOTE (syncPromoNotification.addons.label): This appears in
|
|
||||||
# the add-on install complete panel when Sync isn't set.
|
|
||||||
# %S will be replaced by syncBrandShortName.
|
|
||||||
# The final space separates this text from the Learn More link.
|
|
||||||
syncPromoNotification.addons.description=You can access your add-ons on all your devices with %S.\u0020
|
|
||||||
# LOCALIZATION NOTE (syncPromoNotification.addons-sync-disabled.label):
|
|
||||||
# This appears in the add-on install complete panel when Sync is set
|
|
||||||
# but addons sync is not. %S will be replaced by syncBrandShortName.
|
|
||||||
# The final space separates this text from the Learn More link.
|
|
||||||
syncPromoNotification.addons-sync-disabled.description=You can use your %S account to synchronize add-ons across multiple devices.\u0020
|
|
||||||
|
|
||||||
# Mozilla data reporting notification (Telemetry, Firefox Health Report, etc)
|
# Mozilla data reporting notification (Telemetry, Firefox Health Report, etc)
|
||||||
dataReportingNotification.message = %1$S automatically sends some data to %2$S so that we can improve your experience.
|
dataReportingNotification.message = %1$S automatically sends some data to %2$S so that we can improve your experience.
|
||||||
dataReportingNotification.button.label = Choose What I Share
|
dataReportingNotification.button.label = Choose What I Share
|
||||||
|
|
|
||||||
|
|
@ -1559,29 +1559,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||||
min-width: 27em;
|
min-width: 27em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-promo-box {
|
|
||||||
margin: 8px -10px -10px -10px;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-top: 1px solid ThreeDShadow;
|
|
||||||
background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-icon {
|
|
||||||
list-style-image: url("chrome://browser/skin/sync-notification-24.png");
|
|
||||||
-moz-margin-end: 10px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-closebutton {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-closebutton > .toolbarbutton-text {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Content area */
|
/* Content area */
|
||||||
#sidebar {
|
#sidebar {
|
||||||
background-color: Window;
|
background-color: Window;
|
||||||
|
|
|
||||||
|
|
@ -1338,41 +1338,6 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url-
|
||||||
min-width: 27em;
|
min-width: 27em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-promo-box {
|
|
||||||
margin: 10px -10px -10px;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-top: 1px solid ThreeDShadow;
|
|
||||||
background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
|
|
||||||
border-bottom-left-radius: 3px;
|
|
||||||
border-bottom-right-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (-moz-mac-lion-theme) {
|
|
||||||
.panel-promo-box {
|
|
||||||
border-top-style: none;
|
|
||||||
background: #f1f5fb;
|
|
||||||
color: GrayText;
|
|
||||||
box-shadow: 0px 1px 2px rgb(204,214,234) inset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-icon {
|
|
||||||
list-style-image: url("chrome://browser/skin/sync-notification-24.png");
|
|
||||||
-moz-margin-end: 10px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-closebutton {
|
|
||||||
border: none;
|
|
||||||
-moz-margin-end: -14px;
|
|
||||||
margin-top: -8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-closebutton > .toolbarbutton-text {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ::::: content area ::::: */
|
/* ::::: content area ::::: */
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
|
|
|
||||||
|
|
@ -1778,42 +1778,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||||
min-width: 27em;
|
min-width: 27em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-promo-box {
|
|
||||||
margin: 10px -10px -10px;
|
|
||||||
padding: 8px 10px;
|
|
||||||
border-top: 1px solid ThreeDShadow;
|
|
||||||
background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
|
|
||||||
border-bottom-left-radius: 3px;
|
|
||||||
border-bottom-right-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (-moz-windows-default-theme) {
|
|
||||||
.panel-promo-box {
|
|
||||||
border-top-style: none;
|
|
||||||
background: #f1f5fb;
|
|
||||||
color: GrayText;
|
|
||||||
box-shadow: 0px 1px 2px rgb(204,214,234) inset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-icon {
|
|
||||||
list-style-image: url("chrome://browser/skin/sync-notification-24.png");
|
|
||||||
-moz-margin-end: 10px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-closebutton {
|
|
||||||
-moz-appearance: none;
|
|
||||||
border: none;
|
|
||||||
-moz-margin-end: -10px;
|
|
||||||
margin-top: -5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.panel-promo-closebutton > .toolbarbutton-text {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ::::: content area ::::: */
|
/* ::::: content area ::::: */
|
||||||
|
|
||||||
#sidebar {
|
#sidebar {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue