Commit Graph

208 Commits

Author SHA1 Message Date
Bobby Wibowo
f5e70b2d96
Added experimental embedded video.js player thingy 2020-11-03 20:56:32 +07:00
Bobby Wibowo
34d3601c30
Transitioned styling to Sass
Added new dev dependencies:
bulma, gulp-sass, node-sass

Updated some dependencies

Various other things related to styling

Bumped v1 version string and rebuilt client assets
2020-07-28 21:47:48 +07:00
Bobby Wibowo
541c1da5a6
Updated cookiepolicy.njk 2020-07-28 16:04:29 +07:00
Bobby Wibowo
6daa1e529e
Added src/js/misc/newsfeed.js
A small script to pull feed from blog.fiery.me as news thingy.
2020-07-28 03:46:15 +07:00
Bobby Wibowo
1981159805
Updated auth.njk again (and auth.js)
Better solution for #215

Bumped v1 version string and rebuilt client asset
2020-06-27 17:42:36 +07:00
Bobby Wibowo
4dfe776ff7
Updated auth.njk
Resolves #215
2020-06-27 17:24:12 +07:00
Bobby Wibowo
b4ab04f55a
Async-load render.js
Also fixed undefined vars check, as var === undefined throws error
when truly not defined.
It's probably specific to browsers (don't recall seeing this in node).

Bumped v1 version string and rebuilt client assets.
2020-06-20 03:33:39 +07:00
Bobby Wibowo
8bcee712ac
A toggle button to show original file names
For admins, preference for your personal uploads list and Manage uploads
aren't shared, just like thumbs/lists toggle.

Non-keyed keywords for filtering will now apply to original names too.

Added a new fontello icon for this button.

Various other things I'm too lazy to write.
2020-06-07 12:29:17 +07:00
Bobby Wibowo
8b4b0e79c5
Improved albums public page cache and more
Removed its dependency towards albums' editedAt property.
Editing album's metas (name, description, etc) will no longer update
its editedAt property.
Instead it will now ONLY be updated when adding/removing files to/from
it. Just like how it was meant to be, which was to be used to check
whether it's necessary to re-generate their downloadable ZIPs.

Albums public page cache will still be properly invalidated when
adding/removing files to/from it, as well as after editing their metas.

Added views/album-notice.njk to be used to render okay-ish notice when
an album's public page is still being generated.
I was originally thinking of using it for disabled albums as well, but
I refrained from it to reduce the possibility of disabled album IDs from
being easily scanned (as it just returns 404 now).

Removed invalidatedAt property from stats cache. Instead their caches
will immediately be nullified as they should (thus frees up memory
slightly as well).

Stats cache for albums will now only be cleared when truly necessary.
As in, adding/removing files to/from albums will no longer clear them.

Updated Nunjucks files to properly use h1, h2, h3 tags in actual
hierarchical orders.
Elements that don't need to use hX tags will now use P instead.
Nothing changes visually, only structurally.

Fixed some elements in Nunjucks using single quotes instead of
double quotes. They'd have worked the same, but consistency.

Added h1 title in FAQ page.

Make text for no JS warning a bit bigger, and improved the phrasing
a little bit.
2020-06-03 10:44:24 +07:00
Bobby Wibowo
5e5d5c5647
Manage albums admin page, and more!
Resolves #194.

Added pagination for Manage your albums page.

Albums sidebar will now only list 9 albums at most.
Use Manage your albums page to view the rest.
Albums in the list will now have View uploads button after all.

Delete album button for albums renamed to Disable album.
Since techincally the server would've always been disabling the albums
instead of deleting them.
It was something upstream dev's decided, and I haven't bothered changing
its behavior.

I'll work on actual Delete album feature some other days.

As the title says, added Manage albums admin page.

Viewing uploads of an album will hook into albumid: filter key.

I'll work on filter and bulk operations some other days.

Updated styling for disabled albums and users.
Instead of havine a line through them, they will be greyed out.
Disable public page of albums will still use line through however.

Links to album's disabled public page are now clickable.

Added a new button styling is-dangerish.
It'll be orange.

Renamed /api/albums/delete to /api/albums/disable.
For backwards compatibility, /api/albums/delete will still work
but automatically re-routed to /api/albums/disable.

/api/uploads/list will no longer print SQLite errors for moderators
or higher when encountering them.
It was originally used to inform moderators of non-existing colum names
when used for sorting.
But on one of the recent commits, I had added a check for allowed colum
names.

Improved some caching in dashboard page.

Added new entries to cookie policy.

Some other small things.

Bumped v1 version string and rebuilt client assets.
2020-06-01 11:44:16 +07:00
Bobby Wibowo
58cbcdd1fe
Updated some Nunjucks files and home.js
Updated options in _globals.njk to NOT use camelCase.

Rephrased banned categories.

Added toggle option for banned categories into faq.njk.

Added FAQ message about Tor and/or VPNs being blocked.

Updated faq.njk and cookiepolicy.njk for updated option names.

Updated cookie settings for Cookie Consent in home.js.
Now it will only enable Secure cookie if on HTTPS protocol.
This should properly store the cookie in local installations.

Bumped v1 version string and rebuilt client assets.
2020-05-28 05:18:09 +07:00
Bobby Wibowo
36a41c9711
Added floating home button to auth page
Moved floating home button codes to views/_partial/floating-home.njk.

Added some variables support into some partial NJK files.

album.njk now uses partial versions for noscript codes.

A few other things.

Bumped v1 version string and rebuilt client assets.
2020-05-26 03:49:54 +07:00
Bobby Wibowo
64ab8e20b2
Updated auth page, amont other things
"Login or register" subtitle and Register button will no longer be shown
if enableUserAccounts are disabled in config.

Updated auth.js to continue working even when register and/or login
buttons cannot be found.

Added .is-wrappable support for .button elements.
This makes the text inside the buttons "wrappable" to next lines.
Do note that this will cause the buttons to get taller when they do need
to wrap their texts.

Updated "Log in to upload" button in homepage uploader use the new
.is-wrappable class.
Their texts will also now be split into two lines.
Anonymous upload warning specifically will now instead say
"Log in or register".

Bumped v1 version string and rebuilt client assets.
2020-05-26 03:04:26 +07:00
Bobby Wibowo
575a9353fa
Quick fix _globals.njk 2020-05-17 22:43:01 +07:00
Bobby Wibowo
e495d3efd3
Added home icon to album public pages
Updated dashboard.js: Uppercase ZIP in
Statistics > Albums > Zip Generated.

Bumped v1 version string and rebuilt client assets.
2020-05-17 04:54:06 +07:00
Bobby Wibowo
5e91554a52
Updated faq.njk
Added a message linking to Cookie Policy in FAQ.

Added id attribute to all h1 elements in FAQ.
These allow URL fragments if needed.
2020-05-17 03:56:37 +07:00
Bobby Wibowo
86b51fe5f5
Added Cookie Consent, among other things
This adds Cookie Consent library at public/libs/cookieconsent.

Added views/cookiepolicy.njk.

Added a new config option cookiePolicy. Disabled by default.

Updated views/faq.njk to use variables wherever applicable.
The variables are initiated at views/_globals.njk.
The said file also contains variables used at views/cookiepolicy.njk.

Restored messages about Cloudflare to FAQ.
They will be shown only if config.cloudflare.purgeCache is enabled.

Statistics will now capitalize first letters of the keys instead.

Updated background color of SweetAlert modals.

Moved table styling from dashboard.css to style.css (global),
since table will also be used in Cookie Policy page.

Bumped v1 version string and rebuilt client assets.
2020-05-17 03:35:54 +07:00
Bobby Wibowo
7b676bb9fd
Added retina/2x home logo
Rebuilt client assets and bumped v1 version string
2020-05-09 14:40:44 +07:00
Bobby Wibowo
ff54f088bd
Added client assets update detection
/api/check and /api/token/verify will now pass along v1 version string
if used (when config.cacheControl is used) for both home.js and
dashboard.js to use to compare version strings.
This should help notify users using browsers with a bit more overbearing
caching (generally mobile browsers).

Rebuilt client assets and bumped v1 version string

