mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'MDL-57374_master' of https://github.com/dasistwas/moodle
This commit is contained in:
commit
42d80f2b9d
@ -1395,9 +1395,9 @@ EditorClean.prototype = {
|
||||
isHTML = (types.indexOf('text/html') > -1);
|
||||
}
|
||||
|
||||
var content;
|
||||
if (isHTML) {
|
||||
// Get the clipboard content.
|
||||
var content;
|
||||
try {
|
||||
content = event.clipboardData.getData('text/html');
|
||||
} catch (error) {
|
||||
@ -1427,11 +1427,17 @@ EditorClean.prototype = {
|
||||
this.updateOriginal();
|
||||
return false;
|
||||
} else {
|
||||
try {
|
||||
// Plaintext clipboard content can only be retrieved this way.
|
||||
content = event.clipboardData.getData('text');
|
||||
} catch (error) {
|
||||
// Something went wrong. Fallback.
|
||||
// Due to poor cross browser clipboard compatibility, the failure to find html doesn't mean it isn't there.
|
||||
// Wait for the clipboard event to finish then fallback clean the entire editor.
|
||||
this.fallbackPasteCleanupDelayed();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If we reached a here, this probably means the browser has limited (or no) clipboard support.
|
||||
// Wait for the clipboard event to finish then fallback clean the entire editor.
|
||||
|
File diff suppressed because one or more lines are too long
@ -1384,9 +1384,9 @@ EditorClean.prototype = {
|
||||
isHTML = (types.indexOf('text/html') > -1);
|
||||
}
|
||||
|
||||
var content;
|
||||
if (isHTML) {
|
||||
// Get the clipboard content.
|
||||
var content;
|
||||
try {
|
||||
content = event.clipboardData.getData('text/html');
|
||||
} catch (error) {
|
||||
@ -1416,11 +1416,17 @@ EditorClean.prototype = {
|
||||
this.updateOriginal();
|
||||
return false;
|
||||
} else {
|
||||
try {
|
||||
// Plaintext clipboard content can only be retrieved this way.
|
||||
content = event.clipboardData.getData('text');
|
||||
} catch (error) {
|
||||
// Something went wrong. Fallback.
|
||||
// Due to poor cross browser clipboard compatibility, the failure to find html doesn't mean it isn't there.
|
||||
// Wait for the clipboard event to finish then fallback clean the entire editor.
|
||||
this.fallbackPasteCleanupDelayed();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If we reached a here, this probably means the browser has limited (or no) clipboard support.
|
||||
// Wait for the clipboard event to finish then fallback clean the entire editor.
|
||||
|
8
lib/editor/atto/yui/src/editor/js/clean.js
vendored
8
lib/editor/atto/yui/src/editor/js/clean.js
vendored
@ -147,9 +147,9 @@ EditorClean.prototype = {
|
||||
isHTML = (types.indexOf('text/html') > -1);
|
||||
}
|
||||
|
||||
var content;
|
||||
if (isHTML) {
|
||||
// Get the clipboard content.
|
||||
var content;
|
||||
try {
|
||||
content = event.clipboardData.getData('text/html');
|
||||
} catch (error) {
|
||||
@ -179,11 +179,17 @@ EditorClean.prototype = {
|
||||
this.updateOriginal();
|
||||
return false;
|
||||
} else {
|
||||
try {
|
||||
// Plaintext clipboard content can only be retrieved this way.
|
||||
content = event.clipboardData.getData('text');
|
||||
} catch (error) {
|
||||
// Something went wrong. Fallback.
|
||||
// Due to poor cross browser clipboard compatibility, the failure to find html doesn't mean it isn't there.
|
||||
// Wait for the clipboard event to finish then fallback clean the entire editor.
|
||||
this.fallbackPasteCleanupDelayed();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If we reached a here, this probably means the browser has limited (or no) clipboard support.
|
||||
// Wait for the clipboard event to finish then fallback clean the entire editor.
|
||||
|
Loading…
x
Reference in New Issue
Block a user