zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [6/6] zeppelin git commit: [ZEPPELIN-1927] Remove useless function wrapping in all js files
Date Wed, 11 Jan 2017 02:42:12 GMT
[ZEPPELIN-1927] Remove useless function wrapping in all js files

### What is this PR for?

Removed useless function wrappings to move toward `import`, `export` syntax. This PR will not affect on any previous functionalities.

**This PR is not big! I did only 2 things.**

1. Removed `(function() {})()` which wraps a module.
2. Reindented whole files.

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

### Todos
* [x] - Remove function wrappings
* [x] - Reindent

### What is the Jira issue?

[ZEPPELIN-1927](https://issues.apache.org/jira/browse/ZEPPELIN-1927)

### How should this be tested?

CI will test this PR.

### Screenshots (if appropriate)

None

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

Author: 1ambda <1amb4a@gmail.com>

Closes #1876 from 1ambda/ZEPPELIN-1927/remove-useless-func-wrappings and squashes the following commits:

7017807 [1ambda] fix: Remove all func wrappings in js files


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

Branch: refs/heads/master
Commit: 4c60b27c3acbdd976bf8901ef52019380bb3c334
Parents: ff8d902
Author: 1ambda <1amb4a@gmail.com>
Authored: Wed Jan 11 06:26:53 2017 +0900
Committer: Lee moon soo <moon@apache.org>
Committed: Tue Jan 10 18:42:01 2017 -0800

----------------------------------------------------------------------
 zeppelin-web/src/app/app.controller.js          |   72 +-
 zeppelin-web/src/app/app.js                     |  235 +-
 .../configuration/configuration.controller.js   |   62 +-
 .../src/app/credential/credential.controller.js |  278 ++-
 zeppelin-web/src/app/home/home.controller.js    |  198 +-
 .../app/interpreter/interpreter.controller.js   | 1282 +++++-----
 .../src/app/interpreter/interpreter.filter.js   |   17 +-
 .../src/app/jobmanager/jobmanager.controller.js |  292 ++-
 .../src/app/jobmanager/jobmanager.filter.js     |   48 +-
 .../src/app/jobmanager/jobs/job.controller.js   |  162 +-
 .../src/app/notebook/notebook.controller.js     | 1768 +++++++-------
 .../notebook/paragraph/paragraph.controller.js  | 2182 +++++++++---------
 .../paragraph/result/result.controller.js       | 1503 ++++++------
 .../notebookRepos/notebookRepos.controller.js   |  116 +-
 .../src/app/search/result-list.controller.js    |  256 +-
 .../arrayOrderingSrv/arrayOrdering.service.js   |   38 +-
 .../src/components/baseUrl/baseUrl.service.js   |   56 +-
 .../browser-detect/browserDetect.service.js     |   50 +-
 .../clipboard/clipboard.controller.js           |   38 +-
 .../dropdowninput/dropdowninput.directive.js    |   24 +-
 .../components/editor/codeEditor.directive.js   |   48 +-
 .../elasticInputCtrl/elasticInput.controller.js |   14 +-
 .../expandCollapse/expandCollapse.directive.js  |   46 +-
 .../interpreter/interpreter.directive.js        |   30 +-
 .../src/components/login/login.controller.js    |   86 +-
 .../src/components/navbar/navbar.controller.js  |  226 +-
 .../src/components/ngenter/ngenter.directive.js |   30 +-
 .../components/ngescape/ngescape.directive.js   |   28 +-
 .../components/noteAction/noteAction.service.js |  302 ++-
 .../noteListDataFactory/noteList.datafactory.js |  112 +-
 .../noteName-create/notename.controller.js      |  182 +-
 .../noteName-create/visible.directive.js        |   60 +-
 .../notenameImport.controller.js                |  246 +-
 .../notevarshareService/notevarshare.service.js |   38 +-
 .../popover-html-unsafe-popup.directive.js      |   20 +-
 .../popover-html-unsafe.directive.js            |   12 +-
 .../src/components/rename/rename.controller.js  |   48 +-
 .../src/components/rename/rename.service.js     |   32 +-
 .../components/resizable/resizable.directive.js |  100 +-
 .../src/components/saveAs/saveAs.service.js     |   68 +-
 .../components/searchService/search.service.js  |   34 +-
 .../websocketEvents/websocketEvents.factory.js  |  314 ++-
 .../websocketEvents/websocketMsg.service.js     |  608 +++--
 43 files changed, 5637 insertions(+), 5724 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/zeppelin-web/src/app/app.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/app.controller.js b/zeppelin-web/src/app/app.controller.js
index 0ab8469..95be93d 100644
--- a/zeppelin-web/src/app/app.controller.js
+++ b/zeppelin-web/src/app/app.controller.js
@@ -11,52 +11,50 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
 
-  angular.module('zeppelinWebApp').controller('MainCtrl', MainCtrl);
+angular.module('zeppelinWebApp').controller('MainCtrl', MainCtrl);
 
-  MainCtrl.$inject = ['$scope', '$rootScope', '$window', 'arrayOrderingSrv'];
+MainCtrl.$inject = ['$scope', '$rootScope', '$window', 'arrayOrderingSrv'];
 
-  function MainCtrl($scope, $rootScope, $window, arrayOrderingSrv) {
-    $scope.looknfeel = 'default';
+function MainCtrl($scope, $rootScope, $window, arrayOrderingSrv) {
+  $scope.looknfeel = 'default';
 
-    var init = function() {
-      $scope.asIframe = (($window.location.href.indexOf('asIframe') > -1) ? true : false);
-    };
+  var init = function() {
+    $scope.asIframe = (($window.location.href.indexOf('asIframe') > -1) ? true : false);
+  };
 
-    init();
+  init();
 
-    $rootScope.$on('setIframe', function(event, data) {
-      if (!event.defaultPrevented) {
-        $scope.asIframe = data;
-        event.preventDefault();
-      }
-    });
+  $rootScope.$on('setIframe', function(event, data) {
+    if (!event.defaultPrevented) {
+      $scope.asIframe = data;
+      event.preventDefault();
+    }
+  });
 
-    $rootScope.$on('setLookAndFeel', function(event, data) {
-      if (!event.defaultPrevented && data && data !== '' && data !== $scope.looknfeel) {
-        $scope.looknfeel = data;
-        event.preventDefault();
-      }
-    });
+  $rootScope.$on('setLookAndFeel', function(event, data) {
+    if (!event.defaultPrevented && data && data !== '' && data !== $scope.looknfeel) {
+      $scope.looknfeel = data;
+      event.preventDefault();
+    }
+  });
 
-    // Set The lookAndFeel to default on every page
-    $rootScope.$on('$routeChangeStart', function(event, next, current) {
-      $rootScope.$broadcast('setLookAndFeel', 'default');
-    });
+  // Set The lookAndFeel to default on every page
+  $rootScope.$on('$routeChangeStart', function(event, next, current) {
+    $rootScope.$broadcast('setLookAndFeel', 'default');
+  });
 
-    $rootScope.noteName = function(note) {
-      if (!_.isEmpty(note)) {
-        return arrayOrderingSrv.getNoteName(note);
-      }
-    };
+  $rootScope.noteName = function(note) {
+    if (!_.isEmpty(note)) {
+      return arrayOrderingSrv.getNoteName(note);
+    }
+  };
 
-    BootstrapDialog.defaultOptions.onshown = function() {
-      angular.element('#' + this.id).find('.btn:last').focus();
-    };
+  BootstrapDialog.defaultOptions.onshown = function() {
+    angular.element('#' + this.id).find('.btn:last').focus();
+  };
 
-    // Remove BootstrapDialog animation
-    BootstrapDialog.configDefaultOptions({animate: false});
-  }
+  // Remove BootstrapDialog animation
+  BootstrapDialog.configDefaultOptions({animate: false});
+}
 
-})();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/zeppelin-web/src/app/app.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/app.js b/zeppelin-web/src/app/app.js
index 6b5d8f9..fcfed28 100644
--- a/zeppelin-web/src/app/app.js
+++ b/zeppelin-web/src/app/app.js
@@ -14,129 +14,128 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(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',
-          'ngclipboard'
-      ])
-        .filter('breakFilter', function() {
-          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;
 
-          $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('/notebook/:noteId/revision/:revisionId', {
-              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('/notebookRepos', {
-              templateUrl: 'app/notebookRepos/notebookRepos.html',
-              controller: 'NotebookReposCtrl',
-              controllerAs: 'noterepo'
-            })
-            .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,
-            combineDuplications: true,
-            timeout: 6000
-          });
-        })
-        .constant('TRASH_FOLDER_ID', '~Trash');
-
-  function auth() {
-    var $http = angular.injector(['ng']).get('$http');
-    var baseUrlSrv = angular.injector(['zeppelinWebApp']).get('baseUrlSrv');
+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',
+  'ngclipboard'
+])
+  .filter('breakFilter', function() {
+    return function(text) {
+      if (!!text) {
+        return text.replace(/\n/g, '<br />');
+      }
+    };
+  })
+  .config(function($httpProvider, $routeProvider, ngToastProvider) {
     // withCredentials when running locally via grunt
-    $http.defaults.withCredentials = true;
-    jQuery.ajaxSetup({
-      dataType: 'json',
-      xhrFields: {
-        withCredentials: true
-      },
-      crossDomain: true
-    });
-    return $http.get(baseUrlSrv.getRestApiBase() + '/security/ticket').then(function(response) {
-      zeppelinWebApp.run(function($rootScope) {
-        $rootScope.ticket = angular.fromJson(response.data).body;
+    $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('/notebook/:noteId/revision/:revisionId', {
+        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('/notebookRepos', {
+        templateUrl: 'app/notebookRepos/notebookRepos.html',
+        controller: 'NotebookReposCtrl',
+        controllerAs: 'noterepo'
+      })
+      .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(errorResponse) {
-      // Handle error case
+
+    ngToastProvider.configure({
+      dismissButton: true,
+      dismissOnClick: false,
+      combineDuplications: true,
+      timeout: 6000
     });
-  }
+  })
+  .constant('TRASH_FOLDER_ID', '~Trash');
 
-  function bootstrapApplication() {
-    zeppelinWebApp.run(function($rootScope, $location) {
-      $rootScope.$on('$routeChangeStart', function(event, next, current) {
-        if (!$rootScope.ticket && next.$$route && !next.$$route.publicAccess) {
-          $location.path('/');
-        }
-      });
+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;
+  jQuery.ajaxSetup({
+    dataType: 'json',
+    xhrFields: {
+      withCredentials: true
+    },
+    crossDomain: true
+  });
+  return $http.get(baseUrlSrv.getRestApiBase() + '/security/ticket').then(function(response) {
+    zeppelinWebApp.run(function($rootScope) {
+      $rootScope.ticket = angular.fromJson(response.data).body;
     });
-    angular.bootstrap(document, ['zeppelinWebApp']);
-  }
+  }, function(errorResponse) {
+    // Handle error case
+  });
+}
 
-  angular.element(document).ready(function() {
-    auth().then(bootstrapApplication);
+function bootstrapApplication() {
+  zeppelinWebApp.run(function($rootScope, $location) {
+    $rootScope.$on('$routeChangeStart', function(event, next, current) {
+      if (!$rootScope.ticket && next.$$route && !next.$$route.publicAccess) {
+        $location.path('/');
+      }
+    });
   });
-}());
+  angular.bootstrap(document, ['zeppelinWebApp']);
+}
+
+angular.element(document).ready(function() {
+  auth().then(bootstrapApplication);
+});

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/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 df25404..4d6ad9f 100644
--- a/zeppelin-web/src/app/configuration/configuration.controller.js
+++ b/zeppelin-web/src/app/configuration/configuration.controller.js
@@ -11,41 +11,39 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
 
-  angular.module('zeppelinWebApp').controller('ConfigurationCtrl', ConfigurationCtrl);
+angular.module('zeppelinWebApp').controller('ConfigurationCtrl', ConfigurationCtrl);
 
-  ConfigurationCtrl.$inject = ['$scope', '$rootScope', '$http', 'baseUrlSrv', 'ngToast'];
+ConfigurationCtrl.$inject = ['$scope', '$rootScope', '$http', 'baseUrlSrv', 'ngToast'];
 
-  function ConfigurationCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
-    $scope.configrations = [];
-    $scope._ = _;
-    ngToast.dismiss();
+function ConfigurationCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
+  $scope.configrations = [];
+  $scope._ = _;
+  ngToast.dismiss();
 
-    var getConfigurations = function() {
-      $http.get(baseUrlSrv.getRestApiBase() + '/configurations/all').
-      success(function(data, status, headers, config) {
-        $scope.configurations = data.body;
-      }).
-      error(function(data, status, headers, config) {
-        if (status === 401) {
-          ngToast.danger({
-            content: 'You don\'t have permission on this page',
-            verticalPosition: 'bottom',
-            timeout: '3000'
-          });
-          setTimeout(function() {
-            window.location.replace('/');
-          }, 3000);
-        }
-        console.log('Error %o %o', status, data.message);
-      });
-    };
+  var getConfigurations = function() {
+    $http.get(baseUrlSrv.getRestApiBase() + '/configurations/all').
+    success(function(data, status, headers, config) {
+      $scope.configurations = data.body;
+    }).
+    error(function(data, status, headers, config) {
+      if (status === 401) {
+        ngToast.danger({
+          content: 'You don\'t have permission on this page',
+          verticalPosition: 'bottom',
+          timeout: '3000'
+        });
+        setTimeout(function() {
+          window.location.replace('/');
+        }, 3000);
+      }
+      console.log('Error %o %o', status, data.message);
+    });
+  };
 
-    var init = function() {
-      getConfigurations();
-    };
+  var init = function() {
+    getConfigurations();
+  };
 
-    init();
-  }
-})();
+  init();
+}

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/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 ce4ef14..d0fdd1e 100644
--- a/zeppelin-web/src/app/credential/credential.controller.js
+++ b/zeppelin-web/src/app/credential/credential.controller.js
@@ -11,88 +11,87 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
 
-  angular.module('zeppelinWebApp').controller('CredentialCtrl', CredentialCtrl);
+angular.module('zeppelinWebApp').controller('CredentialCtrl', CredentialCtrl);
 
-  CredentialCtrl.$inject = ['$scope', '$rootScope', '$http', 'baseUrlSrv', 'ngToast'];
+CredentialCtrl.$inject = ['$scope', '$rootScope', '$http', 'baseUrlSrv', 'ngToast'];
 
-  function CredentialCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
-    $scope._ = _;
-    ngToast.dismiss();
+function CredentialCtrl($scope, $rootScope, $http, baseUrlSrv, ngToast) {
+  $scope._ = _;
+  ngToast.dismiss();
 
-    $scope.credentialInfo = [];
-    $scope.showAddNewCredentialInfo = false;
-    $scope.availableInterpreters = [];
+  $scope.credentialInfo = [];
+  $scope.showAddNewCredentialInfo = false;
+  $scope.availableInterpreters = [];
 
-    var getCredentialInfo = function() {
-      $http.get(baseUrlSrv.getRestApiBase() + '/credential').
-      success(function(data, status, headers, config) {
-        $scope.credentialInfo  = _.map(data.body.userCredentials, function(value, prop) {
-          return {entity: prop, password: value.password, username: value.username};
-        });
-        console.log('Success %o %o', status, $scope.credentialInfo);
-      }).
-      error(function(data, status, headers, config) {
-        if (status === 401) {
-          ngToast.danger({
-            content: 'You don\'t have permission on this page',
-            verticalPosition: 'bottom',
-            timeout: '3000'
-          });
-          setTimeout(function() {
-            window.location.replace('/');
-          }, 3000);
-        }
-        console.log('Error %o %o', status, data.message);
+  var getCredentialInfo = function() {
+    $http.get(baseUrlSrv.getRestApiBase() + '/credential').
+    success(function(data, status, headers, config) {
+      $scope.credentialInfo  = _.map(data.body.userCredentials, function(value, prop) {
+        return {entity: prop, password: value.password, username: value.username};
       });
-    };
-
-    $scope.addNewCredentialInfo = function() {
-      if ($scope.entity && _.isEmpty($scope.entity.trim()) &&
-        $scope.username && _.isEmpty($scope.username.trim())) {
+      console.log('Success %o %o', status, $scope.credentialInfo);
+    }).
+    error(function(data, status, headers, config) {
+      if (status === 401) {
         ngToast.danger({
-          content: 'Username \\ Entity can not be empty.',
+          content: 'You don\'t have permission on this page',
           verticalPosition: 'bottom',
           timeout: '3000'
         });
-        return;
+        setTimeout(function() {
+          window.location.replace('/');
+        }, 3000);
       }
+      console.log('Error %o %o', status, data.message);
+    });
+  };
+
+  $scope.addNewCredentialInfo = function() {
+    if ($scope.entity && _.isEmpty($scope.entity.trim()) &&
+      $scope.username && _.isEmpty($scope.username.trim())) {
+      ngToast.danger({
+        content: 'Username \\ Entity can not be empty.',
+        verticalPosition: 'bottom',
+        timeout: '3000'
+      });
+      return;
+    }
 
-      var newCredential  = {
-        'entity': $scope.entity,
-        'username': $scope.username,
-        'password': $scope.password
-      };
+    var newCredential  = {
+      'entity': $scope.entity,
+      'username': $scope.username,
+      'password': $scope.password
+    };
 
-      $http.put(baseUrlSrv.getRestApiBase() + '/credential', newCredential).
-      success(function(data, status, headers, config) {
-        ngToast.success({
-          content: 'Successfully saved credentials.',
-          verticalPosition: 'bottom',
-          timeout: '3000'
-        });
-        $scope.credentialInfo.push(newCredential);
-        resetCredentialInfo();
-        $scope.showAddNewCredentialInfo = false;
-        console.log('Success %o %o', status, data.message);
-      }).
-      error(function(data, status, headers, config) {
-        ngToast.danger({
-          content: 'Error saving credentials',
-          verticalPosition: 'bottom',
-          timeout: '3000'
-        });
-        console.log('Error %o %o', status, data.message);
+    $http.put(baseUrlSrv.getRestApiBase() + '/credential', newCredential).
+    success(function(data, status, headers, config) {
+      ngToast.success({
+        content: 'Successfully saved credentials.',
+        verticalPosition: 'bottom',
+        timeout: '3000'
       });
-    };
+      $scope.credentialInfo.push(newCredential);
+      resetCredentialInfo();
+      $scope.showAddNewCredentialInfo = false;
+      console.log('Success %o %o', status, data.message);
+    }).
+    error(function(data, status, headers, config) {
+      ngToast.danger({
+        content: 'Error saving credentials',
+        verticalPosition: 'bottom',
+        timeout: '3000'
+      });
+      console.log('Error %o %o', status, data.message);
+    });
+  };
 
-    var getAvailableInterpreters = function() {
-      $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting')
+  var getAvailableInterpreters = function() {
+    $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting')
       .success(function(data, status, headers, config) {
         for (var setting = 0; setting < data.body.length; setting++) {
           $scope.availableInterpreters.push(
-          data.body[setting].group + '.' + data.body[setting].name);
+            data.body[setting].group + '.' + data.body[setting].name);
         }
         angular.element('#entityname').autocomplete({
           source: $scope.availableInterpreters,
@@ -102,91 +101,90 @@
           }
         });
       }).error(function(data, status, headers, config) {
-        console.log('Error %o %o', status, data.message);
-      });
-    };
-
-    $scope.toggleAddNewCredentialInfo = function() {
-      if ($scope.showAddNewCredentialInfo) {
-        $scope.showAddNewCredentialInfo = false;
-      } else {
-        $scope.showAddNewCredentialInfo = true;
-      }
-    };
+      console.log('Error %o %o', status, data.message);
+    });
+  };
 
-    $scope.cancelCredentialInfo = function() {
+  $scope.toggleAddNewCredentialInfo = function() {
+    if ($scope.showAddNewCredentialInfo) {
       $scope.showAddNewCredentialInfo = false;
-      resetCredentialInfo();
-    };
+    } else {
+      $scope.showAddNewCredentialInfo = true;
+    }
+  };
 
-    var resetCredentialInfo = function() {
-      $scope.entity = '';
-      $scope.username = '';
-      $scope.password = '';
+  $scope.cancelCredentialInfo = function() {
+    $scope.showAddNewCredentialInfo = false;
+    resetCredentialInfo();
+  };
+
+  var resetCredentialInfo = function() {
+    $scope.entity = '';
+    $scope.username = '';
+    $scope.password = '';
+  };
+
+  $scope.copyOriginCredentialsInfo = function() {
+    ngToast.info({
+      content: 'Since entity is a unique key, you can edit only username & password',
+      verticalPosition: 'bottom',
+      timeout: '3000'
+    });
+  };
+
+  $scope.updateCredentialInfo = function(form, data, entity) {
+    var request = {
+      entity: entity,
+      username: data.username,
+      password: data.password
     };
 
-    $scope.copyOriginCredentialsInfo = function() {
-      ngToast.info({
-        content: 'Since entity is a unique key, you can edit only username & password',
+    $http.put(baseUrlSrv.getRestApiBase() + '/credential/', request).
+    success(function(data, status, headers, config) {
+      var index = _.findIndex($scope.credentialInfo, {'entity': entity});
+      $scope.credentialInfo[index] = request;
+      return true;
+    }).
+    error(function(data, status, headers, config) {
+      console.log('Error %o %o', status, data.message);
+      ngToast.danger({
+        content: 'We couldn\'t save the credential',
         verticalPosition: 'bottom',
         timeout: '3000'
       });
-    };
-
-    $scope.updateCredentialInfo = function(form, data, entity) {
-      var request = {
-        entity: entity,
-        username: data.username,
-        password: data.password
-      };
-
-      $http.put(baseUrlSrv.getRestApiBase() + '/credential/', request).
-      success(function(data, status, headers, config) {
-        var index = _.findIndex($scope.credentialInfo, {'entity': entity});
-        $scope.credentialInfo[index] = request;
-        return true;
-      }).
-      error(function(data, status, headers, config) {
-        console.log('Error %o %o', status, data.message);
-        ngToast.danger({
-          content: 'We couldn\'t save the credential',
-          verticalPosition: 'bottom',
-          timeout: '3000'
-        });
-        form.$show();
-      });
-      return false;
-    };
-
-    $scope.removeCredentialInfo = function(entity) {
-      BootstrapDialog.confirm({
-        closable: false,
-        closeByBackdrop: false,
-        closeByKeyboard: false,
-        title: '',
-        message: 'Do you want to delete this credential information?',
-        callback: function(result) {
-          if (result) {
-            $http.delete(baseUrlSrv.getRestApiBase() + '/credential/' + entity).
-            success(function(data, status, headers, config) {
-              var index = _.findIndex($scope.credentialInfo, {'entity': entity});
-              $scope.credentialInfo.splice(index, 1);
-              console.log('Success %o %o', status, data.message);
-            }).
-            error(function(data, status, headers, config) {
-              console.log('Error %o %o', status, data.message);
-            });
-          }
+      form.$show();
+    });
+    return false;
+  };
+
+  $scope.removeCredentialInfo = function(entity) {
+    BootstrapDialog.confirm({
+      closable: false,
+      closeByBackdrop: false,
+      closeByKeyboard: false,
+      title: '',
+      message: 'Do you want to delete this credential information?',
+      callback: function(result) {
+        if (result) {
+          $http.delete(baseUrlSrv.getRestApiBase() + '/credential/' + entity).
+          success(function(data, status, headers, config) {
+            var index = _.findIndex($scope.credentialInfo, {'entity': entity});
+            $scope.credentialInfo.splice(index, 1);
+            console.log('Success %o %o', status, data.message);
+          }).
+          error(function(data, status, headers, config) {
+            console.log('Error %o %o', status, data.message);
+          });
         }
-      });
-    };
+      }
+    });
+  };
 
-    var init = function() {
-      getAvailableInterpreters();
-      getCredentialInfo();
-    };
+  var init = function() {
+    getAvailableInterpreters();
+    getCredentialInfo();
+  };
 
-    init();
-  }
+  init();
+}
 
-})();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/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 08ce309..c27f811 100644
--- a/zeppelin-web/src/app/home/home.controller.js
+++ b/zeppelin-web/src/app/home/home.controller.js
@@ -11,126 +11,124 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
-
-  angular.module('zeppelinWebApp').controller('HomeCtrl', HomeCtrl);
-
-  HomeCtrl.$inject = [
-    '$scope',
-    'noteListDataFactory',
-    'websocketMsgSrv',
-    '$rootScope',
-    'arrayOrderingSrv',
-    'ngToast',
-    'noteActionSrv',
-    'TRASH_FOLDER_ID'
-  ];
-
-  function HomeCtrl($scope, noteListDataFactory, websocketMsgSrv, $rootScope, arrayOrderingSrv,
-                    ngToast, noteActionSrv, TRASH_FOLDER_ID) {
-    ngToast.dismiss();
-    var vm = this;
-    vm.notes = noteListDataFactory;
-    vm.websocketMsgSrv = websocketMsgSrv;
-    vm.arrayOrderingSrv = arrayOrderingSrv;
-
-    vm.notebookHome = false;
-    if ($rootScope.ticket !== undefined) {
-      vm.staticHome = false;
-    } else {
-      vm.staticHome = true;
-    }
 
-    $scope.isReloading = false;
-    $scope.TRASH_FOLDER_ID = TRASH_FOLDER_ID;
+angular.module('zeppelinWebApp').controller('HomeCtrl', HomeCtrl);
+
+HomeCtrl.$inject = [
+  '$scope',
+  'noteListDataFactory',
+  'websocketMsgSrv',
+  '$rootScope',
+  'arrayOrderingSrv',
+  'ngToast',
+  'noteActionSrv',
+  'TRASH_FOLDER_ID'
+];
+
+function HomeCtrl($scope, noteListDataFactory, websocketMsgSrv, $rootScope, arrayOrderingSrv,
+                  ngToast, noteActionSrv, TRASH_FOLDER_ID) {
+  ngToast.dismiss();
+  var vm = this;
+  vm.notes = noteListDataFactory;
+  vm.websocketMsgSrv = websocketMsgSrv;
+  vm.arrayOrderingSrv = arrayOrderingSrv;
+
+  vm.notebookHome = false;
+  if ($rootScope.ticket !== undefined) {
+    vm.staticHome = false;
+  } else {
+    vm.staticHome = true;
+  }
 
-    var initHome = function() {
-      websocketMsgSrv.getHomeNote();
-    };
+  $scope.isReloading = false;
+  $scope.TRASH_FOLDER_ID = TRASH_FOLDER_ID;
 
-    initHome();
+  var initHome = function() {
+    websocketMsgSrv.getHomeNote();
+  };
 
-    $scope.reloadNoteList = function() {
-      websocketMsgSrv.reloadAllNotesFromRepo();
-      $scope.isReloadingNotes = true;
-    };
+  initHome();
 
-    $scope.toggleFolderNode = function(node) {
-      node.hidden = !node.hidden;
-    };
+  $scope.reloadNoteList = function() {
+    websocketMsgSrv.reloadAllNotesFromRepo();
+    $scope.isReloadingNotes = true;
+  };
 
-    angular.element('#loginModal').on('hidden.bs.modal', function(e) {
-      $rootScope.$broadcast('initLoginValues');
-    });
+  $scope.toggleFolderNode = function(node) {
+    node.hidden = !node.hidden;
+  };
 
-    /*
-    ** $scope.$on functions below
-    */
+  angular.element('#loginModal').on('hidden.bs.modal', function(e) {
+    $rootScope.$broadcast('initLoginValues');
+  });
 
-    $scope.$on('setNoteMenu', function(event, notes) {
-      $scope.isReloadingNotes = false;
-    });
+  /*
+   ** $scope.$on functions below
+   */
 
-    $scope.$on('setNoteContent', function(event, note) {
-      if (note) {
-        vm.note = note;
+  $scope.$on('setNoteMenu', function(event, notes) {
+    $scope.isReloadingNotes = false;
+  });
 
-        // initialize look And Feel
-        $rootScope.$broadcast('setLookAndFeel', 'home');
+  $scope.$on('setNoteContent', function(event, note) {
+    if (note) {
+      vm.note = note;
 
-        // make it read only
-        vm.viewOnly = true;
+      // initialize look And Feel
+      $rootScope.$broadcast('setLookAndFeel', 'home');
 
-        vm.notebookHome = true;
-        vm.staticHome = false;
-      } else {
-        vm.staticHome = true;
-        vm.notebookHome = false;
-      }
-    });
+      // make it read only
+      vm.viewOnly = true;
 
-    $scope.renameNote = function(node) {
-      noteActionSrv.renameNote(node.id, node.path);
-    };
+      vm.notebookHome = true;
+      vm.staticHome = false;
+    } else {
+      vm.staticHome = true;
+      vm.notebookHome = false;
+    }
+  });
 
-    $scope.moveNoteToTrash = function(noteId) {
-      noteActionSrv.moveNoteToTrash(noteId, false);
-    };
+  $scope.renameNote = function(node) {
+    noteActionSrv.renameNote(node.id, node.path);
+  };
 
-    $scope.moveFolderToTrash = function(folderId) {
-      noteActionSrv.moveFolderToTrash(folderId);
-    };
+  $scope.moveNoteToTrash = function(noteId) {
+    noteActionSrv.moveNoteToTrash(noteId, false);
+  };
 
-    $scope.restoreNote = function(noteId) {
-      websocketMsgSrv.restoreNote(noteId);
-    };
+  $scope.moveFolderToTrash = function(folderId) {
+    noteActionSrv.moveFolderToTrash(folderId);
+  };
 
-    $scope.restoreFolder = function(folderId) {
-      websocketMsgSrv.restoreFolder(folderId);
-    };
+  $scope.restoreNote = function(noteId) {
+    websocketMsgSrv.restoreNote(noteId);
+  };
 
-    $scope.restoreAll = function() {
-      noteActionSrv.restoreAll();
-    };
+  $scope.restoreFolder = function(folderId) {
+    websocketMsgSrv.restoreFolder(folderId);
+  };
 
-    $scope.renameFolder = function(node) {
-      noteActionSrv.renameFolder(node.id);
-    };
+  $scope.restoreAll = function() {
+    noteActionSrv.restoreAll();
+  };
 
-    $scope.removeNote = function(noteId) {
-      noteActionSrv.removeNote(noteId, false);
-    };
+  $scope.renameFolder = function(node) {
+    noteActionSrv.renameFolder(node.id);
+  };
 
-    $scope.removeFolder = function(folderId) {
-      noteActionSrv.removeFolder(folderId);
-    };
+  $scope.removeNote = function(noteId) {
+    noteActionSrv.removeNote(noteId, false);
+  };
 
-    $scope.emptyTrash = function() {
-      noteActionSrv.emptyTrash();
-    };
+  $scope.removeFolder = function(folderId) {
+    noteActionSrv.removeFolder(folderId);
+  };
 
-    $scope.clearAllParagraphOutput = function(noteId) {
-      noteActionSrv.clearAllParagraphOutput(noteId);
-    };
-  }
-})();
+  $scope.emptyTrash = function() {
+    noteActionSrv.emptyTrash();
+  };
+
+  $scope.clearAllParagraphOutput = function(noteId) {
+    noteActionSrv.clearAllParagraphOutput(noteId);
+  };
+}

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/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 2754ae5..f73bc98 100644
--- a/zeppelin-web/src/app/interpreter/interpreter.controller.js
+++ b/zeppelin-web/src/app/interpreter/interpreter.controller.js
@@ -11,710 +11,708 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
 
-  angular.module('zeppelinWebApp').controller('InterpreterCtrl', InterpreterCtrl);
-
-  InterpreterCtrl.$inject = ['$rootScope', '$scope', '$http', 'baseUrlSrv', 'ngToast', '$timeout', '$route'];
-
-  function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeout, $route) {
-    var interpreterSettingsTmp = [];
-    $scope.interpreterSettings = [];
-    $scope.availableInterpreters = {};
-    $scope.showAddNewSetting = false;
-    $scope.showRepositoryInfo = false;
-    $scope.searchInterpreter = '';
-    $scope._ = _;
-    ngToast.dismiss();
-
-    $scope.openPermissions = function() {
-      $scope.showInterpreterAuth = true;
-    };
-
-    $scope.closePermissions = function() {
-      $scope.showInterpreterAuth = false;
-    };
-
-    var getSelectJson = function() {
-      var selectJson = {
-        tags: false,
-        multiple: true,
-        tokenSeparators: [',', ' '],
-        minimumInputLength: 2,
-        ajax: {
-          url: function(params) {
-            if (!params.term) {
-              return false;
+angular.module('zeppelinWebApp').controller('InterpreterCtrl', InterpreterCtrl);
+
+InterpreterCtrl.$inject = ['$rootScope', '$scope', '$http', 'baseUrlSrv', 'ngToast', '$timeout', '$route'];
+
+function InterpreterCtrl($rootScope, $scope, $http, baseUrlSrv, ngToast, $timeout, $route) {
+  var interpreterSettingsTmp = [];
+  $scope.interpreterSettings = [];
+  $scope.availableInterpreters = {};
+  $scope.showAddNewSetting = false;
+  $scope.showRepositoryInfo = false;
+  $scope.searchInterpreter = '';
+  $scope._ = _;
+  ngToast.dismiss();
+
+  $scope.openPermissions = function() {
+    $scope.showInterpreterAuth = true;
+  };
+
+  $scope.closePermissions = function() {
+    $scope.showInterpreterAuth = false;
+  };
+
+  var getSelectJson = function() {
+    var selectJson = {
+      tags: false,
+      multiple: true,
+      tokenSeparators: [',', ' '],
+      minimumInputLength: 2,
+      ajax: {
+        url: function(params) {
+          if (!params.term) {
+            return false;
+          }
+          return baseUrlSrv.getRestApiBase() + '/security/userlist/' + params.term;
+        },
+        delay: 250,
+        processResults: function(data, params) {
+          var users = [];
+          if (data.body.users.length !== 0) {
+            for (var i = 0; i < data.body.users.length; i++) {
+              users.push({
+                'id': data.body.users[i],
+                'text': data.body.users[i]
+              });
             }
-            return baseUrlSrv.getRestApiBase() + '/security/userlist/' + params.term;
-          },
-          delay: 250,
-          processResults: function(data, params) {
-            var users = [];
-            if (data.body.users.length !== 0) {
-              for (var i = 0; i < data.body.users.length; i++) {
-                users.push({
-                  'id': data.body.users[i],
-                  'text': data.body.users[i]
-                });
-              }
+          }
+          return {
+            results: users,
+            pagination: {
+              more: false
             }
-            return {
-              results: users,
-              pagination: {
-                more: false
-              }
-            };
-          },
-          cache: false
-        }
-      };
-      return selectJson;
-    };
-
-    $scope.togglePermissions = function(intpName) {
-      angular.element('#' + intpName + 'Users').select2(getSelectJson());
-      if ($scope.showInterpreterAuth) {
-        $scope.closePermissions();
-      } else {
-        $scope.openPermissions();
+          };
+        },
+        cache: false
       }
     };
-
-    $scope.$on('ngRenderFinished', function(event, data) {
-      for (var setting = 0; setting < $scope.interpreterSettings.length; setting++) {
-        angular.element('#' + $scope.interpreterSettings[setting].name + 'Users').select2(getSelectJson());
-      }
-    });
-
-    var getInterpreterSettings = function() {
-      $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting')
+    return selectJson;
+  };
+
+  $scope.togglePermissions = function(intpName) {
+    angular.element('#' + intpName + 'Users').select2(getSelectJson());
+    if ($scope.showInterpreterAuth) {
+      $scope.closePermissions();
+    } else {
+      $scope.openPermissions();
+    }
+  };
+
+  $scope.$on('ngRenderFinished', function(event, data) {
+    for (var setting = 0; setting < $scope.interpreterSettings.length; setting++) {
+      angular.element('#' + $scope.interpreterSettings[setting].name + 'Users').select2(getSelectJson());
+    }
+  });
+
+  var getInterpreterSettings = function() {
+    $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/setting')
       .success(function(data, status, headers, config) {
         $scope.interpreterSettings = data.body;
         checkDownloadingDependencies();
       }).error(function(data, status, headers, config) {
-        if (status === 401) {
-          ngToast.danger({
-            content: 'You don\'t have permission on this page',
-            verticalPosition: 'bottom',
-            timeout: '3000'
-          });
-          setTimeout(function() {
-            window.location.replace('/');
-          }, 3000);
-        }
-        console.log('Error %o %o', status, data.message);
-      });
-    };
-
-    var checkDownloadingDependencies = function() {
-      var isDownloading = false;
-      for (var index = 0; index < $scope.interpreterSettings.length; index++) {
-        var setting = $scope.interpreterSettings[index];
-        if (setting.status === 'DOWNLOADING_DEPENDENCIES') {
-          isDownloading = true;
-        }
-
-        if (setting.status === 'ERROR' || setting.errorReason) {
-          ngToast.danger({content: 'Error setting properties for interpreter \'' +
-            setting.group + '.' + setting.name + '\': ' + setting.errorReason,
-            verticalPosition: 'top', dismissOnTimeout: false});
-        }
+      if (status === 401) {
+        ngToast.danger({
+          content: 'You don\'t have permission on this page',
+          verticalPosition: 'bottom',
+          timeout: '3000'
+        });
+        setTimeout(function() {
+          window.location.replace('/');
+        }, 3000);
       }
-
-      if (isDownloading) {
-        $timeout(function() {
-          if ($route.current.$$route.originalPath === '/interpreter') {
-            getInterpreterSettings();
-          }
-        }, 2000);
+      console.log('Error %o %o', status, data.message);
+    });
+  };
+
+  var checkDownloadingDependencies = function() {
+    var isDownloading = false;
+    for (var index = 0; index < $scope.interpreterSettings.length; index++) {
+      var setting = $scope.interpreterSettings[index];
+      if (setting.status === 'DOWNLOADING_DEPENDENCIES') {
+        isDownloading = true;
       }
-    };
-
-    var getAvailableInterpreters = function() {
-      $http.get(baseUrlSrv.getRestApiBase() + '/interpreter').success(function(data, status, headers, config) {
-        $scope.availableInterpreters = data.body;
-      }).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.setPerNoteOption = 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 (setting.status === 'ERROR' || setting.errorReason) {
+        ngToast.danger({content: 'Error setting properties for interpreter \'' +
+        setting.group + '.' + setting.name + '\': ' + setting.errorReason,
+          verticalPosition: 'top', dismissOnTimeout: false});
       }
+    }
 
-      if (sessionOption === 'isolated') {
-        option.perNote = sessionOption;
-        option.session = false;
-        option.process = true;
-      } else if (sessionOption === 'scoped') {
-        option.perNote = sessionOption;
-        option.session = true;
-        option.process = false;
-      } else {
-        option.perNote = 'shared';
-        option.session = false;
-        option.process = false;
-      }
-    };
+    if (isDownloading) {
+      $timeout(function() {
+        if ($route.current.$$route.originalPath === '/interpreter') {
+          getInterpreterSettings();
+        }
+      }, 2000);
+    }
+  };
+
+  var getAvailableInterpreters = function() {
+    $http.get(baseUrlSrv.getRestApiBase() + '/interpreter').success(function(data, status, headers, config) {
+      $scope.availableInterpreters = data.body;
+    }).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.setPerNoteOption = 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.perNote = sessionOption;
+      option.session = false;
+      option.process = true;
+    } else if (sessionOption === 'scoped') {
+      option.perNote = sessionOption;
+      option.session = true;
+      option.process = false;
+    } else {
+      option.perNote = 'shared';
+      option.session = false;
+      option.process = false;
+    }
+  };
+
+  $scope.setPerUserOption = 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.perUser = sessionOption;
+      option.session = false;
+      option.process = true;
+    } else if (sessionOption === 'scoped') {
+      option.perUser = sessionOption;
+      option.session = true;
+      option.process = false;
+    } else {
+      option.perUser = 'shared';
+      option.session = false;
+      option.process = false;
+    }
+  };
+
+  $scope.getPerNoteOption = 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.perNote === 'scoped') {
+      return 'scoped';
+    } else if (option.perNote === 'isolated') {
+      return 'isolated';
+    } else {
+      return 'shared';
+    }
+  };
+
+  $scope.getPerUserOption = 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.perUser === 'scoped') {
+      return 'scoped';
+    } else if (option.perUser === 'isolated') {
+      return 'isolated';
+    } else {
+      return 'shared';
+    }
+  };
+
+  $scope.getInterpreterRunningOption = function(settingId) {
+    var sharedModeName = 'shared';
+
+    var globallyModeName = 'Globally';
+    var perNoteModeName = 'Per Note';
+    var perUserModeName = 'Per User';
+
+    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;
+    }
 
-    $scope.setPerUserOption = 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;
-      }
+    var perNote = option.perNote;
+    var perUser = option.perUser;
 
