Advertisement
Guest User

editor_plugin.js

a guest
Apr 5th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.     tinymce.create('tinymce.plugins.wpfilebase', {
  3.         init: function(ed, url) {
  4.             ed.addButton('wpfbInsertTag', {
  5.                 title: 'WP-Filebase',
  6.                 image: url + '/images/btn.gif',
  7.                 onclick: (function() {
  8.                     var postId = '';
  9.                     try { postId = tinymce.DOM.get("post_ID").value; } catch(ex) {}
  10.                     ed.windowManager.open(                         
  11.                         {file: (ajaxurl.replace("admin-ajax.php","admin.php?wpfilebase-screen=editor-plugin" ).replace('editor-plugin?','editor-plugin&')+'&post_id='+postId+'&content='+encodeURIComponent(tinyMCE.activeEditor.selection.getContent())), title:'WP-Filebase', width: 810, height: 400, inline: 1},
  12.                         {plugin_url: url}
  13.                     );
  14.                 })
  15.             });
  16.         },
  17.        
  18.         createControl: function(n, cm) { return null; },
  19.        
  20.         getInfo: function() {
  21.             return {
  22.                 longname: 'WP-Filebase',
  23.                 author: 'Fabian Schlieper',
  24.                 authorurl: 'http://fabi.me/',
  25.                 infourl: 'http://fabi.me/wp-filebase/',
  26.                 version: '1.0'
  27.             };
  28.         }//
  29.     });
  30.     tinymce.PluginManager.add('wpfilebase', tinymce.plugins.wpfilebase);
  31. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement