Skip to content

Instantly share code, notes, and snippets.

@wsalesky
wsalesky / desc.xhtml
Last active March 8, 2024 14:01
TinyMCE XSLTForms nested repeats
<?xml-stylesheet href="xsl/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:rte="http://www.agencexml.com/xsltforms/rte" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsltforms="http://www.agencexml.com/xsltforms" lang="en">
<head>
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover"/>
<title>TinyMCE Support</title>
<style type="text/css">
.large-textarea textarea {
font-family: Courier, sans-serif;
height: 10em;
width: 500px;
@wsalesky
wsalesky / index.xhtml
Created January 15, 2024 16:14
XSLTForms tinyMCE subforms example
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:rte="http://www.agencexml.com/xsltforms/rte" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:srophe="https://srophe.app" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:local="http://syriaca.org/ns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sc="http://www.ascc.net/xml/schematron" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsltforms="http://www.agencexml.com/xsltforms" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<link rel="shortcut icon" href="resources/images/hn/favicon-16.png"/>
<title>Edit MS TEI Records</title>
<script type="text/javascript" src="/exist/apps/xsltforms/scripts/tinymce_4
@wsalesky
wsalesky / tinymceExample2.xhtml
Created January 2, 2024 23:54
XSLTForms TinyMCE dynamic content example
<?xml-model href="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_ms.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<data>
<summary>irec2 Summary 1</summary>
<summary>irec2 Summary 2</summary>
</data>
</TEI>
@wsalesky
wsalesky / tinymceExample.xhtml
Created January 2, 2024 23:33
XSLTForms multiple tinymce editors in a single form.
<?xml-stylesheet href="xsl/xsltforms.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsltforms="http://www.agencexml.com/xsltforms"
xmlns:rte="http://www.agencexml.com/xsltforms/rte" lang="en">
<head>
<meta name="viewport" content="initial-scale=1, width=device-width, viewport-fit=cover" />
<title>TinyMCE Support</title>
<style type="text/css">
.large-textarea textarea {
@wsalesky
wsalesky / 52938328347.json
Created August 30, 2023 15:40
Test IIIF manifest
{
"@context": "http://iiif.io/api/presentation/2/context.json",
"@id": "https://architecturasinica.org/iiif/manifest/gallery/52938328347/52938328347.json",
"@type": "sc:Manifest",
"label": "jiashan 假山",
"description": "jiashan of yellow stone, &amp;quot;Yungang,&amp;quot; Wangshiyuan (Master of the Nets Garden), Qing dynasty, Suzhou, Jiangsu Province, detail showing interior &amp;quot;grotto&amp;quot; 網師園雲崗假山, 局部,黃石下有洞,江蘇省蘇州(photo: Jin Yinuo 金一諾, 2023)",
"attribution": "Architectura Sinica",
"metadata": [
{
"label": "Title",
@wsalesky
wsalesky / move.xhtml
Created January 26, 2022 13:55
Testing XSLTForms and HTML5 drag and drop functionality.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<head>
<title>Insert with Origin</title>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', (event) => {
function handleDragStart(e) {
this.style.opacity = '0.4';
dragSrcEl = this;
@wsalesky
wsalesky / xformsRepeats.xhtml
Created February 1, 2022 01:17
XForms repeats following XML document order.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<head>
<title>Insert with Origin</title>
<style type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
body {font-family:Helvetica, sans-serif}
</style>
<xf:model>
<xf:instance id="i-rec">
<TEI xmlns="http://www.tei-c.org/ns/1.0">
@wsalesky
wsalesky / placeNames.xml
Created March 26, 2020 15:53
Generated Place names.
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:srophe="https://srophe.app">
<text>
<body>
<listPlace>
<place>
<idno>https://pleiades.stoa.org/places/520998</idno>
<placeName srophe:tags="#headword">Constantinopolis</placeName>
<desc>Capital city of the Eastern Roman Empire, the Latin, and the Ottoman
Empires founded by Constantine I in AD 330. </desc>
<location type="gps">
@wsalesky
wsalesky / git-sync.xql
Last active August 19, 2019 08:58
Sync remote eXistdb with github repository automatically using github webhooks.
xquery version "3.0";
(:module namespace gitsync = "http://syriaca.org/ns/gitsync";:)
(:~
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests.

: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. 

:
: Secret can be stored as environmental variable.
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app.
@wsalesky
wsalesky / git-sync-v2.xql
Created November 30, 2017 18:57
Update git-sync XQuery to use eXistdb's native JSON parser.
xquery version "3.1";
(:~
: Webhook endpoint for tcadrt.com data repository, /master/ branch:
: XQuery endpoint to respond to Github webhook requests. Query responds only to push requests from the master branch.

: The EXPath Crypto library supplies the HMAC-SHA1 algorithm for matching Github secret. 

:
: Secret can be stored as environmental variable.
: Will need to be run with administrative privileges, suggest creating a git user with privileges only to relevant app.
: