mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Implemented anchors in ELCode
SVN revision: 1856
This commit is contained in:
parent
0c6bf63c18
commit
2848a9a8be
@ -163,7 +163,8 @@ For the quality of the information committed to the logbook, you need understand
|
||||
<p>
|
||||
<li>in addition to the above URLs, one can enter a tag <b>elog:<id></b> which references another logbook entry. The tag <b>elog:<logbook>/<id></b> references a message in another logbook on the same server.
|
||||
The tag <b>elog:<id>/<n></b> references attachment number <b>n</b> in a logbook entry. To reference
|
||||
an attachment in the current message, one uses <b>elog:/<n></b>.
|
||||
an attachment in the current message, one uses <b>elog:/<n></b>. An anchor inside an entry can be referenced
|
||||
with <b>elog:<id>#<anchor></b>.
|
||||
<p>
|
||||
<li>the Text multi-line field, if present, may be pre-filled with a template if entries need to have a common, consistent format across the logbook (especially for HTML). There may also be a comment inserted before it to explain local rules and conventions, upload rules, etc.
|
||||
<p>
|
||||
|
||||
@ -133,6 +133,16 @@ for example. In order to avoid interpretation of tags, one puts a backslash "\"
|
||||
in front of the tag, like \[b] instead of [b].<br><br>
|
||||
</td></tr>
|
||||
|
||||
<tr><td bgcolor=#486090><h2>Anchor</h2></td></tr>
|
||||
|
||||
<tr><td bgcolor=#FFFFFF><br>An anchor can be put into an entry with
|
||||
<b>[anchor]</b><i>anchor_name</i><b>[/anchor]</b>. This is equivalent to a HTML anchor like
|
||||
<b><a name="</b><i>anchor_name</i><b>"></a></b>.
|
||||
Such anchors can be referenced inside an entry with
|
||||
<b>elog:<id>#<i>anchor_name</i></b> where <b><id></b> is the ID number of
|
||||
the entry (the number from the left column in the list display). <br><br>
|
||||
</td></tr>
|
||||
|
||||
<tr><td bgcolor=#486090><h2>Smileys</h2></td></tr>
|
||||
|
||||
<tr><td bgcolor=#FFFFFF><br>Smileys, or Emoticons, are small graphical images which can be used to
|
||||
|
||||
@ -5770,6 +5770,9 @@ PATTERN_LIST pattern_list[] = {
|
||||
/* horizontal line */
|
||||
{"[line]", "<hr />"},
|
||||
|
||||
/* anchor */
|
||||
{"[anchor]", "<a name=\"%#\">"},
|
||||
{"[/anchor]", "</a>"},
|
||||
{"", ""}
|
||||
};
|
||||
|
||||
@ -5861,7 +5864,7 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str)
|
||||
if (!isdigit(tmp[m]))
|
||||
break;
|
||||
|
||||
if (m < (int) strlen(tmp)) {
|
||||
if (m < (int) strlen(tmp) && tmp[m] != '#') {
|
||||
/* if link contains reference to other logbook, put logbook explicitly */
|
||||
if (email_notify)
|
||||
compose_base_url(NULL, base_url, sizeof(base_url));
|
||||
@ -6050,7 +6053,8 @@ void rsputs_elcode(LOGBOOK * lbs, BOOL email_notify, const char *str)
|
||||
/* add http:// if missing */
|
||||
else if (!strnieq(attrib, "http://", 7) &&
|
||||
strstr(pattern_list[l].subst, "mailto") == NULL &&
|
||||
strstr(pattern_list[l].subst, "img") == NULL)
|
||||
strstr(pattern_list[l].subst, "img") == NULL &&
|
||||
strncmp(pattern_list[l].subst, "<a", 2) != 0)
|
||||
sprintf(hattrib, "http://%s", attrib);
|
||||
strlcpy(subst, pattern_list[l].subst, sizeof(subst));
|
||||
*strchr(subst, '#') = 's';
|
||||
@ -10018,6 +10022,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
||||
ricon("table", loc("Insert table"), "elcode(document.form1.Text, 'TABLE','')");
|
||||
ricon("heading", loc("Insert heading CTRL+H"), "queryHeading(document.form1.Text)");
|
||||
ricon("line", loc("Insert horizontal line"), "elcode(document.form1.Text, 'LINE','')");
|
||||
ricon("anchor", loc("Insert anchor point"), "elcode(document.form1.Text, 'ANCHOR','')");
|
||||
|
||||
rsprintf(" ");
|
||||
ricon("code", loc("Insert code CTRL+O"), "elcode(document.form1.Text, 'CODE','')");
|
||||
|
||||
BIN
themes/default/icons/elc_anchor.png
Normal file
BIN
themes/default/icons/elc_anchor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 485 B |
BIN
themes/default/icons/elc_line.png
Normal file
BIN
themes/default/icons/elc_line.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 210 B |
BIN
themes/default/icons/eld_anchor.png
Normal file
BIN
themes/default/icons/eld_anchor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 487 B |
BIN
themes/default/icons/eld_line.png
Normal file
BIN
themes/default/icons/eld_line.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 217 B |
Loading…
x
Reference in New Issue
Block a user