Slight update to yarn.lock (a small syntax change for node-gyp, idk why)
2020-04-30 05:56:28 +07:00
Bobby Wibowo
12516032e1
Updated disabled JS warning
Moved <style> tag from <noscript> tag into <head> tag.

Auto-redirect visitors with JS disabled to either No-JS uploader or
No-JS version of album pages after 3 seconds.

Those changes can be found in a new NJK file at the location below:
views/_partial/noscript-refresh.njk

Made the warning a lot more concise.
2020-04-24 01:18:25 +07:00
Bobby Wibowo
69af0549d5
Updated FAQ: Albums 2020-04-12 15:24:22 +07:00
Bobby Wibowo
2f0560ee1e
Updated FAQ
Removed extra margin from whitelist/blacklist extensions list
2020-04-12 15:22:07 +07:00
Bobby Wibowo
049b41f7ea
Improved FAQ page by a lot
Added categories
Added more questions (including link to my brand new Patreon)
Added a floating button to return to the homepage uploader
A bit of CSS prettifying (style.css)
2020-04-09 02:59:58 +07:00
Bobby Wibowo
589bf00dd9
Removed rel="noopener" attrib from local links 2020-04-07 01:50:15 +07:00
Bobby Wibowo
783ac81bf7
Updated
lolisafe.js: fixed a logic

faq.njk: fixed typo
2020-02-13 14:37:19 +07:00
Bobby Wibowo
5adbe84896
Updated FAQ to remove bits about Cloudflare 2020-02-11 17:30:03 +07:00
Bobby Wibowo
5ff512bc7f
Updated FAQ 2019-12-05 03:19:23 +07:00
Bobby Wibowo
9d12fc7701
Added a new TODO entry and updated FAQ 2019-12-02 03:10:23 +07:00
Bobby Wibowo
a8c702065f
Implemented descriptive upload progress
Say goodbye to upload progress bar 👋

Bumped v1 version string
2019-11-26 21:58:10 +07:00
Bobby Wibowo
37266fb05b
Fixed chunk size message in FAQ
Updated background color of code HTML tag.

Bumped v1 version string.
2019-10-11 12:53:11 +07:00
Bobby Wibowo
7855801d62
Updated
Rewritten codes for home uploader config.
All options are now defined in a single config object in home.js.
Config tab content will be dynamically generated through that config.
This should eliminate the need of modifying home.njk whenever a new
option needs to be added,
make the codes more readable, and easier to extend.

Upgrade stylelint dev dependency.

Bumped v1 version string.
2019-10-11 12:36:59 +07:00
Bobby Wibowo
411d17e1fb
Updated
* Changed colorscheme to black (experimental).

* Fixed ClamAV failing to report names of dirty files.

* Removed built-in support for Google site verification (globals.njk).
Just use HTML verification with public directory,
or manually edit home.njk.

* Bumped v1 version string.
2019-10-06 05:20:59 +07:00
Bobby Wibowo
6a934627a2
Added loader icon on dashboard
It will be shown when token is still being verified.

Moved loader icon section from auth.njk to _partial/loader.njk,
which will also be included into dashboard.njk.

Bumped v1 version string.
2019-09-21 11:50:49 +07:00
Bobby Wibowo
6803eb0812
Updated todo.md and nojs.njk
Added another todo entry.

Added required attribute to input file in No-JS uploader. This should
prevent submission when clicking Upload button before selecting any
files.

Removed built-in "safe" filter from some fields in nojs.njk, cause they
were unnecessary.
2019-09-20 01:25:01 +07:00
Bobby Wibowo
8f809e6cd5
Updated _layout.njk
Use "summary_large_image" type for Twitter Cards.
2019-09-19 20:54:27 +07:00
Bobby Wibowo
8ab77a6464
Updated
Removed version strings from _globals.njk,
in favor of src/versions.json.
That versions in that file can be bumped with "yarn bump-versions".
v1 is automatically bumped when doing "yarn build" as well.

Added README file in src directory, explaining versions.json file.

Added README file in scripts directory, detailing usage of each scripts.

Version strings will no longer be appended when cacheControl is disabled
in config file.
After all, version strings are only needed when the static assets are
cached indefinitely in users' browsers.

