1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
3 | xmlns:java="http://xml.apache.org/xslt/java" xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
4 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
5 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" extension-element-prefixes="java util"
|
---|
6 | exclude-result-prefixes="java util gsf">
|
---|
7 |
|
---|
8 | <xsl:template name="documentNodeAudio">
|
---|
9 |
|
---|
10 | <script type="text/javascript">
|
---|
11 | <xsl:text disable-output-escaping="yes">
|
---|
12 | $(document).ready(function() {
|
---|
13 | loadAudio('</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Audio"/><xsl:text disable-output-escaping="yes">',
|
---|
14 | '</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/structured-audio.csv<xsl:text disable-output-escaping="yes">');
|
---|
15 | })
|
---|
16 | </xsl:text>
|
---|
17 | </script>
|
---|
18 |
|
---|
19 | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"><xsl:text> </xsl:text></script>
|
---|
20 | <script type="text/javascript" src="https://unpkg.com/wavesurfer.js"><xsl:text> </xsl:text></script>
|
---|
21 | <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.regions.min.js"><xsl:text> </xsl:text></script>
|
---|
22 | <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js"><xsl:text> </xsl:text></script>
|
---|
23 | <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.cursor.min.js"><xsl:text> </xsl:text></script>
|
---|
24 | <script type="text/javascript" src="https://d3js.org/colorbrewer.v1.min.js"><xsl:text> </xsl:text></script>
|
---|
25 |
|
---|
26 | <div id="audioContainer">
|
---|
27 | <div id="waveform"><text></text></div>
|
---|
28 | <div id="wave-timeline"><text></text></div>
|
---|
29 | <div id="toolbar">
|
---|
30 | <div class="flex-leftalign toolbar-section">
|
---|
31 | <img src="interfaces/{$interface_name}/images/bootstrap/chapters.svg" id="chapterButton" title="Click to toggle sections" />
|
---|
32 | <img src="interfaces/{$interface_name}/images/bootstrap/zoom-out.svg" id="zoomIcon" class="noHover" />
|
---|
33 | <input type="range" min="1" max="100" value="25" id="slider" title="Click and drag to zoom in/out" />
|
---|
34 | <img src="interfaces/{$interface_name}/images/bootstrap/zoom-in.svg" id="zoomIcon" class="noHover" />
|
---|
35 | </div>
|
---|
36 | <div class="flex-centeralign toolbar-section">
|
---|
37 | <img src="interfaces/{$interface_name}/images/bootstrap/back.svg" id="backButton" title="Click to skip back" />
|
---|
38 | <img src="interfaces/{$interface_name}/images/bootstrap/play.svg" id="playPauseButton" title="Click to play/pause" />
|
---|
39 | <img src="interfaces/{$interface_name}/images/bootstrap/forward.svg" id="forwardButton" title="Click to skip forward"/>
|
---|
40 | </div>
|
---|
41 | <div class="flex-rightalign toolbar-section">
|
---|
42 | <img src="interfaces/{$interface_name}/images/bootstrap/download.svg" id="downloadButton" title="Click to download audio" />
|
---|
43 | <img src="interfaces/{$interface_name}/images/bootstrap/unmute.svg" id="muteButton" title="Click to mute/unmute" />
|
---|
44 | </div>
|
---|
45 | </div>
|
---|
46 | <div id="chapters"></div>
|
---|
47 | </div>
|
---|
48 | <!-- Download: <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link> -->
|
---|
49 |
|
---|
50 |
|
---|
51 | </xsl:template>
|
---|
52 |
|
---|
53 | <xsl:template name="documentNodeText">
|
---|
54 | <xsl:param name="force">0</xsl:param>
|
---|
55 | <!-- Hides the "This document has no text." message -->
|
---|
56 | <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
|
---|
57 | <xsl:choose>
|
---|
58 | <xsl:when test="$force = '1' or not($noText = '1')">
|
---|
59 |
|
---|
60 | <!-- Section text -->
|
---|
61 | <xsl:for-each select="nodeContent">
|
---|
62 | <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
|
---|
63 | </xsl:for-each>
|
---|
64 | </xsl:when>
|
---|
65 | <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
|
---|
66 | <xsl:call-template name="documentNodeAudio"/>
|
---|
67 | </xsl:when>
|
---|
68 | </xsl:choose>
|
---|
69 | <xsl:text> </xsl:text>
|
---|
70 | </xsl:template>
|
---|
71 |
|
---|
72 | <xsl:template name="documentHeading">
|
---|
73 | <span style="font-weight:bold; font-size: 120%;">
|
---|
74 | <xsl:call-template name="choose-title" />: Side <gsf:metadata name="Side"/>
|
---|
75 | </span>
|
---|
76 | <table id="tapeDetails">
|
---|
77 | <gsf:switch>
|
---|
78 | <gsf:metadata name='Notes' />
|
---|
79 | <gsf:when test='exists'>
|
---|
80 | <tr><td>Notes:</td><td><gsf:metadata name="Notes" highlight="highlight" /></td></tr>
|
---|
81 | </gsf:when>
|
---|
82 | </gsf:switch>
|
---|
83 | <gsf:switch>
|
---|
84 | <gsf:metadata name='TapeLabel' />
|
---|
85 | <gsf:when test='exists'>
|
---|
86 | <tr><td>Tape Label:</td><td><gsf:metadata name="TapeLabel" highlight="highlight" /></td></tr>
|
---|
87 | </gsf:when>
|
---|
88 | </gsf:switch>
|
---|
89 | <gsf:switch>
|
---|
90 | <gsf:metadata name='CardNotes' />
|
---|
91 | <gsf:when test='exists'>
|
---|
92 | <tr><td>Card Notes:</td><td><gsf:metadata name="CardNotes" highlight="highlight" /></td></tr>
|
---|
93 | </gsf:when>
|
---|
94 | </gsf:switch>
|
---|
95 | <gsf:switch>
|
---|
96 | <gsf:metadata name='IsMicroCassette' />
|
---|
97 | <gsf:when test='equals' test-value='y'>
|
---|
98 | <tr><td>Microcassette?</td><td>Yes</td></tr>
|
---|
99 | </gsf:when>
|
---|
100 | </gsf:switch>
|
---|
101 | <gsf:switch>
|
---|
102 | <gsf:metadata name='Chapter' />
|
---|
103 | <gsf:when test='exists'>
|
---|
104 | <tr><td>Chapter:</td><td><gsf:metadata name="Chapter" highlight="highlight" /></td></tr>
|
---|
105 | </gsf:when>
|
---|
106 | </gsf:switch>
|
---|
107 | <gsf:switch>
|
---|
108 | <gsf:metadata name='AudioDuration' />
|
---|
109 | <gsf:when test='exists'>
|
---|
110 | <tr><td>Audio Duration:</td><td id="audio-duration">
|
---|
111 | <script type="text/javascript">
|
---|
112 | <xsl:text disable-output-escaping="yes">
|
---|
113 | $(document).ready(function() {
|
---|
114 | var audio_duration = formatAudioDuration('</xsl:text><gsf:metadata name="AudioDuration" /><xsl:text disable-output-escaping="yes">');
|
---|
115 | $('#audio-duration').html(audio_duration);
|
---|
116 | })
|
---|
117 | </xsl:text>
|
---|
118 | </script>
|
---|
119 | </td></tr>
|
---|
120 | </gsf:when>
|
---|
121 | </gsf:switch>
|
---|
122 | </table>
|
---|
123 |
|
---|
124 | <gsf:variable name="audioSource"><gsf:metadata name="Source"/></gsf:variable>
|
---|
125 |
|
---|
126 | </xsl:template>
|
---|
127 |
|
---|
128 | </xsl:stylesheet> |
---|