Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube icon not showing #65

Open
ahmed-bhs opened this issue Mar 21, 2018 · 1 comment
Open

youtube icon not showing #65

ahmed-bhs opened this issue Mar 21, 2018 · 1 comment

Comments

@ahmed-bhs
Copy link

ahmed-bhs commented Mar 21, 2018

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.

@cmanley
Copy link

cmanley commented Jul 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants