diff --git a/data/www/js/lib/jquery-more.js b/data/www/js/lib/jquery-more.js index b043be6..445e1c3 100644 --- a/data/www/js/lib/jquery-more.js +++ b/data/www/js/lib/jquery-more.js @@ -53,5 +53,32 @@ jQuery(function () { updateCheckboxActiveClass(); }); + $.fn.serializeObject = function() { + const obj = {}; + + this.find('input, select, textarea').each(function() { + const field = $(this); + const name = field.attr('name'); + + if (!name) return; // Ignore fields without a name + + if (field.is(':checkbox')) { + const isOnOff = field.val() === 'on' || field.val() === '1'; + obj[name] = field.is(':checked') ? field.val() : (isOnOff ? false : null); + } else if (field.is(':radio')) { + if (field.is(':checked')) { + obj[name] = field.val(); + } else if (!(name in obj)) { + obj[name] = false; + } + } else { + const tryInt = parseInt(field.val()); + obj[name] = isNaN(tryInt) ? field.val() : tryInt; + } + }); + + return obj; + }; + }); }); diff --git a/data/www/js/slideshow/content-composition.js b/data/www/js/slideshow/content-composition.js index 58672c2..540d44b 100644 --- a/data/www/js/slideshow/content-composition.js +++ b/data/www/js/slideshow/content-composition.js @@ -388,8 +388,8 @@ jQuery(document).ready(function ($) { $(document).on('submit', 'form.form', function (e) { unfocusElements(); - const layers = getLocationPayload(); - $('#content-edit-location').val(JSON.stringify(layers)); + const location = getLocationPayload(); + $('#content-edit-location').val(JSON.stringify(location)); }); function updateZIndexes() { diff --git a/data/www/js/slideshow/content-text.js b/data/www/js/slideshow/content-text.js index bdd7d6d..d90de8a 100644 --- a/data/www/js/slideshow/content-text.js +++ b/data/www/js/slideshow/content-text.js @@ -70,6 +70,13 @@ jQuery(document).ready(function ($) { draw(); - - + $(document).on('submit', 'form.form', function (e) { + const location = getLocationPayload(); + $('#content-edit-location').val(JSON.stringify(location)); + }); }); + + +const getLocationPayload = function() { + return $('form#elementForm').serializeObject(); +}; diff --git a/data/www/scss/components/_animation.scss b/data/www/scss/components/_animation.scss new file mode 100644 index 0000000..3572c42 --- /dev/null +++ b/data/www/scss/components/_animation.scss @@ -0,0 +1,12 @@ +@keyframes blink{50%{opacity:0;}} +.cfx-blink{animation:1.5s linear infinite blink;} +.cfx-ffff-speed {animation-delay: 0.1s;} +.cfx-fff-speed {animation-delay: 0.3s;} +.cfx-ff-speed {animation-delay: 0.5s;} +.cfx-f-speed {animation-delay: 0.8s;} +.cfx-m-speed {animation-delay: 1s;} +.cfx-s-speed {animation-delay: 1.3s;} +.cfx-ss-speed {animation-delay: 1.5s;} +.cfx-sss-speed {animation-delay: 1.8s;} +.cfx-ssss-speed {animation-delay: 2s;} +.cfx-sssss-speed {animation-delay: 3s;} \ No newline at end of file diff --git a/views/slideshow/contents/edit-text.jinja.html b/views/slideshow/contents/edit-text.jinja.html index 81b78cc..ca8e158 100644 --- a/views/slideshow/contents/edit-text.jinja.html +++ b/views/slideshow/contents/edit-text.jinja.html @@ -117,11 +117,13 @@ Text + {% set contentStyles = json_loads(content.location) %} +