I have hacked the asp files so that the Format: bar in the post new topic/reply editor works better.
Making a list of several lines just by highlighting them is now possible.
I supply the code under here:
The only thing you will need is to create 4 new icons: icon_editor_listalpha (alphabetical list)
icon_editor_listnum (numbered list)
icon_editor_heading4
icon_editor_heading5
The icons have been put into http://sectorzerox.sytes.net/icons.zip. Thanks ZeroAvengerX!
Ok, the code:
File: inc_code.js
Delete the function list().
Add the following code somewhere in the file:
Note! This forum cannot avoid decoding everything like [ list ]...[ /list] even though it is put between [ code][ /code],
so I advise to copy the text to wordpad and run replace on all "[ " to "[".
function list() {
var text = getText();
if (helpstat) {
alert("List Tag Builds a bulleted list.\n\nUSE: [ list] [ *]item1[ /*] [ *]item2[ /*] [ *]item3[ /*] [ /list]");
} else if (basic) {
//Discover line breaks and embrace the list items.
AddTxt="[ list]";
while (1) {
j = text.indexOf("\n");
if ((j==-1) || (text=="")) {
AddTxt+="[ *]"+text+"[ /*]";
break;
}
else {
AddTxt+="[ *]"+text.substr(0, j-1)+"[ /*]\n";
}
text = text.substr(j+1,text.length+1);
}
AddTxt+="[ /list]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be listed",text);
} else {
txt=prompt("Text to be listed","Text");
}
if (txt!=null) {
AddTxt="[ list][ *] "+txt+"[ /*][ /list]";
AddText(AddTxt);
}
}
}
function listalpha() {
var text = getText();
if (helpstat) {
alert("List Tag Builds a alphabetical list.\n\nUSE: [ list=a] [ *]item1[ /*] [ *]item2[ /*] [ *]item3[ /*] [ /list=a]");
} else if (basic) {
//Discover line breaks and embrace the list items.
AddTxt="[ list=a]";
while (1) {
j = text.indexOf("\n");
if ((j==-1) || (text=="")) {
AddTxt+="[ *]"+text+"[ /*]";
break;
}
else {
AddTxt+="[ *]"+text.substr(0, j-1)+"[ /*]\n";
}
text = text.substr(j+1,text.length+1);
}
AddTxt+="[ /list=a]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be listed",text);
} else {
txt=prompt("Text to be listed","Text");
}
if (txt!=null) {
AddTxt="[ list=a][ *] "+txt+"[ /*][ /list=a]";
AddText(AddTxt);
}
}
}
function listnum() {
var text = getText();
if (helpstat) {
alert("List Tag Builds a numbered list.\n\nUSE: [ list=1] [ *]item1[ /*] [ *]item2[ /*] [ *]item3[ /*] [ /list=1]");
} else if (basic) {
//Discover line breaks and embrace the list items.
AddTxt="[ list=1]";
while (1) {
j = text.indexOf("\n");
if ((j==-1) || (text=="")) {
AddTxt+="[ *]"+text+"[ /*]";
break;
}
else {
AddTxt+="[ *]"+text.substr(0, j-1)+"[ /*]\n";
}
text = text.substr(j+1,text.length+1);
}
AddTxt+="[ /list=1]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be listed",text);
} else {
txt=prompt("Text to be listed","Text");
}
if (txt!=null) {
AddTxt="[ list=1][ *] "+txt+"[ /*][ /list=1]";
AddText(AddTxt);
}
}
}
function heading4() {
var text = getText();
if (helpstat) {
alert("Heading4 Tag converts the enclosed text to a heading size 4.\n\nUSE: [ h4]This text is Heading4[ /h4]");
} else if (basic) {
AddTxt="[ h4]" + text + "[ /h4]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be a Heading4.",text);
} else {
txt=prompt("Text to be Heading4.","Text");
}
if (txt!=null) {
AddTxt="[ h4]"+txt+"[ /h4]";
AddText(AddTxt);
}
}
}
function heading5() {
var text = getText();
if (helpstat) {
alert("Heading5 Tag converts the enclosed text to a heading size 5.\n\nUSE: [ h5]This text is Heading5[ /h5]");
} else if (basic) {
AddTxt="[ h5]" + text + "[ /h5]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be a Heading4.",text);
} else {
txt=prompt("Text to be Heading4.","Text");
}
if (txt!=null) {
AddTxt="[ h5]"+txt+"[ /h5]";
AddText(AddTxt);
}
}
}
File: inc_iconfiles.asp
Add the following:
Const strIconEditorListalpha = "icon_editor_listalpha.gif|23|22"
Const strIconEditorListnum = "icon_editor_listnum.gif|23|22"
Const strIconEditorHeading4 = "icon_editor_heading4.gif|23|22"
Const strIconEditorHeading5 = "icon_editor_heading5.gif|23|22"
File:inc_post_buttons.asp
Search for strIconEditorList and make the section look like this:
It is probably safest to replace the entire Respons.Write statement to get it right. ALL RED CHARACTERS MUST BE THERE!!!
Response.Write " <a href=""Javascript:showcode();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorCode,"Insert Code","align=""top""") & "</a>" & _
"<a href=""Javascript:quote();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorQuote,"Insert Quote","align=""top""") & "</a>" & _
"<a href=""Javascript:list();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorList,"Insert List","align=""top""") & "</a>" & _
"<a href=""Javascript:listnum();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorListnum,"Insert Numbered List","align=""top""") & "</a>" & _
"<a href=""Javascript:listalpha();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorListalpha,"Insert Alphabetic List","align=""top""") & "</a>" & vbNewLine & _
"<a href=""Javascript:heading4();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorHeading4,"Insert Heading4","align=""top""") & "</a>" & _
"<a href=""Javascript:heading5();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorHeading5,"Insert Heading5","align=""top""") & "</a>" & vbNewLine