mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1226238 - (Part 3) Remove reading list button from reader view. r=Gijs
MozReview-Commit-ID: 4QmGlGH8ELA
This commit is contained in:
parent
7c39667fa9
commit
981a623da4
@ -240,8 +240,7 @@
|
||||
/*======= Toolbar icons =======*/
|
||||
|
||||
/* desktop-only controls */
|
||||
.close-button,
|
||||
.list-button {
|
||||
.close-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry", "resource://gre/modules/UITelemetry.jsm");
|
||||
|
||||
const READINGLIST_COMMAND_ID = "readingListSidebar";
|
||||
|
||||
var gStrings = Services.strings.createBundle("chrome://global/locale/aboutReader.properties");
|
||||
|
||||
var AboutReader = function(mm, win, articlePromise) {
|
||||
@ -36,8 +34,6 @@ var AboutReader = function(mm, win, articlePromise) {
|
||||
this._mm = mm;
|
||||
this._mm.addMessageListener("Reader:Added", this);
|
||||
this._mm.addMessageListener("Reader:Removed", this);
|
||||
this._mm.addMessageListener("Sidebar:VisibilityChange", this);
|
||||
this._mm.addMessageListener("ReadingList:VisibilityStatus", this);
|
||||
this._mm.addMessageListener("Reader:CloseDropdown", this);
|
||||
this._mm.addMessageListener("Reader:AddButton", this);
|
||||
this._mm.addMessageListener("Reader:RemoveButton", this);
|
||||
@ -75,7 +71,6 @@ var AboutReader = function(mm, win, articlePromise) {
|
||||
try {
|
||||
if (Services.prefs.getBoolPref("browser.readinglist.enabled")) {
|
||||
this._setupButton("toggle-button", this._onReaderToggle.bind(this, "button"), "aboutReader.toolbar.addToReadingList");
|
||||
this._setupButton("list-button", this._onList.bind(this), "aboutReader.toolbar.openReadingList");
|
||||
}
|
||||
} catch (e) {
|
||||
// Pref doesn't exist.
|
||||
@ -121,9 +116,6 @@ var AboutReader = function(mm, win, articlePromise) {
|
||||
this._isReadingListItem = -1;
|
||||
this._updateToggleButton();
|
||||
|
||||
// Setup initial ReadingList button styles.
|
||||
this._updateListButton();
|
||||
|
||||
this._loadArticle();
|
||||
}
|
||||
|
||||
@ -239,20 +231,6 @@ AboutReader.prototype = {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Notifys us of Sidebar updates, user clicks X to close,
|
||||
// checks View -> Sidebar -> (Bookmarks, Histroy, Readinglist, etc).
|
||||
case "Sidebar:VisibilityChange": {
|
||||
let data = message.data;
|
||||
this._updateListButtonStyle(data.isOpen && data.commandID === READINGLIST_COMMAND_ID);
|
||||
break;
|
||||
}
|
||||
|
||||
// Returns requested status of current ReadingList Sidebar.
|
||||
case "ReadingList:VisibilityStatus": {
|
||||
this._updateListButtonStyle(message.data.isOpen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -291,8 +269,6 @@ AboutReader.prototype = {
|
||||
|
||||
this._mm.removeMessageListener("Reader:Added", this);
|
||||
this._mm.removeMessageListener("Reader:Removed", this);
|
||||
this._mm.removeMessageListener("Sidebar:VisibilityChange", this);
|
||||
this._mm.removeMessageListener("ReadingList:VisibilityStatus", this);
|
||||
this._mm.removeMessageListener("Reader:CloseDropdown", this);
|
||||
this._mm.removeMessageListener("Reader:AddButton", this);
|
||||
this._mm.removeMessageListener("Reader:RemoveButton", this);
|
||||
@ -358,50 +334,6 @@ AboutReader.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* To help introduce ReadingList, we want to automatically
|
||||
* open the Desktop sidebar the first time ReaderMode is used.
|
||||
*/
|
||||
_showListIntro: function() {
|
||||
this._mm.sendAsyncMessage("ReadingList:ShowIntro");
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle ReadingList Sidebar visibility. SidebarUI will trigger
|
||||
* _updateListButtonStyle().
|
||||
*/
|
||||
_onList: function() {
|
||||
this._mm.sendAsyncMessage("ReadingList:ToggleVisibility");
|
||||
},
|
||||
|
||||
/**
|
||||
* Request ReadingList Sidebar-button visibility status update.
|
||||
* Only desktop currently responds to this message.
|
||||
*/
|
||||
_updateListButton: function() {
|
||||
this._mm.sendAsyncMessage("ReadingList:GetVisibility");
|
||||
},
|
||||
|
||||
/**
|
||||
* Update ReadingList toggle button styles.
|
||||
* @param isVisible
|
||||
* What Sidebar ReadingList visibility style the List
|
||||
* toggle-button should be set to reflect, and what
|
||||
* button-action the tip will provide.
|
||||
*/
|
||||
_updateListButtonStyle: function(isVisible) {
|
||||
let classes = this._doc.getElementById("list-button").classList;
|
||||
if (isVisible) {
|
||||
classes.add("on");
|
||||
// When on, action tip is "close".
|
||||
this._setButtonTip("list-button", "aboutReader.toolbar.closeReadingList");
|
||||
} else {
|
||||
classes.remove("on");
|
||||
// When off, action tip is "open".
|
||||
this._setButtonTip("list-button", "aboutReader.toolbar.openReadingList");
|
||||
}
|
||||
},
|
||||
|
||||
_setFontSize: function(newFontSize) {
|
||||
let containerClasses = this._doc.getElementById("container").classList;
|
||||
|
||||
@ -505,11 +437,6 @@ AboutReader.prototype = {
|
||||
},
|
||||
|
||||
_handleVisibilityChange: function() {
|
||||
// ReadingList / Sidebar state might change while we're not the selected tab.
|
||||
if (this._doc.visibilityState === "visible") {
|
||||
this._updateListButton();
|
||||
}
|
||||
|
||||
let colorScheme = Services.prefs.getCharPref("reader.color_scheme");
|
||||
if (colorScheme != "auto") {
|
||||
return;
|
||||
@ -787,7 +714,6 @@ AboutReader.prototype = {
|
||||
this._updateImageMargins();
|
||||
this._requestReadingListStatus();
|
||||
|
||||
this._showListIntro();
|
||||
this._requestFavicon();
|
||||
this._doc.body.classList.add("loaded");
|
||||
|
||||
|
@ -58,7 +58,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
<li><button id="toggle-button" class="button toggle-button" hidden="true"/></li>
|
||||
<li><button id="list-button" class="button list-button" hidden="true"/></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
|
@ -25,8 +25,6 @@ aboutReader.toolbar.close=Close Reader View
|
||||
aboutReader.toolbar.typeControls=Type controls
|
||||
aboutReader.toolbar.addToReadingList=Add to Reading List
|
||||
aboutReader.toolbar.removeFromReadingList=Remove from Reading List
|
||||
aboutReader.toolbar.openReadingList=Open Reading List
|
||||
aboutReader.toolbar.closeReadingList=Close Reading List
|
||||
|
||||
# These are used for the Reader View toolbar button and the menuitem within the
|
||||
# View menu.
|
||||
|
@ -334,13 +334,6 @@
|
||||
background-image: url("chrome://global/skin/reader/RM-Add-24x24.svg");
|
||||
}
|
||||
|
||||
.list-button {
|
||||
background-image: url("chrome://global/skin/reader/RM-Reading-List-24x24.svg");
|
||||
}
|
||||
.list-button.on {
|
||||
background-color: #d9d9d9;
|
||||
}
|
||||
|
||||
.minus-button {
|
||||
background-image: url("chrome://global/skin/reader/RM-Minus-24x24.svg");
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ toolkit.jar:
|
||||
skin/classic/global/reader/RM-Delete-24x24.svg (../../shared/reader/RM-Delete-24x24.svg)
|
||||
skin/classic/global/reader/RM-Minus-24x24.svg (../../shared/reader/RM-Minus-24x24.svg)
|
||||
skin/classic/global/reader/RM-Plus-24x24.svg (../../shared/reader/RM-Plus-24x24.svg)
|
||||
skin/classic/global/reader/RM-Reading-List-24x24.svg (../../shared/reader/RM-Reading-List-24x24.svg)
|
||||
skin/classic/global/reader/RM-Type-Controls-24x24.svg (../../shared/reader/RM-Type-Controls-24x24.svg)
|
||||
skin/classic/global/reader/RM-Type-Controls-Arrow.svg (../../shared/reader/RM-Type-Controls-Arrow.svg)
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<rect x="8" y="10" fill="#808080" width="14" height="4"/>
|
||||
<rect x="8" y="16" fill="#808080" width="14" height="4"/>
|
||||
<rect x="8" y="4" fill="#808080" width="14" height="4"/>
|
||||
<circle fill="#808080" cx="4" cy="6" r="2"/>
|
||||
<circle fill="#808080" cx="4" cy="12" r="2"/>
|
||||
<circle fill="#808080" cx="4" cy="18" r="2"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 653 B |
Loading…
Reference in New Issue
Block a user