mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'MDL-45533-27' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
b3eea60ecb
5 changed files with 44 additions and 8 deletions
|
@ -201,6 +201,11 @@ Y.extend(Editor, Y.Base, {
|
|||
// Disable odd inline CSS styles.
|
||||
this.disableCssStyling();
|
||||
|
||||
// Use paragraphs not divs.
|
||||
if (document.queryCommandSupported('DefaultParagraphSeparator')) {
|
||||
document.execCommand('DefaultParagraphSeparator', false, 'p');
|
||||
}
|
||||
|
||||
// Add the toolbar and editable zone to the page.
|
||||
this.textarea.get('parentNode').insert(this._wrapper, this.textarea);
|
||||
|
||||
|
@ -521,7 +526,8 @@ EditorClean.prototype = {
|
|||
*/
|
||||
getCleanHTML: function() {
|
||||
// Clone the editor so that we don't actually modify the real content.
|
||||
var editorClone = this.editor.cloneNode(true);
|
||||
var editorClone = this.editor.cloneNode(true),
|
||||
html;
|
||||
|
||||
// Remove all YUI IDs.
|
||||
Y.each(editorClone.all('[id^="yui"]'), function(node) {
|
||||
|
@ -529,9 +535,15 @@ EditorClean.prototype = {
|
|||
});
|
||||
|
||||
editorClone.all('.atto_control').remove(true);
|
||||
html = editorClone.get('innerHTML');
|
||||
|
||||
// Revert untouched editor contents to an empty string.
|
||||
if (html === '<p></p>' || html === '<p><br></p>') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Remove any and all nasties from source.
|
||||
return this._cleanHTML(editorClone.get('innerHTML'));
|
||||
return this._cleanHTML(html);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -199,6 +199,11 @@ Y.extend(Editor, Y.Base, {
|
|||
// Disable odd inline CSS styles.
|
||||
this.disableCssStyling();
|
||||
|
||||
// Use paragraphs not divs.
|
||||
if (document.queryCommandSupported('DefaultParagraphSeparator')) {
|
||||
document.execCommand('DefaultParagraphSeparator', false, 'p');
|
||||
}
|
||||
|
||||
// Add the toolbar and editable zone to the page.
|
||||
this.textarea.get('parentNode').insert(this._wrapper, this.textarea);
|
||||
|
||||
|
@ -518,7 +523,8 @@ EditorClean.prototype = {
|
|||
*/
|
||||
getCleanHTML: function() {
|
||||
// Clone the editor so that we don't actually modify the real content.
|
||||
var editorClone = this.editor.cloneNode(true);
|
||||
var editorClone = this.editor.cloneNode(true),
|
||||
html;
|
||||
|
||||
// Remove all YUI IDs.
|
||||
Y.each(editorClone.all('[id^="yui"]'), function(node) {
|
||||
|
@ -526,9 +532,15 @@ EditorClean.prototype = {
|
|||
});
|
||||
|
||||
editorClone.all('.atto_control').remove(true);
|
||||
html = editorClone.get('innerHTML');
|
||||
|
||||
// Revert untouched editor contents to an empty string.
|
||||
if (html === '<p></p>' || html === '<p><br></p>') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Remove any and all nasties from source.
|
||||
return this._cleanHTML(editorClone.get('innerHTML'));
|
||||
return this._cleanHTML(html);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
11
lib/editor/atto/yui/src/editor/js/clean.js
vendored
11
lib/editor/atto/yui/src/editor/js/clean.js
vendored
|
@ -42,7 +42,8 @@ EditorClean.prototype = {
|
|||
*/
|
||||
getCleanHTML: function() {
|
||||
// Clone the editor so that we don't actually modify the real content.
|
||||
var editorClone = this.editor.cloneNode(true);
|
||||
var editorClone = this.editor.cloneNode(true),
|
||||
html;
|
||||
|
||||
// Remove all YUI IDs.
|
||||
Y.each(editorClone.all('[id^="yui"]'), function(node) {
|
||||
|
@ -50,9 +51,15 @@ EditorClean.prototype = {
|
|||
});
|
||||
|
||||
editorClone.all('.atto_control').remove(true);
|
||||
html = editorClone.get('innerHTML');
|
||||
|
||||
// Revert untouched editor contents to an empty string.
|
||||
if (html === '<p></p>' || html === '<p><br></p>') {
|
||||
return '';
|
||||
}
|
||||
|
||||
// Remove any and all nasties from source.
|
||||
return this._cleanHTML(editorClone.get('innerHTML'));
|
||||
return this._cleanHTML(html);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
5
lib/editor/atto/yui/src/editor/js/editor.js
vendored
5
lib/editor/atto/yui/src/editor/js/editor.js
vendored
|
@ -199,6 +199,11 @@ Y.extend(Editor, Y.Base, {
|
|||
// Disable odd inline CSS styles.
|
||||
this.disableCssStyling();
|
||||
|
||||
// Use paragraphs not divs.
|
||||
if (document.queryCommandSupported('DefaultParagraphSeparator')) {
|
||||
document.execCommand('DefaultParagraphSeparator', false, 'p');
|
||||
}
|
||||
|
||||
// Add the toolbar and editable zone to the page.
|
||||
this.textarea.get('parentNode').insert(this._wrapper, this.textarea);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue