From 1267cee65a4bad8a3468ad8d72c1e48424fa49ec Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Thu, 18 Jun 2015 23:26:19 -0400 Subject: delete vimperator dots, as I don't use it anymore --- vimperator/.vimperator/plugin/PDF.js.js | 250 ----------------------------- vimperator/.vimperator/plugin/_smooziee.js | 171 -------------------- 2 files changed, 421 deletions(-) delete mode 100644 vimperator/.vimperator/plugin/PDF.js.js delete mode 100644 vimperator/.vimperator/plugin/_smooziee.js (limited to 'vimperator/.vimperator/plugin') diff --git a/vimperator/.vimperator/plugin/PDF.js.js b/vimperator/.vimperator/plugin/PDF.js.js deleted file mode 100644 index 0f04981..0000000 --- a/vimperator/.vimperator/plugin/PDF.js.js +++ /dev/null @@ -1,250 +0,0 @@ -/* NEW BSD LICENSE {{{ -Copyright (c) 2012, anekos. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - 3. The names of the authors may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. - - -################################################################################### -# http://sourceforge.jp/projects/opensource/wiki/licenses%2Fnew_BSD_license # -# に参考になる日本語訳がありますが、有効なのは上記英文となります。 # -################################################################################### - -}}} */ - -// INFO {{{ -let INFO = xml` - - anekos - New BSD License - -

- - :pdfjs-mapping-sample -

mapping sample

pdfjs index - nnoremap -urls ^\\.pdf$ z :pdfjs zoom - ]]>
-
-
`; -// }}} - -(function () { - - let scrollCount = 1; - - // Functions {{{ - - function getScrollHeight (count) { - let base = content.innerHeight / 10; - if (count > 0) - scrollCount = count; - return base * scrollCount; - } - - function addMap (keys, desc, action) { - mappings.addUserMap( - [modes.NORMAL], - keys, - desc + ' - PDF.js.js', - action, - { - count: true, - matchingUrls: /\.pdf$/ - } - ); - } - - function getOutline () { - return Array.slice(content.document.querySelector('#outlineView').querySelectorAll('.outlineItem > a')); - } - - function getOutlineLevel (node) { - let level = 0; - while (node && (node.getAttribute('id') != 'outlineView')) { - node = node.parentNode; - level++; - } - return node ? (level / 2): 0; - } - - function nSpace (level) { - let res = ''; - for (i = 0; i < level; i++) - res += ' '; - return res; - } - - // }}} - - // Mappings {{{ - - addMap( - ['j'], - 'Scroll Down', - function (count) { - content.document.querySelector('#viewerContainer').scrollTop += getScrollHeight(count); - } - ); - - addMap( - ['k'], - 'Scroll up', - function (count) { - content.document.querySelector('#viewerContainer').scrollTop -= getScrollHeight(count); - } - ); - - addMap( - ['n'], - 'Next page', - function (count) { - content.window.wrappedJSObject.PDFView.page += (count > 0 ? count : 1); - } - ); - - addMap( - ['p'], - 'Previous page', - function (count) { - content.window.wrappedJSObject.PDFView.page -= (count > 0 ? count : 1); - } - ); - - addMap( - ['gg'], - 'Go to page top or N page.', - function (count) { - if (count > 0) - content.window.wrappedJSObject.PDFView.page = count; - else - content.window.wrappedJSObject.PDFView.page = 1; - } - ); - - addMap( - ['zh'], - 'Fit to page.', - function (count) { - liberator.execute('pdfjs zoom page-fit'); - } - ); - - addMap( - ['zw'], - 'Fit to page to width.', - function (count) { - liberator.execute('pdfjs zoom page-width'); - } - ); - - addMap( - ['za'], - 'Fit to page to width.', - function (count) { - liberator.execute('pdfjs zoom auto'); - } - ); - - addMap( - ['zz'], - 'Fit to page to width.', - function (count) { - commandline.open('', 'pdfjs zoom ', modes.EX); - } - ); - - // }}} - - commands.addUserCommand( // {{{ - ['pdfjs'], - 'PDF.js', - function () void 'Meow is best', - { - subCommands: [ - new Command( - ['i[ndex]'], - 'Jump page by index', - function (args) { - let index = args.literalArg.match(/^#(\d+)$/); - if (index) { - let os = getOutline(); - buffer.followLink(os[parseInt(index[1], 10)], liberator.CURRENT_TAB); - } else { - content.window.wrappedJSObject.PDFView.page = parseInt(args.literalArg, 10); - } - }, - { - literal: 0, - completer: function (context, args) { - function desc (o) { - const PageRE = /#page=(\d+)\&/; - if (o.href && PageRE.test(o.href)) { - return `${nSpace(getOutlineLevel(o))} ${o.textContent} (p${o.href.match(PageRE)[1]})`; - } else { - return `${nSpace(getOutlineLevel(o))} ${o.textContent}`; - } - } - - let os = getOutline(); - context.compare = void 0; - context.filters = [CompletionContext.Filter.textDescription]; - context.completions = [ - [ - '#' + i, desc(o) - ] - for ([i, o] in Iterator(os)) - ]; - } - } - ), - - new Command( - ['z[oom]'], - 'Zoom', - function (args) { - content.window.wrappedJSObject.PDFView.parseScale(args.literalArg); - }, - { - literal: 0, - completer: function (context, args) { - let os = Array.slice(content.document.querySelector('#scaleSelect').querySelectorAll('option')); - context.completions = [ - [o.value, o.textContent] - for ([, o] in Iterator(os)) - ]; - } - } - ) - ] - }, - true - ); // }}} - -})(); - -// vim:sw=2 ts=2 et si fdm=marker: diff --git a/vimperator/.vimperator/plugin/_smooziee.js b/vimperator/.vimperator/plugin/_smooziee.js deleted file mode 100644 index a8af10d..0000000 --- a/vimperator/.vimperator/plugin/_smooziee.js +++ /dev/null @@ -1,171 +0,0 @@ -// -// _smooziee.js -// -// LICENSE: {{{ -// Copyright (c) 2009 snaka -// -// distributable under the terms of an MIT-style license. -// http://www.opensource.jp/licenses/mit-license.html -// }}} -// -// INFO: {{{ -var INFO = xml` - - snaka - - MIT style license -

