Merge branch 'MDL-76920-master' of https://github.com/cescobedo/moodle

This commit is contained in:
Paul Holden 2023-03-16 16:33:39 +00:00 committed by Sara Arjona
commit d81bbc0933
7 changed files with 47 additions and 41 deletions

View file

@ -4,7 +4,7 @@
<location>yui/src/codemirror</location> <location>yui/src/codemirror</location>
<name>codemirror</name> <name>codemirror</name>
<description>CodeMirror is a versatile text editor implemented in JavaScript for the browser.</description> <description>CodeMirror is a versatile text editor implemented in JavaScript for the browser.</description>
<version>5.65.9</version> <version>5.65.12</version>
<license>MIT</license> <license>MIT</license>
<repository>https://github.com/codemirror/codemirror5</repository> <repository>https://github.com/codemirror/codemirror5</repository>
</library> </library>

View file

@ -1957,7 +1957,7 @@ var define = null; // Remove require.js support in this context.
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
// support for the old title property // support for the old title property
// https://github.com/codemirror/codemirror5/pull/5673 // https://github.com/codemirror/CodeMirror/pull/5673
if (m.title) { (attributes || (attributes = {})).title = m.title; } if (m.title) { (attributes || (attributes = {})).title = m.title; }
if (m.attributes) { if (m.attributes) {
for (var attr in m.attributes) for (var attr in m.attributes)
@ -8263,8 +8263,8 @@ var define = null; // Remove require.js support in this context.
} }
function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {
field.setAttribute("autocorrect", autocorrect ? "" : "off"); field.setAttribute("autocorrect", autocorrect ? "on" : "off");
field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); field.setAttribute("autocapitalize", autocapitalize ? "on" : "off");
field.setAttribute("spellcheck", !!spellcheck); field.setAttribute("spellcheck", !!spellcheck);
} }
@ -8279,7 +8279,6 @@ var define = null; // Remove require.js support in this context.
else { te.setAttribute("wrap", "off"); } else { te.setAttribute("wrap", "off"); }
// If border: 0; -- iOS fails to open keyboard (issue #1287) // If border: 0; -- iOS fails to open keyboard (issue #1287)
if (ios) { te.style.border = "1px solid black"; } if (ios) { te.style.border = "1px solid black"; }
disableBrowserMagic(te);
return div return div
} }
@ -8901,6 +8900,7 @@ var define = null; // Remove require.js support in this context.
} }
// Old-fashioned briefly-focus-a-textarea hack // Old-fashioned briefly-focus-a-textarea hack
var kludge = hiddenTextarea(), te = kludge.firstChild; var kludge = hiddenTextarea(), te = kludge.firstChild;
disableBrowserMagic(te);
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
te.value = lastCopied.text.join("\n"); te.value = lastCopied.text.join("\n");
var hadFocus = activeElt(div.ownerDocument); var hadFocus = activeElt(div.ownerDocument);
@ -9465,6 +9465,8 @@ var define = null; // Remove require.js support in this context.
// The semihidden textarea that is focused when the editor is // The semihidden textarea that is focused when the editor is
// focused, and receives input. // focused, and receives input.
this.textarea = this.wrapper.firstChild; this.textarea = this.wrapper.firstChild;
var opts = this.cm.options;
disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);
}; };
TextareaInput.prototype.screenReaderLabelChanged = function (label) { TextareaInput.prototype.screenReaderLabelChanged = function (label) {
@ -9869,14 +9871,14 @@ var define = null; // Remove require.js support in this context.
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.65.9"; CodeMirror.version = "5.65.12";
return CodeMirror; return CodeMirror;
}))); })));
var CodeMirror = this.CodeMirror; var CodeMirror = this.CodeMirror;
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/5/LICENSE
(function(mod) { (function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS if (typeof exports == "object" && typeof module == "object") // CommonJS
@ -9927,7 +9929,7 @@ var CodeMirror = this.CodeMirror;
} }
function getTagRegexp(tagName, anchored) { function getTagRegexp(tagName, anchored) {
return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); return new RegExp((anchored ? "^" : "") + "<\/\\s*" + tagName + "\\s*>", "i");
} }
function addTags(from, to) { function addTags(from, to) {
@ -11226,7 +11228,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "async" || if (type == "async" ||
(type == "variable" && (type == "variable" &&
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))) {
cx.marked = "keyword"; cx.marked = "keyword";
return cont(classBody); return cont(classBody);
} }

File diff suppressed because one or more lines are too long

View file

@ -1957,7 +1957,7 @@ var define = null; // Remove require.js support in this context.
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
// support for the old title property // support for the old title property
// https://github.com/codemirror/codemirror5/pull/5673 // https://github.com/codemirror/CodeMirror/pull/5673
if (m.title) { (attributes || (attributes = {})).title = m.title; } if (m.title) { (attributes || (attributes = {})).title = m.title; }
if (m.attributes) { if (m.attributes) {
for (var attr in m.attributes) for (var attr in m.attributes)
@ -8263,8 +8263,8 @@ var define = null; // Remove require.js support in this context.
} }
function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {
field.setAttribute("autocorrect", autocorrect ? "" : "off"); field.setAttribute("autocorrect", autocorrect ? "on" : "off");
field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); field.setAttribute("autocapitalize", autocapitalize ? "on" : "off");
field.setAttribute("spellcheck", !!spellcheck); field.setAttribute("spellcheck", !!spellcheck);
} }
@ -8279,7 +8279,6 @@ var define = null; // Remove require.js support in this context.
else { te.setAttribute("wrap", "off"); } else { te.setAttribute("wrap", "off"); }
// If border: 0; -- iOS fails to open keyboard (issue #1287) // If border: 0; -- iOS fails to open keyboard (issue #1287)
if (ios) { te.style.border = "1px solid black"; } if (ios) { te.style.border = "1px solid black"; }
disableBrowserMagic(te);
return div return div
} }
@ -8901,6 +8900,7 @@ var define = null; // Remove require.js support in this context.
} }
// Old-fashioned briefly-focus-a-textarea hack // Old-fashioned briefly-focus-a-textarea hack
var kludge = hiddenTextarea(), te = kludge.firstChild; var kludge = hiddenTextarea(), te = kludge.firstChild;
disableBrowserMagic(te);
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
te.value = lastCopied.text.join("\n"); te.value = lastCopied.text.join("\n");
var hadFocus = activeElt(div.ownerDocument); var hadFocus = activeElt(div.ownerDocument);
@ -9465,6 +9465,8 @@ var define = null; // Remove require.js support in this context.
// The semihidden textarea that is focused when the editor is // The semihidden textarea that is focused when the editor is
// focused, and receives input. // focused, and receives input.
this.textarea = this.wrapper.firstChild; this.textarea = this.wrapper.firstChild;
var opts = this.cm.options;
disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);
}; };
TextareaInput.prototype.screenReaderLabelChanged = function (label) { TextareaInput.prototype.screenReaderLabelChanged = function (label) {
@ -9869,14 +9871,14 @@ var define = null; // Remove require.js support in this context.
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.65.9"; CodeMirror.version = "5.65.12";
return CodeMirror; return CodeMirror;
}))); })));
var CodeMirror = this.CodeMirror; var CodeMirror = this.CodeMirror;
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/5/LICENSE
(function(mod) { (function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS if (typeof exports == "object" && typeof module == "object") // CommonJS
@ -9927,7 +9929,7 @@ var CodeMirror = this.CodeMirror;
} }
function getTagRegexp(tagName, anchored) { function getTagRegexp(tagName, anchored) {
return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); return new RegExp((anchored ? "^" : "") + "<\/\\s*" + tagName + "\\s*>", "i");
} }
function addTags(from, to) { function addTags(from, to) {
@ -11226,7 +11228,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "async" || if (type == "async" ||
(type == "variable" && (type == "variable" &&
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))) {
cx.marked = "keyword"; cx.marked = "keyword";
return cont(classBody); return cont(classBody);
} }

View file

@ -1953,7 +1953,7 @@
if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; }
if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }
// support for the old title property // support for the old title property
// https://github.com/codemirror/codemirror5/pull/5673 // https://github.com/codemirror/CodeMirror/pull/5673
if (m.title) { (attributes || (attributes = {})).title = m.title; } if (m.title) { (attributes || (attributes = {})).title = m.title; }
if (m.attributes) { if (m.attributes) {
for (var attr in m.attributes) for (var attr in m.attributes)
@ -8259,8 +8259,8 @@
} }
function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {
field.setAttribute("autocorrect", autocorrect ? "" : "off"); field.setAttribute("autocorrect", autocorrect ? "on" : "off");
field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); field.setAttribute("autocapitalize", autocapitalize ? "on" : "off");
field.setAttribute("spellcheck", !!spellcheck); field.setAttribute("spellcheck", !!spellcheck);
} }
@ -8275,7 +8275,6 @@
else { te.setAttribute("wrap", "off"); } else { te.setAttribute("wrap", "off"); }
// If border: 0; -- iOS fails to open keyboard (issue #1287) // If border: 0; -- iOS fails to open keyboard (issue #1287)
if (ios) { te.style.border = "1px solid black"; } if (ios) { te.style.border = "1px solid black"; }
disableBrowserMagic(te);
return div return div
} }
@ -8897,6 +8896,7 @@
} }
// Old-fashioned briefly-focus-a-textarea hack // Old-fashioned briefly-focus-a-textarea hack
var kludge = hiddenTextarea(), te = kludge.firstChild; var kludge = hiddenTextarea(), te = kludge.firstChild;
disableBrowserMagic(te);
cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);
te.value = lastCopied.text.join("\n"); te.value = lastCopied.text.join("\n");
var hadFocus = activeElt(div.ownerDocument); var hadFocus = activeElt(div.ownerDocument);
@ -9461,6 +9461,8 @@
// The semihidden textarea that is focused when the editor is // The semihidden textarea that is focused when the editor is
// focused, and receives input. // focused, and receives input.
this.textarea = this.wrapper.firstChild; this.textarea = this.wrapper.firstChild;
var opts = this.cm.options;
disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);
}; };
TextareaInput.prototype.screenReaderLabelChanged = function (label) { TextareaInput.prototype.screenReaderLabelChanged = function (label) {
@ -9865,7 +9867,7 @@
addLegacyProps(CodeMirror); addLegacyProps(CodeMirror);
CodeMirror.version = "5.65.9"; CodeMirror.version = "5.65.12";
return CodeMirror; return CodeMirror;

View file

@ -1,5 +1,5 @@
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE // Distributed under an MIT license: https://codemirror.net/5/LICENSE
(function(mod) { (function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS if (typeof exports == "object" && typeof module == "object") // CommonJS
@ -50,7 +50,7 @@
} }
function getTagRegexp(tagName, anchored) { function getTagRegexp(tagName, anchored) {
return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i"); return new RegExp((anchored ? "^" : "") + "<\/\\s*" + tagName + "\\s*>", "i");
} }
function addTags(from, to) { function addTags(from, to) {

View file

@ -779,7 +779,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "async" || if (type == "async" ||
(type == "variable" && (type == "variable" &&
(value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { cx.stream.match(/^\s+#?[\w$\xa1-\uffff]/, false))) {
cx.marked = "keyword"; cx.marked = "keyword";
return cont(classBody); return cont(classBody);
} }