Mercurial > hg > ismi-richfaces
annotate src/main/webapp/imageServer/resources/js/diva4ismi.js @ 193:76d2dda8d4de
update URLs for changed server names.
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 05 Dec 2018 18:48:23 +0100 |
parents | f2c1e5be355c |
children | 5309d29b3061 |
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", |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
5 iipServerURL: "https://images.rasi.mcgill.ca/fcgi-bin/iipsrv.fcgi", |
193
76d2dda8d4de
update URLs for changed server names.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
155
diff
changeset
|
6 drupal_url: "https://ismi-db.mpiwg-berlin.mpg.de/drupal-ismi", |
76d2dda8d4de
update URLs for changed server names.
Robert Casties <casties@mpiwg-berlin.mpg.de>
parents:
155
diff
changeset
|
7 entity_url: "https://ismi-db.mpiwg-berlin.mpg.de/om4-ismi/browse/entityDetails.xhtml?eid=" |
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 | |
70
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
110 function showBibliographyEntryFormatted(bibId, bibInf, bibLoc) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
111 // extract endnote id number, call formatbiblioNumeric |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
112 var numIdPat = /#(\d+)/; |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
113 var numIdRes = numIdPat.exec(bibId); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
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; |
70
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
116 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
|
117 $.ajax({ |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
118 url : divaGlobal.drupal_url + "/formatbiblioNumeric/" + id, |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
119 type : 'GET', |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
120 success : function(data) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
121 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
|
122 // inserting the template in this document |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
123 // mache rel urls zu absoluten |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
124 if (data.nodes.length > 0) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
125 // FIXME: better handling of relative URLs |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
126 var ref = data.nodes[0].node.citation.replace(new RegExp( |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
127 "/drupal-ismi", "g"), divaGlobal.drupal_url); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
128 var bib = $(loc); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
129 bib.html(ref); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
130 } |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
131 }, |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
132 error : function(data) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
133 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
|
134 } |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
135 }); |
10 | 136 } |
137 | |
7 | 138 function loadWitnessInformation(json, titleId){ |
139 | |
140 if(divaGlobal.debugModus){ | |
141 $('#witness-id').html(titleId); | |
142 } | |
143 | |
144 var fullTitle = json.data.fullTitle; | |
145 var fullTitleTranslit = json.data.fullTitleTranslit; | |
146 var titleContent = new String(); | |
147 if(fullTitle){ | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
148 titleContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+fullTitle+"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
7 | 149 }else{ |
150 titleContent = "<table><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>" | |
151 } | |
152 | |
153 var authorName = json.data.authorName; | |
154 var authorNameTranslit = json.data.authorNameTranslit; | |
155 var authorContent = new String(); | |
156 if(authorName){ | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
157 authorContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+authorName+"</td></tr><tr><td class='tdTitle'>"+authorNameTranslit+"</td></tr></table>"; |
7 | 158 }else{ |
159 authorContent = "<table><tr><td class='tdTitle'>"+authorNameTranslit+"</td></tr></table>" | |
160 } | |
161 | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
162 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
|
163 |
7 | 164 var notesOnTitleAuthor = json.data.notesOnTitleAuthor; |
165 var notesOnCollationAndCorrections = json.data.notesOnCollationAndCorrections; | |
166 var notesOnOwnership = json.data.notesOnOwnership; | |
167 var notes = json.data.notes; | |
168 var codex = json.data.codex; | |
169 var collection = json.data.collection; | |
170 var repository = json.data.repository; | |
171 var city = json.data.city; | |
172 var country = json.data.country; | |
173 var folios = json.data.folios; | |
174 var incipit = json.data.incipit; | |
175 var explicit = json.data.explicit; | |
176 var subject = json.data.subject; | |
177 var ahlwardtNo = json.data.ahlwardtNo; | |
178 var titleAsWrittenInWitness = json.data.titleAsWrittenInWitness; | |
179 var authorAsWrittenInWitness = json.data.authorAsWrittenInWitness; | |
180 var copyist = json.data.copyist; | |
181 var placeOfCopying = json.data.placeOfCopying; | |
182 var colophon = json.data.colophon; | |
183 | |
184 var pageDimensions = json.data.pageDimensions; | |
185 var writtenAreaDimensions = json.data.writtenAreaDimensions; | |
186 var linesPerPage = json.data.linesPerPage; | |
187 var pageLayout = json.data.pageLayout; | |
188 var script = json.data.script; | |
189 var writingSurface = json.data.writingSurface; | |
190 var creationDate = json.data.creationDate; | |
44 | 191 // FIXME: json coming in has this error, so it's present elsewhere |
192 if (creationDate="Unkknown") creationDate="Unknown"; | |
7 | 193 |
194 var readersContent = "<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
195 var readers= json.data.readers; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
196 for(var readerKey in json.data.readers){ |
7 | 197 var reader = json.data.readers[readerKey]; |
198 readersContent += "<tr><td class='tdTitle' style='width: 300px;'>"+reader+"</td></tr>"; | |
199 } | |
200 readersContent += "</table>"; | |
10 | 201 |
7 | 202 |
10 | 203 |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
204 var referencesContent="<table>"; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
205 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
|
206 var ref = json.data.references[refKey]; |
19 | 207 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 | 208 } |
209 referencesContent += "</table>"; | |
7 | 210 |
10 | 211 setEntry('#witness-title',"") //no need to display this already in titleInfomation |
212 //$('#witness-title').html(titleContent); | |
213 | |
214 setEntry('#witness-title-written-in-witness',titleAsWrittenInWitness); | |
215 | |
216 setEntry('#witness-author',"") //no need to display this already in titleInfomation | |
217 //$('#witness-author').html(authorContent); | |
218 | |
219 | |
220 setEntry('#witness-author-written-in-witness',authorAsWrittenInWitness); | |
221 //$('#witness-codex').html(codex); | |
222 setEntry('#witness-codex',''); | |
223 | |
224 setEntry('#witness-ahlwardt-no',ahlwardtNo); | |
225 setEntry('#witness-copyist',copyist); | |
226 setEntry('#witness-place-copyist',placeOfCopying); | |
227 setEntry('#witness-date-copyist',creationDate); | |
228 setEntry('#witness-colophon',colophon); | |
229 | |
7 | 230 $('#witness-readers').html(readersContent); |
10 | 231 |
232 if (( readers == null)||( readers == "")) { | |
233 $('#witness-readers').parent().hide(); | |
234 }; | |
235 setEntry('#witness-folios',folios); | |
236 setEntry('#witness-dimensions',pageDimensions); | |
237 setEntry('#witness-written-dimensions',writtenAreaDimensions); | |
238 setEntry('#witness-lines',linesPerPage); | |
239 setEntry('#witness-surface',writingSurface); | |
240 setEntry('#witness-layout',pageLayout); | |
241 | |
242 //$('#title-incipit').text(incipit); | |
243 setEntry('#witness-incipit',incipit); | |
244 | |
245 //$('#title-explicit').text(explicit); | |
246 setEntry('#witness-explicit',explicit); | |
247 | |
248 //$('#title-table-contents').text(tableOfContents); | |
249 setEntry('#witness-table-contents',tableOfContents); | |
250 setEntry('#witness-script',script); | |
251 setEntry('#witness-notes',notes); | |
252 //setEntry('#witness-refs',"TODO"); | |
253 | |
40 | 254 if ((json.data.references == null)||(Object.keys(json.data.references).length == 0)) { |
39 | 255 $('#witness-refs').parent().hide(); |
40 | 256 } else { |
257 $('#witness-refs').html(referencesContent); | |
258 for (refKey in json.data.references) { | |
259 var ref = json.data.references[refKey]; | |
260 var loc = "#bibl-entry-" + titleId + "-" + createIdFromRef(refKey); | |
261 var bibInf = json.data.references[refKey]; | |
262 showBibliographyEntryFormatted(refKey, bibInf, loc); | |
263 } | |
264 } | |
7 | 265 |
266 } | |
267 | |
268 function loadTitleInformation(json, titleId){ | |
269 | |
270 if(divaGlobal.debugModus){ | |
271 $('#title-id').html(titleId); | |
272 } | |
273 | |
274 var fullTitle = json.data.fullTitle; | |
275 var fullTitleTranslit = json.data.fullTitleTranslit; | |
276 var titleContent = new String(); | |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
277 |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
278 /* 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
|
279 if(fullTitle && divaGlobal.entity_url){ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
280 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
|
281 '<a href="../public/dynamicPage.xhtml?eid='+titleId+'">'+fullTitle+"</a>"+'<a href="'+divaGlobal.entity_url+titleId+'">(full)</a>' |
10 | 282 +"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
7 | 283 }else{ |
10 | 284 titleContent = "<table><tr><td class='tdTitle'>"+ |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
285 '<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
|
286 +"</td></tr></table>" |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
287 } |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
288 */ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
289 |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
290 /* 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
|
291 if(fullTitle && divaGlobal.entity_url){ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
292 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
|
293 '<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
|
294 +"</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
|
295 }else{ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
296 titleContent = "<table><tr><td class='tdTitle'>"+ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
297 '<a target="_blank" href="'+divaGlobal.entity_url+titleId+'">'+fullTitleTranslit+'</a>' |
10 | 298 +"</td></tr></table>" |
7 | 299 } |
300 | |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
301 /* here the title is not linked |
43 | 302 if(fullTitle){ |
46 | 303 titleContent = "<table><tr><td class='tdTitle' style='width: 300px; text-align:right'>"+fullTitle+"</td></tr>" + |
45 | 304 "<tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
43 | 305 }else{ |
306 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
|
307 } */ |
7 | 308 var language = json.data.language; |
309 var category = json.data.category; | |
310 var author = json.data.author; | |
10 | 311 var authorId = json.data.authorId; |
7 | 312 var aliases = json.data.aliases; |
313 var personDedicatedTo = json.data.personDedicatedTo; | |
314 var commentaryOnText = json.data.commentaryOnText; | |
315 var translationOfText = json.data.translationOfText; | |
316 var versionOfText = json.data.versionOfText; | |
317 | |
318 var aliasesContent = "<table>"; | |
319 for(aliasKey in aliases){ | |
320 var alias = aliases[aliasKey]; | |
321 //alert(alias); | |
43 | 322 aliasesContent += "<tr><td class='tdTitle' style='width: 300px; text-align:right'>"+alias+"</td></tr>"; |
7 | 323 } |
324 aliasesContent += "</table>"; | |
325 | |
10 | 326 if (( aliases == null)||( aliases == "")) { |
327 $('#title-aliases').parent().hide(); | |
328 }; | |
329 | |
7 | 330 var dedication = json.data.dedication; |
331 var notes = json.data.notes; | |
332 var tableOfContents = json.data.tableOfContents; | |
333 var explicit = json.data.explicit; | |
334 var incipit = json.data.incipit; | |
335 var creationDate = json.data.creationDate; | |
336 var createIn = json.data.createIn; | |
337 var authorMisattribution = json.data.authorMisattribution; | |
338 | |
339 var authorMisattributionContent = "<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
340 for(var missKey in authorMisattribution){ |
7 | 341 var miss = authorMisattribution[missKey]; |
342 authorMisattributionContent += "<tr><td class='tdTitle' style='width: 300px;'>"+miss+"</td></tr>"; | |
343 } | |
344 authorMisattributionContent += "</table>"; | |
345 | |
10 | 346 if (( authorMisattribution == null)||( authorMisattribution == "")) { |
347 $('#title-misattributions').parent().hide(); | |
348 }; | |
349 | |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
350 var authorContent = '<a target="_blank" href="'+divaGlobal.entity_url+authorId+'">'+author+"</a>"; |
10 | 351 |
352 var referencesContent="<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
353 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
|
354 var ref = json.data.references[refKey]; |
19 | 355 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 | 356 } |
357 referencesContent += "</table>"; | |
358 | |
19 | 359 |
7 | 360 //inserting the values into the table |
361 $('#title-tile').html(titleContent); | |
362 $('#title-aliases').html(aliasesContent); | |
363 $('#title-misattributions').html(authorMisattributionContent); | |
10 | 364 $('#title-author').html(authorContent); |
365 | |
366 | |
367 //$('#title-subject').text(category); | |
368 setEntry('#title-subject',category); | |
369 | |
370 | |
371 //$('#title-lang').text(language); | |
372 setEntry('#title-lang',language); | |
373 | |
374 //$('#title-date-composition').text(creationDate); | |
375 setEntry('#title-date-composition',creationDate); | |
376 | |
377 //$('#title-place-composition').text(createIn); | |
378 setEntry('#title-place-composition',createIn); | |
379 | |
380 //$('#title-dedicated-to').text(personDedicatedTo); | |
381 setEntry('#title-dedicated-to',personDedicatedTo); | |
382 | |
383 //$('#title-dedication').text(dedication); | |
384 setEntry('#title-dedication',dedication); | |
385 | |
386 //$('#title-commentary-on').text(commentaryOnText); | |
387 setEntry('#title-commentary-on',commentaryOnText); | |
388 | |
389 //$('#title-translation-of').text(translationOfText); | |
390 setEntry('#title-translation-of',translationOfText); | |
391 | |
392 //$('#title-version-of').text(versionOfText); | |
393 setEntry('#title-version-of',versionOfText); | |
394 | |
395 //$('#title-incipit').text(incipit); | |
396 setEntry('#title-incipit',incipit); | |
397 | |
398 //$('#title-explicit').text(explicit); | |
399 setEntry('#title-explicit',explicit); | |
400 | |
401 //$('#title-table-contents').text(tableOfContents); | |
402 setEntry('#title-table-contents',tableOfContents); | |
403 | |
404 | |
405 //$('#title-notes').text(notes); | |
406 setEntry('#title-notes',notes); | |
407 | |
40 | 408 if ((json.data.references == null)||(Object.keys(json.data.references).length == 0)) { |
409 $('#title-bib').parent().hide(); | |
410 } else { | |
411 $('#title-bib').html(referencesContent); | |
412 for (var refKey in json.data.references) { | |
413 var ref = json.data.references[refKey]; | |
414 var loc="#bibl-entry-"+titleId+"-"+ createIdFromRef(refKey) ; | |
415 var bibInf=json.data.references[refKey]; | |
416 showBibliographyEntryFormatted(refKey,bibInf,loc); | |
417 } | |
418 } | |
10 | 419 |
420 | |
421 | |
422 | |
7 | 423 } |
424 | |
425 | |
426 $(document).ready(function () { | |
427 | |
428 $("#witness-edit").on('click', '.set-start-set', function(ev) | |
429 { | |
430 var dv = $('#diva-wrapper').data('diva'); | |
431 var pageNumber = dv.getCurrentPageNumber(); | |
432 var witnessId = $(this).data('witness'); | |
433 var inputElement = $('#input-start-page-' + witnessId) | |
434 inputElement.val(pageNumber); | |
435 }); | |
436 | |
437 $("#witness-edit").on('click', '.set-start-reset', function(ev) | |
438 { | |
439 var dv = $('#diva-wrapper').data('diva'); | |
440 var witnessId = $(this).data('witness'); | |
441 var inputElement = $('#input-start-page-' + witnessId) | |
442 inputElement.val(""); | |
443 }); | |
444 | |
445 $("#witness-edit").on('click', '.set-end-set', function(ev) { | |
446 var dv = $('#diva-wrapper').data('diva'); | |
447 var pageNumber = dv.getCurrentPageNumber(); | |
448 var witnessId = $(this).data('witness'); | |
449 var inputElement = $('#input-end-page-' + witnessId) | |
450 | |
451 inputElement.val(pageNumber); | |
452 }); | |
453 | |
454 $("#witness-edit").on('click', '.set-end-reset', function(ev) { | |
455 var dv = $('#diva-wrapper').data('diva'); | |
456 var witnessId = $(this).data('witness'); | |
457 var inputElement = $('#input-end-page-' + witnessId) | |
458 inputElement.val(""); | |
459 }); | |
460 | |
461 }); | |
462 |