DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Ability to copy geshi formatted code text.. help me test?  (Read 26,765 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Can anyone help me test the new ability to copy the text of geshi syntax highlighted text?

Normal attempts to select and copy geshi syntax highlighted text results in garbage that is impossible to reuse outside the forum.

I've added a new copy/print link at the top of geshi syntax highlighted code which should pop up a plain text window to copy from -- let's see if it works -- let me know.

here is a SAMPLE CODE BLOCK to test out the copy function on:
Code: (php)
	$entries = array();
	$total_t = 0;
	$total_s = 0;
	foreach ($cache_hits as $h)
		{
		$entries[] = $h['d'] . ' ' . $h['k'] . ': ' . comma_format($h['t'], 5) . ' - ' . $h['s'] . ' bytes';
		$total_t += $h['t'];
		$total_s += $h['s'];
		}
« Last Edit: May 25, 2009, 04:28 AM by mouser »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #1 on: May 25, 2009, 03:54 AM »
note: you may have to do a ctrl+refresh of the page in order to force the forum to reload the latest javascript code on the site instead of using cache.

argv

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 45
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #2 on: May 25, 2009, 05:55 AM »
It seems to work fine doing paste in Notepad++, just the formating is lost; is this what you wanted to test?

  1.
      $entries = array();
  2.
      $total_t = 0;
  3.
      $total_s = 0;
  4.
      foreach ($cache_hits as $h)
  5.
      {
  6.
      $entries[] = $h['d'] . ' ' . $h['k'] . ': ' . comma_format($h['t'], 5) . ' - ' . $h['s'] . ' bytes';
  7.
      $total_t += $h['t'];
  8.
      $total_s += $h['s'];
  9.
      }

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #3 on: May 25, 2009, 06:05 AM »
those messed up numbers demonstrate the problem with normal select and copy.
try clicking on the link that says "[copy or print]" to see a new window popup with clean plain text you can copy properly -- that's the new thing.

argv

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 45
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #4 on: May 25, 2009, 06:11 AM »
It's better:

$entries = array();
$total_t = 0;
$total_s = 0;
foreach ($cache_hits as $h)
{
$entries[] = $h['d'] . ' ' . $h['k'] . ': ' . comma_format($h['t'], 5) . ' - ' . $h['s'] . ' bytes';
$total_t += $h['t'];
$total_s += $h['s'];
}

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • Coding Snacks
    • Volunteers/Staff
    • Gathering Badge
    • Participated in NANY Challenge Once
    • Linux User
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #5 on: May 25, 2009, 07:40 AM »
yeah, it works in metapad & PSPad.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #6 on: May 25, 2009, 03:17 PM »
Works fine with Kedit.
Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #7 on: May 25, 2009, 06:21 PM »
ok it works, no more reports needed. :up:

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #8 on: May 30, 2009, 02:54 AM »
Actually, it doesn't work for me. Just makes the page jump to top.

wreckedcarzz

  • Still lurking. Still an anthro.
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,629
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #9 on: May 30, 2009, 05:06 AM »
Actually, it doesn't work for me. Just makes the page jump to top.

Same here, Firefox 3.0.10 on Vista SP1

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #10 on: May 30, 2009, 05:14 AM »
somehow i broke it.. thanks for reporting..
working to fix it now.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #11 on: May 30, 2009, 05:41 AM »
ok should be working again.. really goes to show you that not even what you think is the simplest trivial change should ever be uploaded and assumed to work without testing.  :-[

Coeluh

  • Family Guy ^^
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #12 on: June 06, 2009, 06:34 PM »
Copying doesnt work yet, I just get a popup

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #13 on: June 07, 2009, 02:12 PM »
It's just fine over here too, also tried the 'wrong' copy, by selecting the forum text, and that worked as bad as argv showed.

Thnx
Ath
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

fenixproductions

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,186
    • Participated in NANY Challenge Four Times
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #14 on: June 10, 2009, 01:41 AM »
2mouser
I am not sure it's the same feature but take a look here:
http://www.donationcoder.com/forum/index.php?topic=17398.0

If you click on copy or print link in skrommel's code, popup with plain text will appear but backslashes are missing!

It took me a while to figure out why his code is not working for me until I've realized what is wrong.

P.S. Tested under Opera only.
Надо было учиться, а не камни в школу бросать...
--
f0dder is my personal hero :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #15 on: June 10, 2009, 01:42 AM »
yikes! you are right!! fixing now!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #16 on: June 10, 2009, 02:02 AM »
fixed now hopefully?

fenixproductions

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,186
    • Participated in NANY Challenge Four Times
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #17 on: June 10, 2009, 02:09 AM »
2mouser
Seems to be OK.

…and I lost of my precious minutes because of that error ;)
Надо было учиться, а не камни в школу бросать...
--
f0dder is my personal hero :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #18 on: June 10, 2009, 04:25 AM »
dont blame me, blame Cody, he was stealing all the backslashes to build his nest.

Coeluh

  • Family Guy ^^
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #19 on: June 12, 2009, 10:57 PM »
dont blame me, blame Cody, he was stealing all the backslashes to build his nest.
Should it go directly to my clipboard? because that is not working for me...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #20 on: June 13, 2009, 03:40 AM »
Quote
Should it go directly to my clipboard? because that is not working for me...

no, you still have to manually ctrl+A and copy to clipboard.. the main functionality of the new feature is to remove the formatting codes and the line numbers.

Coeluh

  • Family Guy ^^
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #21 on: June 13, 2009, 10:23 AM »
Quote
Should it go directly to my clipboard? because that is not working for me...

no, you still have to manually ctrl+A and copy to clipboard.. the main functionality of the new feature is to remove the formatting codes and the line numbers.
Will you implement the copy code function?

Original address: https://www.donationcoder.com/forum/index.php?topic=18458.0