Skip to content
Snippets Groups Projects
Commit ab09498a authored by Pregmodder's avatar Pregmodder
Browse files

Merge remote-tracking branch 'upstream/pregmod-master' into pregmod-dev

parents 2a57bbfc 981faad1
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ window.diffFlatten = function diffFlatten(data) {
if (Object(cur) !== cur) {
result[prop] = cur;
} else if (Array.isArray(cur)) {
for (let i=0, l=cur.length; i<l; i++)
for (var i=0, l=cur.length; i<l; i++) // don't change the "var" to "let"
recurse(cur[i], prop + "[" + i + "]");
if (l === 0)
result[prop] = [];
......
......@@ -147,19 +147,17 @@ Macro.add('options', {
const isEnableOption = argText && (argText.startsWith("Enable") || argText === "Yes" || argText.startsWith("Allow"));
const isDisableOption = argText && (argText.startsWith("Disable") || argText === "No" || argText.startsWith("Deny"));
let className = "optionMacroOption ";
if (isEnableOption === "optionMacroEnable") {
className += isDisableOption;
} else {
if (isDisableOption) {
className += "optionMacroDisable";
}
if (isEnableOption) {
className += "optionMacroEnable";
} else if (isDisableOption) {
className += "optionMacroDisable";
}
if (found_index !== i || hasMultipleOptionsWithSameValue) {
let onClickChange = args[hasComparitor ? 3 : 2];
onClickChange = onClickChange ? ', ' + onClickChange : '';
output += `<span class=${className}>[[${argText}${extraComment}|${passageName}][${variable}=${JSON.stringify(args[hasComparitor ? 1 : 0])}${onClickChange}]]</span>`;
} else if (showSelectedOption) {
output += `<span class=${optionMacroSelected}${className}>${argText}${extraComment}</span>`;
output += `<span class="optionMacroSelected ${className}">${argText}${extraComment}</span>`;
}
}
} else if (this.payload[i].name === 'comment') {
......@@ -167,9 +165,10 @@ Macro.add('options', {
}
}
jQuery(this.output).wiki(
`<span class=optionMacro ${currentOptionIsNumber ? 'optionMacroNumber' : ``}>` +
`<span class=optionDescription> ${title} ${description} </span>` +
`<span class=optionValue> ${output} </span> ${comment ? `<span class=optionComment>// ${comment} //</span>` : ``}` +
`<span class="optionMacro ${currentOptionIsNumber ? 'optionMacroNumber' : ''}">` +
`<span class="optionDescription">${title} ${description} </span>` +
`<span class="optionValue">${output}</span>` +
`${comment ? '<span class="optionComment">//${comment}//</span>' : ''}` +
`</span>`);
} catch (ex) {
return this.error('bad options expression: ' + ex.message);
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment