When nodes are added to the dom, they may need to be re-processed by a JS based
filter. To do this we need to trigger the legacy YUI event filter-content-updated.
To make this easier I added some wrappers to template that will insert the node, run any
JS and trigger the event.
I also changed existing yui code to call the amd function to trigger the event. This way
all jquery and yui listeners will always be notified.
Added new functions to editor api - set/get_text so the
original form text can be determined from an editor.
When calling use_editor() you should first call set_text() with
the text that will be inserted in the form element.
There is also a new scheduled task for cleaning Atto autosave drafts.
If the files in the draft area have been modified more recently than the timestamp
of the draft - do not restore the files, or you will delete any newer files. We
cannot really guess here - merging the 2 lists of files will be wrong.
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.
version = planned 2015051100 release version
requires= current 2015050500 rc1 version
Note: On purpose, the course format social wrong version (2015102100)
has been kept unmodified. Looking forward a solution right now.
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.
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.
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.