You are not logged in.

#1 2017-08-21 08:34:29

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Code Select Link in the Forums

The Siduction forums have a feature where a link is generated to copy code (text within the code tag).  Clicking the link copies the code to your clipboard.  I think that would be a nice feature, if possible, for the forums here.

Offline

#2 2017-08-21 09:13:56

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Code Select Link in the Forums

Like on the scrot.moe site the "Copy" buttons? Yes, that's a useful feature indeed. Instead of select -> click -> copy just press the button...

Offline

#3 2017-08-21 09:36:11

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,754

Re: Code Select Link in the Forums

a. Doesn't seem to require tons of code
https://codepen.io/shaikmaqsood/pen/XmydxJ
(But I haven't dig deep)

b. ff extension (right click to get menu / select copy to clipboard < skips selecting anything), also mentions single-click, but could not get that to work.
https://addons.mozilla.org/en-US/firefo … e/?src=api

Last edited by brontosaurusrex (2017-08-21 09:48:33)

Offline

#4 2017-08-21 14:58:32

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Code Select Link in the Forums

KrunchTime wrote:

Clicking the link copies the code to your clipboard.  I think that would be a nice feature, if possible, for the forums here.

Triple-clicking on a code box copies the text to the PRIMARY buffer, a middle-click will then paste the text, even into an xterm or urxvt window  8)

We don't need no stinkin' CLIPBOARD...  8o

Last edited by Head_on_a_Stick (2017-08-21 14:59:57)

Offline

#5 2017-08-21 15:28:05

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: Code Select Link in the Forums

earlybird wrote:

a) Wayland

Works for me™ in my GNOME desktop under Wayland  smile

and b) OtherOS (Windows, OSX, QubesOS, ...).

People should use proper operating systems, that's not an unreasonable request  8o

Offline

#6 2017-08-21 15:33:01

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,754

Re: Code Select Link in the Forums

earlybird wrote:

adding a button means pain and layout changes.

Maybe ondblclick (It won't require any visual changes then)? I don't think a single-click-copy-to-clipboard is something user would expect to happen.

Last edited by brontosaurusrex (2017-08-21 15:34:01)

Offline

#7 2017-08-22 00:06:24

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: Code Select Link in the Forums

martix wrote:

Like on the scrot.moe site the "Copy" buttons? Yes, that's a useful feature indeed. Instead of select -> click -> copy just press the button...

Yes, similar functionality.  Copy buttons also used on the Postimage site.

Offline

Board footer

Powered by FluxBB