0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed linter errors in editor preview templates

This commit is contained in:
Kevin Ansfield 2022-05-25 09:11:21 +01:00
parent f76d7e9cd2
commit a09a1939c7
4 changed files with 20 additions and 13 deletions

View file

@ -25,6 +25,6 @@
</div> </div>
</div> </div>
<div class="gh-browserpreview-iframecontainer"> <div class="gh-browserpreview-iframecontainer">
<iframe class="gh-pe-iframe" src={{@post.previewUrl}}></iframe> <iframe class="gh-pe-iframe" src={{@post.previewUrl}} title="Desktop browser post preview"></iframe>
</div> </div>
</div> </div>

View file

@ -6,7 +6,7 @@
</p> </p>
<p><span class="dark">To:</span> Jamie Larson &lt;jamie@example.com&gt;</p> <p><span class="dark">To:</span> Jamie Larson &lt;jamie@example.com&gt;</p>
</div> </div>
<iframe class="gh-pe-iframe" {{did-insert this.renderEmailPreview}} sandbox="allow-same-origin allow-popups allow-popups-to-escape-sandbox"></iframe> <iframe class="gh-pe-iframe" {{did-insert this.renderEmailPreview}} title="Email preview" sandbox="allow-same-origin allow-popups allow-popups-to-escape-sandbox"></iframe>
</div> </div>
{{!-- <div class="flex"> {{!-- <div class="flex">
<div class="gh-btn-group mr3"> <div class="gh-btn-group mr3">
@ -49,6 +49,7 @@
@value={{this.previewEmailAddress}} @value={{this.previewEmailAddress}}
class="gh-input gh-post-preview-email-input" class="gh-input gh-post-preview-email-input"
placeholder="you@yoursite.com" placeholder="you@yoursite.com"
aria-label="Email address to receive preview"
aria-invalid={{if this.sendPreviewEmailError "true"}} aria-invalid={{if this.sendPreviewEmailError "true"}}
aria-describedby={{if this.sendPreviewEmailError "sendError"}} aria-describedby={{if this.sendPreviewEmailError "sendError"}}
{{on-key "Enter" (perform this.sendPreviewEmailTask)}} {{on-key "Enter" (perform this.sendPreviewEmailTask)}}

View file

@ -1,7 +1,7 @@
<div class="modal-body modal-preview-email-content gh-pe-mobile-container gh-post-preview-container h-auto overflow-auto {{unless @skipAnimation "fade-in"}}"> <div class="modal-body modal-preview-email-content gh-pe-mobile-container gh-post-preview-container h-auto overflow-auto {{unless @skipAnimation "fade-in"}}">
<div class="gh-pe-mobile-bezel"> <div class="gh-pe-mobile-bezel">
<div class="gh-pe-mobile-screen"> <div class="gh-pe-mobile-screen">
<iframe class="gh-post-preview-iframe" src={{@post.previewUrl}}></iframe> <iframe class="gh-post-preview-iframe" src={{@post.previewUrl}} title="Mobile browser post preview"></iframe>
</div> </div>
</div> </div>
</div> </div>

View file

@ -17,8 +17,8 @@
</div> </div>
<div <div
class="gh-social-og-preview" class="gh-social-og-preview"
{{on "mouseenter" (action (mut this.facebookHovered) true)}} {{on "mouseenter" (fn (mut this.facebookHovered) true)}}
{{on "mouseleave" (action (mut this.facebookHovered) false)}} {{on "mouseleave" (fn (mut this.facebookHovered) false)}}
> >
{{#if (and this.facebookHovered (not this.facebookImage))}} {{#if (and this.facebookHovered (not this.facebookImage))}}
{{!-- only shown on hover when there's no image or fallback --}} {{!-- only shown on hover when there's no image or fallback --}}
@ -68,6 +68,7 @@
</div> </div>
{{#if this.editingFacebookTitle}} {{#if this.editingFacebookTitle}}
<input <input
aria-label="Facebook title"
type="text" type="text"
class="gh-input" class="gh-input"
placeholder={{this.facebookTitle}} placeholder={{this.facebookTitle}}
@ -80,12 +81,13 @@
data-prevent-escape-close-modal="true" data-prevent-escape-close-modal="true"
/> />
{{else}} {{else}}
<div class="gh-social-og-preview-title editable pointer" {{on "click" this.editFacebookTitle}}> <div class="gh-social-og-preview-title editable pointer" role="button" aria-label="Edit Facebook title" {{on "click" this.editFacebookTitle}}>
{{truncate this.facebookTitle}} {{truncate this.facebookTitle}}
</div> </div>
{{/if}} {{/if}}
{{#if this.editingFacebookDescription}} {{#if this.editingFacebookDescription}}
<textarea <textarea
aria-label="Facebook description"
class="gh-input" class="gh-input"
maxlength="500" maxlength="500"
placeholder={{truncate this.facebookDescription 160}} placeholder={{truncate this.facebookDescription 160}}
@ -96,7 +98,7 @@
data-prevent-escape-close-modal="true" data-prevent-escape-close-modal="true"
>{{@post.ogDescription}}</textarea> >{{@post.ogDescription}}</textarea>
{{else}} {{else}}
<div class="gh-social-og-preview-desc editable pointer" {{on "click" this.editFacebookDescription}}> <div class="gh-social-og-preview-desc editable pointer" role="button" aria-label="Edit Facebook description" {{on "click" this.editFacebookDescription}}>
{{truncate this.facebookDescription}} {{truncate this.facebookDescription}}
</div> </div>
{{/if}} {{/if}}
@ -121,8 +123,8 @@
<span class="gh-social-og-desc w-60" /> <span class="gh-social-og-desc w-60" />
</div> </div>
<div class="gh-social-twitter-post-preview" <div class="gh-social-twitter-post-preview"
{{on "mouseenter" (action (mut this.twitterHovered) true)}} {{on "mouseenter" (fn (mut this.twitterHovered) true)}}
{{on "mouseleave" (action (mut this.twitterHovered) false)}} {{on "mouseleave" (fn (mut this.twitterHovered) false)}}
> >
{{#if (and this.twitterHovered (not this.twitterImage))}} {{#if (and this.twitterHovered (not this.twitterImage))}}
{{!-- only shown on hover when there's no image or fallback --}} {{!-- only shown on hover when there's no image or fallback --}}
@ -167,6 +169,7 @@
<div class="gh-social-twitter-preview-content"> <div class="gh-social-twitter-preview-content">
{{#if this.editingTwitterTitle}} {{#if this.editingTwitterTitle}}
<input <input
aria-label="Twitter title"
type="text" type="text"
class="gh-input" class="gh-input"
placeholder={{this.twitterTitle}} placeholder={{this.twitterTitle}}
@ -179,10 +182,11 @@
data-prevent-escape-close-modal="true" data-prevent-escape-close-modal="true"
/> />
{{else}} {{else}}
<div class="gh-social-twitter-preview-title editable pointer" {{on "click" this.editTwitterTitle}}>{{this.twitterTitle}}</div> <div class="gh-social-twitter-preview-title editable pointer" role="button" aria-label="Edit Twitter title" {{on "click" this.editTwitterTitle}}>{{this.twitterTitle}}</div>
{{/if}} {{/if}}
{{#if this.editingTwitterDescription}} {{#if this.editingTwitterDescription}}
<textarea <textarea
aria-label="Twitter description"
class="gh-input" class="gh-input"
maxlength="500" maxlength="500"
placeholder={{truncate this.twitterDescription 160}} placeholder={{truncate this.twitterDescription 160}}
@ -193,7 +197,7 @@
data-prevent-escape-close-modal="true" data-prevent-escape-close-modal="true"
>{{@post.twitterDescription}}</textarea> >{{@post.twitterDescription}}</textarea>
{{else}} {{else}}
<div class="gh-social-twitter-preview-desc editable pointer" {{on "click" this.editTwitterDescription}}>{{truncate this.twitterDescription}}</div> <div class="gh-social-twitter-preview-desc editable pointer" role="button" aria-label="Edit Twitter description" {{on "click" this.editTwitterDescription}}>{{truncate this.twitterDescription}}</div>
{{/if}} {{/if}}
<div class="gh-social-twitter-preview-meta"> <div class="gh-social-twitter-preview-meta">
{{svg-jar "twitter-link"}} {{svg-jar "twitter-link"}}
@ -219,6 +223,7 @@
<div class="gh-seo-preview-link">{{this.serpURL}}</div> <div class="gh-seo-preview-link">{{this.serpURL}}</div>
{{#if this.editingMetaTitle}} {{#if this.editingMetaTitle}}
<input <input
aria-label="Meta title"
type="text" type="text"
class="gh-input" class="gh-input"
placeholder={{this.serpTitle}} placeholder={{this.serpTitle}}
@ -231,12 +236,13 @@
data-prevent-escape-close-modal="true" data-prevent-escape-close-modal="true"
> >
{{else}} {{else}}
<div class="gh-seo-preview-title editable pointer" {{on "click" this.editMetaTitle}}> <div class="gh-seo-preview-title editable pointer" role="button" aria-label="Edit meta title" {{on "click" this.editMetaTitle}}>
{{this.serpTitle}} {{this.serpTitle}}
</div> </div>
{{/if}} {{/if}}
{{#if this.editingMetaDescription}} {{#if this.editingMetaDescription}}
<textarea <textarea
aria-label="Meta description"
class="gh-input" class="gh-input"
placeholder={{this.serpDescription}} placeholder={{this.serpDescription}}
maxlength="500" maxlength="500"
@ -247,7 +253,7 @@
data-prevent-escape-close-modal="true" data-prevent-escape-close-modal="true"
>{{@post.metaDescription}}</textarea> >{{@post.metaDescription}}</textarea>
{{else}} {{else}}
<div class="gh-seo-preview-desc editable pointer" {{on "click" this.editMetaDescription}}> <div class="gh-seo-preview-desc editable pointer" role="button" aria-label="Edit meta description" {{on "click" this.editMetaDescription}}>
{{moment-format (now) "DD MMM YYYY"}}{{truncate this.serpDescription 149}} {{moment-format (now) "DD MMM YYYY"}}{{truncate this.serpDescription 149}}
</div> </div>
{{/if}} {{/if}}