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

Last change on this file since 30590 was 30590, checked in by kjdon, 8 years ago

this change was made on puka, and when I tried this on commdev, it didn't work without the change

File size: 11.0 KB
Line 
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="60" rows="18" id="fragment"><%= request.getAttribute("old") != null ? request.getAttribute("old") : ""%></textarea>
84 <%= request.getAttribute("fragment2") != null ? request.getAttribute("fragment2") : ""%>
85 <fieldset>
86 <legend class="more-options">
87 <a href="javascript:toggleOptions();">
88 <img id="input-more-options-icon" src="../../images/arrow-closed.png" alt="Advanced Options Icon"></img>
89 Ngā Kōwhiringa Arā Atu Anō
90 </a>
91 </legend>
92 <div id="input-options" class="options" style="display: <%=inputOptionsDisplay%>; visibility: <%=inputOptionsVisibility%>;">
93 <table>
94 <tr>
95 <td>
96 <input name="preserveExistingMacrons" type="checkbox" value="true" <%=checkPreserveMacrons%>></input>
97 <label>Pupuritia ngā tohutō tīariari</label>
98 </td>
99 </tr>
100 </table>
101 </div>
102 </fieldset>
103 <input type="hidden" name="lang" value="mi" />
104 <input id="hidden-input-options" type="hidden" name="options" value="<%= hiddenInputOptions%>" />
105 <p class="submit_button">
106 <input title="Submit to add macrons" type="submit" value="Tāpiri Tohutō" />
107 </p>
108 </form>
109 </fieldset>
110
111 <fieldset id="restore-by-upload">
112 <legend class="tabset_label">Tāpiri tohutō i te kōnae tuku atu</legend>
113 <form action="../servlet/FileUpload" method="post" enctype="multipart/form-data">
114 <p class="instructions">Kōwhiritia tētehi kōnae hei tukuake</p>
115 <p>
116 <label>Kōnae:</label>
117 <input type="file" id="uploaded_file" name="file" />
118 </p>
119 <fieldset>
120 <legend class="more-options">
121 <a href="javascript:toggleOptions();">
122 <img id="upload-more-options-icon" src="../../images/arrow-closed.png" alt="Advanced Options Icon"></img>
123 Ngā Kōwhiringa Arā Atu Anō
124 </a>
125 </legend>
126 <div id="upload-options" class="options" style="display: <%=inputOptionsDisplay%>; visibility: <%=inputOptionsVisibility%>;">
127 <table>
128 <tr>
129 <th><label>Whakawaehere Pūāhua:</label></th>
130 <td><select id="upload-charset" name="charsetEncoding">
131 <option value="(detect automatically)" selected="selected">(kimi aunoa)</option>
132 <option value="utf-8">utf-8 (Unicode)</option>
133 <option value="utf-16">utf-16 (Unicode)</option>
134 </select></td>
135 </tr>
136 <tr>
137 <th><label>Momo Tuhinga:</label></th>
138 <td><select id="upload-doctype" name="fileType">
139 <option value="(detect automatically)" selected="selected">(kimi aunoa)</option>
140 <option value=".docx">Microsoft Office Word 2007 (.docx)</option>
141 <option value=".odt">Open Office Word (.odt)</option>
142 <option value=".txt">Text (.txt)</option>
143 </select></td>
144 </tr>
145 <tr>
146 <td>
147 <input name="preserveExistingMacrons" type="checkbox" value="true" <%=checkPreserveMacrons%>></input>
148 <label>Pupuritia ngā tohutō tīariari</label>
149 </td>
150 </tr>
151 </table>
152 </div>
153 </fieldset>
154 <input type="hidden" name="lang" value="mi" />
155 <input id="hidden-upload-options" type="hidden" name="options" value="<%= hiddenInputOptions%>" />
156 <p class="submit_button">
157 <input title="Submit to add macrons" type="submit" value="Tiki Kōnae" />
158 </p>
159 <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>
160 </form>
161 </fieldset>
162
163 <fieldset id="download-file">
164 <legend class="tabset_label">Whakaora ki te Kōnae Tukuake</legend>
165 <form action="../servlet/Download" method="post" >
166 <p class="instructions">Tāputa:</p>
167 <div id="options" class="options">
168 <table>
169 <tr>
170 <th><label>Kōnae:</label></th>
171 <td><label><%= request.getAttribute("filename")%></label></td>
172 </tr>
173 <tr>
174 <th><label>Whakawaehere Pūāhua:</label></th>
175 <td><label><%= request.getAttribute("charsetEncoding")%></label></td>
176 </tr>
177 <tr>
178 <th><label>Momo Tuhinga:</label></th>
179 <td><label><%= request.getAttribute("fileType")%></label></td>
180 </tr>
181 </table>
182 </div>
183 <%
184 String downloadFilePath = request.getAttribute("file") != null ? ((java.io.File) request.getAttribute("file")).getAbsolutePath() : null;
185 %>
186 <input type="hidden" id="filepath" name="filepath" value="<%=downloadFilePath%>" />
187 <input type="hidden" id="filename" name="filename" value="<%= request.getAttribute("filename")%>" />
188 <p class="submit_button">
189 <input title="Download File" type="submit" value="Tikiake Kōnae" />
190 </p>
191 </form>
192 </fieldset>
193 </div>
194 </div>
195
196 <jsp:include page="footer.jsp" />
197 </body>
198</html>
Note: See TracBrowser for help on using the repository browser.