Closed ganlub closed 11 years ago
Can you share what browser and epiceditor version you're on? Its very strange its exporting hidden characters like that. Never seen that before.
Hey! I'm using Chromium 28.0.1500.52 on Ubuntu 13.04 and Firefox 22.0, and the epiceditor version was the 0.2.1.1. I attach you the php that contains the EE file on pastebin: http://pastebin.com/etATdVhx.
Thank you very much!
I wonder if it has to do with the hidden input? Couple questions:
console.log(editor.exportFile())
show those characters? So... it's the Php part, if i remove the $mysqli->real_escape_string($_POST['content']) and I leave it as $_POST['content'] it works!! Thank you for teach me how to debug more logically and found the mistakes by my self!!!!
No worries! Good luck :)
Hi! I have another trouble, now I'm trying to load a .md file on the editor, but I dunno what I'm doing wrong because I'm getting just '#Editing article' and nothing else, and on the console I can't see nothing.
$("#datepicker").change(function() {
if($("#datepicker").val()!='<?php echo Date("Y-m-d"); ?>'){
//editor.open('press/Readme.md');
editor.importFile('press/Readme.md',"#Editing article")
alert("Changed!");
}
});
Thank you!
Are you trying to load a file on your computer or server? If so, this is a client side JS framework. Client side JS doesn't have access to your file system. If you want that file to be accessible in EpicEditor's file storage you need to write to it like
editor.importFile($fileName, $fileContent)
Then, in your JS you'd have access to the content.
I'm trying to load the file form the server, it changed the way as what you said, but it doesn't work. The demoFunc() returns a markdown file content:
editor.importFile('Readme.md', '<? echo $managePress->demoFunc(); ?>');
Something it's going wrong and I don't know where.
What does console.log(editor.exportFile('Readme.md'))
log out?
After importfile, of course
the console log is printing me exactly $managePress->demoFunc()
, because I did editor.importFile('Readme.md', '<? echo '$managePress->demoFunc()'; ?>');
Do you not have PHP running? PHP should replace that right? I don't really do PHP, so I'm not sure why your PHP is working but EpicEditor is returning the content you gave it.
Remove the quotes around the echo
Hi, I'm trying to get the epiceditor content form JS, but I'm doing: var content = editor.exportFile(); $("#content").val(content);
or var content = (editor.getElement('editor').body.innerText);
but the content it's plagued of \r\n, something like this: ***\r\n#Title\r\n## Hola\r\n### text
How can I get the clean content to save it on a file through php. Thank you very much, and congrats for the nice project!