Skip to content

Commit bac27f3

Browse files
authored
Restore previous naming conventions (#2057)
* Revert prior fix as it broke things instead of clearing up identifier naming. * Change also how the horizontal ellipsis shows up. Post #2056 #2048 * We'll try this again.
1 parent 66ef9fd commit bac27f3

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

controllers/scriptStorage.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,6 +1201,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
12011201
var userName = findMeta(aMeta, 'OpenUserJS.author.0.value') || aUser.name;
12021202
var scriptName = null;
12031203
var scriptDescription = null;
1204+
var thisName = null;
1205+
var thisDescription = null;
12041206
var hasInvalidKey = null;
12051207

12061208
async.series([
@@ -1251,7 +1253,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
12511253
// Check for non-localized presence
12521254
name.forEach(function (aElement, aIndex, aArray) {
12531255
if (!name[aIndex].key) {
1254-
scriptName = aElement.value;
1256+
thisName = aElement.value;
1257+
scriptName = cleanFilename(thisName, '');
12551258
}
12561259
});
12571260

@@ -1311,7 +1314,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
13111314
if (description) {
13121315
description.forEach(function (aElement, aIndex, aArray) {
13131316
if (!description[aIndex].key) {
1314-
scriptDescription = aElement.value;
1317+
thisDescription = aElement.value;
1318+
scriptDescription = cleanFilename(thisDescription, '');
13151319
}
13161320
});
13171321
}
@@ -2083,15 +2087,15 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
20832087

20842088

20852089
storeDescriptionLength = settings.scriptSearchQueryStoreMaxDescription;
2086-
storeDescriptionLength = rLogographic.test(scriptDescription)
2090+
storeDescriptionLength = rLogographic.test(thisDescription)
20872091
? parseInt(storeDescriptionLength / logographicDivisor)
20882092
: storeDescriptionLength;
20892093

20902094
aScript = new Script({
2091-
name: scriptName,
2095+
name: thisName,
20922096
_description: (
2093-
scriptDescription
2094-
? scriptDescription.substr(0, storeDescriptionLength).trim()
2097+
thisDescription
2098+
? thisDescription.substr(0, storeDescriptionLength).trim()
20952099
: ''
20962100
),
20972101
author: aUser.name,
@@ -2133,13 +2137,13 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
21332137
}
21342138

21352139
storeDescriptionLength = settings.scriptSearchQueryStoreMaxDescription;
2136-
storeDescriptionLength = rLogographic.test(scriptDescription)
2140+
storeDescriptionLength = rLogographic.test(thisDescription)
21372141
? parseInt(storeDescriptionLength / logographicDivisor)
21382142
: storeDescriptionLength;
21392143

21402144
aScript._description = (
2141-
scriptDescription
2142-
? scriptDescription.substr(0, storeDescriptionLength).trim()
2145+
thisDescription
2146+
? thisDescription.substr(0, storeDescriptionLength).trim()
21432147
: ''
21442148
);
21452149
aScript.meta = aMeta;

libs/modelParser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ var parseScript = function (aScript) {
351351
if (script.description && script._description
352352
&& script.description.length && script.description.length > logographicDivisor
353353
&& script.description.length > (logographic
354-
? parseInt(script._description.length / logographicDivisor)
355-
: script._description.length)) {
354+
? parseInt(settings.scriptSearchQueryStoreMaxDescription / logographicDivisor)
355+
: settings.scriptSearchQueryStoreMaxDescription)) {
356356
script.hasLongDescription = true;
357357
}
358358
}

0 commit comments

Comments
 (0)