Javascript 如何在Imperavi Redactor中添加剪辑?

Javascript 如何在Imperavi Redactor中添加剪辑?,javascript,wysiwyg,Javascript,Wysiwyg,我在插件剪辑中使用Imperavi Redactor 10.0.6。在以前添加我自己的剪辑时,我使用了此解决方案:,但在当前版本中,此方法不起作用。在clips.js文件中,我找到了变量项。我可以改变这个数组,但我不确定它是否是最好的解决方案 谢谢你的帮助。我解决了这个问题,因此: 您需要更改file clips.js remove array fromitem变量,并分配: var items= this.opts.clips; 现在,您可以设置剪辑选项,如下所示: $(function()

我在插件剪辑中使用Imperavi Redactor 10.0.6。在以前添加我自己的剪辑时,我使用了此解决方案:,但在当前版本中,此方法不起作用。在clips.js文件中,我找到了变量
。我可以改变这个数组,但我不确定它是否是最好的解决方案


谢谢你的帮助。

我解决了这个问题,因此:

您需要更改file clips.js remove array from
item
变量,并分配:

var items= this.opts.clips;
现在,您可以设置剪辑选项,如下所示:

$(function()
    {
        $('#redactor').redactor({
            plugins: ['clips'],
            clips:[['Your data...' , 'Your data is wonderful'], ['Another...','Another data is bad']]
        });
    });
     $settings['plugins'][]='clips';
$settings['clips'][]=array('Your data...', 'Your data is wonderful');
$settings['clips'][]=array('Another...', 'Another data is bad');
$settings= Json_encode($settings);
等等

如果您使用JSON,它将如下所示:

$(function()
    {
        $('#redactor').redactor({
            plugins: ['clips'],
            clips:[['Your data...' , 'Your data is wonderful'], ['Another...','Another data is bad']]
        });
    });
     $settings['plugins'][]='clips';
$settings['clips'][]=array('Your data...', 'Your data is wonderful');
$settings['clips'][]=array('Another...', 'Another data is bad');
$settings= Json_encode($settings);

这是一个很好的解决方案,但在更新包后,您所做的更改将丢失。你应该向我提出请求