MDL-44846 Atto: Make the color plugins reliable.
authorDamyon Wiese <damyon@moodle.com>
Mon, 31 Mar 2014 05:19:59 +0000 (13:19 +0800)
committerDamyon Wiese <damyon@moodle.com>
Thu, 3 Apr 2014 02:52:41 +0000 (10:52 +0800)
commitaf6a2e9459240a2384c359badb8d3cbc09b04560
treecc4eebd7484dc6fd3b360c9beb90bc27c2e3ff71
parentfc7557677de76602640b4478f91c641944c6c342
MDL-44846 Atto: Make the color plugins reliable.

The problem is that in IE, the browser implements color commands with font tags (<font color=...>).

We specifically strip font tags to avoid abuse when pasting from word (the world has seen enough of Tahoma).

This solution instead uses Rangy to set inline styles on the selection. This works in all browsers nicely.

I also updated the toggleInlineSelectionClass function to use the same rangy function. This solves problems with
whitespace squashing in ie.
14 files changed:
lib/editor/atto/plugins/backcolor/yui/build/moodle-atto_backcolor-button/moodle-atto_backcolor-button-debug.js
lib/editor/atto/plugins/backcolor/yui/build/moodle-atto_backcolor-button/moodle-atto_backcolor-button-min.js
lib/editor/atto/plugins/backcolor/yui/build/moodle-atto_backcolor-button/moodle-atto_backcolor-button.js
lib/editor/atto/plugins/backcolor/yui/src/button/js/button.js
lib/editor/atto/plugins/fontcolor/yui/build/moodle-atto_fontcolor-button/moodle-atto_fontcolor-button-debug.js
lib/editor/atto/plugins/fontcolor/yui/build/moodle-atto_fontcolor-button/moodle-atto_fontcolor-button-min.js
lib/editor/atto/plugins/fontcolor/yui/build/moodle-atto_fontcolor-button/moodle-atto_fontcolor-button.js
lib/editor/atto/plugins/fontcolor/yui/src/button/js/button.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor.js
lib/editor/atto/yui/src/editor/js/editor.js
lib/editor/atto/yui/src/editor/js/selection.js
lib/editor/atto/yui/src/editor/js/styling.js