javascript - Froala Editor Custom Input Field -


i've been looking around have found no explains how create custom input field on toolbar of froala editor. similar how url button works:

froala url input

it has input field , insert, how can add button similar functionality

you use custom popup example starting point , extend there changing initpopup method this:

// popup buttons. var popup_buttons = '';  // create list of buttons. if (editor.opts.popupbuttons.length > 1) {   popup_buttons += '<div class="fr-buttons">';   popup_buttons += editor.button.buildlist(editor.opts.popupbuttons);   popup_buttons += '</div>'; }  // custom layer. var custom_layer = '<div class="fr-my-layer fr-layer fr-active" id="fr-my-layer-' + editor.id + '"><div class="fr-input-line"><input id="fr-my-layer-text-' + editor.id + '" type="text" placeholder="' + editor.language.translate('alternate text') + '" tabindex="1"></div><div class="fr-action-buttons"><button type="button" class="fr-command fr-submit" data-cmd="mybutton" tabindex="2" role="button">' + editor.language.translate('insert') + '</button></div></div>';  // load popup template. var template = {   buttons: popup_buttons,   custom_layer: custom_layer };  // create popup. var $popup = editor.popups.create('customplugin.popup', template);  return $popup; 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -