mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
prefer const when not reasigned
This commit is contained in:
parent
64336a8c75
commit
f8e5cbd81a
@ -338,7 +338,7 @@ export default Ember.Component.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onKeyUp(text, cp) {
|
onKeyUp(text, cp) {
|
||||||
var subtext = text.substring(0, cp);
|
const subtext = text.substring(0, cp);
|
||||||
return subtext.match(/(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/gm);
|
return subtext.match(/(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/gm);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ export default Ember.Component.extend({
|
|||||||
return resolve([translations[full]]);
|
return resolve([translations[full]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
let match = term.match(/^:?(.*?):t(\d)?$/);
|
const match = term.match(/^:?(.*?):t(\d)?$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
let name = match[1];
|
let name = match[1];
|
||||||
let scale = match[2];
|
let scale = match[2];
|
||||||
|
@ -64,7 +64,7 @@ export function buildEmojiUrl(code, opts) {
|
|||||||
url = opts.customEmoji[code];
|
url = opts.customEmoji[code];
|
||||||
}
|
}
|
||||||
|
|
||||||
let noToneMatch = code.match(/(.?[\w-]*)?:?/);
|
const noToneMatch = code.match(/(.?[\w-]*)?:?/);
|
||||||
if (noToneMatch && !url && (emojiHash.hasOwnProperty(noToneMatch[1]) || aliasHash.hasOwnProperty(noToneMatch[1]))) {
|
if (noToneMatch && !url && (emojiHash.hasOwnProperty(noToneMatch[1]) || aliasHash.hasOwnProperty(noToneMatch[1]))) {
|
||||||
url = opts.getURL(`/images/emoji/${opts.emojiSet}/${code.replace(/:t/, '/')}.png`);
|
url = opts.getURL(`/images/emoji/${opts.emojiSet}/${code.replace(/:t/, '/')}.png`);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user