diff --git a/article/nodes/composite/composite_view.js b/article/nodes/composite/composite_view.js index 9fbb9ee..cb4cb8d 100644 --- a/article/nodes/composite/composite_view.js +++ b/article/nodes/composite/composite_view.js @@ -16,6 +16,10 @@ CompositeView.Prototype = function() { // ============================= // + // Render Markup + // -------- + // + this.render = function() { NodeView.prototype.render.call(this); diff --git a/article/nodes/cover/cover_view.js b/article/nodes/cover/cover_view.js index 5b82e08..a099bb9 100644 --- a/article/nodes/cover/cover_view.js +++ b/article/nodes/cover/cover_view.js @@ -14,6 +14,7 @@ var CoverView = function(node, viewFactory) { CoverView.Prototype = function() { + // Render it // -------- // @@ -85,7 +86,6 @@ CoverView.Prototype = function() { if (pubInfo) { var pubDate = pubInfo.published_on; - console.log("pubDate",pubDate); var articleType = pubInfo.article_type; if (pubDate) { var items = [articleUtil.formatDate(pubDate)]; diff --git a/article/nodes/footnote/footnote.css b/article/nodes/footnote/footnote.css index 2099440..3ff4242 100644 --- a/article/nodes/footnote/footnote.css +++ b/article/nodes/footnote/footnote.css @@ -28,4 +28,14 @@ Footnotes .lens-article .content-node.footnote .content .footnote-urls .url { padding-right: 20px; +} + +.lens-article .content-node.footnote .content .table { + + border-collapse: collapse; + width: 100%; +} +.lens-article .content-node.footnote .content .table th, td { + padding: 1px; + } \ No newline at end of file diff --git a/article/nodes/footnote/footnote_view.js b/article/nodes/footnote/footnote_view.js index 5466339..b694054 100644 --- a/article/nodes/footnote/footnote_view.js +++ b/article/nodes/footnote/footnote_view.js @@ -5,7 +5,7 @@ var $$ = require("../../../substance/application").$$; var NodeView = require("../node").View; var ResourceView = require('../../resource_view'); var util = require("../../../substance/util"); -var TableView = require('../table/table_view'); + // Lens.Citation.View @@ -93,9 +93,9 @@ CitationView.Prototype = function () { if (children[0]) { var table = document.createElement('table'); table.innerHTML =children[0].innerHTML; - div.appendChild(table); + table.className="table"; + frag.appendChild(table); - //div.appendChild(children[0]); } } diff --git a/article/nodes/html_table/html_table.js b/article/nodes/html_table/html_table.js new file mode 100644 index 0000000..b485c2c --- /dev/null +++ b/article/nodes/html_table/html_table.js @@ -0,0 +1,84 @@ +var _ = require('underscore'); +var Document = require('../../../substance/document'); + +// Lens.HTMLTable +// ----------------- +// + +var HTMLTable = function(node, doc) { + Document.Node.call(this, node, doc); +}; + +// Type definition +// ----------------- +// + +HTMLTable.type = { + "id": "html_table", + "parent": "content", + "properties": { + "source_id": "string", + "label": "string", + "content": "string", + "footers": ["array", "string"], + "caption": "caption" + } +}; + +HTMLTable.config = { + "zoomable": true +}; + + +// This is used for the auto-generated docs +// ----------------- +// + +HTMLTable.description = { + "name": "HTMLTable", + "remarks": [ + "A table figure which is expressed in HTML notation" + ], + "properties": { + "source_id": "string", + "label": "Label shown in the resource header.", + "title": "Full table title", + "content": "HTML data", + "footers": "HTMLTable footers expressed as an array strings", + "caption": "References a caption node, that has all the content" + } +}; + + +// Example HTMLTable +// ----------------- +// + +HTMLTable.example = { + "id": "html_table_1", + "type": "html_table", + "label": "HTMLTable 1.", + "title": "Lorem ipsum table", + "content": "
innerhalb von Tabellen und Zitaten 7.12.18 voe***/
+.content-node.paragraph + .content-node.paragraph {
+ margin-top: 0.7em;
+ }
+
+td > .content-node.paragraph + .content-node.paragraph {
+ margin-top: 0;
+ }
+/*.quote > .content .content-node.paragraph + .quote > .content .content-node.paragraph*/
+.quote > .content > .paragraph + .paragraph {
+ margin-top: 0 !important;
+ }
+
diff --git a/article/nodes/quote/quote.css b/article/nodes/quote/quote.css
index 0ff271d..33e6248 100644
--- a/article/nodes/quote/quote.css
+++ b/article/nodes/quote/quote.css
@@ -5,8 +5,8 @@
}
.document .content-node.quote .content-node.paragraph {
- padding: 10px 40px 10px 40px;
- border-left: 3px solid #ccc;
+ padding: 0px 20px 0px 20px;
+ /*border-left: 3px solid #ccc; doppelte Ausgabe von Rändern bei Zitaten in Stille, Scholz ... 416/416-69-83162-1-10-20181203.xml*/
}
.surface.content .content-node.quote {
diff --git a/article/nodes/table/table.css b/article/nodes/table/table.css
index 84b3cf8..4caae3a 100644
--- a/article/nodes/table/table.css
+++ b/article/nodes/table/table.css
@@ -1,122 +1,51 @@
-.lens-article .content-node.html-table > .content {
- padding: 20px;
-}
-.lens-article .content-node.html-table > .content img {
- width: 100%;
-}
-
-.lens-article .content-node.html-table .table-wrapper {
- width: 100%;
- overflow: auto;
-}
-
-.lens-article .content-node.html-table .caption {
- padding-top: 20px;
-}
-
-.lens-article .content-node.html-table table {
- position: relative;
- border-collapse: collapse;
- border-spacing: 0;
- margin-bottom: 20px;
- margin: 0 auto;
- width: 100%;
-}
-
-.lens-article .content-node.html-table thead tr {
- background: #eee;
-}
-
-.lens-article .content-node.html-table thead td {
- font-weight: bold;
-}
-
-/* Table sub tags */
-.lens-article .content-node.html-table table sub {
- vertical-align: baseline;
- position: relative;
- top: 0.4em;
- font-size: 11px;
-}
-
-.lens-article .content-node.html-table table td {
- padding: 5px;
- /**font-size: 12px;**/
- border: 0px solid lightgrey;
- /* Enable white-space: nowrap; if author controls wrapping (
in HTML)
- /* white-space: nowrap; */
-}
-
-.lens-article .content-node.html-table .footers {
+.lens-article .content-node.table .footers {
padding: 0 20px;
padding-top: 10px;
font-size: 12px;
- background: #fff;
-}
+ background: #fff; }
/** Formatierung der Klasse "layout-tabelle" - Layout-Tabelle - , die nur zur Anordnung von Elementen verwendet wird **/
-.lens-article .content-node.html-table .layout-tabelle {
+.layout-tabelle {
border: 0;
width: auto;
- margin-left: 0;
-}
+ margin-left: 0; }
-.lens-article .content-node.html-table .layout-tabelle td {
+.layout-tabelle td {
border: 0;
font-size: 1em;
- padding: 3px;
-}
+ padding: 3px; }
/** Formatierung der Klasse "gitter-tabelle" - Gitter-Tabelle **/
-.lens-article .content-node.html-table .gitter-tabelle {
+.gitter-tabelle {
border: 1px solid lightgray;
border-collapse: collapse;
width: auto;
- margin-left: 0;
-}
+ margin-left: 0; }
-.lens-article .content-node.html-table .gitter-tabelle td {
+.gitter-tabelle td {
border: 1px solid lightgray;
border-collapse: collapse;
- padding: 3px;
-}
-
-
+ padding: 3px; }
/** Layout Daten-Tabelle Issue Nr. 58
- für heiUP auskommentiert, um mehrspaltigen Satz ohne Färbung zu ermöglichen, To do: HTML/CSS-Konstruktion für mehrspaltigen Satz - 09.03. voe - neues default ist layout-tabelle, deshalb testweise wieder einkommentiert - 07.08. voe**/
-
-.lens-article .content-node.html-table > .content { /* Wie wirkt sich diese klassenunabhängige Anweisung aus? Test! 07.08.. - wenn bis 07.11. keine Verschiebungen bekannt werden, kann Hinweis entfernt werden.*/
- padding-left: 0;
-}
+ für heiUP auskommentiert, um mehrspaltigen Satz ohne Färbung zu ermöglichen, - neues default ist layout-tabelle, deshalb testweise wieder einkommentiert - 07.08. voe**/
+.lens-article .content-node.table > .content {
+ padding-left: 0; }
-.lens-article .content-node.html-table .daten-tabelle {
+.daten-tabelle {
border: 1px solid #f8f8f8;
- overflow-x: scroll;
-}
+ overflow-x: scroll; }
-.lens-article .content-node.html-table .daten-tabelle tr {
- vertical-align: top;
-}
+.daten-tabelle tr {
+ vertical-align: top; }
-.lens-article .content-node.html-table .daten-tabelle tr:nth-child(odd) {
- background-color: #f8f8f8;
-}
+.daten-tabelle tr:nth-child(odd) {
+ background-color: #f8f8f8; }
-.lens-article .content-node.html-table .daten-tabelle tr:nth-child(odd) td:empty {
- background-color: #f8f8f8;
-}
+.daten-tabelle tr:nth-child(odd) td:empty {
+ background-color: #f8f8f8; }
-
-.lens-article .content-node.html-table .daten-tabelle td {
+.daten-tabelle td {
border-right: 1px solid #f8f8f8;
- padding: 10px;
-}
-.lens-article .content-node.html-table table td {
- font-size: 0.75em;
- line-height: 1.7em;
-}
-
-
-
+ padding: 10px; }
\ No newline at end of file
diff --git a/article/nodes/text/text.css b/article/nodes/text/text.css
index 53001c8..15d367e 100644
--- a/article/nodes/text/text.css
+++ b/article/nodes/text/text.css
@@ -21,4 +21,9 @@
.content-node.text.title {
padding-left: 0;
-}
\ No newline at end of file
+}
+
+/* Abstract */
+.abstract {
+ margin-bottom: 2.7em;
+}
diff --git a/article/resource_view.js b/article/resource_view.js
index eafa5c2..fb8b5b7 100644
--- a/article/resource_view.js
+++ b/article/resource_view.js
@@ -51,7 +51,7 @@ ResourceView.Prototype = function() {
}
togglesEl.appendChild($$('a.toggle-res.toggle.action-toggle-resource', {
"href": "#",
- "html": " "+locales.Focus
+ "html": " Focus"
}));
headerEl.appendChild(togglesEl);
diff --git a/converter/lens_converter.js b/converter/lens_converter.js
index 87d673e..3ddc92b 100644
--- a/converter/lens_converter.js
+++ b/converter/lens_converter.js
@@ -1,13 +1,17 @@
"use strict";
+
var _ = require("underscore");
var util = require("../substance/util");
var errors = util.errors;
var ImporterError = errors.define("ImporterError");
var Article = require("../article");
-var NlmToLensConverter = function (options) {
+
+var NlmToLensConverter = function(options) {
this.options = options || NlmToLensConverter.DefaultOptions;
};
-NlmToLensConverter.Prototype = function () {
+
+NlmToLensConverter.Prototype = function() {
+
this._annotationTypes = {
"bold": "strong",
"italic": "emphasis",
@@ -24,6 +28,7 @@ NlmToLensConverter.Prototype = function () {
"inline-formula": "inline-formula",
"uri": "link"
};
+
// mapping from xref.refType to node type
this._refTypeMapping = {
"bibr": "citation_reference",
@@ -34,6 +39,7 @@ NlmToLensConverter.Prototype = function () {
"other": "figure_reference",
"list": "definition_reference",
};
+
// mapping of contrib type to human readable names
// Can be overriden in specialized converter
this._contribTypeMapping = {
@@ -66,45 +72,56 @@ NlmToLensConverter.Prototype = function () {
"section-editor": "Section Editor",
"section-author": "Section Author"
};
- this.isAnnotation = function (type) {
+
+ this.isAnnotation = function(type) {
return this._annotationTypes[type] !== undefined;
};
- this.isParagraphish = function (node) {
+
+ this.isParagraphish = function(node) {
for (var i = 0; i < node.childNodes.length; i++) {
var el = node.childNodes[i];
if (el.nodeType !== Node.TEXT_NODE && !this.isAnnotation(el.tagName.toLowerCase())) return false;
}
return true;
};
- this.test = function (xml, documentUrl) {
+
+ this.test = function(xml, documentUrl) {
/* jshint unused:false */
return true;
};
+
// Helpers
// --------
- this.getName = function (nameEl) {
+
+ this.getName = function(nameEl) {
if (!nameEl) return "N/A";
var names = [];
+
var surnameEl = nameEl.querySelector("surname");
var givenNamesEl = nameEl.querySelector("given-names");
var suffix = nameEl.querySelector("suffix");
+
if (givenNamesEl) names.push(givenNamesEl.textContent);
if (surnameEl) names.push(surnameEl.textContent);
if (suffix) return [names.join(" "), suffix.textContent].join(", ");
+
return names.join(" ");
};
- this.toHtml = function (el) {
+
+ this.toHtml = function(el) {
if (!el) return "";
var tmp = document.createElement("DIV");
tmp.appendChild(el.cloneNode(true));
return tmp.innerHTML;
};
- this.mmlToHtmlString = function (el) {
+
+ this.mmlToHtmlString = function(el) {
var html = this.toHtml(el);
html = html.replace(/<(\/)?mml:([^>]+)>/g, "<$1$2>");
return html;
};
- this.selectDirectChildren = function (scopeEl, selector) {
+
+ this.selectDirectChildren = function(scopeEl, selector) {
// Note: if the ':scope' pseudo class was supported by more browsers
// it would be the correct selector based solution.
// However, for now we do simple filtering.
@@ -116,57 +133,74 @@ NlmToLensConverter.Prototype = function () {
}
return result;
};
+
// ### The main entry point for starting an import
- this.import = function (input) {
+
+ this.import = function(input) {
var xmlDoc;
+
// Note: when we are using jqueries get("