Hi Jos,
The code I am trying to use is:
- Code: Select all
/**
* Configure the TinyMCE editor to add the code, table, image, media, link, horizontal rule and date & time functions
*
* @param {*} element
* @param {Number} [editorType]
* @param {Number} [editorModifier]
*
* @properties={typeid:24,uuid:"0EDEDABA-AAFC-4C36-98D2-BD5AAB6027CF"}
*/
function configureHTMLEditor(element, editorType, editorModifier) {
if (editorType === undefined) editorType = scopes.tmleWebUtilities.EDITOR_TYPE.SERVOY;
var externalPlugins = '';
var menu = '';
var toolbar = '';
switch (editorType) {
case scopes.tmleWebUtilities.EDITOR_TYPE.SERVOY:
break;
case scopes.tmleWebUtilities.EDITOR_TYPE.BASIC:
externalPlugins = ' external_plugins: { \
} ';
toolbar = ' toolbar: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | indent outdent | bullist numlist" ';
break;
case scopes.tmleWebUtilities.EDITOR_TYPE.INTERMEDIATE:
externalPlugins = ' external_plugins: { \
table : " ../../../tinymce/plugins/table/plugin.min.js", \
image : " ../../../tinymce/plugins/image/plugin.min.js", \
link : " ../../../tinymce/plugins/link/plugin.min.js" \
} ';
toolbar = ' toolbar: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | indent outdent | bullist numlist | link unlink | image | table" ';
break;
case scopes.tmleWebUtilities.EDITOR_TYPE.ADVANCED:
menu = 'menubar: true, \
menu : { \
edit : {title : "Edit" , items : "undo redo | cut copy paste pastetext | selectall"}, \
insert : {title : "Insert", items : "link image | template hr insertdatetime"}, \
view : {title : "View" , items : "visualaid"}, \
format : {title : "Format", items : "bold italic underline strikethrough superscript subscript | formats | removeformat"}, \
table : {title : "Table" , items : "inserttable tableprops deletetable | cell row column"}, \
tools : {title : "Tools" , items : "spellchecker code"} \
} ';
externalPlugins = ' external_plugins: { \
code : " ../../../tinymce/plugins/code/plugin.min.js", \
table : " ../../../tinymce/plugins/table/plugin.min.js", \
image : " ../../../tinymce/plugins/image/plugin.min.js", \
hr : " ../../../tinymce/plugins/hr/plugin.min.js", \
insertdatetime : " ../../../tinymce/plugins/insertdatetime/plugin.min.js", \
paste : " ../../../tinymce/plugins/paste/plugin.min.js", \
fullscreen : " ../../../tinymce/plugins/fullscreen/plugin.min.js", \
link : " ../../../tinymce/plugins/link/plugin.min.js" \
} ';
toolbar = ' toolbar: "undo redo | pastetext | fontsizeselect | bold italic underline | alignleft aligncenter alignright alignjustify | indent outdent | bullist numlist | link unlink | image | table | hr insertdatetime code fullscreen" ';
break;
}
var configString = '{ \
browser_spellcheck: true ' + (inbuiltPlugins ? ',' + inbuiltPlugins : '') + (externalPlugins ? ',' + externalPlugins : '') + (menu ? ',' + menu : '') + (toolbar ? ',' + toolbar : '') + '}';
element.putClientProperty(APP_UI_PROPERTY.HTML_EDITOR_CONFIGURATION, configString);
}
Using the above the editor fails to initialise and I get a standard text field displayed on the screen. If I download a copy of TinyMCE V4.0.20, place it in the ROOT folder in a folder called "tinymce_test" and change all the path references above from "../../../tinymce" to "/tinymce_test" then everything works as expected.
Also when I try to access the plugins directly in the browser using the built-in copy of TinyMCE (using a URL such as
http://localhost:8080/servoy-webclient/resources/tinymce/tinymce.min.js and
http://localhost:8080/servoy-webclient/resources/tinymce/plugins/tabindex/plugin.min.js then these work just fine and the .js file is shown but if I try
http://localhost:8080/servoy-webclient/resources/tinymce/plugins/table/plugin.min.js then I get a Tomcat error saying the requested resource is not available. From that I am guessing that the version of TinyMCE built into Servoy is missing a lot of the standard plugins but there is no way that I can see to find out which ones are there and which aren't (without trying each one individually!).
Finally I need to upgrade the version of TinyMCE being used to the latest in order that we can have the users set vertical alignment on table cells without having to go into the raw HTML code and so far I can't see any way of doing this - any ideas?
Thanks
Steve