  <footer id="footer" class="footer">
    <div class="credits">
       Powered by <a href="https://mf1t.com/">mf1t.com</a>
    </div>
  </footer>

  <script type="text/javascript">
  $(document).ready(function() {

    $('.editor').richText({
      imageHTML: '<div class="input-group"><input class="form-control rounded-0 border-success w-auto" type="text" id="imageURL" placeholder="Enter image URL" /><a href="#" class="addMediaButton input-group-text border-success bg-success text-white rounded-0" data-media_type="" data-bs-toggle="modal" data-bs-target="#SelectMedia" data-target="#imageURL"><i class="bi bi-image"></i></a></div> <input class="form-control mt-2 rounded-0 border-secondary" type="text" id="imageCaption" placeholder="Enter image caption (optional)" />',
    });

    $('.editor2').richText({
      imageHTML: '<div class="input-group"><input class="form-control rounded-0 border-success w-auto" type="text" id="imageURL" placeholder="Enter image URL" /><a href="#" class="addMediaButton input-group-text border-success bg-success text-white rounded-0" data-media_type="" data-bs-toggle="modal" data-bs-target="#SelectMedia" data-target="#imageURL"><i class="bi bi-image"></i></a></div> <input class="form-control mt-2 rounded-0 border-secondary" type="text" id="imageCaption" placeholder="Enter image caption (optional)" />',
    });

    function insertAtCaret(html) {
      const sel = window.getSelection();
      if (sel.rangeCount) {
        const range = sel.getRangeAt(0);
        const el = document.createElement("div");
        el.innerHTML = html;
        const frag = document.createDocumentFragment(), node = el.firstChild;
        frag.appendChild(node);
        range.insertNode(frag);
        range.setStartAfter(node);
        range.setEndAfter(node);
        sel.removeAllRanges();
        sel.addRange(range);
      }
    }
    // Generic button handler for all buttons with .insertTextBtn class
    $(document).on('click', '.addReadMoreNews', function (e) {
      e.preventDefault();

      const htmlToInsert = $(this).data('readalso'); // get dynamic HTML
      const $editor = $('.editor2').siblings('.richText-editor').get(0);
      $editor.focus();
      insertAtCaret(htmlToInsert);
    });

    $(".tt-select-single").select2({
      containerCssClass: function(e) {
      return $(e).attr('required') ? 'required' : '';
      }
    });

    $(".tt-tag-selector").select2({
      tags: true,
    });

  });
  </script>
  <a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
  <!-- Vendor JS Files -->
  <script src="assets/vendor/apexcharts/apexcharts.min.js"></script>
  <script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="assets/vendor/echarts/echarts.min.js"></script>
  <script src="assets/vendor/php-email-form/validate.js"></script>
  <script src="assets/vendor/nestable/jquery.nestable.js"></script>
  <script src="assets/vendor/nestable/custom-nestable.js"></script>

  <!-- Template Main JS File -->
  <script src="assets/js/main.js"></script>
</body>
</html>
