mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 13:12:27 +01:00
Fix liberator.storage.saveAll().
This commit is contained in:
@@ -457,7 +457,7 @@ liberator.Bookmarks = function () //{{{
|
||||
}
|
||||
|
||||
if (openItems)
|
||||
return liberator.openTabs((i[0] for (i in items)), items.length);
|
||||
return liberator.open([i[0] for (i in items)], liberator.NEW_TAB);
|
||||
|
||||
var title, url, tags, keyword, extra;
|
||||
var list = ":" + liberator.util.escapeHTML(liberator.commandline.getCommand()) + "<br/>" +
|
||||
@@ -762,7 +762,7 @@ liberator.History = function () //{{{
|
||||
|
||||
if (openItems)
|
||||
{
|
||||
return liberator.openTabs((i[0] for (i in items)), items.length);
|
||||
return liberator.open([i[0] for (i in items)], liberator.NEW_TAB);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -858,16 +858,22 @@ const liberator = (function () //{{{
|
||||
// [["url1", postdata1], ["url2", postdata2], ...]
|
||||
// @param where: if ommited, CURRENT_TAB is assumed
|
||||
// but NEW_TAB is set when liberator.forceNewTab is true.
|
||||
// @param callback: not implemented, will be allowed to specify a callback function
|
||||
// which is called, when the page finished loading
|
||||
// @param force: Don't prompt whether to open more than 20 tabs.
|
||||
// @returns true when load was initiated, or false on error
|
||||
open: function (urls, where)
|
||||
open: function (urls, where, force)
|
||||
{
|
||||
// convert the string to an array of converted URLs
|
||||
// -> see liberator.util.stringToURLArray for more details
|
||||
if (typeof urls == "string")
|
||||
urls = liberator.util.stringToURLArray(urls);
|
||||
|
||||
if (urls.length > 20 && !force)
|
||||
{
|
||||
liberator.commandline.input("This will open " + urls.length + " new tabs. Would you like to continue? (yes/[no])",
|
||||
function (resp) { if (resp.match(/^y(es)?$/i)) liberator.open(urls, where, true) });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (urls.length == 0)
|
||||
return false;
|
||||
|
||||
@@ -924,24 +930,6 @@ const liberator = (function () //{{{
|
||||
return true;
|
||||
},
|
||||
|
||||
/* Not really ideal. I'd like open to do this. */
|
||||
openTabs: function (uris, length)
|
||||
{
|
||||
let open = function ()
|
||||
{
|
||||
for each (let uri in uris)
|
||||
liberator.open(uri, liberator.NEW_TAB);
|
||||
}
|
||||
if ((length || uris.length) > 50)
|
||||
liberator.commandline.input("This will open " + (length || uris.length) + " new tabs. Would you like to continue? (yes/[no])",
|
||||
function (resp) { if (resp.match(/^y(es)?$/i)) open() },
|
||||
{
|
||||
completer: function (filter) [0, [["yes", "Open all in tabs"], ["no", "Cancel"]]],
|
||||
});
|
||||
else
|
||||
open();
|
||||
},
|
||||
|
||||
// namespace for plugins/scripts. Actually (only) the active plugin must/can set a
|
||||
// v.plugins.mode = <str> string to show on v.modes.CUSTOM
|
||||
// v.plugins.stop = <func> hooked on a v.modes.reset()
|
||||
|
||||
@@ -110,7 +110,7 @@ function ObjectStore(name, store)
|
||||
this.__iterator__ = function() {
|
||||
for (let key in object)
|
||||
yield [key, object[key]];
|
||||
}
|
||||
};
|
||||
}
|
||||
ObjectStore.prototype = prototype;
|
||||
|
||||
@@ -162,7 +162,7 @@ function ArrayStore(name, store)
|
||||
var funcName = aFuncName;
|
||||
arguments[0] = array;
|
||||
array = Array[funcName].apply(Array, arguments);
|
||||
},
|
||||
};
|
||||
|
||||
this.get = function get(index)
|
||||
{
|
||||
@@ -172,7 +172,7 @@ function ArrayStore(name, store)
|
||||
this.__iterator__ = function() {
|
||||
for(let i = 0; i < array.length; i++)
|
||||
yield [i, array[i]];
|
||||
}
|
||||
};
|
||||
}
|
||||
ArrayStore.prototype = prototype;
|
||||
|
||||
@@ -230,7 +230,7 @@ var storage = {
|
||||
|
||||
saveAll: function storeAll() {
|
||||
for each(key in keys)
|
||||
key.store();
|
||||
key.save();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user