Mercurial > hg > ismi-richfaces
annotate src/main/webapp/public/publicWitness.jsp @ 12:cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
author | casties |
---|---|
date | Tue, 07 Apr 2015 19:36:11 +0000 |
parents | 17551d9f091f |
children | 27883e041333 |
rev | line source |
---|---|
7 | 1 <%@ page contentType="text/html; charset=UTF-8" %> |
2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
3 <%@page import="org.mpi.openmind.repository.bo.Entity"%> | |
4 <%@page import="de.mpiwg.itgroup.diva.jsp.JSPDigitalization"%> | |
5 | |
6 | |
7 <html> | |
8 <head> | |
10 | 9 <title>Codex Details</title> |
7 | 10 |
11 <link href="../imageServer/resources/css/diva4ismi.css" type="text/css" rel="stylesheet" /> | |
12 <link href="../imageServer/resources/css/bootstrap.css" type="text/css" rel="stylesheet" /> | |
13 <link href="../imageServer/resources/css/bootstrap-responsive.min.css" type="text/css" rel="stylesheet"> | |
14 <link href="../imageServer/resources/css/style.css" type="text/css" rel="stylesheet"> | |
15 <link href="../imageServer/resources/css/diva.min.css" type="text/css" rel="stylesheet" /> | |
16 | |
17 | |
18 <script type="text/javascript" src="../imageServer/resources/js/jquery.min.js"></script> | |
19 <script type="text/javascript" src="../imageServer/resources/js/diva.min.js"></script> | |
20 <script type="text/javascript" src="../imageServer/resources/js/bootstrap.min.js"></script> | |
21 <script type="text/javascript" src="../imageServer/resources/js/typeahead.js"></script> | |
10 | 22 <script type="text/javascript" src="../imageServer/resources/js/ismiUtils.js"></script> |
7 | 23 <script type="text/javascript" src="../imageServer/resources/js/diva4ismi.js"></script> |
10 | 24 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
25 <jsp:useBean id="witnessPage0" class="de.mpiwg.itgroup.ismi.publicView.pages.WitnessCodexDynamicPage" scope="session" /> |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
26 <jsp:setProperty name="witnessPage0" property="request" value="${pageContext.request}" /> |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
27 <jsp:setProperty name="witnessPage0" property="response" value="${pageContext.response}" /> |
10 | 28 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
29 <%witnessPage0.init(); |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
30 if(!witnessPage0.isErrorLoading()){ |
10 | 31 response.sendRedirect("../public/publicCodices.xhtml"); |
32 }else{ | |
33 %> | |
7 | 34 |
35 | |
10 | 36 <script type="text/javascript"> |
37 | |
7 | 38 $(document).ready(function () { |
39 | |
40 function getURLParams() | |
41 { | |
42 var urlParams = {}, | |
43 match, | |
44 pl = /\+/g, // Regex for replacing addition symbol with a space | |
45 search = /([^&=]+)=?([^&]*)/g, | |
46 decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, | |
47 query = window.location.search.substring(1); | |
48 while (match = search.exec(query)) | |
49 { | |
50 urlParams[decode(match[1])] = decode(match[2]); | |
51 } | |
52 | |
53 return urlParams; | |
54 } | |
10 | 55 |
56 $('#table-titles-in-codex').on('click', '.show-title-details', function(ev){ | |
57 var dv = $('#diva-wrapper').data('diva'); | |
58 var start_page = $(this).data('start'); | |
59 | |
60 if(start_page){ | |
61 dv.gotoPageByNumber(start_page); | |
62 ev.preventDefault(); | |
63 }else{ | |
64 alert("No page assigned to this title."); | |
7 | 65 } |
10 | 66 var titleId = $(this).data('title-id'); |
67 showTitleDetailsSmall(titleId); | |
68 var witnessId = $(this).data('witness-id'); | |
69 showWitnessDetailsSmall(witnessId); | |
70 }); | |
71 | |
72 $('#additional-information').on('click', | |
73 '.title-details-show-more', function(ev){ | |
74 var titleId = $(this).data('title-id'); | |
75 showTitleDetailsBig(titleId); | |
76 }); | |
77 | |
78 $('#additional-information').on('click', '.title-details-show-less', function(ev){ | |
79 var titleId = $(this).data('title-id'); | |
80 showTitleDetailsSmall(titleId); | |
81 }); | |
82 | |
83 $('#additional-information2').on('click', '.witness-details-show-more', function(ev){ | |
84 var witnessId = $(this).data('witness-id'); | |
85 showWitnessDetailsBig(witnessId); | |
86 }); | |
87 | |
88 $('#additional-information2').on('click', '.witness-details-show-less', function(ev){ | |
89 var witnessId = $(this).data('witness-id'); | |
90 showWitnessDetailsSmall(witnessId); | |
91 }); | |
7 | 92 |
93 $('.ismi-fullscreen-icon').on('click', function(ev) { | |
94 | |
95 var jaja = $( this ).data('in-fullscreen-mode'); | |
96 var panel = $( "#attributesPanel" ); | |
97 if(jaja == true){ | |
98 //panel.css('backgroundColor','#EE178C'); | |
99 panel.css('left','0'); | |
100 panel.css('max-height','100%'); | |
101 panel.css('max-width','100%'); | |
102 panel.css('position','fixed'); | |
103 panel.css('top','0'); | |
104 panel.css('width','100%'); | |
105 panel.css('z-index','102'); | |
106 panel.css('overflow','scroll'); | |
107 | |
108 //panel.data('in-fullscreen-mode') = !panel.data('in-fullscreen-mode'); | |
109 $( this ).data('in-fullscreen-mode', false); | |
110 //alert("Fue true"); | |
111 } | |
112 if(jaja == false){ | |
113 | |
114 panel.css('left',''); | |
115 panel.css('max-height',''); | |
116 panel.css('max-width',''); | |
117 panel.css('position',''); | |
118 panel.css('top','0'); | |
119 panel.css('width',''); | |
120 panel.css('z-index',''); | |
121 panel.css('overflow',''); | |
122 | |
123 $( this ).data('in-fullscreen-mode', true); | |
124 } | |
125 }); | |
10 | 126 |
127 | |
128 $('#page-jump').on('keypress', function(ev) | |
129 { | |
130 if (ev.which == '13') | |
131 { | |
132 var dv = $('#diva-wrapper').data('diva'); | |
133 var value = $(this).val(); | |
134 var success = dv.gotoPageByNumber(value); | |
135 | |
136 if (!success) | |
137 { | |
138 if (!$('#page-jump-group').hasClass('error')) | |
139 { | |
140 $('#page-jump-group').addClass('error'); | |
141 $('#page-jump-controls').append('<span id="jump-error-help" class="help-inline">The page you specified is not valid.</span>'); | |
142 } | |
143 } | |
144 else | |
145 { | |
146 if ($('#page-jump-group').hasClass('error')) | |
147 { | |
148 $('#page-jump-group').removeClass('error'); | |
149 $('#jump-error-help').remove(); | |
150 } | |
151 } | |
152 | |
153 } | |
154 }); | |
7 | 155 |
156 $('.go-to-witness-link').on('click', function(ev) { | |
157 var dv = $('#diva-wrapper').data('diva'); | |
158 var start_page = $(this).data('start'); | |
10 | 159 |
7 | 160 if(start_page){ |
161 dv.gotoPageByNumber(start_page); | |
162 ev.preventDefault(); | |
163 }else{ | |
164 alert("No page assigned to this witness."); | |
165 } | |
166 | |
10 | 167 var witnessId = $(this).data('witness-id'); |
168 showWitnessDetailsSmall(witnessId); | |
169 | |
7 | 170 }); |
171 | |
172 function handlePageSwitch(idx, fn, divid) | |
173 { | |
174 // page number is what we're after, which is always | |
175 // page index + 1. | |
176 $('#current-page-idx').text(idx + 1); | |
177 $('#current-page-fn').text(fn); | |
178 } | |
179 | |
180 function handleDocumentLoaded(idx, fn) | |
181 { | |
182 var witnesses = {}; | |
183 | |
184 // we could do this with an ajax request, but we have | |
185 // the variables already here, we just need to get them | |
186 // from Django and not JS. | |
187 | |
188 var urlParams = getURLParams(); | |
189 if (urlParams.hasOwnProperty('witness')) | |
190 { | |
191 urlWitness = parseInt(urlParams['witness'], 10); | |
192 | |
193 // this won't be populated if the witness doesn't have a | |
194 // start page set. | |
195 if (witnesses.hasOwnProperty(urlWitness)) | |
196 { | |
197 this.gotoPageByNumber(witnesses[urlWitness]); | |
198 } | |
199 } | |
200 } | |
201 | |
202 $("#diva-wrapper").diva( | |
203 { | |
204 enableAutoHeight: true, | |
205 enableAutoTitle: false, | |
206 enableGotoPage: false, | |
207 fixedHeightGrid: false, | |
208 contained: true, | |
209 iipServerURL: divaGlobal.iipServerURL, | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
210 digiId: "<%=witnessPage0.getDigiId()%>", |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
211 objectData: divaGlobal.rest_url + "/rest/diva/proxy/json/<%=witnessPage0.getDigiLabel()%>", |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
212 imageDir: "/data7/srv/images/<%=witnessPage0.getDigiLabel()%>", |
7 | 213 onSetCurrentPage : handlePageSwitch, |
214 onDocumentLoaded : handleDocumentLoaded, | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
215 goDirectlyTo: <%=witnessPage0.getStartPage()%>, |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
216 inFullscreen: <%=witnessPage0.getImageFullscreen()%>, |
10 | 217 zoomLevel: 1, |
7 | 218 canvasPlugin: { |
219 proxyURL: divaGlobal.rest_url + "/rest/diva/proxy/image" | |
220 } | |
221 }); | |
10 | 222 |
223 | |
224 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
225 var witnessId = <%=witnessPage0.getWitnessId()%>; |
10 | 226 showWitnessDetailsBig(witnessId); |
7 | 227 }); |
228 | |
229 | |
230 </script> | |
231 <% } %> | |
232 </head> | |
233 | |
234 <body bgcolor=white> | |
235 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
236 <% if(witnessPage0.isErrorLoading()) { %> |
7 | 237 <input type='hidden' name='csrfmiddlewaretoken' value='psDBHsF5a1mttLSKeUgoUUVN3HL6f8Re' /> |
238 <jsp:include page="header.jsp" /> | |
239 | |
10 | 240 <!-- |
241 <div class="magnifiedAttributePanel"> | |
242 </div> | |
243 --> | |
244 | |
7 | 245 <div class="custom-container"> |
246 | |
247 | |
248 <div class="row-fluid"> | |
249 <div id="attributesPanel" class="span4 page" style="min-height: 700px;"> | |
250 | |
251 <a class="ismi-fullscreen-icon" href="#" data-in-fullscreen-mode="true"></a> | |
252 | |
253 <div class="attPanel"> | |
254 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
255 <c:if test="${witnessPage0.getDigi() != null}"> |
10 | 256 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
257 <input type="hidden" id="digi_id" value="${witnessPage0.getDigi().getId()}"> |
7 | 258 |
259 <div class="divaBackgroud"> | |
10 | 260 |
261 <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> | |
262 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
263 <h4><%=witnessPage0.getDigiLabel()%></h4> |
10 | 264 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
265 <c:if test="${witnessPage0.getWitnessList().size() > 0}"> |
10 | 266 <span class="titlePanel">Titles in this Codex</span> |
7 | 267 |
10 | 268 <table id="table-titles-in-codex" class="table table-bordered table-condensed divaPanel"> |
269 <thead> | |
270 <tr> | |
271 <th class="tableHead">Title</th> | |
272 <th class="tableHead">Folios</th> | |
273 </tr> | |
274 </thead> | |
275 <tbody> | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
276 <c:forEach var="witness" items="${witnessPage0.getWitnessList()}"> |
10 | 277 <tr> |
278 <td class="tdTitle"> | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
279 <!-- href="${witnessPage0.getAppBean().getRoot()}/public/dynamicPage.xhtml?eid=${witness.titleId}" --> |
10 | 280 <a class="show-title-details" |
281 data-title-id="${witness.titleId}" | |
282 data-witness-id="${witness.id}" | |
283 data-start="${witness.startPage}"> | |
284 <c:out value="${witness.title}"/> | |
285 </a> | |
286 | |
287 </td> | |
288 <td class="columnCentered"> | |
289 <c:if test="${witness.startPage != null}"> | |
290 <a class="witness-new-window" data-witness-id="${witness.id}" data-start="${witness.startPage}" | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
291 href="${witnessPage0.getAppBean().getRoot()}/public/publicCodex.jsp?eid=${witnessPage0.getCurrentEntId()}&startPage=${witness.startPage}&imgFullscreen=true" |
10 | 292 target="_blank"> |
293 <img src="../resources/images/new_window-16.png"> | |
294 </a> | |
295 </c:if> | |
296 <a class="go-to-witness-link" data-witness-id="${witness.id}" data-start="${witness.startPage}" href="#"> | |
297 <c:out value="${witness.folios}"/> | |
298 </a> | |
299 | |
300 </td> | |
301 </tr> | |
302 </c:forEach> | |
303 </tbody> | |
304 </table> | |
305 </c:if> | |
306 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
307 <c:if test="${witnessPage0.getUnknownList().size() > 0}"> |
10 | 308 <h4>Unknown titles in this Codex</h4> |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
309 <c:forEach var="witness" items="${witnessPage0.getUnknownList()}"> |
10 | 310 <a class="go-to-witness-link" data-witness-id="${witness.id}" data-start="${witness.startPage}" href="#"> |
311 <c:out value="${witness.folios}"/> | |
312 </a> | |
313 </c:forEach> | |
314 <br> | |
315 </c:if> | |
316 | |
317 | |
318 <div id="additional-information"> | |
319 </div> | |
320 | |
321 <div id="additional-information2"> | |
322 </div> | |
323 | |
324 <span class="titlePanel">Codex Information</span> | |
7 | 325 <table class="table table-bordered table-condensed divaPanel"> |
10 | 326 <tbody> |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
327 <c:forEach var="attLabel" items="${witnessPage0.getLabels()}"> |
7 | 328 <tr> |
329 <td class="tdTitle"> | |
330 <c:out value="${attLabel}"/> | |
331 <td> | |
332 <td > | |
333 <table class="tableContent"> | |
334 <tbody> | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
335 <c:forEach var="attValue" items="${witnessPage0.getAttMap().get(attLabel)}"> |
7 | 336 <tr> |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
337 <td style="text-align: ${witnessPage0.getAttMapTextAlign().get(attLabel)};"> |
7 | 338 <c:out value="${attValue}"/> |
339 </td> | |
340 </tr> | |
341 </c:forEach> | |
342 </tbody> | |
343 </table> | |
344 <td> | |
345 </tr> | |
346 </c:forEach> | |
347 </tbody> | |
348 </table> | |
10 | 349 |
7 | 350 </div> |
351 </c:if> | |
352 </div> | |
353 </div> | |
354 <div class="span8"> | |
355 <input type='hidden' name='csrfmiddlewaretoken' value='psDBHsF5a1mttLSKeUgoUUVN3HL6f8Re' /> | |
356 <div id="diva-wrapper" style="width: 600px;"></div> | |
357 </div> | |
358 </div> | |
359 </div> | |
10 | 360 |
7 | 361 <% } %> |
362 </body> | |
363 </html> |