Issue #1248Opened June 29, 2018by ronaldaug1 reactions

Appending a button inside the default (code view) modal.

Question

This is not actually an issue. I would like to add a button inside the original code view modal, it's like zip download button that @artf added inside this plugin.

Instead of modifying gjs export plugin, Is there any API option that I can achieve it in a few lines.

Probably, something like this..

var myBtn = document.createElement('BUTTON');
myBtn.innerHtml = "copy";
var modal = editor.Modal;
modal.append(myBtn);

It could be done by cloning a new code mirror as below. But there will be two code editors inside GJS editor and I think it's a bit more work for just a single button.

var codeViewer = editor.CodeManager.getViewer('CodeMirror').clone();

Answers (2)

ronaldaugJune 30, 20181 reactions

I got it by listening this command run:export-template.

editor.on('run:export-template', () => {
        editor.Modal.getContentEl().appendChild(myBtn);
})
lock[bot]September 17, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.