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

Adding placeholder text to the editor? #401

Open
lfzawacki opened this issue Oct 24, 2016 · 4 comments
Open

Adding placeholder text to the editor? #401

lfzawacki opened this issue Oct 24, 2016 · 4 comments

Comments

@lfzawacki
Copy link

Going by the documentation and a quick search through the code it doesn't seem to be possible to add a placeholder text to the editor. Is the the feature really not present? How hard would it be to add it?

By the way, the official http://epiceditor.com seems to be down.

Thanks

@massar
Copy link
Collaborator

massar commented Oct 24, 2016

If by 'placeholder' you mean a 'default text', the trick I use is to have:

<textarea id="epiceditor">
# Placeholder

A placeholder
</textarea>

Then when your javascript loads, you find the 'epiceditor' node in the DOM and replace it with the EpicEditor, using the content of the textarea as the starting point ('textarea' argument in the options)

That way you get a nice fallback to HTML for those who properly disable Javascript till they see why they should enable it and that it is for a real reason not just to load ads and other malware.

Of course, you could also use your epiceditor loader script to async load some content and set that as the body.

By the way, the official http://epiceditor.com seems to be down.

Apparently the A address of epiceditor.com points to a old cluster of Fastly; hence, @OscarGodson will have to update DNS for that to be resolved. (bad thing about CDNs and not using their DNS: can't "CNAME" the root to their cluster).

@lfzawacki
Copy link
Author

Ok, thanks. I was actually thinking of something more like the placeholder attribute in the textarea tag which displays text with different styling and is not 'actually' there (it will disappear when the user focuses and/or starts typing text).

Anyway, I might make it work loading the text there, but the issue is about the input tag placeholder behavior.

@massar
Copy link
Collaborator

massar commented Oct 25, 2016

Placeholders do not make total sense for an editor like EpicEditor IMHO.

But If you want the behaviour of a placeholder: when the editor is activated, remove the initial text and let people type.

@lfzawacki
Copy link
Author

Yeah, I'll get it to work this way. You can probably close this issue now. Thanks again.

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

2 participants