Select content button
3 posters
Page 1 of 1
Select content button
Hello,
I followed this TUT https://help.forumotion.com/t93456-select-content-button but no select code button is showing up, any help would be nice.
here the code:
CSS:
I followed this TUT https://help.forumotion.com/t93456-select-content-button but no select code button is showing up, any help would be nice.
here the code:
- Code:
function
selectCode(a){a=$(a).closest("dl").find(".cont_code,code")[0];if(window.getSelection){var
c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+="
");var b=document.createRange();b.setStart(a.firstChild, 0);b.setEnd(a,
a.childNodes.length);c.removeAllRanges();c.addRange(b)}}else
document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())};
$(function(){$("dl.codebox:not(.spoiler,.hidecode)
> dd.code, dl.codebox:not(.spoiler,.hidecode) > dd >
code").closest("dl").find('dt').append('<span
onclick="selectCode(this)" class="selectCode">Select
content</span>')});
CSS:
- Code:
.selectCode { float:right; text-transform: uppercase; cursor:pointer; }
div.cont_code { clear: right; }
Last edited by Sir. Mayo on 11.05.15 23:31; edited 1 time in total
Re: Select content button
Did you edit the code at all ? It looks kind of messy
Try replacing it with this :
Try replacing it with this :
- Code:
function selectCode(a){a=$(a).closest("dl").find(".cont_code,code")[0];if(window.getSelection){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+=" ");var b=document.createRange();b.setStart(a.firstChild, 0);b.setEnd(a, a.childNodes.length);c.removeAllRanges();c.addRange(b)}}else document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())};
$(function(){$("dl.codebox:not(.spoiler,.hidecode) > dd.code, dl.codebox:not(.spoiler,.hidecode) > dd > code").closest("dl").find('dt').append('<span onclick="selectCode(this)" class="selectCode">Select content</span>')});
Re: Select content button
Sir. Mayo wrote:Hello,
I followed this TUT https://help.forumotion.com/t93456-select-content-button but no select code button is showing up, any help would be nice.
here the code:
- Code:
function
selectCode(a){a=$(a).closest("dl").find(".cont_code,code")[0];if(window.getSelection){var
c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+="
");var b=document.createRange();b.setStart(a.firstChild, 0);b.setEnd(a,
a.childNodes.length);c.removeAllRanges();c.addRange(b)}}else
document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())};
$(function(){$("dl.codebox:not(.spoiler,.hidecode)
> dd.code, dl.codebox:not(.spoiler,.hidecode) > dd >
code").closest("dl").find('dt').append('<span
onclick="selectCode(this)" class="selectCode">Select
content</span>')});
CSS:
- Code:
.selectCode { float:right; text-transform: uppercase; cursor:pointer; }
div.cont_code { clear: right; }
Ange Tuteur wrote:Did you edit the code at all ? It looks kind of messy
Try replacing it with this :
- Code:
function selectCode(a){a=$(a).closest("dl").find(".cont_code,code")[0];if(window.getSelection){var c=window.getSelection();if(c.setBaseAndExtent)c.setBaseAndExtent(a,0,a,a.innerText.length-1);else{window.opera&&a.innerHTML.substring(a.innerHTML.length-4)=="<BR>"&&(a.innerHTML+=" ");var b=document.createRange();b.setStart(a.firstChild, 0);b.setEnd(a, a.childNodes.length);c.removeAllRanges();c.addRange(b)}}else document.getSelection?(c=document.getSelection(),b=document.createRange(),b.selectNodeContents(a),c.removeAllRanges(),c.addRange(b)):document.selection&&(b=document.body.createTextRange(),b.moveToElementText(a),b.select())};
$(function(){$("dl.codebox:not(.spoiler,.hidecode) > dd.code, dl.codebox:not(.spoiler,.hidecode) > dd > code").closest("dl").find('dt').append('<span onclick="selectCode(this)" class="selectCode">Select content</span>')});
It turns out it was a Google tracking script i had installed. But i removed it and everything is find now thanks @Ange Tuteur
Similar topics
» Select content
» select content button in code box
» Select content button doesn't work
» "select content"
» Select Content
» select content button in code box
» Select content button doesn't work
» "select content"
» Select Content
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum