comparison media/js/tiny_mce/plugins/contextmenu/editor_plugin_src.js @ 183:149c3567fec1

Updated to TinyMCE version 3.3.2. This is for #57.
author Brian Neal <bgneal@gmail.com>
date Sun, 28 Mar 2010 21:47:48 +0000
parents a5b4c5ce0658
children 237710206167
comparison
equal deleted inserted replaced
182:5c889b587416 183:149c3567fec1
1 /** 1 /**
2 * $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $ 2 * editor_plugin_src.js
3 * 3 *
4 * @author Moxiecode 4 * Copyright 2009, Moxiecode Systems AB
5 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. 5 * Released under LGPL License.
6 *
7 * License: http://tinymce.moxiecode.com/license
8 * Contributing: http://tinymce.moxiecode.com/contributing
6 */ 9 */
7 10
8 (function() { 11 (function() {
9 var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; 12 var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
10 13
14 /**
15 * This plugin a context menu to TinyMCE editor instances.
16 *
17 * @class tinymce.plugins.ContextMenu
18 */
11 tinymce.create('tinymce.plugins.ContextMenu', { 19 tinymce.create('tinymce.plugins.ContextMenu', {
20 /**
21 * Initializes the plugin, this will be executed after the plugin has been created.
22 * This call is done before the editor instance has finished it's initialization so use the onInit event
23 * of the editor instance to intercept that event.
24 *
25 * @method init
26 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
27 * @param {string} url Absolute URL to where the plugin is located.
28 */
12 init : function(ed) { 29 init : function(ed) {
13 var t = this; 30 var t = this;
14 31
15 t.editor = ed; 32 t.editor = ed;
33
34 /**
35 * This event gets fired when the context menu is shown.
36 *
37 * @event onContextMenu
38 * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
39 * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
40 */
16 t.onContextMenu = new tinymce.util.Dispatcher(this); 41 t.onContextMenu = new tinymce.util.Dispatcher(this);
17 42
18 ed.onContextMenu.add(function(ed, e) { 43 ed.onContextMenu.add(function(ed, e) {
19 if (!e.ctrlKey) { 44 if (!e.ctrlKey) {
20 t._getMenu(ed).showMenu(e.clientX, e.clientY); 45 t._getMenu(ed).showMenu(e.clientX, e.clientY);
33 58
34 ed.onMouseDown.add(hide); 59 ed.onMouseDown.add(hide);
35 ed.onKeyDown.add(hide); 60 ed.onKeyDown.add(hide);
36 }, 61 },
37 62
63 /**
64 * Returns information about the plugin as a name/value array.
65 * The current keys are longname, author, authorurl, infourl and version.
66 *
67 * @method getInfo
68 * @return {Object} Name/value array containing information about the plugin.
69 */
38 getInfo : function() { 70 getInfo : function() {
39 return { 71 return {
40 longname : 'Contextmenu', 72 longname : 'Contextmenu',
41 author : 'Moxiecode Systems AB', 73 author : 'Moxiecode Systems AB',
42 authorurl : 'http://tinymce.moxiecode.com', 74 authorurl : 'http://tinymce.moxiecode.com',