Browse Source
* Add buttons for page sections and calls to action. * Fix coding standards. * Fix localization.pull/113/head 1.1.0
Ned Zimmerman
7 years ago
committed by
GitHub
15 changed files with 195 additions and 85 deletions
@ -0,0 +1,36 @@
|
||||
( function () { |
||||
tinymce.create( 'tinymce.plugins.aldine_call_to_action', { |
||||
init: function ( editor, url ) { |
||||
editor.addButton( 'aldine_call_to_action', { |
||||
title: aldine.call_to_action.title, |
||||
icon: 'icon dashicons-flag', |
||||
onclick: function () { |
||||
editor.windowManager.open( { |
||||
title: aldine.call_to_action.title, |
||||
body: [ |
||||
{ |
||||
type: 'textbox', |
||||
name: 'text', |
||||
label: aldine.call_to_action.text, |
||||
value: aldine.call_to_action.title, |
||||
}, |
||||
{ |
||||
type: 'textbox', |
||||
name: 'url', |
||||
label: aldine.call_to_action.url, |
||||
value: '#', |
||||
}, |
||||
], |
||||
onsubmit: function ( e ) { |
||||
editor.insertContent( '[aldine_call_to_action text="' + e.data.text + '" url="' + e.data.url + '"]' ); |
||||
}, |
||||
} ); |
||||
}, |
||||
} ); |
||||
}, |
||||
createControl: function ( n, cm ) { |
||||
return null; |
||||
}, |
||||
} ); |
||||
tinymce.PluginManager.add( 'aldine_call_to_action', tinymce.plugins.aldine_call_to_action ); |
||||
} )(); |
@ -0,0 +1,42 @@
|
||||
( 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 ); |
||||
} )(); |
@ -0,0 +1 @@
|
||||
!function(t){var n={};function e(l){if(n[l])return n[l].exports;var o=n[l]={i:l,l:!1,exports:{}};return t[l].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=n,e.d=function(t,n,l){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:l})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}({1:function(t,n,e){t.exports=e("eL/z")},"eL/z":function(t,n){tinymce.create("tinymce.plugins.aldine_call_to_action",{init:function(t,n){t.addButton("aldine_call_to_action",{title:aldine.call_to_action.title,icon:"icon dashicons-flag",onclick:function(){t.windowManager.open({title:aldine.call_to_action.title,body:[{type:"textbox",name:"text",label:aldine.call_to_action.text,value:aldine.call_to_action.title},{type:"textbox",name:"url",label:aldine.call_to_action.url,value:"#"}],onsubmit:function(n){t.insertContent('[aldine_call_to_action text="'+n.data.text+'" url="'+n.data.url+'"]')}})}})},createControl:function(t,n){return null}}),tinymce.PluginManager.add("aldine_call_to_action",tinymce.plugins.aldine_call_to_action)}}); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}({4:function(e,t,n){e.exports=n("BNyP")},BNyP:function(e,t){tinymce.create("tinymce.plugins.aldine_page_section",{init:function(e,t){e.addButton("aldine_page_section",{title:aldine.page_section.title,icon:"icon dashicons-layout",onclick:function(){e.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:""}],onsubmit:function(t){e.insertContent('[aldine_page_section title="'+t.data.title+'" variant="'+t.data.variant+'"]<p>Insert your page section content here.</p>[/aldine_page_section]')}})}})},createControl:function(e,t){return null}}),tinymce.PluginManager.add("aldine_page_section",tinymce.plugins.aldine_page_section)}}); |
@ -0,0 +1 @@
|
||||
!function(t){var e={};function n(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}({3:function(t,e,n){t.exports=n("GR5A")},GR5A:function(t,e){tinymce.create("tinymce.plugins.aldine_page_section",{init:function(t,e){t.addButton("aldine_page_section",{title:"Page Section",icon:"layout",onclick:function(){t.windowManager.open({title:"Page Section",body:[{type:"textbox",name:"title",label:"Title",value:"Page Section"},{type:"listbox",name:"variant",label:"Variant",values:[{text:"Standard",value:""},{text:"Accent",value:"accent"},{text:"Bordered",value:"bordered"},{text:"Borderless",value:"borderless"}],value:""}],onsubmit:function(e){t.insertContent('[aldine_page_section title="'+e.data.title+'" variant="'+e.data.variant+'"][/aldine_page_section]')}})}})},createControl:function(t,e){return null}}),tinymce.create("tinymce.plugins.aldine_call_to_action",{init:function(t,e){t.addButton("aldine_call_to_action",{title:"Call to Action",icon:"link",onclick:function(){t.windowManager.open({title:"Call to Action",body:[{type:"textbox",name:"text",label:"Text",value:"Call to Action"},{type:"textbox",name:"url",label:"URL",value:"#"}],onsubmit:function(e){t.insertContent('[aldine_call_to_action text="'+e.data.text+'" url="'+e.data.url+'"]')}})}})},createControl:function(t,e){return null}}),tinymce.PluginManager.add("aldine_call_to_action",tinymce.plugins.aldine_call_to_action)}}); |
Loading…
Reference in new issue