Help Desk Software & Beyond
May 21, 2012, 11:39:40 PM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [MOD] 'Add more BBCode options' (TTX v 2.24 and down)  (Read 2043 times)
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« on: October 19, 2007, 04:16:59 PM »

Right now the BBCode translator in TTX supports the following...

Bold
Italics
Underline
Code
Smaller Text
URL
Image



Here's how to add the following...

Bigger Text

Code:
[big] [/big]

Subscript Text

Code:
[sub] [/sub]

Superscript Text

Code:
[sup] [/sup]



In TTXMarkup.pm...

Quote
$buff =~ s/\[(\/?)(u|b|i|code|small|big|sub|sup)]/<$1$2>/gi;

and

Quote
$buff =~ s/\[(\/?)(u|b|i|code|small|big|sub|sup)]//gi;

Now the system will recognize and handle the new BBCodes.



Modify the BBCode editor in both newticket.html and ticket.html templates by adding these three new buttons.

Code:
<input alt="Bigger" title="Bigger" tabindex="-1" type=submit style="margin: 3px; font-size: small; width: 33px; height: 23px; font-weight: normal; text-decoration: none; font-family: Times, serif;" value=big onclick="markup('[big]', '[/big]', document.forms.newticket.problem); return false;">

<input alt="Subscript" title="Subscript" tabindex="-1" type=submit style="margin: 3px; font-size: small; width: 33px; height: 23px; font-weight: normal; text-decoration: none; font-family: Times, serif;" value=sub onclick="markup('[sub]', '[/sub]', document.forms.newticket.problem); return false;">

<input alt="Superscript" title="Superscript" tabindex="-1" type=submit style="margin: 3px; font-size: small; width: 33px; height: 23px; font-weight: normal; text-decoration: none; font-family: Times, serif;" value=sup onclick="markup('[sup]', '[/sup]', document.forms.newticket.problem); return false;">



Don't forget to modify your markuphelp.html template also.  (Currently it's also missing the help item for "small" text)



The possibilities are endless.  Anything that has a corresponding HTML tag is most easily added.
« Last Edit: January 16, 2008, 05:28:58 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #1 on: October 19, 2007, 04:19:32 PM »

The <big></big> and <small></small> tags are supposed to just add 1 and subtract 1 from the browser's current font size.  However, they might not be properly recognized in all browsers.

I strongly suggest you add these to your CSS list.

This is just an example:

Quote
small       { font-size: 9px;}
big         { font-size: 13px;}
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #2 on: October 19, 2007, 04:39:36 PM »

Add an email button to the editor...

Code:
<input alt="email" title="email" tabindex="-1" type=submit style="margin: 3px; font-size: small; width: 33px; height: 23px; font-weight: normal; font-family: Times, serif;" value="email" onclick="markup('[url mailto:name@example.com]', '[/url]', document.forms.newticket.problem); return false;">

It's just a modified hyperlink button so you don't need to change the module.
Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Sparky
Moderator
Hero Member
*****

Karma: 83
Posts: 2,228


stop pushing all those buttons


View Profile
« Reply #3 on: October 19, 2007, 09:59:24 PM »

How about a strikeout button...

Code:
<input alt="Strikeout" title="Strikeout" tabindex="-1" type=submit style="margin: 3px; font-size: small; width: 33px; height: 23px; font-weight: normal; text-decoration: line-through; font-family: Times, serif;" value=strike onclick="markup('[strike]', '[/strike]', document.forms.newticket.problem); return false;">


In TTXMarkup.pm...

Quote
$buff =~ s/\[(\/?)(u|b|i|code|small|strike)]/<$1$2>/gi;

Quote
$buff =~ s/\[(\/?)(u|b|i|code|small|strike)]//gi;
« Last Edit: October 19, 2007, 10:06:31 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 19 queries.