From 8aab6c4290cdca7a0feefbd346b3fc19495c847e Mon Sep 17 00:00:00 2001 From: seenxu Date: Wed, 3 Apr 2013 18:26:25 +0300 Subject: remove hover link feature reasons for the feature removal: * Firefox has a similar built-in feature * U.xmlToDom fails to append element to the page bottom * if there are too many links on page, append to DOM thing hurts performance. Conflicts: maine_coon.js --- maine_coon.js | 257 ++++++++++++++-------------------------------------------- 1 file changed, 62 insertions(+), 195 deletions(-) (limited to 'maine_coon.js') diff --git a/maine_coon.js b/maine_coon.js index af4ff57..b71b059 100644 --- a/maine_coon.js +++ b/maine_coon.js @@ -32,114 +32,65 @@ THE POSSIBILITY OF SUCH DAMAGE. */ -let PLUGIN_INFO = xml` - - Maine Coon - メインクーン - Make the screen larger - なるべくでかい画面で使えるように - 2.6.5 - anekos - 3.0 - https://github.com/vimpr/vimperator-plugins/raw/master/maine_coon.js - new BSD License (Please read the source code comments of this plugin) - 修正BSDライセンス (ソースコードのコメントを参照してください) - || - :set mainecoon=ac - ||< - The default value of this option is "amu". - === note === - The C and c options probably are supported on some OSs only. - == Global Variables == - maine_coon_targets: - Other elements IDs that you want to hide. - let g:maine_coon_targets = "sidebar-2 sidebar-2-splitter" - maine_coon_default: - The default value of 'mainecoon' option. - >|| - 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;" - ||< - == Thanks == - snaka72 (hidechrome part): - http://vimperator.g.hatena.ne.jp/snaka72/20090106/1231262955 - == Maine Coon == - http://en.wikipedia.org/wiki/Maine_Coon - ]]> - || - :set mainecoon=ac - ||< - デフォルト値は "amu" - === 備考 === - C c オプションはいくつかの OS でのみ有効です。多分。 - == Global Variables == - maine_coon_targets: - フルスクリーン時にの非表示にしたい要素のIDを空白区切りで指定します。 - >|| +var INFO = xml ` + + anekos + BSD + +

+ || + :set mainecoon=ac + ||< + The default value of this option is "amu". + === note === + The C and c options probably are supported on some OSs only. + == Global Variables == + maine_coon_targets: + Other elements IDs that you want to hide. let g:maine_coon_targets = "sidebar-2 sidebar-2-splitter" - ||< - maine_coon_default: - オプションのデフォルト値を設定します。 - >|| - 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;" - ||< - == Thanks == - snaka72 (hidechrome part): - http://vimperator.g.hatena.ne.jp/snaka72/20090106/1231262955 - == メインクーン == - http://ja.wikipedia.org/wiki/%E3%83%A1%E3%82%A4%E3%83%B3%E3%82%AF%E3%83%BC%E3%83%B3 - ]]> -`; + maine_coon_default: + The default value of 'mainecoon' option. + >|| + 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;" + ||< + == Thanks == + * snaka72 (hidechrome part): + http://vimperator.g.hatena.ne.jp/snaka72/20090106/1231262955 + * seenxu + make maine_coon.js works with vimperator 3.6.1) + == Maine Coon == + http://en.wikipedia.org/wiki/Maine_Coon + ]]> +

+
`; (function () { @@ -168,7 +119,6 @@ let PLUGIN_INFO = xml` }) ); - function s2b (s, d) !!((!/^(\d+|false)$/i.test(s)|parseInt(s)|!!d*2)&1<${message}`, doc); - doc.body.appendChild(elem); - let count = time; - let handle = setInterval(function () { - try { - if (count <= 0) { - if (remove) - remove(); - } else { - elem.style.MozOpacity = count / time; - } - count--; - } catch (e) { // XXX ほんとは DOM 関連だけキャッチしたい - remove(true); - liberator.log(e); - } - }, 100); - remove = function (noDOM) { - if (!noDOM) - doc.body.removeChild(elem); - clearInterval(handle); - remove = null; - }; - }; - })(); - let setAutoHideCommandLine = (function () { let hiddenNodes = []; @@ -325,7 +223,8 @@ let PLUGIN_INFO = xml` } } else { bottomBar.collapsed = false; - hiddenNodes.forEach(function ([c, v, d]) [c.collapsed, c.style.display] = [v, d]); + hiddenNodes.forEach( + function ([c, v, d]) [c.collapsed, c.style.display] = [v, d]); } } })(); @@ -343,7 +242,6 @@ let PLUGIN_INFO = xml` function focusToCommandline () commandlineBox.inputField.focus(); - let useEcho = false; let autoHideCommandLine = false; let displayURL = true; @@ -366,27 +264,6 @@ let PLUGIN_INFO = xml` ); } - - { - let last; - messageBox.watch('value', function (name, oldValue, newValue) { - try { - if (autoHideCommandLine - && useEcho - && /\S/.test(newValue) - && messageBox.collapsed - && last != newValue - && newValue != 'Press ENTER or type command to continue') { - echo(newValue); - } - } catch (e) { - liberator.reportError(e); - } - last = newValue; - return newValue; - }); - } - U.around(commandline, 'input', function (next, args) { let result = next(); inputting = true; @@ -410,7 +287,8 @@ let PLUGIN_INFO = xml` U.around(commandline._callbacks.submit, modes.EX, function (next, args) { let r = next(); - if (autoHideCommandLine && !inputting && !(modes.extended & modes.OUTPUT_MULTILINE)) + if (autoHideCommandLine && !inputting && !( + modes.extended & modes.OUTPUT_MULTILINE)) commandline.close(); return r; }, true); @@ -427,17 +305,6 @@ let PLUGIN_INFO = xml` U.around(commandline._callbacks.cancel, modes.PROMPT, callback, true); } - events.addSessionListener( - document.getElementById("appcontent"), - "DOMContentLoaded", - function (event) { - let doc = event.originalTarget; - if (doc instanceof HTMLDocument && !doc.defaultView.frameElement && displayURL) - echo(doc.location.href); - }, - true - ); - options.add( ['mainecoon'], 'Make big screen like a Maine Coon', -- cgit v1.2.3