mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-11 14:35:48 +01:00
Prompt before running :sanitize all.
--HG-- extra : rebase_source : 7a66e541ba326e72416bff85085003f97d607454
This commit is contained in:
@@ -93,6 +93,8 @@ command.let.undefinedVar-1 = E121: Undefined variable: %S
|
|||||||
command.let.unexpectedChar = E18: Unexpected characters in :let
|
command.let.unexpectedChar = E18: Unexpected characters in :let
|
||||||
command.run.noPrevious = E34: No previous command
|
command.run.noPrevious = E34: No previous command
|
||||||
command.sanitize.privateMode = Cannot sanitize items in private mode
|
command.sanitize.privateMode = Cannot sanitize items in private mode
|
||||||
|
command.sanitize.allDeleted = All items sanitized
|
||||||
|
command.sanitize.noneDeleted = No items sanitized
|
||||||
command.scriptnames.none = No sourced scripts found
|
command.scriptnames.none = No sourced scripts found
|
||||||
command.set.errorParsing-1 = Error parsing :set command: %S
|
command.set.errorParsing-1 = Error parsing :set command: %S
|
||||||
command.set.numberRequired-2 = E521: Number required after =: %S=%S
|
command.set.numberRequired-2 = E521: Number required after =: %S=%S
|
||||||
@@ -274,6 +276,8 @@ quickmark.notSet = QuickMark not set
|
|||||||
quickmark.invalid = Argument must be an ASCII letter or digit
|
quickmark.invalid = Argument must be an ASCII letter or digit
|
||||||
quickmark.added-2 = Added Quick Mark '%S': %S
|
quickmark.added-2 = Added Quick Mark '%S': %S
|
||||||
|
|
||||||
|
sanitize.prompt.deleteAll = This will sanitize all items. Would you like to continue? (yes/[no]):
|
||||||
|
|
||||||
save.invalidDestination-1 = Invalid destination: %S
|
save.invalidDestination-1 = Invalid destination: %S
|
||||||
|
|
||||||
sort.ascending = ascending
|
sort.ascending = ascending
|
||||||
|
|||||||
@@ -427,20 +427,34 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
|
|||||||
else
|
else
|
||||||
dactyl.assert(modules.options.get("sanitizeitems").validator(items), _("error.invalidArgument"));
|
dactyl.assert(modules.options.get("sanitizeitems").validator(items), _("error.invalidArgument"));
|
||||||
|
|
||||||
if (items.indexOf("all") >= 0)
|
function sanitize(items) {
|
||||||
items = Object.keys(sanitizer.itemMap).filter(function (k) items.indexOf(k) === -1);
|
sanitizer.range = range.native;
|
||||||
|
sanitizer.ignoreTimespan = range.min == null;
|
||||||
sanitizer.range = range.native;
|
sanitizer.sanitizing = true;
|
||||||
sanitizer.ignoreTimespan = range.min == null;
|
if (args["-host"]) {
|
||||||
sanitizer.sanitizing = true;
|
args["-host"].forEach(function (host) {
|
||||||
if (args["-host"]) {
|
sanitizer.sanitizing = true;
|
||||||
args["-host"].forEach(function (host) {
|
sanitizer.sanitizeItems(items, range, host);
|
||||||
sanitizer.sanitizing = true;
|
});
|
||||||
sanitizer.sanitizeItems(items, range, host);
|
}
|
||||||
});
|
else
|
||||||
|
sanitizer.sanitize(items, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (items.indexOf("all") >= 0)
|
||||||
|
modules.commandline.input(_("sanitize.prompt.deleteAll") + " ",
|
||||||
|
function (resp) {
|
||||||
|
if (resp.match(/^y(es)?$/i)) {
|
||||||
|
items = Object.keys(sanitizer.itemMap).filter(function (k) items.indexOf(k) === -1);
|
||||||
|
sanitize(items);
|
||||||
|
dactyl.echo(_("command.sanitize.allDeleted"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
dactyl.echo(_("command.sanitize.noneDeleted"));
|
||||||
|
});
|
||||||
else
|
else
|
||||||
sanitizer.sanitize(items, range);
|
sanitize(items);
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
argCount: "*", // FIXME: should be + and 0
|
argCount: "*", // FIXME: should be + and 0
|
||||||
|
|||||||
Reference in New Issue
Block a user