Skip to content

Etherpad-Lite resize plugin for capturing Etherpad Lite content size change in the embedding site.

Notifications You must be signed in to change notification settings

citizenos/ep_resize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ep_resize

An Etherpad Lite plugin that sends a postMessage to embedding page when pad size changes.

What is it good for?

For example when you want to embed the Etherpad Lite in an iframe and want the iframe size to dynamically change so that all the contents would fit.

Install

Run in your EP installion directory:

npm install ep_resize

Usage example

Assuming you use JQuery you can receive the EP resize event as follows:

    $(window).on('message onmessage', function (e) {
        var msg = e.originalEvent.data;
        if (msg.name === 'ep_resize') {
            var width = msg.data.width;
            var height = msg.data.height;
            console.log('ep_resize', 'new width:', width, 'new height:', height);
        }
    });

When making single page webapps, don't forget to remove the message handler when the view is destroyed

    $(window).off('message onmessage');

Credits

About

Etherpad-Lite resize plugin for capturing Etherpad Lite content size change in the embedding site.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.8%
  • CSS 4.2%