ckeditor-youtube-plugin icon indicating copy to clipboard operation
ckeditor-youtube-plugin copied to clipboard

youtube icon not showing

Open ahmed-bhs opened this issue 7 years ago • 1 comments

Hi,

I am not able to get the youtube icon in the toolbar when i use the ckeditor youtube plugin I have configured as the doc but could not able to see the icon in the toolbar.

The problem that in the network section, ther's a call to the icon link on the CDN http://cdn.ckeditor.com/4.9.0/standard/plugins/youtube/images/icon.png/ .
I am getting the icon only if i edit manually the icon : this.path + 'images/icon.png' , and even when i console.log(this.path) it returns http://cdn.ckeditor.com/4.9.0/standard/plugins/youtube/. This my youtube/config.js

CKEDITOR.plugins.add('youtube', {
    lang: [ 'en', 'bg', 'pt', 'pt-br', 'ja', 'hu', 'it', 'fr', 'tr', 'ru', 'de', 'ar', 'nl', 'pl', 'vi', 'zh', 'el', 'he', 'es', 'nb', 'nn', 'fi', 'et', 'sk', 'cs', 'ko', 'eu' ],
    init: function (editor) {
        editor.addCommand('youtube', new CKEDITOR.dialogCommand('youtube', {
            allowedContent: 'div{*}(*); iframe{*}[!width,!height,!src,!frameborder,!allowfullscreen]; object param[*]; a[*]; img[*]'
        }));

        editor.ui.addButton('Youtube', {
            label : editor.lang.youtube.button,
            toolbar : 'insert',
            command : 'youtube',
            icon : this.path + 'images/icon.png'  //here console.log(this.path) return  http://cdn.ckeditor.com/4.9.0/standard/plugins/youtube/
        });

This the Ckeditor configuration:

CKEDITOR.plugins.addExternal('youtube', '../../node_modules/ckeditor-youtube-plugin/youtube/');

    $rootScope.ckEditorOptions = { //ckEditorOptions represent my config variable
        allowedContent : true,
        extraPlugins: 'youtube',

        toolbar_full: [  

            {name: 'youtube', items: ['Youtube']},

        ],
        language: 'fr',

I noticed then, unfortunately the CKEDITOR.plugins.addExternal in the first line is not working right and because that line role is to define our path this.path who should not point to the CDN. This is my console.log(this):

{lang: Array(27), init: ƒ, name: "youtube", path: "http://cdn.ckeditor.com/4.9.0/standard/plugins/youtube/", langEntries: {…}}init: ƒ (editor)lang: (27) ["en", "bg", "pt", "pt-br", "ja", "hu", "it", "fr", "tr", "ru", "de", "ar", "nl", "pl", "vi", "zh", "el", "he", "es", "nb", "nn", "fi", "et", "sk", "cs", "ko", "eu"]langEntries: {fr: {…}}name: "youtube"path: "http://cdn.ckeditor.com/4.9.0/standard/plugins/youtube/"__proto__: Object

@fonini @garex your help would be appreciated !! cheers.

ahmed-bhs avatar Mar 21 '18 14:03 ahmed-bhs

Try using an URL starting with a "/" in: CKEDITOR.plugins.addExternal('youtube', '/rooted/path/to/node_modules/ckeditor-youtube-plugin/youtube/');

cmanley avatar Jul 18 '18 20:07 cmanley