(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
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;
}
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) {
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 : ''
+ })()
}
);
}
if (isError){
liberator.echoerr('CopiedErrorString: `' + copyString + "'");
} else {
- liberator.echo('CopiedString: `' + util.escapeHTML(copyString || '') + "'");
+ liberator.echomsg('CopiedString: `' + util.escapeHTML(copyString || '') + "'");
}
}
};
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
return !(validators.some(function(validator) { return validator(s); }));
}
- plugins.libly.$U.around(
+ liberator.plugins.libly.$U.around(
liberator,
'open',
function (next, args) {
// Vimperator plugin: Relative Move
-// Version: 0.1
+// Version: 0.3
//
// Usage:
// If you stay "http://example.com/aaa/bbb/ccc"
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){
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
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;