diff --git a/LICENSE b/LICENSE index 5adcdb5a..f5d8e500 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2009 XING AG +Copyright (C) 2011 XING AG This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version. diff --git a/Makefile b/Makefile index 217cc540..f704e66b 100644 --- a/Makefile +++ b/Makefile @@ -2,41 +2,51 @@ VERSION = $(shell cat version.txt) JS_OUTPUT = "dist/wysihtml5-${VERSION}.js" -JS_FILES = lib/rangy/rangy-core.js \ - lib/rangy/rangy-cssclassapplier-wysihtml5.js \ - src/wysihtml5.js \ - src/browser_support.js \ - src/utils/auto_focus.js \ - src/utils/auto_link.js \ - src/utils/caret.js \ - src/utils/contains.js \ - src/utils/convert_into_list.js \ - src/utils/copy_styles.js \ - src/utils/copy_attributes.js \ - src/utils/get_in_dom_element.js \ - src/utils/get_parent_element.js \ - src/utils/get_style.js \ - src/utils/has_element_with_tag_name.js \ - src/utils/has_element_with_class_name.js \ - src/utils/insert_rules.js \ - src/utils/observe.js \ - src/utils/resolve_list.js \ - src/utils/rename_element.js \ - src/utils/remove_empty_text_nodes.js \ - src/utils/sandbox.js \ - src/utils/sanitize_html.js \ - src/utils/simulate_placeholder.js \ - src/utils/synchronizer.js \ - src/utils/text_content.js \ - src/utils/unwrap.js \ +JS_FILES = src/wysihtml5.js \ + lib/rangy/rangy-core.js \ + lib/base/base.js \ + src/browser.js \ + src/lang/array.js \ + src/lang/dispatcher.js \ + src/lang/object.js \ + src/lang/string.js \ + src/dom/auto_link.js \ + src/dom/class.js \ + src/dom/contains.js \ + src/dom/convert_to_list.js \ + src/dom/copy_attributes.js \ + src/dom/copy_styles.js \ + src/dom/delegate.js \ + src/dom/get_as_dom.js \ + src/dom/get_parent_element.js \ + src/dom/get_style.js \ + src/dom/has_element_with_tag_name.js \ + src/dom/has_element_with_class_name.js \ + src/dom/insert.js \ + src/dom/insert_css.js \ + src/dom/observe.js \ + src/dom/parse.js \ + src/dom/remove_empty_text_nodes.js \ + src/dom/rename_element.js \ + src/dom/replace_with_child_nodes.js \ + src/dom/resolve_list.js \ + src/dom/sandbox.js \ + src/dom/set_attributes.js \ + src/dom/set_styles.js \ + src/dom/simulate_placeholder.js \ + src/dom/text_content.js \ src/quirks/clean_pasted_html.js \ src/quirks/ensure_proper_clearing.js \ + src/quirks/get_correct_inner_html.js \ src/quirks/insert_line_break_on_return.js \ src/quirks/redraw.js \ + src/selection/selection.js \ + src/selection/html_applier.js \ src/views/view.js \ src/views/composer.js \ src/views/composer.style.js \ src/views/composer.observe.js \ + src/views/synchronizer.js \ src/views/textarea.js \ src/toolbar/dialog.js \ src/toolbar/speech.js \ @@ -60,6 +70,20 @@ JS_FILES = lib/rangy/rangy-core.js \ src/commands/underline.js \ src/editor.js -all: +all: bundle minify + +bundle: + @@echo "Bundling..." + @@touch ${JS_OUTPUT} @@rm ${JS_OUTPUT} - @@cat ${JS_FILES} >> ${JS_OUTPUT} \ No newline at end of file + @@cat ${JS_FILES} >> ${JS_OUTPUT} + @@cat ${JS_OUTPUT} | sed "s/@VERSION/${VERSION}/" > "${JS_OUTPUT}.tmp" + @@mv "${JS_OUTPUT}.tmp" ${JS_OUTPUT} + +minify: + @@echo "Minifying... (this requires node.js)" + @@node build/minify.js ${JS_OUTPUT} + @@echo "Done." + +unittest: + @@open test/index.html diff --git a/README.textile b/README.textile index 22d19ada..a47820a6 100644 --- a/README.textile +++ b/README.textile @@ -1,8 +1,9 @@ -h1. wysihtml5 0.1.0 +h1. wysihtml5 0.2.0 wysihtml5 is an open source rich text editor based on HTML5 technology and the progressive-enhancement approach. -It uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag-soups and inline-styles. -The editor is already in production use on "XING.com":https://www.xing.com - a social network with more than 10 million members. +It uses a sophisticated security concept and aims to generate fully valid HTML5 markup by preventing unmaintainable tag soups and inline styles. +The code is completely library agnostic: No jQuery, Prototype or similar is required. +The editor is already in use on "XING.com":https://www.xing.com - a social network with more than 10 million members. h2. Features: @@ -15,6 +16,7 @@ h2. Features: * Source code view for users with HTML skills * Uses sandboxed iframes in order to prevent identity theft through XSS * Editor inherits styles and attributes (placeholder, autofocus, ...) from original textarea (you only have to style one element) +* Speech-input for Chrome 11+ h2. Browser Support @@ -44,7 +46,7 @@ Following is a list of all configuration options with their corresponding defaul // Object which includes parser rules (set this to examples/rules/spec.json or your own spec, otherwise only span tags are allowed!) parserRules: null, // Parser method to use when the user inserts content via copy & paste - parser: wysihtml5.utils.sanitizeHTML || Prototype.K, + parser: wysihtml5.dom.parse || Prototype.K, // Class name which should be set on the contentEditable element in the created sandbox iframe, can be styled via the 'stylesheets' option composerClassName: "wysihtml5-editor", // Class name to add to the body when the wysihtml5 editor is supported @@ -113,6 +115,20 @@ copied to the hidden