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

1213 commits

Author SHA1 Message Date
Austin Burdine
3fd2c7ad66 Swap out ember-inline-svg for ember-svg-jar (#970)
closes TryGhost/Ghost#9506
2018-03-19 09:57:31 +00:00
Rosco Kalis
e1e2d6e8bf Remove unused wordCount utility (#971)
issue TryGhost/Ghost#9507
- Removed unused wordCount utility
2018-03-19 09:19:09 +00:00
Kevin Ansfield
97e5925fec Koenig - Move list creation from card menus to toolbar
refs https://github.com/TryGhost/Ghost/issues/9505
- remove unordered and bullet list icons from the (+) and / menus
- add unordered and bullet list icons to the formatting toolbar
- reorder toolbar icons to match latest design specs
- remove now-unused `replaceWithListItem` actions
2018-03-15 14:35:39 +00:00
Kevin Ansfield
e47d778738 Koenig - Create blank paragraph when pressing Enter in title input
refs https://github.com/TryGhost/Ghost/issues/9311
- adds a solution to the problem of not being able to add text above a card if that card is the first section in the mobiledoc
2018-03-14 13:07:50 +00:00
Kevin Ansfield
d6bdc943d3 🐛 Fixed infinite loading on posts screen (#967)
closes https://github.com/TryGhost/Ghost/issues/9493

- bump `ember-infinity` to 1.0.0-alpha for Ember Data 3.0 support
  - update posts and users routes for change in API
- bump `ember-in-viewport` to 3.0.0 (fixes offset on posts screen with new version of ember-infinity)
2018-03-12 17:43:53 +07:00
Hey24sheep
09fe424eb1 🐛 Fixed "Are you sure" modal being shown incorrectly after toggling private mode (#964)
closes TryGhost/Ghost#9472
- add `changedAttributes()` passthrough to `settings` service
- use `changedAttributes()` in general settings `toggleIsPrivate` method to reset the password to the last known value when disabling private mode
2018-03-09 14:42:27 +00:00
Hey24sheep
a947c03594 🐛 Fixed need to click Night Shift toggle 3 times in certain circumstances (#965)
closes TryGhost/Ghost#9471
- added check for undefined value
- fixed the condition in feature.js _setAdminTheme
2018-03-09 09:34:43 +00:00
Kevin Ansfield
e4ce6481cc 🐛 Fixed size of the time input fields in publish and post settings menus
no issue
- moving the time input to use `{{gh-text-input}}` meant that the input gained the `.gh-input` class which messed with the combined date/time input styling
- switched back to plain `<input type="text">` to get rid of the extra class
2018-03-07 10:58:58 +00:00
Hey24sheep
3319dc7fee 🐛 Fixed unreadable error message colour when uploading themes/images (#962)
closes TryGhost/Ghost#9476
- added midgrey to uploader.css upload fail
2018-03-05 09:54:46 +00:00
Kevin Ansfield
04b8dbb855
Bump Ember dependencies to 3.0 (#961)
no issue
- upgrade `ember-cli`, `ember-source`, and `ember-data` to their latest 3.x versions
- remove jquery ajax test that was a silent failure anyway (we removed the global jquery ajax auth patch a while ago)
- fix issues that arose from using/abusing Ember internals in a couple of places
2018-02-28 17:31:43 +00:00
Kevin Ansfield
479b187ac0
Remove ember-one-way-controls (#959)
closes https://github.com/TryGhost/Ghost/issues/9386
- remove usage of `{{one-way-checkbox}}` in favour of direct HTML+handlebars
- add `{{gh-text-input}}` that inherits from Ember's built-in `TextInput` component along with our custom `TextInput` mixin
- swap all uses of `{{gh-input}}` for `{{gh-text-input}}
- remove `{{gh-input}}` component
- update `{{gh-textarea}}` to inherit from Ember's `TextArea` component instead of `OneWayTextarea` and update all component uses accordingly
- update `{{gh-trim-focus-input}}` to inherit from `{{gh-text-input}}` and update all component uses accordingly
- standardize on using the `focus-out` action naming rather than `focusOut` for all text inputs, this is because the text input components (especially `{{gh-trim-focus-input}}`) have their own `focusOut` handler which gets overridden if consumers supply their own `focusOut` attr
- drop `ember-one-way-controls` package
- add `ember-one-way-select` package
2018-02-28 11:44:03 +00:00
Kevin Ansfield
759aeb3884 Koenig - Image card
refs https://github.com/TryGhost/Ghost/issues/9311
- add actions for cursor movement and pass through to card components
    - `moveCursorToNextSection` deselects card and places cursor at beginning of next section, useful for caption inputs where <kbd>down arrow</kbd> or <kbd>right arrow</kbd> should move the cursor out of the input & card. Also creates an empty paragraph before moving the cursor if for some reason an empty paragraph doesn't exist after the last card in the doc
    - `moveCursorToPrevSection` deselects card and places cursor at end of previous section, useful for caption inputs where <kbd>up arrow</kbd> or <kbd>left arrow</kbd> should move the cursor out of the input & card
    - `addParagraphAfterCard` deselects card, creates a new paragraph after the card and moves the cursor to it. Useful for caption inputs where <kbd>enter</kbd> should have the same behaviour as if it was pressed whilst the card is selected
- modify `{{gh-uploader}}` so that it passes the FileList to it's `onStart` closure action. Useful for displaying previews when uploading images
- modify `{{koenig-card}}` toolbar display so that it can display text as well as icon buttons
- update `{{koenig-card-image}}` so that it has a full image uploader and caption input
2018-02-22 20:41:40 +00:00
Kevin Ansfield
44c2359e9d Update Spirit CSS 2018-02-22 17:02:14 +00:00
Sarah Frantz
2c0e4b3938 🐛 Fixed broken i18n docs link on general settings screen (#958)
no issue
- Link to i18n on the general settings screen 404'd - fixed link to go to https://themes.ghost.org/docs/i18n
2018-02-21 20:49:57 +00:00
Kevin Ansfield
1563d219b1 Update Spirit CSS 2018-02-20 17:40:17 +00:00
Kevin Ansfield
86eff72110 Koenig - Initial Spirit styles integration
no issue
- copy Spirit styles over (eventually these will live in an addon)
- update `ember-cli-build` to output a separate CSS file for Spirit
- update `asset-delivery` addon to output Spirit CSS link
- add `{{kg-style}}` helper for Spirit class names
- update `{{koenig-card}}` and the `{{koenig-card-markdown/html}}` components to use Spirit class names and markup
- replace markdown icon with new version from Spirit
2018-02-20 15:05:19 +00:00
Kevin Ansfield
33c7a2ab74 Fix session restoration
no issue
- upgrading to `ember-simple-auth` 1.5.1 introduced a session restoration bug due to a change in the underlying initializer that we override
2018-02-20 12:43:15 +00:00
Kevin Ansfield
a04baeba0a Koenig - Add click overlay to embed card
refs https://github.com/TryGhost/Ghost/issues/9311
- adds an overlay element to the embed card so that clicks do not interact with any embedded iframes so that you can lazy click to enter edit mode
2018-02-15 17:14:30 +00:00
Kevin Ansfield
66890f3732 Koenig - Update {{koenig-card-html}} to use new {{koenig-card}} container
refs https://github.com/TryGhost/Ghost/issues/9311
- wraps embed card in same container as the markdown card to handle mouse selection/edit toggles etc
- add render mode to embed card
- autofocus CodeMirror editor when switching to edit mode
- fix incorrect pointer on cards
2018-02-15 15:57:44 +00:00
Kevin Ansfield
ae79640a6a Koenig - Remove old Koenig alpha code
refs https://github.com/TryGhost/Ghost/issues/9311
- old code is no longer needed for reference so cleaning up
2018-02-15 10:46:23 +00:00
Kevin Ansfield
c82e2b370d Koenig - Generic {{koenig-card}} container card component
refs https://github.com/TryGhost/Ghost/issues/9311
- initial CSS for container card outline, selection state, toolbar, etc
- adds `{{#koenig-card}}` component to be used inside of component card templates to handle the default card container HTML, mouse interactions, etc
- update `{{koenig-card-markdown}}` to use the new `{{koenig-card}}` component
  - add render/edit mode views
  - focus the textarea when entering edit mode
- updated `{{koenig-editor}}`
  - add <kbd>Cmd+Enter</kbd> command to put a selected card into edit mode
  - when inserting new cards put them into edit mode immediately
  - move edit/select methods out of actions and into normal methods so that timing is easier to reason about
  - skip `cursorDidChange` process when cursor changes as a result of a card selection, fixes issues with `selectCard` being triggered multiple times unexpectedly
2018-02-13 18:00:54 +00:00
Austin Burdine
ae3b9f97d9 Contributor Role (#948)
refs https://github.com/TryGhost/Ghost/issues/9314

* added save button for contributor
* hide tag filter & redirect to posts.index if post is published
* update editor controller test to need session service
2018-02-07 10:42:46 +01:00
Katharina Irrgang
032b7d5f01 Escape html for error messages (#956)
no issue

- if we would like to re-add html in our error messages, we have to differentiate between static messages which can contain html and messages which are dynamic and can contain dynamic input, which should not allow html
- e.g. it is always possible that Ghost receives a message from a third party module, which concats static text with input text
- if we want to show html content from an error, we need to come up with a concept
- for now: no support for html in error messages
2018-02-07 10:30:04 +01:00
Kevin Ansfield
8efb2e485c Koenig - Card selection and deletion
refs https://github.com/TryGhost/Ghost/issues/9311
- cursor based card selection
- handling of delete/backspace when cards are involved
- add `cursorDidExitAtTop` closure action to `{{koenig-editor}}` to consolidate editor cursor behaviour in the editor
  - added extra behaviour for LEFT in editor and RIGHT in title to switch focus between title and editor
- fixed incorrect icon in the slash menu
2018-02-04 20:35:44 +01:00
Kevin Ansfield
5d0d98738d Koenig - HTML card template
refs https://github.com/TryGhost/Ghost/issues/9311
- add a basic HTML card that renders a CodeMirror editor
- adjust styles so that CodeMirror styles for the markdown editor don't affect CodeMirror instances inside Koenig
2018-02-03 19:20:50 +01:00
Kevin Ansfield
2d95392624 Koenig - Slash menu
refs https://github.com/TryGhost/Ghost/issues/9311
- adds `{{koenig-slash-menu}}` component that renders a quick-access card/block menu when typing `/` at the beginning of a new paragraph
2018-02-03 17:54:57 +01:00
Kevin Ansfield
f949c2cef6 Koenig - Fix whitespace above/below cards 2018-02-03 17:54:57 +01:00
Chris Morgan
9bcac85a5d Fixed copy in /settings/general (#953)
no issue

Two spelling and grammar fixes, and one technical.

- eg. → e.g.
- /yyyy/mm/slug/ → /yyyy/mm/dd/slug/
- , → .
2018-02-02 08:24:35 +00:00
Kevin Ansfield
584dece638 Koenig - (+) card/list selection menu
refs https://github.com/TryGhost/Ghost/issues/9311
- re-implement the (+) card/list selection menu from the old Koenig alpha with improved positioning and event handling
- buttons work for the currently available cards - `<hr>` and `markdown`
2018-01-31 15:49:20 +01:00
Kevin Ansfield
bcadfbc30a Koenig - Textarea-only markdown card
refs https://github.com/TryGhost/Ghost/issues/9311
- add `{{koenig-card-markdown}}` component that renders an auto expanding textarea with the markdown card value
- add `{{card-markdown}}` that is an alias of `{{koenig-card-markdown}}` for backwards compatibility - all of our pre-1.0 alpha cards and our current markdown implementation do not have the `koenig-` prefix in their card names
2018-01-31 08:32:27 +00:00
Kevin Ansfield
9c57402030 Koenig - Fixed jump-to-top bug when focusing editor
refs https://github.com/TryGhost/Ghost/issues/9311
- the editor was being focused and the cursor placed properly but the act of focusing also reset the scroll position
- pulled the `.gh-koenig-editor` class into the component rather than leaving it in the template so that the component has access to `this.element`
- ensure the `.gh-koenig-editor` container is scrolled all the way to the bottom after focusing the editor
2018-01-30 21:09:46 +00:00
Kevin Ansfield
2093b34c36 Koenig - HR card with markdown text expansion
refs https://github.com/TryGhost/Ghost/issues/9311
- adds the `koenig-card-hr` card that renders a `<hr>` element
- adds text expansion to convert `---` into the new HR card
2018-01-30 15:19:30 +00:00
Kevin Ansfield
3d341e2dd6
Koenig reboot - rich text (#952)
refs https://github.com/TryGhost/Ghost/issues/9311

Koenig is being fully rebooted, first port of call is to focus on getting the rich-text only aspect of mobiledoc-kit working with our popup toolbar.

- renames old koenig implementation (used for reference, will eventually be deleted)
- new `{{koenig-editor}}` mobiledoc-kit component implementation based on ember-mobiledoc-editor
  - markdown text expansions
- new `{{gh-koenig-edtor}}` that wraps our title+editor and handles keyboard navigation between the two
  - clicks below content will focus the editor
- new `{{koenig-toolbar}}` component for the popup formatting toolbar with improved behaviour and simplified code
2018-01-30 10:01:07 +00:00
Kevin Ansfield
3bbd488ff2 🐛 Fixed editor autofocus when starting a new post
no issue
- we were setting the `shouldFocusEditor` value correctly but then immediately resetting it again 🙈
- updated the logic to change the value when going from new->edit as well as setting it correctly _after_ all of the controller values are reset in the `setPost` method
2018-01-25 13:14:50 +00:00
Aileen Nowak
9b014fa323 🎨 Improved warning about authored posts being removed when deleting a user (#951)
closes TryGhost/Ghost#9405
- users were still not noticing the warning that a user's posts are deleted along with the user
- improves the confirmation dialog layout to be clearer and even more explicit about authored posts being deleted along with the user
2018-01-23 10:45:19 +00:00
Kevin Ansfield
41b3521cf1
Resurrect the old alpha Koenig editor (#916)
requires https://github.com/TryGhost/Ghost/pull/9277

- added a `koenigEditor` feature flag
  - modified the feature service to accept a `developer` boolean on the options object passed into the internal `feature` method, if `true` the feature flag won't be enabled unless the `enableDeveloperExperiments` config option is also enabled
  - added "developer feature testing" section in labs that's only visible if `enableDeveloperExperiments` config flag is enabled
  - added koenig editor toggle to the developer section in labs

- enabled a switch between the markdown and koenig editors
  - modified the default value of the `mobiledoc` attr in the Post model to be a blank mobiledoc or blank markdown mobiledoc depending on the feature flag
  - modified the `autofocus` switch in editor controller's `setPost` method so that it is always switched, even for new->edit where the post model isn't swapped
  - added a compatibility check to the editor controller's `setPost` method that shows an alert and force enables the koenig editor if the koenig flag is not enabled and the opened post is not compatible with the markdown editor

- fixed various issues that have appeared due to the old koenig alpha becoming out of sync with master
2018-01-18 15:36:01 +00:00
Kevin Ansfield
51e890b991
Refactor new->edit transition to avoid editor re-renders (#949)
closes TryGhost/Ghost#8287
closes TryGhost/Ghost#8750
- moved all editor model functionality into the new `editor` route+controller
- moved editor template from `editor/edit.hbs` to `editor.hbs`
- refactored `editor` controller and the `editor.new`/`editor.edit` routes to work with a persistent editor rather than a teardown/re-render when transitioning from new->edit
- fixed issue in `{{gh-markdown-editor}}` for `autofocus` behaviour when the component isn't re-rendered
- fixed issue in `{{gh-simplemde}}` that was causing multiple updates to the `value` property when a new value is passed in to the component
- added `{{gh-scheduled-post-countdown}}` component to lower the noise in the editor controller
- removed editor route/controller mixins
- removed the `editor.edit` and `editor.new` controllers
2018-01-17 13:27:37 +00:00
Kevin Ansfield
8b3c92ee20 🐛 Fixed 'c' and 'k' chars not working in Unsplash search when adding tag cover
closes https://github.com/TryGhost/Ghost/issues/9147
- change the keymaster scope when the unsplash search input has focus so the route's registered shortcuts aren't accidentally triggered
2018-01-12 18:09:10 +00:00
Kevin Ansfield
99dcc96e4c Handle errors thrown during app boot
closes https://github.com/TryGhost/Ghost/issues/9394
- add `application-error.hbs` template so that we show an error screen for errors during app boot
- track the application route loading state so that we can fall back to the default error handling for errors that usually only show an alert
2018-01-12 16:11:46 +00:00
Kevin Ansfield
ac16e6504c ESLint: Consistent ember property/method ordering
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-components.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-controllers.md
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-routes.md
2018-01-12 12:17:56 +00:00
Kevin Ansfield
0ef503f23d ESLint: Don't use observers if possible
closes https://github.com/TryGhost/Ghost/issues/8690
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-observers.md
- remove observers where possible
- move night shift toggle behaviour to the feature service
	- refresh feature service after import to fix stuck night shift toggle
2018-01-12 12:17:56 +00:00
Kevin Ansfield
9fe5159915 ESLint: Be explicit with Ember Data attribute types
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/no-empty-attrs.md
2018-01-12 12:17:56 +00:00
Kevin Ansfield
050f4d99b6 ESLint: Alias model in controllers
no issue
- https://github.com/ember-cli/eslint-plugin-ember/blob/HEAD/docs/rules/alias-model-in-controller.md
- replace `model` with a meaningful property name everywhere possible
- refactor `design` and `general` settings controllers to use a directly injected settings service rather than passing it in as a "model" to be more explicit
2018-01-12 12:17:56 +00:00
Kevin Ansfield
a9fcddaf3f Remove unused "copy-html" modal component 2018-01-12 12:17:56 +00:00
Kevin Ansfield
7afb88a0c2 Switch to eslint-plugin-ghost extending plugin:ghost/ember
no issue
- fix lint errors in lib/gh-koenig
- fix ghost:base eslint errors
- update ember plugin refs, remove ember-suave plugin refs
- remove old jshint refs
- add `lint:js` script
- switch to `eslint-plugin-ghost` extending `plugin:ghost/ember`
2018-01-12 12:17:56 +00:00
Kevin Ansfield
e4d34d4221 🎨 Highlight non-breaking spaces as special chars in the editor
closes https://github.com/TryGhost/Ghost/issues/9384
- add non-breaking space char to CodeMirror's default "specialChars" regex so that they are visible in the editor
2018-01-11 09:20:25 +00:00
Kevin Ansfield
63fe1b1a88
🎨 Move "Update available" notification to the About screen (#894)
refs https://github.com/TryGhost/Ghost/issues/5071

Upgrade messages are now shown on the About screen rather than as alerts. Notifications that are marked as `top` or `custom` are still shown as alerts to allow for certain upgrade messages to be given more visibility.

- remove old `upgrade-notification` service
- update the `upgrade-status` service:
  - add a `message` property that contains an upgrade notification if any exists
  - add a `handleUpgradeNotification` method that accepts a Notification model instance and extracts the `notification.message` property into a html safe string for use in templates
- when loading server notifications during app boot, pass notifications that aren't marked as `top` or `custom` to the new `handleUpgradeNotification` method
- update the `about.hbs` template to pull the upgrade message from the `upgradeStatus` service
2018-01-09 14:23:36 +00:00
juan-g
f701962f63 Theme translations and blog localisation (#703)
refs #5345, refs #3801, refs https://github.com/TryGhost/Ghost/pull/8437

- added language option to General Settings
- just a text field for flexibility, to allow any language (validation will be added later)
- default language is: English (en)
- added i18n docs link under the input field

**Documentation can be found at https://themes.ghost.org/v1.20.0/docs/i18n.**
2018-01-09 14:55:28 +01:00
Kevin Ansfield
b8fc5606b8 Added Zapier app with pre-built zap templates list (#943)
no issue

- add Zapier app to Apps screen
- use Zapier's zap template embed widget to list our pre-built templates
2018-01-09 11:36:41 +01:00
Kevin Ansfield
ab99bcd20d Fix linting error 2018-01-08 19:30:16 +00:00