Added heading to ELCode tags

SVN revision: 1637
This commit is contained in:
2006-01-24 21:39:34 +00:00
parent 66d96e870d
commit 42d35efc3c
3 changed files with 24 additions and 0 deletions
+6
View File
@@ -75,6 +75,12 @@ The size of the text in pixels ranges from 1 to 29. Here are some examples:
<tr><td bgcolor=#D0D0FF width=200><b>[center]</b>Hello<b>[/center]</b><td bgcolor=#FFFFFF><center>will put the text in the center</center></tr>
<tr><td bgcolor=#D0D0FF width=200>
<b>[h1]</b>Hello<b>[/h1]</b><br>
<b>[h2]</b>Hello<b>[/h2]</b><br>
<b>[h3]</b>Hello<b>[/h3]</b>
<td bgcolor=#FFFFFF>will become a heading of <font size=6><b>level 1</b></font>, <font size=5><b>level 2</b></font> or <font size=4><b>level 3</b></font></tr>
</table><p>
Tags can be nested, such as<p>
+8
View File
@@ -90,3 +90,11 @@ function queryURL(text)
linkURL = prompt(linkURL_prompt, 'http://');
elcode1(text, 'URL', linkURL, linkText);
}
function queryHeading(text)
{
selection = getSelection(text);
heading = prompt(linkHeading_prompt, '');
tag = 'H' + heading;
elcode1(text, tag, '', selection);
}
+10
View File
@@ -5532,6 +5532,14 @@ PATTERN_LIST pattern_list[] = {
{"[/list]", "</ul>"},
{"[list=", "<ol type=\"%s\">"},
/* headings */
{"[h1]", "<h1>"},
{"[/h1]", "</h1>"},
{"[h2]", "<h2>"},
{"[/h2]", "</h2>"},
{"[h3]", "<h3>"},
{"[/h3]", "</h3>"},
/* URLs */
{"[url=", "<a href=\"%#\">%s</a>"},
{"[url]", "<a href=\"%#\">%s</a>"},
@@ -8740,6 +8748,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
/* strings for elcode.js */
rsprintf("linkText_prompt = '%s';\n", loc("Enter name of hyperlink"));
rsprintf("linkURL_prompt = '%s';\n", loc("Enter URL of hyperlink"));
rsprintf("linkHeading_prompt = '%s';\n", loc("Enter heading level (1, 2 or 3)"));
if (stristr(browser, "MSIE") && !stristr(browser, "opera"))
rsprintf("browser = 'MSIE';\n");
else if (stristr(browser, "Mozilla") && !stristr(browser, "opera") && !stristr(browser, "konqueror"))
@@ -9308,6 +9317,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
rsprintf(" ");
ricon("quote", loc("insert quote"), "elcode(document.form1.Text, 'QUOTE','')");
ricon("list", loc("insert list"), "elcode(document.form1.Text, 'LIST','')");
ricon("heading", loc("insert heading"), "queryHeading(document.form1.Text)");
rsprintf(" ");
ricon("code", loc("insert code"), "elcode(document.form1.Text, 'CODE','')");