153 Commits

Author SHA1 Message Date
Frederic Massart
3b10fa25bc MDL-50564 atto: Require atto_menu in atto_plugin 2015-11-13 14:38:33 -06:00
Dan Poltawski
30b86ccb68 Merge branch 'MDL-51605-master' of git://github.com/damyon/moodle 2015-10-12 09:46:00 +01:00
Damyon Wiese
b3c10f9fb2 MDL-51605 Atto: Fix deprecation warnings from upgraded rangy 2015-10-09 15:42:10 +08:00
Andrew Nicols
ed845fa7fe Merge branch 'MDL-51228-master' of https://github.com/dthies/moodle 2015-10-06 16:31:34 +01:00
Eloy Lafuente (stronk7)
6a0deee441 Merge branch 'MDL-51227-master' of https://github.com/dthies/moodle 2015-10-01 00:25:31 +02:00
Damyon Wiese
fc07d950ea MDL-51605 Rangy: Patch out AMD support (we can't use it from YUI). 2015-09-30 13:17:28 +08:00
Damyon Wiese
0fde7efad1 MDL-51605 atto: Update rangy to 1.3.0 2015-09-30 13:08:15 +08:00
Daniel Thies
7bb2069bfa MDL-51227 editor_atto: Stop Chrome losing selection when formating 2015-09-25 09:32:46 -05:00
Daniel Thies
c8719db169 MDL-51424 editor_atto: Save selection and editor contents after change 2015-09-21 08:53:16 -05:00
Daniel Thies
d0ec31716b MDL-51228 atto_editor: Add documententation for inlineFormat flag 2015-09-13 14:29:07 -05:00
Daniel Thies
dc9ca4acea MDL-46387 editor-atto: Toggle sub/sup tags using rangy
In order to have a consistant browser behavior and prevent nesting of
subscripts and superscripts, tags are converted to CSS classes and then
the CSS classes in the selection are toggeled using the rangy crossbrowser
selection library already included in Atto without using an execCommand.
2015-08-13 15:46:29 -05:00
Eloy Lafuente (stronk7)
82cf09885c Merge branch 'MDL-49686-master' of git://github.com/merrill-oakland/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-04-02 11:08:11 +02:00
Eloy Lafuente (stronk7)
b485fb20dd Merge branch 'MDL-49693-master' of git://github.com/merrill-oakland/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-04-02 11:05:32 +02:00
Dan Poltawski
3d8b835aec Merge branch 'MDL-49564-master' of git://github.com/merrill-oakland/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-31 19:25:10 +01:00
Eric Merrill
9029ce75eb MDL-49693 atto: Clean textarea contents before inserting into editor 2015-03-27 12:27:00 -04:00
Eric Merrill
8e202bd80a MDL-49686 atto: Process style and class attributes in sub-functions
To ensure we only clean style and classes, first we select the inside
of those attributes and "replace" them with handler functions. Those
functions scan the actual attribute values for class or styles that
we want to exclude.

The first level regex has 3 groups. group1 selects everything in the
tag leading up to the attribute values, group2 has the attributes,
group3 has the trailing quote mark. We work on group2 then return
the combination of group1, group2, and group3.
2015-03-27 11:36:05 -04:00
Eric Merrill
73e144334b MDL-49671 atto: Any pastes that don't have html should clean everything
Browsers may not provide html content in the clipboard object event
though it will really be pasted as such. This includes Firefox on
Windows, Internet Explorer, and some niche cases in Safari.

Because of this, we need to scrub the entire editor anytime we can't
intercept a paste event.

In some magical day in the future when there is better cross browser
support, we can undo this.
2015-03-26 23:31:05 -04:00
Eric Merrill
1b6ce030d3 MDL-49564 atto: Improve empty span removal
Paste from MS word, followed by cleaning, may leave many many unused
spans. Try to remove them.
2015-03-26 23:05:23 -04:00
David Monllao
cfb32192d6 MDL-47002 editor_atto: Remove all after html when pasting 2015-03-26 16:15:29 +08:00
David Monllao
d784f5edc3 MDL-47002 editor_atto: Clean the comments separately 2015-03-26 14:37:55 +08:00
Eric Merrill
665829ec2a MDL-47002 atto: Prevent removal of Rangy spans 2015-03-25 10:02:43 -04:00
Dan Poltawski
db8a3b2eb9 Merge branch 'MDL-46746-master' of git://github.com/merrill-oakland/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-24 11:04:04 +00:00
Eric Merrill
6ea68e233a MDL-49565 atto: Allow html comments in editor code 2015-03-18 12:28:02 -04:00
Eric Merrill
df7a9fd4ba MDL-46746 atto: Remove unnecessary filtering of unicode characters 2015-03-18 12:04:31 -04:00
Eric Merrill
3ef9636190 MDL-47003 atto: Make code cleanup more targeted
Apply different, stricter, code cleanup when we receive HTML (WYSIWYG)
paste events, but be more lax the rest of the time.

Also, update the regexes to be more targeted for specific code patterns
pasted from office packages.
2015-03-18 11:44:11 -04:00
Eric Merrill
a7fdadc94c MDL-47002 atto: Improve paste behaviour to ensure propper cleanup
Old code failed to clean the editor div which resulted in
undesirable code being being left in the div for editing. To properly
handel incoming code, we should try to intercept and clean before the
paste, or clean the entire editable div.
2015-03-18 09:27:44 -04:00
David Monllao
ceba96bbca Merge branch 'MDL-49256-master' of git://github.com/andrewnicols/moodle
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-10 17:42:35 +08:00
Andrew Nicols
c4e2c67134 MDL-49256 atto: Check form existence before resetAutosave 2015-03-06 11:26:41 +08:00
Frederic Massart
39c6f62d03 MDL-49107 atto_link: Insert link even when selection is empty 2015-02-25 16:33:58 +01:00
Paul Nicholls
10fae2779e MDL-48973 Atto: Atto does not listen to the drop event
The 'drop' event fires before the native ContentEditable drop handler, so
in order to update the underlying textarea we need to call updateOriginal
with a brief delay so that the dropped content has actually been added to
the editor.
2015-02-13 14:48:12 +13:00
Andrew Nicols
557f44d970 MDL-48620 JavaScript: Updated shifted files to comply with coding style 2015-01-23 14:51:24 +08:00
Dave Cooper
369a63ac1c MDL-47935 Atto: Moved atto notification message position 2015-01-09 15:53:19 +08:00
Sam Hemelryk
d125c7d238 MDL-47133 editor_atto: fixed lint errors 2014-12-01 10:36:23 +13:00
Sam Hemelryk
231cb5e3d4 Merge branch 'MDL-47133-master' of git://github.com/FMCorz/moodle 2014-12-01 10:34:18 +13:00
Frederic Massart
04b12fc1b3 MDL-47133 editor_atto: Use strict validation of keyboard shortcuts 2014-11-26 17:41:05 +08:00
Daniel Thies
8bca3609ee MDL-48064 atto_editor: Expand event subscription for saving selection 2014-11-17 11:15:45 -06:00
Daniel Thies
9b9a3abf9b MDL-48064 atto_editor: Check if activeElement is child node in isActive 2014-11-14 11:49:15 -06:00
Daniel Thies
8160d004ce MDL-47943 editor_atto: Save selection on mouseleave for Chrome 2014-11-05 09:34:20 -06:00
Damyon Wiese
c942fddf93 MDL-48006 Atto autosave: Never restore text that is empty. 2014-11-03 11:30:30 +08:00
Mark Nelson
7b62567e85 MDL-47736 editor_atto: added fix for IE 9 and 10 2014-10-21 00:46:35 -07:00
Mark Nelson
3c15d25bcf MDL-47736 editor_atto: exclude <br> from being restored 2014-10-20 23:24:08 -07:00
Mark Nelson
e924e1b33a MDL-47736 editor_atto: only save/restore draft when necessary 2014-10-19 22:14:15 -07:00
Frederic Massart
53cca2274e MDL-47737 editor_atto: Prevent false negative when saving draft on IE9 2014-10-17 20:48:43 +08:00
Frederic Massart
5aafc6f425 MDL-47733 editor_atto: Do not prompt error when draft is empty 2014-10-17 18:19:11 +08:00
Dave Cooper
b6da971b4a MDL-47140 editor_atto: Improved error handling 2014-10-13 10:51:17 +08:00
Damyon Wiese
3a7887baa4 MDL-47060 Atto: Autosave - play nicely with HTML source view.
There are 2 fixes here:
1. do not overwrite the changes to the HTML source when we do an autosave.
2. Move the Atto notifications alert to the containing div so it aligns properly for either view.
2014-09-03 15:00:02 +08:00
Damyon Wiese
6d9a83c294 Revert "Merge branch 'MDL-46917-master' of git://github.com/andrewnicols/moodle"
This reverts commit acbcea51013bdf5d0101dc5856d8aca97bf1c036, reversing
changes made to 91f31c097dd46674d8535096e020ffa42536e854.
2014-08-26 17:18:03 +08:00
Andrew Nicols
1b8f073de3 MDL-46917 atto: Focus on the editor when the form label is selected 2014-08-22 08:58:21 +08:00
Damyon Wiese
942501f318 MDL-18014 Atto autosave: When text is recovered, force it into the undo stack
This allows you to use "Undo" to go back to the unaltered text in the form.
2014-08-19 12:13:41 +08:00
Damyon Wiese
c07f86ce26 MDL-18014 Atto autosave: Use the $PAGE->url to differentiate autosave instances 2014-08-14 13:23:05 +08:00