2 * editor_plugin_src.js
\r
4 * Copyright 2009, Moxiecode Systems AB
\r
5 * Released under LGPL License.
\r
7 * License: http://tinymce.moxiecode.com/license
\r
8 * Contributing: http://tinymce.moxiecode.com/contributing
\r
12 tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
\r
13 init : function(ed, url) {
\r
16 // Register commands
\r
17 ed.addCommand('mceAdvLink', function() {
\r
18 var se = ed.selection;
\r
20 // No selection and not in link
\r
21 if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
\r
24 ed.windowManager.open({
\r
25 file : url + '/link.htm',
\r
26 width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
\r
27 height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
\r
35 ed.addButton('link', {
\r
36 title : 'advlink.link_desc',
\r
40 ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
\r
42 ed.onNodeChange.add(function(ed, cm, n, co) {
\r
43 cm.setDisabled('link', co && n.nodeName != 'A');
\r
44 cm.setActive('link', n.nodeName == 'A' && !n.name);
\r
48 getInfo : function() {
\r
50 longname : 'Advanced link',
\r
51 author : 'Moxiecode Systems AB',
\r
52 authorurl : 'http://tinymce.moxiecode.com',
\r
53 infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
\r
54 version : tinymce.majorVersion + "." + tinymce.minorVersion
\r
60 tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
\r