1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Commit graph

339 commits

Author SHA1 Message Date
Rishabh Garg
2604e86753
Updated to use count words/images helper from SDK (#1159)
refs https://github.com/TryGhost/Ghost/issues/10618

- Updated use of `countWords`, `countImages` and `stripTags` helper from Ghost SDK
- Removed existing local utils copy
2019-04-16 12:50:59 +05:30
Kevin Ansfield
c7294b2706 Fixed image card placeholder image changing on select/deselect 2019-03-22 11:35:59 +00:00
Kevin Ansfield
8af0709a58 Fixed "must use set()" error caused by image card random placeholder 2019-03-22 11:31:31 +00:00
Kevin Ansfield
371597cd3c Bumped ember-cli-babel version in koenig-editor in-repo addon 2019-03-11 10:19:27 +00:00
Zimo
6ab5192acc Added random image card placeholder illustrations
no refs.
- three random illustrations loop as image placeholder illustrations
- increased padding of clickable area for better happy-go-clicky
2019-03-07 15:40:08 +01:00
Zimo
ba0fa873a8 Updated image card placeholder illustration
no refs.
2019-03-07 12:44:33 +01:00
Kevin Ansfield
6351c85b25
Bumped dependencies (#1108)
Bumped all non-ember-core dependencies that do not require significant work or that contain unresolvable inter-dependencies.

Skipped:
- `ember-drag-drop` - our usage needs re-working for closure actions
- `ember-infinity`, `ember-in-viewport` - one depends on the other and `ember-light-table` depends on a particular version of `ember-in-viewport` in a way that breaks if they are upgraded

Removed/bumped:
- removed ember-cli-es6-transform
- removed ember-cli-cjs-transform
- removed current-device
- removed ember-responsive
- bumped yarn.lock sub-dependencies
- bumped @ember/jquery
- bumped @tryghost/mobiledoc-kit
- bumped autoprefixer
- bumped broccoli-funnel
- bumped coveralls
- bumped ember-auto-import
- bumped ember-moment
- bumped ember-power-select
- bumped ember-simple-auth
- bumped broccoli-uglify-sourcemap
- bumped ember-cli-eslint and eslint-plugin-ghost with fixes for new rules
- bumped ember-cli-mirage
- bumped ember-cli-pretender
- bumped ember-power-calendar-moment
- bumped ember-power-datepicker
- bumped ember-composable-helpers
- bumped ember-concurrency
- bumped ember-load
- bumped eslint
- bumped walk-sync
- bumped ember-useragent
- bumped fs-extra
- bumped ember-resolver
- bumped @html-next/vertical-collection
- bumped ember-cli-babel
2019-03-05 17:34:00 +00:00
Kevin Ansfield
3a53a3041f 🐛 Fixed markdown text expansions sometimes resulting in sticky formatting
no issue
- `**bold**` would sometimes result in any further typing keeping bold formatting
- switching to a fixed number of milliseconds helps with timing so mobiledoc-kit does not reset the internal format state _after_ the actions queue had already run
2019-02-24 18:31:36 +07:00
Kevin Ansfield
256d32a5fe Fixed linting 2019-02-24 16:07:09 +07:00
Kevin Ansfield
af658364f6 Fixed kgStyle import statement 2019-02-24 15:48:08 +07:00
Kevin Ansfield
b21af6ad77 Moved Spirit CSS library from external to internal 2019-02-24 11:19:22 +07:00
Kevin Ansfield
f8b03f50b6
🎨 Separated post and page list screens (#1101)
no issue
- added `page` model
- removed `page` param from Post model
- added pages screen with associated links
- added `:type` param to editor screens to work with the right models
- removed post<->page toggle and associated tour item
2019-02-22 10:17:33 +07:00
Kevin Ansfield
92623073d0 Added undefined guards to uses of JSON stringify/parse copying
no issue
- added guards for JSON stringify+parse replacements of `Ember.copy` introduced in 18dd5e34f6
2019-01-30 14:44:53 +00:00
Kevin Ansfield
18dd5e34f6 Fixed Ember.copy deprecations
refs https://github.com/TryGhost/Ghost/issues/10310
- https://emberjs.com/deprecations/v3.x/#toc_ember-runtime-deprecate-copy-copyable
2019-01-30 10:14:07 +00:00
Kevin Ansfield
fa9c9e3d1a 🐛 Fixed drag-n-drop card reordering interfering with caption and markdown/html card text selection
closes  https://github.com/TryGhost/Ghost/issues/10399
- added a data attribute `data-koenig-dnd-disabled` which will prevent the element or any of it's children from initiating a koenig drag event
  - applied the data attribute to `{{koenig-basic-html-input}}`'s outer tag so that captions never initiate a card re-order
- disabled card re-ordering when a card is in edit mode
  - allows text selection within a markdown/html card without triggering the card re-order behaviour
  - clicking another card will exit edit mode and re-enable drag before the drag behaviour is initiated so you can still re-order other cards if you've left a card in edit mode
2019-01-28 09:35:58 +00:00
John O'Nolan
cc5747bd48 Update Unsplash logo 2019-01-23 15:05:28 +07:00
Kevin Ansfield
6efe2c8288 Removed babel polyfill
no issue
- the polyfill is no longer required for latest browsers (tested on Chrome, FF, and Safari)
- Edge may have problems but it's not currently supported
- reduces build size. Before/after:
  - `vendor.min.js: 3.29 MB (706 KB gzipped)`
  - `vendor.min.js: 3.2 MB (672.92 KB gzipped)`
2019-01-22 14:03:27 +00:00
Kevin Ansfield
37a23122c2 Switch from embor-browserify to ember-auto-import
no issue
- minor reduction in build size. Before/after:
  - `vendor.min.js 3.32 MB (710.66 KB gzipped)`
  - `vendor.min.js 3.29 MB (706 KB gzipped)`
2019-01-22 13:09:38 +00:00
Kevin Ansfield
079c8ccc2c
Migrate to latest ember, ember-mocha and modern ember testing (#1044)
no issue
- upgrade to latest `ember-source` and related dependencies including `ember-cli`
- upgrade to latest `ember-mocha` and modern ember testing setup
    - https://github.com/emberjs/rfcs/blob/master/text/0268-acceptance-testing-refactor.md
    - switch from using global acceptance test helpers and `native-dom-helpers` to using the new `ember-test-helpers` methods
    - use [`chai-dom`](https://github.com/nathanboktae/chai-dom) assertions where in some places (still a lot of places in the tests that could use these)
- pin `ember-in-viewport` to 3.0.x to work around incompatibilities between different versions used in `ember-light-table`, `ember-infinity`, and `ember-sticky-element`
    - incompatibilities manifested as "Invalid value used as weak map key" errors thrown when using `ember-light-table` (subscribers screen)
- pin `ember-power-datepicker` to unreleased version that contains a move from global acceptance test helpers to modern test helpers
2019-01-02 09:58:55 +00:00
Kevin Ansfield
fd91e31825 Fixed koenigDragDropHandler._resetDrag throwing errors
no issue
- guard around `_elementsWithHoverRemoved` is necessary because it won't always be set
2018-12-17 17:21:22 +00:00
Kevin Ansfield
bc788994f8
Added drag-and-drop card re-ordering in the editor (#1085)
no issue
- add vertical drop position indicator handling to `koenig-drag-drop-handler` service
- fixed issues with nested drag-and-drop containers
- register card drag/drop handler in `koenig-editor`
    - add drag icon creation
2018-12-17 14:02:40 +00:00
Kevin Ansfield
e1c9ed687d Fixed error thrown by editor caption input when pressing Escape 2018-12-13 15:22:47 +00:00
Kevin Ansfield
f51c9dd5bb
Added auto-scroll when dragging gallery images (#1083)
no issue

Adds auto-scroll if the mouse is placed near the top or bottom of the window whilst dragging an image to re-order it within a gallery. Useful when the position you want to drag to is not currently on screen.

- append drop indicator element to `.koenig-editor` element to account for scrolling (also fixes indicator positioning bug with current implementation if you use mouse-wheel or keyboard to scroll the page whilst dragging)
- generalise `getParent` util to accept a 
  - switch to using selectors rather than dataset for finding parent draggable/droppable/container
- add a `ScrollHandler` class that is used by the `koenigDragDropHandler` service to trigger scrolling whilst dragging
2018-12-13 12:17:43 +00:00
Kevin Ansfield
5afdb552df Fixed drag-n-drop reorder of gallery images not responding to drops
no issue
- https://github.com/TryGhost/Ghost-Admin/pull/1081 introduced a bug where the `insertIndex` was being cleared every time we showed the drop position indicator because we hide the indicator as a reset every time we show the indicator. This meant every drop was missing the required insertIndex.
- added a flag to the `_hideDropIndicator` function so that a reset when showing the indicator doesn't clear the required information
2018-12-11 13:20:05 +00:00
Kevin Ansfield
23fa35c3c6 Fixed overlay overflow on left-most images in gallery card
no issue
- margin was applied to the wrong edge
2018-12-11 13:01:22 +00:00
Kevin Ansfield
7d0266e9eb
Fixed gallery image changing order randomly when dropped on itself (#1081)
no issue
- clear the cached `insertIndex` when hiding the drop position indicator
- update the gallery card's `_isDropAllowed` function to return `false` if the `droppabeIndex` (`insertIndex`) doesn't exist
2018-12-11 12:13:51 +00:00
Kevin Ansfield
6ba1c1168d
Fixed drop indicator not showing if placed directly between images (#1082)
no issue
- when dragging an image, if you dragged out of the gallery then back in directly over the space between images then no indicator was shown
- switch to using padding around images rather than margin so that the mouse can be detected over the gap. Added classes to the image overlays to account for the change in sizing
2018-12-11 12:13:15 +00:00
Kevin Ansfield
cd99ded0a0
Added drag-n-drop re-ordering of images within gallery cards (#1073)
no issue
- first pass at implementation of drag-and-drop re-ordering of images within a gallery
- adds a `koenig-drag-drop-handler` service that allows consumers (editor and cards) to hook into drag and drop behaviour without interfering with each other and allows for future possibilities such as dragging images between galleries or into/out of galleries
2018-12-11 10:05:59 +00:00
Kevin Ansfield
02b750e64e
Bumped editor undo states to 100 2018-12-06 10:08:49 +00:00
Kevin Ansfield
7c7061716e
Optimised gallery image upload previews (#1079)
no issue
- use `URL.createObjectURL(file)` to get a blob url rather than using `FileReader.readAsDataURL` which generates a very large data attribute
- speeds up the display of previews and associated browser hangs when an upload finishes, especially noticeable with large images and fast connections where multiple uploads finish around the same time
2018-12-05 20:16:03 +00:00
Peter Zimon
98d57d66ee UI refinements (#1075)
no issue
* Update negative margin of card indicators
* Update to Spirit 0.0.49
2018-11-26 14:25:47 +00:00
Rishabh Garg
2636e78246 Added image validation error message to gallery card (#1048)
closes https://github.com/TryGhost/Ghost/issues/9840
- added error on uploading an invalid image format
  - updated to use overall error method(`onFailed`) to set error message instead of individual upload failures(`onUploadFailure`)
2018-11-26 10:31:02 +00:00
Zimo
1beae3001c Fixing negative margins of Koenig embeds 2018-11-20 11:12:15 +01:00
Kevin Ansfield
a3c41f92f4
🐛 Fixed editor undo states for card contents (#1064)
refs https://github.com/TryGhost/Ghost/issues/10049
- update `{{koenig-card}}` component to compare payload values and create a snapshot when exiting edit mode for container cards (markdown, html, code)
- update image card to trigger snapshots on image upload/selection and width change
2018-11-06 14:43:19 +00:00
Kevin Ansfield
dc6def3c37 Fixed 'set on destroyed object' error in tests
no issue
- we were throttling word count updates but not taking into consideration the editor components could have been destroyed by the time the throttle timeout occurred
2018-09-24 11:09:19 +01:00
Kevin Ansfield
4ba9c6e582 🐛 Fixed broken editor state when deleting a selection containing cards
closes https://github.com/TryGhost/Ghost/issues/9852
- Ember was throwing an error because we weren't using `.set` to set properties on the editor component which halted execution whilst the component cards were being re-rendered
2018-09-17 11:48:13 +01:00
Kevin Ansfield
5ae15e2b04
🐛 Fixed ` not triggering code text expansions on German keyboards (Win/macOS only) (#1042)
closes https://github.com/TryGhost/Ghost/issues/9825
- the <code>`</code> key on German keyboard layouts is a dead key and so does not trigger the typical keyboard events our editor relies on
- added custom keyboard event listeners to watch for specific keyboard event sequences triggered by using the dead key + spacebar to insert a <code>`</code>
  - trigger text input handlers when we detect a <code>`</code> insertion
  - Linux unfortunately does not trigger events that can be used to track the sequence so this will not work there although it is easier to set up keyboard layouts without dead keys on Linux
- moved modifier key tracking into global event handlers from ember event handlers
  - reduce confusion from duplicated event handling
  - allows modifier key handlers to fire when keys are pressed without the editor element having focus
2018-09-05 17:51:57 +01:00
Kevin Ansfield
4bbd5f0149 Do not allow upload of invalid images to gallery
no issue
- added `onUploadStart` action to `{{gh-uploader}}` that is triggered when individual files start uploading
  - will not be triggered for any files that fail client-side validation
- changed `{{koenig-card-gallery}}` to only add images to the local gallery display when the uploader starts an upload
2018-08-31 12:01:08 +01:00
Kevin Ansfield
7d80ac9619 Updated gallery error message copy 2018-08-31 11:10:14 +01:00
Kevin Ansfield
23a349ab36 Refactored gallery card
no issue
- moved all payload building into single function
  - only put fully valid images into mobiledoc
- extracted image data reading and width/height reading into a separate function
- fixed re-ordering when deleting an image
2018-08-31 10:36:19 +01:00
Kevin Ansfield
2245d93f2b Added gallery card to the editor
no issue
- added gallery card (initial implementation)
    - supports upto 9 images in gallery
    - max 3 images per row
- fixed gh-uploaded error handling for generic errors
- ignore jsconfig.json
2018-08-30 17:48:20 +01:00
Zimo
46de788bb5 Adding hover state for image placeholder 2018-08-27 13:56:21 +01:00
Kevin Ansfield
89cc8a3189 Koenig - Fixed missing borders on some embeds
refs https://github.com/TryGhost/Ghost/issues/9724
- removed 1px white border on embed card click overlay so that it doesn't cover borders used by certain embeds such as Instagram and Facebook posts
2018-08-20 13:34:45 +01:00
Zimo
e4349edafb Replacing Facebook embed with Spotify 2018-08-15 18:11:16 +02:00
Kevin Ansfield
3e3adede4c Fix linting 2018-08-15 16:52:06 +01:00
Kevin Ansfield
69d3c63b0c 🐛 Koenig - Fixed pasting of plain text
refs https://github.com/TryGhost/Ghost/issues/9724
- `formatMarkdown` was previously changed to return a SafeString but that meant any direct usage of the helper had to account for not dealing with a basic String type
- changed `formatMarkdown` to return a basic String
- modified helper usage of `{{sanitize-html}}` to use triple-curlies
2018-08-15 16:25:02 +01:00
Zimo
4d45f03d1b Koenig - Minor design refinements
refs https://github.com/TryGhost/Ghost/issues/9724
- fixed Card menu plus icon's rounded edges
- decreased link toolbar appearance delay
- changing 'H'/'h' toolbar mapping to 'H2'/'H3' and harmonized title font size
2018-08-14 14:35:13 +01:00
Kevin Ansfield
84059cd5a7 🎨 Koenig - Added paste-url-over-selection link creation to caption inputs
refs https://github.com/TryGhost/Ghost/issues/9724
- the "paste url on a selection to make it a link" feature from the main editor was missing in caption inputs
- copied functionality across (shared functionality needs extracting at some point)
2018-08-13 10:59:13 +01:00
Kevin Ansfield
1f3d77d723 🐛 Koenig - Fixed pasting of rich-text image captions losing formatting
refs https://github.com/TryGhost/Ghost/issues/9724
- caption payload changed from `textContent` to a cleaned `innerHTML` in our `figureToImageCard` parser plugin
2018-08-13 10:41:01 +01:00
Kevin Ansfield
c345019b92 🐛 Koenig - Fixed rich-text captions sometimes losing spaces
refs https://github.com/TryGhost/Ghost/issues/9724
- `clean-basic-html` was being overzealous with it's empty element removal, often contenteditable (especially when pasting) will result in HTML such as `<span>&nbsp;</span>` which was being completely removed
- if an empty element has any spaces in it, replace the element with a textNode containing a single space
2018-08-13 10:37:45 +01:00