diff options
-rw-r--r-- | char-hints-mod2.js | 12 | ||||
-rw-r--r-- | garbage_finder.js | 11 | ||||
-rw-r--r-- | i_love_echo.js | 42 | ||||
-rw-r--r-- | ldrize_cooperation.js | 142 | ||||
-rw-r--r-- | localkeymode.js | 14 | ||||
-rw-r--r-- | maine_coon.js | 10 | ||||
-rw-r--r-- | mouse_gestures.js | 52 | ||||
-rw-r--r-- | notifier.js | 2 | ||||
-rw-r--r-- | notifier/observer_growl.js | 2 | ||||
-rw-r--r-- | peekpage.js | 6 | ||||
-rw-r--r-- | tinyurl.js | 14 | ||||
-rw-r--r-- | toggler.js | 7 |
12 files changed, 152 insertions, 162 deletions
diff --git a/char-hints-mod2.js b/char-hints-mod2.js index fcd2ec5..c44b40e 100644 --- a/char-hints-mod2.js +++ b/char-hints-mod2.js @@ -19,7 +19,7 @@ select charhint label in uppercase. == SETTING ==
let g:hinstchars:
set character used by char-hint.
- ex)
+ e.g.)
let g:hinstchars="hjkl"
let g:hintsio:
- "i" setting char-hint input lowercase.
@@ -27,7 +27,7 @@ let g:hintsio: - "o" setting char-hint show lowercase.
- "O" setting char-hint show uppercase.
Default setting is "IO".
- ex)
+ e.g.)
let g:histsio="i"
== TODO ==
@@ -41,7 +41,7 @@ let g:hintsio: == SETTING ==
let g:hinstchars:
set character used by char-hint.
- ex)
+ e.g.)
let g:hinstchars="hjkl"
let g:hintsio:
- "i" setting char-hint input lowercase.
@@ -49,7 +49,7 @@ let g:hintsio: - "o" setting char-hint show lowercase.
- "O" setting char-hint show uppercase.
Default setting is "IO".
- ex)
+ e.g.)
let g:histsio="i"
== TODO ==
@@ -203,9 +203,7 @@ let g:hintsio: liberator.execute(":hi Hint::after content: attr(hintchar)");
if(liberator.globalVariables.hintsio) {
let hintsio = liberator.globalVariables.hintsio;
- for(let i=0,l=hintsio.length;i<l;++i) {
- setIOType(hintsio[i]);
- }
+ for(let i=hintsio.length;i-->0;setIOType(hintsio[i]));
}
if(liberator.globalVariables.hintchars) {
hintchars = liberator.globalVariables.hintchars;
diff --git a/garbage_finder.js b/garbage_finder.js index 0a40630..1bec2d1 100644 --- a/garbage_finder.js +++ b/garbage_finder.js @@ -48,7 +48,7 @@ let PLUGIN_INFO = <detail><![CDATA[ == Commands == :garbages: - Display (removed|appended) variables. + Displays (removed|appended) variables. ]]></detail> <detail lang="ja"><![CDATA[ 前回(Firefox)起動時の window オブジェクトにおける変数と、現在のそれの差分を取ります。 @@ -83,7 +83,7 @@ let PLUGIN_INFO = function diff (oldList, newList) { function sub (n, o) - n.filter(function (it) !has(o, it)) + n.filter(function (it) !has(o, it)); return { appended: ignore(sub(newList, oldList)), removed: ignore(sub(oldList, newList)) @@ -111,17 +111,16 @@ let PLUGIN_INFO = commands.addUserCommand( ['garbages'], - 'Display garbages', + 'Displays garbages', function (args) { function makeLI (list) { if (list.length) { let result = <></>; list.forEach(function (it) (result += <li>{it}</li>)); return <ol>{result}</ol>; - } else { - // XXX 駄目くさいけどめんどくさいので… - return <ol>Nothing</ol>; } + // XXX 駄目くさいけどめんどくさいので… + return <ol>Nothing</ol>; } if (args.bang) { diff --git a/i_love_echo.js b/i_love_echo.js index 1a06b55..b7fbf0e 100644 --- a/i_love_echo.js +++ b/i_love_echo.js @@ -67,7 +67,7 @@ function $(arg){ //{{{ return new $o(arg); } } //}}} -liberator.modules.$f = (function () { //{{{ +liberator.modules.$f = (function(){ //{{{ const pests = [ '__defineGetter__', '__defineSetter__', 'hasOwnProperty', 'isPrototypeOf', '__lookupGetter__', '__lookupSetter__', '__parent__', 'propertyIsEnumerable', @@ -78,23 +78,23 @@ liberator.modules.$f = (function () { //{{{ value; function memfn(parent) - function (name,args) + function(name,args) FFF(function(self) let (s = parent(self)) let (f = s[name]) (f instanceof Function ? s[name].apply(s, args) : f)); function mem(parent) - function (name) + function(name) FFF(function(self) parent(self)[name]); - function FFF(parent) { - parent.__noSuchMethod__ = memfn(parent) + function FFF(parent){ + parent.__noSuchMethod__ = memfn(parent); parent.m = {__noSuchMethod__: mem(parent)}; pests.forEach(function(it) (parent[it] = function() parent.__noSuchMethod__(it, arguments))); return parent; - }; + } return FFF(id); })(); //}}} @@ -202,7 +202,7 @@ createPrototype($s, { var s = [i < hash.length ? toHexString(hash.charCodeAt(i)) : "" for (i in hash)].join(""); return $(s); }, - s: function(from, to) $(this.value.replace(from,to)), + s: function(from, to) $(this.value.replace(from, to)), split: function(reg) $(this.value.split(reg)), get toJSON(){ var json; @@ -213,13 +213,13 @@ createPrototype($s, { return null; } }, - evaluate: function(doc,context){ + evaluate: function(doc, context){ if (!doc) doc = content.document; if (!context) context = doc; var result = []; var nodes = doc.evaluate(this.value, context, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); var node; - while (node = nodes.iterateNext()) { + while (node = nodes.iterateNext()){ result.push(node); } return $(result); @@ -251,7 +251,7 @@ createPrototype($a, { return this; }, get first() $(this.value[0]), - get last() $(this.value[this.length - 1]), + get last() $(this.value[this.length - 1]) }); // }}} @@ -310,7 +310,7 @@ createPrototype($o, { return $(json.encode(this.value)); } }); -if (DOMINSPECTOR){ createPrototype($o,{ inspect: function(){ inspectObject(this.value); return ""; } }); } +if (DOMINSPECTOR){ createPrototype($o, { inspect: function(){ inspectObject(this.value); return ""; } }); } // }}} // ----------------------------------------------------------------------------- @@ -403,7 +403,7 @@ createPrototype($xml, { }, // 2}}} }); if (DOMINSPECTOR){ - createPrototype($xml,{ + createPrototype($xml, { inspect: function(){ if (this.value instanceof Document) inspectDOMDocument(this.value); @@ -426,12 +426,12 @@ function $xhr(url, method, user, password, xhr){ this.success = null; } $xhr.prototype = { - open: function(url,user,password){ + open: function(url, user, password){ if (this.xhr.readyState != 0) return this; if (url) this.url = url; if (user) this.user = user; if (password) this.password = password; - this.xhr.open(this.method,this.url,false,this.user,this.password); + this.xhr.open(this.method, this.url, false, this.user, this.password); return this; }, setMIME: function(type, charset){ @@ -474,13 +474,13 @@ createPrototype($xhrResult, { return $(this.value.responseXML); } else if (this.value.getResponseHeader("Content-Type").indexOf("text/html") == 0){ let str = this.value.responseText. - replace(/^[\s\S]*?<html(?:\s[^>]*)?>|<\/html\s*>[\S\s]*$/ig,""). - replace(/[\r\n]+/g," "); - let htmlFragment = document.implementation.createDocument(null,"html",null); + replace(/^[\s\S]*?<html(?:[ \t\r\n][^>]*)?>|<\/html[ \t\n\t]*>[\S\s]*$/ig, ""). + replace(/[\r\n]+/g, " "); + let htmlFragment = document.implementation.createDocument(null, "html", null); //let range = window.content.document.createRange(); let range = document.getElementById("liberator-multiline-output").contentDocument.createRange(); range.setStartAfter(window.content.document.body); - htmlFragment.documentElement.appendChild(htmlFragment.importNode(range.createContextualFragment(str),true)); + htmlFragment.documentElement.appendChild(htmlFragment.importNode(range.createContextualFragment(str), true)); return $(htmlFragment); } else { return this.text; @@ -520,16 +520,16 @@ createPrototype($e4x, { }); // }}} -function createPrototype(class,obj){ +function createPrototype(class, obj){ var flag; for (let i in obj){ flag = false; if (obj.__lookupGetter__(i)){ - class.prototype.__defineGetter__(i,obj.__lookupGetter__(i)); + class.prototype.__defineGetter__(i, obj.__lookupGetter__(i)); flag = true; } if (obj.__lookupSetter__(i)){ - class..prototype.__defineSetter__(i,obj.__lookupSetter__(i)); + class..prototype.__defineSetter__(i, obj.__lookupSetter__(i)); flag = true; } if (!flag) class.prototype[i] = obj[i]; diff --git a/ldrize_cooperation.js b/ldrize_cooperation.js index 6a21459..7cbe5b0 100644 --- a/ldrize_cooperation.js +++ b/ldrize_cooperation.js @@ -64,61 +64,61 @@ (function(){
//pattern: wildcard
- //include: [regexp, option] or regexp
- //handler: [programPath, [args]] or programPath or function(url,title)
+ //include: [regexp,option] or regexp
+ //handler: [programPath,[args]] or programPath or function(url,title)
var handlerInfo = [
//{
- // pattern: 'http://www.nicovideo.jp/*',
- // handler: ['c:\\usr\\SmileDownloader\\SmileDownloader.exe',['%URL%']],
+ // pattern: "http://www.nicovideo.jp/*",
+ // handler: ["c:\\usr\\SmileDownloader\\SmileDownloader.exe",["%URL%"]],
// wait: 5000
//},
//{
- // handler: ['C:\\usr\\irvine\\irvine.exe',['%URL%']],
+ // handler: ["C:\\usr\\irvine\\irvine.exe",["%URL%"]],
//},
];
- const DISABLE_ICON = 'data:image/png;base64,'
- +'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAACXBIWXMAAA7E'
- +'AAAOxAGVKw4bAAACL0lEQVR4nF2Sy0tUYRjGf9+Z4/HMjJfjBUZEMM2MSDII'
- +'REjSVtVecBFZi6Bdi4RW/SFBq2oR0R8gSaUJhVJIBkEEMZOWl5kuM+fqnPN9'
- +'52sxQ4kPv837Pu+zel4xMjkz/3h5p87pbhyDw4o1mzUOkubYbvLo2kVx+4Pe'
- +'rAKMdTGQ5YgiWK/8z+QT3yyVUTFAzaBXHQ0IONPKOxepAH65dUOGSB/pM9LC'
- +'whjyy/sg4DB3TjGZbjVuVIihQhKfxGdzmzhhNBvGXhr7NDiRY+fr573ibmtC'
- +'4pN4GNJDukiXusvbIuMnh9K9YujSYKKPl6vrZu+EI5EuyheG9JEe0qPusfSR'
- +'4cGBbPA98og8LMlAPlor2ZEvVIT0kD6G9EhcEpfY58c+xbKYHBaRl4Ye432s'
- +'rqyo7pnQo/qTxEW62gy2CKoAbheu4mGGm5eHgsViOTh+5Sp37+2X4gJQC0gU'
- +'Otb0j2hhaCG06NfC0K22/radzs6uTM3ojY1SobDcdHNaCC2Mimn2YZmQggEd'
- +'kPJ0UczfyOzVWHr1xnVmrS5I0R6pgTC1mXdoUwB2Jj5QFvDsBc8fTCkpL82l'
- +'uW6rWWEPQBoL07JwCgAaywbgd8ynIrultTB3wWk73LtWdS3OXtd/fBwH2+Yg'
- +'xM4R14kqrzMZzM5pO9dcNlQrl832wTSoGiEok84eOrK0ZGB0+shTJYpyFUv7'
- +'In/s/LlbTyq+/ufZFlkTK4MhAJKUMCGs6x473rg/9xe9wS0xVA1n/AAAAABJ'
- +'RU5ErkJggg==';
- const ENABLE_ICON = 'data:image/png;base64,'
- +'iVB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dbjbUWZVkmpQQAEEJc1wX/EYZhHMdlWQIAKKV7cgPG+PLy8uPjg/+l3+/7"
+ +"vl/1KKVQURRCCABAFEVa6yAIOOeO41Tjj4+PoyiK49h1XSkl53xPbOCcz+fz"
+ +"bre7WCzYhpOTk+l0GoYhhFAIIaXck1JuNc/Pz51OpyiKahkAAMb49fVVCKGU"
+ +"qgTw4uKCUqq1RggZY05PT8uyTJJEa312dvby8rJcLq21y+WSUiqlhN1uN89z"
+ +"xpgxJs9zQkiv1xuNRlmWXV9f39/ff39/53meZRmllBCCZrNZkiTWWowxIWQ6"
+ +"nV5dXRFCGGOfn59PT0+MMWut67pa6/V6jZrNpjHGWus4TqPRsNaORqPBYCCE"
+ +"GI/Hvu/7vm+trc4KAEC+71dGQggrdyaTyXA4NMbc3NxsvW82mwCAoihQrVY7"
+ +"PDzctVYIEUXR29tbo9GAEO6WpJTO7e0tIQRjXK/XhRCe5ymlsiyDEAZB4Hle"
+ +"lawEX19fqNVqVS/kOE6r1fI8DyHU6XT++ShjzM/Pz8HBAXx/f+/3+9X2WmvO"
+ +"uVKq3GCMUUoxxlarVb1ef3h4+AWNW50eXTIBjgAAAABJRU5ErkJggg==";
var Class = function() function(){this.initialize.apply(this,arguments)};
var _isEnable;
- function replaceMap (mode, key, desc, aroundFunc, extra){
- var old = liberator.modules.mappings.getDefault(mode, key);
+ function replaceMap (mode,key,desc,aroundFunc,extra){
+ var old = liberator.modules.mappings.getDefault(mode,key);
var oldAction = old.action;
old.description = desc;
old.action = function()
- let (self = this, args = arguments)
- aroundFunc(function() oldAction.apply(self, args));
+ let (self = this,args = arguments)
+ aroundFunc(function() oldAction.apply(self,args));
}
var LDRizeCooperation = new Class();
@@ -137,7 +137,7 @@ window.eval(liberator.globalVariables.ldrc_intelligence_bind) : false ;
this.isModHints = liberator.globalVariables.ldrc_hints != undefined ?
window.eval(liberator.globalVariables.ldrc_hints) : false ;
- this.captureMappings = window.eval(liberator.globalVariables.ldrc_captureMappings) || ['j','k','p','o'];
+ this.captureMappings = window.eval(liberator.globalVariables.ldrc_captureMappings) || ["j","k","p","o"];
this.skipHeight = liberator.globalVariables.ldrc_skip != undefined ?
window.eval(liberator.globalVariables.ldrc_skip) : 0.5 ;
@@ -156,14 +156,14 @@ },
setupStatusbarPanel: function(){
var self = this;
- var LDRizeCooperationPanel = document.createElement('statusbarpanel');
- LDRizeCooperationPanel.setAttribute('id','ldrizecopperation-status');
- LDRizeCooperationPanel.setAttribute('class','statusbarpanel-iconic');
- LDRizeCooperationPanel.setAttribute('src',this.isEnable ? ENABLE_ICON : DISABLE_ICON);
+ var LDRizeCooperationPanel = document.createElement("statusbarpanel");
+ LDRizeCooperationPanel.setAttribute("id","ldrizecopperation-status");
+ LDRizeCooperationPanel.setAttribute("class","statusbarpanel-iconic");
+ LDRizeCooperationPanel.setAttribute("src",this.isEnable ? ENABLE_ICON : DISABLE_ICON);
LDRizeCooperationPanel.addEventListener("click",function(e){
self.isEnable = !self.isEnable;
},false);
- document.getElementById('status-bar').insertBefore(LDRizeCooperationPanel,document.getElementById('security-button').nextSibling);
+ document.getElementById("status-bar").insertBefore(LDRizeCooperationPanel,document.getElementById("security-button").nextSibling);
return LDRizeCooperationPanel;
},
@@ -172,7 +172,7 @@ var GreasemonkeyService;
try{
GreasemonkeyService = Cc["@greasemonkey.mozdev.org/greasemonkey-service;1"].getService().wrappedJSObject;
- this.addAfter(GreasemonkeyService,'evalInSandbox',function(code,codebase,sandbox){
+ this.addAfter(GreasemonkeyService,"evalInSandbox",function(code,codebase,sandbox){
if(sandbox.window.LDRize != undefined && sandbox.window.Minibuffer != undefined){
sandbox.window.addEventListener("focus",function(){
self.LDRize = liberator.eval("self",sandbox.LDRize.getSiteinfo);
@@ -195,8 +195,8 @@ var oldAction = map.action;
var getter = "getPrev";
switch(x){
- case 'j': getter = "getNext";
- case 'k': map.action = function(){
+ case "j": getter = "getNext";
+ case "k": map.action = function(){
self.isEnableLDRizeCooperation() ?
self.isIntelligenceBind && self.isScrollOrBind(getter) ?
oldAction.apply(this,arguments) // scroll
@@ -204,10 +204,10 @@ : oldAction.apply(this,arguments);
};
break;
- case 'J':
- case 'K': map.action = function(){
+ case "J":
+ case "K": map.action = function(){
self.isEnableLDRizeCooperation()
- ? self.sendRawKeyEvent(0, x.charCodeAt(0) + 32)
+ ? self.sendRawKeyEvent(0,x.charCodeAt(0) + 32)
: oldAction.apply(this,arguments);
};
break;
@@ -226,10 +226,10 @@ //Hints
[
["l","LDRize paragraphes",liberator.CURRENT_TAB],
- ["L","LDRize paragraphes (in a new tab", liberator.NEW_TAB]
+ ["L","LDRize paragraphes (in a new tab",liberator.NEW_TAB]
].forEach(function([mode,prompt,target]){
liberator.modules.hints.addMode(mode,prompt,
- function(elem) liberator.modules.buffer.followLink(elem, target),
+ function(elem) liberator.modules.buffer.followLink(elem,target),
function(){
var siteinfo = self.LDRize.getSiteinfo();
return siteinfo.paragraph + "/" + siteinfo.link;
@@ -238,19 +238,19 @@ });
//Commands
- liberator.modules.commands.addUserCommand(["pin"], "LDRize Pinned Links",
+ liberator.modules.commands.addUserCommand(["pin"],"LDRize Pinned Links",
function(){
var links = self.getPinnedItems();
var showString = links.length + " Items<br/>";
links.forEach(function(link){
showString += link + "<br/>";
});
- liberator.modules.commandline.echo(showString, liberator.modules.commandline.HL_NORMAL, liberator.modules.commandline.FORCE_MULTILINE);
+ liberator.modules.commandline.echo(showString,liberator.modules.commandline.HL_NORMAL,liberator.modules.commandline.FORCE_MULTILINE);
},{});
- liberator.modules.commands.addUserCommand(["mb","m","minibuffer"], "Execute Minibuffer",
- function(arg){ self.Minibuffer.execute(arg.string.replace(/\\/g,"")) },
+ liberator.modules.commands.addUserCommand(["mb","m","minibuffer"],"Execute Minibuffer",
+ function(arg){ self.Minibuffer.execute(arg.string.replace(/\\+/g,"")) },
{
- completer: function(context, arg, special){
+ completer: function(context,arg,special){
var filter = context.filter;
var completionList = [];
var command = self.Minibuffer.command;
@@ -259,22 +259,22 @@ var exp = new RegExp("^" + tokens.pop());
for(let i in command) if(exp.test(i))completionList.push([tokens.concat(i).join(" | "),"MinibufferCommand"]);
for(let i in alias) if(exp.test(i))completionList.push([i,"MinibufferAlias"]);
- context.title = ['Minibuffer Command', 'Description'];
+ context.title = ["Minibuffer Command","Description"];
context.completions = completionList;
}
});
- liberator.modules.commands.addUserCommand(["pindownload"], "Download pinned links by any software",
- function(arg){ self.downloadLinksByProgram(self.getPinnedItems());}, {});
- liberator.modules.commands.addUserCommand(["toggleldrizecooperation","toggleldrc"], "Toggle LDRize Cooperation",
- function(arg){ self.isEnable = !self.isEnable}, {});
+ liberator.modules.commands.addUserCommand(["pindownload"],"Download pinned links by any software",
+ function(arg){ self.downloadLinksByProgram(self.getPinnedItems());},{});
+ liberator.modules.commands.addUserCommand(["toggleldrizecooperation","toggleldrc"],"Toggle LDRize Cooperation",
+ function(arg){ self.isEnable = !self.isEnable},{});
//Options
- liberator.modules.options.add(['ldrc','ldrizecooperation'],'LDRize cooperation','boolean',this.isEnable,
+ liberator.modules.options.add(["ldrc","ldrizecooperation"],"LDRize cooperation","boolean",this.isEnable,
{
setter: function(value){ self.isEnable = value; },
getter: function() self.isEnable
}
);
- liberator.modules.options.add(['ldrchints'],'mod hinttags for LDRize','boolean',this.isModHints,
+ liberator.modules.options.add(["ldrchints"],"mod hinttags for LDRize","boolean",this.isModHints,
{
setter: function(value){ self.isModHints = value; },
getter: function() self.isModHints
@@ -303,11 +303,11 @@ //Pin
getPinnedItems: function(){
- var linkXpath = this.LDRize.getSiteinfo()['link'];
- var viewXpath = this.LDRize.getSiteinfo()['view'] || linkXpath + "/text()";
+ var linkXpath = this.LDRize.getSiteinfo()["link"];
+ var viewXpath = this.LDRize.getSiteinfo()["view"] || linkXpath + "/text()";
return this.LDRize.getPinnedItems().map(function(i){
- var linkResult = i.XPath(linkXpath), viewResult = i.XPath(viewXpath);
- return [linkResult, viewResult ? viewResult.textContent : null];
+ var linkResult = i.XPath(linkXpath),viewResult = i.XPath(viewXpath);
+ return [linkResult,viewResult ? viewResult.textContent : null];
});
},
downloadLinksByProgram: function(links){
@@ -334,7 +334,7 @@ },
isScrollOrBind: function(getter){
var self = this;
- var paragraphes, paragraph, current, next, innerHeight, scrollY, limit, p, np, cp;
+ var paragraphes,paragraph,current,next,innerHeight,scrollY,limit,p,np,cp;
try{
paragraphes = this.LDRize.getParagraphes();
paragraph = paragraphes[getter]();
diff --git a/localkeymode.js b/localkeymode.js index 119586a..e27468c 100644 --- a/localkeymode.js +++ b/localkeymode.js @@ -83,7 +83,7 @@ liberator.plugins.LocalKeyMode = (function() { // utility function function cloneMap(org, key) { return new Map( - org.modes, key ? key : org.names, org.description, org.action, + org.modes, key || org.names, org.description, org.action, {flags:org.flags, rhs:org.rhs, noremap:org.noremap } ); } @@ -163,18 +163,18 @@ liberator.plugins.LocalKeyMode = (function() { var delkeys = []; if (!(uri instanceof RegExp) ) uri = new RegExp(uri.replace(/(?=[^-0-9A-Za-z_@])/g, '\\')); - items.forEach( function( [key, command, extra] ){ + items.forEach( function( [key, command, extra] ) { if (!key) return; else if (!command) delkeys = delkeys.concat( key.split(' ')); else { key = key instanceof Array ? key : [key]; - extra = extra ? extra : new Object(); + extra = extra || new Object(); if (!extra || !extra.rhs) extra.rhs = (command+'').replace(rhsRegExp, ' '); - if (typeof command != 'function'){ + if (typeof command != 'function') { let cmdName = command; if (command.charAt(0) == ':') - command = extra.noremap ? function () commandline.open("", cmdName, modes.EX) - : function () liberator.execute(cmdName); + command = extra.noremap ? function () commandline.open("", cmdName, modes.EX) + : function () liberator.execute(cmdName); else command = function () feedKeys( command, extra.noremap, true); } @@ -312,7 +312,7 @@ liberator.plugins.LocalKeyMode = (function() { } } }, { - completer: function(context, arg, special){ + completer: function(context, arg, special) { let filter = context.filter; var names = self.completeNames; context.title = ['Name','Description']; diff --git a/maine_coon.js b/maine_coon.js index b2e4ec9..31a9f23 100644 --- a/maine_coon.js +++ b/maine_coon.js @@ -59,7 +59,7 @@ let PLUGIN_INFO = Hide caption-bar If window is maximized, then window maximize after window is hid. m: - Display the message to command-line. + Displays the message to command-line. (e.g. "Yanked http://..." "-- CARET --") >|| :set mainecoon=ac @@ -240,7 +240,7 @@ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/) doc.body.removeChild(elem); clearInterval(handle); remove = null; - } + }; }; })(); @@ -302,10 +302,10 @@ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/) try { if (autoHideCommandLine && useEcho - && /[^\s]/.test(newValue) + && /\S/.test(newValue) && messageBox.collapsed && last != newValue - && newValue != "Press ENTER or type command to continue") { + && newValue != 'Press ENTER or type command to continue') { echo(newValue); } } catch (e) { @@ -362,7 +362,7 @@ let tagetIDs = (liberator.globalVariables.maine_coon_targets || '').split(/\s+/) ['f', 'Fullscreen'], ['a', 'Hide automatically command-line'], ['C', 'Hide caption bar (maximize)'], - ['m', 'Display the message to command-line'], + ['m', 'Displays the message to command-line'], ]; }, validater: function (value) /^[cfa]*$/.test(value) diff --git a/mouse_gestures.js b/mouse_gestures.js index 48c2d00..5b41f18 100644 --- a/mouse_gestures.js +++ b/mouse_gestures.js @@ -22,15 +22,15 @@ var PLUGIN_INFO = ['RLR', 'Close Tab Or Window', '#cmd_close'], ['LD' , 'Stop Loading Page', '#Browser:Stop'], ['LR' , 'Undo Close Tab', '#History:UndoCloseTab'], - ['UL' , 'Select Previous Tab' ,'gT', true], - ['UR' , 'Select Next Tab' ,'gt', true], + ['UL' , 'Select Previous Tab', 'gT', true], + ['UR' , 'Select Next Tab', 'gt', true], ['LU' , 'Scroll To Top', function() goDoCommand('cmd_scrollTop')], ['LD' , 'Scroll To Bottom', function() goDoCommand('cmd_scrollBottom')], ['UDR', 'Add Bookmark', ':dialog addbookmark'], - ['L>R' , 'Forward', '#Browser:Forward'], - ['L<R' , 'Back', '#Browser:Back'], - ['W-' , 'Select Previous Tab' , function() gBrowser.tabContainer.advanceSelectedTab(-1, true) ], - ['W+' , 'Select Next Tab' , function() gBrowser.tabContainer.advanceSelectedTab(+1, true) ], + ['L>R', 'Forward', '#Browser:Forward'], + ['L<R', 'Back', '#Browser:Back'], + ['W-' , 'Select Previous Tab', function() gBrowser.tabContainer.advanceSelectedTab(-1, true) ], + ['W+' , 'Select Next Tab', function() gBrowser.tabContainer.advanceSelectedTab(+1, true) ], ]; EOM == liberator.globalVariables == @@ -78,30 +78,30 @@ liberator.plugins.MouseGestures = (function() { var Class = function() function() {this.initialize.apply(this, arguments);}; var MouseGestures = new Class(); - + var doCommandByID = function(id) { - if (document.getElementById(id)) + if (document.getElementById(id)) document.getElementById(id).doCommand(); }; - + MouseGestures.prototype = { - initialize: function(){ + initialize: function() { this.parseSetting(); - + var self = this; this.registerEvents('add'); window.addEventListener('unload', function() { self.registerEvents('remove'); }, false); }, - parseSetting: function(){ + parseSetting: function() { var gestures = {}; var self = this; this._showstatus = global.mousegesture_showmsg || true; - + this._enableRocker = global.mousegesture_rocker || false; this._enableWheel = global.mousegesture_wheel || false; if (this._enableRocker) this.captureEvents.push('draggesture'); if (this._enableWheel) this.captureEvents.push('DOMMouseScroll'); - global.mousegesture_list.forEach(function( [gesture, desc, action, noremap] ){ + global.mousegesture_list.forEach(function( [gesture, desc, action, noremap] ) { action = action || desc; noremap = noremap || false; if (typeof action == 'string') { @@ -115,17 +115,17 @@ liberator.plugins.MouseGestures = (function() { this.GESTURES = gestures; }, captureEvents : ['mousedown', 'mousemove', 'mouseup', 'contextmenu'], - registerEvents: function(action){ + registerEvents: function(action) { var self = this; this.captureEvents.forEach( - function(type) { getBrowser().mPanelContainer[action + 'EventListener'](type, self, type == 'contextmenu' || type == 'draggesture'); + function(type) { getBrowser().mPanelContainer[action + 'EventListener'](type, self, type == 'contextmenu' || type == 'draggesture'); }); }, set status(msg) { - if (this._showstatus) commandline.echo(msg,null, commandline.FORCE_SINGLELINE); + if (this._showstatus) commandline.echo(msg, null, commandline.FORCE_SINGLELINE); }, handleEvent: function(event) { - switch(event.type){ + switch(event.type) { case 'mousedown': if (event.button == 2) { this._isMouseDownR = true; @@ -137,7 +137,7 @@ liberator.plugins.MouseGestures = (function() { this._gesture = 'L>R'; this.stopGesture(event); } - } else if (this._enableRocker && event.button == 0){ + } else if (this._enableRocker && event.button == 0) { this._isMouseDownL = true; if (this._isMouseDownR) { this._isMouseDownL = false; @@ -158,7 +158,7 @@ liberator.plugins.MouseGestures = (function() { this.stopGesture(event); if (this._shouldFireContext) { // for Linux & Mac this._shouldFireContext = false; - var mEvent = event.originalTarget.ownerDocument.createEvent('MouseEvents'); + let mEvent = event.originalTarget.ownerDocument.createEvent('MouseEvents'); mEvent.initMouseEvent('contextmenu', true, true, aEvent.originalTarget.defaultView, 0, event.screenX, event.screenY, event.clientX, event.clientY, false, false, false, false, 2, null); event.originalTarget.dispatchEvent(mEvent); } @@ -178,7 +178,7 @@ liberator.plugins.MouseGestures = (function() { event.stopPropagation(); this._suppressContext = true; this._gesture = 'W' + (event.detail > 0 ? '+' : '-'); - this.stopGesture( event , false); + this.stopGesture( event, false ); } break; case 'draggesture': @@ -213,7 +213,7 @@ liberator.plugins.MouseGestures = (function() { } this._x = x; this._y = y; }, - timerGesture: function(isClear){ + timerGesture: function(isClear) { if (this._timer) clearTimeout(this._timer); this._timer = setTimeout( !isClear ? function(self) self.stopGesture({}, true) : function(self) self._timer = self.status = '', 1500, this); }, @@ -221,11 +221,11 @@ liberator.plugins.MouseGestures = (function() { if (this._gesture) { try { if (cancel) throw 'Gesture Canceled'; - - var cmd = this.GESTURES[this._gesture] || null; + + let cmd = this.GESTURES[this._gesture] || null; /* if ( !cmd && this.GESTURES['*'] ) { - for (var key in this.GESTURES['*']) { + for (let key in this.GESTURES['*']) { if (this.GESTURES['*'][key].test(this._gesture)) { cmd = this.GESTURES[key]; break; @@ -234,7 +234,7 @@ liberator.plugins.MouseGestures = (function() { } */ if (!cmd) throw 'Unknown Gesture: ' + this._gesture; - + cmd[1].call(this); this.status = 'Gesture: ' + cmd[0]; } catch (exp) { diff --git a/notifier.js b/notifier.js index 2e6a2d2..815508a 100644 --- a/notifier.js +++ b/notifier.js @@ -410,5 +410,5 @@ function bootstrap() { }; })(); -// vim: set fdm=marker sw=4 ts=4 sts=0 et: +// vim: set fdm=marker sw=2 ts=2 sts=0 et: diff --git a/notifier/observer_growl.js b/notifier/observer_growl.js index d8c60c1..bff7466 100644 --- a/notifier/observer_growl.js +++ b/notifier/observer_growl.js @@ -188,7 +188,7 @@ notifier.observer.register(notifier.Observer, { var text = growl.message.title + ' ' + growl.message.message.replace(/(?:<[^>]*>)+/g, ''); - if (growl.sticky_keywords_exp.some(function(k) text.match(k)) || + if (growl.sticky_keywords_exp.some(function(k) k.test(text)) || growl.created.getTime() + growl.options.life * 1000 > new Date().getTime()) return false; diff --git a/peekpage.js b/peekpage.js index 535032e..3b06635 100644 --- a/peekpage.js +++ b/peekpage.js @@ -12,12 +12,12 @@ * */ (function(){ - var multilineOutputWidget = document.getElementById("liberator-multiline-output"); + var multilineOutputWidget = document.getElementById('liberator-multiline-output'); var outputContainer = multilineOutputWidget.parentNode; var option = { bang: true, - completer: function (context) { + completer: function (context){ var complete = options.complete.replace(/[sS]/g, ''); completion.url(context, complete); }, @@ -32,7 +32,7 @@ iframe.width = '100%'; if (outputContainer.collapsed) - doc.body.innerHTML = ""; + doc.body.innerHTML = ''; doc.body.appendChild(iframe); commandline.updateOutputHeight(true); @@ -2,7 +2,7 @@ var PLUGIN_INFO = <VimperatorPlugin> <name>{NAME}</name> - <description>tinyurl from vimperator</description> + <description>TinyURL from Vimperator</description> <author mail="konbu.komuro@gmail.com" homepage="http://d.hatena.ne.jp/hogelog/">hogelog</author> <version>0.1</version> <minVersion>2.0pre</minVersion> @@ -22,7 +22,7 @@ plugins.tinyurl.getTiny(url): plugins.tinyurl.getExpand(url): return ExpandURL - ]]></detail> + ]]></detail> </VimperatorPlugin>; //}}} @@ -40,15 +40,11 @@ plugins.tinyurl.getExpand(url): argCount: '1', }); - let tiny = plugins.tinyurl = { + var tiny = plugins.tinyurl = { getTiny: function(url) - { - return util.httpGet(TinyAPI+encodeURIComponent(url)).responseText; - }, + util.httpGet(TinyAPI+encodeURIComponent(url)).responseText, getExpand: function (url) - { - return util.httpGet(url).channel.name; - } + util.httpGet(url).channel.name }; })(); // vim: fdm=marker sw=4 ts=4 et: @@ -54,10 +54,7 @@ Toggler.prototype = { if (!notUpdate) this.index = index; return this.cmds[this.index]; }, - list: function(){ - var data = this.cmds.map(function(cmd, i) [i==this.index ? "*" : "", cmd], this); - return template.table(this.name, data); - } + list: function() template.table(this.name, this.cmds.map(function(cmd, i) [i==this.index ? "*" : "", cmd], this)) }; var manager = { add: function(name, cmds){ @@ -89,7 +86,7 @@ var manager = { reload: function(){ if (liberator.globalVariables.toggler){ settings = {}; - for (var [name, toggler] in Iterator(liberator.globalVariables.toggler)) + for (let [name, toggler] in Iterator(liberator.globalVariables.toggler)) this.add(name, toggler); } }, |