-      if (sessionOption === 'isolated') {
-        option.perUser = sessionOption;
-        option.session = false;
-        option.process = true;
-      } else if (sessionOption === 'scoped') {
-        option.perUser = sessionOption;
-        option.session = true;
-        option.process = false;
-      } else {
-        option.perUser = 'shared';
-        option.session = false;
-        option.process = false;
-      }
-    };
+    // Globally == shared_perNote + shared_perUser
+    if (perNote === sharedModeName && perUser === sharedModeName) {
+      return globallyModeName;
+    }
 
-    $scope.getPerNoteOption = 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 ($rootScope.ticket.ticket === 'anonymous' && $rootScope.ticket.roles === '[]') {
+      if (perNote !== undefined && typeof perNote === 'string' && perNote !== '') {
+        return perNoteModeName;
       }
-
-      if (option.perNote === 'scoped') {
-        return 'scoped';
-      } else if (option.perNote === 'isolated') {
-        return 'isolated';
-      } else {
-        return 'shared';
+    } else if ($rootScope.ticket.ticket !== 'anonymous') {
+      if (perNote !== undefined && typeof perNote === 'string' && perNote !== '') {
+        if (perUser !== undefined && typeof perUser === 'string' && perUser !== '') {
+          return perUserModeName;
+        }
+        return perNoteModeName;
       }
-    };
+    }
+
+    option.perNote = sharedModeName;
+    option.perUser = sharedModeName;
+    return globallyModeName;
+  };
+
+  $scope.setInterpreterRunningOption = function(settingId, isPerNoteMode, isPerUserMode) {
+    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;
+    }
+    option.perNote = isPerNoteMode;
+    option.perUser = isPerUserMode;
+  };
+
+  $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.setPermission === undefined) {
+            setting.option.setPermission = false;
+          }
+          if (setting.option.isUserImpersonate === undefined) {
+            setting.option.isUserImpersonate = false;
+          }
+          if (!($scope.getInterpreterRunningOption(settingId) === 'Per User' &&
+            $scope.getPerUserOption(settingId) === 'isolated')) {
+            setting.option.isUserImpersonate = false;
+          }
+          if (setting.option.remote === undefined) {
+            // remote always true for now
+            setting.option.remote = true;
+          }
+          setting.option.users = angular.element('#' + setting.name + 'Users').val();
 
