Changeset 9692
- Timestamp:
- 04/18/08 18:49:53 (8 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/direct_bookmark.js
r9631 r9692 1 1 // Vimperator plugin: 'Direct Post to Social Bookmarks' 2 2 // Version: 0.03 3 // Last Change: 1 7-Apr-2008. Jan 20083 // Last Change: 18-Apr-2008. Jan 2008 4 4 // License: Creative Commons 5 5 // Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid … … 136 136 137 137 // copied from Pagerization (c) id:ofk 138 function parseHTML(str ){138 function parseHTML(str, ignore_tags){ 139 139 str = str.replace(/^[\s\S]*?<html(?:\s[^>]+?)?>|<\/html\s*>[\S\s]*$/ig, ''); 140 if (ignore_tags && ignore_tags instanceof Array) 141 str = str.replace(new RegExp('<' + ignore_tags.join('[^>]+?>|<') + '[^>]+?>', 'ig'), ''); 140 142 var res = document.implementation.createDocument(null, 'html', null); 141 143 var range = document.createRange(); … … 254 256 xhr.send(null); 255 257 256 var mypage_html = parseHTML(xhr.responseText );258 var mypage_html = parseHTML(xhr.responseText, ['img']); 257 259 var tags = getElementsByXPath("//ul[@id=\"taglist\"]/li/a",mypage_html); 258 260 … … 329 331 xhr.send(null); 330 332 331 var mypage_html = parseHTML(xhr.responseText );333 var mypage_html = parseHTML(xhr.responseText, ['img']); 332 334 var tags = getElementsByXPath("id(\"tag_list\")/span",mypage_html); 333 335 … … 367 369 }); 368 370 // unique tags 369 for(var i = tags.length; i --> 0; tags.indexOf(tag ) == i || tags.splice(i, 1));371 for(var i = tags.length; i --> 0; tags.indexOf(tags[i]) == i || tags.splice(i, 1)); 370 372 liberator.plugins.direct_bookmark.tags = tags.sort(); 371 373 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)