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

Allow editor to run without iframe #179

Closed
leoasis opened this issue Jul 30, 2014 · 4 comments
Closed

Allow editor to run without iframe #179

leoasis opened this issue Jul 30, 2014 · 4 comments
Labels

Comments

@leoasis
Copy link
Contributor

leoasis commented Jul 30, 2014

Given that I needed to add modules into quill that had heavy use of javascript libraries and css, I decided to make the editor run outside an iframe. It turned out it is pretty easy to "hack" it doing this:

var Renderer = require('quilljs/lib/renderer');
Renderer.buildFrame = function(container) {
  var iframe, iframeDoc, root;
  iframe = document.createElement('div');
  container.appendChild(iframe);
  root = document.createElement('div');
  iframe.appendChild(root);
  return [root, iframe];
};

Basically we mock the iframe with a div.

This works incredibly well so far, the only thing remaining is to be able to modify a little bit the default styles, which is harder to do in this case since they are hidden inside the Renderer module (not exposed like the defaults with Normalizer or Format).

Anyway, I think it would be pretty easy to support a mode that runs without an iframe, for those who need and want to reuse javascript and styles from the top level window.

What do you think?

@leoasis leoasis changed the title Allow editor to run outside an iframe Allow editor to run outside without iframe Jul 30, 2014
@leoasis leoasis changed the title Allow editor to run outside without iframe Allow editor to run without iframe Jul 30, 2014
@jhchen
Copy link
Member

jhchen commented Jul 30, 2014

It's a good idea and I think many users would be interested in this option. We did have this option (with similar implementation) in the early days but a few browser inconsistencies showed up that was difficult to debug. Our test framework is a lot more complete and robust now so though it's probably a good idea to revisit this at some point and add official support.

@jhchen jhchen added the feature label Jul 30, 2014
@pklingem
Copy link

pklingem commented Aug 6, 2014

+1 started integrating quill into an app and had to go a different route due to the iframe. This is a great looking editor, keep up the good work!

@mitar
Copy link

mitar commented Nov 1, 2014

+1

@jhchen
Copy link
Member

jhchen commented Nov 7, 2014

Iframes have been removed in v0.19.0.

@jhchen jhchen closed this as completed Nov 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants