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

Last change on this file since 13452 was 13452, checked in by shaoqun, 17 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
RevLine 
[7343]1# this file must be UTF-8 encoded
2
[258]3package document
4
5#######################################################################
6# macros set from within the server
7#######################################################################
8
9_imagethispage_ {}
10_httpprevarrow_ {}
11_httpnextarrow_ {}
[283]12_pagetitle_ {}
[1804]13_phindclassifier_ {}
[6813]14_collageclassifier_ {}
[13427]15
[12944]16# custom header for individual document
17_documentheader_ {}
[13370]18
[13427]19#custom css links for individual document
20_csslink_{
21 <link rel="stylesheet" href="_cssfilelink_" type="text/css"
22 charset="UTF-8" _linktagend_
[13450]23 <link rel="alternate stylesheet" href="_httpimg_/preview-document.css"
24 type="text/css"
[13427]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}
[13370]29
[258]30#######################################################################
31# page content
32#######################################################################
33
[13370]34_nextsearchresult_ {_If_("_cgiargsrn_" ne "0" ,<div class="nextresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrn_">_textnextsearchresult_</a></div>,)}
[12944]35
[13370]36_prevsearchresult_ {_If_("_cgiargsrp_" ne "0" ,<div class="prevresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrp_">_textprevsearchresult_</a></div>,) }
37
[258]38_content_ {
[7503]39_optnavigationbar_
[11094]40
[10872]41_If_(_phindclassifier__collageclassifier_,
42<p style="text-align: center;">
[1804]43_phindclassifier_
[6813]44_collageclassifier_
[10872]45</p>
46)
[13370]47
48<div class="searchresults">
49_prevsearchresult_
50_nextsearchresult_
51</div>
52
[10872]53<div class="document">
[13370]54
55
[258]56}
57
[8106]58# Dublin Core Metadata Element Set, Version 1.1
[2802]59_textTitlepage_ {_texticonhtitle_}
[8106]60_textCreatorpage_ {_texticonhcreat_}
[2802]61_textSubjectpage_ {_texticonhsubj_}
[8106]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
[2802]75_textTopage_ {_texticonhto_}
76_textFrompage_ {_texticonhfrom_}
77_textSeriespage_ {_texticonhser_}
78_textHowtopage_ {_texticonhhow_}
79_textOrganizationpage_ {_texticonhorg_}
80_textBrowsepage_ {_texticonhbrwse_}
[6813]81_textCollagepage_ {_texticonhcoll_}
[2802]82_textPeoplepage_ {_texticonhpeople_}
83_textAcronympage_ {_texticonhacronym_}
84_textPhrasepage_ {_texticonhphrases_}
85_textArtistpage_ {_texticonhartist_}
[3105]86_textKeywordpage_ {_texticonhkw_}
[3534]87_textVolumepage_ {_texticonhvol_}
[5622]88_textCaptionspage_ {_texticonhcapt_}
[5517]89_textCountriespage_ {_texticonhcount_}
[2802]90
[258]91#######################################################################
92# navigation arrows
93#
94#######################################################################
95
[4868]96# these two may be reset to "" by the server
97_navarrowsbottom_ {_navarrows_}
98_navarrowstop_ {_navarrows_}
99
[258]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
[548]113_navarrows_ [v=1] {<p>
[258]114_prevarrow_<br>
115_nextarrow_
116}
117
118#######################################################################
119# the goto form
120#######################################################################
121
122_gotoform_ {
123<form name="GotoForm" method="get" action="_gwcgi_">
[876]124<input type=hidden name="e" value="_decodedcompressedoptions_">
[258]125<input type=hidden name="d" value="_cgiargd_">
126<input type=hidden name="cl" value="_cgiargcl_">
[666]127<input type="text" name="gp" size="3" maxlength="4">
[944]128<input type="submit" value="_textgoto_">
[258]129</form>
130}
131
[944]132_textnumpages_ {&nbsp;<i>(_1_ _pages_)</i>}
[666]133_parentarrow_ {}
134
135
[258]136#######################################################################
[1804]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_ {
[2507]146<APPLET CODEBASE="_httpprefix_/bin/java" CODE="org.nzdl.gsdl.Phind.Phind.class" ARCHIVE="Phind.jar" WIDTH=500 HEIGHT=400>
[3084]147 <PARAM NAME=library VALUE="_gwcgi_?e=_compressedoptions_">
[2487]148 <PARAM NAME=phindcgi VALUE="_gwcgi_?a=phind">
[1804]149 <PARAM NAME=collection VALUE="_cgiargc_">
[2021]150 <PARAM NAME=classifier VALUE="_phindnumber_">
151
[1804]152 <PARAM NAME=orientation VALUE="vertical">
153 <PARAM NAME=depth VALUE="2">
[2021]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">
[1804]158 <PARAM NAME=blocksize VALUE="10">
[2021]159
[1804]160 The Phind java applet.
161</APPLET>
162}
163
[6813]164_collageapplet_ {
[7332]165 <applet CODEBASE="_httpprefix_/bin/java"
166 code="org.nzdl.gsdl.GsdlCollageApplet.GsdlCollageApplet.class"
167 archive="GsdlCollageApplet.jar"
168 width="_collagexdim_" height="_collageydim_">
[1804]169
[7332]170 <param name="gwcgi" value="_gwcgi_">
171 <param name="collection" value="_cgiargc_">
172 <param name="classifier" value="_cgiargcl_.1">
[6813]173
[7332]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_">
[11421]184 <param name="documentroot" value="_httpimg_">
[6813]185 </applet>
[7332]186
187<center>
188_collagecaption_
189</center>
190
[6813]191}
192
193
[1804]194#######################################################################
[283]195# icons
[258]196#######################################################################
197
[10872]198_iconsmalltext_ {<img src="_httpiconsmtext_" class="icon" width=_widthsmtext_ height=_heightsmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
[548]199_iconsmalltext_ [v=1] {<small><b>_texticonsmalltext2_</b></small>}
[283]200
[10872]201_iconarrowsmalltext_ {<img src="_httpiconasmtext_" class="icon" width=_widthasmtext_ height=_heightasmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
[548]202_iconarrowsmalltext_ [v=1] {<small><b>->_texticonsmalltext2_</b></small>}
[454]203
[10872]204_iconclosedfolder_ {<img src="_httpiconclsdfldr_" class="icon" width=_widthclsdfldr_ height=_heightclsdfldr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
[548]205_iconclosedfolder_ [v=1] {<small><b>_texticonclosedfolder2_</b></small>}
[283]206
[10872]207_iconarrowclosedfolder_ {<img src=_httpiconaclsdfdr_" class="icon" width=_widthaclsdfdr_ height=_heightaclsdfdr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
[548]208_iconarrowclosedfolder_ [v=1] {<small><b>->_texticonclosedfolder2_</b></small>}
[454]209
[10872]210_iconopenfolder_ {<img src="_httpiconopenfldr_" class="icon" width=_widthopenfldr_ height=_heightopenfldr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
[548]211_iconopenfolder_ [v=1] {<small><b>_texticonopenfolder2_</b></small>}
[283]212
[10872]213_iconarrowopenfolder_ {<img src="_httpiconaopenfdr_" class="icon" width=_widthaopenfdr_ height=_heightaopenfdr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
[548]214_iconarrowopenfolder_ [v=1] {<small><b>->_texticonopenfolder2_</b></small>}
[454]215
[10872]216_iconarrowclosedbook_ {<img src="_httpiconabook_" width=_widthabook_ height=_heightabook_ class="icon" alt="_texticonclosedbook_" title="_texticonclosedbook_">}
[548]217_iconarrowclosedbook_ [v=1] {<small><b>->_texticonclosedbook_: </b></small>}
[454]218
[10872]219_iconopenbook_ {<img src="_httpiconopenbook_" width=_widthopenbook_ height=_heightopenbook_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
[548]220_iconopenbook_ [v=1] {<small><b>_texticonopenbook_: </b></small>}
[283]221
[10872]222_iconarrowopenbook_ {<img src="_httpiconaopenbk_" width=_widthaopenbk_ height=_heightaopenbk_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
[548]223_iconarrowopenbook_ [v=1] {<small><b>->_texticonopenbook_: </b></small>}
[454]224
[10872]225_iconopenbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
[548]226_iconopenbookshelf_ [v=1] {<small><b>_texticonopenbookshelf_: </b></small>}
[283]227
[10872]228_iconarrowopenbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
[548]229_iconarrowopenbookshelf_ [v=1] {<small><b>->_texticonopenbookshelf_: </b></small>}
[454]230
[10872]231_iconclosedbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
[548]232_iconclosedbookshelf_ [v=1] {<small><b>_texticonclosedbookshelf_: </b></small>}
[283]233
[10872]234_iconarrowclosedbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
[548]235_iconarrowclosedbookshelf_ [v=1] {<small><b>->_texticonclosedbookshelf_: </b></small>}
[454]236
[10872]237_iconpointer_ {<img src="_httpiconarrrght_" class="icon" width=_widtharrrght_ height=_heightarrrght_>}
[548]238_iconpointer_ [v=1] {<small><b>_texticonpointer_-> </b></small>}
[283]239
[11132]240_iconwarning_ {<img src="_httpiconwarning_" width="_widthwarning_" height="_heightwarning_" class="icon" align="left">}
[548]241_iconwarning_ [v=1] {_texticonwarning_}
[283]242
243
[258]244#######################################################################
[283]245# images
246#######################################################################
247
[11132]248_docbutton_ {<div class="button"><span class="button" title="_3_"><a href="_1_">_2_</a></span></div>
249}
[283]250
[11132]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>}
[283]253
[13427]254_imageprint_{<div class="button"><span class="button"><a href="javascript:print_preview()">_textPRINT_</a></span></div>}
255
256
[11132]257_imagehighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=1&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_textHIGHLIGHT_,_texticonhighlight_)}
[283]258
[11132]259_imagenohighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=0&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_document:textNOHIGHLIGHT_,_document:texticonnohighlight_)}
[283]260
[11132]261_imagecontracttoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=0,_textCONTRACTCONTENTS_,_texticoncontracttoc_)}
[283]262
[11132]263_imageexpandtoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=1,_textEXPANDCONTENTS_,_texticonexpandtoc_)}
[283]264
[11132]265_imagecontracttext_ {_docbutton_(_httpcurrentdocument_&amp;gt=0,_textCONTRACT_,_texticoncontracttext_)}
[283]266
[11132]267_imageexpandtext_ {_docbutton_(_httpcurrentdocument_&amp;gt=1,_textEXPANDTEXT_,_texticonexpandtext_)}
[283]268
[11132]269_imagecont_ {_docbutton_(_httpcurrentdocument_&amp;gt=2,_textCONTINUE_,_texticoncont_)}
[283]270
[11132]271
[13427]272#######################################################################
273# print preview script
274#######################################################################
[11132]275
[13427]276
277_pagescriptextra_{
278
279 var style_display_old;
280 var show = true;
[13452]281 var toc_top;
[13427]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;
[13452]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";
[13427]307 \};
308 \}
309
310 \}
311
[13452]312
[13427]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;
[13452]321 if (toc_top)
322 div_node.insertBefore(toc_top,div_node.firstChild);
323 \};
[13427]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)\{
[13450]335 toc_link.appendChild(document.createTextNode('_textshowcontents_'));
[13427]336 show = false;
337 hide_toc();
338 \}
339 else\{
[13450]340 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
[13427]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;\};
[13450]362 cancel_print_link.appendChild(document.createTextNode('_textreturnoriginal_'));
[13427]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;\};
[13450]368 print_link.appendChild(document.createTextNode('_textprintpage_'));
[13427]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;\};
[13450]375 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
[13427]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
[283]418#######################################################################
[258]419# headers/footers
420#######################################################################
421
422
423# header overridden for text pages
424_textheader_ {_cgihead_
[454]425_htmlhead_
[10872]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>
[11779]433<div class="bannerextra">_pagebannerextra_</div>
[258]434}
[10872]435
[548]436_textheader_ [v=1] {_cgihead_
437_htmlhead_
[10872]438_globallinks_
[548]439}
[258]440
441_footer_ {
[10872]442</div> <!-- document:footer -->
443
[13427]444<div class="navarrowsbottom">
[4868]445_navarrowsbottom_
[13427]446</div>
[258]447_endspacer__htmlfooter_
448}
Note: See TracBrowser for help on using the repository browser.