-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhtml_snippets.xsl
350 lines (347 loc) · 15.3 KB
/
html_snippets.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sru="http://www.loc.gov/zing/srw/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fcs="http://clarin.eu/fcs/1.0"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:tei="http://www.tei-c.org/ns/1.0"
version="1.0" exclude-result-prefixes="xs sru fcs xd tei">
<xsl:import href="params.xsl"/>
<xd:doc scope="stylesheet">
<xd:desc>pieces of html wrapped in templates, to be reused by other stylesheets
<xd:p>History:
<xd:ul>
<xd:li>2011-12-05: created by:"vr": copied from cr/html_snippets reworked back to xslt 1.0</xd:li>
</xd:ul>
</xd:p>
</xd:desc>
</xd:doc>
<xd:doc>
<xd:desc>Standard header for the html page
<xd:p>
<xd:ul>
<xd:li>Sets the charset to UTF-8</xd:li>
<xd:li>includes a customized stylesheet based on jQuery-ui 1.8.5</xd:li>
<xd:li>includes a CSS style sheet cmd-ui.css</xd:li>
<xd:li>includes a CSS style sheet cr.css</xd:li>
<xd:li>includes jQuery 1.6.2 (???!)</xd:li>
</xd:ul>
</xd:p>
<xd:p>
TODO: what about htmljspage and jquery.treeview css/js? Enable it? Toss it?
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="html-head">
<title>
<xsl:value-of select="$title"/>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href="{$scripts_url}style/jquery/clarindotblue/jquery-ui-1.8.5.custom.css" type="text/css" rel="stylesheet"/>
<link href="{$scripts_url}style/corpusshell.css" type="text/css" rel="stylesheet"/>
<link href="{$scripts_url}style/cr.css" type="text/css" rel="stylesheet"/>
<script type="text/javascript" src="{$scripts_url}js/jquery/jquery-1.6.2.js"/>
<script type="text/javascript" src="{$scripts_url}js/jquery/jquery.tablesorter.js"/>
<!-- <xsl:if test="contains($format,'htmljspage')">
<link href="{$base_dir}/style/jquery/jquery-treeview/jquery.treeview.css" rel="stylesheet"/>
</xsl:if>-->
</xsl:template>
<xd:doc>
<xd:desc>A header visible for the user
<xd:p>
Shows the site's name, a logo and and the contents of top-menu.
</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="page-header">
<xsl:variable name="logo_link">
<xsl:choose>
<xsl:when test="not($site_url='')">
<xsl:value-of select="$site_url"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base_url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="cmds-ui-block" id="header">
<div id="logo">
<a href="{$logo_link}">
<img src="{$site_logo}" alt="{$site_name}"/>
</a>
<div id="site-name">
<xsl:value-of select="$site_name"/>
</div>
</div>
<xsl:call-template name="top-menu"/>
</div>
</xsl:template>
<xd:doc>
<xd:desc>Shows a link that leads to the xml representation of this page</xd:desc>
</xd:doc>
<xsl:template name="top-menu">
<!--
<xsl:variable name="link_toggle_js">
<xsl:call-template name="formURL">
<xsl:with-param name="format">
<xsl:choose>
<xsl:when test="contains($format,'htmljspage')">htmlpage</xsl:when>
<xsl:otherwise>htmljspage</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>-->
<xsl:variable name="link_xml">
<xsl:call-template name="formURL">
<xsl:with-param name="format" select="'xml'"/>
<xsl:with-param name="dataview" select="$x-dataview"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="link_tei">
<xsl:call-template name="formURL">
<xsl:with-param name="format" select="'xmltei'"/>
<xsl:with-param name="dataview" select="$x-dataview"/>
</xsl:call-template>
</xsl:variable>
<a href="{$link_xml}">fcs/xml</a>
<xsl:choose>
<xsl:when test="//tei:TEI">
<xsl:text> </xsl:text><a href="{$link_tei}">TEI</a>
</xsl:when>
<xsl:when test="//tei:teiHeader|//tei:front">
<xsl:text> </xsl:text><a href="{$link_tei}">TEI</a>
</xsl:when>
</xsl:choose>
<!--<xsl:choose>
<xsl:when test="contains($format,'htmljspage')">
<a href="{$link_toggle_js}"> none js </a>
</xsl:when>
<xsl:otherwise>
<a href="{$link_toggle_js}"> js </a>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$user = ''">
<a href="workspace.jsp"> login</a>
</xsl:when>
<xsl:otherwise>
User: <b>
<xsl:value-of select="$user"/>
</b>
<a href="logout.jsp"> logout</a>
</xsl:otherwise>
</xsl:choose>
<a target="_blank" href="static/info"> docs</a> -->
<div id="notify" class="cmds-elem-plus note">
<div id="notifylist" class="note"/>
</div>
</xsl:template>
<xd:doc>
<xd:desc>Provides query controls
<xd:p>Note: This is included in the operation specific parts of the style sheet and htmljs pages.</xd:p>
</xd:desc>
</xd:doc>
<xsl:template name="query-input">
<!-- QUERYSEARCH - BLOCK -->
<div class="cmds-ui-block init-show" id="querysearch">
<div class="header ui-widget-header ui-state-default ui-corner-top">
Search
</div>
<div class="content" id="query-input">
<!-- fill form@action with <xsl:call-template name="formURL"/> will not work,
because the parameter have to be encoded as input-elements not in the form-url
-->
<!--<form id="searchretrieve" action="{$base_url}" method="get">-->
<form id="searchretrieve" action="" method="get">
<input type="hidden" name="x-format" value="{$format}"/>
<input type="hidden" name="operation" value="{$operation}"/>
<input type="hidden" name="version" value="1.2"/>
<input type="hidden" name="x-dataview" value="{//fcs:x-dataview}"/>
<!--<table class="cmds-ui-elem-stretch">
<tr>
<td colspan="2">
-->
<label>Context</label>
<xsl:call-template name="contexts-select"/>
<xsl:call-template name="br"/>
<!-- <div id="main-query" >-->
<input type="text" id="input-simplequery" name="query" value="{$q}" class="queryinput active"/>
<!-- <div id="searchclauselist" class="queryinput inactive"/>-->
<!-- </td>
<td>
-->
<input type="submit" value="submit" id="submit-query"/>
<!--<xsl:call-template name="br"/>-->
<!--<span id="switch-input" class="cmd"/>
<label>Complex query</label>-->
<!-- </td>
</tr>
<tr>
<td valign="top">
<!-\- selected collections -\->
<!-\- <label>Collections</label><xsl:call-template name="br"/>-\->
<div id="collections-widget" class="c-widget"/>
</td>
<td valign="top">
<xsl:call-template name="result-paging"/>
</td>
<td/>
</tr>
</table>-->
</form>
</div>
</div>
</xsl:template>
<xd:doc>
<xd:desc>Provides information to the user about the position in a search response that spans multiple pages</xd:desc>
</xd:doc>
<xsl:template name="result-paging">
<span class="label">from:</span>
<span>
<input type="text" name="startRecord" class="value start_record paging-input">
<xsl:attribute name="value">
<xsl:value-of select="$startRecord"/>
</xsl:attribute>
</input>
</span>
<span class="label">max:</span>
<span>
<input type="text" name="maximumRecords" class="value maximum_records paging-input">
<xsl:attribute name="value">
<xsl:choose>
<xsl:when test="number($numberOfRecords) > 0 and number($numberOfRecords) < number($maximumRecords)">
<xsl:value-of select="$numberOfRecords"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$maximumRecords"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</input>
</span>
<input type="submit" value="" class="cmd cmd_reload"/>
</xsl:template>
<xd:doc>
<xd:desc>Provides controls for going forward and back in searches that span multiple pages</xd:desc>
</xd:doc>
<xsl:template name="prev-next">
<xsl:variable name="prev_startRecord">
<xsl:choose>
<xsl:when test="number($startRecord) - number($maximumRecords) > 0">
<xsl:value-of select="format-number(number($startRecord) - number($maximumRecords),'#')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="next_startRecord">
<xsl:choose>
<xsl:when test="number($startRecord) + number($maximumRecords) > number(numberOfRecords)">
<xsl:value-of select="$startRecord"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(number($startRecord) + number($maximumRecords),'#')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="link_prev">
<xsl:call-template name="formURL">
<xsl:with-param name="startRecord" select="$prev_startRecord"/>
<xsl:with-param name="maximumRecords" select="$maximumRecords"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="prev-disabled">
<xsl:if test="$startRecord = '1'">disabled</xsl:if>
</xsl:variable>
<xsl:variable name="link_next">
<xsl:call-template name="formURL">
<xsl:with-param name="startRecord" select="$next_startRecord"/>
<xsl:with-param name="maximumRecords" select="$maximumRecords"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="next-disabled">
<xsl:if test="number($startRecord) + number($maximumRecords) >= number(numberOfRecords)">disabled</xsl:if>
</xsl:variable>
<span class="result-navigation prev-next">
<a class="internal prev {$prev-disabled}" href="{$link_prev}">
<span class="ui-icon cmd_prev"/>
</a>
<a class="internal next {$next-disabled}" href="{$link_next}">
<span class="ui-icon cmd_next"/>
</a>
</span>
</xsl:template>
<xd:doc>
<xd:desc>Provides a querylistblock HTML div element which is manipulated by JavaScript</xd:desc>
</xd:doc>
<xsl:template name="query-list">
<!-- QUERYLIST BLOCK -->
<div id="querylistblock" class="cmds-ui-block">
<div class="header ui-widget-header ui-state-default ui-corner-top">
<span>QUERYLIST</span>
</div>
<div class="content" id="querylist"/>
</div>
</xsl:template>
<xd:doc>
<xd:desc>Provides a detailblock HTML div element which is manipulated by JavaScript</xd:desc>
</xd:doc>
<xsl:template name="detail-space">
<div id="detailblock" class="cmds-ui-block">
<div class="header ui-widget-header ui-state-default ui-corner-top">
<span>DETAIL</span>
</div>
<div class="content" id="details"/>
</div>
</xsl:template>
<xd:doc>
<xd:desc>Provides a public-space HTML div element which is manipulated by JavaScript</xd:desc>
</xd:doc>
<xsl:template name="public-space">
<div id="public-space" class="cmds-ui-block">
<div class="header">
<span>Public Space</span>
</div>
<div id="serverqs" class="content"/>
</div>
</xsl:template>
<xd:doc>
<xd:desc>Provides HTML elements for a Personal Workspace which is manipulated by JavaScript</xd:desc>
</xd:doc>
<xsl:template name="user-space">
<div class="cmds-ui-block init-show" id="user-space">
<div class="header">
<span>Personal Workspace</span>
</div>
<div id="userqs" class="content">
<div id="userquerysets">
<label>Querysets</label>
<select id="qts_select"/>
<!-- <button id="qts_add" class="cmd cmd_add" >Add</button> -->
<span id="qts_add" class="cmd cmd_add"/>
<span id="qts_delete" class="cmd cmd_del"/>
</div>
<label>name</label>
<input type="text" id="qts_input"/>
<span id="qts_save" class="cmd cmd_save"/>
<div id="userqueries"/>
</div>
<div id="userbs" class="content">
<div id="bookmarksets">
<label>Bookmarksets</label>
<select id="bts_select"/>
<span id="bts_add" class="cmd cmd_add"/>
<span id="bts_delete" class="cmd cmd_del"/>
<span id="bts_publish" class="cmd cmd_publish"/>
</div>
<label>name</label>
<input type="text" id="bts_input"/>
<span id="bts_save" class="cmd cmd_save"/>
<div id="bookmarks"/>
</div>
</div>
</xsl:template>
</xsl:stylesheet>