Merge remote-tracking branch 'friendlyanon/master'

This commit is contained in:
ccd0 2017-07-14 20:00:41 -07:00
commit 40fb4fba4c
4 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,25 @@
CopyTextLink =
init: ->
return unless g.VIEW in ['index', 'thread'] and Conf['Menu'] and Conf['Copy Text Link']
a = $.el 'a',
className: 'copy-text-link'
href: 'javascript:;'
textContent: 'Copy Text'
$.on a, 'click', CopyTextLink.copy
Menu.menu.addEntry
el: a
open: (post) ->
CopyTextLink.text = post.nodes.commentClean.innerText
true
copy: ->
el = $.el 'textarea',
className: 'copy-text-element',
value: CopyTextLink.text
$.add d.body, el
el.select()
try
d.execCommand 'copy'
$.rm el

View File

@ -307,6 +307,11 @@ Config =
'Add a report link to the menu.'
1
]
'Copy Text Link': [
true
'Add a link to copy the post\'s text.'
1
]
'Thread Hiding Link': [
true
'Add a link to hide entire threads.'

View File

@ -1012,6 +1012,14 @@ div[data-checked="false"] > .suboption-list {
left: calc(110px - .5px * var(--tn-w));
}
/* Copy Text Link's textarea element */
textarea.copy-text-element {
height: 0;
width: 0;
position: absolute;
top: -10000px;
}
/* Announcement Hiding */
:root.hide-announcement #globalMessage {
display: none;

View File

@ -461,6 +461,7 @@ Main =
['Menu', Menu]
['Index Generator (Menu)', Index.menu]
['Report Link', ReportLink]
['Copy Text Link', CopyTextLink]
['Thread Hiding (Menu)', ThreadHiding.menu]
['Reply Hiding (Menu)', PostHiding.menu]
['Delete Link', DeleteLink]