Commit Graph

54 Commits

Author SHA1 Message Date
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
Ryan McCarvill c34e0161ff Mobile-Doc based editor (#291)
refs TryGhost/Ghost#7429, requires TryGhost/Ghost#7437

Added Ghost-Editor (based on mobiled doc).
-------------------
- Added mobiledoc editor
- Fixed problems with workflow and auto saves
- Integrated basic toolbar
- Removed all editor related tests, everything bar the most basic acceptance tests will be in the ghost-editor repository.
- Commented out tests which relied on Ember Helpers that are not compatable with mobile-doc, workarounds are inbound shortly.

This is the first integration of ghost-editor. It's styled enough to work, however it is not anywhere approaching something that looks remotely like what the finished thing will be.

Early ALPHA, development build. Tread cautiously.
2016-09-26 15:04:20 +02:00
Austin Burdine 666a3e7f1a lazy-load codemirror on code injection screen (#99)
refs TryGhost/Ghost#6149
- concats codemirror.js and css on build, keeping them out of vendor.js
- add lazy-loader service to enable loading of external scripts
2016-07-05 17:30:14 +01:00
Austin Burdine c803bd913d only build parts of jquery-ui that we need (#100) 2016-06-30 14:42:00 +01:00
Kevin Ansfield b9cf09541d convert bower deps to npm deps
no issue
- convert moment + moment-timezone to npm dependencies
- convert password-generator to npm dependency
- convert keymaster.js to npm dependency
- convert blueimp-md5 to npm dependency
2016-06-29 11:52:10 +01:00
Kevin Ansfield 47f286448e deps: jquery-deparam@0.5.2 as npm module 2016-06-29 11:28:53 +01:00
Kevin Ansfield e9ebca5189 deps: codemirror@5.16.0 as npm module 2016-06-29 11:28:53 +01:00
Aileen Nowak be8b31ec85 Timezones: Always use the timezone of blog setting
closes TryGhost/Ghost#6406

follow-up PR of #2

- adds a `timeZone` Service to provide the offset (=timezone reg. moment-timezone) of the users blog settings
- `gh-datetime-input` will read the offset of the timezone now and adjust the `publishedAt` date with it. This is the date which will be shown in the PSM 'Publish Date' field. When the user writes a new date/time, the offset is considered and will be deducted again before saving it to the model. This way, we always work with a UTC publish date except for this input field.
- gets `availableTimezones` from `configuration/timezones` API endpoint
- adds a `moment-utc` transform on all date attr (`createdAt`, `updatedAt`, `publishedAt`, `unsubscribedAt` and `lastLogin`) to only work with UTC times on serverside
- when switching the timezone in the select box, the user will be shown the local time of the selected timezone
- `createdAt`-property in `gh-user-invited` returns now `moment(createdAt).fromNow()` as `createdAt` is a moment date already
- added clock service to show actual time ticking below select box
- default timezone is '(GMT) Greenwich Mean Time : Dublin, Edinburgh, London'
- if no timezone is saved in the settings yet, the default value will be used
- shows the local time in 'Publish Date'  in PSM by default, until user overwrites it
- adds dependency `moment-timezone 0.5.4` to `bower.json`

---------

**Tests:**

- sets except for clock service in test env
- adds fixtures to mirage
- adds `service.ajax` and `service:ghostPaths` to navigation-test.js
- adds unit test for `gh-format-timeago` helper
- updates acceptance test `general-setting`
- adds acceptance test for `editor`
- adds integration tests for `services/config` and `services/time-zone`

---------

**Todos:**

- [ ] Integration tests: ~~`services/config`~~, ~~`services/time-zone`~~, `components/gh-datetime-input`
- [x] Acceptance test: `editor`
- [ ] Unit tests: `utils/date-formatting`
- [ ] write issue for renaming date properties (e. g. `createdAt` to `createdAtUTC`) and translate those for server side with serializers
2016-06-03 16:23:39 +02:00
Kevin Ansfield fffd211667 Drop XRegExp dependency
closes #6102
- removes the `xregexp` dependency
- pulls in the non-alphnumeric unicode list directly from the XRegExp library to ensure the word count helper still takes into account unicode strings

The XRegExp dependency was breaking as new browsers add more es6 support as evidenced in #6102. Upgrading to version 3.1.0 fixed the Chrome "experimental JS" issue but was still broken in Safari Technology Preview.

We only use one feature of `XRegExp` in a single place for a relatively non-critical feature: calculating the word count. As such I figured it may be better to drop the 63KB minified dependency and simply copy the result of the compiled regex directly until such time as XRegExp has native support in our supported browsers.
2016-03-30 19:45:20 +01:00
Kevin Ansfield 24b655789d Include babel polyfill when compiling client
no issue
- fixes issues when using `phantomjs` or other browsers that are not fully es6 compatible
2016-02-04 12:49:53 +00:00
Kevin Ansfield 4d62348a16 Remove unused `ember-resize` dependency
no issue
- removes `ember-resize` dep that crept back in under the radar in the Ember 2.2 update
- updates `ember-cli-build`'s test dependencies to match the format specified in http://ember-cli.com/managing-dependencies/#test-assets
2015-12-01 11:03:53 +00:00