File: bounded_index.thtml

package info (click to toggle)
libaws 2.2dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,624 kB
  • ctags: 1,173
  • sloc: ada: 61,829; ansic: 6,483; makefile: 1,282; xml: 196; sh: 119; java: 112; python: 66; sed: 40
file content (37 lines) | stat: -rw-r--r-- 1,565 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@@-- Builds an index for split pages. 
@@-- If there are more entries than the maximum allowed, the first, last, and
@@-- currententries are always displayed; extra entries are replaced with "..."
@@-- and are associated to $2
@@--
@@-- Parameters: $1= Number of visible index entries
@@--             $2 (optional) = Href to use for "..." entries. 
@@--                             (none by default)
@@--
@@-- Can be used with splitters:
@@--   primary index  : Alpha, Alpha.Bounded, Uniform.Alpha, Uniform,
@@--                    Uniform.Overlapping
@@--   secondary index: Alpha.Bounded

@@TABLE@@
   @@IF@@ @_TABLE_LINE_@ = 1 or @_TABLE_LINE_@ = @_HREFS_V'LENGTH_@ or (@_PAGE_INDEX_@ <= @_"/"(2):$1_@ and @_TABLE_LINE_@ <= @_"-"(2):$1_@) or (@_PAGE_INDEX_@ > @_"/"(2):"-"($1):"*"(2):HREFS_V'LENGTH_@ and @_TABLE_LINE_@ > @_"+"(2):"-"($1):HREFS_V'LENGTH_@)
      @@IF@@ @_TABLE_LINE_@ = @_PAGE_INDEX_@
         <font color="red">@_INDEXES_V_@</font>
      @@ELSE@@
         <a href="@_HREFS_V_@">@_INDEXES_V_@</a>
      @@END_IF@@

   @@ELSIF@@ @_TABLE_LINE_@ > @_"+"(2):"/"(2):"-"($1):"*"(2):PAGE_INDEX_@ and @_TABLE_LINE_@ <= @_"+"($1):"-"(2):"/"(2):"-"($1):"*"(2):PAGE_INDEX_@
      @@IF@@ @_TABLE_LINE_@ = @_PAGE_INDEX_@
         <font color="red">@_INDEXES_V_@</font>
      @@ELSE@@
         <a href="@_HREFS_V_@">@_INDEXES_V_@</a>
      @@END_IF@@

   @@ELSIF@@ @_TABLE_LINE_@ = 2 or @_TABLE_LINE_@ = @_"-"(1):INDEXES_V'LENGTH_@
     @@IF@@ @_EXIST:$2_@
       <a href="@_$2_@">...</a>
     @@ELSE@@
       ...
     @@END_IF@@
   @@END_IF@@
@@END_TABLE@@