DEV: Fix random typos (#16066)

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` Get the current `history.state`
Polyfill checks for native browser support and falls back to retrieving Polyfill checks for native browser support and falls back to retrieving
from a private _historyState constiable from a private _historyState variable
@method getState @method getState
*/ */

View File

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

View File

@ -40,7 +40,7 @@ export function registerTopicFooterDropdown(dropdown) {
priority: 0, priority: 0,
// an object used to display the state of the dropdown // 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, noneItem: null,
}; };

View File

@ -19,7 +19,7 @@ const DEBOUNCING_DELAY = 50;
export default { export default {
enqueue(type, params, callback) { 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) { if (_queue.length >= MAX_QUEUE_SIZE) {
const removedJobs = _queue.splice(0, 1)[0]; const removedJobs = _queue.splice(0, 1)[0];
removedJobs.forEach((job) => { 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 // 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 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 // Otherwise, will return true
export default function userPresent({ export default function userPresent({
browserHiddenTime = DEFAULT_BROWSER_HIDDEN_MS, 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 /* mainly for backwards compatibility with plugins, used in quick messages plugin
* TODO: remove July 2021 * TODO: remove July 2022
* */ * */
triggerNewPostInStream(postId, opts) { triggerNewPostInStream(postId, opts) {
deprecated( 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. * we have in state.
* *
* @method forEachTracked * @method forEachTracked

View File

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

View File

@ -44,7 +44,7 @@ export default class MediaOptimizationWorkerService extends Service {
) { ) {
return Promise.resolve(); return Promise.resolve();
} }
await this.ensureAvailiableWorker(); await this.ensureAvailableWorker();
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
this.logIfDebug(`Transforming ${file.name}`); this.logIfDebug(`Transforming ${file.name}`);
@ -88,7 +88,7 @@ export default class MediaOptimizationWorkerService extends Service {
}); });
} }
async ensureAvailiableWorker() { async ensureAvailableWorker() {
if (this.worker && this.workerInstalled) { if (this.worker && this.workerInstalled) {
return Promise.resolve(); 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 // 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 WidgetClickHook = buildHook(CLICK_ATTRIBUTE_NAME);
export const WidgetDoubleClickHook = buildHook(DOUBLE_CLICK_ATTRIBUTE_NAME); export const WidgetDoubleClickHook = buildHook(DOUBLE_CLICK_ATTRIBUTE_NAME);
export const WidgetClickOutsideHook = buildHook( 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) { acceptance("Mobile - menu swipes", function (needs) {
needs.mobileView(); needs.mobileView();
needs.user(); needs.user();

View File

@ -3,9 +3,9 @@
class DoNotDisturbTiming < ActiveRecord::Base class DoNotDisturbTiming < ActiveRecord::Base
belongs_to :user 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 if starts_at > ends_at
errors.add(:ends_at, :invalid) errors.add(:ends_at, :invalid)
end end

View File

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

View File

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

View File

@ -220,7 +220,7 @@ class PresenceChannel
end end
# Designed to be run periodically. Checks the channel list for channels with expired members, # 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 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 = PresenceChannel.redis.zrangebyscore(redis_key_channel_list, '-inf', Time.zone.now.to_i)
channels_with_expiring_members.each do |name| 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. # 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 # 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 # 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 # 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) expect(c.config.allowed_user_ids).to eq(nil)
end end
it 'handles permissions for private messsages' do it 'handles permissions for private messages' do
c = PresenceChannel.new("/discourse-presence/reply/#{private_message.id}") c = PresenceChannel.new("/discourse-presence/reply/#{private_message.id}")
expect(c.config.public).to eq(false) expect(c.config.public).to eq(false)
expect(c.config.allowed_group_ids).to contain_exactly(group.id, Group::AUTO_GROUPS[:staff]) 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}" puts "Scraping #{url}"
get(url) get(url)
messsages_crawled = false messages_crawled = false
extract(".subject a[href*='#{@groupname}']") do |a| extract(".subject a[href*='#{@groupname}']") do |a|
[ [
@ -131,10 +131,10 @@ def crawl_topic(url)
a["title"].empty? a["title"].empty?
] ]
end.each do |msg_url, might_be_deleted| 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 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 @scraped_topic_urls << url
rescue rescue
puts "Failed to scrape topic at #{url}".red puts "Failed to scrape topic at #{url}".red

View File

@ -202,7 +202,7 @@ describe 'uploads' do
consumes 'application/json' consumes 'application/json'
description <<~HEREDOC description <<~HEREDOC
Multipart uploads are uploaded in chunks or parts to individual presigned 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 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 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 each chunk. For example a 12MB file may have 2 5MB chunks and a final