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