1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
|
window.VT=window.VT||{},VT.TodoApp=function(a){function b(b){Object.assign(e,b),a.querySelector(".todo-frame.-days").todoFrameDays.update({items:e.items,at:e.at}),a.querySelector(".todo-frame.-custom").todoFrameCustom.update({lists:e.customLists,items:e.items,at:e.customAt}),a.querySelectorAll(".app-collapsible").forEach(function(a){a.appCollapsible.update()})}function c(){a.dispatchEvent(new CustomEvent("beforeFlip",{bubbles:!0}))}function d(){a.dispatchEvent(new CustomEvent("flip",{bubbles:!0}))}var e={items:[],customLists:[],at:VT.formatDateId(new Date),customAt:0};a.innerHTML="<header class=\"app-header\">\n <h1 class=\"title\"><a href=\"https://weboas.is\">WebOasis - Todo</a></h1>\n</header>\n<div class=\"todo-frame -days\"></div>\n<div class=\"app-collapsible\">\n <p class=\"bar\">\n <button class=\"app-button -circle toggle\"><i class=\"app-icon\" data-id=\"chevron-up-24\"></i></button>\n </p>\n <div class=\"body\">\n <div class=\"todo-frame -custom\"></div>\n </div>\n</div>\n<footer class=\"app-footer\">\n <p>\n <a href=\"old/\">Old Todo List</a>\n </p>\n</footer>",VT.AppFlip(a,{selector:".todo-item, .todo-item-input, .todo-day, .todo-custom-list",removeTimeout:200}),VT.TodoStore(a),a.querySelectorAll(".app-collapsible").forEach(VT.AppCollapsible),a.querySelectorAll(".app-icon").forEach(VT.AppIcon),a.querySelectorAll(".app-fps").forEach(VT.AppFps),VT.TodoFrameDays(a.querySelector(".todo-frame.-days")),VT.TodoFrameCustom(a.querySelector(".todo-frame.-custom")),a.addEventListener("todoData",c,!0),a.addEventListener("sortableUpdate",c,!0),a.addEventListener("draggableCancel",c,!0),a.addEventListener("draggableDrop",c,!0),a.addEventListener("draggableStart",function(b){b.detail.image.classList.add("_noflip"),a.appendChild(b.detail.image)}),a.addEventListener("draggableCancel",function(a){a.detail.image.classList.remove("_noflip"),b()}),a.addEventListener("draggableDrop",function(a){a.detail.image.classList.remove("_noflip")}),a.addEventListener("sortableUpdate",function(a){a.detail.placeholder.classList.add("_noflip")}),a.addEventListener("focusin",function(a){a.target.classList.contains("use-focus-other")&&document.querySelectorAll(".use-focus-other").forEach(function(b){b===a.target||b.dispatchEvent(new CustomEvent("focusOther"))})}),a.addEventListener("todoData",function(a){b(a.detail)}),a.addEventListener("todoData",d),a.addEventListener("sortableUpdate",d),a.addEventListener("draggableCancel",d),a.addEventListener("draggableDrop",d),a.todoStore.load()};
|