Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a WYSIWYG editor? #71

Open
Jp3rd opened this issue Jun 14, 2017 · 26 comments
Open

is there a WYSIWYG editor? #71

Jp3rd opened this issue Jun 14, 2017 · 26 comments

Comments

@Jp3rd
Copy link

Jp3rd commented Jun 14, 2017

or is there a workaround?

@CosmoMyzrailGorynych
Copy link
Contributor

What do you mean? Text editor, markddown, theme editor, etc?

@Gottwik
Copy link
Owner

Gottwik commented Jul 7, 2017

There is no wysiwyg in enduro yet. What I do when I need a formatted text is have a textarea with a markdown abstractor(abstractor converts the markdown to html).

If you believe there is a use case for wysiwyg, comment below or submit a pull request.

@mdxprograms
Copy link

mdxprograms commented Jul 15, 2017

is it possible to "hook" into the admin with a wysiwyg plugin like pell? just set a type for something like below? Then use something like showdown for markdown parsing on the frontend

{
  $content_type: 'editor',
  content: '## my heading goes here'
}

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Jul 15, 2017

/* Pell is not a markdown editor, isn't it? */

@mdxprograms It is definitely posssible to hook up a UI script on a front side and make an editor. We only need a special input type to define such fields.

I will try to make such with SimpleMDE tonight, 'cause it is really a simple but needed task.

@mdxprograms
Copy link

That would be awesome. I'm always willing to contribute as well 👍🏼

Ya I realized Pell wasn't the best example but it would be cool if there was a markdown editor none the less.

Really like this project. Please let me know if you guys need anything.

Sent from my Google Pixel using FastHub

@CosmoMyzrailGorynych
Copy link
Contributor

Nah, I can't render enduro_admin UI because of strange error and definitely won't be able to tie SimpleMDE to it in nearest future :|

@mdxprograms
Copy link

What's the error? I can help take a look

Sent from my Google Pixel using FastHub

@Gottwik
Copy link
Owner

Gottwik commented Jul 16, 2017

@mdxprograms: super interesting stuff. It's simple because pell outputs html so you can just store that without any markdown conversion going on.

jul-16-2017 03-02-59

made a sample for you: https://github.com/Gottwik/enduro_samples/tree/master/wysiwyg

Let me know if it is what you were looking for. I will work on documenting these features better.

@mdxprograms
Copy link

checking it out now

@CosmoMyzrailGorynych
Copy link
Contributor

@mdxprograms it is here: Gottwik/enduro_admin#12
It seems that edited copy of enduro_admin is not linked to enduro, though I did everything said in instructions. And there is also a strange error while rendering index.hbs.

@mdxprograms
Copy link

mdxprograms commented Jul 16, 2017

hmm @Gottwik @CosmoMyzrailGorynych I'm getting the following and the textbox is only showing the raw markup. @CosmoMyzrailGorynych is this related to Gottwik/enduro_admin#12?

screen shot 2017-07-16 at 12 42 36 am
screen shot 2017-07-16 at 12 44 22 am

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Jul 16, 2017

@mdxprograms idk but am trying to make similar trick with SimpleMDE. I get exactly the same error because admin extensions can't see enduro_admin_app.compileProvider.

*UPD* Seems that removing .compileProvider from extension file removes this error. But I haven't tried it with Pell.

@mdxprograms
Copy link

hmm is it possible to use the CDN on a global scale just to see if that would fix it?

@Gottwik
Copy link
Owner

Gottwik commented Jul 16, 2017

ehm, my bad, you have to update enduro(npm i enduro -g) :-/ I added the compileProvider for this thing to work.

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Jul 16, 2017

Just done this but it didn't help
*upd* trying again, maybe I was just too fast :D

@Gottwik
Copy link
Owner

Gottwik commented Jul 16, 2017

do you still see the compileProvider error? Or is it the invalid regular expression thing?

@CosmoMyzrailGorynych
Copy link
Contributor

It is still a .compileProvider error. My enduro version is 1.4.30; maybe npm needs some time to refresh its cache, idk?

@Gottwik
Copy link
Owner

Gottwik commented Jul 16, 2017

Hey, the problem could be that you have cloned the enduro_admin and used npm link.

Maybe just git pull your enduro_admin and this will solve itself.

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Jul 16, 2017

Still doesn't work.
My repo is here:

image

I did npm link in enduro_admin folder and npm link enduro_admin in C:\Users\Космо\AppData\Roaming\npm\node_modules\enduro>.

@Gottwik
Copy link
Owner

Gottwik commented Jul 16, 2017

Either you figure out the npm linking or you just pull enduro and run npm i. That will fetch the newest enduro_admin

I think you need to do npm link in enduro folder. This sound the npm linking got screwed up(might be because of the poor instructions on enduro_admin).

How does it look when you go to <folder where you have enduro cloned> /node_modules/enduro_admin/package.json. You should be seeing version 1.0.64.

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Jul 16, 2017

Me:
help

Enduro doesn't install bower dependencies on Windows. It launches node_modules/bower/bin/bower install instead of ./node_modules/bower/bin/bower install (not sure about this though) and therefore fails. Now I have a non-working global copy of enduro.

*UPD* It seems that I unlinked enduro_admin and I managed to launch enduro on my project.

*UPD* enduro_admin in enduro doesn't update to 1.0.64 :/ It instead incremented from 1.0.61 to 1.0.62

*UPD* That's because [email protected] enforces [email protected] in its package.json

*UPD* I officially state that we've found the pure evil while making enduro and enduro_admin recursive.

*UPD* Yaaaay, now I have an empty custom textarea 🎊

*UPD* YAAAAY
image

@CosmoMyzrailGorynych
Copy link
Contributor

CosmoMyzrailGorynych commented Jul 16, 2017

@Gottwik how can we listen to culture switching to update editor's content?

@Gottwik
Copy link
Owner

Gottwik commented Jul 16, 2017

¯_(ツ)_/¯

what does bower has to do with enduro? Themes?

I guess the linking is messed up. Either reinstall everything(I use nvm, which makes this easier I believe) or try to figure out the linking with https://docs.npmjs.com/cli/ls#link

Hey, let me know if I can help. I am happy to follow your steps to see if I get different results.

@CosmoMyzrailGorynych
Copy link
Contributor

@Gottwik I have already solved linking problems and even created a SimpleMDE field. Looks like you were seeing an old thread from email or so O.o

@Gottwik
Copy link
Owner

Gottwik commented Jul 18, 2017

@CosmoMyzrailGorynych You can add this to make it work with cultures. I will add it to the sample.

scope.$watch('current_culture', function () {
    current_content.content.innerHTML = scope.context[scope.terminatedkey] || ''
})

@Jp3rd Were we able to answer your question?

@mdxprograms Does this work for you? Did you expect more packaged solution or is this fine?

@CosmoMyzrailGorynych
Copy link
Contributor

Wheee, it works ^—^
I will add a sample project soon; here's a quick setup:

  1. run bower install simplemde --save in your project directory;
  2. create two files:
    \assets\admin_extensions\marked.js
    \pages\custom_types\marked.hbs

@Gottwik I can write documentation/tutorial for endurojs.com if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants