This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Allow copy code easily by showing a copy button or icon

It is really nice to see that we can insert code into the post. It would be even nicer if there is copy button floating at the corner and allowing the user to copy the code by simply clicking it. Something like the below that is provided on other tech sites prompts 'Copy code' when mouse over that copy icon. 

Thanks!

Easton

  • thank you for the suggestion - we will look into this!

     



    Raquel Winkler
    OpenText Community Manager
    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • Hi Easton.  Do you have any example of a site that does that?  I have seen this before but don't have a site in mind at the moment.

    If you mean once the code is on the page and in some kind of form field we do not have that capability as the only form we have is for composing a post/comment and our community uses the TinyMCE editor which is a third party editor and we have little control over its functionality.

    Let me know if you have any example and we will look into what we can do.

    Thanks.



    Chris Seamons
    OpenText Community Management
    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a "Like" or click on "Verify Answer" under the "More" button

  • Thanks for the prompt response, Chris.

    I just dig a little bit and find below two examples, I remember seeing such an ability in StackOverflow before but I might be wrong (On StackOverflow there is copy icon at the corner today).

    I was wondering if our engineer or the customer posted some code, the others might want to copy the code and put it to use.

    https://gobyexample.com/timeouts

    https://www.ibm.com/docs/en/i/7.2?topic=preparedstatements-example-parametermetadata

    Best regards,

    Easton

  • Our developer confirmed that this functionality is not part of the TinyMCE editor options or configuration and since most of our posts do not contain code it would be problematic to add code to the page to allow or specify what one would want to allow to be copied.  Although not as simple as the copy button there are addons that will automatically copy highlighted text so maybe this would be the way for you to accomplish this.

    Sorry I can't really give a better solution.



    Chris Seamons
    OpenText Community Management
    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a "Like" or click on "Verify Answer" under the "More" button

  • This is fine Chris. Thank you for the clarification~.