aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrry2008-04-09 06:01:59 +0000
committerdrry2008-04-09 06:01:59 +0000
commitb8a6f565cfca9f3a5074fde1693af898edf951c3 (patch)
tree681d304a44436a00be750ed13a14c2a49134184b
parent99dd65177b999d89cb76768e2bb46a71f0efb842 (diff)
downloadvimperator-plugins-b8a6f565cfca9f3a5074fde1693af898edf951c3.tar.bz2
lang/javascript/vimperator-plugins/trunk/direct_hb.js
lang/javascript/vimperator-plugins/trunk/direct_delb.js: * 正規表現を修正しました。 * ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@9170 d0d07461-0603-4401-acd4-de1884942a52
-rw-r--r--direct_delb.js16
-rw-r--r--direct_hb.js22
2 files changed, 15 insertions, 23 deletions
diff --git a/direct_delb.js b/direct_delb.js
index 379c38f..6c57daa 100644
--- a/direct_delb.js
+++ b/direct_delb.js
@@ -60,7 +60,7 @@
if(logins.length)
[deliciousUser, deliciousPassword] = [logins[0].username, logins[0].password];
else
- liberator.echoerr("Delicious Bookmark: account not found");
+ liberator.echoerr("DeliciousBookmark: account not found");
} catch(ex) { }
function getTags(){
@@ -72,7 +72,7 @@
var tags = xhr.responseXML.getElementsByTagName('tag');
for each(var tag in tags)
liberator.plugins.delicious_tags.push(tag.getAttribute('tag'));
- liberator.echo("Delicious Bookmark: Tag parsing is finished. Taglist length: " + tags.length);
+ liberator.echo("DeliciousBookmark: Tag parsing is finished. Taglist length: " + tags.length);
} else
throw new Error(xhr.statusText)
}
@@ -90,18 +90,14 @@
if (/^\[.*\]/.test(comment)) {
var tag, text;
while((tag = re.exec(comment))) {
- text = tag[2];
- tag = tag[1];
+ [, tag, text] = tag;
tags.push(tag);
}
comment = text || '';
}
var request_url = 'https://api.del.icio.us/v1/posts/add?' + [
- 'url=' + encodeURIComponent(target),
- 'description=' + encodeURIComponent(title),
- 'extended=' + encodeURIComponent(comment),
- 'tags=' + encodeURIComponent(tags.join(' ')),
- ].join('&');
+ ['url', target], ['description', title], ['extended', comment], ['tags', tags.join(' ')]
+ ].map(function(p) p[0] + '=' + encodeURIComponent(p[1])).join('&');
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4){
@@ -121,7 +117,7 @@
addDeliciousBookmarks(liberator.buffer.URL, liberator.buffer.title, arg, isNormalize);
},{
completer: function(filter){
- var match_result = filter.match(/(\[[^\]]*\])?(?:\[)?(.*)/); //[all, commited, now inputting]
+ var match_result = filter.match(/(\[[^\]]*\])?\[?(.*)/); //[all, commited, now inputting]
var m = new RegExp(XMigemoCore ? "^(" + XMigemoCore.getRegExp(match_result[2]) + ")" : "^" + match_result[2],'i');
var completionList = [];
for each(var tag in liberator.plugins.delicious_tags)
diff --git a/direct_hb.js b/direct_hb.js
index 20ee452..a3ef5ee 100644
--- a/direct_hb.js
+++ b/direct_hb.js
@@ -27,21 +27,17 @@
WSSEUtils.prototype = {
- get userName(){
- return this._userName;
- },
+ get userName()
+ this._userName,
- get noce(){
- return this._nonce;
- },
+ get noce()
+ this._nonce,
- get created(){
- return this._created;
- },
+ get created()
+ this._created,
- get passwordDigest(){
- return this._passwordDigest;
- },
+ get passwordDigest()
+ this._passwordDigest,
getWSSEHeader: function(){
var result = [
@@ -210,7 +206,7 @@
},{
completer: function(filter){
//var match_result = filter.match(/(.*)\[(\w*)$/); //[all, commited, now inputting]
- var match_result = filter.match(/(\[[^\]]*\])?(?:\[)?(.*)/); //[all, commited, now inputting]
+ var match_result = filter.match(/(\[[^\]]*\])?\[?(.*)/); //[all, commited, now inputting]
//var m = new RegExp("^" + match_result[2]);
var m = new RegExp(XMigemoCore ? "^(" + XMigemoCore.getRegExp(match_result[2]) + ")" : "^" + match_result[2],'i');
var completionList = [];