From 72141fd67003dbd62e94a507169d88e9f13bf1da Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Sat, 29 Oct 2011 14:15:21 +1100 Subject: [PATCH] Initial commit for public release. --- Demo.html | 74 +++ License.txt | 19 + Makefile | 14 + Readme.md | 306 ++++++++++ build/document.html | 57 ++ build/squire.js | 1 + source/Editor.js | 1326 ++++++++++++++++++++++++++++++++++++++++++ source/Node.js | 452 ++++++++++++++ source/Range.js | 410 +++++++++++++ source/document.html | 57 ++ 10 files changed, 2716 insertions(+) create mode 100644 Demo.html create mode 100644 License.txt create mode 100644 Makefile create mode 100644 Readme.md create mode 100644 build/document.html create mode 100644 build/squire.js create mode 100644 source/Editor.js create mode 100644 source/Node.js create mode 100644 source/Range.js create mode 100644 source/document.html diff --git a/Demo.html b/Demo.html new file mode 100644 index 0000000..ca1f350 --- /dev/null +++ b/Demo.html @@ -0,0 +1,74 @@ + + + + + HTML Editor Test + + + + +

HTML Editor Test

+
+

This is a really simple demo, with the most trivial of UI integrations

+

+ Bold + Unbold + Italic +        + Unitalic + Underline + Deunderline +        + Font size + Font face +

+

+ Quote + Dequote +        + List + Unlist +        + Insert image +        + Undo + Redo +

+
+ + + diff --git a/License.txt b/License.txt new file mode 100644 index 0000000..c5f4f6b --- /dev/null +++ b/License.txt @@ -0,0 +1,19 @@ +Copyright © 2011 by Neil Jenkins + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5bb70d8 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +.PHONY: build clean + +clean: + rm -rf build + +build: build/squire.js build/document.html + +build/squire.js: source/Node.js source/Range.js source/Editor.js + mkdir -p $(@D) + cat $^ | uglifyjs > $@ + +build/document.html: source/document.html + mkdir -p $(@D) + cp $^ $@ \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..ce4761e --- /dev/null +++ b/Readme.md @@ -0,0 +1,306 @@ +Squire +====== + +Squire is an HTML5 rich text editor, which provides powerful cross-browser normalisation, whilst being supremely lightweight and flexible. It is built for the present and the future, and as such does not support ancient browsers. I'd guess it should work fine back to around Opera 10, Firefox 3.5, Safari 4, Chrome 9 and IE9, but I only test in the latest version of each of these browsers. Adding IE8 support should be possible by patching IE8 to support the W3C Range and TreeWalker APIs; patches are welcome. I am not interested in support for IE7 or below. + +Unlike other HTML5 rich text editors, squire was written as a component for writing documents (emails, essays, etc.), not doing wysiwyg websites. If you are looking for support for inserting form controls or flash components or the like, you'll need to look elsewhere. However for many purposes, Squire may be just what you need, providing the power without the bloat. The key features are: + +### Lightweight ### + +* Only 7KB of JS after minification and gzip (25KB before gzip). +* Does not include its own XHR wrapper, widget library or lightbox overlays. +* No dependencies. +* No UI for a toolbar is supplied, allowing you to integrate seamlessly with the + rest of your application and lose the bloat of having two UI toolkits loaded. + Instead, you get a component you can drop in in place of a `