Skip to content

Commit

Permalink
Merge branch 'release/evt2-beta2.01'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaraDipi committed Jul 21, 2021
2 parents 177d6eb + 1caa5f9 commit 1814a0e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 33 deletions.
4 changes: 2 additions & 2 deletions app/src/dataHandler/criticalElementsParser.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,7 @@ angular.module('evtviewer.dataHandler')
spanElement = evtParser.parseXMLElement(doc, e, {skip: ''});
} else {
spanElement = document.createElement('span');
spanElement.className = elem.tagName;
spanElement.className = elem.tagName ? elem.tagName.toLowerCase() : '';

var attribKeys = Object.keys(elem.attributes);
for (var key in attribKeys) {
Expand Down Expand Up @@ -2496,7 +2496,7 @@ angular.module('evtviewer.dataHandler')
spanElement = evtParser.parseXMLElement(doc, e, {skip: ''});
} else {
spanElement = document.createElement('span');
spanElement.className = elem.tagName;
spanElement.className = elem.tagName ? elem.tagName.toLowerCase() : '';;

var attribKeys = Object.keys(elem.attributes);
for (var key in attribKeys) {
Expand Down
8 changes: 5 additions & 3 deletions app/src/dataHandler/parser.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ angular.module('evtviewer.dataHandler')
newElement = parser.parseNote(element);
} else if (tagName === 'date' && (!element.childNodes || element.childNodes.length <= 0)) { //TEMP => TODO: create new directive
newElement = document.createElement('span');
newElement.className = element.tagName;
newElement.className = element.tagName ? element.tagName.toLowerCase() : '';;
var textContent = '';
for (var i = 0; i < element.attributes.length; i++) {
var attrib = element.attributes[i];
Expand All @@ -226,7 +226,7 @@ angular.module('evtviewer.dataHandler')
} else {
newElement = document.createElement('span');
}
newElement.className = element.tagName !== undefined ? element.tagName : '';
newElement.className = element.tagName !== undefined ? element.tagName.toLowerCase() : '';
if (element.attributes) {
for (var k = 0; k < element.attributes.length; k++) {
var attribK = element.attributes[k];
Expand Down Expand Up @@ -703,8 +703,10 @@ angular.module('evtviewer.dataHandler')
//newElement.insertBefore(lineNumElem, newElement.childNodes[0]);
} else if (parsedData.getEncodingDetail('lineNums')) {
newElement.className += ' l-indent';
var parsedElement = parser.parseXMLElement(doc, newElement, options);
newElement.innerHTML = '<span class="lineContent">' + parsedElement.outerHTML + '</span>';
}

return newElement;
};
/**
Expand Down
51 changes: 24 additions & 27 deletions app/src/dataHandler/search/diplomaticLbHandler.service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
angular.module('evtviewer.dataHandler')
.service('evtSearchDiplomaticLbHandler', ['evtSearchDocument', 'evtDiplomaticEditionHandler', 'evtInterpretativeEditionHandler',
function DiplomaticLbHandler(evtSearchDocument, evtDiplomaticEditionHandler, evtInterpretativeEditionHandler){
.service('evtSearchDiplomaticLbHandler', ['evtSearchDocument', 'evtDiplomaticEditionHandler', 'evtInterpretativeEditionHandler', 'evtParser',
function DiplomaticLbHandler(evtSearchDocument, evtDiplomaticEditionHandler, evtInterpretativeEditionHandler, evtParser){

var countAllDocsLine = 0;
DiplomaticLbHandler.prototype.getLineInfo = function(xmlDocDom, xmlDocBody, lbNodes, prevDocsLbNumber, ns, nsResolver) {
var currentXmlDoc = evtSearchDocument.getCurrentXmlDoc(xmlDocDom, xmlDocBody, ns, nsResolver),
Expand Down Expand Up @@ -54,42 +54,39 @@ angular.module('evtviewer.dataHandler')
}
line.xmlDocTitle = currentXmlDoc.title;
line.xmlDocId = currentXmlDoc.id;
line.docId = line.xmlDocId + '-' + line.pageId + '-' + line.line;
line.docId = line.xmlDocId + '-' + line.pageId + '-' + line.line + '-line' + countLine;
line.lbId = node.getAttribute('xml:id');

do {
if (editionIsDipl) {
lineNodes.diplomatic = evtSearchDocument.getLineNodes(xmlDocDom, diplomaticNodes, prevDocsLbNumber, countLine, ns, nsResolver);
cleanedDiplomaticNodes = evtSearchDocument.removeEmptyTextNodes(lineNodes.diplomatic);
} else {
lineNodes.diplomatic = [];
cleanedDiplomaticNodes = [];
}

if (editionIsInterp) {
lineNodes.interpretative = evtSearchDocument.getLineNodes(xmlDocDom, interpretativeNodes, prevDocsLbNumber, countLine, ns, nsResolver);
cleanedInterpretativeNodes = evtSearchDocument.removeEmptyTextNodes(lineNodes.interpretative);
} else {
lineNodes.interpretative = [];
cleanedInterpretativeNodes = [];
}
} while (cleanedDiplomaticNodes.length === 0 && cleanedInterpretativeNodes.length === 0 &&
lineNodes.diplomatic.length !== 0 && lineNodes.interpretative.length !== 0);


if (editionIsDipl) {
lineNodes.diplomatic = evtSearchDocument.getLineNodes(xmlDocDom, diplomaticNodes, prevDocsLbNumber, countLine, ns, nsResolver);
cleanedDiplomaticNodes = evtSearchDocument.removeEmptyTextNodes(lineNodes.diplomatic);
} else {
lineNodes.diplomatic = [];
cleanedDiplomaticNodes = [];
}

if (editionIsInterp) {
lineNodes.interpretative = evtSearchDocument.getLineNodes(xmlDocDom, interpretativeNodes, prevDocsLbNumber, countLine, ns, nsResolver);
cleanedInterpretativeNodes = evtSearchDocument.removeEmptyTextNodes(lineNodes.interpretative);
} else {
lineNodes.interpretative = [];
cleanedInterpretativeNodes = [];
}

line.content = {};
if (editionIsDipl) {
line.content.diplomatic = evtSearchDocument.getContent(lineNodes.diplomatic, 'diplomatic');
}

if (editionIsInterp) {
line.content.interpretative = evtSearchDocument.getContent(lineNodes.interpretative, 'interpretative');
}

lineId++;
countLine++;
countAllDocsLine++;
prevLine = line.line;

lines[line.docId] = line;
lineNodes = [];
}
Expand Down
1 change: 1 addition & 0 deletions app/styles/_buttonSwitch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ button-switch {
top: 54px;
z-index: 20;
left: 75%;
transform: none !important;
&.centered {
left: 75%;
}
Expand Down
4 changes: 4 additions & 0 deletions app/styles/_searchBoxInternal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@

.result-token {
font-weight: bold;
color: $search-result-item;
}

.results-number {
Expand All @@ -145,6 +146,9 @@
.original-text {
display: block;
font-style: italic;
strong {
color: $search-result-item;
}
}

.resultInfo {
Expand Down
2 changes: 1 addition & 1 deletion app/styles/_tei.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
text-decoration: none;
}

.div {
div.div {
display: block;
margin: 15px 0;
background: inherit;
Expand Down
1 change: 1 addition & 0 deletions app/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ $box-witness-text-color: $box-text-color;
$search-box-height: 30px;
$search-input-height: 27px;
$search-result-info: $base-color-light;
$search-result-item: #ad0808;
$search-options-background: $box-background-color;
$search-buttons-background: $box-background-color;
$virtual-keyboard-width: 325px;
Expand Down

0 comments on commit 1814a0e

Please sign in to comment.