You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by pr...@apache.org on 2016/07/08 16:23:30 UTC

[1/2] zeppelin git commit: [ZEPPELIN-235] jscs in zeppelin-web

Repository: zeppelin
Updated Branches:
  refs/heads/master b84ae60f1 -> 5556f8152


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 7ed029d..1febeb1 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -14,9 +14,10 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp')
-  .controller('ParagraphCtrl', function($scope,$rootScope, $route, $window, $element, $routeParams, $location,
-                                         $timeout, $compile, $http, websocketMsgSrv, baseUrlSrv, ngToast, SaveAsService) {
+angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $rootScope, $route, $window, $element,
+                                                                      $routeParams, $location, $timeout, $compile,
+                                                                      $http, websocketMsgSrv, baseUrlSrv, ngToast,
+                                                                      SaveAsService) {
   var ANGULAR_FUNCTION_OBJECT_NAME_PREFIX = '_Z_ANGULAR_FUNC_';
   $scope.parentNote = null;
   $scope.paragraph = null;
@@ -93,7 +94,7 @@ angular.module('zeppelinWebApp')
     $scope.parentNote = note;
     $scope.originalText = angular.copy(newParagraph.text);
     $scope.chart = {};
-    $scope.colWidthOption = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ];
+    $scope.colWidthOption = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
     $scope.showTitleEditor = false;
     $scope.paragraphFocused = false;
     if (newParagraph.focus) {
@@ -127,8 +128,6 @@ angular.module('zeppelinWebApp')
     }
   };
 
