diff --git a/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-debug.js b/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-debug.js
index a9d5e22d7db..43a8d5ecaf1 100644
--- a/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-debug.js
+++ b/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-debug.js
@@ -34,13 +34,55 @@ YUI.add('moodle-atto_subscript-button', function (Y, NAME) {
*/
Y.namespace('M.atto_subscript').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _subscriptApplier
+ * @type Object
+ * @private
+ */
+ _subscriptApplier: null,
+
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _superscriptApplier
+ * @type Object
+ * @private
+ */
+ _superscriptApplier: null,
+
initializer: function() {
- this.addBasicButton({
- exec: 'subscript',
+ this.addButton({
+ buttonName: 'subscript',
+ callback: this.toggleSubscript,
+ icon: 'e/subscript',
+ inlineFormat: true,
// Watch the following tags and add/remove highlighting as appropriate:
tags: 'sub'
});
+ this._subscriptApplier = window.rangy.createCssClassApplier("editor-subscript");
+ this._superscriptApplier = window.rangy.createCssClassApplier("editor-superscript");
+ },
+
+ /**
+ * Toggle subscripts in selection
+ *
+ * @method toggleSubscript
+ */
+ toggleSubscript: function() {
+ // Replace all the sub and sup tags.
+ this.get('host').changeToCSS('sup', 'editor-superscript');
+ this.get('host').changeToCSS('sub', 'editor-subscript');
+
+ // Remove all superscripts inselection and toggle subscript.
+ this._superscriptApplier.undoToSelection();
+ this._subscriptApplier.toggleSelection();
+
+ // Replace CSS classes with tags.
+ this.get('host').changeToTags('editor-subscript', 'sub');
+ this.get('host').changeToTags('editor-superscript', 'sup');
}
});
diff --git a/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-min.js b/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-min.js
index 9510f931d8e..e92ce238c83 100644
--- a/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-min.js
+++ b/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button-min.js
@@ -1 +1 @@
-YUI.add("moodle-atto_subscript-button",function(e,t){e.namespace("M.atto_subscript").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addBasicButton({exec:"subscript",tags:"sub"})}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
+YUI.add("moodle-atto_subscript-button",function(e,t){e.namespace("M.atto_subscript").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_subscriptApplier:null,_superscriptApplier:null,initializer:function(){this.addButton({buttonName:"subscript",callback:this.toggleSubscript,icon:"e/subscript",inlineFormat:!0,tags:"sub"}),this._subscriptApplier=window.rangy.createCssClassApplier("editor-subscript"),this._superscriptApplier=window.rangy.createCssClassApplier("editor-superscript")},toggleSubscript:function(){this.get("host").changeToCSS("sup","editor-superscript"),this.get("host").changeToCSS("sub","editor-subscript"),this._superscriptApplier.undoToSelection(),this._subscriptApplier.toggleSelection(),this.get("host").changeToTags("editor-subscript","sub"),this.get("host").changeToTags("editor-superscript","sup")}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
diff --git a/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button.js b/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button.js
index a9d5e22d7db..43a8d5ecaf1 100644
--- a/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button.js
+++ b/lib/editor/atto/plugins/subscript/yui/build/moodle-atto_subscript-button/moodle-atto_subscript-button.js
@@ -34,13 +34,55 @@ YUI.add('moodle-atto_subscript-button', function (Y, NAME) {
*/
Y.namespace('M.atto_subscript').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _subscriptApplier
+ * @type Object
+ * @private
+ */
+ _subscriptApplier: null,
+
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _superscriptApplier
+ * @type Object
+ * @private
+ */
+ _superscriptApplier: null,
+
initializer: function() {
- this.addBasicButton({
- exec: 'subscript',
+ this.addButton({
+ buttonName: 'subscript',
+ callback: this.toggleSubscript,
+ icon: 'e/subscript',
+ inlineFormat: true,
// Watch the following tags and add/remove highlighting as appropriate:
tags: 'sub'
});
+ this._subscriptApplier = window.rangy.createCssClassApplier("editor-subscript");
+ this._superscriptApplier = window.rangy.createCssClassApplier("editor-superscript");
+ },
+
+ /**
+ * Toggle subscripts in selection
+ *
+ * @method toggleSubscript
+ */
+ toggleSubscript: function() {
+ // Replace all the sub and sup tags.
+ this.get('host').changeToCSS('sup', 'editor-superscript');
+ this.get('host').changeToCSS('sub', 'editor-subscript');
+
+ // Remove all superscripts inselection and toggle subscript.
+ this._superscriptApplier.undoToSelection();
+ this._subscriptApplier.toggleSelection();
+
+ // Replace CSS classes with tags.
+ this.get('host').changeToTags('editor-subscript', 'sub');
+ this.get('host').changeToTags('editor-superscript', 'sup');
}
});
diff --git a/lib/editor/atto/plugins/subscript/yui/src/button/js/button.js b/lib/editor/atto/plugins/subscript/yui/src/button/js/button.js
index 337d3628e40..07dc361b32f 100644
--- a/lib/editor/atto/plugins/subscript/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/subscript/yui/src/button/js/button.js
@@ -32,12 +32,54 @@
*/
Y.namespace('M.atto_subscript').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _subscriptApplier
+ * @type Object
+ * @private
+ */
+ _subscriptApplier: null,
+
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _superscriptApplier
+ * @type Object
+ * @private
+ */
+ _superscriptApplier: null,
+
initializer: function() {
- this.addBasicButton({
- exec: 'subscript',
+ this.addButton({
+ buttonName: 'subscript',
+ callback: this.toggleSubscript,
+ icon: 'e/subscript',
+ inlineFormat: true,
// Watch the following tags and add/remove highlighting as appropriate:
tags: 'sub'
});
+ this._subscriptApplier = window.rangy.createCssClassApplier("editor-subscript");
+ this._superscriptApplier = window.rangy.createCssClassApplier("editor-superscript");
+ },
+
+ /**
+ * Toggle subscripts in selection
+ *
+ * @method toggleSubscript
+ */
+ toggleSubscript: function() {
+ // Replace all the sub and sup tags.
+ this.get('host').changeToCSS('sup', 'editor-superscript');
+ this.get('host').changeToCSS('sub', 'editor-subscript');
+
+ // Remove all superscripts inselection and toggle subscript.
+ this._superscriptApplier.undoToSelection();
+ this._subscriptApplier.toggleSelection();
+
+ // Replace CSS classes with tags.
+ this.get('host').changeToTags('editor-subscript', 'sub');
+ this.get('host').changeToTags('editor-superscript', 'sup');
}
});
diff --git a/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-debug.js b/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-debug.js
index bcad8e55b01..d5285d34734 100644
--- a/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-debug.js
+++ b/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-debug.js
@@ -34,13 +34,55 @@ YUI.add('moodle-atto_superscript-button', function (Y, NAME) {
*/
Y.namespace('M.atto_superscript').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _subscriptApplier
+ * @type Object
+ * @private
+ */
+ _subscriptApplier: null,
+
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _superscriptApplier
+ * @type Object
+ * @private
+ */
+ _superscriptApplier: null,
+
initializer: function() {
- this.addBasicButton({
- exec: 'superscript',
+ this.addButton({
+ buttonName: 'superscript',
+ inlineFormat: true,
+ callback: this.toggleSuperscript,
+ icon: 'e/superscript',
// Watch the following tags and add/remove highlighting as appropriate:
tags: 'sup'
});
+ this._subscriptApplier = window.rangy.createCssClassApplier("editor-subscript");
+ this._superscriptApplier = window.rangy.createCssClassApplier("editor-superscript");
+ },
+
+ /**
+ * Toggle superscripts in selection
+ *
+ * @method toggleSuperscript
+ */
+ toggleSuperscript: function() {
+ // Replace all the sub and sup tags.
+ this.get('host').changeToCSS('sub', 'editor-subscript');
+ this.get('host').changeToCSS('sup', 'editor-superscript');
+
+ // Remove all subscripts inselection and toggle superscript.
+ this._superscriptApplier.toggleSelection();
+ this._subscriptApplier.undoToSelection();
+
+ // Replace CSS classes with tags.
+ this.get('host').changeToTags('editor-superscript', 'sup');
+ this.get('host').changeToTags('editor-subscript', 'sub');
}
});
diff --git a/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-min.js b/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-min.js
index 70ac08d0fc7..d7dcc400135 100644
--- a/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-min.js
+++ b/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button-min.js
@@ -1 +1 @@
-YUI.add("moodle-atto_superscript-button",function(e,t){e.namespace("M.atto_superscript").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addBasicButton({exec:"superscript",tags:"sup"})}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
+YUI.add("moodle-atto_superscript-button",function(e,t){e.namespace("M.atto_superscript").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_subscriptApplier:null,_superscriptApplier:null,initializer:function(){this.addButton({buttonName:"superscript",inlineFormat:!0,callback:this.toggleSuperscript,icon:"e/superscript",tags:"sup"}),this._subscriptApplier=window.rangy.createCssClassApplier("editor-subscript"),this._superscriptApplier=window.rangy.createCssClassApplier("editor-superscript")},toggleSuperscript:function(){this.get("host").changeToCSS("sub","editor-subscript"),this.get("host").changeToCSS("sup","editor-superscript"),this._superscriptApplier.toggleSelection(),this._subscriptApplier.undoToSelection(),this.get("host").changeToTags("editor-superscript","sup"),this.get("host").changeToTags("editor-subscript","sub")}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
diff --git a/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button.js b/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button.js
index bcad8e55b01..d5285d34734 100644
--- a/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button.js
+++ b/lib/editor/atto/plugins/superscript/yui/build/moodle-atto_superscript-button/moodle-atto_superscript-button.js
@@ -34,13 +34,55 @@ YUI.add('moodle-atto_superscript-button', function (Y, NAME) {
*/
Y.namespace('M.atto_superscript').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _subscriptApplier
+ * @type Object
+ * @private
+ */
+ _subscriptApplier: null,
+
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _superscriptApplier
+ * @type Object
+ * @private
+ */
+ _superscriptApplier: null,
+
initializer: function() {
- this.addBasicButton({
- exec: 'superscript',
+ this.addButton({
+ buttonName: 'superscript',
+ inlineFormat: true,
+ callback: this.toggleSuperscript,
+ icon: 'e/superscript',
// Watch the following tags and add/remove highlighting as appropriate:
tags: 'sup'
});
+ this._subscriptApplier = window.rangy.createCssClassApplier("editor-subscript");
+ this._superscriptApplier = window.rangy.createCssClassApplier("editor-superscript");
+ },
+
+ /**
+ * Toggle superscripts in selection
+ *
+ * @method toggleSuperscript
+ */
+ toggleSuperscript: function() {
+ // Replace all the sub and sup tags.
+ this.get('host').changeToCSS('sub', 'editor-subscript');
+ this.get('host').changeToCSS('sup', 'editor-superscript');
+
+ // Remove all subscripts inselection and toggle superscript.
+ this._superscriptApplier.toggleSelection();
+ this._subscriptApplier.undoToSelection();
+
+ // Replace CSS classes with tags.
+ this.get('host').changeToTags('editor-superscript', 'sup');
+ this.get('host').changeToTags('editor-subscript', 'sub');
}
});
diff --git a/lib/editor/atto/plugins/superscript/yui/src/button/js/button.js b/lib/editor/atto/plugins/superscript/yui/src/button/js/button.js
index 80bfeece74e..fce14a12bb2 100644
--- a/lib/editor/atto/plugins/superscript/yui/src/button/js/button.js
+++ b/lib/editor/atto/plugins/superscript/yui/src/button/js/button.js
@@ -32,12 +32,54 @@
*/
Y.namespace('M.atto_superscript').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _subscriptApplier
+ * @type Object
+ * @private
+ */
+ _subscriptApplier: null,
+
+ /**
+ * A rangy object to alter CSS classes.
+ *
+ * @property _superscriptApplier
+ * @type Object
+ * @private
+ */
+ _superscriptApplier: null,
+
initializer: function() {
- this.addBasicButton({
- exec: 'superscript',
+ this.addButton({
+ buttonName: 'superscript',
+ callback: this.toggleSuperscript,
+ icon: 'e/superscript',
+ inlineFormat: true,
// Watch the following tags and add/remove highlighting as appropriate:
tags: 'sup'
});
+ this._subscriptApplier = window.rangy.createCssClassApplier("editor-subscript");
+ this._superscriptApplier = window.rangy.createCssClassApplier("editor-superscript");
+ },
+
+ /**
+ * Toggle superscripts in selection
+ *
+ * @method toggleSuperscript
+ */
+ toggleSuperscript: function() {
+ // Replace all the sub and sup tags.
+ this.get('host').changeToCSS('sub', 'editor-subscript');
+ this.get('host').changeToCSS('sup', 'editor-superscript');
+
+ // Remove all subscripts inselection and toggle superscript.
+ this._superscriptApplier.toggleSelection();
+ this._subscriptApplier.undoToSelection();
+
+ // Replace CSS classes with tags.
+ this.get('host').changeToTags('editor-superscript', 'sup');
+ this.get('host').changeToTags('editor-subscript', 'sub');
}
});
diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
index 04823a04705..22162fc1a89 100644
--- a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
+++ b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js
@@ -1401,6 +1401,175 @@ Y.Base.mix(Y.M.editor_atto.Editor, [EditorClean]);
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see
"||response_json.result==="