Mercurial > hg > ismi-richfaces
annotate src/main/webapp/imageServer/resources/js/diva4ismi.js @ 44:ba4b40933569
Temporary Fix: "Unkknown" displaying
- Just a temporary fix for the launch.
- The json data coming in has the spelling error 'Unkknown' instead of 'Unknown' for the creation date in Witness Information.
- Eg. See Glaser 21
Signed-off-by: Alistair-Russell <russell.alistair@gmail.com>
author | arussell |
---|---|
date | Sun, 12 Jul 2015 22:18:46 +0000 |
parents | 9a623c3f80a9 |
children | e1b5864670cf |
rev | line source |
---|---|
7 | 1 var divaGlobal = { |
35
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
2 rest_url : "http://localhost:18080/ismi-richfaces", |
7 | 3 debugModus : false, |
19 | 4 //rest_url : "https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi", |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
5 //rest_url : "http://ismi-dev.mpiwg-berlin.mpg.de:8080/ismi-richfaces", |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
6 iipServerURL: "https://images.rasi.mcgill.ca/fcgi-bin/iipsrv.fcgi", |
35
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
7 drupal_url: "https://ismi-dev.mpiwg-berlin.mpg.de/drupal-ismi" |
7 | 8 } |
9 | |
10 function showTitleDetailsBig(titleId){ | |
11 showTitleDetails(titleId, 'templates/templateTitleInformationBig.html'); | |
12 } | |
13 | |
14 function showTitleDetailsSmall(titleId){ | |
15 showTitleDetails(titleId, 'templates/templateTitleInformationSmall.html'); | |
16 } | |
17 | |
18 function showWitnessDetailsBig(witnessId){ | |
19 showWitnessDetails(witnessId, 'templates/templateWitnessInformationBig.html'); | |
20 } | |
21 | |
22 function showWitnessDetailsSmall(witnessId){ | |
23 showWitnessDetails(witnessId, 'templates/templateWitnessInformationSmall.html'); | |
24 } | |
25 | |
10 | 26 function setEntry(loc,field) { |
27 if ((field == null)||(field == "")) { | |
28 $(loc).parent().hide(); | |
29 } | |
30 $(loc).html(field); | |
31 } | |
32 | |
19 | 33 function createIdFromRef(txt) { |
34 | |
35 txt=txt.replace(/\W+/g, ""); | |
36 return txt; | |
37 | |
38 } | |
39 | |
7 | 40 function showTitleDetails(titleId, template){ |
41 $.ajax({ | |
42 url: template, | |
43 type: 'GET', | |
44 success: function(data){ | |
45 //inserting the template in this document | |
46 $('#additional-information').html(data); | |
47 $('#title-details-show-more').attr('data-title-id', titleId); | |
48 $('#title-details-show-less').attr('data-title-id', titleId); | |
49 | |
8 | 50 var jsonRequest = divaGlobal.rest_url + '/jsonInterface?method=get_title_details&include_romanization=true&id=' + titleId; |
7 | 51 |
52 console.log(jsonRequest); | |
53 | |
54 $.ajax({ | |
55 url: jsonRequest, | |
56 type: 'GET', | |
57 success: function(data){ | |
58 loadTitleInformation(data, titleId); | |
59 | |
60 }, | |
61 error: function(data) { | |
62 console.error('jsonInterface error. = ' + jsonRequest); | |
63 } | |
64 }); | |
65 | |
66 }, | |
67 error: function(data) { | |
68 console.error(template + ' no found.'); | |
69 } | |
70 }); | |
71 } | |
72 | |
10 | 73 function showWitnessDetails(titleId, template){ |
7 | 74 $.ajax({ |
75 url: template, | |
76 type: 'GET', | |
77 success: function(data){ | |
78 //inserting the template in this document | |
10 | 79 $('#additional-information2').html(data); |
80 $('#witness-details-show-more').attr('data-witness-id', titleId); | |
81 $('#witness-details-show-less').attr('data-witness-id', titleId); | |
7 | 82 |
10 | 83 var jsonRequest = divaGlobal.rest_url + '/jsonInterface?method=get_witness_details&include_romanization=true&id=' + titleId; |
7 | 84 |
85 console.log(jsonRequest); | |
86 | |
87 $.ajax({ | |
88 url: jsonRequest, | |
89 type: 'GET', | |
90 success: function(data){ | |
10 | 91 loadWitnessInformation(data, titleId); |
7 | 92 |
93 }, | |
94 error: function(data) { | |
95 console.error('jsonInterface error. = ' + jsonRequest); | |
96 } | |
97 }); | |
98 | |
99 }, | |
100 error: function(data) { | |
101 console.error(template + ' no found.'); | |
102 } | |
103 }); | |
104 } | |
105 | |
10 | 106 |
107 | |
108 | |
109 | |
35
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
110 function showBibliographyEntryFormatted(bibId, bibInf, bibLoc){ |
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
111 // extract endnote id number, call formatbiblioNumeric |
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
112 var numIdPat = /#(\d+)/; |
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
113 var numIdRes = numIdPat.exec(bibId); |
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
114 var id = numIdRes[1]; |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
115 var loc = bibLoc; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
116 console.debug("setting up bib id="+id+" at loc="+loc); |
10 | 117 $.ajax({ |
35
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
118 url: divaGlobal.drupal_url+"/formatbiblioNumeric/"+id, |
10 | 119 type: 'GET', |
120 success: function(data){ | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
121 console.debug("got bib id="+id+" for loc="+loc); |
10 | 122 //inserting the template in this document |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
123 //mache rel urls zu absoluten |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
124 if (data.nodes.length > 0) { |
35
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
125 // FIXME: better handling of relative URLs |
3e8493684729
change ajax calls to formatbiblio to new formatbiblioNumeric.
casties
parents:
22
diff
changeset
|
126 var ref = data.nodes[0].node.citation.replace(new RegExp("/drupal-ismi","g"),divaGlobal.drupal_url); |
20 | 127 var bib = $(loc); |
128 bib.html(ref); | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
129 } |
10 | 130 }, |
131 error: function(data) { | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
132 console.error('unable to load formatted bib entry ' + id); |
10 | 133 } |
134 }); | |
135 } | |
136 | |
7 | 137 function loadWitnessInformation(json, titleId){ |
138 | |
139 if(divaGlobal.debugModus){ | |
140 $('#witness-id').html(titleId); | |
141 } | |
142 | |
143 var fullTitle = json.data.fullTitle; | |
144 var fullTitleTranslit = json.data.fullTitleTranslit; | |
145 var titleContent = new String(); | |
146 if(fullTitle){ | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
147 titleContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+fullTitle+"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
7 | 148 }else{ |
149 titleContent = "<table><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>" | |
150 } | |
151 | |
152 var authorName = json.data.authorName; | |
153 var authorNameTranslit = json.data.authorNameTranslit; | |
154 var authorContent = new String(); | |
155 if(authorName){ | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
156 authorContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+authorName+"</td></tr><tr><td class='tdTitle'>"+authorNameTranslit+"</td></tr></table>"; |
7 | 157 }else{ |
158 authorContent = "<table><tr><td class='tdTitle'>"+authorNameTranslit+"</td></tr></table>" | |
159 } | |
160 | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
161 var tableOfContents = json.data.tableOfContents.substr(0,49) + json.data.tableOfContents.substr(84); |
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
162 |
7 | 163 var notesOnTitleAuthor = json.data.notesOnTitleAuthor; |
164 var notesOnCollationAndCorrections = json.data.notesOnCollationAndCorrections; | |
165 var notesOnOwnership = json.data.notesOnOwnership; | |
166 var notes = json.data.notes; | |
167 var codex = json.data.codex; | |
168 var collection = json.data.collection; | |
169 var repository = json.data.repository; | |
170 var city = json.data.city; | |
171 var country = json.data.country; | |
172 var folios = json.data.folios; | |
173 var incipit = json.data.incipit; | |
174 var explicit = json.data.explicit; | |
175 var subject = json.data.subject; | |
176 var ahlwardtNo = json.data.ahlwardtNo; | |
177 var titleAsWrittenInWitness = json.data.titleAsWrittenInWitness; | |
178 var authorAsWrittenInWitness = json.data.authorAsWrittenInWitness; | |
179 var copyist = json.data.copyist; | |
180 var placeOfCopying = json.data.placeOfCopying; | |
181 var colophon = json.data.colophon; | |
182 | |
183 var pageDimensions = json.data.pageDimensions; | |
184 var writtenAreaDimensions = json.data.writtenAreaDimensions; | |
185 var linesPerPage = json.data.linesPerPage; | |
186 var pageLayout = json.data.pageLayout; | |
187 var script = json.data.script; | |
188 var writingSurface = json.data.writingSurface; | |
189 var creationDate = json.data.creationDate; | |
44 | 190 // FIXME: json coming in has this error, so it's present elsewhere |
191 if (creationDate="Unkknown") creationDate="Unknown"; | |
7 | 192 |
193 var readersContent = "<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
194 var readers= json.data.readers; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
195 for(var readerKey in json.data.readers){ |
7 | 196 var reader = json.data.readers[readerKey]; |
197 readersContent += "<tr><td class='tdTitle' style='width: 300px;'>"+reader+"</td></tr>"; | |
198 } | |
199 readersContent += "</table>"; | |
10 | 200 |
7 | 201 |
10 | 202 |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
203 var referencesContent="<table>"; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
204 for(var refKey in json.data.references){ |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
205 var ref = json.data.references[refKey]; |
19 | 206 referencesContent += "<tr><td class='tdTitle' id='bibl-entry-"+titleId+"-"+createIdFromRef(refKey)+"' style='width: 300px;'>"+refKey+"</td></tr><tr><td class='tdTitle'>"+ref+"</td></tr>"; |
10 | 207 } |
208 referencesContent += "</table>"; | |
7 | 209 |
10 | 210 setEntry('#witness-title',"") //no need to display this already in titleInfomation |
211 //$('#witness-title').html(titleContent); | |
212 | |
213 setEntry('#witness-title-written-in-witness',titleAsWrittenInWitness); | |
214 | |
215 setEntry('#witness-author',"") //no need to display this already in titleInfomation | |
216 //$('#witness-author').html(authorContent); | |
217 | |
218 | |
219 setEntry('#witness-author-written-in-witness',authorAsWrittenInWitness); | |
220 //$('#witness-codex').html(codex); | |
221 setEntry('#witness-codex',''); | |
222 | |
223 setEntry('#witness-ahlwardt-no',ahlwardtNo); | |
224 setEntry('#witness-copyist',copyist); | |
225 setEntry('#witness-place-copyist',placeOfCopying); | |
226 setEntry('#witness-date-copyist',creationDate); | |
227 setEntry('#witness-colophon',colophon); | |
228 | |
7 | 229 $('#witness-readers').html(readersContent); |
10 | 230 |
231 if (( readers == null)||( readers == "")) { | |
232 $('#witness-readers').parent().hide(); | |
233 }; | |
234 setEntry('#witness-folios',folios); | |
235 setEntry('#witness-dimensions',pageDimensions); | |
236 setEntry('#witness-written-dimensions',writtenAreaDimensions); | |
237 setEntry('#witness-lines',linesPerPage); | |
238 setEntry('#witness-surface',writingSurface); | |
239 setEntry('#witness-layout',pageLayout); | |
240 | |
241 //$('#title-incipit').text(incipit); | |
242 setEntry('#witness-incipit',incipit); | |
243 | |
244 //$('#title-explicit').text(explicit); | |
245 setEntry('#witness-explicit',explicit); | |
246 | |
247 //$('#title-table-contents').text(tableOfContents); | |
248 setEntry('#witness-table-contents',tableOfContents); | |
249 setEntry('#witness-script',script); | |
250 setEntry('#witness-notes',notes); | |
251 //setEntry('#witness-refs',"TODO"); | |
252 | |
40 | 253 if ((json.data.references == null)||(Object.keys(json.data.references).length == 0)) { |
39 | 254 $('#witness-refs').parent().hide(); |
40 | 255 } else { |
256 $('#witness-refs').html(referencesContent); | |
257 for (refKey in json.data.references) { | |
258 var ref = json.data.references[refKey]; | |
259 var loc = "#bibl-entry-" + titleId + "-" + createIdFromRef(refKey); | |
260 var bibInf = json.data.references[refKey]; | |
261 showBibliographyEntryFormatted(refKey, bibInf, loc); | |
262 } | |
263 } | |
7 | 264 |
265 } | |
266 | |
267 function loadTitleInformation(json, titleId){ | |
268 | |
269 if(divaGlobal.debugModus){ | |
270 $('#title-id').html(titleId); | |
271 } | |
272 | |
273 var fullTitle = json.data.fullTitle; | |
274 var fullTitleTranslit = json.data.fullTitleTranslit; | |
275 var titleContent = new String(); | |
10 | 276 /* |
7 | 277 if(fullTitle){ |
10 | 278 titleContent = "<table><tr><td class='tdTitle' style='width: 300px;''>"+ |
279 '<a href="../public/dynamicPage.xhtml?eid='+titleId+'">'+fullTitle+"</a>"+'<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">(full)</a>' | |
280 +"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; | |
7 | 281 }else{ |
10 | 282 titleContent = "<table><tr><td class='tdTitle'>"+ |
283 '<a href="../public/dynamicPage.xhtml?eid='+titleId+'">'+fullTitleTranslit+"</a>"+'<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">(full)</a>' | |
284 +"</td></tr></table>" | |
7 | 285 } |
286 | |
43 | 287 */ |
288 // Below the Translit Title links to it's page on the drupal site. The link was removed for the launch | |
289 /* | |
290 if(fullTitle){ | |
10 | 291 titleContent = "<table><tr><td class='tdTitle' style='width: 300px;''>"+ |
292 '<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">'+fullTitle+'</a>' | |
293 +"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; | |
294 }else{ | |
295 titleContent = "<table><tr><td class='tdTitle'>"+ | |
296 '<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">'+fullTitleTranslit+'</a>' | |
297 +"</td></tr></table>" | |
298 } | |
43 | 299 */ |
300 if(fullTitle){ | |
301 titleContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+fullTitleTranslit+"</td></tr></table>"; | |
302 }else{ | |
303 titleContent = "<table><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>" | |
304 } | |
7 | 305 var language = json.data.language; |
306 var category = json.data.category; | |
307 var author = json.data.author; | |
10 | 308 var authorId = json.data.authorId; |
7 | 309 var aliases = json.data.aliases; |
310 var personDedicatedTo = json.data.personDedicatedTo; | |
311 var commentaryOnText = json.data.commentaryOnText; | |
312 var translationOfText = json.data.translationOfText; | |
313 var versionOfText = json.data.versionOfText; | |
314 | |
315 var aliasesContent = "<table>"; | |
316 for(aliasKey in aliases){ | |
317 var alias = aliases[aliasKey]; | |
318 //alert(alias); | |
43 | 319 aliasesContent += "<tr><td class='tdTitle' style='width: 300px; text-align:right'>"+alias+"</td></tr>"; |
7 | 320 } |
321 aliasesContent += "</table>"; | |
322 | |
10 | 323 if (( aliases == null)||( aliases == "")) { |
324 $('#title-aliases').parent().hide(); | |
325 }; | |
326 | |
7 | 327 var dedication = json.data.dedication; |
328 var notes = json.data.notes; | |
329 var tableOfContents = json.data.tableOfContents; | |
330 var explicit = json.data.explicit; | |
331 var incipit = json.data.incipit; | |
332 var creationDate = json.data.creationDate; | |
333 var createIn = json.data.createIn; | |
334 var authorMisattribution = json.data.authorMisattribution; | |
335 | |
336 var authorMisattributionContent = "<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
337 for(var missKey in authorMisattribution){ |
7 | 338 var miss = authorMisattribution[missKey]; |
339 authorMisattributionContent += "<tr><td class='tdTitle' style='width: 300px;'>"+miss+"</td></tr>"; | |
340 } | |
341 authorMisattributionContent += "</table>"; | |
342 | |
10 | 343 if (( authorMisattribution == null)||( authorMisattribution == "")) { |
344 $('#title-misattributions').parent().hide(); | |
345 }; | |
346 | |
347 /* var authorContent = '<a href="../public/dynamicPage.xhtml?eid='+authorId+'">'+author+"</a>"+'<a href="'+divaGlobal.drupal_url+"/entity/"+authorId+'">(full)</a>'; | |
348 */ | |
349 var authorContent = '<a href="'+divaGlobal.drupal_url+"/entity/"+authorId+'">'+author+"</a>"; | |
19 | 350 |
10 | 351 |
352 | |
353 var referencesContent="<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
354 for(var refKey in json.data.references){ |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
355 var ref = json.data.references[refKey]; |
19 | 356 referencesContent += "<tr><td class='tdTitle' id='bibl-entry-"+titleId+"-"+createIdFromRef(refKey)+"' style='width: 300px;'>"+refKey+"</td></tr><tr><td class='tdTitle'>"+ref+"</td></tr>"; |
10 | 357 } |
358 referencesContent += "</table>"; | |
359 | |
19 | 360 |
7 | 361 //inserting the values into the table |
362 $('#title-tile').html(titleContent); | |
363 $('#title-aliases').html(aliasesContent); | |
364 $('#title-misattributions').html(authorMisattributionContent); | |
10 | 365 $('#title-author').html(authorContent); |
366 | |
367 | |
368 //$('#title-subject').text(category); | |
369 setEntry('#title-subject',category); | |
370 | |
371 | |
372 //$('#title-lang').text(language); | |
373 setEntry('#title-lang',language); | |
374 | |
375 //$('#title-date-composition').text(creationDate); | |
376 setEntry('#title-date-composition',creationDate); | |
377 | |
378 //$('#title-place-composition').text(createIn); | |
379 setEntry('#title-place-composition',createIn); | |
380 | |
381 //$('#title-dedicated-to').text(personDedicatedTo); | |
382 setEntry('#title-dedicated-to',personDedicatedTo); | |
383 | |
384 //$('#title-dedication').text(dedication); | |
385 setEntry('#title-dedication',dedication); | |
386 | |
387 //$('#title-commentary-on').text(commentaryOnText); | |
388 setEntry('#title-commentary-on',commentaryOnText); | |
389 | |
390 //$('#title-translation-of').text(translationOfText); | |
391 setEntry('#title-translation-of',translationOfText); | |
392 | |
393 //$('#title-version-of').text(versionOfText); | |
394 setEntry('#title-version-of',versionOfText); | |
395 | |
396 //$('#title-incipit').text(incipit); | |
397 setEntry('#title-incipit',incipit); | |
398 | |
399 //$('#title-explicit').text(explicit); | |
400 setEntry('#title-explicit',explicit); | |
401 | |
402 //$('#title-table-contents').text(tableOfContents); | |
403 setEntry('#title-table-contents',tableOfContents); | |
404 | |
405 | |
406 //$('#title-notes').text(notes); | |
407 setEntry('#title-notes',notes); | |
408 | |
40 | 409 if ((json.data.references == null)||(Object.keys(json.data.references).length == 0)) { |
410 $('#title-bib').parent().hide(); | |
411 } else { | |
412 $('#title-bib').html(referencesContent); | |
413 for (var refKey in json.data.references) { | |
414 var ref = json.data.references[refKey]; | |
415 var loc="#bibl-entry-"+titleId+"-"+ createIdFromRef(refKey) ; | |
416 var bibInf=json.data.references[refKey]; | |
417 showBibliographyEntryFormatted(refKey,bibInf,loc); | |
418 } | |
419 } | |
10 | 420 |
421 | |
422 | |
423 | |
7 | 424 } |
425 | |
426 | |
427 $(document).ready(function () { | |
428 | |
429 $("#witness-edit").on('click', '.set-start-set', function(ev) | |
430 { | |
431 var dv = $('#diva-wrapper').data('diva'); | |
432 var pageNumber = dv.getCurrentPageNumber(); | |
433 var witnessId = $(this).data('witness'); | |
434 var inputElement = $('#input-start-page-' + witnessId) | |
435 inputElement.val(pageNumber); | |
436 }); | |
437 | |
438 $("#witness-edit").on('click', '.set-start-reset', function(ev) | |
439 { | |
440 var dv = $('#diva-wrapper').data('diva'); | |
441 var witnessId = $(this).data('witness'); | |
442 var inputElement = $('#input-start-page-' + witnessId) | |
443 inputElement.val(""); | |
444 }); | |
445 | |
446 $("#witness-edit").on('click', '.set-end-set', function(ev) { | |
447 var dv = $('#diva-wrapper').data('diva'); | |
448 var pageNumber = dv.getCurrentPageNumber(); | |
449 var witnessId = $(this).data('witness'); | |
450 var inputElement = $('#input-end-page-' + witnessId) | |
451 | |
452 inputElement.val(pageNumber); | |
453 }); | |
454 | |
455 $("#witness-edit").on('click', '.set-end-reset', function(ev) { | |
456 var dv = $('#diva-wrapper').data('diva'); | |
457 var witnessId = $(this).data('witness'); | |
458 var inputElement = $('#input-end-page-' + witnessId) | |
459 inputElement.val(""); | |
460 }); | |
461 | |
462 }); | |
463 |