Select Content don't work on my forum
+2
Base
isnanz
6 posters
Page 1 of 1
Select Content don't work on my forum
http://limadua.forumotion.com/t684-test-code-and-select-content
I've followed step by step https://help.forumotion.com/t93456-select-content-button
why don't work?
I've followed step by step https://help.forumotion.com/t93456-select-content-button
why don't work?
Re: Select Content don't work on my forum
Hi, did you use the 'phpBB 2' code? You will also need to set its placement to all pages.
Re: Select Content don't work on my forum
Base wrote:Hi, did you use the 'phpBB 2' code? You will also need to set its placement to all pages.
didn't work
Re: Select Content don't work on my forum
It's working for me. Perhaps you have added it wrong... please try again.
Re: Select Content don't work on my forum
Base wrote:It's working for me. Perhaps you have added it wrong... please try again.
like this..
but still didn't work...
Re: Select Content don't work on my forum
Where are your Forumotion links? Do NOT remove them unless you've paid. Even then, the phpBB link must still be there.
Are you sure that your forum version is phpBB 2?
Are you sure that your forum version is phpBB 2?
Re: Select Content don't work on my forum
Hi,
I don't know why this is happening?
Could you please remove the code all together and leave it as either blank or with just a "." in it.
Save it.
Then remove the "." and insert this code.
Save again and it should work
I don't know why this is happening?
Could you please remove the code all together and leave it as either blank or with just a "." in it.
Save it.
Then remove the "." and insert this code.
- 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>');
});
Save again and it should work
Darren1- Helper
- Posts : 11853
Reputation : 566
Language : English
Re: Select Content don't work on my forum
Darren1 wrote:Hi,
I don't know why this is happening?
Could you please remove the code all together and leave it as either blank or with just a "." in it.
Save it.
Then remove the "." and insert this code.
- 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>');
});
Save again and it should work
still didn't work..
http://limadua.forumotion.com/t684-test-code-and-select-content
Re: Select Content don't work on my forum
It may just be a simple code typo, re-read the code and check for any typos.
DarkBlade- Forumember
- Posts : 206
Reputation : 14
Language : English
Re: Select Content don't work on my forum
DarkStar. wrote:The code for phpbb2 doesn't work for me too
Well, in your profile details it says you're running on phpBB 3. So maybe perhaps use the other one...?
Re: Select Content don't work on my forum
My forum is phpbb3, but i put this code on a phpbb2 test forum and it doesn't work
Re: Select Content don't work on my forum
Try to experiment with this
phpbb2
and add this to css
and this to phpbb3
phpbb2
- Code:
function selectCode(a){a=a.parentNode.tagName==="B"?$(a).closest("table").find(".cont_code")[0]:$(a).closest("dl").find("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) dt").add($("div.cont_code").closest("table").find("span.genmed b")).append('<span onClick="selectCode(this)" class="selectCode">Sélectionner le contenu</span>');
});
and add this to css
- Code:
.selectCode { float:right; text-transform: uppercase; cursor:pointer; }
and this to phpbb3
- Code:
function selectCode(a)
{
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('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();
}
}
if(text){}else{ var text = 'Selecionar todos';}
jQuery(document).ready(function(){
jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
});
Step 1:
Navigate to...
Administration Panel → Modules Tab → Javascript codes management → Create a new javascript
Step 2:
Call it whatever you like and set its placement to all pages.
Re: Select Content don't work on my forum
May not be the problem of code
Perhaps the problem is in your board
These codes work well , Perhaps you put codes incorrectly
Because it seems puzzling , How to not working with you !!
Try to check in more action steps the code
Greetings
Perhaps the problem is in your board
These codes work well , Perhaps you put codes incorrectly
Because it seems puzzling , How to not working with you !!
Try to check in more action steps the code
Greetings
Re: Select Content don't work on my forum
I put the codes corectly, i am sure. Take a look here: http://test2010.forumgratuit.ro/t9-sasdasdsadsadasdadsf#16
It's not working
It's not working
Re: Select Content don't work on my forum
Could it be that you have some other coding on your forum which could be conflicting this?
Re: Select Content don't work on my forum
Ahmedvirus wrote:Try to experiment with this
phpbb2
- Code:
function selectCode(a){a=a.parentNode.tagName==="B"?$(a).closest("table").find(".cont_code")[0]:$(a).closest("dl").find("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) dt").add($("div.cont_code").closest("table").find("span.genmed b")).append('<span onClick="selectCode(this)" class="selectCode">Sélectionner le contenu</span>');
});
and add this to css
- Code:
.selectCode { float:right; text-transform: uppercase; cursor:pointer; }
and this to phpbb3
- Code:
function selectCode(a)
{
// Get ID of code block
var e = a.parentNode.parentNode.getElementsByTagName('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();
}
}
if(text){}else{ var text = 'Selecionar todos';}
jQuery(document).ready(function(){
jQuery("dl.codebox dt").not("dl.spoiler > dt").html('Code: <a href="#" onclick="selectCode(this); return false;" title="Select all the content" class="code-a"> Select Content </a>');
});Step 1:
Navigate to...
Administration Panel → Modules Tab → Javascript codes management → Create a new javascript
Step 2:
Call it whatever you like and set its placement to all pages.
not working for me
Re: Select Content don't work on my forum
Base wrote:Could it be that you have some other coding on your forum which could be conflicting this?
maybe but i understand with problem..
Re: Select Content don't work on my forum
Try the code on another forum ok !maybe but i understand with problem
Re: Select Content don't work on my forum
I created a new phpbb2 forum and both codes worked. The code for phpbb2 wasn't working because i modified viewtopic_body in a haotic way. Thanks
Re: Select Content don't work on my forum
working if i create Display -> Templates -> General -> overall_header / Top of the page<script type="text/javascript" src="http://limadua.forumotion.com/10195.js"></script>
http://limadua.forumotion.com/t684-test-code-and-select-content
http://limadua.forumotion.com/t684-test-code-and-select-content
Re: Select Content don't work on my forum
isnanz, posting consecutively is not tolerated unless separated by 24 hours since the last post. This is your 2nd reminder about this, next time will be a warning.
Solved => Locked and Archived
Solved => Locked and Archived
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum