Skip to content

Commit e4415e3

Browse files
committed
Added DataTables support
1 parent ccaaa79 commit e4415e3

20 files changed

+17439
-1915
lines changed
Loading
Loading
Loading

frontend/express/public/javascripts/countly/countly.common.js

+7
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,13 @@
10511051
ticks: _.compact(ticks)
10521052
};
10531053
};
1054+
1055+
countlyCommon.formatNumber = function(x) {
1056+
x = parseFloat(parseFloat(x).toFixed(2));
1057+
var parts = x.toString().split(".");
1058+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1059+
return parts.join(".");
1060+
};
10541061

10551062
// Private Methods
10561063

frontend/express/public/javascripts/countly/countly.event.js

+4
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@
193193
countlyEvent.getActiveSegmentation = function () {
194194
return (_activeSegmentation) ? _activeSegmentation : jQuery.i18n.map["events.no-segmentation"];
195195
};
196+
197+
countlyEvent.isSegmentedView = function() {
198+
return (_activeSegmentation) ? true : false;
199+
};
196200

197201
countlyEvent.getEventData = function () {
198202

frontend/express/public/javascripts/countly/countly.location.js

+6
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@
148148
locationData.chartData = locationData.chartData.splice(0, options.maxCountries);
149149
}
150150
}
151+
152+
for (var i = 0; i < locationData.chartData.length; i++) {
153+
locationData.chartData[i]['country_flag'] =
154+
"<div class='flag' style='background-image:url(/images/flags/" + locationData.chartData[i]['code'] + ".png);'></div>" +
155+
locationData.chartData[i]['country'];
156+
}
151157

152158
return _.sortBy(locationData.chartData, function(obj) { return -obj.t; });
153159
};

frontend/express/public/javascripts/countly/countly.session.js

+19
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,25 @@
514514

515515
return durationRange[index];
516516
};
517+
518+
countlySession.getDurationIndex = function (duration) {
519+
var sec = jQuery.i18n.map["common.seconds"],
520+
min = jQuery.i18n.map["common.minutes"],
521+
hr = jQuery.i18n.map["common.hour"];
522+
523+
var durationRange = [
524+
"0-10 " + sec,
525+
"11-30 " + sec,
526+
"31-60 " + sec,
527+
"1-3 " + min,
528+
"3-10 " + min,
529+
"10-30 " + min,
530+
"30-60 " + min,
531+
"> 1 " + hr
532+
];
533+
534+
return durationRange.indexOf(duration);
535+
};
517536

518537
countlySession.getTopUserBars = function () {
519538

0 commit comments

Comments
 (0)