pressbooks aldine theme the theme used for the front page or default book
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

( function () {
tinymce.create( 'tinymce.plugins.aldine_page_section', {
init: function ( editor, url ) {
editor.addButton( 'aldine_page_section', {
title: aldine.page_section.title,
icon: 'icon dashicons-layout',
onclick: function () {
editor.windowManager.open( {
title: aldine.page_section.title,
body: [
{
type: 'textbox',
name: 'title',
label: aldine.page_section.title_label,
value: aldine.page_section.title,
},
{
type: 'listbox',
name: 'variant',
label: 'Variant',
values: [
{ text: aldine.page_section.standard, value: '' },
{ text: aldine.page_section.accent, value: 'accent' },
{ text: aldine.page_section.bordered, value: 'bordered' },
{ text: aldine.page_section.borderless, value: 'borderless' },
],
value: '', // Sets the default
},
],
onsubmit: function ( e ) {
editor.insertContent( '[aldine_page_section title="' + e.data.title + '" variant="' + e.data.variant + '"]<p>Insert your page section content here.</p>[/aldine_page_section]' );
},
} );
},
} );
},
createControl: function ( n, cm ) {
return null;
},
} );
tinymce.PluginManager.add( 'aldine_page_section', tinymce.plugins.aldine_page_section );
} )();