codevdesign 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -61,20 +61,22 @@
|
|
|
61
61
|
props: {
|
|
62
62
|
modelValue: { type: String, default: '' },
|
|
63
63
|
langue: { type: String, default: 'fr_FR' },
|
|
64
|
-
|
|
64
|
+
redimension: { type: Boolean, default: false },
|
|
65
65
|
desactiver: { type: Boolean, default: false },
|
|
66
|
+
hauteur: { type: [String, Number], default: '400' },
|
|
67
|
+
hauteurMinimale: { type: [String, Number], default: '200' },
|
|
66
68
|
plugins: {
|
|
67
69
|
type: [String, Array],
|
|
68
70
|
default: 'autoresize table image link fullscreen advlist lists autolink code',
|
|
69
71
|
},
|
|
70
|
-
|
|
72
|
+
autoriserImage: { type: Boolean, default: false },
|
|
71
73
|
imageTailleMaximale: { type: Number, default: 5 }, // Mo
|
|
72
74
|
cacherBarreMenu: { type: Boolean, default: false },
|
|
73
75
|
cacherBarreOutils: { type: Boolean, default: false },
|
|
74
76
|
toolbar: {
|
|
75
77
|
type: [String, Array],
|
|
76
78
|
default:
|
|
77
|
-
'bold italic underline strikethrough | fontsizeselect | forecolor backcolor | ' +
|
|
79
|
+
'bold italic underline strikethrough | print | fontsizeselect | forecolor backcolor | ' +
|
|
78
80
|
'alignleft aligncenter alignright alignjustify | emoticons | bullist numlist | ' +
|
|
79
81
|
'image | link | outdent indent blockquote | undo redo | fullscreen | removeformat | table | code',
|
|
80
82
|
},
|
|
@@ -102,7 +104,7 @@
|
|
|
102
104
|
toolbarEffective() {
|
|
103
105
|
if (this.cacherBarreOutils) return false
|
|
104
106
|
const raw = Array.isArray(this.toolbar) ? this.toolbar.join(' | ') : this.toolbar
|
|
105
|
-
if (
|
|
107
|
+
if (this.autoriserImage) return this._normalizeToolbar(raw)
|
|
106
108
|
|
|
107
109
|
const sansImage = raw
|
|
108
110
|
.replace(/\bimage\b/g, '')
|
|
@@ -119,7 +121,7 @@
|
|
|
119
121
|
const list = (Array.isArray(this.plugins) ? this.plugins : this.plugins.split(/\s+/))
|
|
120
122
|
.map(p => p.trim())
|
|
121
123
|
.filter(Boolean)
|
|
122
|
-
const filtered = this.
|
|
124
|
+
const filtered = !this.autoriserImage ? list.filter(p => p !== 'image') : list
|
|
123
125
|
return filtered.join(' ')
|
|
124
126
|
},
|
|
125
127
|
|
|
@@ -127,24 +129,27 @@
|
|
|
127
129
|
const opts = {
|
|
128
130
|
autolink: !this.desactiver,
|
|
129
131
|
autoresize: true,
|
|
130
|
-
automatic_uploads:
|
|
132
|
+
automatic_uploads: this.autoriserImage,
|
|
131
133
|
branding: false,
|
|
132
134
|
browser_spellcheck: true,
|
|
133
135
|
content_css: 'default',
|
|
134
136
|
deprecation_warnings: false,
|
|
135
137
|
emoticons_database: 'emojis',
|
|
136
138
|
highlight_on_focus: false,
|
|
137
|
-
image_dimensions:
|
|
139
|
+
image_dimensions: this.autoriserImage,
|
|
138
140
|
language: this.langue === 'en' ? 'en_US' : 'fr_FR',
|
|
139
141
|
license_key: 'gpl',
|
|
142
|
+
height: Number(this.hauteur) || 200,
|
|
143
|
+
min_height: Number(this.hauteurMinimale) || 200,
|
|
144
|
+
max_height: Number(this.hauteur) || 1000,
|
|
140
145
|
menubar: !this.cacherBarreMenu,
|
|
141
|
-
object_resizing:
|
|
142
|
-
paste_data_images:
|
|
146
|
+
object_resizing: this.autoriserImage,
|
|
147
|
+
paste_data_images: this.autoriserImage,
|
|
143
148
|
plugins: this.pluginsEffective,
|
|
144
149
|
promotion: false,
|
|
145
150
|
readonly: this.desactiver,
|
|
146
|
-
resize:
|
|
147
|
-
resize_img_proportional:
|
|
151
|
+
resize: this.redimension,
|
|
152
|
+
resize_img_proportional: this.autoriserImage,
|
|
148
153
|
skin_url: 'default',
|
|
149
154
|
statusbar: this.cacherBarreOutils === false,
|
|
150
155
|
theme_advanced_resizing: true,
|
|
@@ -152,7 +157,7 @@
|
|
|
152
157
|
toolbar: this.toolbarEffective,
|
|
153
158
|
|
|
154
159
|
// --- File picker seulement si images permises ---
|
|
155
|
-
...(this.
|
|
160
|
+
...(this.autoriserImage ? {} : { file_picker_types: 'image' }),
|
|
156
161
|
|
|
157
162
|
setup: editor => {
|
|
158
163
|
this._editor = editor
|
|
@@ -186,7 +191,7 @@
|
|
|
186
191
|
},
|
|
187
192
|
}
|
|
188
193
|
|
|
189
|
-
if (
|
|
194
|
+
if (this.autoriserImage) {
|
|
190
195
|
opts.file_picker_callback = cb => {
|
|
191
196
|
const input = document.createElement('input')
|
|
192
197
|
input.type = 'file'
|
|
@@ -234,10 +239,16 @@
|
|
|
234
239
|
},
|
|
235
240
|
|
|
236
241
|
// Re-montage propre sur changements des props
|
|
237
|
-
|
|
242
|
+
autoriserImage() {
|
|
238
243
|
this._scheduleReinit()
|
|
239
244
|
},
|
|
240
|
-
|
|
245
|
+
hauteur() {
|
|
246
|
+
this._scheduleReinit()
|
|
247
|
+
},
|
|
248
|
+
hauteurMinimale() {
|
|
249
|
+
this._scheduleReinit()
|
|
250
|
+
},
|
|
251
|
+
redimension() {
|
|
241
252
|
this._scheduleReinit()
|
|
242
253
|
},
|
|
243
254
|
toolbar() {
|