Content Selection Code is not working?
+2
SLGray
Van-Helsing
6 posters
Page 1 of 2
Page 1 of 2 • 1, 2
Content Selection Code is not working?
Hi dear all,
I am using this Tuturial https://help.forumotion.com/t93456-select-content-button?highlight=Select+All to add content select function in my forum but its not working? My forum version is phpbb2.
Best Regards,
Dark-Avenger.
I am using this Tuturial https://help.forumotion.com/t93456-select-content-button?highlight=Select+All to add content select function in my forum but its not working? My forum version is phpbb2.
Best Regards,
Dark-Avenger.
Re: Content Selection Code is not working?
Did you check all pages for the JavaScript?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Content Selection Code is not working?
How is it not working?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Content Selection Code is not working?
SLGray i have tested it also and it doesn't show the Select Content link at all! I don't know it might be a problem with the code that has been given..
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Content Selection Code is not working?
I am using it on my forums, and it works fine.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Content Selection Code is not working?
Can you please try adding this code to yours and check if it shows? Because to me it doesn't show anything!
This is the default code but it still doesn't show anything to me..
- Code:
function selectCode(a)
{
// Get ID of code block
var e = jQuery(a).closest('tr').next().find('.cont_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();
}
}
jQuery(function(){
jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
<a href="javascript:void()" onClick="selectCode(this)"><font
face="verdana" color="red"></font> Select Content </a>');
});
This is the default code but it still doesn't show anything to me..
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Content Selection Code is not working?
Is your forum version punBB? If it is, you need to use the second code.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Content Selection Code is not working?
It's not punBB. I am testing it on PhpBB2
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Content Selection Code is not working?
Do you have other JavaScripts? Try removing them, and see if the code works.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Content Selection Code is not working?
I have other Javascripts but no-one is affecting the Select Content Javascript..
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Content Selection Code is not working?
Are you sure i thought as well and it turns out it was an issue with other scripts, try turning other ones off one by one.
Re: Content Selection Code is not working?
Javascripts:
Result:
Still nothing!
Result:
Still nothing!
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Content Selection Code is not working?
Hi dear all,
I was find another similar tutorial in avacweb http://www.avacweb.com/t925-suggestion-for-avacweb-select-all-in-codeboxes-i-m-including-the-method?highlight=select but when I am pressing the Select Content it scrolls up the forum.
Best Regards,
Dark-Avenger
I was find another similar tutorial in avacweb http://www.avacweb.com/t925-suggestion-for-avacweb-select-all-in-codeboxes-i-m-including-the-method?highlight=select but when I am pressing the Select Content it scrolls up the forum.
Best Regards,
Dark-Avenger
Re: Content Selection Code is not working?
Can you link to a post on your forum where there is a code box please and thank you
Re: Content Selection Code is not working?
Try using a different browser. If you are using Chrome, there are known issues with somethings not working in Chrome.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Content Selection Code is not working?
Not working with me neither. I installed it and now my quote tag messed up. Now it outputs: Code: Select all
Guest- Guest
Re: Content Selection Code is not working?
Marios94 wrote:Can you please try adding this code to yours and check if it shows? Because to me it doesn't show anything!
- Code:
function selectCode(a)
{
// Get ID of code block
var e = jQuery(a).closest('tr').next().find('.cont_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();
}
}
jQuery(function(){
jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
<a href="javascript:void()" onClick="selectCode(this)"><font
face="verdana" color="red"></font> Select Content </a>');
});
This is the default code but it still doesn't show anything to me..
DId you test this code on a punbb forum that is the code for phbb2 ONLY. that why it would not work on a Punbb forum.
Re: Content Selection Code is not working?
Dosen't work. I run PHPbb2. It pops up the select content but it wont select it & changes quote to codeSir. Mayo wrote:Marios94 wrote:Can you please try adding this code to yours and check if it shows? Because to me it doesn't show anything!
- Code:
function selectCode(a)
{
// Get ID of code block
var e = jQuery(a).closest('tr').next().find('.cont_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();
}
}
jQuery(function(){
jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
<a href="javascript:void()" onClick="selectCode(this)"><font
face="verdana" color="red"></font> Select Content </a>');
});
This is the default code but it still doesn't show anything to me..
DId you test this code on a punbb forum that is the code for phbb2 ONLY. that why it would not work on a Punbb forum.
Guest- Guest
Re: Content Selection Code is not working?
Can you please link to a post that guests can see that has a code box so i can see the issue my self.
Re: Content Selection Code is not working?
I fixed the JS issue, I just removed the JS from it. To be honest it's just simply easier not to use it.Sir. Mayo wrote:Can you please link to a post that guests can see that has a code box so i can see the issue my self.
Guest- Guest
Re: Content Selection Code is not working?
Hi all,
I am using mozilla firefox and I am still facing the same problem, is it a bug of phpbb2 or the JS is wrong?
Best Regards,
Dark-Avenger
I am using mozilla firefox and I am still facing the same problem, is it a bug of phpbb2 or the JS is wrong?
Best Regards,
Dark-Avenger
Re: Content Selection Code is not working?
Hello, I have the same problem too on my two phpBB2 forums. I'm using Mozilla. I haven't added any JavaScript codes recently. The Select Content button one day has just dissapeared without any reason.
Re: Content Selection Code is not working?
I already said that i am using this code to a test forum that is PHPBB2.Sir. Mayo wrote:Marios94 wrote:Can you please try adding this code to yours and check if it shows? Because to me it doesn't show anything!
- Code:
function selectCode(a)
{
// Get ID of code block
var e = jQuery(a).closest('tr').next().find('.cont_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();
}
}
jQuery(function(){
jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
<a href="javascript:void()" onClick="selectCode(this)"><font
face="verdana" color="red"></font> Select Content </a>');
});
This is the default code but it still doesn't show anything to me..
DId you test this code on a punbb forum that is the code for phbb2 ONLY. that why it would not work on a Punbb forum.
Re: Content Selection Code is not working?
Hello,
try switching your current script with this :
try switching your current script 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.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">Select content</span>');
});
Re: Content Selection Code is not working?
Yes, that almost worked for me! But this is how it looks like now:
I can't push the "Select Content" button.
I can't push the "Select Content" button.
Re: Content Selection Code is not working?
Click it, it works.
Just add this CSS :
Just add this CSS :
- Code:
.selectCode { margin-left:10px; cursor:pointer; }
Re: Content Selection Code is not working?
No problem
If you want to change the hover color you can use this CSS :
If you want to change the hover color you can use this CSS :
- Code:
.selectCode:hover { color:#f00; }
Page 1 of 2 • 1, 2
Similar topics
» Hide Code? or Post to See Content Code?
» Code: Select Content for code box
» "Select Content" not working?
» Code Of " Select Content"
» select content code
» Code: Select Content for code box
» "Select Content" not working?
» Code Of " Select Content"
» select content code
Page 1 of 2
Permissions in this forum:
You cannot reply to topics in this forum