Socket
Socket
Sign inDemoInstall

@saltcorn/ckeditor4

Package Overview
Dependencies
7
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.2.2

public/plugins/autogrow/plugin.js

60

index.js

@@ -50,2 +50,19 @@ const {

},
{
name: "autogrow",
label: "Auto-grow",
type: "Bool",
},
{
name: "minheight",
label: "Min height (px)",
type: "Integer",
showIf: { autogrow: true },
},
{
name: "maxheight",
label: "Max height (px)",
type: "Integer",
showIf: { autogrow: true },
},
...(dirs

@@ -57,3 +74,5 @@ ? [

type: "String",
attributes: { options: dirs.map((d) => d.path_to_serve) },
attributes: {
options: [...dirs.map((d) => d.path_to_serve), "Base64 encode"],
},
},

@@ -141,8 +160,11 @@ ]

];
let varPlugin =
attrs.folder === "Base64 encode" ? "base64image" : "uploadimage";
if (attrs.autogrow) varPlugin += ",autogrow";
const extraPlugins =
attrs.reduced || attrs.toolbar === "Reduced"
? "uploadimage,dialogadvtab"
? `${varPlugin},dialogadvtab`
: attrs.toolbar === "Document"
? "uploadimage,colorbutton,font,justify,dialogadvtab,colordialog"
: "uploadimage,dialogadvtab";
? `${varPlugin},colorbutton,font,justify,dialogadvtab,colordialog`
: `${varPlugin},dialogadvtab`;
const rndcls = `cke${Math.floor(Math.random() * 16777215).toString(16)}`;

@@ -167,5 +189,4 @@

extraPlugins: ${JSON.stringify(extraPlugins)},
imageUploadUrl: '/files/upload',
${attrs.folder === "Base64 encode" ? "" : `imageUploadUrl: '/files/upload',`}
${attrs.disabled ? `readOnly: true,` : ``}
height: "${attrs.height || 10}em",
toolbarGroups: ${JSON.stringify(toolbarGroups)},

@@ -177,2 +198,8 @@ ${

}
${
attrs.autogrow
? `autoGrow_minHeight: ${attrs.minheight},
autoGrow_maxHeight:${attrs.maxheight},`
: `height: "${attrs.height || 10}em",`
}
disallowedContent: 'img{width,height}',

@@ -190,4 +217,11 @@ extraAllowedContent: 'img[width,height]'

});
editor.on( 'fileUploadRequest', function( evt ) {
let ckOnChange = ()=>{
editor.updateElement();
$('textarea#input${text(nm)}').closest('form').trigger('change');
}
editor.on('change', $.debounce ? $.debounce(ckOnChange, 500, null,true) : ckOnChange);
${
attrs.folder === "Base64 encode"
? ""
: `editor.on( 'fileUploadRequest', function( evt ) {
var fileLoader = evt.data.fileLoader,

@@ -212,7 +246,2 @@ formData = new FormData(),

})
let ckOnChange = ()=>{
editor.updateElement();
$('textarea#input${text(nm)}').closest('form').trigger('change');
}
editor.on('change', $.debounce ? $.debounce(ckOnChange, 500, null,true) : ckOnChange);
editor.on('fileUploadResponse', function( evt ) {

@@ -228,3 +257,6 @@ evt.stop();

evt.data.url=r.success.url;
});
});`
}
$('#input${text(nm)}').on('set_form_field', (e)=>{

@@ -231,0 +263,0 @@ editor.setData(e.target.value)

{
"name": "@saltcorn/ckeditor4",
"version": "0.2.1",
"version": "0.2.2",
"description": "CKEditor4 editor for HTML fields",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc