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 @action
onClearRecents() { onClearRecent() {
this.emojiStore.favorites = []; this.emojiStore.favorites = [];
this.set("recentEmojis", []); this.set("recentEmojis", []);
}, },

View File

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

View File

@ -4,7 +4,7 @@ import discourseComputed from "discourse-common/utils/decorators";
import { gt } from "@ember/object/computed"; import { gt } from "@ember/object/computed";
export default Controller.extend({ 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") @discourseComputed("model.contact_url", "model.contact_email")
contactInfo(url, email) { contactInfo(url, email) {

View File

@ -6,7 +6,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
export default class extends Controller { export default class extends Controller {
@tracked saved = false; @tracked saved = false;
@tracked selectedSiderbarCategories = []; @tracked selectedSidebarCategories = [];
@tracked selectedSidebarTagNames = []; @tracked selectedSidebarTagNames = [];
@action @action
@ -18,7 +18,7 @@ export default class extends Controller {
this.model.set( this.model.set(
"sidebarCategoryIds", "sidebarCategoryIds",
this.selectedSiderbarCategories.mapBy("id") this.selectedSidebarCategories.mapBy("id")
); );
this.model this.model

View File

@ -72,7 +72,7 @@ export default Controller.extend({
} else if (backupCodesAvailable) { } else if (backupCodesAvailable) {
return BACKUP_CODE; return BACKUP_CODE;
} else { } 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 { bind } from "discourse-common/utils/decorators";
import { headerOffset } from "discourse/lib/offset-calculator"; 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 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 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). // 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, const width = drawable.width,
height = drawable.height, height = drawable.height,
sx = 0, sx = 0,
@ -80,7 +80,7 @@ function jpegDecodeFailure(type, imageData) {
export async function fileToImageData(file) { export async function fileToImageData(file) {
const drawable = await fileToDrawable(file); const drawable = await fileToDrawable(file);
const imageData = drawableToimageData(drawable); const imageData = drawableToImageData(drawable);
if (isTransparent(file.type, imageData)) { if (isTransparent(file.type, imageData)) {
throw "Image has transparent pixels, won't convert to JPEG!"; 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 // 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) { export function generateCookFunction(options) {
return loadMarkdownIt().then(() => { return loadMarkdownIt().then(() => {
const prettyText = createPrettyText(options); const prettyText = createPrettyText(options);

View File

@ -71,7 +71,7 @@ export function groupPath(subPath) {
let _jumpScheduled = false; let _jumpScheduled = false;
let _transitioning = false; let _transitioning = false;
let lockon = null; let lockOn = null;
export function jumpToElement(elementId) { export function jumpToElement(elementId) {
if (_jumpScheduled || isEmpty(elementId)) { if (_jumpScheduled || isEmpty(elementId)) {
@ -82,17 +82,17 @@ export function jumpToElement(elementId) {
_jumpScheduled = true; _jumpScheduled = true;
schedule("afterRender", function () { schedule("afterRender", function () {
if (lockon) { if (lockOn) {
lockon.clearLock(); lockOn.clearLock();
} }
lockon = new LockOn(selector, { lockOn = new LockOn(selector, {
finished() { finished() {
_jumpScheduled = false; _jumpScheduled = false;
lockon = null; lockOn = null;
}, },
}); });
lockon.lock(); lockOn.lock();
}); });
} }
@ -142,20 +142,20 @@ const DiscourseURL = EmberObject.extend({
holder = document.querySelector(selector); holder = document.querySelector(selector);
} }
if (lockon) { if (lockOn) {
lockon.clearLock(); lockOn.clearLock();
} }
lockon = new LockOn(selector, { lockOn = new LockOn(selector, {
originalTopOffset: opts.originalTopOffset, originalTopOffset: opts.originalTopOffset,
finished() { finished() {
_transitioning = false; _transitioning = false;
lockon = null; lockOn = null;
}, },
}); });
if (holder && opts.skipIfOnScreen) { if (holder && opts.skipIfOnScreen) {
const elementTop = lockon.elementTop(); const elementTop = lockOn.elementTop();
const scrollTop = $(window).scrollTop(); const scrollTop = $(window).scrollTop();
const windowHeight = $(window).height() - offsetCalculator(); const windowHeight = $(window).height() - offsetCalculator();
const height = $(holder).height(); const height = $(holder).height();
@ -169,8 +169,8 @@ const DiscourseURL = EmberObject.extend({
} }
} }
lockon.lock(); lockOn.lock();
if (lockon.elementTop() < 1) { if (lockOn.elementTop() < 1) {
_transitioning = false; _transitioning = false;
return; return;
} }

View File

@ -527,7 +527,7 @@ export function clipboardCopy(text) {
return clipboardCopyFallback(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, // to retrieve/generate server-side text to copy to the clipboard,
// otherwise this write function will error in certain browsers, because // otherwise this write function will error in certain browsers, because
// the time taken from the user event to the clipboard text being copied // 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 // 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. // similar to what Safari and Chrome do.
discourseDebounce( discourseDebounce(
this, this,

View File

@ -533,10 +533,10 @@ export default Mixin.create({
// * * // * *
const indentationRegexp = new RegExp(`^${indentationChar}+`); const indentationRegexp = new RegExp(`^${indentationChar}+`);
const lineStartsWithIndentationChar = lineVal.match(indentationRegexp); const lineStartsWithIndentationChar = lineVal.match(indentationRegexp);
const intentationCharsBeforeSelection = value.match(indentationRegexp); const indentationCharsBeforeSelection = value.match(indentationRegexp);
if (lineStartsWithIndentationChar) { if (lineStartsWithIndentationChar) {
const charsToSubtract = intentationCharsBeforeSelection const charsToSubtract = indentationCharsBeforeSelection
? intentationCharsBeforeSelection[0] ? indentationCharsBeforeSelection[0]
: ""; : "";
value = value =
lineStartsWithIndentationChar[0].replace(charsToSubtract, "") + 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.use(DropTarget, this._uploadDropTargetOptions());
this._uppyInstance.on("progress", (progress) => { this._uppyInstance.on("progress", (progress) => {

View File

@ -243,7 +243,7 @@ export default RestModel.extend({
}); });
}, },
refreshAndJumptoSecondVisible() { refreshAndJumpToSecondVisible() {
return this.refresh({}).then(() => { return this.refresh({}).then(() => {
if (this.posts && this.posts.length > 1) { if (this.posts && this.posts.length > 1) {
DiscourseURL.jumpToPost(this.posts[1].get("post_number")); DiscourseURL.jumpToPost(this.posts[1].get("post_number"));
@ -254,14 +254,14 @@ export default RestModel.extend({
showSummary() { showSummary() {
this.cancelFilter(); this.cancelFilter();
this.set("filter", "summary"); this.set("filter", "summary");
return this.refreshAndJumptoSecondVisible(); return this.refreshAndJumpToSecondVisible();
}, },
// Filter the stream to a particular user. // Filter the stream to a particular user.
filterParticipant(username) { filterParticipant(username) {
this.cancelFilter(); this.cancelFilter();
this.userFilters.addObject(username); this.userFilters.addObject(username);
return this.refreshAndJumptoSecondVisible(); return this.refreshAndJumpToSecondVisible();
}, },
filterReplies(postNumber, postId) { filterReplies(postNumber, postId) {

View File

@ -185,7 +185,7 @@ const PrivateMessageTopicTrackingState = EmberObject.extend({
break; break;
case "unread": 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 // 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 // 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 // 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) { setupController(controller, user) {
const props = { const props = {
model: user, model: user,
selectedSiderbarCategories: user.sidebarCategories, selectedSidebarCategories: user.sidebarCategories,
}; };
if (this.siteSettings.tagging_enabled) { if (this.siteSettings.tagging_enabled) {

View File

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

View File

@ -33,7 +33,7 @@
<div class="section recent" data-section="recent"> <div class="section recent" data-section="recent">
<div class="section-header"> <div class="section-header">
<span class="title">{{i18n "emoji_picker.recent"}}</span> <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>
<div class="section-group"> <div class="section-group">
{{#each this.recentEmojis as |emoji|}} {{#each this.recentEmojis as |emoji|}}

View File

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

View File

@ -515,7 +515,7 @@ export default createWidget("header", {
}, },
preventDefault(e) { 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(); const height = window.innerHeight ? window.innerHeight : $(window).height();
if ( if (
!$(e.target).parents(".menu-panel").length || !$(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 visit("/");
await click(".btn-sidebar-toggle"); await click(".btn-sidebar-toggle");

View File

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

View File

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