Permalink
Browse files

Remove trailing whitespace

  • Loading branch information...
1 parent a3ebdae commit 1b49ca257e1f82eaad1a706361c355912ffd213a @dgutov committed Mar 18, 2012
Showing with 20 additions and 20 deletions.
  1. +8 −8 content/bookmarks.js
  2. +12 −12 content/main.js
View
@@ -17,7 +17,7 @@ let ios = Services.io;
let bm = {
DOMAIN_REGEX: /:\/\/([^/]*)/,
KEEP_TITLE_ANN: "bmreplace/keep-title",
-
+
/*
* Checks if there is a bookmark with given URL.
* @param url URL string.
@@ -39,7 +39,7 @@ let bm = {
lst.sort(function(a, b) b.weight - a.weight); // better matches first
return lst;
},
-
+
getBookmarksOn: function(domain) {
let query = hs.getNewQuery();
query.domain = domain;
@@ -63,20 +63,20 @@ let bm = {
root.containerOpen = false;
return lst;
},
-
+
matchWeight: function(u, v) {
u = this.urlPath(u);
v = this.urlPath(v);
let max = Math.min(u.length, v.length);
for (var i = 0; i < max && u[i] == v[i]; ++i) {}
return i;
},
-
+
urlPath: function(url) {
let match = this.DOMAIN_REGEX.exec(url);
return url.slice(match.index + match[0].length);
},
-
+
/*
* Replaces bookmark's title and URL with new ones.
* Retains the folder, bookmark's position in it, and
@@ -100,7 +100,7 @@ let bm = {
fs.setAndLoadFaviconForPage(uri, favUri, false);
} catch (e) {/*NS_ERROR_NOT_AVAILABLE*/}
},
-
+
/*
* Shows Places "Add Bookmark" dialog.
*/
@@ -113,7 +113,7 @@ let bm = {
hiddenRows: ["description", "location", "keyword", "loadInSidebar"]
}, parentWindow);
},
-
+
/*
* Checks if we should keep the old bookmark title when replacing.
*/
@@ -124,7 +124,7 @@ let bm = {
return false;
}
},
-
+
setKeepTitle: function(id, value) {
as.setItemAnnotation(id, bm.KEEP_TITLE_ANN, value,
0, Ci.nsIAnnotationService.EXPIRE_NEVER);
View
@@ -16,7 +16,7 @@ let main = {
doc = window.content.document,
url = doc.location.toString(),
title = _("label");
-
+
if (!bm.DOMAIN_REGEX.test(url)) {
prompts.alert(window, title, _("urlNotSupported"));
return;
@@ -58,15 +58,15 @@ let main = {
function modifySelect(subject, topic) {
if (topic == "domwindowopened") {
ww.unregisterNotification(modifySelect);
-
+
runOnLoad(subject, function(window) {
let doc = window.document,
dialog = doc.documentElement,
cb = doc.createElement("checkbox"),
list = $(doc, "list"),
vbox = list.parentNode,
extra2 = dialog.getButton("extra2");
-
+
cb.setAttribute("label", _("keepOldTitle"));
vbox.appendChild(cb);
extra2.hidden = false;
@@ -77,28 +77,28 @@ let main = {
vbox.parentNode.setAttribute("flex", "1");
vbox.parentNode.style.width = "26em";
window.sizeToContent();
-
+
let updateChecked = function() {
result.checked = cb.checked;
};
-
+
list.addEventListener("dblclick", updateChecked, false);
dialog.addEventListener("dialogaccept", updateChecked, false);
-
+
list.addEventListener("select", function() {
cb.checked = states[list.selectedIndex];
}, false);
-
+
extra2.addEventListener("command", function() {
result.addNew = true;
window.close();
}, false);
}, "");
}
}
-
+
ww.registerNotification(modifySelect);
-
+
let bag = {
QueryInterface: function() { return this; },
getProperty: function(name) { return this[name]; },
@@ -108,21 +108,21 @@ let main = {
text: text,
list: options
};
-
+
window.openDialog("chrome://global/content/selectDialog.xul",
"_blank", "modal,resizable,centerscreen", bag);
result.value = bag.selected;
return bag.ok;
},
-
+
getLastVersion: function() {
try {
return PREFS_BRANCH.getCharPref(PREF_VERSION);
} catch(e) {
return null;
}
},
-
+
setLastVersion: function(version) {
PREFS_BRANCH.setCharPref(PREF_VERSION, version);
}

0 comments on commit 1b49ca2

Please sign in to comment.