diff --git a/bin/update_fonts.js b/bin/update_fonts.js index e3c9788d..b15fcda6 100644 --- a/bin/update_fonts.js +++ b/bin/update_fonts.js @@ -8,7 +8,7 @@ const dir = 'styles/fontello'; for(const file of fs.readdirSync(dir)) { if ( file.endsWith('.css') ) { const old_path = path.join(dir, file), - new_path = `${old_path.substr(0, old_path.length - 4)}.scss`; + new_path = `${old_path.slice(0, -4)}.scss`; fs.renameSync(old_path, new_path); } diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index 85c1b1ff..31db09ad 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -376,7 +376,7 @@ function mention_processAll(tokens, msg, user, color_mentions) { this.applyHighlight(msg, priority, null, 'mention', true); // Push the remaining text from the token. - text.push(segment.substr(match[0].length)); + text.push(segment.slice(match[0].length)); } } else @@ -493,7 +493,7 @@ export const Mentions = { this.applyHighlight(msg, priority, null, 'mention', true); // Push the remaining text from the token. - text.push(segment.substr(match[0].length)); + text.push(segment.slice(match[0].length)); } else text.push(segment); diff --git a/src/modules/main_menu/components/chat-tester.vue b/src/modules/main_menu/components/chat-tester.vue index 521f949b..ef235db5 100644 --- a/src/modules/main_menu/components/chat-tester.vue +++ b/src/modules/main_menu/components/chat-tester.vue @@ -438,8 +438,8 @@ export default { if ( idx === -1 ) msg.user = null; else { - msg.user = msg.prefix.substr(0, idx); - msg.prefix = msg.prefix.substr(idx); + msg.user = msg.prefix.slice(0, idx); + msg.prefix = msg.prefix.slice(idx); } return msg; diff --git a/src/modules/main_menu/components/profile-manager.vue b/src/modules/main_menu/components/profile-manager.vue index 4828f2be..3e6e1f3e 100644 --- a/src/modules/main_menu/components/profile-manager.vue +++ b/src/modules/main_menu/components/profile-manager.vue @@ -553,7 +553,7 @@ export default { if ( values ) for(const [key, value] of Object.entries(values)) { if ( key.startsWith(prefix) ) { - prof.set(key.substr(prefix.length), value); + prof.set(key.slice(prefix.length), value); i++; } } diff --git a/src/settings/components/page.vue b/src/settings/components/page.vue index 248a3ffc..d6e4e448 100644 --- a/src/settings/components/page.vue +++ b/src/settings/components/page.vue @@ -104,7 +104,7 @@ export default { out.push({ key: part.name, i18n: `settings.filter.page.route.${this.route.name}.${part.name}`, - title: name[0].toLocaleUpperCase() + name.substr(1), + title: name[0].toLocaleUpperCase() + name.slice(1), optional: part.optional }); } diff --git a/src/settings/context.js b/src/settings/context.js index 4c224628..08577815 100644 --- a/src/settings/context.js +++ b/src/settings/context.js @@ -277,7 +277,7 @@ export default class SettingsContext extends EventEmitter { if ( prefix && this._context_objects.has(prefix) ) { for(const key of Object.keys(this._context) ) if ( key.startsWith(prefix) ) { - const partial_key = key.substr(prefix.length); + const partial_key = key.slice(prefix.length); if ( ! keys.includes(partial_key) ) keys.push(partial_key); } diff --git a/src/settings/index.js b/src/settings/index.js index 0f3cd5c0..959f4111 100644 --- a/src/settings/index.js +++ b/src/settings/index.js @@ -690,7 +690,7 @@ export default class SettingsManager extends Module { // If we're still here, it means an individual setting was changed. // Look up the profile it belongs to and emit a changed event from // that profile, thus notifying any contexts or UI instances. - key = key.substr(2); + key = key.slice(2); // Is it a value? const idx = key.indexOf(':');