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

Last change on this file since 24420 was 24420, checked in by sjm84, 13 years ago

More fixes to the format manager

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