Add select content to code box
Liquid Code :: Coding Factory :: Scripting :: Finished scripts :: Other
Page 1 of 1 • Share
Add select content to code box
_Twisted_Mods_- Posts : 101
Reputation : 3
Birthday : 1986-08-05
Join date : 2014-10-03
Age : 37
Location : USA
[script=Your choice=in the topics]
- Code:
$(function(){
$('.codebox dt').append(' <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a" style="float:right;"> Select Content </a> ');
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{
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)}
}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()}}if(text){}else{
var text='Selecionar todos'
}
Similar topics
» Liquid Code Staff
» How can I modify this code to work with new f/m chatbox?
» Liquid Code Forum Rules
» How can I modify this code to work with new f/m chatbox?
» Liquid Code Forum Rules
Liquid Code :: Coding Factory :: Scripting :: Finished scripts :: Other
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|