Skip to content

Commit ecef73a

Browse files
authored
Merge pull request #669 from Cookiezaurs/guidelines-frontend-countly
Guidelines frontend countly
2 parents 011e610 + 04b0dc8 commit ecef73a

File tree

7 files changed

+379
-369
lines changed

7 files changed

+379
-369
lines changed

bin/scripts/device_list/generate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ csv()
1919
}
2020
})
2121
.on('done', ()=>{
22-
console.log("/**\n * Object with device models as keys and pretty/marketing device names as values\n * @name countlyDeviceList\n * @global\n * @namespace countlyDeviceList\n */\ncountlyDeviceList = " + JSON.stringify(devices) + ";\nif( typeof module !== 'undefined' && module.exports ) {\n exports = module.exports = countlyDeviceList\n}");
22+
console.log("/**\n * Object with device models as keys and pretty/marketing device names as values\n * @name countlyDeviceList\n * @global\n * @namespace countlyDeviceList\n */\nwindow.countlyDeviceList = " + JSON.stringify(devices) + ";\nif( typeof module !== 'undefined' && module.exports ) {\n exports = module.exports = window.countlyDeviceList\n}");
2323
});

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

+352-347
Large diffs are not rendered by default.

frontend/express/public/javascripts/countly/countly.config.sample.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*global CommonConstructor, countlyGlobal */
12
(function(CommonConstructor) {
23
var countlyCommon = CommonConstructor.prototype;
34
/**

frontend/express/public/javascripts/countly/countly.device.detail.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*global CountlyHelpers, countlyDeviceDetails, countlyAppVersion, countlyCommon, _*/
12
(function() {
23

34
window.countlyDeviceDetails = window.countlyDeviceDetails || {};
@@ -65,7 +66,7 @@
6566
var chartData = countlyCommon.extractTwoLevelData(countlyDeviceDetails.getDb(), countlyDeviceDetails.getMeta("os"), countlyDeviceDetails.clearObject, [
6667
{
6768
name: "os_",
68-
func: function(rangeArr, dataObj) {
69+
func: function(rangeArr) {
6970
if (countlyDeviceDetails.os_mapping[rangeArr.toLowerCase()]) {
7071
return countlyDeviceDetails.os_mapping[rangeArr.toLowerCase()].name;
7172
}
@@ -74,7 +75,7 @@
7475
},
7576
{
7677
name: "origos_",
77-
func: function(rangeArr, dataObj) {
78+
func: function(rangeArr) {
7879
return rangeArr;
7980
}
8081
},
@@ -87,12 +88,11 @@
8788
platformTotal = _.pluck(chartData.chartData, 'u'),
8889
chartData2 = [];
8990

90-
var sum = _.reduce(platformTotal, function(memo, num) {
91+
/*var sum = _.reduce(platformTotal, function(memo, num) {
9192
return memo + num;
92-
}, 0);
93+
}, 0);*/
9394

9495
for (var i = 0; i < platformNames.length; i++) {
95-
var percent = (platformTotal[i] / sum) * 100;
9696
chartData2[i] = {
9797
data: [
9898
[0, platformTotal[i]]
@@ -111,19 +111,19 @@
111111
var chartData = countlyCommon.extractTwoLevelData(countlyDeviceDetails.getDb(), countlyDeviceDetails.getMeta("resolutions"), countlyDeviceDetails.clearObject, [
112112
{
113113
name: "resolution",
114-
func: function(rangeArr, dataObj) {
114+
func: function(rangeArr) {
115115
return rangeArr;
116116
}
117117
},
118118
{
119119
name: "width",
120-
func: function(rangeArr, dataObj) {
120+
func: function(rangeArr) {
121121
return "<a>" + rangeArr.split("x")[0] + "</a>";
122122
}
123123
},
124124
{
125125
name: "height",
126-
func: function(rangeArr, dataObj) {
126+
func: function(rangeArr) {
127127
return "<a>" + rangeArr.split("x")[1] + "</a>";
128128
}
129129
},
@@ -138,12 +138,12 @@
138138
chartData2 = [],
139139
chartData3 = [];
140140

141-
var sum = _.reduce(resolutionTotal, function(memo, num) {
141+
/*var sum = _.reduce(resolutionTotal, function(memo, num) {
142142
return memo + num;
143-
}, 0);
144-
145-
for (var i = 0; i < resolutions.length; i++) {
146-
var percent = (resolutionTotal[i] / sum) * 100;
143+
}, 0);*/
144+
var i=0;
145+
for (i = 0; i < resolutions.length; i++) {
146+
//var percent = (resolutionTotal[i] / sum) * 100;
147147
chartData2[i] = {
148148
data: [
149149
[0, resolutionTotal[i]]
@@ -152,12 +152,12 @@
152152
};
153153
}
154154

155-
var sum2 = _.reduce(resolutionNew, function(memo, num) {
155+
/*var sum2 = _.reduce(resolutionNew, function(memo, num) {
156156
return memo + num;
157-
}, 0);
157+
}, 0);*/
158158

159-
for (var i = 0; i < resolutions.length; i++) {
160-
var percent = (resolutionNew[i] / sum) * 100;
159+
for (i = 0; i < resolutions.length; i++) {
160+
//var percent = (resolutionNew[i] / sum) * 100;
161161
chartData3[i] = {
162162
data: [
163163
[0, resolutionNew[i]]

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
/*global CountlyHelpers, countlyDeviceList */
12
(function() {
3+
/** Function gets full device name
4+
* @param {string} shortName - short device name
5+
* @returns{string} full device name
6+
*/
27
function getDeviceFullName(shortName) {
3-
if (shortName == "Unknown") {
8+
if (shortName === "Unknown") {
49
return jQuery.i18n.map["common.unknown"];
510
}
611
if (countlyDeviceList && countlyDeviceList[shortName]) {

frontend/express/public/javascripts/countly/countly.device.list.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/plugin-upload/frontend/app.js

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ function check_name_list(filepath, myname, mandatory) {
6969
* @return {Promise} returns promise
7070
*/
7171
function check_package_file(my_path) {
72-
console.log(my_path);
7372
return new Promise(function(resolve, reject) {
7473
if (!fs.existsSync(my_path + '/package.json')) {
7574
return reject(Error('package_missing'));

0 commit comments

Comments
 (0)