Select Content Code not working.
5 posters
Page 1 of 1
Select Content Code not working.
Hello so I used this tutorial to do the select content feature for my friends forum but it doesn't work for some reason.
https://help.forumotion.com/t93456-select-content-button the tutorial is there and the forum is version phpbb3 so I used the second code for it. When the code was copied and pasted into the javascript code management it seemed to work but whenever I or other members click it, it scrolls us up at the top
Any ideas on how to solve this?
https://help.forumotion.com/t93456-select-content-button the tutorial is there and the forum is version phpbb3 so I used the second code for it. When the code was copied and pasted into the javascript code management it seemed to work but whenever I or other members click it, it scrolls us up at the top
Any ideas on how to solve this?
Re: Select Content Code not working.
Are you sure you followed everything "Correctly"?
Needhelplease:(- New Member
- Posts : 4
Reputation : 1
Language : English
Re: Select Content Code not working.
Yea javascript is enabled and it is also set to all pages. The indentations are also correct.
Re: Select Content Code not working.
hi try this code it working on my forum
javascript
i hope it works with you
javascript
- 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.selectNodeContents(a);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">code_select</span>');
});
- Code:
.selectCode {
cursor:pointer;
float:right;
text-transform:uppercase;
}
i hope it works with you
Michael_vx- Forumember
- Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt
Re: Select Content Code not working.
Hi
Are you using any other Javascript for the topics? Please post your forum Url so we can check if there are conflicting scripts.
Regards,
Pizza Boi
Are you using any other Javascript for the topics? Please post your forum Url so we can check if there are conflicting scripts.
Regards,
Pizza Boi
Pizza Boi- Hyperactive
- Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!
Re: Select Content Code not working.
Hello The Life Less One,
Since the last update to the editor the select content code on versions like phpbb2 stopped working. Over on FR support there's a code that should work for all versions, regardless.
Replace your script by :
Then add the following to your stylesheet :
Display > Colors > CSS stylesheet
Since the last update to the editor the select content code on versions like phpbb2 stopped working. Over on FR support there's a code that should work for all versions, regardless.
Replace your script by :
- 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.selectNodeContents(a);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">Sélectionner le contenu</span>');
});
Then add the following to your stylesheet :
Display > Colors > CSS stylesheet
- Code:
.selectCode { float:right; text-transform: uppercase; cursor:pointer; }
div.cont_code { clear: right; }
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum