Skip to content

Commit

Permalink
Merge pull request #332 from Voog/v0_6
Browse files Browse the repository at this point in the history
Version 0.6
  • Loading branch information
Oliver Pulges committed May 13, 2016
2 parents e6e9fdf + 0d9da7f commit e5e8729
Show file tree
Hide file tree
Showing 204 changed files with 16,863 additions and 31,267 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
*wysihtml 0.6.0 (May 13 , 2016) (BREAKING CHANGES)
* Object namespace is now wysihtyml (was previously wysihtml5)
* Restructures code into separate modules, so users can build their own bundle of needed features (wysihtml-toolbar.js all bundle no longer present)
* Fixes problems when bundling code by removing conflicting internal bundled UMD wrappers
* Reduced size by removing some IE8 only targeting code.

*wysihtml5x 0.5.5* (January 6, 2016)
* Fixes some editing issues with IE proprietary control selection

Expand Down
193 changes: 66 additions & 127 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,132 +1,38 @@
module.exports = function(grunt) {

"use strict";
'use strict';

// List required source files that will be built into wysihtml5x.js
// List required source files that will be built into wysihtml.js
var base = [
"src/wysihtml5.js",
"src/polyfills.js",
"node_modules/rangy/lib/rangy-core.js",
"node_modules/rangy/lib/rangy-textrange.js",
"node_modules/rangy/lib/rangy-selectionsaverestore.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/dom_node.js",
"src/dom/get_as_dom.js",
"src/dom/get_parent_element.js",
"src/dom/get_style.js",
"src/dom/get_textnodes.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/line_breaks.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/contenteditable_area.js",
"src/dom/set_attributes.js",
"src/dom/set_styles.js",
"src/dom/simulate_placeholder.js",
"src/dom/text_content.js",
"src/dom/get_attribute.js",
"src/dom/get_attributes.js",
"src/dom/is_loaded_image.js",
"src/dom/table.js",
"src/dom/query.js",
"src/dom/compare_document_position.js",
"src/dom/unwrap.js",
"src/dom/get_pasted_html.js",
"src/dom/remove_invisible_spaces.js",
"src/quirks/clean_pasted_html.js",
"src/quirks/ensure_proper_clearing.js",
"src/quirks/get_correct_inner_html.js",
"src/quirks/redraw.js",
"src/quirks/table_cells_selection.js",
"src/quirks/style_parser.js",
"src/selection/selection.js",
"src/selection/html_applier.js",
"src/commands.js",
"src/commands/bold.js",
"src/commands/createLink.js",
"src/commands/removeLink.js",
"src/commands/fontSize.js",
"src/commands/fontSizeStyle.js",
"src/commands/foreColor.js",
"src/commands/foreColorStyle.js",
"src/commands/bgColorStyle.js",
"src/commands/formatBlock.js",
"src/commands/formatCode.js",
"src/commands/formatInline.js",
"src/commands/insertBlockQuote.js",
"src/commands/insertHTML.js",
"src/commands/insertImage.js",
"src/commands/insertLineBreak.js",
"src/commands/insertOrderedList.js",
"src/commands/insertUnorderedList.js",
"src/commands/insertList.js",
"src/commands/italic.js",
"src/commands/justifyCenter.js",
"src/commands/justifyLeft.js",
"src/commands/justifyRight.js",
"src/commands/justifyFull.js",
"src/commands/alignRightStyle.js",
"src/commands/alignLeftStyle.js",
"src/commands/alignCenterStyle.js",
"src/commands/alignJustifyStyle.js",
"src/commands/redo.js",
"src/commands/underline.js",
"src/commands/undo.js",
"src/commands/createTable.js",
"src/commands/mergeTableCells.js",
"src/commands/addTableCells.js",
"src/commands/deleteTableCells.js",
"src/commands/indentList.js",
"src/commands/outdentList.js",
"src/commands/subscript.js",
"src/commands/superscript.js",
"src/undo_manager.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/sourceview.js",
"src/views/textarea.js",
"src/editor.js"
];

// List of optional source files that will be built to wysihtml5x-toolbar.js
var toolbar = [
"src/toolbar/dialog.js",
"src/toolbar/speech.js",
"src/toolbar/toolbar.js",
"src/toolbar/dialog_createTable.js",
"src/toolbar/dialog_foreColorStyle.js",
"src/toolbar/dialog_fontSizeStyle.js"
'src/wysihtml.js',
'src/polyfills.js',
'lib/base/base.js',
'lib/rangy/rangy-core.js',
'lib/rangy/rangy-selectionsaverestore.js',
'lib/rangy/rangy-textrange.js',
'src/browser.js',
'src/lang/*.js',
'src/dom/*.js',
'src/quirks/*js',
'src/selection/selection.js',
'src/commands.js',
'src/core-commands/*.js',
'src/undo_manager.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/sourceview.js',
'src/views/textarea.js',
'src/editor.js'
];

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';',
process: function(src, filepath) {
return src.replace(/@VERSION/g, grunt.config.get('pkg.version'));
}
Expand All @@ -135,9 +41,9 @@ module.exports = function(grunt) {
src: base,
dest: 'dist/<%= pkg.name %>.js'
},
toolbar: {
src: base.concat(toolbar),
dest: 'dist/<%= pkg.name %>-toolbar.js'
extraCommands: {
src: 'src/extra-commands/*.js',
dest: 'dist/<%= pkg.name %>.all-commands.js'
}
},
uglify: {
Expand All @@ -147,22 +53,55 @@ module.exports = function(grunt) {
},
build: {
files: {
'dist/<%= pkg.name %>.min.js': 'dist/<%= pkg.name %>.js',
'dist/<%= pkg.name %>-toolbar.min.js': 'dist/<%= pkg.name %>-toolbar.js'
'dist/minified/<%= pkg.name %>.min.js': 'dist/<%= pkg.name %>.js',
'dist/minified/<%= pkg.name %>.all-commands.min.js': 'dist/<%= pkg.name %>.all-commands.js'
}
}
},
open: {
test: {
path: 'test/index.html'
}
test: {
path: 'test/index.html'
}
}
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-open');
grunt.registerTask('build-modules', 'Builds all extension files', function() {
var concat = {},
uglify = {};

grunt.file.expand('./src/extensions/*').forEach(function (d) {
var dir = d.split('/').pop();

if (!grunt.file.isDir(d)) {
var fnameArr = dir.split('.');
fnameArr.pop();
dir = fnameArr.join('.');
}

concat[dir] = {
src: grunt.file.isDir(d) ? [d + '/*.js'] : [d],
dest: 'dist/wysihtml.' + dir + '.js'
};

uglify[dir] = {
options: {
sourceMap: true
},
files: {
['dist/minified/wysihtml.' + dir + '.min.js']: 'dist/wysihtml.' + dir + '.js'
}
};

});
grunt.config.set('concat', concat);
grunt.task.run('concat');
grunt.config.set('uglify', uglify);
grunt.task.run('uglify');
});

grunt.registerTask('default', ['concat', 'uglify']);
grunt.registerTask('default', ['concat', 'uglify', 'build-modules']);
grunt.registerTask('test', ['open:test']);
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (C) 2012-2014 XING AG, Voog and contributors
Copyright (C) 2012-2016 XING AG, Voog and contributors

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:

Expand Down
20 changes: 14 additions & 6 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
# wysihtml

wysihtml is an extended and less strict approach on [xing/wysihtml5](https://github.com/xing/wysihtml5) open source rich text editor based on HTML5 technology.
The code is completely library agnostic: No jQuery, Prototype or similar is required.
wysihtml is an extended and less strict approach on [xing/wysihtml5](https://github.com/xing/wysihtml5) open source rich text editor.
The code is library agnostic and has all dependencies bundled: No jQuery, Prototype or similar is required.
The currently bundled dependencies are rangy.js (including textrange and selectionsaverestore modules) and base.js.

This project is supported by [Voog](http://voog.com).

# Version 0.6.0 breaking changes

Version 0.6.0 notes for migration.

* Object namespace is now wysihtyml (was previously wysihtml5). This change includes all classnames and event names.
* The default toolbar is separated to independent module (wysihtml.toolbar.js) and must be added separately if used.
* Full command set for backwards compatibility is not bundled and separated to wysihtml.all-commands.js module. Most commands there directly map to formatBlock or formatInline commands and are thus optional and can be replaced with these internal commands.
* Table editing features are now as a separate module

## Demos
* Project page with simple demo: http://wysihtml.com
* Minimal demo: https://voog.github.com/wysihtml/examples/simple.html
* Advanced demo: https://voog.github.com/wysihtml/examples/advanced.html
* Editable GitHub page: https://voog.github.com/wysihtml
* Or try it on a working app: https://www.voog.com


## Features

* Auto linking of urls as-you-type.
Expand All @@ -24,7 +33,6 @@ This project is supported by [Voog](http://voog.com).
* 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`, etc.) from original textarea (you only have to style one element).
* Speech-input for Chrome.

**Extended features not present in xing/wysihtml5:**

Expand All @@ -41,7 +49,7 @@ This project is supported by [Voog](http://voog.com).

## Browser Support

The rich text editing interface is supported in IE9+, FF 29+, Safari 5+, Safari on iOS 5+, Opera 12+ and Chrome.
The rich text editing interface is supported in IE9+, FF 29+, Safari 6+, Safari on iOS 6+, Opera 12+ and Chrome.
**Graceful Degradation:** Users with other browsers will see the textarea and are still able to write plain HTML by themselves.

## Development
Expand All @@ -51,7 +59,7 @@ wysihtml can be initialized and built using node package manager:
npm install
npm run build

This adds dependencies (first line) and builds both minified and development versions (second line), including one with toolbar support.
This adds dependencies (first line) and builds both minified and development versions (second line).

## Contributors

Expand Down
Loading

0 comments on commit e5e8729

Please sign in to comment.