topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday December 2, 2024, 11:18 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

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

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
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 [Select]
  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.                 }
« Last Edit: May 24, 2009, 11:28 PM by mouser »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #1 on: May 24, 2009, 10:54 PM »
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
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #2 on: May 25, 2009, 12: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,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #3 on: May 25, 2009, 01: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
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #4 on: May 25, 2009, 01: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
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #5 on: May 25, 2009, 02:40 AM »
yeah, it works in metapad & PSPad.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #6 on: May 25, 2009, 10:17 AM »
Works fine with Kedit.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #7 on: May 25, 2009, 01:21 PM »
ok it works, no more reports needed. :up:

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,885
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #8 on: May 29, 2009, 09:54 PM »
Actually, it doesn't work for me. Just makes the page jump to top.

wreckedcarzz

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,626
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #9 on: May 30, 2009, 12: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,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #10 on: May 30, 2009, 12:14 AM »
somehow i broke it.. thanks for reporting..
working to fix it now.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #11 on: May 30, 2009, 12: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

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

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #13 on: June 07, 2009, 09:12 AM »
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

fenixproductions

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,186
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #14 on: June 09, 2009, 08:41 PM »
2mouser
I am not sure it's the same feature but take a look here:
https://www.donation...ex.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.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #15 on: June 09, 2009, 08:42 PM »
yikes! you are right!! fixing now!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #16 on: June 09, 2009, 09:02 PM »
fixed now hopefully?

fenixproductions

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,186
    • View Profile
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #17 on: June 09, 2009, 09:09 PM »
2mouser
Seems to be OK.

…and I lost of my precious minutes because of that error ;)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #18 on: June 09, 2009, 11:25 PM »
dont blame me, blame Cody, he was stealing all the backslashes to build his nest.

Coeluh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #19 on: June 12, 2009, 05: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,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #20 on: June 12, 2009, 10:40 PM »
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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Re: Ability to copy geshi formatted code text.. help me test?
« Reply #21 on: June 13, 2009, 05:23 AM »
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?