Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
use Ferret property, add note and link to annotatations box
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/users/tmap/svn/repos/baker/trunk@23316 fdbf22ae-c210-0410-be80-ca943da6b8f8
  • Loading branch information
AnsleyManke committed Feb 22, 2017
1 parent ff60e82 commit 51860ba
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions JavaSource/resources/ferret/scripts/LAS_initialize_data.jnl
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@ GO ($data_initialization_script) ($1)

IF `($ferret_memory"25.6") LT 100` THEN SET MEM/SIZ=100

! If a Ferret property ferret_add_a_note is set, define a note that will
! be added to the annotations box. The note may contain a URL.

GO LAS_note_from_property

! End of ------------LAS_initialize_data.jnl--------------------------
42 changes: 42 additions & 0 deletions JavaSource/resources/ferret/scripts/LAS_note_from_property.jnl
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=&quot;_blank&quot; href=($ferret_url_for_note)>($new_note2)</a>)
ENDIF

! set the note symbol.

DEFINE SYMBOL note_($note_num)_lab = ($new_note)
ENDIF

0 comments on commit 51860ba

Please sign in to comment.