Mercurial > hg > ismi-richfaces
annotate src/main/webapp/imageServer/resources/js/diva4ismi.js @ 72:70207f24937e
cleaned displayAuthor. added filter for witnesses with scans.
author | casties |
---|---|
date | Tue, 22 Dec 2015 20:07:13 +0100 |
parents | 954d6200336d |
children | f2c1e5be355c |
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", |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
7 drupal_url: "https://ismi-dev.mpiwg-berlin.mpg.de/drupal-ismi", |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
8 entity_url: "https://ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/browse/entityDetails.xhtml?eid=" |
7 | 9 } |
10 | |
11 function showTitleDetailsBig(titleId){ | |
12 showTitleDetails(titleId, 'templates/templateTitleInformationBig.html'); | |
13 } | |
14 | |
15 function showTitleDetailsSmall(titleId){ | |
16 showTitleDetails(titleId, 'templates/templateTitleInformationSmall.html'); | |
17 } | |
18 | |
19 function showWitnessDetailsBig(witnessId){ | |
20 showWitnessDetails(witnessId, 'templates/templateWitnessInformationBig.html'); | |
21 } | |
22 | |
23 function showWitnessDetailsSmall(witnessId){ | |
24 showWitnessDetails(witnessId, 'templates/templateWitnessInformationSmall.html'); | |
25 } | |
26 | |
10 | 27 function setEntry(loc,field) { |
28 if ((field == null)||(field == "")) { | |
29 $(loc).parent().hide(); | |
30 } | |
31 $(loc).html(field); | |
32 } | |
33 | |
19 | 34 function createIdFromRef(txt) { |
35 | |
36 txt=txt.replace(/\W+/g, ""); | |
37 return txt; | |
38 | |
39 } | |
40 | |
7 | 41 function showTitleDetails(titleId, template){ |
42 $.ajax({ | |
43 url: template, | |
44 type: 'GET', | |
45 success: function(data){ | |
46 //inserting the template in this document | |
47 $('#additional-information').html(data); | |
48 $('#title-details-show-more').attr('data-title-id', titleId); | |
49 $('#title-details-show-less').attr('data-title-id', titleId); | |
50 | |
8 | 51 var jsonRequest = divaGlobal.rest_url + '/jsonInterface?method=get_title_details&include_romanization=true&id=' + titleId; |
7 | 52 |
53 console.log(jsonRequest); | |
54 | |
55 $.ajax({ | |
56 url: jsonRequest, | |
57 type: 'GET', | |
58 success: function(data){ | |
59 loadTitleInformation(data, titleId); | |
60 | |
61 }, | |
62 error: function(data) { | |
63 console.error('jsonInterface error. = ' + jsonRequest); | |
64 } | |
65 }); | |
66 | |
67 }, | |
68 error: function(data) { | |
69 console.error(template + ' no found.'); | |
70 } | |
71 }); | |
72 } | |
73 | |
10 | 74 function showWitnessDetails(titleId, template){ |
7 | 75 $.ajax({ |
76 url: template, | |
77 type: 'GET', | |
78 success: function(data){ | |
79 //inserting the template in this document | |
10 | 80 $('#additional-information2').html(data); |
81 $('#witness-details-show-more').attr('data-witness-id', titleId); | |
82 $('#witness-details-show-less').attr('data-witness-id', titleId); | |
7 | 83 |
10 | 84 var jsonRequest = divaGlobal.rest_url + '/jsonInterface?method=get_witness_details&include_romanization=true&id=' + titleId; |
7 | 85 |
86 console.log(jsonRequest); | |
87 | |
88 $.ajax({ | |
89 url: jsonRequest, | |
90 type: 'GET', | |
91 success: function(data){ | |
10 | 92 loadWitnessInformation(data, titleId); |
7 | 93 |
94 }, | |
95 error: function(data) { | |
96 console.error('jsonInterface error. = ' + jsonRequest); | |
97 } | |
98 }); | |
99 | |
100 }, | |
101 error: function(data) { | |
102 console.error(template + ' no found.'); | |
103 } | |
104 }); | |
105 } | |
106 | |
10 | 107 |
108 | |
109 | |
110 | |
70
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
111 function showBibliographyEntryFormatted(bibId, bibInf, bibLoc) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
112 // extract endnote id number, call formatbiblioNumeric |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
113 var numIdPat = /#(\d+)/; |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
114 var numIdRes = numIdPat.exec(bibId); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
115 var id = numIdRes[1]; |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
116 var loc = bibLoc; |
70
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
117 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
|
118 $.ajax({ |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
119 url : divaGlobal.drupal_url + "/formatbiblioNumeric/" + id, |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
120 type : 'GET', |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
121 success : function(data) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
122 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
|
123 // inserting the template in this document |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
124 // mache rel urls zu absoluten |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
125 if (data.nodes.length > 0) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
126 // FIXME: better handling of relative URLs |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
127 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
|
128 "/drupal-ismi", "g"), divaGlobal.drupal_url); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
129 var bib = $(loc); |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
130 bib.html(ref); |
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 }, |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
133 error : function(data) { |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
134 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
|
135 } |
954d6200336d
display live reference from Drupal in edit form (ticket #71).
casties
parents:
55
diff
changeset
|
136 }); |
10 | 137 } |
138 | |
7 | 139 function loadWitnessInformation(json, titleId){ |
140 | |
141 if(divaGlobal.debugModus){ | |
142 $('#witness-id').html(titleId); | |
143 } | |
144 | |
145 var fullTitle = json.data.fullTitle; | |
146 var fullTitleTranslit = json.data.fullTitleTranslit; | |
147 var titleContent = new String(); | |
148 if(fullTitle){ | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
149 titleContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+fullTitle+"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
7 | 150 }else{ |
151 titleContent = "<table><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>" | |
152 } | |
153 | |
154 var authorName = json.data.authorName; | |
155 var authorNameTranslit = json.data.authorNameTranslit; | |
156 var authorContent = new String(); | |
157 if(authorName){ | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
158 authorContent = "<table><tr><td class='tdTitle' style='width: 300px;'>"+authorName+"</td></tr><tr><td class='tdTitle'>"+authorNameTranslit+"</td></tr></table>"; |
7 | 159 }else{ |
160 authorContent = "<table><tr><td class='tdTitle'>"+authorNameTranslit+"</td></tr></table>" | |
161 } | |
162 | |
36
5fdd27200bfd
Fixed: Condensed table of contents for more witness info
arussell
parents:
35
diff
changeset
|
163 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
|
164 |
7 | 165 var notesOnTitleAuthor = json.data.notesOnTitleAuthor; |
166 var notesOnCollationAndCorrections = json.data.notesOnCollationAndCorrections; | |
167 var notesOnOwnership = json.data.notesOnOwnership; | |
168 var notes = json.data.notes; | |
169 var codex = json.data.codex; | |
170 var collection = json.data.collection; | |
171 var repository = json.data.repository; | |
172 var city = json.data.city; | |
173 var country = json.data.country; | |
174 var folios = json.data.folios; | |
175 var incipit = json.data.incipit; | |
176 var explicit = json.data.explicit; | |
177 var subject = json.data.subject; | |
178 var ahlwardtNo = json.data.ahlwardtNo; | |
179 var titleAsWrittenInWitness = json.data.titleAsWrittenInWitness; | |
180 var authorAsWrittenInWitness = json.data.authorAsWrittenInWitness; | |
181 var copyist = json.data.copyist; | |
182 var placeOfCopying = json.data.placeOfCopying; | |
183 var colophon = json.data.colophon; | |
184 | |
185 var pageDimensions = json.data.pageDimensions; | |
186 var writtenAreaDimensions = json.data.writtenAreaDimensions; | |
187 var linesPerPage = json.data.linesPerPage; | |
188 var pageLayout = json.data.pageLayout; | |
189 var script = json.data.script; | |
190 var writingSurface = json.data.writingSurface; | |
191 var creationDate = json.data.creationDate; | |
44 | 192 // FIXME: json coming in has this error, so it's present elsewhere |
193 if (creationDate="Unkknown") creationDate="Unknown"; | |
7 | 194 |
195 var readersContent = "<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
196 var readers= json.data.readers; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
197 for(var readerKey in json.data.readers){ |
7 | 198 var reader = json.data.readers[readerKey]; |
199 readersContent += "<tr><td class='tdTitle' style='width: 300px;'>"+reader+"</td></tr>"; | |
200 } | |
201 readersContent += "</table>"; | |
10 | 202 |
7 | 203 |
10 | 204 |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
205 var referencesContent="<table>"; |
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
206 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
|
207 var ref = json.data.references[refKey]; |
19 | 208 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 | 209 } |
210 referencesContent += "</table>"; | |
7 | 211 |
10 | 212 setEntry('#witness-title',"") //no need to display this already in titleInfomation |
213 //$('#witness-title').html(titleContent); | |
214 | |
215 setEntry('#witness-title-written-in-witness',titleAsWrittenInWitness); | |
216 | |
217 setEntry('#witness-author',"") //no need to display this already in titleInfomation | |
218 //$('#witness-author').html(authorContent); | |
219 | |
220 | |
221 setEntry('#witness-author-written-in-witness',authorAsWrittenInWitness); | |
222 //$('#witness-codex').html(codex); | |
223 setEntry('#witness-codex',''); | |
224 | |
225 setEntry('#witness-ahlwardt-no',ahlwardtNo); | |
226 setEntry('#witness-copyist',copyist); | |
227 setEntry('#witness-place-copyist',placeOfCopying); | |
228 setEntry('#witness-date-copyist',creationDate); | |
229 setEntry('#witness-colophon',colophon); | |
230 | |
7 | 231 $('#witness-readers').html(readersContent); |
10 | 232 |
233 if (( readers == null)||( readers == "")) { | |
234 $('#witness-readers').parent().hide(); | |
235 }; | |
236 setEntry('#witness-folios',folios); | |
237 setEntry('#witness-dimensions',pageDimensions); | |
238 setEntry('#witness-written-dimensions',writtenAreaDimensions); | |
239 setEntry('#witness-lines',linesPerPage); | |
240 setEntry('#witness-surface',writingSurface); | |
241 setEntry('#witness-layout',pageLayout); | |
242 | |
243 //$('#title-incipit').text(incipit); | |
244 setEntry('#witness-incipit',incipit); | |
245 | |
246 //$('#title-explicit').text(explicit); | |
247 setEntry('#witness-explicit',explicit); | |
248 | |
249 //$('#title-table-contents').text(tableOfContents); | |
250 setEntry('#witness-table-contents',tableOfContents); | |
251 setEntry('#witness-script',script); | |
252 setEntry('#witness-notes',notes); | |
253 //setEntry('#witness-refs',"TODO"); | |
254 | |
40 | 255 if ((json.data.references == null)||(Object.keys(json.data.references).length == 0)) { |
39 | 256 $('#witness-refs').parent().hide(); |
40 | 257 } else { |
258 $('#witness-refs').html(referencesContent); | |
259 for (refKey in json.data.references) { | |
260 var ref = json.data.references[refKey]; | |
261 var loc = "#bibl-entry-" + titleId + "-" + createIdFromRef(refKey); | |
262 var bibInf = json.data.references[refKey]; | |
263 showBibliographyEntryFormatted(refKey, bibInf, loc); | |
264 } | |
265 } | |
7 | 266 |
267 } | |
268 | |
269 function loadTitleInformation(json, titleId){ | |
270 | |
271 if(divaGlobal.debugModus){ | |
272 $('#title-id').html(titleId); | |
273 } | |
274 | |
275 var fullTitle = json.data.fullTitle; | |
276 var fullTitleTranslit = json.data.fullTitleTranslit; | |
277 var titleContent = new String(); | |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
278 |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
279 /* 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
|
280 if(fullTitle && divaGlobal.entity_url){ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
281 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
|
282 '<a href="../public/dynamicPage.xhtml?eid='+titleId+'">'+fullTitle+"</a>"+'<a href="'+divaGlobal.entity_url+titleId+'">(full)</a>' |
10 | 283 +"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
7 | 284 }else{ |
10 | 285 titleContent = "<table><tr><td class='tdTitle'>"+ |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
286 '<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
|
287 +"</td></tr></table>" |
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 |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
291 /* 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
|
292 if(fullTitle && divaGlobal.entity_url){ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
293 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
|
294 '<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
|
295 +"</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
|
296 }else{ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
297 titleContent = "<table><tr><td class='tdTitle'>"+ |
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
298 '<a target="_blank" href="'+divaGlobal.entity_url+titleId+'">'+fullTitleTranslit+'</a>' |
10 | 299 +"</td></tr></table>" |
7 | 300 } |
301 | |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
302 /* here the title is not linked |
43 | 303 if(fullTitle){ |
46 | 304 titleContent = "<table><tr><td class='tdTitle' style='width: 300px; text-align:right'>"+fullTitle+"</td></tr>" + |
45 | 305 "<tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; |
43 | 306 }else{ |
307 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
|
308 } */ |
7 | 309 var language = json.data.language; |
310 var category = json.data.category; | |
311 var author = json.data.author; | |
10 | 312 var authorId = json.data.authorId; |
7 | 313 var aliases = json.data.aliases; |
314 var personDedicatedTo = json.data.personDedicatedTo; | |
315 var commentaryOnText = json.data.commentaryOnText; | |
316 var translationOfText = json.data.translationOfText; | |
317 var versionOfText = json.data.versionOfText; | |
318 | |
319 var aliasesContent = "<table>"; | |
320 for(aliasKey in aliases){ | |
321 var alias = aliases[aliasKey]; | |
322 //alert(alias); | |
43 | 323 aliasesContent += "<tr><td class='tdTitle' style='width: 300px; text-align:right'>"+alias+"</td></tr>"; |
7 | 324 } |
325 aliasesContent += "</table>"; | |
326 | |
10 | 327 if (( aliases == null)||( aliases == "")) { |
328 $('#title-aliases').parent().hide(); | |
329 }; | |
330 | |
7 | 331 var dedication = json.data.dedication; |
332 var notes = json.data.notes; | |
333 var tableOfContents = json.data.tableOfContents; | |
334 var explicit = json.data.explicit; | |
335 var incipit = json.data.incipit; | |
336 var creationDate = json.data.creationDate; | |
337 var createIn = json.data.createIn; | |
338 var authorMisattribution = json.data.authorMisattribution; | |
339 | |
340 var authorMisattributionContent = "<table>"; | |
17
dba143f9cb85
fixed bug where only one reference would be displayed on the page.
casties
parents:
14
diff
changeset
|
341 for(var missKey in authorMisattribution){ |
7 | 342 var miss = authorMisattribution[missKey]; |
343 authorMisattributionContent += "<tr><td class='tdTitle' style='width: 300px;'>"+miss+"</td></tr>"; | |
344 } | |
345 authorMisattributionContent += "</table>"; | |
346 | |
10 | 347 if (( authorMisattribution == null)||( authorMisattribution == "")) { |
348 $('#title-misattributions').parent().hide(); | |
349 }; | |
350 | |
55
e15c7ddeb76c
made links in public witness display link to openmind (configurable).
casties
parents:
46
diff
changeset
|
351 var authorContent = '<a target="_blank" href="'+divaGlobal.entity_url+authorId+'">'+author+"</a>"; |
10 | 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 |