fixes#3013
- bubble promise rejection on post model validation/save error so that it doesn't bubble as resolved
- prefer `.catch()` for promise handlers as per recommendations
- check if `.save()` is being called from model.destroyRecord() and forgo validation if so
- normalize output for both `.validate()` and `.save()`
closes#2893, issue #2850, issue #2856
- this is a stable, but quick and dirty validations layer for the time constraints
- this could be replaced with a unified server/client layer later. the infrastructure is there.
- create a validation engine mixin to match validators with models
- override the save method in the mixin to perform validations first
- create a post validator
- fixup calls to .save() to make sure they catch errors properly
Closes#2988, #2752
Ref #1463, #2984,
# Shortcuts via Keymaster
- Added KeyMaster to bower dependencies. KeyMaster is a minimal keyboard
shortcuts library.
- Added `ShortcutsRouteMixin` for routes that will use shortcuts.
Currently, only routes can have shortcuts. See the extensive comment
at the top of `core/client/mixins/shortcuts-route.js` for a
description of how to implement shortcuts.
## Other Changes
- Injected popover service into ApplicationRoute
- Created `EditorRouteBase` mixin for the `editor.new` and
`editor.edit` routes to mixin.
- `StyleBodyMixin` now calls `this._super()` on `activate` and
`deactivate` to play nicely with other mixins.
## Shortcuts and Stubs implemented
#### Application-Wide
- `'esc':'closePopups'` shortcut **stub** to close popovers,
modals, and notifcations
#### Editor Shortcuts
- `'ctrl+s, command+s': 'save'` note that `command` is the
`meta` key.
- `'ctrl+alt+p': 'publish'`
- `'ctrl+alt+z': 'toggleZenMode'`
fixes#2999
- handle undefined argument in openModal function
- catch whether a model is deleted in Editor routes to aid transition
- move updateTags function to the PostModel
- add call to updateTags in delete-post modal
No issue
Misc Places
- Removed expired, irrelevant, and fixed todos
FloatingHeaderPartial
- Fixed "Written" vs "Published" text logic
SettingsGeneralController
- Removed single quotes from property names
EditorBaseController, MarkerManagerMixin
- Aligned var declarations
PostItemView
- Commented out unfunctional code for feature request #2398
- Switched `isPage`, `isFeatured` to be computed properties in `Po
- use `toggleProperty` in `PostController.action.toggleFeatured`
Closes#2958
- Created `boundOneWay` util to extract common pattern of having a oneWay property that doesn't break its binding after being set
- Changed `EditorControllerMixin.willPublish`, `PostSettingsMenuController.publishedAtValue` and `.slugValue` to use the new `boundOneWay` util
closes#2426, closes#2781, closes#2913
- Concatenate vendor files on change of js in core/shared/
- Add all the markerManager stuff to its own mixin
- make markers a shared object for all that mix it in. makes it easier to use helper functions in different modules
- add getMarkdown method, returns object with two keys holding the markdown: one with markers, the other without
- Clear markers when codemirror is destroyed
- make Editor subcomponents communicate through the Editor Controller
- Set Codemirror and html preview shared scrolling
- Set CodeMirror, html preview css scroll class with util
- Create 'scratch' property in Editor controller; prevents a model save wiping image markers due to markdown bindings
- Add editor and html preview actions to handle img upload start/finish
- disable codemirror when an image is being uploaded, enables on success or failure
- Fix editor wordcount when there are 0 words
- Add modal dialog when transitioning out of the editor with an unsaved post
- Add window.onbeforeunload handling with `.unloadDirtyMessage()` on editor controller
- and various other things
Closes#2845.
Ref #1351.
- Refactored `PostSettingsMenuController` to appropriately set and display
slug and publish date and their placeholders.
- Removed api spam on title change by putting `slugPlaceholder` generation
inside of an `Ember.run.debounce` call.
- Renamed `gh-blur-text-field` to `gh-blur-input`
- Created `SlugGenerator` class to abstract slug generation.
- Added `timestampVerification` function to `utils/date-formatting`
- `utils/date-formatting` now uses `strict` parsing of dates
- Added more acceptable date formats to accommodate strict parsing
- Moved `isDraft` and `isPublished` computed properties from
`EditorController` to `PostModel`
closes#2947
- make a PostSerializer to embed the tags objects in the posts POST/PUT request
- on editor save, clear out tags from the post and data store that have `id: null`
Closes#2860
- `editor-base-controller`'s `save` action returns a promise with the model
after saving
- `EditorNewController` will transition to `EditorEditController` upon a
successful save (model has an id)
- Removed a console.log in editor's save function
closes#2910
- create EditorController, PostSettingsMenuController
- remove `posts.post` controllerName dependency on EditorRoute/NewRoute
- `{{render}}` the PostSettingsMenuView with its own controller
- break up properties/methods from PostsPostController into all three controllers
- fix EditorRoute pagination options to now be comparable to PostsRoute
- add NewController to force NewRoute to refresh editor with blank model. Identical to Editor's
- EditorController and NewController are based on a shared mixin
- NewView created, templateName is 'editor'
Closes#2418, #2714
Ref #2446, #2565
- Added and injected `popover` service to globally control popovers
- Added `gh-popover-button` component
- Added `popover-mixin` for popover and popover-buttons to mixin
- Added body-event-listener mixin for popover service to watch for body
clicks with
- Post settings and post save button both now use `gh-popover`
- Added hacks to `ember-hacks.css` to make popovers work until ghost-ui
consolidates functionality
- Change fixture response of posts route to actual format.
- Extracted classNames logic of routes into style-body mixin.
- Additionally replaced all double-quotes with single-quotes for style conformance.