j,k key scrolling to be smoothly.

-

Global vriables

-

You can configure following variable as you like.

-
-
smooziee_scroll_amount
Scrolling amount(unit:px). Default value is 400px.
-
smooziee_interval
Scrolling interval(unit:ms). Default value is 20ms.
-
-

Example

-

Set scroll amount is 300px and interval is 10ms.

- -

API

- smooziee.smoothScrollBy(amount); -

Example

- -
- - snaka - - MIT style license -

普段のj,kキーのスクロールをLDRizeライクにスムースにします。

-

グローバル変数

-

以下の変数を.vimperatorrcなどで設定することで動作を調整することができます。

-
-
smooziee_scroll_amount
-
1回にスクロールする幅です(単位:ピクセル)。デフォルトは"400"です。
-
smooziee_interval
-
スクロール時のアニメーションのインターバルです(単位:ミリ秒)。 - "1"以上の値を設定します。デフォルトは"20"です。
-
-

設定例

-

スクロール量を300pxに、インターバルを10msに設定します。

- -

API

-

他のキーにマップする場合やスクリプトから呼び出せるようAPIを用意してます。

- smooziee.smoothScrollBy(amount); -

Example

- -

ToDo

-
    -
  • 読み込みの順番によっては他のプラグインと競合する可能性があるのをなんとかしたい。
  • -
-
`; -// }}} - -let self = liberator.plugins.smooziee = (function(){ - - // Mappings {{{ -/* mappings.addUserMap( - [modes.NORMAL], - ["j"], - "Smooth scroll down", - function(count){ - self.smoothScrollBy(getScrollAmount() * (count || 1)); - }, - { - count: true - } - ); - mappings.addUserMap( - [modes.NORMAL], - ["k"], - "Smooth scroll up", - function(count){ - self.smoothScrollBy(getScrollAmount() * -(count || 1)); - }, - { - count: true - } - ); -*/ - - mappings.addUserMap( - [modes.NORMAL], - ["d"], - "Smooth scroll down page", - function(count){ - self.smoothScrollBy(getScrollAmount() * 3.5 * (count || 1)); - }, - { - count: true - } - ); - mappings.addUserMap( - [modes.NORMAL], - ["u"], - "Smooth scroll up page", - function(count){ - self.smoothScrollBy(getScrollAmount() * 3.5 * -(count || 1)); - }, - { - count: true - } - ); - // }}} - // PUBLIC {{{ - var PUBLICS = { - smoothScrollBy: function(moment) { - win = Buffer.findScrollableWindow(); - interval = window.eval(liberator.globalVariables.smooziee_scroll_interval || '20'); - destY = win.scrollY + moment; - clearTimeout(next); - smoothScroll(moment); - } - } - - // }}} - // PRIVATE {{{ - var next; - var destY; - var win; - var interval; - - function getScrollAmount() window.eval(liberator.globalVariables.smooziee_scroll_amount || '400'); - - function smoothScroll(moment) { - if (moment > 0) - moment = Math.floor(moment / 2); - else - moment = Math.ceil(moment / 2); - - win.scrollBy(0, moment); - - if (Math.abs(moment) < 1) { - setTimeout(makeScrollTo(win.scrollX, destY), interval); - destY = null; - return; - } - next = setTimeout(function() smoothScroll(moment), interval); - } - - function makeScrollTo(x, y) function() win.scrollTo(x, y); - // }}} - return PUBLICS; -})(); -// vim: sw=2 ts=2 et si fdm=marker: -- cgit v1.2.3-60-g2f50