Initial Cloudflare's cache purging will no longer be executed when
cloudflare -> purgeCache is disabled, even if cacheControl is enabled.
Just in case someone wants to use version strings for other use cases.

Actually use custom metaDesc variable on meta description tag.
2019-09-19 19:10:37 +07:00
Bobby Wibowo
386787c6ce
Updated
Description in album public pages will no longer use h2 tag.
Descriptions that can go up to 4000 chars kinda made no sense to use
that tag.

Use Nunjucks' built-in nl2br tag to replace newlines with <br> tag.

Removed unused macro from faq.njk.

Better extensions filter list in URL uploads tab.

Updated config.sample.js with sample usage of the URL uploads extensions
filter.
2019-09-19 15:30:00 +07:00
Bobby Wibowo
1ff1a4463c
Make original names selectable in nojs uploader 2019-09-19 14:33:50 +07:00
Bobby Wibowo
6c4a99f2e9
Bumped v2 version string
Forgot this was necessary when updating fb_share.png
2019-09-19 14:27:13 +07:00
Bobby Wibowo
6e27115f38
Enforce pass min/max lengths in dashboard 2019-09-19 14:23:48 +07:00
Bobby Wibowo
c3d61733af
Updated
Added iamdustan/smoothscroll polyfill in dashboard pages.
This will polyfill smooth scroll (when executed programmatically)
for older browers.

No-JS uploader's notice button when on private mode will now also say
"Log in to upload", although auth page will still require JS.

All front-end buttons will now use outlined version. I'm lovin' it.

Auth page will now show a loading spinner if the user has a saved token.
Afterwards, they will still be redirected to dashboard.

Better error handlers in home, dashboard, and auth pages.

Removed <hr> from uploads & users lists in dashboard.

"Manage your token" menu will no longer try to make an API request prior
to displaying its page.
Reloading the page will already trigger token verification anyway.

Updated public/images/fb_share.png.

Updated README.md.

A few other tweaks.
2019-09-19 14:19:11 +07:00
Bobby Wibowo
c3d4bc766e
Updated album.njk 2019-09-19 08:30:02 +07:00
Bobby Wibowo
ea37e0b7d3
Updated
Reduced album title max length from 280 to 70.
Existing albums with longer titles will have their titles truncated in
their public pages, but the original titles will still remain in db.

"Load images for preview" will now properly display its saved value.

Increased max parallel uploads to 10.

"yarn develop" will now also restart safe if some Nunjuck templates are
edited (_globals.njk, _layout.njk, and album.njk).

Better meta tags generation.

Bumped v1 version string.
2019-09-19 08:27:19 +07:00
Bobby Wibowo
e6d4d96693
Fixed URLs uploader being disabled & updated todo
etc.
2019-09-17 12:14:25 +07:00
Bobby Wibowo
9e9b0d4439
Updated
Updated some dev dependencies.

---

Gulp will now build CSS/JS files during development into dist-dev
directory, to prevent IDE's Git from unnecessarily building diff's.

Added dist-dev to ignore files.

---

The entire config fille will now be passed to Nunjuck templates for ease
of access of config values.

Root domain for use in Nunjuck templates will now be parsed from config.

Better page titles.

Updated help message for "Uploads history order" option in
homepage's config tab.

Added "Load images for preview" option to homepage's config tab.
Setting this to false will now prevent image uploads from loading
themselves for previews.

Uploads' original names in homepage's uploads history are now
selectable.

Min/max length for user/pass are now enforced in auth's front-end.

Improved performance of album public pages.
Their generated HTML pages will now be cached into memory.
Unfortunately, No-JS version of their pages will be cached separately,
so each album may take up to double the memory space.

File names in thumbnails no longer have their full URLs as tooltips.
I saw no point in that behavior.

Added video icons.
Homepage's uploads history will now display video icons for videos.

"View thumbnail" button in Dashboard is now renamed to "Show preview".
Their icons will also be changed depending on their file types.

Added max length for albums' title & description.
These will be enforced both in front-end and back-end.
Existing albums that have surpassed the limits will not be enforced.

