[Basilisk] Issue MoonchildProductions/UXP#516 - Remove named function syntax from basilisk/components/places.

This commit is contained in:
athenian200 2020-03-06 10:42:08 -06:00 committed by Roy Tam
commit 1cceb703f1
9 changed files with 211 additions and 211 deletions

View file

@ -231,11 +231,11 @@ this.PlacesUIUtils = {
* The string spec of the URI
* @return A URI object for the spec.
*/
createFixedURI: function PUIU_createFixedURI(aSpec) {
createFixedURI: function(aSpec) {
return URIFixup.createFixupURI(aSpec, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
},
getFormattedString: function PUIU_getFormattedString(key, params) {
getFormattedString: function(key, params) {
return bundle.formatStringFromName(key, params, params.length);
},
@ -254,7 +254,7 @@ this.PlacesUIUtils = {
* @see https://developer.mozilla.org/en/Localization_and_Plurals
* @return The localized plural string.
*/
getPluralString: function PUIU_getPluralString(aKey, aNumber, aParams) {
getPluralString: function(aKey, aNumber, aParams) {
let str = PluralForm.get(aNumber, bundle.GetStringFromName(aKey));
// Replace #1 with aParams[0], #2 with aParams[1], and so on.
@ -264,7 +264,7 @@ this.PlacesUIUtils = {
});
},
getString: function PUIU_getString(key) {
getString: function(key) {
return bundle.GetStringFromName(key);
},
@ -660,7 +660,7 @@ this.PlacesUIUtils = {
return ("performed" in aInfo && aInfo.performed);
},
_getTopBrowserWin: function PUIU__getTopBrowserWin() {
_getTopBrowserWin: function() {
return RecentWindow.getMostRecentBrowserWindow();
},
@ -683,7 +683,7 @@ this.PlacesUIUtils = {
* a DOM node
* @return the closet ancestor places view if exists, null otherwsie.
*/
getViewForNode: function PUIU_getViewForNode(aNode) {
getViewForNode: function(aNode) {
let node = aNode;
// The view for a <menu> of which its associated menupopup is a places
@ -712,7 +712,7 @@ this.PlacesUIUtils = {
* organizer. If this is not called visits will be marked as
* TRANSITION_LINK.
*/
markPageAsTyped: function PUIU_markPageAsTyped(aURL) {
markPageAsTyped: function(aURL) {
PlacesUtils.history.markPageAsTyped(this.createFixedURI(aURL));
},
@ -723,7 +723,7 @@ this.PlacesUIUtils = {
* personal toolbar, and bookmarks from within the places organizer.
* If this is not called visits will be marked as TRANSITION_LINK.
*/
markPageAsFollowedBookmark: function PUIU_markPageAsFollowedBookmark(aURL) {
markPageAsFollowedBookmark: function(aURL) {
PlacesUtils.history.markPageAsFollowedBookmark(this.createFixedURI(aURL));
},
@ -733,7 +733,7 @@ this.PlacesUIUtils = {
* This is actually used to distinguish user-initiated visits in frames
* so automatic visits can be correctly ignored.
*/
markPageAsFollowedLink: function PUIU_markPageAsFollowedLink(aURL) {
markPageAsFollowedLink: function(aURL) {
PlacesUtils.history.markPageAsFollowedLink(this.createFixedURI(aURL));
},
@ -747,7 +747,7 @@ this.PlacesUIUtils = {
* @return true if it's safe to open the node in the browser, false otherwise.
*
*/
checkURLSecurity: function PUIU_checkURLSecurity(aURINode, aWindow) {
checkURLSecurity: function(aURINode, aWindow) {
if (PlacesUtils.nodeIsBookmark(aURINode))
return true;
@ -774,7 +774,7 @@ this.PlacesUIUtils = {
* @return A description string if a META element was discovered with a
* "description" or "httpequiv" attribute, empty string otherwise.
*/
getDescriptionFromDocument: function PUIU_getDescriptionFromDocument(doc) {
getDescriptionFromDocument: function(doc) {
var metaElements = doc.getElementsByTagName("META");
for (var i = 0; i < metaElements.length; ++i) {
if (metaElements[i].name.toLowerCase() == "description" ||
@ -792,7 +792,7 @@ this.PlacesUIUtils = {
* @return the description of the given item, or an empty string if it is
* not set.
*/
getItemDescription: function PUIU_getItemDescription(aItemId) {
getItemDescription: function(aItemId) {
if (PlacesUtils.annotations.itemHasAnnotation(aItemId, this.DESCRIPTION_ANNO))
return PlacesUtils.annotations.getItemAnnotation(aItemId, this.DESCRIPTION_ANNO);
return "";
@ -932,7 +932,7 @@ this.PlacesUIUtils = {
/** aItemsToOpen needs to be an array of objects of the form:
* {uri: string, isBookmark: boolean}
*/
_openTabset: function PUIU__openTabset(aItemsToOpen, aEvent, aWindow) {
_openTabset: function(aItemsToOpen, aEvent, aWindow) {
if (!aItemsToOpen.length)
return;
@ -1009,7 +1009,7 @@ this.PlacesUIUtils = {
}
},
openURINodesInTabs: function PUIU_openURINodesInTabs(aNodes, aEvent, aView) {
openURINodesInTabs: function(aNodes, aEvent, aView) {
let window = aView.ownerWindow;
let urlsToOpen = [];
@ -1044,12 +1044,12 @@ this.PlacesUIUtils = {
* web panel.
* see also openUILinkIn
*/
openNodeIn: function PUIU_openNodeIn(aNode, aWhere, aView, aPrivate) {
openNodeIn: function(aNode, aWhere, aView, aPrivate) {
let window = aView.ownerWindow;
this._openNodeIn(aNode, aWhere, window, aPrivate);
},
_openNodeIn: function PUIU_openNodeIn(aNode, aWhere, aWindow, aPrivate=false) {
_openNodeIn: function(aNode, aWhere, aWindow, aPrivate=false) {
if (aNode && PlacesUtils.nodeIsURI(aNode) &&
this.checkURLSecurity(aNode, aWindow)) {
let isBookmark = PlacesUtils.nodeIsBookmark(aNode);
@ -1092,11 +1092,11 @@ this.PlacesUIUtils = {
*
* @note this is not supposed be perfect, so use it only for UI purposes.
*/
guessUrlSchemeForUI: function PUIU_guessUrlSchemeForUI(aUrlString) {
guessUrlSchemeForUI: function(aUrlString) {
return aUrlString.substr(0, aUrlString.indexOf(":"));
},
getBestTitle: function PUIU_getBestTitle(aNode, aDoNotCutTitle) {
getBestTitle: function(aNode, aDoNotCutTitle) {
var title;
if (!aNode.title && PlacesUtils.nodeIsURI(aNode)) {
// if node title is empty, try to set the label using host and filename
@ -1284,7 +1284,7 @@ this.PlacesUIUtils = {
// Create a new left pane folder.
var callback = {
// Helper to create an organizer special query.
create_query: function CB_create_query(aQueryName, aParentId, aQueryUrl) {
create_query: function(aQueryName, aParentId, aQueryUrl) {
let itemId = bs.insertBookmark(aParentId,
PlacesUtils._uri(aQueryUrl),
bs.DEFAULT_INDEX,
@ -1301,7 +1301,7 @@ this.PlacesUIUtils = {
},
// Helper to create an organizer special folder.
create_folder: function CB_create_folder(aFolderName, aParentId, aIsRoot) {
create_folder: function(aFolderName, aParentId, aIsRoot) {
// Left Pane Root Folder.
let folderId = bs.createFolder(aParentId,
queries[aFolderName].title,
@ -1325,7 +1325,7 @@ this.PlacesUIUtils = {
return folderId;
},
runBatched: function CB_runBatched(aUserData) {
runBatched: function(aUserData) {
delete PlacesUIUtils.leftPaneQueries;
PlacesUIUtils.leftPaneQueries = { };
@ -1392,7 +1392,7 @@ this.PlacesUIUtils = {
* @param aItemId id of a container
* @return the name of the query, or empty string if not a left-pane query
*/
getLeftPaneQueryNameFromId: function PUIU_getLeftPaneQueryNameFromId(aItemId) {
getLeftPaneQueryNameFromId: function(aItemId) {
var queryName = "";
// If the let pane hasn't been built, use the annotation service
// directly, to avoid building the left pane too early.