Commit dae7512b authored by Jérôme Chauveau's avatar Jérôme Chauveau
Browse files

css & xsl : suite.

parent ffce4ca4
Loading
Loading
Loading
Loading
+22 −8
Changes for certic.xsl: 22 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xs="http://www.w3.org/1999/XSL/Transform"
                xmlns:xsl-="http://www.w3.org/1999/XSL/Transform"
                exclude-result-prefixes="xlink mml">


@@ -118,14 +119,13 @@
        <section class="front">

            <div class="button-tabs">
                <button id="tabtn-toc" class="tab-btn focus-tab" onclick="openTab('toc')">Table of contents</button>
                <button id="tabtn-refs" class="tab-btn" onclick="openTab('refs')">References</button>
                <button id="tabtn-toc" class="tab-btn focus-tab" onclick="openTab('toc')">Table des matières</button>
                <button id="tabtn-refs" class="tab-btn" onclick="openTab('refs')">Références</button>
                <button id="tabtn-footnotes" class="tab-btn" onclick="openTab('footnotes')">Notes</button>
                <button id="tabtn-metas" class="tab-btn" onclick="openTab('metas')">?</button>
                <button id="tabtn-metas" class="tab-btn" onclick="openTab('metas')">i</button>
            </div>

            <div id="toc" class="meta-tab">
                <h2>Table of contents</h2>
            <div id="toc" class="content-tab">
                <div id="toc-contents">

                    <ol>
@@ -139,7 +139,7 @@
                </div>
            </div>

            <div id="refs" class="meta-tab" style="display:none">
            <div id="refs" class="content-tab" style="display:none">
                <ul>
                    <xsl:for-each select="../back//ref">
                        <xsl:apply-templates select="."/>
@@ -147,7 +147,7 @@
                </ul>
            </div>

            <div id="footnotes" class="meta-tab" style="display:none">
            <div id="footnotes" class="content-tab" style="display:none">
                <ul>
                    <xsl:for-each select="../back//fn">
                        <xsl:apply-templates select="."/>
@@ -155,7 +155,7 @@
                </ul>
            </div>

            <div id="metas" class="meta-tab" style="display:none">
            <div id="metas" class="content-tab" style="display:none">
                <div>
                    <xsl:apply-templates select="./journal-meta"/>
                    <xsl:apply-templates select="./article-meta"/>
@@ -208,6 +208,10 @@
    <xsl:template name="sec-toc-item">
        <xsl:param name="item"/>
        <li>
            <a role="button">
                <xsl:attribute name="href">
                    <xsl:value-of select="concat('#title-', count(preceding::title))"/>
                </xsl:attribute>
                <xsl:value-of select="$item/title"/>
                <xsl:if test="count($item/sec)>=1">
                    <ol>
@@ -218,6 +222,7 @@
                        </xsl:for-each>
                    </ol>
                </xsl:if>
            </a>
        </li>

    </xsl:template>
@@ -308,25 +313,34 @@
        <xsl:variable name="ancestors">
            <xs:value-of select="count(ancestor::sec)"/>
        </xsl:variable>

        <xsl:variable name="n">
            <xs:value-of select="count(preceding::title)"/>
        </xsl:variable>

        <xsl:choose>
            <xsl:when test="$ancestors=1">
                <h2>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h2>
            </xsl:when>
            <xsl:when test="$ancestors=2">
                <h3>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h3>
            </xsl:when>

            <xsl:when test="$ancestors=3">
                <h4>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h4>
            </xsl:when>
            <xsl:otherwise>
                <h5>
                    <xsl:attribute name="id"><xsl-:value-of select="concat('title-',$n)"/></xsl:attribute>
                    <xsl:apply-templates></xsl:apply-templates>
                </h5>
            </xsl:otherwise>
