1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

chore: fix typos (#4021)

This commit is contained in:
Viktor Szépe
2024-10-21 17:00:56 +02:00
committed by GitHub
parent 084ae6fceb
commit 265d0e1dd1
28 changed files with 47 additions and 47 deletions

View File

@@ -12,7 +12,7 @@ export interface IExportRegistry {
add(namespace: string, id: string, object: any): void;
/**
* Add a function to run when object of id "id" is added (or overriden).
* Add a function to run when object of id "id" is added (or overridden).
* If such an object is already registered, the handler will be applied immediately.
*/
onLoad(namespace: string, id: string, handler: Function): void;

View File

@@ -7,7 +7,7 @@ const w = window as any;
* Proxy app. Common JS is run first, at which point `window.app` is not
* set as this is done by the namespaced JS.
*
* When the corrent value is set, this code would retain the reference to
* When the current value is set, this code would retain the reference to
* the original invalid value.
*
* By using a proxy, we can ensure that our `window.app` value is always

View File

@@ -26,7 +26,7 @@ export default class DefaultResolver<
/**
* When a route change results in a changed key, a full page
* rerender occurs. This method can be overriden in subclasses
* rerender occurs. This method can be overridden in subclasses
* to prevent rerenders on some route changes.
*/
makeKey(): string {

View File

@@ -289,19 +289,19 @@ function makePrefix(index: number, unorderedList: boolean): string {
}
function clearExistingListStyle(style: StyleArgs, selectedText: string): [UndoResult, UndoResult, string] {
let undoResultOpositeList: UndoResult;
let undoResultOppositeList: UndoResult;
let undoResult: UndoResult;
let pristineText;
if (style.orderedList) {
undoResult = undoOrderedListStyle(selectedText);
undoResultOpositeList = undoUnorderedListStyle(undoResult.text);
pristineText = undoResultOpositeList.text;
undoResultOppositeList = undoUnorderedListStyle(undoResult.text);
pristineText = undoResultOppositeList.text;
} else {
undoResult = undoUnorderedListStyle(selectedText);
undoResultOpositeList = undoOrderedListStyle(undoResult.text);
pristineText = undoResultOpositeList.text;
undoResultOppositeList = undoOrderedListStyle(undoResult.text);
pristineText = undoResultOppositeList.text;
}
return [undoResult, undoResultOpositeList, pristineText];
return [undoResult, undoResultOppositeList, pristineText];
}
function listStyle(textarea: HTMLTextAreaElement, style: StyleArgs): SelectionRange {
@@ -316,7 +316,7 @@ function listStyle(textarea: HTMLTextAreaElement, style: StyleArgs): SelectionRa
// If the user intent was to do an undo, we will stop after this.
// Otherwise, we will still undo to other list type to prevent list stacking
const [undoResult, undoResultOpositeList, pristineText] = clearExistingListStyle(style, selectedText);
const [undoResult, undoResultOppositeList, pristineText] = clearExistingListStyle(style, selectedText);
const prefixedLines = pristineText.split('\n').map((value, index) => {
return `${makePrefix(index, style.unorderedList)}${value}`;
@@ -326,7 +326,7 @@ function listStyle(textarea: HTMLTextAreaElement, style: StyleArgs): SelectionRa
return previousValue + makePrefix(currentIndex, style.unorderedList).length;
}, 0);
const totalPrefixLengthOpositeList = prefixedLines.reduce((previousValue, _currentValue, currentIndex) => {
const totalPrefixLengthOppositeList = prefixedLines.reduce((previousValue, _currentValue, currentIndex) => {
return previousValue + makePrefix(currentIndex, !style.unorderedList).length;
}, 0);
@@ -348,9 +348,9 @@ function listStyle(textarea: HTMLTextAreaElement, style: StyleArgs): SelectionRa
selectionStart = Math.max(selectionStart + makePrefix(0, style.unorderedList).length + newlinesToAppend.length, 0);
selectionEnd = selectionStart;
} else {
if (undoResultOpositeList.processed) {
if (undoResultOppositeList.processed) {
selectionStart = Math.max(textarea.selectionStart + newlinesToAppend.length, 0);
selectionEnd = textarea.selectionEnd + newlinesToAppend.length + totalPrefixLength - totalPrefixLengthOpositeList;
selectionEnd = textarea.selectionEnd + newlinesToAppend.length + totalPrefixLength - totalPrefixLengthOppositeList;
} else {
selectionStart = Math.max(textarea.selectionStart + newlinesToAppend.length, 0);
selectionEnd = textarea.selectionEnd + newlinesToAppend.length + totalPrefixLength;

View File

@@ -38,7 +38,7 @@ export default class DiscussionListPane extends Component {
$(document).on('mousemove', hotEdge);
// When coming from another discussion, scroll to the previous postition
// When coming from another discussion, scroll to the previous position
// to prevent the discussion list jumping around.
if (app.previous.matches(DiscussionPage)) {
const top = app.cache.discussionListPaneScrollTop || 0;

View File

@@ -179,7 +179,7 @@ export default class PostStreamScrubber extends Component {
heights.after = 100 - heights.before - heights.handle;
// If the stream is paused, don't change height on scroll, as the viewport is being scrolled by the JS
// If a height change animation is already in progress, don't adjust height unless overriden
// If a height change animation is already in progress, don't adjust height unless overridden
if ((options.fromScroll && this.stream.paused) || (this.adjustingHeight && !options.forceHeightChange)) return;
const func = options.animate ? 'animate' : 'css';

View File

@@ -19,7 +19,7 @@ export default class DiscussionPageResolver<
* Remove optional parts of a discussion's slug to keep the substring
* that bijectively maps to a discussion object. By default this just
* extracts the numerical ID from the slug. If a custom discussion
* slugging driver is used, this may need to be overriden.
* slugging driver is used, this may need to be overridden.
* @param slug
*/
canonicalizeDiscussionSlug(slug: string | undefined) {

View File

@@ -17,13 +17,13 @@ export default class GlobalSearchState extends SearchState {
// We can't do this in the constructor, as this class is instantiated
// before pages are rendered, and we need app.current.
if (!this.initialValueSet && this.currPageProvidesSearch()) {
this.intializeValue();
this.initializeValue();
}
return super.getValue();
}
protected intializeValue() {
protected initializeValue() {
this.setValue(this.getInitialSearch());
this.initialValueSet = true;
}

View File

@@ -5,7 +5,7 @@
*
* It relies on the element having children with particular CSS classes.
*
* The function returns a record with a `reset` proeprty. This is a function
* The function returns a record with a `reset` property. This is a function
* which reverts the slider to its original position. This should be called,
* for example, when a controls dropdown is closed.
*