From 325f668670ff72908feea189beb7e13c5e5ed7c1 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Wed, 18 Jun 2014 16:52:06 +0800 Subject: [PATCH] MDL-46046 atto_accessibilityhelper: Remove dead code from the plugin --- ...e-atto_accessibilityhelper-button-debug.js | 31 ------------------- ...dle-atto_accessibilityhelper-button-min.js | 2 +- .../moodle-atto_accessibilityhelper-button.js | 31 ------------------- .../yui/src/button/js/button.js | 31 ------------------- 4 files changed, 1 insertion(+), 94 deletions(-) diff --git a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-debug.js b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-debug.js index aa9104676a2..0dd0891dd78 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-debug.js +++ b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-debug.js @@ -67,15 +67,6 @@ var COMPONENT = 'atto_accessibilityhelper', Y.namespace('M.atto_accessibilityhelper').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { - /** - * The warnings which are displayed. - * - * @property _displayedWarnings - * @type Object - * @private - */ - _displayedWarnings: {}, - initializer: function() { this.addButton({ icon: 'e/screenreader_helper', @@ -127,28 +118,6 @@ Y.namespace('M.atto_accessibilityhelper').Button = Y.Base.create('button', Y.M.e .empty() .appendChild(this._listImages()); - // Add ability to select problem areas in the editor. - content.delegate('click', function(e) { - e.preventDefault(); - - var host = this.get('host'), - index = e.target.getAttribute("data-index"), - node = this._displayedWarnings[index], - dialogue = this.getDialogue(); - - - if (node) { - // Clear the dialogue's focusAfterHide to ensure we focus - // on the selection. - dialogue.set('focusAfterHide', null); - host.setSelection(host.getSelectionFromNode(node)); - } - - // Hide the dialogue. - dialogue.hide(); - - }, 'a', this); - return content; }, diff --git a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js index 5840b0086c9..a3f68514096 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js +++ b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_accessibilityhelper-button",function(e,t){var n="atto_accessibilityhelper",r='

{{get_string "liststyles" component}}

{{get_string "listlinks" component}}

{{get_string "listimages" component}}

',i={STYLESLABEL:n+"_styleslabel",LINKSLABEL:n+"_linkslabel",IMAGESLABEL:n+"_imageslabel"};e.namespace("M.atto_accessibilityhelper").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_displayedWarnings:{},initializer:function(){this.addButton({icon:"e/screenreader_helper",callback:this._displayDialogue})},_displayDialogue:function(){var e=this.getDialogue({headerContent:M.util.get_string("pluginname",n),width:"800px",focusAfterHide:!0});e.set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=e.Handlebars.compile(r),s=e.Node.create(t({CSS:i,component:n}));return s.one(".listStyles").empty().appendChild(this._listStyles()),s.one(".listLinks").empty().appendChild(this._listLinks()),s.one(".listImages").empty().appendChild(this._listImages()),s.delegate("click",function(e){e.preventDefault();var t=this.get("host"),n=e.target.getAttribute("data-index"),r=this._displayedWarnings[n],i=this.getDialogue();r&&(i.set("focusAfterHide",null),t.setSelection(t.getSelectionFromNode(r))),i.hide()},"a",this),s},_listStyles:function(){var t=[],r=this.get("host"),i=r.getSelectionParentNode(),s;i&&(i=e.one(i));while(i&&i!==this.editor)s=i.get("tagName"),typeof s!="undefined"&&t.push(e.Escape.html(s)),i=i.ancestor();return t.length===0&&t.push(M.util.get_string("nostyles",n)),t.reverse(),t.join(", ")},_listLinks:function(){var t=e.Node.create("
    "),r,i;return this.editor.all("a").each(function(s){i=e.Node.create(''+e.Escape.html(s.get("text"))+""),i.setData("sourcelink",s),i.on("click",this._linkSelected,this),r=e.Node.create("
  1. "),r.appendChild(i),t.appendChild(r)},this),t.hasChildNodes()||t.append("
  2. "+M.util.get_string("nolinks",n)+"
  3. "),t},_listImages:function(){var t=e.Node.create("
      "),r,i;return this.editor.all("img").each(function(s){var o=s.getAttribute("alt");o===""&&(o=s.getAttribute("title"),o===""&&(o=s.getAttribute("src"))),i=e.Node.create(''+e.Escape.html(o)+""),i.setData("sourceimage",s),i.on("click",this._imageSelected,this),r=e.Node.create("
    1. "),r.append(i),t.append(r)},this),t.hasChildNodes()||t.append("
    2. "+M.util.get_string("noimages",n)+"
    3. "),t},_imageSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),n=e.target.getData("sourceimage");this.editor.focus(),t.setSelection(t.getSelectionFromNode(n))},_linkSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),n=e.target.getData("sourcelink");this.editor.focus(),t.setSelection(t.getSelectionFromNode(n))}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); +YUI.add("moodle-atto_accessibilityhelper-button",function(e,t){var n="atto_accessibilityhelper",r='

      {{get_string "liststyles" component}}

      {{get_string "listlinks" component}}

      {{get_string "listimages" component}}

      ',i={STYLESLABEL:n+"_styleslabel",LINKSLABEL:n+"_linkslabel",IMAGESLABEL:n+"_imageslabel"};e.namespace("M.atto_accessibilityhelper").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/screenreader_helper",callback:this._displayDialogue})},_displayDialogue:function(){var e=this.getDialogue({headerContent:M.util.get_string("pluginname",n),width:"800px",focusAfterHide:!0});e.set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=e.Handlebars.compile(r),s=e.Node.create(t({CSS:i,component:n}));return s.one(".listStyles").empty().appendChild(this._listStyles()),s.one(".listLinks").empty().appendChild(this._listLinks()),s.one(".listImages").empty().appendChild(this._listImages()),s},_listStyles:function(){var t=[],r=this.get("host"),i=r.getSelectionParentNode(),s;i&&(i=e.one(i));while(i&&i!==this.editor)s=i.get("tagName"),typeof s!="undefined"&&t.push(e.Escape.html(s)),i=i.ancestor();return t.length===0&&t.push(M.util.get_string("nostyles",n)),t.reverse(),t.join(", ")},_listLinks:function(){var t=e.Node.create("
        "),r,i;return this.editor.all("a").each(function(s){i=e.Node.create(''+e.Escape.html(s.get("text"))+""),i.setData("sourcelink",s),i.on("click",this._linkSelected,this),r=e.Node.create("
      1. "),r.appendChild(i),t.appendChild(r)},this),t.hasChildNodes()||t.append("
      2. "+M.util.get_string("nolinks",n)+"
      3. "),t},_listImages:function(){var t=e.Node.create("
          "),r,i;return this.editor.all("img").each(function(s){var o=s.getAttribute("alt");o===""&&(o=s.getAttribute("title"),o===""&&(o=s.getAttribute("src"))),i=e.Node.create(''+e.Escape.html(o)+""),i.setData("sourceimage",s),i.on("click",this._imageSelected,this),r=e.Node.create("
        1. "),r.append(i),t.append(r)},this),t.hasChildNodes()||t.append("
        2. "+M.util.get_string("noimages",n)+"
        3. "),t},_imageSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),n=e.target.getData("sourceimage");this.editor.focus(),t.setSelection(t.getSelectionFromNode(n))},_linkSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),n=e.target.getData("sourcelink");this.editor.focus(),t.setSelection(t.getSelectionFromNode(n))}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); diff --git a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button.js b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button.js index aa9104676a2..0dd0891dd78 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button.js +++ b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button.js @@ -67,15 +67,6 @@ var COMPONENT = 'atto_accessibilityhelper', Y.namespace('M.atto_accessibilityhelper').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { - /** - * The warnings which are displayed. - * - * @property _displayedWarnings - * @type Object - * @private - */ - _displayedWarnings: {}, - initializer: function() { this.addButton({ icon: 'e/screenreader_helper', @@ -127,28 +118,6 @@ Y.namespace('M.atto_accessibilityhelper').Button = Y.Base.create('button', Y.M.e .empty() .appendChild(this._listImages()); - // Add ability to select problem areas in the editor. - content.delegate('click', function(e) { - e.preventDefault(); - - var host = this.get('host'), - index = e.target.getAttribute("data-index"), - node = this._displayedWarnings[index], - dialogue = this.getDialogue(); - - - if (node) { - // Clear the dialogue's focusAfterHide to ensure we focus - // on the selection. - dialogue.set('focusAfterHide', null); - host.setSelection(host.getSelectionFromNode(node)); - } - - // Hide the dialogue. - dialogue.hide(); - - }, 'a', this); - return content; }, diff --git a/lib/editor/atto/plugins/accessibilityhelper/yui/src/button/js/button.js b/lib/editor/atto/plugins/accessibilityhelper/yui/src/button/js/button.js index f6c1c74e18e..d01d387f0e4 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/accessibilityhelper/yui/src/button/js/button.js @@ -65,15 +65,6 @@ var COMPONENT = 'atto_accessibilityhelper', Y.namespace('M.atto_accessibilityhelper').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { - /** - * The warnings which are displayed. - * - * @property _displayedWarnings - * @type Object - * @private - */ - _displayedWarnings: {}, - initializer: function() { this.addButton({ icon: 'e/screenreader_helper', @@ -125,28 +116,6 @@ Y.namespace('M.atto_accessibilityhelper').Button = Y.Base.create('button', Y.M.e .empty() .appendChild(this._listImages()); - // Add ability to select problem areas in the editor. - content.delegate('click', function(e) { - e.preventDefault(); - - var host = this.get('host'), - index = e.target.getAttribute("data-index"), - node = this._displayedWarnings[index], - dialogue = this.getDialogue(); - - - if (node) { - // Clear the dialogue's focusAfterHide to ensure we focus - // on the selection. - dialogue.set('focusAfterHide', null); - host.setSelection(host.getSelectionFromNode(node)); - } - - // Hide the dialogue. - dialogue.hide(); - - }, 'a', this); - return content; },