Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Tinymce is now initialized only for texareas that have .html class to allow simple textarea inputs to be added to post and product pages

givanzb54d2df5cd62
diff --git a/public/js/admin/functions.js b/public/js/admin/functions.js
index 9822e77..5a35072 100644
--- a/public/js/admin/functions.js
+++ b/public/js/admin/functions.js
@@ -36,11 +36,14 @@ function clearFeaturedMedia(id = "featured-image") {
}
const slugify = (str) => {
-return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '') // Remove accents
- .replace(/([^\w]+|\s+)/g, '-') // Replace space and other characters by hyphen
- .replace(/\-\-+/g, '-') // Replaces multiple hyphens by one hyphen
- .replace(/(^-+|-+$)/g, '') // Remove extra hyphens from beginning or end of the string
- .toLowerCase();
+ if (str) {
+ return str.normalize('NFD').replace(/[\u0300-\u036f]/g, '') // Remove accents
+ .replace(/([^\w]+|\s+)/g, '-') // Replace space and other characters by hyphen
+ .replace(/\-\-+/g, '-') // Replaces multiple hyphens by one hyphen
+ .replace(/(^-+|-+$)/g, '') // Remove extra hyphens from beginning or end of the string
+ .toLowerCase();
+ }
+ return str;
}
diff --git a/public/js/libs/tinymce-options.js b/public/js/libs/tinymce-options.js
index c1285e6..bc16bf2 100755
--- a/public/js/libs/tinymce-options.js
+++ b/public/js/libs/tinymce-options.js
@@ -37,7 +37,7 @@ let make_wysiwyg = function(inst){
}
var tinyMceOptions = {
- selector: "textarea",
+ selector: "textarea.html",
body_class: "container",
init_instance_callback : make_wysiwyg,
setup: function (editor) {