summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-06-20 17:18:13 +0000
committerJacob Schatz <jschatz@gitlab.com>2016-06-20 17:18:13 +0000
commita0aaa6a0b8427ff1fd6811adb4cf59ab8e64a969 (patch)
tree28d14b3b5330319af686be0aa2fd30739d382742 /spec/features
parentd32ac35642aa0d75ecf5fafd7cb3e3665bbe2581 (diff)
parentb543a96e1c71c9233f9425cee2435cd0497adc4c (diff)
downloadgitlab-ce-a0aaa6a0b8427ff1fd6811adb4cf59ab8e64a969.tar.gz
Merge branch 'markdowner' into 'master'
POC: Markdown shortcut buttons ## What does this MR do? Adds markdown shortcut buttons to text area for comments. ## Are there points in the code the reviewer needs to double check? Because changing `textarea.val('something')` kills the natural browser undo stack, I had to implement a custom undo stack using state. You can't use the "undoable" state undo pattern because you need to go back to a previous state regardless of cursor position. The undo also adds an undo history item once you delete stuff or press enter. You can also edit multiple textareas at once and it will keep an undo history for each textarea individually, so the undo state should not collide between textareas. ## Why was this MR needed? It has been requested multiple times and the competition has it. https://gitlab.com/gitlab-org/gitlab-ce/issues/17185#note_12073433 Libraries are available that already implement this functionality but they are enormous and bloaty. I implemented this in very few lines of code and kept it very simple and as minimal as possible. This was also some competitions approach. I believe so as to not include too much JS. Adding extra buttons with new functionality **should only need new HTML and no new JS**. Only extra complex thing was adding a overridden undo stack, which was made as simple as possible as well. ## What are the relevant issue numbers? https://gitlab.com/gitlab-org/gitlab-ce/issues/17185#note_12073433 ## Screenshots (if relevant) **NOTE:** One thing you cannot see in this screenshot is that I am pressing <kbd>Cmd</kbd><kbd>Z</kbd> to undo and <kbd>Cmd</kbd><kbd>Shift</kbd><kbd>Z</kbd> to redo which is the undo/redo stack I implemented. <kbd>Ctrl</kbd><kbd>Y</kbd> also works for redo. ![markdown-editor](/uploads/2517bfb1a7b4269da7fcc4003c88b7f6/markdown-editor.gif) cc @dzaporozhets for UI cc @iamphill @alfredo1 for JS review cc @JobV if you like the idea. Fixes: #17185 See merge request !4305
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/issues_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index c3cb3379440..5065dfb849c 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -22,7 +22,7 @@ describe 'Issues', feature: true do
before do
visit edit_namespace_project_issue_path(project.namespace, project, issue)
- click_button "Go full screen"
+ find('.js-zen-enter').click
end
it 'should open new issue popup' do