bbcode
2 posters
Page 1 of 1
bbcode
I'm not sure quite where to put this.
But I want to add a new bbcode to the list on my forum.
One thats like a spoiler but it has a select all button on it.
how would I add this?
But I want to add a new bbcode to the list on my forum.
One thats like a spoiler but it has a select all button on it.
how would I add this?
randomer433- New Member
- Posts : 6
Reputation : 0
Language : english
Re: bbcode
Hi, for the select all button, you will need to create a new HTML page and add this for its content:
Then, place this code in your site description:
Replace the # sign with the page ID and the name of the page follows after the hyphen.
Regards,
Base
- 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 All</a>');
});
Then, place this code in your site description:
- Code:
<script src="/h#-" type="text/javascript"></script>
Replace the # sign with the page ID and the name of the page follows after the hyphen.
Regards,
Base
Re: bbcode
not quite sure that worked
I created a new html thing. and out in that code.
then in the sites discription I put in that code and I replaced the # with the forums link and then I wasn't sure what to put after the -
I created a new html thing. and out in that code.
then in the sites discription I put in that code and I replaced the # with the forums link and then I wasn't sure what to put after the -
randomer433- New Member
- Posts : 6
Reputation : 0
Language : english
Re: bbcode
After the hyphen ( - sign ), you will need to put the name of your HTML page. For example:
- Code:
/h9001-select-code
Re: bbcode
i'll try that
thanks
~R433
EDIT:
Thats not doing anything.
thanks
~R433
EDIT:
Thats not doing anything.
randomer433- New Member
- Posts : 6
Reputation : 0
Language : english
Re: bbcode
I tried again.
Does my html name have to be as complicated as yours
Does my html name have to be as complicated as yours
randomer433- New Member
- Posts : 6
Reputation : 0
Language : english
Re: bbcode
Posting consecutively is not tolerated unless separated by 24 hours since the last post. In future, please use the edit button.
It's what you want. Just make sure that you type in the code correctly.
It's what you want. Just make sure that you type in the code correctly.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum