Commit Graph

64 Commits

Author SHA1 Message Date
Kevin Ansfield e32ba68c80 Fixed missing CSS styles in production builds
no issue

- some styles such as `border: none` inside `.gh-btn-white` were being stripped when ran through `clean-css` leading to visual differences between development and production
- disabled `ember-cli`'s default CSS minification as we already use `cssnano` for minification in our postcss pipeline for both dev and prod builds
2020-05-20 11:05:30 +01:00
Kevin Ansfield bb84f62838 Fixed conflicting svg ids
no issue

- enables `prefixIds` svgo option to guarantee all `id` attributes are unique across svgs
- disabled `cleanupIds` option so that it doesn't interfere with id uniqueness
- fixes instagram icon background not showing
2019-08-28 11:33:32 +01:00
Kevin Ansfield 824e668354 🐛 Fixed syntax highlighting inside Code Injection inputs
no issue
- the CodeMirror and theme styles were not being correctly loaded
2019-04-29 17:57:41 +02:00
Kevin Ansfield e551488e55 🐛 Fixed difficult to cancel webhook modal
closes https://github.com/TryGhost/Ghost/issues/10135
- `focusOut` events are fired before the `click` event is fired when clicking buttons whilst an input has focus, this has the effect of triggering our on-blur validations that can cause UI to jump which then results in the `mouseUp` being outside of the button which means no `click` event is fired
- stops `mouseDown` event from bubbling from modal cancel/close buttons so that `focusOut` validations aren't triggered
2019-03-15 14:38:54 +00:00
Kevin Ansfield 7e2ffa06dd Fixed Travis to exit early on lint failures and skip duplicate linting in ember tests
no issue
- Travis runs all `script` tasks even if an earlier one fails so moved to using `&&` so ember tests aren't run if linting errors
- Added `ember-cli-eslint` to the addons blacklist when building in Travis so that we aren't running linting twice (also reduces build log output)
2019-03-11 15:45:26 +00: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 b21af6ad77 Moved Spirit CSS library from external to internal 2019-02-24 11:19:22 +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 ba493d7862 Fixed listing, removed unused broccoli-clean-css dependency 2019-01-22 09:30:28 +00:00
Kevin Ansfield fdebfae0ca Lazy-load SimpleMDE dependency in MD card (reduces main bundle by 260KB)
no issue
- use broccoli-funnel to avoid polluting the `dist/` dir with unused build artefacts
- load codemirror and simplemde CSS up-front to avoid duplicate styles and specificity problems
- pull simplemde dependency out into a separate JS file and lazy-load in `{{gh-simplemde}}` component to reduce main bundle size. Before/after:
  - `vendor.min.js 3.58 MB (795.88 KB gzipped)`
  - `vendor.min.js 3.32 MB (710.66 KB gzipped)`
2019-01-21 16:06:25 +00:00
Kevin Ansfield f24070922f 🐛 Koenig - Fixed Cmd+Backspace with special chars and Firefox triple-click behaviour
refs https://github.com/TryGhost/Ghost/issues/9724
- bump to custom build of mobiledoc-kit that includes unreleased fixes
  - cmd+backspace stopping on special chars: https://github.com/bustle/mobiledoc-kit/pull/632
  - Firefox triple-click then typing not replacing content: https://github.com/bustle/mobiledoc-kit/pull/593
