2
function removeNote() {
5
.on("click", function (event) {
6
event.stopPropagation();
7
$(this).parents(".single-note-item").remove();
11
function favouriteNote() {
14
.on("click", function (event) {
15
event.stopPropagation();
16
$(this).parents(".single-note-item").toggleClass("note-favourite");
20
function addLabelGroups() {
21
$(".category-selector .badge-group-item")
23
.on("click", function (event) {
24
event.preventDefault();
26
var getclass = this.className;
27
var getSplitclass = getclass.split(" ")[0];
28
if ($(this).hasClass("badge-business")) {
29
$(this).parents(".single-note-item").removeClass("note-social");
30
$(this).parents(".single-note-item").removeClass("note-important");
31
$(this).parents(".single-note-item").toggleClass(getSplitclass);
32
} else if ($(this).hasClass("badge-social")) {
33
$(this).parents(".single-note-item").removeClass("note-business");
34
$(this).parents(".single-note-item").removeClass("note-important");
35
$(this).parents(".single-note-item").toggleClass(getSplitclass);
36
} else if ($(this).hasClass("badge-important")) {
37
$(this).parents(".single-note-item").removeClass("note-social");
38
$(this).parents(".single-note-item").removeClass("note-business");
39
$(this).parents(".single-note-item").toggleClass(getSplitclass);
44
var $btns = $(".note-link").click(function () {
45
if (this.id == "all-category") {
46
var $el = $("." + this.id).fadeIn();
47
$("#note-full-container > div").not($el).hide();
49
if (this.id == "important") {
50
var $el = $("." + this.id).fadeIn();
51
$("#note-full-container > div").not($el).hide();
53
var $el = $("." + this.id).fadeIn();
54
$("#note-full-container > div").not($el).hide();
56
$btns.removeClass("active");
57
$(this).addClass("active");
60
$("#add-notes").on("click", function (event) {
61
$("#addnotesmodal").modal("show");
62
$("#btn-n-save").hide();
63
$("#btn-n-add").show();
67
$("#btn-n-add").on("click", function (event) {
68
event.preventDefault();
70
var today = new Date();
71
var dd = String(today.getDate()).padStart(2, "0");
72
var mm = String(today.getMonth());
73
var yyyy = today.getFullYear();
88
today = dd + " " + monthNames[mm] + " " + yyyy;
90
var $_noteTitle = document.getElementById("note-has-title").value;
91
var $_noteDescription = document.getElementById(
92
"note-has-description"
96
'<div class="col-md-4 single-note-item all-category"><div class="card card-body">' +
97
'<span class="side-stick"></span>' +
98
'<h6 class="note-title text-truncate w-75 mb-0" data-noteHeading="' +
103
'<p class="note-date fs-2">' +
106
'<div class="note-content">' +
107
'<p class="note-inner-content" data-noteContent="' +
113
'<div class="d-flex align-items-center">' +
114
'<a href="javascript:void(0)" class="link me-1"><i class="ti ti-star fs-4 favourite-note"></i></a>' +
115
'<a href="javascript:void(0)" class="link text-danger ms-2"><i class="ti ti-trash fs-4 remove-note"></i></a>' +
116
'<div class="ms-auto">' +
117
'<div class="category-selector btn-group">' +
118
'<a class="nav-link category-dropdown label-group p-0" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">' +
119
'<div class="category">' +
120
'<div class="category-business"></div>' +
121
'<div class="category-social"></div>' +
122
'<div class="category-important"></div>' +
123
'<span class="more-options text-dark"><i class="ti ti-dots-vertical fs-5"></i></span>' +
126
'<div class="dropdown-menu dropdown-menu-right category-menu">' +
127
'<a class="note-business badge-group-item badge-business dropdown-item position-relative category-business" href="javascript:void(0);">Business</a>' +
128
'<a class="note-social badge-group-item badge-social dropdown-item position-relative category-social" href="javascript:void(0);"> Social</a>' +
129
'<a class="note-important badge-group-item badge-important dropdown-item position-relative category-important" href="javascript:void(0);"> Important</a>' +
136
$("#note-full-container").prepend($html);
137
$("#addnotesmodal").modal("hide");
144
$("#addnotesmodal").on("hidden.bs.modal", function (event) {
145
event.preventDefault();
146
document.getElementById("note-has-title").value = "";
147
document.getElementById("note-has-description").value = "";
154
$("#btn-n-add").attr("disabled", "disabled");
157
$("#note-has-title").keyup(function () {
159
$("#note-has-title").each(function () {
160
if ($(this).val() == "") {
166
$("#btn-n-add").attr("disabled", "disabled");
168
$("#btn-n-add").removeAttr("disabled");