Mercurial > hg > ismi-richfaces
changeset 10:17551d9f091f
add new witness view
lin, and those below, will be ignored--
A src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/WitnessCodexDynamicPage.java
M src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java
M src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java
M src/main/resources/hibernate.cfg.xml
M src/main/webapp/imageServer/resources/css/diva4ismi.css
M src/main/webapp/imageServer/resources/js/diva4ismi.js
M src/main/webapp/public/publicCodex.jsp
M src/main/webapp/public/publicWitness.jsp
M src/main/webapp/public/templates/templateWitnessInformationBig.html
author | dwinter |
---|---|
date | Mon, 23 Mar 2015 12:43:55 +0000 |
parents | e07a1ae515b7 |
children | b4f0b63ab779 |
files | src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/WitnessCodexDynamicPage.java src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java src/main/resources/hibernate.cfg.xml src/main/webapp/imageServer/resources/css/diva4ismi.css src/main/webapp/imageServer/resources/js/diva4ismi.js src/main/webapp/public/publicCodex.jsp src/main/webapp/public/publicWitness.jsp src/main/webapp/public/templates/templateWitnessInformationBig.html |
diffstat | 9 files changed, 543 insertions(+), 143 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/WitnessCodexDynamicPage.java Mon Mar 23 12:43:55 2015 +0000 @@ -0,0 +1,102 @@ +package de.mpiwg.itgroup.ismi.publicView.pages; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.mpi.openmind.repository.bo.Entity; + +import de.mpiwg.itgroup.ismi.utils.templates.WitnessTemplate; + +public class WitnessCodexDynamicPage extends JSPDynamicPage{ + + private List<WitnessTemplate> witnessList; + private List<WitnessTemplate> unknownList; + private Integer startPage; + private Boolean imageFullscreen; + private Long witnessId; + + @Override + public void load(Long witnessId){ + + this.witnessId = witnessId; + + witnessList = new ArrayList<WitnessTemplate>(); + unknownList = new ArrayList<WitnessTemplate>(); + + // Load codex for this witness + List<Entity> codex0 = getWrapper().getTargetsForSourceRelation(witnessId, "is_part_of", "CODEX", 1); + Long codexId; + Entity codexent = (codex0.size() == 0) ? null : codex0.get(0); + codexId = codexent.getId(); + + super.load(codexId); + + //loading the digitalization object + List<Entity> list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_digitalization_of", "DIGITALIZATION", 1); + this.digi = (list0.size() == 0) ? null : list0.get(0); + + //loading the witnesses + list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_part_of", "WITNESS", -1); + for(Entity witness : list0){ + WitnessTemplate tmp = new WitnessTemplate(witness, getWrapper(), true); + this.witnessList.add(tmp); + if(tmp.isUnknown()){ + this.unknownList.add(tmp); + } + } + Collections.sort(this.witnessList); + Collections.sort(this.unknownList); + } + + public void init(){ + this.startPage = 0; + this.imageFullscreen = false; + try { + + this.load(Long.parseLong(getRequest().getParameter("eid"))); + + try { + this.startPage = Integer.parseInt(getRequest().getParameter("startPage")); + this.imageFullscreen = + (getRequest().getParameter("imgFullscreen") != null) ? Boolean.parseBoolean(getRequest().getParameter("imgFullscreen")) : false; + } catch (Exception e) { + // TODO: handle exception + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public Integer getStartPage() { + return startPage; + } + + public Boolean getImageFullscreen() { + return imageFullscreen; + } + + public List<WitnessTemplate> getWitnessList() { + return witnessList; + } + + public void setWitnessList(List<WitnessTemplate> witnessList) { + this.witnessList = witnessList; + } + + public Long getWitnessId(){ + return this.witnessId; + } + + + + public List<WitnessTemplate> getUnknownList() { + return unknownList; + } + + public void setUnknownList(List<WitnessTemplate> unknownList) { + this.unknownList = unknownList; + } + +}
--- a/src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java Mon Mar 23 12:43:55 2015 +0000 @@ -38,6 +38,7 @@ titleDetails.put("ov", template.ov); titleDetails.put("author", template.author); + titleDetails.put("authorId", template.authorId); titleDetails.put("category", template.category); titleDetails.put("createIn", template.createIn); titleDetails.put("creationDate", template.creationDate); @@ -67,8 +68,18 @@ missatts.put(missatt); } titleDetails.put("authorMisattribution", missatts); + + + + //references + JSONArray references = new JSONArray(); + for(String reference : template.referenceEndnoteIdList){ + references.put(reference); + } + titleDetails.put("references", references); - json.put("data", titleDetails); + json.put("data", titleDetails); + }catch (Exception e) { PrintWriter out = response.getWriter();
--- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Mon Mar 23 12:43:55 2015 +0000 @@ -35,6 +35,7 @@ //extra public List<String> aliasList; public List<String> authorMisattributionList; + public List<String>referenceEndnoteIdList; public String personDedicatedTo; public String commentaryOnText; public String translationOfText; @@ -90,7 +91,7 @@ List<Entity> list0 = om.getSourcesForTargetRelation(entity.getId(), "is_reference_of", "REFERENCE", -1); for(Entity ref : list0){ - this.refEntityList.add(om.getEntityContent(ref)); + this.refEntityList.add(om.getEntityContent(ref)); } list0 = om.getTargetsForSourceRelation(entity.getId(), "was_created_by", "PERSON", -1); @@ -136,6 +137,14 @@ } this.loadRefernces(); + + this.referenceEndnoteIdList = new ArrayList(); + for (ReferenceTemplate refTempl : this.getReferenceList()){ + this.referenceEndnoteIdList.add(refTempl.getEndnoteId()); + } + + + }
--- a/src/main/resources/hibernate.cfg.xml Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/resources/hibernate.cfg.xml Mon Mar 23 12:43:55 2015 +0000 @@ -22,7 +22,8 @@ <property name="hibernate.connection.url">jdbc:mysql://localhost/openmind?characterEncoding=UTF-8</property> <property name="hibernate.connection.charSet">UTF-8</property> <property name="hibernate.connection.username">root</property> - <property name="hibernate.connection.password">e1nste1n</property> +<!-- <property name="hibernate.connection.password">e1nste1n</property>--> + <property name="hibernate.connection.password">fB79DCsT87</property> <!-- <property name="hibernate.connection.username">ismi</property>
--- a/src/main/webapp/imageServer/resources/css/diva4ismi.css Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/imageServer/resources/css/diva4ismi.css Mon Mar 23 12:43:55 2015 +0000 @@ -1,3 +1,25 @@ +#witness-table-contents table tr td { + text-align:right; + color: #3b4186; + font-size: 10px; + +} + + +#witness-date-copyist table tr th { + color: #3b4186; + font-size: 10px; + +} + + +#title-date-composition table tr th { + color: #3b4186; + font-size: 10px; + +} + + .ismi-fullscreen-icon { z-index: 100;
--- a/src/main/webapp/imageServer/resources/js/diva4ismi.js Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/imageServer/resources/js/diva4ismi.js Mon Mar 23 12:43:55 2015 +0000 @@ -1,8 +1,10 @@ var divaGlobal = { //rest_url : "http://localhost:8080/ismi-richfaces", debugModus : false, - rest_url : "https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi", - iipServerURL: "https://images.rasi.mcgill.ca/fcgi-bin/iipsrv.fcgi" + //rest_url : "https://openmind-ismi-dev.mpiwg-berlin.mpg.de/om4-ismi", + rest_url : "http://ismi-dev.mpiwg-berlin.mpg.de:8080/ismi-richfaces", + iipServerURL: "https://images.rasi.mcgill.ca/fcgi-bin/iipsrv.fcgi", + drupal_url: "https://drupal.mpiwg-berlin.mpg.de/ismi" } function showTitleDetailsBig(titleId){ @@ -21,6 +23,13 @@ showWitnessDetails(witnessId, 'templates/templateWitnessInformationSmall.html'); } +function setEntry(loc,field) { + if ((field == null)||(field == "")) { + $(loc).parent().hide(); + } + $(loc).html(field); +} + function showTitleDetails(titleId, template){ $.ajax({ url: template, @@ -54,17 +63,17 @@ }); } -function showWitnessDetails(witnessId, template){ +function showWitnessDetails(titleId, template){ $.ajax({ url: template, type: 'GET', success: function(data){ //inserting the template in this document - $('#additional-information').html(data); - $('#witness-details-show-more').attr('data-witness-id', witnessId); - $('#witness-details-show-less').attr('data-witness-id', witnessId); + $('#additional-information2').html(data); + $('#witness-details-show-more').attr('data-witness-id', titleId); + $('#witness-details-show-less').attr('data-witness-id', titleId); - var jsonRequest = divaGlobal.rest_url + '/jsonInterface?method=get_witness_details&include_romanization=true&id=' + witnessId; + var jsonRequest = divaGlobal.rest_url + '/jsonInterface?method=get_witness_details&include_romanization=true&id=' + titleId; console.log(jsonRequest); @@ -72,7 +81,7 @@ url: jsonRequest, type: 'GET', success: function(data){ - loadWitnessInformation(data, witnessId); + loadWitnessInformation(data, titleId); }, error: function(data) { @@ -87,6 +96,27 @@ }); } + + + + +function showBibliographyEntryFormatted(bibId,loc){ + bibId=encodeURIComponent(bibId) + $.ajax({ + url: divaGlobal.drupal_url+"/formatbiblio/"+bibId, + type: 'GET', + success: function(data){ + //inserting the template in this document + //mache rel urls zu absoluten + ref = data.nodes[0].node.citation.replace(new RegExp("/ismi","g"),divaGlobal.drupal_url) + $(loc).html(ref); + }, + error: function(data) { + console.error(bibId + ' no found.'); + } + }); +} + function loadWitnessInformation(json, titleId){ if(divaGlobal.debugModus){ @@ -141,34 +171,76 @@ var creationDate = json.data.creationDate; var readersContent = "<table>"; + var readers= json.data.readers; for(readerKey in json.data.readers){ var reader = json.data.readers[readerKey]; readersContent += "<tr><td class='tdTitle' style='width: 300px;'>"+reader+"</td></tr>"; } readersContent += "</table>"; + - + + var referencesContent="<table>"; + for(readerKey in json.data.references){ + var reader = json.data.references[readerKey]; + referencesContent += "<tr><td class='tdTitle' id='bibl-entry-"+readerKey +"' style='width: 300px;'>"+reader+"</td></tr>"; + } + referencesContent += "</table>"; - $('#witness-title').html(titleContent); - $('#witness-title-written-in-witness').html(titleAsWrittenInWitness); - $('#witness-author').html(authorContent); - $('#witness-author-written-in-witness').html(authorAsWrittenInWitness); - $('#witness-codex').html(codex); - $('#witness-ahlwardt-no').html(ahlwardtNo); - $('#witness-copyist').html(copyist); - $('#witness-place-copyist').html(placeOfCopying); - $('#witness-date-copyist').html(creationDate); - $('#witness-colophon').html(colophon); + setEntry('#witness-title',"") //no need to display this already in titleInfomation + //$('#witness-title').html(titleContent); + + setEntry('#witness-title-written-in-witness',titleAsWrittenInWitness); + + setEntry('#witness-author',"") //no need to display this already in titleInfomation + //$('#witness-author').html(authorContent); + + + setEntry('#witness-author-written-in-witness',authorAsWrittenInWitness); + //$('#witness-codex').html(codex); + setEntry('#witness-codex',''); + + setEntry('#witness-ahlwardt-no',ahlwardtNo); + setEntry('#witness-copyist',copyist); + setEntry('#witness-place-copyist',placeOfCopying); + setEntry('#witness-date-copyist',creationDate); + setEntry('#witness-colophon',colophon); + $('#witness-readers').html(readersContent); - $('#witness-folios').text(folios); - $('#witness-dimensions').html(pageDimensions); - $('#witness-written-dimensions').html(writtenAreaDimensions); - $('#witness-lines').html(linesPerPage); - $('#witness-surface').html(writingSurface); - $('#witness-layout').html(pageLayout); - $('#witness-script').html(script); - $('#witness-notes').text(notes); - $('#witness-refs').text("TODO"); + + if (( readers == null)||( readers == "")) { + $('#witness-readers').parent().hide(); + }; + setEntry('#witness-folios',folios); + setEntry('#witness-dimensions',pageDimensions); + setEntry('#witness-written-dimensions',writtenAreaDimensions); + setEntry('#witness-lines',linesPerPage); + setEntry('#witness-surface',writingSurface); + setEntry('#witness-layout',pageLayout); + + //$('#title-incipit').text(incipit); + setEntry('#witness-incipit',incipit); + + //$('#title-explicit').text(explicit); + setEntry('#witness-explicit',explicit); + + //$('#title-table-contents').text(tableOfContents); + setEntry('#witness-table-contents',tableOfContents); + setEntry('#witness-script',script); + setEntry('#witness-notes',notes); + //setEntry('#witness-refs',"TODO"); + + $('#witness-refs').html(referencesContent); + + for(readerKey in json.data.references){ + var reader = json.data.references[readerKey]; + var loc="#bibl-entry-"+readerKey ; + var bibId=json.data.references[readerKey]; + showBibliographyEntryFormatted(bibId,loc); + + } + referencesContent += "</table>"; + } @@ -181,15 +253,31 @@ var fullTitle = json.data.fullTitle; var fullTitleTranslit = json.data.fullTitleTranslit; var titleContent = new String(); + /* if(fullTitle){ - titleContent = "<table><tr><td class='tdTitle' style='width: 300px;''>"+fullTitle+"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; + titleContent = "<table><tr><td class='tdTitle' style='width: 300px;''>"+ + '<a href="../public/dynamicPage.xhtml?eid='+titleId+'">'+fullTitle+"</a>"+'<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">(full)</a>' + +"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; }else{ - titleContent = "<table><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>" + titleContent = "<table><tr><td class='tdTitle'>"+ + '<a href="../public/dynamicPage.xhtml?eid='+titleId+'">'+fullTitleTranslit+"</a>"+'<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">(full)</a>' + +"</td></tr></table>" } +*/ + if(fullTitle){ + titleContent = "<table><tr><td class='tdTitle' style='width: 300px;''>"+ + '<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">'+fullTitle+'</a>' + +"</td></tr><tr><td class='tdTitle'>"+fullTitleTranslit+"</td></tr></table>"; + }else{ + titleContent = "<table><tr><td class='tdTitle'>"+ + '<a href="'+divaGlobal.drupal_url+"/entity/"+titleId+'">'+fullTitleTranslit+'</a>' + +"</td></tr></table>" + } var language = json.data.language; var category = json.data.category; var author = json.data.author; + var authorId = json.data.authorId; var aliases = json.data.aliases; var personDedicatedTo = json.data.personDedicatedTo; var commentaryOnText = json.data.commentaryOnText; @@ -204,6 +292,10 @@ } aliasesContent += "</table>"; + if (( aliases == null)||( aliases == "")) { + $('#title-aliases').parent().hide(); + }; + var dedication = json.data.dedication; var notes = json.data.notes; var tableOfContents = json.data.tableOfContents; @@ -220,25 +312,84 @@ } authorMisattributionContent += "</table>"; + if (( authorMisattribution == null)||( authorMisattribution == "")) { + $('#title-misattributions').parent().hide(); + }; + +/* var authorContent = '<a href="../public/dynamicPage.xhtml?eid='+authorId+'">'+author+"</a>"+'<a href="'+divaGlobal.drupal_url+"/entity/"+authorId+'">(full)</a>'; +*/ + var authorContent = '<a href="'+divaGlobal.drupal_url+"/entity/"+authorId+'">'+author+"</a>"; + + + var referencesContent="<table>"; + for(readerKey in json.data.references){ + var reader = json.data.references[readerKey]; + referencesContent += "<tr><td class='tdTitle' id='bibl-entry-"+readerKey +"' style='width: 300px;'>"+reader+"</td></tr>"; + } + referencesContent += "</table>"; + //inserting the values into the table $('#title-tile').html(titleContent); $('#title-aliases').html(aliasesContent); $('#title-misattributions').html(authorMisattributionContent); - $('#title-author').text(author); - $('#title-subject').text(category); - $('#title-lang').text(language); - $('#title-date-composition').text(creationDate); - $('#title-place-composition').text(createIn); - $('#title-dedicated-to').text(personDedicatedTo); - $('#title-dedication').text(dedication); - $('#title-commentary-on').text(commentaryOnText); - $('#title-translation-of').text(translationOfText); - $('#title-version-of').text(versionOfText); - $('#title-incipit').text(incipit); - $('#title-explicit').text(explicit); - $('#title-table-contents').text(tableOfContents); - $('#title-notes').text(notes); - $('#title-bib').text("TODO"); + $('#title-author').html(authorContent); + + + //$('#title-subject').text(category); + setEntry('#title-subject',category); + + + //$('#title-lang').text(language); + setEntry('#title-lang',language); + + //$('#title-date-composition').text(creationDate); + setEntry('#title-date-composition',creationDate); + + //$('#title-place-composition').text(createIn); + setEntry('#title-place-composition',createIn); + + //$('#title-dedicated-to').text(personDedicatedTo); + setEntry('#title-dedicated-to',personDedicatedTo); + + //$('#title-dedication').text(dedication); + setEntry('#title-dedication',dedication); + + //$('#title-commentary-on').text(commentaryOnText); + setEntry('#title-commentary-on',commentaryOnText); + + //$('#title-translation-of').text(translationOfText); + setEntry('#title-translation-of',translationOfText); + + //$('#title-version-of').text(versionOfText); + setEntry('#title-version-of',versionOfText); + + //$('#title-incipit').text(incipit); + setEntry('#title-incipit',incipit); + + //$('#title-explicit').text(explicit); + setEntry('#title-explicit',explicit); + + //$('#title-table-contents').text(tableOfContents); + setEntry('#title-table-contents',tableOfContents); + + + //$('#title-notes').text(notes); + setEntry('#title-notes',notes); + + $('#title-bib').html(referencesContent); + + for(readerKey in json.data.references){ + var reader = json.data.references[readerKey]; + var loc="#bibl-entry-"+readerKey ; + var bibId=json.data.references[readerKey]; + showBibliographyEntryFormatted(bibId,loc); + + } + referencesContent += "</table>"; + + + + }
--- a/src/main/webapp/public/publicCodex.jsp Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/public/publicCodex.jsp Mon Mar 23 12:43:55 2015 +0000 @@ -65,9 +65,12 @@ } var titleId = $(this).data('title-id'); showTitleDetailsSmall(titleId); + var witnessId = $(this).data('witness-id'); + showWitnessDetailsSmall(witnessId); }); - $('#additional-information').on('click', '.title-details-show-more', function(ev){ + $('#additional-information').on('click', + '.title-details-show-more', function(ev){ var titleId = $(this).data('title-id'); showTitleDetailsBig(titleId); }); @@ -77,12 +80,12 @@ showTitleDetailsSmall(titleId); }); - $('#additional-information').on('click', '.witness-details-show-more', function(ev){ + $('#additional-information2').on('click', '.witness-details-show-more', function(ev){ var witnessId = $(this).data('witness-id'); showWitnessDetailsBig(witnessId); }); - $('#additional-information').on('click', '.witness-details-show-less', function(ev){ + $('#additional-information2').on('click', '.witness-details-show-less', function(ev){ var witnessId = $(this).data('witness-id'); showWitnessDetailsSmall(witnessId); }); @@ -272,6 +275,7 @@ <!-- href="${codexPage.getAppBean().getRoot()}/public/dynamicPage.xhtml?eid=${witness.titleId}" --> <a class="show-title-details" data-title-id="${witness.titleId}" + data-witness-id="${witness.id}" data-start="${witness.startPage}"> <c:out value="${witness.title}"/> </a> @@ -306,9 +310,12 @@ <br> </c:if> + <div id="additional-information"> </div> + <div id="additional-information2"> + </div> <span class="titlePanel">Codex Information</span> <table class="table table-bordered table-condensed divaPanel">
--- a/src/main/webapp/public/publicWitness.jsp Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/public/publicWitness.jsp Mon Mar 23 12:43:55 2015 +0000 @@ -6,7 +6,7 @@ <html> <head> - <title>Witness Details</title> + <title>Codex Details</title> <link href="../imageServer/resources/css/diva4ismi.css" type="text/css" rel="stylesheet" /> <link href="../imageServer/resources/css/bootstrap.css" type="text/css" rel="stylesheet" /> @@ -19,24 +19,22 @@ <script type="text/javascript" src="../imageServer/resources/js/diva.min.js"></script> <script type="text/javascript" src="../imageServer/resources/js/bootstrap.min.js"></script> <script type="text/javascript" src="../imageServer/resources/js/typeahead.js"></script> + <script type="text/javascript" src="../imageServer/resources/js/ismiUtils.js"></script> <script type="text/javascript" src="../imageServer/resources/js/diva4ismi.js"></script> - <!-- - <script type="text/javascript" src="resources/js/jquery-ui-1.10.4/jquery-1.10.2.js"></script> - --> + + <jsp:useBean id="codexPage" class="de.mpiwg.itgroup.ismi.publicView.pages.WitnessCodexDynamicPage" scope="session" /> + <jsp:setProperty name="codexPage" property="request" value="${pageContext.request}" /> + <jsp:setProperty name="codexPage" property="response" value="${pageContext.response}" /> + + <%codexPage.init(); + if(!codexPage.isErrorLoading()){ + response.sendRedirect("../public/publicCodices.xhtml"); + }else{ + %> - <jsp:useBean id="witnessPage" class="de.mpiwg.itgroup.ismi.publicView.pages.WitnessDynamicPage" scope="session" /> - <jsp:setProperty name="witnessPage" property="request" value="${pageContext.request}" /> - <jsp:setProperty name="witnessPage" property="response" value="${pageContext.response}" /> - - - <%witnessPage.init(); - if(!witnessPage.isErrorLoading()){ - response.sendRedirect("../public/publicCodices.xhtml"); - }else{ - %> - -<script type="text/javascript"> + <script type="text/javascript"> + $(document).ready(function () { function getURLParams() @@ -54,35 +52,43 @@ return urlParams; } - - - $('#page-jump').on('keypress', function(ev) - { - if (ev.which == '13') - { - var dv = $('#diva-wrapper').data('diva'); - var value = $(this).val(); - var success = dv.gotoPageByNumber(value); - - if (!success) - { - if (!$('#page-jump-group').hasClass('error')) - { - $('#page-jump-group').addClass('error'); - $('#page-jump-controls').append('<span id="jump-error-help" class="help-inline">The page you specified is not valid.</span>'); - } - } - else - { - if ($('#page-jump-group').hasClass('error')) - { - $('#page-jump-group').removeClass('error'); - $('#jump-error-help').remove(); - } - } - + + $('#table-titles-in-codex').on('click', '.show-title-details', function(ev){ + var dv = $('#diva-wrapper').data('diva'); + var start_page = $(this).data('start'); + + if(start_page){ + dv.gotoPageByNumber(start_page); + ev.preventDefault(); + }else{ + alert("No page assigned to this title."); } - }); + var titleId = $(this).data('title-id'); + showTitleDetailsSmall(titleId); + var witnessId = $(this).data('witness-id'); + showWitnessDetailsSmall(witnessId); + }); + + $('#additional-information').on('click', + '.title-details-show-more', function(ev){ + var titleId = $(this).data('title-id'); + showTitleDetailsBig(titleId); + }); + + $('#additional-information').on('click', '.title-details-show-less', function(ev){ + var titleId = $(this).data('title-id'); + showTitleDetailsSmall(titleId); + }); + + $('#additional-information2').on('click', '.witness-details-show-more', function(ev){ + var witnessId = $(this).data('witness-id'); + showWitnessDetailsBig(witnessId); + }); + + $('#additional-information2').on('click', '.witness-details-show-less', function(ev){ + var witnessId = $(this).data('witness-id'); + showWitnessDetailsSmall(witnessId); + }); $('.ismi-fullscreen-icon').on('click', function(ev) { @@ -117,11 +123,40 @@ $( this ).data('in-fullscreen-mode', true); } }); - + + + $('#page-jump').on('keypress', function(ev) + { + if (ev.which == '13') + { + var dv = $('#diva-wrapper').data('diva'); + var value = $(this).val(); + var success = dv.gotoPageByNumber(value); + + if (!success) + { + if (!$('#page-jump-group').hasClass('error')) + { + $('#page-jump-group').addClass('error'); + $('#page-jump-controls').append('<span id="jump-error-help" class="help-inline">The page you specified is not valid.</span>'); + } + } + else + { + if ($('#page-jump-group').hasClass('error')) + { + $('#page-jump-group').removeClass('error'); + $('#jump-error-help').remove(); + } + } + + } + }); $('.go-to-witness-link').on('click', function(ev) { var dv = $('#diva-wrapper').data('diva'); var start_page = $(this).data('start'); + if(start_page){ dv.gotoPageByNumber(start_page); ev.preventDefault(); @@ -129,6 +164,9 @@ alert("No page assigned to this witness."); } + var witnessId = $(this).data('witness-id'); + showWitnessDetailsSmall(witnessId); + }); function handlePageSwitch(idx, fn, divid) @@ -169,79 +207,124 @@ fixedHeightGrid: false, contained: true, iipServerURL: divaGlobal.iipServerURL, - digiId: "<%=witnessPage.getDigi().getId()%>", - objectData: divaGlobal.rest_url + "/rest/diva/proxy/json/<%=witnessPage.getDigiLabel()%>", - imageDir: "/data7/srv/images/<%=witnessPage.getDigiLabel()%>", + digiId: "<%=codexPage.getDigiId()%>", + objectData: divaGlobal.rest_url + "/rest/diva/proxy/json/<%=codexPage.getDigiLabel()%>", + imageDir: "/data7/srv/images/<%=codexPage.getDigiLabel()%>", onSetCurrentPage : handlePageSwitch, onDocumentLoaded : handleDocumentLoaded, - zoomLevel: 1, - currentPageIndex: 13, - goDirectlyTo: <%=witnessPage.getFirstPage()%>, + goDirectlyTo: <%=codexPage.getStartPage()%>, + inFullscreen: <%=codexPage.getImageFullscreen()%>, + zoomLevel: 1, canvasPlugin: { proxyURL: divaGlobal.rest_url + "/rest/diva/proxy/image" } }); + + + + var witnessId = <%=codexPage.getWitnessId()%>; + showWitnessDetailsBig(witnessId); }); </script> - <% } %> </head> <body bgcolor=white> - <% if(witnessPage.isErrorLoading()) { %> - + <% if(codexPage.isErrorLoading()) { %> <input type='hidden' name='csrfmiddlewaretoken' value='psDBHsF5a1mttLSKeUgoUUVN3HL6f8Re' /> <jsp:include page="header.jsp" /> + <!-- + <div class="magnifiedAttributePanel"> + </div> + --> + <div class="custom-container"> <div class="row-fluid"> - <div id="attributesPanel" class="span4 page" style="min-height: 700px;"> - <a class="ismi-fullscreen-icon" href="#" data-in-fullscreen-mode="true"></a> <div class="attPanel"> - <c:if test="${witnessPage.getDigi() != null}"> + <c:if test="${codexPage.getDigi() != null}"> + + <input type="hidden" id="digi_id" value="${codexPage.getDigi().getId()}"> - <input type="hidden" id="digi_id" value="${witnessPage.getDigi().getId()}"> - <div class="divaBackgroud"> + + <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> + + <h4><%=codexPage.getDigiLabel()%></h4> + + <c:if test="${codexPage.getWitnessList().size() > 0}"> + <span class="titlePanel">Titles in this Codex</span> - <h4><%=witnessPage.getDigiLabel()%></h4> - - <span class="titlePanel">Attributes</span> + <table id="table-titles-in-codex" class="table table-bordered table-condensed divaPanel"> + <thead> + <tr> + <th class="tableHead">Title</th> + <th class="tableHead">Folios</th> + </tr> + </thead> + <tbody> + <c:forEach var="witness" items="${codexPage.getWitnessList()}"> + <tr> + <td class="tdTitle"> + <!-- href="${codexPage.getAppBean().getRoot()}/public/dynamicPage.xhtml?eid=${witness.titleId}" --> + <a class="show-title-details" + data-title-id="${witness.titleId}" + data-witness-id="${witness.id}" + data-start="${witness.startPage}"> + <c:out value="${witness.title}"/> + </a> + + </td> + <td class="columnCentered"> + <c:if test="${witness.startPage != null}"> + <a class="witness-new-window" data-witness-id="${witness.id}" data-start="${witness.startPage}" + href="${codexPage.getAppBean().getRoot()}/public/publicCodex.jsp?eid=${codexPage.getCurrentEntId()}&startPage=${witness.startPage}&imgFullscreen=true" + target="_blank"> + <img src="../resources/images/new_window-16.png"> + </a> + </c:if> + <a class="go-to-witness-link" data-witness-id="${witness.id}" data-start="${witness.startPage}" href="#"> + <c:out value="${witness.folios}"/> + </a> + + </td> + </tr> + </c:forEach> + </tbody> + </table> + </c:if> + + <c:if test="${codexPage.getUnknownList().size() > 0}"> + <h4>Unknown titles in this Codex</h4> + <c:forEach var="witness" items="${codexPage.getUnknownList()}"> + <a class="go-to-witness-link" data-witness-id="${witness.id}" data-start="${witness.startPage}" href="#"> + <c:out value="${witness.folios}"/> + </a> + </c:forEach> + <br> + </c:if> + + + <div id="additional-information"> + </div> + + <div id="additional-information2"> + </div> + + <span class="titlePanel">Codex Information</span> <table class="table table-bordered table-condensed divaPanel"> - <tbody> - - <tr> - <td class="tdTitle">Author</td> - <td/> - <td> - <a href="${witnessPage.getAppBean().getRoot()}/public/dynamicPage.xhtml?eid=${witnessPage.getAuthorId()}"> - <c:out value="${witnessPage.getAuthor()}"/> - </a> - </td> - <td/> - </tr> - <tr> - <td class="tdTitle">Title</td> - <td/> - <td> - <a href="${witnessPage.getAppBean().getRoot()}/public/dynamicPage.xhtml?eid=${witnessPage.getTitleId()}"> - <c:out value="${witnessPage.getTitle()}"/> - </a> - </td> - <td/> - </tr> - - <c:forEach var="attLabel" items="${witnessPage.getLabels()}"> + <tbody> + <c:forEach var="attLabel" items="${codexPage.getLabels()}"> <tr> <td class="tdTitle"> <c:out value="${attLabel}"/> @@ -249,9 +332,9 @@ <td > <table class="tableContent"> <tbody> - <c:forEach var="attValue" items="${witnessPage.getAttMap().get(attLabel)}"> + <c:forEach var="attValue" items="${codexPage.getAttMap().get(attLabel)}"> <tr> - <td style="text-align: <c:out value="${witnessPage.getAttMapTextAlign().get(attLabel)}"/>;"> + <td style="text-align: ${codexPage.getAttMapTextAlign().get(attLabel)};"> <c:out value="${attValue}"/> </td> </tr> @@ -263,7 +346,7 @@ </c:forEach> </tbody> </table> - + </div> </c:if> </div> @@ -274,8 +357,7 @@ </div> </div> </div> - + <% } %> - </body> </html>
--- a/src/main/webapp/public/templates/templateWitnessInformationBig.html Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/public/templates/templateWitnessInformationBig.html Mon Mar 23 12:43:55 2015 +0000 @@ -52,7 +52,7 @@ </td> </tr> <tr> - <td class="tdTitle"> Readers [Studied by]</td> + <td class="tdTitle">Readers [Studied by]</td> <td class="tdTitle" id="witness-readers"> </td> </tr> @@ -87,6 +87,21 @@ </td> </tr> <tr> + <td class="tdTitle">Incipit</td> + <td class="tdTitle" id="witness-incipit"> + </td> + </tr> + <tr> + <td class="tdTitle">Explicit</td> + <td class="tdTitle" id="witness-explicit"> + </td> + </tr> + <tr> + <td class="tdTitle">Table of Contents</td> + <td class="tdTitle" id="witness-table-contents"> + </td> + </tr> + <tr> <td class="tdTitle">Script</td> <td class="tdTitle" id="witness-script"> </td>