【问题标题】:config.extraPlugins = 'Audio'; not working in ckedtiorconfig.extraPlugins = '音频';不在ckedtior工作
【发布时间】:2017-05-10 03:02:53
【问题描述】:

我想添加插件音频 html 5 和视频 html 5

但是

代码 (config.extraPlugins) 在 ckedtior 中不起作用

写入文件配置时的代码 (config.extraPlugins) 工具栏全部消失且不起作用

enter image description here

但删除显示工具栏和工作的代码(config.extraPlugins)

enter image description here

CKEDITOR.editorConfig = function( config ) {

				 config.extraPlugins = 'Audio';
                config.extraPlugins = 'html5video';

		// Define changes to default configuration here.
		// For complete reference see:
		// http://docs.ckeditor.com/#!/api/CKEDITOR.configuration
			config.language = 'en';

		// The toolbar groups arrangement, optimized for two toolbar rows.
		config.toolbarGroups = [
			{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
			{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
			{ name: 'links' },
			{ name: 'insert' },
			{ name: 'forms' },
			{ name: 'tools' },
			{ name: 'document',	   groups: [ 'mode', 'document', 'doctools' ] },
			{ name: 'others' },
			'/',
			{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
			{ name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
			{ name: 'styles' },
			{ name: 'colors' },
			{ name: 'about' }
		];
		

		// Remove some buttons provided by the standard plugins, which are
		// not needed in the Standard(s) toolbar.
		config.removeButtons = 'Underline,Subscript,Superscript';

		// Set the most common block elements.
		config.format_tags = 'p;h1;h2;h3;pre';
		// Simplify the dialog windows.
		config.removeDialogTabs = 'image:advanced;link:advanced';
		 config.filebrowserBrowseUrl = 'ckeditor/kcfinder/browse.php?opener=ckeditor&type=files';
	   config.filebrowserImageBrowseUrl = 'ckeditor/kcfinder/browse.php?opener=ckeditor&type=images';
	   config.filebrowserFlashBrowseUrl = 'ckeditor/kcfinder/browse.php?opener=ckeditor&type=flash';
	   config.filebrowserUploadUrl = 'ckeditor/kcfinder/upload.php?opener=ckeditor&type=files';
	   config.filebrowserImageUploadUrl = 'ckeditor/kcfinder/upload.php?opener=ckeditor&type=images';
	   config.filebrowserFlashUploadUrl = 'ckeditor/kcfinder/upload.php?opener=ckeditor&type=flash';
	};

【问题讨论】:

  • 你的意思是新按钮没有出现在工具栏上?
  • 写入配置时的代码(config.extraPlugins)全部消失且不工作,但删除代码(config.extraPlugins)显示工具栏并正常工作
  • 我不明白你的意思,也许用你遇到的问题的截图更新你的问题?
  • ok 会更新我的问题
  • 你现在可以检查问题了

标签: javascript angularjs plugins ckeditor


【解决方案1】:

您应该只使用一次 config.extraPlugins,否则您将覆盖声明。如果您要添加多个额外的插件,则 extraPlugins 选项需要一个逗号分隔的插件列表。在您的情况下,它应该是:

config.extraPlugins = 'Audio,html5video';

CKEditor 的文档:https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-27
    • 1970-01-01
    • 2015-10-28
    • 1970-01-01
    • 2014-10-12
    • 2014-02-03
    • 1970-01-01
    相关资源
    最近更新 更多