This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use Ferret property, add note and link to annotatations box
git-svn-id: file:///home/users/tmap/svn/repos/baker/trunk@23316 fdbf22ae-c210-0410-be80-ca943da6b8f8
- Loading branch information
1 parent
ff60e82
commit 51860ba
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
JavaSource/resources/ferret/scripts/LAS_note_from_property.jnl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
! LAS_note_from_property.jnl | ||
! 2/2017 ACM | ||
! | ||
! Define a note in the annotations box using Ferret properties. | ||
! Include a url if it is specified. IF the letters url are | ||
! part of the note text, substitute the url for url. Otherwise, | ||
! if a URL is given, just use the entire note text in the link. | ||
! | ||
! Call this as part of dataset initialization. If these Ferret properties | ||
! are set, then the annotation is defined: | ||
! | ||
! ferret_add_a_note Contains text to be added to the notes in the annotation box. | ||
! ferret_url_for_note Contains a url, which can be a relative url, docs/Prawler_profiles.html | ||
! If ferret_add_a_note is not defined, then ferret_url_for_note is ignored. | ||
! The url will be shown in parentheses. | ||
|
||
IF ($ferret_add_a_note"0|*>1") THEN | ||
|
||
DEFINE SYMBOL note_num = `($note_num"0") + 1` | ||
DEFINE SYMBOL new_note = ($ferret_add_a_note) | ||
|
||
! If a url is given, then substitute it for the letters url within the note text. | ||
! If the letters url do not appear in the note text, make the entire text the link. | ||
|
||
IF ($ferret_url_for_note"0|*>1") THEN | ||
LET nl = STRLEN("($ferret_add_a_note)") | ||
LET iu = MAX(1, STRINDEX("($ferret_add_a_note)", "url") ) | ||
|
||
IF `iu GT 1` THEN | ||
DEFINE SYMBOL new_note1 = `SUBSTRING("($ferret_add_a_note)", 1, iu-1)` | ||
DEFINE SYMBOL new_note2 = `SUBSTRING("($ferret_add_a_note)", iu+4, nl)` | ||
ELSE | ||
DEFINE SYMBOL new_note2 = ($ferret_add_a_note) | ||
ENDIF | ||
|
||
DEFINE SYMBOL new_note = ($new_note1) (<a target="_blank" href=($ferret_url_for_note)>($new_note2)</a>) | ||
ENDIF | ||
|
||
! set the note symbol. | ||
|
||
DEFINE SYMBOL note_($note_num)_lab = ($new_note) | ||
ENDIF |