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

Last change on this file since 27257 was 27257, checked in by ak19, 11 years ago

Add User Comment form. Allows adding username, timestamp and comment to a document. Need to still display the just-added comment when the ajax reloads the page. Also should not display the form on a non-doc page, like when browsing a classifier.

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