I am looking into writing my own plugin for tinyMCE 3 (for use within umbraco 4). I have read the wiki but found it a little confusing.
As a first step i am looking to insert a function into the tinyMCE toolbar which does somethign simple like alert("button clicked"); Could anyone point me in right direction, im just looking for the steps i need to go through to A: add the button in to the toolbar B:link this into a javascript function which calls an alert.
I found that writing a tinyMCE plugin was a pain in the ass, but here's some pointers:
you need to define your plugin in the /config/tinyMCEConfig.config file. This is where you tell it what icon you want, what's the alias and what's the "command" (the command is the folder name of your plugin). These are in the <command /> blocks, just copy an existing one and change it for your needs
Put your plugin into /umbraco_client/tinymce3/plugins/<command name>
All your JavaScript logic needs to be in editor_plugin.js (well, at least the start point, it can call out to other JS files, but make sure you manually import them using some kind of loader so they are scoped in the tinyMCE iframe!)
You've got to change the Data Type in Umbraco for TinyMCE to allow your button to show on the toolbar
You can define custom parameters/ global variables to be passed into plugins using the <customConfig /> node in the tinyMCE config file
Hopefully that gives you a starting point. For how to setup the JavaScript plugin file I suggest you refer to the tinyMCE docs, they'll be more useful that I can put into a post :)
Custom Tiny MCE 3 plugin
Hi there.
I am looking into writing my own plugin for tinyMCE 3 (for use within umbraco 4). I have read the wiki but found it a little confusing.
As a first step i am looking to insert a function into the tinyMCE toolbar which does somethign simple like alert("button clicked"); Could anyone point me in right direction, im just looking for the steps i need to go through to A: add the button in to the toolbar B:link this into a javascript function which calls an alert.
Thanks
try something like this - just put it in the server side event code
private void JavaAlert(string Message){
Message = string.Format("<script>alert('{0}');</script>", Message);
System.Web.HttpContext.Current.Response.Write(Message);
}
I found that writing a tinyMCE plugin was a pain in the ass, but here's some pointers:
Hopefully that gives you a starting point. For how to setup the JavaScript plugin file I suggest you refer to the tinyMCE docs, they'll be more useful that I can put into a post :)
is working on a reply...