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>"
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');
}
});