1 | <xsl:stylesheet version="1.0"
|
---|
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
3 | xmlns:java="http://xml.apache.org/xslt/java"
|
---|
4 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
5 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
6 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
7 | extension-element-prefixes="java util"
|
---|
8 | exclude-result-prefixes="java util gsf gslib">
|
---|
9 |
|
---|
10 | <xsl:include href="xml-to-string.xsl"/>
|
---|
11 | <xsl:include href="xml-to-gui.xsl"/>
|
---|
12 | <xsl:include href="xml-to-gui-templates.xsl"/>
|
---|
13 |
|
---|
14 | <xsl:output method="html" omit-xml-declaration="yes"/>
|
---|
15 |
|
---|
16 | <xsl:template name="formatmanagerpre">
|
---|
17 |
|
---|
18 | <!-- <xsl:variable name="foo"> -->
|
---|
19 | <!-- <xsl:value-of select="/page/pageRequest/paramList[@name='formatedit']"/> -->
|
---|
20 |
|
---|
21 | <!--<xsl:if test="/page/pageRequest/paramList/param[(@name='formatedit') and (@value='1')]">-->
|
---|
22 |
|
---|
23 | <!-- Sam2's div code -->
|
---|
24 |
|
---|
25 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>
|
---|
26 | <!--<script type="text/javascript" src="interfaces/default/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>-->
|
---|
27 | <!-- XML parsing doesn't seem to work properly jquery so jquery.xml.js is a fix for this -->
|
---|
28 | <script type="text/javascript" src="interfaces/default/js/jquery.xml.js"><xsl:text> </xsl:text></script>
|
---|
29 | <script type="text/javascript" src="interfaces/default/js/jquery-ui-1.8.15/ui/jquery-ui-1.8.15.custom.js"><xsl:text> </xsl:text></script>
|
---|
30 | <script type="text/javascript" src="interfaces/default/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script>
|
---|
31 | <script type="text/javascript" src="interfaces/default/js/innerxhtml.js"><xsl:text> </xsl:text></script>
|
---|
32 | <!--<script type="text/javascript" src="interfaces/default/js/gui_div.js"><xsl:text> </xsl:text></script>-->
|
---|
33 | <script type="text/javascript" src="interfaces/default/js/format_browse.js"><xsl:text> </xsl:text></script>
|
---|
34 | <script type="text/javascript" src="interfaces/default/js/format_document.js"><xsl:text> </xsl:text></script>
|
---|
35 | <script type="text/javascript" src="interfaces/default/js/format_util.js"><xsl:text> </xsl:text></script>
|
---|
36 | <script type="text/javascript" src="interfaces/default/js/format_jquery_prototypes.js"><xsl:text> </xsl:text></script>
|
---|
37 |
|
---|
38 | <xsl:call-template name="xml-to-gui-templates">
|
---|
39 | <xsl:with-param name="node-set" select="test"/>
|
---|
40 | <xsl:with-param name="metadataSets" select="//metadataSetList"/>
|
---|
41 | </xsl:call-template>
|
---|
42 |
|
---|
43 | <xsl:variable name="fmt1">
|
---|
44 | <xsl:call-template name="xml-to-string">
|
---|
45 | <xsl:with-param name="node-set" select="//format[@type='browse']"/>
|
---|
46 | </xsl:call-template>
|
---|
47 | </xsl:variable>
|
---|
48 |
|
---|
49 | <xsl:variable name="meta">
|
---|
50 | <xsl:call-template name="xml-to-string">
|
---|
51 | <xsl:with-param name="node-set" select="//metadataSetList"/>
|
---|
52 | </xsl:call-template>
|
---|
53 | </xsl:variable>
|
---|
54 |
|
---|
55 | <style type="text/css">
|
---|
56 |
|
---|
57 | .placeholder{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; height:20px; }
|
---|
58 |
|
---|
59 | .placeholder_td{margin-left: 10px; border: dashed 1px #ccc; background-color:#FFFFCC; width:20px; }
|
---|
60 |
|
---|
61 | .header { background-color: #AFCCAF; border: solid 1px #117711; padding: 5px; padding-left: 10px; }
|
---|
62 |
|
---|
63 | .resizable { width: 150px; height: 150px; padding: 0.5em; }
|
---|
64 |
|
---|
65 | .indent { margin-left: 15px; }
|
---|
66 | .block { margin-left: 15px; border-left: dashed 1px black;}
|
---|
67 |
|
---|
68 | .droppable { background-color: #99dd99;}
|
---|
69 | .droppable_hl { border: dashed 1px #ccc; background-color:#FFFFCC; }
|
---|
70 |
|
---|
71 | #XSLTcode {width: 99%; }
|
---|
72 |
|
---|
73 | .elementToolBox {position: fixed; top: 25%; right: 0px; background: white; border: 2px solid; padding: 10px 10px 10px 0px;}
|
---|
74 |
|
---|
75 | .elementToolBoxHeader { font-weight:bold; }
|
---|
76 |
|
---|
77 | .visible {display: block;}
|
---|
78 | .hidden {display: none;}
|
---|
79 | <!-- .gsf_metadata { border: solid 2px #0000BB; background-color: #440077; } -->
|
---|
80 |
|
---|
81 | <!-- .gsf_choose_metadata { border: solid 1px #000000; background-color: #223344; } -->
|
---|
82 | </style>
|
---|
83 |
|
---|
84 | <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>
|
---|
85 |
|
---|
86 | <table width="100%" border="1">
|
---|
87 |
|
---|
88 | <td width="100%">
|
---|
89 | <xsl:choose>
|
---|
90 | <xsl:when test="/page/pageRequest/@action = 'd'">
|
---|
91 | <!-- TOC on or off -->
|
---|
92 | <xsl:choose>
|
---|
93 | <xsl:when test="/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
|
---|
94 | <input type="checkbox" name="TOC" checked="checked" onclick="displayTOC(this)">Display Table of Contents (set to true)</input>
|
---|
95 | </xsl:when>
|
---|
96 | <xsl:otherwise>
|
---|
97 | <input type="checkbox" name="TOC" onclick="displayTOC(this)">Display Table of Contents (set to false)</input>
|
---|
98 | </xsl:otherwise>
|
---|
99 | </xsl:choose> <br/>
|
---|
100 |
|
---|
101 | <!-- book cover image on or off -->
|
---|
102 | <xsl:choose>
|
---|
103 | <xsl:when test="/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">
|
---|
104 | <input type="checkbox" name="bookCover" checked="checked" onclick="displayBookCover(this)">Display Book Cover Image (set to true)</input>
|
---|
105 | </xsl:when>
|
---|
106 | <xsl:otherwise>
|
---|
107 | <input type="checkbox" name="bookCover" onclick="displayBookCover(this)">Display Book Cover Image (set to false)</input>
|
---|
108 | </xsl:otherwise>
|
---|
109 | </xsl:choose> <br/>
|
---|
110 |
|
---|
111 | <textarea id="XSLTcode" rows="5">
|
---|
112 | The XSLT code for the relevant part of the page will be displayed here.
|
---|
113 | </textarea>
|
---|
114 | <!-- What are we doing? It might be possible to tweak saveFormatStatement() if we are only dealing with format stuff but are we? -->
|
---|
115 | <br/>
|
---|
116 | <table>
|
---|
117 | <td>
|
---|
118 | <button id="saveDocumentChanges" type="button" onclick="saveDocumentChanges()">Save Changes</button>
|
---|
119 | </td>
|
---|
120 | <td>
|
---|
121 | <form>
|
---|
122 | <input name="documentChanges" type="radio" id="applyToDocument" value="document" checked="true"/>Apply to this document only
|
---|
123 | <input name="documentChanges" type="radio" id="applyToCollection" value="collection" />Apply to collection
|
---|
124 | </form>
|
---|
125 | </td>
|
---|
126 | </table>
|
---|
127 | </xsl:when>
|
---|
128 | <xsl:otherwise>
|
---|
129 | <table>
|
---|
130 | <td>
|
---|
131 | <button id="updateFormatStatement" type="button" onclick="updateFormatStatement()">Update Format Statement</button>
|
---|
132 | </td>
|
---|
133 | <td>
|
---|
134 | <button id="saveFormatStatement" type="button" onclick="saveFormatStatement()">Save Format Statement</button>
|
---|
135 | </td>
|
---|
136 | <td>
|
---|
137 | <form>
|
---|
138 | <input name="classifiers" type="radio" id="applyToThis" value="this" checked="true"/>This Classifier
|
---|
139 | <input name="classifiers" type="radio" id="applyToAll" value="all" />All Classifiers
|
---|
140 | </form>
|
---|
141 | </td>
|
---|
142 | </table>
|
---|
143 |
|
---|
144 | <div id="formatStatement">
|
---|
145 | <div id="formatRoot">
|
---|
146 | <xsl:call-template name="xml-to-gui">
|
---|
147 | <xsl:with-param name="node-set" select="//format"/> <!-- [@type='browse']"/> -->
|
---|
148 | <xsl:with-param name="metadataSets" select="//metadataSetList"/>
|
---|
149 | </xsl:call-template>
|
---|
150 | </div>
|
---|
151 | </div>
|
---|
152 | </xsl:otherwise>
|
---|
153 | </xsl:choose>
|
---|
154 | </td>
|
---|
155 | </table>
|
---|
156 |
|
---|
157 | <div class="elementToolBox">
|
---|
158 | <p class="indent elementToolBoxHeader">Elements to add</p>
|
---|
159 | <!-- <div class="header element_type_gsf_template css_gsf_template" title="gsf:template">TEMPLATE</div> -->
|
---|
160 | <div class="draggable_gsf_template css_gsf_template block" title="gsf:template">
|
---|
161 | <table class="header">
|
---|
162 | <tbody>
|
---|
163 | <tr>
|
---|
164 | <td class="header">MATCH=<input type="text" name="rawtextinput" size="10"/></td>
|
---|
165 | <td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
|
---|
166 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick">[x]</a></td>
|
---|
167 | </tr>
|
---|
168 | </tbody>
|
---|
169 | </table>
|
---|
170 | </div>
|
---|
171 |
|
---|
172 | <div class="draggable_gsf_choose_metadata css_gsf_choose_metadata block" title="gsf:choose-metadata">
|
---|
173 | <table class="header">
|
---|
174 | <tbody>
|
---|
175 | <tr>
|
---|
176 | <td class="header">CHOOSE</td>
|
---|
177 | <td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick" title="Click me to expand">[-]</a></td>
|
---|
178 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick" title="Click me to remove"/></td>
|
---|
179 | </tr>
|
---|
180 | </tbody>
|
---|
181 | </table>
|
---|
182 | </div>
|
---|
183 |
|
---|
184 | <div class="draggable_gsf_metadata css_gsf_metadata block" title="gsf:metadata">
|
---|
185 | <table class="header">
|
---|
186 | <tbody>
|
---|
187 | <tr>
|
---|
188 | <td class="header" style="font-size: 0.8em;">METADATA</td>
|
---|
189 | <td class="header" id="metadataSelector">
|
---|
190 | <!--<xsl:call-template name="meta-to-combo">
|
---|
191 | <xsl:with-param name="metadataSets" select="//metadataSetList"/>
|
---|
192 | <xsl:with-param name="current" select="ex.Title"/>
|
---|
193 | </xsl:call-template>-->
|
---|
194 | </td>
|
---|
195 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick" title="Click me to remove"/></td>
|
---|
196 | </tr>
|
---|
197 | </tbody>
|
---|
198 | </table>
|
---|
199 | </div>
|
---|
200 |
|
---|
201 | <div class="draggable_gsf_link css_gsf_link block" title="gsf:link">
|
---|
202 | <table class="header">
|
---|
203 | <tbody>
|
---|
204 | <tr>
|
---|
205 | <td class="header">LINK</td>
|
---|
206 | <td class="header"><select>
|
---|
207 | <option value = "document" selected = "document">Document</option>
|
---|
208 | <option value = "classifier">Classifier</option>
|
---|
209 | <option value = "source">Source</option>
|
---|
210 | <option value = "horizontal">Horizontal</option>
|
---|
211 | </select></td>
|
---|
212 | <td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
|
---|
213 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick">[x]</a></td>
|
---|
214 | </tr>
|
---|
215 | </tbody>
|
---|
216 | </table>
|
---|
217 | </div>
|
---|
218 |
|
---|
219 | <div class="draggable_gsf_switch css_gsf_switch block" title="gsf:switch">
|
---|
220 | <table class="header">
|
---|
221 | <tbody>
|
---|
222 | <tr>
|
---|
223 | <td class="header">SWITCH</td>
|
---|
224 | <td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
|
---|
225 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick">[x]</a></td>
|
---|
226 | </tr>
|
---|
227 | </tbody>
|
---|
228 | </table>
|
---|
229 | </div>
|
---|
230 |
|
---|
231 | <div class="draggable_gsf_when css_gsf_when block" title="gsf:when">
|
---|
232 | <table class="header">
|
---|
233 | <tbody>
|
---|
234 | <tr>
|
---|
235 | <td class="header">WHEN <xsl:value-of select="@test"/></td>
|
---|
236 | <td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
|
---|
237 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick"/></td>
|
---|
238 | </tr>
|
---|
239 | </tbody>
|
---|
240 | </table>
|
---|
241 | </div>
|
---|
242 |
|
---|
243 | <div class="draggable_gsf_otherwise css_gsf_otherwise block" title="gsf:otherwise">
|
---|
244 | <table class="header">
|
---|
245 | <tbody>
|
---|
246 | <tr>
|
---|
247 | <td class="header">OTHERWISE</td>
|
---|
248 | <td class="header"><a href="#" class="minmax ui-icon ui-icon-minusthick">[-]</a></td>
|
---|
249 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick"/></td>
|
---|
250 | </tr>
|
---|
251 | </tbody>
|
---|
252 | </table>
|
---|
253 | </div>
|
---|
254 |
|
---|
255 | <div class="draggable_gsf_icon css_gsf_icon block" title="gsf:icon">
|
---|
256 | <table class="header">
|
---|
257 | <tbody>
|
---|
258 | <tr>
|
---|
259 | <td class="header">ICON</td>
|
---|
260 | <td class="header"><select>
|
---|
261 | <option value="document" selected="document">Document</option>
|
---|
262 | <option value="classifier">Classifier</option>
|
---|
263 | <option value="source">Source</option>
|
---|
264 | </select></td>
|
---|
265 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick">[x]</a></td>
|
---|
266 | </tr>
|
---|
267 | </tbody>
|
---|
268 | </table>
|
---|
269 | </div>
|
---|
270 | <div class="draggable_gsf_text css_text block" title="text">
|
---|
271 | <table class="header">
|
---|
272 | <tbody>
|
---|
273 | <tr>
|
---|
274 | <td class="header">TEXT</td>
|
---|
275 | <td class="header"><input type="text" name="rawtextinput" size="10" value=""/></td>
|
---|
276 | <td class="header"><a href="#" class="ui-icon ui-icon-closethick"/></td>
|
---|
277 | </tr>
|
---|
278 | </tbody>
|
---|
279 | </table>
|
---|
280 | </div>
|
---|
281 | <div class="draggable_table css_table block" title="gsf:table">
|
---|
282 | <table class="header">
|
---|
283 | <tbody>
|
---|
284 | <tr>
|
---|
285 | <td class="header">NEW TABLE</td>
|
---|
286 | </tr>
|
---|
287 | </tbody>
|
---|
288 | </table>
|
---|
289 | </div>
|
---|
290 | <div class="draggable_tr css_tr block" title="gsf:table">
|
---|
291 | <table class="header">
|
---|
292 | <tbody>
|
---|
293 | <tr>
|
---|
294 | <td class="header">NEW TABLE ROW</td>
|
---|
295 | </tr>
|
---|
296 | </tbody>
|
---|
297 | </table>
|
---|
298 | </div>
|
---|
299 | <div class="draggable_td css_td block" title="gsf:table">
|
---|
300 | <table class="header">
|
---|
301 | <tbody>
|
---|
302 | <tr>
|
---|
303 | <td class="header">NEW TABLE COLUMN</td>
|
---|
304 | </tr>
|
---|
305 | </tbody>
|
---|
306 | </table>
|
---|
307 | </div>
|
---|
308 | </div>
|
---|
309 |
|
---|
310 | <!--
|
---|
311 | <div id="format">
|
---|
312 | <p>
|
---|
313 | <b>Format string here</b>
|
---|
314 | <i>
|
---|
315 | <xsl:value-of select="$fmt1"/>
|
---|
316 | </i>
|
---|
317 | </p>
|
---|
318 | </div> -->
|
---|
319 | <!-- <p>
|
---|
320 | <i>
|
---|
321 | <xsl:value-of select="$meta"/>
|
---|
322 | </i>
|
---|
323 | </p>
|
---|
324 | </div> -->
|
---|
325 | <!--</xsl:if>-->
|
---|
326 |
|
---|
327 | <!--<H2>Preview</H2>
|
---|
328 |
|
---|
329 | <div id="my_categories"><xsl:text> </xsl:text></div>
|
---|
330 |
|
---|
331 | <iframe name="preview" id="iframe" width="98%" height="300">Your browser does not support iframes</iframe>
|
---|
332 |
|
---|
333 | <xsl:variable name="preview"> -->
|
---|
334 | <!-- <button type="button" onclick="loadXMLDoc()">Change Content</button> -->
|
---|
335 | </xsl:template>
|
---|
336 |
|
---|
337 | <xsl:template name="formatmanagerpost">
|
---|
338 | <!-- </xsl:variable>
|
---|
339 |
|
---|
340 | <script type="text/javascript">
|
---|
341 | preview_html = <xsl:text disable-output-escaping="yes">'</xsl:text><xsl:copy-of select="$preview"/><xsl:text disable-output-escaping="yes">';</xsl:text>
|
---|
342 | </script>
|
---|
343 |
|
---|
344 | <div id="result">
|
---|
345 | Here
|
---|
346 | </div>-->
|
---|
347 | </xsl:template>
|
---|
348 | </xsl:stylesheet>
|
---|