source: main/trunk/model-sites-dev/atea/collect/tiriana-audio/transform/pages/document.xsl@ 36167

Last change on this file since 36167 was 36167, checked in by davidb, 7 months ago

First cut at files for a enriched audio player based on wavesurfer regions

File size: 5.6 KB
Line 
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 <div>
10 <audio id="audioPlayer" controls="controls">
11 <xsl:attribute name="src">
12 <xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Source"/>
13 </xsl:attribute>
14 Your browser does not support the audio element.
15 </audio>
16 </div>
17 Download: <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
18 </xsl:template> -->
19
20 <xsl:template name="documentNodeAudio">
21
22 <!-- <script type="text/javascript">
23 <xsl:text disable-output-escaping="yes">
24 $(document).ready(function() {
25 loadAudio('</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Source"/><xsl:text disable-output-escaping="yes">',
26 '</xsl:text>interfaces/{$interface_name}/images/Te_Kakano_C9B.csv<xsl:text disable-output-escaping="yes">');
27 })
28 </xsl:text>
29 </script> -->
30
31 <script type="text/javascript">
32 <xsl:text disable-output-escaping="yes">
33 $(document).ready(function() {
34 loadAudio('</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/<gsf:metadata name="Source"/><xsl:text disable-output-escaping="yes">',
35 '</xsl:text><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/speaker-diarization.csv<xsl:text disable-output-escaping="yes">');
36 })
37 </xsl:text>
38 </script>
39
40 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"><xsl:text> </xsl:text></script>
41 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js"><xsl:text> </xsl:text></script>
42 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.regions.min.js"><xsl:text> </xsl:text></script>
43 <script type="text/javascript" src="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.timeline.min.js"><xsl:text> </xsl:text></script>
44 <script type="text/javascript" src="https://d3js.org/colorbrewer.v1.min.js"><xsl:text> </xsl:text></script>
45
46 <div id="audioContainer">
47 <div id="waveform"><text></text></div>
48 <div id="wave-timeline"><text></text></div>
49 <div id="toolbar">
50 <div class="flex-leftalign" id="zoom-section">
51 <img src="interfaces/{$interface_name}/images/bootstrap/zoom-out.svg" id="zoomIcon" class="noHover" />
52 <input type="range" min="1" max="100" value="0" id="slider" />
53 <img src="interfaces/{$interface_name}/images/bootstrap/zoom-in.svg" id="zoomIcon" class="noHover" />
54 </div>
55 <img src="interfaces/{$interface_name}/images/bootstrap/back.svg" id="backButton" />
56 <img src="interfaces/{$interface_name}/images/bootstrap/play.svg" id="playPauseButton" />
57 <img src="interfaces/{$interface_name}/images/bootstrap/forward.svg" id="forwardButton" />
58 <img src="interfaces/{$interface_name}/images/bootstrap/unmute.svg" id="muteButton" />
59 </div>
60 <img src="interfaces/{$interface_name}/images/bootstrap/chapters.svg" id="chapterButton" />
61 <div id="chapters"></div>
62 </div>
63 <!-- Download: <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link> -->
64
65
66 </xsl:template>
67
68 <xsl:template name="documentNodeText">
69 <xsl:param name="force">0</xsl:param>
70 <!-- Hides the "This document has no text." message -->
71 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
72 <xsl:choose>
73 <xsl:when test="$force = '1' or not($noText = '1')">
74
75 <!-- Section text -->
76 <xsl:for-each select="nodeContent">
77 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
78 </xsl:for-each>
79 </xsl:when>
80 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
81 <xsl:call-template name="documentNodeAudio"/>
82 </xsl:when>
83 </xsl:choose>
84 <xsl:text> </xsl:text>
85 </xsl:template>
86
87 <xsl:template name="documentHeading">
88 <span style="font-weight:bold; font-size: 120%;">
89 <xsl:call-template name="choose-title" />
90 </span>
91 <table id="tapeDetails">
92 <gsf:switch>
93 <gsf:metadata name='Notes' />
94 <gsf:when test='exists'>
95 <tr><td id="fCol">Notes:</td><td><gsf:metadata name="Notes" highlight="highlight" /></td></tr>
96 </gsf:when>
97 </gsf:switch>
98 <gsf:switch>
99 <gsf:metadata name='TapeLabel' />
100 <gsf:when test='exists'>
101 <tr><td id="fCol">Tape Label:</td><td><gsf:metadata name="TapeLabel" highlight="highlight" /></td></tr>
102 </gsf:when>
103 </gsf:switch>
104 <gsf:switch>
105 <gsf:metadata name='CardNotes' />
106 <gsf:when test='exists'>
107 <tr><td id="fCol">Card Notes:</td><td><gsf:metadata name="CardNotes" highlight="highlight" /></td></tr>
108 </gsf:when>
109 </gsf:switch>
110 <gsf:switch>
111 <gsf:metadata name='IsMicroCassette' />
112 <gsf:when test='equals' test-value='y'>
113 <tr><td id="fCol">Microcassette?</td><td>Yes</td></tr>
114 </gsf:when>
115 </gsf:switch>
116 </table>
117
118 <gsf:variable name="audioSource"><gsf:metadata name="Source"/></gsf:variable>
119 <!-- <audio controls src="Coronation_A.wav" type="audio/wav">
120 Your browser does not support the audio element.
121 </audio> -->
122
123 </xsl:template>
124
125</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.