From e1153524b5f8ee8fcd1cd317bca28aef61fc8469 Mon Sep 17 00:00:00 2001
From: anekos
Date: Wed, 7 Jan 2009 09:22:18 +0000
Subject: +snaka72 さんのコードを取り込んだ +'mainecoon' オプション追加
+clock.js などがあっても、コマンドラインを隠せるようにした
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@28091 d0d07461-0603-4401-acd4-de1884942a52
---
maine_coon.js | 246 +++++++++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 199 insertions(+), 47 deletions(-)
(limited to 'maine_coon.js')
diff --git a/maine_coon.js b/maine_coon.js
index 6e61eeb..dfcbbd4 100644
--- a/maine_coon.js
+++ b/maine_coon.js
@@ -38,7 +38,7 @@ let PLUGIN_INFO =
メインクーン
Makes more large screen
なるべくでかい画面で使えるように
- 1.1
+ 2.0
anekos
2.0pre
2.0pre
@@ -46,28 +46,47 @@ let PLUGIN_INFO =
new BSD License (Please read the source code comments of this plugin)
修正BSDライセンス (ソースコードのコメントを参照してください)
normal
+ == Options ==
+ mainecoon:
+ Possible values
+ c:
+ Hide caption-bar
+ a:
+ Hide automatically command-line
+ f:
+ Fullscreeen
== Global Variables ==
maine_coon_targets:
- Other elements ids that you want to kill.
+ Other elements IDs that you want to hide.
let g:maine_coon_targets = "sidebar-2 sidebar-2-splitter"
- maine_coon_auto_hide:
- "true" or "false"
- Hide automatically commandline, if this variable is true.
+ maine_coon_default:
+ The default value of 'mainecoon' option.
+ == Thanks ==
+ snaka72 (hidechrome part):
+ http://vimperator.g.hatena.ne.jp/snaka72/20090106/1231262955
]]>
normal
+ == Options ==
+ mainecoon:
+ 以下の文字の組み合わせを指定します。
+ c:
+ キャプションバーを隠す
+ a:
+ 自動でコマンドラインを隠す
+ f:
+ フルスクリーン
+ "c" と "f" の併用は意味がありません。
== Global Variables ==
maine_coon_targets:
- 他の非表示にしたい要素のIDを空白区切りで指定します。
- let g:maine_coon_targets = "sidebar-2 sidebar-2-splitter"
- maine_coon_auto_hide:
- "true" / "false"
- true のとき、自動的にコマンドラインを隠す。
+ フルスクリーン時にの非表示にしたい要素のIDを空白区切りで指定します。
+ >||
+ let g:maine_coon_targets = "sidebar-2 sidebar-2-splitter"
+ ||<
+ maine_coon_default:
+ オプションのデフォルト値を設定します。
+ == Thanks ==
+ snaka72 (hidechrome part):
+ http://vimperator.g.hatena.ne.jp/snaka72/20090106/1231262955
]]>
;
@@ -75,7 +94,8 @@ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/)
(function () {
- let autoHideCommandLine = s2b(liberator.globalVariables.maine_coon_auto_hide || '', true);
+ let mainWindow = document.getElementById('main-window');
+ let messageBox = document.getElementById('liberator-message');
function around (obj, name, func) {
let next = obj[name];
@@ -86,24 +106,7 @@ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/)
args);
}
- function s2b (s, d) (!/^(\d+|false)$/i.test(s)|parseInt(s)|!!d*2)&1<= 0);
+
+ if (has('f')) {
+ hideChrome(false);
+ delay(function () setFullscreen(true));
+ } else if (has('c')) {
+ setFullscreen(false);
+ delay(function () hideChrome(true));
+ } else {
+ hideChrome(false);
+ delay(function () setFullscreen(false));
+ }
+ setAutoHideCommandLine(has('a'));
+
+ return value;
+ },
+ completer: function (context, args) {
+ context.title = ['Value', 'Description'];
+ context.completions = [
+ ['c', 'Hide caption bar'],
+ ['f', 'Fullscreen'],
+ ['a', 'Hide automatically command-line'],
+ ];
+ },
+ validater: function (value) /^[cfa]*$/.test(value)
+ }
+ );
+ // XXX obsolete
commands.addUserCommand(
['fullscreen', 'fs'],
'Toggle fullscreen mode',
- function () {
- let hide = !window.fullScreen;
- window.fullScreen = hide;
- setTimeout(function () {
- hideTargets(hide);
- document.getElementById('status-bar').setAttribute('moz-collapsed', false);
- document.getElementById('navigator-toolbox').collapsed = hide;
- if (!hide)
- window.maximize();
- }, 400);
- },
+ function () setFullscreen(!window.fullScreen),
{},
true
);
--
cgit v1.2.3