-    $scope.getPerUserOption = 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;
-      }
+          var request = {
+            option: angular.copy(setting.option),
+            properties: angular.copy(setting.properties),
+            dependencies: angular.copy(setting.dependencies)
+          };
 
-      if (option.perUser === 'scoped') {
-        return 'scoped';
-      } else if (option.perUser === 'isolated') {
-        return 'isolated';
-      } else {
-        return 'shared';
+          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);
+              checkDownloadingDependencies();
+              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();
+        }
       }
-    };
-
-    $scope.getInterpreterRunningOption = function(settingId) {
-      var sharedModeName = 'shared';
-
-      var globallyModeName = 'Globally';
-      var perNoteModeName = 'Per Note';
-      var perUserModeName = 'Per User';
-
-      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;
+    });
+  };
+
+  $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) {
+            console.log('Error %o %o', status, data.message);
+          });
+        }
       }
-
-      var perNote = option.perNote;
-      var perUser = option.perUser;
-
-      // Globally == shared_perNote + shared_perUser
-      if (perNote === sharedModeName && perUser === sharedModeName) {
-        return globallyModeName;
+    });
+  };
+
+  $scope.newInterpreterGroupChange = function() {
+    var el = _.pluck(_.filter($scope.availableInterpreters, {'name': $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 ($rootScope.ticket.ticket === 'anonymous' && $rootScope.ticket.roles === '[]') {
-        if (perNote !== undefined && typeof perNote === 'string' && perNote !== '') {
-          return perNoteModeName;
-        }
-      } else if ($rootScope.ticket.ticket !== 'anonymous') {
-        if (perNote !== undefined && typeof perNote === 'string' && perNote !== '') {
-          if (perUser !== undefined && typeof perUser === 'string' && perUser !== '') {
-            return perUserModeName;
-          }
-          return perNoteModeName;
+    }
+    $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);
+          });
         }
       }
