mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
Merge branch 'MDL-68551' of https://github.com/Neosi/moodle
This commit is contained in:
commit
561fc87034
@ -16,4 +16,4 @@ Feature: Atto strike button
|
||||
And I set the field "Text editor" to "Plain text area"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit profile" "link" in the "region-main" "region"
|
||||
Then I should see "<strike>MUA</strike>"
|
||||
Then I should see "<del>MUA</del>"
|
||||
|
@ -35,13 +35,36 @@ YUI.add('moodle-atto_strike-button', function (Y, NAME) {
|
||||
|
||||
Y.namespace('M.atto_strike').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
|
||||
initializer: function() {
|
||||
this.addBasicButton({
|
||||
exec: 'strikeThrough',
|
||||
var strike;
|
||||
|
||||
this.addButton({
|
||||
callback: this._toggleStrike,
|
||||
icon: 'e/strikethrough',
|
||||
buttonName: strike,
|
||||
inlineFormat: true,
|
||||
|
||||
// Watch the following tags and add/remove highlighting as appropriate:
|
||||
tags: 'strike'
|
||||
tags: 'del, strike'
|
||||
});
|
||||
this._strikeApplier = window.rangy.createClassApplier("bf-editor-strike-del");
|
||||
},
|
||||
/**
|
||||
* Toggle the strikethrough setting.
|
||||
*
|
||||
* @method _toggleStrike
|
||||
*/
|
||||
_toggleStrike: function() {
|
||||
var host = this.get('host');
|
||||
|
||||
// Change all <del> and <strike> tags to applier class.
|
||||
host.changeToCSS('del', 'bf-editor-strike-del');
|
||||
host.changeToCSS('strike', 'bf-editor-strike-del');
|
||||
|
||||
// Use the applier toggle selection.
|
||||
this._strikeApplier.toggleSelection();
|
||||
|
||||
// Then change the applier class back to <del> tags.
|
||||
host.changeToTags('bf-editor-strike-del', 'del');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-atto_strike-button",function(e,t){e.namespace("M.atto_strike").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addBasicButton({exec:"strikeThrough",icon:"e/strikethrough",tags:"strike"})}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
YUI.add("moodle-atto_strike-button",function(e,t){e.namespace("M.atto_strike").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e;this.addButton({callback:this._toggleStrike,icon:"e/strikethrough",buttonName:e,inlineFormat:!0,tags:"del, strike"}),this._strikeApplier=window.rangy.createClassApplier("bf-editor-strike-del")},_toggleStrike:function(){var e=this.get("host");e.changeToCSS("del","bf-editor-strike-del"),e.changeToCSS("strike","bf-editor-strike-del"),this._strikeApplier.toggleSelection(),e.changeToTags("bf-editor-strike-del","del")}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
|
@ -35,13 +35,36 @@ YUI.add('moodle-atto_strike-button', function (Y, NAME) {
|
||||
|
||||
Y.namespace('M.atto_strike').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
|
||||
initializer: function() {
|
||||
this.addBasicButton({
|
||||
exec: 'strikeThrough',
|
||||
var strike;
|
||||
|
||||
this.addButton({
|
||||
callback: this._toggleStrike,
|
||||
icon: 'e/strikethrough',
|
||||
buttonName: strike,
|
||||
inlineFormat: true,
|
||||
|
||||
// Watch the following tags and add/remove highlighting as appropriate:
|
||||
tags: 'strike'
|
||||
tags: 'del, strike'
|
||||
});
|
||||
this._strikeApplier = window.rangy.createClassApplier("bf-editor-strike-del");
|
||||
},
|
||||
/**
|
||||
* Toggle the strikethrough setting.
|
||||
*
|
||||
* @method _toggleStrike
|
||||
*/
|
||||
_toggleStrike: function() {
|
||||
var host = this.get('host');
|
||||
|
||||
// Change all <del> and <strike> tags to applier class.
|
||||
host.changeToCSS('del', 'bf-editor-strike-del');
|
||||
host.changeToCSS('strike', 'bf-editor-strike-del');
|
||||
|
||||
// Use the applier toggle selection.
|
||||
this._strikeApplier.toggleSelection();
|
||||
|
||||
// Then change the applier class back to <del> tags.
|
||||
host.changeToTags('bf-editor-strike-del', 'del');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -33,12 +33,35 @@
|
||||
|
||||
Y.namespace('M.atto_strike').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], {
|
||||
initializer: function() {
|
||||
this.addBasicButton({
|
||||
exec: 'strikeThrough',
|
||||
var strike;
|
||||
|
||||
this.addButton({
|
||||
callback: this._toggleStrike,
|
||||
icon: 'e/strikethrough',
|
||||
buttonName: strike,
|
||||
inlineFormat: true,
|
||||
|
||||
// Watch the following tags and add/remove highlighting as appropriate:
|
||||
tags: 'strike'
|
||||
tags: 'del, strike'
|
||||
});
|
||||
this._strikeApplier = window.rangy.createClassApplier("bf-editor-strike-del");
|
||||
},
|
||||
/**
|
||||
* Toggle the strikethrough setting.
|
||||
*
|
||||
* @method _toggleStrike
|
||||
*/
|
||||
_toggleStrike: function() {
|
||||
var host = this.get('host');
|
||||
|
||||
// Change all <del> and <strike> tags to applier class.
|
||||
host.changeToCSS('del', 'bf-editor-strike-del');
|
||||
host.changeToCSS('strike', 'bf-editor-strike-del');
|
||||
|
||||
// Use the applier toggle selection.
|
||||
this._strikeApplier.toggleSelection();
|
||||
|
||||
// Then change the applier class back to <del> tags.
|
||||
host.changeToTags('bf-editor-strike-del', 'del');
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user