Skip to content

Commit 58c53f1

Browse files
author
Melih Korkmaz
committed
Guideline fix
1 parent 6f67c12 commit 58c53f1

File tree

4 files changed

+105
-103
lines changed

4 files changed

+105
-103
lines changed

plugins/plugins/api/api.js

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
var plugin = {},
22
fs = require('fs'),
33
path = require('path'),
4-
common = require('../../../api/utils/common.js'),
5-
async = require('async'),
4+
common = require('../../../api/utils/common.js'),
65
parser = require('properties-parser'),
76
plugins = require('../../pluginManager.js');
87

9-
(function(plugin) {
8+
(function() {
109
plugins.register('/i/plugins', function(ob) {
1110
var params = ob.params;
1211
var validateUserForWriteAPI = ob.validateUserForWriteAPI;
@@ -76,8 +75,10 @@ var plugin = {},
7675
try {
7776
data = require(fullpath + '/package.json');
7877
}
79-
catch (ex) {}
80-
var ob = {};
78+
catch (ex) {
79+
// Error
80+
}
81+
ob = {};
8182
if (pluginList.indexOf(file) > -1) {
8283
ob.enabled = true;
8384
}
@@ -96,7 +97,7 @@ var plugin = {},
9697
//we need to get localization only if plugin is disabled
9798
if (!ob.enabled) {
9899
var local_path = fullpath + "/frontend/public/localization/" + ob.code + ".properties";
99-
if (params.member.lang && params.member.lang != "en") {
100+
if (params.member.lang && params.member.lang !== "en") {
100101
local_path = fullpath + "/frontend/public/localization/" + ob.code + "_" + params.member.lang + ".properties";
101102
}
102103
if (fs.existsSync(local_path)) {
@@ -174,9 +175,11 @@ var plugin = {},
174175
updateArr.ends = data.frontend.session_timeout * 60 + Math.round(Date.now() / 1000);
175176
updateArr.ttl = data.frontend.session_timeout * 60;
176177
}
177-
if (params.member.settings && params.member.settings.frontend && typeof data.frontend.session_timeout !== "undefined") {}
178+
if (params.member.settings && params.member.settings.frontend && typeof data.frontend.session_timeout !== "undefined") {
179+
// Empty block
180+
}
178181
else { //if not set member value
179-
common.db.collection("auth_tokens").update({"owner": ob.params.member._id + "", "purpose": "LoggedInAuth"}, {$set: updateArr}, function(err, res1) {
182+
common.db.collection("auth_tokens").update({"owner": ob.params.member._id + "", "purpose": "LoggedInAuth"}, {$set: updateArr}, function(err) {
180183
if (err) {
181184
console.log(err);
182185
}
@@ -233,7 +236,7 @@ var plugin = {},
233236
updateArr.ttl = data.frontend.session_timeout * 60;
234237
}
235238

236-
common.db.collection("auth_tokens").update({"owner": ob.params.member._id + "", "purpose": "LoggedInAuth"}, {$set: updateArr}, function(err, res1) {
239+
common.db.collection("auth_tokens").update({"owner": ob.params.member._id + "", "purpose": "LoggedInAuth"}, {$set: updateArr}, function(err) {
237240
if (err) {
238241
console.log(err);
239242
}

plugins/plugins/frontend/app.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
var plugin = {},
2-
plugins = require('../../pluginManager.js');
1+
var exportedPlugin = {};
32

43
(function(plugin) {
5-
plugin.init = function(app, countlyDb) { };
6-
}(plugin));
4+
plugin.init = function() {
75

8-
module.exports = plugin;
6+
};
7+
}(exportedPlugin));
8+
9+
module.exports = exportedPlugin;

plugins/plugins/frontend/public/javascripts/countly.models.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
(function(countlyPlugins, $, undefined) {
1+
/*global countlyCommon,countlyGlobal,jQuery */
2+
(function(countlyPlugins, $) {
23

34
//Private Properties
45
var _pluginsData = {};
@@ -7,7 +8,7 @@
78
var _themeList = [];
89

910
//Public Methods
10-
countlyPlugins.initialize = function(id) {
11+
countlyPlugins.initialize = function() {
1112
return $.ajax({
1213
type: "GET",
1314
url: countlyCommon.API_URL + "/o/plugins",
@@ -46,7 +47,7 @@
4647
});
4748
};
4849

49-
countlyPlugins.initializeConfigs = function(id) {
50+
countlyPlugins.initializeConfigs = function() {
5051
return $.when(
5152
$.ajax({
5253
type: "GET",
@@ -95,7 +96,7 @@
9596
});
9697
};
9798

98-
countlyPlugins.initializeUserConfigs = function(id) {
99+
countlyPlugins.initializeUserConfigs = function() {
99100
return $.when(
100101
$.ajax({
101102
type: "GET",

0 commit comments

Comments
 (0)