+    });
+  };
 
-      option.perNote = sharedModeName;
-      option.perUser = sharedModeName;
-      return globallyModeName;
-    };
-
-    $scope.setInterpreterRunningOption = function(settingId, isPerNoteMode, isPerUserMode) {
-      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;
-      }
-      option.perNote = isPerNoteMode;
-      option.perUser = isPerUserMode;
-    };
-
-    $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.setPermission === undefined) {
-              setting.option.setPermission = false;
-            }
-            if (setting.option.isUserImpersonate === undefined) {
-              setting.option.isUserImpersonate = false;
-            }
-            if (!($scope.getInterpreterRunningOption(settingId) === 'Per User' &&
-                $scope.getPerUserOption(settingId) === 'isolated')) {
-              setting.option.isUserImpersonate = false;
-            }
-            if (setting.option.remote === undefined) {
-              // remote always true for now
-              setting.option.remote = true;
-            }
-            setting.option.users = angular.element('#' + setting.name + 'Users').val();
-
-            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);
-                checkDownloadingDependencies();
-                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();
-          }
-        }
+  $scope.addNewInterpreterSetting = function() {
+    //user input validation on interpreter creation
+    if (!$scope.newInterpreterSetting.name ||
+      !$scope.newInterpreterSetting.name.trim() || !$scope.newInterpreterSetting.group) {
+      BootstrapDialog.alert({
+        closable: true,
+        title: 'Add interpreter',
+        message: 'Please fill in interpreter name and choose a group'
       });
-    };
-
-    $scope.resetInterpreterSetting = function(settingId) {
-      var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+      return;
+    }
 
-      // Set the old settings back
-      $scope.interpreterSettings[index] = angular.copy(interpreterSettingsTmp[index]);
-      removeTMPSettings(index);
-    };
-
-    $scope.removeInterpreterSetting = function(settingId) {
-      BootstrapDialog.confirm({
+    if ($scope.newInterpreterSetting.name.indexOf('.') >= 0) {
+      BootstrapDialog.alert({
         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);
-            });
-          }
-        }
+        title: 'Add interpreter',
+        message: '\'.\' is invalid for interpreter name'
       });
-    };
+      return;
+    }
 
-    $scope.newInterpreterGroupChange = function() {
-      var el = _.pluck(_.filter($scope.availableInterpreters, {'name': $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.newInterpreterSetting.properties = properties;
-    };
-
-    $scope.restartInterpreterSetting = function(settingId) {
-      BootstrapDialog.confirm({
+    if (_.findIndex($scope.interpreterSettings, {'name': $scope.newInterpreterSetting.name}) >= 0) {
+      BootstrapDialog.alert({
         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);
-            });
-          }
-        }
+        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();
+    }
+    if (newSetting.option.setPermission === undefined) {
+      newSetting.option.setPermission = false;
+    }
+    newSetting.option.users = angular.element('#newInterpreterUsers').val();
+
+    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;
+        checkDownloadingDependencies();
+      }).error(function(data, status, headers, config) {
+      console.log('Error %o %o', status, data.message);
+      ngToast.danger({content: data.message, verticalPosition: 'bottom'});
+    });
+  };
 
-    $scope.addNewInterpreterSetting = function() {
-      //user input validation on interpreter creation
-      if (!$scope.newInterpreterSetting.name ||
-          !$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.cancelInterpreterSetting = function() {
+    $scope.showAddNewSetting = false;
+    $scope.resetNewInterpreterSetting();
+  };
+
+  $scope.resetNewInterpreterSetting = function() {
+    $scope.newInterpreterSetting = {
+      name: undefined,
+      group: undefined,
+      properties: {},
+      dependencies: [],
+      option: {
+        remote: true,
+        isExistingProcess: false,
+        setPermission: false,
+        session: false,
+        process: false
 
-      if ($scope.newInterpreterSetting.name.indexOf('.') >= 0) {
-        BootstrapDialog.alert({
-          closable: true,
-          title: 'Add interpreter',
-          message: '\'.\' is invalid for interpreter name'
-        });
-        return;
       }
+    };
+    emptyNewProperty($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'
+  $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;
         });
-        return;
-      }
-
-      var newSetting = $scope.newInterpreterSetting;
-      if (newSetting.propertyKey !== '' || newSetting.propertyKey) {
-        $scope.addNewInterpreterProperty();
-      }
-      if (newSetting.depArtifact !== '' || newSetting.depArtifact) {
-        $scope.addNewInterpreterDependency();
-      }
-      if (newSetting.option.setPermission === undefined) {
-        newSetting.option.setPermission = false;
-      }
-      newSetting.option.users = angular.element('#newInterpreterUsers').val();
-
-      var request = angular.copy($scope.newInterpreterSetting);
+    } else {
+      var index = _.findIndex($scope.interpreterSettings, {'id': settingId});
+      $scope.interpreterSettings[index].dependencies = _.reject($scope.interpreterSettings[index].dependencies,
+        function(el) {
+          return el.groupArtifactVersion === artifact;
+        });
+    }
+  };
 
-      // Change properties to proper request format
-      var newProperties = {};
-      for (var p in newSetting.properties) {
-        newProperties[p] = newSetting.properties[p].value;
+  $scope.addNewInterpreterProperty = function(settingId) {
+    if (settingId === undefined) {
+      // Add new property from create form
+      if (!$scope.newInterpreterSetting.propertyKey || $scope.newInterpreterSetting.propertyKey === '') {
+        return;
       }
-      request.properties = newProperties;
 
-      $http.post(baseUrlSrv.getRestApiBase() + '/interpreter/setting', request)
-        .success(function(data, status, headers, config) {
-          $scope.resetNewInterpreterSetting();
-          getInterpreterSettings();
-          $scope.showAddNewSetting = false;
-          checkDownloadingDependencies();
-        }).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,
-          setPermission: false,
-          session: false,
-          process: 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];
 
-    $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];
+      if (!setting.propertyKey || setting.propertyKey === '') {
+        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;
-          });
+      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.addNewInterpreterProperty = function(settingId) {
-      if (settingId === undefined) {
-        // Add new property from create form
-        if (!$scope.newInterpreterSetting.propertyKey || $scope.newInterpreterSetting.propertyKey === '') {
-          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;
+      // 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);
         }
-        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;
-        }
-
-        // 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;
-        }
+      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);
-          }
+      // 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);
       }
-    };
 
-    $scope.resetNewRepositorySetting = function() {
-      $scope.newRepoSetting = {
-        id: '',
-        url: '',
-        snapshot: false,
-        username: '',
-        password: '',
-        proxyProtocol: 'HTTP',
-        proxyHost: '',
-        proxyPort: null,
-        proxyLogin: '',
-        proxyPassword: ''
-      };
-    };
-
-    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);
+      setting.dependencies.push({
+        'groupArtifactVersion': setting.depArtifact,
+        'exclusions': (setting.depExclude === '') ? [] : setting.depExclude
       });
-    };
+      emptyNewDependency(setting);
+    }
+  };
+
+  $scope.resetNewRepositorySetting = function() {
+    $scope.newRepoSetting = {
+      id: '',
+      url: '',
+      snapshot: false,
+      username: '',
+      password: '',
+      proxyProtocol: 'HTTP',
+      proxyHost: '',
+      proxyPort: null,
+      proxyLogin: '',
+      proxyPassword: ''
+    };
+  };
+
+  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);
+  $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) {
-              console.log('Error %o %o', status, data.message);
-            });
-          }
+    $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) {
+            console.log('Error %o %o', status, data.message);
+          });
         }
-      });
-    };
-
-    $scope.isDefaultRepository = function(repoId) {
-      if (repoId === 'central' || repoId === 'local') {
-        return true;
-      } else {
-        return false;
       }
-    };
-
-    $scope.showErrorMessage = function(setting) {
-      BootstrapDialog.show({
-        title: 'Error downloading dependencies',
-        message: setting.errorReason
-      });
-    };
+    });
+  };
+
+  $scope.isDefaultRepository = function(repoId) {
+    if (repoId === 'central' || repoId === 'local') {
+      return true;
+    } else {
+      return false;
+    }
+  };
+
+  $scope.showErrorMessage = function(setting) {
+    BootstrapDialog.show({
+      title: 'Error downloading dependencies',
+      message: setting.errorReason
+    });
+  };
 
-    var init = function() {
-      $scope.resetNewInterpreterSetting();
-      $scope.resetNewRepositorySetting();
+  var init = function() {
+    $scope.resetNewInterpreterSetting();
+    $scope.resetNewRepositorySetting();
 
-      getInterpreterSettings();
-      getAvailableInterpreters();
-      getRepositories();
-    };
+    getInterpreterSettings();
+    getAvailableInterpreters();
+    getRepositories();
+  };
 
-    $scope.showSparkUI = function(settingId) {
-      $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/getmetainfos/' + settingId + '?propName=url')
-        .success(function(data, status, headers, config) {
-          var url = data.body.url;
-          if (!url) {
-            BootstrapDialog.alert({
-              message: 'No spark application running'
-            });
-            return;
-          }
-          window.open(url, '_blank');
-        }).error(function(data, status, headers, config) {
-         console.log('Error %o %o', status, data.message);
-       });
-    };
+  $scope.showSparkUI = function(settingId) {
+    $http.get(baseUrlSrv.getRestApiBase() + '/interpreter/getmetainfos/' + settingId + '?propName=url')
+      .success(function(data, status, headers, config) {
+        var url = data.body.url;
+        if (!url) {
+          BootstrapDialog.alert({
+            message: 'No spark application running'
+          });
+          return;
+        }
+        window.open(url, '_blank');
+      }).error(function(data, status, headers, config) {
+      console.log('Error %o %o', status, data.message);
+    });
+  };
 
-    init();
-  }
+  init();
+}
 
-})();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/4c60b27c/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 59510b0..c5f1572 100644
--- a/zeppelin-web/src/app/interpreter/interpreter.filter.js
+++ b/zeppelin-web/src/app/interpreter/interpreter.filter.js
@@ -11,15 +11,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-(function() {
 
-  angular.module('zeppelinWebApp').filter('sortByKey', sortByKey);
+angular.module('zeppelinWebApp').filter('sortByKey', sortByKey);
 
-  function sortByKey() {
-    return function(properties) {
-      var sortedKeys = properties ? Object.keys(properties) : [];
-      return sortedKeys.sort();
-    };
-  }
-
-})();
+function sortByKey() {
+  return function(properties) {
+    var sortedKeys = properties ? Object.keys(properties) : [];
+    return sortedKeys.sort();
+  };
+}


Mime
View raw message