Giter VIP home page Giter VIP logo

moodle-editor_ousupsub's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

timhunt mkassaei

moodle-editor_ousupsub's Issues

What is pageHash for?

When initializing the editor, an SHA1 hash of the PAGE url is passed as the pageHash property. It is normally used by Atto's autosave feature. Just wondering if it is somehow needed here too or if it is just a copy & paste relic.

Z and Y keys in supsub editor

Capital letter Z and capital letter Y don't work in our Moodle environment with the ousupsub plugin combined with pmatch.

Disabling some javascript code solves this issue:

diff --git a/web/lib/editor/ousupsub/standalone/ousupsub/ousupsub.js b/web/lib/editor/ousupsub/standalone/ousupsub/ousupsub.js
index 444c27d9a4a54580a265b1d6d55d23544c5f1931..e7dfa6a00cee1c4a76eb62c5373819336ca90a8f 100644
--- a/web/lib/editor/ousupsub/standalone/ousupsub/ousupsub.js
+++ b/web/lib/editor/ousupsub/standalone/ousupsub/ousupsub.js
@@ -370,7 +370,7 @@ e.getIframeSelection=function(t){return e.getSelection(i.getIframeWindow(t))};va
 function o(e,t){e.className?s(e,t)||(e.className+=" "+t):e.className=t}function a(e){return e.split(/\s+/).sort().join(" ")}function f(e){return a(e.className)}function l(e,t){return f(e)==f(t)}function c(e){var t=e.parentNode;while(e.hasChildNodes())t.insertBefore(e.firstChild,e);t.removeChild(e)}function h(e,t){var n=e.cloneRange();n.selectNodeContents(t);var r=n.intersection(e),i=r?r.toString():"";return n.detach(),i!=""}function p(e){return e.getNodes([3],function(t){return h(e,t)})}function d(e,t){if(e.attributes.length!=t.attributes.length)return!1;for(var n=0,r=e.attributes.length,i,s,o;n<r;++n){i=e.attributes[n],o=i.name;if(o!="class"){s=t.attributes.getNamedItem(o);if(i.specified!=s.specified)return!1;if(i.specified&&i.nodeValue!==s.nodeValue)return!1}}return!0}function v(e,t){for(var r=0,i=e.attributes.length,s;r<i;++r){s=e.attributes[r].name;if((!t||!n.arrayContains(t,s))&&e.attributes[r].specified&&s!="class")return!0}return!1}function m(e,t){for(var n in t)if(t.hasOwnProperty(n)&&e[n]!==t[n])return!1;return!0}function b(e){var t;return e&&e.nodeType==1&&((t=e.parentNode)&&t.nodeType==9&&t.designMode=="on"||y(e)&&!y(e.parentNode))}function w(e){return(y(e)||e.nodeType!=1&&y(e.parentNode))&&!b(e)}function S(e){return e&&e.nodeType==1&&!E.test(g(e,"display"))}function T(e){if(e.data.length==0)return!0;if(x.test(e.data))return!1;var t=g(e.parentNode,"whiteSpace");switch(t){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(e.data))return!1}return S(e.previousSibling)||S(e.nextSibling)}function N(e,t){return n.isCharacterDataNode(e)?t==0?!!e.previousSibling:t==e.length?!!e.nextSibling:!0:t>0&&t<e.childNodes.length}function C(e,r,i,s){var o,u=i==0;if(n.isAncestorOf(r,e))return e;if(n.isCharacterDataNode(r))if(i==0)i=n.getNodeIndex(r),r=r.parentNode;else{if(i!=r.length)throw t.createError("splitNodeAt should not be called with offset in the middle of a data node ("+i+" in "+r.data);i=n.getNodeIndex(r)+1,r=r.parentNode}if(N(r,i)){if(!o){o=r.cloneNode(!1),o.id&&o.removeAttribute("id");var a;while(a=r.childNodes[i])o.appendChild(a);n.insertAfter(o,r)}return r==e?o:C(e,o.parentNode,n.getNodeIndex(o),s)}if(e!=r){o=r.parentNode;var f=n.getNodeIndex(r);return u||f++,C(e,o,f,s)}return e}function k(e,t){return e.tagName==t.tagName&&l(e,t)&&d(e,t)}function L(e){var t=e?"nextSibling":"previousSibling";return function(n,r){var i=n.parentNode,s=n[t];if(s){if(s&&s.nodeType==3)return s}else if(r){s=i[t];if(s&&s.nodeType==1&&k(i,s))return s[e?"firstChild":"lastChild"]}return null}}function M(e){this.isElementMerge=e.nodeType==1,this.firstTextNode=this.isElementMerge?e.lastChild:e,this.textNodes=[this.firstTextNode]}function P(e,t,n){this.cssClass=e;var r,s,o,u,f=null;if(typeof t=="object"&&t!==null){n=t.tagNames,f=t.elementProperties;for(s=0;u=_[s++];)t.hasOwnProperty(u)&&(this[u]=t[u]);r=t.normalize}else r=t;this.normalize=typeof r=="undefined"?!0:r,this.attrExceptions=[];var l=document.createElement(this.elementTagName);this.elementProperties={};for(var c in f)f.hasOwnProperty(c)&&(D.hasOwnProperty(c)&&(c=D[c]),l[c]=f[c],this.elementProperties[c]=l[c],this.attrExceptions.push(c));this.elementSortedClassName=this.elementProperties.hasOwnProperty("className")?a(this.elementProperties.className+" "+e):e,this.applyToAnyTagName=!1;var h=typeof n;if(h=="string")n=="*"?this.applyToAnyTagName=!0:this.tagNames=i(n.toLowerCase()).split(/\s*,\s*/);else if(h=="object"&&typeof n.length=="number"){this.tagNames=[];for(s=0,o=n.length;s<o;++s)n[s]=="*"?this.applyToAnyTagName=!0:this.tagNames.push(n[s].toLowerCase())}else this.tagNames=[this.elementTagName]}function H(e,t,n){return new P(e,t,n)}e.requireModules(["WrappedSelection","WrappedRange"]);var n=e.dom,r="span",u=function(){function e(e,t,n){return t&&n?" ":""}return function(t,n){t.className&&(t.className=t.className.replace(new RegExp("(?:^|\\s)"+n+"(?:\\s|$)"),e))}}(),g;typeof window.getComputedStyle!="undefined"?g=function(e,t){return n.getWindow(e).getComputedStyle(e,null)[t]}:typeof document.documentElement.currentStyle!="undefined"?g=function(e,t){return e.currentStyle[t]}:t.fail("No means of obtaining computed style properties found");var y;(function(){var e=document.createElement("div");typeof e.isContentEditable=="boolean"?y=function(e){return e&&e.nodeType==1&&e.isContentEditable}:y=function(e){return!e||e.nodeType!=1||e.contentEditable=="false"?!1:e.contentEditable=="true"||y(e.parentNode)}})();var E=/^inline(-block|-table)?$/i,x=/[^\r\n\t\f \u200B]/,A=L(!1),O=L(!0);M.prototype={doMerge:function(){var e=[],t,n,r;for(var i=0,s=this.textNodes.length;i<s;++i)t=this.textNodes[i],n=t.parentNode,e[i]=t.data,i&&(n.removeChild(t),n.hasChildNodes()||n.parentNode.removeChild(n));return this.firstTextNode.data=r=e.join(""),r},getLength:function(){var e=this.textNodes.length,t=0;while(e--)t+=this.textNodes[e].length;return t},toString:function(){var e=[];for(var t=0,n=this.textNodes.length;t<n;++t)e[t]="'"+this.textNodes[t].data+"'";return"[Merge("+e.join(",")+")]"}};var _=["elementTagName","ignoreWhiteSpace","applyToEditableOnly"],D={"class":"className"};P.prototype={elementTagName:r,elementProperties:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,hasClass:function(e){return e.nodeType==1&&n.arrayContains(this.tagNames,e.tagName.toLowerCase())&&s(e,this.cssClass)},getSelfOrAncestorWithClass:function(e){while(e){if(this.hasClass(e,this.cssClass))return e;e=e.parentNode}return null},isModifiable:function(e){return!this.applyToEditableOnly||w(e)},isIgnorableWhiteSpaceNode:function(e){return this.ignoreWhiteSpace&&e&&e.nodeType==3&&T(e)},postApply:function(e,t,n){var r=e[0],i=e[e.length-1],s=[],o,u=r,a=i,f=0,l=i.length,c,h;for(var p=0,d=e.length;p<d;++p)c=e[p],h=A(c,!n),h?(o||(o=new M(h),s.push(o)),o.textNodes.push(c),c===r&&(u=o.firstTextNode,f=u.length),c===i&&(a=o.firstTextNode,l=o.getLength())):o=null;var v=O(i,!n);v&&(o||(o=new M(i),s.push(o)),o.textNodes.push(v));if(s.length){for(p=0,d=s.length;p<d;++p)s[p].doMerge();t.
 setStart(u,f),t.setEnd(a,l)}},createContainer:function(t){var n=t.createElement(this.elementTagName);return e.util.extend(n,this.elementProperties),o(n,this.cssClass),n},applyToTextNode:function(e){var t=e.parentNode;if(t.childNodes.length==1&&n.arrayContains(this.tagNames,t.tagName.toLowerCase()))o(t,this.cssClass);else{var r=this.createContainer(n.getDocument(e));e.parentNode.insertBefore(r,e),r.appendChild(e)}},isRemovable:function(e){return e.tagName.toLowerCase()==this.elementTagName&&f(e)==this.elementSortedClassName&&m(e,this.elementProperties)&&!v(e,this.attrExceptions)&&this.isModifiable(e)},undoToTextNode:function(e,t,n){if(!t.containsNode(n)){var r=t.cloneRange();r.selectNode(n),r.isPointInRange(t.endContainer,t.endOffset)&&(C(n,t.endContainer,t.endOffset,[t]),t.setEndAfter(n)),r.isPointInRange(t.startContainer,t.startOffset)&&(n=C(n,t.startContainer,t.startOffset,[t]))}this.isRemovable(n)?c(n):u(n,this.cssClass)},applyToRange:function(e){e.splitBoundaries();var t=p(e);if(t.length){var n;for(var r=0,i=t.length;r<i;++r)n=t[r],!this.isIgnorableWhiteSpaceNode(n)&&!this.getSelfOrAncestorWithClass(n)&&this.isModifiable(n)&&this.applyToTextNode(n);e.setStart(t[0],0),n=t[t.length-1],e.setEnd(n,n.length),this.normalize&&this.postApply(t,e,!1)}},applyToSelection:function(t){t=t||window;var n=e.getSelection(t),r,i=n.getAllRanges();n.removeAllRanges();var s=i.length;while(s--)r=i[s],this.applyToRange(r),n.addRange(r)},undoToRange:function(e){e.splitBoundaries();var t=p(e),n,r,i=t[t.length-1];if(t.length){for(var s=0,o=t.length;s<o;++s)n=t[s],r=this.getSelfOrAncestorWithClass(n),r&&this.isModifiable(n)&&this.undoToTextNode(n,e,r),e.setStart(t[0],0),e.setEnd(i,i.length);this.normalize&&this.postApply(t,e,!0)}},undoToSelection:function(t){t=t||window;var n=e.getSelection(t),r=n.getAllRanges(),i;n.removeAllRanges();for(var s=0,o=r.length;s<o;++s)i=r[s],this.undoToRange(i),n.addRange(i)},getTextSelectedByRange:function(e,t){var n=t.cloneRange();n.selectNodeContents(e);var r=n.intersection(t),i=r?r.toString():"";return n.detach(),i},isAppliedToRange:function(e){if(e.collapsed)return!!this.getSelfOrAncestorWithClass(e.commonAncestorContainer);var t=e.getNodes([3]);for(var n=0,r;r=t[n++];)if(!this.isIgnorableWhiteSpaceNode(r)&&h(e,r)&&this.isModifiable(r)&&!this.getSelfOrAncestorWithClass(r))return!1;return!0},isAppliedToSelection:function(t){t=t||window;var n=e.getSelection(t),r=n.getAllRanges(),i=r.length;while(i--)if(!this.isAppliedToRange(r[i]))return!1;return!0},toggleRange:function(e){this.isAppliedToRange(e)?this.undoToRange(e):this.applyToRange(e)},toggleSelection:function(e){this.isAppliedToSelection(e)?this.undoToSelection(e):this.applyToSelection(e)},detach:function(){}},P.util={hasClass:s,addClass:o,removeClass:u,hasSameClasses:l,replaceWithOwnChildren:c,elementsHaveSameNonClassAttributes:d,elementHasNonClassAttributes:v,splitNodeAt:C,isEditableElement:y,isEditingHost:b,isEditable:w},e.CssClassApplier=P,e.createCssClassApplier=H}),rangy.createModule("SaveRestore",function(e,t){function i(e,t){return(t||document).getElementById(e)}function s(e,t){var i="selectionBoundary_"+ +(new Date)+"_"+(""+Math.random()).slice(2),s,o=n.getDocument(e.startContainer),u=e.cloneRange();return u.collapse(t),s=o.createElement("span"),s.id=i,s.style.lineHeight="0",s.style.display="none",s.className="rangySelectionBoundary",s.appendChild(o.createTextNode(r)),u.insertNode(s),u.detach(),s}function o(e,n,r,s){var o=i(r,e);o?(n[s?"setStartBefore":"setEndBefore"](o),o.parentNode.removeChild(o)):t.warn("Marker element has been removed. Cannot restore selection.")}function u(e,t){return t.compareBoundaryPoints(e.START_TO_START,e)}function a(n){n=n||window;var r=n.document;if(!e.isSelectionValid(n)){t.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.");return}var o=e.getSelection(n),a=o.getAllRanges(),f=[],l,c,h;a.sort(u);for(var p=0,d=a.length;p<d;++p)h=a[p],h.collapsed?(c=s(h,!1),f.push({markerId:c.id,collapsed:!0})):(c=s(h,!1),l=s(h,!0),f[p]={startMarkerId:l.id,endMarkerId:c.id,collapsed:!1,backwards:a.length==1&&o.isBackwards()});for(p=d-1;p>=0;--p)h=a[p],h.collapsed?h.collapseBefore(i(f[p].markerId,r)):(h.setEndBefore(i(f[p].endMarkerId,r)),h.setStartAfter(i(f[p].startMarkerId,r)));return o.setRanges(a),{win:n,doc:r,rangeInfos:f,restored:!1}}function f(n,r){if(!n.restored){var s=n.rangeInfos,u=e.getSelection(n.win),a=[];for(var f=s.length,l=f-1,c,h;l>=0;--l){c=s[l],h=e.createRange(n.doc);if(c.collapsed){var p=i(c.markerId,n.doc);if(p){p.style.display="inline";var d=p.previousSibling;d&&d.nodeType==3?(p.parentNode.removeChild(p),h.collapseToPoint(d,d.length)):(h.collapseBefore(p),p.parentNode.removeChild(p))}else t.warn("Marker element has been removed. Cannot restore selection.")}else o(n.doc,h,c.startMarkerId,!0),o(n.doc,h,c.endMarkerId,!1);f==1&&h.normalizeBoundaries(),a[l]=h}f==1&&r&&e.features.selectionHasExtend&&s[0].backwards?(u.removeAllRanges(),u.addRange(a[0],!0)):u.setRanges(a),n.restored=!0}}function l(e,t){var n=i(t,e);n&&n.parentNode.removeChild(n)}function c(e){var t=e.rangeInfos;for(var n=0,r=t.length,i;n<r;++n)i=t[n],i.collapsed?l(e.doc,i.markerId):(l(e.doc,i.startMarkerId),l(e.doc,i.endMarkerId))}e.requireModules(["DomUtil","DomRange","WrappedRange"]);var n=e.dom,r="\ufeff";e.saveSelection=a,e.restoreSelection=f,e.removeMarkerElement=l,e.removeMarkers=c}),rangy.createModule("Serializer",function(e,t){function s(e){return e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function o(e,t){t=t||[];var n=e.nodeType,r=e.childNodes,i=r.length,u=[n,e.nodeName,i].join(":"),a="",f="";switch(n){case 3:a=s(e.nodeValue);break;case 8:a="<!--"+s(e.nodeValue)+"-->";break;default:a="<"+u+">",f="</>"}a&&t.push(a);for(var l=0;l<i;++l)o(r[l],t);return f&&t.push(f),t}function u(e){var t=o(e).join("");return r(t).toString(16)}function a(e,t,n){var r=[],s=e;n=n||i.getDocument(e).documentElement;while(s&&s!=n)r.push(i.getNodeIndex(s,!0)),s=s.parentNode
 ;return r.join("/")+":"+t}function f(e,n,r){n?r=r||i.getDocument(n):(r=r||document,n=r.documentElement);var s=e.split(":"),o=n,u=s[0]?s[0].split("/"):[],a=u.length,f;while(a--){f=parseInt(u[a],10);if(!(f<o.childNodes.length))throw t.createError("deserializePosition failed: node "+i.inspectNode(o)+" has no child with index "+f+", "+a);o=o.childNodes[parseInt(u[a],10)]}return new i.DomPosition(o,parseInt(s[1],10))}function l(t,n,r){r=r||e.DomRange.getRangeDocument(t).documentElement;if(!i.isAncestorOf(r,t.commonAncestorContainer,!0))throw new Error("serializeRange: range is not wholly contained within specified root node");var s=a(t.startContainer,t.startOffset,r)+","+a(t.endContainer,t.endOffset,r);return n||(s+="{"+u(r)+"}"),s}function c(t,n,r){n?r=r||i.getDocument(n):(r=r||document,n=r.documentElement);var s=/^([^,]+),([^,\{]+)({([^}]+)})?$/.exec(t),o=s[4],a=u(n);if(o&&o!==u(n))throw new Error("deserializeRange: checksums of serialized range root node ("+o+") and target root node ("+a+") do not match");var l=f(s[1],n,r),c=f(s[2],n,r),h=e.createRange(r);return h.setStart(l.node,l.offset),h.setEnd(c.node,c.offset),h}function h(e,t,n){t?n=n||i.getDocument(t):(n=n||document,t=n.documentElement);var r=/^([^,]+),([^,]+)({([^}]+)})?$/.exec(e),s=r[3];return!s||s===u(t)}function p(t,n,r){t=t||e.getSelection();var i=t.getAllRanges(),s=[];for(var o=0,u=i.length;o<u;++o)s[o]=l(i[o],n,r);return s.join("|")}function d(t,n,r){n?r=r||i.getWindow(n):(r=r||window,n=r.document.documentElement);var s=t.split("|"),o=e.getSelection(r),u=[];for(var a=0,f=s.length;a<f;++a)u[a]=c(s[a],n,r.document);return o.setRanges(u),o}function v(e,t,n){var r;t?r=n?n.document:i.getDocument(t):(n=n||window,t=n.document.documentElement);var s=e.split("|");for(var o=0,u=s.length;o<u;++o)if(!h(s[o],t,r))return!1;return!0}function g(e){var t=e.split(/[;,]/);for(var n=0,r=t.length,i,s;n<r;++n){i=t[n].split("=");if(i[0].replace(/^\s+/,"")==m){s=i[1];if(s)return decodeURIComponent(s.replace(/\s+$/,""))}}return null}function y(e){e=e||window;var t=g(e.document.cookie);t&&d(t,e.doc)}function b(t,n){t=t||window,n=typeof n=="object"?n:{};var r=n.expires?";expires="+n.expires.toUTCString():"",i=n.path?";path="+n.path:"",s=n.domain?";domain="+n.domain:"",o=n.secure?";secure":"",u=p(e.getSelection(t));t.document.cookie=encodeURIComponent(m)+"="+encodeURIComponent(u)+r+i+s+o}e.requireModules(["WrappedSelection","WrappedRange"]);var n="undefined";(typeof encodeURIComponent==n||typeof decodeURIComponent==n)&&t.fail("Global object is missing encodeURIComponent and/or decodeURIComponent method");var r=function(){function e(e){var t=[];for(var n=0,r=e.length,i;n<r;++n)i=e.charCodeAt(n),i<128?t.push(i):i<2048?t.push(i>>6|192,i&63|128):t.push(i>>12|224,i>>6&63|128,i&63|128);return t}function n(){var e=[];for(var t=0,n,r;t<256;++t){r=t,n=8;while(n--)(r&1)==1?r=r>>>1^3988292384:r>>>=1;e[t]=r>>>0}return e}function r(){return t||(t=n()),t}var t=null;return function(t){var n=e(t),i=-1,s=r();for(var o=0,u=n.length,a;o<u;++o)a=(i^n[o])&255,i=i>>>8^s[a];return(i^-1)>>>0}}(),i=e.dom,m="rangySerializedSelection";e.serializePosition=a,e.deserializePosition=f,e.serializeRange=l,e.deserializeRange=c,e.canDeserializeRange=h,e.serializeSelection=p,e.deserializeSelection=d,e.canDeserializeSelection=v,e.restoreSelectionFromCookie=y,e.saveSelectionCookie=b,e.getElementChecksum=u}),YUI.add("moodle-editor_ousupsub-rangy",function(e,t){rangy.initialized||rangy.init()},"@VERSION@",{requires:[]});
