Justified Text

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/70492?pagenum=1
05 November 2025, 12:58

Topic


Carefree
Justified Text
26 April 2013, 13:12


This mod adds justified paragraph ability (and button) to the editor. It's available on SnitzBitz. Put this image into your images folder (save it as "icon_editor_justify.gif"), then make the following changes:

"inc_code.js"
Code:

Look for the following lines (appx 177-196):

function left() {
var text = getText();
if (helpstat) {
alert("Left tag aligns the enclosed text to the left.\n\nUSE: This text is aligned left");
} else if (basic) {
AddTxt="" + text + "";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be aligned left",text);
} else {
txt=prompt("Text to be aligned left","Text");
}
if (txt!=null) {
AddTxt=""+txt+"";
AddText(AddTxt);
}
}
}


Below those, insert these:

function justify() {
var text = getText();
if (helpstat) {
alert("Justify tag justifies a paragraph (fills the line as much as possible with even right and left borders).\n\nUSE: [justify]This paragraph has justified margins.[/justify]");
} else if (basic) {
AddTxt="[justify]" + text + "[/justify]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be justified",text);
} else {
txt=prompt("Text to be justified","Text");
}
if (txt!=null) {
AddTxt="[justify]"+txt+"[/justify]";
AddText(AddTxt);
}
}
}

"inc_func_common.asp"
Code:

Look for the following line (appx 479):

fString = replace(fString, "
", "<br />", 1, -1, 1)

Above it, insert this:

fString = doCode(fString, "[justify]", "[/justify]", "<p align=""justify"">", "</p>")
"inc_func_posting.asp"
Code:

Look for the following lines (appx 313-314):

fString = replace(fString, "<div align=""right"">", "", 1, -1, 1)
fString = replace(fString, "</div id=""right"">", "
", 1, -1, 1)

Below them, insert these:

fString = replace(fString, "<p align=""justify"">","[justify]", 1, -1, 1)
fString = replace(fString, "</p>","[/justify]", 1, -1, 1)
"inc_iconfiles.asp"
Code:

Look for the following line (appx 48):

Const strIconEditorHR = "icon_editor_hr.gif|23|22"

Below it, insert this:

Const strIconEditorJustify = "icon_editor_justify.gif|23|22"

"inc_post_buttons.asp"
Code:

Look for the following line (appx 58):

" <a href=""Javascript:hr();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorHR,"Horizontal Rule","align=""top""") & "</a>" & _

Above it, insert this:

" <a href=""Javascript:justify();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorJustify,"Justify","align=""top""") & "</a>" & _

"pop_forum_code.asp"
Code:

Look for the following lines (appx 65-68):

" <p><b>Striking Text:</b><br />" & vbNewLine & _
" Enclose your text with and <br />" & vbNewLine & _
" <i>Example:</i> <b></b>mistake<b></b> = <s>mistake</s>" & vbNewLine & _
" </p>" & vbNewLine & _

Below those, insert these:

" <p><b>Aligning Text Justified:</b><br />" & vbNewLine & _
" Enclose your text with [justify] and [/justify]" & vbNewLine & _
" </p>" & vbNewLine & _

 

Replies ...


MaGraham
29 April 2013, 04:25


LOVE IT! cool

I wish you would consider starting an email list and, for those who are interested, send out an email notification when you've done a new mod, Carefree. And, place me at the top of that list.

Seriously, I would have hated to have missed this! I LOVE adding a little something extra for my members! And, for those of us who are perfectionists. . .this is COOL! bigsmile
THANK YOU!

Carefree
29 April 2013, 05:35


I've written hundreds of mods over the years, some on request, most in answer to suggestions. For a while, I kept a folder full of Snitz mods - but I guess I didn't always put the new ones there. I was looking for one I had done regarding embedding a Google Image link, but cannot seem to find it. Doesn't matter. I wrote another little mod on a similar idea (embedding a CNN news link). Now I'm considering a single link to retrieve both based on a topic's title if in a news forum.
HuwR
29 April 2013, 08:19


@MaGraham

I have enabled subscriptions (FORUM/Topic) for this forum so you can subscribe and not miss MODS when Carefree posts them smile
Carefree
29 April 2013, 09:44


LOL. Just as easy to periodically visit and read the new posts (IMHO).
HuwR
29 April 2013, 10:26


Originally posted by Carefree
LOL. Just as easy to periodically visit and read the new posts (IMHO).
I don't think everyone is as sad as we are Carefree bigsmile
ruirib
29 April 2013, 11:05


Originally posted by Carefree
LOL. Just as easy to periodically visit and read the new posts (IMHO).
I don't think everyone is as sad as we are Carefree bigsmile There are a few of us.
Carefree
29 April 2013, 12:27


Not sure I post mods frequently enough to make it worth the effort. Cannot seem to keep my mind on anything long enough to finish it. It's been several years since I was able to watch an entire movie without losing interest. Fortunately, I can still read a good book. I'll really be a sad case when I lose the rest of my vision.
Davio
29 April 2013, 14:20


Originally posted by ruirib
There are a few of us.
Yeah, you guys need to get out more. tongue
© 2000-2021 Snitz™ Communications