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

203 commits

Author SHA1 Message Date
Kevin Ansfield 101ea4222d Cleaned up unused code in bookmark card
no issue

- the `willDestroyElement` hook is referencing event handlers that aren't used in the bookmark card
- stopped setting `type` in the card payload as it's not used anywhere (possible hangover from when bookmarks were a type of embed card)
2020-01-21 17:45:33 +00:00
Kevin Ansfield 92107312a8 Upgraded eslint-plugin-ghost and fixed new linter errors
no issue

- update imports for `@ember-data` package (https://github.com/emberjs/rfcs/blob/master/text/0395-ember-data-packages.md)
- use `computed.reads` where applicable (https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/require-computed-macros.md)
- fix usage of `scheduleOnce` so that functions are only scheduled once (https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-incorrect-calls-with-inline-anonymous-functions.md)
2020-01-16 17:01:12 +00:00
Kevin Ansfield 90fc381767 🐛 Fixed editor showing incorrect domain and "unsaved changes" modal for relative links
no issue

- convert relative links to absolute based on the configured blog url when displaying URLs in the link toolbar and when manually setting a relative link
  - converting to absolute in the editor prevents the in-memory mobiledoc getting out of sync with the server response when it converts relative urls to absolute
2019-10-29 11:57:29 +00:00
Kevin Ansfield e32110c73a Fixed "undefined" appearing in markdown card styles
no issue
2019-08-28 09:56:45 +01:00
Rishabh Garg 9bfd340885 Added bookmark card and integrated it as fallback for unknown embeds (#1293)
requires https://github.com/TryGhost/Ghost/pull/11024

With the bookmark card you can present links in a much richer format, similar to Twitter cards. If the URL points to a page with right meta information it can show the page title, excerpt, author, publisher and even a preview image.

Bookmark cards can be created in two ways:

1. pasting a link as the first thing in blank paragraph - we'll check to see if we can create an embed, if we can't then we'll create a bookmark card instead
2. manually selecting the bookmark card from the (+) menu or by typing "/bookmark<kbd>Enter</kbd>" or "/bookmark {url}<kbd>Enter</kbd>" for short (you might want to do this if you want the bookmark version instead of a full embed)

Pressing <kbd>Ctrl/Cmd+Z</kbd> after pasting will convert the bookmark card back to a link if that's preferred, alternatively a URL can be pasted with <kbd>Ctrl/Cmd+Shift+V</kbd> to avoid any automatic transformation to an embed/bookmark.

---

- adds "bookmark" card that functions similarly to the embed card
- if the oembed API request returns `type: "bookmark"` then the metadata is used to create a bookmark card
2019-08-27 15:10:31 +01:00
Kevin Ansfield 0e8754b886 Added ability to edit alt text for image cards
no issue

- adds an "Alt" button that is displayed in the caption input whilst an image card is selected, clicking it toggles between the rich-text caption input and a plain-text alt text input
2019-07-23 18:13:41 +01:00
Kevin Ansfield 564ee97b01 🐛 Fixed unexpected image positions when re-ordering gallery images
no issue

- the position that images were inserted did not always match the position indicator because of errors in the insert index calculations
2019-07-05 14:54:22 +01:00
Kevin Ansfield aa8c0200e3 Added ability to drag images in and out of galleries
no issue

- adjust drag handlers in the editor and gallery card to handle drag/drop of image cards as well as straight images
- adjust drag handlers in the gallery card to handle image inserts as well as re-orders
- add `onDragEnd` event/action to the Koenig drag-n-drop handler so that containers can perform cleanup if one of their draggables was successfully dropped into a different container
- change ghost element when dragging an image card to be an image rather than a card icon
  - allow `createGhostElement` function passed in when registering a drag-n-drop container to fall back to the default behaviour by returning a falsy value
2019-07-05 14:54:22 +01:00
Kevin Ansfield 0e70ac51b2
Update dependency eslint-plugin-ghost to v0.3.0 (#1247)
no issue

- update dependency `eslint-plugin-ghost` to v0.3.0
  - includes new rules from `eslint-plugin-ember` 6.3.0-6.7.0
- fixed linting failures for new rules
2019-06-24 16:33:21 +01:00
Peter Zimon 183e22e0bf 🎨 Updated admin area design and usability (#1232)
refs. https://github.com/TryGhost/Team/issues/205

Major update to Ghost Admin UI including:
- improved general consistency (typography, colors and contrast, UI components, icons)
- new design for post and pages lists, improved discoverability of filters 
- search moved to modal
- account menu is decoupled from ghost logo
- further usability fixes
2019-06-18 11:47:20 +01:00
Kevin Ansfield 556bb46f98 Use extracted @tryghost/kg-parser-plugins package
no issue

- `@tryghost/kg-parser-plugins` contains the parser plugins used by the editor and was extracted so that they can be used in server-side html-to-mobiledoc conversion
2019-05-03 10:45:08 +01:00
Kevin Ansfield 3bcb56225d Use extracted @tryghost/kg-clean-basic-html package
no issue
- `cleanBasicHtml` has been extracted to an external package so that it can be used inside the extracted `@tryghost/kg-parser-plugins` package server-side
2019-05-02 17:14:00 +01:00
Kevin Ansfield de94b4cd40 do not show card toolbar if caption has focus 2019-05-01 15:13:49 +01:00
Kevin Ansfield 538b6b3504 extract {{kg-action-bar}} component 2019-05-01 13:57:00 +01:00
Kevin Ansfield 1c2ed065c8 Added caption support to code cards
no issue
2019-04-30 18:14:49 +02:00
Kevin Ansfield 40f7babc46 Fixed invisible caret in captions for cards with no style specified 2019-04-30 17:53:19 +02:00
Kevin Ansfield 232cd9382b
Added language selection to code cards (#1180)
no issue

- Added a language indicator when in rendered mode and a language input when in edit mode
- Allow code card language to be set with <code>```lang</code>+<kbd>Space/Enter</kbd> expansion 
    - previously <code>\`\`\`</code> would immediately create a code card, the <kbd>Space/Enter</kbd> is now necessary for the insertion to occur
    - lang is optional <code>\`\`\`</code>+<kbd>Space/Enter</kbd> will insert a code card with no language selected
    - requires <kbd>Enter</kbd> to be pressed to finalise the expansion and insert the card
    - added hook for text expansions to skip newline creation for when they are triggered with <kbd>Enter</kbd>
- Set the code card editor's language mode based on selected language
    - set the CodeMirror mode based on the code card payload language
        - add a basic map of language short codes to their respective CodeMirror modes
    - observe `mode` property in `{{gh-cm-editor}}` so that the mode is properly set when it's changed after initial render
2019-04-30 16:46:29 +02:00
Kevin Ansfield 99375f73f4 Fixed slash-menu appearing empty immediately after setting title on new post
closes https://github.com/TryGhost/Ghost/issues/9847
- the text expansion is triggered twice in this situation, the first time with `""` and the second with `"/"`. The second trigger was trying to match cards to `"/"` which returned an empty card set
- added a quick workaround that ensures we never include a leading `/` in the card selection query
2019-04-29 17:08:40 +02:00
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
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
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 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
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 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 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
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