Closed drayanaindra closed 10 years ago
Without any code I cant help much. Could you post your EpicEditor code and maybe the HTML relevant to RpicEditor?
this is my code, i following your tutorial
HTML `
JavaScript
var opts = { container: 'epiceditor', textarea: 'id_content', basePath: 'epiceditor', clientSideStorage: true, localStorageName: 'epiceditor', useNativeFullscreen: true, parser: marked, file: { name: 'epiceditor', defaultContent: '', autoSave: 100 }, theme: { base: '/themes/base/epiceditor.css', preview: '/themes/preview/preview-dark.css', editor: '/themes/editor/epic-dark.css' }, button: { preview: true, fullscreen: true, bar: "auto" }, focusOnLoad: false, shortcut: { modifier: 18, fullscreen: 70, preview: 80 }, string: { togglePreview: 'Toggle Preview Mode', toggleEdit: 'Toggle Edit Mode', toggleFullscreen: 'Enter Fullscreen' }, autogrow: false } var editor = new EpicEditor(opts);
Have you called .load() yet?
i write this
var editor = new EpicEditor().load(opts);
it right ? when i try it, browser console result error at line 1110.
What's the error?
error result is
`TypeError: callback.call is not a function
callback.call(this);`
Couple things:
textarea: 'id_content'
if the textarea
is in the EpicEditor div. This is totally optional, but will automatically hide it for you too.load
doesn't take opts, it takes a callback (why you're getting that error. You passed a JS hash, not a function). You pass the options to the constructor (EpicEditor(opts)
) Examples from the API docs:
var editor = new EpicEditor(opts);
editor.load(function () {
console.log("Editor loaded.")
});
So, putting those two things together, this would work:
var editor = new EpicEditor(opts);
editor.load(function () {
console.log("Editor loaded.")
});
I also took your exact code and it works fine for me as long as I actually call .load()
and pass options to the constructor. If you're still having problems feel free to post again and I can reopen.
so, i can't using textarea?
because if i not using textarea, i can't get content.
I'm sorry, I dont understand. Yes, you can use a textarea with EpicEditor. If you're still having issues with my code above post what's going on :)
my form example
<form>
<textarea name="content", id="id_content"></textarea>
</form>
i try like tutorial on your github documentation
<form>
<div id="epiceditor">
<textarea name="content" id="id_content"></textarea>
</div>
</form>
and i following your opst Javascript like documentation in Github.
but, when i try search content
(as name of textarea) using firebug, the content
is hide.
sorry, if i many ask. :)
Like I mentioned above, EpicEditor will hide the textarea if you place it inside the EpicEditor div (and only if then) because normally people don't want to show a textarea and EpicEditor since EpicEditor is replacing the textarea and the textarea is synced (so as you type in EpicEditor you'll see text update in the textarea).
If you really want to show the textarea tho just pass in textarea: 'id_content'
or whatever and that should override the default behavior and keep it there. Additionally, you can just place the textarea outside of the EpicEditor div like:
<form>
<div id="epiceditor"></div>
<textarea name="content" id="id_content"></textarea>
</form>
can you help me, how to enable textarea ? in API textarea i add
id_content
because my id textarea is it, but this value not worked.