PluginProbe
WP Ultimate Post Grid / 4.0.1
WP Ultimate Post Grid v4.0.1
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / assets / js / other / tinymce-toolbar-icon.js

tinymce-toolbar-icon.js in WP Ultimate Post Grid 4.0.1, at assets/js/other/tinymce-toolbar-icon.js

58 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function() {
2 tinymce.create('tinymce.plugins.wp_ultimate_post_grid', {
3 /**
4 * Initializes the plugin, this will be executed after the plugin has been created.
5 * This call is done before the editor instance has finished it's initialization so use the onInit event
6 * of the editor instance to intercept that event.
7 *
8 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
9 * @param {string} url Absolute URL to where the plugin is located.
10 */
11 init : function(ed, url) {
12 ed.addButton('wp_ultimate_post_grid', {
13 title : 'WP Ultimate Post Grid',
14 cmd : 'wp_ultimate_post_grid',
15 image : url.slice(0, -9) + '/icons/wp-ultimate-post-grid.svg'
16 });
17
18 ed.addCommand('wp_ultimate_post_grid', function() {
19 WPUPG_Modal.open( 'menu', {
20 insertCallback: ( shortcode ) => WPUPG_Modal.addTextToEditor( shortcode, ed.id ),
21 } );
22 });
23 },
24
25 /**
26 * Creates control instances based in the incomming name. This method is normally not
27 * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
28 * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
29 * method can be used to create those.
30 *
31 * @param {String} n Name of the control to create.
32 * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
33 * @return {tinymce.ui.Control} New control instance or null if no control was created.
34 */
35 createControl : function(n, cm) {
36 return null;
37 },
38
39 /**
40 * Returns information about the plugin as a name/value array.
41 * The current keys are longname, author, authorurl, infourl and version.
42 *
43 * @return {Object} Name/value array containing information about the plugin.
44 */
45 getInfo : function() {
46 return {
47 longname : 'WP Ultimate Post Grid',
48 author : 'Bootstrapped Ventures',
49 authorurl : 'https://bootstrapped.ventures',
50 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
51 version : "0.1"
52 };
53 }
54 });
55
56 // Register plugin
57 tinymce.PluginManager.add( 'wp_ultimate_post_grid', tinymce.plugins.wp_ultimate_post_grid );
58 })();