-
-
   $scope.renderHtml = function() {
     var retryRenderer = function() {
       if (angular.element('#p' + $scope.paragraph.id + '_html').length) {
@@ -150,12 +149,12 @@ angular.module('zeppelinWebApp')
 
   $scope.renderAngular = function() {
     var retryRenderer = function() {
-      if (angular.element('#p'+$scope.paragraph.id+'_angular').length) {
+      if (angular.element('#p' + $scope.paragraph.id + '_angular').length) {
         try {
-          angular.element('#p'+$scope.paragraph.id+'_angular').html($scope.paragraph.result.msg);
+          angular.element('#p' + $scope.paragraph.id + '_angular').html($scope.paragraph.result.msg);
 
-          $compile(angular.element('#p'+$scope.paragraph.id+'_angular').contents())(paragraphScope);
-        } catch(err) {
+          $compile(angular.element('#p' + $scope.paragraph.id + '_angular').contents())(paragraphScope);
+        } catch (err) {
           console.log('ANGULAR rendering error %o', err);
         }
       } else {
@@ -199,7 +198,7 @@ angular.module('zeppelinWebApp')
     var textEl = angular.element('#p' + $scope.paragraph.id + '_text');
     if (textEl.length) {
       var lines = msg.split('\n');
-      for (var i=0; i < lines.length; i++) {
+      for (var i = 0; i < lines.length; i++) {
         textEl.append(angular.element('<div></div>').text(lines[i]));
       }
     }
@@ -209,8 +208,6 @@ angular.module('zeppelinWebApp')
     }
   };
 
-
-
   $scope.$on('angularObjectUpdate', function(event, data) {
     var noteId = $route.current.pathParams.noteId;
     if (!data.noteId || data.noteId === noteId) {
@@ -221,7 +218,7 @@ angular.module('zeppelinWebApp')
         scope = paragraphScope;
         registry = angularObjectRegistry;
       } else {
-        var app = _.find($scope.apps, { id: data.paragraphId});
+        var app = _.find($scope.apps, {id: data.paragraphId});
         if (app) {
           scope = getAppScope(app);
           registry = getAppRegistry(app);
@@ -239,9 +236,9 @@ angular.module('zeppelinWebApp')
 
       if (!registry[varName]) {
         registry[varName] = {
-          interpreterGroupId : data.interpreterGroupId,
-          noteId : data.noteId,
-          paragraphId : data.paragraphId
+          interpreterGroupId: data.interpreterGroupId,
+          noteId: data.noteId,
+          paragraphId: data.paragraphId
         };
       } else {
         registry[varName].noteId = registry[varName].noteId || data.noteId;
@@ -281,7 +278,6 @@ angular.module('zeppelinWebApp')
     }
   });
 
-
   $scope.$on('angularObjectRemove', function(event, data) {
     var noteId = $route.current.pathParams.noteId;
     if (!data.noteId || data.noteId === noteId) {
@@ -292,7 +288,7 @@ angular.module('zeppelinWebApp')
         scope = paragraphScope;
         registry = angularObjectRegistry;
       } else {
-        var app = _.find($scope.apps, { id: data.paragraphId});
+        var app = _.find($scope.apps, {id: data.paragraphId});
         if (app) {
           scope = getAppScope(app);
           registry = getAppRegistry(app);
@@ -365,7 +361,7 @@ angular.module('zeppelinWebApp')
     }
   };
 
-  $scope.getIframeDimensions = function () {
+  $scope.getIframeDimensions = function() {
     if ($scope.asIframe) {
       var paragraphid = '#' + $routeParams.paragraphId + '_container';
       var height = angular.element(paragraphid).height();
@@ -374,7 +370,7 @@ angular.module('zeppelinWebApp')
     return 0;
   };
 
-  $scope.$watch($scope.getIframeDimensions, function (newValue, oldValue) {
+  $scope.$watch($scope.getIframeDimensions, function(newValue, oldValue) {
     if ($scope.asIframe && newValue) {
       var message = {};
       message.height = newValue;
@@ -383,7 +379,7 @@ angular.module('zeppelinWebApp')
     }
   });
 
-  var isEmpty = function (object) {
+  var isEmpty = function(object) {
     return !object;
   };
 
@@ -417,12 +413,11 @@ angular.module('zeppelinWebApp')
 
       var statusChanged = (data.paragraph.status !== $scope.paragraph.status);
 
-
       //console.log("updateParagraph oldData %o, newData %o. type %o -> %o, mode %o -> %o", $scope.paragraph, data, oldType, newType, oldGraphMode, newGraphMode);
 
       if ($scope.paragraph.text !== data.paragraph.text) {
         if ($scope.dirtyText) {         // check if editor has local update
-          if ($scope.dirtyText === data.paragraph.text ) {  // when local update is the same from remote, clear local update
+          if ($scope.dirtyText === data.paragraph.text) {  // when local update is the same from remote, clear local update
             $scope.paragraph.text = data.paragraph.text;
             $scope.dirtyText = undefined;
             $scope.originalText = angular.copy(data.paragraph.text);
@@ -483,7 +478,7 @@ angular.module('zeppelinWebApp')
       getSuggestions();
 
       if (newActiveApp && newActiveApp !== oldActiveApp) {
-        var app = _.find($scope.apps, { id : newActiveApp });
+        var app = _.find($scope.apps, {id: newActiveApp});
         renderApp(app);
       }
 
@@ -491,7 +486,7 @@ angular.module('zeppelinWebApp')
         // when last paragraph runs, zeppelin automatically appends new paragraph.
         // this broadcast will focus to the newly inserted paragraph
         var paragraphs = angular.element('div[id$="_paragraphColumn_main"]');
-        if (paragraphs.length >= 2 && paragraphs[paragraphs.length-2].id.startsWith($scope.paragraph.id)) {
+        if (paragraphs.length >= 2 && paragraphs[paragraphs.length - 2].id.startsWith($scope.paragraph.id)) {
           // rendering output can took some time. So delay scrolling event firing for sometime.
           setTimeout(function() {
             $rootScope.$broadcast('scrollToCursor');
@@ -539,16 +534,17 @@ angular.module('zeppelinWebApp')
     $scope.dirtyText = undefined;
   };
 
-  $scope.saveParagraph = function(){
-    if($scope.dirtyText === undefined || $scope.dirtyText === $scope.originalText){
+  $scope.saveParagraph = function() {
+    if ($scope.dirtyText === undefined || $scope.dirtyText === $scope.originalText) {
       return;
     }
-    commitParagraph($scope.paragraph.title, $scope.dirtyText, $scope.paragraph.config, $scope.paragraph.settings.params);
+    commitParagraph($scope.paragraph.title, $scope.dirtyText, $scope.paragraph.config,
+      $scope.paragraph.settings.params);
     $scope.originalText = angular.copy($scope.dirtyText);
     $scope.dirtyText = undefined;
   };
 
-  $scope.toggleEnableDisable = function () {
+  $scope.toggleEnableDisable = function() {
     $scope.paragraph.config.enabled = $scope.paragraph.config.enabled ? false : true;
     var newParams = angular.copy($scope.paragraph.settings.params);
     var newConfig = angular.copy($scope.paragraph.config);
@@ -578,7 +574,7 @@ angular.module('zeppelinWebApp')
 
   $scope.removeParagraph = function() {
     var paragraphs = angular.element('div[id$="_paragraphColumn_main"]');
-    if (paragraphs[paragraphs.length-1].id.startsWith($scope.paragraph.id)) {
+    if (paragraphs[paragraphs.length - 1].id.startsWith($scope.paragraph.id)) {
       BootstrapDialog.alert({
         closable: true,
         message: 'The last paragraph can\'t be deleted.'
@@ -672,7 +668,7 @@ angular.module('zeppelinWebApp')
     commitParagraph($scope.paragraph.title, $scope.paragraph.text, newConfig, newParams);
   };
 
-  $scope.showLineNumbers = function () {
+  $scope.showLineNumbers = function() {
     var newParams = angular.copy($scope.paragraph.settings.params);
     var newConfig = angular.copy($scope.paragraph.config);
     newConfig.lineNumbers = true;
@@ -681,7 +677,7 @@ angular.module('zeppelinWebApp')
     commitParagraph($scope.paragraph.title, $scope.paragraph.text, newConfig, newParams);
   };
 
-  $scope.hideLineNumbers = function () {
+  $scope.hideLineNumbers = function() {
     var newParams = angular.copy($scope.paragraph.settings.params);
     var newConfig = angular.copy($scope.paragraph.config);
     newConfig.lineNumbers = false;
@@ -731,7 +727,7 @@ angular.module('zeppelinWebApp')
     commitParagraph($scope.paragraph.title, $scope.paragraph.text, newConfig, newParams);
   };
 
-  $scope.toggleLineWithFocus = function () {
+  $scope.toggleLineWithFocus = function() {
     var mode = $scope.getGraphMode();
 
     if (mode === 'lineWithFocusChart') {
@@ -747,8 +743,6 @@ angular.module('zeppelinWebApp')
     return false;
   };
 
-
-
   $scope.loadForm = function(formulaire, params) {
     var value = formulaire.defaultValue;
     if (params[formulaire.name]) {
@@ -799,7 +793,7 @@ angular.module('zeppelinWebApp')
         autoAdjustEditorHeight(_editor.container.id);
       });
 
-      if (navigator.appVersion.indexOf('Mac') !== -1 ) {
+      if (navigator.appVersion.indexOf('Mac') !== -1) {
         $scope.editor.setKeyboardHandler('ace/keyboard/emacs');
         $rootScope.isMac = true;
       } else if (navigator.appVersion.indexOf('Win') !== -1 ||
@@ -811,7 +805,7 @@ angular.module('zeppelinWebApp')
 
       $scope.setParagraphMode = function(session, paragraphText, pos) {
         // Evaluate the mode only if the first 30 characters of the paragraph have been modified or the the position is undefined.
-        if ( (typeof pos === 'undefined') || (pos.row === 0 && pos.column < 30)) {
+        if ((typeof pos === 'undefined') || (pos.row === 0 && pos.column < 30)) {
           // If paragraph loading, use config value if exists
           if ((typeof pos === 'undefined') && $scope.paragraph.config.editorMode) {
             session.setMode($scope.paragraph.config.editorMode);
@@ -823,7 +817,7 @@ angular.module('zeppelinWebApp')
             if (!editorModes[oldMode] || !editorModes[oldMode].test(paragraphText)) {
               for (var key in editorModes) {
                 if (key !== oldMode) {
-                  if (editorModes[key].test(paragraphText)){
+                  if (editorModes[key].test(paragraphText)) {
                     $scope.paragraph.config.editorMode = key;
                     session.setMode(key);
                     return true;
@@ -838,8 +832,8 @@ angular.module('zeppelinWebApp')
       };
 
       var remoteCompleter = {
-        getCompletions : function(editor, session, pos, prefix, callback) {
-          if (!$scope.editor.isFocused() ){ return;}
+        getCompletions: function(editor, session, pos, prefix, callback) {
+          if (!$scope.editor.isFocused()) { return;}
 
           pos = session.getTextRange(new Range(0, 0, pos.row, pos.column)).length;
           var buf = session.getValue();
@@ -863,12 +857,13 @@ angular.module('zeppelinWebApp')
         }
       };
 
-      langTools.setCompleters([remoteCompleter, langTools.keyWordCompleter, langTools.snippetCompleter, langTools.textCompleter]);
+      langTools.setCompleters([remoteCompleter, langTools.keyWordCompleter, langTools.snippetCompleter,
+        langTools.textCompleter]);
 
       $scope.editor.setOptions({
         enableBasicAutocompletion: true,
         enableSnippets: false,
-        enableLiveAutocompletion:false
+        enableLiveAutocompletion: false
       });
 
       $scope.handleFocus = function(value) {
@@ -894,7 +889,6 @@ angular.module('zeppelinWebApp')
 
       $scope.setParagraphMode($scope.editor.getSession(), $scope.editor.getSession().getValue());
 
-
       // autocomplete on '.'
       /*
       $scope.editor.commands.on("afterExec", function(e, t) {
@@ -910,7 +904,6 @@ angular.module('zeppelinWebApp')
       // remove binding
       $scope.editor.commands.bindKey('ctrl-alt-n.', null);
 
-
       // autocomplete on 'ctrl+.'
       $scope.editor.commands.bindKey('ctrl-.', 'startAutocomplete');
       $scope.editor.commands.bindKey('ctrl-space', null);
@@ -921,7 +914,8 @@ angular.module('zeppelinWebApp')
         if ($scope.editor.completer && $scope.editor.completer.activated) { // if autocompleter is active
         } else {
           // fix ace editor focus issue in chrome (textarea element goes to top: -1000px after focused by cursor move)
-          if (parseInt(angular.element('#' + $scope.paragraph.id + '_editor > textarea').css('top').replace('px', '')) < 0) {
+          if (parseInt(angular.element('#' + $scope.paragraph.id + '_editor > textarea')
+              .css('top').replace('px', '')) < 0) {
             var position = $scope.editor.getCursorPosition();
             var cursorPos = $scope.editor.renderer.$cursorLayer.getPixelPosition(position, true);
             angular.element('#' + $scope.paragraph.id + '_editor > textarea').css('top', cursorPos.top);
@@ -942,7 +936,7 @@ angular.module('zeppelinWebApp')
           } else if (keyCode === 40 || (keyCode === 78 && e.ctrlKey && !e.altKey)) {  // DOWN
             numRows = $scope.editor.getSession().getLength();
             currentRow = $scope.editor.getCursorPosition().row;
-            if (currentRow === numRows-1) {
+            if (currentRow === numRows - 1) {
               // move focus to next paragraph
               $scope.$emit('moveFocusToNextParagraph', $scope.paragraph.id);
             } else {
@@ -957,7 +951,8 @@ angular.module('zeppelinWebApp')
 
   var autoAdjustEditorHeight = function(id) {
     var editor = $scope.editor;
-    var height = editor.getSession().getScreenLength() * editor.renderer.lineHeight + editor.renderer.scrollBar.getWidth();
+    var height = editor.getSession().getScreenLength() * editor.renderer.lineHeight +
+      editor.renderer.scrollBar.getWidth();
 
     angular.element('#' + id).height(height.toString() + 'px');
     editor.resize();
@@ -966,7 +961,7 @@ angular.module('zeppelinWebApp')
   $rootScope.$on('scrollToCursor', function(event) {
     // scroll on 'scrollToCursor' event only when cursor is in the last paragraph
     var paragraphs = angular.element('div[id$="_paragraphColumn_main"]');
-    if (paragraphs[paragraphs.length-1].id.startsWith($scope.paragraph.id)) {
+    if (paragraphs[paragraphs.length - 1].id.startsWith($scope.paragraph.id)) {
       $scope.scrollToCursor($scope.paragraph.id, 0);
     }
   });
@@ -978,8 +973,8 @@ angular.module('zeppelinWebApp')
    **/
   $scope.scrollToCursor = function(paragraphId, lastCursorMove) {
     if (!$scope.editor.isFocused()) {
-     // only make sense when editor is focused
-     return;
+      // only make sense when editor is focused
+      return;
     }
     var lineHeight = $scope.editor.renderer.lineHeight;
     var headerHeight = 103; // menubar, notebook titlebar
@@ -989,20 +984,20 @@ angular.module('zeppelinWebApp')
     var windowHeight = angular.element(window).height();  // actual viewport height
 
     var scrollPosition = angular.element(document).scrollTop();
-    var editorPosition = angular.element('#'+paragraphId+'_editor').offset();
+    var editorPosition = angular.element('#' + paragraphId + '_editor').offset();
     var position = $scope.editor.getCursorPosition();
     var lastCursorPosition = $scope.editor.renderer.$cursorLayer.getPixelPosition(position, true);
 
-    var calculatedCursorPosition = editorPosition.top + lastCursorPosition.top + lineHeight*lastCursorMove;
+    var calculatedCursorPosition = editorPosition.top + lastCursorPosition.top + lineHeight * lastCursorMove;
 
     var scrollTargetPos;
     if (calculatedCursorPosition < scrollPosition + headerHeight + scrollTriggerEdgeMargin) {
-      scrollTargetPos = calculatedCursorPosition - headerHeight - ((windowHeight-headerHeight)/3);
+      scrollTargetPos = calculatedCursorPosition - headerHeight - ((windowHeight - headerHeight) / 3);
       if (scrollTargetPos < 0) {
         scrollTargetPos = 0;
       }
-    } else if(calculatedCursorPosition > scrollPosition + scrollTriggerEdgeMargin + windowHeight - headerHeight) {
-      scrollTargetPos = calculatedCursorPosition - headerHeight - ((windowHeight-headerHeight)*2/3);
+    } else if (calculatedCursorPosition > scrollPosition + scrollTriggerEdgeMargin + windowHeight - headerHeight) {
+      scrollTargetPos = calculatedCursorPosition - headerHeight - ((windowHeight - headerHeight) * 2 / 3);
 
       if (scrollTargetPos > documentHeight) {
         scrollTargetPos = documentHeight;
@@ -1015,7 +1010,7 @@ angular.module('zeppelinWebApp')
     bodyEl.finish();
 
     // scroll to scrollTargetPos
-    bodyEl.scrollTo(scrollTargetPos, {axis: 'y', interrupt: true, duration:100});
+    bodyEl.scrollTo(scrollTargetPos, {axis: 'y', interrupt: true, duration: 100});
   };
 
   var setEditorHeight = function(id, height) {
@@ -1034,7 +1029,7 @@ angular.module('zeppelinWebApp')
     var pdata = $scope.paragraph;
     var timeMs = Date.parse(pdata.dateFinished) - Date.parse(pdata.dateStarted);
     if (isNaN(timeMs) || timeMs < 0) {
-      if ($scope.isResultOutdated()){
+      if ($scope.isResultOutdated()) {
         return 'outdated';
       }
       return '';
@@ -1043,7 +1038,7 @@ angular.module('zeppelinWebApp')
     var desc = 'Took ' +
       moment.duration(moment(pdata.dateFinished).diff(moment(pdata.dateStarted))).humanize() +
       '. Last updated by ' + user + ' at ' + moment(pdata.dateUpdated).format('MMMM DD YYYY, h:mm:ss A') + '.';
-    if ($scope.isResultOutdated()){
+    if ($scope.isResultOutdated()) {
       desc += ' (outdated)';
     }
     return desc;
@@ -1055,13 +1050,13 @@ angular.module('zeppelinWebApp')
 
   $scope.isResultOutdated = function() {
     var pdata = $scope.paragraph;
-    if (pdata.dateUpdated !==undefined && Date.parse(pdata.dateUpdated) > Date.parse(pdata.dateStarted)){
+    if (pdata.dateUpdated !== undefined && Date.parse(pdata.dateUpdated) > Date.parse(pdata.dateStarted)) {
       return true;
     }
     return false;
   };
 
-  $scope.goToLineEnd = function () {
+  $scope.goToLineEnd = function() {
     $scope.editor.navigateLineEnd();
   };
 
@@ -1176,7 +1171,6 @@ angular.module('zeppelinWebApp')
     $scope.closeTable();
   });
 
-
   $scope.getResultType = function(paragraph) {
     var pdata = (paragraph) ? paragraph : $scope.paragraph;
     if (pdata.result && pdata.result.type) {
@@ -1187,7 +1181,7 @@ angular.module('zeppelinWebApp')
   };
 
   $scope.getBase64ImageSrc = function(base64Data) {
-    return 'data:image/png;base64,'+base64Data;
+    return 'data:image/png;base64,' + base64Data;
   };
 
   $scope.getGraphMode = function(paragraph) {
@@ -1219,7 +1213,7 @@ angular.module('zeppelinWebApp')
         }
 
         if (textRow === '') {
-          if (rows.length>0) {
+          if (rows.length > 0) {
             comment = true;
           }
           continue;
@@ -1230,10 +1224,10 @@ angular.module('zeppelinWebApp')
         for (var j = 0; j < textCols.length; j++) {
           var col = textCols[j];
           if (i === 0) {
-            columnNames.push({name:col, index:j, aggr:'sum'});
+            columnNames.push({name: col, index: j, aggr: 'sum'});
           } else {
             cols.push(col);
-            cols2.push({key: (columnNames[i]) ? columnNames[i].name: undefined, value: col});
+            cols2.push({key: (columnNames[i]) ? columnNames[i].name : undefined, value: col});
           }
         }
         if (i !== 0) {
@@ -1258,8 +1252,7 @@ angular.module('zeppelinWebApp')
 
       if (!type || type === 'table') {
         setTable($scope.paragraph.result, refresh);
-      }
-      else {
+      } else {
         setD3Chart(type, $scope.paragraph.result, refresh);
       }
     }
@@ -1310,7 +1303,7 @@ angular.module('zeppelinWebApp')
           fillHandle: false,
           fragmentSelection: true,
           disableVisualSelection: true,
-          cells: function (row, col, prop) {
+          cells: function(row, col, prop) {
             var cellProperties = {};
             cellProperties.renderer = function(instance, td, row, col, prop, value, cellProperties) {
               if (!isNaN(value)) {
@@ -1339,7 +1332,7 @@ angular.module('zeppelinWebApp')
       if (angular.element('#p' + $scope.paragraph.id + '_table').length) {
         try {
           renderTable();
-        } catch(err) {
+        } catch (err) {
           console.log('Chart drawing error %o', err);
         }
       } else {
@@ -1350,7 +1343,7 @@ angular.module('zeppelinWebApp')
 
   };
 
-  var groupedThousandsWith3DigitsFormatter = function(x){
+  var groupedThousandsWith3DigitsFormatter = function(x) {
     return d3.format(',')(d3.round(x, 3));
   };
 
@@ -1371,7 +1364,7 @@ angular.module('zeppelinWebApp')
   };
 
   var yAxisTickFormat = function(d) {
-    if(d >= Math.pow(10,6)){
+    if (d >= Math.pow(10,6)) {
       return customAbbrevFormatter(d);
     }
     return groupedThousandsWith3DigitsFormatter(d);
@@ -1419,12 +1412,12 @@ angular.module('zeppelinWebApp')
         $scope.chart[type].x(function(d) { return d.label;})
           .y(function(d) { return d.value;});
 
-        if ( d.length > 0 ) {
-          for ( var i=0; i<d[0].values.length ; i++) {
+        if (d.length > 0) {
+          for (var i = 0; i < d[0].values.length ; i++) {
             var e = d[0].values[i];
             d3g.push({
-              label : e.x,
-              value : e.y
+              label: e.x,
+              value: e.y
             });
           }
         }
@@ -1442,7 +1435,7 @@ angular.module('zeppelinWebApp')
         if ($scope.chart[type].useInteractiveGuideline) { // lineWithFocusChart hasn't got useInteractiveGuideline
           $scope.chart[type].useInteractiveGuideline(true); // for better UX and performance issue. (https://github.com/novus/nvd3/issues/691)
         }
-        if($scope.paragraph.config.graph.forceY) {
+        if ($scope.paragraph.config.graph.forceY) {
           $scope.chart[type].forceY([0]); // force y-axis minimum to 0 for line chart.
         } else {
           $scope.chart[type].forceY([]);
@@ -1465,16 +1458,16 @@ angular.module('zeppelinWebApp')
         if (d3g[0].values.length > numberOfDataThreshold) {
           animationDuration = 0;
         }
-      } catch(ignoreErr) {
+      } catch (ignoreErr) {
       }
 
-      var chartEl = d3.select('#p'+$scope.paragraph.id+'_'+type+' svg')
+      var chartEl = d3.select('#p' + $scope.paragraph.id + '_' + type + ' svg')
       .attr('height', $scope.paragraph.config.graph.height)
       .datum(d3g)
       .transition()
       .duration(animationDuration)
       .call($scope.chart[type]);
-      d3.select('#p'+$scope.paragraph.id+'_'+type+' svg').style.height = height+'px';
+      d3.select('#p' + $scope.paragraph.id + '_' + type + ' svg').style.height = height + 'px';
       nv.utils.windowResize($scope.chart[type].update);
     };
 
@@ -1482,7 +1475,7 @@ angular.module('zeppelinWebApp')
       if (angular.element('#p' + $scope.paragraph.id + '_' + type + ' svg').length !== 0) {
         try {
           renderChart();
-        } catch(err) {
+        } catch (err) {
           console.log('Chart drawing error %o', err);
         }
       } else {
@@ -1494,14 +1487,13 @@ angular.module('zeppelinWebApp')
 
   $scope.isGraphMode = function(graphName) {
     var activeAppId = _.get($scope.paragraph.config, 'helium.activeApp');
-    if ($scope.getResultType() === 'TABLE' && $scope.getGraphMode()===graphName && !activeAppId) {
+    if ($scope.getResultType() === 'TABLE' && $scope.getGraphMode() === graphName && !activeAppId) {
       return true;
     } else {
       return false;
     }
   };
 
-
   $scope.onGraphOptionChange = function() {
     clearUnknownColsFromGraphOption();
     $scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
@@ -1558,8 +1550,8 @@ angular.module('zeppelinWebApp')
   /* Clear unknown columns from graph option */
   var clearUnknownColsFromGraphOption = function() {
     var unique = function(list) {
-      for (var i = 0; i<list.length; i++) {
-        for (var j=i+1; j<list.length; j++) {
+      for (var i = 0; i < list.length; i++) {
+        for (var j = i + 1; j < list.length; j++) {
           if (angular.equals(list[i], list[j])) {
             list.splice(j, 1);
           }
@@ -1568,10 +1560,10 @@ angular.module('zeppelinWebApp')
     };
 
     var removeUnknown = function(list) {
-      for (var i = 0; i<list.length; i++) {
+      for (var i = 0; i < list.length; i++) {
         // remove non existing column
         var found = false;
-        for (var j=0; j<$scope.paragraph.result.columnNames.length; j++) {
+        for (var j = 0; j < $scope.paragraph.result.columnNames.length; j++) {
           var a = list[i];
           var b = $scope.paragraph.result.columnNames[j];
           if (a.index === b.index && a.name === b.name) {
@@ -1641,60 +1633,60 @@ angular.module('zeppelinWebApp')
     var values = $scope.paragraph.config.graph.values;
 
     var aggrFunc = {
-      sum : function(a,b) {
+      sum: function(a, b) {
         var varA = (a !== undefined) ? (isNaN(a) ? 1 : parseFloat(a)) : 0;
         var varB = (b !== undefined) ? (isNaN(b) ? 1 : parseFloat(b)) : 0;
-        return varA+varB;
+        return varA + varB;
       },
-      count : function(a,b) {
+      count: function(a, b) {
         var varA = (a !== undefined) ? parseInt(a) : 0;
         var varB = (b !== undefined) ? 1 : 0;
-        return varA+varB;
+        return varA + varB;
       },
-      min : function(a,b) {
+      min: function(a, b) {
         var varA = (a !== undefined) ? (isNaN(a) ? 1 : parseFloat(a)) : 0;
         var varB = (b !== undefined) ? (isNaN(b) ? 1 : parseFloat(b)) : 0;
         return Math.min(varA,varB);
       },
-      max : function(a,b) {
+      max: function(a, b) {
         var varA = (a !== undefined) ? (isNaN(a) ? 1 : parseFloat(a)) : 0;
         var varB = (b !== undefined) ? (isNaN(b) ? 1 : parseFloat(b)) : 0;
         return Math.max(varA,varB);
       },
-      avg : function(a,b,c) {
+      avg: function(a, b, c) {
         var varA = (a !== undefined) ? (isNaN(a) ? 1 : parseFloat(a)) : 0;
         var varB = (b !== undefined) ? (isNaN(b) ? 1 : parseFloat(b)) : 0;
-        return varA+varB;
+        return varA + varB;
       }
     };
 
     var aggrFuncDiv = {
-      sum : false,
-      count : false,
-      min : false,
-      max : false,
-      avg : true
+      sum: false,
+      count: false,
+      min: false,
+      max: false,
+      avg: true
     };
 
     var schema = {};
     var rows = {};
 
-    for (var i=0; i < data.rows.length; i++) {
+    for (var i = 0; i < data.rows.length; i++) {
       var row = data.rows[i];
       var newRow = {};
       var s = schema;
       var p = rows;
 
-      for (var k=0; k < keys.length; k++) {
+      for (var k = 0; k < keys.length; k++) {
         var key = keys[k];
 
         // add key to schema
         if (!s[key.name]) {
           s[key.name] = {
-            order : k,
-            index : key.index,
-            type : 'key',
-            children : {}
+            order: k,
+            index: key.index,
+            type: 'key',
+            children: {}
           };
         }
         s = s[key.name].children;
@@ -1707,17 +1699,17 @@ angular.module('zeppelinWebApp')
         p = p[keyKey];
       }
 
-      for (var g=0; g < groups.length; g++) {
+      for (var g = 0; g < groups.length; g++) {
         var group = groups[g];
         var groupKey = row[group.index];
 
         // add group to schema
         if (!s[groupKey]) {
           s[groupKey] = {
-            order : g,
-            index : group.index,
-            type : 'group',
-            children : {}
+            order: g,
+            index: group.index,
+            type: 'group',
+            children: {}
           };
         }
         s = s[groupKey].children;
@@ -1729,29 +1721,29 @@ angular.module('zeppelinWebApp')
         p = p[groupKey];
       }
 
-      for (var v=0; v < values.length; v++) {
+      for (var v = 0; v < values.length; v++) {
         var value = values[v];
-        var valueKey = value.name+'('+value.aggr+')';
+        var valueKey = value.name + '(' + value.aggr + ')';
 
         // add value to schema
         if (!s[valueKey]) {
           s[valueKey] = {
-            type : 'value',
-            order : v,
-            index : value.index
+            type: 'value',
+            order: v,
+            index: value.index
           };
         }
 
         // add value to row
         if (!p[valueKey]) {
           p[valueKey] = {
-            value : (value.aggr !== 'count') ? row[value.index] : 1,
+            value: (value.aggr !== 'count') ? row[value.index] : 1,
             count: 1
           };
         } else {
           p[valueKey] = {
-            value : aggrFunc[value.aggr](p[valueKey].value, row[value.index], p[valueKey].count+1),
-            count : (aggrFuncDiv[value.aggr]) ?  p[valueKey].count+1 : p[valueKey].count
+            value: aggrFunc[value.aggr](p[valueKey].value, row[value.index], p[valueKey].count + 1),
+            count: (aggrFuncDiv[value.aggr]) ?  p[valueKey].count + 1 : p[valueKey].count
           };
         }
       }
@@ -1760,8 +1752,8 @@ angular.module('zeppelinWebApp')
     //console.log("schema=%o, rows=%o", schema, rows);
 
     return {
-      schema : schema,
-      rows : rows
+      schema: schema,
+      rows: rows
     };
   };
 
@@ -1777,7 +1769,7 @@ angular.module('zeppelinWebApp')
       if (!o) {
         return n;
       } else {
-        return o+'.'+n;
+        return o + '.' + n;
       }
     };
 
@@ -1791,12 +1783,12 @@ angular.module('zeppelinWebApp')
     var traverse = function(sKey, s, rKey, r, func, rowName, rowValue, colName) {
       //console.log("TRAVERSE sKey=%o, s=%o, rKey=%o, r=%o, rowName=%o, rowValue=%o, colName=%o", sKey, s, rKey, r, rowName, rowValue, colName);
 
-      if (s.type==='key') {
+      if (s.type === 'key') {
         rowName = concat(rowName, sKey);
         rowValue = concat(rowValue, rKey);
-      } else if (s.type==='group') {
+      } else if (s.type === 'group') {
         colName = concat(colName, rKey);
-      } else if (s.type==='value' && sKey===rKey || valueOnly) {
+      } else if (s.type === 'value' && sKey === rKey || valueOnly) {
         colName = concat(colName, rKey);
         func(rowName, rowValue, colName, r);
       }
@@ -1850,8 +1842,8 @@ angular.module('zeppelinWebApp')
 
         if (!d3g[i]) {
           d3g[i] = {
-            values : [],
-            key : (noKey && isMultiBarChart) ? 'values' : colName
+            values: [],
+            key: (noKey && isMultiBarChart) ? 'values' : colName
           };
         }
 
@@ -1862,8 +1854,8 @@ angular.module('zeppelinWebApp')
           yVar = isNaN(value.value) ? 0 : parseFloat(value.value) / parseFloat(value.count);
         }
         d3g[i].values.push({
-          x : xVar,
-          y : yVar
+          x: xVar,
+          y: yVar
         });
       });
     }
@@ -1890,7 +1882,7 @@ angular.module('zeppelinWebApp')
         }
 
         withoutAggr = colName.substring(0, colName.lastIndexOf('('));
-        if (namesWithoutAggr[withoutAggr] <= 1 ) {
+        if (namesWithoutAggr[withoutAggr] <= 1) {
           d3g[0].values[valueIndex].x = withoutAggr;
         }
       }
@@ -1898,7 +1890,7 @@ angular.module('zeppelinWebApp')
       for (var d3gIndex = 0; d3gIndex < d3g.length; d3gIndex++) {
         colName = d3g[d3gIndex].key;
         withoutAggr = colName.substring(0, colName.lastIndexOf('('));
-        if (namesWithoutAggr[withoutAggr] <= 1 ) {
+        if (namesWithoutAggr[withoutAggr] <= 1) {
           d3g[d3gIndex].key = withoutAggr;
         }
       }
@@ -1915,12 +1907,11 @@ angular.module('zeppelinWebApp')
     }
 
     return {
-      xLabels : rowIndexValue,
-      d3g : d3g
+      xLabels: rowIndexValue,
+      d3g: d3g
     };
   };
 
-
   var setDiscreteScatterData = function(data) {
     var xAxis = $scope.paragraph.config.graph.scatter.xAxis;
     var yAxis = $scope.paragraph.config.graph.scatter.yAxis;
@@ -1946,12 +1937,12 @@ angular.module('zeppelinWebApp')
 
       var key = xValue + ',' + yValue +  ',' + grp;
 
-      if(!rows[key]) {
+      if (!rows[key]) {
         rows[key] = {
-          x : xValue,
-          y : yValue,
-          group : grp,
-          size : 1
+          x: xValue,
+          y: yValue,
+          group: grp,
+          size: 1
         };
       } else {
         rows[key].size++;
@@ -1960,7 +1951,7 @@ angular.module('zeppelinWebApp')
 
     // change object into array
     var newRows = [];
-    for(var r in rows){
+    for (var r in rows) {
       var newRow = [];
       if (xAxis) { newRow[xAxis.index] = rows[r].x; }
       if (yAxis) { newRow[yAxis.index] = rows[r].y; }
@@ -1999,7 +1990,7 @@ angular.module('zeppelinWebApp')
 
     if (!xAxis && !yAxis) {
       return {
-        d3g : []
+        d3g: []
       };
     }
 
@@ -2050,7 +2041,7 @@ angular.module('zeppelinWebApp')
       if (group) {
         grpName = row[group.index];
       }
-      var sz = (isAllDiscrete) ? row[row.length-1] : ((size) ? row[size.index] : 1);
+      var sz = (isAllDiscrete) ? row[row.length - 1] : ((size) ? row[size.index] : 1);
 
       if (grpNameIndex[grpName] === undefined) {
         grpIndexValue[grpIdx] = grpName;
@@ -2069,22 +2060,22 @@ angular.module('zeppelinWebApp')
 
       if (!d3g[grpNameIndex[grpName]]) {
         d3g[grpNameIndex[grpName]] = {
-          key : grpName,
-          values : []
+          key: grpName,
+          values: []
         };
       }
 
       d3g[grpNameIndex[grpName]].values.push({
-        x : xAxis ? (isNaN(xValue) ? rowNameIndex[xValue] : parseFloat(xValue)) : 0,
-        y : yAxis ? (isNaN(yValue) ? colNameIndex[yValue] : parseFloat(yValue)) : 0,
-        size : isNaN(parseFloat(sz))? 1 : parseFloat(sz)
+        x: xAxis ? (isNaN(xValue) ? rowNameIndex[xValue] : parseFloat(xValue)) : 0,
+        y: yAxis ? (isNaN(yValue) ? colNameIndex[yValue] : parseFloat(yValue)) : 0,
+        size: isNaN(parseFloat(sz)) ? 1 : parseFloat(sz)
       });
     }
 
     return {
-      xLabels : rowIndexValue,
-      yLabels : colIndexValue,
-      d3g : d3g
+      xLabels: rowIndexValue,
+      yLabels: colIndexValue,
+      d3g: d3g
     };
   };
 
@@ -2095,7 +2086,7 @@ angular.module('zeppelinWebApp')
       var j = 0;
       for (var i = 0; i < f.length; i++) {
         var item = f[i];
-        if(uniqObj[item] !== 1) {
+        if (uniqObj[item] !== 1) {
           uniqObj[item] = 1;
           uniqArr[j++] = item;
         }
@@ -2104,7 +2095,7 @@ angular.module('zeppelinWebApp')
     };
 
     for (var i = 0; i < field.length; i++) {
-      if(isNaN(parseFloat(field[i])) &&
+      if (isNaN(parseFloat(field[i])) &&
          (typeof field[i] === 'string' || field[i] instanceof String)) {
         return true;
       }
@@ -2112,14 +2103,14 @@ angular.module('zeppelinWebApp')
 
     var threshold = 0.05;
     var unique = getUnique(field);
-    if (unique.length/field.length < threshold) {
+    if (unique.length / field.length < threshold) {
       return true;
     } else {
       return false;
     }
   };
 
-  $scope.isValidSizeOption = function (options, rows) {
+  $scope.isValidSizeOption = function(options, rows) {
     var xValues = [];
     var yValues = [];
 
@@ -2178,15 +2169,16 @@ angular.module('zeppelinWebApp')
     };
   }
 
-  $scope.goToSingleParagraph = function () {
+  $scope.goToSingleParagraph = function() {
     var noteId = $route.current.pathParams.noteId;
-    var redirectToUrl = location.protocol + '//' + location.host + location.pathname + '#/notebook/' + noteId + '/paragraph/' + $scope.paragraph.id+'?asIframe';
+    var redirectToUrl = location.protocol + '//' + location.host + location.pathname + '#/notebook/' + noteId +
+      '/paragraph/' + $scope.paragraph.id + '?asIframe';
     $window.open(redirectToUrl);
   };
 
-  $scope.showScrollDownIcon = function(){
+  $scope.showScrollDownIcon = function() {
     var doc = angular.element('#p' + $scope.paragraph.id + '_text');
-    if(doc[0]){
+    if (doc[0]) {
       return doc[0].scrollHeight > doc.innerHeight();
     }
     return false;
@@ -2198,8 +2190,8 @@ angular.module('zeppelinWebApp')
     $scope.keepScrollDown = true;
   };
 
-  $scope.showScrollUpIcon = function(){
-    if(angular.element('#p' + $scope.paragraph.id + '_text')[0]){
+  $scope.showScrollUpIcon = function() {
+    if (angular.element('#p' + $scope.paragraph.id + '_text')[0]) {
       return angular.element('#p' + $scope.paragraph.id + '_text')[0].scrollTop !== 0;
     }
     return false;
@@ -2212,7 +2204,7 @@ angular.module('zeppelinWebApp')
     $scope.keepScrollDown = false;
   };
 
-  $scope.exportToDSV = function (delimiter) {
+  $scope.exportToDSV = function(delimiter) {
     var data = $scope.paragraph.result;
     var dsv = '';
     for (var titleIndex in $scope.paragraph.result.columnNames) {
@@ -2245,7 +2237,7 @@ angular.module('zeppelinWebApp')
   $scope.suggestion = {};
 
   $scope.switchApp = function(appId) {
-    var app = _.find($scope.apps, { id : appId });
+    var app = _.find($scope.apps, {id: appId});
     var config = $scope.paragraph.config;
     var settings = $scope.paragraph.settings;
 
@@ -2281,7 +2273,7 @@ angular.module('zeppelinWebApp')
 
     // Display ApplicationState
     if (paragraph.apps) {
-      _.forEach(paragraph.apps, function (app) {
+      _.forEach(paragraph.apps, function(app) {
         appStates.push({
           id: app.id,
           pkg: app.pkg,
@@ -2293,7 +2285,7 @@ angular.module('zeppelinWebApp')
 
     // update or remove app states no longer exists
     _.forEach($scope.apps, function(currentAppState, idx) {
-      var newAppState = _.find(appStates, { id : currentAppState.id });
+      var newAppState = _.find(appStates, {id: currentAppState.id});
       if (newAppState) {
         angular.extend($scope.apps[idx], newAppState);
       } else {
@@ -2347,7 +2339,7 @@ angular.module('zeppelinWebApp')
           console.log('renderApp %o', appState);
           targetEl.html(appState.output);
           $compile(targetEl.contents())(getAppScope(appState));
-        } catch(err) {
+        } catch (err) {
           console.log('App rendering error %o', err);
         }
       } else {
@@ -2359,11 +2351,11 @@ angular.module('zeppelinWebApp')
 
   $scope.$on('appendAppOutput', function(event, data) {
     if ($scope.paragraph.id === data.paragraphId) {
-      var app = _.find($scope.apps, { id : data.appId });
+      var app = _.find($scope.apps, {id: data.appId});
       if (app) {
         app.output += data.data;
 
-        var paragraphAppState = _.find($scope.paragraph.apps, { id : data.appId });
+        var paragraphAppState = _.find($scope.paragraph.apps, {id: data.appId});
         paragraphAppState.output = app.output;
 
         var targetEl = angular.element(document.getElementById('p' + app.id));
@@ -2376,11 +2368,11 @@ angular.module('zeppelinWebApp')
 
   $scope.$on('updateAppOutput', function(event, data) {
     if ($scope.paragraph.id === data.paragraphId) {
-      var app = _.find($scope.apps, { id : data.appId });
+      var app = _.find($scope.apps, {id: data.appId});
       if (app) {
         app.output = data.data;
 
-        var paragraphAppState = _.find($scope.paragraph.apps, { id : data.appId });
+        var paragraphAppState = _.find($scope.paragraph.apps, {id: data.appId});
         paragraphAppState.output = app.output;
 
         var targetEl = angular.element(document.getElementById('p' + app.id));
@@ -2414,9 +2406,10 @@ angular.module('zeppelinWebApp')
       var app = _.find($scope.apps, {id: data.appId});
       if (app) {
         app.status = data.status;
-        var paragraphAppState = _.find($scope.paragraph.apps, { id : data.appId });
+        var paragraphAppState = _.find($scope.paragraph.apps, {id: data.appId});
         paragraphAppState.status = app.status;
       }
     }
   });
 });
+

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/app/search/result-list.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/search/result-list.controller.js b/zeppelin-web/src/app/search/result-list.controller.js
index 2edf9f5..1cda335 100644
--- a/zeppelin-web/src/app/search/result-list.controller.js
+++ b/zeppelin-web/src/app/search/result-list.controller.js
@@ -18,11 +18,11 @@ angular
   .module('zeppelinWebApp')
   .controller('SearchResultCtrl', function($scope, $routeParams, searchService) {
 
-  $scope.isResult = true ;
-  $scope.searchTerm = $routeParams.searchTerm;
-  var results = searchService.search({'q': $routeParams.searchTerm}).query();
+    $scope.isResult = true ;
+    $scope.searchTerm = $routeParams.searchTerm;
+    var results = searchService.search({'q': $routeParams.searchTerm}).query();
 
-  results.$promise.then(function(result) {
+    results.$promise.then(function(result) {
     $scope.notes = result.body.map(function(note) {
       // redirect to notebook when search result is a notebook itself,
       // not a paragraph
@@ -42,17 +42,17 @@ angular
       $scope.isResult = true;
     }
 
-  $scope.$on('$routeChangeStart', function (event, next, current) {
+    $scope.$on('$routeChangeStart', function(event, next, current) {
       if (next.originalPath !== '/search/:searchTerm') {
         searchService.searchTerm = '';
       }
     });
   });
 
-  $scope.page = 0;
-  $scope.allResults = false;
+    $scope.page = 0;
+    $scope.allResults = false;
 
-  $scope.highlightSearchResults = function(note) {
+    $scope.highlightSearchResults = function(note) {
     return function(_editor) {
       function getEditorMode(text) {
         var editorModes = {
@@ -65,7 +65,7 @@ angular
         };
 
         return Object.keys(editorModes).reduce(function(res, mode) {
-          return editorModes[mode].test(text)? mode : res;
+          return editorModes[mode].test(text) ? mode : res;
         }, 'ace/mode/scala');
       }
 
@@ -82,7 +82,7 @@ angular
         return function(str) {
           var indeces = [];
           var i = -1;
-          while((i = str.indexOf(term, i + 1)) >= 0) {
+          while ((i = str.indexOf(term, i + 1)) >= 0) {
             indeces.push(i);
           }
           return indeces;
@@ -155,4 +155,4 @@ angular
     };
   };
 
-});
+  });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js b/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
index da9da18..00f827b 100644
--- a/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
+++ b/zeppelin-web/src/components/arrayOrderingSrv/arrayOrdering.service.js
@@ -22,8 +22,8 @@ angular.module('zeppelinWebApp').service('arrayOrderingSrv', function() {
   };
 
   this.getNoteName = function(note) {
-    if(note.name === undefined || note.name.trim() === '') {
-      return'Note ' + note.id;
+    if (note.name === undefined || note.name.trim() === '') {
+      return 'Note ' + note.id;
     } else {
       return note.name;
     }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/baseUrl/baseUrl.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/baseUrl/baseUrl.service.js b/zeppelin-web/src/components/baseUrl/baseUrl.service.js
index f06eef3..656df63 100644
--- a/zeppelin-web/src/components/baseUrl/baseUrl.service.js
+++ b/zeppelin-web/src/components/baseUrl/baseUrl.service.js
@@ -36,7 +36,8 @@ angular.module('zeppelinWebApp').service('baseUrlSrv', function() {
   };
 
   this.getRestApiBase = function() {
-    return location.protocol + '//' + location.hostname + ':' + this.getPort() + skipTrailingSlash(location.pathname) + '/api';
+    return location.protocol + '//' + location.hostname + ':' + this.getPort() + skipTrailingSlash(location.pathname) +
+      '/api';
   };
 
   var skipTrailingSlash = function(path) {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js b/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js
index 65dd5d3..6095da6 100644
--- a/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js
+++ b/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js
@@ -13,13 +13,13 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').directive('dropdownInput', function () {
-    return {
-        restrict: 'A',
-        link: function (scope, element) {
-            element.bind('click', function (event) {
-                event.stopPropagation();
-            });
-        }
-    };
+angular.module('zeppelinWebApp').directive('dropdownInput', function() {
+  return {
+    restrict: 'A',
+    link: function(scope, element) {
+      element.bind('click', function(event) {
+        event.stopPropagation();
+      });
+    }
+  };
 });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/expandCollapse/expandCollapse.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/expandCollapse/expandCollapse.directive.js b/zeppelin-web/src/components/expandCollapse/expandCollapse.directive.js
index ec40175..1c83188 100644
--- a/zeppelin-web/src/components/expandCollapse/expandCollapse.directive.js
+++ b/zeppelin-web/src/components/expandCollapse/expandCollapse.directive.js
@@ -16,18 +16,18 @@
 angular.module('zeppelinWebApp').directive('expandCollapse', function() {
   return {
           restrict: 'EA',
-          link: function(scope, element, attrs){
-            angular.element(element).click( function(event) {
-              if(angular.element(element).find('.expandable:visible').length > 1) {
+          link: function(scope, element, attrs) {
+            angular.element(element).click(function(event) {
+              if (angular.element(element).find('.expandable:visible').length > 1) {
                 angular.element(element).find('.expandable:visible').slideUp('slow');
                 angular.element(element).find('i.icon-folder-alt').toggleClass('icon-folder icon-folder-alt');
-            	} else {
+              } else {
                 angular.element(element).find('.expandable').first().slideToggle('200',function() {
                   angular.element(element).find('i').first().toggleClass('icon-folder icon-folder-alt');
                 });
               }
               event.stopPropagation();
-       		  });
+            });
           }
         };
 });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/navbar/navbar.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js b/zeppelin-web/src/components/navbar/navbar.controller.js
index 702a257..89faada 100644
--- a/zeppelin-web/src/components/navbar/navbar.controller.js
+++ b/zeppelin-web/src/components/navbar/navbar.controller.js
@@ -18,7 +18,7 @@ angular.module('zeppelinWebApp')
 .controller('NavCtrl', function($scope, $rootScope, $http, $routeParams,
     $location, notebookListDataFactory, baseUrlSrv, websocketMsgSrv, arrayOrderingSrv, searchService) {
 
-  $scope.query = {q : '' };
+  $scope.query = {q: ''};
   /** Current list of notes (ids) */
 
   $scope.showLoginWindow = function() {
@@ -36,7 +36,7 @@ angular.module('zeppelinWebApp')
 
   angular.element('#notebook-list').perfectScrollbar({suppressScrollX: true});
 
-  angular.element(document).click(function(){
+  angular.element(document).click(function() {
     $scope.query.q = '';
   });
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/noteName-create/notename.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/noteName-create/notename.controller.js b/zeppelin-web/src/components/noteName-create/notename.controller.js
index 6965134..9a01cfd 100644
--- a/zeppelin-web/src/components/noteName-create/notename.controller.js
+++ b/zeppelin-web/src/components/noteName-create/notename.controller.js
@@ -23,15 +23,15 @@ angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, not
   $scope.note = {};
 
   vm.createNote = function() {
-      if (!vm.clone) {
-        vm.websocketMsgSrv.createNotebook($scope.note.notename);
-      } else {
-       var noteId = $routeParams.noteId;
-       vm.websocketMsgSrv.cloneNotebook(noteId, $scope.note.notename);
-      }
+    if (!vm.clone) {
+      vm.websocketMsgSrv.createNotebook($scope.note.notename);
+    } else {
+      var noteId = $routeParams.noteId;
+      vm.websocketMsgSrv.cloneNotebook(noteId, $scope.note.notename);
+    }
   };
 
-  vm.handleNameEnter = function(){
+  vm.handleNameEnter = function() {
     angular.element('#noteNameModal').modal('toggle');
     vm.createNote();
   };
@@ -42,9 +42,9 @@ angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, not
     $scope.$apply();
   };
 
-  vm.newNoteName = function () {
+  vm.newNoteName = function() {
     var newCount = 1;
-    angular.forEach(vm.notes.flatList, function (noteName) {
+    angular.forEach(vm.notes.flatList, function(noteName) {
       noteName = noteName.name;
       if (noteName.match(/^Untitled Note [0-9]*$/)) {
         var lastCount = noteName.substr(14) * 1;

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/noteName-create/visible.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/noteName-create/visible.directive.js b/zeppelin-web/src/components/noteName-create/visible.directive.js
index 3c15dcb..d0fe977 100644
--- a/zeppelin-web/src/components/noteName-create/visible.directive.js
+++ b/zeppelin-web/src/components/noteName-create/visible.directive.js
@@ -13,30 +13,30 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').directive('modalvisible', function () {
-    return {
-        restrict: 'A',
-        scope: {
-	        	preVisibleCallback: '&previsiblecallback',
-	        	postVisibleCallback: '&postvisiblecallback',
-	        	targetinput: '@targetinput'
-        	   },
-        link: function(scope, elem, attrs) {
-        	// Add some listeners
-    		var previsibleMethod = scope.preVisibleCallback;
-    		var postVisibleMethod = scope.postVisibleCallback;
-    		elem.on('show.bs.modal',function(e) {
-    			var relatedTgt = angular.element(e.relatedTarget);
-    			var clone = relatedTgt.data('clone');
-    			var cloneNote = clone ? true : false;
-    			previsibleMethod()(cloneNote);
-    		});
-    		elem.on('shown.bs.modal', function(e) {
-    			if(scope.targetinput) {
-    			  angular.element(e.target).find('input#' + scope.targetinput ).select();
-    			}
-    			postVisibleMethod();
-    		});
+angular.module('zeppelinWebApp').directive('modalvisible', function() {
+  return {
+    restrict: 'A',
+    scope: {
+      preVisibleCallback: '&previsiblecallback',
+      postVisibleCallback: '&postvisiblecallback',
+      targetinput: '@targetinput'
+    },
+    link: function(scope, elem, attrs) {
+      // Add some listeners
+      var previsibleMethod = scope.preVisibleCallback;
+      var postVisibleMethod = scope.postVisibleCallback;
+      elem.on('show.bs.modal',function(e) {
+        var relatedTgt = angular.element(e.relatedTarget);
+        var clone = relatedTgt.data('clone');
+        var cloneNote = clone ? true : false;
+        previsibleMethod()(cloneNote);
+      });
+      elem.on('shown.bs.modal', function(e) {
+        if (scope.targetinput) {
+          angular.element(e.target).find('input#' + scope.targetinput).select();
         }
-    };
+        postVisibleMethod();
+      });
+    }
+  };
 });

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/noteName-import/notenameImport.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/noteName-import/notenameImport.controller.js b/zeppelin-web/src/components/noteName-import/notenameImport.controller.js
index d48179d..766064f 100644
--- a/zeppelin-web/src/components/noteName-import/notenameImport.controller.js
+++ b/zeppelin-web/src/components/noteName-import/notenameImport.controller.js
@@ -71,8 +71,7 @@ angular.module('zeppelinWebApp').controller('NoteImportCtrl', function($scope, $
         $scope.note.errorText = 'Unable to Fetch URL';
         $scope.$apply();
       });
-    }
-    else {
+    } else {
       $scope.note.errorText = 'Enter URL';
       $scope.$apply();
     }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js b/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
index 91aa7be..730ea09 100644
--- a/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
+++ b/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
@@ -40,8 +40,8 @@ angular.module('zeppelinWebApp').factory('notebookListDataFactory', function() {
   var addNode = function(curDir, nodes, noteId) {
     if (nodes.length === 1) {  // the leaf
       curDir.children.push({
-        name : nodes[0],
-        id : noteId
+        name: nodes[0],
+        id: noteId
       });
     } else {  // a folder node
       var node = nodes.shift();
@@ -51,9 +51,9 @@ angular.module('zeppelinWebApp').factory('notebookListDataFactory', function() {
         addNode(dir, nodes, noteId);
       } else {
         var newDir = {
-          name : node,
-          hidden : true,
-          children : []
+          name: node,
+          hidden: true,
+          children: []
         };
         curDir.children.push(newDir);
         addNode(newDir, nodes, noteId);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/popover-html-unsafe/popover-html-unsafe.directive.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/popover-html-unsafe/popover-html-unsafe.directive.js b/zeppelin-web/src/components/popover-html-unsafe/popover-html-unsafe.directive.js
index 3e405dc..274e011 100644
--- a/zeppelin-web/src/components/popover-html-unsafe/popover-html-unsafe.directive.js
+++ b/zeppelin-web/src/components/popover-html-unsafe/popover-html-unsafe.directive.js
@@ -18,7 +18,7 @@ angular.module('zeppelinWebApp')
     return {
       restrict: 'EA',
       replace: true,
-      scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&' },
+      scope: {title: '@', content: '@', placement: '@', animation: '&', isOpen: '&'},
       templateUrl: 'components/popover-html-unsafe/popover-html-unsafe-popup.html'
     };
   })

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/searchService/search.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/searchService/search.service.js b/zeppelin-web/src/components/searchService/search.service.js
index d026404..a2bc7cf 100644
--- a/zeppelin-web/src/components/searchService/search.service.js
+++ b/zeppelin-web/src/components/searchService/search.service.js
@@ -17,13 +17,13 @@ angular.module('zeppelinWebApp').service('searchService', function($resource, ba
 
   this.search = function(term) {
     this.searchTerm = term.q;
-     console.log('Searching for: %o', term.q);
+    console.log('Searching for: %o', term.q);
     if (!term.q) { //TODO(bzz): empty string check
       return;
     }
     var encQuery = window.encodeURIComponent(term.q);
-    return $resource(baseUrlSrv.getRestApiBase()+'/notebook/search?q='+encQuery, {}, {
-      query: {method:'GET'}
+    return $resource(baseUrlSrv.getRestApiBase() + '/notebook/search?q=' + encQuery, {}, {
+      query: {method: 'GET'}
     });
   };
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
index 47bc854..4175818 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
@@ -13,7 +13,8 @@
  */
 'use strict';
 
-angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope, $websocket, $location, $window, baseUrlSrv) {
+angular.module('zeppelinWebApp').factory('websocketEvents',
+  function($rootScope, $websocket, $location, $window, baseUrlSrv) {
   var websocketCalls = {};
 
   websocketCalls.ws = $websocket(baseUrlSrv.getWebsocketUrl());
@@ -22,7 +23,7 @@ angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope,
   websocketCalls.ws.onOpen(function() {
     console.log('Websocket created');
     $rootScope.$broadcast('setConnectedStatus', true);
-    setInterval(function(){
+    setInterval(function() {
       websocketCalls.sendNewEvent({op: 'PING'});
     }, 10000);
   });
@@ -65,26 +66,26 @@ angular.module('zeppelinWebApp').factory('websocketEvents', function($rootScope,
       $rootScope.$broadcast('setUpdateNotebookJobs', data.notebookRunningJobs);
     } else if (op === 'AUTH_INFO') {
       BootstrapDialog.show({
-          closable: false,
-          closeByBackdrop: false,
-          closeByKeyboard: false,
-          title: 'Insufficient privileges', 
-          message: data.info.toString(),
-          buttons: [{
-              label: 'Login',
-              action: function(dialog) {
-                  dialog.close();
-                  angular.element('#loginModal').modal({
+        closable: false,
+        closeByBackdrop: false,
+        closeByKeyboard: false,
+        title: 'Insufficient privileges',
+        message: data.info.toString(),
+        buttons: [{
+          label: 'Login',
+          action: function(dialog) {
+            dialog.close();
+            angular.element('#loginModal').modal({
                     show: 'true'
                   });
-              }
-          }, {
-              label: 'Cancel',
-              action: function(dialog) {
-                  dialog.close();
-                  $window.location.replace('/');
-              }
-          }]
+          }
+        }, {
+          label: 'Cancel',
+          action: function(dialog) {
+            dialog.close();
+            $window.location.replace('/');
+          }
+        }]
       });
     } else if (op === 'PARAGRAPH') {
       $rootScope.$broadcast('updateParagraph', data);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
index b636f0f..698b8ff 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
@@ -29,7 +29,7 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
       websocketEvents.sendNewEvent({op: 'DEL_NOTE', data: {id: noteId}});
     },
 
-    cloneNotebook: function(noteIdToClone, newNoteName ) {
+    cloneNotebook: function(noteIdToClone, newNoteName) {
       websocketEvents.sendNewEvent({op: 'CLONE_NOTE', data: {id: noteIdToClone, name: newNoteName}});
     },
 
@@ -46,15 +46,15 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
     },
 
     updateNotebook: function(noteId, noteName, noteConfig) {
-      websocketEvents.sendNewEvent({op: 'NOTE_UPDATE', data: {id: noteId, name: noteName, config : noteConfig}});
+      websocketEvents.sendNewEvent({op: 'NOTE_UPDATE', data: {id: noteId, name: noteName, config: noteConfig}});
     },
 
     moveParagraph: function(paragraphId, newIndex) {
-      websocketEvents.sendNewEvent({ op: 'MOVE_PARAGRAPH', data : {id: paragraphId, index: newIndex}});
+      websocketEvents.sendNewEvent({op: 'MOVE_PARAGRAPH', data: {id: paragraphId, index: newIndex}});
     },
 
     insertParagraph: function(newIndex) {
-      websocketEvents.sendNewEvent({ op: 'INSERT_PARAGRAPH', data : {index: newIndex}});
+      websocketEvents.sendNewEvent({op: 'INSERT_PARAGRAPH', data: {index: newIndex}});
     },
 
     updateAngularObject: function(noteId, paragraphId, name, value, interpreterGroupId) {
@@ -120,11 +120,11 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
 
     completion: function(paragraphId, buf, cursor) {
       websocketEvents.sendNewEvent({
-        op : 'COMPLETION',
-        data : {
-          id : paragraphId,
-          buf : buf,
-          cursor : cursor
+        op: 'COMPLETION',
+        data: {
+          id: paragraphId,
+          buf: buf,
+          cursor: cursor
         }
       });
     },
@@ -134,7 +134,7 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
         op: 'COMMIT_PARAGRAPH',
         data: {
           id: paragraphId,
-          title : paragraphTitle,
+          title: paragraphTitle,
           paragraph: paragraphData,
           config: paragraphConfig,
           params: paragraphParams
@@ -161,7 +161,7 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
       });
     },
 
-    isConnected: function(){
+    isConnected: function() {
       return websocketEvents.isConnected();
     },
 
@@ -171,7 +171,7 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
 
     getUpdateNotebookJobsList: function(lastUpdateServerUnixTime) {
       websocketEvents.sendNewEvent(
-        {op: 'LIST_UPDATE_NOTEBOOK_JOBS', data : {lastUpdateUnixTime : lastUpdateServerUnixTime*1}}
+        {op: 'LIST_UPDATE_NOTEBOOK_JOBS', data: {lastUpdateUnixTime: lastUpdateServerUnixTime * 1}}
       );
     },
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/test/spec/controllers/nav.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/test/spec/controllers/nav.js b/zeppelin-web/test/spec/controllers/nav.js
index 9bbfbe3..8b5e0a4 100644
--- a/zeppelin-web/test/spec/controllers/nav.js
+++ b/zeppelin-web/test/spec/controllers/nav.js
@@ -2,7 +2,8 @@
 describe('Controller: NavCtrl', function() {
   // load the controller's module
   beforeEach(module('zeppelinWebApp'));
-  var NavCtrl, scope;
+  var NavCtrl;
+  var scope;
   // Initialize the controller and a mock scope
   beforeEach(inject(function($controller, $rootScope) {
     scope = $rootScope.$new();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/test/spec/controllers/notebook.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/test/spec/controllers/notebook.js b/zeppelin-web/test/spec/controllers/notebook.js
index 5afa628..317a905 100644
--- a/zeppelin-web/test/spec/controllers/notebook.js
+++ b/zeppelin-web/test/spec/controllers/notebook.js
@@ -103,4 +103,4 @@ describe('Controller: NotebookCtrl', function() {
     expect(scope.saveTimer).toEqual(null);
   });
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/test/spec/controllers/paragraph.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/test/spec/controllers/paragraph.js b/zeppelin-web/test/spec/controllers/paragraph.js
index 77fc495..31f8dc7 100644
--- a/zeppelin-web/test/spec/controllers/paragraph.js
+++ b/zeppelin-web/test/spec/controllers/paragraph.js
@@ -11,9 +11,9 @@ describe('Controller: ParagraphCtrl', function() {
     config: {}
   };
   var route = {
-    current : {
-      pathParams : {
-        noteId : 'noteId'
+    current: {
+      pathParams: {
+        noteId: 'noteId'
       }
     }
   };
@@ -60,17 +60,18 @@ describe('Controller: ParagraphCtrl', function() {
     expect(scope.paragraphFocused).toEqual(false);
   });
 
-  it('should call loadTableData() and getGraphMode() should return "table" when the result type is "TABLE"', function() {
-    scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
-      return 'TABLE';
+  it('should call loadTableData() and getGraphMode() should return "table" when the result type is "TABLE"',
+    function() {
+      scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {
+        return 'TABLE';
+      });
+      spyOn(scope, 'loadTableData');
+      spyOn(scope, 'setGraphMode');
+      scope.init(paragraphMock);
+      expect(scope.loadTableData).toHaveBeenCalled();
+      expect(scope.setGraphMode).toHaveBeenCalled();
+      expect(scope.getGraphMode()).toEqual('table');
     });
-    spyOn(scope, 'loadTableData');
-    spyOn(scope, 'setGraphMode');
-    scope.init(paragraphMock);
-    expect(scope.loadTableData).toHaveBeenCalled();
-    expect(scope.setGraphMode).toHaveBeenCalled();
-    expect(scope.getGraphMode()).toEqual('table');
-  });
 
   it('should call renderHtml() when the result type is "HTML"', function() {
     scope.getResultType = jasmine.createSpy('getResultType spy').andCallFake(function() {

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/test/spec/directives/ngenter.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/test/spec/directives/ngenter.js b/zeppelin-web/test/spec/directives/ngenter.js
index dc2136d..56f75cb 100644
--- a/zeppelin-web/test/spec/directives/ngenter.js
+++ b/zeppelin-web/test/spec/directives/ngenter.js
@@ -1,28 +1,28 @@
 'use strict';
 
-describe('Directive: ngEnter', function () {
+describe('Directive: ngEnter', function() {
 
   // load the directive's module
   beforeEach(module('zeppelinWebApp'));
 
-  var element,
-    scope;
+  var element;
+  var scope;
 
-  beforeEach(inject(function ($rootScope) {
+  beforeEach(inject(function($rootScope) {
     scope = $rootScope.$new();
   }));
 
-  it('should be define', inject(function ($compile) {
+  it('should be define', inject(function($compile) {
     element = angular.element('<ng-enter></ng-enter>');
     element = $compile(element)(scope);
     expect(element.text()).toBeDefined();
   }));
 
   //Test the rest of function in ngEnter
-/*  it('should make hidden element visible', inject(function ($compile) {
-    element = angular.element('<ng-enter></ng-enter>');
-    element = $compile(element)(scope);
-    expect(element.text()).toBe('this is the ngEnter directive');
-  }));*/
+  /*  it('should make hidden element visible', inject(function ($compile) {
+      element = angular.element('<ng-enter></ng-enter>');
+      element = $compile(element)(scope);
+      expect(element.text()).toBe('this is the ngEnter directive');
+    }));*/
 });
 

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/5556f815/zeppelin-web/test/spec/factory/notebookList.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/test/spec/factory/notebookList.js b/zeppelin-web/test/spec/factory/notebookList.js
index 10c6981..e411f28 100644
--- a/zeppelin-web/test/spec/factory/notebookList.js
+++ b/zeppelin-web/test/spec/factory/notebookList.js
@@ -4,10 +4,10 @@ describe('Factory: NotebookList', function() {
 
   var notebookList;
 
-  beforeEach(function () {
+  beforeEach(function() {
     module('zeppelinWebApp');
 
-    inject(function ($injector) {
+    inject(function($injector) {
       notebookList = $injector.get('notebookListDataFactory');
     });
   });
@@ -22,7 +22,7 @@ describe('Factory: NotebookList', function() {
       {name: '/C/CB/CBA', id: '000006'},  // same name with a dir
       {name: '/C/CB/CBA', id: '000007'},  // same name with another note
       {name: 'C///CB//CBB', id: '000008'},
-      {name: 'D/D[A/DA]B', id:'000009'}   // check if '[' and ']' considered as folder seperator      
+      {name: 'D/D[A/DA]B', id: '000009'}   // check if '[' and ']' considered as folder seperator
     ];
     notebookList.setNotes(notesList);
 


[2/2] zeppelin git commit: [ZEPPELIN-235] jscs in zeppelin-web

Posted by pr...@apache.org.
[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 <pr...@gmail.com>

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 <pr...@gmail.com>
Authored: Thu Jul 7 22:31:59 2016 +0530
Committer: Prabhjyot Singh <pr...@gmail.com>
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();
   });
 
 });
+