mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
a1ed9adf92
Ember.ObjectController (and Ember.ArrayController) will be deprecated in Ember 1.11 (and removed from core in Ember 2.0). The reasoning is detailed in the Ember 2.0 RFC. This PR does the following: * Updates templates/controllers/views to explicitly reference model properties (instead of relying on proxying behavior). * Clearly delineate where certain properties are being set or retrieved from (for example it was not clear exactly where `scratch` and `titleScratch` were stored). * Remove usage of `Ember.ObjectController`. * Add JSCS rule to prevent future PR's from adding regressions.
39 lines
1.9 KiB
Handlebars
39 lines
1.9 KiB
Handlebars
<header class="page-header">
|
|
<button class="menu-button js-menu-button" {{action "toggleGlobalMobileNav"}}><span class="sr-only">Menu</span></button>
|
|
<h2 class="page-title">Editor</h2>
|
|
</header>
|
|
|
|
<div class="page-content">
|
|
<header>
|
|
<section class="box entry-title">
|
|
{{gh-trim-focus-input type="text" id="entry-title" placeholder="Your Post Title" value=model.titleScratch
|
|
tabindex="1" focus=shouldFocusTitle}}
|
|
</section>
|
|
</header>
|
|
|
|
<section {{bind-attr class=":entry-markdown :js-entry-markdown isPreview::active"}}>
|
|
<header {{action "togglePreview" false}} class="floatingheader">
|
|
<small>Markdown</small>
|
|
<a class="markdown-help" href="" {{action "openModal" "markdown"}}><span class="hidden">What is Markdown?</span></a>
|
|
</header>
|
|
<section id="entry-markdown-content" class="entry-markdown-content">
|
|
{{gh-codemirror value=model.scratch scrollInfo=view.markdownScrollInfo
|
|
setCodeMirror="setCodeMirror" openModal="openModal" typingPause="autoSave"
|
|
focus=shouldFocusEditor focusCursorAtEnd=model.isDirty onFocusIn="autoSaveNew"}}
|
|
</section>
|
|
</section>
|
|
|
|
<section {{bind-attr class=":entry-preview :js-entry-preview isPreview:active"}}>
|
|
<header {{action "togglePreview" true}} class="floatingheader">
|
|
<small>Preview <span class="entry-word-count js-entry-word-count">{{gh-count-words model.scratch}}</span></small>
|
|
</header>
|
|
<section class="entry-preview-content js-entry-preview-content">
|
|
{{gh-markdown classNames="rendered-markdown js-rendered-markdown"
|
|
markdown=model.scratch scrollPosition=view.scrollPosition
|
|
uploadStarted="disableCodeMirror" uploadFinished="enableCodeMirror" uploadSuccess="handleImgUpload"}}
|
|
</section>
|
|
</section>
|
|
|
|
{{partial "publish-bar"}}
|
|
|
|
</div>
|