source: main/trunk/greenstone3/web/interfaces/oran/transform/layouts/formatmanager.xsl@ 24907

Last change on this file since 24907 was 24907, checked in by sjb48, 12 years ago

Tidied up format functionality.

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