andresmrm / EtherPlant

A simple web page to code in Etherpad and visualize in PlantUML.
GNU Affero General Public License v3.0
2 stars 4 forks source link

This is a bad implementation and you should feel bad. #1

Open JohnMcLear opened 9 years ago

JohnMcLear commented 9 years ago

Etherpad provides a way to fire an event on a pad is edited. You should do that instead of a 5 second interval. I even wrote the required code needed for this specifically for UML, peep my repos.

andresmrm commented 9 years ago

And I do feel bad. =(

Thanks for the notice, John! I tried to find something like what you are saying, but couldn't.

Since we are talking about bad implementations, the current code asks for the EtherPad server for the pad content. What seems a bit ugly to me, since the content is in a iFrame in the same page. Is there a good way to get it from the iFrame, instead of doing a request for the server?

checking your repos...

Is this the code you said? Erm... how do I use it? https://github.com/JohnMcLear/ep_plantuml/tree/master/static/js

You seem to have solved my first question, about avoiding the request to the EtherPad server, but how? This line seems not work in my page:

$('iframe[name="ace_outer"]').contents().find('iframe').contents().find("#innerdocbody").text()

Even using something like this seems to return nothing to me.

$('#pad-iframe').contents()
JohnMcLear commented 9 years ago

Your preview window should be inside of Etherpad, Etherpad should not be in a nested iFrame.

andresmrm commented 9 years ago

But for this, don't I need to run my own EtherPad server, and modify it? That would have many other impacts...

On 21-11-14 10:24, John McLear wrote:

Your preview window should be inside of Etherpad, Etherpad should not be in a nested iFrame.


Reply to this email directly or view it on GitHub: https://github.com/andresmrm/EtherPlant/issues/1#issuecomment-64014425

JohnMcLear commented 9 years ago

Yes