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

Support for toolbar items #4

Open
atlguy opened this issue Mar 16, 2017 · 10 comments
Open

Support for toolbar items #4

atlguy opened this issue Mar 16, 2017 · 10 comments

Comments

@atlguy
Copy link

atlguy commented Mar 16, 2017

It appears that this plug-in can only be used if using a toolbar group. Can you please add support for toolbar items so I can load and position this in a toolbar instead of using the group feature?

@doghap
Copy link

doghap commented Mar 24, 2017

editor.addCommand( 'html5video', new CKEDITOR.dialogCommand( 'html5video' ) );
editor.ui.addButton && editor.ui.addButton( 'html5video', {
				label: editor.lang.html5video.button,
				command: 'html5video',
				toolbar: 'insert,20'
			});

In plugin.js, add this code just before
CKEDITOR.dialog.add( 'html5video', this.path + 'dialogs/html5video.js' );

and in your toolbar use name html5video

@atlguy
Copy link
Author

atlguy commented Mar 24, 2017

Thank you. I tried that the button is not appearing.

@tetrahydra
Copy link

tetrahydra commented May 3, 2017

I managed to make it work:

var editor = CKEDITOR.replace( 'editor_text', {

	extraPlugins : 'html5video,lineutils,clipboard,widget,widgetselection,widgetcommon',
	toolbar      : [
		[ 'Image', 'html5video'],	
	];,
	
});

editor.addCommand( 'html5video', new CKEDITOR.dialogCommand( 'html5video' ) );
editor.ui.addButton && editor.ui.addButton( 'html5video', {
	label   : 'Video',
	command : 'html5video'
});

Ignore this one:
CKEDITOR.dialog.add( 'html5video', this.path + 'dialogs/html5video.js' );

@bahriddin
Copy link
Owner

Hi, guys. Due to my very busy student life, I am currently unable to help you. I hope after 2 weeks when the semester ends, I can help you actively.
Cheers!

@sg2002
Copy link

sg2002 commented Mar 23, 2018

I've found that you don't need to add:
editor.addCommand( 'html5video', new CKEDITOR.dialogCommand( 'html5video' ) );

This just breaks the video insertion. Just this should work:

editor.ui.addButton && editor.ui.addButton( 'html5video', {
	label   : 'Video',
	command : 'html5video'
});

@bahriddin
Copy link
Owner

Hi, mates. Can I close this issue?

@sumitsk20
Copy link

tried all of above solution, nothing is working for me :(

@nquang2448
Copy link

it's still nothing :(

@SerhiyRomanov
Copy link

I use it with CKEditor 4.14 and django-ckeditor.
I don't know why it works, but we have to define a button name with the First Capital letter, like this: 'Html5video'
Example of my toolbar config:

{
'name': 'insert',
'items': ['Image', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe', 'Html5video']
},

@bahriddin
Copy link
Owner

Sorry guys. I am not using CKEditor for several years and not quite sure what is happening here.
PRs are welcome if you know the solution.

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

8 participants