Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Deliciousポストフォーム変更対応(taberarelooから移植)

  • Loading branch information...
commit deda57f410f46d8d06aed94d008ae48671482408 1 parent 4b7c1dc
@to authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 xpi/chrome/content/library/20_model.js
View
14 xpi/chrome/content/library/20_model.js
@@ -1241,8 +1241,15 @@ models.register(update({}, AbstractSessionService, {
})
}).addCallback(function(res){
var doc = convertToHTMLDocument(res.responseText);
+ var form = {};
+ items(formContents(doc.documentElement)).forEach(function([key, value]){
+ form[key.replace(/[A-Z]/g, function(c){
+ return '_' + c.toLowerCase()
+ })] = value;
+ });
+
return request('http://www.delicious.com/save', {
- sendContent : update(formContents(doc), {
+ sendContent : update(form, {
title : ps.item,
url : ps.itemUrl,
note : joinText([ps.body, ps.description], ' ', true),
@@ -1250,6 +1257,11 @@ models.register(update({}, AbstractSessionService, {
private : ps.private,
}),
});
+ }).addCallback(function(res){
+ res = JSON.parse(res.responseText);
+
+ if(res.error)
+ throw new Error(res.error_msg);
});
},
Please sign in to comment.
Something went wrong with that request. Please try again.