Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ( function() {
- tinymce.PluginManager.add( 'dqshortcodes', function( editor, url ) {
- console.log(url);
- // Add a button that opens a window
- editor.addButton( 'showrecent', {
- text: 'Recent posts',
- icon: false,
- onclick: function() {
- // Open window
- editor.windowManager.open({
- title: 'Example plugin',
- body: [{
- type: 'textbox',
- name: 'numberofposts',
- label: 'Number of posts'
- }
- ],
- onsubmit: function( e ) {
- // Insert content when the window form is submitted
- console.log(e.data.numberofposts);
- var string = "[recent-posts";
- if(e.data.numberofposts != ""){
- string += " numbers="+e.data.numberofposts;
- }
- string += "]";
- editor.insertContent( string );
- }
- });
- }
- });
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement