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

Last change on this file since 24243 was 24243, checked in by sjb48, 13 years ago

Oran code for supporting format changes to document.

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