1 /* Import plugin specific language pack */
\r
2 tinyMCE.importPluginLanguagePack('advlink', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk');
\r
4 function TinyMCE_advlink_getInfo() {
\r
6 longname : 'Advanced link',
\r
7 author : 'Moxiecode Systems',
\r
8 authorurl : 'http://tinymce.moxiecode.com',
\r
9 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html',
\r
10 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
\r
14 function TinyMCE_advlink_getControlHTML(control_name) {
\r
15 switch (control_name) {
\r
17 var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvLink\');return false;';
\r
18 return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_advlink" src="{$themeurl}/images/link.gif" title="{$lang_link_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreClass(this);" /></a>';
\r
24 function TinyMCE_advlink_execCommand(editor_id, element, command, user_interface, value) {
\r
27 var anySelection = false;
\r
28 var inst = tinyMCE.getInstanceById(editor_id);
\r
29 var focusElm = inst.getFocusElement();
\r
31 if (tinyMCE.selectedElement)
\r
32 anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
\r
34 if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
\r
35 var template = new Array();
\r
37 template['file'] = '../../plugins/advlink/link.htm';
\r
38 template['width'] = 480;
\r
39 template['height'] = 400;
\r
41 // Language specific width and height addons
\r
42 template['width'] += tinyMCE.getLang('lang_advlink_delta_width', 0);
\r
43 template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0);
\r
45 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
\r
54 function TinyMCE_advlink_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
\r
55 tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonDisabled', true);
\r
61 tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonNormal', false);
\r
64 if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "")
\r
65 tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonSelected', false);
\r
66 } while ((node = node.parentNode));
\r