source: trunk/gsdl/macros/document.dm@ 13452

Last change on this file since 13452 was 13452, checked in by shaoqun, 16 years ago

make the top level of TOC stay when hiding TOC

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 15.9 KB
Line 
1# this file must be UTF-8 encoded
2
3package document
4
5#######################################################################
6# macros set from within the server
7#######################################################################
8
9_imagethispage_ {}
10_httpprevarrow_ {}
11_httpnextarrow_ {}
12_pagetitle_ {}
13_phindclassifier_ {}
14_collageclassifier_ {}
15
16# custom header for individual document
17_documentheader_ {}
18
19#custom css links for individual document
20_csslink_{
21 <link rel="stylesheet" href="_cssfilelink_" type="text/css"
22 charset="UTF-8" _linktagend_
23 <link rel="alternate stylesheet" href="_httpimg_/preview-document.css"
24 type="text/css"
25 title="Preview Document" charset="UTF-8" media="screen" _linktagend_
26 <link rel="stylesheet" href="_httpimg_/print-document.css" type="text/css"
27 charset="UTF-8" media="print" _linktagend_
28}
29
30#######################################################################
31# page content
32#######################################################################
33
34_nextsearchresult_ {_If_("_cgiargsrn_" ne "0" ,<div class="nextresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrn_">_textnextsearchresult_</a></div>,)}
35
36_prevsearchresult_ {_If_("_cgiargsrp_" ne "0" ,<div class="prevresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrp_">_textprevsearchresult_</a></div>,) }
37
38_content_ {
39_optnavigationbar_
40
41_If_(_phindclassifier__collageclassifier_,
42<p style="text-align: center;">
43_phindclassifier_
44_collageclassifier_
45</p>
46)
47
48<div class="searchresults">
49_prevsearchresult_
50_nextsearchresult_
51</div>
52
53<div class="document">
54
55
56}
57
58# Dublin Core Metadata Element Set, Version 1.1
59_textTitlepage_ {_texticonhtitle_}
60_textCreatorpage_ {_texticonhcreat_}
61_textSubjectpage_ {_texticonhsubj_}
62_textDescriptionpage_ {_texticonhdesc_}
63_textPublisherpage_ {_texticonhpubl_}
64_textContributorpage_ {_texticonhcontr_}
65_textDatepage_ {_texticonhdate_}
66_textTypepage_ {_texticonhtype_}
67_textFormatpage_ {_texticonhform_}
68_textIdentifierpage_ {_texticonhident_}
69_textSourcepage_ {_texticonhsrc_}
70_textLanguagepage_ {_texticonhlang_}
71_textRelationpage_ {_texticonhrel_}
72_textCoveragepage_ {_texticonhcover_}
73_textRightspage_ {_texticonhright_}
74
75_textTopage_ {_texticonhto_}
76_textFrompage_ {_texticonhfrom_}
77_textSeriespage_ {_texticonhser_}
78_textHowtopage_ {_texticonhhow_}
79_textOrganizationpage_ {_texticonhorg_}
80_textBrowsepage_ {_texticonhbrwse_}
81_textCollagepage_ {_texticonhcoll_}
82_textPeoplepage_ {_texticonhpeople_}
83_textAcronympage_ {_texticonhacronym_}
84_textPhrasepage_ {_texticonhphrases_}
85_textArtistpage_ {_texticonhartist_}
86_textKeywordpage_ {_texticonhkw_}
87_textVolumepage_ {_texticonhvol_}
88_textCaptionspage_ {_texticonhcapt_}
89_textCountriespage_ {_texticonhcount_}
90
91#######################################################################
92# navigation arrows
93#
94#######################################################################
95
96# these two may be reset to "" by the server
97_navarrowsbottom_ {_navarrows_}
98_navarrowstop_ {_navarrows_}
99
100_navarrows_ {<center>
101<table width=_pagewidth_ cellpadding=0 cellspacing=0 border=0>
102<tr><td align=left valign=top>
103_prevarrow_
104</td><td align=right valign=top>
105_nextarrow_
106</td></tr></table>
107</center>
108}
109
110_prevarrow_ {_If_(_httpprevarrow_,<a href="_httpprevarrow_">_iconprev_</a>)}
111_nextarrow_ {_If_(_httpnextarrow_,<a href="_httpnextarrow_">_iconnext_</a>)}
112
113_navarrows_ [v=1] {<p>
114_prevarrow_<br>
115_nextarrow_
116}
117
118#######################################################################
119# the goto form
120#######################################################################
121
122_gotoform_ {
123<form name="GotoForm" method="get" action="_gwcgi_">
124<input type=hidden name="e" value="_decodedcompressedoptions_">
125<input type=hidden name="d" value="_cgiargd_">
126<input type=hidden name="cl" value="_cgiargcl_">
127<input type="text" name="gp" size="3" maxlength="4">
128<input type="submit" value="_textgoto_">
129</form>
130}
131
132_textnumpages_ {&nbsp;<i>(_1_ _pages_)</i>}
133_parentarrow_ {}
134
135
136#######################################################################
137# the phind applet
138#
139# The phind applet is only required on phind classifier pages.
140# Consequently, the _phindclassifier_ macro is not usually set. On screens
141# where it is required, _phindclassifier_ resolves to _phindapplet_, and
142# the following macro is loaded into the web page.
143#######################################################################
144
145_phindapplet_ {
146<APPLET CODEBASE="_httpprefix_/bin/java" CODE="org.nzdl.gsdl.Phind.Phind.class" ARCHIVE="Phind.jar" WIDTH=500 HEIGHT=400>
147 <PARAM NAME=library VALUE="_gwcgi_?e=_compressedoptions_">
148 <PARAM NAME=phindcgi VALUE="_gwcgi_?a=phind">
149 <PARAM NAME=collection VALUE="_cgiargc_">
150 <PARAM NAME=classifier VALUE="_phindnumber_">
151
152 <PARAM NAME=orientation VALUE="vertical">
153 <PARAM NAME=depth VALUE="2">
154 <PARAM NAME=resultorder VALUE="L,l,E,e,D,d">
155
156 <PARAM NAME=backdrop VALUE="_httpimg_/phindbg1.jpg">
157 <PARAM NAME=fontsize VALUE="10">
158 <PARAM NAME=blocksize VALUE="10">
159
160 The Phind java applet.
161</APPLET>
162}
163
164_collageapplet_ {
165 <applet CODEBASE="_httpprefix_/bin/java"
166 code="org.nzdl.gsdl.GsdlCollageApplet.GsdlCollageApplet.class"
167 archive="GsdlCollageApplet.jar"
168 width="_collagexdim_" height="_collageydim_">
169
170 <param name="gwcgi" value="_gwcgi_">
171 <param name="collection" value="_cgiargc_">
172 <param name="classifier" value="_cgiargcl_.1">
173
174 <param name="hrefMustHave" value="cl=_cgiargcl_.1">
175 <param name="imageMustNotHave" value="hl=\%x=\%gt=\%gc=\%.pr">
176
177 <param name="imageType" value="_collageimageType_">
178 <param name="verbosity" value="_collageverbosity_">
179 <param name="maxDepth" value="_collagemaxDepth_">
180 <param name="maxDisplay" value="_collagemaxDisplay_">
181 <param name="refreshDelay" value="_collagerefreshDelay_">
182 <param name="isJava2" value="_collageisJava2_">
183 <param name="bgcolor" value="_collagebgcolor_">
184 <param name="documentroot" value="_httpimg_">
185 </applet>
186
187<center>
188_collagecaption_
189</center>
190
191}
192
193
194#######################################################################
195# icons
196#######################################################################
197
198_iconsmalltext_ {<img src="_httpiconsmtext_" class="icon" width=_widthsmtext_ height=_heightsmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
199_iconsmalltext_ [v=1] {<small><b>_texticonsmalltext2_</b></small>}
200
201_iconarrowsmalltext_ {<img src="_httpiconasmtext_" class="icon" width=_widthasmtext_ height=_heightasmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
202_iconarrowsmalltext_ [v=1] {<small><b>->_texticonsmalltext2_</b></small>}
203
204_iconclosedfolder_ {<img src="_httpiconclsdfldr_" class="icon" width=_widthclsdfldr_ height=_heightclsdfldr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
205_iconclosedfolder_ [v=1] {<small><b>_texticonclosedfolder2_</b></small>}
206
207_iconarrowclosedfolder_ {<img src=_httpiconaclsdfdr_" class="icon" width=_widthaclsdfdr_ height=_heightaclsdfdr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
208_iconarrowclosedfolder_ [v=1] {<small><b>->_texticonclosedfolder2_</b></small>}
209
210_iconopenfolder_ {<img src="_httpiconopenfldr_" class="icon" width=_widthopenfldr_ height=_heightopenfldr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
211_iconopenfolder_ [v=1] {<small><b>_texticonopenfolder2_</b></small>}
212
213_iconarrowopenfolder_ {<img src="_httpiconaopenfdr_" class="icon" width=_widthaopenfdr_ height=_heightaopenfdr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
214_iconarrowopenfolder_ [v=1] {<small><b>->_texticonopenfolder2_</b></small>}
215
216_iconarrowclosedbook_ {<img src="_httpiconabook_" width=_widthabook_ height=_heightabook_ class="icon" alt="_texticonclosedbook_" title="_texticonclosedbook_">}
217_iconarrowclosedbook_ [v=1] {<small><b>->_texticonclosedbook_: </b></small>}
218
219_iconopenbook_ {<img src="_httpiconopenbook_" width=_widthopenbook_ height=_heightopenbook_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
220_iconopenbook_ [v=1] {<small><b>_texticonopenbook_: </b></small>}
221
222_iconarrowopenbook_ {<img src="_httpiconaopenbk_" width=_widthaopenbk_ height=_heightaopenbk_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
223_iconarrowopenbook_ [v=1] {<small><b>->_texticonopenbook_: </b></small>}
224
225_iconopenbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
226_iconopenbookshelf_ [v=1] {<small><b>_texticonopenbookshelf_: </b></small>}
227
228_iconarrowopenbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
229_iconarrowopenbookshelf_ [v=1] {<small><b>->_texticonopenbookshelf_: </b></small>}
230
231_iconclosedbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
232_iconclosedbookshelf_ [v=1] {<small><b>_texticonclosedbookshelf_: </b></small>}
233
234_iconarrowclosedbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
235_iconarrowclosedbookshelf_ [v=1] {<small><b>->_texticonclosedbookshelf_: </b></small>}
236
237_iconpointer_ {<img src="_httpiconarrrght_" class="icon" width=_widtharrrght_ height=_heightarrrght_>}
238_iconpointer_ [v=1] {<small><b>_texticonpointer_-> </b></small>}
239
240_iconwarning_ {<img src="_httpiconwarning_" width="_widthwarning_" height="_heightwarning_" class="icon" align="left">}
241_iconwarning_ [v=1] {_texticonwarning_}
242
243
244#######################################################################
245# images
246#######################################################################
247
248_docbutton_ {<div class="button"><span class="button" title="_3_"><a href="_1_">_2_</a></span></div>
249}
250
251# can't use _docbutton_ macro for detach button as we need to include target
252_imagedetach_ {<div class="button"><span class="button"><a href="_httpcurrentdocument_&amp;x=1" target="\_blank" title="_texticondetach_">_textDETACH_</a></span></div>}
253
254_imageprint_{<div class="button"><span class="button"><a href="javascript:print_preview()">_textPRINT_</a></span></div>}
255
256
257_imagehighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=1&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_textHIGHLIGHT_,_texticonhighlight_)}
258
259_imagenohighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=0&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_document:textNOHIGHLIGHT_,_document:texticonnohighlight_)}
260
261_imagecontracttoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=0,_textCONTRACTCONTENTS_,_texticoncontracttoc_)}
262
263_imageexpandtoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=1,_textEXPANDCONTENTS_,_texticonexpandtoc_)}
264
265_imagecontracttext_ {_docbutton_(_httpcurrentdocument_&amp;gt=0,_textCONTRACT_,_texticoncontracttext_)}
266
267_imageexpandtext_ {_docbutton_(_httpcurrentdocument_&amp;gt=1,_textEXPANDTEXT_,_texticonexpandtext_)}
268
269_imagecont_ {_docbutton_(_httpcurrentdocument_&amp;gt=2,_textCONTINUE_,_texticoncont_)}
270
271
272#######################################################################
273# print preview script
274#######################################################################
275
276
277_pagescriptextra_{
278
279 var style_display_old;
280 var show = true;
281 var toc_top;
282
283 function has_toc(){
284 var div_nodes = document.getElementsByTagName("div");
285 for (var i=0;i < div_nodes.length ; i++ )\{
286 var div_node = div_nodes[i];
287 if (div_node.className =="toc" && div_node.childNodes.length > 1)
288 \{
289 return true;
290 \}
291 \}
292
293 return false;
294 \}
295
296 function hide_toc()\{
297 var div_nodes = document.getElementsByTagName("div");
298 for (var i=0;i < div_nodes.length ; i++ )\{
299 var div_node = div_nodes[i];
300 if (div_node.className =="toc")
301 \{
302 style_display_old = div_node.style.display;
303 toc_top = document.getElementById("toc_top");
304 if (toc_top)
305 div_node.parentNode.insertBefore(toc_top,div_node);
306 div_node.style.display = "none";
307 \};
308 \}
309
310 \}
311
312
313 function show_toc()\{
314
315 var div_nodes = document.getElementsByTagName("div");
316 for (var i=0;i < div_nodes.length ; i++ )\{
317 var div_node = div_nodes[i];
318 if (div_node.className =="toc")
319 \{
320 div_node.style.display = style_display_old;
321 if (toc_top)
322 div_node.insertBefore(toc_top,div_node.firstChild);
323 \};
324 \}
325
326 \}
327
328
329 function switch_toc()\{
330 var toc_link = document.getElementById("toc_link");
331 while (toc_link.hasChildNodes()) \{
332 toc_link.removeChild(toc_link.firstChild);
333 \}
334 if (show)\{
335 toc_link.appendChild(document.createTextNode('_textshowcontents_'));
336 show = false;
337 hide_toc();
338 \}
339 else\{
340 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
341 show = true;
342 show_toc();
343 \}
344
345 \}
346
347 function print_preview() \{
348 // Switch the stylesheet
349 setActiveStyleSheet("Preview Document");
350 add_print_message();
351 \}
352
353 function add_print_message()\{
354 if (document.getElementById)\{
355 var print_message = document.createElement('ul');
356 print_message.id = 'print-message';
357 print_message.className = "printmessage";
358
359 var cancel_print_link = document.createElement('li');
360 cancel_print_link.className = "cancelprint"
361 cancel_print_link.onclick = function()\{ cancel_print(); return false;\};
362 cancel_print_link.appendChild(document.createTextNode('_textreturnoriginal_'));
363 print_message.appendChild(cancel_print_link);
364
365
366 var print_link = document.createElement('li');
367 print_link.onclick = function()\{ window.print(); return false;\};
368 print_link.appendChild(document.createTextNode('_textprintpage_'));
369 print_message.appendChild(print_link);
370
371 if (has_toc())\{
372 var toc_link = document.createElement('li');
373 toc_link.id = "toc_link";
374 toc_link.onclick = function()\{ switch_toc(); return false;\};
375 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
376 print_message.appendChild(toc_link);
377 \}
378
379 //insert the print message node
380 var div_nodes = document.getElementsByTagName("div");
381 for (var i=0;i < div_nodes.length ; i++ )\{
382 var div_node = div_nodes[i];
383 if (div_node.className =="document")\{
384 var parent = div_node.parentNode;
385 parent.insertBefore(print_message,div_node);
386 \}
387 \}
388 \}
389
390 \}
391
392
393 function cancel_print() \{
394 // Destroy the preview message
395 var print_message = document.getElementById('print-message');
396 var parent = print_message.parentNode;
397 parent.removeChild(print_message);
398
399 show_toc();
400 // Switch back stylesheet
401 setActiveStyleSheet("default");
402 \}
403
404 function setActiveStyleSheet(title) \{
405 var i, a, main;
406 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) \{
407 if(a.getAttribute("rel").indexOf("style") != -1
408 && a.getAttribute("title")) \{
409 a.disabled = true;
410 if(a.getAttribute("title") == title) a.disabled = false;
411 \}
412 \ }
413 \}
414
415}
416
417
418#######################################################################
419# headers/footers
420#######################################################################
421
422
423# header overridden for text pages
424_textheader_ {_cgihead_
425_htmlhead_
426_startspacer_
427
428<!-- document:textheader -->
429<div id="banner">
430<div class="pageinfo"><p class="bannerlinks">_globallinks_</p></div>
431<div class="collectimage">_imagecollection_</div>
432</div>
433<div class="bannerextra">_pagebannerextra_</div>
434}
435
436_textheader_ [v=1] {_cgihead_
437_htmlhead_
438_globallinks_
439}
440
441_footer_ {
442</div> <!-- document:footer -->
443
444<div class="navarrowsbottom">
445_navarrowsbottom_
446</div>
447_endspacer__htmlfooter_
448}
Note: See TracBrowser for help on using the repository browser.