Code Of " Select Content" Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Code Of " Select Content"

    avatar
    Guest
    Guest


    Solved Code Of " Select Content"

    Post by Guest July 15th 2013, 4:08 pm

    I want a code that makes members copy the whole code by selecting on "select content" like the one in help.forumotion.com:rose:


    Last edited by Egyptian Revolution on July 15th 2013, 9:19 pm; edited 1 time in total
    Derri
    Derri
    Helper
    Helper


    Male Posts : 8711
    Reputation : 638
    Language : English & Basic French
    Location : Scotland, United Kingdom

    Solved Re: Code Of " Select Content"

    Post by Derri July 15th 2013, 4:12 pm

    avatar
    Guest
    Guest


    Solved Re: Code Of " Select Content"

    Post by Guest July 15th 2013, 4:18 pm

    thanks but nothing happened
    novacane.
    novacane.
    Forumember


    Female Posts : 59
    Reputation : 3
    Language : english

    Solved Re: Code Of " Select Content"

    Post by novacane. July 15th 2013, 5:06 pm

    are you sure you have your javascripts activated?
    Derri
    Derri
    Helper
    Helper


    Male Posts : 8711
    Reputation : 638
    Language : English & Basic French
    Location : Scotland, United Kingdom

    Solved Re: Code Of " Select Content"

    Post by Derri July 15th 2013, 5:25 pm

    Yes make sure you activate Javascript Very Happy

    You'll find the option in the Javascript management area.
    avatar
    Guest
    Guest


    Solved Re: Code Of " Select Content"

    Post by Guest July 15th 2013, 6:09 pm

    it is active
    Derri
    Derri
    Helper
    Helper


    Male Posts : 8711
    Reputation : 638
    Language : English & Basic French
    Location : Scotland, United Kingdom

    Solved Re: Code Of " Select Content"

    Post by Derri July 15th 2013, 6:15 pm

    Did you ensure you took the correct code?
    avatar
    Guest
    Guest


    Solved Re: Code Of " Select Content"

    Post by Guest July 15th 2013, 7:58 pm

    yes, i used this code for phpbb3

    Code:
    function selectCode(a)
        {
          // Get ID of code block
          var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
         
          // Not IE
          if (window.getSelection)
          {
              var s = window.getSelection();
              // Safari
              if (s.setBaseAndExtent)
              {
                s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
              }
              // Firefox and Opera
              else
              {
                // workaround for bug # 42885
                if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
                {
                    e.innerHTML = e.innerHTML + ' ';
                }
         
                var r = document.createRange();
                r.selectNodeContents(e);
                s.removeAllRanges();
                s.addRange(r);
              }
          }
          // Some older browsers
          else if (document.getSelection)
          {
              var s = document.getSelection();
              var r = document.createRange();
              r.selectNodeContents(e);
              s.removeAllRanges();
              s.addRange(r);
          }
          // IE
          else if (document.selection)
          {
              var r = document.body.createTextRange();
              r.moveToElementText(e);
              r.select();
          }
        }
        if(text){}else{ var text = 'Selecionar todos';}
        jQuery(document).ready(function(){
     
         jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a
     href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
        });
    Derri
    Derri
    Helper
    Helper


    Male Posts : 8711
    Reputation : 638
    Language : English & Basic French
    Location : Scotland, United Kingdom

    Solved Re: Code Of " Select Content"

    Post by Derri July 15th 2013, 8:12 pm

    Egyptian Revolution wrote:yes, i used this code for phpbb3

    Code:
    function selectCode(a)
        {
          // Get ID of code block
          var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
         
          // Not IE
          if (window.getSelection)
          {
              var s = window.getSelection();
              // Safari
              if (s.setBaseAndExtent)
              {
                s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
              }
              // Firefox and Opera
              else
              {
                // workaround for bug # 42885
                if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
                {
                    e.innerHTML = e.innerHTML + ' ';
                }
         
                var r = document.createRange();
                r.selectNodeContents(e);
                s.removeAllRanges();
                s.addRange(r);
              }
          }
          // Some older browsers
          else if (document.getSelection)
          {
              var s = document.getSelection();
              var r = document.createRange();
              r.selectNodeContents(e);
              s.removeAllRanges();
              s.addRange(r);
          }
          // IE
          else if (document.selection)
          {
              var r = document.body.createTextRange();
              r.moveToElementText(e);
              r.select();
          }
        }
        if(text){}else{ var text = 'Selecionar todos';}
        jQuery(document).ready(function(){
     
         jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a
     href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
        });

    Have you got other javascripts installed? If so, try removing them one by one to see if that's causing a clash.
    avatar
    Guest
    Guest


    Solved Re: Code Of " Select Content"

    Post by Guest July 15th 2013, 9:17 pm

    thanks  i delete some codes that caused the problem and i solved it
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51554
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Code Of " Select Content"

    Post by SLGray July 15th 2013, 9:21 pm

    Topic Solved & Locked



    Code Of " Select Content" Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.