This site is inactive. Owner of this forum started new forum called Admins talk forum. It can be found at http://admins.forumotion.com
. Login Register

You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

Post: #1on Mon Feb 17, 2014 6:20 pm

avatar

Kite Trojan

Retired staff
Instead of highlighting the whole code, it be eaiser if you add a select content.

View user profile

Post: #2on Mon Feb 17, 2014 6:57 pm

avatar

Ikerepc

FH Founder
I have too much job now, later. But thanks for suggestion

View user profile http://admins.forumotion.com

Post: #3on Fri Mar 07, 2014 1:36 am

avatar

Kite Trojan

Retired staff
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>');
    });

When you have time add this in your JScript management.

View user profile

Post: #4on Fri Mar 07, 2014 7:44 am

avatar

Ikerepc

FH Founder
Thanks, I will.


-------------------

View user profile http://admins.forumotion.com

Post: #5on Fri Mar 07, 2014 8:25 am

avatar

Ikerepc

FH Founder
Done.
Topic solved & Locked


-------------------

View user profile http://admins.forumotion.com

Post: #6

Sponsored content

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum