Modal Window

modal-window

Repo: GitHub - AlexRabolin/modal-window: A modal window style plugin for Discourse.

A modal window style plugin for Discourse.

Hello, this plugin will open a modal window from a forum post.

But, You don’t need this plugin to open a modal window outside the forum, in this case, just copy the HTML and CSS code in your forum.

Demo

Modal window with contents :

Installation

Everything is explained in the read-me here: GitHub - AlexRabolin/modal-window: A modal window style plugin for Discourse.

Edit your web template (<a href"Install plugins on a self-hosted site">install-a-plugin) and add this repositories url : GitHub - AlexRabolin/modal-window: A modal window style plugin for Discourse.

Then rebuild your web container so that the plugin installs.

7 Likes

The plugin is broken since the last update of discourse.
can anyone help me fix it ?

This code no longer works now for authorizing (whitelisting) the class “label” ? :

(function() {
Discourse.Markdown.whiteListTag('label', 'for', '*');
})();

Thank you in advance.
Alex.

You need to create a file named named modal-window.js.es6 at assets/javascripts/lib/discourse-markdown/

Then inside it, you need:

import { registerOption } from 'pretty-text/pretty-text';

registerOption((siteSettings, opts) => {
  opts.features["modal-window"] = true;
});

export function setup(helper) {
  helper.whiteList(['label[for]']);
}
6 Likes

A big thank you @cpradio , the plugin works again thanks to you :slight_smile:

4 Likes

Hello, the plugin is broken recently, have you got a idea please ?

The tag iframe src= is not broken, is ready :slight_smile: .
But the tag label for= is broken ( and i want to use span class * for glyphicon on the forum post but it’s not ready to :frowning: )

###This is the code of the plugin :

.js

(function() {
      Discourse.Markdown.whiteListTag('label', 'for', '*');
      Discourse.Markdown.whiteListTag('iframe', 'src', 'https://www.meteoblue.com/fr/meteo/widget/daily/*');
      Discourse.Markdown.whiteListTag('iframe', 'src', 'http://www.windguru.cz/fr/*');
      Discourse.Markdown.whiteListTag('iframe', 'src', 'https://beta.windguru.cz/*'); 
      Discourse.Markdown.whiteListTag('iframe', 'src', 'https://embed.windytv.com/*'); 
    })();

and

.js.es6

import { registerOption } from 'pretty-text/pretty-text';

    registerOption((siteSettings, opts) => {
      opts.features["plugin-kitedor"] = true;
    });

    export function setup(helper) {
      helper.whiteList(['label[for]']);
      helper.whiteList(['iframe[src]']);
    }

Hi all, I just complete a bit our plugin pb.

What was working in first version is use of :
helper.whiteList([‘label[for]’]);
helper.whiteList([‘iframe[src]’]);

We added following instruction in order to use glyficons
helper.whiteList([‘span[class]’]);

Adding it has broke iframes whitelisting, but work with glyficons, removing it just make it work again (iframes) I think so there is an incompatibility between span whitelist and iframe execution?

About label whitelist, was working, but not dependent of other tags whitelist, it doesn’t work anymore with last discourse update.

Thank you for you help, we are trying to add some capabilities on forum, and not sure about support on custom enhancements.