From 868f4a64eca3fb38fbfa12e7b9a9d0d4a374f369 Mon Sep 17 00:00:00 2001
From: Pitu <7425261+Pitu@users.noreply.github.com>
Date: Sun, 16 Sep 2018 00:39:58 -0300
Subject: Begone!
---
public/css/style.css | 113 -----
public/images/fb_share.png | Bin 63834 -> 0 bytes
public/images/icons/android-chrome-192x192.png | Bin 11300 -> 0 bytes
public/images/icons/android-chrome-384x384.png | Bin 31742 -> 0 bytes
public/images/icons/apple-touch-icon.png | Bin 8070 -> 0 bytes
public/images/icons/browserconfig.xml | 9 -
public/images/icons/favicon-16x16.png | Bin 920 -> 0 bytes
public/images/icons/favicon-32x32.png | Bin 1680 -> 0 bytes
public/images/icons/favicon.ico | Bin 15086 -> 0 bytes
public/images/icons/manifest.json | 18 -
public/images/icons/mstile-150x150.png | Bin 6268 -> 0 bytes
public/images/icons/safari-pinned-tab.svg | 47 --
public/images/logo.png | Bin 157334 -> 0 bytes
public/images/logo_big.png | Bin 4245986 -> 0 bytes
public/images/logo_smol.png | Bin 59261 -> 0 bytes
public/images/logo_square.png | Bin 139609 -> 0 bytes
public/js/auth.js | 56 ---
public/js/dashboard.js | 620 -------------------------
public/js/home.js | 220 ---------
19 files changed, 1083 deletions(-)
delete mode 100644 public/css/style.css
delete mode 100644 public/images/fb_share.png
delete mode 100644 public/images/icons/android-chrome-192x192.png
delete mode 100644 public/images/icons/android-chrome-384x384.png
delete mode 100644 public/images/icons/apple-touch-icon.png
delete mode 100644 public/images/icons/browserconfig.xml
delete mode 100644 public/images/icons/favicon-16x16.png
delete mode 100644 public/images/icons/favicon-32x32.png
delete mode 100644 public/images/icons/favicon.ico
delete mode 100644 public/images/icons/manifest.json
delete mode 100644 public/images/icons/mstile-150x150.png
delete mode 100644 public/images/icons/safari-pinned-tab.svg
delete mode 100644 public/images/logo.png
delete mode 100644 public/images/logo_big.png
delete mode 100644 public/images/logo_smol.png
delete mode 100644 public/images/logo_square.png
delete mode 100644 public/js/auth.js
delete mode 100644 public/js/dashboard.js
delete mode 100644 public/js/home.js
(limited to 'public')
diff --git a/public/css/style.css b/public/css/style.css
deleted file mode 100644
index 6bf95e1..0000000
--- a/public/css/style.css
+++ /dev/null
@@ -1,113 +0,0 @@
-/* ------------------
- HOME
------------------- */
-
-section#home #b {
- -webkit-animation-delay: 0.5s;
- animation-delay: 0.5s;
- -webkit-animation-duration: 1.5s;
- animation-duration: 1.5s;
- -webkit-animation-fill-mode: both;
- animation-fill-mode: both;
- -webkit-animation-name: floatUp;
- animation-name: floatUp;
- -webkit-animation-timing-function: cubic-bezier(0, 0.71, 0.29, 1);
- animation-timing-function: cubic-bezier(0, 0.71, 0.29, 1);
- border-radius: 24px;
- display: inline-block;
- height: 240px;
- margin-bottom: 40px;
- position: relative;
- vertical-align: top;
- width: 240px;
- box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);
-}
-
-section#home div#dropzone {
- border: 1px solid #dbdbdb;
- background-color: rgba(0, 0, 0, 0);
- border-color: #ff3860;
- color: #ff3860;
- display: none;
- width: 100%;
- border-radius: 3px;
- box-shadow: none;
- height: 2.5em;
- -webkit-box-align: center;
- -ms-flex-align: center;
- align-items: center;
- user-select: none;
- justify-content: center;
- padding-left: .75em;
- padding-right: .75em;
- text-align: center;
- cursor: pointer;
-}
-
-section#home div#uploads, section#home p#tokenContainer, section#home a#panel { display: none; }
-section#home div#dropzone:hover { background-color: #ff3860; border-color: #ff3860; color: #fff; }
-section#home h3#maxFileSize { font-size: 14px; }
-section#home h3#links span { padding-left: 5px; padding-right: 5px; }
-section#home img.logo { height: 200px; margin-top: 20px; }
-section#home .dz-preview .dz-details { display: flex; }
-section#home .dz-preview .dz-details .dz-size, section#home .dz-preview .dz-details .dz-filename { flex: 1; }
-section#home .dz-preview img, section#home .dz-preview .dz-success-mark, section#home .dz-preview .dz-error-mark { display: none; }
-section#home div#uploads { margin-bottom: 25px; }
-
-@keyframes floatUp {
- 0% {
- opacity: 0;
- box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0);
- -webkit-transform: scale(0.86);
- transform: scale(0.86);
- }
- 25% { opacity: 100; }
- 67% {
- box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);
- -webkit-transform: scale(1);
- transform: scale(1);
- }
- 100% {
- box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);
- -webkit-transform: scale(1);
- transform: scale(1);
- }
-}
-
-/* ------------------
- PANEL
------------------- */
-
-section#login input, section#login p.control a.button {
- border-left: 0px;
- border-top: 0px;
- border-right: 0px;
- border-radius: 0px;
- box-shadow: 0 0 0;
-}
-
-section#login p.control a.button { margin-left: 10px; }
-section#login p.control a#loginBtn { border-right: 0px; }
-section#login p.control a#registerBtn { border-left: 0px; }
-
-
-section#auth, section#dashboard { display: none }
-section#auth input { background: rgba(0, 0, 0, 0); }
-section#auth input, section#auth a {
- border-left: 0px;
- border-top: 0px;
- border-right: 0px;
- border-radius: 0px;
- box-shadow: 0 0 0;
-}
-
-section#dashboard .table { font-size: 12px }
-section#dashboard div#table div.column { display:flex; width: 200px; height: 220px; margin: 9px; background: #f9f9f9; overflow: hidden; flex-wrap: wrap; align-items: center; }
-section#dashboard div#table div.column a { width: 100%; }
-section#dashboard div#table div.column a:first-child { height: 180px; }
-section#dashboard div#table div.column a img { width:200px; }
-
-.select-wrapper {
- text-align: center;
- margin-bottom: 10px;
-}
diff --git a/public/images/fb_share.png b/public/images/fb_share.png
deleted file mode 100644
index d5fc25b..0000000
Binary files a/public/images/fb_share.png and /dev/null differ
diff --git a/public/images/icons/android-chrome-192x192.png b/public/images/icons/android-chrome-192x192.png
deleted file mode 100644
index 1e77f89..0000000
Binary files a/public/images/icons/android-chrome-192x192.png and /dev/null differ
diff --git a/public/images/icons/android-chrome-384x384.png b/public/images/icons/android-chrome-384x384.png
deleted file mode 100644
index c07f93c..0000000
Binary files a/public/images/icons/android-chrome-384x384.png and /dev/null differ
diff --git a/public/images/icons/apple-touch-icon.png b/public/images/icons/apple-touch-icon.png
deleted file mode 100644
index 3590469..0000000
Binary files a/public/images/icons/apple-touch-icon.png and /dev/null differ
diff --git a/public/images/icons/browserconfig.xml b/public/images/icons/browserconfig.xml
deleted file mode 100644
index f95ebd2..0000000
--- a/public/images/icons/browserconfig.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
| File | -${albumOrUser} | -Date | -- |
|---|
- - Submit -
- -| Name | -Files | -Created At | -Public link | -- |
|---|
- - Request new token -
- `; - - panel.page.appendChild(container); - - document.getElementById('getNewToken').addEventListener('click', function(){ - panel.getNewToken(); - }); - - }) - .catch(function (error) { - return swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - console.log(error); - }); - -}; - -panel.getNewToken = function(){ - - axios.post('/api/tokens/change') - .then(function (response) { - - if(response.data.success === false){ - if(response.data.description === 'No token provided') return panel.verifyToken(panel.token); - else return swal("An error ocurred", response.data.description, "error"); - } - - swal({ - title: "Woohoo!", - text: 'Your token was changed successfully.', - type: "success" - }, function(){ - localStorage.token = response.data.token; - location.reload(); - }); - - }) - .catch(function (error) { - return swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - console.log(error); - }); - -}; - -panel.changePassword = function(){ - - panel.page.innerHTML = ''; - var container = document.createElement('div'); - container.className = "container"; - container.innerHTML = ` -- -
- -- - Set new password -
- `; - - panel.page.appendChild(container); - - document.getElementById('sendChangePassword').addEventListener('click', function(){ - if (document.getElementById('password').value === document.getElementById('passwordConfirm').value) { - panel.sendNewPassword(document.getElementById('password').value); - } else { - swal({ - title: "Password mismatch!", - text: 'Your passwords do not match, please try again.', - type: "error" - }, function() { - panel.changePassword(); - }); - } - }); -}; - -panel.sendNewPassword = function(pass){ - - axios.post('/api/password/change', {password: pass}) - .then(function (response) { - - if(response.data.success === false){ - if(response.data.description === 'No token provided') return panel.verifyToken(panel.token); - else return swal("An error ocurred", response.data.description, "error"); - } - - swal({ - title: "Woohoo!", - text: 'Your password was changed successfully.', - type: "success" - }, function(){ - location.reload(); - }); - - }) - .catch(function (error) { - return swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - console.log(error); - }); - -}; - -panel.setActiveMenu = function(item){ - var menu = document.getElementById('menu'); - var items = menu.getElementsByTagName('a'); - for(var i = 0; i < items.length; i++) - items[i].className = ""; - - item.className = 'is-active'; -}; - -window.onload = function () { - panel.preparePage(); -}; diff --git a/public/js/home.js b/public/js/home.js deleted file mode 100644 index 771244a..0000000 --- a/public/js/home.js +++ /dev/null @@ -1,220 +0,0 @@ -var upload = {}; - -upload.isPrivate = true; -upload.token = localStorage.token; -upload.maxFileSize; -// add the album var to the upload so we can store the album id in there -upload.album; -upload.myDropzone; - -upload.checkIfPublic = function(){ - axios.get('/api/check') - .then(function (response) { - upload.isPrivate= response.data.private; - upload.maxFileSize = response.data.maxFileSize; - upload.preparePage(); - }) - .catch(function (error) { - swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - return console.log(error); - }); -} - -upload.preparePage = function(){ - if(!upload.isPrivate) return upload.prepareUpload(); - if(!upload.token) return document.getElementById('loginToUpload').style.display = 'inline-flex'; - upload.verifyToken(upload.token, true); -}; - -upload.verifyToken = function(token, reloadOnError){ - if(reloadOnError === undefined) - reloadOnError = false; - - axios.post('/api/tokens/verify', { - token: token - }) - .then(function (response) { - - if(response.data.success === false){ - swal({ - title: "An error ocurred", - text: response.data.description, - type: "error" - }, function(){ - if(reloadOnError){ - localStorage.removeItem("token"); - location.reload(); - } - }); - return; - } - - localStorage.token = token; - upload.token = token; - return upload.prepareUpload(); - - }) - .catch(function (error) { - swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - return console.log(error); - }); - -}; - -upload.prepareUpload = function(){ - // I think this fits best here because we need to check for a valid token before we can get the albums - if (upload.token) { - var select = document.getElementById('albumSelect'); - - select.addEventListener('change', function() { - upload.album = select.value; - }); - - axios.get('/api/albums', { headers: { token: upload.token }}) - .then(function(res) { - var albums = res.data.albums; - - // if the user doesn't have any albums we don't really need to display - // an album selection - if (albums.length === 0) return; - - // loop through the albums and create an option for each album - for (var i = 0; i < albums.length; i++) { - var opt = document.createElement('option'); - opt.value = albums[i].id; - opt.innerHTML = albums[i].name; - select.appendChild(opt); - } - // display the album selection - document.getElementById('albumDiv').style.display = 'block'; - }) - .catch(function(e) { - swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - return console.log(e); - }); - } - - div = document.createElement('div'); - div.id = 'dropzone'; - div.innerHTML = 'Click here or drag and drop files'; - div.style.display = 'flex'; - - document.getElementById('maxFileSize').innerHTML = 'Maximum upload size per file is ' + upload.maxFileSize; - document.getElementById('loginToUpload').style.display = 'none'; - - if(upload.token === undefined) - document.getElementById('loginLinkText').innerHTML = 'Create an account and keep track of your uploads'; - - document.getElementById('uploadContainer').appendChild(div); - - upload.prepareDropzone(); - -}; - -upload.prepareDropzone = function(){ - var previewNode = document.querySelector('#template'); - previewNode.id = ''; - var previewTemplate = previewNode.parentNode.innerHTML; - previewNode.parentNode.removeChild(previewNode); - - var dropzone = new Dropzone('div#dropzone', { - url: '/api/upload', - paramName: 'files[]', - maxFilesize: upload.maxFileSize.slice(0, -2), - parallelUploads: 2, - uploadMultiple: false, - previewsContainer: 'div#uploads', - previewTemplate: previewTemplate, - createImageThumbnails: false, - maxFiles: 1000, - autoProcessQueue: true, - headers: { - 'token': upload.token - }, - init: function() { - upload.myDropzone = this; - this.on('addedfile', function(file) { - document.getElementById('uploads').style.display = 'block'; - }); - // add the selected albumid, if an album is selected, as a header - this.on('sending', function(file, xhr) { - if (upload.album) { - xhr.setRequestHeader('albumid', upload.album); - } - }); - } - }); - - // Update the total progress bar - dropzone.on('uploadprogress', function(file, progress) { - file.previewElement.querySelector('.progress').setAttribute('value', progress); - file.previewElement.querySelector('.progress').innerHTML = progress + '%'; - }); - - dropzone.on('success', function(file, response) { - - // Handle the responseText here. For example, add the text to the preview element: - - if (response.success === false) { - var p = document.createElement('p'); - p.innerHTML = response.description; - file.previewTemplate.querySelector('.link').appendChild(p); - } - - if (response.files[0].url) { - a = document.createElement('a'); - a.href = response.files[0].url; - a.target = '_blank'; - a.innerHTML = response.files[0].url; - file.previewTemplate.querySelector('.link').appendChild(a); - - file.previewTemplate.querySelector('.progress').style.display = 'none'; - } - - }); - - upload.prepareShareX(); -}; - -upload.prepareShareX = function(){ - if (upload.token) { - var sharex_element = document.getElementById("ShareX"); - var sharex_file = "{\r\n\ - \"Name\": \"" + location.hostname + "\",\r\n\ - \"DestinationType\": \"ImageUploader, FileUploader\",\r\n\ - \"RequestType\": \"POST\",\r\n\ - \"RequestURL\": \"" + location.origin + "/api/upload\",\r\n\ - \"FileFormName\": \"files[]\",\r\n\ - \"Headers\": {\r\n\ - \"token\": \"" + upload.token + "\"\r\n\ - },\r\n\ - \"ResponseType\": \"Text\",\r\n\ - \"URL\": \"$json:files[0].url$\",\r\n\ - \"ThumbnailURL\": \"$json:files[0].url$\"\r\n\ -}"; - var sharex_blob = new Blob([sharex_file], {type: "application/octet-binary"}); - sharex_element.setAttribute("href", URL.createObjectURL(sharex_blob)); - sharex_element.setAttribute("download", location.hostname + ".sxcu"); - } -}; - -//Handle image paste event -window.addEventListener('paste', function(event) { - var items = (event.clipboardData || event.originalEvent.clipboardData).items; - for (index in items) { - var item = items[index]; - if (item.kind === 'file') { - var blob = item.getAsFile(); - console.log(blob.type); - var file = new File([blob], "pasted-image."+blob.type.match(/(?:[^\/]*\/)([^;]*)/)[1]); - file.type = blob.type; - console.log(file); - upload.myDropzone.addFile(file); - } - } -}); - -window.onload = function () { - upload.checkIfPublic(); -}; - -- cgit v1.2.3