From 16ab6c8dc19486f0176f0780673faf285a7e5ef9 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 15 Sep 2020 21:09:18 +0100 Subject: [PATCH] [Javascript] Split out JS code for ADIF and Notes pages --- application/views/interface_assets/footer.php | 46 +++---------------- assets/js/sections/adif.js | 23 ++++++++++ assets/js/sections/notes.js | 8 ++++ 3 files changed, 37 insertions(+), 40 deletions(-) create mode 100644 assets/js/sections/adif.js create mode 100644 assets/js/sections/notes.js diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index ed0b5c6b..8e19dc57 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -20,49 +20,15 @@ var icon_dot_url = "assets/images/dot.png"; - uri->segment(1) == "adif") { ?> - - - - +uri->segment(1) == "adif") { ?> + + + + uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit") ) { ?> - - + uri->segment(1) == "search" && $this->uri->segment(2) == "filter") { ?> diff --git a/assets/js/sections/adif.js b/assets/js/sections/adif.js new file mode 100644 index 00000000..0ddb3b95 --- /dev/null +++ b/assets/js/sections/adif.js @@ -0,0 +1,23 @@ +$(function () { + $('#datetimepicker1').datetimepicker({ + format: 'DD/MM/YYYY', + }); +}); + +$(function () { + $('#datetimepicker2').datetimepicker({ + format: 'DD/MM/YYYY', + }); +}); + +$(function () { + $('#datetimepicker3').datetimepicker({ + format: 'DD/MM/YYYY', + }); +}); + +$(function () { + $('#datetimepicker4').datetimepicker({ + format: 'DD/MM/YYYY', + }); +}); \ No newline at end of file diff --git a/assets/js/sections/notes.js b/assets/js/sections/notes.js new file mode 100644 index 00000000..ee2610fc --- /dev/null +++ b/assets/js/sections/notes.js @@ -0,0 +1,8 @@ +var quill = new Quill('#quillArea', { + placeholder: 'Compose an epic...', + theme: 'snow' +}); + +$("#notes_add").on("submit",function(){ + $("#hiddenArea").val(quill.root.innerHTML); +}) \ No newline at end of file