aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cookie.js11
-rw-r--r--ubiquity.js22
-rw-r--r--walk-input.js8
3 files changed, 20 insertions, 21 deletions
diff --git a/cookie.js b/cookie.js
index 9ff8c0a..3ec462e 100644
--- a/cookie.js
+++ b/cookie.js
@@ -1,4 +1,4 @@
-/**
+/*
* ==VimperatorPlugin==
* @name cookie.js
* @description display cookie in ':pageinfo'.
@@ -68,7 +68,7 @@ CookieManager.prototype = {
},
_deserializeCookie: function (cookieString) {
- let cookies = cookieString.split(/; */);
+ let cookies = cookieString.split('; ');
let cookie = {};
let key, val;
for (let i=0, max=cookies.length ; i<max ; ++i) {
@@ -92,7 +92,7 @@ CookieManager.prototype = {
obj.key + '=' + obj.value,
'domain=' + obj.domain,
'expires=' + new Date(new Date().getTime() + obj.expires),
- ].join('; ');
+ ].join(';');
this._setCookieString(string);
},
};
@@ -101,8 +101,7 @@ liberator.modules.buffer.addPageInfoSection(
'c',
'Cookie',
function (verbose) {
- if(verbose) {
- let p;
+ if (verbose) {
let c = new CookieManager(liberator.modules.buffer.URL);
for ([, p] in Iterator(c.properties())) {
yield [p, c.getCookie(p)];
@@ -111,6 +110,6 @@ liberator.modules.buffer.addPageInfoSection(
}
);
-})();
+})()
// vim: set sw=4 ts=4 et;
diff --git a/ubiquity.js b/ubiquity.js
index 35c11b1..1947ec5 100644
--- a/ubiquity.js
+++ b/ubiquity.js
@@ -1,7 +1,7 @@
/**
* ==VimperatorPlugin==
* @name Ubiquity Glue
- * @description Vimperator-plugin for Ubiquity
+ * @description viperator-plugin for Ubiquity
* @depend Ubiquity (ubiquity@labs.mozilla.com)
* @version 0.1.1a
* ==/VimperatorPlugin==
@@ -32,14 +32,14 @@ if (!Application.extensions.has(ubiquityID) || !Application.extensions.get(ubiqu
Components.utils.reportError('Vimperator: UbiquityGlue: Ubiquity is not installed');
return null;
}
-function preExec(target, name, func){
+function preExec(target,name,func){
var original = target[name];
target[name] = function(){
- var result = func.apply(this, arguments);
+ var result = func.apply(this,arguments);
var tmp = null;
- if (result != false) tmp = original.apply(target, arguments);
+ if (result != false) tmp = original.apply(target,arguments);
return tmp;
- };
+ }
}
preExec(events, 'onEscape', function(){
@@ -55,7 +55,7 @@ preExec(commandline, 'open', function(){
// XXX:選択範囲が必要な操作が現状上手く動かない.不便であればコメントアウトしてください.
preExec(gUbiquity, 'openWindow', function(anchor, flag){
if(!flag) {
- liberator.commandline.open(':', 'ubiquity ', liberator.modes.EX);
+ commandline.open(':', 'ubiquity ', modes.EX);
return false;
}
});
@@ -63,7 +63,7 @@ preExec(gUbiquity, 'openWindow', function(anchor, flag){
// -------------------------------------------------
// Command
// -------------------------------------------------
-commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue',
+commands.addUserCommand(['ubi[quity]'],'Vimperator Ubiquity Glue',
function(args){
args = (typeof args.string == 'undefined') ? args: args.string;
if (!args){
@@ -71,7 +71,7 @@ commands.addUserCommand(['ubi[quity]'], 'Vimperator Ubiquity Glue',
return;
}
ubiquityManager.execute(args);
- }, {
+ },{
completer: function(filter){
return ubiquityManager.completer(filter);
}
@@ -110,10 +110,10 @@ var ubiquityManager = {
}
},
completer: function(args){
- var matches = args.match(/(\S+)(?:\s+(.+)$)?/);
+ var matches = args.match(/([^\s]+)(?:\s+(.+)$)?/);
var suggestions = [];
- for (let cmd in this.commands){
- suggestions.push([cmd, this.commands[cmd].description]);
+ for (var cmd in this.commands){
+ suggestions.push([cmd , this.commands[cmd].description]);
}
if (!matches){
return [0, suggestions];
diff --git a/walk-input.js b/walk-input.js
index ee7695a..eb0b8ea 100644
--- a/walk-input.js
+++ b/walk-input.js
@@ -31,7 +31,7 @@ var walkinput = function(forward) {
var current = null;
var next = null;
var prev = null;
- for (let i = 0, l = list.snapshotLength; i < l; ++i) {
+ for (let i = 0; i < list.snapshotLength; ++i) {
let e = list.snapshotItem(i);
if (e == focused) {
current = e;
@@ -43,13 +43,13 @@ var walkinput = function(forward) {
}
if (forward) {
- (next || list.snapshotItem(0)).focus();
+ (next || list.snapshotItem(0)).focus();
} else {
- (prev || list.snapshotItem(list.snapshotLength - 1)).focus();
+ (prev || list.snapshotItem(list.snapshotLength - 1)).focus();
}
};
-mappings.add([modes.NORMAL, modes.INSERT], ['<M-i>', '<A-i>'],
+mappings.add([modes.NORMAL, modes.INSERT], ['<M-i>', '<A-i>'],
'Walk Input Fields (Forward)', function () walkinput(true));
mappings.add([modes.NORMAL, modes.INSERT], ['<M-I>', '<A-I>'],
'Walk Input Fields (Backward)', function () walkinput(false));