DEV: Fix various typos (#17485)

This commit is contained in:
Jarek Radosz 2022-07-14 02:56:25 +02:00 committed by GitHub
parent ee89c68687
commit abe9b41ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 43 additions and 44 deletions

View File

@ -186,7 +186,7 @@ export default Component.extend({
}),
@action
onClearRecents() {
onClearRecent() {
this.emojiStore.favorites = [];
this.set("recentEmojis", []);
},

View File

@ -18,7 +18,7 @@ export default Component.extend({
},
@on("init")
initSubscribtions() {
initSubscriptions() {
this.messageBus.subscribe("/refresh_client", () => {
this.session.requiresRefresh = true;
});

View File

@ -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) {

View File

@ -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

View File

@ -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!");
}
}
},

View File

@ -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).

View File

@ -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!";

View File

@ -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);

View File

@ -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;
}

View File

@ -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

View File

@ -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,

View File

@ -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;

View File

@ -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) => {

View File

@ -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) {

View File

@ -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

View File

@ -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) {

View File

@ -4,7 +4,7 @@
<ul class="nav-pills">
<li class="nav-item-about"><LinkTo @route="about" class="active">{{i18n "about.simple_title"}}</LinkTo></li>
{{#if this.faqOverriden}}
{{#if this.faqOverridden}}
<li class="nav-item-guidelines"><LinkTo @route="guidelines">{{i18n "guidelines"}}</LinkTo></li>
<li class="nav-item-faq"><LinkTo @route="faq">{{i18n "faq"}}</LinkTo></li>
{{else}}
@ -27,7 +27,6 @@
<AboutPageUsers @users={{this.model.admins}} />
<div class="clearfix"></div>
</section>
{{/if}}

View File

@ -33,7 +33,7 @@
<div class="section recent" data-section="recent">
<div class="section-header">
<span class="title">{{i18n "emoji_picker.recent"}}</span>
<DButton @icon="trash-alt" @action={{action "onClearRecents"}} @class="trash-recent" />
<DButton @icon="trash-alt" @action={{action "onClearRecent"}} @class="trash-recent" />
</div>
<div class="section-group">
{{#each this.recentEmojis as |emoji|}}

View File

@ -13,8 +13,8 @@
<div class="controls">
<CategorySelector
@categories={{this.selectedSiderbarCategories}}
@onChange={{action (mut this.selectedSiderbarCategories)}}
@categories={{this.selectedSidebarCategories}}
@onChange={{action (mut this.selectedSidebarCategories)}}
@options={{hash
allowUncategorized=(not this.siteSettings.suppress_uncategorized_badge)
displayCategoryDescription=true

View File

@ -515,7 +515,7 @@ export default createWidget("header", {
},
preventDefault(e) {
// prevent all scrollin on menu panels, except on overflow
// prevent all scrolling on menu panels, except on overflow
const height = window.innerHeight ? window.innerHeight : $(window).height();
if (
!$(e.target).parents(".menu-panel").length ||

View File

@ -44,7 +44,7 @@ acceptance("Sidebar - Mobile - User with sidebar enabled", function (needs) {
);
});
test("collpasing sidebar sections does not collapse sidebar", async function (assert) {
test("collapsing sidebar sections does not collapse sidebar", async function (assert) {
await visit("/");
await click(".btn-sidebar-toggle");

View File

@ -1,4 +1,4 @@
/* Discourse custom changes for backward compatiblity
/* Discourse custom changes for backward compatibility
========================================================================== */
button,

View File

@ -2340,13 +2340,13 @@ describe UsersController do
it "should allow user to modify category sidebar section links" do
category = Fabricate(:category)
restricted_category = Fabricate(:category, read_restricted: true)
category_siderbar_section_link = Fabricate(:category_sidebar_section_link, user: user)
category_sidebar_section_link = Fabricate(:category_sidebar_section_link, user: user)
put "/u/#{user.username}.json", params: { sidebar_category_ids: [category.id, restricted_category.id] }
expect(response.status).to eq(200)
expect(user.sidebar_section_links.count).to eq(1)
expect(SidebarSectionLink.exists?(id: category_siderbar_section_link.id)).to eq(false)
expect(SidebarSectionLink.exists?(id: category_sidebar_section_link.id)).to eq(false)
sidebar_section_link = user.sidebar_section_links.first