DEV: Fix random typos ()

This commit is contained in:
Jarek Radosz 2022-02-28 03:20:58 +01:00 committed by GitHub
parent cfe4ff8d56
commit 6f6406ea03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 29 additions and 29 deletions

View File

@ -113,7 +113,7 @@ const DiscourseLocation = EmberObject.extend({
Get the current `history.state`
Polyfill checks for native browser support and falls back to retrieving
from a private _historyState constiable
from a private _historyState variable
@method getState
*/

View File

@ -831,7 +831,7 @@ class PluginApi {
}
/**
* Register a desktop notificaiton handler
* Register a desktop notification handler
*
* ```javascript
* api.registerDesktopNotificationHandler((data, siteSettings, user) => {

View File

@ -40,7 +40,7 @@ export function registerTopicFooterDropdown(dropdown) {
priority: 0,
// an object used to display the state of the dropdown
// when no value is currectnly set, eg: { id: 1, name: "foo" }
// when no value is currently set, eg: { id: 1, name: "foo" }
noneItem: null,
};

View File

@ -19,7 +19,7 @@ const DEBOUNCING_DELAY = 50;
export default {
enqueue(type, params, callback) {
// makes sures the queue is not filling indefinitely
// makes sure the queue is not filling indefinitely
if (_queue.length >= MAX_QUEUE_SIZE) {
const removedJobs = _queue.splice(0, 1)[0];
removedJobs.forEach((job) => {

View File

@ -15,7 +15,7 @@ let testPresence = true;
// Check whether the document is currently visible, and the user is actively using the site
// Will return false if the browser went into the background more than `browserHiddenTime` milliseconds ago
// Will also return false if there has been no user activty for more than `userUnseenTime` milliseconds
// Will also return false if there has been no user activity for more than `userUnseenTime` milliseconds
// Otherwise, will return true
export default function userPresent({
browserHiddenTime = DEFAULT_BROWSER_HIDDEN_MS,

View File

@ -680,8 +680,8 @@ export default RestModel.extend({
});
},
/* mainly for backwards compatability with plugins, used in quick messages plugin
* TODO: remove July 2021
/* mainly for backwards compatibility with plugins, used in quick messages plugin
* TODO: remove July 2022
* */
triggerNewPostInStream(postId, opts) {
deprecated(

View File

@ -506,7 +506,7 @@ const TopicTrackingState = EmberObject.extend({
},
/**
* Calls the provided callback for each of the currenty tracked topics
* Calls the provided callback for each of the currently tracked topics
* we have in state.
*
* @method forEachTracked

View File

@ -759,8 +759,8 @@ const User = RestModel.extend({
},
@discourseComputed("watched_first_post_category_ids")
watchedFirstPostCategories(wachedFirstPostCategoryIds) {
return Category.findByIds(wachedFirstPostCategoryIds);
watchedFirstPostCategories(watchedFirstPostCategoryIds) {
return Category.findByIds(watchedFirstPostCategoryIds);
},
@discourseComputed("can_delete_account")

View File

@ -44,7 +44,7 @@ export default class MediaOptimizationWorkerService extends Service {
) {
return Promise.resolve();
}
await this.ensureAvailiableWorker();
await this.ensureAvailableWorker();
return new Promise(async (resolve) => {
this.logIfDebug(`Transforming ${file.name}`);
@ -88,7 +88,7 @@ export default class MediaOptimizationWorkerService extends Service {
});
}
async ensureAvailiableWorker() {
async ensureAvailableWorker() {
if (this.worker && this.workerInstalled) {
return Promise.resolve();
}

View File

@ -43,7 +43,7 @@ function buildHook(attributeName, setAttr) {
}
// For the majority of events, we register a single listener on the `<body>`, and then
// notify the relavent widget (if any) when the event fires (see setupDocumentCallback() below)
// notify the relevant widget (if any) when the event fires (see setupDocumentCallback() below)
export const WidgetClickHook = buildHook(CLICK_ATTRIBUTE_NAME);
export const WidgetDoubleClickHook = buildHook(DOUBLE_CLICK_ATTRIBUTE_NAME);
export const WidgetClickOutsideHook = buildHook(

View File

@ -73,7 +73,7 @@ async function triggerSwipeEnd({ x, y, touchTarget }) {
});
}
// new Touch() isn't availiable in Firefox, so this is skipped there
// new Touch() isn't available in Firefox, so this is skipped there
acceptance("Mobile - menu swipes", function (needs) {
needs.mobileView();
needs.user();

View File

@ -3,9 +3,9 @@
class DoNotDisturbTiming < ActiveRecord::Base
belongs_to :user
validate :ends_at_greater_thans_starts_at
validate :ends_at_greater_than_starts_at
def ends_at_greater_thans_starts_at
def ends_at_greater_than_starts_at
if starts_at > ends_at
errors.add(:ends_at, :invalid)
end

View File

@ -405,8 +405,8 @@ class TopicUser < ActiveRecord::Base
# The parameters can be used to shrink the scope, and make it faster.
# user_id, post_id and topic_id can optionally be arrays of ids.
#
# Providing post_id will automatically scope to the relavent user_id and topic_id.
# A provided `topic_id` value will always take presedence, which is
# Providing post_id will automatically scope to the relevant user_id and topic_id.
# A provided `topic_id` value will always take precedence, which is
# useful when a post has been moved between topics.
def self.update_post_action_cache(
user_id: nil,

View File

@ -17,7 +17,7 @@ class InlineUploads
end
cooked_fragment = Nokogiri::HTML5::fragment(PrettyText.cook(markdown, disable_emojis: true))
link_occurences = []
link_occurrences = []
cooked_fragment.traverse do |node|
if node.name == "img"
@ -29,9 +29,9 @@ class InlineUploads
if seen_link = matched_uploads(node).first
if (actual_link = (node.attributes["href"]&.value || node.attributes["src"]&.value))
link_occurences << { link: actual_link, is_valid: true }
link_occurrences << { link: actual_link, is_valid: true }
elsif node.name != "p"
link_occurences << { link: seen_link, is_valid: false }
link_occurrences << { link: seen_link, is_valid: false }
end
end
end
@ -104,7 +104,7 @@ class InlineUploads
.sort { |a, b| a[3] <=> b[3] }
.each do |match, link, replace_with, _index|
node_info = link_occurences.shift
node_info = link_occurrences.shift
next unless node_info&.dig(:is_valid)
if link.include?(node_info[:link])

View File

@ -220,7 +220,7 @@ class PresenceChannel
end
# Designed to be run periodically. Checks the channel list for channels with expired members,
# and runs auto_leave for each eligable channel
# and runs auto_leave for each eligible channel
def self.auto_leave_all
channels_with_expiring_members = PresenceChannel.redis.zrangebyscore(redis_key_channel_list, '-inf', Time.zone.now.to_i)
channels_with_expiring_members.each do |name|
@ -357,7 +357,7 @@ class PresenceChannel
# are published in the same sequence that the PresenceChannel lua script are run.
#
# The present/leave/auto_leave lua scripts will automatically acquire this mutex
# if needed. If their return value indicates a change has occured, the mutex
# if needed. If their return value indicates a change has occurred, the mutex
# should be released via #release_mutex after the messagebus message has been sent
#
# If they need a change, and the mutex is not available, they will raise an error

View File

@ -98,7 +98,7 @@ describe "discourse-presence" do
expect(c.config.allowed_user_ids).to eq(nil)
end
it 'handles permissions for private messsages' do
it 'handles permissions for private messages' do
c = PresenceChannel.new("/discourse-presence/reply/#{private_message.id}")
expect(c.config.public).to eq(false)
expect(c.config.allowed_group_ids).to contain_exactly(group.id, Group::AUTO_GROUPS[:staff])

View File

@ -123,7 +123,7 @@ def crawl_topic(url)
puts "Scraping #{url}"
get(url)
messsages_crawled = false
messages_crawled = false
extract(".subject a[href*='#{@groupname}']") do |a|
[
@ -131,10 +131,10 @@ def crawl_topic(url)
a["title"].empty?
]
end.each do |msg_url, might_be_deleted|
messsages_crawled |= crawl_message(msg_url, might_be_deleted)
messages_crawled |= crawl_message(msg_url, might_be_deleted)
end
@skipped_topic_count = skippable && messsages_crawled ? 0 : @skipped_topic_count + 1
@skipped_topic_count = skippable && messages_crawled ? 0 : @skipped_topic_count + 1
@scraped_topic_urls << url
rescue
puts "Failed to scrape topic at #{url}".red

View File

@ -202,7 +202,7 @@ describe 'uploads' do
consumes 'application/json'
description <<~HEREDOC
Multipart uploads are uploaded in chunks or parts to individual presigned
URLs, similar to the one genreated by /generate-presigned-put. The part
URLs, similar to the one generated by /generate-presigned-put. The part
numbers provided must be between 1 and 10000. The total number of parts
will depend on the chunk size in bytes that you intend to use to upload
each chunk. For example a 12MB file may have 2 5MB chunks and a final