[ZEPPELIN-235] jscs in zeppelin-web

### What is this PR for?
Reopening the PR https://github.com/apache/zeppelin/pull/229 for jscs in 
zeppelin-web, using following  in .jscsrc

```
{
  "preset": "google",
  "maximumLineLength": {
  "value": 120,
  "allExcept": [ "comments", "regex"]
  }
}
```

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

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

### How should this be tested?
Try changing the indentation in any javascript file, and see an error being 
shown in the terminal on compile/build

### Questions:
* Does the licenses files need update? n/a
* Is there breaking changes for older versions? n/a
* Does this needs documentation? n/a

Author: Prabhjyot Singh <[email protected]>

Closes #1139 from prabhjyotsingh/ZEPPELIN-235 and squashes the following 
commits:

9cc3cde [Prabhjyot Singh] resove merge errors
a274efa [Prabhjyot Singh] Merge remote-tracking branch 'origin/master' into 
ZEPPELIN-235
c16d2c7 [Prabhjyot Singh] addressing @corneadoug feedback
bffd134 [Prabhjyot Singh] revert 4 space changes for notebook.controller.js
02de55d [Prabhjyot Singh] jscs in zeppelin-web


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

Branch: refs/heads/master
Commit: 5556f8152c2de3b8a5985701919438e6316e3e99
Parents: b84ae60
Author: Prabhjyot Singh <[email protected]>
Authored: Thu Jul 7 22:31:59 2016 +0530
Committer: Prabhjyot Singh <[email protected]>
Committed: Fri Jul 8 21:53:15 2016 +0530

----------------------------------------------------------------------
 zeppelin-web/.jscsrc                            |  10 +
 zeppelin-web/Gruntfile.js                       |  63 +-
 zeppelin-web/package.json                       |   1 +
 zeppelin-web/pom.xml                            |   1 +
 zeppelin-web/src/app/app.js                     | 183 +++--
 .../configuration/configuration.controller.js   |   2 +-
 .../src/app/credential/credential.controller.js |  12 +-
 zeppelin-web/src/app/home/home.controller.js    |   3 +-
 .../app/interpreter/interpreter.controller.js   | 798 +++++++++----------
 .../src/app/interpreter/interpreter.filter.js   |   4 +-
 .../src/app/jobmanager/jobmanager.controller.js |  16 +-
 .../src/app/jobmanager/jobs/job.controller.js   |  12 +-
 .../src/app/notebook/notebook.controller.js     | 133 ++--
 .../notebook/paragraph/paragraph.controller.js  | 333 ++++----
 .../src/app/search/result-list.controller.js    |  22 +-
 .../arrayOrderingSrv/arrayOrdering.service.js   |   4 +-
 .../src/components/baseUrl/baseUrl.service.js   |   3 +-
 .../dropdowninput/dropdowninput.directive.js    |  18 +-
 .../expandCollapse/expandCollapse.directive.js  |  10 +-
 .../src/components/navbar/navbar.controller.js  |   4 +-
 .../noteName-create/notename.controller.js      |  18 +-
 .../noteName-create/visible.directive.js        |  50 +-
 .../notenameImport.controller.js                |   3 +-
 .../notebookList.datafactory.js                 |  10 +-
 .../popover-html-unsafe.directive.js            |   2 +-
 .../components/searchService/search.service.js  |   6 +-
 .../websocketEvents/websocketEvents.factory.js  |  41 +-
 .../websocketEvents/websocketMsg.service.js     |  24 +-
 zeppelin-web/test/spec/controllers/nav.js       |   3 +-
 zeppelin-web/test/spec/controllers/notebook.js  |   2 +-
 zeppelin-web/test/spec/controllers/paragraph.js |  27 +-
 zeppelin-web/test/spec/directives/ngenter.js    |  20 +-
 zeppelin-web/test/spec/factory/notebookList.js  |   6 +-
 33 files changed, 922 insertions(+), 922 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/.jscsrc
----------------------------------------------------------------------
diff --git a/zeppelin-web/.jscsrc b/zeppelin-web/.jscsrc
new file mode 100644
index 0000000..ab5a0f5
--- /dev/null
+++ b/zeppelin-web/.jscsrc
@@ -0,0 +1,10 @@
+{
+  "preset": "google",
+  "maximumLineLength": {
+    "value": 120,
+    "allExcept": [
+      "comments",
+      "regex"
+    ]
+  }
+}

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/Gruntfile.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/Gruntfile.js b/zeppelin-web/Gruntfile.js
index 824984c..720baa9 100644
--- a/zeppelin-web/Gruntfile.js
+++ b/zeppelin-web/Gruntfile.js
@@ -24,7 +24,7 @@
 // use this if you want to recursively match all subfolders:
 // 'test/spec/**/*.js'
 
