Skip to content

Instantly share code, notes, and snippets.

@ctalau
ctalau / backspace_issue.html
Created August 20, 2014 13:06
Backspace key event cannot always be 'preventDefault'-ed
<html>
<body>
<div id="1" contenteditable="true">Welcome to Dockbook Support in oXygen.</div>
<script>
document.getElementById('1').onkeydown = function(e) {
if (e.keyCode == 8) {
e.preventDefault();
}
@ctalau
ctalau / keys.html
Last active August 29, 2015 14:05
Typed keys lost if the 'textInput' event handler takes too long
<html>
<body>
<div id="editor" onkeydown="logEvent(event);" onkeyup="logEvent(event);" onkeypress="logEvent(event);" contenteditable="true">Title.</div>
<div id="log"></div>
<script>
var html = editor.innerHTML;
editor.addEventListener('textInput', function(e) {
// Perform some lengthy computation.
var result = takesLong();
<?xml version="1.0" encoding="UTF-8"?>
<article xmlns="http://docbook.org/ns/docbook" version="5.0"
xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<title>Welcome to Docbook Support in oXygen</title>
</info>
<sect1>
<title>Inline Markup and Images</title>
<para>This sample shows that &lt;oXygen/&gt; can be used to edit dockbook<?oxy_delete author="Mary" timestamp="20120510T144707+0300" content=" " comment="We must not add extra spacing before and after punctuation marks."?>.</para>
<para>The <emphasis role="bold">following</emphasis>
<!DOCTYPE html>
<html>
<!--
Copyright 2007 The Closure Library Authors. All Rights Reserved.
Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<!--
-->
@ctalau
ctalau / main.xml
Last active September 16, 2016 11:13
Controlled values in oXygen XML Web Author
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="values.less"?>
<root choices="values2.xml">
<elementWithChoices/>
</root>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="gardenia">
<title>Gardenia</title>
<?oxy_insert_start author="Anonymous" timestamp="20161026T110114+0300"?>
<body>
<p>p</p>
<p/>
<p/>
<p/>
<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
xmlns:sqf="http://www.schematron-quickfix.com/validator/process"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:file="http://expath.org/ns/file"
xmlns:bin="http://expath.org/ns/binary">
<sch:pattern>
<sch:rule context="image">
<xsl:variable name="binary" select="file:read-binary(resolve-uri(@href, base-uri()))" as="xs:base64Binary"/>
<xsl:variable name="location" select="bin:find($binary,0,bin:hex('FFC0'))"/>
@ctalau
ctalau / attr-edit.css
Last active April 25, 2017 09:21
Edit attr
div {
background-color: red;
content: oxy_label(text, "Contract Number: ", styles, "width: 1.7in;color:white")
oxy_textfield(edit, '@contractNumber', columns, 15)
oxy_label(text, "Equipment Covered: ", styles, "width: 1.7in; text-align: right;color:white")
oxy_textArea(
edit, '@equipmentCovered',
contentType, 'text/plain',
rows, 3,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_izl_pgh_11b">
<title>asd</title>
<body>
<p>This is a fix
asssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</p>
</body>
</topic>