From 32c72ccb37d2dc8169fa8d5bb123e2c92c205afc Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 1 Aug 2013 12:30:36 +0800 Subject: [PATCH 1/4] MDL-35981 comments: Make delete comment keyboard accessible. --- comment/comment.js | 43 +++++++++++-------------------------------- 1 file changed, 11 insertions(+), 32 deletions(-) diff --git a/comment/comment.js b/comment/comment.js index 544d82fbe2d..ea19518c311 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -59,11 +59,6 @@ M.core_comment = { }, this); } scope.toggle_textarea(false); - CommentHelper.confirmoverlay = new Y.Overlay({ -bodyContent: '
'+M.str.moodle.yes+' '+M.str.moodle.no+'
', - visible: false - }); - CommentHelper.confirmoverlay.render(document.body); }, post: function() { var ta = Y.one('#dlg-content-'+this.client_id); @@ -238,7 +233,6 @@ bodyContent: '
Date: Fri, 2 Aug 2013 11:42:15 +0800 Subject: [PATCH 2/4] MDL-35981 comments: Add comment about keycodes for space and enter. --- comment/comment.js | 1 + 1 file changed, 1 insertion(+) diff --git a/comment/comment.js b/comment/comment.js index ea19518c311..6c0e310b75f 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -301,6 +301,7 @@ M.core_comment = { scope.dodelete(commentid[1]); } }, '13,32'); + // 13 and 32 are the keycodes for space and enter. } ); }, From 25379e44ad51f6cc27be42bbfc94bb128a58f88a Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 1 Aug 2013 12:38:32 +0800 Subject: [PATCH 3/4] MDL-35981 comments: Remove confirm step from behat delete comments. --- blocks/comments/tests/behat/behat_block_comments.php | 4 ---- blog/tests/behat/comment.feature | 1 - 2 files changed, 5 deletions(-) diff --git a/blocks/comments/tests/behat/behat_block_comments.php b/blocks/comments/tests/behat/behat_block_comments.php index 3cac07a0d8f..e7eaf887d4d 100644 --- a/blocks/comments/tests/behat/behat_block_comments.php +++ b/blocks/comments/tests/behat/behat_block_comments.php @@ -103,10 +103,6 @@ class behat_block_comments extends behat_base { $deleteicon = $this->find('css', '.comment-delete a img', $deleteexception, $commentnode); $deleteicon->click(); - // Yes confirm. - $confirmnode = $this->find('xpath', "//div[@class='comment-delete-confirm']/descendant::a[contains(., '" . get_string('yes') . "')]"); - $confirmnode->click(); - // Wait for the AJAX request. $this->getSession()->wait(4 * 1000, false); } diff --git a/blog/tests/behat/comment.feature b/blog/tests/behat/comment.feature index 78281940855..1527a3ca256 100644 --- a/blog/tests/behat/comment.feature +++ b/blog/tests/behat/comment.feature @@ -55,7 +55,6 @@ Feature: Comment on a blog entry And I follow "Save comment" And I wait "4" seconds When I click on ".comment-delete a" "css_element" - And I click on "Yes" "link" And I wait "4" seconds Then I should not see "$My own >nasty< \"string\"!" And I follow "Blog post from user 1" From 36b58250b719a94f8a87f6289ddcbfa9e248ec9e Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Mon, 5 Aug 2013 09:49:38 +0800 Subject: [PATCH 4/4] MDL-35981 comments: Fix for keyboard control of "add a comment" --- comment/comment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comment/comment.js b/comment/comment.js index 6c0e310b75f..d1cf768a0f3 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -354,7 +354,7 @@ M.core_comment = { if (ta) { //toggle_textarea.apply(ta, [false]); //// reset textarea size - ta.on('click', function() { + ta.on('focus', function() { this.toggle_textarea(true); }, this); //ta.onkeypress = function() {