white-space cleanse, and added forin flags to a couple files that need to be looked at at a later date.

This commit is contained in:
Spencer Alger
2013-08-26 17:56:40 -07:00
parent d778873ba5
commit 389f8aef4d
19 changed files with 149 additions and 148 deletions
+3 -3
View File
@@ -5,9 +5,9 @@
// Base modules
var modules = [
'kibana.services',
'kibana.controllers',
'kibana.filters',
'kibana.directives',
'kibana.controllers',
'kibana.filters',
'kibana.directives',
'elasticjs.service',
'$strap.directives',
'kibana.panels',
+3 -3
View File
@@ -3,7 +3,7 @@
'use strict';
angular.module('kibana.controllers', [])
.controller('DashCtrl', function($scope, $rootScope, $http, $timeout, $route, ejsResource,
.controller('DashCtrl', function($scope, $rootScope, $http, $timeout, $route, ejsResource,
fields, dashboard, alertSrv) {
$scope.editor = {
@@ -23,7 +23,7 @@ angular.module('kibana.controllers', [])
$scope.fields = fields;
$scope.reset_row();
var ejs = $scope.ejs = ejsResource(config.elasticsearch);
var ejs = $scope.ejs = ejsResource(config.elasticsearch);
};
$scope.add_row = function(dash,row) {
@@ -58,7 +58,7 @@ angular.module('kibana.controllers', [])
return $scope.editorTabs;
};
// This is whoafully incomplete, but will do for now
// This is whoafully incomplete, but will do for now
$scope.parse_error = function(data) {
var _error = data.match("nested: (.*?);");
return _.isNull(_error) ? data : _error[1];
+2 -2
View File
@@ -9,7 +9,7 @@ angular.module('kibana.directives', [])
link: function(scope, elem, attrs) {
var template = '<i class="icon-spinner small icon-spin icon-large panel-loading" '+
'ng-show="panelMeta.loading == true && !panel.title"></i>'+
' <span class="editlink panelextra pointer" style="right:15px;top:0px" ' +
' <span class="editlink panelextra pointer" style="right:15px;top:0px" ' +
'bs-modal="\'partials/paneleditor.html\'" ng-show="panel.editable != false">'+
'<span class="small">{{panel.type}}</span> <i class="icon-cog pointer"></i> '+
'</span><h4>'+
@@ -73,7 +73,7 @@ angular.module('kibana.directives', [])
elm.bind('blur', function() {
scope.$apply(function() {
ngModelCtrl.$setViewValue(elm.val());
});
});
});
}
};
+1 -1
View File
@@ -1,4 +1,4 @@
/*jshint globalstrict:true */
/*jshint globalstrict:true, forin:false */
/*global angular:true */
/*global Blob:false*/
'use strict';
+29 -28
View File
@@ -1,3 +1,4 @@
/*jshint forin:false*/
// Wrap this all up in a 'kbn' object so I don't have a billion globals
(function() {
'use strict';
@@ -102,54 +103,54 @@
kbn.round_interval = function(interval) {
switch (true) {
// 0.5s
case (interval <= 500):
case (interval <= 500):
return 100; // 0.1s
// 5s
case (interval <= 5000):
case (interval <= 5000):
return 1000; // 1s
// 7.5s
case (interval <= 7500):
case (interval <= 7500):
return 5000; // 5s
// 15s
case (interval <= 15000):
case (interval <= 15000):
return 10000; // 10s
// 45s
case (interval <= 45000):
case (interval <= 45000):
return 30000; // 30s
// 3m
case (interval <= 180000):
case (interval <= 180000):
return 60000; // 1m
// 9m
case (interval <= 450000):
case (interval <= 450000):
return 300000; // 5m
// 20m
case (interval <= 1200000):
case (interval <= 1200000):
return 600000; // 10m
// 45m
case (interval <= 2700000):
case (interval <= 2700000):
return 1800000; // 30m
// 2h
case (interval <= 7200000):
case (interval <= 7200000):
return 3600000; // 1h
// 6h
case (interval <= 21600000):
case (interval <= 21600000):
return 10800000; // 3h
// 24h
case (interval <= 86400000):
case (interval <= 86400000):
return 43200000; // 12h
// 48h
case (interval <= 172800000):
case (interval <= 172800000):
return 86400000; // 24h
// 1w
case (interval <= 604800000):
case (interval <= 604800000):
return 86400000; // 24h
// 3w
case (interval <= 1814400000):
case (interval <= 1814400000):
return 604800000; // 1w
// 2y
case (interval < 3628800000):
case (interval < 3628800000):
return 2592000000; // 30d
default:
default:
return 31536000000; // 1y
}
};
@@ -194,21 +195,21 @@
kbn.interval_to_seconds = function(string) {
var matches = string.match(/(\d+(?:\.\d+)?)([Mwdhmsy])/);
switch (matches[2]) {
case 'y':
case 'y':
return matches[1]*31536000;
case 'M':
case 'M':
return matches[1]*2592000;
case 'w':
case 'w':
return matches[1]*604800;
case 'd':
case 'd':
return matches[1]*86400;
case 'h':
case 'h':
return matches[1]*3600;
case 'm':
case 'm':
return matches[1]*60;
case 's':
case 's':
return matches[1];
}
}
};
// This should go away, moment.js can do this
@@ -235,7 +236,7 @@
if (objidx > 0) {
strval = strval + ', ';
}
strval = strval + JSON.stringify(obj[objidx]);
}
array[rootname] = strval;
@@ -299,7 +300,7 @@ _.mixin({
array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] );
return array;
}
}
});
_.mixin({
@@ -308,7 +309,7 @@ _.mixin({
array.splice(index, 1);
return array;
}
}
});
_.mixin({