diff --git a/common/Makefile b/common/Makefile index 6ee53cfd..bd8deac6 100644 --- a/common/Makefile +++ b/common/Makefile @@ -78,13 +78,12 @@ release: $(XPI) $(RDF) # This is not for you! dist: $(XPI) @echo DIST $(XPI) $(GOOGLE) - [ -n "$(featured)" ] && labels="$$labels,Featured"; \ proj=$$(echo -n $(NAME) | sed 's/\(.\).*/\1/' | tr a-z A-Z); \ proj="$$proj$$(echo $(NAME) | sed 's/.//')"; \ [ -z "$$summary" ] && summary="$$proj $(VERSION) Release"; \ + labels="Project-$$proj,$(labels)"; \ + [ -n "$(featured)" ] && labels="$$labels,Featured"; \ \ - labels=$$(echo -n "$$labels,Project-$$proj" | sed 's/^,*//g'); \ - \ IFS=,; for l in $$(echo $$labels); do \ set -- "$$@" --form-string "label=$$l"; \ done; \ diff --git a/common/content/browser.js b/common/content/browser.js index 445606b4..f522cbcc 100644 --- a/common/content/browser.js +++ b/common/content/browser.js @@ -166,8 +166,7 @@ function Browser() //{{{ function () { let homepages = gHomeButton.getHomePage(); - liberator.open(homepages, /\bhomepage\b/.test(options["activate"]) ? - liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); + liberator.open(homepages, { from: "homepage", where: liberator.NEW_TAB }); }); mappings.add([modes.NORMAL], ["gu"], diff --git a/common/content/buffer.js b/common/content/buffer.js index 537a2448..95606569 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -427,7 +427,7 @@ function Buffer() //{{{ { let url = util.readFromClipboard(); if (url) - liberator.open(url, options.get("activate").has("paste") ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB); + liberator.open(url, { from: "activate", where: liberator.NEW_TAB }); else liberator.beep(); }); diff --git a/common/content/liberator.js b/common/content/liberator.js index a4e53137..475d03d6 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -1562,7 +1562,7 @@ const liberator = (function () //{{{ * tabs. * @returns {boolean} */ - open: function (urls, where, force) + open: function (urls, params, force) { // convert the string to an array of converted URLs // -> see util.stringToURLArray for more details @@ -1587,22 +1587,31 @@ const liberator = (function () //{{{ commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no]) ", function (resp) { if (resp && resp.match(/^y(es)?$/i)) - liberator.open(urls, where, true); + liberator.open(urls, params, true); }); return true; } let flags = 0; - if (where && !(where instanceof Array)) + if (params instanceof Array) + params = { where: params }; + + for (let [opt, flag] in Iterator({ replace: "REPLACE_HISTORY", hide: "BYPASS_HISTORY" })) + if (params[opt]) + flags |= Ci.nsIWebNavigation["LOAD_FLAGS_" + flag]; + + let where = params.where || liberator.CURRENT_TAB; + if ("from" in params && liberator.has("tabs")) { - for (let [opt, flag] in Iterator({ replace: "REPLACE_HISTORY", hide: "BYPASS_HISTORY" })) - if (where[opt]) - flags |= Ci.nsIWebNavigation["LOAD_FLAGS_" + flag]; - if ("from" in where) - where = (options["newtab"] && options.get("newtab").has("all", where.from)) - ? liberator.NEW_TAB : liberator.CURRENT_TAB; - else - where = where.where || liberator.CURRENT_TAB; + if (!('where' in params) && options.get("newtab").has("all", params.from)) + where = liberator.NEW_BACKGROUND_TAB; + if (options.get("activate").has("all", params.from)) + { + if (where == liberator.NEW_TAB) + where = liberator.NEW_BACKGROUND_TAB; + else if (where == liberator.NEW_BACKGROUND_TAB) + where = liberator.NEW_TAB; + } } if (urls.length == 0) diff --git a/common/content/tabs.js b/common/content/tabs.js index 4e54cd23..f7dade7b 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -551,13 +551,10 @@ function Tabs() //{{{ args = args.string; let where = special ? liberator.NEW_TAB : liberator.NEW_BACKGROUND_TAB; - if (/\btabopen\b/.test(options["activate"])) - where = special ? liberator.NEW_BACKGROUND_TAB : liberator.NEW_TAB; - if (args) - liberator.open(args, where); + liberator.open(args, { from: "tabopen", where: where }); else - liberator.open("about:blank", where); + liberator.open("about:blank", { from: "tabopen", where: where }); }, { bang: true,