[Javascript] Split out JS code for ADIF and Notes pages

pull/617/head
Peter Goodhall 2020-09-15 21:09:18 +01:00
rodzic d4aa6c9405
commit 16ab6c8dc1
3 zmienionych plików z 37 dodań i 40 usunięć

Wyświetl plik

@ -20,49 +20,15 @@
var icon_dot_url = "<?php echo base_url();?>assets/images/dot.png";
</script>
<?php if ($this->uri->segment(1) == "adif") { ?>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.1/js/tempusdominus-bootstrap-4.min.js"></script>
<script type="text/javascript">
$(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',
});
});
</script>
<?php } ?>
<?php if ($this->uri->segment(1) == "adif") { ?>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.1/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="<?php echo base_url() ;?>assets/js/sections/adif.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit") ) { ?>
<script src="<?php echo base_url() ;?>assets/plugins/quill/quill.min.js"></script>
<script>
var quill = new Quill('#quillArea', {
placeholder: 'Compose an epic...',
theme: 'snow'
});
$("#notes_add").on("submit",function(){
$("#hiddenArea").val(quill.root.innerHTML);
})
</script>
<script src="<?php echo base_url() ;?>assets/js/sections/notes.js"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "search" && $this->uri->segment(2) == "filter") { ?>

Wyświetl plik

@ -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',
});
});

Wyświetl plik

@ -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);
})