1 /* Import plugin specific language pack */
2 tinyMCE.importPluginLanguagePack('advlink', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl');
4 function TinyMCE_advlink_getInfo() {
6 longname : 'Advanced link',
7 author : 'Moxiecode Systems',
8 authorurl : 'http://tinymce.moxiecode.com',
9 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html',
10 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
14 function TinyMCE_advlink_getControlHTML(control_name) {
15 switch (control_name) {
17 return '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvLink\');" 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>';
23 function TinyMCE_advlink_execCommand(editor_id, element, command, user_interface, value) {
26 var anySelection = false;
27 var inst = tinyMCE.getInstanceById(editor_id);
28 var focusElm = inst.getFocusElement();
30 if (tinyMCE.selectedElement)
31 anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
33 if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
34 var template = new Array();
36 template['file'] = '../../plugins/advlink/link.htm';
37 template['width'] = 480;
38 template['height'] = 400;
40 // Language specific width and height addons
41 template['width'] += tinyMCE.getLang('lang_advlink_delta_width', 0);
42 template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0);
44 tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
53 function TinyMCE_advlink_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
54 tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonDisabled', true);
60 tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonNormal', false);
63 if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "")
64 tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonSelected', false);
65 } while ((node = node.parentNode));