Commit Graph

53 Commits

Author SHA1 Message Date
Bobby Wibowo
c3d4c237cb
Init account-manager branch 2018-10-10 02:52:41 +07:00
Bobby Wibowo
2f6c728e64
Updates
Moved page.prepareShareX() to a single JS file named sharex.js. It'll be loaded in home and dashboard pages, and both home.js and dashboard.js will rely on the function provided by it.

The generated ShareX config file will also properly support cases where the safe is being hosted in a subdir now (e.i. https://example.com/lolisafe).
2018-10-09 02:30:22 +07:00
Bobby Wibowo
8e74c7f5bd
Updated dashboard
* Added "ShareX user profile" menu item to administration sidebar. This do the same thing as the ShareX icon in the homepage, which is to download a ShareX config.

* Updated version string in _globals.njk. A few of the previous commits also modified some JS files, but I forgot to update the version string back then.
2018-09-07 22:22:17 +07:00
Bobby Wibowo
ed7612bd89
Fix .eslintrc.json for client-side JS files
I can't remember why I extended the config with "eslint:recommended" instead of "standard" back then. I know I wanted to force an older ecmaversion, but even then it would still work just fine with standard.
I've fixed it now to use standard. I've also applied auto-fix to dashboard.js and home.js, which fixed some stray or missing whitespaces, as well as the indenting of case's inside switch statement.
2018-09-07 22:02:04 +07:00
Bobby Wibowo
56bdd08ee7
Init 'browser-ecma5' branch (#7)
* Downgraded ecma version of client-side scripts to v5. This change means no more backtick strings and some others.

* Massively modified auth.js, dashboard.js and home.js to support the downgrade (dashboard.js had the most changes).

* Removed enter key event handler from auth page. The previous code had some small issues. I'd rather not have the handler than let the issues persist. I'll eventually look into adding this again in the future.

* Updated uploadController.js to handle some invalid requests into /api/delete and /api/bulkdelete.
2018-09-04 22:49:37 +07:00
Bobby Wibowo
5c365dc4a8
More changes related to the previous commit 2018-07-17 10:21:04 +07:00
Bobby Wibowo
fcdac004f3
Updated dashboard.js and home.js
Continuation of the previous commit.
2018-07-14 11:37:36 +07:00
Bobby Wibowo
5e765f4935
Updated home.js and dashboard.js
Use for-i-loop instead of for-of-loop on various places (I may have missed some spots though).
2018-07-14 11:35:31 +07:00
Bobby Wibowo
4d7b23bb39
Initial commit at browser-ecma6 branch
This commit is intended to downgrade codes in JS files used for browser to increase browsers compatibility.

This branch is still experimental and may require much more testing.
2018-07-14 10:42:18 +07:00
Bobby Wibowo
369b1137a7
Updates
* Some structure updates to the homepage and the No-JS uploader form. Making them both somewhat look better, especially in terms of spacing.

* Upload URLs form will now show an error alert when there the form is empty or only filled with whitespaces.

* Upload URLs form will now automatically remove empty lines or lines that consist of only whitespaces when the upload button is pressed.
2018-05-13 05:13:26 +07:00
Bobby Wibowo
4d634196c5
Updated home.js
* Cache selected album the exact moment "Upload URLs" button is pressed, so that any in progress requests will not have its album id altered.

* All URLs will now be displayed in the uploads list (the thing in between upload buttons and footer links) the moment "Upload URLs" button is pressed. Previously it would only show the URLs one by one after each finished request.
Brief video: https://i.fiery.me/AByv.mp4.
2018-05-11 22:10:49 +07:00
Bobby Wibowo
bd722129de
Updates, now supports uploading by URLs!
* Added upload by URLs. It has its own max size (config.uploads.urlMaxSize), make sure your config matches config.sample.js.
Here's a brief video showing it in action: https://i.fiery.me/CUhQ.mp4.

* /api/upload now supports uploading by URLs. Devs will only need to POST a JSON request containing a key named "urls", which is an array of the urls to upload.

* Added file extension filter to /api/upload/finishchunks.

* Added proper total chunks size check to /api/upload/finishchunks.

* Various code improvements.
2018-05-11 21:34:13 +07:00
Bobby Wibowo
7991a63315
Updates (please update your config.js)
NOTICE: Please update your config.js. Use config.sample.js as the template.
There were a couple of renames and restructures.

* Album zipper API route will now internally save its state when it's generating zip files, and any subsequent requests will silently be "postponed" until the first spawned task is finished. This will guarantee that there are no multiple zipping tasks for the same album. The method may seem a bit hackish though.

* All instances of console.log(error) were replaced with console.error(error). This will guarantee that any error goes to stderr instead of stdout.

* Deleting file by names will now properly remove successful files from the textarea. There was a logic flaw.

* Failure to generate thumbnails will no longer print the full stack, but instead only the error message. It will also then symlink a template image from /public/images/unavailable.png (it's only a simple image that says that it failed to generate thumbnail).
This haven't been tested in Windows machines, but it'll probably work fine.
I thought of adding a new column to files table which will store information whether the thumbnail generation is sucessful or not, but oh well, I'll go with this method for now.
2018-05-09 15:41:30 +07:00
Bobby Wibowo
9e069f5a9a
Updates
* Added "create new album" button at homepage uploader. Due to this, albums list will always be shown even when you don't have any albums (and of course the list will be empty).
Preview: https://i.fiery.me/ITQ5.mp4 (ignore the fact that the prompt says "Edit album", it's been fixed before this commit goes live)

* Refactored various bits of the codes to use async/await instead of Promise.then. This will obviously cause the browser's requirement to raise but hell, it's the modern browsers age.

* Various other code improvements.
2018-05-06 21:14:57 +07:00
Bobby Wibowo
31968ada06
Updated home.js
Removed unused lines from experimentations.
2018-04-29 19:54:55 +07:00
Bobby Wibowo
61e1896945
Updates
* A bunch of refactors in public JS files (home.js, dashboard.js, etcetera).

* Added lazyload to home page (for thumbs of uploaded images), dashboard (for thumbs view) and albums' public link.
Albums' public link will silently fallback to loading all thumbs at once if JavaScript is disabled.

* A bunch of others code improvements. Honestly I'm too lazy to track all the changes.
2018-04-29 19:47:24 +07:00
Bobby Wibowo
21bf3b59c2
Updated home
Removed "dz-thumbnail" alt from dropzone's template and slightly changed ShareX's config template.
2018-04-26 20:14:18 +07:00
Bobby Wibowo
5bb960756f
Updates
uploadController.js:

 * Fixed chunk uploads failing when "blockedExtensions" is missing from the config file.

config.sample.js:

* Renamed "blockedExtensions" to "extensionsFilter", and added a new option named "filterBlacklist". When "filterBlacklist" is set to 'true', all extensions in "extensionsFilter" array will be blacklisted, otherwise it will be a whitelist, so only files with those extensions that can be uploaded.

* Renamed "uploads.chunkedUploads.maxSize" to "uploads.chunkedUploads.chunkSize".

* Added "uploads.chunkedUploads.noJsMaxSize" which can be used to change the 'displayed' file size on the No-JS uploader page.

* Some other phrases updates.

_globals.njk:

* Updated static files' version string since there is a small update to home.js.

other files:

* Regular code improvements/tweaks.
2018-04-25 20:16:34 +07:00
Bobby Wibowo
7376ce3d7c
Updates
* Added Firefox extension link. For now this will simply link my fork of the Chrome extension. You will have to build the extension by your own.

* Updated icons (added Firefox).

* Tiny refactor in home.js, thus I had to update version string in _globals.njk as well.
2018-04-22 02:08:09 +07:00
Bobby Wibowo
431be5cccd
Updated home
* Main upload button will no longer be "loading" if an error occurs with the API check request.

* It will now show a message asking user to try out the No-JS uploader when JavaScript is disabled.
2018-04-21 20:14:34 +07:00
Bobby Wibowo
dd43acecea
Updates
* Added VSCode settings to git repo. Now you can match yours with mine, if you want.

* Added .jsbeautifyrc for js-beautify (to be used by VSCode's Beautify extension).

* Refactored all instances of require('**/*.js') with require('**/*') wherever applicable (basically gotten rid of the .js extension).

* Refactored path in all instances of require() wherever applicable.

* Sorted instances of require() wherever applicable.

* Fixed 500 HTTP error trying to load an error page for 505 HTTP error.

* Removed special treatement of NoJS page from uploadsController.processFilesForDisplay().

* Updated version string of all static files.

* Beautified all HTML, HANDLEBARS and CSS files.

* Refactored the structure of footer links in homepage and No-JS uploader. This should now fix homepage going out-of-bound in smaller screens.

* Added CSS prefixes wherever applicable.

* Improved back-end side of No-JS uploader. This will now handle errors properly.

* No-JS uploader will now show max file size.

* No-JS uploader will now show a proper message when private mode is enabled and/or registration is disabled.
2018-04-13 23:20:57 +07:00
Bobby Wibowo
3ca692d8c7
Updates
* Refactored all instances of "failedIds" and "albumIds" to "failedids" and "albumids" respectively. Abandoning camel case for these ones.

* Refactored the way it looks into which albums the files are supposed to be added into.
For /api/upload/finishchunks, you can add "albumid" to each object in files[] to specify which album you want the finsihed chunks to be added into. Each object may have different album IDs.
For /api/upload, which is regular uploads, unfortunately you can only choose one album at a time (by adding "albumid" to the request headers, like usual). It uses the same function as the one used for finishchunks to add the files into album, so it shouldn't be hard to extend this ability to regular uploads, someday in the future.

* Fixed a bug in /api/upload/finishchunks. Previously you couldn't ever get it to work.

* Updated error message when successful uploads could not be added to album.

* "albumid" will no longer be added to request headers if they are chunked uploads. They'd have been ignored anyways.
2018-04-05 19:54:24 +07:00
Bobby Wibowo
b1dbb931c1
Updates
* Updated eslint-plugin-import dev dependency.

* Added 2 new ESLint rules: "prefer-const" and "object-shorthand".

* Refactor all JS files to follow the new ESLint rules.

* Refactored all instances of for-i into for-of wherever applicable.
2018-04-05 17:52:57 +07:00
Bobby Wibowo
95de5ee3fd
Updates
* New uploads that can NOT be added to an album, for whatever reason, will print out message that they can not be added to the said album, but their links will still also be shown underneath the message. Previously it would only print out the message but not the link.

* Improved uploadController.processFilesForDisplay(). Previously it would loop through all uploaded files and update album info for EVERY file, even though to begin with it was designed so that every call would only have to access ONE album. So yeah, this time it will only update album info ONCE no matter how many files are being processed in that session.
2018-04-05 17:21:51 +07:00
Bobby Wibowo
ab81bedffa
I can't ever be satisfied 🎤
* Updated home. All footer links are now using icons.

* Added Chrome extension link to home.

* Updated icons (added some and replaced some).

* Home will now show a different message if private mode is on but guests are still allowed to create accounts.

* Home will no longer show message about creating account if guests are not allowed to create one.

* Updated API route: /api/check. State of whether registration is enabled or not is now exposed with key "enableUserAccounts".
2018-04-04 01:54:42 +07:00
Bobby Wibowo
8724d45ce0
Updates
* Refactored all instances of "An error occurred" by appending an exclamation mark.

* Added the ability to add/remove files to/from album (API route: /api/albums/addfiles - https://s.fiery.me/dCAqLEQ9.mp4).

* Added the ability to purge files associated with an album when deleting the said album (set "purge" key to true in the JSON POST request to /api/albums/delete).

* Updated icons.

* Some other refactors, probably.
2018-03-30 09:39:53 +07:00
Bobby Wibowo
76076ac5c2
WHY CAN'T I EVER BE DONE!?
I forgot to make clipboard button on mobile to only appear after succesful upload.
2018-03-29 03:28:40 +07:00
Bobby Wibowo
be4d16c6c2
Updated home.html and home.js
Removed "copy link" button from home page for desktop (the button for tablet and mobile will still be there).
2018-03-29 03:12:11 +07:00
Bobby Wibowo
0f32319552
Updates
* Small styling update to auth page.

* Changed icons used in dashboard.

* Added ClipboardJS.

* Added "copy link" button in file list (list view only) and album list. They will use ClipboardJS.

* Added "copy link" in upload result. For desktop, there will be small clipboard icons after the links, but for mobile and tablet, there will be a clickable buttons instead.

* Updated placeholder color for input elements.

* Updated "Loading..." in home page to use Bulma's loading spinner instead. It will also now be unclickable while still loading.

* Matched version string for all JS and CSS files.
2018-03-29 03:05:01 +07:00
Bobby Wibowo
2dd724f88f
Updates
* Switched standard to eslint with eslint-config-standard (and 4 more eslint plugins needed by standard).

* Added "curly" eslint rule with "all" option. I like it.

* Refactored all JS files to apply the new "curly" eslint rule.

* Renewed axios.min.js, dropzone.min.js and sweetalert.min.js. Re-minified and added a small comment stating their version and copyright statement.

* Some buttons in dashboard will now show loading icon whenever they're waiting for response from the server.

* Updated README.md and .gitignore.
2018-03-29 00:40:50 +07:00
Bobby Wibowo
66a63ca6d6
Updates (YAY, CHUNKED UPLOADS!)
* Added new dependency: rimraf. This will be used by chunked upload support to bulk delete temporary chunk files.

* Added chunked uploads support :3

* Updated Dropzone to 5.2.0.

* More improvements to thumbnail view. Delete button will now only appear on hover. Some other details, such as file name, size and album/owner will also appear on hover. Touch devices will have all of those appear always visible by default.

* Image thumbnails will now appear on home page after successful uploads (only for WEBP, JPG, JPEG, BMP, GIF and PNG files). WEBP may not work properly in Firefox though.

* Refactored home.js to use const/let and some other stuff.

* Refactored album view. It will now display properly on mobile screen. Download Album button will also no longer be located at the top right, but right below the subtitle.

* Updated some version strings.

* And maybe some others that I can't remember.
2018-03-28 18:36:28 +07:00
Bobby Wibowo
3fa5b24ee5
Updates
* Better auth handling.

* Deleting a file will no longer cause the dashboard to load the very first page of uploaded files list. It will instead reload the currently viewed page.

* Updated dropzone (I guess).
2018-03-25 02:47:41 +07:00
Bobby Wibowo
c96f5b0a33
Updates
* Updated Bulma to 0.6.2. Text will look slightly bigger in general now. I may change that in the future.

* Updated SweetAlert to 2.1.0.

* A bunch of other updates to make it compatible with the updated Bulma and SweetAlert.
2018-03-19 23:51:39 +07:00
Bobby Wibowo
c1db799aee
Updates
Replaced all instances of "ocurred" into "occurred".
2018-02-25 02:33:31 +07:00
Bobby Wibowo
32dd070e49
Yet another bunch of updates
* Self-host all libs (including but not limited to Font Awesome icons). LICENSE files were properly included as well.

* Temporarily disabling error pages.

* Added "start" and "pm2" scripts. To be used with "yarn SCRIPT_NAME" or "npm run SCRIPT_NAME".

* Added container for the tables in dashboard. On narrow screens, such as phones, users will then have the ability to use horizontal scroll on the tables.

* Fixed various resource paths. This should now work properly when not being hosted in root domain (e.i. https://fiery.me/lolisafe/).

* Before checking API, the "Running in ..." button will now say "Loading..." instead.
2018-01-24 22:31:23 +07:00
Bobby Wibowo
62ccfe5fee
Updates
* Updated content and colors of faq.html.

* Updated home.js.
2018-01-24 03:41:28 +07:00
Bobby Wibowo
bcdfcd7064
Various updates
* Switched ESLint + Aqua to Standard. I'm a big fan of Standard. Updated yarn.lock file too.

* Lots of refactors to follow the rules of Standard.

* Fixed issue with uploading as a not logged in user.
2018-01-24 03:06:30 +07:00
Bobby Wibowo
47f2f30682
More breaking changes
* Added Editor Config file.

* Added ".vscode/" to .gitignore.

* Added final newline to some files.

* Added KDE Breeze Dark colors.

 * Applied various ESLint autofixes. There were still plenty of non-auto-fixable issues though. I'm not sure why this project had ESLint dev dependency but still ended up with countless issues.

* ... and maybe some others.
2018-01-24 01:00:55 +07:00
EpikPhailure
4ef19ed027
removed extraneous space 2017-11-02 21:19:57 -07:00
ScruffyRules
9c07dda317 Fix up formatting in the sharex_file variable 2017-10-06 17:10:06 +10:30
ScruffyRules
d367bc27fa Make ShareX link download a sharex file if you're logged in 2017-10-06 16:58:39 +10:30
Kana
1544f1ca76 Fix being able to paste an image from clipboard 2017-09-25 19:05:20 -03:00
Pitu
2a978df1a7 Made that an ID 2017-04-27 04:47:08 -03:00
Pitu
dca43e948e Derp 2017-04-27 04:45:15 -03:00
Pitu
9db6c23ce1 Moved the eventListener 2017-04-27 04:37:30 -03:00
Onestay
f167bc52a0 removed all trailing spaces (I think) 2017-04-23 15:36:26 +02:00
Onestay
480a38d260 change let and const to var to support older browsers 2017-04-23 15:26:45 +02:00
Onestay
07f1b1ca3c remove debug console.log 2017-04-23 15:22:14 +02:00
Onestay
cf6a396730 Uploading to an album 2017-04-23 15:19:31 +02:00
Onestay
e5cd142347 Get albums and put them in the select as options 2017-04-23 14:29:09 +02:00