source: main/trunk/greenstone2/macros/document.dm@ 27258

Last change on this file since 27258 was 27258, checked in by ak19, 11 years ago
  1. The Add User Comment form is no longer displayed when Browsing, only on document pages. 2. When a user is in a subsection and tries to add a comment, it should get added to the top section, which is at the docid level, and not get added at the subsection level. This also means that import's metadata will be set correctly in metadata.xml, since import doesn't store subsection level meta.
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 24.0 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="_httpstyle_/preview-document.css"
24 type="text/css"
25 title="Preview Document" charset="UTF-8" media="screen" _linktagend_
26 <link rel="stylesheet" href="_httpstyle_/print-document.css" type="text/css"
27 charset="UTF-8" media="print" _linktagend_
28}
29
30#######################################################################
31# page content
32#######################################################################
33
34_tocopen_ {<div class="top" _tocopenextra_>}
35_tocclose_ {</div>}
36
37_nextsearchresult_ {_If_("_cgiargsrn_" ne "0",<li id="nextresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrn_">_textnextsearchresult_</a></li>)}
38
39_prevsearchresult_ {_If_("_cgiargsrp_" ne "0",<li id="prevresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrp_">_textprevsearchresult_</a></li>)}
40
41_content_ {
42_optnavigationbar_
43
44_If_(_phindclassifier__collageclassifier_,
45<p style="text-align: center;">
46_phindclassifier_
47_collageclassifier_
48</p>
49)
50
51_If_("_cgiargcl_" eq "search",
52<ul id="searchresults">
53_prevsearchresult_
54_nextsearchresult_
55</ul>)
56
57<div class="document">
58
59
60}
61
62# Dublin Core Metadata Element Set, Version 1.1
63_textTitlepage_ {_texticonhtitle_}
64_textCreatorpage_ {_texticonhcreat_}
65_textSubjectpage_ {_texticonhsubj_}
66_textDescriptionpage_ {_texticonhdesc_}
67_textPublisherpage_ {_texticonhpubl_}
68_textContributorpage_ {_texticonhcontr_}
69_textDatepage_ {_texticonhdate_}
70_textTypepage_ {_texticonhtype_}
71_textFormatpage_ {_texticonhform_}
72_textIdentifierpage_ {_texticonhident_}
73_textSourcepage_ {_texticonhsrc_}
74_textLanguagepage_ {_texticonhlang_}
75_textRelationpage_ {_texticonhrel_}
76_textCoveragepage_ {_texticonhcover_}
77_textRightspage_ {_texticonhright_}
78
79_textTopage_ {_texticonhto_}
80_textFrompage_ {_texticonhfrom_}
81_textSeriespage_ {_texticonhser_}
82_textHowtopage_ {_texticonhhow_}
83_textOrganizationpage_ {_texticonhorg_}
84_textBrowsepage_ {_texticonhbrwse_}
85_textCollagepage_ {_texticonhcoll_}
86_textPeoplepage_ {_texticonhpeople_}
87_textAcronympage_ {_texticonhacronym_}
88_textPhrasepage_ {_texticonhphrases_}
89_textArtistpage_ {_texticonhartist_}
90_textKeywordpage_ {_texticonhkw_}
91_textVolumepage_ {_texticonhvol_}
92_textCaptionspage_ {_texticonhcapt_}
93_textCountriespage_ {_texticonhcount_}
94
95#######################################################################
96# navigation arrows
97#
98#######################################################################
99
100# these two may be reset to "" by the server
101_navarrowsbottom_ {_navarrows_}
102_navarrowstop_ {_navarrows_}
103
104_navarrows_ {<center>
105<table width=_pagewidth_ cellpadding=0 cellspacing=0 border=0>
106<tr><td align=left valign=top>
107_usercomment_
108_prevarrow_
109</td><td align=right valign=top>
110_nextarrow_
111</td></tr></table>
112</center>
113}
114
115_prevarrow_ {_If_(_httpprevarrow_,<a href="_httpprevarrow_">_iconprev_</a>)}
116_nextarrow_ {_If_(_httpnextarrow_,<a href="_httpnextarrow_">_iconnext_</a>)}
117
118_navarrows_ [v=1] {<p>
119_prevarrow_<br>
120_nextarrow_
121}
122
123#######################################################################
124# section for adding user comments: consists of form and its javascript
125#######################################################################
126
127# Display the add-user-comment form on actual document pages and not when browsing/searching
128# This means the form should only be displayed on pages where the _cgiargd_ (the docid) is set
129
130# For getting the submitbutton to make Ajax calls, see
131# http://stackoverflow.com/questions/4264091/input-type-submit-instead-of-input-type-button-with-ajax
132# http://stackoverflow.com/questions/8869341/ajax-form-submit-with-submit-button
133
134_usercomment_ {
135
136_If_(_cgiargd_,
137
138<form name="AddUserCommentForm">
139<p>_textcommentusername_ <input type="text" name="username"></p>
140<p>
141_textaddusercomment_
142<textarea name="comment" rows="10" cols="70"></textarea>
143<input type=hidden name="d" value="_cgiargd_">
144</p>
145
146<input type="submit" value="_textaddcomment_" onclick="addUserComment(document.AddUserCommentForm.username.value, document.AddUserCommentForm.comment.value, document.AddUserCommentForm.d.value); return false;">
147</form>
148)
149<script type="text/javascript">
150 function addUserComment(_username, _comment, _docid) \{
151 // Need to the add user comment meta of username, timestamp and comment to the
152 // topmost section of the document. So only get the docId up to any period mark:
153 var period = _docid.indexOf(".");
154 if(period != -1) \{
155 _docid = _docid.substring(0, period);
156 \}
157
158 // Want to store username, timestamp and comment in import/metadata.xml, archives/doc.xml
159 // and index/col.gdb.
160
161 // For getting the current time, see
162 // http://stackoverflow.com/questions/3830244/get-current-date-time-in-seconds
163 var _timestamp = new Date().getTime(); // div by 1000 to get seconds. valueOf() may return string
164
165 //alert("username:" + _username
166 //+ "\\ncomment: " + _comment
167 //+ "\\ncollection: " + collection
168 //+ "\\ndocid: " + _docid
169 //+ "\\ntimestamp: " + _timestamp);
170
171
172 // To make individual api calls to set username meta, then timestamp then comment meta:
173 // GSAPI already knows the collection
174 //gsapi.setMetadata(_docid, "username", null, _username, "accumulate", "import|archives|index");
175 //gsapi.setMetadata(_docid, "usertimestamp", null, _timestamp, "accumulate", "import|archives|index");
176 //gsapi.setMetadata(_docid, "usercomment", null, _comment, "accumulate", "import|archives|index");
177
178
179 // Use the new JSON metatable format to set username, timestamp and comment meta for docid in one go
180
181 // For creating the JSON object that gets turned into a string, see
182 // http://msdn.microsoft.com/en-us/library/ie/cc836459%28v=vs.94%29.aspx
183 // http://jsfiddle.net/qmacro/W54hy/
184
185 var username_rec = \{
186 metaname: "username",
187 metavals: [_username]
188 \};
189
190 var timestamp_rec = \{
191 metaname: "timestamp",
192 metavals: [_timestamp]
193 \};
194
195 var comment_rec = \{
196 metaname: "usercomment",
197 metavals: [_comment]
198 \};
199
200 var doc_rec = \{
201 docid: _docid,
202 metatable: [username_rec, timestamp_rec, comment_rec],
203 metamode: "accumulate"
204 \};
205
206 var docArray = [doc_rec];
207
208 //alert(JSON.stringify(docArray));
209
210 // GSAPI already knows the collection
211 gsapi.setMetadataArray(docArray, "accumulate","import|archives|index");
212
213 \}
214</script>
215}
216
217
218#######################################################################
219# the goto form
220#######################################################################
221
222_gotoform_ {
223<form name="GotoForm" method="get" action="_gwcgi_">
224<input type=hidden name="e" value="_decodedcompressedoptions_">
225<input type=hidden name="d" value="_cgiargd_">
226<input type=hidden name="cl" value="_cgiargcl_">
227<input type="text" name="gp" size="3" maxlength="4">
228<input type="submit" value="_textgoto_">
229</form>
230}
231
232_textnumpages_ {&nbsp;<i>(_1_ _pages_)</i>}
233_parentarrow_ {}
234_prevtitle_ {}
235_nexttitle_ {}
236
237#######################################################################
238# the phind applet
239#
240# The phind applet is only required on phind classifier pages.
241# Consequently, the _phindclassifier_ macro is not usually set. On screens
242# where it is required, _phindclassifier_ resolves to _phindapplet_, and
243# the following macro is loaded into the web page.
244#######################################################################
245
246_phindapplet_ {
247<APPLET CODEBASE="_httpjava_" CODE="org.nzdl.gsdl.Phind.Phind.class" ARCHIVE="Phind.jar" WIDTH=500 HEIGHT=400>
248 <PARAM NAME=library VALUE="_gwcgi_?e=_compressedoptions_">
249 <PARAM NAME=phindcgi VALUE="_gwcgi_?a=phind">
250 <PARAM NAME=collection VALUE="_cgiargc_">
251 <PARAM NAME=classifier VALUE="_phindnumber_">
252
253 <PARAM NAME=orientation VALUE="vertical">
254 <PARAM NAME=depth VALUE="2">
255 <PARAM NAME=resultorder VALUE="L,l,E,e,D,d">
256 <PARAM NAME=textorientation VALUE="_textorientation_">
257 <PARAM NAME=backdrop VALUE="_httpimg_/phindbg1.jpg">
258 <PARAM NAME=fontsize VALUE="10">
259 <PARAM NAME=blocksize VALUE="10">
260
261 The Phind java applet.
262</APPLET>
263}
264
265_collageapplet_ {
266 <applet CODEBASE="_httpjava_"
267 code="org.nzdl.gsdl.GsdlCollageApplet.GsdlCollageApplet.class"
268 archive="GsdlCollageApplet.jar"
269 width="_collagexdim_" height="_collageydim_">
270
271 <param name="gwcgi" value="_gwcgi_">
272 <param name="collection" value="_cgiargc_">
273 <param name="classifier" value="_cgiargcl_.1">
274
275 <param name="hrefMustHave" value="cl=_cgiargcl_.1">
276 <param name="imageMustNotHave" value="hl=\%x=\%gt=\%gc=\%.pr">
277
278 <param name="imageType" value="_collageimageType_">
279 <param name="verbosity" value="_collageverbosity_">
280 <param name="maxDepth" value="_collagemaxDepth_">
281 <param name="maxDisplay" value="_collagemaxDisplay_">
282 <param name="refreshDelay" value="_collagerefreshDelay_">
283 <param name="isJava2" value="_collageisJava2_">
284 <param name="bgcolor" value="_collagebgcolor_">
285 <param name="documentroot" value="_httpimg_">
286 </applet>
287
288<center>
289_collagecaption_
290</center>
291}
292
293
294_flashbook_ {
295 <div id="bookdiv">
296 </div>
297
298 <script type="text/javascript">
299 var myWidth = "100%";
300 myHeight = 800;
301
302 var img_cover = '_httpassocdir_/_thisOID_/cover.jpg';
303 var doc_url = document.URL;
304 doc_url = doc_url.replace(/(&|\\?)book=[a-z]+/gi,'');
305 doc_url += '&book=flashxml';
306
307 var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;//get windows or not
308 //Only for Windows computers because Greenstone webserver doesn't allow us to pass parameters to Flash.
309 //These methods is called by the Flash program to get all the necessary parameters for the book
310 //However, it will only work for IE 5.0 and later, Firefox 1.0 and later, Mozilla 1.7.5 and later
311 //Netscape 8.0 and later, Safari 1.3 and later
312 function getDocURL() \{ return doc_url; \}
313 function getImgCover() \{ return img_cover; \}
314 function getStageW() \{ return -1; \}
315 function getStageH() \{ return -1; \}
316
317
318 var flash_plug_html = "";
319 flash_plug_html += '<OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \\n';
320 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \\n';
321 flash_plug_html += ' height="';
322 flash_plug_html += myHeight + '" id="Book" swLiveConnect="true" align="middle"\\n';
323 flash_plug_html += ' width="';
324 flash_plug_html += myWidth + '">\\n';
325
326 flash_plug_html += ' <PARAM name="allowScriptAccess" value="always" />\\n';
327 flash_plug_html += ' <PARAM name="movie" value="_httpflash_/Book.swf';
328 if (isWin == false)
329 \{
330 flash_plug_html += '?src_image=' + escape(img_cover);
331 flash_plug_html += '&amp;doc_url=' + escape(doc_url);
332 \}
333 flash_plug_html += '" />\\n';
334 flash_plug_html += ' <PARAM name="quality" value="high" />\\n';
335 flash_plug_html += ' <PARAM name="bgcolor" value="#FFFFFF" />\\n';
336 flash_plug_html += ' <EMBED align="middle" \\n';
337 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \\n';
338 flash_plug_html += ' bgcolor="#FFFFFF" height="';
339 flash_plug_html += myHeight + '" name="Book" \\n';
340 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \\n';
341 flash_plug_html += ' quality="high" \\n';
342 flash_plug_html += ' src=\\'_httpflash_/Book.swf';
343 if (isWin == false)
344 \{
345 flash_plug_html += '?src_image=' + escape(img_cover);
346 flash_plug_html += '&amp;doc_url=' + escape(doc_url);
347 \}
348 flash_plug_html += '\\'\\n';
349 flash_plug_html += ' type="application/x-shockwave-flash" width="';
350 flash_plug_html += myWidth + '" />\\n';
351 flash_plug_html += '</OBJECT>\\n';
352
353 var flash_div = document.getElementById("bookdiv");
354 flash_div.innerHTML = flash_plug_html;
355 </script>
356}
357
358#######################################################################
359# icons
360#######################################################################
361
362_iconsmalltext_ {<img src="_httpiconsmtext_" class="icon" width=_widthsmtext_ height=_heightsmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
363_iconsmalltext_ [v=1] {<small><b>_texticonsmalltext2_</b></small>}
364
365_iconarrowsmalltext_ {<img src="_httpiconasmtext_" class="icon" width=_widthasmtext_ height=_heightasmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
366_iconarrowsmalltext_ [v=1] {<small><b>->_texticonsmalltext2_</b></small>}
367
368_iconclosedfolder_ {<img src="_httpiconclsdfldr_" class="icon" width=_widthclsdfldr_ height=_heightclsdfldr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
369_iconclosedfolder_ [v=1] {<small><b>_texticonclosedfolder2_</b></small>}
370
371_iconarrowclosedfolder_ {<img src=_httpiconaclsdfdr_" class="icon" width=_widthaclsdfdr_ height=_heightaclsdfdr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
372_iconarrowclosedfolder_ [v=1] {<small><b>->_texticonclosedfolder2_</b></small>}
373
374_iconopenfolder_ {<img src="_httpiconopenfldr_" class="icon" width=_widthopenfldr_ height=_heightopenfldr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
375_iconopenfolder_ [v=1] {<small><b>_texticonopenfolder2_</b></small>}
376
377_iconarrowopenfolder_ {<img src="_httpiconaopenfdr_" class="icon" width=_widthaopenfdr_ height=_heightaopenfdr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
378_iconarrowopenfolder_ [v=1] {<small><b>->_texticonopenfolder2_</b></small>}
379
380_iconarrowclosedbook_ {<img src="_httpiconabook_" width=_widthabook_ height=_heightabook_ class="icon" alt="_texticonclosedbook_" title="_texticonclosedbook_">}
381_iconarrowclosedbook_ [v=1] {<small><b>->_texticonclosedbook_: </b></small>}
382
383_iconopenbook_ {<img src="_httpiconopenbook_" width=_widthopenbook_ height=_heightopenbook_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
384_iconopenbook_ [v=1] {<small><b>_texticonopenbook_: </b></small>}
385
386_iconarrowopenbook_ {<img src="_httpiconaopenbk_" width=_widthaopenbk_ height=_heightaopenbk_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
387_iconarrowopenbook_ [v=1] {<small><b>->_texticonopenbook_: </b></small>}
388
389_iconopenbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
390_iconopenbookshelf_ [v=1] {<small><b>_texticonopenbookshelf_: </b></small>}
391
392_iconarrowopenbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
393_iconarrowopenbookshelf_ [v=1] {<small><b>->_texticonopenbookshelf_: </b></small>}
394
395_iconclosedbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
396_iconclosedbookshelf_ [v=1] {<small><b>_texticonclosedbookshelf_: </b></small>}
397
398_iconarrowclosedbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
399_iconarrowclosedbookshelf_ [v=1] {<small><b>->_texticonclosedbookshelf_: </b></small>}
400
401_iconpointer_ {<img src="_httpiconarrrght_" class="icon" width=_widtharrrght_ height=_heightarrrght_>}
402_iconpointer_ [v=1] {<small><b>_texticonpointer_-> </b></small>}
403
404_iconwarning_ {<img src="_httpiconwarning_" width="_widthwarning_" height="_heightwarning_" class="icon" align="left">}
405_iconwarning_ [v=1] {_texticonwarning_}
406
407
408#######################################################################
409# images
410#######################################################################
411
412_coverimage_ {<img alt="Cover Image" onError="src='_httpimg_/blank.gif'" src="_httpassocdir_/_thisOID_/cover.jpg">}
413
414_docbutton_ {<div class="button"><span class="button" title="_3_"><a href="_1_">_2_</a></span></div>
415}
416
417# can't use _docbutton_ macro for detach button as we need to include target
418_imagedetach_ {<div class="button"><span class="button"><a href="_httpcurrentdocument_&amp;x=1" target="\_blank" title="_texticondetach_">_textDETACH_</a></span></div>}
419
420_imageprint_{<div class="button"><span class="button"><a href="javascript:print_preview()">_textPRINT_</a></span></div>}
421
422
423_imagehighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=1&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_textHIGHLIGHT_,_texticonhighlight_)}
424
425_imagenohighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=0&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_document:textNOHIGHLIGHT_,_document:texticonnohighlight_)}
426
427_imagecontracttoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=0,_textCONTRACTCONTENTS_,_texticoncontracttoc_)}
428
429_imageexpandtoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=1,_textEXPANDCONTENTS_,_texticonexpandtoc_)}
430
431_imagecontracttext_ {_docbutton_(_httpcurrentdocument_&amp;gt=0,_textCONTRACT_,_texticoncontracttext_)}
432
433_imageexpandtext_ {_docbutton_(_httpcurrentdocument_&amp;gt=1,_textEXPANDTEXT_,_texticonexpandtext_)}
434
435_imagecont_ {_docbutton_(_httpcurrentdocument_&amp;gt=2,_textCONTINUE_,_texticoncont_)}
436
437
438#######################################################################
439# print preview script
440#######################################################################
441
442
443_pagescriptextra_{
444
445 var style_display_old;
446 var show = true;
447 var toc_top;
448
449 function has_toc(){
450 var div_nodes = document.getElementsByTagName("div");
451 for (var i=0;i < div_nodes.length ; i++ )\{
452 var div_node = div_nodes[i];
453 if (div_node.className =="toc" && div_node.childNodes.length > 1)
454 \{
455 return true;
456 \}
457 \}
458
459 return false;
460 \}
461
462 function hide_toc()\{
463 var div_nodes = document.getElementsByTagName("div");
464 for (var i=0;i < div_nodes.length ; i++ )\{
465 var div_node = div_nodes[i];
466 if (div_node.className =="toc")
467 \{
468 style_display_old = div_node.style.display;
469 toc_top = document.getElementById("toc_top");
470 if (toc_top)
471 div_node.parentNode.insertBefore(toc_top,div_node);
472 div_node.style.display = "none";
473 \};
474 \}
475
476 \}
477
478
479 function show_toc()\{
480
481 var div_nodes = document.getElementsByTagName("div");
482 for (var i=0;i < div_nodes.length ; i++ )\{
483 var div_node = div_nodes[i];
484 if (div_node.className =="toc")
485 \{
486 div_node.style.display = style_display_old;
487 if (toc_top)
488 div_node.insertBefore(toc_top,div_node.firstChild);
489 \};
490 \}
491
492 \}
493
494
495 function switch_toc()\{
496 var toc_link = document.getElementById("toc_link");
497 while (toc_link.hasChildNodes()) \{
498 toc_link.removeChild(toc_link.firstChild);
499 \}
500 if (show)\{
501 toc_link.appendChild(document.createTextNode('_textshowcontents_'));
502 show = false;
503 hide_toc();
504 \}
505 else\{
506 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
507 show = true;
508 show_toc();
509 \}
510
511 \}
512
513 function print_preview() \{
514 // Switch the stylesheet
515 setActiveStyleSheet("Preview Document");
516 add_print_message();
517 \}
518
519 function add_print_message()\{
520 if (document.getElementById)\{
521 var print_message = document.createElement('ul');
522 print_message.id = 'print-message';
523 print_message.className = "printmessage";
524
525 var cancel_print_link = document.createElement('li');
526 cancel_print_link.className = "cancelprint"
527 cancel_print_link.onclick = function()\{ cancel_print(); return false;\};
528 cancel_print_link.appendChild(document.createTextNode('_textreturnoriginal_'));
529 print_message.appendChild(cancel_print_link);
530
531
532 var print_link = document.createElement('li');
533 print_link.onclick = function()\{ window.print(); return false;\};
534 print_link.appendChild(document.createTextNode('_textprintpage_'));
535 print_message.appendChild(print_link);
536
537 if (has_toc())\{
538 var toc_link = document.createElement('li');
539 toc_link.id = "toc_link";
540 toc_link.onclick = function()\{ switch_toc(); return false;\};
541 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
542 print_message.appendChild(toc_link);
543 \}
544
545 //insert the print message node
546 var div_nodes = document.getElementsByTagName("div");
547 for (var i=0;i < div_nodes.length ; i++ )\{
548 var div_node = div_nodes[i];
549 if (div_node.className =="document")\{
550 var parent = div_node.parentNode;
551 parent.insertBefore(print_message,div_node);
552 \}
553 \}
554 \}
555
556 \}
557
558
559 function cancel_print() \{
560 // Destroy the preview message
561 var print_message = document.getElementById('print-message');
562 var parent = print_message.parentNode;
563 parent.removeChild(print_message);
564
565 show_toc();
566 // Switch back stylesheet
567 setActiveStyleSheet("default");
568 \}
569
570 function setActiveStyleSheet(title) \{
571 var i, a, main;
572 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) \{
573 if(a.getAttribute("rel").indexOf("style") != -1
574 && a.getAttribute("title")) \{
575 a.disabled = true;
576 if(a.getAttribute("title") == title) a.disabled = false;
577 \}
578 \}
579 \}
580
581}
582
583
584#######################################################################
585# headers/footers
586#######################################################################
587
588
589# header overridden for text pages
590_textheader_ {_cgihead_
591_htmlhead_
592_startspacer_
593
594<!-- document:textheader -->
595<div id="banner">
596<div class="pageinfo"><p class="bannerlinks">_globallinks_</p></div>
597<div class="collectimage">_imagecollection_</div>
598</div>
599<div class="bannerextra">_pagebannerextra_</div>
600}
601
602_textheader_ [v=1] {_cgihead_
603_htmlhead_
604_globallinks_
605}
606
607_footer_ {
608</div> <!-- document:footer -->
609
610<div class="navarrowsbottom">
611_navarrowsbottom_
612</div>
613_endspacer__htmlfooter_
614}
615
616
617
618
619package Global
620
621# Social network support
622# Defined here in document, as the most likely place this will be used in
623# within a document view, however its package is 'Global' because you
624# might equally want this in a search or browse list
625
626# _1_ = e.g. title
627# _2_ = [srclink] or left empty. If left empty, then it will share the internal GS document
628
629_sharemescript_ {
630 <script type="text/javascript">
631 var a2a_config = a2a_config || \{ \};
632 a2a_config.linkname = "_1_";
633
634 _If_(_2_,
635 var srclink = \'_2_\';
636
637 //If metadata value is a valid URL that starts with xxx://
638 // (e.g. any protocol\, http, https\, ftp ...) then that will be the link to share
639 if (srclink.match(/^[^:]+:\\\/\\\//i)) \{
640 a2a_config.linkurl = srclink;
641 \}
642 else \{
643 //if metadata value is [srclink] then we have to cut off the 'href' tag label
644 var href = srclink.match(/href=\"([^\"]*)\"/);
645 a2a_config.linkurl = gsapi.fullDomainURL(href[1]);
646 \}
647 ,
648 //if no metadata was passed as link\, then the GS version of the document will be used.
649 a2a_config.linkurl = gsapi.fullDomainURL("_gwcgi_")+ "?c=_cgiargc_&a=d&d=_cgiargd_";
650)
651
652 </script>
653}
654
655_shareme_ {
656
657<div style=\'padding-left:50px;\' class=\'a2a_kit a2a_default_style\'>
658 _sharemescript_(_1_,_2_)
659 <center>
660 <a class=\'a2a_dd\' href=\'http://www.addtoany.com/share_save\'>Share</a>
661 <span class=\"a2a_divider\"></span>
662 <a class=\'a2a_button_facebook\'></a>
663 <a class=\'a2a_button_twitter\'></a>
664 <a class=\'a2a_button_email\'></a>
665 <a class=\'a2a_button_linkedin\'></a>
666 </center>
667 <script type=\"text/javascript\" src=\"http://static.addtoany.com/menu/page.js\"></script>
668</div>
669
670}
671
672_sharemesmall_ {
673
674<span style=\'padding-left:8px;\' class=\'a2a_kit a2a_default_style\'>
675 _sharemescript_(_1_,_2_)
676 <a class=\'a2a_dd\' href=\'http://www.addtoany.com/share_save\'>Share</a>
677 <script type=\"text/javascript\" src=\"http://static.addtoany.com/menu/page.js\"></script>
678</span>
679
680}
Note: See TracBrowser for help on using the repository browser.