From a807b4609220d6a60673008b962d2456d4ccebb7 Mon Sep 17 00:00:00 2001 From: PHO Date: Sun, 11 Sep 2016 10:27:19 +0900 Subject: [PATCH] Auto commit by The Sugar System. --- dot-files/_emacs_el | 10 ++++++++-- dot-files/_vimperator/plugin/_libly_js | 10 +++++----- dot-files/_vimperator/plugin/bitly_js | 5 ++++- dot-files/_vimperator/plugin/copy_js | 2 +- dot-files/_vimperator/plugin/multi_requester_js | 3 ++- dot-files/_vimperator/plugin/prevent-pseudo-domain_js | 2 +- dot-files/_vimperator/plugin/relative_move_js | 8 ++++---- 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/dot-files/_emacs_el b/dot-files/_emacs_el index c347430..167d443 100644 --- a/dot-files/_emacs_el +++ b/dot-files/_emacs_el @@ -173,8 +173,14 @@ Will prompt you shell name when you type `C-u' before this command." t) (paren-activate)) ;; elscreen -(load "elscreen" "ElScreen" t) -(elscreen-start) +(condition-case e + (load "elscreen" "ElScreen" t) + (file-error + (if (equal (cadr e) "Cannot open load file") + (message "Warning: feature %s is absent" feature) ; warn and ignore + (apply 'signal (car e) (cdr e))))) ; rethrow +(if (featurep 'elscreen) + (elscreen-start)) (require-if-present 'elscreen-w3m) ;; undo-tree diff --git a/dot-files/_vimperator/plugin/_libly_js b/dot-files/_vimperator/plugin/_libly_js index 51035bf..1ff4600 100644 --- a/dot-files/_vimperator/plugin/_libly_js +++ b/dot-files/_vimperator/plugin/_libly_js @@ -246,9 +246,10 @@ libly.$U = {//{{{ function getPluginPath () { let pluginPath; Error('hoge').stack.split(/\n/).some( - function (s) - let (m = s.match(/-> liberator:\/\/template\/chrome:\/\/liberator\/content\/liberator\.js -> (.+):\d+$/)) - (m && (pluginPath = m[1].replace(/\?.*$/, ''))) + function (s) { + let m = s.match(/@chrome:\/\/liberator\/content\/liberator\.js -> file:\/\/\/(.+):\d+$/); + (m && (pluginPath = m[1].replace(/\?.*$/, ''))); + } ); return pluginPath; } @@ -311,9 +312,8 @@ libly.$U = {//{{{ evalJson: function(str, toRemove) { var json; try { - json = Components.classes['@mozilla.org/dom/json;1'].getService(Components.interfaces.nsIJSON); if (toRemove) str = str.substring(1, str.length - 1); - return json.decode(str); + return JSON.parse(str); } catch (e) { return null; } }, dateFormat: function(dtm, fmt) { diff --git a/dot-files/_vimperator/plugin/bitly_js b/dot-files/_vimperator/plugin/bitly_js index 5d4af2d..5b654ed 100644 --- a/dot-files/_vimperator/plugin/bitly_js +++ b/dot-files/_vimperator/plugin/bitly_js @@ -90,7 +90,10 @@ let PLUGIN_INFO = xml` callback(); }, { - default: let (e = content.document.querySelector('#bitly_api_key')) (e ? e.value : '') + default: (function () { + let e = content.document.querySelector('#bitly_api_key'); + return e ? e.value : '' + })() } ); } diff --git a/dot-files/_vimperator/plugin/copy_js b/dot-files/_vimperator/plugin/copy_js index 18b61f5..fd72f9b 100644 --- a/dot-files/_vimperator/plugin/copy_js +++ b/dot-files/_vimperator/plugin/copy_js @@ -362,7 +362,7 @@ var exCopyManager = { if (isError){ liberator.echoerr('CopiedErrorString: `' + copyString + "'"); } else { - liberator.echo('CopiedString: `' + util.escapeHTML(copyString || '') + "'"); + liberator.echomsg('CopiedString: `' + util.escapeHTML(copyString || '') + "'"); } } }; diff --git a/dot-files/_vimperator/plugin/multi_requester_js b/dot-files/_vimperator/plugin/multi_requester_js index 90ca321..4b9c9f9 100644 --- a/dot-files/_vimperator/plugin/multi_requester_js +++ b/dot-files/_vimperator/plugin/multi_requester_js @@ -304,7 +304,8 @@ var MultiRequester = { let srcEncode = info.srcEncode || "UTF-8"; let urlEncode = info.urlEncode || srcEncode; - let repStrCount = let (m = url.match(/%s/g)) (m && m.length); + let m = url.match(/%s/g); + let repStrCount = m && m.length; if (repStrCount && !parsedArgs.strs.length) continue; // via. lookupDictionary.js diff --git a/dot-files/_vimperator/plugin/prevent-pseudo-domain_js b/dot-files/_vimperator/plugin/prevent-pseudo-domain_js index 0e4124c..e23b483 100644 --- a/dot-files/_vimperator/plugin/prevent-pseudo-domain_js +++ b/dot-files/_vimperator/plugin/prevent-pseudo-domain_js @@ -29,7 +29,7 @@ return !(validators.some(function(validator) { return validator(s); })); } - plugins.libly.$U.around( + liberator.plugins.libly.$U.around( liberator, 'open', function (next, args) { diff --git a/dot-files/_vimperator/plugin/relative_move_js b/dot-files/_vimperator/plugin/relative_move_js index a75eff3..c5ca149 100644 --- a/dot-files/_vimperator/plugin/relative_move_js +++ b/dot-files/_vimperator/plugin/relative_move_js @@ -1,5 +1,5 @@ // Vimperator plugin: Relative Move -// Version: 0.1 +// Version: 0.3 // // Usage: // If you stay "http://example.com/aaa/bbb/ccc" @@ -28,7 +28,7 @@ function open_path(path, tab){ var win = window.content.window; var loc = win.location; - var splited_path = path.split(/\/+/); + var splited_path = path.toString().split(/\/+/); var up = 0; if(!tab){ @@ -57,7 +57,7 @@ break; case -1: // "./hoge" base = trim_query(loc.href); - path = path.substring(2); + path = path.toString().substring(2); if(base[base.length-1] == "/") url = base + path; else @@ -72,7 +72,7 @@ while(c < up){ if(c > 0) base = base.substr(0, base.length-1); [base] = base.match(/^.*\/(?=[^\/]*$)/); - path = path.substring(3); + path = path.toString().substring(3); c++; } url = base + path; -- 2.40.0