source: other-projects/the-macronizer/trunk/web/jsp/mi/main.jsp@ 29855

Last change on this file since 29855 was 29855, checked in by davidb, 9 years ago

John's code after refactoring by Tom over the summer of 2014/2015

File size: 10.9 KB
RevLine 
[29855]1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<%
3 String inputOptionsDisplay;
4 String inputOptionsVisibility;
5 String hiddenInputOptions;
6 if (request.getAttribute("options") != null && request.getAttribute("options").equals("true")) {
7 inputOptionsDisplay = "block";
8 inputOptionsVisibility = "visible";
9 hiddenInputOptions = "true";
10 } else {
11 inputOptionsDisplay = "none";
12 inputOptionsVisibility = "hidden";
13 hiddenInputOptions = "false";
14 }
15 String checkPreserveMacrons;
16 if (request.getAttribute("preserveMacrons") != null && !request.getAttribute("preserveMacrons").equals("true")) {
17 checkPreserveMacrons = "";
18 } else {
19 checkPreserveMacrons = "checked";
20 }
21%>
22
23<html>
24 <head>
25 <%@page contentType="text/html" pageEncoding="UTF-8"%>
26 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27 <title>The Māori Macron Restoration Service</title>
28 <link href="../../css/css.css" rel="stylesheet" type="text/css" />
29 <script src="../../js/js.js" type="text/javascript"></script>
30
31 <style type="text/css">
32 <% if (request.getAttribute("file") != null) {%>
33 fieldset#download-file, li#download-tab {
34 display: block;
35 visibility: visible;
36 }
37 fieldset#restore-by-input, fieldset#restore-by-upload {
38 display: none;
39 visibility: hidden;
40 }
41 <% } else {%>
42 fieldset#restore-by-input {
43 display: block;
44 visibility: visible;
45 }
46 fieldset#restore-by-upload, fieldset#download-file, li#download-tab {
47 display: none;
48 visibility: hidden;
49 }
50 <% }%>
51
52
53
54
55 </style>
56
57 </head>
58
59 <body>
60 <jsp:include page="header.jsp" />
61
62 <div id="content">
63 <ul id="tabset_tabs">
64 <%
65 String inputTabClass, uploadTabClass, downloadTabClass;
66 inputTabClass = uploadTabClass = downloadTabClass = "";
67 if (request.getAttribute("file") != null) {
68 downloadTabClass = "selected";
69 } else {
70 inputTabClass = "selected";
71 }
72 %>
73 <li id="input-tab" class="<%=inputTabClass%>"> <a href="javascript:toggleTabs('restore-by-input');"> <span>Tāpiri Tohutō i te</span> Tāurunga</a> </li>
74 <li id="upload-tab" class="<%=uploadTabClass%>"> <a href="javascript:toggleTabs('restore-by-upload');"> <span>Tāpiri Tohutō i te</span> Kōnae Tuku Atu</a> </li>
75 <li id="download-tab" class="<%=downloadTabClass%>"> <a href="javascript:void()"> <span>Whakaora ki te</span> Kōnae Tukuake</a> </li>
76 </ul>
77
78 <div id="fields">
79 <fieldset id="restore-by-input">
80 <legend class="tabset_label">Tāpiri Tohutō i te Tāurunga</legend>
81 <form action="../servlet/DirectInput" method="post" >
82 <p class="instructions">Tuhia ngā kōrero</p>
83 <textarea name="fragment" cols="80" rows="18" id="fragment"><%= request.getAttribute("fragment") != null ? request.getAttribute("fragment") : ""%></textarea>
84 <fieldset>
85 <legend class="more-options">
86 <a href="javascript:toggleOptions();">
87 <img id="input-more-options-icon" src="../../images/arrow-closed.png" alt="Advanced Options Icon"></img>
88 Ngā Kōwhiringa Arā Atu Anō
89 </a>
90 </legend>
91 <div id="input-options" class="options" style="display: <%=inputOptionsDisplay%>; visibility: <%=inputOptionsVisibility%>;">
92 <table>
93 <tr>
94 <td>
95 <input name="preserveExistingMacrons" type="checkbox" value="true" <%=checkPreserveMacrons%>></input>
96 <label>Pupuritia ngā tohutō tīariari</label>
97 </td>
98 </tr>
99 </table>
100 </div>
101 </fieldset>
102 <input type="hidden" name="lang" value="mi" />
103 <input id="hidden-input-options" type="hidden" name="options" value="<%= hiddenInputOptions%>" />
104 <p class="submit_button">
105 <input title="Submit to add macrons" type="submit" value="Tāpiri Tohutō" />
106 </p>
107 </form>
108 </fieldset>
109
110 <fieldset id="restore-by-upload">
111 <legend class="tabset_label">Tāpiri tohutō i te kōnae tuku atu</legend>
112 <form action="../servlet/FileUpload" method="post" enctype="multipart/form-data">
113 <p class="instructions">Kōwhiritia tētehi kōnae hei tukuake</p>
114 <p>
115 <label>Kōnae:</label>
116 <input type="file" id="uploaded_file" name="file" />
117 </p>
118 <fieldset>
119 <legend class="more-options">
120 <a href="javascript:toggleOptions();">
121 <img id="upload-more-options-icon" src="../../images/arrow-closed.png" alt="Advanced Options Icon"></img>
122 Ngā Kōwhiringa Arā Atu Anō
123 </a>
124 </legend>
125 <div id="upload-options" class="options" style="display: <%=inputOptionsDisplay%>; visibility: <%=inputOptionsVisibility%>;">
126 <table>
127 <tr>
128 <th><label>Whakawaehere Pūāhua:</label></th>
129 <td><select id="upload-charset" name="charsetEncoding">
130 <option value="(detect automatically)" selected="selected">(kimi aunoa)</option>
131 <option value="utf-8">utf-8 (Unicode)</option>
132 <option value="utf-16">utf-16 (Unicode)</option>
133 </select></td>
134 </tr>
135 <tr>
136 <th><label>Momo Tuhinga:</label></th>
137 <td><select id="upload-doctype" name="fileType">
138 <option value="(detect automatically)" selected="selected">(kimi aunoa)</option>
139 <option value=".docx">Microsoft Office Word 2007 (.docx)</option>
140 <option value=".odt">Open Office Word (.odt)</option>
141 <option value=".txt">Text (.txt)</option>
142 </select></td>
143 </tr>
144 <tr>
145 <td>
146 <input name="preserveExistingMacrons" type="checkbox" value="true" <%=checkPreserveMacrons%>></input>
147 <label>Pupuritia ngā tohutō tīariari</label>
148 </td>
149 </tr>
150 </table>
151 </div>
152 </fieldset>
153 <input type="hidden" name="lang" value="mi" />
154 <input id="hidden-upload-options" type="hidden" name="options" value="<%= hiddenInputOptions%>" />
155 <p class="submit_button">
156 <input title="Submit to add macrons" type="submit" value="Tiki Kōnae" />
157 </p>
158 <p class="notes">Hei whakamōhio: E āhei ana ngā tuhinga Microsoft Word 2007, ngā tuhinga Open Office Text me ngā tuhinga kuputuhi hoki.</p>
159 </form>
160 </fieldset>
161
162 <fieldset id="download-file">
163 <legend class="tabset_label">Whakaora ki te Kōnae Tukuake</legend>
164 <form action="../servlet/Download" method="post" >
165 <p class="instructions">Tāputa:</p>
166 <div id="options" class="options">
167 <table>
168 <tr>
169 <th><label>Kōnae:</label></th>
170 <td><label><%= request.getAttribute("filename")%></label></td>
171 </tr>
172 <tr>
173 <th><label>Whakawaehere Pūāhua:</label></th>
174 <td><label><%= request.getAttribute("charsetEncoding")%></label></td>
175 </tr>
176 <tr>
177 <th><label>Momo Tuhinga:</label></th>
178 <td><label><%= request.getAttribute("fileType")%></label></td>
179 </tr>
180 </table>
181 </div>
182 <%
183 String downloadFilePath = request.getAttribute("file") != null ? ((java.io.File) request.getAttribute("file")).getAbsolutePath() : null;
184 %>
185 <input type="hidden" id="filepath" name="filepath" value="<%=downloadFilePath%>" />
186 <input type="hidden" id="filename" name="filename" value="<%= request.getAttribute("filename")%>" />
187 <p class="submit_button">
188 <input title="Download File" type="submit" value="Tikiake Kōnae" />
189 </p>
190 </form>
191 </fieldset>
192 </div>
193 </div>
194
195 <jsp:include page="footer.jsp" />
196 </body>
197</html>
Note: See TracBrowser for help on using the repository browser.