From 267a990306da90daa29c8c59a3cbd57f2faf169d Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 5 Jan 2018 17:57:49 +0100 Subject: [PATCH] Added countdown timer specific post form --- assets/css/components/posts/form.css | 5 +++-- assets/js/components/posts/form.js | 23 +++++++++++++++++++++++ system/config/dev.config.php | 6 ++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/assets/css/components/posts/form.css b/assets/css/components/posts/form.css index bffee2b1..699662a2 100644 --- a/assets/css/components/posts/form.css +++ b/assets/css/components/posts/form.css @@ -45,8 +45,9 @@ .post-form .post-image, .post-form .post-youtube, .post-form .post-movie, -.post-form .post-weblink -.post-form .post-pdf { +.post-form .post-weblink, +.post-form .post-pdf, +.post-form .post-countdown { display: none; } diff --git a/assets/js/components/posts/form.js b/assets/js/components/posts/form.js index d7d8509c..8e441c7b 100644 --- a/assets/js/components/posts/form.js +++ b/assets/js/components/posts/form.js @@ -174,6 +174,28 @@ ComunicWeb.components.posts.form = { }); //End : PDF + //Add countdown timer specific informations + var countdownForm = createElem2({ + appendTo: boxBody, + type: "div", + class: "post-countdown" + }); + + var timeEndInput = createFormGroup({ + target: countdownForm, + label: "Date de fin", + placeholder: "dd/mm/yyyy", + type: "text" + }); + + $(timeEndInput).datepicker({ + autoclose: true, + format: "dd/mm/yyyy" + }); + //End : countdown timer + + + //Create post type change handler var changesHandler = function(){ @@ -182,6 +204,7 @@ ComunicWeb.components.posts.form = { movieInputForm.style.display = movieType.checked ? "block" : "none"; linkChooseForm.style.display = linkType.checked ? "block" : "none"; pdfUploadForm.style.display = pdfType.checked ? "block" : "none"; + countdownForm.style.display = countdownType.checked ? "block" : "none"; }; //Apply changesHandler function to all the data types diff --git a/system/config/dev.config.php b/system/config/dev.config.php index 3fb1b3b9..e7c377fe 100644 --- a/system/config/dev.config.php +++ b/system/config/dev.config.php @@ -44,6 +44,9 @@ class Dev { //Light box "3rdparty/lightbox/ekko-lightbox.min.css", + //Datepicker + "3rdparty/adminLTE/plugins/datepicker/datepicker3.css", + //VideoJS //"3rdparty/videojs/6.4.0/video-js.min.css" ); @@ -94,6 +97,9 @@ class Dev { //Bootstrap-WYSIWYG "3rdparty/bootstrap-wysiwyg.js", + //Datepicker + "3rdparty/adminLTE/plugins/datepicker/bootstrap-datepicker.js", + //VideoJS //"3rdparty/videojs/6.4.0/video.min.js" );