0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-31 03:08:46 -05:00
Squire/Demo.html
Matthew Borden 97a75e92ac Attempt: Drop.js Working
Attempting to get Drop.js Working with multiple elements.
2014-07-07 17:46:17 +10:00

92 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="UTF-8">
<title>HTML Editor Test</title>
<style type="text/css" media="screen">
body {
position:relative;
margin:0 auto;
padding:50px;
width:540px;
font:400 14px/1.24 helvetica,arial,sans-serif;
text-shadow:0 1px 0 #fff;
}
iframe {
border: none;
}
h1 {
font-size:1.95em
}
span {
cursor:pointer;
text-decoration:underline
}
p {
margin:5px 0
}
</style>
<!--[if IE 8]>
<script type="text/javascript" src="build/ie8.js"></script>
<![endif]-->
<script type="text/javascript" charset="utf-8">
var editor;
document.addEventListener( 'click', function ( e ) {
var id = e.target.id,
value;
if ( id && editor && editor[ id ] ) {
if ( e.target.className === 'prompt' ) {
value = prompt( 'Value:' );
}
editor[ id ]( value );
}
}, false );
</script>
</head>
<body>
<h1>HTML Editor Test</h1>
<header>
<p>This is a really simple demo, with the most trivial of UI integrations</p>
<p>
<span id="bold2">Bold</span>
<span id="removeBold">Unbold</span>
<span id="italic">Italic</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="removeItalic">Unitalic</span>
<span id="underline">Underline</span>
<span id="removeUnderline">Deunderline</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="setFontSize" class="prompt">Font size</span>
<span id="setFontFace" class="prompt">Font face</span>
</p>
<p>
<span id="setTextColour" class="prompt">Text colour</span>
<span id="setHighlightColour" class="prompt">Text highlight</span>
<span id="makeLink" class="prompt">Link</span>
</p>
<p>
<span id="increaseQuoteLevel">Quote</span>
<span id="decreaseQuoteLevel">Dequote</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="makeUnorderedList">List</span>
<span id="removeList">Unlist</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="insertImage" class="prompt">Insert image</span>
<span id="setHTML" class="prompt">Set HTML</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span id="undo">Undo</span>
<span id="redo">Redo</span>
</p>
</header>
<iframe src="build/Squire-UI.html" width="500" height="300"></iframe>
<iframe src="build/document.html" onload="top.editor=this.contentWindow.editor" width="500" height="500"></iframe>
</body>
</html>