jemcode / administrate-field-ckeditor

A plugin for adding CKEditor support to Administrate
https://rubygems.org/gems/administrate-field-ckeditor
MIT License
20 stars 25 forks source link

Nothing shows up... #3

Closed ACPK closed 7 years ago

rikkipitt commented 7 years ago

@ACPK looks like this is to do with javascript inclusion ordering in the new Administrate.

The compiled JS is appended to the end of the HTML document, while the CKEditor gem adds inline JS which loads before the main files are. Looks like everything is okay apart from this... I'll look into it over the next few days.

adrianvalenz commented 7 years ago

Sweet. Looking forward to it.

ACPK commented 7 years ago

@rikkipitt - Thanks! Can't wait!

rikkipitt commented 7 years ago

@ACPK @adrianvalenz I had a brief look at the issue, and I'm not sure what to do really. Essentially, Administrate loads their JS in the footer before the closing </html> tag. The ckeditor gem inlines some JS which picks up on config parameters that @pedantic-git kindly incorporated.

https://github.com/thoughtbot/administrate/blob/780aa1ea7f8093ba3a99314f16a4db77689107f6/app/views/layouts/administrate/application.html.erb#L42

The field JS is loaded before the ckeditor plugin inclusion and so doesn't show up. Perhaps we ask Administrate to accept a pull request to load JS in the head? Not sure if they'll do that though...

pedantic-git commented 7 years ago

Now it's back in active maintenance I think they're pretty receptive to PRs like that which have an obvious use case.

adrianvalenz commented 7 years ago

Can we fork our own version of their Administrate, change the code to load JavaScript in the head, and install the gem with a github ref to ours? At least until they make the change?

rikkipitt commented 7 years ago

Of course, who wants to submit the pull request? I can if you'd like me to?

rikkipitt commented 7 years ago

Not a great start! I forked their master repo, ran ./bin/setup and then rake to start the test suite. 50+ tests are failing... anyone else getting the same?

adrianvalenz commented 7 years ago

Maybe git clone the tag version 3.0.0?

rikkipitt commented 7 years ago

@adrianvalenz tried that, it's actually related to this - https://github.com/thoughtbot/administrate/pull/726

That was added 1 hour ago... what are the chances?! I was running an old version of PhantomJs.

adrianvalenz commented 7 years ago

Oh dang. :/

Sorry I fell asleep...it's 11am right now pacific time. Where are you guys at?

rikkipitt commented 7 years ago

Morning @adrianvalenz, I'll submit a pull request this evening and let you guys know when it's ready. It'll be on my fork of Administrate found here - https://github.com/jemcode/administrate

I'll let you know when you can use my git ref and get things working.

Rikki

rikkipitt commented 7 years ago

@ACPK @adrianvalenz @pedantic-git This is all fixed now in release v0.0.4.

https://github.com/jemcode/administrate-field-ckeditor/releases/tag/v0.0.4

Hope this helps!