pinboard-elinks

Check-in [6079ccfc6a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add tweets link as well as starred
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256: 6079ccfc6a9d5054782d0e00b66cee7bbc00ced62b01ebb13984bd5f0ad605d1
User & Date: base@atomicules.co.uk 2015-07-20 20:03:37
Context
2015-08-07
20:22
Add fix for websites that don't text wrap properly As a result of [this email] [1] on the ELinks-users list I worked out that some websites use <pre> tags where I'd expect them to use a <p> or <div>, etc and Elinks, probably correctly, refuses to wrap <pre> elements. So rather than fix Elinks, use Lua to fix the offending webpages. [1]: http://lists.linuxfromscratch.org/pipermail/elinks-users/2015-August/002192.html check-in: b2ece6336b user: base@atomicules.co.uk tags: master, trunk
2015-07-20
20:03
Add tweets link as well as starred check-in: 6079ccfc6a user: base@atomicules.co.uk tags: master, trunk
2014-04-22
10:21
Add "starred" link to the top navigation menu check-in: 194e123f55 user: base@atomicules.co.uk tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pinboard.lua.

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
		html = string.gsub (html, '<div name="edit_checkbox".-</div>', '') --ok as no child divs
		html = string.gsub (html, '<div class="star.-</div>', '') --ok as no child divs
		html = string.gsub (html, '<fieldset id="bulk_edit_box">.-</fieldset>', '') --do this instead of parent div
		html = string.gsub (html, '<a class="bookmark_title.-edit</a>', new_edit_link)
		html = string.gsub (html, '<div class="delete_link".-</div>', '')
		html = string.gsub (html, '<div style="display:inline" class="read">.-</div>', '')
		html = string.gsub (html, '<div id="edit_bookmark_form".-</form>\n  \n</div>', '')
		--Add a starred link to the nav menu
		html = string.gsub (html, '(<div id="top_menu">\n<a href="/u:)(%w-)(/".-</a> ‧ )', '%1%2%3<a href="/u:%2/starred/" >starred</a> ')
		return html
	elseif string.find(url, "://pinboard.in/add%?url=") then --need to escape the ? here
		--Remove delete and destroy from the add page.
		html = string.gsub (html, '<div style="display:inline" id="delete_.-</div>', '')
		html = string.gsub (html, '<div style="visibility:hidden;display:none" class="delete_div" id="destroy_.-</div>', '')
		return html
	end







|
|







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
		html = string.gsub (html, '<div name="edit_checkbox".-</div>', '') --ok as no child divs
		html = string.gsub (html, '<div class="star.-</div>', '') --ok as no child divs
		html = string.gsub (html, '<fieldset id="bulk_edit_box">.-</fieldset>', '') --do this instead of parent div
		html = string.gsub (html, '<a class="bookmark_title.-edit</a>', new_edit_link)
		html = string.gsub (html, '<div class="delete_link".-</div>', '')
		html = string.gsub (html, '<div style="display:inline" class="read">.-</div>', '')
		html = string.gsub (html, '<div id="edit_bookmark_form".-</form>\n  \n</div>', '')
		--Add starred and tweets links to the nav menu
		html = string.gsub (html, '(<div id="top_menu">\n<a href="/u:)(%w-)(/".-</a> ‧ )', '%1%2%3<a href="/u:%2/starred/" >starred</a>  ‧ <a href="/u:%2/tweets/" >tweets</a> ‧')
		return html
	elseif string.find(url, "://pinboard.in/add%?url=") then --need to escape the ? here
		--Remove delete and destroy from the add page.
		html = string.gsub (html, '<div style="display:inline" id="delete_.-</div>', '')
		html = string.gsub (html, '<div style="visibility:hidden;display:none" class="delete_div" id="destroy_.-</div>', '')
		return html
	end