Select all in [code] and [php]
#31
have you tried my plugin which i have attached here? Smile all your codes are correct..
<signature too big>
Reply
#32
@joshee

global.lang.php
did you mean ?
$l['code'] = "Code:";
$l['php_code'] = "PHP Code:"
and how to insert <a href="#" onclick="selectCode(this); return false;">[Select all]</a> ?


(2009-11-08, 07:34 PM)Joshee Wrote: Javascript code:
<script type="text/javascript">
function selectCode(a)
{
   var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
   if (window.getSelection)
   {
      var s = window.getSelection();
       if (s.setBaseAndExtent)
      {
         s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
      }
      else
      {
         var r = document.createRange();
         r.selectNodeContents(e);
         s.removeAllRanges();
         s.addRange(r);
      }
   }
   else if (document.getSelection)
   {
      var s = document.getSelection();
      var r = document.createRange();
      r.selectNodeContents(e);
      s.removeAllRanges();
      s.addRange(r);
   }
   else if (document.selection)
   {
      var r = document.body.createTextRange();
      r.moveToElementText(e);
      r.select();
   }
}
</script> 

And I have
Code: <a href="#" onclick="selectCode(this); return false;">[Select all]</a>
And
PHP Code: <a href="#" onclick="selectCode(this); return false;">[Select all]</a>
In the languages.
Reply
#33
Nice idea thanks.

i have change
<a href="#" onclick="selectCode(this); return false;">[Select all]</a>

to button style

<input type="button" value="SELECT ALL" style="width:100px;font-size:10px;margin:0px;padding:0px;" onclick="selectCode(this); return false;" />
Reply
#34
I dont get it now Smile

What should i do for this?
Reply
#35
You don't get what?

You just have to follow the instruction in the first page, that's all.
Reply
#36
(2009-09-28, 11:11 PM)Joey_Pham423 Wrote:
 <a href="#" onclick="selectCode(this); return false;">(SELECT ALL)</a> 

Hello
Is better to use this code?
<a href=\"#\" onclick=\"selectCode(this); return false;\">(Select All)</a>
Reply
#37
Does it work with quote?
Reply
#38
yeah it does
Reply
#39
how do I align the button to the right?

<input type="button" value="SELECT ALL" style="width:100px;font-size:10px;margin:0px;padding:0px;" onclick="selectCode(this); return false;" /> 
Reply
#40
Quote:<input type="button" value="SELECT ALL" style="text-align:right; width:100px;font-size:10px;margin:0px;padding:0px;" onclick="selectCode(this); return false;" />
Reply


Forum Jump:


Users browsing this thread: 12 Guest(s)