2018-07-17 18:13:05 +01:00
Kevin Ansfield a291b43c0f Koenig - Fix mobiledoc-kit imports
refs 97ee08aae9
- remove the scoped package name from the import statements
2018-07-02 11:29:42 +01:00
Kevin Ansfield 2e49c9b3f4 🐛 Fixed backspace deleting words and rich-text paste collapsing paragraphs
refs https://github.com/TryGhost/Ghost/issues/9623
- switch to custom `mobiledoc-kit` build
  - fixes top-level elements not being run through parser plugins (https://github.com/bustle/mobiledoc-kit/pull/627)
  - fixes <kbd>Alt</kbd> getting stuck and causing <kbd>Backspace</kbd> to delete whole words (https://github.com/bustle/mobiledoc-kit/pull/626)
  - fixes error that can occur when a paste results in blank insert (https://github.com/bustle/mobiledoc-kit/pull/620)
- add new `figureToImageCard` parser
  - replaces hacky workaround to detect an image+figcaption inside the `imgToCard` parser plugin
- remove wrapping of html in a `<div>...</div>` when pasting
  - no longer necessary now that top-level elements are parsed
  - fixes rich-text pastes where multiple paragraphs would be collapsed into a single paragraph
2018-06-18 18:48:32 +01:00
Kevin Ansfield 57a66f7cdc 🐛 Koenig - Fix embedding of multiple FB Videos
refs https://github.com/TryGhost/Ghost/issues/9623
- wrap all embeds in an `<iframe>` so that their scripts are isolated (fixes FB Video)
- add `MutationObserver` implementation to adjust iframe height as embed's content is loaded
- add `noframe.js` to resize embedded iframes such as YouTube videos
2018-06-13 17:13:33 +01:00
Chris Thoburn 47d91aa910 Don't fingerprint assets in development (dev perf fix) (#1018)
no issue
- doing so causes a double pass through asset-rewrite and forces both to take much longer. This cuts 3s off of rebuilds.  Using asset-rewrite as is done in dev mode is also suspicious, likely a better setup could be devised that doesnt require rewrite to interop with the local ghost server
2018-05-21 09:37:17 +01:00
Kevin Ansfield a28eb92c12
Switch to packaged version of Spirit (#985)
no issue
- remove the manually copied Spirit CSS files
- remove the manually copied Spirit helpers
- install `ember-cli-ghost-spirit` addon
- remove manual postcss configuration
- update all `color()` functions in CSS to `color-mod()`
- fixed invalid `color-mod()` usage in `power-calendar.css`
- bump sub-dependencies
2018-04-03 11:52:18 +01:00
Austin Burdine fd6f2551bb Bower => NPM (#972)
no issue

- Convert validator to an npm dependency
  - clean up validator imports
  - fix validator function imports
  - remove unused validator extensions
- Convert devicejs to an npm dependency
- Convert remaining used bower deps to npm deps
- 🔥 Remove bower & unused bower dependencies
- remove globals imports in favor of direct module imports where possible
2018-03-19 17:56:09 +00:00
Kevin Ansfield 9dee8a0f31 Fixed Koenig SVG assets after ember-svg-jar switch
no issue
- https://github.com/TryGhost/Ghost-Admin/pull/970 worked for the general public icons but failed for koenig icons because of the incorrect config parameter name (`paths` -> `sourceDirs`)
- disabled the `stripPath` config so that there's no conflicts between public (`icon`) and koenig (`koenig/icon`) icons
2018-03-19 13:10:04 +00:00
Austin Burdine 2ea1a354d9 Replace jquery-deparam with deparam dependency (#973) 2018-03-19 10:29:01 +00:00
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
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 3280ca7b84 Koenig - Use {{inline-svg}} helper in {{koenig-plus-menu}}
refs https://github.com/TryGhost/Ghost/issues/9311
- use the `{{inline-svg}}` helper instead of having SVGs inlined manually in the component template
- rename the koenig icons directory
- add the koenig icons directory to the list of locations used by `{{inline-svg}}`
2018-01-31 16:20:27 +01: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 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 72ff75b935
New tags input, drop selectize & jquery-ui deps (#892)
closes https://github.com/TryGhost/Ghost/issues/6458
- swap `ember-sortable` for `ember-drag-drop` in navigation UI
- extract PSM tag input into new `{{gh-psm-tags-input}}`
- add new `{{gh-token-input}}` that wraps `ember-power-select` and `ember-drag-drop` to replicate the previous selectize based tags input
- enhance `{{gh-psm-tags-input}}` behaviour to highlight selected primary tag and show "primary/internal" in selected tag titles
- 🔥 remove `selectize`
- 🔥 remove `jquery-ui`
- 🔥 remove unused `{{gh-navigation}}` component
2017-10-31 09:10:49 +00:00
Kevin Ansfield bfb27f677a Bump dependencies (#887)
no issue

- ember/ember-data/ember-cli@2.16
- bump all outdated dependencies that do not require additional work or more extensive tests
- bump sub-dependencies in yarn.lock
- use `broccoli-uglify-sourcemap` (same dep as already used in `ember-cli-uglify`) instead of a separate `broccoli-uglify-js` package for building production codemirror assets
- add `/concat-stats-for` to `.gitignore` so that filesize stats from `CONCAT_STATS=true ember build` don't end up in the repo
2017-10-12 17:42:10 +02:00
Kevin Ansfield 46c42b7214 Improved built JS compat w/ CloudFlare Auto Minify (#861)
refs TryGhost/Ghost#8815, TryGhost/Ghost#8840, TryGhost/Ghost#8842, TryGhost/Ghost#8849
- `ember-cli` 2.14 introduced some [new defaults for uglify-js](https://github.com/ember-cli/ember-cli/pull/7077) that resulted in CloudFlare's Auto Minify feature mangling the JS files and causing syntax errors
- revert the `semicolons: false` option to restore compatibility

**Note:** This does _not_ mean it's recommended to use CloudFlare's Auto Minify feature. It's still recommended that all CloudFlare's performance settings are [disabled for /ghost* URLs](https://docs.ghost.org/docs/troubleshooting#section-ghost-admin-not-loading)
2017-09-18 16:39:03 +01:00
Kevin Ansfield 852b9eec05 Remove usage of jquery-file-upload (#815)
closes https://github.com/TryGhost/Ghost/issues/6661
- refactor `gh-profile-image` component to use native browser functionality
- remove `jquery-file-upload` bower dependency
2017-08-18 10:27:42 +07:00
Aileen Nowak 9e614978f0 🐛 fix sticky save notifications (#762)
closes TryGhost/Ghost#8610

There's an issue in CSSnano, which we're using in production mode to minify our CSS that caused animation frames to not work properly anymore.
See: https://github.com/ben-eb/gulp-cssnano/issues/33#issuecomment-210518957

Adding the recommended options fixed this issue.
2017-07-04 11:20:25 +01:00
Kevin Ansfield 590006af89 🎨 fully fix Code Injection styles (#723)
closes https://github.com/TryGhost/Ghost/issues/8504

- allow `.settings-code-editor` to inherit from `.gh-input` - fixes border colours
- change `gh-cm-editor`'s "focused" class from `.focused` to `.focus` so it can inherit `.gh-input` styles
- add lazy loading of CM styles back in `gh-cm-editor` but prevent `lib/codemirror.css` from being compiled into the codemirror styles so that we get the theme colours without causing conflicts with the main editor
2017-06-01 23:01:43 +02:00
Kevin Ansfield a14efa9e16 Fix split screen editor (#684)
no issue

* fix title input padding and placeholder weight
* 🔥 remove unused showdown-ghost dependency
* implement full screen mode via CSS rather than autonav toggle
* implement custom split pane editor preview
    - replace SimpleMDE's split pane handling with our own so that we have more control over the element positioning, toggling of our custom fullscreen code, and so that the preview pane can be scrolled separately as per our old editor
* use forked version of simplemde that has the latest CodeMirror compiled
    - SimpleMDE hasn't been updated for 11 months and the version of CodeMirror is baked into the SimpleMDE code, to get an up to date version I've forked and re-compiled
    - pull in the unminified SimpleMDE source so that it's easier to debug in development, our asset compilation steps will take care of minifying it for production
* fix gh-markdown-editor teardown
2017-05-08 19:15:56 +01:00
Kevin Ansfield 4b48328e6d SimpleMDE editor (#682)
no issue

* move "save on first change" behaviour into editor controller
* allow TAB events to be specified in keyEvents hash of gh-input
* replace mobiledoc-kit/gh-koenig with a SimpleMDE based editor
    - remove `gh-koenig` in-repo-addon from `package.json` so that test files etc aren't loaded
    - remove `mobiledoc-kit` dependencies
    - extends `gh-editor` to handle file drag/drop
    - adds `gh-uploader` and `gh-progress-bar` components to handle file uploads in a more composable manner
    - adds `gh-simplemde` component that wraps SimpleMDE
2017-05-08 11:35:42 +01:00
Kevin Ansfield 5c76346cd0 🎨 animated retry icon
refs https://github.com/TryGhost/Ghost/issues/7515
- add a `retry` icon that better matches button text dimensions
- add a spin animation for the retry icon
- use the new retry icon in the default `gh-task-button` template
- add a "restart animation" method to `gh-task-button` so that repeated clicks on a button appear to register the action when local validation means that there's no transition from failed->running->failed
2017-04-14 16:16:52 +01:00
Kevin Ansfield 5e9e3cd027 switch to ember-cli-moment-shim (#622)
no issue

- preparation for using `ember-pikaday` that utilizes `ember-cli-moment-shim`
- removes usage of `moment` global
- removes custom imports of `moment` and `moment-timezone` libraries
2017-04-05 19:45:35 +02:00
Kevin Ansfield 0e69d95587 🐛 fix broken assets (#616)
closes https://github.com/TryGhost/Ghost/issues/8270

- add `.jpeg` to the list of asset extensions that get fingerprinted
- remove the use of the `{{gh-path "asset" ...}}` helper - since switching to hash-location URLs all assets can now be referenced relatively and removing usage of the helper prevents it getting in the way of ember-cli's asset fingerprinting/rewriting mechanism
2017-04-05 14:08:15 +01:00
Kevin Ansfield cfda6f8365 🐛 fix night-mode in production build
closes https://github.com/TryGhost/Ghost/issues/8213
- quick-fix by not adding the `.min` to the production `ghost-dark.css` file, the asset rename breaks the asset rewriting resulting in the lazy loader attempting to load a non-fingerprinted file
2017-04-05 07:42:20 -05:00
Kevin Ansfield ec78939910 Fix tests when run via http://localhost:4200/tests (#609)
* deps: ember-cli-node-assets@0.2.2

* fix tests when run via http://localhost:4200/tests

no issue
- `blogUrl` in the mocked config was hardcoded, switching to using the current origin fixed the navigation tests
- we were only pulling jquery drag simulator library in on test builds but we also need it added to `test-support.js` in development builds
- lazy loading is disabled in the test env which previously worked fine as all of the codemirror assets are bundled into the test build, now that we also run tests using the development build we needed to update the config to import codemirror assets into the `test-support.js` file - this ensures that we have normal lazy-loading behaviour when developing locally and that accessing via http://localhost:4200/tests doesn't die horribly due to missing dependencies
2017-03-30 20:51:50 +01:00
Kevin Ansfield 3b27fe5d15 deps: ember-cli@2.12.1 (#604)
no issue
- https://emberjs.com/blog/2017/03/19/ember-2-12-released.html#toc_changes-in-ember-cli-2-12
2017-03-28 11:29:18 +01:00
Kevin Ansfield e1f5ee8fcd 🎨 remove usage of ghost's {{asset}} helper in index.html (#574)
refs #8140

🎨 remove usage of ghost's {{asset}} helper in built index.html files

requires https://github.com/TryGhost/Ghost/pull/8142
- switch to hash-location rather than history-location
- remove usage of Ghost's `{{asset}}` helper in index.html
- add `content-for` helpers to `asset-delivery` addon that switch asset urls in index.html to `.min` files in production
- update the `asset-delivery` addon to copy the production `index.min.html` to `default-prod.hbs` so Ghost can serve production assets when in production mode
- change template output path to `core/server/admin/views/`
- enable asset fingerprinting
- remove `ember-cli-sri` dependency - we weren't using it but now that ember is handling assets it was used automatically and could potentially create issues if users have proxy servers that attempt to compress or otherwise modify asset files

 redirect to setup if server says setup isn't finished

refs https://github.com/TryGhost/Ghost/issues/8140
- now we're using hash-location the server no longer knows if we're hitting the /setup route so it's not able to redirect for us
- extends the default ESA `UnauthenticatedRouteMixin` to add a check against the `/authentication/setup` API endpoint and redirects to `/#/setup/one` if setup isn't complete - this works for all routes because the default behaviour when hitting an authenticated route without the right credentials is to force a logout and redirect to `/#/signin` which utilises the `UnauthenticatedRouteMixin`

deps: ember-cli-inject-live-reload@1.6.1
2017-03-14 17:04:46 +01:00
Kevin Ansfield 5181852b50 🐛 re-add broccoli-clean-css
no issue
- `broccoli-clean-css` is used to compress codemirror CSS files so it's still needed
- update usage in `ember-cli-build.js` to match 2.0's class interface
2017-03-03 17:19:19 +00:00
Kevin Ansfield 2b3d512fb0 move editor deps into main project
no issue
- this prevents the need for running `npm/yarn install` inside the `lib/gh-koenig` directory
- `ember-cli` may eventually be able to handle this with an `ember install` or similar command, there's [an in-repo-addon RFC](638cad2405/active/0000-better-in-repo-addons.md) suggesting this improvement but it hasn't got much traction yet - it may be necessary to wait until ember-cli has standardised on `yarn`
2017-03-02 11:06:20 +00:00
Kevin Ansfield d4eeb2ec96 inline-svg helper for icons (#558)
no issue
- adds [ember-inline-svg](https://github.com/minutebase/ember-inline-svg) addon
- configure svg path to `public/assets/icons` so that icons can be accessed directly, eg `{{inline-svg "plane.svg"}}`
- configure svg optimization to remove title, dimensions, and xmlns element (not needed for inline svg)
- add existing icons as used on Ghost.org
2017-03-01 12:48:27 +00:00
Kevin Ansfield 5674498759 accordion toggles for settings sections 2017-02-21 13:03:44 +00:00
Austin Burdine 758a2a551a 🎨 Myth => PostCSS (#537) 2017-02-18 02:46:41 +07:00
Kevin Ansfield 229391d638 Revert "Offline Support via ServiceWorker" (#526)
Temporarily reverting in order to get the next alpha release out. Unfortunately this has the unintended consequence of the service worker caching a 200 response for /ghost/ so when starting a new blog the redirect to /setup/one that the server sends is never picked up.

This would only affect developers using localhost/people trying to set up a blog multiple times on the same domain but as that's the target audience for the alpha it's probably best to avoid any confusion.
2017-02-11 22:57:12 +00:00
Felix Rieseberg acf6348681 🚀 Offline Support via ServiceWorker (#523)
This commit adds support for service workers, mostly by including packages that do the heavy lifting. Those are in detail:

* ember-service-worker (SW infrastructure)
* ember-service-worker-ghost-cache (Caches static assets and the main application)
* ember-service-worker-cache-fallback (Caches API requests and falls back to the cache if the server can’t be reached)
* ember-service-worker-index (Caches main html)
2017-02-11 14:42:46 +00:00
Kevin Ansfield b73a3f0b29 New content screen prototype (#503)
refs https://github.com/TryGhost/Ghost/issues/7860

- remove preview pane from content screen
- add basic post status filters
- replace custom infinite scroll with ember-infinity and increase trigger threshold for improved scroll behaviour

Commits:
* basic content list + filter using existing infinite scroll and pagination
* swap our custom pagination + infinite loader for `ember-infinity`
* minor cleanups
* reset scroll position when changing filter
* fix tests
* remove client-side sorting step as we no longer have a live collection
* remove unused `mobile-index-route`
* add acceptance tests for content screen filters
2017-01-25 21:05:28 +01:00
Austin Burdine abfcc4f7ff deps: ember-cli-mirage@0.2.0
- remove lodash from bower
- move all resources to /mirage instead of /app/mirage
- update endpoints to use ORM
- general cleanup
2017-01-13 15:59:37 +00:00
Kevin Ansfield 2265ee25c8 switch from jshint/jscs to eslint
no issue
- drop `jshint`, `jscs`, and `ember-suave` dependencies
- remove `grunt` related linting dependencies and tasks
- remove linting build from Travis so that linting can be performed as part of the normal test suite (refs TryGhost/Ghost#7427)
- add `ember-cli-eslint` and `eslint-plugin-ember-suave` dependencies
- configure `eslint` to match our previous coding style
- update config to run eslint tests as part of the normal test run
- add `npm run lint` command to only run linter tests
2016-11-14 13:25:36 +00:00
Hannah Wolfe 9edd8e3286 🎨 Change asset path to /ghost/assets (#309)
refs #7503

- Having assets served from the same directory as the admin makes this tricky to refactor server side
- It's also much harder to optimise for 404s
2016-10-07 16:16:26 -05:00