зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1208685 - Dedupe alert.css and cleanup alert.js heading. r=bgrins
--HG-- rename : toolkit/themes/linux/global/alerts/alert.css => toolkit/themes/shared/alert-common.css extra : commitid : BFCPtEgeF91 extra : rebase_source : f49e1a8db0c8d67a75ed8e808fd27f46fe5f2778
This commit is contained in:
Родитель
1c6f4508d5
Коммит
13a4f5584f
|
@ -1,16 +1,8 @@
|
|||
// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
|
||||
var windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Ci.nsIWindowMediator);
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
// Copied from nsILookAndFeel.h, see comments on eMetric_AlertNotificationOrigin
|
||||
const NS_ALERT_HORIZONTAL = 1;
|
||||
|
@ -19,6 +11,8 @@ const NS_ALERT_TOP = 4;
|
|||
|
||||
const WINDOW_MARGIN = 10;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var gOrigin = 0; // Default value: alert from bottom right.
|
||||
var gReplacedWindow = null;
|
||||
var gAlertListener = null;
|
||||
|
@ -119,7 +113,7 @@ function moveWindowToReplace(aReplacedAlert) {
|
|||
|
||||
// Move windows that come after the replaced alert if the height is different.
|
||||
if (heightDelta != 0) {
|
||||
let windows = windowMediator.getEnumerator('alert:alert');
|
||||
let windows = Services.wm.getEnumerator('alert:alert');
|
||||
while (windows.hasMoreElements()) {
|
||||
let alertWindow = windows.getNext();
|
||||
// boolean to determine if the alert window is after the replaced alert.
|
||||
|
@ -149,7 +143,7 @@ function moveWindowToEnd() {
|
|||
screen.availTop + screen.availHeight - window.outerHeight;
|
||||
|
||||
// Position the window at the end of all alerts.
|
||||
let windows = windowMediator.getEnumerator('alert:alert');
|
||||
let windows = Services.wm.getEnumerator('alert:alert');
|
||||
while (windows.hasMoreElements()) {
|
||||
let alertWindow = windows.getNext();
|
||||
if (alertWindow != window) {
|
||||
|
@ -172,7 +166,7 @@ function onAlertBeforeUnload() {
|
|||
if (!gIsReplaced) {
|
||||
// Move other alert windows to fill the gap left by closing alert.
|
||||
let heightDelta = window.outerHeight + WINDOW_MARGIN;
|
||||
let windows = windowMediator.getEnumerator('alert:alert');
|
||||
let windows = Services.wm.getEnumerator('alert:alert');
|
||||
while (windows.hasMoreElements()) {
|
||||
let alertWindow = windows.getNext();
|
||||
if (alertWindow != window) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
== Styles specific to the alerts dialog.
|
||||
======================================================================= */
|
||||
|
||||
@import url("chrome://global/skin/");
|
||||
@import url("chrome://global/skin/alerts/alert-common.css");
|
||||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
|
@ -15,48 +15,6 @@
|
|||
background-color: -moz-Dialog;
|
||||
}
|
||||
|
||||
.alertImageBox {
|
||||
padding: 8px 0;
|
||||
width: 64px;
|
||||
background-image: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.6));
|
||||
-moz-border-end: 1px solid rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
.alertTextBox {
|
||||
padding: 8px;
|
||||
-moz-padding-start: 16px;
|
||||
width: 255px;
|
||||
}
|
||||
|
||||
.alertTextBox,
|
||||
.alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.1));
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"]:hover .alertTextBox,
|
||||
#alertNotification[clickable="true"]:hover .alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.3));
|
||||
}
|
||||
|
||||
.alertTitle {
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
#alertImage {
|
||||
max-width: 48px;
|
||||
max-height: 48px;
|
||||
list-style-image: url(chrome://global/skin/alerts/notification-48.png);
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
.alertCloseButton {
|
||||
-moz-appearance: none;
|
||||
height: 16px;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
== Styles specific to the alerts dialog.
|
||||
======================================================================= */
|
||||
|
||||
@import url("chrome://global/skin/");
|
||||
@import url("chrome://global/skin/alerts/alert-common.css");
|
||||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
|
@ -22,53 +22,11 @@
|
|||
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
|
||||
}
|
||||
|
||||
.alertImageBox {
|
||||
padding: 8px 0;
|
||||
width: 64px;
|
||||
background-image: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.6));
|
||||
-moz-border-end: 1px solid rgba(0,0,0,.08);
|
||||
}
|
||||
|
||||
.alertTitle,
|
||||
.alertTextBox {
|
||||
text-shadow: 0 1px white;
|
||||
}
|
||||
|
||||
.alertTextBox {
|
||||
padding: 8px;
|
||||
-moz-padding-start: 16px;
|
||||
width: 255px;
|
||||
}
|
||||
|
||||
.alertTextBox,
|
||||
.alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.1));
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"]:hover .alertTextBox,
|
||||
#alertNotification[clickable="true"]:hover .alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.3));
|
||||
}
|
||||
|
||||
.alertTitle {
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
#alertImage {
|
||||
max-width: 48px;
|
||||
max-height: 48px;
|
||||
list-style-image: url(chrome://global/skin/alerts/notification-48.png);
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
@keyframes alert-animation {
|
||||
from {
|
||||
opacity: 0;
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* ===== alert.css =====================================================
|
||||
== Shared styles specific to the alerts dialog.
|
||||
======================================================================= */
|
||||
|
||||
@import url("chrome://global/skin/");
|
||||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
.alertImageBox {
|
||||
padding: 8px 0;
|
||||
width: 64px;
|
||||
background-image: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.6));
|
||||
-moz-border-end: 1px solid rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
.alertTextBox {
|
||||
padding: 8px;
|
||||
-moz-padding-start: 16px;
|
||||
width: 255px;
|
||||
}
|
||||
|
||||
.alertTextBox,
|
||||
.alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.1));
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"]:hover .alertTextBox,
|
||||
#alertNotification[clickable="true"]:hover .alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.3));
|
||||
}
|
||||
|
||||
.alertTitle {
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
#alertImage {
|
||||
max-width: 48px;
|
||||
max-height: 48px;
|
||||
list-style-image: url(chrome://global/skin/alerts/notification-48.png);
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: inherit;
|
||||
}
|
|
@ -18,6 +18,7 @@
|
|||
skin/classic/global/appPicker.css (../../shared/appPicker.css)
|
||||
skin/classic/global/config.css (../../shared/config.css)
|
||||
skin/classic/global/icons/warning.svg (../../shared/incontent-icons/warning.svg)
|
||||
skin/classic/global/alerts/alert-common.css (../../shared/alert-common.css)
|
||||
skin/classic/global/menu/shared-menu-check@2x.png (../../shared/menu-check@2x.png)
|
||||
skin/classic/global/menu/shared-menu-check.png (../../shared/menu-check.png)
|
||||
skin/classic/global/menu/shared-menu-check-active.svg (../../shared/menu-check-active.svg)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
== Styles specific to the alerts dialog.
|
||||
======================================================================= */
|
||||
|
||||
@import url("chrome://global/skin/");
|
||||
@import url("chrome://global/skin/alerts/alert-common.css");
|
||||
|
||||
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
|
||||
|
||||
|
@ -16,48 +16,6 @@
|
|||
background-color: -moz-Dialog;
|
||||
}
|
||||
|
||||
.alertImageBox {
|
||||
padding: 8px 0;
|
||||
width: 64px;
|
||||
background-image: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0.6));
|
||||
-moz-border-end: 1px solid rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
.alertTextBox {
|
||||
padding: 8px;
|
||||
-moz-padding-start: 16px;
|
||||
width: 255px;
|
||||
}
|
||||
|
||||
.alertTextBox,
|
||||
.alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.1));
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"]:hover .alertTextBox,
|
||||
#alertNotification[clickable="true"]:hover .alertCloseBox {
|
||||
background-image: linear-gradient(rgba(255,255,255,0.4), rgba(255,255,255,0.3));
|
||||
}
|
||||
|
||||
.alertTitle {
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
#alertImage {
|
||||
max-width: 48px;
|
||||
max-height: 48px;
|
||||
list-style-image: url(chrome://global/skin/alerts/notification-48.png);
|
||||
}
|
||||
|
||||
#alertNotification[clickable="true"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: inherit;
|
||||
}
|
||||
|
||||
@keyframes alert-animation {
|
||||
from {
|
||||
opacity: 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче