Skip to content

Commit

Permalink
add viewtextnote + viewtext
Browse files Browse the repository at this point in the history
  • Loading branch information
respinos committed Sep 18, 2023
1 parent 02a58fb commit 8f5ecad
Show file tree
Hide file tree
Showing 12 changed files with 1,724 additions and 28 deletions.
1 change: 1 addition & 0 deletions samples/scripts/textclass.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ async function processDLXS(req, res) {
// console.log(xmlData);
// }
if ( xmlData.indexOf('Location: ') > -1 ) {
console.log(xmlData);
let tmp = xmlData.match(/Location: (.*)$/si);
let domain = ( req.hostname == 'localhost' ) ? 'http://' : 'https://';
domain += req.hostname;
Expand Down
5 changes: 4 additions & 1 deletion src/js/text/handlers/item-page-navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ window.root = window;
const tocbot = require('tocbot');

window.addEventListener('DOMContentLoaded', (event) => {
if ( ! ( document.documentElement.dataset.view == 'image' || document.documentElement.dataset.view == 'static' ) ) {
if ( ! (
document.documentElement.dataset.view == 'image' ||
document.documentElement.dataset.view == 'static' ||
document.documentElement.dataset.view == 'text' ) ) {
return ;
}

Expand Down
8 changes: 8 additions & 0 deletions styles/text/text.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.fullview-page p {
white-space: pre-line;
}

.fullview-page + .fullview-page {
padding-top: 2rem;
border-top: 2px solid var(--color-neutral-100);
}
4 changes: 2 additions & 2 deletions templates/text/qbat/qbat.header.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<xsl:template name="build-collection-heading">
<xsl:variable name="header" select="//qui:header[@role='main']" />
<div class="flex flex-space-between">
<div class="flex flex-space-between flex-align-center">
<h1 class="collection-heading mb-0">
<xsl:if test="normalize-space($header/@data-badge)">
<span class="material-icons" aria-hidden="true">
Expand All @@ -52,7 +52,7 @@
</h1>
<form>
<div class="flex flex-align-center gap-0_5">
<label for="q1">Search in this text: </label>
<label for="q1" style="text-wrap: nowrap">Search in this text: </label>
<input type="text" id="q1" name="q1" />
<button class="button button--small">Search</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/text/qbat/qbat.pageviewer.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
<xsl:with-param name="icon">link</xsl:with-param>
<xsl:with-param name="data-attributes">
<qbat:attribute name="data-value">
<xsl:value-of select="//CurrentUrl" />
<xsl:value-of select="//qui:field[@key='bookmark']//qui:value" />
</qbat:attribute>
</xsl:with-param>
</xsl:call-template>
Expand Down
98 changes: 98 additions & 0 deletions templates/text/qbat/qbat.text.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:qui="http://dlxs.org/quombat/ui" xmlns:qbat="http://dlxs.org/quombat/quombat" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dlxs="http://dlxs.org" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">

<xsl:template name="build-extra-scripts">

<script>
window.mUse = window.mUse || [];
</script>


<link rel="stylesheet" href="{$docroot}styles/text/pageviewer.css" />
<link rel="stylesheet" href="{$docroot}styles/text/text.css" />

<xsl:call-template name="build-entry-scripts" />

</xsl:template>

<xsl:template name="build-entry-scripts" />

<xsl:template name="build-extra-main-class">
<xsl:text>[ mt-0 ]</xsl:text>
</xsl:template>

<xsl:template match="qui:main">

<xsl:call-template name="build-navigation" />

<xsl:call-template name="build-page-heading" />

<div class="[ flex flex-flow-rw ][ aside--wrap ]">

<div class="[ aside ]">
<nav class="[ page-index ]" xx-aria-labelledby="page-index-label">
<h2 id="page-index-label" class="[ subtle-heading ][ text-black js-toc-ignore ]">Page Index</h2>
<div class="toc js-toc"></div>
<select id="action-page-index"></select>
</nav>
</div>

<div class="[ main-panel ]">

<xsl:call-template name="build-item-header" />

<xsl:apply-templates select="//qui:block[@slot='content']" />

</div>
</div>

</xsl:template>

<xsl:template name="build-navigation">
<xsl:call-template name="build-breadcrumbs" />
</xsl:template>

<xsl:template name="build-page-heading">
<h1 class="collection-heading--small">
<!-- <xsl:value-of select="//qui:header[@role='main']" /> -->
<xsl:apply-templates select="//qui:header[@role='main']" mode="build-title" />
</h1>
</xsl:template>

<xsl:template name="build-item-header">
<xsl:apply-templates select="//qui:block[@slot='metadata']/qui:section" />
</xsl:template>

<xsl:template match="qui:block[@slot='content']">
<section class="[ records ]">
<h2 class="subtle-heading">Pages</h2>
<xsl:apply-templates select="qui:section/qui:div"></xsl:apply-templates>
</section>
</xsl:template>

<xsl:template match="qui:div[@class='page']">
<div class="fullview-page">
<h3 class="[ xx-subtle-heading ]" id="{@id}">
<a href="{qui:nav/qui:link/@href}">
<xsl:value-of select="qui:nav/qui:link" />
</a>
</h3>
<xsl:apply-templates mode="copy" />
</div>
</xsl:template>

<xsl:template match="qui:div/qui:nav" mode="copy" />

<xsl:template match="qui:section" priority="101">
<!-- <xsl:if test="@name != 'default'">
<h3 id="{@slug}"><xsl:value-of select="@name" /></h3>
</xsl:if>
<xsl:if test="@name = 'default'">
<h3 id="record_details">Record Details</h3>
</xsl:if> -->
<h2 class="subtle-heading">About this Item</h2>
<dl class="record" data-message="wtf">
<xsl:apply-templates />
</dl>
</xsl:template>
</xsl:stylesheet>
55 changes: 55 additions & 0 deletions templates/text/qbat/qbat.viewtextnote.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:qui="http://dlxs.org/quombat/ui" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dlxs="http://dlxs.org" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">

<xsl:template match="qui:root">
<html lang="en" data-root="{$docroot}" data-username="{$username}">
<xsl:apply-templates select="qui:head" />
<body class="[ font-base-family ]">

<main data-page="form">
<div class="modal--overlay"></div>
<div class="modal">
<xsl:apply-templates select="//qui:main" />
</div>
</main>
</body>
</html>
</xsl:template>

<xsl:template name="build-cqfill-script"></xsl:template>

<xsl:template match="qui:main">
<xsl:apply-templates select="qui:header[@role='main']" />
<xsl:apply-templates select="qui:block[@slot='blurb']" />
<xsl:call-template name="build-modal-controls" />
</xsl:template>

<xsl:template match="qui:header[@role='main']">
<div class="[ modal--header ][ flex flex-flow-row ][ flex-space-between flex-gap-1 ]">
<h1 class="collection-heading--small">
<xsl:apply-templates />
</h1>
<!-- <xsl:call-template name="build-modal-dismiss-action" /> -->
</div>
</xsl:template>

<xsl:template match="qui:block[@slot='blurb']">
<blockquote>
<xsl:apply-templates mode="copy" />
</blockquote>
</xsl:template>

<xsl:template name="build-modal-controls">
<div class="modal--footer">
<button class="button button--large button--secondary" data-action="cancel">Cancel</button>
<a class="button button--large button--primary" href="{//qui:nav/qui:link[@rel='text']/@href}">
<xsl:value-of select="//qui:nav/qui:link[@rel='text']" />
</a>
</div>
</xsl:template>

<xsl:template name="build-extra-styles">
<link rel="stylesheet" href="{$docroot}styles/modals.css" />
</xsl:template>

</xsl:stylesheet>
Loading

0 comments on commit 8f5ecad

Please sign in to comment.