aboutsummaryrefslogtreecommitdiffstats
path: root/maine_coon.js
diff options
context:
space:
mode:
Diffstat (limited to 'maine_coon.js')
-rw-r--r--maine_coon.js63
1 files changed, 40 insertions, 23 deletions
diff --git a/maine_coon.js b/maine_coon.js
index f7ee430..ad0023f 100644
--- a/maine_coon.js
+++ b/maine_coon.js
@@ -38,7 +38,7 @@ let PLUGIN_INFO =
<name lang="ja">メインクーン</name>
<description>Make the screen larger</description>
<description lang="ja">なるべくでかい画面で使えるように</description>
- <version>2.6.2</version>
+ <version>2.6.5</version>
<author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
<minVersion>3.0</minVersion>
<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/maine_coon.js</updateURL>
@@ -141,32 +141,33 @@ let PLUGIN_INFO =
]]></detail>
</VimperatorPlugin>;
-let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/);
-let elemStyle =
- (
- liberator.globalVariables.maine_coon_style
- ||
- libly.$U.toStyleText({
- height: '1em',
- margin: 0,
- padding: '3px',
- border: '1px solid #b3b3b3',
- borderLeft: 0,
- borderBottom: 0,
- textAlign: 'left',
- color: '#000',
- font: '11px/1 sans-serif',
- background: '#ebebeb'
- })
- );
-
-
(function () {
let U = libly.$U;
let mainWindow = document.getElementById('main-window');
let messageBox = document.getElementById('liberator-message');
let bottomBar = document.getElementById('liberator-bottombar');
+ let commandlineBox = document.getElementById('liberator-commandline-command');
+
+ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/);
+ let elemStyle =
+ (
+ liberator.globalVariables.maine_coon_style
+ ||
+ libly.$U.toStyleText({
+ height: '1em',
+ margin: 0,
+ padding: '3px',
+ border: '1px solid #b3b3b3',
+ borderLeft: 0,
+ borderBottom: 0,
+ textAlign: 'left',
+ color: '#000',
+ font: '11px/1 sans-serif',
+ background: '#ebebeb'
+ })
+ );
+
function s2b (s, d) !!((!/^(\d+|false)$/i.test(s)|parseInt(s)|!!d*2)&1<<!s);
@@ -329,6 +330,19 @@ let elemStyle =
}
})();
+ function makeTimeoutDelay (f, n) {
+ if (typeof n === 'undefined')
+ n = 1;
+
+ if (n > 1)
+ f = makeTimeoutDelay(f, n - 1);
+
+ return function () setTimeout(f, 10);
+ }
+
+ function focusToCommandline ()
+ commandlineBox.inputField.focus();
+
let useEcho = false;
let autoHideCommandLine = false;
@@ -374,15 +388,18 @@ let elemStyle =
}
U.around(commandline, 'input', function (next, args) {
- bottomBar.collapsed = false;
let result = next();
inputting = true;
+ bottomBar.collapsed = false;
+ focusToCommandline();
return result;
}, true);
U.around(commandline, 'open', function (next, args) {
+ let result = next();
bottomBar.collapsed = false;
- return next();
+ focusToCommandline();
+ return result;
}, true);
U.around(commandline, 'close', function (next, args) {