We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Paragraph Indent Button; By Zedboards
Topic Started: Feb 3 2010, 11:32 PM (1,982 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: Zedboards
Paragraph Indent Button
 
We added some buttons for our forum including one called P_Indent that will indent a whole paragraph (instead of just the first line) and another called Literary Form, which allows a piece of text to be placed into an area with a different color background. At first Internet Explorer did not like this, but it turned out, the order of the code mattered for some reason. What we now have, which includes several other tags (center, right, off topic and hr) looks like the following. Please note, these have not been tested with either Safari or Opera:
Code:
 
<script>

ubb_tag("Form","literary","<div style='position:relative; width:500px; background-color:#D5DFD9; border-top:1px solid #3D5C3D; font-family: Georgia, serif; font-size:10pt; text-align:justify; margin-left:auto; margin-right:auto; padding:10px'><% INNER %></div>",0,"for presentation of literary texts",0,'Literary Form');

ubb_tag("Line Indent","indent","",-1,"Put before a line, it will indent this line",0,'indent');

ubb_tag("Paragraph Indent","P_indent","<div style='text-align:justify; margin-left:50px'><% INNER %></div>",0,"Marked text gets indent as a whole",0,'P_indent');

ubb_tag("Center","center","<div style='text-align:center'><% INNER %></div>",0,"Marked text/elements get centered",0,'Center');

ubb_tag("Right","right","<div style='text-align:right'><% INNER %></div>",0,"Marked text/elements get right-justified",0,'Right');

ubb_tag("Off Topic","offtopic","<i><b><font color='#7A7A7A'>Off Topic:</font></i></b><br><font color='#8F8F8F'><% INNER %></font>",0,"Mark text as off topic");

ubb_tag("Line","hr","",-1,"Draws horizontal line - position cursor",0,'HR');

</script>


Zed
Offline Profile Quote Post Goto Top
 
Zeidlik1219
Member
[ * ]
Where do I put this?
Offline Profile Quote Post Goto Top
 
Daruke-ZNR
Member Avatar
WolfClaw GDC Network Administrator
[ * ]
I would assume below the board, like nearly every other script out there. :P
Offline Profile Quote Post Goto Top
 
Lout-ZNR
Member Avatar
He came, he saw...
[ *  *  * ]
Looking at that code I think you'll find it works in conjunction with the following code -

http://resources.zetaboards.com/topic/5079145/
Offline Profile Quote Post Goto Top
 
Kally
Member Avatar
Member
[ * ]
The P_Indent isn't working for me? What is it I type to get the indent to work? [p_indent] or is it something else?
Thank you (:
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

There already is an indent feature on ZetaBoards by default. Just add [indent] where you would like to indent. There is no closing tag required.
Offline Profile Quote Post Goto Top
 
Kally
Member Avatar
Member
[ * ]
Yes but that's just the first line, isn't it? I'm talking about the entire paragraph.
Edited by Kally, Aug 28 2012, 04:13 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript">
$('#c_bbcode button:last').after(' <button type="button" onclick="ZetaTag(\'PINDENT\')">Indent</button>');

$('td.c_post, #topic_review td').each(function () {
$(this).html($(this).html().replace(/\[pindent\](.+?)\[\/pindent\]/gi, '<div style="text-align: justify; margin-left: 50px">$1</div>'));
});
</script>
Try that. If you don't need the BBCode button, then I suggest using the class BBCode tag instead.
Online Profile Quote Post Goto Top
 
Kally
Member Avatar
Member
[ * ]
It works fine, thank you!
I was wondering if there was a way to get the margin on the right hand side, too?
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
margin-left: 50px
Change that to this:
Code:
 
margin: 0 50px
Online Profile Quote Post Goto Top
 
Kally
Member Avatar
Member
[ * ]
It's perfect! Thank you very much! :D
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply