diff --git a/_assets/_old/js/common_old.js b/_assets/_old/js/common_old.js index 4473cd7c..a1c9b8e2 100644 --- a/_assets/_old/js/common_old.js +++ b/_assets/_old/js/common_old.js @@ -1,24 +1,3 @@ -'use strict' - -var tempID = '_fm_internal_temporary_id' - -var templates = {} -var selectedItems = [] -var overlay -var clickOverlay - -// Sends a costum event to itself -Document.prototype.sendCostumEvent = function (text) { - this.dispatchEvent(new window.CustomEvent(text)) -} - - - -/* * * * * * * * * * * * * * * * - * * - * BUTTONS * - * * - * * * * * * * * * * * * * * * */ var buttons = { previousState: {} } @@ -70,77 +49,31 @@ buttons.setDone = function (name, success = true) { return false } -/* * * * * * * * * * * * * * * * - * * - * EVENTS * - * * - * * * * * * * * * * * * * * * */ - -function notImplemented (event) { - event.preventDefault() - clickOverlay.click() - - let clone = document.importNode(templates.message.content, true) - clone.querySelector('h3').innerHTML = 'Not implemented' - clone.querySelector('p').innerHTML = "Sorry, but this feature wasn't implemented yet." - - document.querySelector('body').appendChild(clone) - document.querySelector('.overlay').classList.add('active') - document.querySelector('.prompt').classList.add('active') -} - -// Prevent Default event -var preventDefault = function (event) { - event.preventDefault() -} - -function logoutEvent (event) { - let request = new window.XMLHttpRequest() - request.open('GET', window.location.pathname, true, 'data.username', 'password') - request.send() - request.onreadystatechange = function () { - if (request.readyState === 4) { - window.location = '/' - } +listing.addDoubleTapEvent = function () { + let items = document.getElementsByClassName('item'), + touches = { + id: '', + count: 0 } + + Array.from(items).forEach(file => { + file.addEventListener('touchstart', event => { + if (touches.id != file.id) { + touches.id = file.id + touches.count = 1 + + setTimeout(() => { + touches.count = 0 + }, 300) + + return + } + + touches.count++ + + if (touches.count > 1) { + window.location = file.dataset.url + } + }) + }) } - -/* * * * * * * * * * * * * * * * - * * - * BOOTSTRAP * - * * - * * * * * * * * * * * * * * * */ - -document.addEventListener('DOMContentLoaded', function (event) { - - - let dropdownButtons = document.querySelectorAll('.action[data-dropdown]') - Array.from(dropdownButtons).forEach(button => { - button.addEventListener('click', event => { - button.querySelector('ul').classList.toggle('active') - clickOverlay.classList.add('active') - - clickOverlay.addEventListener('click', event => { - button.querySelector('ul').classList.remove('active') - clickOverlay.classList.remove('active') - }) - }) - }) - - let mainActions = document.getElementById('main-actions') - - document.getElementById('more').addEventListener('click', event => { - event.preventDefault() - event.stopPropagation() - - clickOverlay.classList.add('active') - mainActions.classList.add('active') - - clickOverlay.addEventListener('click', event => { - mainActions.classList.remove('active') - clickOverlay.classList.remove('active') - }) - }) - - return false -}) diff --git a/_assets/_old/js/listing.js b/_assets/_old/js/listing.js deleted file mode 100644 index 85bbbdbe..00000000 --- a/_assets/_old/js/listing.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict' - -listing.redefineDownloadURLs = function () { - let files = '' - - for (let i = 0; i < selectedItems.length; i++) { - let url = document.getElementById(selectedItems[i]).dataset.url - files += url.replace(window.location.pathname, '') + ',' - } - - files = files.substring(0, files.length - 1) - files = encodeURIComponent(files) - - let links = document.querySelectorAll('#download ul a') - Array.from(links).forEach(link => { - link.href = '?download=' + link.dataset.format + '&files=' + files - }) -} - -listing.addDoubleTapEvent = function () { - let items = document.getElementsByClassName('item'), - touches = { - id: '', - count: 0 - } - - Array.from(items).forEach(file => { - file.addEventListener('touchstart', event => { - if (touches.id != file.id) { - touches.id = file.id - touches.count = 1 - - setTimeout(() => { - touches.count = 0 - }, 300) - - return - } - - touches.count++ - - if (touches.count > 1) { - window.location = file.dataset.url - } - }) - }) -} - - -document.addEventListener('DOMContentLoaded', event => { - listing.addDoubleTapEvent() - - if (user.AllowNew) { - buttons.new.addEventListener('click', listing.newFileButton) - } -}) diff --git a/_assets/index.html b/_assets/index.html index 6c540a9f..69b8c6c2 100644 --- a/_assets/index.html +++ b/_assets/index.html @@ -36,7 +36,7 @@ background: #fff; z-index: 9999; transition: .1s ease opacity; - -webkit-transition: .5s ease opacity; + -webkit-transition: .1s ease opacity; } #loading.done { @@ -79,10 +79,10 @@ } @keyframes sk-bouncedelay { - 0%, 80%, 100% { + 0%, 80%, 100% { -webkit-transform: scale(0); transform: scale(0); - } 40% { + } 40% { -webkit-transform: scale(1.0); transform: scale(1.0); } diff --git a/_assets/src/App.vue b/_assets/src/App.vue index 12280787..d6daa580 100644 --- a/_assets/src/App.vue +++ b/_assets/src/App.vue @@ -1,5 +1,5 @@