-module.exports = function (grunt) {
+module.exports = function(grunt) {
 
   // Load grunt tasks automatically
   require('load-grunt-tasks')(grunt);
@@ -127,7 +127,7 @@ module.exports = function (grunt) {
           '<%= yeoman.app %>/app/**/*.js',
           '<%= yeoman.app %>/components/**/*.js'
         ],
-        tasks: ['newer:jshint:all'],
+        tasks: ['newer:jshint:all', 'newer:jscs:all'],
         options: {
           livereload: '<%= connect.options.livereload %>'
         }
@@ -140,7 +140,7 @@ module.exports = function (grunt) {
       },
       jsTest: {
         files: ['test/spec/{,*/}*.js'],
-        tasks: ['newer:jshint:test', 'karma']
+        tasks: ['newer:jshint:test', 'newer:jscs:test', 'karma']
       },
       styles: {
         files: [
@@ -179,7 +179,7 @@ module.exports = function (grunt) {
       livereload: {
         options: {
           open: true,
-          middleware: function (connect) {
+          middleware: function(connect) {
             return [
               connect.static('.tmp'),
               connect().use(
@@ -194,7 +194,7 @@ module.exports = function (grunt) {
       test: {
         options: {
           port: 9001,
-          middleware: function (connect) {
+          middleware: function(connect) {
             return [
               connect.static('.tmp'),
               connect.static('test'),
@@ -215,10 +215,30 @@ module.exports = function (grunt) {
       }
     },
 
+    jscs: {
+      options: {
+        config: '.jscsrc',
+        esnext: true, // If you use ES6 http://jscs.info/overview.html#esnext
+        verbose: true, // If you need output with rule names 
http://jscs.info/overview.html#verbose
+        requireCurlyBraces: ['if']
+      },
+      all: {
+        src: [
+          'Gruntfile.js',
+          '<%= yeoman.app %>/app/**/*.js',
+          '<%= yeoman.app %>/components/**/*.js'
+        ]
+      },
+      test: {
+        src: ['test/spec/{,*/}*.js']
+      }
+    },
+
     // Make sure code styles are up to par and there are no obvious mistakes
     jshint: {
       options: {
         jshintrc: '.jshintrc',
+        reporterOutput: '',
         reporter: require('jshint-stylish')
       },
       all: {
@@ -271,27 +291,26 @@ module.exports = function (grunt) {
 
     // Automatically inject Bower components into the app
     wiredep: {
-      options: {
-      },
+      options: {},
       app: {
         src: ['<%= yeoman.app %>/index.html'],
-        ignorePath:  /\.\.\//
+        ignorePath: /\.\.\//
       },
       test: {
         devDependencies: true,
         src: '<%= karma.unit.configFile %>',
-        ignorePath:  /\.\.\//,
-        fileTypes:{
+        ignorePath: /\.\.\//,
+        fileTypes: {
           js: {
             block: 
/(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
-              detect: {
-                js: /'(.*\.js)'/gi
-              },
-              replace: {
-                js: '\'{{filePath}}\','
-              }
+            detect: {
+              js: /'(.*\.js)'/gi
+            },
+            replace: {
+              js: '\'{{filePath}}\','
             }
           }
+        }
       }
     },
 
@@ -319,7 +338,7 @@ module.exports = function (grunt) {
       html: ['<%= yeoman.dist %>/{,*/}*.html'],
       css: ['<%= yeoman.dist %>/styles/*.css'],
       options: {
-        assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/assets']
+        assetsDirs: ['<%= yeoman.dist %>', '<%= yeoman.dist %>/assets']
       }
     },
 
@@ -411,12 +430,12 @@ module.exports = function (grunt) {
           ]
         }, {
           // copy fonts
-          expand : true,
+          expand: true,
           cwd: '<%= yeoman.app %>',
           dest: '<%= yeoman.dist %>',
           src: ['fonts/**/*.{eot,svg,ttf,woff}']
         }, {
-          expand : true,
+          expand: true,
           cwd: '<%= yeoman.app %>',
           dest: '<%= yeoman.dist %>',
           src: ['app/**/*.html', 'components/**/*.html']
@@ -474,8 +493,7 @@ module.exports = function (grunt) {
     }
   });
 
-
-  grunt.registerTask('serve', 'Compile then start a connect web server', 
function (target) {
+  grunt.registerTask('serve', 'Compile then start a connect web server', 
function(target) {
     if (target === 'dist') {
       return grunt.task.run(['build', 'connect:dist:keepalive']);
     }
@@ -490,7 +508,7 @@ module.exports = function (grunt) {
     ]);
   });
 
-  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task 
instead', function (target) {
+  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task 
instead', function(target) {
     grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` 
to start a server.');
     grunt.task.run(['serve:' + target]);
   });
@@ -505,6 +523,7 @@ module.exports = function (grunt) {
   ]);
 
   grunt.registerTask('build', [
+    'jscs',
     'jshint:all',
     'htmlhint',
     'clean:dist',

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/package.json
----------------------------------------------------------------------
diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json
index d3f6741..8bfa0ef 100644
--- a/zeppelin-web/package.json
+++ b/zeppelin-web/package.json
@@ -31,6 +31,7 @@
     "grunt-svgmin": "^0.4.0",
     "grunt-usemin": "^2.1.1",
     "grunt-wiredep": "~2.0.0",
+    "grunt-jscs": "^2.1.0",
     "jshint-stylish": "^0.2.0",
     "karma": "~0.12.23",
     "karma-coverage": "^0.5.1",

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/pom.xml
----------------------------------------------------------------------
diff --git a/zeppelin-web/pom.xml b/zeppelin-web/pom.xml
index 0b2ce0e..5b331c6 100644
--- a/zeppelin-web/pom.xml
+++ b/zeppelin-web/pom.xml
@@ -59,6 +59,7 @@
             <exclude>.gitignore</exclude>
             <exclude>.bowerrc</exclude>
             <exclude>.editorconfig</exclude>
+            <exclude>.jscsrc</exclude>
             <exclude>.jshintrc</exclude>
             <exclude>.tmp/**</exclude>
             <exclude>**/.settings/*</exclude>

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/app.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js
index b5f6c85..3cbfe3f 100644
--- a/zeppelin-web/src/app/app.js
+++ b/zeppelin-web/src/app/app.js
@@ -16,107 +16,104 @@
  */
 'use strict';
 (function() {
-    var zeppelinWebApp = angular.module('zeppelinWebApp', [
-            'ngCookies',
-            'ngAnimate',
-            'ngRoute',
-            'ngSanitize',
-            'angular-websocket',
-            'ui.ace',
-            'ui.bootstrap',
-            'as.sortable',
-            'ngTouch',
-            'ngDragDrop',
-            'angular.filter',
-            'monospaced.elastic',
-            'puElasticInput',
-            'xeditable',
-            'ngToast',
-            'focus-if',
-            'ngResource'
-        ])
+  var zeppelinWebApp = angular.module('zeppelinWebApp', [
+          'ngCookies',
+          'ngAnimate',
+          'ngRoute',
+          'ngSanitize',
+          'angular-websocket',
+          'ui.ace',
+          'ui.bootstrap',
+          'as.sortable',
+          'ngTouch',
+          'ngDragDrop',
+          'angular.filter',
+          'monospaced.elastic',
+          'puElasticInput',
+          'xeditable',
+          'ngToast',
+          'focus-if',
+          'ngResource'
+      ])
         .filter('breakFilter', function() {
-            return function (text) {
-                if (!!text) {
-                    return text.replace(/\n/g, '<br />');
-                }
-            };
+          return function(text) {
+            if (!!text) {
+              return text.replace(/\n/g, '<br />');
+            }
+          };
         })
-        .config(function ($httpProvider, $routeProvider, ngToastProvider) {
-            // withCredentials when running locally via grunt
-            $httpProvider.defaults.withCredentials = true;
+        .config(function($httpProvider, $routeProvider, ngToastProvider) {
+          // withCredentials when running locally via grunt
+          $httpProvider.defaults.withCredentials = true;
 
-            $routeProvider
-                .when('/', {
-                    templateUrl: 'app/home/home.html'
-                })
-                .when('/notebook/:noteId', {
-                    templateUrl: 'app/notebook/notebook.html',
-                    controller: 'NotebookCtrl'
-                })
-                .when('/notebook/:noteId/paragraph?=:paragraphId', {
-                    templateUrl: 'app/notebook/notebook.html',
-                    controller: 'NotebookCtrl'
-                })
-                .when('/notebook/:noteId/paragraph/:paragraphId?', {
-                    templateUrl: 'app/notebook/notebook.html',
-                    controller: 'NotebookCtrl'
-                })
-                .when('/jobmanager', {
-                    templateUrl: 'app/jobmanager/jobmanager.html',
-                    controller: 'JobmanagerCtrl'
-                })
-                .when('/interpreter', {
-                    templateUrl: 'app/interpreter/interpreter.html',
-                    controller: 'InterpreterCtrl'
-                })
-                .when('/credential', {
-                    templateUrl: 'app/credential/credential.html',
-                    controller: 'CredentialCtrl'
-                })
-                .when('/configuration', {
-                    templateUrl: 'app/configuration/configuration.html',
-                    controller: 'ConfigurationCtrl'
-                })
-                .when('/search/:searchTerm', {
-                    templateUrl: 'app/search/result-list.html',
-                    controller: 'SearchResultCtrl'
-                })
-                .otherwise({
-                    redirectTo: '/'
-                });
-
-            ngToastProvider.configure({
-                dismissButton: true,
-                dismissOnClick: false,
-                timeout: 6000
+          $routeProvider
+            .when('/', {
+              templateUrl: 'app/home/home.html'
+            })
+            .when('/notebook/:noteId', {
+              templateUrl: 'app/notebook/notebook.html',
+              controller: 'NotebookCtrl'
+            })
+            .when('/notebook/:noteId/paragraph?=:paragraphId', {
+              templateUrl: 'app/notebook/notebook.html',
+              controller: 'NotebookCtrl'
+            })
+            .when('/notebook/:noteId/paragraph/:paragraphId?', {
+              templateUrl: 'app/notebook/notebook.html',
+              controller: 'NotebookCtrl'
+            })
+            .when('/jobmanager', {
+              templateUrl: 'app/jobmanager/jobmanager.html',
+              controller: 'JobmanagerCtrl'
+            })
+            .when('/interpreter', {
+              templateUrl: 'app/interpreter/interpreter.html',
+              controller: 'InterpreterCtrl'
+            })
+            .when('/credential', {
+              templateUrl: 'app/credential/credential.html',
+              controller: 'CredentialCtrl'
+            })
+            .when('/configuration', {
+              templateUrl: 'app/configuration/configuration.html',
+              controller: 'ConfigurationCtrl'
+            })
+            .when('/search/:searchTerm', {
+              templateUrl: 'app/search/result-list.html',
+              controller: 'SearchResultCtrl'
+            })
+            .otherwise({
+              redirectTo: '/'
             });
-        });
-
 
-    function auth() {
-        var $http = angular.injector(['ng']).get('$http');
-        var baseUrlSrv = 
angular.injector(['zeppelinWebApp']).get('baseUrlSrv');
-        // withCredentials when running locally via grunt
-        $http.defaults.withCredentials = true;
-
-        return 
$http.get(baseUrlSrv.getRestApiBase()+'/security/ticket').then(function(response)
 {
-            zeppelinWebApp.run(function($rootScope) {
-                $rootScope.ticket = angular.fromJson(response.data).body;
-            });
-        }, function(errorResponse) {
-            // Handle error case
+          ngToastProvider.configure({
+            dismissButton: true,
+            dismissOnClick: false,
+            timeout: 6000
+          });
         });
-    }
 
-    function bootstrapApplication() {
-        angular.bootstrap(document, ['zeppelinWebApp']);
-    }
+  function auth() {
+    var $http = angular.injector(['ng']).get('$http');
+    var baseUrlSrv = angular.injector(['zeppelinWebApp']).get('baseUrlSrv');
+    // withCredentials when running locally via grunt
+    $http.defaults.withCredentials = true;
 
-
-    angular.element(document).ready(function() {
-        auth().then(bootstrapApplication);
+    return $http.get(baseUrlSrv.getRestApiBase() + 
'/security/ticket').then(function(response) {
+      zeppelinWebApp.run(function($rootScope) {
+        $rootScope.ticket = angular.fromJson(response.data).body;
+      });
+    }, function(errorResponse) {
+      // Handle error case
     });
+  }
 
-}());
+  function bootstrapApplication() {
+    angular.bootstrap(document, ['zeppelinWebApp']);
+  }
 
+  angular.element(document).ready(function() {
+    auth().then(bootstrapApplication);
+  });
+
+}());

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/configuration/configuration.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/configuration/configuration.controller.js 
b/zeppelin-web/src/app/configuration/configuration.controller.js
index feecddf..9c77a33 100644
--- a/zeppelin-web/src/app/configuration/configuration.controller.js
+++ b/zeppelin-web/src/app/configuration/configuration.controller.js
@@ -19,7 +19,7 @@ 
angular.module('zeppelinWebApp').controller('ConfigurationCtrl', function($scope
   $scope._ = _;
 
   var getConfigurations = function() {
-    $http.get(baseUrlSrv.getRestApiBase()+'/configurations/all').
+    $http.get(baseUrlSrv.getRestApiBase() + '/configurations/all').
     success(function(data, status, headers, config) {
       $scope.configurations = data.body;
     }).

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/credential/credential.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/credential/credential.controller.js 
b/zeppelin-web/src/app/credential/credential.controller.js
index 32562b8..df23163 100644
--- a/zeppelin-web/src/app/credential/credential.controller.js
+++ b/zeppelin-web/src/app/credential/credential.controller.js
@@ -14,8 +14,8 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, 
$route, $routeParams, $location, $rootScope,
-                                                                         
$http, baseUrlSrv) {
+angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, 
$route, $routeParams, $location,
+                                                                       
$rootScope, $http, baseUrlSrv) {
   $scope._ = _;
 
   $scope.credentialEntity = '';
@@ -33,11 +33,11 @@ 
angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, $
     }
 
     $http.put(baseUrlSrv.getRestApiBase() + '/credential',
-      { 'entity': $scope.credentialEntity,
+      {'entity': $scope.credentialEntity,
         'username': $scope.credentialUsername,
         'password': $scope.credentialPassword
-      } ).
-    success(function (data, status, headers, config) {
+      }).
+    success(function(data, status, headers, config) {
       BootstrapDialog.alert({
         closable: true,
         message: 'Successfully saved credentials.'
@@ -47,7 +47,7 @@ angular.module('zeppelinWebApp').controller('CredentialCtrl', 
function($scope, $
       $scope.credentialPassword = '';
       console.log('Success %o %o', status, data.message);
     }).
-    error(function (data, status, headers, config) {
+    error(function(data, status, headers, config) {
       alert('Error saving credentials');
       console.log('Error %o %o', status, data.message);
     });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/home/home.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/home/home.controller.js 
b/zeppelin-web/src/app/home/home.controller.js
index ddd0f80..7c07cd4 100644
--- a/zeppelin-web/src/app/home/home.controller.js
+++ b/zeppelin-web/src/app/home/home.controller.js
@@ -13,7 +13,8 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').controller('HomeCtrl', function($scope, 
notebookListDataFactory, websocketMsgSrv, $rootScope, arrayOrderingSrv, $http, 
baseUrlSrv) {
+angular.module('zeppelinWebApp').controller('HomeCtrl', function($scope, 
notebookListDataFactory, websocketMsgSrv,
+                                                                 $rootScope, 
arrayOrderingSrv, $http, baseUrlSrv) {
   var vm = this;
   vm.notes = notebookListDataFactory;
   vm.websocketMsgSrv = websocketMsgSrv;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/interpreter/interpreter.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/interpreter/interpreter.controller.js 
b/zeppelin-web/src/app/interpreter/interpreter.controller.js
index 5d87aae..5a90b79 100644
--- a/zeppelin-web/src/app/interpreter/interpreter.controller.js
+++ b/zeppelin-web/src/app/interpreter/interpreter.controller.js
@@ -14,459 +14,447 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').controller('InterpreterCtrl', 
function($scope, $route, $routeParams, $location, $rootScope,
-                                                                         
$http, baseUrlSrv, ngToast) {
-  var interpreterSettingsTmp = [];
-  $scope.interpreterSettings = [];
-  $scope.availableInterpreters = {};
-  $scope.showAddNewSetting = false;
-  $scope.showRepositoryInfo = false;
-  $scope._ = _;
-
-  var getInterpreterSettings = function() {
-    $http.get(baseUrlSrv.getRestApiBase()+'/interpreter/setting').
-      success(function(data, status, headers, config) {
+angular.module('zeppelinWebApp').controller('InterpreterCtrl',
+  function($scope, $route, $routeParams, $location, $rootScope, $http, 
baseUrlSrv, ngToast) {
+    var interpreterSettingsTmp = [];
+    $scope.interpreterSettings = [];
+    $scope.availableInterpreters = {};
+    $scope.showAddNewSetting = false;
+    $scope.showRepositoryInfo = false;
+    $scope._ = _;
+
+    var getInterpreterSettings = function() {
+      $http.get(baseUrlSrv.getRestApiBase() + 
'/interpreter/setting').success(function(data, status, headers, config) {
         $scope.interpreterSettings = data.body;
-      }).
-      error(function(data, status, headers, config) {
+      }).error(function(data, status, headers, config) {
         console.log('Error %o %o', status, data.message);
       });
-  };
+    };
 
-  var getAvailableInterpreters = function() {
-    $http.get(baseUrlSrv.getRestApiBase()+'/interpreter').
-      success(function(data, status, headers, config) {
+    var getAvailableInterpreters = function() {
+      $http.get(baseUrlSrv.getRestApiBase() + 
'/interpreter').success(function(data, status, headers, config) {
         $scope.availableInterpreters = data.body;
-      }).
-      error(function(data, status, headers, config) {
+      }).error(function(data, status, headers, config) {
         console.log('Error %o %o', status, data.message);
       });
-  };
-
-  var emptyNewProperty = function(object) {
-    angular.extend(object, {propertyValue: '', propertyKey: ''});
-  };
-
-  var emptyNewDependency = function(object) {
-    angular.extend(object, {depArtifact: '', depExclude: ''});
-  };
-
-  var removeTMPSettings = function(index) {
-    interpreterSettingsTmp.splice(index, 1);
-  };
-
-  $scope.copyOriginInterpreterSettingProperties = function(settingId) {
-    var index = _.findIndex($scope.interpreterSettings, { 'id': settingId });
-    interpreterSettingsTmp[index] = 
angular.copy($scope.interpreterSettings[index]);
-  };
-
-  $scope.setSessionOption = function(settingId, sessionOption) {
-    var option;
-    if (settingId === undefined) {
-      option = $scope.newInterpreterSetting.option;
-    } else {
-      var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
-      var setting = $scope.interpreterSettings[index];
-      option = setting.option;
-    }
-
-    if (sessionOption === 'isolated') {
-      option.perNoteSession = false;
-      option.perNoteProcess = true;
-    } else if (sessionOption === 'scoped') {
-      option.perNoteSession = true;
-      option.perNoteProcess = false;
-    } else {
-      option.perNoteSession = false;
-      option.perNoteProcess = false;
-    }
-  };
-
-  $scope.getSessionOption = function(settingId) {
-    var option;
-    if (settingId === undefined) {
-      option = $scope.newInterpreterSetting.option;
-    } else {
+    };
+
+    var emptyNewProperty = function(object) {
+      angular.extend(object, {propertyValue: '', propertyKey: ''});
+    };
+
+    var emptyNewDependency = function(object) {
+      angular.extend(object, {depArtifact: '', depExclude: ''});
+    };
+
+    var removeTMPSettings = function(index) {
+      interpreterSettingsTmp.splice(index, 1);
+    };
+
+    $scope.copyOriginInterpreterSettingProperties = function(settingId) {
       var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
-      var setting = $scope.interpreterSettings[index];
-      option = setting.option;
-    }
-
-    if (option.perNoteSession) {
-      return 'scoped';
-    } else if (option.perNoteProcess) {
-      return 'isolated';
-    } else {
-      return 'shared';
-    }
-  };
-
-  $scope.updateInterpreterSetting = function(form, settingId) {
-    var thisConfirm = BootstrapDialog.confirm({
-      closable: false,
-      closeByBackdrop: false,
-      closeByKeyboard: false,
-      title: '',
-      message: 'Do you want to update this interpreter and restart with new 
settings?',
-      callback: function (result) {
-        if (result) {
-          var index = _.findIndex($scope.interpreterSettings, {'id': 
settingId});
-          var setting = $scope.interpreterSettings[index];
-          if (setting.propertyKey !== '' || setting.propertyKey) {
-            $scope.addNewInterpreterProperty(settingId);
-          }
-          if (setting.depArtifact !== '' || setting.depArtifact) {
-            $scope.addNewInterpreterDependency(settingId);
-          }
-          // add missing field of option
-          if (!setting.option) {
-            setting.option = {};
-          }
-          if (setting.option.isExistingProcess === undefined) {
-            setting.option.isExistingProcess = false;
-          }
-          if (setting.option.remote === undefined) {
-            // remote always true for now
-            setting.option.remote = true;
+      interpreterSettingsTmp[index] = 
angular.copy($scope.interpreterSettings[index]);
+    };
+
+    $scope.setSessionOption = function(settingId, sessionOption) {
+      var option;
+      if (settingId === undefined) {
+        option = $scope.newInterpreterSetting.option;
+      } else {
+        var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+        var setting = $scope.interpreterSettings[index];
+        option = setting.option;
+      }
+
+      if (sessionOption === 'isolated') {
+        option.perNoteSession = false;
+        option.perNoteProcess = true;
+      } else if (sessionOption === 'scoped') {
+        option.perNoteSession = true;
+        option.perNoteProcess = false;
+      } else {
+        option.perNoteSession = false;
+        option.perNoteProcess = false;
+      }
+    };
+
+    $scope.getSessionOption = function(settingId) {
+      var option;
+      if (settingId === undefined) {
+        option = $scope.newInterpreterSetting.option;
+      } else {
+        var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+        var setting = $scope.interpreterSettings[index];
+        option = setting.option;
+      }
+
+      if (option.perNoteSession) {
+        return 'scoped';
+      } else if (option.perNoteProcess) {
+        return 'isolated';
+      } else {
+        return 'shared';
+      }
+    };
+
+    $scope.updateInterpreterSetting = function(form, settingId) {
+      var thisConfirm = BootstrapDialog.confirm({
+        closable: false,
+        closeByBackdrop: false,
+        closeByKeyboard: false,
+        title: '',
+        message: 'Do you want to update this interpreter and restart with new 
settings?',
+        callback: function(result) {
+          if (result) {
+            var index = _.findIndex($scope.interpreterSettings, {'id': 
settingId});
+            var setting = $scope.interpreterSettings[index];
+            if (setting.propertyKey !== '' || setting.propertyKey) {
+              $scope.addNewInterpreterProperty(settingId);
+            }
+            if (setting.depArtifact !== '' || setting.depArtifact) {
+              $scope.addNewInterpreterDependency(settingId);
+            }
+            // add missing field of option
+            if (!setting.option) {
+              setting.option = {};
+            }
+            if (setting.option.isExistingProcess === undefined) {
+              setting.option.isExistingProcess = false;
+            }
+            if (setting.option.remote === undefined) {
+              // remote always true for now
+              setting.option.remote = true;
+            }
+            var request = {
+              option: angular.copy(setting.option),
+              properties: angular.copy(setting.properties),
+              dependencies: angular.copy(setting.dependencies)
+            };
+
+            thisConfirm.$modalFooter.find('button').addClass('disabled');
+            thisConfirm.$modalFooter.find('button:contains("OK")')
+              .html('<i class="fa fa-circle-o-notch fa-spin"></i> Saving 
Setting');
+
+            $http.put(baseUrlSrv.getRestApiBase() + '/interpreter/setting/' + 
settingId, request)
+              .success(function(data, status, headers, config) {
+                $scope.interpreterSettings[index] = data.body;
+                removeTMPSettings(index);
+                thisConfirm.close();
+              })
+              .error(function(data, status, headers, config) {
+                console.log('Error %o %o', status, data.message);
+                ngToast.danger({content: data.message, verticalPosition: 
'bottom'});
+                form.$show();
+                thisConfirm.close();
+              });
+            return false;
+          } else {
+            form.$show();
           }
-          var request = {
-            option: angular.copy(setting.option),
-            properties: angular.copy(setting.properties),
-            dependencies: angular.copy(setting.dependencies)
-          };
+        }
+      });
+    };
+
+    $scope.resetInterpreterSetting = function(settingId) {
+      var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+
+      // Set the old settings back
+      $scope.interpreterSettings[index] = 
angular.copy(interpreterSettingsTmp[index]);
+      removeTMPSettings(index);
+    };
 
-          thisConfirm.$modalFooter.find('button').addClass('disabled');
-          thisConfirm.$modalFooter.find('button:contains("OK")')
-            .html('<i class="fa fa-circle-o-notch fa-spin"></i> Saving 
Setting');
-
-          $http.put(baseUrlSrv.getRestApiBase() + '/interpreter/setting/' + 
settingId, request)
-            .success(function(data, status, headers, config) {
-              $scope.interpreterSettings[index] = data.body;
-              removeTMPSettings(index);
-              thisConfirm.close();
-            })
-            .error(function(data, status, headers, config) {
+    $scope.removeInterpreterSetting = function(settingId) {
+      BootstrapDialog.confirm({
+        closable: true,
+        title: '',
+        message: 'Do you want to delete this interpreter setting?',
+        callback: function(result) {
+          if (result) {
+            $http.delete(baseUrlSrv.getRestApiBase() + '/interpreter/setting/' 
+ settingId)
+              .success(function(data, status, headers, config) {
+
+                var index = _.findIndex($scope.interpreterSettings, {'id': 
settingId});
+                $scope.interpreterSettings.splice(index, 1);
+              }).error(function(data, status, headers, config) {
               console.log('Error %o %o', status, data.message);
-              ngToast.danger({content: data.message, verticalPosition: 
'bottom'});
-              form.$show();
-              thisConfirm.close();
             });
-          return false;
-        } else {
-          form.$show();
+          }
+        }
+      });
+    };
+
+    $scope.newInterpreterGroupChange = function() {
+      var el = _.pluck(_.filter($scope.availableInterpreters, {'group': 
$scope.newInterpreterSetting.group}),
+        'properties');
+
+      var properties = {};
+      for (var i = 0; i < el.length; i++) {
+        var intpInfo = el[i];
+        for (var key in intpInfo) {
+          properties[key] = {
+            value: intpInfo[key].defaultValue,
+            description: intpInfo[key].description
+          };
         }
       }
-    });
-  };
-
-  $scope.resetInterpreterSetting = function(settingId){
-    var index = _.findIndex($scope.interpreterSettings, { 'id': settingId });
-
-    // Set the old settings back
-    $scope.interpreterSettings[index] = 
angular.copy(interpreterSettingsTmp[index]);
-    removeTMPSettings(index);
-  };
-
-  $scope.removeInterpreterSetting = function(settingId) {
-    BootstrapDialog.confirm({
-      closable: true,
-      title: '',
-      message: 'Do you want to delete this interpreter setting?',
-      callback: function(result) {
-        if (result) {
-          $http.delete(baseUrlSrv.getRestApiBase() + '/interpreter/setting/' + 
settingId).
-            success(function(data, status, headers, config) {
-
-              var index = _.findIndex($scope.interpreterSettings, { 'id': 
settingId });
-              $scope.interpreterSettings.splice(index, 1);
-            }).
-            error(function(data, status, headers, config) {
+
+      $scope.newInterpreterSetting.properties = properties;
+    };
+
+    $scope.restartInterpreterSetting = function(settingId) {
+      BootstrapDialog.confirm({
+        closable: true,
+        title: '',
+        message: 'Do you want to restart this interpreter?',
+        callback: function(result) {
+          if (result) {
+            $http.put(baseUrlSrv.getRestApiBase() + 
'/interpreter/setting/restart/' + settingId)
+              .success(function(data, status, headers, config) {
+                var index = _.findIndex($scope.interpreterSettings, {'id': 
settingId});
+                $scope.interpreterSettings[index] = data.body;
+              }).error(function(data, status, headers, config) {
               console.log('Error %o %o', status, data.message);
             });
+          }
         }
+      });
+    };
+
+    $scope.addNewInterpreterSetting = function() {
+      //user input validation on interpreter creation
+      if (!$scope.newInterpreterSetting.name.trim() || 
!$scope.newInterpreterSetting.group) {
+        BootstrapDialog.alert({
+          closable: true,
+          title: 'Add interpreter',
+          message: 'Please fill in interpreter name and choose a group'
+        });
+        return;
       }
-    });
-  };
-
-  $scope.newInterpreterGroupChange = function() {
-    var el = _.pluck(_.filter($scope.availableInterpreters, { 'group': 
$scope.newInterpreterSetting.group }), 'properties');
-
-    var properties = {};
-    for (var i=0; i < el.length; i++) {
-      var intpInfo = el[i];
-      for (var key in intpInfo) {
-        properties[key] = {
-          value: intpInfo[key].defaultValue,
-          description: intpInfo[key].description
-        };
+
+      if (_.findIndex($scope.interpreterSettings, {'name': 
$scope.newInterpreterSetting.name}) >= 0) {
+        BootstrapDialog.alert({
+          closable: true,
+          title: 'Add interpreter',
+          message: 'Name ' + $scope.newInterpreterSetting.name + ' already 
exists'
+        });
+        return;
       }
-    }
-
-    $scope.newInterpreterSetting.properties = properties;
-  };
-
-  $scope.restartInterpreterSetting = function(settingId) {
-    BootstrapDialog.confirm({
-      closable: true,
-      title: '',
-      message: 'Do you want to restart this interpreter?',
-      callback: function(result) {
-        if (result) {
-          $http.put(baseUrlSrv.getRestApiBase() + 
'/interpreter/setting/restart/' + settingId).
-            success(function(data, status, headers, config) {
-              var index = _.findIndex($scope.interpreterSettings, { 'id': 
settingId });
-              $scope.interpreterSettings[index] = data.body;
-            }).
-            error(function(data, status, headers, config) {
-              console.log('Error %o %o', status, data.message);
-            });
-        }
+
+      var newSetting = $scope.newInterpreterSetting;
+      if (newSetting.propertyKey !== '' || newSetting.propertyKey) {
+        $scope.addNewInterpreterProperty();
+      }
+      if (newSetting.depArtifact !== '' || newSetting.depArtifact) {
+        $scope.addNewInterpreterDependency();
       }
-    });
-  };
 
-  $scope.addNewInterpreterSetting = function() {
-    //user input validation on interpreter creation
-    if (!$scope.newInterpreterSetting.name.trim() || 
!$scope.newInterpreterSetting.group) {
-      BootstrapDialog.alert({
-        closable: true,
-        title: 'Add interpreter',
-        message: 'Please fill in interpreter name and choose a group'
-      });
-      return;
-    }
+      var request = angular.copy($scope.newInterpreterSetting);
 
-    if (_.findIndex($scope.interpreterSettings, { 'name': 
$scope.newInterpreterSetting.name }) >= 0) {
-      BootstrapDialog.alert({
-        closable: true,
-        title: 'Add interpreter',
-        message: 'Name ' + $scope.newInterpreterSetting.name + ' already 
exists'
-      });
-      return;
-    }
-
-    var newSetting = $scope.newInterpreterSetting;
-    if (newSetting.propertyKey !== '' || newSetting.propertyKey) {
-      $scope.addNewInterpreterProperty();
-    }
-    if (newSetting.depArtifact !== '' || newSetting.depArtifact) {
-      $scope.addNewInterpreterDependency();
-    }
-
-    var request = angular.copy($scope.newInterpreterSetting);
-
-    // Change properties to proper request format
-    var newProperties = {};
-    for (var p in newSetting.properties) {
-      newProperties[p] = newSetting.properties[p].value;
-    }
-    request.properties = newProperties;
-
-    $http.post(baseUrlSrv.getRestApiBase() + '/interpreter/setting', request).
-      success(function(data, status, headers, config) {
-        $scope.resetNewInterpreterSetting();
-        getInterpreterSettings();
-        $scope.showAddNewSetting = false;
-      }).
-      error(function(data, status, headers, config) {
+      // Change properties to proper request format
+      var newProperties = {};
+      for (var p in newSetting.properties) {
+        newProperties[p] = newSetting.properties[p].value;
+      }
+      request.properties = newProperties;
+
+      $http.post(baseUrlSrv.getRestApiBase() + '/interpreter/setting', request)
+        .success(function(data, status, headers, config) {
+          $scope.resetNewInterpreterSetting();
+          getInterpreterSettings();
+          $scope.showAddNewSetting = false;
+        }).error(function(data, status, headers, config) {
         console.log('Error %o %o', status, data.message);
         ngToast.danger({content: data.message, verticalPosition: 'bottom'});
       });
-  };
-
-  $scope.cancelInterpreterSetting = function() {
-    $scope.showAddNewSetting = false;
-    $scope.resetNewInterpreterSetting();
-  };
-
-  $scope.resetNewInterpreterSetting = function() {
-    $scope.newInterpreterSetting = {
-      name: undefined,
-      group: undefined,
-      properties: {},
-      dependencies: [],
-      option: {
-        remote: true,
-        isExistingProcess: false,
-        perNoteSession: false,
-        perNoteProcess: false
+    };
 
-      }
+    $scope.cancelInterpreterSetting = function() {
+      $scope.showAddNewSetting = false;
+      $scope.resetNewInterpreterSetting();
     };
-    emptyNewProperty($scope.newInterpreterSetting);
-  };
-
-  $scope.removeInterpreterProperty = function(key, settingId) {
-    if (settingId === undefined) {
-      delete $scope.newInterpreterSetting.properties[key];
-    }
-    else {
-      var index = _.findIndex($scope.interpreterSettings, { 'id': settingId });
-      delete $scope.interpreterSettings[index].properties[key];
-    }
-  };
-
-  $scope.removeInterpreterDependency = function(artifact, settingId) {
-    if (settingId === undefined) {
-      $scope.newInterpreterSetting.dependencies = 
_.reject($scope.newInterpreterSetting.dependencies,
-        function(el) {
-          return el.groupArtifactVersion === artifact;
-        });
-    } else {
-      var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
-      $scope.interpreterSettings[index].dependencies = 
_.reject($scope.interpreterSettings[index].dependencies,
-        function(el) {
-          return el.groupArtifactVersion === artifact;
-        });
-    }
-  };
 
-  $scope.addNewInterpreterProperty = function(settingId) {
-    if(settingId === undefined) {
-      // Add new property from create form
-      if (!$scope.newInterpreterSetting.propertyKey || 
$scope.newInterpreterSetting.propertyKey === '') {
-        return;
-      }
+    $scope.resetNewInterpreterSetting = function() {
+      $scope.newInterpreterSetting = {
+        name: undefined,
+        group: undefined,
+        properties: {},
+        dependencies: [],
+        option: {
+          remote: true,
+          isExistingProcess: false,
+          perNoteSession: false,
+          perNoteProcess: false
 
-      
$scope.newInterpreterSetting.properties[$scope.newInterpreterSetting.propertyKey]
 = {
-        value: $scope.newInterpreterSetting.propertyValue
+        }
       };
       emptyNewProperty($scope.newInterpreterSetting);
-    }
-    else {
-      // Add new property from edit form
-      var index = _.findIndex($scope.interpreterSettings, { 'id': settingId });
-      var setting = $scope.interpreterSettings[index];
+    };
 
-      if (!setting.propertyKey || setting.propertyKey === '') {
-        return;
+    $scope.removeInterpreterProperty = function(key, settingId) {
+      if (settingId === undefined) {
+        delete $scope.newInterpreterSetting.properties[key];
+      } else {
+        var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+        delete $scope.interpreterSettings[index].properties[key];
       }
-      setting.properties[setting.propertyKey] = setting.propertyValue;
-      emptyNewProperty(setting);
-    }
-  };
-
-  $scope.addNewInterpreterDependency = function(settingId) {
-    if(settingId === undefined) {
-      // Add new dependency from create form
-      if (!$scope.newInterpreterSetting.depArtifact || 
$scope.newInterpreterSetting.depArtifact === '') {
-        return;
+    };
+
+    $scope.removeInterpreterDependency = function(artifact, settingId) {
+      if (settingId === undefined) {
+        $scope.newInterpreterSetting.dependencies = 
_.reject($scope.newInterpreterSetting.dependencies,
+          function(el) {
+            return el.groupArtifactVersion === artifact;
+          });
+      } else {
+        var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+        $scope.interpreterSettings[index].dependencies = 
_.reject($scope.interpreterSettings[index].dependencies,
+          function(el) {
+            return el.groupArtifactVersion === artifact;
+          });
       }
+    };
 
-      // overwrite if artifact already exists
-      var newSetting = $scope.newInterpreterSetting;
-      for(var d in newSetting.dependencies) {
-        if (newSetting.dependencies[d].groupArtifactVersion === 
newSetting.depArtifact) {
-          newSetting.dependencies[d] = {
-            'groupArtifactVersion': newSetting.depArtifact,
-            'exclusions': newSetting.depExclude
-          };
-          newSetting.dependencies.splice(d, 1);
+    $scope.addNewInterpreterProperty = function(settingId) {
+      if (settingId === undefined) {
+        // Add new property from create form
+        if (!$scope.newInterpreterSetting.propertyKey || 
$scope.newInterpreterSetting.propertyKey === '') {
+          return;
         }
-      }
 
-      newSetting.dependencies.push({
-        'groupArtifactVersion': newSetting.depArtifact,
-        'exclusions': (newSetting.depExclude === '')? []: newSetting.depExclude
-      });
-      emptyNewDependency(newSetting);
-    }
-    else {
-      // Add new dependency from edit form
-      var index = _.findIndex($scope.interpreterSettings, { 'id': settingId });
-      var setting = $scope.interpreterSettings[index];
-      if (!setting.depArtifact || setting.depArtifact === '') {
-        return;
+        
$scope.newInterpreterSetting.properties[$scope.newInterpreterSetting.propertyKey]
 = {
+          value: $scope.newInterpreterSetting.propertyValue
+        };
+        emptyNewProperty($scope.newInterpreterSetting);
+      } else {
+        // Add new property from edit form
+        var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+        var setting = $scope.interpreterSettings[index];
+
+        if (!setting.propertyKey || setting.propertyKey === '') {
+          return;
+        }
+        setting.properties[setting.propertyKey] = setting.propertyValue;
+        emptyNewProperty(setting);
       }
+    };
 
-      // overwrite if artifact already exists
-      for(var dep in setting.dependencies) {
-        if (setting.dependencies[dep].groupArtifactVersion === 
setting.depArtifact) {
-          setting.dependencies[dep] = {
-            'groupArtifactVersion': setting.depArtifact,
-            'exclusions': setting.depExclude
-          };
-          setting.dependencies.splice(dep, 1);
+    $scope.addNewInterpreterDependency = function(settingId) {
+      if (settingId === undefined) {
+        // Add new dependency from create form
+        if (!$scope.newInterpreterSetting.depArtifact || 
$scope.newInterpreterSetting.depArtifact === '') {
+          return;
+        }
+
+        // overwrite if artifact already exists
+        var newSetting = $scope.newInterpreterSetting;
+        for (var d in newSetting.dependencies) {
+          if (newSetting.dependencies[d].groupArtifactVersion === 
newSetting.depArtifact) {
+            newSetting.dependencies[d] = {
+              'groupArtifactVersion': newSetting.depArtifact,
+              'exclusions': newSetting.depExclude
+            };
+            newSetting.dependencies.splice(d, 1);
+          }
         }
+
+        newSetting.dependencies.push({
+          'groupArtifactVersion': newSetting.depArtifact,
+          'exclusions': (newSetting.depExclude === '') ? [] : 
newSetting.depExclude
+        });
+        emptyNewDependency(newSetting);
+      } else {
+        // Add new dependency from edit form
+        var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+        var setting = $scope.interpreterSettings[index];
+        if (!setting.depArtifact || setting.depArtifact === '') {
+          return;
+        }
+
+        // overwrite if artifact already exists
+        for (var dep in setting.dependencies) {
+          if (setting.dependencies[dep].groupArtifactVersion === 
setting.depArtifact) {
+            setting.dependencies[dep] = {
+              'groupArtifactVersion': setting.depArtifact,
+              'exclusions': setting.depExclude
+            };
+            setting.dependencies.splice(dep, 1);
+          }
+        }
+
+        setting.dependencies.push({
+          'groupArtifactVersion': setting.depArtifact,
+          'exclusions': (setting.depExclude === '') ? [] : setting.depExclude
+        });
+        emptyNewDependency(setting);
       }
+    };
 
-      setting.dependencies.push({
-        'groupArtifactVersion': setting.depArtifact,
-        'exclusions': (setting.depExclude === '')? []: setting.depExclude
-      });
-      emptyNewDependency(setting);
-    }
-  };
-
-  $scope.resetNewRepositorySetting = function() {
-    $scope.newRepoSetting = {
-      id: '',
-      url: '',
-      snapshot: false,
-      username: '',
-      password: ''
+    $scope.resetNewRepositorySetting = function() {
+      $scope.newRepoSetting = {
+        id: '',
+        url: '',
+        snapshot: false,
+        username: '',
+        password: ''
+      };
     };
-  };
-
-  var getRepositories = function() {
-    $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/repository').
-      success(function(data, status, headers, config) {
-        $scope.repositories = data.body;
-      }).
-      error(function(data, status, headers, config) {
+
+    var getRepositories = function() {
+      $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/repository')
+        .success(function(data, status, headers, config) {
+          $scope.repositories = data.body;
+        }).error(function(data, status, headers, config) {
         console.log('Error %o %o', status, data.message);
       });
-  };
-
-  $scope.addNewRepository = function() {
-    var request = angular.copy($scope.newRepoSetting);
-
-    $http.post(baseUrlSrv.getRestApiBase() + '/interpreter/repository', 
request).
-      success(function(data, status, headers, config) {
-        getRepositories();
-        $scope.resetNewRepositorySetting();
-        angular.element('#repoModal').modal('hide');
-      }).
-      error(function(data, status, headers, config) {
+    };
+
+    $scope.addNewRepository = function() {
+      var request = angular.copy($scope.newRepoSetting);
+
+      $http.post(baseUrlSrv.getRestApiBase() + '/interpreter/repository', 
request)
+        .success(function(data, status, headers, config) {
+          getRepositories();
+          $scope.resetNewRepositorySetting();
+          angular.element('#repoModal').modal('hide');
+        }).error(function(data, status, headers, config) {
         console.log('Error %o %o', headers, config);
       });
-  };
-
-  $scope.removeRepository = function(repoId) {
-    BootstrapDialog.confirm({
-      closable: true,
-      title: '',
-      message: 'Do you want to delete this repository?',
-      callback: function(result) {
-        if (result) {
-          $http.delete(baseUrlSrv.getRestApiBase()+'/interpreter/repository/' 
+ repoId).
-            success(function(data, status, headers, config) {
-              var index = _.findIndex($scope.repositories, { 'id': repoId });
-              $scope.repositories.splice(index, 1);
-            }).
-            error(function(data, status, headers, config) {
+    };
+
+    $scope.removeRepository = function(repoId) {
+      BootstrapDialog.confirm({
+        closable: true,
+        title: '',
+        message: 'Do you want to delete this repository?',
+        callback: function(result) {
+          if (result) {
+            $http.delete(baseUrlSrv.getRestApiBase() + 
'/interpreter/repository/' + repoId)
+              .success(function(data, status, headers, config) {
+                var index = _.findIndex($scope.repositories, {'id': repoId});
+                $scope.repositories.splice(index, 1);
+              }).error(function(data, status, headers, config) {
               console.log('Error %o %o', status, data.message);
             });
+          }
         }
+      });
+    };
+
+    $scope.isDefaultRepository = function(repoId) {
+      if (repoId === 'central' || repoId === 'local') {
+        return true;
+      } else {
+        return false;
       }
-    });
-  };
-
-  $scope.isDefaultRepository = function(repoId) {
-    if (repoId === 'central' || repoId === 'local') {
-      return true;
-    } else {
-      return false;
-    }
-  };
-
-  var init = function() {
-    $scope.resetNewInterpreterSetting();
-    $scope.resetNewRepositorySetting();
-    getInterpreterSettings();
-    getAvailableInterpreters();
-    getRepositories();
-  };
-
-  init();
-});
+    };
+
+    var init = function() {
+      $scope.resetNewInterpreterSetting();
+      $scope.resetNewRepositorySetting();
+      getInterpreterSettings();
+      getAvailableInterpreters();
+      getRepositories();
+    };
+
+    init();
+  });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/interpreter/interpreter.filter.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/interpreter/interpreter.filter.js 
b/zeppelin-web/src/app/interpreter/interpreter.filter.js
index 2e9010a..8da32af 100644
--- a/zeppelin-web/src/app/interpreter/interpreter.filter.js
+++ b/zeppelin-web/src/app/interpreter/interpreter.filter.js
@@ -14,8 +14,8 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').filter('sortByKey', function () {
-  return function (properties) {
+angular.module('zeppelinWebApp').filter('sortByKey', function() {
+  return function(properties) {
     var sortedKeys = properties ? Object.keys(properties) : [];
     return sortedKeys.sort();
   };

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobmanager.controller.js 
b/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
index 760be45..e1465d9 100644
--- a/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
+++ b/zeppelin-web/src/app/jobmanager/jobmanager.controller.js
@@ -22,7 +22,7 @@ angular.module('zeppelinWebApp')
       $scope.$on('setNotebookJobs', function(event, responseData) {
         $scope.lastJobServerUnixTime = responseData.lastResponseUnixTime;
         $scope.jobInfomations = responseData.jobs;
-        $scope.jobInfomationsIndexs = $scope.jobInfomations? 
_.indexBy($scope.jobInfomations, 'notebookId') : {};
+        $scope.jobInfomationsIndexs = $scope.jobInfomations ? 
_.indexBy($scope.jobInfomations, 'notebookId') : {};
       });
 
       $scope.$on('setUpdateNotebookJobs', function(event, responseData) {
@@ -30,7 +30,7 @@ angular.module('zeppelinWebApp')
         var indexStore = $scope.jobInfomationsIndexs;
         $scope.lastJobServerUnixTime = responseData.lastResponseUnixTime;
         var notes = responseData.jobs;
-        notes.map(function (changedItem) {
+        notes.map(function(changedItem) {
           if (indexStore[changedItem.notebookId] === undefined) {
             var newItem = angular.copy(changedItem);
             jobInfomations.push(newItem);
@@ -46,7 +46,7 @@ angular.module('zeppelinWebApp')
                 indexStore.splice(removeIndex, 1);
               }
 
-              removeIndex = _.findIndex(jobInfomations, { 'notebookId' : 
changedItem.notebookId});
+              removeIndex = _.findIndex(jobInfomations, {'notebookId': 
changedItem.notebookId});
               if (removeIndex) {
                 jobInfomations.splice(removeIndex, 1);
               }
@@ -64,8 +64,8 @@ angular.module('zeppelinWebApp')
         });
       });
 
-      $scope.filterValueToName = function (filterValue) {
-        var index = _.findIndex($scope.ACTIVE_INTERPRETERS, {value : 
filterValue});
+      $scope.filterValueToName = function(filterValue) {
+        var index = _.findIndex($scope.ACTIVE_INTERPRETERS, {value: 
filterValue});
 
         if ($scope.ACTIVE_INTERPRETERS[index].name !== undefined) {
           return $scope.ACTIVE_INTERPRETERS[index].name;
@@ -74,12 +74,12 @@ angular.module('zeppelinWebApp')
         }
       };
 
-      $scope.init = function () {
+      $scope.init = function() {
         $scope.jobInfomations = [];
         $scope.JobInfomationsByFilter = $scope.jobInfomations;
 
         websocketMsgSrv.getNotebookJobsList();
-        var refreshObj = $interval(function () {
+        var refreshObj = $interval(function() {
           if ($scope.lastJobServerUnixTime !== undefined) {
             
websocketMsgSrv.getUpdateNotebookJobsList($scope.lastJobServerUnixTime);
           }
@@ -90,4 +90,4 @@ angular.module('zeppelinWebApp')
           websocketMsgSrv.unsubscribeJobManager();
         });
       };
-});
+    });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/jobmanager/jobs/job.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/jobmanager/jobs/job.controller.js 
b/zeppelin-web/src/app/jobmanager/jobs/job.controller.js
index dcd470a..2d31442 100644
--- a/zeppelin-web/src/app/jobmanager/jobs/job.controller.js
+++ b/zeppelin-web/src/app/jobmanager/jobs/job.controller.js
@@ -15,15 +15,15 @@
 'use strict';
 
 angular.module('zeppelinWebApp')
-  .controller('JobCtrl', function($scope,$rootScope, $http, baseUrlSrv) {
+  .controller('JobCtrl', function($scope, $rootScope, $http, baseUrlSrv) {
 
-    $scope.init = function (jobInformation) {
+    $scope.init = function(jobInformation) {
       $scope.progressValue = 0;
     };
 
-    $scope.getProgress = function () {
+    $scope.getProgress = function() {
       var statusList = _.pluck($scope.notebookJob.paragraphs, 'status');
-      var runningJob = _.countBy(statusList, function (status) {
+      var runningJob = _.countBy(statusList, function(status) {
         if (status === 'FINISHED' || status === 'RUNNING') {
           return 'matchCount';
         } else {
@@ -33,7 +33,7 @@ angular.module('zeppelinWebApp')
       var totalCount = statusList.length;
       var runningJobCount = runningJob.matchCount;
       var result = Math.ceil(runningJobCount / totalCount * 100);
-      return isNaN(result)? 0 : result;
+      return isNaN(result) ? 0 : result;
     };
 
-});
+  });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/notebook/notebook.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/notebook.controller.js 
b/zeppelin-web/src/app/notebook/notebook.controller.js
index b2f52ef..97b35f0 100644
--- a/zeppelin-web/src/app/notebook/notebook.controller.js
+++ b/zeppelin-web/src/app/notebook/notebook.controller.js
@@ -15,18 +15,18 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').controller('NotebookCtrl',
-  function($scope, $route, $routeParams, $location, $rootScope, $http, $window,
-    websocketMsgSrv, baseUrlSrv, $timeout, SaveAsService) {
+angular.module('zeppelinWebApp').controller('NotebookCtrl', function($scope, 
$route, $routeParams, $location,
+                                                                     
$rootScope, $http, $window, websocketMsgSrv,
+                                                                     
baseUrlSrv, $timeout, SaveAsService) {
   $scope.note = null;
   $scope.showEditor = false;
   $scope.editorToggled = false;
   $scope.tableToggled = false;
   $scope.viewOnly = false;
   $scope.showSetting = false;
-  $scope.looknfeelOption = [ 'default', 'simple', 'report'];
+  $scope.looknfeelOption = ['default', 'simple', 'report'];
   $scope.cronOption = [
-    {name: 'None', value : undefined},
+    {name: 'None', value: undefined},
     {name: '1m', value: '0 0/1 * * * ?'},
     {name: '5m', value: '0 0/5 * * * ?'},
     {name: '1h', value: '0 0 0/1 * * ?'},
@@ -56,7 +56,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
   $scope.role = '';
 
   $scope.$on('setConnectedStatus', function(event, param) {
-    if(connectedOnce && param){
+    if (connectedOnce && param) {
       initNotebook();
     }
     connectedOnce = true;
@@ -68,7 +68,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
 
     for (var o in $scope.cronOption) {
-      if ($scope.cronOption[o].value===value) {
+      if ($scope.cronOption[o].value === value) {
         return $scope.cronOption[o].name;
       }
     }
@@ -101,12 +101,11 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
 
   initNotebook();
 
-
   $scope.focusParagraphOnClick = function(clickEvent) {
     if (!$scope.note) {
       return;
     }
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
       var paragraphId = $scope.note.paragraphs[i].id;
       if (jQuery.contains(angular.element('#' + paragraphId + 
'_container')[0], clickEvent.target)) {
         $scope.$broadcast('focusParagraph', paragraphId, 0, true);
@@ -128,7 +127,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
   // register mouseevent handler for focus paragraph
   document.addEventListener('keydown', $scope.keyboardShortcut);
 
-
   /** Remove the note and go back tot he main page */
   /** TODO(anthony): In the nearly future, go back to the main page and telle 
to the dude that the note have been remove */
   $scope.removeNote = function(noteId) {
@@ -178,7 +176,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
         }
       }
     });
-    document.getElementById('note.checkpoint.message').value='';
+    document.getElementById('note.checkpoint.message').value = '';
   };
 
   $scope.runNote = function() {
@@ -188,7 +186,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
       message: 'Run all paragraphs?',
       callback: function(result) {
         if (result) {
-          _.forEach($scope.note.paragraphs, function (n, key) {
+          _.forEach($scope.note.paragraphs, function(n, key) {
             angular.element('#' + n.id + 
'_paragraphColumn_main').scope().runParagraph(n.text);
           });
         }
@@ -256,9 +254,9 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
 
   $scope.isNoteRunning = function() {
     var running = false;
-    if(!$scope.note){ return false; }
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
-      if ( $scope.note.paragraphs[i].status === 'PENDING' || 
$scope.note.paragraphs[i].status === 'RUNNING') {
+    if (!$scope.note) { return false; }
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
+      if ($scope.note.paragraphs[i].status === 'PENDING' || 
$scope.note.paragraphs[i].status === 'RUNNING') {
         running = true;
         break;
       }
@@ -277,7 +275,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     $scope.killSaveTimer();
     $scope.isNoteDirty = true;
     //console.log('startSaveTimer called ' + $scope.note.id);
-    $scope.saveTimer = $timeout(function(){
+    $scope.saveTimer = $timeout(function() {
       $scope.saveNote();
     }, 10000);
   };
@@ -321,7 +319,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
 
   /** Update note config **/
   $scope.setConfig = function(config) {
-    if(config) {
+    if (config) {
       $scope.note.config = config;
     }
     websocketMsgSrv.updateNotebook($scope.note.id, $scope.note.name, 
$scope.note.config);
@@ -353,7 +351,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     getInterpreterBindings(getInterpreterBindingsCallBack);
   });
 
-
   var initializeLookAndFeel = function() {
     if (!$scope.note.config.looknfeel) {
       $scope.note.config.looknfeel = 'default';
@@ -370,7 +367,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     noteCopy.config = note.config;
     noteCopy.info = note.info;
     noteCopy.paragraphs = [];
-    for (var i=0; i<note.paragraphs.length; i++) {
+    for (var i = 0; i < note.paragraphs.length; i++) {
       if (note.paragraphs[i].id === paragraphId) {
         noteCopy.paragraphs[0] = note.paragraphs[i];
         if (!noteCopy.paragraphs[0].config) {
@@ -387,13 +384,13 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
   // create new paragraph on current position
   $scope.$on('insertParagraph', function(event, paragraphId, position) {
     var newIndex = -1;
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
-      if ( $scope.note.paragraphs[i].id === paragraphId ) {
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
+      if ($scope.note.paragraphs[i].id === paragraphId) {
         //determine position of where to add new paragraph; default is below
-        if ( position === 'above' ) {
+        if (position === 'above') {
           newIndex = i;
         } else {
-          newIndex = i+1;
+          newIndex = i + 1;
         }
         break;
       }
@@ -407,13 +404,13 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
 
   $scope.$on('moveParagraphUp', function(event, paragraphId) {
     var newIndex = -1;
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
       if ($scope.note.paragraphs[i].id === paragraphId) {
-        newIndex = i-1;
+        newIndex = i - 1;
         break;
       }
     }
-    if (newIndex<0 || newIndex>=$scope.note.paragraphs.length) {
+    if (newIndex < 0 || newIndex >= $scope.note.paragraphs.length) {
       return;
     }
     // save dirtyText of moving paragraphs.
@@ -425,14 +422,14 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
 
   $scope.$on('moveParagraphDown', function(event, paragraphId) {
     var newIndex = -1;
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
       if ($scope.note.paragraphs[i].id === paragraphId) {
-        newIndex = i+1;
+        newIndex = i + 1;
         break;
       }
     }
 
-    if (newIndex<0 || newIndex>=$scope.note.paragraphs.length) {
+    if (newIndex < 0 || newIndex >= $scope.note.paragraphs.length) {
       return;
     }
     // save dirtyText of moving paragraphs.
@@ -442,10 +439,10 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
     websocketMsgSrv.moveParagraph(paragraphId, newIndex);
   });
 
-  $scope.$on('moveFocusToPreviousParagraph', function(event, 
currentParagraphId){
+  $scope.$on('moveFocusToPreviousParagraph', function(event, 
currentParagraphId) {
     var focus = false;
-    for (var i=$scope.note.paragraphs.length-1; i>=0; i--) {
-      if (focus === false ) {
+    for (var i = $scope.note.paragraphs.length - 1; i >= 0; i--) {
+      if (focus === false) {
         if ($scope.note.paragraphs[i].id === currentParagraphId) {
           focus = true;
           continue;
@@ -457,10 +454,10 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   });
 
-  $scope.$on('moveFocusToNextParagraph', function(event, currentParagraphId){
+  $scope.$on('moveFocusToNextParagraph', function(event, currentParagraphId) {
     var focus = false;
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
-      if (focus === false ) {
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
+      if (focus === false) {
         if ($scope.note.paragraphs[i].id === currentParagraphId) {
           focus = true;
           continue;
@@ -490,7 +487,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
 
     var paragraphToBeFocused;
     var focusedParagraph;
-    for (var i=0; i<$scope.note.paragraphs.length; i++) {
+    for (var i = 0; i < $scope.note.paragraphs.length; i++) {
       var paragraphId = $scope.note.paragraphs[i].id;
       if (angular.element('#' + paragraphId + 
'_paragraphColumn_main').scope().paragraphFocused) {
         focusedParagraph = paragraphId;
@@ -538,7 +535,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     /** remove paragraph */
     if (numNewParagraphs < numOldParagraphs) {
       for (var oldidx in oldParagraphIds) {
-        if(oldParagraphIds[oldidx] !== newParagraphIds[oldidx]) {
+        if (oldParagraphIds[oldidx] !== newParagraphIds[oldidx]) {
           $scope.note.paragraphs.splice(oldidx, 1);
           break;
         }
@@ -546,7 +543,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
 
     // restore focus of paragraph
-    for (var f=0; f<$scope.note.paragraphs.length; f++) {
+    for (var f = 0; f < $scope.note.paragraphs.length; f++) {
       if (paragraphToBeFocused === $scope.note.paragraphs[f].id) {
         $scope.note.paragraphs[f].focus = true;
       }
@@ -554,7 +551,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
   };
 
   var getInterpreterBindings = function(callback) {
-    $http.get(baseUrlSrv.getRestApiBase()+ '/notebook/interpreter/bind/' 
+$scope.note.id).
+    $http.get(baseUrlSrv.getRestApiBase() + '/notebook/interpreter/bind/' + 
$scope.note.id).
     success(function(data, status, headers, config) {
       $scope.interpreterBindings = data.body;
       $scope.interpreterBindingsOrig = 
angular.copy($scope.interpreterBindings); // to check dirty
@@ -597,8 +594,8 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
   };
 
   $scope.interpreterSelectionListeners = {
-    accept : function(sourceItemHandleScope, destSortableScope) {return true;},
-    itemMoved: function (event) {},
+    accept: function(sourceItemHandleScope, destSortableScope) {return true;},
+    itemMoved: function(event) {},
     orderChanged: function(event) {}
   };
 
@@ -656,7 +653,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
   };
 
   var getPermissions = function(callback) {
-    $http.get(baseUrlSrv.getRestApiBase()+ '/notebook/' +$scope.note.id + 
'/permissions').
+    $http.get(baseUrlSrv.getRestApiBase() + '/notebook/' + $scope.note.id + 
'/permissions').
     success(function(data, status, headers, config) {
       $scope.permissions = data.body;
       $scope.permissionsOrig = angular.copy($scope.permissions); // to check 
dirty
@@ -676,7 +673,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     getPermissions();
   };
 
-
   $scope.closePermissions = function() {
     if (isPermissionsDirty()) {
       BootstrapDialog.confirm({
@@ -708,11 +704,11 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   }
 
-  $scope.savePermissions = function () {
+  $scope.savePermissions = function() {
     convertPermissionsToArray();
     $http.put(baseUrlSrv.getRestApiBase() + '/notebook/' + $scope.note.id + 
'/permissions',
       $scope.permissions, {withCredentials: true}).
-      success(function (data, status, headers, config) {
+      success(function(data, status, headers, config) {
         getPermissions(function() {
           console.log('Note permissions %o saved', $scope.permissions);
           BootstrapDialog.alert({
@@ -724,7 +720,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
           $scope.showPermissions = false;
         });
       }).
-      error(function (data, status, headers, config) {
+      error(function(data, status, headers, config) {
         console.log('Error %o %o', status, data.message);
         BootstrapDialog.show({
           closable: false,
@@ -735,7 +731,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
           buttons: [
             {
               label: 'Login',
-              action: function (dialog) {
+              action: function(dialog) {
                 dialog.close();
                 angular.element('#loginModal').modal({
                   show: 'true'
@@ -744,7 +740,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
             },
             {
               label: 'Cancel',
-              action: function (dialog) {
+              action: function(dialog) {
                 dialog.close();
                 $window.location.replace('/');
               }
@@ -752,7 +748,7 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
           ]
         });
       });
-    };
+  };
 
   $scope.togglePermissions = function() {
     if ($scope.showPermissions) {
@@ -763,7 +759,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   };
 
-
   var isSettingDirty = function() {
     if (angular.equals($scope.interpreterBindings, 
$scope.interpreterBindingsOrig)) {
       return false;
@@ -822,7 +817,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   }
 
-
   function convertToArray(role) {
     if (!$scope.permissions) {
       return;
@@ -839,22 +833,19 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   }
 
-
   function convertToString(role) {
     if (role === 'owners') {
       $scope.permissions.owners = searchText.join();
-    }
-    else if (role === 'readers') {
+    } else if (role === 'readers') {
       $scope.permissions.readers = searchText.join();
-    }
-    else if (role === 'writers') {
+    } else if (role === 'writers') {
       $scope.permissions.writers = searchText.join();
     }
   }
 
-  function getSuggestions (searchQuery) {
-    $scope.suggestions =[];
-    $http.get(baseUrlSrv.getRestApiBase() + '/security/userlist/' + 
searchQuery ).then(function
+  function getSuggestions(searchQuery) {
+    $scope.suggestions = [];
+    $http.get(baseUrlSrv.getRestApiBase() + '/security/userlist/' + 
searchQuery).then(function
     (response) {
       var userlist = angular.fromJson(response.data).body;
       for (var k in userlist) {
@@ -869,12 +860,10 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   }
 
-
   var getChangedIndex = function() {
     if (previousSelectedList.length === 0) {
       selectedUserIndex = searchText.length - 1;
-    }
-    else {
+    } else {
       for (var i = 0; i < searchText.length; i++) {
         if (previousSelectedList[i] !== searchText[i]) {
           selectedUserIndex = i;
@@ -918,35 +907,33 @@ 
angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   };
 
-
   var checkIfSelected = function() {
-    if (($scope.suggestions.length === 0) && ($scope.selectIndex < 0 || 
$scope.selectIndex >= $scope.suggestions.length) || ( $scope.suggestions.length 
!== 0 && ( $scope.selectIndex < 0 || $scope.selectIndex >= 
$scope.suggestions.length   ))) {
+    if (($scope.suggestions.length === 0) &&
+      ($scope.selectIndex < 0 || $scope.selectIndex >= 
$scope.suggestions.length) ||
+      ($scope.suggestions.length !== 0 && ($scope.selectIndex < 0 || 
$scope.selectIndex >= $scope.suggestions.length))
+    ) {
       searchText[selectedUserIndex] = selectedUser;
       $scope.suggestions = [];
       return true;
-    }
-    else {
+    } else {
       return false;
     }
   };
 
-
   $scope.checkKeyDown = function(event, role) {
     if (event.keyCode === 40) {
       event.preventDefault();
       if ($scope.selectIndex + 1 !== $scope.suggestions.length) {
         $scope.selectIndex++;
       }
-    }
-    else if (event.keyCode === 38) {
+    } else if (event.keyCode === 38) {
       event.preventDefault();
 
       if ($scope.selectIndex - 1 !== -1) {
         $scope.selectIndex--;
 
       }
-    }
-    else if (event.keyCode === 13) {
+    } else if (event.keyCode === 13) {
       event.preventDefault();
       if (!checkIfSelected()) {
         selectedUser = $scope.suggestions[$scope.selectIndex];
@@ -966,7 +953,6 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     }
   };
 
-
   $scope.assignValueAndHide = function(index, role) {
     searchText[selectedUserIndex] = $scope.suggestions[index];
     updatePreviousList();
@@ -974,9 +960,10 @@ angular.module('zeppelinWebApp').controller('NotebookCtrl',
     $scope.suggestions = [];
   };
 
-  angular.element(document).click(function(){
+  angular.element(document).click(function() {
     angular.element('.userlist').hide();
     angular.element('.ace_autocomplete').hide();
   });
 
 });
+

Reply via email to