-YUI.add("moodle-editor_ousupsub-editor",function(e,t){function i(){i.superclass.constructor.apply(this,arguments)}function s(){}function o(){}function u(){u.superclass.constructor.apply(this,arguments)}var n="moodle-editor_ousupsub-editor",r={CONTENT:"editor_ousupsub_content",CONTENTWRAPPER:"editor_ousupsub_content_wrap",EDITORWRAPPER:".editor_ousupsub_content",TOOLBAR:"editor_ousupsub_toolbar",WRAPPER:"editor_ousupsub",HIGHLIGHT:"highlight"};e.extend(i,e.Base,{BLOCK_TAGS:["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"],PLACEHOLDER_CLASS:"ousupsub-tmp-class",ALL_NODES_SELECTOR:"[style],font[face]",FONT_FAMILY:"fontFamily",_wrapper:null,editor:null,toolbar:null,textarea:null,textareaLabel:null,plugins:null,_eventHandles:null,_tabFocus:null,_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this.textarea=e.one(document.getElementById(this.get("elementid")));if(!this.textarea)return;e.M.editor_ousupsub.addEditorReference(this.get("elementid"),this),this._eventHandles=[],this._wrapper=e.Node.create('<div class="'+r.WRAPPER+'"></div>'),this.editor=e.Node.create('<div id="'+this.get("elementid")+'editable" '+'contenteditable="true" '+'autocapitalize="none" '+'autocorrect="off" '+'role="textbox" '+'spellcheck="false" '+'aria-live="off" '+'class="'+r.CONTENT+'"></div>'),this.textareaLabel=e.one('[for="'+this.get("elementid")+'"]'),this.textareaLabel&&(this.textareaLabel.generateID(),this.editor.setAttribute("aria-labelledby",this.textareaLabel.get("id"))),this.setupToolbar();var t=e.Node.create('<div class="'+r.CONTENTWRAPPER+'"></div>');t.appendChild(this.editor),this._wrapper.appendChild(t);var n=this.textarea.getAttribute("cols")*6+41+"px";this.editor.setStyle("width",n),this.editor.setStyle("minWidth",n),this.editor.setStyle("maxWidth",n);var i=this.textarea.getAttribute("rows"),s=i*6+13+"px";this.editor.setStyle("height",s),this.editor.setStyle("minHeight",s),this.editor.setStyle("maxHeight",s),s=i*6+17+"px",t.setStyle("height",s),t.setStyle("minHeight",s),t.setStyle("maxHeight",s),this.disableCssStyling(),document.queryCommandSupported("DefaultParagraphSeparator")&&document.execCommand("DefaultParagraphSeparator",!1,"p"),this.textarea.get("parentNode").insert(this._wrapper,this.textarea),this.textarea.hide(),this.updateFromTextArea(),this.setupTextareaNavigation(),this._preventEnter(),this.publishEvents(),this.setupSelectionWatchers(),this.setupAutomaticPolling(),this.setupPlugins()},destructor:function(){e.Array.each(this.plugins,function(e,t){e.destroy(),this.plugins[t]=undefined},this),(new e.EventHandle(this._eventHandles)).detach(),this.textarea.show(),this._wrapper.remove(!0),e.M.editor_ousupsub.removeEditorReference(this.get("elementid"),this)},focus:function(){return this.editor.focus(),this},publishEvents:function(){return this.publish("change",{broadcast:!0,preventable:!0}),this.publish("pluginsloaded",{fireOnce:!0}),this.publish("ousupsub:selectionchanged",{prefix:"ousupsub"}),this},setupAutomaticPolling:function(){return this._registerEventHandle(this.editor.on(["keyup","cut"],this.updateOriginal,this)),this._registerEventHandle(this.editor.on(["keypress","delete"],this.cleanEditorHTMLSimple,this)),this._registerEventHandle(this.editor.on("paste",this.pasteCleanup,this)),this._registerEventHandle(this.editor.on("drop",this.updateOriginalDelayed,this)),this},updateOriginalDelayed:function(){return setTimeout(e.bind(this.updateOriginal,this),0),this},setupPlugins:function(){this.plugins={};var t=this.get("plugins"),n,r,i,s;for(n in t){r=t[n];if(!r.plugins)continue;for(i in r.plugins)s=r.plugins[i],s.name==="superscript"?this.plugins.superscript=new e.M.editor_ousupsub.EditorPlugin({name:"superscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"superscript",tags:"sup",keys:["94"],icon:"e/superscript",keyDescription:"Shift + ^ or Up arrow"}):s.name==="subscript"&&(this.plugins.subscript=new e.M.editor_ousupsub.EditorPlugin({name:"subscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"subscript",tags:"sub",keys:["95"],icon:"e/subscript",keyDescription:"Shift + _ or Down arrow"}))}return this._undoStack=[],this._redoStack=[],this.plugins.undo=new e.M.editor_ousupsub.EditorPlugin({name:"undo",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,keys:["90"],callback:this._undoHandler}),this.plugins.redo=new e.M.editor_ousupsub.EditorPlugin({name:"redo",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,keys:["89"],callback:this._redoHandler}),this.on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.on("ousupsub:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates(),this.setupUndoHandlers(),this.fire("pluginsloaded"),this},setupUndoHandlers:function(){return this._registerEventHandle(this._wrapper.delegate("key",this._undoHandler,"down:90+ctrl","."+r.CONTENT,this)),this._registerEventHandle(this._wrapper.delegate("key",this._redoHandler,"down:89+ctrl","."+r.CONTENT,this)),this},pluginEnabled:function(e){return this.plugins[e]?!0:!1},enablePlugins:function(e){this._setPluginState(!0,e)},disablePlugins:function(e){this._setPluginState(!1,e)},_setPluginState:function(t,n){var r="disableButtons";t&&(r="enableButtons"),n?this.plugins[n][r]():e.Object.each(this.plugins,function(e){e[r]()},this)},_registerEventHandle:function(e){this._eventHandles.push(e)},setupToolbar:function(){return this.toolbar=e.Node.create('<div class="'+r.TOOLBAR+'" role="toolbar" aria-live="off"></div>'),this._wrapper.appendChild(this.toolbar),this.textareaLabel&&this.toolbar.setAttribute("aria-labelledby",this.textareaLabel.get("id")),this.setupToolbarNavigation(),this},setupToolbarNavigation:function(){return this._wrapper.delegate("key",this.toolbarKeyboardNavigation,"down:37,39","."+r
+YUI.add("moodle-editor_ousupsub-editor",function(e,t){function i(){i.superclass.constructor.apply(this,arguments)}function s(){}function o(){}function u(){u.superclass.constructor.apply(this,arguments)}var n="moodle-editor_ousupsub-editor",r={CONTENT:"editor_ousupsub_content",CONTENTWRAPPER:"editor_ousupsub_content_wrap",EDITORWRAPPER:".editor_ousupsub_content",TOOLBAR:"editor_ousupsub_toolbar",WRAPPER:"editor_ousupsub",HIGHLIGHT:"highlight"};e.extend(i,e.Base,{BLOCK_TAGS:["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"],PLACEHOLDER_CLASS:"ousupsub-tmp-class",ALL_NODES_SELECTOR:"[style],font[face]",FONT_FAMILY:"fontFamily",_wrapper:null,editor:null,toolbar:null,textarea:null,textareaLabel:null,plugins:null,_eventHandles:null,_tabFocus:null,_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this.textarea=e.one(document.getElementById(this.get("elementid")));if(!this.textarea)return;e.M.editor_ousupsub.addEditorReference(this.get("elementid"),this),this._eventHandles=[],this._wrapper=e.Node.create('<div class="'+r.WRAPPER+'"></div>'),this.editor=e.Node.create('<div id="'+this.get("elementid")+'editable" '+'contenteditable="true" '+'autocapitalize="none" '+'autocorrect="off" '+'role="textbox" '+'spellcheck="false" '+'aria-live="off" '+'class="'+r.CONTENT+'"></div>'),this.textareaLabel=e.one('[for="'+this.get("elementid")+'"]'),this.textareaLabel&&(this.textareaLabel.generateID(),this.editor.setAttribute("aria-labelledby",this.textareaLabel.get("id"))),this.setupToolbar();var t=e.Node.create('<div class="'+r.CONTENTWRAPPER+'"></div>');t.appendChild(this.editor),this._wrapper.appendChild(t);var n=this.textarea.getAttribute("cols")*6+41+"px";this.editor.setStyle("width",n),this.editor.setStyle("minWidth",n),this.editor.setStyle("maxWidth",n);var i=this.textarea.getAttribute("rows"),s=i*6+13+"px";this.editor.setStyle("height",s),this.editor.setStyle("minHeight",s),this.editor.setStyle("maxHeight",s),s=i*6+17+"px",t.setStyle("height",s),t.setStyle("minHeight",s),t.setStyle("maxHeight",s),this.disableCssStyling(),document.queryCommandSupported("DefaultParagraphSeparator")&&document.execCommand("DefaultParagraphSeparator",!1,"p"),this.textarea.get("parentNode").insert(this._wrapper,this.textarea),this.textarea.hide(),this.updateFromTextArea(),this.setupTextareaNavigation(),this._preventEnter(),this.publishEvents(),this.setupSelectionWatchers(),this.setupAutomaticPolling(),this.setupPlugins()},destructor:function(){e.Array.each(this.plugins,function(e,t){e.destroy(),this.plugins[t]=undefined},this),(new e.EventHandle(this._eventHandles)).detach(),this.textarea.show(),this._wrapper.remove(!0),e.M.editor_ousupsub.removeEditorReference(this.get("elementid"),this)},focus:function(){return this.editor.focus(),this},publishEvents:function(){return this.publish("change",{broadcast:!0,preventable:!0}),this.publish("pluginsloaded",{fireOnce:!0}),this.publish("ousupsub:selectionchanged",{prefix:"ousupsub"}),this},setupAutomaticPolling:function(){return this._registerEventHandle(this.editor.on(["keyup","cut"],this.updateOriginal,this)),this._registerEventHandle(this.editor.on(["keypress","delete"],this.cleanEditorHTMLSimple,this)),this._registerEventHandle(this.editor.on("paste",this.pasteCleanup,this)),this._registerEventHandle(this.editor.on("drop",this.updateOriginalDelayed,this)),this},updateOriginalDelayed:function(){return setTimeout(e.bind(this.updateOriginal,this),0),this},setupPlugins:function(){this.plugins={};var t=this.get("plugins"),n,r,i,s;for(n in t){r=t[n];if(!r.plugins)continue;for(i in r.plugins)s=r.plugins[i],s.name==="superscript"?this.plugins.superscript=new e.M.editor_ousupsub.EditorPlugin({name:"superscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"superscript",tags:"sup",keys:["94"],icon:"e/superscript",keyDescription:"Shift + ^ or Up arrow"}):s.name==="subscript"&&(this.plugins.subscript=new e.M.editor_ousupsub.EditorPlugin({name:"subscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"subscript",tags:"sub",keys:["95"],icon:"e/subscript",keyDescription:"Shift + _ or Down arrow"}))}return this._undoStack=[],this._redoStack=[],this.on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.on("ousupsub:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates(),this.setupUndoHandlers(),this.fire("pluginsloaded"),this},setupUndoHandlers:function(){return this._registerEventHandle(this._wrapper.delegate("key",this._undoHandler,"down:90+ctrl","."+r.CONTENT,this)),this._registerEventHandle(this._wrapper.delegate("key",this._redoHandler,"down:89+ctrl","."+r.CONTENT,this)),this},pluginEnabled:function(e){return this.plugins[e]?!0:!1},enablePlugins:function(e){this._setPluginState(!0,e)},disablePlugins:function(e){this._setPluginState(!1,e)},_setPluginState:function(t,n){var r="disableButtons";t&&(r="enableButtons"),n?this.plugins[n][r]():e.Object.each(this.plugins,function(e){e[r]()},this)},_registerEventHandle:function(e){this._eventHandles.push(e)},setupToolbar:function(){return this.toolbar=e.Node.create('<div class="'+r.TOOLBAR+'" role="toolbar" aria-live="off"></div>'),this._wrapper.appendChild(this.toolbar),this.textareaLabel&&this.toolbar.setAttribute("aria-labelledby",this.textareaLabel.get("id")),this.setupToolbarNavigation(),this},setupToolbarNavigation:function(){return this._wrapper.delegate("key",this.toolbarKeyboardNavigation,"down:37,39","."+r
 .TOOLBAR,this),this._wrapper.delegate("focus",function(e){this._setTabFocus(e.currentTarget)},"."+r.TOOLBAR+" button",this),this},toolbarKeyboardNavigation:function(e){e.preventDefault();var t=this.toolbar.all("button"),n=1,r,i=e.target.ancestor("button",!0);e.keyCode===37&&(n=-1),r=this._findFirstFocusable(t,i,n),r&&(r.focus(),this._setTabFocus(r))},_findFirstFocusable:function(e,t,n){var r=0,i,s,o,u;u=e.indexOf(t),u<-1&&(u=0);while(r<e.size()){u+=n,u<0?u=e.size()-1:u>=e.size()&&(u=0),s=e.item(u),r++;if(s.hasAttribute("hidden")||s.hasAttribute("disabled"))continue;i=s.ancestor(".ousupsub_group");if(i.hasAttribute("hidden"))continue;o=s;break}return o},checkTabFocus:function(){if(this._tabFocus)if(this._tabFocus.hasAttribute("disabled")||this._tabFocus.hasAttribute("hidden")||this._tabFocus.ancestor(".ousupsub_group").hasAttribute("hidden")){var e=this._findFirstFocusable(this.toolbar.all("button"),this._tabFocus,-1);e&&(this._tabFocus.compareTo(document.activeElement)&&e.focus(),this._setTabFocus(e))}return this},_setTabFocus:function(e){return this._tabFocus&&this._tabFocus.setAttribute("tabindex","-1"),this._tabFocus=e,this._tabFocus.setAttribute("tabindex",0),this.toolbar.setAttribute("aria-activedescendant",this._tabFocus.generateID()),this},disableCssStyling:function(){try{document.execCommand("styleWithCSS",0,!1)}catch(e){try{document.execCommand("useCSS",0,!0)}catch(t){try{document.execCommand("styleWithCSS",!1,!1)}catch(n){}}}},_getEmptyContent:function(){return""},updateFromTextArea:function(){this.editor.setHTML(""),this.editor.append(this.textarea.get("value")),this.cleanEditorHTML(),this.editor.getHTML()===""&&this.editor.setHTML(this._getEmptyContent())},updateOriginal:function(){var e=this.textarea.get("value"),t=this.getCleanHTML();return t===""&&this.isActive()&&(t=this._getEmptyContent()),t=this._removeUnicodeCharacters(t),t=t.trim(),e!==t&&(this.textarea.set("value",t),this.fire("change")),this},setupTextareaNavigation:function(){return this._registerEventHandle(this._wrapper.delegate("key",this.textareaKeyboardNavigation,"down:38,40","."+r.CONTENT,this)),this._registerEventHandle(this._wrapper.delegate("key",this.textareaKeyboardNavigation,"press:94, 95","."+r.CONTENT,this)),this},textareaKeyboardNavigation:function(e){e.preventDefault(),!YUI.Env.UA.android&&!this.isActive()&&this.focus();var t="",n=1,r=window.event||e,i=r.keyCode?r.keyCode:r.charCode;if(i===38||i===94)t="superscript";else if(i===40||i===95)t="subscript";if(!t)return;this._applyTextCommand(t,n)},_preventEnter:function(){var t="keypress";if(e.UA.webkit||e.UA.ie)t="keydown";this.editor.on(t,function(e){var t=window.event||e;if(t.keyCode===13){if(!t.preventDefault){t.returnValue=!1;return}t.preventDefault()}},this)},_addToRedo:function(e){this._redoStack.push(e)},_addToUndo:function(e,t){var n=this._undoStack[this._undoStack.length-1];typeof t=="undefined"&&(t=!1),n!==e&&(this._undoStack.push(e),t&&(this._redoStack=[]));while(this._undoStack.length>this._maxUndos)this._undoStack.shift()},_getHTML:function(){return this.getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(e){if(this._undoStack.length===1)return this._undoStack[0];var t=this._undoStack.pop();return t===e&&(t=this._undoStack.pop()),this._undoStack.length===0&&this._addToUndo(t),t},_restoreValue:function(e){this.editor.setHTML(e),this._addToUndo(e)},_updateButtonsStates:function(){this._undoStack.length>1?this.enablePlugins("undo"):this.disablePlugins("undo"),this._redoStack.length>0?this.enablePlugins("redo"):this.disablePlugins("redo")},_undoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getUndo(t);if(t===n){this._updateButtonsStates();return}this._restoreValue(n),this._addToRedo(t),this._updateButtonsStates()},_redoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getRedo();if(n===undefined||t===n){this._updateButtonsStates();return}this._restoreValue(n),this._updateButtonsStates()},_changeListener:function(e){if(e.event&&e.event.type.indexOf("key")!==-1&&e.event.keyCode!==39&&e.event.keyCode!==37&&e.event.keyCode!==40&&e.event.keyCode!==38)return;this._addToUndo(this._getHTML(),!0),this._updateButtonsStates()}},{NS:"editor_ousupsub",ATTRS:{elementid:{value:null,writeOnce:!0},contextid:{value:null,writeOnce:!0},plugins:{value:{},writeOnce:!0}}}),e.augment(i,e.EventTarget),e.namespace("M.editor_ousupsub").Editor=i,s.ATTRS={},s.prototype={getCleanHTML:function(){var t=this.editor.cloneNode(!0),n,r="",i="";e.each(t.all('[id^="yui"]'),function(e){e.removeAttribute("id")}),t.all(".ousupsub_control").remove(!0),n=t.get("innerHTML");if(n===""||n==="<br>")return"";if(n.indexOf(r)===0){var s=n.length-(r.length+i.length);n=n.substr(r.length,s)}return this._cleanHTML(n)},cleanEditorHTML:function(){return this.editor.set("innerHTML",this._cleanHTML(this.editor.get("innerHTML"))),this},cleanEditorHTMLSimple:function(){var e=window.rangy.saveSelection();return this.editor.set("innerHTML",this._cleanHTMLSimple(this.editor.get("innerHTML"))),window.rangy.restoreSelection(e,!0),this},_cleanHTMLSimple:function(e){var t=[{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>(.+)<\/span>/gi,replace:"$1"}];return this._filterContentWithRules(e,t)},_cleanHTML:function(e){var t=[{regex:/<p[^>]*>(&nbsp;|\s)*<\/p>/gi,replace:""},{regex:/<sup[^>]*(&nbsp;|\s)*>/gi,replace:"<sup>"},{regex:/<sub[^>]*(&nbsp;|\s)*>/gi,replace:"<sub>"},{regex:/&nbsp;/gi,replace:" "},{regex:/<\/sup>(\s*)+<sup>/gi,replace:"$1"},{regex:/<\/sub>(\s*)+<sub>/gi,replace:"$1"},{regex:/<sup>(\s*)+/gi,replace:"$1<sup>"},{regex:/<sub>(\s*)+/gi,replace:"$1<sub>"},{regex:/(\s*)+<\/sup>/gi,replace:"</sup>$1"},{regex:/(\s*)+<\/sub>/gi,replace:"</sub>$1"},{regex:/<br>/gi,replace:""},{regex:/<style[^>]*>[\s\S]*?<\/style>/gi,replace:""},{regex:/<!--(?![\s\S]*?-->)/gi,replace:""},{regex:/<script[^>]*>[\s\S]*?<\/script>/gi,replace:""},{regex:/<\/?(?:br|title|meta|style|std|font|html|body|link|a|ul|li|ol)[^>]*?>/gi,replace:""},{regex:/<\/?(?:b|i|u|ul|ol|li|img)[^>]*?>/gi
 ,replace:""},{regex:/<\/?(?:abbr|address|area|article|aside|audio|base|bdi|bdo|blockquote)[^>]*?>/gi,replace:""},{regex:/<\/?(?:button|canvas|caption|cite|code|col|colgroup|content|data)[^>]*?>/gi,replace:""},{regex:/<\/?(?:datalist|dd|decorator|del|details|dialog|dfn|div|dl|dt|element)[^>]*?>/gi,replace:""},{regex:/<\/?(?:em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5)[^>]*?>/gi,replace:""},{regex:/<\/?(?:h6|header|hgroup|hr|iframe|input|ins|kbd|keygen|label|legend)[^>]*?>/gi,replace:""},{regex:/<\/?(?:main|map|mark|menu|menuitem|meter|nav|noscript|object|optgroup)[^>]*?>/gi,replace:""},{regex:/<\/?(?:option|output|p|param|pre|progress|q|rp|rt|rtc|ruby|samp)[^>]*?>/gi,replace:""},{regex:/<\/?(?:section|select|script|shadow|small|source|std|strong|summary)[^>]*?>/gi,replace:""},{regex:/<\/?(?:svg|table|tbody|td|template|textarea|time|tfoot|th|thead|tr|track)[^>]*?>/gi,replace:""},{regex:/<\/?(?:var|wbr|video)[^>]*?>/gi,replace:""},{regex:/<\/?(?:acronym|applet|basefont|big|blink|center|dir|frame|frameset|isindex)[^>]*?>/gi,replace:""},{regex:/<\/?(?:listing|noembed|plaintext|spacer|strike|tt|xmp)[^>]*?>/gi,replace:""},{regex:/<\/?(?:jsl|nobr)[^>]*?>/gi,replace:""},{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>[\s\S]*?([\s\S]*?)<\/span>/gi,replace:"$1"},{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>(&nbsp;|\s)*<\/span>/gi,replace:""},{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>[\s\S]*?([\s\S]*?)<\/span>/gi,replace:"$1"},{regex:/<sup[^>]*>(&nbsp;|\s)*<\/sup>/gi,replace:""},{regex:/<sub[^>]*>(&nbsp;|\s)*<\/sub>/gi,replace:""},{regex:/<xmlns.*?>(.*?)<\/xmlns.*?>/gi,replace:"$1"}];return this._filterContentWithRules(e,t)},cleanEditorHTMLEmptySupAndSubTags:function(){var e=window.rangy.saveSelection(),t=this.editor.get("innerHTML");return t=this._cleanEditorHTMLEmptySupAndSubTags(t),t=this._removeUnicodeCharacters(t),this.editor.set("innerHTML",t),window.rangy.restoreSelection(e,!0),this},_cleanEditorHTMLEmptySupAndSubTags:function(e){var t=[{regex:/<su[bp][^>]*>(&#65279;|\s)*<\/su[bp]>/gi,replace:""}];return this._filterContentWithRules(e,t)},_filterContentWithRules:function(e,t){var n=0;for(n=0;n<t.length;n++)e=e.replace(t[n].regex,t[n].replace);return e},pasteCleanup:function(e){if(e.type==="paste"){var t=e._event;if(t&&t.clipboardData&&t.clipboardData.getData){var n=t.clipboardData.types,r=!1;if(!n)r=!1;else if(typeof n.contains=="function")r=n.contains("text/html");else{if(typeof n.indexOf!="function")return this.fallbackPasteCleanupDelayed(),!0;r=n.indexOf("text/html")>-1;if(!r)if(n.indexOf("com.apple.webarchive")>-1||n.indexOf("com.apple.iWork.TSPNativeData")>-1)return this.fallbackPasteCleanupDelayed(),!0}if(r){var i;try{i=t.clipboardData.getData("text/html")}catch(s){return this.fallbackPasteCleanupDelayed(),!0}e.preventDefault(),i=this._cleanPasteHTML(i);var o=window.rangy.saveSelection();return this.insertContentAtFocusPoint(i),window.rangy.restoreSelection(o),window.rangy.getSelection().collapseToEnd(),this.updateOriginal(),this._normaliseTextarea(),!1}return this.fallbackPasteCleanupDelayed(),!0}return this.fallbackPasteCleanupDelayed(),!0}return this.updateOriginalDelayed(),!0},fallbackPasteCleanup:function(){var e=window.rangy.saveSelection(),t=this.editor.get("innerHTML");return this.editor.set("innerHTML",this._cleanPasteHTML(t)),this.updateOriginal(),window.rangy.restoreSelection(e,!0),this},fallbackPasteCleanupDelayed:function(){return setTimeout(e.bind(this.fallbackPasteCleanup,this),0),this},_cleanPasteHTML:function(e){if(!e||e.length===0)return"";var t=[{regex:/<\s*\/html\s*>([\s\S]+)$/gi,replace:""},{regex:/<!--\[if[\s\S]*?endif\]-->/gi,replace:""},{regex:/<!--(Start|End)Fragment-->/gi,replace:""},{regex:/<xml[^>]*>[\s\S]*?<\/xml>/gi,replace:""},{regex:/<\?xml[^>]*>[\s\S]*?<\\\?xml>/gi,replace:""},{regex:/<\/?\w+:[^>]*>/gi,replace:""}];e=this._filterContentWithRules(e,t),e=this._cleanHTML(e);if(e.length===0||!e.match(/\S/))return e;var n=document.createElement("div");return n.innerHTML=e,e=n.innerHTML,n.innerHTML="",t=[{regex:/(<[^>]*?style\s*?=\s*?"[^>"]*?)(?:[\s]*MSO[-:][^>;"]*;?)+/gi,replace:"$1"},{regex:/(<[^>]*?class\s*?=\s*?"[^>"]*?)(?:[\s]*MSO[_a-zA-Z0-9\-]*)+/gi,replace:"$1"},{regex:/(<[^>]*?class\s*?=\s*?"[^>"]*?)(?:[\s]*Apple-[_a-zA-Z0-9\-]*)+/gi,replace:"$1"},{regex:/<a [^>]*?name\s*?=\s*?"OLE_LINK\d*?"[^>]*?>\s*?<\/a>/gi,replace:""}],e=this._filterContentWithRules(e,t),e=this._cleanHTML(e),e},_applyTextCommand:function(e,t){var n,r;if(t){r=this.getCursorTag();if(r==="superscript"&&e===r||r==="subscript"&&e===r)return;r==="superscript"&&e==="subscript"?e="superscript":r==="subscript"&&e==="superscript"&&(e="subscript");if(!this.pluginEnabled(e))return}document.execCommand(e,!1,null),n=window.rangy.getSelection();if(n.isCollapsed){this.cleanEditorHTMLEmptySupAndSubTags(),r=e==="superscript"?"sup":"sub";var i=this.insertContentAtFocusPoint("<"+r+">\ufeff&#65279;</"+r+">"),s=window.rangy.createRange();s.selectNode(i._node.childNodes[0]),this.setSelection([s]),n.rangeCount&&n.collapseToEnd()}this._normaliseTextarea(),this.cleanEditorHTMLSimple(),this.saveSelection(),this.updateOriginal()},getCursorTag:function(){var e="text",t=window.rangy.getSelection(),n=t.focusNode.nodeName.toLowerCase(),r=t.focusNode.parentNode.nodeName.toLowerCase(),i="";t.focusNode.childNodes&&t.focusNode.childNodes[t.focusOffset-1]&&(i=t.focusNode.childNodes[t.focusOffset-1].nodeName.toLowerCase());if(n==="sup"||r==="sup"||i==="sup")e="superscript";else if(n==="sub"||r==="sub"||i==="sub")e="subscript";return e},_normaliseTextarea:function(){var e=window.rangy.saveSelection(),t=this._getEditorNode();this._removeSingleNodesByName(t,"br");var n=["p","b","i","u","ul","ol","li"];for(var r=0;r<n.length;r++)this._removeNodesByName(t,n[r]);this._normaliseTagInTextarea("sup"),this._normaliseTagInTextarea("sub"),this._removeNodesByName(t,"span"),window.rangy.restoreSelection(e,!0),t.normalize()},_normaliseTagInTextarea:function(e){var t=[],n=this._getEditorNode
 (),r,i=!1,s;t=this._copyArray(n.querySelectorAll(e),t);for(var o=0;o<t.length;o++){s=t[o],r=s.parentNode,i=!1;if(r===n)continue;r.firstChild===s&&r.lastChild===s&&r.nodeName.toLowerCase()===e&&(i=!0),!i&&s&&r.nodeName.toLowerCase()===e&&(i=!0,this._splitParentNode(r,e)),this._removeNodesByName(s,e),i&&this._removeNodesByName(r,e)}t=[],t=this._copyArray(n.querySelectorAll(e),t);for(o=0;o<t.length;o++){s=t[o];if(!s.previousSibling||s.previousSibling.nodeName.toLowerCase()!==e)continue;this._mergeNodes(s,s.previousSibling)}},_mergeNodes:function(e,t){var n=[],r=e.childNodes;for(var i=0;i<r.length;i++)n.push(r.item(i));for(i=0;i<n.length;i++)t.appendChild(n[i]);this._removeNode(e)},_splitParentNode:function(e,t){var n=[],r,i=[];n=this._copyArray(e.childNodes,n);var s,o;for(s=0;s<n.length;s++){r=n[s],i=[],r.nodeName.toLowerCase()===t?i=this._copyArray(r.childNodes,i):(i[0]=document.createElement(t),i[0].appendChild(r));for(o=0;o<i.length;o++)e.parentNode.insertBefore(i[o],e)}},_copyArray:function(e,t){for(var n=0;n<e.length;n++)t.push(e[n]);return t},_removeNodesByName:function(e,t){var n,r=e.nodeName.toLowerCase()===t,i=[],s=e.childNodes;e.nodeName.toLowerCase()==="span"&&e.id.indexOf("selectionBoundary_")>-1&&(r=!1),i=this._copyArray(s,i);for(var o=0;o<i.length;o++){n=i[o],n.childNodes&&n.childNodes.length&&this._removeNodesByName(n,t);if(r){var u=e.parentNode;u.insertBefore(n,e)}}r&&this._removeNode(e)},_removeSingleNodesByName:function(e,t){if(!e.childNodes)return;var n,r=[];r=this._copyArray(e.childNodes,r);for(var i=0;i<r.length;i++)n=r[i],n.childNodes&&n.childNodes.length&&this._removeSingleNodesByName(n,t),n.nodeName.toLowerCase()===t&&this._removeNode(n)},_removeNode:function(e){return e.remove?e.remove():e.parentNode.removeChild(e)},_getEditor:function(e){return e||(e=this.get("host")),this},_getEditorNode:function(e){return this._getEditor(e).editor._node},_removeUnicodeCharacters:function(e){var t=[];for(var n=0;n<e.length;n++){if(e.charCodeAt(n)=="65279")continue;t.push(e.charAt(n))}return t.join("")}},e.Base.mix(e.M.editor_ousupsub.Editor,[s]),o.ATTRS={},o.prototype={_selections:null,_lastSelection:null,_focusFromClick:!1,setupSelectionWatchers:function(){return this._registerEventHandle(this.on("ousupsub:selectionchanged",this.saveSelection,this)),this._registerEventHandle(this.editor.on("focus",this.restoreSelection,this)),this._registerEventHandle(this.editor.on("mousedown",function(){this._focusFromClick=!0},this)),this._registerEventHandle(this.editor.on("blur",function(){this._focusFromClick=!1,this.updateOriginal()},this)),this._registerEventHandle(this.editor.on(["keyup","focus"],function(t){setTimeout(e.bind(this._hasSelectionChanged,this,t),0)},this)),this._registerEventHandle(this.editor.on("gesturemoveend",function(t){setTimeout(e.bind(this._hasSelectionChanged,this,t),0)},{standAlone:!0},this)),this},isActive:function(){var e=window.rangy.createRange(),t=window.rangy.getSelection();return t.rangeCount?!document.activeElement||!this.editor.compareTo(document.activeElement)&&!this.editor.contains(document.activeElement)?!1:(e.selectNode(this.editor.getDOMNode()),e.intersectsRange(t.getRangeAt(0))):!1},getSelectionFromNode:function(e){var t=window.rangy.createRange();return t.selectNode(e.getDOMNode()),[t]},saveSelection:function(){this.isActive()&&(this._selections=this.getSelection())},restoreSelection:function(){this._focusFromClick||this._selections&&this.setSelection(this._selections),this._focusFromClick=!1},getSelection:function(){return window.rangy.getSelection().getAllRanges()},selectionContainsNode:function(e){return window.rangy.getSelection().containsNode(e.getDOMNode(),!0)},selectionFilterMatches:function(e,t,n){typeof n=="undefined"&&(n=!0),t||(t=this.getSelectedNodes());var r=t.size()>0,i=!1,s=this.editor,o=function(e){return e===s};return s.one(e)?(t.each(function(t){if(n){if(!r||!t.ancestor(e,!0,o))r=!1}else!i&&t.ancestor(e,!0,o)&&(i=!0)},this),n?r:i):!1},getSelectedNodes:function(){var t=new e.NodeList,n,r,i,s,o;r=window.rangy.getSelection(),r.rangeCount?i=r.getRangeAt(0):i=window.rangy.createRange(),i.collapsed&&i.commonAncestorContainer!==this.editor.getDOMNode()&&i.commonAncestorContainer!==e.config.doc&&(i=i.cloneRange(),i.selectNode(i.commonAncestorContainer)),n=i.getNodes();for(o=0;o<n.length;o++)s=e.one(n[o]),this.editor.contains(s)&&t.push(s);return t},_hasSelectionChanged:function(e){var t=window.rangy.getSelection(),n,r=!1;return t.rangeCount?n=t.getRangeAt(0):n=window.rangy.createRange(),this._lastSelection&&!this._lastSelection.equals(n)?(r=!0,this._fireSelectionChanged(e)):(this._lastSelection=n,r)},_fireSelectionChanged:function(e){this.fire("ousupsub:selectionchanged",{event:e,selectedNodes:this.getSelectedNodes()})},getSelectionParentNode:function(){var e=window.rangy.getSelection();return e.rangeCount?e.getRangeAt(0).commonAncestorContainer:!1},setSelection:function(e){var t=window.rangy.getSelection();t.setRanges(e)},insertContentAtFocusPoint:function(t){var n=window.rangy.getSelection(),r,i=e.Node.create(t);return n.rangeCount&&(r=n.getRangeAt(0)),r&&(r.deleteContents(),r.insertNode(i.getDOMNode())),i}},e.Base.mix(e.M.editor_ousupsub.Editor,[o]);var a="disabled",f="highlight",l=".ousupsub_group.",c="_group";e.extend(u,e.Base,{name:null,exec:null,editor:null,toolbar:null,_eventHandles:null,buttons:null,buttonNames:null,buttonStates:null,DISABLED:0,ENABLED:1,_buttonHandlers:null,_primaryKeyboardShortcut:null,_highlightQueue:null,initializer:function(e){this.name=e.name,this.exec=e.exec,this.toolbar=e.toolbar,this.editor=e.editor,this.buttons={},this.buttonNames=[],this.buttonStates={},this._primaryKeyboardShortcut=[],this._buttonHandlers=[],this._menuHideHandlers=[],this._highlightQueue={},this._eventHandles=[],this.addButton(e)},destructor:function(){(new e.EventHandle(this._eventHandles)).detach()},markUpdated:function(){return this.get("host").saveSelection(),this.get("host").updateOriginal()},registerEventHandle:function(e){this._eventHandles
diff --git a/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-debug.js b/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-debug.js
index fd1e48e5888ca9f642d60086d823f733d348f9be..a3db03a36380cbea66ba3678c68c2850acab2996 100644
--- a/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-debug.js
+++ b/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-debug.js
@@ -422,28 +422,6 @@ Y.extend(Editor, Y.Base, {
         this._undoStack = [];
         this._redoStack = [];
 
-        // Add undo plugin
-        this.plugins.undo = new Y.M.editor_ousupsub.EditorPlugin({
-            name: 'undo',
-            group: group.group,
-            editor: this.editor,
-            toolbar: this.toolbar,
-            host: this,
-            keys: ['90'],
-            callback: this._undoHandler
-        });
-
-        // Add redo plugin
-        this.plugins.redo = new Y.M.editor_ousupsub.EditorPlugin({
-            name: 'redo',
-            group: group.group,
-            editor: this.editor,
-            toolbar: this.toolbar,
-            host: this,
-            keys: ['89'],
-            callback: this._redoHandler
-        });
-
         // Enable the undo once everything has loaded.
         this.on('pluginsloaded', function() {
             // Adds the current value to the stack.
diff --git a/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-min.js b/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-min.js
index 6cede6f7d45e6db73890bdb5a64caee859814f31..24e89d510ae9e819a9dbb5c5986b285b229e2484 100644
--- a/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-min.js
+++ b/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor-min.js
@@ -1,4 +1,4 @@
-YUI.add("moodle-editor_ousupsub-editor",function(e,t){function i(){i.superclass.constructor.apply(this,arguments)}function s(){}function o(){}function u(){u.superclass.constructor.apply(this,arguments)}var n="moodle-editor_ousupsub-editor",r={CONTENT:"editor_ousupsub_content",CONTENTWRAPPER:"editor_ousupsub_content_wrap",EDITORWRAPPER:".editor_ousupsub_content",TOOLBAR:"editor_ousupsub_toolbar",WRAPPER:"editor_ousupsub",HIGHLIGHT:"highlight"};e.extend(i,e.Base,{BLOCK_TAGS:["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"],PLACEHOLDER_CLASS:"ousupsub-tmp-class",ALL_NODES_SELECTOR:"[style],font[face]",FONT_FAMILY:"fontFamily",_wrapper:null,editor:null,toolbar:null,textarea:null,textareaLabel:null,plugins:null,_eventHandles:null,_tabFocus:null,_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this.textarea=e.one(document.getElementById(this.get("elementid")));if(!this.textarea)return;e.M.editor_ousupsub.addEditorReference(this.get("elementid"),this),this._eventHandles=[],this._wrapper=e.Node.create('<div class="'+r.WRAPPER+'"></div>'),this.editor=e.Node.create('<div id="'+this.get("elementid")+'editable" '+'contenteditable="true" '+'autocapitalize="none" '+'autocorrect="off" '+'role="textbox" '+'spellcheck="false" '+'aria-live="off" '+'class="'+r.CONTENT+'"></div>'),this.textareaLabel=e.one('[for="'+this.get("elementid")+'"]'),this.textareaLabel&&(this.textareaLabel.generateID(),this.editor.setAttribute("aria-labelledby",this.textareaLabel.get("id"))),this.setupToolbar(),this.setupTemplateEditor(),this.disableCssStyling(),document.queryCommandSupported("DefaultParagraphSeparator")&&document.execCommand("DefaultParagraphSeparator",!1,"p"),this.textarea.get("parentNode").insert(this._wrapper,this.textarea),this.textarea.hide(),this.updateFromTextArea(),this.setupTextareaNavigation(),this._preventEnter(),this.publishEvents(),this.setupSelectionWatchers(),this.setupAutomaticPolling(),this.setupPlugins()},destructor:function(){e.Array.each(this.plugins,function(e,t){e.destroy(),this.plugins[t]=undefined},this),(new e.EventHandle(this._eventHandles)).detach(),this.textarea.show(),this._wrapper.remove(!0),e.M.editor_ousupsub.removeEditorReference(this.get("elementid"),this)},focus:function(){return this.editor.focus(),this},publishEvents:function(){return this.publish("change",{broadcast:!0,preventable:!0}),this.publish("pluginsloaded",{fireOnce:!0}),this.publish("ousupsub:selectionchanged",{prefix:"ousupsub"}),this},setupAutomaticPolling:function(){return this._registerEventHandle(this.editor.on(["keyup","cut"],this.updateOriginal,this)),this._registerEventHandle(this.editor.on(["keypress","delete"],this.cleanEditorHTMLSimple,this)),this._registerEventHandle(this.editor.on("paste",this.pasteCleanup,this)),this._registerEventHandle(this.editor.on("drop",this.updateOriginalDelayed,this)),this},updateOriginalDelayed:function(){return setTimeout(e.bind(this.updateOriginal,this),0),this},setupPlugins:function(){this.plugins={};var t=this.get("plugins"),n,r,i,s;for(n in t){r=t[n];if(!r.plugins)continue;for(i in r.plugins)s=r.plugins[i],s.name==="superscript"?this.plugins.superscript=new e.M.editor_ousupsub.EditorPlugin({name:"superscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"superscript",tags:"sup",keys:["94"],icon:"e/superscript",keyDescription:"Shift + ^ or Up arrow"}):s.name==="subscript"&&(this.plugins.subscript=new e.M.editor_ousupsub.EditorPlugin({name:"subscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"subscript",tags:"sub",keys:["95"],icon:"e/subscript",keyDescription:"Shift + _ or Down arrow"}))}return this._undoStack=[],this._redoStack=[],this.plugins.undo=new e.M.editor_ousupsub.EditorPlugin({name:"undo",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,keys:["90"],callback:this._undoHandler}),this.plugins.redo=new e.M.editor_ousupsub.EditorPlugin({name:"redo",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,keys:["89"],callback:this._redoHandler}),this.on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.on("ousupsub:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates(),this.setupUndoHandlers(),this.fire("pluginsloaded"),this},setupUndoHandlers:function(){return this._registerEventHandle(this._wrapper.delegate("key",this._undoHandler,"down:90+ctrl","."+r.CONTENT,this)),this._registerEventHandle(this._wrapper.delegate("key",this._redoHandler,"down:89+ctrl","."+r.CONTENT,this)),this},pluginEnabled:function(e){return this.plugins[e]?!0:!1},enablePlugins:function(e){this._setPluginState(!0,e)},disablePlugins:function(e){this._setPluginState(!1,e)},_setPluginState:function(t,n){var r="disableButtons";t&&(r="enableButtons"),n?this.plugins[n][r]():e.Object.each(this.plugins,function(e){e[r]()},this)},_registerEventHandle:function(e){this._eventHandles.push(e)},setupToolbar:function(){return this.toolbar=e.Node.create('<div class="'+r.TOOLBAR+'" role="toolbar" aria-live="off"></div>'),this._wrapper.appendChild(this.toolbar),this.textareaLabel&&this.toolbar.setAttribute("aria-labelledby",this.textareaLabel.get("id")),this.setupToolbarNavigation(),this},setupToolbarNavigation:function(){return this._wrapper.delegate("key",this.toolbarKeyboardNavigation,"down:37,39","."+r.TOOLBAR,this),this._wrapper.delegate("focus",function(e){this._setTabFocus(e.currentTarget)},"."+r.TOOLBAR+" button",this),this},toolbarKeyboardNavigation:function(e){e.preventDefault();var t=this.toolbar.all("button"),n=1,r,i=e.target.ancestor("button",!0);e.keyCode===37&&(n=-1),r=this._findFirstFocusable(t,i,n),r&&(r.focus(),this._setTabFocus(r))},_findFirstFocusable:function(e,t,n){var r=0,i,s,o,u;u=e.indexOf(t),u<-1&&(u=0);while(r<e.size()){u+=n,u<0?u=e.size()-1:u>=e.size()&&(u=0),s=e.
+YUI.add("moodle-editor_ousupsub-editor",function(e,t){function i(){i.superclass.constructor.apply(this,arguments)}function s(){}function o(){}function u(){u.superclass.constructor.apply(this,arguments)}var n="moodle-editor_ousupsub-editor",r={CONTENT:"editor_ousupsub_content",CONTENTWRAPPER:"editor_ousupsub_content_wrap",EDITORWRAPPER:".editor_ousupsub_content",TOOLBAR:"editor_ousupsub_toolbar",WRAPPER:"editor_ousupsub",HIGHLIGHT:"highlight"};e.extend(i,e.Base,{BLOCK_TAGS:["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"],PLACEHOLDER_CLASS:"ousupsub-tmp-class",ALL_NODES_SELECTOR:"[style],font[face]",FONT_FAMILY:"fontFamily",_wrapper:null,editor:null,toolbar:null,textarea:null,textareaLabel:null,plugins:null,_eventHandles:null,_tabFocus:null,_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this.textarea=e.one(document.getElementById(this.get("elementid")));if(!this.textarea)return;e.M.editor_ousupsub.addEditorReference(this.get("elementid"),this),this._eventHandles=[],this._wrapper=e.Node.create('<div class="'+r.WRAPPER+'"></div>'),this.editor=e.Node.create('<div id="'+this.get("elementid")+'editable" '+'contenteditable="true" '+'autocapitalize="none" '+'autocorrect="off" '+'role="textbox" '+'spellcheck="false" '+'aria-live="off" '+'class="'+r.CONTENT+'"></div>'),this.textareaLabel=e.one('[for="'+this.get("elementid")+'"]'),this.textareaLabel&&(this.textareaLabel.generateID(),this.editor.setAttribute("aria-labelledby",this.textareaLabel.get("id"))),this.setupToolbar(),this.setupTemplateEditor(),this.disableCssStyling(),document.queryCommandSupported("DefaultParagraphSeparator")&&document.execCommand("DefaultParagraphSeparator",!1,"p"),this.textarea.get("parentNode").insert(this._wrapper,this.textarea),this.textarea.hide(),this.updateFromTextArea(),this.setupTextareaNavigation(),this._preventEnter(),this.publishEvents(),this.setupSelectionWatchers(),this.setupAutomaticPolling(),this.setupPlugins()},destructor:function(){e.Array.each(this.plugins,function(e,t){e.destroy(),this.plugins[t]=undefined},this),(new e.EventHandle(this._eventHandles)).detach(),this.textarea.show(),this._wrapper.remove(!0),e.M.editor_ousupsub.removeEditorReference(this.get("elementid"),this)},focus:function(){return this.editor.focus(),this},publishEvents:function(){return this.publish("change",{broadcast:!0,preventable:!0}),this.publish("pluginsloaded",{fireOnce:!0}),this.publish("ousupsub:selectionchanged",{prefix:"ousupsub"}),this},setupAutomaticPolling:function(){return this._registerEventHandle(this.editor.on(["keyup","cut"],this.updateOriginal,this)),this._registerEventHandle(this.editor.on(["keypress","delete"],this.cleanEditorHTMLSimple,this)),this._registerEventHandle(this.editor.on("paste",this.pasteCleanup,this)),this._registerEventHandle(this.editor.on("drop",this.updateOriginalDelayed,this)),this},updateOriginalDelayed:function(){return setTimeout(e.bind(this.updateOriginal,this),0),this},setupPlugins:function(){this.plugins={};var t=this.get("plugins"),n,r,i,s;for(n in t){r=t[n];if(!r.plugins)continue;for(i in r.plugins)s=r.plugins[i],s.name==="superscript"?this.plugins.superscript=new e.M.editor_ousupsub.EditorPlugin({name:"superscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"superscript",tags:"sup",keys:["94"],icon:"e/superscript",keyDescription:"Shift + ^ or Up arrow"}):s.name==="subscript"&&(this.plugins.subscript=new e.M.editor_ousupsub.EditorPlugin({name:"subscript",group:r.group,editor:this.editor,toolbar:this.toolbar,host:this,exec:"subscript",tags:"sub",keys:["95"],icon:"e/subscript",keyDescription:"Shift + _ or Down arrow"}))}return this._undoStack=[],this._redoStack=[],this.on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.on("ousupsub:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates(),this.setupUndoHandlers(),this.fire("pluginsloaded"),this},setupUndoHandlers:function(){return this._registerEventHandle(this._wrapper.delegate("key",this._undoHandler,"down:90+ctrl","."+r.CONTENT,this)),this._registerEventHandle(this._wrapper.delegate("key",this._redoHandler,"down:89+ctrl","."+r.CONTENT,this)),this},pluginEnabled:function(e){return this.plugins[e]?!0:!1},enablePlugins:function(e){this._setPluginState(!0,e)},disablePlugins:function(e){this._setPluginState(!1,e)},_setPluginState:function(t,n){var r="disableButtons";t&&(r="enableButtons"),n?this.plugins[n][r]():e.Object.each(this.plugins,function(e){e[r]()},this)},_registerEventHandle:function(e){this._eventHandles.push(e)},setupToolbar:function(){return this.toolbar=e.Node.create('<div class="'+r.TOOLBAR+'" role="toolbar" aria-live="off"></div>'),this._wrapper.appendChild(this.toolbar),this.textareaLabel&&this.toolbar.setAttribute("aria-labelledby",this.textareaLabel.get("id")),this.setupToolbarNavigation(),this},setupToolbarNavigation:function(){return this._wrapper.delegate("key",this.toolbarKeyboardNavigation,"down:37,39","."+r.TOOLBAR,this),this._wrapper.delegate("focus",function(e){this._setTabFocus(e.currentTarget)},"."+r.TOOLBAR+" button",this),this},toolbarKeyboardNavigation:function(e){e.preventDefault();var t=this.toolbar.all("button"),n=1,r,i=e.target.ancestor("button",!0);e.keyCode===37&&(n=-1),r=this._findFirstFocusable(t,i,n),r&&(r.focus(),this._setTabFocus(r))},_findFirstFocusable:function(e,t,n){var r=0,i,s,o,u;u=e.indexOf(t),u<-1&&(u=0);while(r<e.size()){u+=n,u<0?u=e.size()-1:u>=e.size()&&(u=0),s=e.
 item(u),r++;if(s.hasAttribute("hidden")||s.hasAttribute("disabled"))continue;i=s.ancestor(".ousupsub_group");if(i.hasAttribute("hidden"))continue;o=s;break}return o},checkTabFocus:function(){if(this._tabFocus)if(this._tabFocus.hasAttribute("disabled")||this._tabFocus.hasAttribute("hidden")||this._tabFocus.ancestor(".ousupsub_group").hasAttribute("hidden")){var e=this._findFirstFocusable(this.toolbar.all("button"),this._tabFocus,-1);e&&(this._tabFocus.compareTo(document.activeElement)&&e.focus(),this._setTabFocus(e))}return this},_setTabFocus:function(e){return this._tabFocus&&this._tabFocus.setAttribute("tabindex","-1"),this._tabFocus=e,this._tabFocus.setAttribute("tabindex",0),this.toolbar.setAttribute("aria-activedescendant",this._tabFocus.generateID()),this},disableCssStyling:function(){try{document.execCommand("styleWithCSS",0,!1)}catch(e){try{document.execCommand("useCSS",0,!0)}catch(t){try{document.execCommand("styleWithCSS",!1,!1)}catch(n){}}}},setupTemplateEditor:function(){var t=e.Node.create('<div class="'+r.CONTENTWRAPPER+'"></div>');t.appendChild(this.editor),this._wrapper.appendChild(t);var n=this.textarea.getAttribute("cols")*6+41+"px";this.editor.setStyle("width",n),this.editor.setStyle("minWidth",n),this.editor.setStyle("maxWidth",n);var i=this.textarea.getAttribute("rows"),s=i*6+13,o=s+"px";this.editor.setStyle("height",o),this.editor.setStyle("minHeight",o),this.editor.setStyle("maxHeight",o),this.editor.setStyle("line-height",o);var u=s+1+"px";t.setStyle("height",u),t.setStyle("minHeight",u),t.setStyle("maxHeight",u),this.textareaLabel.setStyle("display","inline-block"),this.textareaLabel.setStyle("margin",0),this.textareaLabel.setStyle("height",u),this.textareaLabel.setStyle("minHeight",u),this.textareaLabel.setStyle("maxheight",u),this.textareaLabel.hasClass("accesshide")?(this.textareaLabel.removeClass("accesshide"),this.textareaLabel.setStyle("visibility","hidden"),this._wrapper.setStyle("margin-left",-parseInt(this.textareaLabel.get("offsetWidth")))):this.textareaLabel.setStyle("vertical-align","bottom");var a=this,f="#"+a.get("elementid").replace(/:/g,"\\:")+"editable";e.on("contentready",function(){a.textareaLabel.setStyle("line-height",a.editor.getComputedStyle("line-height"));var t=s+1+parseInt(a.toolbar.get("offsetHeight"));a._wrapper.setStyle("height",t),a._wrapper.setStyle("minHeight",t),a._wrapper.setStyle("maxHeight",t),e.UA.ie&&a.textareaLabel.getComputedStyle("visibility")==="hidden"&&a._wrapper.setStyle("vertical-align",parseInt(a.toolbar.get("offsetHeight"))-1+"px")},f)},_getEmptyContent:function(){return""},updateFromTextArea:function(){this.editor.setHTML(""),this.editor.append(this.textarea.get("value")),this.cleanEditorHTML(),this.editor.getHTML()===""&&this.editor.setHTML(this._getEmptyContent())},updateOriginal:function(){var e=this.textarea.get("value"),t=this.getCleanHTML();return t===""&&this.isActive()&&(t=this._getEmptyContent()),t=this._removeUnicodeCharacters(t),t=t.trim(),e!==t&&(this.textarea.set("value",t),this.fire("change")),this},setupTextareaNavigation:function(){return this._registerEventHandle(this._wrapper.delegate("key",this.textareaKeyboardNavigation,"down:38,40","."+r.CONTENT,this)),this._registerEventHandle(this._wrapper.delegate("key",this.textareaKeyboardNavigation,"press:94, 95","."+r.CONTENT,this)),this},textareaKeyboardNavigation:function(e){e.preventDefault(),!YUI.Env.UA.android&&!this.isActive()&&this.focus();var t="",n=1,r=window.event||e,i=r.keyCode?r.keyCode:r.charCode;if(i===38||i===94)t="superscript";else if(i===40||i===95)t="subscript";if(!t)return;this._applyTextCommand(t,n)},_preventEnter:function(){var t="keypress";if(e.UA.webkit||e.UA.ie)t="keydown";this.editor.on(t,function(e){var t=window.event||e;if(t.keyCode===13){if(!t.preventDefault){t.returnValue=!1;return}t.preventDefault()}},this)},_addToRedo:function(e){this._redoStack.push(e)},_addToUndo:function(e,t){var n=this._undoStack[this._undoStack.length-1];typeof t=="undefined"&&(t=!1),n!==e&&(this._undoStack.push(e),t&&(this._redoStack=[]));while(this._undoStack.length>this._maxUndos)this._undoStack.shift()},_getHTML:function(){return this.getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(e){if(this._undoStack.length===1)return this._undoStack[0];var t=this._undoStack.pop();return t===e&&(t=this._undoStack.pop()),this._undoStack.length===0&&this._addToUndo(t),t},_restoreValue:function(e){this.editor.setHTML(e),this._addToUndo(e)},_updateButtonsStates:function(){this._undoStack.length>1?this.enablePlugins("undo"):this.disablePlugins("undo"),this._redoStack.length>0?this.enablePlugins("redo"):this.disablePlugins("redo")},_undoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getUndo(t);if(t===n){this._updateButtonsStates();return}this._restoreValue(n),this._addToRedo(t),this._updateButtonsStates()},_redoHandler:function(e){e.preventDefault();var t=this._getHTML(),n=this._getRedo();if(n===undefined||t===n){this._updateButtonsStates();return}this._restoreValue(n),this._updateButtonsStates()},_changeListener:function(e){if(e.event&&e.event.type.indexOf("key")!==-1&&e.event.keyCode!==39&&e.event.keyCode!==37&&e.event.keyCode!==40&&e.event.keyCode!==38)return;this._addToUndo(this._getHTML(),!0),this._updateButtonsStates()}},{NS:"editor_ousupsub",ATTRS:{elementid:{value:null,writeOnce:!0},contextid:{value:null,writeOnce:!0},plugins:{value:{},writeOnce:!0}}}),e.augment(i,e.EventTarget),e.namespace("M.editor_ousupsub").Editor=i,s.ATTRS={},s.prototype={getCleanHTML:function(){var t=this.editor.cloneNode(!0),n,r="",i="";e.each(t.all('[id^="yui"]'),function(e){e.removeAttribute("id")}),t.all(".ousupsub_control").remove(!0),n=t.get("innerHTML");if(n===""||n==="<br>")return"";if(n.indexOf(r)===0){var s=n.length-(r.length+i.length);n=n.substr(r.length,s)}return this._cleanHTML(n)},cleanEditorHTML:function(){return this.editor.set("innerHTML",this._cleanHTML(this.editor.get("innerHTML"))),this},cleanEditorHTMLSimple:function(
 ){var e=window.rangy.saveSelection();return this.editor.set("innerHTML",this._cleanHTMLSimple(this.editor.get("innerHTML"))),window.rangy.restoreSelection(e,!0),this},_cleanHTMLSimple:function(e){var t=[{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>(.+)<\/span>/gi,replace:"$1"}];return this._filterContentWithRules(e,t)},_cleanHTML:function(e){var t=[{regex:/<p[^>]*>(&nbsp;|\s)*<\/p>/gi,replace:""},{regex:/<sup[^>]*(&nbsp;|\s)*>/gi,replace:"<sup>"},{regex:/<sub[^>]*(&nbsp;|\s)*>/gi,replace:"<sub>"},{regex:/&nbsp;/gi,replace:" "},{regex:/<\/sup>(\s*)+<sup>/gi,replace:"$1"},{regex:/<\/sub>(\s*)+<sub>/gi,replace:"$1"},{regex:/<sup>(\s*)+/gi,replace:"$1<sup>"},{regex:/<sub>(\s*)+/gi,replace:"$1<sub>"},{regex:/(\s*)+<\/sup>/gi,replace:"</sup>$1"},{regex:/(\s*)+<\/sub>/gi,replace:"</sub>$1"},{regex:/<br>/gi,replace:""},{regex:/<style[^>]*>[\s\S]*?<\/style>/gi,replace:""},{regex:/<!--(?![\s\S]*?-->)/gi,replace:""},{regex:/<script[^>]*>[\s\S]*?<\/script>/gi,replace:""},{regex:/<\/?(?:br|title|meta|style|std|font|html|body|link|a|ul|li|ol)[^>]*?>/gi,replace:""},{regex:/<\/?(?:b|i|u|ul|ol|li|img)[^>]*?>/gi,replace:""},{regex:/<\/?(?:abbr|address|area|article|aside|audio|base|bdi|bdo|blockquote)[^>]*?>/gi,replace:""},{regex:/<\/?(?:button|canvas|caption|cite|code|col|colgroup|content|data)[^>]*?>/gi,replace:""},{regex:/<\/?(?:datalist|dd|decorator|del|details|dialog|dfn|div|dl|dt|element)[^>]*?>/gi,replace:""},{regex:/<\/?(?:em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5)[^>]*?>/gi,replace:""},{regex:/<\/?(?:h6|header|hgroup|hr|iframe|input|ins|kbd|keygen|label|legend)[^>]*?>/gi,replace:""},{regex:/<\/?(?:main|map|mark|menu|menuitem|meter|nav|noscript|object|optgroup)[^>]*?>/gi,replace:""},{regex:/<\/?(?:option|output|p|param|pre|progress|q|rp|rt|rtc|ruby|samp)[^>]*?>/gi,replace:""},{regex:/<\/?(?:section|select|script|shadow|small|source|std|strong|summary)[^>]*?>/gi,replace:""},{regex:/<\/?(?:svg|table|tbody|td|template|textarea|time|tfoot|th|thead|tr|track)[^>]*?>/gi,replace:""},{regex:/<\/?(?:var|wbr|video)[^>]*?>/gi,replace:""},{regex:/<\/?(?:acronym|applet|basefont|big|blink|center|dir|frame|frameset|isindex)[^>]*?>/gi,replace:""},{regex:/<\/?(?:listing|noembed|plaintext|spacer|strike|tt|xmp)[^>]*?>/gi,replace:""},{regex:/<\/?(?:jsl|nobr)[^>]*?>/gi,replace:""},{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>[\s\S]*?([\s\S]*?)<\/span>/gi,replace:"$1"},{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>(&nbsp;|\s)*<\/span>/gi,replace:""},{regex:/<span(?![^>]*?rangySelectionBoundary[^>]*?)[^>]*>[\s\S]*?([\s\S]*?)<\/span>/gi,replace:"$1"},{regex:/<sup[^>]*>(&nbsp;|\s)*<\/sup>/gi,replace:""},{regex:/<sub[^>]*>(&nbsp;|\s)*<\/sub>/gi,replace:""},{regex:/<xmlns.*?>(.*?)<\/xmlns.*?>/gi,replace:"$1"}];return this._filterContentWithRules(e,t)},cleanEditorHTMLEmptySupAndSubTags:function(){var e=window.rangy.saveSelection(),t=this.editor.get("innerHTML");return t=this._cleanEditorHTMLEmptySupAndSubTags(t),t=this._removeUnicodeCharacters(t),this.editor.set("innerHTML",t),window.rangy.restoreSelection(e,!0),this},_cleanEditorHTMLEmptySupAndSubTags:function(e){var t=[{regex:/<su[bp][^>]*>(&#65279;|\s)*<\/su[bp]>/gi,replace:""}];return this._filterContentWithRules(e,t)},_filterContentWithRules:function(e,t){var n=0;for(n=0;n<t.length;n++)e=e.replace(t[n].regex,t[n].replace);return e},pasteCleanup:function(e){if(e.type==="paste"){var t=e._event;if(t&&t.clipboardData&&t.clipboardData.getData){var n=t.clipboardData.types,r=!1;if(!n)r=!1;else if(typeof n.contains=="function")r=n.contains("text/html");else{if(typeof n.indexOf!="function")return this.fallbackPasteCleanupDelayed(),!0;r=n.indexOf("text/html")>-1;if(!r)if(n.indexOf("com.apple.webarchive")>-1||n.indexOf("com.apple.iWork.TSPNativeData")>-1)return this.fallbackPasteCleanupDelayed(),!0}if(r){var i;try{i=t.clipboardData.getData("text/html")}catch(s){return this.fallbackPasteCleanupDelayed(),!0}e.preventDefault(),i=this._cleanPasteHTML(i);var o=window.rangy.saveSelection();return this.insertContentAtFocusPoint(i),window.rangy.restoreSelection(o),window.rangy.getSelection().collapseToEnd(),this.updateOriginal(),this._normaliseTextarea(),!1}return this.fallbackPasteCleanupDelayed(),!0}return this.fallbackPasteCleanupDelayed(),!0}return this.updateOriginalDelayed(),!0},fallbackPasteCleanup:function(){var e=window.rangy.saveSelection(),t=this.editor.get("innerHTML");return this.editor.set("innerHTML",this._cleanPasteHTML(t)),this.updateOriginal(),window.rangy.restoreSelection(e,!0),this},fallbackPasteCleanupDelayed:function(){return setTimeout(e.bind(this.fallbackPasteCleanup,this),0),this},_cleanPasteHTML:function(e){if(!e||e.length===0)return"";var t=[{regex:/<\s*\/html\s*>([\s\S]+)$/gi,replace:""},{regex:/<!--\[if[\s\S]*?endif\]-->/gi,replace:""},{regex:/<!--(Start|End)Fragment-->/gi,replace:""},{regex:/<xml[^>]*>[\s\S]*?<\/xml>/gi,replace:""},{regex:/<\?xml[^>]*>[\s\S]*?<\\\?xml>/gi,replace:""},{regex:/<\/?\w+:[^>]*>/gi,replace:""}];e=this._filterContentWithRules(e,t),e=this._cleanHTML(e);if(e.length===0||!e.match(/\S/))return e;var n=document.createElement("div");return n.innerHTML=e,e=n.innerHTML,n.innerHTML="",t=[{regex:/(<[^>]*?style\s*?=\s*?"[^>"]*?)(?:[\s]*MSO[-:][^>;"]*;?)+/gi,replace:"$1"},{regex:/(<[^>]*?class\s*?=\s*?"[^>"]*?)(?:[\s]*MSO[_a-zA-Z0-9\-]*)+/gi,replace:"$1"},{regex:/(<[^>]*?class\s*?=\s*?"[^>"]*?)(?:[\s]*Apple-[_a-zA-Z0-9\-]*)+/gi,replace:"$1"},{regex:/<a [^>]*?name\s*?=\s*?"OLE_LINK\d*?"[^>]*?>\s*?<\/a>/gi,replace:""}],e=this._filterContentWithRules(e,t),e=this._cleanHTML(e),e},_applyTextCommand:function(e,t){var n,r;if(t){r=this.getCursorTag();if(r==="superscript"&&e===r||r==="subscript"&&e===r)return;r==="superscript"&&e==="subscript"?e="superscript":r==="subscript"&&e==="superscript"&&(e="subscript");if(!this.pluginEnabled(e))return}document.execCommand(e,!1,null),n=window.rangy.getSelection();if(n.isCollapsed){this.cleanEditorHTMLEmptySupAndSubTags(),r=e==="superscript"?"sup":"sub";var i=this
 .insertContentAtFocusPoint("<"+r+">\ufeff&#65279;</"+r+">"),s=window.rangy.createRange();s.selectNode(i._node.childNodes[0]),this.setSelection([s]),n.rangeCount&&n.collapseToEnd()}this._normaliseTextarea(),this.cleanEditorHTMLSimple(),this.saveSelection(),this.updateOriginal()},getCursorTag:function(){var e="text",t=window.rangy.getSelection(),n=t.focusNode.nodeName.toLowerCase(),r=t.focusNode.parentNode.nodeName.toLowerCase(),i="";t.focusNode.childNodes&&t.focusNode.childNodes[t.focusOffset-1]&&(i=t.focusNode.childNodes[t.focusOffset-1].nodeName.toLowerCase());if(n==="sup"||r==="sup"||i==="sup")e="superscript";else if(n==="sub"||r==="sub"||i==="sub")e="subscript";return e},_normaliseTextarea:function(){var e=window.rangy.saveSelection(),t=this._getEditorNode();this._removeSingleNodesByName(t,"br");var n=["p","b","i","u","ul","ol","li"];for(var r=0;r<n.length;r++)this._removeNodesByName(t,n[r]);this._normaliseTagInTextarea("sup"),this._normaliseTagInTextarea("sub"),this._removeNodesByName(t,"span"),window.rangy.restoreSelection(e,!0),t.normalize()},_normaliseTagInTextarea:function(e){var t=[],n=this._getEditorNode(),r,i=!1,s;t=this._copyArray(n.querySelectorAll(e),t);for(var o=0;o<t.length;o++){s=t[o],r=s.parentNode,i=!1;if(r===n)continue;r.firstChild===s&&r.lastChild===s&&r.nodeName.toLowerCase()===e&&(i=!0),!i&&s&&r.nodeName.toLowerCase()===e&&(i=!0,this._splitParentNode(r,e)),this._removeNodesByName(s,e),i&&this._removeNodesByName(r,e)}t=[],t=this._copyArray(n.querySelectorAll(e),t);for(o=0;o<t.length;o++){s=t[o];if(!s.previousSibling||s.previousSibling.nodeName.toLowerCase()!==e)continue;this._mergeNodes(s,s.previousSibling)}},_mergeNodes:function(e,t){var n=[],r=e.childNodes;for(var i=0;i<r.length;i++)n.push(r.item(i));for(i=0;i<n.length;i++)t.appendChild(n[i]);this._removeNode(e)},_splitParentNode:function(e,t){var n=[],r,i=[];n=this._copyArray(e.childNodes,n);var s,o;for(s=0;s<n.length;s++){r=n[s],i=[],r.nodeName.toLowerCase()===t?i=this._copyArray(r.childNodes,i):(i[0]=document.createElement(t),i[0].appendChild(r));for(o=0;o<i.length;o++)e.parentNode.insertBefore(i[o],e)}},_copyArray:function(e,t){for(var n=0;n<e.length;n++)t.push(e[n]);return t},_removeNodesByName:function(e,t){var n,r=e.nodeName.toLowerCase()===t,i=[],s=e.childNodes;e.nodeName.toLowerCase()==="span"&&e.id.indexOf("selectionBoundary_")>-1&&(r=!1),i=this._copyArray(s,i);for(var o=0;o<i.length;o++){n=i[o],n.childNodes&&n.childNodes.length&&this._removeNodesByName(n,t);if(r){var u=e.parentNode;u.insertBefore(n,e)}}r&&this._removeNode(e)},_removeSingleNodesByName:function(e,t){if(!e.childNodes)return;var n,r=[];r=this._copyArray(e.childNodes,r);for(var i=0;i<r.length;i++)n=r[i],n.childNodes&&n.childNodes.length&&this._removeSingleNodesByName(n,t),n.nodeName.toLowerCase()===t&&this._removeNode(n)},_removeNode:function(e){return e.remove?e.remove():e.parentNode.removeChild(e)},_getEditor:function(e){return e||(e=this.get("host")),this},_getEditorNode:function(e){return this._getEditor(e).editor._node},_removeUnicodeCharacters:function(e){var t=[];for(var n=0;n<e.length;n++){if(e.charCodeAt(n)=="65279")continue;t.push(e.charAt(n))}return t.join("")}},e.Base.mix(e.M.editor_ousupsub.Editor,[s]),o.ATTRS={},o.prototype={_selections:null,_lastSelection:null,_focusFromClick:!1,setupSelectionWatchers:function(){return this._registerEventHandle(this.on("ousupsub:selectionchanged",this.saveSelection,this)),this._registerEventHandle(this.editor.on("focus",this.restoreSelection,this)),this._registerEventHandle(this.editor.on("mousedown",function(){this._focusFromClick=!0},this)),this._registerEventHandle(this.editor.on("blur",function(){this._focusFromClick=!1,this.updateOriginal()},this)),this._registerEventHandle(this.editor.on(["keyup","focus"],function(t){setTimeout(e.bind(this._hasSelectionChanged,this,t),0)},this)),this._registerEventHandle(this.editor.on("gesturemoveend",function(t){setTimeout(e.bind(this._hasSelectionChanged,this,t),0)},{standAlone:!0},this)),this},isActive:function(){var e=window.rangy.createRange(),t=window.rangy.getSelection();return t.rangeCount?!document.activeElement||!this.editor.compareTo(document.activeElement)&&!this.editor.contains(document.activeElement)?!1:(e.selectNode(this.editor.getDOMNode()),e.intersectsRange(t.getRangeAt(0))):!1},getSelectionFromNode:function(e){var t=window.rangy.createRange();return t.selectNode(e.getDOMNode()),[t]},saveSelection:function(){this.isActive()&&(this._selections=this.getSelection())},restoreSelection:function(){this._focusFromClick||this._selections&&this.setSelection(this._selections),this._focusFromClick=!1},getSelection:function(){return window.rangy.getSelection().getAllRanges()},selectionContainsNode:function(e){return window.rangy.getSelection().containsNode(e.getDOMNode(),!0)},selectionFilterMatches:function(e,t,n){typeof n=="undefined"&&(n=!0),t||(t=this.getSelectedNodes());var r=t.size()>0,i=!1,s=this.editor,o=function(e){return e===s};return s.one(e)?(t.each(function(t){if(n){if(!r||!t.ancestor(e,!0,o))r=!1}else!i&&t.ancestor(e,!0,o)&&(i=!0)},this),n?r:i):!1},getSelectedNodes:function(){var t=new e.NodeList,n,r,i,s,o;r=window.rangy.getSelection(),r.rangeCount?i=r.getRangeAt(0):i=window.rangy.createRange(),i.collapsed&&i.commonAncestorContainer!==this.editor.getDOMNode()&&i.commonAncestorContainer!==e.config.doc&&(i=i.cloneRange(),i.selectNode(i.commonAncestorContainer)),n=i.getNodes();for(o=0;o<n.length;o++)s=e.one(n[o]),this.editor.contains(s)&&t.push(s);return t},_hasSelectionChanged:function(e){var t=window.rangy.getSelection(),n,r=!1;return t.rangeCount?n=t.getRangeAt(0):n=window.rangy.createRange(),this._lastSelection&&!this._lastSelection.equals(n)?(r=!0,this._fireSelectionChanged(e)):(this._lastSelection=n,r)},_fireSelectionChanged:function(e){this.fire("ousupsub:selectionchanged",{event:e,selectedNodes:this.getSelectedNodes()})},getSelectionParentNode:function(){var e=window.rangy.getSelection();return e.rangeCount?e.getRangeAt(0).commonAncestorContainer
diff --git a/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor.js b/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor.js
index 6ee750de4ba51bad784dc468c4b3c9da71c5165a..2e185adb27fe97babaf974ed68c9d88115acc4e3 100644
--- a/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor.js
+++ b/web/lib/editor/ousupsub/yui/build/moodle-editor_ousupsub-editor/moodle-editor_ousupsub-editor.js
@@ -420,28 +420,6 @@ Y.extend(Editor, Y.Base, {
         this._undoStack = [];
         this._redoStack = [];
 
-        // Add undo plugin
-        this.plugins.undo = new Y.M.editor_ousupsub.EditorPlugin({
-            name: 'undo',
-            group: group.group,
-            editor: this.editor,
-            toolbar: this.toolbar,
-            host: this,
-            keys: ['90'],
-            callback: this._undoHandler
-        });
-
-        // Add redo plugin
-        this.plugins.redo = new Y.M.editor_ousupsub.EditorPlugin({
-            name: 'redo',
-            group: group.group,
-            editor: this.editor,
-            toolbar: this.toolbar,
-            host: this,
-            keys: ['89'],
-            callback: this._redoHandler
-        });
-
         // Enable the undo once everything has loaded.
         this.on('pluginsloaded', function() {
             // Adds the current value to the stack.

Unable to switch from sub to sup or vice versa in one click

  1. Enable the sup mode
  2. Type something
  3. Click the sub icon

Expected behaviour: The mode is changed
Actual behaviour: No mode change. You have to return to normal mode first and then pick the format. Which doubles the amount of needed clicks :-p

p.s. This is not urgent at all of course. I just tried hard to find at least something to report here for this awesome plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.