Skip to content

Commit

Permalink
Merge branch 'master' into FrameProperties-remove-obsolete-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
win7-7 committed Aug 4, 2019
2 parents 248476f + 5a95720 commit 1c53b58
Show file tree
Hide file tree
Showing 23 changed files with 7,446 additions and 5,453 deletions.
2 changes: 1 addition & 1 deletion application/palemoon/branding/official/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# 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/.

MOZ_APP_DISPLAYNAME=PaleMoon
MOZ_APP_DISPLAYNAME="Pale Moon"
# MOZ_UA_BUILDID=20100101
2 changes: 1 addition & 1 deletion application/palemoon/branding/unofficial/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# 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/.

MOZ_APP_DISPLAYNAME=NewMoon
MOZ_APP_DISPLAYNAME="New Moon"
2 changes: 1 addition & 1 deletion application/palemoon/branding/unstable/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# 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/.

MOZ_APP_DISPLAYNAME=Palemoon
MOZ_APP_DISPLAYNAME="Pale Moon"
# MOZ_UA_BUILDID=20100101
Binary file modified application/palemoon/branding/unstable/firefox.icns
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,15 @@ PlacesViewBase.prototype = {

get selectedNode() {
if (this._contextMenuShown) {
let popup = document.popupNode;
return popup._placesNode || popup.parentNode._placesNode || null;
let anchor = this._contextMenuShown.triggerNode;
if (!anchor)
return null;

if (anchor._placesNode)
return this._rootElt == anchor ? null : anchor._placesNode;

anchor = anchor.parentNode;
return this._rootElt == anchor ? null : (anchor._placesNode || null);
}
return null;
},
Expand Down Expand Up @@ -176,13 +183,13 @@ PlacesViewBase.prototype = {
},

buildContextMenu: function PVB_buildContextMenu(aPopup) {
this._contextMenuShown = true;
this._contextMenuShown = aPopup;
window.updateCommands("places");
return this.controller.buildContextMenu(aPopup);
},

destroyContextMenu: function PVB_destroyContextMenu(aPopup) {
this._contextMenuShown = false;
this._contextMenuShown = null;
},

_cleanPopup: function PVB_cleanPopup(aPopup, aDelay) {
Expand Down
86 changes: 44 additions & 42 deletions application/palemoon/components/places/content/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,6 @@ PlacesController.prototype = {
return ip != null && (isPaste || ip.isTag != true);
},

/**
* Determines whether or not the root node for the view is selected
*/
rootNodeIsSelected: function PC_rootNodeIsSelected() {
var nodes = this._view.selectedNodes;
var root = this._view.result.root;
for (var i = 0; i < nodes.length; ++i) {
if (nodes[i] == root)
return true;
}

return false;
},

/**
* Looks at the data on the clipboard to see if it is paste-able.
* Paste-able data is:
Expand Down Expand Up @@ -400,7 +386,7 @@ PlacesController.prototype = {
* Gathers information about the selected nodes according to the following
* rules:
* "link" node is a URI
* "bookmark" node is a bookamrk
* "bookmark" node is a bookmark
* "livemarkChild" node is a child of a livemark
* "tagChild" node is a child of a tag
* "folder" node is a folder
Expand All @@ -414,15 +400,10 @@ PlacesController.prototype = {
* node are set on its corresponding object as properties.
* Notes:
* 1) This can be slow, so don't call it anywhere performance critical!
* 2) A single-object array corresponding the root node is returned if
* there's no selection.
*/
_buildSelectionMetadata: function PC__buildSelectionMetadata() {
var metadata = [];
var root = this._view.result.root;
var nodes = this._view.selectedNodes;
if (nodes.length == 0)
nodes.push(root); // See the second note above

for (var i = 0; i < nodes.length; i++) {
var nodeData = {};
Expand Down Expand Up @@ -501,10 +482,23 @@ PlacesController.prototype = {
*/
_shouldShowMenuItem: function PC__shouldShowMenuItem(aMenuItem, aMetaData) {
var selectiontype = aMenuItem.getAttribute("selectiontype");
if (selectiontype == "multiple" && aMetaData.length == 1)
if (!selectiontype) {
selectiontype = "single|multiple";
}
var selectionTypes = selectiontype.split("|");
if (selectionTypes.indexOf("any") != -1) {
return true;
}
var count = aMetaData.length;
if (count > 1 && selectionTypes.indexOf("multiple") == -1)
return false;
if (selectiontype == "single" && aMetaData.length != 1)
if (count == 1 && selectionTypes.indexOf("single") == -1)
return false;
// NB: if there is no selection, we show the item if (and only if)
// the selectiontype includes 'none' - the metadata list will be
// empty so none of the other criteria will apply anyway.
if (count == 0)
return selectionTypes.indexOf("none") != -1;

var forceHideAttr = aMenuItem.getAttribute("forcehideselection");
if (forceHideAttr) {
Expand Down Expand Up @@ -551,9 +545,11 @@ PlacesController.prototype = {
* 1) The "selectiontype" attribute may be set on a menu-item to "single"
* if the menu-item should be visible only if there is a single node
* selected, or to "multiple" if the menu-item should be visible only if
* multiple nodes are selected. If the attribute is not set or if it is
* set to an invalid value, the menu-item may be visible for both types of
* selection.
* multiple nodes are selected, or to "none" if the menuitems should be
* visible for if there are no selected nodes, or to a |-separated
* combination of these.
* If the attribute is not set or set to an invalid value, the menu-item
* may be visible irrespective of the selection.
* 2) The "selection" attribute may be set on a menu-item to the various
* meta-data rules for which it may be visible. The rules should be
* separated with the | character.
Expand Down Expand Up @@ -584,7 +580,7 @@ PlacesController.prototype = {

var separator = null;
var visibleItemsBeforeSep = false;
var anyVisible = false;
var usableItemCount = 0;
for (var i = 0; i < aPopup.childNodes.length; ++i) {
var item = aPopup.childNodes[i];
if (item.localName != "menuseparator") {
Expand All @@ -598,12 +594,13 @@ PlacesController.prototype = {
(!/tree/i.test(this._view.localName) || ip);
var hideIfPrivate = item.getAttribute("hideifprivatebrowsing") == "true" &&
PrivateBrowsingUtils.isWindowPrivate(window);
item.hidden = hideIfNoIP || hideIfPrivate || hideParentFolderItem ||
!this._shouldShowMenuItem(item, metadata);
var shouldHideItem = hideIfNoIP || hideIfPrivate || hideParentFolderItem ||
!this._shouldShowMenuItem(item, metadata);
item.hidden = item.disabled = shouldHideItem;

if (!item.hidden) {
visibleItemsBeforeSep = true;
anyVisible = true;
usableItemCount++;

// Show the separator above the menu-item if any
if (separator) {
Expand All @@ -627,21 +624,21 @@ PlacesController.prototype = {
}

// Set Open Folder/Links In Tabs items enabled state if they're visible
if (anyVisible) {
if (usableItemCount > 0) {
var openContainerInTabsItem = document.getElementById("placesContext_openContainer:tabs");
if (!openContainerInTabsItem.hidden && this._view.selectedNode &&
PlacesUtils.nodeIsContainer(this._view.selectedNode)) {
openContainerInTabsItem.disabled =
!PlacesUtils.hasChildURIs(this._view.selectedNode);
}
else {
// see selectiontype rule in the overlay
var openLinksInTabsItem = document.getElementById("placesContext_openLinks:tabs");
openLinksInTabsItem.disabled = openLinksInTabsItem.hidden;
if (!openContainerInTabsItem.hidden) {
var containerToUse = this._view.selectedNode || this._view.result.root;
if (PlacesUtils.nodeIsContainer(containerToUse)) {
if (!PlacesUtils.hasChildURIs(containerToUse, true)) {
openContainerInTabsItem.disabled = true;
// Ensure that we don't display the menu if nothing is enabled:
usableItemCount--;
}
}
}
}

return anyVisible;
return usableItemCount > 0;
},

/**
Expand Down Expand Up @@ -707,10 +704,15 @@ PlacesController.prototype = {
*/
openSelectionInTabs: function PC_openLinksInTabs(aEvent) {
var node = this._view.selectedNode;
var nodes = this._view.selectedNodes;
// In the case of no selection, open the root node:
if (!node && !nodes.length) {
node = this._view.result.root;
}
if (node && PlacesUtils.nodeIsContainer(node))
PlacesUIUtils.openContainerNodeInTabs(this._view.selectedNode, aEvent, this._view);
PlacesUIUtils.openContainerNodeInTabs(node, aEvent, this._view);
else
PlacesUIUtils.openURINodesInTabs(this._view.selectedNodes, aEvent, this._view);
PlacesUIUtils.openURINodesInTabs(nodes, aEvent, this._view);
},

/**
Expand Down
11 changes: 5 additions & 6 deletions application/palemoon/components/places/content/placesOverlay.xul
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@
command="placesCmd_new:bookmark"
label="&cmd.new_bookmark.label;"
accesskey="&cmd.new_bookmark.accesskey;"
selection="any"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:folder"
command="placesCmd_new:folder"
label="&cmd.new_folder.label;"
accesskey="&cmd.context_new_folder.accesskey;"
selection="any"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuitem id="placesContext_new:separator"
command="placesCmd_new:separator"
label="&cmd.new_separator.label;"
accesskey="&cmd.new_separator.accesskey;"
closemenu="single"
selection="any"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_newSeparator"/>
<menuitem id="placesContext_createBookmark"
Expand All @@ -182,14 +182,13 @@
command="placesCmd_copy"
label="&copyCmd.label;"
closemenu="single"
accesskey="&copyCmd.accesskey;"
selection="any"/>
accesskey="&copyCmd.accesskey;"/>
<menuitem id="placesContext_paste"
command="placesCmd_paste"
label="&pasteCmd.label;"
closemenu="single"
accesskey="&pasteCmd.accesskey;"
selection="any"
selectiontype="any"
hideifnoinsertionpoint="true"/>
<menuseparator id="placesContext_editSeparator"/>
<menuitem id="placesContext_delete"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var SidebarUtils = {
var openInTabs = isContainer &&
(aEvent.button == 1 ||
(aEvent.button == 0 && modifKey)) &&
PlacesUtils.hasChildURIs(tbo.view.nodeForTreeIndex(cell.row));
PlacesUtils.hasChildURIs(tbo.view.nodeForTreeIndex(cell.row), true);

if (aEvent.button == 0 && isContainer && !openInTabs) {
tbo.view.toggleOpenState(cell.row);
Expand Down
9 changes: 9 additions & 0 deletions application/palemoon/components/preferences/advanced.xul
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
<preference id="general.smoothScroll.scrollbars" name="general.smoothScroll.scrollbars" type="bool"/>
<preference id="general.smoothScroll.scrollbars.durationMinMS" name="general.smoothScroll.scrollbars.durationMinMS" type="int"/>
<preference id="general.smoothScroll.scrollbars.durationMaxMS" name="general.smoothScroll.scrollbars.durationMaxMS" type="int"/>

<preference id="mousewheel.default.delta_multiplier_y" name="mousewheel.default.delta_multiplier_y" type="int"/>
</preferences>

#ifdef HAVE_SHELL_SERVICE
Expand Down Expand Up @@ -445,6 +447,13 @@
preference="general.smoothScroll.scrollbars.durationMaxMS"/>
<label flex="1">ms.</label>
</hbox>

<hbox align="center">
<label value="&smoothscroll.overall.yspeed.label;"/>
<textbox type="number" size="3" min="1" max="999"
preference="mousewheel.default.delta_multiplier_y"/>
<label flex="1">%.</label>
</hbox>
</groupbox>
</tabpanel>
<!-- end Smooth scrolling tab -->
Expand Down
30 changes: 0 additions & 30 deletions application/palemoon/components/preferences/privacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,36 +298,6 @@ var gPrivacyPane = {

// HISTORY

/**
* Read the location bar enabled and suggestion prefs
* @return Int value for suggestion menulist
*/
readSuggestionPref: function PPP_readSuggestionPref()
{
let getVal = function(aPref)
document.getElementById("browser.urlbar." + aPref).value;

// Suggest nothing if autocomplete is not enabled
if (!getVal("autocomplete.enabled"))
return -1;

// Bottom 2 bits of default.behavior specify history/bookmark
return getVal("default.behavior") & 3;
},

/**
* Update browser.urlbar.autocomplete.enabled when a
* browser.urlbar.suggest.* pref is changed from the ui.
*/
writeSuggestionPref: function PPP_writeSuggestionPref() {
let getVal = (aPref) => {
return document.getElementById("browser.urlbar.suggest." + aPref).value;
}
// autocomplete.enabled is true if any of the suggestions is true
let enabled = ["history", "bookmark", "openpage"].map(getVal).some(v => v);
Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", enabled);
},

/*
* Preferences:
*
Expand Down
3 changes: 0 additions & 3 deletions application/palemoon/components/preferences/privacy.xul
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,12 @@

<vbox id="tabPrefsBox" align="start" flex="1">
<checkbox id="historySuggestion" label="&locbar.history.label;"
onsyncfrompreference="return gPrivacyPane.writeSuggestionPref();"
accesskey="&locbar.history.accesskey;"
preference="browser.urlbar.suggest.history"/>
<checkbox id="bookmarkSuggestion" label="&locbar.bookmarks.label;"
onsyncfrompreference="return gPrivacyPane.writeSuggestionPref();"
accesskey="&locbar.bookmarks.accesskey;"
preference="browser.urlbar.suggest.bookmark"/>
<checkbox id="openpageSuggestion" label="&locbar.openpage.label;"
onsyncfrompreference="return gPrivacyPane.writeSuggestionPref();"
accesskey="&locbar.openpage.accesskey;"
preference="browser.urlbar.suggest.openpage"/>
</vbox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,5 @@
<!ENTITY smoothscroll.pagekeys.duration "Page up/down scroll duration:">
<!ENTITY smoothscroll.scrollbar.label "Smooth scroll with scrollbars">
<!ENTITY smoothscroll.scrollbar.duration "Scrollbar smooth scroll duration:">

<!ENTITY smoothscroll.overall.yspeed.label "Overall smooth scroll speed:">
Loading

0 comments on commit 1c53b58

Please sign in to comment.