Skip to content

Commit

Permalink
Restore previous naming conventions (#2057)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Martii authored Mar 2, 2025
1 parent 66ef9fd commit bac27f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
var userName = findMeta(aMeta, 'OpenUserJS.author.0.value') || aUser.name;
var scriptName = null;
var scriptDescription = null;
var thisName = null;
var thisDescription = null;
var hasInvalidKey = null;

async.series([
Expand Down Expand Up @@ -1251,7 +1253,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
// Check for non-localized presence
name.forEach(function (aElement, aIndex, aArray) {
if (!name[aIndex].key) {
scriptName = aElement.value;
thisName = aElement.value;
scriptName = cleanFilename(thisName, '');
}
});

Expand Down Expand Up @@ -1311,7 +1314,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
if (description) {
description.forEach(function (aElement, aIndex, aArray) {
if (!description[aIndex].key) {
scriptDescription = aElement.value;
thisDescription = aElement.value;
scriptDescription = cleanFilename(thisDescription, '');
}
});
}
Expand Down Expand Up @@ -2083,15 +2087,15 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {


storeDescriptionLength = settings.scriptSearchQueryStoreMaxDescription;
storeDescriptionLength = rLogographic.test(scriptDescription)
storeDescriptionLength = rLogographic.test(thisDescription)
? parseInt(storeDescriptionLength / logographicDivisor)
: storeDescriptionLength;

aScript = new Script({
name: scriptName,
name: thisName,
_description: (
scriptDescription
? scriptDescription.substr(0, storeDescriptionLength).trim()
thisDescription
? thisDescription.substr(0, storeDescriptionLength).trim()
: ''
),
author: aUser.name,
Expand Down Expand Up @@ -2133,13 +2137,13 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
}

storeDescriptionLength = settings.scriptSearchQueryStoreMaxDescription;
storeDescriptionLength = rLogographic.test(scriptDescription)
storeDescriptionLength = rLogographic.test(thisDescription)
? parseInt(storeDescriptionLength / logographicDivisor)
: storeDescriptionLength;

aScript._description = (
scriptDescription
? scriptDescription.substr(0, storeDescriptionLength).trim()
thisDescription
? thisDescription.substr(0, storeDescriptionLength).trim()
: ''
);
aScript.meta = aMeta;
Expand Down
4 changes: 2 additions & 2 deletions libs/modelParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ var parseScript = function (aScript) {
if (script.description && script._description
&& script.description.length && script.description.length > logographicDivisor
&& script.description.length > (logographic
? parseInt(script._description.length / logographicDivisor)
: script._description.length)) {
? parseInt(settings.scriptSearchQueryStoreMaxDescription / logographicDivisor)
: settings.scriptSearchQueryStoreMaxDescription)) {
script.hasLongDescription = true;
}
}
Expand Down

0 comments on commit bac27f3

Please sign in to comment.