+6 −2
Changes for resources/javascript/xml2html.js: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ window.addEventListener('DOMContentLoaded', (event) => {

function openTab(tabName) {
    let i;
    let tabs = document.querySelectorAll(".meta-tab");
    let tabs = document.querySelectorAll(".content-tab");
    for (i = 0; i < tabs.length; i++) {
        tabs[i].style.display = "none";
    }
@@ -27,6 +27,7 @@ function openTab(tabName) {
    document.getElementById('tabtn-' + tabName).classList.add('focus-tab');
}


function darkMode(bool) {
    if (bool) {
        document.getElementById('moon').style.display = "block";
@@ -43,7 +44,10 @@ function bindFootnotes() {
        fnc.addEventListener('click', () => {
            openTab('footnotes');
            console.log(fnc.dataset.target);
            document.getElementById(fnc.dataset.target).scrollIntoView();
            document.getElementById(fnc.dataset.target).scrollIntoView({
                block :'center',
                behavior: "smooth"
            });
            document.querySelectorAll('.footnote').forEach((fn) => fn.classList.remove('focus'));
            document.getElementById(fnc.dataset.target).classList.add('focus');
        })
+50 −9
Changes for resources/styles/article.css: 50 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -3,19 +3,24 @@
    --dark-theme-txt: #adbac7;
    --nav-height: 4em;
    --third-color : #0a84ff;
    --right-width: 35%;
    --btn-tabs-height: 40px;
}


/** temp addons (if jatsParser enabled)*/
.jatsParser__meta, #jatsParserFullText > h2, #jatsParserFullText > p  {
.jatsParser__meta, #jatsParserFullText > h2, #jatsParserFullText > p, .usernav,.journal_branding, .jatsParser__cover-wrapper {
    display: none;
}
/***************************************/


header,section.authors, section.abstract, h1.page_title, h2.subtitle, .pkp_structure_footer_wrapper, .entry_details {
/* hides pkp ojs stuff */
#navigationUserWrapper, section.item, .cmp_skip_to_content, .pkp_navigation_primary_row, .pkp_site_name_wrapper,
.entry_details, .pkp_brand_footer{
    display:none;
}


*{
    /*border-width: 0;*/
    margin: 0;
@@ -39,6 +44,7 @@ nav {
    width: 100%;
    border-bottom : 1px solid black;
    background-color: white;
    box-sizing: border-box;
}

body.dark nav{
@@ -72,8 +78,9 @@ body.dark{
}

.wrap {
    padding: calc(var(--nav-height)) 20px 0px 20px;
    padding-top: calc(var(--nav-height));
    font-family: "Noto Sans",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;
    border-top: 1px solid black;
}

section.back{
@@ -97,10 +104,10 @@ section.back{
}

.right-contents {
    width: 35%;
    width: var(--right-width);
    position: fixed;
    right:0px;
    top: calc(var(--nav-height) + 1px);
    top: calc(var(--nav-height));
    overflow-y: auto;
    scrollbar-width: thin;
    height: calc(100vh - var(--nav-height));
@@ -134,10 +141,16 @@ section.front ol, section.front ol {

.button-tabs{
    border-bottom : 1px solid black;
    position: fixed;
    width: var(--right-width);
    height: var(--btn-tabs-height);
    z-index: 1;
    background-color: white;
}

.dark .button-tabs {
    border-bottom: 1px solid var(--dark-theme-txt);
    background-color: var(--dark-theme-bg);
}

.tab-btn{
@@ -147,7 +160,17 @@ section.front ol, section.front ol {
    cursor: pointer;
    border: none;
    font-weight: bold;
    height: var(--btn-tabs-height);
    border-right:1px solid black;
}
.dark .tab-btn {
    border-right:1px solid var(--dark-theme-txt);
}

.content-tab{
    padding-top: var(--btn-tabs-height);
}

.focus-tab{
    background-color: black;
    color: white;
@@ -249,6 +272,19 @@ section.body h3:before{
    content: counter(section)"."counter(subsection)" ";
}

/************/

#toc li {
    margin-top:5px;
}
#toc a {
    color: black;
    text-decoration: none;
}

.dark #toc a {
    color: var(--dark-theme-txt);
}

/***********/
span.fn-call {
@@ -264,14 +300,13 @@ span.fn-call {
}

#footnotes li{
    margin-bottom:10px;
    box-sizing: border-box;
    padding: 10px;
    padding: 20px 10px 20px 10px;
    border-bottom: 1px solid #888;
}

#footnotes li.focus{
    border: 1px solid var(--third-color);
    border-right: 5px solid var(--third-color);
}

#footnotes li .label {
@@ -297,3 +332,9 @@ span.fn-call {
.dark #footnotes li, .dark .mixed-citation {
    border-bottom: 1px solid var(--dark-theme-txt);
}

/******************************************/
.journal-meta {
    padding: 10px;
}