Spelling fixes to live code (#15670)

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref 2021-12-06 05:11:25 -05:00 committed by GitHub
parent 558dd157be
commit 5324eb1477
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 44 additions and 44 deletions

View file

@ -268,7 +268,7 @@ function initializePodcastPlayback() {
setPlaying(true);
resolve();
} else {
audio.currrentTime = currentState.currentTime;
audio.currentTime = currentState.currentTime;
audio
.play()
.then(function () {

View file

@ -18,7 +18,7 @@ function buildCommentFormHTML(commentableId, commentableType, parentId) {
<input value="${parentId}" type="hidden" name="comment[parent_id]" id="comment_parent_id" />
<div class="comment-form__inner">
<div class="comment-form__field">
<textarea id="textarea-for-${parentId}" class="crayons-textfield crayons-textfield--ghost comment-textarea" name="comment[body_markdown]" placeholder="Reply..." aria-label="Reply to a comment..." required="required" onkeydown="handleKeyDown(event)" onfocus="handleFocus(event)" oninput="handleChange(event)" onkeykup="handleKeyUp(event)"></textarea>
<textarea id="textarea-for-${parentId}" class="crayons-textfield crayons-textfield--ghost comment-textarea" name="comment[body_markdown]" placeholder="Reply..." aria-label="Reply to a comment..." required="required" onkeydown="handleKeyDown(event)" onfocus="handleFocus(event)" oninput="handleChange(event)" onkeyup="handleKeyUp(event)"></textarea>
<div class="comment-form__toolbar">
<div class="editor-image-upload">
<input type="file" id="image-upload-${randomIdNumber}" name="file" accept="image/*" style="display:none">

View file

@ -1,6 +1,6 @@
function buildCommentHTML(comment) {
var iconSmallOverflowHorizontal = `<svg width="24" height="24" viewBox="0 0 24 24" class="crayons-icon pointer-events-none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.25 12a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm5.25 0a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zm3.75 1.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z" /></svg>`;
var iconCollaspe = `<svg width="24" height="24" class="crayons-icon expanded" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 10.6771L8 6.93529L8.99982 6L12 8.80653L15.0002 6L16 6.93529L12 10.6771ZM12 15.1935L8.99982 18L8 17.0647L12 13.3229L16 17.0647L15.0002 17.9993L12 15.1935Z" /></svg>`;
var iconCollapse = `<svg width="24" height="24" class="crayons-icon expanded" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 10.6771L8 6.93529L8.99982 6L12 8.80653L15.0002 6L16 6.93529L12 10.6771ZM12 15.1935L8.99982 18L8 17.0647L12 13.3229L16 17.0647L15.0002 17.9993L12 15.1935Z" /></svg>`;
var iconExpand = `<svg width="24" height="24" class="crayons-icon collapsed" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 18L8 14.2287L8.99982 13.286L12 16.1147L15.0002 13.286L16 14.2287L12 18ZM12 7.88533L8.99982 10.714L8 9.77133L12 6L16 9.77133L15.0002 10.7133L12 7.88533Z" /></svg>`;
var depthClass = "";
@ -33,7 +33,7 @@ function buildCommentHTML(comment) {
<details class="comment-wrapper comment-wrapper--deep-${ comment.depth } js-comment-wrapper" open>
<summary aria-label="Toggle this comment (and replies)">
<span class="inline-block align-middle ${ comment.depth > 0 ? 'mx-0' : 'm:mx-1'}">
${ iconCollaspe }
${ iconCollapse }
${ iconExpand }
</span>
<span class="js-collapse-comment-content inline-block align-middle"></span>

View file

@ -82,14 +82,14 @@ function showModalAfterError({
}) {
response
.json()
.then(function parseError(errorReponse) {
.then(function parseError(errorResponse) {
if (response.status === 429) {
showRateLimitModal({ element, action_ing, action_past, timeframe });
} else {
showUserAlertModal(
`Error ${action_ing} ${element}`,
`Your ${element} could not be ${action_past} due to an error: ` +
errorReponse.error,
errorResponse.error,
'OK',
);
}

View file

@ -30,7 +30,7 @@ module Admin
Credit.public_send(update_action, org, amount)
add_note(org)
flash[:notice] = "Sucessfully updated credits"
flash[:notice] = "Successfully updated credits"
redirect_to admin_organization_path(org)
end

View file

@ -52,7 +52,7 @@ class ArticlesController < ApplicationController
end
def new
base_editor_assigments
base_editor_assignments
@article, needs_authorization = Articles::Builder.call(@user, @tag, @prefill)
@ -216,7 +216,7 @@ class ArticlesController < ApplicationController
private
def base_editor_assigments
def base_editor_assignments
@user = current_user
@version = @user.setting.editor_version if @user
@organizations = @user&.organizations

View file

@ -50,7 +50,7 @@ class CommentsController < ApplicationController
@comment.user_id = current_user.id
authorize @comment
permit_commentor
permit_commenter
if @comment.save
checked_code_of_conduct = params[:checked_code_of_conduct].present? && !current_user.checked_code_of_conduct
@ -106,7 +106,7 @@ class CommentsController < ApplicationController
@comment.user_id = moderator.id
@comment.body_markdown = response_template.content
authorize @comment
permit_commentor
permit_commenter
if @comment.save
Notification.send_new_comment_notifications_without_delay(@comment)
@ -312,7 +312,7 @@ class CommentsController < ApplicationController
end
end
def permit_commentor
def permit_commenter
return unless user_blocked?
raise ModerationUnauthorizedError, "Not allowed due to moderation action"

View file

@ -17,7 +17,7 @@ describe('<SearchFormSync />', () => {
document.body.innerHTML =
'<div id="mobile-search-container"><form></form></div>';
setWindowLocation(`https://locahost:3000/`);
setWindowLocation(`https://localhost:3000/`);
global.InstantClick = jest.fn(() => ({
on: jest.fn(),
@ -41,7 +41,7 @@ describe('<SearchFormSync />', () => {
const searchTerm = 'diphthong';
// simulates a search result returned which contains the server side rendered search form for mobile only.
setWindowLocation(`https://locahost:3000/search?q=${searchTerm}`);
setWindowLocation(`https://localhost:3000/search?q=${searchTerm}`);
fireEvent(
window,
@ -72,7 +72,7 @@ describe('<SearchFormSync />', () => {
const searchTerm = 'diphthong';
// simulates a search result returned which contains the server side rendered search form for mobile only.
setWindowLocation(`https://locahost:3000/search?q=${searchTerm}`);
setWindowLocation(`https://localhost:3000/search?q=${searchTerm}`);
fireEvent(
window,
@ -91,7 +91,7 @@ describe('<SearchFormSync />', () => {
const searchTerm2 = 'diphthong2';
// simulates a search result returned which contains the server side rendered search form for mobile only.
setWindowLocation(`https://locahost:3000/search?q=${searchTerm2}`);
setWindowLocation(`https://localhost:3000/search?q=${searchTerm2}`);
const oldPortalContainer = document.getElementById(
'mobile-search-container',

View file

@ -29,7 +29,7 @@ Primary buttons should be used for the principal call to action on the page.
Default variant is less prominent, and therefore can be used for less prominent actions.
Default buttons are visually light (greyish) and you can have as many of them as you want (within common sense :D).
They can (but don't have to) be used in conjuction with a Primary button. In that case, default variant should be used for any remaining actions.
They can (but don't have to) be used in conjunction with a Primary button. In that case, default variant should be used for any remaining actions.
## Configuration

View file

@ -16,7 +16,7 @@ Do not use `<Button />s` as navigational elements. Instead, use Links (or CTAs)
Under the hood, CTA outputs `<a>` element.
Call To Actions has slighlty different UI than regular `<Link block />` as our intention here was to make these more prominent.
Call To Actions has slightly different UI than regular `<Link block />` as our intention here was to make these more prominent.
`<CTA />` is basically a `<Link />` therefore standard link markup should be used, including an `href` (links omitting `href` attributes are not focusable by keyboard).
### Icons

View file

@ -20,4 +20,4 @@ And there arere four styles to pick from:
- Critical (red) - something super important, don&apos;t overuse it!!
- Inverted (dark grey) - alternative to the default one, especially when we need
to show two defautl indicators next to each other.
to show two default indicators next to each other.

View file

@ -23,7 +23,7 @@ Both variants are just fine and which one you gonna use is dependent on the cont
### Variants (styles)
There are two available variants (styles) to pick from: _default_ and _branded_. The primary difference is color: _default_ uses grey color and _branded_ uses accent color.
It is recommended to always use `branded` variant for inline links, epsecially when link is used alongside other text - making it `branded` will make it more distinguishable.
It is recommended to always use `branded` variant for inline links, especially when link is used alongside other text - making it `branded` will make it more distinguishable.
### Icons

View file

@ -5,5 +5,5 @@ the main font.
Please, do not overuse Accent typography.
We strongly encourage to limit number of sizes and weights to what presesented
We strongly encourage to limit number of sizes and weights to what presented
below.

View file

@ -6,7 +6,7 @@ import { Meta } from '@storybook/addon-docs/blocks';
# Media Queries
[Media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) allow us to create responsive experiences by changing the look and feel of a component based on the given media query. This can be done from CSS, but also programatically via JavaScript. This works well with a component because it **allows us to render only certain markup** based on the evaluated media query unlike a CSS media query which would apply to existing markup.
[Media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) allow us to create responsive experiences by changing the look and feel of a component based on the given media query. This can be done from CSS, but also programmatically via JavaScript. This works well with a component because it **allows us to render only certain markup** based on the evaluated media query unlike a CSS media query which would apply to existing markup.
## Breakpoints

View file

@ -6,7 +6,7 @@ module Constants
description: "Determines the default reading font (registered users can change this in their UX settings)"
},
default_locale: {
description: "Determines the default language and lozalization for the Forem (currently in experimental beta)"
description: "Determines the default language and localization for the Forem (currently in experimental beta)"
},
feed_strategy: {
description: "Determines the main feed algorithm approach the app takes: basic or large_forem_experimental " \

View file

@ -13,7 +13,7 @@ module ReverseMarkdown
def treat_empty(node)
parent = node.parent.name.to_sym
if %i[ol ul].include?(parent) # Otherwise the identation is broken
if %i[ol ul].include?(parent) # Otherwise the indentation is broken
""
elsif node.text == " " # Regular whitespace text node
" "

View file

@ -375,7 +375,7 @@ class User < ApplicationRecord
has_role?(:tech_admin) || has_role?(:super_admin)
end
def vomitted_on?
def vomited_on?
Reaction.exists?(reactable_id: id, reactable_type: "User", category: "vomit", status: "confirmed")
end

View file

@ -45,7 +45,7 @@ module Mailchimp
report_error(e)
rescue Gibbon::MailChimpError => e
# If user was previously subscribed, set their status to "pending"
return resubscribe_to_newsletter if previously_subcribed?(e)
return resubscribe_to_newsletter if previously_subscribed?(e)
report_error(e)
end
@ -196,7 +196,7 @@ module Mailchimp
md5_email(email)
end
def previously_subcribed?(error)
def previously_subscribed?(error)
error.title.include?("Member In Compliance State")
end
end

View file

@ -25,7 +25,7 @@ module ReCaptcha
return true if @user.suspended?
# recaptcha will be enabled if the user has a vomit or is too recent
@user.vomitted_on? || @user.created_at.after?(1.month.ago)
@user.vomited_on? || @user.created_at.after?(1.month.ago)
end
private

View file

@ -41,8 +41,8 @@
<% if reaction.reactable_type == "User" && reaction.reactable.suspended? %>
<span class="badge badge-danger">Suspended</span>
<% end %>
<% if reaction.reactable_type == "User" && reaction.reactable.vomitted_on? %>
<span class="badge badge-warning">Vomitted</span>
<% if reaction.reactable_type == "User" && reaction.reactable.vomited_on? %>
<span class="badge badge-warning">Vomited</span>
<% end %>
</span>
<span>

View file

@ -1,5 +1,5 @@
<div class="content-center crayons-notice crayons-notice--info my-4 ml-1">
<span class="fs-2xl">HMTL Variant Preview</span>
<span class="fs-2xl">HTML Variant Preview</span>
<br>
<%= link_to "Back to admin page", "javascript:history.back()" %>
</div>

View file

@ -37,7 +37,7 @@
<div class="crayons-card p-6 mb-6">
<% current_credits = @organization.unspent_credits_count %>
<h3 class="mb-4">Credits (currrent: <%= current_credits %>)</h3>
<h3 class="mb-4">Credits (current: <%= current_credits %>)</h3>
<%= form_tag update_org_credits_admin_organization_path(@organization), method: :patch, class: "form-inline justify-content-between mb-2" do %>
<div class="form-group">
<%= hidden_field_tag :credit_action, :add %>

View file

@ -2,12 +2,12 @@
<div class="grid grid-cols-2 m:grid-cols-4 gap-2 m:gap-4 pt-3">
<div class="crayons-card crayons-card--secondary p-3 m:p-6">
<strong class="fs-2xl m:fs-3xl lh-tight color-base-90"><%= number_with_delimiter(@reactions_count, delimeter: ",") %></strong>
<strong class="fs-2xl m:fs-3xl lh-tight color-base-90"><%= number_with_delimiter(@reactions_count, delimiter: ",") %></strong>
<span class="color-base-60 block fs-base"><%= t("views.dashboard.summary.reactions") %></span>
</div>
<div class="crayons-card crayons-card--secondary p-3 m:p-6">
<strong class="fs-2xl m:fs-3xl lh-tight color-base-90"><%= num_views > 500 ? number_with_delimiter(num_views, delimeter: ",") : t("views.dashboard.summary.lt_500") %></strong>
<strong class="fs-2xl m:fs-3xl lh-tight color-base-90"><%= num_views > 500 ? number_with_delimiter(num_views, delimiter: ",") : t("views.dashboard.summary.lt_500") %></strong>
<span class="color-base-60 block fs-base"><%= t("views.dashboard.summary.views") %></span>
</div>

View file

@ -33,7 +33,7 @@
<summary><%= t("views.listings.form.category.summary") %></summary>
</details>
</div>
<%# The following tag_list field is overriden by the Tags JS component
<%# The following tag_list field is overridden by the Tags JS component
from the listingForm. We keep this form field in place to facilitate
SSR. By having the form field loaded on the DOM first with this view,
we prevent the screen from "jumping" once the deferred JS is loaded

View file

@ -62,7 +62,7 @@
<p>All registered members have the ability to disable advertisements — where reasonable — through their Settings page. For instance, its not feasible to disable certain advertisements in the form of recognition posts, site-wide contests, dedicated sponsorship page, etc.</p>
<h3>Third Party Vendors</h3>
<p>
<strong>We may share your account information with third parties in some circumstances, including:</strong> (1) with your consent; (2) to a service provider or partner who meets our data protection standards; (3) for survey or research purposes, after aggregation, anonymization, or pseudonomization; (4) when we have a good faith belief it is required by law, such as pursuant to a subpoena or other legal process; (5) when we have a good faith belief that doing so will help prevent imminent harm to someone.
<strong>We may share your account information with third parties in some circumstances, including:</strong> (1) with your consent; (2) to a service provider or partner who meets our data protection standards; (3) for survey or research purposes, after aggregation, anonymization, or pseudonymization; (4) when we have a good faith belief it is required by law, such as pursuant to a subpoena or other legal process; (5) when we have a good faith belief that doing so will help prevent imminent harm to someone.
</p>
<p><strong>Data Storage</strong>
<br>

View file

@ -33,13 +33,13 @@
<script>
const deleteAccountBtn = document.getElementById('delete__account__btn');
const deleteAccountUsernameInput = document.getElementById('delete__account__username__field');
const deleteAcccountVerificationInput = document.getElementById('delete__account__verification__field');
const deleteAccountVerificationInput = document.getElementById('delete__account__verification__field');
function bothInputsVerified() {
return deleteAccountUsernameInput.value === '<%= @user.username %>' && deleteAcccountVerificationInput.value === "<%= t("views.settings.destroy.word") %>";
return deleteAccountUsernameInput.value === '<%= @user.username %>' && deleteAccountVerificationInput.value === "<%= t("views.settings.destroy.word") %>";
}
const disableDeleteAccountBtn = () => { deleteAccountBtn.disabled = !bothInputsVerified() };
deleteAccountUsernameInput.addEventListener('input', disableDeleteAccountBtn);
deleteAcccountVerificationInput.addEventListener('input', disableDeleteAccountBtn);
deleteAccountVerificationInput.addEventListener('input', disableDeleteAccountBtn);
</script>
<p>
<%= t("views.settings.destroy.ghost_html", ghost: link_to("@ghost", "/ghost"), click: email_link(text: t("views.settings.destroy.click"), additional_info: { subject: "Request Account Deletion", body: @email_body })) %>

View file

@ -4,7 +4,7 @@ require 'rails-html-sanitizer'
class I18nExtractor
ERB_TAG = /<%(.*?)%>/
HTML_TAG = /<[^>]*>|<\/[^>]*>|[^>]*\/>|\".+">|">|<\w+(.+|)|.+="(.+)|"/
SEPERATOR = '_@@@_'
SEPARATOR = '_@@@_'
SKIP_TAGS = [[/<script/i,/<\/script>/i],[/<%/,/%>/],[/<style/i,/\/style>/i]]
def initialize(filename)

View file

@ -12,7 +12,7 @@ TWITTER_OMNIAUTH_SETUP = lambda do |env|
env["omniauth.strategy"].options[:consumer_secret] = Settings::Authentication.twitter_secret
end
GITHUB_OMNIUATH_SETUP = lambda do |env|
GITHUB_OMNIAUTH_SETUP = lambda do |env|
env["omniauth.strategy"].options[:client_id] = Settings::Authentication.github_key
env["omniauth.strategy"].options[:client_secret] = Settings::Authentication.github_secret
env["omniauth.strategy"].options[:scope] = "user:email"
@ -320,7 +320,7 @@ Devise.setup do |config|
# Fun fact, unless Twitter is last, it doesn't work for some reason.
config.omniauth :facebook, setup: FACEBOOK_OMNIAUTH_SETUP
config.omniauth :github, setup: GITHUB_OMNIUATH_SETUP
config.omniauth :github, setup: GITHUB_OMNIAUTH_SETUP
config.omniauth :apple, setup: APPLE_OMNIAUTH_SETUP
config.omniauth :forem, setup: FOREM_OMNIAUTH_SETUP, strategy_class: OmniAuth::Strategies::Forem
config.omniauth :twitter, setup: TWITTER_OMNIAUTH_SETUP

View file

@ -47,7 +47,7 @@ award_four_week_streak_badge:
- award_four_week_streak
- ""
award_eight_week_streak_badge:
description: "Awards 'eigth week publishing streak' badges to users (runs every 12 hours on the 15th minute after the hour)"
description: "Awards 'eight week publishing streak' badges to users (runs every 12 hours on the 15th minute after the hour)"
cron: "15 */12 * * *"
class: "BadgeAchievements::BadgeAwardWorker"
args:
@ -125,7 +125,7 @@ remove_old_emails:
cron: "0 6 * * *"
class: "Emails::RemoveOldEmailsWorker"
sync_credits_counter_cache:
description: "Sychronizes counter caches for credits (runs daily at 16:00 UTC)"
description: "Synchronizes counter caches for credits (runs daily at 16:00 UTC)"
cron: "0 16 * * *"
class: "Credits::SyncCounterCache"
get_podcast_episodes: