';
html += ' ';
html += ' ';
for (var c in $scope.paragraph.result.columnNames) {
- html += '| '+$scope.paragraph.result.columnNames[c].name+' | ';
+ html += '' + $scope.paragraph.result.columnNames[c].name + ' | ';
}
html += '
';
html += ' ';
@@ -813,10 +811,10 @@ angular.module('zeppelinWebApp')
var v = row[index].value;
if (getTableContentFormat(v) !== 'html') {
v = v.replace(/[\u00A0-\u9999<>\&]/gim, function(i) {
- return ''+i.charCodeAt(0)+';';
+ return '' + i.charCodeAt(0) + ';';
});
}
- html += ' '+formatTableContent(v)+' | ';
+ html += ' ' + formatTableContent(v) + ' | ';
}
html += ' ';
}
@@ -828,14 +826,14 @@ angular.module('zeppelinWebApp')
// set table height
var height = $scope.paragraph.config.graph.height;
- $('#p'+$scope.paragraph.id+'_table').height(height);
+ $('#p' + $scope.paragraph.id + '_table').height(height);
};
var retryRenderer = function() {
- if ($('#p'+$scope.paragraph.id+'_table').length) {
+ if ($('#p' + $scope.paragraph.id + '_table').length) {
try {
renderTable();
- } catch(err) {
+ } catch (err) {
console.log('Chart drawing error %o', err);
}
} else {
@@ -846,7 +844,7 @@ angular.module('zeppelinWebApp')
};
- var setD3Chart = function(type, data, refresh) {
+ var setD3Chart = function(type, data, refresh) {
if (!$scope.chart[type]) {
var chart = nv.models[type]();
$scope.chart[type] = chart;
@@ -902,12 +900,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 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
});
}
}
@@ -946,24 +944,24 @@ 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);
};
var retryRenderer = function() {
- if ($('#p'+$scope.paragraph.id+'_'+type+' svg').length !== 0) {
+ if ($('#p' + $scope.paragraph.id + '_' + type + ' svg').length !== 0) {
try {
renderChart();
- } catch(err) {
+ } catch (err) {
console.log('Chart drawing error %o', err);
}
} else {
@@ -973,73 +971,72 @@ angular.module('zeppelinWebApp')
$timeout(retryRenderer);
};
- $scope.isGraphMode = function(graphName) {
- if ($scope.getResultType() === 'TABLE' && $scope.getGraphMode()===graphName) {
+ $scope.isGraphMode = function(graphName) {
+ if ($scope.getResultType() === 'TABLE' && $scope.getGraphMode() === graphName) {
return true;
} else {
return false;
}
};
-
- $scope.onGraphOptionChange = function() {
+ $scope.onGraphOptionChange = function() {
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeGraphOptionKeys = function(idx) {
+ $scope.removeGraphOptionKeys = function(idx) {
$scope.paragraph.config.graph.keys.splice(idx, 1);
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeGraphOptionValues = function(idx) {
+ $scope.removeGraphOptionValues = function(idx) {
$scope.paragraph.config.graph.values.splice(idx, 1);
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeGraphOptionGroups = function(idx) {
+ $scope.removeGraphOptionGroups = function(idx) {
$scope.paragraph.config.graph.groups.splice(idx, 1);
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.setGraphOptionValueAggr = function(idx, aggr) {
+ $scope.setGraphOptionValueAggr = function(idx, aggr) {
$scope.paragraph.config.graph.values[idx].aggr = aggr;
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeScatterOptionXaxis = function(idx) {
+ $scope.removeScatterOptionXaxis = function(idx) {
$scope.paragraph.config.graph.scatter.xAxis = null;
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeScatterOptionYaxis = function(idx) {
+ $scope.removeScatterOptionYaxis = function(idx) {
$scope.paragraph.config.graph.scatter.yAxis = null;
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeScatterOptionGroup = function(idx) {
+ $scope.removeScatterOptionGroup = function(idx) {
$scope.paragraph.config.graph.scatter.group = null;
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- $scope.removeScatterOptionSize = function(idx) {
+ $scope.removeScatterOptionSize = function(idx) {
$scope.paragraph.config.graph.scatter.size = null;
clearUnknownColsFromGraphOption();
$scope.setGraphMode($scope.paragraph.config.graph.mode, true, false);
};
- /* Clear unknown columns from graph option */
- var clearUnknownColsFromGraphOption = function() {
+ /* Clear unknown columns from graph option */
+ var clearUnknownColsFromGraphOption = function() {
var unique = function(list) {
- for (var i = 0; i 0) {
$scope.paragraph.config.graph.keys.push($scope.paragraph.result.columnNames[0]);
}
@@ -1115,66 +1112,66 @@ angular.module('zeppelinWebApp')
}
};
- var pivot = function(data) {
+ var pivot = function(data) {
var keys = $scope.paragraph.config.graph.keys;
var groups = $scope.paragraph.config.graph.groups;
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;
@@ -1187,17 +1184,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;
@@ -1209,29 +1206,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
};
}
}
@@ -1240,12 +1237,12 @@ angular.module('zeppelinWebApp')
//console.log("schema=%o, rows=%o", schema, rows);
return {
- schema : schema,
- rows : rows
+ schema: schema,
+ rows: rows
};
};
- var pivotDataToD3ChartFormat = function(data, allowTextXAxis, fillMissingValues, chartType) {
+ var pivotDataToD3ChartFormat = function(data, allowTextXAxis, fillMissingValues, chartType) {
// construct d3 data
var d3g = [];
@@ -1257,7 +1254,7 @@ angular.module('zeppelinWebApp')
if (!o) {
return n;
} else {
- return o+'.'+n;
+ return o + '.' + n;
}
};
@@ -1271,12 +1268,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);
}
@@ -1330,8 +1327,8 @@ angular.module('zeppelinWebApp')
if (!d3g[i]) {
d3g[i] = {
- values : [],
- key : (noKey && isMultiBarChart) ? 'values' : colName
+ values: [],
+ key: (noKey && isMultiBarChart) ? 'values' : colName
};
}
@@ -1342,8 +1339,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
});
});
}
@@ -1370,7 +1367,7 @@ angular.module('zeppelinWebApp')
}
withoutAggr = colName.substring(0, colName.lastIndexOf('('));
- if (namesWithoutAggr[withoutAggr] <= 1 ) {
+ if (namesWithoutAggr[withoutAggr] <= 1) {
d3g[0].values[valueIndex].x = withoutAggr;
}
}
@@ -1378,7 +1375,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;
}
}
@@ -1395,13 +1392,12 @@ angular.module('zeppelinWebApp')
}
return {
- xLabels : rowIndexValue,
- d3g : d3g
+ xLabels: rowIndexValue,
+ d3g: d3g
};
};
-
- var setDiscreteScatterData = function(data) {
+ var setDiscreteScatterData = function(data) {
var xAxis = $scope.paragraph.config.graph.scatter.xAxis;
var yAxis = $scope.paragraph.config.graph.scatter.yAxis;
var group = $scope.paragraph.config.graph.scatter.group;
@@ -1426,12 +1422,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++;
@@ -1440,7 +1436,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; }
@@ -1451,7 +1447,7 @@ angular.module('zeppelinWebApp')
return newRows;
};
- var setScatterChart = function(data, refresh) {
+ var setScatterChart = function(data, refresh) {
var xAxis = $scope.paragraph.config.graph.scatter.xAxis;
var yAxis = $scope.paragraph.config.graph.scatter.yAxis;
var group = $scope.paragraph.config.graph.scatter.group;
@@ -1479,7 +1475,7 @@ angular.module('zeppelinWebApp')
if (!xAxis && !yAxis) {
return {
- d3g : []
+ d3g: []
};
}
@@ -1530,7 +1526,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;
@@ -1549,33 +1545,33 @@ 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
};
};
- var isDiscrete = function(field) {
+ var isDiscrete = function(field) {
var getUnique = function(f) {
var uniqObj = {};
var uniqArr = [];
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;
}
@@ -1584,7 +1580,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;
}
@@ -1592,14 +1588,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 = [];
@@ -1634,8 +1630,8 @@ angular.module('zeppelinWebApp')
return true;
};
- $scope.setGraphHeight = function() {
- var height = $('#p'+$scope.paragraph.id+'_graph').height();
+ $scope.setGraphHeight = function() {
+ var height = $('#p' + $scope.paragraph.id + '_graph').height();
var newParams = angular.copy($scope.paragraph.settings.params);
var newConfig = angular.copy($scope.paragraph.config);
@@ -1645,16 +1641,17 @@ angular.module('zeppelinWebApp')
commitParagraph($scope.paragraph.title, $scope.paragraph.text, newConfig, newParams);
};
- /** Utility function */
- if (typeof String.prototype.startsWith !== 'function') {
- String.prototype.startsWith = function(str) {
+ /** Utility function */
+ if (typeof String.prototype.startsWith !== 'function') {
+ String.prototype.startsWith = function(str) {
return this.slice(0, str.length) === str;
};
- }
+ }
- $scope.goToSingleParagraph = function () {
+ $scope.goToSingleParagraph = function() {
var noteId = $route.current.pathParams.noteId;
- var redirectToUrl = location.protocol + '//' + location.host + '/#/notebook/' + noteId + '/paragraph/' + $scope.paragraph.id+'?asIframe';
+ var redirectToUrl = location.protocol + '//' + location.host + '/#/notebook/' + noteId + '/paragraph/' +
+ $scope.paragraph.id + '?asIframe';
$window.open(redirectToUrl);
};
-});
+ });
diff --git a/zeppelin-web/src/components/baseUrl/baseUrl.service.js b/zeppelin-web/src/components/baseUrl/baseUrl.service.js
index f5eb2df5970..7d8f350342b 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) {
diff --git a/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js b/zeppelin-web/src/components/dropdowninput/dropdowninput.directive.js
index 65dd5d3720b..6095da69726 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();
+ });
+ }
+ };
});
diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js b/zeppelin-web/src/components/navbar/navbar.controller.js
index 620e075bed8..0d9e10d0b79 100644
--- a/zeppelin-web/src/components/navbar/navbar.controller.js
+++ b/zeppelin-web/src/components/navbar/navbar.controller.js
@@ -15,7 +15,9 @@
'use strict';
-angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootScope, $routeParams, notebookListDataFactory, websocketMsgSrv, arrayOrderingSrv) {
+angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootScope, $routeParams,
+ notebookListDataFactory, websocketMsgSrv,
+ arrayOrderingSrv) {
/** Current list of notes (ids) */
var vm = this;
@@ -23,24 +25,24 @@ angular.module('zeppelinWebApp').controller('NavCtrl', function($scope, $rootSco
vm.connected = websocketMsgSrv.isConnected();
vm.websocketMsgSrv = websocketMsgSrv;
vm.arrayOrderingSrv = arrayOrderingSrv;
-
+
$('#notebook-list').perfectScrollbar({suppressScrollX: true});
-
+
$scope.$on('setNoteMenu', function(event, notes) {
notebookListDataFactory.setNotes(notes);
});
$scope.$on('setConnectedStatus', function(event, param) {
- vm.connected = param;
- });
+ vm.connected = param;
+ });
function loadNotes() {
- websocketMsgSrv.getNotebookList();
- }
+ websocketMsgSrv.getNotebookList();
+ }
function isActive(noteId) {
- return ($routeParams.noteId === noteId);
- }
+ return ($routeParams.noteId === noteId);
+ }
vm.loadNotes = loadNotes;
vm.isActive = isActive;
diff --git a/zeppelin-web/src/components/noteName-create/notename.controller.js b/zeppelin-web/src/components/noteName-create/notename.controller.js
index 342cad7eb7a..fe1cd6bb8ef 100644
--- a/zeppelin-web/src/components/noteName-create/notename.controller.js
+++ b/zeppelin-web/src/components/noteName-create/notename.controller.js
@@ -14,33 +14,28 @@
'use strict';
-angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, $rootScope, $routeParams, websocketMsgSrv) {
+angular.module('zeppelinWebApp').controller('NotenameCtrl', function($scope, $rootScope, websocketMsgSrv) {
var vm = this;
vm.websocketMsgSrv = websocketMsgSrv;
- $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);
- }
+
+ vm.createNote = function() {
+ vm.websocketMsgSrv.createNotebook($scope.notename);
+ };
+ vm.preVisible = function() {
+ var generatedName = vm.generateName();
+ $scope.notename = 'Note ' + generatedName;
+ $scope.$apply();
};
- vm.preVisible = function(clone){
- var generatedName = vm.generateName();
- $scope.note.notename = 'Note ' + generatedName;
- vm.clone = clone;
- $scope.$apply();
+ vm.generateName = function() {
+ var DICTIONARY = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
+ 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R',
+ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
+ var randIndex;
+ var name = '';
+ for (var i = 0; i < 9; i++) {
+ randIndex = Math.floor(Math.random() * 32);
+ name += DICTIONARY[randIndex];
+ }
+ return name;
};
- vm.generateName = function () {
- var DICTIONARY = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
- 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'M', 'N', 'P', 'Q', 'R',
- 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ];
- var randIndex, name = '';
- for (var i = 0; i < 9; i++) {
- randIndex = Math.floor(Math.random() * 32);
- name += DICTIONARY[randIndex];
- }
- return name;
- };
});
diff --git a/zeppelin-web/src/components/noteName-create/visible.directive.js b/zeppelin-web/src/components/noteName-create/visible.directive.js
index 3c15dcbf70f..8d410884927 100644
--- a/zeppelin-web/src/components/noteName-create/visible.directive.js
+++ b/zeppelin-web/src/components/noteName-create/visible.directive.js
@@ -13,30 +13,27 @@
*/
'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) {
+ previsibleMethod();
+ });
+ elem.on('shown.bs.modal', function(e) {
+ if (scope.targetinput) {
+ angular.element(e.target).find('input#' + scope.targetinput).select();
}
- };
+ postVisibleMethod();
+ });
+ }
+ };
});
diff --git a/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js b/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
index ae48999b86d..ce06af08ceb 100644
--- a/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
+++ b/zeppelin-web/src/components/notebookListDataFactory/notebookList.datafactory.js
@@ -23,4 +23,4 @@ angular.module('zeppelinWebApp').factory('notebookListDataFactory', function() {
};
return notes;
-});
\ No newline at end of file
+});
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 3e405dcd93c..274e0117319 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'
};
})
diff --git a/zeppelin-web/src/components/resizable/resizable.directive.js b/zeppelin-web/src/components/resizable/resizable.directive.js
index fe46a2424bf..c47230fa10b 100644
--- a/zeppelin-web/src/components/resizable/resizable.directive.js
+++ b/zeppelin-web/src/components/resizable/resizable.directive.js
@@ -13,29 +13,31 @@
*/
'use strict';
-angular.module('zeppelinWebApp').directive('resizable', function () {
- var resizableConfig = {
- autoHide: true,
- handles: 'se',
- helper: 'resizable-helper',
- minHeight:100,
- grid: [10000, 10] // allow only vertical
- };
+angular.module('zeppelinWebApp').directive('resizable', function() {
+ var resizableConfig = {
+ autoHide: true,
+ handles: 'se',
+ helper: 'resizable-helper',
+ minHeight: 100,
+ grid: [10000, 10] // allow only vertical
+ };
- return {
- restrict: 'A',
- scope: {
- callback: '&onResize'
- },
- link: function postLink(scope, elem, attrs) {
- attrs.$observe('allowresize', function(isAllowed) {
- if (isAllowed === 'true') {
- elem.resizable(resizableConfig);
- elem.on('resizestop', function () {
- if (scope.callback) { scope.callback(); }
- });
- }
- });
+ return {
+ restrict: 'A',
+ scope: {
+ callback: '&onResize'
+ },
+ link: function postLink(scope, elem, attrs) {
+ attrs.$observe('allowresize', function(isAllowed) {
+ if (isAllowed === 'true') {
+ elem.resizable(resizableConfig);
+ elem.on('resizestop', function() {
+ if (scope.callback) {
+ scope.callback();
+ }
+ });
}
- };
+ });
+ }
+ };
});
diff --git a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
index dad2cb5545f..57cdfc21783 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
@@ -22,7 +22,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);
});
diff --git a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
index e74cfd04926..2698ffef446 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketMsg.service.js
@@ -22,14 +22,20 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
},
createNotebook: function(noteName) {
- websocketEvents.sendNewEvent({op: 'NEW_NOTE',data: {name: noteName}});
+ websocketEvents.sendNewEvent({
+ op: 'NEW_NOTE',
+ data: {name: noteName}
+ });
},
deleteNotebook: function(noteId) {
- websocketEvents.sendNewEvent({op: 'DEL_NOTE', data: {id: noteId}});
+ 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}});
},
getNotebookList: function() {
@@ -37,19 +43,38 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
},
getNotebook: function(noteId) {
- websocketEvents.sendNewEvent({op: 'GET_NOTE', data: {id: noteId}});
+ websocketEvents.sendNewEvent({
+ op: 'GET_NOTE',
+ data: {id: noteId}
+ });
},
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, name, value, interpreterGroupId) {
@@ -65,7 +90,10 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
},
cancelParagraphRun: function(paragraphId) {
- websocketEvents.sendNewEvent({op: 'CANCEL_PARAGRAPH', data: {id: paragraphId}});
+ websocketEvents.sendNewEvent({
+ op: 'CANCEL_PARAGRAPH',
+ data: {id: paragraphId}
+ });
},
runParagraph: function(paragraphId, paragraphTitle, paragraphData, paragraphConfig, paragraphParams) {
@@ -82,16 +110,19 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
},
removeParagraph: function(paragraphId) {
- websocketEvents.sendNewEvent({op: 'PARAGRAPH_REMOVE', data: {id: paragraphId}});
+ websocketEvents.sendNewEvent({
+ op: 'PARAGRAPH_REMOVE',
+ data: {id: paragraphId}
+ });
},
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
}
});
},
@@ -101,7 +132,7 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
op: 'COMMIT_PARAGRAPH',
data: {
id: paragraphId,
- title : paragraphTitle,
+ title: paragraphTitle,
paragraph: paragraphData,
config: paragraphConfig,
params: paragraphParams
@@ -109,7 +140,7 @@ angular.module('zeppelinWebApp').service('websocketMsgSrv', function($rootScope,
});
},
- isConnected: function(){
+ isConnected: function() {
return websocketEvents.isConnected();
}
diff --git a/zeppelin-web/test/spec/controllers/nav.js b/zeppelin-web/test/spec/controllers/nav.js
index 9bbfbe3447a..8b5e0a4d1de 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();
diff --git a/zeppelin-web/test/spec/controllers/notebook.js b/zeppelin-web/test/spec/controllers/notebook.js
index 5afa628e6ad..317a905b4f1 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
+});
diff --git a/zeppelin-web/test/spec/controllers/paragraph.js b/zeppelin-web/test/spec/controllers/paragraph.js
index 25716c13a8c..f9b874c64ac 100644
--- a/zeppelin-web/test/spec/controllers/paragraph.js
+++ b/zeppelin-web/test/spec/controllers/paragraph.js
@@ -49,7 +49,8 @@ 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() {
+ 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';
});
@@ -79,4 +80,4 @@ describe('Controller: ParagraphCtrl', function() {
expect(scope.renderAngular).toHaveBeenCalled();
});
-});
\ No newline at end of file
+});
diff --git a/zeppelin-web/test/spec/directives/ngenter.js b/zeppelin-web/test/spec/directives/ngenter.js
index dc2136dfaf8..05d9596e786 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('');
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('');
- 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('');
+ element = $compile(element)(scope);
+ expect(element.text()).toBe('this is the ngEnter directive');
+ }));*/
});