Merge branch 'MDL-45533-27' of git://github.com/FMCorz/moodle
This commit is contained in:
+14
-2
@@ -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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
+14
-2
@@ -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);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
+9
-2
@@ -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
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user