Justified Text - نوشته شده در (2024 Views)
Advanced Member
Carefree
مطلب: 4224
4224
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 & _
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Senior Member
MaGraham
مطلب: 1297
1297
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!

"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
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.
نوشته شده در
Forum Admin
HuwR
مطلب: 20611
20611
@MaGraham

I have enabled subscriptions (FORUM/Topic) for this forum so you can subscribe and not miss MODS when Carefree posts them smile
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
LOL. Just as easy to periodically visit and read the new posts (IMHO).
نوشته شده در
Forum Admin
HuwR
مطلب: 20611
20611
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
نوشته شده در
Snitz Forums Admin
ruirib
مطلب: 26364
26364
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.
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
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.
نوشته شده در
Development Team Member
Davio
مطلب: 12217
12217
Originally posted by ruirib
There are a few of us.
Yeah, you guys need to get out more. tongue
 
شما باید یک متن وارد کنید