Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/oacsimage/editor_plugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/oacsimage/editor_plugin.js,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/oacsimage/editor_plugin.js 25 Jan 2008 21:44:07 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/plugins/oacsimage/editor_plugin.js 19 May 2009 17:16:13 -0000 1.1.2.1 @@ -1,146 +1,83 @@ - /** * $Id$ * * @author Moxiecode - * @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved. + * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved. */ -/* Import plugin specific language pack */ -// tinyMCE.importPluginLanguagePack('advimage'); +(function() { + // Load plugin specific language pack + tinymce.PluginManager.requireLangPack('oacsimage'); -var TinyMCE_OacsImagePlugin = { - getInfo : function() { - return { - longname : 'Oacs image', - author : 'SolutionGrove, Moxiecde Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_oacsimage.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; - }, + tinymce.create('tinymce.plugins.OacsImage', { + /** + * Initializes the plugin, this will be executed after the plugin has been created. + * This call is done before the editor instance has finished it's initialization so use the onInit event + * of the editor instance to intercept that event. + * + * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. + * @param {string} url Absolute URL to where the plugin is located. + */ + init : function(ed, url) { + // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); + ed.addCommand('mceOacsImage', function() { + var elm = tinyMCE.activeEditor.selection.getNode(); + if (elm != null && ed.dom.getAttrib(elm, 'class').indexOf('mceItem') != -1) + return true; - getControlHTML : function(cn) { - switch (cn) { - case "image": - return tinyMCE.getButtonHTML(cn, 'lang_image_desc', '{$themeurl}/images/image.gif', 'mceOacsImage'); - } + ed.windowManager.open({ + url:'/acs-templating/scripts/xinha/attach-image', + width: 380, + height: 450, + movable: true, + inline: true}); - return ""; - }, + return true; - execCommand : function(editor_id, element, command, user_interface, value) { - switch (command) { - case "mceOacsImage": - var template = new Array(); + }); - template['file'] = '/acs-templating/scripts/xinha/attach-image'; - template['width'] = 500; - template['height'] = 400; + // Register example button + ed.addButton('image', { + title : 'oacsimage.desc', + cmd : 'mceOacsImage' + }); + // Add a node change handler, selects the button in the UI when a image is selected + ed.onNodeChange.add(function(ed, cm, n) { + cm.setActive('image',n.nameName == "IMG"); + }); + }, + /** + * Creates control instances based in the incomming name. This method is normally not + * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons + * but you sometimes need to create more complex controls like listboxes, split buttons etc then this + * method can be used to create those. + * + * @param {String} n Name of the control to create. + * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. + * @return {tinymce.ui.Control} New control instance or null if no control was created. + */ + createControl : function(n, cm) { + return null; + }, - var inst = tinyMCE.getInstanceById(editor_id); - var elm = inst.getFocusElement(); - - if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1) - return true; - - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); - - return true; + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @return {Object} Name/value array containing information about the plugin. + */ + getInfo : function() { + return { + longname : 'Oacs image', + author : 'SolutionGrove, Moxiecde Systems AB', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_oacsimage.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; } + }); - return false; - }, - - cleanup : function(type, content) { - switch (type) { - case "insert_to_editor_dom": - var imgs = content.getElementsByTagName("img"), src, i; - for (i=0; i - {#advanced_dlg.about_title} + {#openacs_dlg.about_title}
-

