Announcement

Collapse
No announcement yet.

Code copy button?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Code copy button?

    Hi Garry,

    It may have been raised before, but is there any chance the vBulletin has
    some sort of addon button to copy the code window text to the clipboard?
    Like on CodeProject (I think).

    Obviously, I use "highlight, scroll, copy" at the moment, but is a bit of
    a pain with long listings and (due to eyesight) the code window is taller
    than the browser display, meaning mode akwardness.
    And often it never gets the last line end.

    Not really a big deal, but if you don't ask ...

    Thanks for the poffs/gbThreads updates also.

    Cheers, Mike.
    There are only two speeds for computers: fast enough, and too bloody slow.
    And there are 10 types of programmer -- those that know binary, and those that don't.

  • #2
    Maybe this one...

    http://www.vbulletin.org/forum/showthread.php?t=178176
    Bernard Ertl
    InterPlan Systems

    Comment


    • #3
      Mike,
      I don't know of any such option. From what I've read, it has to be a mod such as the one Bern pointed out. At the moment, we're unable to add mods to the forum.

      However there were some earlier posts about ways to shift-click (or something like that) that would capture the code content. I'll go look to see if I can find the threads.

      Comment


      • #4
        Thanks. I already do the click, shift-click thing.
        That is what the 'copy button' would ameliorate.

        Cheers, Mike.
        There are only two speeds for computers: fast enough, and too bloody slow.
        And there are 10 types of programmer -- those that know binary, and those that don't.

        Comment


        • #5
          Hi Mike,

          If using IE you can hold the Ctrl key depressed while clicking on the post just to the right of the
          Code:
           listing
          Rgds, Dave

          Comment


          • #6
            Internet Explorer Pah! :tongue:
            I only use Firefox (43)

            Cheers, Mike.
            There are only two speeds for computers: fast enough, and too bloody slow.
            And there are 10 types of programmer -- those that know binary, and those that don't.

            Comment


            • #7
              Someone here wrote a tray application using PB which does exactly this.

              It's been a while but let me look

              I found this from Pierre Belisle for IE..

              http://www.powerbasic.com/support/pb...ad.php?t=24475

              .. which came from here by Adam Drake..
              http://www.powerbasic.com/support/pb...highlight=copy

              I think these work only with IE but someone else should be able to tell.

              And then there is the browser-independent way from Patrice Terrier..

              http://www.powerbasic.com/support/pb...ighlight=forum

              I found these using 'advanced search' here for "subject only" with keywords 'copy', 'clip', 'BBS', "forum" and "code." (one at a time, not all at once.)

              I cannot seem to find this thing I used to use. It sat in the tray, and you could select in browser, copy; then you clicked on the tray icon and it gave you a list control with one row for each "code block" found in the copied text and you could then copy that anywhere.


              MCM
              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                Hi Mike,
                I only use Firefox (43)
                Probably can't help much then but ..

                In Firefox, to ease copying the text from a code listing that is too long for a easy cut-n-paste (too much scrolling) you might try Right-Clicking in the listing, Select 'Inspect Element' from the context menu. That should highlight the "<pre class="alt2".." code listing in the Inspector, which you can right-click again, then select 'Copy Inner HTML'.

                That copies all the 'code' text (with formatting etc) to the clipboard.

                The only problem here is that the text comprises lines terminated with %LF (no %CR). That's not a problem for some editors (I use EditPlus) but the PB Editor will choke on it.

                A clipboard utilty eg.
                Code:
                            Clipboard Get Text To sTemp
                            Replace $Lf With $Crlf In sTemp
                            Clipboard Set Text sTemp
                would take care of that easily enough (you could have it sitting on your desktop?).

                FWIW Might be easier to keep a copy of IE just for browsing the PBForums..

                EDIT: Oh No! that Firefox method doesn't work for Pierre's postings !! - dang, that's N/A then!
                Last edited by Dave Biggs; 1 Jan 2016, 01:34 AM. Reason: Rats!
                Rgds, Dave

                Comment


                • #9
                  Actually, (before I stopped using it), the PB Editor is just fine with
                  Unix line ends, it is the compiler that barfs. Pretty inconsistant.

                  Fortunately, vim has a command to switch between Unix and Dos, if so desired.

                  Cheers, Mike.
                  There are only two speeds for computers: fast enough, and too bloody slow.
                  And there are 10 types of programmer -- those that know binary, and those that don't.

                  Comment


                  • #10
                    A long while back, someone suggested this method that I use:
                    click the "QUOTE" button that opens a reply screen,
                    CTRL-A to select all the text in the message,
                    CTRL-C to copy it to the clipboard,
                    ALT-TAB to your editor, and
                    CTRL-V to paste it.
                    Then go back to the reply screen and cancel it...

                    Tedious, but it works -- mostly. Unfortunately, if the code listing displays in colors, this method will result in text that includes all the color commands, making it a project to extract plain code text. In this case, I found that the click/shift-click method is the only one that works. Again, tedious.

                    However, I'm now going to try some of the other methods suggested!

                    -John

                    Comment


                    • #11
                      You should still be able to click and drag to highlight.

                      Go to the top-left corner of the code textbox and left click and hold to the
                      left and above the first character, but still inside the code textbox.

                      Then drag the cursor, holding the left button, down the textbox.
                      The text will scroll automatically when you reach the bottom and go just
                      beyond the limit of the textbox. When all the text is highlighted let go of the
                      left mouse button and hit Ctrl/C to copy.

                      The textbox scrolls slowly for me, though. It will take a few seconds to get
                      through a long bit of code. I'll go test it in Chrome. Yes. It works in Chrome.
                      I suppose it will work in Firefox, too, though I don't have Firefox installed.
                      It scrolls a bit faster in Chrome.

                      Still far from the Ctrl/left-click combo that works in IE, but it's something.
                      The world is strange and wonderful.*
                      I reserve the right to be horrifically wrong.
                      Please maintain a safe following distance.
                      *wonderful sold separately.

                      Comment


                      • #12
                        I wrote a set utilities to combine sources from PB forum into a CHM format,(back in 2005, using PB8...), so each source code have "copy to clipboard" button at top of the each code section.

                        If anyone is interested, I can post sources. I haven't tested with new forum, but that worked fine with old forum files.

                        You can check the test version of compiled CHM archive from the attachment.
                        Attached Files

                        Comment


                        • #13
                          When I opened this, all of what I guess are buttons, are just red X's

                          Also, when I clicked 'next newest topic' and similar, I get the error
                          "The program cannot display this web page" or close.

                          Think it needs tweaking for vBulletin and/or site nameing conventions.
                          (Just a totally uneducated guess; I don't do html.)

                          Cheers, Mike.
                          There are only two speeds for computers: fast enough, and too bloody slow.
                          And there are 10 types of programmer -- those that know binary, and those that don't.

                          Comment

                          Working...
                          X