aboutsummaryrefslogtreecommitdiffstats
path: root/maine_coon.js
diff options
context:
space:
mode:
authoranekos2010-03-09 16:13:24 +0000
committeranekos2010-03-09 16:13:24 +0000
commit61c97d4940148ab3590d016dcd1802a8177a238b (patch)
treea47812165fabbf0d081fd0a3d8c0414f68f188fa /maine_coon.js
parentf087f3d759aab5a7ce40da89147dd192e8f52ff8 (diff)
downloadvimperator-plugins-61c97d4940148ab3590d016dcd1802a8177a238b.tar.bz2
スタイルを設定可能に
参考パッチ: http://gist.github.com/326704 ましろさん Thanks! git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36977 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'maine_coon.js')
-rw-r--r--maine_coon.js61
1 files changed, 41 insertions, 20 deletions
diff --git a/maine_coon.js b/maine_coon.js
index 5374438..1467023 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.3.2</version>
+ <version>2.4.0</version>
<author mail="anekos@snca.net" homepage="http://d.hatena.ne.jp/nokturnalmortum/">anekos</author>
<minVersion>2.3</minVersion>
<maxVersion>2.3</maxVersion>
@@ -80,6 +80,11 @@ let PLUGIN_INFO =
>||
let g:maine_coon_default = "ac"
||<
+ maine_coon_style:
+ The Style for message output.
+ >||
+ let g:maine_coon_style = "border: 1px solid pink; padding: 3px; color: pink; background: black; font: 18px/1 sans-serif;"
+ ||<
== Example ==
=== The mapping for large mode (l) ===
>||
@@ -129,6 +134,11 @@ let PLUGIN_INFO =
>||
let g:maine_coon_default = "ac"
||<
+ maine_coon_style:
+ メッセージ表示のスタイル指定です。
+ >||
+ let g:maine_coon_style = "border: 1px solid pink; padding: 3px; color: pink; background: black; font: 18px/1 sans-serif;"
+ ||<
== Example ==
=== ラージモード(l) 用のマッピング ===
>||
@@ -143,6 +153,24 @@ let PLUGIN_INFO =
</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 () {
@@ -243,33 +271,26 @@ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/)
if (remove)
remove();
let doc = window.content.document;
- let style = highlight.get('StatusLine').value +
- U.toStyleText({
- position: 'fixed',
- zIndex: 1000,
- left: 0,
- bottom: 0,
- opacity: 1,
- 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'
- });
+ let style =
+ highlight.get('StatusLine').value +
+ U.toStyleText({
+ position: 'fixed',
+ zIndex: 1000,
+ left: 0,
+ bottom: 0,
+ opacity: 1
+ }) +
+ elemStyle;
let elem = U.xmlToDom(<div id="liberator_maine_coon" style={style}>{message}</div>, doc);
doc.body.appendChild(elem);
let count = time;
+ let startOpacity = elem.style.opacity
let handle = setInterval(function () {
if (count <= 0) {
if (remove)
remove();
} else {
- elem.style.opacity = count / time;
+ elem.style.opacity = (count / time) * startOpacity;
}
count--;
}, 100);