The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

bbcode

View previous topic View next topic Go down

bbcode

Post by randomer433 on April 18th 2011, 2:24 pm

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?


randomer433
New Member

Posts : 6
Reputation : 0
Language : english

Back to top Go down

Re: bbcode

Post by Base on April 18th 2011, 2:29 pm

Hi, for the select all button, you will need to create a new HTML page and add this for its content:

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.

Smile

Regards,

Base

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Re: bbcode

Post by randomer433 on April 18th 2011, 6:08 pm

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 -

randomer433
New Member

Posts : 6
Reputation : 0
Language : english

Back to top Go down

Re: bbcode

Post by Base on April 18th 2011, 6:30 pm

After the hyphen ( - sign ), you will need to put the name of your HTML page. For example:

Code:
/h9001-select-code

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Re: bbcode

Post by randomer433 on April 18th 2011, 6:35 pm

i'll try that

thanks

~R433


EDIT:
Thats not doing anything.

randomer433
New Member

Posts : 6
Reputation : 0
Language : english

Back to top Go down

Re: bbcode

Post by randomer433 on April 18th 2011, 6:54 pm

I tried again.

Does my html name have to be as complicated as yours

randomer433
New Member

Posts : 6
Reputation : 0
Language : english

Back to top Go down

Re: bbcode

Post by Base on April 18th 2011, 7:35 pm

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. Smile

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Re: bbcode

Post by randomer433 on April 19th 2011, 3:15 pm

i'll try yet again

randomer433
New Member

Posts : 6
Reputation : 0
Language : english

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum