Skip to content

Commit 1efaea9

Browse files
author
Melih Korkmaz
committed
Fixes for renaming.
1 parent ef090cd commit 1efaea9

File tree

2 files changed

+45
-47
lines changed

2 files changed

+45
-47
lines changed

plugins/plugins/api/api.js

+19-21
Original file line numberDiff line numberDiff line change
@@ -78,44 +78,44 @@ var plugin = {},
7878
catch (ex) {
7979
// Error
8080
}
81-
ob = {};
81+
var resultObj = {};
8282
if (pluginList.indexOf(file) > -1) {
83-
ob.enabled = true;
83+
resultObj.enabled = true;
8484
}
8585
else {
86-
ob.enabled = false;
86+
resultObj.enabled = false;
8787
}
88-
ob.code = file;
88+
resultObj.code = file;
8989
if (data) {
90-
ob.title = data.title || file;
91-
ob.name = data.name || file;
92-
ob.description = data.description || file;
93-
ob.version = data.version || "unknown";
94-
ob.author = data.author || "unknown";
95-
ob.homepage = data.homepage || "";
90+
resultObj.title = data.title || file;
91+
resultObj.name = data.name || file;
92+
resultObj.description = data.description || file;
93+
resultObj.version = data.version || "unknown";
94+
resultObj.author = data.author || "unknown";
95+
resultObj.homepage = data.homepage || "";
9696

9797
//we need to get localization only if plugin is disabled
98-
if (!ob.enabled) {
99-
var local_path = fullpath + "/frontend/public/localization/" + ob.code + ".properties";
98+
if (!resultObj.enabled) {
99+
var local_path = fullpath + "/frontend/public/localization/" + resultObj.code + ".properties";
100100
if (params.member.lang && params.member.lang !== "en") {
101-
local_path = fullpath + "/frontend/public/localization/" + ob.code + "_" + params.member.lang + ".properties";
101+
local_path = fullpath + "/frontend/public/localization/" + resultObj.code + "_" + params.member.lang + ".properties";
102102
}
103103
if (fs.existsSync(local_path)) {
104104
var local_properties = fs.readFileSync(local_path);
105105
local_properties = parser.parse(local_properties);
106-
ob.title = local_properties[ob.code + ".plugin-title"] || local_properties[ob.code + ".title"] || ob.title;
107-
ob.description = local_properties[ob.code + ".plugin-description"] || local_properties[ob.code + ".description"] || ob.description;
106+
resultObj.title = local_properties[resultObj.code + ".plugin-title"] || local_properties[resultObj.code + ".title"] || resultObj.title;
107+
resultObj.description = local_properties[resultObj.code + ".plugin-description"] || local_properties[resultObj.code + ".description"] || resultObj.description;
108108
}
109109
}
110110
}
111111
else {
112-
ob = {name: file, title: file, description: file, version: "unknown", author: "unknown", homepage: "", code: file, enabled: false};
112+
resultObj = {name: file, title: file, description: file, version: "unknown", author: "unknown", homepage: "", code: file, enabled: false};
113113
}
114114
if (global.enclose) {
115115
var eplugin = global.enclose.plugins[file];
116-
ob.prepackaged = eplugin && eplugin.prepackaged;
116+
resultObj.prepackaged = eplugin && eplugin.prepackaged;
117117
}
118-
results.push(ob);
118+
results.push(resultObj);
119119
if (!--pending) {
120120
done(null, results);
121121
}
@@ -175,9 +175,7 @@ var plugin = {},
175175
updateArr.ends = data.frontend.session_timeout * 60 + Math.round(Date.now() / 1000);
176176
updateArr.ttl = data.frontend.session_timeout * 60;
177177
}
178-
if (params.member.settings && params.member.settings.frontend && typeof data.frontend.session_timeout !== "undefined") {
179-
// Empty block
180-
}
178+
if (params.member.settings && params.member.settings.frontend && typeof data.frontend.session_timeout !== "undefined") {} //eslint-disable-line no-empty
181179
else { //if not set member value
182180
common.db.collection("auth_tokens").update({"owner": ob.params.member._id + "", "purpose": "LoggedInAuth"}, {$set: updateArr}, function(err) {
183181
if (err) {

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

+26-26
Original file line numberDiff line numberDiff line change
@@ -977,46 +977,46 @@ window.ConfigurationsView = countlyView.extend({
977977
}
978978
else {
979979
var input = this.getInputByType((id + "." + i).substring(1), "");
980-
label = this.getInputLabel((id + "." + i).substring(1), i);
981-
if (input && label) {
982-
configsHTML += "<tr id='config-row-" + i + "-" + id.replace(".", "") + "' class='config-table-details-row'><td>" + label + "</td><td>" + input + "</td></tr>";
980+
var detailsLabel = this.getInputLabel((id + "." + i).substring(1), i);
981+
if (input && detailsLabel) {
982+
configsHTML += "<tr id='config-row-" + i + "-" + id.replace(".", "") + "' class='config-table-details-row'><td>" + detailsLabel + "</td><td>" + input + "</td></tr>";
983983
}
984984
}
985985
}
986986
else if (i === "_user") {
987987
var hasSelectedData = Object.keys(configsData[i]).some(function(key) { // eslint-disable-line no-loop-func
988988
return configsData[i][key];
989989
});
990-
label = '<div data-localize="' + jQuery.i18n.map["configs.user-level-configuration"] + '">' + jQuery.i18n.map["configs.user-level-configuration"] + '</div><span class="config-help" data-localize="' + jQuery.i18n.map["configs.help.user-level-configuration"] + '">' + jQuery.i18n.map["configs.help.user-level-configuration"] + '</span>';
990+
var userLevelLabel = '<div data-localize="' + jQuery.i18n.map["configs.user-level-configuration"] + '">' + jQuery.i18n.map["configs.user-level-configuration"] + '</div><span class="config-help" data-localize="' + jQuery.i18n.map["configs.help.user-level-configuration"] + '">' + jQuery.i18n.map["configs.help.user-level-configuration"] + '</span>';
991991

992-
input = '<div class="cly-multi-select user-config-select ' + (hasSelectedData ? 'selection-exists' : '') + '" id="' + id.substring(1) + '._user" style="width: 100%; box-sizing: border-box;">';
993-
input += '<div class="select-inner">';
994-
input += '<div class="text-container">';
995-
input += '<div class="text">';
996-
input += '<div class="default-text"></div>';
992+
var userLevelInput = '<div class="cly-multi-select user-config-select ' + (hasSelectedData ? 'selection-exists' : '') + '" id="' + id.substring(1) + '._user" style="width: 100%; box-sizing: border-box;">';
993+
userLevelInput += '<div class="select-inner">';
994+
userLevelInput += '<div class="text-container">';
995+
userLevelInput += '<div class="text">';
996+
userLevelInput += '<div class="default-text"></div>';
997997
for (var c in configsData[i]) {
998998
if (configsData[i][c]) {
999-
input += '<div class="selection" data-value="' + c + '">' + this.getLabelName((id + "." + c).substring(1), c).text + '<div class="remove"><i class="ion-android-close"></i></div></div>';
999+
userLevelInput += '<div class="selection" data-value="' + c + '">' + this.getLabelName((id + "." + c).substring(1), c).text + '<div class="remove"><i class="ion-android-close"></i></div></div>';
10001000
}
10011001
}
1002-
input += '</div>';
1003-
input += '</div>';
1004-
input += '<div class="right combo"></div>';
1005-
input += '</div>';
1006-
input += '<div class="select-items square" style="width: 100%;"><div>';
1002+
userLevelInput += '</div>';
1003+
userLevelInput += '</div>';
1004+
userLevelInput += '<div class="right combo"></div>';
1005+
userLevelInput += '</div>';
1006+
userLevelInput += '<div class="select-items square" style="width: 100%;"><div>';
10071007
for (var d in configsData[i]) {
1008-
input += '<div data-value="' + d + '" class="item ' + (configsData[i][d] ? 'selected' : '') + '">' + this.getLabelName((id + "." + d).substring(1), d).text + '</div>';
1008+
userLevelInput += '<div data-value="' + d + '" class="item ' + (configsData[i][d] ? 'selected' : '') + '">' + this.getLabelName((id + "." + d).substring(1), d).text + '</div>';
10091009
}
1010-
input += '</div></div>';
1011-
input += '</div>';
1010+
userLevelInput += '</div></div>';
1011+
userLevelInput += '</div>';
10121012

1013-
configsHTML += "<tr id='config-row-" + i + "-user-conf' class='config-table-details-row user-row' style='display:none'><td>" + label + "</td><td>" + input + "</td></tr>";
1013+
configsHTML += "<tr id='config-row-" + i + "-user-conf' class='config-table-details-row user-row' style='display:none'><td>" + userLevelLabel + "</td><td>" + userLevelInput + "</td></tr>";
10141014
}
10151015
else {
1016-
input = this.getInputByType((id + "." + i).substring(1), configsData[i]);
1017-
label = this.getInputLabel((id + "." + i).substring(1), i);
1018-
if (input && label) {
1019-
configsHTML += "<tr id='config-row-" + i + "-" + id.replace(".", "") + "' class='config-table-details-row'><td>" + label + "</td><td>" + input + "</td></tr>";
1016+
var inputElse = this.getInputByType((id + "." + i).substring(1), configsData[i]);
1017+
var labelElse = this.getInputLabel((id + "." + i).substring(1), i);
1018+
if (inputElse && labelElse) {
1019+
configsHTML += "<tr id='config-row-" + i + "-" + id.replace(".", "") + "' class='config-table-details-row'><td>" + labelElse + "</td><td>" + inputElse + "</td></tr>";
10201020
}
10211021
}
10221022
}
@@ -1360,13 +1360,13 @@ app.addPageScript("/manage/plugins", function() {
13601360
});
13611361

13621362
$(document).on("click", ".btn-plugin-enabler", function() {
1363-
plugins = {};
1363+
var pluginsEnabler = {};
13641364

13651365
$("#plugins-table").find(".on-off-switch input").each(function() {
13661366
var plugin = this.id.toString().replace(/^plugin-/, ''),
13671367
state = ($(this).is(":checked")) ? true : false;
13681368

1369-
plugins[plugin] = state;
1369+
pluginsEnabler[plugin] = state;
13701370
});
13711371

13721372
var text = jQuery.i18n.map["plugins.confirm"];
@@ -1376,7 +1376,7 @@ app.addPageScript("/manage/plugins", function() {
13761376
return true;
13771377
}
13781378
CountlyHelpers.notify(msg);
1379-
app.activeView.togglePlugin(plugins);
1379+
app.activeView.togglePlugin(pluginsEnabler);
13801380
}, [jQuery.i18n.map["common.no-dont-continue"], jQuery.i18n.map["plugins.yes-i-want-to-apply-changes"]], { title: jQuery.i18n.map["plugins-apply-changes-to-plugins"], image: "apply-changes-to-plugins" });
13811381
});
13821382
});

0 commit comments

Comments
 (0)