From abe9b41ddf1a0481f1450d9a56e846aa3367f365 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 14 Jul 2022 02:56:25 +0200 Subject: [PATCH] DEV: Fix various typos (#17485) --- .../discourse/app/components/emoji-picker.js | 2 +- .../app/components/software-update-prompt.js | 2 +- .../discourse/app/controllers/about.js | 2 +- .../app/controllers/preferences/sidebar.js | 4 +-- .../app/controllers/second-factor-auth.js | 2 +- .../javascripts/discourse/app/lib/lock-on.js | 2 +- .../app/lib/media-optimization-utils.js | 4 +-- .../javascripts/discourse/app/lib/text.js | 2 +- .../javascripts/discourse/app/lib/url.js | 26 +++++++++---------- .../discourse/app/lib/utilities.js | 2 +- .../app/mixins/mobile-scroll-direction.js | 2 +- .../app/mixins/textarea-text-manipulation.js | 6 ++--- .../discourse/app/mixins/uppy-upload.js | 2 +- .../discourse/app/models/post-stream.js | 6 ++--- .../private-message-topic-tracking-state.js | 2 +- .../app/routes/preferences-sidebar.js | 2 +- .../discourse/app/templates/about.hbs | 3 +-- .../app/templates/components/emoji-picker.hbs | 2 +- .../app/templates/preferences/sidebar.hbs | 4 +-- .../discourse/app/widgets/header.js | 2 +- .../tests/acceptance/sidebar-mobile-test.js | 2 +- .../stylesheets/vendor/normalize-ext.scss | 2 +- spec/requests/users_controller_spec.rb | 4 +-- 23 files changed, 43 insertions(+), 44 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/emoji-picker.js b/app/assets/javascripts/discourse/app/components/emoji-picker.js index dfe9f2dcb09..8b59b52d363 100644 --- a/app/assets/javascripts/discourse/app/components/emoji-picker.js +++ b/app/assets/javascripts/discourse/app/components/emoji-picker.js @@ -186,7 +186,7 @@ export default Component.extend({ }), @action - onClearRecents() { + onClearRecent() { this.emojiStore.favorites = []; this.set("recentEmojis", []); }, diff --git a/app/assets/javascripts/discourse/app/components/software-update-prompt.js b/app/assets/javascripts/discourse/app/components/software-update-prompt.js index b8a864f0db8..08b06eab02d 100644 --- a/app/assets/javascripts/discourse/app/components/software-update-prompt.js +++ b/app/assets/javascripts/discourse/app/components/software-update-prompt.js @@ -18,7 +18,7 @@ export default Component.extend({ }, @on("init") - initSubscribtions() { + initSubscriptions() { this.messageBus.subscribe("/refresh_client", () => { this.session.requiresRefresh = true; }); diff --git a/app/assets/javascripts/discourse/app/controllers/about.js b/app/assets/javascripts/discourse/app/controllers/about.js index b22ce0d0cd5..c1fd19fa05a 100644 --- a/app/assets/javascripts/discourse/app/controllers/about.js +++ b/app/assets/javascripts/discourse/app/controllers/about.js @@ -4,7 +4,7 @@ import discourseComputed from "discourse-common/utils/decorators"; import { gt } from "@ember/object/computed"; export default Controller.extend({ - faqOverriden: gt("siteSettings.faq_url.length", 0), + faqOverridden: gt("siteSettings.faq_url.length", 0), @discourseComputed("model.contact_url", "model.contact_email") contactInfo(url, email) { diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/sidebar.js b/app/assets/javascripts/discourse/app/controllers/preferences/sidebar.js index ba396e12a39..73c840b008a 100644 --- a/app/assets/javascripts/discourse/app/controllers/preferences/sidebar.js +++ b/app/assets/javascripts/discourse/app/controllers/preferences/sidebar.js @@ -6,7 +6,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error"; export default class extends Controller { @tracked saved = false; - @tracked selectedSiderbarCategories = []; + @tracked selectedSidebarCategories = []; @tracked selectedSidebarTagNames = []; @action @@ -18,7 +18,7 @@ export default class extends Controller { this.model.set( "sidebarCategoryIds", - this.selectedSiderbarCategories.mapBy("id") + this.selectedSidebarCategories.mapBy("id") ); this.model diff --git a/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js b/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js index 4de8d672c31..8e88afdf95d 100644 --- a/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js +++ b/app/assets/javascripts/discourse/app/controllers/second-factor-auth.js @@ -72,7 +72,7 @@ export default Controller.extend({ } else if (backupCodesAvailable) { return BACKUP_CODE; } else { - throw new Error("unpexected state of user 2fa settings!"); + throw new Error("unexpected state of user 2fa settings!"); } } }, diff --git a/app/assets/javascripts/discourse/app/lib/lock-on.js b/app/assets/javascripts/discourse/app/lib/lock-on.js index 9c77de68d02..4f18588f3d6 100644 --- a/app/assets/javascripts/discourse/app/lib/lock-on.js +++ b/app/assets/javascripts/discourse/app/lib/lock-on.js @@ -1,7 +1,7 @@ import { bind } from "discourse-common/utils/decorators"; import { headerOffset } from "discourse/lib/offset-calculator"; -// Dear traveller, you are entering a zone where we are at war with the browser. +// Dear traveler, you are entering a zone where we are at war with the browser. // The browser is insisting on positioning scrollTop per the location it was in // the past, we are insisting on it being where we want it to be. // The hack is just to keep trying over and over to position the scrollbar (up to 1 second). diff --git a/app/assets/javascripts/discourse/app/lib/media-optimization-utils.js b/app/assets/javascripts/discourse/app/lib/media-optimization-utils.js index 361b589564c..7fd07768a63 100644 --- a/app/assets/javascripts/discourse/app/lib/media-optimization-utils.js +++ b/app/assets/javascripts/discourse/app/lib/media-optimization-utils.js @@ -32,7 +32,7 @@ async function fileToDrawable(file) { } } -function drawableToimageData(drawable) { +function drawableToImageData(drawable) { const width = drawable.width, height = drawable.height, sx = 0, @@ -80,7 +80,7 @@ function jpegDecodeFailure(type, imageData) { export async function fileToImageData(file) { const drawable = await fileToDrawable(file); - const imageData = drawableToimageData(drawable); + const imageData = drawableToImageData(drawable); if (isTransparent(file.type, imageData)) { throw "Image has transparent pixels, won't convert to JPEG!"; diff --git a/app/assets/javascripts/discourse/app/lib/text.js b/app/assets/javascripts/discourse/app/lib/text.js index 24d97d6a942..3ee8baea18f 100644 --- a/app/assets/javascripts/discourse/app/lib/text.js +++ b/app/assets/javascripts/discourse/app/lib/text.js @@ -43,7 +43,7 @@ export function cookAsync(text, options) { } // Warm up pretty text with a set of options and return a function -// which can be used to cook without rebuilding prettytext every time +// which can be used to cook without rebuilding pretty-text every time export function generateCookFunction(options) { return loadMarkdownIt().then(() => { const prettyText = createPrettyText(options); diff --git a/app/assets/javascripts/discourse/app/lib/url.js b/app/assets/javascripts/discourse/app/lib/url.js index 6c092a4f810..9d168964c59 100644 --- a/app/assets/javascripts/discourse/app/lib/url.js +++ b/app/assets/javascripts/discourse/app/lib/url.js @@ -71,7 +71,7 @@ export function groupPath(subPath) { let _jumpScheduled = false; let _transitioning = false; -let lockon = null; +let lockOn = null; export function jumpToElement(elementId) { if (_jumpScheduled || isEmpty(elementId)) { @@ -82,17 +82,17 @@ export function jumpToElement(elementId) { _jumpScheduled = true; schedule("afterRender", function () { - if (lockon) { - lockon.clearLock(); + if (lockOn) { + lockOn.clearLock(); } - lockon = new LockOn(selector, { + lockOn = new LockOn(selector, { finished() { _jumpScheduled = false; - lockon = null; + lockOn = null; }, }); - lockon.lock(); + lockOn.lock(); }); } @@ -142,20 +142,20 @@ const DiscourseURL = EmberObject.extend({ holder = document.querySelector(selector); } - if (lockon) { - lockon.clearLock(); + if (lockOn) { + lockOn.clearLock(); } - lockon = new LockOn(selector, { + lockOn = new LockOn(selector, { originalTopOffset: opts.originalTopOffset, finished() { _transitioning = false; - lockon = null; + lockOn = null; }, }); if (holder && opts.skipIfOnScreen) { - const elementTop = lockon.elementTop(); + const elementTop = lockOn.elementTop(); const scrollTop = $(window).scrollTop(); const windowHeight = $(window).height() - offsetCalculator(); const height = $(holder).height(); @@ -169,8 +169,8 @@ const DiscourseURL = EmberObject.extend({ } } - lockon.lock(); - if (lockon.elementTop() < 1) { + lockOn.lock(); + if (lockOn.elementTop() < 1) { _transitioning = false; return; } diff --git a/app/assets/javascripts/discourse/app/lib/utilities.js b/app/assets/javascripts/discourse/app/lib/utilities.js index 2d9da305638..6865c17ce16 100644 --- a/app/assets/javascripts/discourse/app/lib/utilities.js +++ b/app/assets/javascripts/discourse/app/lib/utilities.js @@ -527,7 +527,7 @@ export function clipboardCopy(text) { return clipboardCopyFallback(text); } -// Use this verison of clipboardCopy if you must use an AJAX call +// Use this version of clipboardCopy if you must use an AJAX call // to retrieve/generate server-side text to copy to the clipboard, // otherwise this write function will error in certain browsers, because // the time taken from the user event to the clipboard text being copied diff --git a/app/assets/javascripts/discourse/app/mixins/mobile-scroll-direction.js b/app/assets/javascripts/discourse/app/mixins/mobile-scroll-direction.js index 467fea56d67..27a31a8c459 100644 --- a/app/assets/javascripts/discourse/app/mixins/mobile-scroll-direction.js +++ b/app/assets/javascripts/discourse/app/mixins/mobile-scroll-direction.js @@ -46,7 +46,7 @@ export default Mixin.create({ } // If the user reaches the very bottom of the topic, we only want to reset - // this scroll direction after a second scrolldown. This is a nicer event + // this scroll direction after a second scroll down. This is a nicer event // similar to what Safari and Chrome do. discourseDebounce( this, diff --git a/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js b/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js index 4a790832441..46e4b7cc729 100644 --- a/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js +++ b/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js @@ -533,10 +533,10 @@ export default Mixin.create({ // * * const indentationRegexp = new RegExp(`^${indentationChar}+`); const lineStartsWithIndentationChar = lineVal.match(indentationRegexp); - const intentationCharsBeforeSelection = value.match(indentationRegexp); + const indentationCharsBeforeSelection = value.match(indentationRegexp); if (lineStartsWithIndentationChar) { - const charsToSubtract = intentationCharsBeforeSelection - ? intentationCharsBeforeSelection[0] + const charsToSubtract = indentationCharsBeforeSelection + ? indentationCharsBeforeSelection[0] : ""; value = lineStartsWithIndentationChar[0].replace(charsToSubtract, "") + value; diff --git a/app/assets/javascripts/discourse/app/mixins/uppy-upload.js b/app/assets/javascripts/discourse/app/mixins/uppy-upload.js index 320f151a4c1..95991d5b2f1 100644 --- a/app/assets/javascripts/discourse/app/mixins/uppy-upload.js +++ b/app/assets/javascripts/discourse/app/mixins/uppy-upload.js @@ -147,7 +147,7 @@ export default Mixin.create(UppyS3Multipart, ExtendableUploader, { }, }); - // droptarget is a UI plugin, only preprocessors must call _useUploadPlugin + // DropTarget is a UI plugin, only preprocessors must call _useUploadPlugin this._uppyInstance.use(DropTarget, this._uploadDropTargetOptions()); this._uppyInstance.on("progress", (progress) => { diff --git a/app/assets/javascripts/discourse/app/models/post-stream.js b/app/assets/javascripts/discourse/app/models/post-stream.js index c03dbb6f45a..1e512afae19 100644 --- a/app/assets/javascripts/discourse/app/models/post-stream.js +++ b/app/assets/javascripts/discourse/app/models/post-stream.js @@ -243,7 +243,7 @@ export default RestModel.extend({ }); }, - refreshAndJumptoSecondVisible() { + refreshAndJumpToSecondVisible() { return this.refresh({}).then(() => { if (this.posts && this.posts.length > 1) { DiscourseURL.jumpToPost(this.posts[1].get("post_number")); @@ -254,14 +254,14 @@ export default RestModel.extend({ showSummary() { this.cancelFilter(); this.set("filter", "summary"); - return this.refreshAndJumptoSecondVisible(); + return this.refreshAndJumpToSecondVisible(); }, // Filter the stream to a particular user. filterParticipant(username) { this.cancelFilter(); this.userFilters.addObject(username); - return this.refreshAndJumptoSecondVisible(); + return this.refreshAndJumpToSecondVisible(); }, filterReplies(postNumber, postId) { diff --git a/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js b/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js index 1c95bbfcaa8..c1ee74e6fee 100644 --- a/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js +++ b/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js @@ -185,7 +185,7 @@ const PrivateMessageTopicTrackingState = EmberObject.extend({ break; case "unread": - // Note: At some point we may want to make the same peformance optimisation + // Note: At some point we may want to make the same performance optimisation // here as we did with the other topic tracking state, where we only send // one 'unread' update to all users, not a more accurate unread update to // each individual user with their own read state. In this case, we need to diff --git a/app/assets/javascripts/discourse/app/routes/preferences-sidebar.js b/app/assets/javascripts/discourse/app/routes/preferences-sidebar.js index b93e9b33d9a..26e50bf84bf 100644 --- a/app/assets/javascripts/discourse/app/routes/preferences-sidebar.js +++ b/app/assets/javascripts/discourse/app/routes/preferences-sidebar.js @@ -6,7 +6,7 @@ export default RestrictedUserRoute.extend({ setupController(controller, user) { const props = { model: user, - selectedSiderbarCategories: user.sidebarCategories, + selectedSidebarCategories: user.sidebarCategories, }; if (this.siteSettings.tagging_enabled) { diff --git a/app/assets/javascripts/discourse/app/templates/about.hbs b/app/assets/javascripts/discourse/app/templates/about.hbs index 45acef09e24..99d9249d4dd 100644 --- a/app/assets/javascripts/discourse/app/templates/about.hbs +++ b/app/assets/javascripts/discourse/app/templates/about.hbs @@ -4,7 +4,7 @@