From 61c97d4940148ab3590d016dcd1802a8177a238b Mon Sep 17 00:00:00 2001
From: anekos
Date: Tue, 9 Mar 2010 16:13:24 +0000
Subject: スタイルを設定可能に
参考パッチ: 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
---
maine_coon.js | 61 +++++++++++++++++++++++++++++++++++++++--------------------
1 file 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 =
メインクーン
Make the screen larger
なるべくでかい画面で使えるように
- 2.3.2
+ 2.4.0
anekos
2.3
2.3
@@ -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 =
;
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(
{message}
, 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);
--
cgit v1.2.3