{#advanced_dlg.about_title}

+

{#openacs_dlg.about_title}

Version: ()

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

@@ -33,7 +33,7 @@
-

{#advanced_dlg.about_loaded}

+

{#openacs_dlg.about_loaded}

Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/anchor.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/anchor.htm,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/anchor.htm 8 May 2009 17:34:11 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/anchor.htm 19 May 2009 17:16:13 -0000 1.2.2.1 @@ -1,18 +1,18 @@ - {#advanced_dlg.anchor_title} + {#openacs_dlg.anchor_title}
- + - +
{#advanced_dlg.anchor_title}{#openacs_dlg.anchor_title}
{#advanced_dlg.anchor_name}:{#openacs_dlg.anchor_name}:
Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/charmap.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/charmap.htm,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/charmap.htm 8 May 2009 17:34:11 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/charmap.htm 19 May 2009 17:16:13 -0000 1.2.2.1 @@ -1,15 +1,15 @@ - {#advanced_dlg.charmap_title} + {#openacs_dlg.charmap_title} - +
{#advanced_dlg.charmap_title}{#openacs_dlg.charmap_title}
Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/color_picker.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/color_picker.htm,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/color_picker.htm 8 May 2009 17:34:11 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/color_picker.htm 19 May 2009 17:16:13 -0000 1.2.2.1 @@ -1,7 +1,7 @@ - {#advanced_dlg.colorpicker_title} + {#openacs_dlg.colorpicker_title} @@ -10,16 +10,16 @@
- {#advanced_dlg.colorpicker_picker_title} + {#openacs_dlg.colorpicker_picker_title}
 @@ -34,7 +34,7 @@
- {#advanced_dlg.colorpicker_palette_title} + {#openacs_dlg.colorpicker_palette_title}
@@ -45,15 +45,15 @@
- {#advanced_dlg.colorpicker_named_title} + {#openacs_dlg.colorpicker_named_title}

- {#advanced_dlg.colorpicker_name} + {#openacs_dlg.colorpicker_name}
@@ -67,7 +67,7 @@
- +
Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/image.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/image.htm,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/image.htm 8 May 2009 17:34:11 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/image.htm 19 May 2009 17:16:13 -0000 1.2.2.1 @@ -1,7 +1,7 @@ - {#advanced_dlg.image_title} + {#openacs_dlg.image_title} @@ -11,15 +11,15 @@
- + - + - + - + - + - + - + - +
@@ -28,43 +28,43 @@
x
Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/link.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/link.htm,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/link.htm 8 May 2009 17:34:11 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/link.htm 19 May 2009 17:16:13 -0000 1.2.2.1 @@ -1,7 +1,7 @@ - {#advanced_dlg.link_title} + {#openacs_dlg.link_title} @@ -12,7 +12,7 @@ @@ -21,7 +21,7 @@ - + - + - + - + Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/source_editor.htm =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/source_editor.htm,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/source_editor.htm 8 May 2009 17:34:11 -0000 1.2 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/source_editor.htm 19 May 2009 17:16:13 -0000 1.2.2.1 @@ -1,16 +1,16 @@ - {#advanced_dlg.code_title} + {#openacs_dlg.code_title} -
{#advanced_dlg.code_title}
+
{#openacs_dlg.code_title}
- +

Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/about.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/about.js,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/about.js 8 May 2009 17:53:05 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/about.js 19 May 2009 17:16:13 -0000 1.1.2.1 @@ -16,9 +16,9 @@ html += '
@@ -30,15 +30,15 @@
'; html += ''; html += ''; - html += ''; - html += ''; - html += ''; + html += ''; + html += ''; + html += ''; html += ''; html += ''; html += ''; Index: openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/link.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/link.js,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/link.js 8 May 2009 17:53:05 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/tinymce/jscripts/tiny_mce/themes/openacs/js/link.js 19 May 2009 17:16:13 -0000 1.1.2.1 @@ -90,10 +90,10 @@ }, checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('openacs_dlg.link_is_email'))) n.value = 'mailto:' + n.value; - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('openacs_dlg.link_is_external'))) n.value = 'http://' + n.value; }, @@ -140,8 +140,8 @@ var dom = tinyMCEPopup.dom, lst = dom.get(id), v; lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('openacs_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('openacs_dlg.link_target_blank'), '_blank'); if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { tinymce.each(v.split(','), function(v) {
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '' + ed.getLang('openacs_dlg.about_plugin') + '' + ed.getLang('openacs_dlg.about_author') + '' + ed.getLang('openacs_dlg.about_version') + '