Index: linktocontent.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/linktocontent.info,v retrieving revision 1.4 diff -u -p -r1.4 linktocontent.info --- linktocontent.info 8 Oct 2007 15:18:09 -0000 1.4 +++ linktocontent.info 11 Jan 2009 16:42:03 -0000 @@ -1,5 +1,5 @@ ; $Id: linktocontent.info,v 1.4 2007/10/08 15:18:09 stborchert Exp $ -name = "Linktocontent" -description = "Provides a small 'API' for TinyMCE plugins to work with drupal data and functionality." -package = Content -dependencies = tinymce +name = Linktocontent +description = Provides a small API for TinyMCE plugins to work with Drupal data and functionality. +package = User interface +dependencies = wysiwyg Index: contrib/linktocontent_category/linktocontent_category.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/contrib/linktocontent_category/linktocontent_category.info,v retrieving revision 1.3 diff -u -p -r1.3 linktocontent_category.info --- contrib/linktocontent_category/linktocontent_category.info 8 Oct 2007 15:18:09 -0000 1.3 +++ contrib/linktocontent_category/linktocontent_category.info 11 Jan 2009 16:42:42 -0000 @@ -1,5 +1,5 @@ ; $Id: linktocontent_category.info,v 1.3 2007/10/08 15:18:09 stborchert Exp $ -name = "Linktocontent Category" -description = "Enhances linktocontent_node.module to use it with category.module." +name = Linktocontent Category +description = Enhances Linktocontent Node to use it with Category. dependencies = linktocontent_node category -package = Content +package = User interface Index: contrib/linktocontent_menu/linktocontent_menu.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/contrib/linktocontent_menu/linktocontent_menu.info,v retrieving revision 1.3 diff -u -p -r1.3 linktocontent_menu.info --- contrib/linktocontent_menu/linktocontent_menu.info 8 Oct 2007 15:18:09 -0000 1.3 +++ contrib/linktocontent_menu/linktocontent_menu.info 11 Jan 2009 16:42:54 -0000 @@ -1,5 +1,5 @@ ; $Id: linktocontent_menu.info,v 1.3 2007/10/08 15:18:09 stborchert Exp $ -name = "Linktocontent Menu" -description = "Add links to menu items via a TinyMCE plugin" +name = Linktocontent Menu +description = Add links to menu items via a TinyMCE plugin. dependencies = linktocontent -package = Content +package = User interface Index: contrib/linktocontent_node/linktocontent_node.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/contrib/linktocontent_node/linktocontent_node.info,v retrieving revision 1.4 diff -u -p -r1.4 linktocontent_node.info --- contrib/linktocontent_node/linktocontent_node.info 8 Oct 2007 15:18:09 -0000 1.4 +++ contrib/linktocontent_node/linktocontent_node.info 11 Jan 2009 16:43:04 -0000 @@ -1,5 +1,5 @@ ; $Id: linktocontent_node.info,v 1.4 2007/10/08 15:18:09 stborchert Exp $ -name = "Linktocontent Node" -description = "Add links to nodes via a TinyMCE plugin" +name = Linktocontent Node +description = Add links to nodes via a TinyMCE plugin. dependencies = linktocontent taxonomy -package = Content +package = User interface Index: tinymce_plugins/linktomenu/editor_plugin.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/editor_plugin.js,v retrieving revision 1.2 diff -u -p -r1.2 editor_plugin.js --- tinymce_plugins/linktomenu/editor_plugin.js 8 Oct 2007 15:20:16 -0000 1.2 +++ tinymce_plugins/linktomenu/editor_plugin.js 11 Jan 2009 16:29:38 -0000 @@ -1 +1,40 @@ -tinyMCE.importPluginLanguagePack('linktomenu','en,de,fr');var TinyMCE_LinkToMenuPlugin={getInfo:function(){return{longname:'Link to menu'}},getControlHTML:function(cn){switch(cn){case"linktomenu":return tinyMCE.getButtonHTML(cn,'lang_linktomenu_image_desc','{$pluginurl}/images/linktomenu.gif','mceLinktomenu')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceLinktomenu":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var selectedText=inst.selection.getSelectedText();var template=new Array();template['file']='../../plugins/linktomenu/popup.php';template['width']=400;template['height']=295;template['width']+=tinyMCE.getLang('lang_linktomenu_delta_width',0);template['height']+=tinyMCE.getLang('lang_linktomenu_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"no",resizable:"no"});return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null){return}do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_linktomenu','mceButtonSelected');return true}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_linktomenu','mceButtonNormal');return true}return true}};tinyMCE.addPlugin("linktomenu",TinyMCE_LinkToMenuPlugin); \ No newline at end of file +/** +* $Id: editor_plugin_src.js,v 1.2 2007/10/08 15:20:16 stborchert Exp $ +*/ + +(function() { + /* Import plugin specific language pack */ + tinymce.PluginManager.requireLangPack('linktomenu', 'en,de,fr'); + + tinymce.create('tinymce.plugins.LinkToMenuPlugin', { + getInfo : function() { + return { + longname : 'Link to menu' + } + }, + + init : function(ed, url) { + ed.addCommand('mceLinktomenu', function() { + ed.windowManager.open({ + file : url + '/popup.php', + width : 400 + parseInt(ed.getLang('linktomenu.delta_width', 0)), + height : 295 + parseInt(ed.getLang('linktomenu.delta_height', 0)) + }, { + plugin_url : url // Plugin absolute URL + }); + }); + + ed.addButton('linktomenu', { + title : 'linktomenu.image_desc', + cmd : 'mceLinktomenu', + image : url + '/images/linktomenu.gif' + }); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('linktomenu', co && n.nodeName != 'A'); + cm.setActive('linktomenu', n.nodeName == 'A' && !n.name); + }); + } + }); + tinymce.PluginManager.add("linktomenu", tinymce.plugins.LinkToMenuPlugin); +})(); Index: tinymce_plugins/linktomenu/editor_plugin_src.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/editor_plugin_src.js,v retrieving revision 1.2 diff -u -p -r1.2 editor_plugin_src.js --- tinymce_plugins/linktomenu/editor_plugin_src.js 8 Oct 2007 15:20:16 -0000 1.2 +++ tinymce_plugins/linktomenu/editor_plugin_src.js 11 Jan 2009 16:29:38 -0000 @@ -2,71 +2,39 @@ * $Id: editor_plugin_src.js,v 1.2 2007/10/08 15:20:16 stborchert Exp $ */ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('linktomenu', 'en,de,fr'); -var TinyMCE_LinkToMenuPlugin = { - getInfo : function() { - return { - longname : 'Link to menu' - } - }, - - getControlHTML : function(cn) { - switch (cn) { - case "linktomenu": - return tinyMCE.getButtonHTML(cn, - 'lang_linktomenu_image_desc', - '{$pluginurl}/images/linktomenu.gif', - 'mceLinktomenu'); - } - return ""; - }, - - execCommand : function(editor_id, element, command, user_interface, value) { - switch (command) { - case "mceLinktomenu": - var anySelection = false; - var inst = tinyMCE.getInstanceById(editor_id); - var focusElm = inst.getFocusElement(); - var selectedText = inst.selection.getSelectedText(); - - var template = new Array(); - - template['file'] = '../../plugins/linktomenu/popup.php'; - template['width'] = 400; - template['height'] = 295; - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_linktomenu_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_linktomenu_delta_height', 0); - - tinyMCE.openWindow(template, {editor_id: editor_id, inline: "no", resizable: "no"}); - - return true; - } // switch - return false; - }, - - handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - if (node == null) { - return; - } - - do { - if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") { - tinyMCE.switchClass(editor_id + '_linktomenu', 'mceButtonSelected'); - return true; +(function() { + /* Import plugin specific language pack */ + tinymce.PluginManager.requireLangPack('linktomenu', 'en,de,fr'); + + tinymce.create('tinymce.plugins.LinkToMenuPlugin', { + getInfo : function() { + return { + longname : 'Link to menu' } - } while ((node = node.parentNode)); + }, - if (any_selection) { - tinyMCE.switchClass(editor_id + '_linktomenu', 'mceButtonNormal'); - return true; + init : function(ed, url) { + ed.addCommand('mceLinktomenu', function() { + ed.windowManager.open({ + file : url + '/popup.php', + width : 400 + parseInt(ed.getLang('linktomenu.delta_width', 0)), + height : 295 + parseInt(ed.getLang('linktomenu.delta_height', 0)) + }, { + plugin_url : url // Plugin absolute URL + }); + }); + + ed.addButton('linktomenu', { + title : 'linktomenu.image_desc', + cmd : 'mceLinktomenu', + image : url + '/images/linktomenu.gif' + }); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('linktomenu', co && n.nodeName != 'A'); + cm.setActive('linktomenu', n.nodeName == 'A' && !n.name); + }); } - - return true; - } - -}; -// Adds the plugin class to the list of available TinyMCE plugins -tinyMCE.addPlugin("linktomenu", TinyMCE_LinkToMenuPlugin); \ No newline at end of file + }); + tinymce.PluginManager.add("linktomenu", tinymce.plugins.LinkToMenuPlugin); +})(); Index: tinymce_plugins/linktomenu/popup.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/popup.php,v retrieving revision 1.2 diff -u -p -r1.2 popup.php --- tinymce_plugins/linktomenu/popup.php 8 Oct 2007 15:20:16 -0000 1.2 +++ tinymce_plugins/linktomenu/popup.php 11 Jan 2009 16:29:38 -0000 @@ -12,7 +12,7 @@ header('Pragma: no-cache'); - {$lang_linktomenu_title} + {#linktomenu.title} @@ -43,19 +43,19 @@ header('Pragma: no-cache'); - +
- +
@@ -63,12 +63,12 @@ header('Pragma: no-cache');
- +
- + @@ -80,14 +80,14 @@ header('Pragma: no-cache');
- +
- +
-
loading{$lang_linktomenu_loading}
+
loading{#linktomenu.loading}
Index: tinymce_plugins/linktomenu/jscripts/functions.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/jscripts/functions.js,v retrieving revision 1.3 diff -u -p -r1.3 functions.js --- tinymce_plugins/linktomenu/jscripts/functions.js 8 Oct 2007 15:18:09 -0000 1.3 +++ tinymce_plugins/linktomenu/jscripts/functions.js 11 Jan 2009 16:29:38 -0000 @@ -67,36 +67,35 @@ function insertAction() { if (selectedNode == null) { return; } - var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); - var elm = inst.getFocusElement(); + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); - elm = tinyMCE.getParentElement(elm, "a"); + elm = inst.dom.getParent(elm, "A"); - tinyMCEPopup.execCommand("mceBeginUndoLevel"); + tinyMCEPopup.execCommand("mceBeginUndoLevel"); - // Create new anchor elements - var path = selectedNode.cells[0].firstChild.nodeValue; - if (elm == null) { - var insertText = selectedNode.cells[1].firstChild.nodeValue; - if (inst.selection.getSelectedText().length == 0) { + // Create new anchor elements + if (elm == null) { + var nid = selectedNode.cells[0].firstChild.nodeValue; + var insertText = selectedNode.cells[1].firstChild.nodeValue; + if (inst.selection.getNode().length == 0) { tinyMCEPopup.execCommand("mceInsertContent", false, - '' + insertText + ''); - } + '' + insertText + ''); + } else { - tinyMCEPopup.execCommand("mceInsertContent", false, - '' + inst.selection.getSelectedHTML() + ''); + tinyMCEPopup.execCommand("mceInsertContent", false, + '' + inst.selection.getContent() + ''); } // end (getSelectedText == 0) - } + } else { - elm.setAttribute("mce_href", path); - // Refresh in old MSIE - if (tinyMCE.isMSIE5) - elm.outerHTML = elm.outerHTML; - } + elm.setAttribute("mce_href", selectedNode.cells[0].firstChild.nodeValue); + // Refresh in old MSIE + if (tinyMCE.isMSIE5) + elm.outerHTML = elm.outerHTML; + } - tinyMCE._setEventsEnabled(inst.getBody(), false); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); } function loadScript(url) { @@ -180,7 +179,7 @@ function _createDropdown(obj){ function _fillDropdown(obj, results){ if (results.menus != false) { var select = _createDropdown(obj); - $(select).addOption(-1, tinyMCELang['lang_linktomenu_choose_category']); + $(select).addOption(-1, tinyMCEPopup.getLang('linktomenu.choose_category')); for (key in results.menus) { if (results.menus[key].hasChildren) { $(select).addOption(results.menus[key].mid, results.menus[key].title); Index: tinymce_plugins/linktomenu/langs/de.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/langs/de.js,v retrieving revision 1.3 diff -u -p -r1.3 de.js --- tinymce_plugins/linktomenu/langs/de.js 8 Oct 2007 15:18:09 -0000 1.3 +++ tinymce_plugins/linktomenu/langs/de.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: de.js,v 1.3 2007/10/08 15:18:09 stborchert Exp $ // German lang variables -tinyMCE.addToLang('linktomenu', { +tinyMCE.addI18n('de.linktomenu', { title : 'Verweis zu Menüpunkt', loading : 'Daten laden...', insert_title : 'Verweis zu Menüpunkt einfügen', Index: tinymce_plugins/linktomenu/langs/en.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/langs/en.js,v retrieving revision 1.3 diff -u -p -r1.3 en.js --- tinymce_plugins/linktomenu/langs/en.js 8 Oct 2007 15:18:09 -0000 1.3 +++ tinymce_plugins/linktomenu/langs/en.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: en.js,v 1.3 2007/10/08 15:18:09 stborchert Exp $ // English lang variables -tinyMCE.addToLang('linktomenu', +tinyMCE.addI18n('en.linktomenu', { title : 'link to menu item', loading : 'loading...', Index: tinymce_plugins/linktomenu/langs/fr.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/langs/fr.js,v retrieving revision 1.3.2.1 diff -u -p -r1.3.2.1 fr.js --- tinymce_plugins/linktomenu/langs/fr.js 29 Aug 2008 02:12:15 -0000 1.3.2.1 +++ tinymce_plugins/linktomenu/langs/fr.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: fr.js,v 1.3.2.1 2008/08/29 02:12:15 sun Exp $ // French lang variables -tinyMCE.addToLang('linktomenu', +tinyMCE.addI18n('fr.linktomenu', { title : 'lien vers noeud', loading : 'chargement...', Index: tinymce_plugins/linktomenu/langs/he.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/langs/he.js,v retrieving revision 1.3 diff -u -p -r1.3 he.js --- tinymce_plugins/linktomenu/langs/he.js 8 Oct 2007 15:18:09 -0000 1.3 +++ tinymce_plugins/linktomenu/langs/he.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: he.js,v 1.3 2007/10/08 15:18:09 stborchert Exp $ // Hebrew lang variables -tinyMCE.addToLang('linktomenu', +tinyMCE.addI18n('he.linktomenu', { title : '????? ??????', loading : '????...', Index: tinymce_plugins/linktomenu/langs/nl.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktomenu/langs/nl.js,v retrieving revision 1.2 diff -u -p -r1.2 nl.js --- tinymce_plugins/linktomenu/langs/nl.js 8 Oct 2007 15:20:16 -0000 1.2 +++ tinymce_plugins/linktomenu/langs/nl.js 11 Jan 2009 16:29:38 -0000 @@ -1,6 +1,6 @@ // Dutch lang variables -tinyMCE.addToLang('linktomenu', +tinyMCE.addI18n('nl.linktomenu', { title : 'Link naar menu item', loading : 'Laden...', Index: tinymce_plugins/linktonode/editor_plugin.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/editor_plugin.js,v retrieving revision 1.3 diff -u -p -r1.3 editor_plugin.js --- tinymce_plugins/linktonode/editor_plugin.js 8 Oct 2007 15:18:09 -0000 1.3 +++ tinymce_plugins/linktonode/editor_plugin.js 11 Jan 2009 16:29:38 -0000 @@ -1 +1,40 @@ -tinyMCE.importPluginLanguagePack('linktonode','en,de,fr');var TinyMCE_LinkToNodePlugin={getInfo:function(){return{longname:'Link to node'}},getControlHTML:function(cn){switch(cn){case"linktonode":return tinyMCE.getButtonHTML(cn,'lang_linktonode_image_desc','{$pluginurl}/images/linktonode.gif','mceLinktonode')}return""},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceLinktonode":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var selectedText=inst.selection.getSelectedText();var template=new Array();template['file']='../../plugins/linktonode/popup.php';template['width']=400;template['height']=295;template['width']+=tinyMCE.getLang('lang_linktonode_delta_width',0);template['height']+=tinyMCE.getLang('lang_linktonode_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"no",resizable:"no"});return true}return false},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null){return}do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_linktonode','mceButtonSelected');return true}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_linktonode','mceButtonNormal');return true}return true}};tinyMCE.addPlugin("linktonode",TinyMCE_LinkToNodePlugin); \ No newline at end of file +/** +* $Id: editor_plugin_src.js,v 1.2 2007/10/08 15:20:16 stborchert Exp $ +*/ + +(function() { + /* Import plugin specific language pack */ + tinymce.PluginManager.requireLangPack('linktonode', 'en,de,fr'); + + tinymce.create('tinymce.plugins.LinkToNodePlugin', { + getInfo : function() { + return { + longname : 'Link to node' + } + }, + + init : function(ed, url) { + ed.addCommand('mceLinktonode', function() { + ed.windowManager.open({ + file : url + '/popup.php', + width : 400 + parseInt(ed.getLang('linktonode.delta_width', 0)), + height : 295 + parseInt(ed.getLang('linktonode.delta_height', 0)) + }, { + plugin_url : url // Plugin absolute URL + }); + }); + + ed.addButton('linktonode', { + title : 'linktonode.image_desc', + cmd : 'mceLinktonode', + image : url + '/images/linktonode.gif' + }); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('linktonode', co && n.nodeName != 'A'); + cm.setActive('linktonode', n.nodeName == 'A' && !n.name); + }); + } + }); + tinymce.PluginManager.add("linktonode", tinymce.plugins.LinkToNodePlugin); +})(); Index: tinymce_plugins/linktonode/editor_plugin_src.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/editor_plugin_src.js,v retrieving revision 1.2 diff -u -p -r1.2 editor_plugin_src.js --- tinymce_plugins/linktonode/editor_plugin_src.js 8 Oct 2007 15:20:16 -0000 1.2 +++ tinymce_plugins/linktonode/editor_plugin_src.js 11 Jan 2009 16:29:38 -0000 @@ -2,71 +2,39 @@ * $Id: editor_plugin_src.js,v 1.2 2007/10/08 15:20:16 stborchert Exp $ */ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('linktonode', 'en,de,fr'); -var TinyMCE_LinkToNodePlugin = { - getInfo : function() { - return { - longname : 'Link to node' - } - }, - - getControlHTML : function(cn) { - switch (cn) { - case "linktonode": - return tinyMCE.getButtonHTML(cn, - 'lang_linktonode_image_desc', - '{$pluginurl}/images/linktonode.gif', - 'mceLinktonode'); - } - return ""; - }, - - execCommand : function(editor_id, element, command, user_interface, value) { - switch (command) { - case "mceLinktonode": - var anySelection = false; - var inst = tinyMCE.getInstanceById(editor_id); - var focusElm = inst.getFocusElement(); - var selectedText = inst.selection.getSelectedText(); - - var template = new Array(); - - template['file'] = '../../plugins/linktonode/popup.php'; - template['width'] = 400; - template['height'] = 295; - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_linktonode_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_linktonode_delta_height', 0); - - tinyMCE.openWindow(template, {editor_id: editor_id, inline: "no", resizable: "no"}); - - return true; - } // switch - return false; - }, - - handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - if (node == null) { - return; - } - - do { - if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") { - tinyMCE.switchClass(editor_id + '_linktonode', 'mceButtonSelected'); - return true; +(function() { + /* Import plugin specific language pack */ + tinymce.PluginManager.requireLangPack('linktonode', 'en,de,fr'); + + tinymce.create('tinymce.plugins.LinkToNodePlugin', { + getInfo : function() { + return { + longname : 'Link to node' } - } while ((node = node.parentNode)); + }, - if (any_selection) { - tinyMCE.switchClass(editor_id + '_linktonode', 'mceButtonNormal'); - return true; + init : function(ed, url) { + ed.addCommand('mceLinktonode', function() { + ed.windowManager.open({ + file : url + '/popup.php', + width : 400 + parseInt(ed.getLang('linktonode.delta_width', 0)), + height : 295 + parseInt(ed.getLang('linktonode.delta_height', 0)) + }, { + plugin_url : url // Plugin absolute URL + }); + }); + + ed.addButton('linktonode', { + title : 'linktonode.image_desc', + cmd : 'mceLinktonode', + image : url + '/images/linktonode.gif' + }); + + ed.onNodeChange.add(function(ed, cm, n, co) { + cm.setDisabled('linktonode', co && n.nodeName != 'A'); + cm.setActive('linktonode', n.nodeName == 'A' && !n.name); + }); } - - return true; - } - -}; -// Adds the plugin class to the list of available TinyMCE plugins -tinyMCE.addPlugin("linktonode", TinyMCE_LinkToNodePlugin); + }); + tinymce.PluginManager.add("linktonode", tinymce.plugins.LinkToNodePlugin); +})(); Index: tinymce_plugins/linktonode/popup.php =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/popup.php,v retrieving revision 1.7 diff -u -p -r1.7 popup.php --- tinymce_plugins/linktonode/popup.php 8 Oct 2007 15:18:09 -0000 1.7 +++ tinymce_plugins/linktonode/popup.php 11 Jan 2009 16:29:38 -0000 @@ -12,7 +12,7 @@ header('Pragma: no-cache'); - {$lang_linktonode_title} + {#linktonode.title} @@ -43,19 +43,19 @@ header('Pragma: no-cache'); - +
- +
@@ -63,14 +63,14 @@ header('Pragma: no-cache');
- +
{$lang_linktomenu_thead_title}{#linktomenu.thead_title}
- - - + + + @@ -82,14 +82,14 @@ header('Pragma: no-cache');
- +
- +
-
loading{$lang_linktonode_loading}
+
loading{#linktonode.loading}
Index: tinymce_plugins/linktonode/jscripts/functions.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/jscripts/functions.js,v retrieving revision 1.12 diff -u -p -r1.12 functions.js --- tinymce_plugins/linktonode/jscripts/functions.js 8 Oct 2007 15:18:10 -0000 1.12 +++ tinymce_plugins/linktonode/jscripts/functions.js 11 Jan 2009 16:29:38 -0000 @@ -73,10 +73,10 @@ function insertAction() { if (selectedNode == null) { return; } - var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id')); - var elm = inst.getFocusElement(); + var inst = tinyMCEPopup.editor; + var elm = inst.selection.getNode(); - elm = tinyMCE.getParentElement(elm, "a"); + elm = inst.dom.getParent(elm, "A"); tinyMCEPopup.execCommand("mceBeginUndoLevel"); @@ -84,13 +84,13 @@ function insertAction() { if (elm == null) { var nid = selectedNode.cells[0].firstChild.nodeValue; var insertText = selectedNode.cells[1].firstChild.nodeValue; - if (inst.selection.getSelectedText().length == 0) { + if (inst.selection.getNode().length == 0) { tinyMCEPopup.execCommand("mceInsertContent", false, '' + insertText + ''); } else { tinyMCEPopup.execCommand("mceInsertContent", false, - '' + inst.selection.getSelectedHTML() + ''); + '' + inst.selection.getContent() + ''); } // end (getSelectedText == 0) } else { @@ -100,7 +100,6 @@ function insertAction() { elm.outerHTML = elm.outerHTML; } - tinyMCE._setEventsEnabled(inst.getBody(), false); tinyMCEPopup.execCommand("mceEndUndoLevel"); tinyMCEPopup.close(); } @@ -186,7 +185,7 @@ function _createDropdown(obj){ function _fillDropdown(obj, results){ if (results.categories != false) { var select = _createDropdown(obj); - $(select).addOption(-1, tinyMCELang['lang_linktonode_choose_category']); + $(select).addOption(-1, tinyMCEPopup.getLang('linktonode.choose_category')); for (key in results.categories) $(select).addOption(results.categories[key].tid, results.categories[key].title); return true; Index: tinymce_plugins/linktonode/langs/de.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/langs/de.js,v retrieving revision 1.5 diff -u -p -r1.5 de.js --- tinymce_plugins/linktonode/langs/de.js 8 Oct 2007 15:18:10 -0000 1.5 +++ tinymce_plugins/linktonode/langs/de.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: de.js,v 1.5 2007/10/08 15:18:10 stborchert Exp $ // German lang variables -tinyMCE.addToLang('linktonode', { +tinyMCE.addI18n('de.linktonode', { title : 'Verweis zu Dokument', loading : 'Daten laden...', insert_title : 'Verweis zu Dokument einfügen', Index: tinymce_plugins/linktonode/langs/el.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/langs/el.js,v retrieving revision 1.3 diff -u -p -r1.3 el.js --- tinymce_plugins/linktonode/langs/el.js 8 Oct 2007 15:18:10 -0000 1.3 +++ tinymce_plugins/linktonode/langs/el.js 11 Jan 2009 16:29:38 -0000 @@ -2,7 +2,7 @@ // Greek lang variables // thanks to dcoun -tinyMCE.addToLang('linktonode', +tinyMCE.addI18n('el.linktonode', { title : 'Σύνδεση σε σελίδα', loading : 'Αναμονή...', Index: tinymce_plugins/linktonode/langs/en.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/langs/en.js,v retrieving revision 1.5 diff -u -p -r1.5 en.js --- tinymce_plugins/linktonode/langs/en.js 8 Oct 2007 15:18:10 -0000 1.5 +++ tinymce_plugins/linktonode/langs/en.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: en.js,v 1.5 2007/10/08 15:18:10 stborchert Exp $ // English lang variables -tinyMCE.addToLang('linktonode', +tinyMCE.addI18n('en.linktonode', { title : 'link to node', loading : 'loading...', Index: tinymce_plugins/linktonode/langs/he.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/langs/he.js,v retrieving revision 1.3 diff -u -p -r1.3 he.js --- tinymce_plugins/linktonode/langs/he.js 8 Oct 2007 15:18:10 -0000 1.3 +++ tinymce_plugins/linktonode/langs/he.js 11 Jan 2009 16:29:38 -0000 @@ -1,7 +1,7 @@ // $Id: he.js,v 1.3 2007/10/08 15:18:10 stborchert Exp $ // Hebrew lang variables -tinyMCE.addToLang('linktonode', +tinyMCE.addI18n('he.linktonode', { title : '????? ??? ????', loading : '????...', Index: tinymce_plugins/linktonode/langs/nl.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/linktocontent/tinymce_plugins/linktonode/langs/nl.js,v retrieving revision 1.2 diff -u -p -r1.2 nl.js --- tinymce_plugins/linktonode/langs/nl.js 8 Oct 2007 15:20:16 -0000 1.2 +++ tinymce_plugins/linktonode/langs/nl.js 11 Jan 2009 16:29:38 -0000 @@ -1,6 +1,6 @@ // Dutch lang variables -tinyMCE.addToLang('linktonode', +tinyMCE.addI18n('nl.linktonode', { title : 'Link naar node', loading : 'Laden...',
{$lang_linktonode_thead_title}{$lang_linktonode_thead_date}{$lang_linktonode_thead_author}{#linktonode.thead_title}{#linktonode.thead_date}{#linktonode.thead_author}