You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2017/04/17 05:16:28 UTC

zeppelin git commit: [ZEPPELIN-2396] eliminate the 'ctrl/command+L' keyboard shortcut

Repository: zeppelin
Updated Branches:
  refs/heads/master 8d03920b9 -> 775607f10


[ZEPPELIN-2396] eliminate the 'ctrl/command+L' keyboard shortcut

### What is this PR for?
This PR is for that eliminate the `Ctrl/Command+L` shortcut keyboard. This function is what the ace editor defined.

### What type of PR is it?
[Improvement | Document]

### What is the Jira issue?
* [ZEPPELIN-2396](https://issues.apache.org/jira/browse/ZEPPELIN-2396)

### How should this be tested?
* **Improvement** - Press `Ctrl + L` key and check if showing the dialog or not
* **Document** - Run document development mode and check [this document](http://localhost:4000/install/upgrade.html#upgrading-from-zeppelin-07-to-08)

### Screenshots (if appropriate)
[Before]
![image](https://cloud.githubusercontent.com/assets/8110458/24990819/8529312a-2051-11e7-8849-e00803310752.png)

[After]
![z_zeppelin-2396](https://cloud.githubusercontent.com/assets/8110458/24990966/9764e108-2052-11e7-9387-560f9d587782.gif)

[Document]
![image](https://cloud.githubusercontent.com/assets/8110458/25040847/e772e024-2146-11e7-9ded-322c589b424b.png)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? Yes, I did. Please review [this document](http://localhost:4000/install/upgrade.html#upgrading-from-zeppelin-07-to-08) if you run document development mode (localhost:4000)

Author: soralee <so...@zepl.com>

Closes #2248 from soralee/ZEPPELIN-2396_ctrl_l and squashes the following commits:

bb0f7d8 [soralee] modify document
d1f966a [soralee] modify document
928f179 [soralee] add space between + and who is providing
5f30fe4 [soralee] upgrade eliminate keyboard shortcut feature and add document
4e1b846 [soralee] ZEPPELIN-2396 drop the Ctrl+L shortcut keyboard


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/775607f1
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/775607f1
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/775607f1

Branch: refs/heads/master
Commit: 775607f103d1e5f6c6e209b687f11bdc038c3e71
Parents: 8d03920
Author: soralee <so...@zepl.com>
Authored: Sat Apr 15 14:01:40 2017 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Mon Apr 17 14:16:20 2017 +0900

----------------------------------------------------------------------
 docs/install/upgrade.md                         |  2 +-
 .../notebook/paragraph/paragraph.controller.js  | 24 +++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/775607f1/docs/install/upgrade.md
----------------------------------------------------------------------
diff --git a/docs/install/upgrade.md b/docs/install/upgrade.md
index 44e38a3..61d2d68 100644
--- a/docs/install/upgrade.md
+++ b/docs/install/upgrade.md
@@ -60,4 +60,4 @@ So, copying `notebook` and `conf` directory should be enough.
 ### Upgrading from Zeppelin 0.7 to 0.8
 
  - From 0.8, we recommend to use `PYSPARK_PYTHON` and `PYSPARK_DRIVER_PYTHON` instead of `zeppelin.pyspark.python` as `zeppelin.pyspark.python` only effects driver. You can use `PYSPARK_PYTHON` and `PYSPARK_DRIVER_PYTHON` as using them in spark.
- 
\ No newline at end of file
+ - From 0.8, depending on your device, the keyboard shortcut `Ctrl-L` or `Command-L` which goes to the line somewhere user wants is not supported. 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/775607f1/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 231ac0b..6a9920a 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -709,19 +709,27 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
        */
 
       // remove binding
-      $scope.editor.commands.bindKey('ctrl-alt-n.', null);
       $scope.editor.commands.removeCommand('showSettingsMenu');
 
-      $scope.editor.commands.bindKey('ctrl-alt-l', null);
-      $scope.editor.commands.bindKey('ctrl-alt-w', null);
-      $scope.editor.commands.bindKey('ctrl-alt-a', null);
-      $scope.editor.commands.bindKey('ctrl-alt-k', null);
-      $scope.editor.commands.bindKey('ctrl-alt-e', null);
-      $scope.editor.commands.bindKey('ctrl-alt-t', null);
+      var isOption = $rootScope.isMac? 'option' : 'alt';
+
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-n.', null);
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-l', null);
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-w', null);
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-a', null);
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-k', null);
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-e', null);
+      $scope.editor.commands.bindKey('ctrl-' + isOption + '-t', null);
+      $scope.editor.commands.bindKey('ctrl-space', null);
+
+      if ($rootScope.isMac) {
+        $scope.editor.commands.bindKey('command-l', null);
+      } else {
+        $scope.editor.commands.bindKey('ctrl-l', null);
+      }
 
       // autocomplete on 'ctrl+.'
       $scope.editor.commands.bindKey('ctrl-.', 'startAutocomplete');
-      $scope.editor.commands.bindKey('ctrl-space', null);
 
       var keyBindingEditorFocusAction = function(scrollValue) {
         var numRows = $scope.editor.getSession().getLength();