LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 07-24-2013, 09:34 AM   #1
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
Cool Copy-code button


sorry if this is a repeat, searching for 'copy' and 'code' doesn't yield anything useful!

I think it would be great to have a javascript button next to any CODE section to quick select all that code and copy it to the local buffer, for easy pasting/testing.

Additionally, there are quite a few great syntax highlighters out there these days for more relaxed reading.
 
Old 07-24-2013, 06:19 PM   #2
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
Just a suggestion why this may not be happening, interacting with the clipboard is by some a little bit of a security no no. With that said I have used JavaScript to do this exact thing, though I think it only worked in IE in Windows. It has been several years so maybe things have changed, but this is the JavaScript I used.
Code:
function ClipBoard() {
   build('document.note.pad');
   selectAll('note.pad');
   //set the clipboard
   var Tex = document.getElementById("pad").value;
   window.clipboardData.setData("Text",Tex);
}
function select() {
   selectAll('note.pad');
}
BTW I think these are great suggestions.
 
Old 07-25-2013, 10:58 PM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,211

Original Poster
Rep: Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612Reputation: 1612
wow. that is awesome.

nice job!
 
Old 07-26-2013, 01:19 AM   #4
jeremy
root
 
Registered: Jun 2000
Distribution: Debian, Red Hat, Slackware, Fedora, Ubuntu
Posts: 12,448

Rep: Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329
Thanks for the feedback. We don't have any plans to incorporate javascript-based copy, but the PHP code tag does do some syntax highlighting.

http://www.linuxquestions.org/questi...?do=bbcode#php

--jeremy
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gnome-commander default button in copy/move dialog taylorkh Linux - Software 3 01-26-2010 09:04 AM
Glade GUI :: Cancel Button Code nomb Programming 1 03-15-2007 09:06 AM
Disable copy-paste on middle mouse button 311Sam Ubuntu 6 10-09-2006 09:40 PM
I need a python code that activate a button Linh Programming 0 08-20-2004 11:47 AM
Unable to copy paste by simultaneous clicking of mouse button jaiashutosh Linux - General 1 08-05-2003 09:02 AM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration