aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJagua2015-09-03 01:31:58 +0900
committerJagua2015-09-03 01:31:58 +0900
commitf1a5a67ce33fe0a29db3967d8a7990185f5748d3 (patch)
treed8c08e464ded73b6abafb19d526bf86d67efdb27
parentdc84195a10f8532132f17658683e9af18b2bc1f5 (diff)
downloadvimperator-plugins-f1a5a67ce33fe0a29db3967d8a7990185f5748d3.tar.bz2
Dropped let expression for Firefox 41+
-rw-r--r--microsoft-translator.js32
1 files changed, 17 insertions, 15 deletions
diff --git a/microsoft-translator.js b/microsoft-translator.js
index 44ae587..c6a864a 100644
--- a/microsoft-translator.js
+++ b/microsoft-translator.js
@@ -1,6 +1,6 @@
/* NEW BSD LICENSE {{{
Copyright (c) 2009-2010, anekos.
-Copyright (c) 2012-2014, Jagua.
+Copyright (c) 2012-2015, Jagua.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -282,6 +282,8 @@ let INFO = xml`
function (text) util.copyToClipboard(text, true)
};
+ let actionTypes = [n for (n in actions)];
+
function makeListValidator (list)
function (vs) (!vs || !vs.some(function (v) !list.some(function (at) (v == at))));
@@ -319,9 +321,10 @@ let INFO = xml`
actionNames.push('echo');
function setPair () {
- if ((!from ^ !to) && settings.pair.length >= 2)
- let (v = settings.pair[(settings.pair[0] == (from || to)) - 0])
- (from ? (to = v) : (from = v));
+ if ((!from ^ !to) && settings.pair.length >= 2) {
+ let v = settings.pair[(settings.pair[0] == (from || to)) - 0];
+ (from ? (to = v) : (from = v));
+ }
}
function req () {
@@ -360,19 +363,18 @@ let INFO = xml`
literal: 0,
bang: true,
options:
- let (actionTypes = [n for (n in actions)])
+ [
[
- [
- ['-action', '-a'],
- commands.OPTION_LIST,
- makeListValidator(actionTypes),
- actionTypes.map(function (v) [v, v]),
- true
- ],
- [['-from', '-f'], commands.OPTION_STRING, null, languages],
- [['-to', '-t'], commands.OPTION_STRING, null, languages],
- [['-guess', '-g'], commands.OPTION_NOARG]
+ ['-action', '-a'],
+ commands.OPTION_LIST,
+ makeListValidator(actionTypes),
+ actionTypes.map(function (v) [v, v]),
+ true
],
+ [['-from', '-f'], commands.OPTION_STRING, null, languages],
+ [['-to', '-t'], commands.OPTION_STRING, null, languages],
+ [['-guess', '-g'], commands.OPTION_NOARG]
+ ],
},
true
);