A few other small improvements.
2019-09-17 11:13:41 +07:00
Bobby Wibowo
21f39dff9d
Updated
Updated axios to v0.18.1.
Also added its source map.

Updated lazyload to v12.0.0.
Also added its source map.

Added bulma's source map.

---

Moved fontello.css from public/libs/fontello to src/libs/fontello,
to make use of CSS builder.

Updated thumbnails styling to properly make sure the thumbnails are
displayed as 200x200 (their actual configured dimension).

Added fixes to some flexbox's bugs that affect IE 10/11.
The safe should display much better in those browsers now.

Show files' expiry dates in thumbs view.

Updated global error handlers in home.js.
I will do similar setup with dashboard.js in the future.
Just not now, I'm tired.

Only load renders after API request to /api/check has been initiated.

Used native lazyloading on album pages' nojs version.

Removed unnecessary is-expanded class.

Rephrased max upload size disclaimer in nojs uploader page.

Bumped v1 and v3 version strings.
2019-09-16 01:18:22 +07:00
Bobby Wibowo
4d308206c7
Updated
Added new option "Uploads history order" into homepage's config tab.
When set to "Newer files on top", this will use flex-direction CSS
property to reverse sort the uploads history.

Added new entires to todo.md.

Bumped v1 version string.
2019-09-15 14:20:55 +07:00
Bobby Wibowo
a362d63e25
Updated dashboard.js
Fixed table row when file is not in an album.

Sigh, I always miss something..
2019-09-15 13:39:03 +07:00
Bobby Wibowo
c9ba16e1d6
Updates (very important to read)
Client-side CSS & JS files will now be processed with Gulp.
Gulp tasks are configured in gulpfile.js file.

CSS files will be optimized with postcss-preset-env, which will
auto-add vendor prefixes and convert any parts necessary for browsers
compatibility.
Afterwards they will be minified with cssnano.

JS files will be optimized with bublé,
likewise for browsers compatibility.
Afterwards they will be minified with terser.

Unprocessed CSS & JS files will now be located at src directory, while
the processed results will be located at dist directory.

Due to bublé, the JS files should now be compatible up to IE 11
at the minimum.
Previously the safe would not work in IE 11 due to extensive usage of
template literals.
Due to that as well, JS files in src directory will now extensively use
arrow functions for my personal comfort (as they will be converted too).

The server will use the processed files at dist directory by default.
If you want to rebuild the files by your own, you can run "yarn build".
Gulp is a development dependency, so make sure you have installed all
development dependencies (e.i. NOT using "yarn install --production").

---

yarn lint -> gulp lint

yarn build -> gulp default

yarn watch -> gulp watch

yarn develop -> env NODE_ENV=development yarn watch

---

Fixed not being able to demote staff into normal users.

/api/token/verify will no longer respond with 401 HTTP error code,
unless an error occurred (which will be 500 HTTP error code).

Fixed /nojs route not displaying file's original name when a duplicate
is found on the server.

Removed is-breeze CSS class name, in favor of Bulma's is-info.

Removed custom styling from auth page, in favor of global styling.

Removed all usage of style HTML attribute in favor of CSS classes.

Renamed js/s/ to js/misc/.

Use loading spinners on dashboard's sidebar menus.

Disable all other sidebar menus when something is loading.

Changed title HTML attribute of disabled control buttons in
uploads & users list.

Hid checkboxes and WIP controls from users list.

Better error messages handling.
Especially homepage will now support CF's HTTP error codes.

Updated various icons.
Also, added fontello config file at public/libs/fontello/config.json.
This should let you edit them more easily with fontello.

Use Gatsby icon for my blog's link in homepage's footer.

A bunch of other improvements here & there.
2019-09-15 13:20:11 +07:00
Bobby Wibowo
10a464bc73
Updated
Moved authors info to AUTHORS file.

Updated Git urls in package.json file.

Added .stylelintrc.

Updated all CSS files to respect current Stylelint guidelines.

Updated dependency: knex.js.

Fixed notice message in no-js version of album public pages.

Bumped v1 version string.
2019-09-12 14:44:31 +07:00