mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-04 08:54:36 +03:00
62553cdf92
no issue - adds `gh-image-uploader` that handles image uploads in a fully ember fashion and with no dependency on `uploader.js` - adds `gh-image-uploader-with-preview` that can fully replace the old `gh-uploader` - replace uses of `gh-uploader` in PSM & TSM with `gh-image-uploader-with-preview` - updates the editor preview image handling to use the new `gh-image-uploader-with-preview` component - updates the image upload modal to use `gh-image-uploader` (utilises the `saveButton=false` flag which means the preview has to be handled externally to avoid auto-replacement when typing a URL) - removes all old `uploader.js` related code - adds custom `RequestEntityTooLargeError` and `UnsupportedMediaTypeError` errors to our `ajax` service
51 lines
2.6 KiB
Handlebars
51 lines
2.6 KiB
Handlebars
<section class="entry-markdown js-entry-markdown {{if markdownActive 'active'}}">
|
|
<header class="floatingheader">
|
|
<span class="desktop-tabs"><a class="markdown-help-label" href="" title="Markdown Help" {{action (route-action "toggleMarkdownHelpModal")}}>Markdown</a></span>
|
|
<span class="mobile-tabs">
|
|
<a href="#" {{action 'selectTab' 'markdown'}} class="{{if markdownActive 'active'}}">Markdown</a>
|
|
<a href="#" {{action 'selectTab' 'preview'}} class="{{if previewActive 'active'}}">Preview</a>
|
|
</span>
|
|
<a class="markdown-help-icon" href="" title="Markdown Help" {{action (route-action "toggleMarkdownHelpModal")}}><i class="icon-markdown"></i></a>
|
|
</header>
|
|
<section id="entry-markdown-content" class="entry-markdown-content">
|
|
{{gh-ed-editor classNames="markdown-editor js-markdown-editor"
|
|
tabindex="1"
|
|
spellcheck="true"
|
|
value=value
|
|
setEditor=(action "setEditor")
|
|
updateScrollInfo=(action "updateScrollInfo")
|
|
toggleCopyHTMLModal=(action "toggleCopyHTMLModal")
|
|
onFocusIn=editorFocused
|
|
height=height
|
|
focus=shouldFocusEditor
|
|
readonly=editorDisabled}}
|
|
</section>
|
|
</section>
|
|
|
|
<section class="entry-preview js-entry-preview {{if previewActive 'active'}}">
|
|
<header class="floatingheader">
|
|
<span class="desktop-tabs"><a target="_blank" href="{{previewUrl}}">Preview</a></span>
|
|
<span class="mobile-tabs">
|
|
<a href="#" {{action 'selectTab' 'markdown'}} class="{{if markdownActive 'active'}}">Markdown</a>
|
|
<a href="#" {{action 'selectTab' 'preview'}} class="{{if previewActive 'active'}}">Preview</a>
|
|
</span>
|
|
<span class="entry-word-count">{{gh-count-words value}}</span>
|
|
</header>
|
|
<section class="entry-preview-content js-entry-preview-content">
|
|
{{gh-ed-preview classNames="rendered-markdown js-rendered-markdown"
|
|
markdown=value
|
|
scrollPosition=scrollPosition
|
|
updateHeight=(action "updateHeight")
|
|
uploadStarted=(action "disableEditor")
|
|
uploadFinished=(action "enableEditor")
|
|
updateImageSrc=(action "handleImgUpload")}}
|
|
</section>
|
|
</section>
|
|
|
|
{{#if showCopyHTMLModal}}
|
|
{{gh-fullscreen-modal "copy-html"
|
|
model=copyHTMLModalContent
|
|
close=(action "toggleCopyHTMLModal")
|
|
modifier="action"}}
|
|
{{/if}}
|