Use JSON.stringify instead and fix linter
This commit is contained in:
parent
a84f8e2808
commit
ffe17a6bc9
1 changed files with 9 additions and 7 deletions
|
@ -10,12 +10,8 @@ define([
|
||||||
return $('<pre>', opt).text(text);
|
return $('<pre>', opt).text(text);
|
||||||
};
|
};
|
||||||
|
|
||||||
var addSlashes = function (text) {
|
|
||||||
return (text + '').replace(/[\\']/g, '\\\'');
|
|
||||||
}
|
|
||||||
|
|
||||||
var todo = function (missing) {
|
var todo = function (missing) {
|
||||||
var str = "";;
|
var str = "";
|
||||||
var need = 1;
|
var need = 1;
|
||||||
|
|
||||||
if (missing.length) {
|
if (missing.length) {
|
||||||
|
@ -27,19 +23,25 @@ define([
|
||||||
|
|
||||||
if (str !== code) {
|
if (str !== code) {
|
||||||
if (str !== "")
|
if (str !== "")
|
||||||
|
{
|
||||||
res += '\n';
|
res += '\n';
|
||||||
|
}
|
||||||
str = code;
|
str = code;
|
||||||
res += '/*\n *\n * ' + code + '\n *\n */\n\n';
|
res += '/*\n *\n * ' + code + '\n *\n */\n\n';
|
||||||
}
|
}
|
||||||
if (need !== needed) {
|
if (need !== needed) {
|
||||||
need = needed;
|
need = needed;
|
||||||
if (need === 0)
|
if (need === 0)
|
||||||
|
{
|
||||||
res += '\n// TODO: These keys are not needed anymore and should be removed ('+ code + ')\n\n';
|
res += '\n// TODO: These keys are not needed anymore and should be removed ('+ code + ')\n\n';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res += (need ? '' : '// ') + 'out.' + key + ' = \'\';';
|
res += (need ? '' : '// ') + 'out.' + key + ' = "";';
|
||||||
if (need)
|
if (need)
|
||||||
res += ' // \'' + addSlashes(Cryptpad.Messages._getKey(key, [])) + '\'';
|
{
|
||||||
|
res += ' // ' + JSON.stringify(Cryptpad.Messages._getKey(key, []));
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}).join('\n')));
|
}).join('\n')));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue