From 520f9967791bd7b8ec4597aa560745856e39557e Mon Sep 17 00:00:00 2001 From: drry Date: Sat, 1 Nov 2008 22:41:17 +0000 Subject: * fixed a regex. * et cetera. git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22556 d0d07461-0603-4401-acd4-de1884942a52 --- commandBookmarklet.js | 2 +- localkeymode.js | 166 +++++++++++++++++++++++++------------------------- 2 files changed, 84 insertions(+), 84 deletions(-) diff --git a/commandBookmarklet.js b/commandBookmarklet.js index 0f71a44..6ecc2d0 100644 --- a/commandBookmarklet.js +++ b/commandBookmarklet.js @@ -21,7 +21,7 @@ var [url, title] = item; var desc = title; title = escape( title.replace(/ +/g,'').toLowerCase() ); - if (title.match(/[^a-zA-Z]+/)) { + if (/[^a-zA-Z]+/.test(title)) { title = "bm"+title.replace(/[^a-zA-Z]+/g,''); title = title.substr(0, title.length>50?50:title.length); } diff --git a/localkeymode.js b/localkeymode.js index c6c26eb..bc93ac1 100644 --- a/localkeymode.js +++ b/localkeymode.js @@ -11,15 +11,15 @@ * :togglelocalkeymode - 有効/無効のトグルです。(ステータスバーのアイコンクリックでも切り替え可能) * :loadkeymaps - 任意のキーマップの読み込みを行う * :clearkeymaps - loadkeymaps の読み込みを無効にする - * + * * .vimperatorrc * g:localkeymode_enable : [true=有効/false=無効(デフォルト)] * * .vimperatorrrc 設定例: * let g:localkeymode_enable = "true" * javascript < [Delete KeyMap]\n"; + self.helpstring += key+' -> [Delete KeyMap]\n'; mappings.remove( modes.NORMAL, key); } ); keymaps.keys.forEach( function( m ) { @@ -219,16 +219,16 @@ liberator.plugins.LocalKeyMode = (function(){ if (org) self.storekeymaps.push( cloneMap(org) ); else self.delkeychars.push( key ); } ); - mappings.addUserMap([modes.NORMAL], m.names, m.description, m.action, - {flags:m.flags, rhs: m.rhs, noremap: m.noremap }); - self.helpstring += m.names+" -> "+m.rhs+"\n"; + mappings.addUserMap([modes.NORMAL], m.names, m.description, m.action, + {flags:m.flags, rhs:m.rhs, noremap:m.noremap }); + self.helpstring += m.names+' -> '+m.rhs+'\n'; } ); this.isBinding = true; }, - deleteCurrentTabCache: function(){ + deleteCurrentTabCache: function() { var tabId = getBrowser().selectedTab.linkedPanel; var tabinfo = this.tabinfo; - for (var i=0; i0) return; - this.helpstring = ""; + this.helpstring = ''; if (this.isBinding) this.restoreKeyMap(); if (!this.isEnable) { this.clearTabCache(); @@ -248,15 +248,15 @@ liberator.plugins.LocalKeyMode = (function(){ var tabinfo = this.tabinfo; var settings = this.localkeymaps; var tabId = getBrowser().selectedTab.linkedPanel; - for (var i=0, l=tabinfo.length; i