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

Last change on this file since 27021 was 25396, checked in by jmt12, 12 years ago

A space between an backslash and a closing curly bracket (javascript) meant the bracket wasn't escaped and everything there after caused errors when parsing

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 20.7 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_
[19129]23 <link rel="alternate stylesheet" href="_httpstyle_/preview-document.css"
[13450]24 type="text/css"
[13427]25 title="Preview Document" charset="UTF-8" media="screen" _linktagend_
[19129]26 <link rel="stylesheet" href="_httpstyle_/print-document.css" type="text/css"
[13427]27 charset="UTF-8" media="print" _linktagend_
28}
[13370]29
[258]30#######################################################################
31# page content
32#######################################################################
33
[14181]34_tocopen_ {<div class="top" _tocopenextra_>}
35_tocclose_ {</div>}
36
[13534]37_nextsearchresult_ {_If_("_cgiargsrn_" ne "0",<li id="nextresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrn_">_textnextsearchresult_</a></li>)}
[12944]38
[13534]39_prevsearchresult_ {_If_("_cgiargsrp_" ne "0",<li id="prevresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrp_">_textprevsearchresult_</a></li>)}
[13370]40
[258]41_content_ {
[7503]42_optnavigationbar_
[11094]43
[10872]44_If_(_phindclassifier__collageclassifier_,
45<p style="text-align: center;">
[1804]46_phindclassifier_
[6813]47_collageclassifier_
[10872]48</p>
49)
[13370]50
[13528]51_If_("_cgiargcl_" eq "search",
[13534]52<ul id="searchresults">
[13528]53_prevsearchresult_
54_nextsearchresult_
[14776]55</ul>)
[13370]56
[10872]57<div class="document">
[13370]58
59
[258]60}
61
[8106]62# Dublin Core Metadata Element Set, Version 1.1
[2802]63_textTitlepage_ {_texticonhtitle_}
[8106]64_textCreatorpage_ {_texticonhcreat_}
[2802]65_textSubjectpage_ {_texticonhsubj_}
[8106]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
[2802]79_textTopage_ {_texticonhto_}
80_textFrompage_ {_texticonhfrom_}
81_textSeriespage_ {_texticonhser_}
82_textHowtopage_ {_texticonhhow_}
83_textOrganizationpage_ {_texticonhorg_}
84_textBrowsepage_ {_texticonhbrwse_}
[6813]85_textCollagepage_ {_texticonhcoll_}
[2802]86_textPeoplepage_ {_texticonhpeople_}
87_textAcronympage_ {_texticonhacronym_}
88_textPhrasepage_ {_texticonhphrases_}
89_textArtistpage_ {_texticonhartist_}
[3105]90_textKeywordpage_ {_texticonhkw_}
[3534]91_textVolumepage_ {_texticonhvol_}
[5622]92_textCaptionspage_ {_texticonhcapt_}
[5517]93_textCountriespage_ {_texticonhcount_}
[2802]94
[258]95#######################################################################
96# navigation arrows
97#
98#######################################################################
99
[4868]100# these two may be reset to "" by the server
101_navarrowsbottom_ {_navarrows_}
102_navarrowstop_ {_navarrows_}
103
[258]104_navarrows_ {<center>
105<table width=_pagewidth_ cellpadding=0 cellspacing=0 border=0>
106<tr><td align=left valign=top>
107_prevarrow_
108</td><td align=right valign=top>
109_nextarrow_
110</td></tr></table>
111</center>
112}
113
114_prevarrow_ {_If_(_httpprevarrow_,<a href="_httpprevarrow_">_iconprev_</a>)}
115_nextarrow_ {_If_(_httpnextarrow_,<a href="_httpnextarrow_">_iconnext_</a>)}
116
[548]117_navarrows_ [v=1] {<p>
[258]118_prevarrow_<br>
119_nextarrow_
120}
121
122#######################################################################
123# the goto form
124#######################################################################
125
126_gotoform_ {
127<form name="GotoForm" method="get" action="_gwcgi_">
[876]128<input type=hidden name="e" value="_decodedcompressedoptions_">
[258]129<input type=hidden name="d" value="_cgiargd_">
130<input type=hidden name="cl" value="_cgiargcl_">
[666]131<input type="text" name="gp" size="3" maxlength="4">
[944]132<input type="submit" value="_textgoto_">
[258]133</form>
134}
135
[944]136_textnumpages_ {&nbsp;<i>(_1_ _pages_)</i>}
[666]137_parentarrow_ {}
[19048]138_prevtitle_ {}
139_nexttitle_ {}
[666]140
[258]141#######################################################################
[1804]142# the phind applet
143#
144# The phind applet is only required on phind classifier pages.
145# Consequently, the _phindclassifier_ macro is not usually set. On screens
146# where it is required, _phindclassifier_ resolves to _phindapplet_, and
147# the following macro is loaded into the web page.
148#######################################################################
149
150_phindapplet_ {
[19149]151<APPLET CODEBASE="_httpjava_" CODE="org.nzdl.gsdl.Phind.Phind.class" ARCHIVE="Phind.jar" WIDTH=500 HEIGHT=400>
[3084]152 <PARAM NAME=library VALUE="_gwcgi_?e=_compressedoptions_">
[2487]153 <PARAM NAME=phindcgi VALUE="_gwcgi_?a=phind">
[1804]154 <PARAM NAME=collection VALUE="_cgiargc_">
[2021]155 <PARAM NAME=classifier VALUE="_phindnumber_">
156
[1804]157 <PARAM NAME=orientation VALUE="vertical">
158 <PARAM NAME=depth VALUE="2">
[2021]159 <PARAM NAME=resultorder VALUE="L,l,E,e,D,d">
[22383]160 <PARAM NAME=textorientation VALUE="_textorientation_">
[2021]161 <PARAM NAME=backdrop VALUE="_httpimg_/phindbg1.jpg">
162 <PARAM NAME=fontsize VALUE="10">
[1804]163 <PARAM NAME=blocksize VALUE="10">
[2021]164
[1804]165 The Phind java applet.
166</APPLET>
167}
168
[6813]169_collageapplet_ {
[19149]170 <applet CODEBASE="_httpjava_"
[7332]171 code="org.nzdl.gsdl.GsdlCollageApplet.GsdlCollageApplet.class"
172 archive="GsdlCollageApplet.jar"
173 width="_collagexdim_" height="_collageydim_">
[1804]174
[7332]175 <param name="gwcgi" value="_gwcgi_">
176 <param name="collection" value="_cgiargc_">
177 <param name="classifier" value="_cgiargcl_.1">
[6813]178
[7332]179 <param name="hrefMustHave" value="cl=_cgiargcl_.1">
180 <param name="imageMustNotHave" value="hl=\%x=\%gt=\%gc=\%.pr">
181
182 <param name="imageType" value="_collageimageType_">
183 <param name="verbosity" value="_collageverbosity_">
184 <param name="maxDepth" value="_collagemaxDepth_">
185 <param name="maxDisplay" value="_collagemaxDisplay_">
186 <param name="refreshDelay" value="_collagerefreshDelay_">
187 <param name="isJava2" value="_collageisJava2_">
188 <param name="bgcolor" value="_collagebgcolor_">
[11421]189 <param name="documentroot" value="_httpimg_">
[6813]190 </applet>
[7332]191
192<center>
193_collagecaption_
194</center>
[13971]195}
[7332]196
[13971]197
198_flashbook_ {
199 <div id="bookdiv">
200 </div>
201
202 <script type="text/javascript">
[14082]203 var myWidth = "100%";
204 myHeight = 800;
205
[19149]206 var img_cover = '_httpassocdir_/_thisOID_/cover.jpg';
[13971]207 var doc_url = document.URL;
208 doc_url = doc_url.replace(/(&|\\?)book=[a-z]+/gi,'');
[14082]209 doc_url += '&book=flashxml';
[18168]210
211 var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;//get windows or not
212 //Only for Windows computers because Greenstone webserver doesn't allow us to pass parameters to Flash.
213 //These methods is called by the Flash program to get all the necessary parameters for the book
214 //However, it will only work for IE 5.0 and later, Firefox 1.0 and later, Mozilla 1.7.5 and later
215 //Netscape 8.0 and later, Safari 1.3 and later
216 function getDocURL() \{ return doc_url; \}
217 function getImgCover() \{ return img_cover; \}
218 function getStageW() \{ return -1; \}
219 function getStageH() \{ return -1; \}
220
221
[13971]222 var flash_plug_html = "";
223 flash_plug_html += '<OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \\n';
224 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \\n';
225 flash_plug_html += ' height="';
[18168]226 flash_plug_html += myHeight + '" id="Book" swLiveConnect="true" align="middle"\\n';
[13971]227 flash_plug_html += ' width="';
228 flash_plug_html += myWidth + '">\\n';
[18168]229
[13971]230 flash_plug_html += ' <PARAM name="allowScriptAccess" value="always" />\\n';
[19130]231 flash_plug_html += ' <PARAM name="movie" value="_httpflash_/Book.swf';
[18168]232 if (isWin == false)
233 \{
234 flash_plug_html += '?src_image=' + escape(img_cover);
235 flash_plug_html += '&amp;doc_url=' + escape(doc_url);
236 \}
[13971]237 flash_plug_html += '" />\\n';
238 flash_plug_html += ' <PARAM name="quality" value="high" />\\n';
239 flash_plug_html += ' <PARAM name="bgcolor" value="#FFFFFF" />\\n';
240 flash_plug_html += ' <EMBED align="middle" \\n';
241 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \\n';
242 flash_plug_html += ' bgcolor="#FFFFFF" height="';
243 flash_plug_html += myHeight + '" name="Book" \\n';
244 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \\n';
245 flash_plug_html += ' quality="high" \\n';
[19130]246 flash_plug_html += ' src=\\'_httpflash_/Book.swf';
[18168]247 if (isWin == false)
248 \{
249 flash_plug_html += '?src_image=' + escape(img_cover);
250 flash_plug_html += '&amp;doc_url=' + escape(doc_url);
251 \}
252 flash_plug_html += '\\'\\n';
[13971]253 flash_plug_html += ' type="application/x-shockwave-flash" width="';
254 flash_plug_html += myWidth + '" />\\n';
255 flash_plug_html += '</OBJECT>\\n';
256
257 var flash_div = document.getElementById("bookdiv");
258 flash_div.innerHTML = flash_plug_html;
259 </script>
[6813]260}
261
[1804]262#######################################################################
[283]263# icons
[258]264#######################################################################
265
[10872]266_iconsmalltext_ {<img src="_httpiconsmtext_" class="icon" width=_widthsmtext_ height=_heightsmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
[548]267_iconsmalltext_ [v=1] {<small><b>_texticonsmalltext2_</b></small>}
[283]268
[10872]269_iconarrowsmalltext_ {<img src="_httpiconasmtext_" class="icon" width=_widthasmtext_ height=_heightasmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
[548]270_iconarrowsmalltext_ [v=1] {<small><b>->_texticonsmalltext2_</b></small>}
[454]271
[10872]272_iconclosedfolder_ {<img src="_httpiconclsdfldr_" class="icon" width=_widthclsdfldr_ height=_heightclsdfldr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
[548]273_iconclosedfolder_ [v=1] {<small><b>_texticonclosedfolder2_</b></small>}
[283]274
[10872]275_iconarrowclosedfolder_ {<img src=_httpiconaclsdfdr_" class="icon" width=_widthaclsdfdr_ height=_heightaclsdfdr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
[548]276_iconarrowclosedfolder_ [v=1] {<small><b>->_texticonclosedfolder2_</b></small>}
[454]277
[10872]278_iconopenfolder_ {<img src="_httpiconopenfldr_" class="icon" width=_widthopenfldr_ height=_heightopenfldr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
[548]279_iconopenfolder_ [v=1] {<small><b>_texticonopenfolder2_</b></small>}
[283]280
[10872]281_iconarrowopenfolder_ {<img src="_httpiconaopenfdr_" class="icon" width=_widthaopenfdr_ height=_heightaopenfdr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
[548]282_iconarrowopenfolder_ [v=1] {<small><b>->_texticonopenfolder2_</b></small>}
[454]283
[10872]284_iconarrowclosedbook_ {<img src="_httpiconabook_" width=_widthabook_ height=_heightabook_ class="icon" alt="_texticonclosedbook_" title="_texticonclosedbook_">}
[548]285_iconarrowclosedbook_ [v=1] {<small><b>->_texticonclosedbook_: </b></small>}
[454]286
[10872]287_iconopenbook_ {<img src="_httpiconopenbook_" width=_widthopenbook_ height=_heightopenbook_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
[548]288_iconopenbook_ [v=1] {<small><b>_texticonopenbook_: </b></small>}
[283]289
[10872]290_iconarrowopenbook_ {<img src="_httpiconaopenbk_" width=_widthaopenbk_ height=_heightaopenbk_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
[548]291_iconarrowopenbook_ [v=1] {<small><b>->_texticonopenbook_: </b></small>}
[454]292
[10872]293_iconopenbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
[548]294_iconopenbookshelf_ [v=1] {<small><b>_texticonopenbookshelf_: </b></small>}
[283]295
[10872]296_iconarrowopenbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
[548]297_iconarrowopenbookshelf_ [v=1] {<small><b>->_texticonopenbookshelf_: </b></small>}
[454]298
[10872]299_iconclosedbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
[548]300_iconclosedbookshelf_ [v=1] {<small><b>_texticonclosedbookshelf_: </b></small>}
[283]301
[10872]302_iconarrowclosedbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
[548]303_iconarrowclosedbookshelf_ [v=1] {<small><b>->_texticonclosedbookshelf_: </b></small>}
[454]304
[10872]305_iconpointer_ {<img src="_httpiconarrrght_" class="icon" width=_widtharrrght_ height=_heightarrrght_>}
[548]306_iconpointer_ [v=1] {<small><b>_texticonpointer_-> </b></small>}
[283]307
[11132]308_iconwarning_ {<img src="_httpiconwarning_" width="_widthwarning_" height="_heightwarning_" class="icon" align="left">}
[548]309_iconwarning_ [v=1] {_texticonwarning_}
[283]310
311
[258]312#######################################################################
[283]313# images
314#######################################################################
315
[19149]316_coverimage_ {<img alt="Cover Image" onError="src='_httpimg_/blank.gif'" src="_httpassocdir_/_thisOID_/cover.jpg">}
[14072]317
[11132]318_docbutton_ {<div class="button"><span class="button" title="_3_"><a href="_1_">_2_</a></span></div>
319}
[283]320
[11132]321# can't use _docbutton_ macro for detach button as we need to include target
322_imagedetach_ {<div class="button"><span class="button"><a href="_httpcurrentdocument_&amp;x=1" target="\_blank" title="_texticondetach_">_textDETACH_</a></span></div>}
[283]323
[13427]324_imageprint_{<div class="button"><span class="button"><a href="javascript:print_preview()">_textPRINT_</a></span></div>}
325
326
[11132]327_imagehighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=1&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_textHIGHLIGHT_,_texticonhighlight_)}
[283]328
[11132]329_imagenohighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=0&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_document:textNOHIGHLIGHT_,_document:texticonnohighlight_)}
[283]330
[11132]331_imagecontracttoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=0,_textCONTRACTCONTENTS_,_texticoncontracttoc_)}
[283]332
[11132]333_imageexpandtoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=1,_textEXPANDCONTENTS_,_texticonexpandtoc_)}
[283]334
[11132]335_imagecontracttext_ {_docbutton_(_httpcurrentdocument_&amp;gt=0,_textCONTRACT_,_texticoncontracttext_)}
[283]336
[11132]337_imageexpandtext_ {_docbutton_(_httpcurrentdocument_&amp;gt=1,_textEXPANDTEXT_,_texticonexpandtext_)}
[283]338
[11132]339_imagecont_ {_docbutton_(_httpcurrentdocument_&amp;gt=2,_textCONTINUE_,_texticoncont_)}
[283]340
[11132]341
[13427]342#######################################################################
343# print preview script
344#######################################################################
[11132]345
[13427]346
347_pagescriptextra_{
348
349 var style_display_old;
350 var show = true;
[13452]351 var toc_top;
[13427]352
353 function has_toc(){
354 var div_nodes = document.getElementsByTagName("div");
355 for (var i=0;i < div_nodes.length ; i++ )\{
356 var div_node = div_nodes[i];
357 if (div_node.className =="toc" && div_node.childNodes.length > 1)
358 \{
359 return true;
360 \}
361 \}
362
363 return false;
364 \}
365
366 function hide_toc()\{
367 var div_nodes = document.getElementsByTagName("div");
368 for (var i=0;i < div_nodes.length ; i++ )\{
369 var div_node = div_nodes[i];
370 if (div_node.className =="toc")
371 \{
372 style_display_old = div_node.style.display;
[13452]373 toc_top = document.getElementById("toc_top");
374 if (toc_top)
375 div_node.parentNode.insertBefore(toc_top,div_node);
376 div_node.style.display = "none";
[13427]377 \};
378 \}
379
380 \}
381
[13452]382
[13427]383 function show_toc()\{
384
385 var div_nodes = document.getElementsByTagName("div");
386 for (var i=0;i < div_nodes.length ; i++ )\{
387 var div_node = div_nodes[i];
388 if (div_node.className =="toc")
389 \{
390 div_node.style.display = style_display_old;
[13452]391 if (toc_top)
392 div_node.insertBefore(toc_top,div_node.firstChild);
393 \};
[13427]394 \}
395
396 \}
397
398
399 function switch_toc()\{
400 var toc_link = document.getElementById("toc_link");
401 while (toc_link.hasChildNodes()) \{
402 toc_link.removeChild(toc_link.firstChild);
403 \}
404 if (show)\{
[13450]405 toc_link.appendChild(document.createTextNode('_textshowcontents_'));
[13427]406 show = false;
407 hide_toc();
408 \}
409 else\{
[13450]410 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
[13427]411 show = true;
412 show_toc();
413 \}
414
415 \}
416
417 function print_preview() \{
418 // Switch the stylesheet
419 setActiveStyleSheet("Preview Document");
420 add_print_message();
421 \}
422
423 function add_print_message()\{
424 if (document.getElementById)\{
425 var print_message = document.createElement('ul');
426 print_message.id = 'print-message';
427 print_message.className = "printmessage";
428
429 var cancel_print_link = document.createElement('li');
430 cancel_print_link.className = "cancelprint"
431 cancel_print_link.onclick = function()\{ cancel_print(); return false;\};
[13450]432 cancel_print_link.appendChild(document.createTextNode('_textreturnoriginal_'));
[13427]433 print_message.appendChild(cancel_print_link);
434
435
436 var print_link = document.createElement('li');
437 print_link.onclick = function()\{ window.print(); return false;\};
[13450]438 print_link.appendChild(document.createTextNode('_textprintpage_'));
[13427]439 print_message.appendChild(print_link);
440
441 if (has_toc())\{
442 var toc_link = document.createElement('li');
443 toc_link.id = "toc_link";
444 toc_link.onclick = function()\{ switch_toc(); return false;\};
[13450]445 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
[13427]446 print_message.appendChild(toc_link);
447 \}
448
449 //insert the print message node
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 =="document")\{
454 var parent = div_node.parentNode;
455 parent.insertBefore(print_message,div_node);
456 \}
457 \}
458 \}
459
460 \}
461
462
463 function cancel_print() \{
464 // Destroy the preview message
465 var print_message = document.getElementById('print-message');
466 var parent = print_message.parentNode;
467 parent.removeChild(print_message);
468
469 show_toc();
470 // Switch back stylesheet
471 setActiveStyleSheet("default");
472 \}
473
474 function setActiveStyleSheet(title) \{
475 var i, a, main;
476 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) \{
477 if(a.getAttribute("rel").indexOf("style") != -1
478 && a.getAttribute("title")) \{
479 a.disabled = true;
480 if(a.getAttribute("title") == title) a.disabled = false;
481 \}
[25396]482 \}
[13427]483 \}
484
485}
486
487
[283]488#######################################################################
[258]489# headers/footers
490#######################################################################
491
492
493# header overridden for text pages
494_textheader_ {_cgihead_
[454]495_htmlhead_
[10872]496_startspacer_
497
498<!-- document:textheader -->
499<div id="banner">
500<div class="pageinfo"><p class="bannerlinks">_globallinks_</p></div>
501<div class="collectimage">_imagecollection_</div>
502</div>
[11779]503<div class="bannerextra">_pagebannerextra_</div>
[258]504}
[10872]505
[548]506_textheader_ [v=1] {_cgihead_
507_htmlhead_
[10872]508_globallinks_
[548]509}
[258]510
511_footer_ {
[10872]512</div> <!-- document:footer -->
513
[13427]514<div class="navarrowsbottom">
[4868]515_navarrowsbottom_
[13427]516</div>
[258]517_endspacer__htmlfooter_
[23804]518}
519
520
[23812]521
522
[23804]523package Global
[23812]524
[23804]525# Social network support
526# Defined here in document, as the most likely place this will be used in
527# within a document view, however its package is 'Global' because you
528# might equally want this in a search or browse list
529
530# _1_ = e.g. title
531# _2_ = [srclink] or left empty. If left empty, then it will share the internal GS document
532
533_sharemescript_ {
534 <script type="text/javascript">
535 var a2a_config = a2a_config || \{ \};
536 a2a_config.linkname = "_1_";
[23812]537
538 _If_(_2_,
[23804]539 var srclink = \'_2_\';
[23812]540
541 //If metadata value is a valid URL that starts with xxx://
542 // (e.g. any protocol\, http, https\, ftp ...) then that will be the link to share
543 if (srclink.match(/^[^:]+:\\\/\\\//i)) \{
544 a2a_config.linkurl = srclink;
545 \}
546 else \{
547 //if metadata value is [srclink] then we have to cut off the 'href' tag label
548 var href = srclink.match(/href=\"([^\"]*)\"/);
549 a2a_config.linkurl = gsapi.fullDomainURL(href[1]);
550 \}
551 ,
552 //if no metadata was passed as link\, then the GS version of the document will be used.
[23804]553 a2a_config.linkurl = gsapi.fullDomainURL("_gwcgi_")+ "?c=_cgiargc_&a=d&d=_cgiargd_";
554)
555
556 </script>
557}
558
559_shareme_ {
560
561<div style=\'padding-left:50px;\' class=\'a2a_kit a2a_default_style\'>
562 _sharemescript_(_1_,_2_)
563 <center>
564 <a class=\'a2a_dd\' href=\'http://www.addtoany.com/share_save\'>Share</a>
565 <span class=\"a2a_divider\"></span>
566 <a class=\'a2a_button_facebook\'></a>
567 <a class=\'a2a_button_twitter\'></a>
568 <a class=\'a2a_button_email\'></a>
569 <a class=\'a2a_button_linkedin\'></a>
570 </center>
571 <script type=\"text/javascript\" src=\"http://static.addtoany.com/menu/page.js\"></script>
572</div>
573
574}
575
576_sharemesmall_ {
577
578<span style=\'padding-left:8px;\' class=\'a2a_kit a2a_default_style\'>
579 _sharemescript_(_1_,_2_)
580 <a class=\'a2a_dd\' href=\'http://www.addtoany.com/share_save\'>Share</a>
581 <script type=\"text/javascript\" src=\"http://static.addtoany.com/menu/page.js\"></script>
582</span>
583
584}
Note: See TracBrowser for help on using the repository browser.