Good afternoon,
I'd love to use the Pipits Inline Perch Assets on a new site I'm working on but I can't seem to get it to work. I have custom Redactor plugins loading and working fine but adding the Inline Assets plugin doesn't seem to work. I can get the icon to appear but adding an image simply adds a blank line within Redactor and no image.
In the console I end up with Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern after trying to add an image using the plugin (using Safari, Big Sur).
My Redactor config.js code is below and I'm on the latest version of Perch Runway:
Code
- Perch.UserConfig.redactor = function () {
- var get = function (profile, config, field) {
- // remove perchassets plugin
- config.plugins = config.plugins.filter(function (item) {
- return item !== 'perchassets'
- })
- // add inlineperchassets plugin
- if (config.plugins.indexOf('inlineperchassets') === -1) config.plugins.push('inlineperchassets');
- if (config.plugins.indexOf('table') === -1) config.plugins.push('table');
- if (config.plugins.indexOf('video') === -1) config.plugins.push('video');
- if (config.plugins.indexOf('specialchars') === -1) config.plugins.push('specialchars');
- if (config.plugins.indexOf('definedlinks') === -1) {
- config.plugins.push('definedlinks');
- config.definedlinks = Perch.path + '/addons/plugins/editors/page-links/page-list.php';
- }
- if (!config.linkNewTab) {
- config.linkNewTab = true;
- }
- if (!config.formattingAdd) {
- config.formattingAdd = {
- 'bold': {
- title: 'Bold Paragraph',
- api: 'module.block.format',
- args: {
- 'tag': 'p',
- 'class': 'c-leading'
- },
- 'type': 'toggle'
- },
- };
- }
- config.buttonsAdd = ['line']
- if(profile == 'minimal') {
- // hide some buttons
- config.buttons = ['bold', 'italic', 'link']
- // hides Perch assets plugin
- config.plugins = ['definedlinks', 'specialchars']
- }
- // Needed when using minimal win combination with other styles
- if(profile == 'expanded') {
- config.buttons = ['html', 'format', 'bold', 'italic', 'lists', 'link', 'file']
- // hides Perch assets plugin
- config.plugins = ['definedlinks', 'specialchars']
- }
- return config;
- };
- var load = function(cb) {
- $("<style/>").text('.redactor-styles .c-leading { font-size: 16px; font-weight: bold; }').appendTo(document.head);
- jQuery.getScript(Perch.path + '/addons/plugins/editors/redactor-plugins/pipit_inlineperchassets/inlineperchassets.js', function(){
- jQuery.getScript(Perch.path + '/addons/plugins/editors/redactor-plugins/table.js', function(){
- jQuery.getScript(Perch.path + '/addons/plugins/editors/page-links/definedlinks.js', function() {
- jQuery.getScript(Perch.path + '/addons/plugins/editors/redactor-plugins/video.js', function() {
- jQuery.getScript(Perch.path + '/addons/plugins/editors/redactor-plugins/specialchars.js', cb);
- });
- });
- });
- });
- };
- return {
- 'get': get,
- 'load': load
- }
- }();
Would love it if Hussein is around and can shed any light on what might be wrong.
Thanks, Lea.