From 2848a9a8be053436a8ad8464f5e89a6e4c578ebd Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 27 Apr 2007 11:04:19 +0000 Subject: [PATCH] Implemented anchors in ELCode SVN revision: 1856 --- doc/userguide.html | 3 ++- resources/elcode_english.html | 10 ++++++++++ src/elogd.c | 9 +++++++-- themes/default/icons/elc_anchor.png | Bin 0 -> 485 bytes themes/default/icons/elc_line.png | Bin 0 -> 210 bytes themes/default/icons/eld_anchor.png | Bin 0 -> 487 bytes themes/default/icons/eld_line.png | Bin 0 -> 217 bytes 7 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 themes/default/icons/elc_anchor.png create mode 100644 themes/default/icons/elc_line.png create mode 100644 themes/default/icons/eld_anchor.png create mode 100644 themes/default/icons/eld_line.png diff --git a/doc/userguide.html b/doc/userguide.html index 8c22cf65..fd5eed11 100755 --- a/doc/userguide.html +++ b/doc/userguide.html @@ -163,7 +163,8 @@ For the quality of the information committed to the logbook, you need understand

  • in addition to the above URLs, one can enter a tag elog:<id> which references another logbook entry. The tag elog:<logbook>/<id> references a message in another logbook on the same server. The tag elog:<id>/<n> references attachment number n in a logbook entry. To reference -an attachment in the current message, one uses elog:/<n>. +an attachment in the current message, one uses elog:/<n>. An anchor inside an entry can be referenced +with elog:<id>#<anchor>.

  • 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.

    diff --git a/resources/elcode_english.html b/resources/elcode_english.html index cee6a6ff..a35fe962 100755 --- a/resources/elcode_english.html +++ b/resources/elcode_english.html @@ -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].

    +

    Anchor

    + +
    An anchor can be put into an entry with +[anchor]anchor_name[/anchor]. This is equivalent to a HTML anchor like +<a name="anchor_name"></a>. +Such anchors can be referenced inside an entry with +elog:<id>#anchor_name where <id> is the ID number of +the entry (the number from the left column in the list display).

    + +

    Smileys


    Smileys, or Emoticons, are small graphical images which can be used to diff --git a/src/elogd.c b/src/elogd.c index 92166aca..c25b71cd 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -5770,6 +5770,9 @@ PATTERN_LIST pattern_list[] = { /* horizontal line */ {"[line]", "
    "}, + /* anchor */ + {"[anchor]", ""}, + {"[/anchor]", ""}, {"", ""} }; @@ -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, "`~saBvMoKS55SH3}6$gG*3j zhC>ZPOIR;?@8C5~T^sH*_=oqL9}n;QoI_kLm$%nM5CnqPcDpT&ux%TjDEo<`=oLHf znA-7p91e$yq8tu~@{}M58jVJ))tb-ep2O;g8ldcEFev%ygyVEg?Z!WPGIk+R$EmdhnfjizZFg<+U}zrS9u zPp4Cnaz3BI1(RvF z?0B9BC!kubw%cuv<78Q`R4R8{em^ge*Uy`DT?a3cB;f~#@MTEtGne553bg4V;+vA) bdjGF0R@IP!LQSFT00000NkvXXu0mjf;V;Ux literal 0 HcmV?d00001 diff --git a/themes/default/icons/elc_line.png b/themes/default/icons/elc_line.png new file mode 100644 index 0000000000000000000000000000000000000000..df7b5a69a862970507f7f717f0cde109549d2486 GIT binary patch literal 210 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6M!2~3ih)e(pu$OrHy0Twqk>a!Fbqv#N1`2T& zctjR6F!(8eFr!%Q%zHpVmUKs7M+SzC{oH>NS%LgSPZ!6Kid)Hl{{OdUPHmVtaU!e7 z-Tn3RbCjp)Mzg6zD$Ehrj|+GtqsFz@IO|k^VJqv*sjJeAP3I52nvbAXSt*WN~UhTw(b+8eH_vH>k)@O1TaS?83{1OO?1 BKbZgk literal 0 HcmV?d00001 diff --git a/themes/default/icons/eld_anchor.png b/themes/default/icons/eld_anchor.png new file mode 100644 index 0000000000000000000000000000000000000000..63a67b01ad78cf1a6a25f801ea5bab3c0c308346 GIT binary patch literal 487 zcmVE zi(Ck8!a5W)6QeoK*8zX;y~pEs&;2OsWn3;72A9!jL`>1?bZ}oHGBS5KC dqLV+85?8$=kR_K3F$w?x002ovPDHLkV1nB5(pLZg literal 0 HcmV?d00001 diff --git a/themes/default/icons/eld_line.png b/themes/default/icons/eld_line.png new file mode 100644 index 0000000000000000000000000000000000000000..2bfccbb0180600a1985a92b0c909d7d210335c15 GIT binary patch literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6M!2~3ih)e(pu$OrHy0Twqk>cmz)BRR%2NdEg z@Q5sCVDM7_VMejqnfHK#Ea{HEjtmSN`?>!lvI6-To-U3d6}OTT7D)X0|9?KK$JQ-d zCgi$=gosQ?X)KsCXO2c8pYT&VDbv&|B0`MZ%O*^nDr#ueFKg|_x_ypyIp6%~hG`0` z6)w9wB&4LcOww%D>|>j(+2c_2{+_K@Pe4dW3d^*;Q+Bg5{68V?W~hF@9B3zlr>mdK II;Vst00S{XkN^Mx literal 0 HcmV?d00001