Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

toolbar icons are not being displayed in tinymce (4.0.1) text editor

Tags:

tinymce

I'm upgrading tinyMCE from 3.4.2 to 4.0.1. Everything works perfect locally. But problem started when I published everything at server. Toolbar loads fine but the icons are not showing properly. Note: I have separate projects for app and CDN. I'm guessing this is a cross-domain/url reference issue but unable to figure it out. Currently the toolbar is loading as shown in the - screencast!

    tinyMCE.init({
// General options
theme: "modern",
editor_selector: "mceDesignerEditorAutoresize",
relative_urls: false,
convert_urls: false,
toolbar1: "cut copy paste | bold italic | undo redo | bullist numlist | outdent indent blockquote | link unlink image code | inserttime preview | forecolor backcolor | imgCustom attachCustom",
toolbar_items_size: 'small',
plugins:  [
    "autoresize advlist autolink lists link image charmap print preview hr anchor pagebreak",
    "searchreplace wordcount visualblocks visualchars code fullscreen",
    "insertdatetime nonbreaking save table contextmenu directionality",
    "emoticons template paste textcolor"
],   
accessibility_warnings: false,
accessibility_focus: false,
setup: function (ed) {
    ed.addButton('imgCustom', {
        title: 'Image',
        image: $("#jsTinyMCEImageUrl").val().toString(),
        onclick: function () {
            openModalPopup($("#jsTinyMCEImagePath").val(), "width=700,height=600");
        }
    });
    ed.addButton('attachCustom', {
        title: 'Attachment',
        image: $("#jsTinyMCEAttachUrl").val().toString(),
        onclick: function () {
            try {
                openModalPopup($("#jsTinyMCEAttachPath").val(), "width=400,height=200");
            }
            catch (e) {
            }
        }
    });
},
language: $('#TinyMCECurrentLanguage').val(),
paste_auto_cleanup_on_paste: true

});

like image 384
Mokarom Avatar asked Jan 14 '23 00:01

Mokarom


1 Answers

It is found that /js/tinymce/skin/lightgray/fonts folder was not being copied to server. This happened as Visual Studio didn't recognize the font files and marked them as 'None' in Build Action and as a result these files were not being published.

Solved it by right clicking the font files, select Properties and Set value for Build Action to 'Content'.

like image 60
Mokarom Avatar answered May 22 '23 23:05

Mokarom