Changeset 38629
- Timestamp:
- 10/29/10 01:07:27 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userscripts/minibufferbookmarkcommand.user.js
r11134 r38629 65 65 if (self.tags.length) comment = '[' + self.tags.join('][') + ']' + comment; 66 66 var request = [ 67 "mode=enter", 68 "&eid=", opt.eid, 69 "&url=", encodeURIComponent(opt.url), 70 "&rkm=", encodeURIComponent(opt.rkm), 71 "&is_bm=", opt.is_bm, 72 "&title=", encodeURIComponent(opt.title), 67 "url=", encodeURIComponent(opt.url), 68 "&rks=", encodeURIComponent(opt.rks), 73 69 "&comment=", encodeURIComponent(comment) 74 70 ].join(''); 75 71 GM_xmlhttpRequest({ 76 72 method: 'POST', 77 url: "http://b.hatena.ne.jp/ add",73 url: "http://b.hatena.ne.jp/bookmarklet.edit", 78 74 headers: { 79 75 'Content-Type': 'application/x-www-form-urlencoded' … … 99 95 res[d.getAttribute('name')] = d.getAttribute('value'); 100 96 }); 101 if(keys(res).length == 1){97 if($X('//p[@class="bookmarked-confirm"]', html).length){ 102 98 // already bookmarked 103 var a = $X('//ul[@class="entry"]/li[1]/a', html);104 var text = a[0].textContent;99 var p = $X('//p[@id="title-edit"]', html); 100 var text = p[0].textContent; 105 101 window.Minibuffer.message('<small>'+text+'</small><br/> has already bookmarked.', 2000); 106 102 async.ready(); … … 112 108 GM_xmlhttpRequest({ 113 109 method: 'GET', 114 url: "http://b.hatena.ne.jp/add?mode=confirm &is_bm=1&url="+encodeURIComponent(arg.url),110 url: "http://b.hatena.ne.jp/add?mode=confirm1&url="+encodeURIComponent(arg.url), 115 111 onload: callback, 116 112 onerror: function(res){log('onerror',res.responseText, '\n',res.responseHeaders)}, … … 143 139 return; 144 140 } 145 var tags = $X('//a[@class="tag -latest"]', html);141 var tags = $X('//a[@class="tag"]', html); 146 142 a.ready(tags.map(function(arg){return arg.textContent})); 147 143 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)