2020-12-26 11:49:51 +00:00
/* global swal, axios, ClipboardJS, LazyLoad, bulmaCollapsible */
2018-01-23 20:06:30 +00:00
2019-01-03 04:49:56 +00:00
const lsKeys = {
2018-10-09 19:52:41 +00:00
token : 'token' ,
viewType : {
2019-01-03 04:49:56 +00:00
uploads : 'viewTypeUploads' ,
uploadsAll : 'viewTypeUploadsAll'
2018-10-09 19:52:41 +00:00
} ,
selected : {
2019-01-03 04:49:56 +00:00
uploads : 'selectedUploads' ,
uploadsAll : 'selectedUploadsAll' ,
2020-06-01 04:44:16 +00:00
albums : 'selectedAlbums' ,
albumsAll : 'selectedAlbumsAll' ,
2019-01-03 04:49:56 +00:00
users : 'selectedUsers'
2020-06-07 05:29:17 +00:00
} ,
originalNames : {
uploads : 'originalNames' ,
uploadsAll : 'originalNamesAll'
2019-09-02 10:24:04 +00:00
}
2018-10-09 19:52:41 +00:00
}
const page = {
2020-05-16 17:11:10 +00:00
// #dashboard
section : null ,
2018-04-29 12:47:24 +00:00
// #page
dom : null ,
// user token
2019-01-03 04:49:56 +00:00
token : localStorage [ lsKeys . token ] ,
2018-10-09 19:52:41 +00:00
// from api/tokens/verify
username : null ,
permissions : null ,
2019-09-10 16:31:27 +00:00
// sidebar menus
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 06:20:11 +00:00
menusContainer : null ,
2019-09-10 16:31:27 +00:00
menus : [ ] ,
2018-10-09 19:52:41 +00:00
currentView : null ,
views : {
2020-06-01 04:44:16 +00:00
// params of uploads view
2018-10-09 19:52:41 +00:00
uploads : {
2019-01-03 04:49:56 +00:00
type : localStorage [ lsKeys . viewType . uploads ] ,
2020-06-07 05:29:17 +00:00
originalNames : localStorage [ lsKeys . originalNames . uploads ] === '1' ,
2018-10-09 19:52:41 +00:00
album : null , // album's id
2020-06-01 04:44:16 +00:00
pageNum : null
2019-01-03 04:49:56 +00:00
} ,
2020-06-01 04:44:16 +00:00
// params of uploads view (all)
2019-01-03 04:49:56 +00:00
uploadsAll : {
type : localStorage [ lsKeys . viewType . uploadsAll ] ,
2020-06-07 05:29:17 +00:00
originalNames : localStorage [ lsKeys . originalNames . uploadsAll ] === '1' ,
2020-06-01 04:44:16 +00:00
filters : null ,
pageNum : null ,
all : true
} ,
// params of albums view
albums : {
filters : null ,
pageNum : null
} ,
// params of albums view (all)
albumsAll : {
filters : null ,
pageNum : null ,
2019-01-03 04:49:56 +00:00
all : true
2018-10-09 19:52:41 +00:00
} ,
2020-06-01 04:44:16 +00:00
// params of users view
2018-10-09 19:52:41 +00:00
users : {
2020-06-01 04:44:16 +00:00
filters : null ,
2018-10-09 19:52:41 +00:00
pageNum : null
}
} ,
2020-12-26 16:50:52 +00:00
prevPageNums : {
uploads : null ,
uploadsAll : null ,
albums : null ,
albumsAll : null ,
users : null
} ,
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
// ids of selected items (shared across pages and will be synced with localStorage)
2018-10-09 19:52:41 +00:00
selected : {
uploads : [ ] ,
2019-01-03 04:49:56 +00:00
uploadsAll : [ ] ,
2020-06-01 04:44:16 +00:00
albums : [ ] ,
albumsAll : [ ] ,
2018-10-09 19:52:41 +00:00
users : [ ]
} ,
2020-06-01 04:44:16 +00:00
checkboxes : [ ] ,
lastSelected : [ ] ,
2018-04-29 12:47:24 +00:00
2018-05-05 19:44:58 +00:00
// select album dom for dialogs/modals
2018-04-29 12:47:24 +00:00
selectAlbumContainer : null ,
2018-10-09 19:52:41 +00:00
// cache for dialogs/modals
2020-06-01 04:44:16 +00:00
cache : { } ,
2018-04-29 12:47:24 +00:00
clipboardJS : null ,
2018-10-08 18:54:16 +00:00
lazyLoad : null ,
2020-12-26 11:49:51 +00:00
albumsSidebarCollapse : null ,
albumsSidebarCollapsible : null ,
2018-10-08 18:54:16 +00:00
2020-11-03 14:17:57 +00:00
imageExts : [ '.gif' , '.jpeg' , '.jpg' , '.png' , '.svg' , '.tif' , '.tiff' , '.webp' ] ,
videoExts : [ '.3g2' , '.3gp' , '.asf' , '.avchd' , '.avi' , '.divx' , '.evo' , '.flv' , '.h264' , '.h265' , '.hevc' , '.m2p' , '.m2ts' , '.m4v' , '.mk3d' , '.mkv' , '.mov' , '.mp4' , '.mpeg' , '.mpg' , '.mxf' , '.ogg' , '.ogv' , '.ps' , '.qt' , '.rmvb' , '.ts' , '.vob' , '.webm' , '.wmv' ] ,
2020-11-03 15:51:29 +00:00
audioExts : [ '.flac' , '.mp3' , '.wav' , '.wma' ] ,
2018-10-18 13:26:40 +00:00
2020-05-16 17:11:10 +00:00
isSomethingLoading : false ,
2019-09-17 04:13:41 +00:00
fadingIn : null ,
2019-09-19 01:27:19 +00:00
albumTitleMaxLength : 70 ,
2019-09-17 04:13:41 +00:00
albumDescMaxLength : 4000
2018-03-28 11:36:28 +00:00
}
2018-01-23 20:06:30 +00:00
2019-09-21 04:50:49 +00:00
page . unhide = ( ) => {
document . querySelector ( '#loader' ) . classList . add ( 'is-hidden' )
2020-05-16 17:11:10 +00:00
page . section . classList . remove ( 'is-hidden' )
2019-09-21 04:50:49 +00:00
}
2019-09-19 07:19:11 +00:00
// Handler for regular JS errors
page . onError = error => {
console . error ( error )
const content = document . createElement ( 'div' )
2020-11-04 04:26:22 +00:00
content . innerHTML = `
< p > < code > $ { error . toString ( ) } < / c o d e > < / p >
< p > Please check your console for more information . < / p >
`
2019-09-19 07:19:11 +00:00
return swal ( {
title : 'An error occurred!' ,
icon : 'error' ,
content
} )
}
// Handler for Axios errors
page . onAxiosError = error => {
console . error ( error )
// Better Cloudflare errors
const cloudflareErrors = {
520 : 'Unknown Error' ,
521 : 'Web Server Is Down' ,
522 : 'Connection Timed Out' ,
523 : 'Origin Is Unreachable' ,
524 : 'A Timeout Occurred' ,
525 : 'SSL Handshake Failed' ,
526 : 'Invalid SSL Certificate' ,
527 : 'Railgun Error' ,
530 : 'Origin DNS Error'
}
const statusText = cloudflareErrors [ error . response . status ] || error . response . statusText
const description = error . response . data && error . response . data . description
? error . response . data . description
2020-11-04 04:26:22 +00:00
: 'There was an error with the request.\nPlease check the console for more information.'
2019-09-19 07:19:11 +00:00
return swal ( ` ${ error . response . status } ${ statusText } ` , description , 'error' )
}
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 06:20:11 +00:00
page . preparePage = ( ) => {
2022-05-06 14:58:23 +00:00
if ( page . token ) page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
else window . location = 'auth'
2018-01-23 20:06:30 +00:00
}
2020-04-29 22:56:28 +00:00
page . checkClientVersion = apiVersion => {
const self = document . querySelector ( '#mainScript' )
const match = self . src . match ( /\?_=(\d+)$/ )
2020-10-30 18:12:09 +00:00
if ( match && match [ 1 ] && match [ 1 ] !== apiVersion ) {
2020-04-29 22:56:28 +00:00
return swal ( {
2020-08-22 19:22:03 +00:00
title : 'Update detected!' ,
2020-04-29 22:56:28 +00:00
text : 'Client assets have been updated. Reload to display the latest version?' ,
icon : 'info' ,
buttons : {
confirm : {
text : 'Reload' ,
closeModal : false
}
}
} ) . then ( ( ) => {
2020-05-25 19:39:28 +00:00
window . location . reload ( )
2020-04-29 22:56:28 +00:00
} )
2020-10-30 18:12:09 +00:00
}
2020-04-29 22:56:28 +00:00
}
2022-05-06 14:58:23 +00:00
page . verifyToken = token => {
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 06:20:11 +00:00
axios . post ( 'api/tokens/verify' , { token } ) . then ( response => {
2018-10-09 19:52:41 +00:00
axios . defaults . headers . common . token = token
2019-01-03 04:49:56 +00:00
localStorage [ lsKeys . token ] = token
2019-09-19 07:19:11 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . version ) {
2020-04-29 22:56:28 +00:00
page . checkClientVersion ( response . data . version )
2020-10-30 18:12:09 +00:00
}
2020-04-29 22:56:28 +00:00
2018-10-09 19:52:41 +00:00
page . token = token
page . username = response . data . username
page . permissions = response . data . permissions
page . prepareDashboard ( )
2022-05-06 14:58:23 +00:00
} ) . catch ( error => {
return swal ( {
title : 'An error occurred!' ,
text : error . response . data ? error . response . data . description : error . toString ( ) ,
icon : 'error'
} ) . then ( ( ) => {
if ( error . response . data && error . response . data . code === 10001 ) {
localStorage . removeItem ( lsKeys . token )
window . location = 'auth'
}
} )
} )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . prepareDashboard = ( ) => {
2020-05-16 17:11:10 +00:00
page . section = document . querySelector ( '#dashboard' )
page . dom = page . section . querySelector ( '#page' )
2019-09-10 16:31:27 +00:00
// Capture all click events
2018-09-04 15:49:37 +00:00
page . dom . addEventListener ( 'click' , page . domClick , true )
2019-09-10 16:31:27 +00:00
// Capture all submit events
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 06:20:11 +00:00
page . dom . addEventListener ( 'submit' , event => {
2019-09-10 16:31:27 +00:00
// Prevent default if necessary
2020-10-30 18:12:09 +00:00
if ( event . target && event . target . classList . contains ( 'prevent-default' ) ) {
2019-08-26 22:00:57 +00:00
return event . preventDefault ( )
2020-10-30 18:12:09 +00:00
}
2019-08-26 22:00:57 +00:00
} , true )
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 06:20:11 +00:00
page . menusContainer = document . querySelector ( '#menu' )
2019-09-10 16:31:27 +00:00
// All item menus in the sidebar
const itemMenus = [
{ selector : '#itemUploads' , onclick : page . getUploads } ,
{ selector : '#itemDeleteUploadsByNames' , onclick : page . deleteUploadsByNames } ,
2020-06-01 04:44:16 +00:00
{ selector : '#itemManageYourAlbums' , onclick : page . getAlbums } ,
2019-09-10 16:31:27 +00:00
{ selector : '#itemManageToken' , onclick : page . changeToken } ,
{ selector : '#itemChangePassword' , onclick : page . changePassword } ,
2019-09-19 07:19:11 +00:00
{ selector : '#itemLogout' , onclick : page . logout } ,
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 06:20:11 +00:00
{ selector : '#itemManageUploads' , onclick : page . getUploads , params : { all : true } , group : 'moderator' } ,
2020-06-01 04:44:16 +00:00
{ selector : '#itemManageAlbums' , onclick : page . getAlbums , params : { all : true } , group : 'moderator' } ,
2019-09-10 16:31:27 +00:00
{ selector : '#itemStatistics' , onclick : page . getStatistics , group : 'admin' } ,
{ selector : '#itemManageUsers' , onclick : page . getUsers , group : 'admin' }
]
for ( let i = 0 ; i < itemMenus . length ; i ++ ) {
// Skip item menu if not enough permission
2020-10-30 18:12:09 +00:00
if ( itemMenus [ i ] . group && ! page . permissions [ itemMenus [ i ] . group ] ) continue
2019-09-10 16:31:27 +00:00
// Add onclick event listener
const item = document . querySelector ( itemMenus [ i ] . selector )
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 06:20:11 +00:00
item . addEventListener ( 'click' , event => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2019-09-19 07:19:11 +00:00
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 06:20:11 +00:00
// eslint-disable-next-line compat/compat
2020-05-16 17:49:38 +00:00
itemMenus [ i ] . onclick . call ( null , Object . assign ( itemMenus [ i ] . params || { } , {
2020-12-26 16:50:52 +00:00
trigger : event . currentTarget ,
forceScroll : true
2020-05-16 17:49:38 +00:00
} ) )
2019-04-05 17:32:52 +00:00
} )
2019-09-10 16:31:27 +00:00
item . classList . remove ( 'is-hidden' )
page . menus . push ( item )
2018-10-09 19:52:41 +00:00
}
2019-09-10 16:31:27 +00:00
// If at least a moderator, show administration section
if ( page . permissions . moderator ) {
document . querySelector ( '#itemLabelAdmin' ) . classList . remove ( 'is-hidden' )
document . querySelector ( '#itemListAdmin' ) . classList . remove ( 'is-hidden' )
}
2018-01-23 20:06:30 +00:00
2019-09-10 16:31:27 +00:00
// Update text of logout button
document . querySelector ( '#itemLogout' ) . innerHTML = ` Logout ( ${ page . username } ) `
2018-01-23 20:06:30 +00:00
2019-09-10 16:31:27 +00:00
// Finally display dashboard
2019-09-21 04:50:49 +00:00
page . unhide ( )
2018-01-23 20:06:30 +00:00
2019-09-10 16:31:27 +00:00
// Load albums sidebar
2018-04-29 12:47:24 +00:00
page . getAlbumsSidebar ( )
2018-09-07 15:22:17 +00:00
2020-10-30 18:12:09 +00:00
if ( typeof page . prepareShareX === 'function' ) page . prepareShareX ( )
2018-01-23 20:06:30 +00:00
}
2019-09-19 07:19:11 +00:00
page . logout = params => {
page . updateTrigger ( params . trigger , 'active' )
2019-01-03 04:49:56 +00:00
localStorage . removeItem ( lsKeys . token )
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 06:20:11 +00:00
window . location = 'auth'
2018-01-23 20:06:30 +00:00
}
2020-05-16 17:11:10 +00:00
page . warnSomethingLoading = ( ) => {
swal ( 'Please wait!' , 'Something else is still loading\u2026' , 'warning' , {
buttons : false ,
timer : 3000
} )
}
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 06:20:11 +00:00
page . updateTrigger = ( trigger , newState ) => {
if ( ! trigger ) return
2020-04-19 18:52:41 +00:00
// Disable menus container and pagination when loading
if ( newState === 'loading' ) {
2020-05-16 17:11:10 +00:00
page . isSomethingLoading = true
page . section . classList . add ( 'is-loading' )
2020-04-19 18:52:41 +00:00
} else {
2020-05-16 17:11:10 +00:00
page . section . classList . remove ( 'is-loading' )
page . isSomethingLoading = false
2020-04-19 18:52:41 +00:00
}
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 06:20:11 +00:00
if ( newState === 'loading' ) {
trigger . classList . add ( 'is-loading' )
} else if ( newState === 'active' ) {
2020-10-01 21:34:44 +00:00
if ( trigger . parentNode . tagName === 'LI' && ! trigger . className . includes ( 'pagination-link' ) ) {
2020-10-30 18:12:09 +00:00
for ( let i = 0 ; i < page . menus . length ; i ++ ) {
2020-10-01 21:34:44 +00:00
page . menus [ i ] . classList . remove ( 'is-active' )
2020-10-30 18:12:09 +00:00
}
2020-10-01 21:34:44 +00:00
trigger . classList . add ( 'is-active' )
}
2020-10-02 16:52:15 +00:00
trigger . classList . remove ( 'is-loading' )
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 06:20:11 +00:00
} else {
trigger . classList . remove ( 'is-loading' )
trigger . classList . remove ( 'is-active' )
}
}
page . getItemID = element => {
2018-09-04 15:49:37 +00:00
// This expects the item's parent to have the item's ID
2018-10-09 19:52:41 +00:00
let parent = element . parentNode
2018-09-04 15:49:37 +00:00
// If the element is part of a set of controls, use the container's parent instead
2018-12-18 17:01:28 +00:00
if ( element . parentNode . classList . contains ( 'controls' ) ) parent = parent . parentNode
2018-09-04 15:49:37 +00:00
return parseInt ( parent . dataset . id )
}
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 06:20:11 +00:00
page . domClick = event => {
2019-06-03 19:40:24 +00:00
// We are processing clicks this way to avoid using "onclick" attribute
// Apparently we will need to use "unsafe-inline" for "script-src" directive
2019-06-04 00:57:37 +00:00
// of Content Security Policy (CSP), if we want to use "onclick" attribute
2019-06-03 19:40:24 +00:00
// Though I think that only applies to some browsers (?)
// Of course it wouldn't have mattered if we didn't use CSP to begin with
2019-08-26 22:00:57 +00:00
// Anyway, I personally would rather not use "onclick" attribute
2018-10-09 19:52:41 +00:00
let element = event . target
2018-12-18 17:01:28 +00:00
if ( ! element ) return
2018-09-04 15:49:37 +00:00
2019-09-08 01:56:29 +00:00
// Delegate click events to their A or BUTTON parents
2020-10-30 18:12:09 +00:00
if ( [ 'I' ] . includes ( element . tagName ) && [ 'SPAN' ] . includes ( element . parentNode . tagName ) ) {
2019-09-08 01:56:29 +00:00
element = element . parentNode
2020-10-30 18:12:09 +00:00
}
if ( [ 'SPAN' ] . includes ( element . tagName ) && [ 'A' , 'BUTTON' ] . includes ( element . parentNode . tagName ) ) {
2019-09-08 01:56:29 +00:00
element = element . parentNode
2020-10-30 18:12:09 +00:00
}
2018-09-04 15:49:37 +00:00
// Skip elements that have no action data
2018-12-18 17:01:28 +00:00
if ( ! element . dataset || ! element . dataset . action ) return
2018-09-04 15:49:37 +00:00
2019-01-01 19:39:08 +00:00
// Skip disabled elements
if ( element . hasAttribute ( 'disabled' ) ) return
2018-09-04 15:49:37 +00:00
event . stopPropagation ( ) // maybe necessary
2018-10-09 19:52:41 +00:00
const id = page . getItemID ( element )
const action = element . dataset . action
2018-09-04 15:49:37 +00:00
switch ( action ) {
2020-04-18 19:52:11 +00:00
// Uploads
2018-09-07 15:02:04 +00:00
case 'view-list' :
2018-10-09 19:52:41 +00:00
return page . setUploadsView ( 'list' , element )
2018-09-07 15:02:04 +00:00
case 'view-thumbs' :
2018-10-09 19:52:41 +00:00
return page . setUploadsView ( 'thumbs' , element )
2020-06-07 05:29:17 +00:00
case 'toggle-original-names' :
return page . toggleOriginalNames ( element )
2019-09-10 16:31:27 +00:00
case 'add-to-album' :
return page . addToAlbum ( id )
case 'delete-upload' :
return page . deleteUpload ( id )
2020-04-18 19:52:11 +00:00
case 'add-selected-uploads-to-album' :
return page . addSelectedUploadsToAlbum ( )
2019-09-10 16:31:27 +00:00
case 'bulk-delete-uploads' :
return page . bulkDeleteUploads ( )
2019-09-17 04:13:41 +00:00
case 'display-preview' :
return page . displayPreview ( id )
2020-04-18 19:52:11 +00:00
// Manage uploads
case 'upload-filters-help' :
return page . uploadFiltersHelp ( element )
case 'filter-uploads' :
return page . filterUploads ( element )
// Manage your albums
2018-09-07 15:02:04 +00:00
case 'submit-album' :
return page . submitAlbum ( element )
case 'edit-album' :
return page . editAlbum ( id )
2020-06-01 04:44:16 +00:00
case 'disable-album' :
return page . disableAlbum ( id )
2022-05-05 06:58:54 +00:00
case 'delete-album' :
return page . deleteAlbum ( id )
2020-06-01 04:44:16 +00:00
case 'view-album-uploads' :
return page . viewAlbumUploads ( id , element )
2020-04-18 19:52:11 +00:00
// Manage users
2020-04-17 07:25:18 +00:00
case 'create-user' :
return page . createUser ( )
2018-10-09 19:52:41 +00:00
case 'edit-user' :
return page . editUser ( id )
2019-01-01 19:39:08 +00:00
case 'disable-user' :
return page . disableUser ( id )
2019-10-06 23:11:07 +00:00
case 'delete-user' :
return page . deleteUser ( id )
2019-01-03 04:49:56 +00:00
case 'view-user-uploads' :
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 06:20:11 +00:00
return page . viewUserUploads ( id , element )
2020-04-18 19:52:11 +00:00
// Others
case 'get-new-token' :
return page . getNewToken ( element )
// Uploads & Users
case 'clear-selection' :
return page . clearSelection ( )
case 'select' :
return page . select ( element , event )
case 'select-all' :
return page . selectAll ( element )
2019-08-26 22:23:54 +00:00
case 'page-ellipsis' :
2020-05-02 15:09:51 +00:00
return page . focusJumpToPage ( element )
2019-01-03 04:49:56 +00:00
case 'page-prev' :
case 'page-next' :
case 'page-goto' :
case 'jump-to-page' :
return page . switchPage ( action , element )
2018-09-04 15:49:37 +00:00
}
}
2020-12-26 16:50:52 +00:00
page . fadeInDom = disableFading => {
2018-12-04 11:58:53 +00:00
if ( page . fadingIn ) {
clearTimeout ( page . fadingIn )
page . dom . classList . remove ( 'fade-in' )
}
2019-09-19 07:19:11 +00:00
2019-11-13 06:21:36 +00:00
if ( ! disableFading ) {
page . dom . classList . add ( 'fade-in' )
page . fadingIn = setTimeout ( ( ) => {
page . dom . classList . remove ( 'fade-in' )
} , 500 )
}
2020-12-26 16:50:52 +00:00
}
2019-09-19 07:19:11 +00:00
2020-12-26 16:50:52 +00:00
page . scrollToDom = disableSmooth => {
2019-09-19 07:19:11 +00:00
page . dom . scrollIntoView ( {
2020-12-26 16:50:52 +00:00
behavior : disableSmooth ? 'auto' : 'smooth' ,
2019-09-19 07:19:11 +00:00
block : 'start' ,
inline : 'nearest'
} )
2018-12-04 11:58:53 +00:00
}
2020-06-01 04:44:16 +00:00
page . getByView = ( view , get ) => {
switch ( view ) {
case 'uploads' :
case 'uploadsAll' :
return {
type : 'uploads' ,
func : page . getUploads
} [ get ]
case 'albums' :
case 'albumsAll' :
return {
type : 'albums' ,
func : page . getAlbums
} [ get ]
case 'users' :
return {
type : 'users' ,
func : page . getUsers
} [ get ]
default :
return null
}
}
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 06:20:11 +00:00
page . switchPage = ( action , element ) => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-04-19 18:52:41 +00:00
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 06:20:11 +00:00
// eslint-disable-next-line compat/compat
2020-05-16 17:49:38 +00:00
const params = Object . assign ( page . views [ page . currentView ] , {
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 06:20:11 +00:00
trigger : element
2020-05-16 17:49:38 +00:00
} )
2019-11-13 06:21:36 +00:00
2020-06-01 04:44:16 +00:00
const func = page . getByView ( page . currentView , 'func' )
2019-11-13 06:21:36 +00:00
2019-01-03 04:49:56 +00:00
switch ( action ) {
case 'page-prev' :
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 06:20:11 +00:00
params . pageNum = page . views [ page . currentView ] . pageNum - 1
2020-10-30 18:12:09 +00:00
if ( params . pageNum < 0 ) {
2019-01-03 04:49:56 +00:00
return swal ( 'An error occurred!' , 'This is already the first page.' , 'error' )
2020-10-30 18:12:09 +00:00
}
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 06:20:11 +00:00
return func ( params )
2019-01-03 04:49:56 +00:00
case 'page-next' :
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 06:20:11 +00:00
params . pageNum = page . views [ page . currentView ] . pageNum + 1
return func ( params )
2019-01-03 04:49:56 +00:00
case 'page-goto' :
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 06:20:11 +00:00
params . pageNum = parseInt ( element . dataset . goto )
return func ( params )
2019-08-20 02:16:34 +00:00
case 'jump-to-page' : {
2020-05-02 15:09:51 +00:00
const jumpToPage = document . querySelector ( ` # ${ element . dataset . jumpid || 'jumpToPage' } ` )
2019-09-08 01:56:29 +00:00
if ( ! jumpToPage . checkValidity ( ) ) return
const parsed = parseInt ( jumpToPage . value )
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 06:20:11 +00:00
params . pageNum = isNaN ( parsed ) ? 0 : ( parsed - 1 )
if ( params . pageNum < 0 ) params . pageNum = 0
return func ( params )
2019-08-20 02:16:34 +00:00
}
2019-01-03 04:49:56 +00:00
}
}
2020-05-02 15:09:51 +00:00
page . focusJumpToPage = element => {
const jumpToPage = document . querySelector ( ` # ${ element . dataset . jumpid || 'jumpToPage' } ` )
if ( ! jumpToPage ) return
jumpToPage . focus ( )
jumpToPage . select ( )
2019-08-26 22:23:54 +00:00
}
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 06:20:11 +00:00
page . getUploads = ( params = { } ) => {
2020-10-30 18:12:09 +00:00
if ( params && params . all && ! page . permissions . moderator ) {
2020-05-02 19:39:24 +00:00
return swal ( 'An error occurred!' , 'You cannot do this!' , 'error' )
2020-10-30 18:12:09 +00:00
}
2018-05-06 14:14:57 +00:00
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'loading' )
2019-01-03 04:49:56 +00:00
2020-10-30 18:12:09 +00:00
if ( typeof params . pageNum !== 'number' || params . pageNum < 0 ) {
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 06:20:11 +00:00
params . pageNum = 0
2020-10-30 18:12:09 +00:00
}
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 06:20:11 +00:00
2021-01-27 17:06:05 +00:00
const url = typeof params . album !== 'undefined'
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 06:20:11 +00:00
? ` api/album/ ${ params . album } / ${ params . pageNum } `
: ` api/uploads/ ${ params . pageNum } `
2020-05-24 01:28:54 +00:00
const headers = { }
2020-10-30 18:12:09 +00:00
if ( params . all ) headers . all = '1'
2020-05-24 01:28:54 +00:00
if ( params . filters ) {
headers . filters = params . filters
// Send client timezone offset if properly using date: and/or :expiry filters
// Server will pretend client is on UTC if unset
2020-10-30 18:12:09 +00:00
if ( /(^|\s)(date|expiry):[\d"]/ . test ( params . filters ) ) {
2020-05-24 01:28:54 +00:00
headers . minoffset = new Date ( ) . getTimezoneOffset ( )
2020-10-30 18:12:09 +00:00
}
2020-05-24 01:28:54 +00:00
}
2020-04-18 19:52:11 +00:00
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 06:20:11 +00:00
axios . get ( url , { headers } ) . then ( response => {
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
2018-10-09 19:52:41 +00:00
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else {
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 06:20:11 +00:00
page . updateTrigger ( params . trigger )
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2018-09-04 15:49:37 +00:00
}
2020-10-30 18:12:09 +00:00
}
2018-09-04 15:49:37 +00:00
2019-10-07 03:34:10 +00:00
const pages = Math . ceil ( response . data . count / 25 )
2019-06-04 00:57:37 +00:00
const files = response . data . files
2020-06-09 19:06:43 +00:00
if ( params . pageNum && ( files . length === 0 ) ) {
page . updateTrigger ( params . trigger )
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 06:20:11 +00:00
if ( params . autoPage ) {
2019-10-07 03:34:10 +00:00
params . pageNum = pages - 1
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 06:20:11 +00:00
return page . getUploads ( params )
} else {
return swal ( 'An error occurred!' , ` There are no more uploads to populate page ${ params . pageNum + 1 } . ` , 'error' )
}
2020-06-09 19:06:43 +00:00
}
2018-10-09 19:52:41 +00:00
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 06:20:11 +00:00
page . currentView = params . all ? 'uploadsAll' : 'uploads'
2020-06-01 04:44:16 +00:00
page . cache = { }
2018-10-09 19:52:41 +00:00
2019-06-04 00:57:37 +00:00
const albums = response . data . albums
const users = response . data . users
const basedomain = response . data . basedomain
2020-06-01 04:44:16 +00:00
if ( params . pageNum < 0 ) params . pageNum = Math . max ( 0 , pages + params . pageNum )
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 06:20:11 +00:00
const pagination = page . paginate ( response . data . count , 25 , params . pageNum )
2018-10-09 19:52:41 +00:00
2020-05-02 19:39:24 +00:00
const filter = `
< div class = "column" >
< form class = "prevent-default" >
< div class = "field has-addons" >
< div class = "control is-expanded" >
2020-06-01 04:44:16 +00:00
< input id = "filters" class = "input is-small" type = "text" placeholder = "Filter uploads" value = "${page.escape(params.filters || '')}" >
2019-01-03 04:49:56 +00:00
< / d i v >
2020-05-02 19:39:24 +00:00
< div class = "control" >
2020-05-16 17:11:10 +00:00
< button type = "button" class = "button is-small is-primary is-outlined" title = "Help?" data - action = "upload-filters-help" $ { params . all ? ' data-all="true"' : '' } >
2020-05-02 19:39:24 +00:00
< span class = "icon" >
< i class = "icon-help-circled" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< div class = "control" >
< button type = "submit" class = "button is-small is-info is-outlined" title = "Filter uploads" data - action = "filter-uploads" >
< span class = "icon" >
< i class = "icon-filter" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< / d i v >
< / f o r m >
< / d i v >
`
2019-01-03 04:49:56 +00:00
const extraControls = `
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 06:20:11 +00:00
< div class = "columns" >
2019-01-03 04:49:56 +00:00
$ { filter }
< div class = "column is-one-quarter" >
2019-08-26 22:00:57 +00:00
< form class = "prevent-default" >
< div class = "field has-addons" >
< div class = "control is-expanded" >
2019-10-07 03:34:10 +00:00
< input id = "jumpToPage" class = "input is-small" type = "number" min = "1" max = "${pages}" value = "${params.pageNum + 1}" $ { pages === 1 ? ' disabled' : '' } >
2019-08-26 22:00:57 +00:00
< / d i v >
< div class = "control" >
2019-09-19 07:19:11 +00:00
< button type = "submit" class = "button is-small is-info is-outlined" title = "Jump to page" data - action = "jump-to-page" >
2019-08-26 22:00:57 +00:00
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-paper-plane" > < / i >
2019-08-26 22:00:57 +00:00
< / s p a n >
< / b u t t o n >
< / d i v >
2019-01-03 04:49:56 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< / f o r m >
2019-01-03 04:49:56 +00:00
< / d i v >
< / d i v >
`
2018-10-09 19:52:41 +00:00
const controls = `
< div class = "columns" >
2020-06-07 05:29:17 +00:00
< div class = "column exclusive-operations has-text-left" >
< a class = "button is-small is-primary is-outlined" title = "Toggle original names" data - action = "toggle-original-names" >
< span class = "icon" >
< i class = "icon-exchange" > < / i >
< / s p a n >
< span > Toggle original names < / s p a n >
< / a >
< / d i v >
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 06:20:11 +00:00
< div class = "column has-text-centered" >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-danger is-outlined" title = "List view" data - action = "view-list" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-th-list" > < / i >
< / s p a n >
< / a >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-danger is-outlined" title = "Thumbs view" data - action = "view-thumbs" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-th-large" > < / i >
< / s p a n >
< / a >
< / d i v >
2020-05-16 17:11:10 +00:00
< div class = "column bulk-operations has-text-right" >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-info is-outlined" title = "Clear selection" data - action = "clear-selection" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-cancel" > < / i >
< / s p a n >
< / a >
2020-10-30 15:54:02 +00:00
$ { params . all
? ''
: ` <a class="button is-small is-warning is-outlined" title="Bulk add to album" data-action="add-selected-uploads-to-album">
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-plus" > < / i >
< / s p a n >
< / a > ` }
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-danger is-outlined" title = "Bulk delete" data - action = "bulk-delete-uploads" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< span > Bulk delete < / s p a n >
< / a >
< / d i v >
< / d i v >
`
2020-05-02 15:09:51 +00:00
// Do some string replacements for bottom controls
const bottomFiltersId = 'bFilters'
const bottomJumpId = 'bJumpToPage'
const bottomExtraControls = extraControls
. replace ( /id="filters"/ , ` id=" ${ bottomFiltersId } " ` )
. replace ( /(data-action="filter-uploads")/ , ` $ 1 data-filtersid=" ${ bottomFiltersId } " ` )
. replace ( /id="jumpToPage"/ , ` id=" ${ bottomJumpId } " ` )
. replace ( /(data-action="jump-to-page")/g , ` $ 1 data-jumpid=" ${ bottomJumpId } " ` )
const bottomPagination = pagination
. replace ( /(data-action="page-ellipsis")/g , ` $ 1 data-jumpid=" ${ bottomJumpId } " ` )
2019-09-10 16:31:27 +00:00
// Whether there are any unselected items
let unselected = false
2019-06-04 00:57:37 +00:00
2020-06-07 05:29:17 +00:00
const showOriginalNames = page . views [ page . currentView ] . originalNames
2021-01-27 17:06:05 +00:00
const hasExpiryDateColumn = files . some ( file => typeof file . expirydate !== 'undefined' )
2019-09-08 01:56:29 +00:00
2019-06-04 00:57:37 +00:00
for ( let i = 0 ; i < files . length ; i ++ ) {
// Build full URLs
files [ i ] . file = ` ${ basedomain } / ${ files [ i ] . name } `
2020-10-30 18:12:09 +00:00
if ( files [ i ] . thumb ) {
2019-09-08 01:56:29 +00:00
files [ i ] . thumb = ` ${ basedomain } / ${ files [ i ] . thumb } `
2020-10-30 18:12:09 +00:00
}
2019-09-08 01:56:29 +00:00
2019-09-17 04:13:41 +00:00
// Determine types
2021-01-31 22:23:53 +00:00
const extname = files [ i ] . extname . toLowerCase ( )
2020-10-30 18:12:09 +00:00
if ( page . imageExts . includes ( extname ) ) {
2019-09-17 04:13:41 +00:00
files [ i ] . type = 'picture'
2020-10-30 18:12:09 +00:00
} else if ( page . videoExts . includes ( extname ) ) {
2019-09-17 04:13:41 +00:00
files [ i ] . type = 'video'
2020-11-03 14:17:57 +00:00
} else if ( page . audioExts . includes ( extname ) ) {
files [ i ] . type = 'audio'
2021-01-31 22:23:53 +00:00
} else {
files [ i ] . type = 'other'
2020-10-30 18:12:09 +00:00
}
2019-09-17 04:13:41 +00:00
2020-11-03 14:17:57 +00:00
files [ i ] . previewable = files [ i ] . thumb || files [ i ] . type === 'audio'
2019-06-04 00:57:37 +00:00
// Cache bare minimum data for thumbnails viewer
2020-06-01 04:44:16 +00:00
page . cache [ files [ i ] . id ] = {
2019-06-04 00:57:37 +00:00
name : files [ i ] . name ,
2020-06-07 05:29:17 +00:00
original : files [ i ] . original ,
2021-01-31 22:23:53 +00:00
extname : files [ i ] . extname ,
2019-06-04 00:57:37 +00:00
thumb : files [ i ] . thumb ,
2020-06-07 05:29:17 +00:00
file : files [ i ] . file ,
2020-11-03 14:17:57 +00:00
type : files [ i ] . type ,
previewable : files [ i ] . previewable
2019-06-04 00:57:37 +00:00
}
2019-09-08 01:56:29 +00:00
2019-06-04 00:57:37 +00:00
// Prettify
files [ i ] . prettyBytes = page . getPrettyBytes ( parseInt ( files [ i ] . size ) )
files [ i ] . prettyDate = page . getPrettyDate ( new Date ( files [ i ] . timestamp * 1000 ) )
2019-09-08 01:56:29 +00:00
2020-10-30 18:12:09 +00:00
if ( hasExpiryDateColumn ) {
2019-09-08 01:56:29 +00:00
files [ i ] . prettyExpiryDate = files [ i ] . expirydate
? page . getPrettyDate ( new Date ( files [ i ] . expirydate * 1000 ) )
2019-09-15 18:18:22 +00:00
: null
2020-10-30 18:12:09 +00:00
}
2019-09-08 01:56:29 +00:00
2019-06-04 00:57:37 +00:00
// Update selected status
files [ i ] . selected = page . selected [ page . currentView ] . includes ( files [ i ] . id )
2019-09-10 16:31:27 +00:00
if ( ! files [ i ] . selected ) unselected = true
2019-09-08 01:56:29 +00:00
2019-06-04 00:57:37 +00:00
// Appendix (display album or user)
2020-10-30 18:12:09 +00:00
if ( params . all ) {
2019-09-08 01:56:29 +00:00
files [ i ] . appendix = files [ i ] . userid
? users [ files [ i ] . userid ] || ''
: ''
2021-01-27 17:06:05 +00:00
} else if ( typeof params . album === 'undefined' ) {
2019-09-08 01:56:29 +00:00
files [ i ] . appendix = files [ i ] . albumid
? albums [ files [ i ] . albumid ] || ''
: ''
2020-10-30 18:12:09 +00:00
}
2019-06-04 00:57:37 +00:00
}
2019-01-03 04:49:56 +00:00
if ( page . views [ page . currentView ] . type === 'thumbs' ) {
2018-10-09 19:52:41 +00:00
page . dom . innerHTML = `
$ { pagination }
2019-01-03 04:49:56 +00:00
$ { extraControls }
2018-10-09 19:52:41 +00:00
$ { controls }
< div id = "table" class = "columns is-multiline is-mobile is-centered" >
< / d i v >
2020-05-02 15:09:51 +00:00
$ { controls }
$ { bottomExtraControls }
$ { bottomPagination }
2018-10-09 19:52:41 +00:00
`
2019-08-20 02:16:34 +00:00
const table = document . querySelector ( '#table' )
2018-10-09 19:52:41 +00:00
2019-06-04 00:57:37 +00:00
for ( let i = 0 ; i < files . length ; i ++ ) {
const upload = files [ i ]
2018-10-09 19:52:41 +00:00
const div = document . createElement ( 'div' )
2019-09-17 04:13:41 +00:00
div . className = 'image-container column'
2018-10-09 19:52:41 +00:00
div . dataset . id = upload . id
2019-09-08 01:56:29 +00:00
2021-01-27 17:06:05 +00:00
if ( typeof upload . thumb !== 'undefined' ) {
2020-04-06 18:50:15 +00:00
div . innerHTML = ` <a class="image" href=" ${ upload . file } " target="_blank"><img alt=" ${ upload . name } " data-src=" ${ upload . thumb } "/></a> `
2020-10-30 18:12:09 +00:00
} else {
2020-04-06 18:50:15 +00:00
div . innerHTML = ` <a class="image" href=" ${ upload . file } " target="_blank"><h1 class="title"> ${ upload . extname || 'N/A' } </h1></a> `
2020-10-30 18:12:09 +00:00
}
2018-10-09 19:52:41 +00:00
div . innerHTML += `
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 06:20:11 +00:00
< input type = "checkbox" class = "checkbox" title = "Select" data - index = "${i}" data - action = "select" $ { upload . selected ? ' checked' : '' } >
2018-10-09 19:52:41 +00:00
< div class = "controls" >
2020-11-03 14:17:57 +00:00
$ { upload . previewable
2020-10-30 15:54:02 +00:00
? ` <a class="button is-small is-primary" title="Display preview" data-action="display-preview">
2018-10-18 13:26:40 +00:00
< span class = "icon" >
2019-09-17 04:13:41 +00:00
< i class = "${upload.type !== 'other' ? `icon-${upload.type}` : 'icon-doc-inv'}" > < / i >
2018-10-18 13:26:40 +00:00
< / s p a n >
2020-10-30 15:54:02 +00:00
< / a > `
: '' }
2018-10-09 19:52:41 +00:00
< a class = "button is-small is-info clipboard-js" title = "Copy link to clipboard" data - clipboard - text = "${upload.file}" >
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-clipboard" > < / i >
2018-10-09 19:52:41 +00:00
< / s p a n >
< / a >
< a class = "button is-small is-warning" title = "Add to album" data - action = "add-to-album" >
< span class = "icon" >
< i class = "icon-plus" > < / i >
< / s p a n >
< / a >
2019-09-10 16:31:27 +00:00
< a class = "button is-small is-danger" title = "Delete" data - action = "delete-upload" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< / a >
< / d i v >
< div class = "details" >
2020-06-07 05:29:17 +00:00
< p class = "name" title = "${upload.file}" > $ { upload . name } < / p >
$ { showOriginalNames ? ` <p class="originalname" title=" ${ upload . original } "> ${ upload . original } </p> ` : '' }
2022-05-06 13:48:24 +00:00
< p class = "prettybytes" data - bytes = "${upload.size}" > $ { upload . appendix ? ` <span> ${ upload . appendix } </span> – ` : '' } $ { upload . prettyBytes } < / p >
2020-10-30 15:54:02 +00:00
$ { hasExpiryDateColumn && upload . prettyExpiryDate
2022-05-06 13:48:24 +00:00
? ` <p class="prettyexpirydate" ${ upload . expirydate ? ` data-timestamp=" ${ upload . expirydate } " ` : '' } >EXP: ${ upload . prettyExpiryDate } </p> `
2020-10-30 15:54:02 +00:00
: '' }
2018-10-09 19:52:41 +00:00
< / d i v >
`
table . appendChild ( div )
2020-06-01 04:44:16 +00:00
page . checkboxes = table . querySelectorAll ( '.checkbox[data-action="select"]' )
2018-07-14 03:42:18 +00:00
}
2018-10-09 19:52:41 +00:00
} else {
2020-05-02 20:30:50 +00:00
const allAlbums = params . all && params . filters && params . filters . includes ( 'albumid:' )
2018-10-09 19:52:41 +00:00
page . dom . innerHTML = `
$ { pagination }
2019-01-03 04:49:56 +00:00
$ { extraControls }
2018-10-09 19:52:41 +00:00
$ { controls }
2020-07-28 14:47:48 +00:00
< div class = "table-container has-text-left" >
2018-10-09 19:52:41 +00:00
< table class = "table is-narrow is-fullwidth is-hoverable" >
< thead >
< tr >
2020-06-07 05:29:17 +00:00
< th class = "controls" > < input id = "selectAll" class = "checkbox" type = "checkbox" title = "Select all" data - action = "select-all" > < / t h >
2020-05-16 17:33:23 +00:00
< th title = "Key: name" > File name < / t h >
2020-06-07 05:29:17 +00:00
$ { showOriginalNames ? '<th title="Key: original">Original name</th>' : '' }
2021-01-27 17:06:05 +00:00
$ { typeof params . album === 'undefined' ? ` <th title="Key: ${ params . all ? 'userid">User' : 'albumid">Album' } </th> ` : '' }
2020-05-16 17:33:23 +00:00
$ { allAlbums ? '<th title="Key: albumid">Album</th>' : '' }
< th title = "Key: size" > Size < / t h >
$ { params . all ? '<th title="Key: ip">IP</th>' : '' }
< th title = "Key: timestamp" > Upload date < / t h >
$ { hasExpiryDateColumn ? '<th title="Key: expirydate">Expiry date</th>' : '' }
2020-12-26 12:54:41 +00:00
< th class = "has-text-right" > ( $ { response . data . count } total ) < / t h >
2018-10-09 19:52:41 +00:00
< / t r >
< / t h e a d >
< tbody id = "table" >
< / t b o d y >
< / t a b l e >
< / d i v >
2020-05-02 15:09:51 +00:00
$ { controls }
$ { bottomExtraControls }
$ { bottomPagination }
2018-10-09 19:52:41 +00:00
`
2019-08-20 02:16:34 +00:00
const table = document . querySelector ( '#table' )
2018-10-09 19:52:41 +00:00
2019-06-04 00:57:37 +00:00
for ( let i = 0 ; i < files . length ; i ++ ) {
const upload = files [ i ]
2018-10-09 19:52:41 +00:00
const tr = document . createElement ( 'tr' )
tr . dataset . id = upload . id
tr . innerHTML = `
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 06:20:11 +00:00
< td class = "controls" > < input type = "checkbox" class = "checkbox" title = "Select" data - index = "${i}" data - action = "select" $ { upload . selected ? ' checked' : '' } > < / t d >
2020-06-07 05:29:17 +00:00
< th class = "name" > < a href = "${upload.file}" target = "_blank" title = "${upload.file}" > $ { upload . name } < / a > < / t h >
$ { showOriginalNames ? ` <th class="originalname" title=" ${ upload . original } "> ${ upload . original } </th> ` : '' }
2021-01-27 17:06:05 +00:00
$ { typeof params . album === 'undefined' ? ` <th class="appendix"> ${ upload . appendix } </th> ` : '' }
2020-06-07 05:29:17 +00:00
$ { allAlbums ? ` <th class="album"> ${ upload . albumid ? ( albums [ upload . albumid ] || '' ) : '' } </th> ` : '' }
2022-05-06 13:48:24 +00:00
< td class = "prettybytes" data - bytes = "${upload.size}" > $ { upload . prettyBytes } < / t d >
2020-06-07 05:29:17 +00:00
$ { params . all ? ` <td class="ip"> ${ upload . ip || '' } </td> ` : '' }
2022-05-06 13:48:24 +00:00
< td class = "prettydate" data - timestamp = "${upload.timestamp}" > $ { upload . prettyDate } < / t d >
$ { hasExpiryDateColumn ? ` <td class="prettyexpirydate" ${ upload . expirydate ? ` data-timestamp=" ${ upload . expirydate } " ` : '' } > ${ upload . prettyExpiryDate || '-' } </td> ` : '' }
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 06:20:11 +00:00
< td class = "controls has-text-right" >
2020-11-03 14:17:57 +00:00
< a class = "button is-small is-primary is-outlined" title = "${upload.previewable ? 'Display preview' : 'File can\'t be previewed'}" data - action = "display-preview" $ { upload . previewable ? '' : ' disabled' } >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
2019-09-17 04:13:41 +00:00
< i class = "${upload.type !== 'other' ? `icon-${upload.type}` : 'icon-doc-inv'}" > < / i >
2018-10-09 19:52:41 +00:00
< / s p a n >
< / a >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-info is-outlined clipboard-js" title = "Copy link to clipboard" data - clipboard - text = "${upload.file}" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-clipboard" > < / i >
2018-10-09 19:52:41 +00:00
< / s p a n >
< / a >
2020-10-30 15:54:02 +00:00
$ { params . all
? ''
: ` <a class="button is-small is-warning is-outlined" title="Add to album" data-action="add-to-album">
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-plus" > < / i >
< / s p a n >
< / a > ` }
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-danger is-outlined" title = "Delete" data - action = "delete-upload" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< / a >
< / t d >
`
table . appendChild ( tr )
2020-06-01 04:44:16 +00:00
page . checkboxes = table . querySelectorAll ( '.checkbox[data-action="select"]' )
2018-07-14 03:42:18 +00:00
}
2018-10-09 19:52:41 +00:00
}
2018-04-28 23:44:25 +00:00
2019-09-10 16:31:27 +00:00
const selectAll = document . querySelector ( '#selectAll' )
2019-09-23 08:09:15 +00:00
if ( selectAll && ! unselected && files . length ) {
2019-09-10 16:31:27 +00:00
selectAll . checked = true
selectAll . title = 'Unselect all'
2018-10-09 19:52:41 +00:00
}
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
const pageNum = files . length ? params . pageNum : 0
if ( params . forceScroll ||
page . prevPageNums [ page . currentView ] === null ||
page . prevPageNums [ page . currentView ] !== pageNum ) {
const disableSmooth = ! params . forceScroll && page . views [ page . currentView ] . type === 'thumbs'
page . scrollToDom ( disableSmooth )
}
2019-11-13 06:21:36 +00:00
if ( page . views [ page . currentView ] . type === 'thumbs' ) {
page . lazyLoad . update ( )
}
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
2020-12-26 16:50:52 +00:00
if ( page . currentView === 'uploads' ) {
page . views . uploads . album = params . album
}
2020-07-19 11:26:44 +00:00
page . views [ page . currentView ] . filters = params . filters
2020-12-26 16:50:52 +00:00
page . views [ page . currentView ] . pageNum = page . prevPageNums [ page . currentView ] = pageNum
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 06:20:11 +00:00
} ) . catch ( error => {
page . updateTrigger ( params . trigger )
2019-09-19 07:19:11 +00:00
page . onAxiosError ( error )
2018-10-09 19:52:41 +00:00
} )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . setUploadsView = ( view , element ) => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
2020-06-01 04:44:16 +00:00
if ( view === 'list' ) {
delete localStorage [ lsKeys . viewType [ page . currentView ] ]
page . views [ page . currentView ] . type = undefined
} else {
localStorage [ lsKeys . viewType [ page . currentView ] ] = view
page . views [ page . currentView ] . type = view
}
2019-10-06 23:11:07 +00:00
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 06:20:11 +00:00
// eslint-disable-next-line compat/compat
2020-05-16 17:49:38 +00:00
page . getUploads ( Object . assign ( page . views [ page . currentView ] , {
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 06:20:11 +00:00
trigger : element
2020-05-16 17:49:38 +00:00
} ) )
2018-01-23 20:06:30 +00:00
}
2020-06-07 05:29:17 +00:00
page . toggleOriginalNames = element => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-06-07 05:29:17 +00:00
if ( page . views [ page . currentView ] . originalNames ) {
delete localStorage [ lsKeys . originalNames [ page . currentView ] ]
page . views [ page . currentView ] . originalNames = false
} else {
localStorage [ lsKeys . originalNames [ page . currentView ] ] = '1'
page . views [ page . currentView ] . originalNames = true
}
// eslint-disable-next-line compat/compat
page . getUploads ( Object . assign ( page . views [ page . currentView ] , {
trigger : element
} ) )
}
2019-09-17 04:13:41 +00:00
page . displayPreview = id => {
2020-06-01 04:44:16 +00:00
const file = page . cache [ id ]
2020-11-03 14:17:57 +00:00
if ( ! file . previewable ) return
2018-10-18 13:26:40 +00:00
const div = document . createElement ( 'div' )
div . innerHTML = `
2020-06-07 05:29:17 +00:00
< div class = "content has-text-centered" >
< p >
< div class = "has-text-weight-bold" > $ { file . name } < / d i v >
< div > $ { file . original } < / d i v >
< / p >
2020-11-03 14:17:57 +00:00
$ { file . thumb
? ` <p class="swal-display-thumb-container">
2018-10-18 13:26:40 +00:00
< img id = "swalThumb" src = "${file.thumb}" >
2020-11-03 14:17:57 +00:00
< / p > `
: '' }
2018-10-18 13:26:40 +00:00
< / d i v >
`
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 06:20:11 +00:00
2021-01-31 22:23:53 +00:00
if ( file . file && [ 'picture' , 'video' , 'audio' ] . includes ( file . type ) ) {
div . innerHTML += `
< div class = "field has-text-centered" >
< div class = "controls" >
< a id = "swalOriginal" type = "button" class = "button is-info" >
< span class = "icon" >
< i class = "icon-${file.type}" > < / i >
< / s p a n >
< span > $ { file . type === 'picture' ? 'Load original' : 'Play in embedded player' } < / s p a n >
< / a >
2018-10-18 13:26:40 +00:00
< / d i v >
2021-01-31 22:23:53 +00:00
< / d i v >
`
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 06:20:11 +00:00
2021-01-31 22:23:53 +00:00
if ( file . type === 'picture' ) {
div . querySelector ( '#swalOriginal' ) . addEventListener ( 'click' , event => {
const trigger = event . currentTarget
if ( trigger . classList . contains ( 'is-danger' ) ) return
trigger . classList . add ( 'is-loading' )
const thumb = div . querySelector ( '#swalThumb' )
thumb . src = file . file
thumb . onload = ( ) => {
trigger . classList . add ( 'is-hidden' )
document . body . querySelector ( '.swal-overlay .swal-modal:not(.is-expanded)' ) . classList . add ( 'is-expanded' )
2018-10-19 15:10:30 +00:00
}
2021-01-31 22:23:53 +00:00
thumb . onerror = event => {
event . currentTarget . classList . add ( 'is-hidden' )
trigger . className = 'button is-danger is-fullwidth'
trigger . innerHTML = `
< span class = "icon" >
< i class = "icon-block" > < / i >
< / s p a n >
< span > Unable to load original < / s p a n >
`
}
} )
} else {
const match = file . file . match ( /.*\/(.*)$/ )
if ( match || match [ 1 ] ) {
div . querySelector ( '#swalOriginal' ) . setAttribute ( 'href' , ` v/ ${ match [ 1 ] } ` )
div . querySelector ( '#swalOriginal' ) . setAttribute ( 'target' , '_blank' )
2020-11-03 13:56:32 +00:00
}
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 06:20:11 +00:00
}
2018-10-18 13:26:40 +00:00
}
2018-07-14 03:42:18 +00:00
return swal ( {
2018-10-18 13:26:40 +00:00
content : div ,
buttons : false
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 06:20:11 +00:00
} ) . then ( ( ) => {
2018-10-19 14:57:15 +00:00
// Restore modal size
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 06:20:11 +00:00
document . body . querySelector ( '.swal-overlay .swal-modal' ) . classList . remove ( 'is-expanded' )
2018-05-01 14:41:25 +00:00
} )
2018-03-29 23:22:08 +00:00
}
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 06:20:11 +00:00
page . selectAll = element => {
2020-06-01 04:44:16 +00:00
for ( let i = 0 ; i < page . checkboxes . length ; i ++ ) {
const id = page . getItemID ( page . checkboxes [ i ] )
2018-12-18 17:01:28 +00:00
if ( isNaN ( id ) ) continue
2020-06-01 04:44:16 +00:00
if ( page . checkboxes [ i ] . checked !== element . checked ) {
page . checkboxes [ i ] . checked = element . checked
2020-10-30 18:12:09 +00:00
if ( page . checkboxes [ i ] . checked ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . push ( id )
2020-10-30 18:12:09 +00:00
} else {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . splice ( page . selected [ page . currentView ] . indexOf ( id ) , 1 )
2020-10-30 18:12:09 +00:00
}
2018-03-29 23:22:08 +00:00
}
}
2018-04-03 15:59:39 +00:00
2020-10-30 18:12:09 +00:00
if ( page . selected [ page . currentView ] . length ) {
2019-09-10 16:31:27 +00:00
localStorage [ lsKeys . selected [ page . currentView ] ] = JSON . stringify ( page . selected [ page . currentView ] )
2020-10-30 18:12:09 +00:00
} else {
2019-09-10 16:31:27 +00:00
delete localStorage [ lsKeys . selected [ page . currentView ] ]
2020-10-30 18:12:09 +00:00
}
2019-09-10 16:31:27 +00:00
element . title = element . checked ? 'Unselect all' : 'Select all'
2018-03-29 23:22:08 +00:00
}
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 06:20:11 +00:00
page . selectInBetween = ( element , lastElement ) => {
const thisIndex = parseInt ( element . dataset . index )
const lastIndex = parseInt ( lastElement . dataset . index )
2018-10-09 19:52:41 +00:00
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 06:20:11 +00:00
const distance = Math . abs ( thisIndex - lastIndex )
2020-10-30 18:12:09 +00:00
if ( distance < 2 ) return
2018-04-04 18:23:45 +00:00
2020-10-30 18:12:09 +00:00
for ( let i = 0 ; i < page . checkboxes . length ; i ++ ) {
2018-04-04 18:23:45 +00:00
if ( ( thisIndex > lastIndex && i > lastIndex && i < thisIndex ) ||
( thisIndex < lastIndex && i > thisIndex && i < lastIndex ) ) {
2019-09-10 16:31:27 +00:00
// Check or uncheck depending on the state of the initial checkbox
2020-06-01 04:44:16 +00:00
const checked = page . checkboxes [ i ] . checked = lastElement . checked
const id = page . getItemID ( page . checkboxes [ i ] )
2020-10-30 18:12:09 +00:00
if ( ! page . selected [ page . currentView ] . includes ( id ) && checked ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . push ( id )
2020-10-30 18:12:09 +00:00
} else if ( page . selected [ page . currentView ] . includes ( id ) && ! checked ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . splice ( page . selected [ page . currentView ] . indexOf ( id ) , 1 )
2020-10-30 18:12:09 +00:00
}
2018-04-04 18:23:45 +00:00
}
2020-10-30 18:12:09 +00:00
}
2018-04-04 18:23:45 +00:00
}
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 06:20:11 +00:00
page . select = ( element , event ) => {
2019-09-10 16:31:27 +00:00
const id = page . getItemID ( element )
if ( isNaN ( id ) ) return
2020-06-01 04:44:16 +00:00
if ( event . shiftKey && page . lastSelected ) {
page . selectInBetween ( element , page . lastSelected )
2019-09-10 16:31:27 +00:00
// Check or uncheck depending on the state of the initial checkbox
2020-06-01 04:44:16 +00:00
element . checked = page . lastSelected . checked
2019-09-10 16:31:27 +00:00
} else {
2020-06-01 04:44:16 +00:00
page . lastSelected = element
2019-09-10 16:31:27 +00:00
}
2018-04-04 18:23:45 +00:00
2020-10-30 18:12:09 +00:00
if ( ! page . selected [ page . currentView ] . includes ( id ) && element . checked ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . push ( id )
2020-10-30 18:12:09 +00:00
} else if ( page . selected [ page . currentView ] . includes ( id ) && ! element . checked ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . splice ( page . selected [ page . currentView ] . indexOf ( id ) , 1 )
2020-10-30 18:12:09 +00:00
}
2018-04-03 15:59:39 +00:00
2019-09-10 16:31:27 +00:00
// Update local storage
2020-10-30 18:12:09 +00:00
if ( page . selected [ page . currentView ] . length ) {
2019-09-10 16:31:27 +00:00
localStorage [ lsKeys . selected [ page . currentView ] ] = JSON . stringify ( page . selected [ page . currentView ] )
2020-10-30 18:12:09 +00:00
} else {
2019-09-10 16:31:27 +00:00
delete localStorage [ lsKeys . selected [ page . currentView ] ]
2020-10-30 18:12:09 +00:00
}
2018-03-29 23:22:08 +00:00
}
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 06:20:11 +00:00
page . clearSelection = ( ) => {
2019-01-05 22:53:08 +00:00
const selected = page . selected [ page . currentView ]
2020-06-01 04:44:16 +00:00
const type = page . getByView ( page . currentView , 'type' )
2018-10-09 19:52:41 +00:00
const count = selected . length
2020-10-30 18:12:09 +00:00
if ( ! count ) return swal ( 'An error occurred!' , ` You have not selected any ${ type } . ` , 'error' )
2018-04-03 15:59:39 +00:00
2019-01-03 04:49:56 +00:00
const suffix = count === 1 ? type . substring ( 0 , type . length - 1 ) : type
2018-07-14 03:42:18 +00:00
return swal ( {
2018-04-03 15:59:39 +00:00
title : 'Are you sure?' ,
2018-10-09 19:52:41 +00:00
text : ` You are going to unselect ${ count } ${ suffix } . ` ,
2018-04-03 15:59:39 +00:00
buttons : true
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 06:20:11 +00:00
} ) . then ( proceed => {
2018-12-18 17:01:28 +00:00
if ( ! proceed ) return
2018-04-03 15:59:39 +00:00
2020-06-01 04:44:16 +00:00
const checkboxes = page . checkboxes
2020-10-30 18:12:09 +00:00
for ( let i = 0 ; i < checkboxes . length ; i ++ ) {
if ( checkboxes [ i ] . checked ) {
2018-10-09 19:52:41 +00:00
checkboxes [ i ] . checked = false
2020-10-30 18:12:09 +00:00
}
}
2018-04-03 15:59:39 +00:00
2019-01-05 22:53:08 +00:00
page . selected [ page . currentView ] = [ ]
2019-09-08 01:56:29 +00:00
delete localStorage [ lsKeys . selected [ page . currentView ] ]
2018-04-03 15:59:39 +00:00
2019-08-20 02:16:34 +00:00
const selectAll = document . querySelector ( '#selectAll' )
2018-12-18 17:01:28 +00:00
if ( selectAll ) selectAll . checked = false
2018-04-03 15:59:39 +00:00
2018-10-09 19:52:41 +00:00
return swal ( 'Cleared selection!' , ` Unselected ${ count } ${ suffix } . ` , 'success' )
} )
2018-04-03 15:59:39 +00:00
}
2020-04-18 19:52:11 +00:00
page . uploadFiltersHelp = element => {
2020-05-02 19:39:24 +00:00
const all = Boolean ( element . dataset . all )
2019-06-17 19:34:15 +00:00
const content = document . createElement ( 'div' )
content . style = 'text-align: left'
2020-10-30 15:54:02 +00:00
content . innerHTML = ` ${ all
? ` There are 2 filter keys, namely <b>user</b> (username) and <b>ip</b>.
2020-04-18 19:52:11 +00:00
These keys can be specified more than once .
2020-04-19 18:19:20 +00:00
For usernames with whitespaces , wrap them with double quotes ( < code > " < / c o d e > ) .
Special cases such as uploads by non - registered users or have no IPs respectively , use < code > user : - < / c o d e > o r < c o d e > i p : - < / c o d e > .
2019-06-17 19:34:15 +00:00
2020-04-19 18:19:20 +00:00
To exclude certain users / ips while still listing every other uploads , add negation sign ( < code > - < / c o d e > ) b e f o r e t h e k e y s .
Negation sign can also be used to exclude the special cases mentioned above ( i . e . < code > - user : - < / c o d e > o r < c o d e > - i p : - < / c o d e > ) .
2020-05-02 20:30:50 +00:00
If you know the ID of a user ' s album , you can list its uploads with < b > albumid < / b > k e y .
2020-10-30 15:54:02 +00:00
Negation sign works for this key as well . `
: ` There is only 1 filter key, namely <b>albumid</b>.
2020-05-02 20:30:50 +00:00
This key can be specified more than once .
Special case such as uploads with no albums , use < code > albumid : - < / c o d e > .
To exclude certain albums while still listing every other uploads , add negation sign ( < code > - < / c o d e > ) b e f o r e t h e k e y s .
2020-10-30 15:54:02 +00:00
Negation sign can also be used to exclude the special case mentioned above ( i . e . < code > - albumid : - < / c o d e > ) . ` }
2020-04-18 19:52:11 +00:00
There are 2 range keys : < b > date < / b > ( u p l o a d d a t e ) a n d < b > e x p i r y < / b > ( e x p i r y d a t e ) .
2020-05-24 01:28:54 +00:00
Their format is : < code > "YYYY/MM/DD HH:MM:SS-YYYY/MM/DD HH:MM:SS" < / c o d e > ( " f r o m " d a t e a n d " t o " d a t e r e s p e c t i v e l y ) .
2020-05-02 19:39:24 +00:00
You may specify only one of the dates .
2020-05-24 01:28:54 +00:00
If "to" date is missing , 'now' will be used . If "from" date is missing , 'beginning of time' will be used .
2020-04-18 19:52:11 +00:00
If any of the subsequent date or time units are not specified , their first value will be used ( e . g . January for month , 1 for day , and so on ) .
If only time is specified , today ' s date will be used .
2020-05-24 01:28:54 +00:00
If you do not need to specify both date and time , you may omit the double quotes .
In conclusion , the following examples are all valid : < code > date : "2020/01/01 01:23-2018/01/01 06" < / c o d e > , < c o d e > e x p i r y : - 2 0 2 0 / 0 5 < / c o d e > , < c o d e > d a t e : 1 2 : 3 4 : 5 6 < / c o d e > .
2020-04-18 19:52:11 +00:00
These keys can only be specified once each .
2020-05-24 01:28:54 +00:00
< b > Timezone ? < / b > F e e l f r e e t o q u e r y t h e d a t e s w i t h y o u r o w n t i m e z o n e .
2020-04-19 18:19:20 +00:00
API requests to the filter endpoint will attach your browser ' s timezone offset , so the server will automatically calculate timezone differences .
Matches can also be sorted with < b > sort < / b > k e y s .
2020-05-02 21:32:45 +00:00
Their formats are : < code > sort : columnName [ : d [ escending ] ] < / c o d e > , w h e r e < c o d e > : d [ e s c e n d i n g ] < / c o d e > i s a n o p t i o n a l t a g t o s e t t h e d i r e c t i o n t o d e s c e n d i n g .
2020-05-02 19:39:24 +00:00
This key must be used with internal column names used in the database ( < code > id < / c o d e > , < c o d e > $ { a l l ? ' u s e r i d ' : ' a l b u m i d ' } < / c o d e > , a n d s o o n ) ,
2020-04-19 18:19:20 +00:00
but there are 2 shortcuts available : < b > date < / b > f o r < c o d e > t i m e s t a m p < / c o d e > c o l u m n a n d < b > e x p i r y < / b > f o r < c o d e > e x p i r y d a t e < / c o d e > c o l u m n .
2020-04-04 16:36:43 +00:00
This key can also be specified more than once , where their order will decide the sorting steps .
2019-06-17 19:34:15 +00:00
2020-05-02 21:32:45 +00:00
Finally , there are type - < b > is < / b > k e y s t o r e f i n e b y t y p e s .
2020-11-03 15:51:29 +00:00
You can use < code > is : image < / c o d e > , < c o d e > i s : v i d e o < / c o d e > , a n d < c o d e > i s : a u d i o < / c o d e > t o l i s t i m a g e s , v i d e o s , a u d i o s r e s p e c t i v e l y .
This will only use image , video and audio extensions that are whitelisted internally in the safe .
For images and videos specifically , they will be the ones whose thumbnails can be generated by the safe .
2020-05-02 21:32:45 +00:00
Negation sign works for this key as well .
Mixing inclusion and exclusion is not allowed ( i . e . < code > is : image - is : video < / c o d e > , s i n c e t h e s e c o n d k e y i s r e d u n d a n t ) .
2020-04-19 18:19:20 +00:00
Any leftover keywords which do not use keys ( non - keyed keywords ) will be matched against the matches ' file names .
2020-05-02 21:32:45 +00:00
Excluding certain keywords is also supported by adding negation sign before the keywords .
2020-04-18 19:52:11 +00:00
2020-05-02 19:39:24 +00:00
< b > Internal steps : < / b >
2020-10-30 15:54:02 +00:00
$ { all
? ` - Query uploads passing ALL exclusion filter keys OR matching ANY filter keys, if any.
- Refine matches `
: '- Filter uploads' } using date key , if any .
2020-05-02 19:39:24 +00:00
- Refine matches using expiry key , if any .
2020-05-02 21:37:12 +00:00
- Refine matches using type - is keys , if any .
2020-05-02 19:39:24 +00:00
- Refine matches using ANY non - keyed keywords , if any .
- Filter matches using ALL exclusion non - keyed keywords , if any .
- Sort matches using sorting keys , if any .
2020-04-04 16:36:43 +00:00
< b > Examples : < / b >
2020-10-30 15:54:02 +00:00
$ { all
? ` - Uploads from users named "demo" AND/OR "John Doe" AND/OR non-registered users:
2020-04-18 19:52:11 +00:00
< code > user : demo user : "John Doe" user : - < / c o d e >
2020-05-02 19:39:24 +00:00
- ALL uploads , but NOT the ones from user named "demo" AND "John Doe" :
2020-04-19 18:19:20 +00:00
< code > - user : demo - user : "John Doe" < / c o d e >
2020-05-02 19:39:24 +00:00
- Uploads from IP "127.0.0.1" AND which file names match "*.rar" OR "*.zip" :
2020-04-18 19:52:11 +00:00
< code > ip : 127.0 . 0.1 * . rar * . zip < / c o d e >
2020-10-30 15:54:02 +00:00
`
: '' } - Uploads without albums :
2020-05-02 20:30:50 +00:00
< code > albumid : - < / c o d e >
- ALL uploads , but NOT the ones from album with ID 69 :
< code > - albumid : 69 < / c o d e >
- Uploads uploaded since "1 June 2019 00:00:00" :
2020-04-18 19:52:11 +00:00
< code > date : 2019 / 06 < / c o d e >
2020-05-02 19:39:24 +00:00
- Uploads uploaded between "7 April 2020 12:00:00" and "7 April 2020 23:59:59" :
2020-05-24 01:28:54 +00:00
< code > date : "2020/04/07 12-2020/04/07 23:59:59" < / c o d e >
2020-05-02 19:39:24 +00:00
- Uploads uploaded before "5 February 2020 00:00:00" :
2020-04-19 18:19:20 +00:00
< code > date : - 2020 / 02 / 05 < / c o d e >
2020-05-02 19:39:24 +00:00
- Uploads which file names match "*.gz" but NOT "*.tar.gz" :
2020-04-18 19:52:11 +00:00
< code > * . gz - * . tar . gz < / c o d e >
2020-05-02 19:39:24 +00:00
- Sort matches by "size" column in ascending and descending order respectively :
< code > $ { all ? 'user:"John Doe"' : '*.txt' } sort : size < / c o d e >
< code > * . mp4 $ { all ? 'user:- ' : '' } sort : size : d < / c o d e >
2020-10-30 15:54:02 +00:00
$ { ! page . permissions . moderator
? '<b>Notice:</b> Regular users may face some limitations in the amount of keys that can be used at a time.'
: '' }
2020-04-18 19:52:11 +00:00
< b > Friendly reminder : < / b > T h i s w i n d o w c a n b e s c r o l l e d u p !
2020-05-02 19:39:24 +00:00
` .trim().replace(/^ \s */g, '').replace(/ \n /g, '<br>')
2020-04-18 19:52:11 +00:00
swal ( { content } ) . then ( ( ) => {
// Restore modal size
document . body . querySelector ( '.swal-overlay .swal-modal' ) . classList . remove ( 'is-expanded' )
} )
// Expand modal size
document . body . querySelector ( '.swal-overlay .swal-modal:not(.is-expanded)' ) . classList . add ( 'is-expanded' )
2019-06-17 19:34:15 +00:00
}
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 06:20:11 +00:00
page . filterUploads = element => {
2020-05-24 01:28:54 +00:00
const filters = document . querySelector ( ` # ${ element . dataset . filtersid || 'filters' } ` ) . value
. trim ( )
. replace ( /\t/g , ' ' )
. replace ( /(^|\s)((albumid|ip|user|date|expiry|is|sort|orderby):)\s+/g , '$2' )
2020-05-02 19:39:24 +00:00
// eslint-disable-next-line compat/compat
page . getUploads ( Object . assign ( page . views [ page . currentView ] , {
filters ,
2020-05-16 17:49:38 +00:00
pageNum : 0 ,
trigger : element
} ) )
2019-01-03 04:49:56 +00:00
}
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 06:20:11 +00:00
page . viewUserUploads = ( id , element ) => {
2020-06-01 04:44:16 +00:00
const user = page . cache [ id ]
2019-01-03 04:49:56 +00:00
if ( ! user ) return
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 06:20:11 +00:00
element . classList . add ( 'is-loading' )
2020-04-18 19:52:11 +00:00
// Wrap username in quotes if it contains whitespaces
const username = user . username . includes ( ' ' )
? ` " ${ user . username } " `
: user . username
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 06:20:11 +00:00
page . getUploads ( {
all : true ,
2020-04-18 19:52:11 +00:00
filters : ` user: ${ username } ` ,
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 06:20:11 +00:00
trigger : document . querySelector ( '#itemManageUploads' )
} )
2019-01-03 04:49:56 +00:00
}
2020-06-01 04:44:16 +00:00
page . viewAlbumUploads = ( id , element ) => {
if ( ! page . cache [ id ] ) return
element . classList . add ( 'is-loading' )
// eslint-disable-next-line compat/compat
const all = page . currentView === 'albumsAll' && page . permissions . moderator
page . getUploads ( {
all ,
filters : ` albumid: ${ id } ` ,
trigger : all
? document . querySelector ( '#itemManageUploads' )
: document . querySelector ( '#itemUploads' )
} )
}
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 06:20:11 +00:00
page . deleteUpload = id => {
2019-09-10 16:31:27 +00:00
page . postBulkDeleteUploads ( {
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 06:20:11 +00:00
all : page . currentView === 'uploadsAll' ,
2019-09-10 16:31:27 +00:00
field : 'id' ,
values : [ id ] ,
cb ( failed ) {
// Remove from remembered checkboxes if necessary
2020-10-30 18:12:09 +00:00
if ( ! failed . length && page . selected [ page . currentView ] . includes ( id ) ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] . splice ( page . selected [ page . currentView ] . indexOf ( id ) , 1 )
2020-10-30 18:12:09 +00:00
}
2019-09-10 16:31:27 +00:00
// Update local storage
2020-10-30 18:12:09 +00:00
if ( page . selected [ page . currentView ] . length ) {
2019-09-10 16:31:27 +00:00
localStorage [ lsKeys . selected [ page . currentView ] ] = JSON . stringify ( page . selected [ page . currentView ] )
2020-10-30 18:12:09 +00:00
} else {
2019-09-10 16:31:27 +00:00
delete localStorage [ lsKeys . selected [ page . currentView ] ]
2020-10-30 18:12:09 +00:00
}
2019-09-08 01:56:29 +00:00
2019-09-10 16:31:27 +00:00
// Reload upload list
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 06:20:11 +00:00
// eslint-disable-next-line compat/compat
2020-05-02 15:42:23 +00:00
page . getUploads ( Object . assign ( page . views [ page . currentView ] , {
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 06:20:11 +00:00
autoPage : true
2020-05-02 15:42:23 +00:00
} ) )
2019-09-10 16:31:27 +00:00
}
2018-10-09 19:52:41 +00:00
} )
2018-03-29 23:22:08 +00:00
}
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 06:20:11 +00:00
page . bulkDeleteUploads = ( ) => {
2019-01-03 04:49:56 +00:00
const count = page . selected [ page . currentView ] . length
2020-10-30 18:12:09 +00:00
if ( ! count ) return swal ( 'An error occurred!' , 'You have not selected any uploads.' , 'error' )
2018-03-29 23:22:08 +00:00
2019-09-10 16:31:27 +00:00
page . postBulkDeleteUploads ( {
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 06:20:11 +00:00
all : page . currentView === 'uploadsAll' ,
2019-09-10 16:31:27 +00:00
field : 'id' ,
values : page . selected [ page . currentView ] ,
cb ( failed ) {
// Update state of checkboxes
2020-10-30 18:12:09 +00:00
if ( failed . length ) {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] = page . selected [ page . currentView ]
2020-10-30 18:12:09 +00:00
. filter ( id => failed . includes ( id ) )
} else {
2019-09-10 16:31:27 +00:00
page . selected [ page . currentView ] = [ ]
2020-10-30 18:12:09 +00:00
}
2018-10-09 19:52:41 +00:00
2019-09-10 16:31:27 +00:00
// Update local storage
2020-10-30 18:12:09 +00:00
if ( page . selected [ page . currentView ] . length ) {
2019-09-08 01:56:29 +00:00
localStorage [ lsKeys . selected [ page . currentView ] ] = JSON . stringify ( page . selected [ page . currentView ] )
2020-10-30 18:12:09 +00:00
} else {
2019-09-08 01:56:29 +00:00
delete localStorage [ lsKeys . selected [ page . currentView ] ]
2020-10-30 18:12:09 +00:00
}
2018-10-09 19:52:41 +00:00
2019-09-10 16:31:27 +00:00
// Reload uploads list
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 06:20:11 +00:00
// eslint-disable-next-line compat/compat
2020-05-02 15:42:23 +00:00
page . getUploads ( Object . assign ( page . views [ page . currentView ] , {
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 06:20:11 +00:00
autoPage : true
2020-05-02 15:42:23 +00:00
} ) )
2019-09-10 16:31:27 +00:00
}
2018-10-09 19:52:41 +00:00
} )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . deleteUploadsByNames = ( params = { } ) => {
2019-06-03 19:40:24 +00:00
let appendix = ''
2020-10-30 18:12:09 +00:00
if ( page . permissions . moderator ) {
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 06:20:11 +00:00
appendix = '<br><b>Hint:</b> You can use this feature to delete uploads by other users.'
2020-10-30 18:12:09 +00:00
}
2019-06-03 19:40:24 +00:00
2018-10-09 19:52:41 +00:00
page . dom . innerHTML = `
2019-09-10 16:31:27 +00:00
< form class = "prevent-default" >
< div class = "field" >
< label class = "label" > Upload names : < / l a b e l >
< div class = "control" >
< textarea id = "bulkDeleteNames" class = "textarea" > < / t e x t a r e a >
< / d i v >
< p class = "help" > Separate each entry with a new line . $ { appendix } < / p >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-09-10 16:31:27 +00:00
< div class = "field" >
< div class = "control" >
2019-09-19 07:19:11 +00:00
< button type = "submit" id = "submitBulkDelete" class = "button is-danger is-outlined is-fullwidth" >
2019-09-10 16:31:27 +00:00
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< span > Bulk delete < / s p a n >
< / b u t t o n >
< / d i v >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-09-10 16:31:27 +00:00
< / f o r m >
2018-10-09 19:52:41 +00:00
`
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
page . scrollToDom ( )
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
2018-05-05 19:44:58 +00:00
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 06:20:11 +00:00
document . querySelector ( '#submitBulkDelete' ) . addEventListener ( 'click' , ( ) => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
2019-09-10 16:31:27 +00:00
const textArea = document . querySelector ( '#bulkDeleteNames' )
// Clean up
const seen = { }
const names = textArea . value
. split ( /\r?\n/ )
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 06:20:11 +00:00
. map ( name => {
2019-09-10 16:31:27 +00:00
const trimmed = name . trim ( )
return /^[^\s]+$/ . test ( trimmed )
? trimmed
: ''
} )
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 06:20:11 +00:00
. filter ( name => {
2019-09-10 16:31:27 +00:00
// Filter out invalid and duplicate names
return ( ! name || Object . prototype . hasOwnProperty . call ( seen , name ) )
? false
: ( seen [ name ] = true )
} )
// Update textarea with cleaned names
textArea . value = names . join ( '\n' )
2020-10-30 18:12:09 +00:00
if ( ! names . length ) {
2019-09-10 16:31:27 +00:00
return swal ( 'An error occurred!' , 'You have not entered any upload names.' , 'error' )
2020-10-30 18:12:09 +00:00
}
2019-09-10 16:31:27 +00:00
page . postBulkDeleteUploads ( {
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 06:20:11 +00:00
all : true ,
2019-09-10 16:31:27 +00:00
field : 'name' ,
values : names ,
cb ( failed ) {
textArea . value = failed . join ( '\n' )
}
2018-07-14 03:42:18 +00:00
} )
2019-09-10 16:31:27 +00:00
} )
}
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 06:20:11 +00:00
page . postBulkDeleteUploads = ( params = { } ) => {
const count = params . values . length
const objective = ` ${ params . values . length } upload ${ count === 1 ? '' : 's' } `
const boldObjective = objective . replace ( /^(\d*)(.*)/ , '<b>$1</b>$2' )
let text = ` <p>You won't be able to recover ${ boldObjective } !</p> `
if ( params . all ) {
const obj1 = count === 1 ? 'an upload' : 'some uploads'
const obj2 = count === 1 ? 'another user' : 'other users'
text += ` \n <p><b>Warning:</b> You may be nuking ${ obj1 } by ${ obj2 } !</p> `
}
const content = document . createElement ( 'div' )
content . innerHTML = text
2018-05-05 19:44:58 +00:00
2018-07-14 03:42:18 +00:00
swal ( {
2018-05-05 19:44:58 +00:00
title : 'Are you sure?' ,
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 06:20:11 +00:00
content ,
2018-05-05 19:44:58 +00:00
icon : 'warning' ,
dangerMode : true ,
buttons : {
cancel : true ,
confirm : {
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 06:20:11 +00:00
text : ` Yes, nuke ${ params . values . length === 1 ? 'it' : 'them' } ! ` ,
2018-05-05 19:44:58 +00:00
closeModal : false
}
}
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 06:20:11 +00:00
} ) . then ( proceed => {
2018-12-18 17:01:28 +00:00
if ( ! proceed ) return
2018-05-05 19:44:58 +00:00
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 06:20:11 +00:00
axios . post ( 'api/upload/bulkdelete' , {
2020-10-30 18:12:09 +00:00
field : params . field ,
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 06:20:11 +00:00
values : params . values
} ) . then ( response => {
2019-09-10 16:31:27 +00:00
if ( ! response ) return
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2018-10-09 19:52:41 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2019-09-10 16:31:27 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2018-10-09 19:52:41 +00:00
2019-09-10 16:31:27 +00:00
const failed = Array . isArray ( response . data . failed ) ? response . data . failed : [ ]
2020-10-30 18:12:09 +00:00
if ( failed . length === params . values . length ) {
2019-09-10 16:31:27 +00:00
swal ( 'An error occurred!' , ` Unable to delete any of the ${ objective } . ` , 'error' )
2020-10-30 18:12:09 +00:00
} else if ( failed . length && failed . length < params . values . length ) {
2019-09-10 16:31:27 +00:00
swal ( 'Warning!' , ` From ${ objective } , unable to delete ${ failed . length } of them. ` , 'warning' )
2020-10-30 18:12:09 +00:00
} else {
2019-10-29 12:39:44 +00:00
swal ( 'Deleted!' , ` ${ objective } ${ count === 1 ? 'has' : 'have' } been deleted. ` , 'success' , {
buttons : false ,
timer : 1500
} )
2020-10-30 18:12:09 +00:00
}
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( typeof params . cb === 'function' ) params . cb ( failed )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-10-09 19:52:41 +00:00
} )
2018-05-05 19:44:58 +00:00
}
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 06:20:11 +00:00
page . addSelectedUploadsToAlbum = ( ) => {
2020-10-30 18:12:09 +00:00
if ( page . currentView !== 'uploads' ) return
2019-01-03 04:49:56 +00:00
const count = page . selected [ page . currentView ] . length
2020-10-30 18:12:09 +00:00
if ( ! count ) return swal ( 'An error occurred!' , 'You have not selected any uploads.' , 'error' )
2018-03-30 02:39:53 +00:00
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 06:20:11 +00:00
page . addUploadsToAlbum ( page . selected [ page . currentView ] , failed => {
2018-12-18 17:01:28 +00:00
if ( ! failed ) return
2020-10-30 18:12:09 +00:00
if ( failed . length ) {
page . selected [ page . currentView ] = page . selected [ page . currentView ]
. filter ( id => failed . includes ( id ) )
} else {
2019-01-03 04:49:56 +00:00
page . selected [ page . currentView ] = [ ]
2020-10-30 18:12:09 +00:00
}
2018-12-18 17:01:28 +00:00
2019-01-05 22:53:08 +00:00
localStorage [ lsKeys . selected [ page . currentView ] ] = JSON . stringify ( page . selected [ page . currentView ] )
page . getUploads ( page . views [ page . currentView ] )
2018-07-14 03:42:18 +00:00
} )
2018-04-28 23:44:25 +00:00
}
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 06:20:11 +00:00
page . addToAlbum = id => {
page . addUploadsToAlbum ( [ id ] , failed => {
2018-12-18 17:01:28 +00:00
if ( ! failed ) return
2019-01-05 22:53:08 +00:00
page . getUploads ( page . views [ page . currentView ] )
2018-07-14 03:42:18 +00:00
} )
2018-03-30 02:39:53 +00:00
}
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 06:20:11 +00:00
page . addUploadsToAlbum = ( ids , callback ) => {
2018-10-09 19:52:41 +00:00
const count = ids . length
2018-09-26 11:57:33 +00:00
2018-10-09 19:52:41 +00:00
const content = document . createElement ( 'div' )
content . innerHTML = `
2018-10-18 13:26:40 +00:00
< div class = "field has-text-centered" >
2019-09-10 16:31:27 +00:00
< p > You are about to add < b > $ { count } < / b > u p l o a d $ { c o u n t = = = 1 ? ' ' : ' s ' } t o a n a l b u m . < / p >
< p > < b > If an upload is already in an album , it will be moved . < / b > < / p >
2018-10-18 13:26:40 +00:00
< / d i v >
2018-10-09 19:52:41 +00:00
< div class = "field" >
< div class = "control" >
< div class = "select is-fullwidth" >
2018-10-10 17:33:11 +00:00
< select id = "swalAlbum" disabled >
2018-10-09 19:52:41 +00:00
< option value = "-1" > Remove from album < / o p t i o n >
< option value = "" selected disabled > Fetching albums list\u2026 < / o p t i o n >
< / s e l e c t >
< / d i v >
2018-10-10 17:33:11 +00:00
< / d i v >
2018-10-09 19:52:41 +00:00
< / d i v >
`
2018-09-26 11:57:33 +00:00
swal ( {
icon : 'warning' ,
2018-10-09 19:52:41 +00:00
content ,
2018-03-30 02:39:53 +00:00
buttons : {
cancel : true ,
confirm : {
2018-09-26 11:57:33 +00:00
text : 'OK' ,
2018-03-30 02:39:53 +00:00
closeModal : false
}
}
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 06:20:11 +00:00
} ) . then ( choose => {
2018-12-18 17:01:28 +00:00
if ( ! choose ) return
2018-09-26 11:57:33 +00:00
2019-08-20 02:16:34 +00:00
const albumid = parseInt ( document . querySelector ( '#swalAlbum' ) . value )
2020-10-30 18:12:09 +00:00
if ( isNaN ( albumid ) ) return swal ( 'An error occurred!' , 'You did not choose an album.' , 'error' )
2018-07-14 03:42:18 +00:00
2018-09-26 11:57:33 +00:00
axios . post ( 'api/albums/addfiles' , {
2018-10-09 19:52:41 +00:00
ids ,
albumid
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 06:20:11 +00:00
} ) . then ( add => {
2018-12-18 17:01:28 +00:00
if ( ! add ) return
2018-07-14 03:42:18 +00:00
2018-09-26 11:57:33 +00:00
if ( add . data . success === false ) {
2020-10-30 18:12:09 +00:00
if ( add . data . description === 'No token provided' ) {
2018-09-26 11:57:33 +00:00
page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-09-26 11:57:33 +00:00
swal ( 'An error occurred!' , add . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
2018-09-26 11:57:33 +00:00
return
}
2018-07-14 03:42:18 +00:00
2018-10-09 19:52:41 +00:00
let added = ids . length
2020-10-30 18:12:09 +00:00
if ( add . data . failed && add . data . failed . length ) {
2018-09-26 11:57:33 +00:00
added -= add . data . failed . length
2020-10-30 18:12:09 +00:00
}
2018-07-14 03:42:18 +00:00
2019-09-10 16:31:27 +00:00
const suffix = ` upload ${ ids . length === 1 ? '' : 's' } `
2020-10-30 18:12:09 +00:00
if ( ! added ) return swal ( 'An error occurred!' , ` Could not add the ${ suffix } to the album. ` , 'error' )
2018-07-14 03:42:18 +00:00
2019-10-29 12:39:44 +00:00
swal ( 'Woohoo!' , ` Successfully ${ albumid < 0 ? 'removed' : 'added' } ${ added } ${ suffix } ${ albumid < 0 ? 'from' : 'to' } the album. ` , 'success' , {
buttons : false ,
timer : 1500
} )
2019-09-08 01:56:29 +00:00
callback ( add . data . failed )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-09-26 11:57:33 +00:00
} )
// Get albums list then update content of swal
2020-12-26 11:49:51 +00:00
axios . get ( 'api/albums' , { headers : { simple : '1' } } ) . then ( list => {
2018-09-26 11:57:33 +00:00
if ( list . data . success === false ) {
2020-10-30 18:12:09 +00:00
if ( list . data . description === 'No token provided' ) {
2018-09-26 11:57:33 +00:00
page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-09-26 11:57:33 +00:00
swal ( 'An error occurred!' , list . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
2018-09-26 11:57:33 +00:00
return
}
// If the prompt was replaced, the container would be missing
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 06:20:11 +00:00
const select = document . querySelector ( '#swalAlbum' )
2018-12-18 17:01:28 +00:00
if ( ! select ) return
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 06:20:11 +00:00
2018-09-26 11:57:33 +00:00
select . innerHTML += list . data . albums
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 06:20:11 +00:00
. map ( album => {
2018-10-09 19:52:41 +00:00
return ` <option value=" ${ album . id } "> ${ album . name } </option> `
2018-09-26 11:57:33 +00:00
} )
. join ( '\n' )
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 06:20:11 +00:00
2018-09-26 11:57:33 +00:00
select . getElementsByTagName ( 'option' ) [ 1 ] . innerHTML = 'Choose an album'
select . removeAttribute ( 'disabled' )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-03-30 02:39:53 +00:00
}
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 06:20:11 +00:00
page . getAlbums = ( params = { } ) => {
2020-10-30 18:12:09 +00:00
if ( params && params . all && ! page . permissions . moderator ) {
2020-06-01 04:44:16 +00:00
return swal ( 'An error occurred!' , 'You cannot do this!' , 'error' )
2020-10-30 18:12:09 +00:00
}
2020-06-01 04:44:16 +00:00
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-06-01 04:44:16 +00:00
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'loading' )
2019-09-19 07:19:11 +00:00
2020-10-30 18:12:09 +00:00
if ( typeof params . pageNum !== 'number' ) params . pageNum = 0
2020-06-01 04:44:16 +00:00
const headers = { }
2020-10-30 18:12:09 +00:00
if ( params . all ) headers . all = '1'
2020-06-01 04:44:16 +00:00
const url = ` api/albums/ ${ params . pageNum } `
axios . get ( url , { headers } ) . then ( response => {
2018-12-18 17:01:28 +00:00
if ( ! response ) return
2018-07-14 03:42:18 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
2018-10-09 19:52:41 +00:00
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else {
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 06:20:11 +00:00
page . updateTrigger ( params . trigger )
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2018-07-14 03:42:18 +00:00
}
2020-10-30 18:12:09 +00:00
}
2018-05-06 14:14:57 +00:00
2020-06-01 04:44:16 +00:00
const pages = Math . ceil ( response . data . count / 25 )
const albums = response . data . albums
2020-06-09 19:06:43 +00:00
if ( params . pageNum && ( albums . length === 0 ) ) {
page . updateTrigger ( params . trigger )
2020-06-01 04:44:16 +00:00
if ( params . autoPage ) {
params . pageNum = pages - 1
return page . getAlbums ( params )
} else {
return swal ( 'An error occurred!' , ` There are no more albums to populate page ${ params . pageNum + 1 } . ` , 'error' )
}
2020-06-09 19:06:43 +00:00
}
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
page . currentView = params . all ? 'albumsAll' : 'albums'
page . cache = { }
const users = response . data . users
const homeDomain = response . data . homeDomain
if ( params . pageNum < 0 ) params . pageNum = Math . max ( 0 , pages + params . pageNum )
const pagination = page . paginate ( response . data . count , 25 , params . pageNum )
const filter = `
< div class = "column" >
< form class = "prevent-default" >
< div class = "field has-addons" >
< div class = "control is-expanded" >
< input id = "filters" class = "input is-small" type = "text" placeholder = "Filter albums (WIP)" value = "${page.escape(params.filters || '')}" disabled >
< / d i v >
< div class = "control" >
< button type = "button" class = "button is-small is-primary is-outlined" title = "Help? (WIP)" data - action = "album-filters-help" disabled >
< span class = "icon" >
< i class = "icon-help-circled" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< div class = "control" >
< button type = "submit" class = "button is-small is-info is-outlined" title = "Filter albums (WIP)" data - action = "filter-albums" disabled >
< span class = "icon" >
< i class = "icon-filter" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< / d i v >
< / f o r m >
< / d i v >
`
const extraControls = `
< div class = "columns" >
$ { filter }
< div class = "column is-one-quarter" >
< form class = "prevent-default" >
< div class = "field has-addons" >
< div class = "control is-expanded" >
< input id = "jumpToPage" class = "input is-small" type = "number" min = "1" max = "${pages}" value = "${params.pageNum + 1}" $ { pages === 1 ? ' disabled' : '' } >
< / d i v >
< div class = "control" >
< button type = "submit" class = "button is-small is-info is-outlined" title = "Jump to page" data - action = "jump-to-page" >
< span class = "icon" >
< i class = "icon-paper-plane" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
`
const controls = `
< div class = "columns" >
< div class = "column is-hidden-mobile" > < / d i v >
< div class = "column bulk-operations has-text-right" >
< a class = "button is-small is-info is-outlined" title = "Clear selection" data - action = "clear-selection" >
< span class = "icon" >
< i class = "icon-cancel" > < / i >
< / s p a n >
< / a >
< a class = "button is-small is-dangerish is-outlined" title = "Bulk disable (WIP)" data - action = "bulk-disable-albums" disabled >
< span class = "icon" >
2022-05-05 06:58:54 +00:00
< i class = "icon-cancel" > < / i >
2020-06-01 04:44:16 +00:00
< / s p a n >
$ { ! params . all ? '<span>Bulk disable</span>' : '' }
< / a >
$ { params . all
? ` <a class="button is-small is-danger is-outlined" title="Bulk delete (WIP)" data-action="bulk-delete-albums" disabled>
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< span > Bulk delete < / s p a n >
< / a > `
: '' }
< / d i v >
< / d i v >
`
// Do some string replacements for bottom controls
const bottomFiltersId = 'bFilters'
const bottomJumpId = 'bJumpToPage'
const bottomExtraControls = extraControls
. replace ( /id="filters"/ , ` id=" ${ bottomFiltersId } " ` )
. replace ( /(data-action="filter-uploads")/ , ` $ 1 data-filtersid=" ${ bottomFiltersId } " ` )
. replace ( /id="jumpToPage"/ , ` id=" ${ bottomJumpId } " ` )
. replace ( /(data-action="jump-to-page")/g , ` $ 1 data-jumpid=" ${ bottomJumpId } " ` )
const bottomPagination = pagination
. replace ( /(data-action="page-ellipsis")/g , ` $ 1 data-jumpid=" ${ bottomJumpId } " ` )
// Whether there are any unselected items
let unselected = false
const createNewAlbum = `
2018-10-09 19:52:41 +00:00
< h2 class = "subtitle" > Create new album < / h 2 >
2019-08-26 22:00:57 +00:00
< form class = "prevent-default" >
< div class = "field" >
< div class = "control" >
2019-09-17 04:13:41 +00:00
< input id = "albumName" class = "input" type = "text" placeholder = "Name" maxlength = "${page.albumTitleMaxLength}" >
2019-08-26 22:00:57 +00:00
< / d i v >
2019-09-17 04:13:41 +00:00
< p class = "help" > Max length is $ { page . albumTitleMaxLength } characters . < / p >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< div class = "field" >
< div class = "control" >
2019-09-17 04:13:41 +00:00
< textarea id = "albumDescription" class = "textarea" placeholder = "Description" rows = "1" maxlength = "${page.albumDescMaxLength}" > < / t e x t a r e a >
2019-08-26 22:00:57 +00:00
< / d i v >
2019-09-17 04:13:41 +00:00
< p class = "help" > Max length is $ { page . albumDescMaxLength } characters . < / p >
2018-12-13 09:09:46 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< div class = "field" >
< div class = "control" >
2019-09-19 07:19:11 +00:00
< button type = "submit" id = "submitAlbum" class = "button is-info is-outlined is-fullwidth" data - action = "submit-album" >
2019-08-26 22:00:57 +00:00
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-paper-plane" > < / i >
2019-08-26 22:00:57 +00:00
< / s p a n >
< span > Create < / s p a n >
< / b u t t o n >
< / d i v >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< / f o r m >
2018-10-09 19:52:41 +00:00
< hr >
2020-06-01 04:44:16 +00:00
`
page . dom . innerHTML = `
$ { ! params . all ? createNewAlbum : '' }
$ { pagination }
$ { extraControls }
$ { controls }
2020-07-28 14:47:48 +00:00
< div class = "table-container has-text-left" >
2020-05-16 20:35:54 +00:00
< table class = "table is-narrow is-fullwidth is-hoverable" >
2018-10-09 19:52:41 +00:00
< thead >
< tr >
2020-06-01 04:44:16 +00:00
< th > < input id = "selectAll" class = "checkbox" type = "checkbox" title = "Select all" data - action = "select-all" > < / t h >
2018-10-09 19:52:41 +00:00
< th > ID < / t h >
< th > Name < / t h >
2020-06-01 04:44:16 +00:00
$ { params . all ? '<th>User</th>' : '' }
< th > Uploads < / t h >
2021-02-12 08:48:40 +00:00
< th > Size < / t h >
2018-10-09 19:52:41 +00:00
< th > Created at < / t h >
2021-02-12 08:48:40 +00:00
< th > ZIP size < / t h >
< th > ZIP generated at < / t h >
2018-10-09 19:52:41 +00:00
< th > Public link < / t h >
2020-12-26 12:54:41 +00:00
< th class = "has-text-right" > ( $ { response . data . count } total ) < / t h >
2018-10-09 19:52:41 +00:00
< / t r >
< / t h e a d >
< tbody id = "table" >
< / t b o d y >
< / t a b l e >
< / d i v >
2020-06-01 04:44:16 +00:00
$ { controls }
$ { bottomExtraControls }
$ { bottomPagination }
2018-10-09 19:52:41 +00:00
`
2019-08-20 02:16:34 +00:00
const table = document . querySelector ( '#table' )
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
for ( let i = 0 ; i < albums . length ; i ++ ) {
const album = albums [ i ]
2021-02-12 08:48:40 +00:00
const urlPath = '/a/'
const albumUrlText = urlPath + album . identifier
const albumUrl = homeDomain + albumUrlText
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
const selected = page . selected [ page . currentView ] . includes ( album . id )
if ( ! selected ) unselected = true
2018-10-09 19:52:41 +00:00
// Prettify
2021-02-12 08:48:40 +00:00
album . hasZip = album . zipSize !== null
2018-10-09 19:52:41 +00:00
album . prettyDate = page . getPrettyDate ( new Date ( album . timestamp * 1000 ) )
2021-02-12 08:48:40 +00:00
album . prettyZipDate = album . hasZip ? page . getPrettyDate ( new Date ( album . zipGeneratedAt * 1000 ) ) : null
album . isZipExpired = album . hasZip && ! ( album . zipGeneratedAt > album . editedAt )
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
// Server-side explicitly expect this value to consider an album as disabled
const enabled = album . enabled !== 0
page . cache [ album . id ] = {
2018-10-09 19:52:41 +00:00
name : album . name ,
download : album . download ,
2018-12-13 09:09:46 +00:00
public : album . public ,
2020-06-01 04:44:16 +00:00
description : album . description ,
2022-05-05 06:17:32 +00:00
descriptionHtml : album . descriptionHtml ,
2021-02-12 08:48:40 +00:00
enabled ,
homeDomain ,
urlPath ,
identifier : album . identifier
2018-07-14 03:42:18 +00:00
}
2018-10-09 19:52:41 +00:00
const tr = document . createElement ( 'tr' )
2020-06-01 04:44:16 +00:00
tr . dataset . id = album . id
2018-10-09 19:52:41 +00:00
tr . innerHTML = `
2020-06-01 04:44:16 +00:00
< td class = "controls" > < input type = "checkbox" class = "checkbox" title = "Select" data - index = "${i}" data - action = "select" $ { selected ? ' checked' : '' } > < / t d >
2018-10-12 10:19:14 +00:00
< th > $ { album . id } < / t h >
2020-06-01 04:44:16 +00:00
< th$ { enabled ? '' : ' class="has-text-grey"' } > $ { album . name } < / t d >
$ { params . all ? ` <th> ${ album . userid ? ( users [ album . userid ] || '' ) : '' } </th> ` : '' }
< th > $ { album . uploads } < / t h >
2022-05-06 13:48:24 +00:00
< td data - bytes = "${album.size}" > $ { page . getPrettyBytes ( album . size ) } < / t d >
< td data - timestamp = "${album.timestamp}" > $ { album . prettyDate } < / t d >
< td$ { album . hasZip ? ` data-bytes=" ${ album . zipSize } " ` : '' } > $ { album . hasZip ? page . getPrettyBytes ( album . zipSize ) : '-' } < / t d >
< td$ { album . hasZip ? ` data-timestamp=" ${ album . zipGeneratedAt } " ` : '' } $ { album . isZipExpired ? ' class="has-text-warning" title="This album has been modified since the last time its ZIP was generated."' : '' } > $ { album . hasZip ? album . prettyZipDate : '-' } < / t d $ >
2021-02-12 08:48:40 +00:00
< td > < a $ { enabled && album . public ? '' : 'class="is-linethrough" ' } href = "${albumUrl}" target = "_blank" > $ { albumUrlText } < / a > < / t d >
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 06:20:11 +00:00
< td class = "has-text-right" data - id = "${album.id}" >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-primary is-outlined" title = "Edit album" data - action = "edit-album" >
2018-10-12 10:19:14 +00:00
< span class = "icon is-small" >
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 06:20:11 +00:00
< i class = "icon-pencil" > < / i >
2018-10-12 10:19:14 +00:00
< / s p a n >
< / a >
2020-06-01 04:44:16 +00:00
< a class = "button is-small is-info is-outlined" title = "${album.uploads ? 'View uploads' : 'Album doesn\'t have uploads'}" data - action = "view-album-uploads" $ { album . uploads ? '' : 'disabled' } >
< span class = "icon" >
< i class = "icon-docs" > < / i >
< / s p a n >
< / a >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-info is-outlined clipboard-js" title = "Copy link to clipboard" $ { album . public ? ` data-clipboard-text=" ${ albumUrl } " ` : 'disabled' } >
2018-10-12 10:19:14 +00:00
< span class = "icon is-small" >
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 06:20:11 +00:00
< i class = "icon-clipboard" > < / i >
2018-10-12 10:19:14 +00:00
< / s p a n >
< / a >
2020-06-03 02:20:40 +00:00
< a class = "button is-small is-warning is-outlined" title = "Download album" $ { enabled && album . download ? ` href="api/album/zip/ ${ album . identifier } ?v= ${ album . editedAt } " ` : 'disabled' } >
2018-10-12 10:19:14 +00:00
< span class = "icon is-small" >
< i class = "icon-download" > < / i >
< / s p a n >
< / a >
2020-06-03 02:20:40 +00:00
< a class = "button is-small is-dangerish is-outlined" title = "Disable album" data - action = "disable-album" $ { enabled ? '' : ' disabled' } >
2018-10-12 10:19:14 +00:00
< span class = "icon is-small" >
2022-05-05 06:58:54 +00:00
< i class = "icon-cancel" > < / i >
2018-10-12 10:19:14 +00:00
< / s p a n >
< / a >
2022-05-05 06:58:54 +00:00
$ { params . all
? ` <a class="button is-small is-danger is-outlined" title="Delete album" data-action="delete-album">
< span class = "icon is-small" >
< i class = "icon-trash" > < / i >
< / s p a n >
< / a > `
: '' }
2018-10-12 10:19:14 +00:00
< / t d >
2018-10-09 19:52:41 +00:00
`
table . appendChild ( tr )
2020-06-01 04:44:16 +00:00
page . checkboxes = table . querySelectorAll ( '.checkbox[data-action="select"]' )
}
const selectAll = document . querySelector ( '#selectAll' )
if ( selectAll && ! unselected ) {
selectAll . checked = true
selectAll . title = 'Unselect all'
2018-10-09 19:52:41 +00:00
}
2020-06-01 04:44:16 +00:00
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
const pageNum = albums . length ? params . pageNum : 0
if ( params . forceScroll ||
page . prevPageNums [ page . currentView ] === null ||
page . prevPageNums [ page . currentView ] !== pageNum ) {
page . scrollToDom ( )
}
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
2020-06-01 04:44:16 +00:00
2020-12-26 16:50:52 +00:00
if ( page . currentView === 'albumsAll' ) {
page . views [ page . currentView ] . filters = params . filters
}
page . views [ page . currentView ] . pageNum = page . prevPageNums [ page . currentView ] = pageNum
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 06:20:11 +00:00
} ) . catch ( error => {
page . updateTrigger ( params . trigger )
2019-09-19 07:19:11 +00:00
page . onAxiosError ( error )
2018-10-09 19:52:41 +00:00
} )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . editAlbum = id => {
2020-06-01 04:44:16 +00:00
const album = page . cache [ id ]
2018-12-18 17:01:28 +00:00
if ( ! album ) return
2018-04-28 17:26:39 +00:00
2021-02-12 08:48:40 +00:00
const albumUrlText = album . urlPath + album . identifier
const albumUrl = album . homeDomain + albumUrlText
2018-10-09 19:52:41 +00:00
const div = document . createElement ( 'div' )
div . innerHTML = `
< div class = "field" >
< div class = "controls" >
2019-09-17 04:13:41 +00:00
< input id = "swalName" class = "input" type = "text" placeholder = "Name" maxlength = "${page.albumTitleMaxLength}" value = "${(album.name || '').substring(0, page.albumTitleMaxLength)}" >
2018-12-13 09:09:46 +00:00
< / d i v >
2019-09-17 04:13:41 +00:00
< p class = "help" > Max length is $ { page . albumTitleMaxLength } characters . < / p >
2018-12-13 09:09:46 +00:00
< / d i v >
< div class = "field" >
< div class = "control" >
2019-09-17 04:13:41 +00:00
< textarea id = "swalDescription" class = "textarea" placeholder = "Description" rows = "2" maxlength = "${page.albumDescMaxLength}" > $ { ( album . description || '' ) . substring ( 0 , page . albumDescMaxLength ) } < / t e x t a r e a >
2018-10-09 19:52:41 +00:00
< / d i v >
2022-05-05 06:17:32 +00:00
< p class = "help" > < b > Markdown supported . < / b > M a x l e n g t h i s $ { p a g e . a l b u m D e s c M a x L e n g t h } c h a r a c t e r s . < / p >
2018-10-09 19:52:41 +00:00
< / d i v >
2022-05-05 06:17:32 +00:00
$ { album . descriptionHtml
? ` <div class="field">
< div class = "content swal-display-description-preview" >
$ { album . descriptionHtml }
< / d i v >
< p class = "help" > Save changes then re - open this Edit prompt to refresh this preview . < / p >
< / d i v > `
: '' }
2020-06-01 04:44:16 +00:00
$ { page . currentView === 'albumsAll' && page . permissions . moderator
? ` <div class="field">
< div class = "control" >
< label class = "checkbox" >
< input id = "swalEnabled" type = "checkbox" $ { album . enabled ? 'checked' : '' } >
Enabled
< / l a b e l >
< / d i v >
< / d i v > `
: '' }
2018-10-09 19:52:41 +00:00
< div class = "field" >
< div class = "control" >
< label class = "checkbox" >
< input id = "swalDownload" type = "checkbox" $ { album . download ? 'checked' : '' } >
Enable download
< / l a b e l >
< / d i v >
< / d i v >
< div class = "field" >
< div class = "control" >
< label class = "checkbox" >
< input id = "swalPublic" type = "checkbox" $ { album . public ? 'checked' : '' } >
Enable public link
< / l a b e l >
< / d i v >
< / d i v >
< div class = "field" >
< div class = "control" >
< label class = "checkbox" >
< input id = "swalRequestLink" type = "checkbox" >
Request new public link
< / l a b e l >
< / d i v >
< / d i v >
2021-02-12 08:48:40 +00:00
< div class = "field" >
< p > Current public link : < a href = "${albumUrl}" target = "_blank" class = "is-underline" > $ { albumUrlText } < / a > < / p >
< / d i v >
2018-10-09 19:52:41 +00:00
`
2018-09-04 15:49:37 +00:00
2018-07-14 03:42:18 +00:00
swal ( {
2018-04-28 17:26:39 +00:00
title : 'Edit album' ,
2018-03-19 16:51:39 +00:00
icon : 'info' ,
2018-04-28 17:26:39 +00:00
content : div ,
2018-03-19 16:51:39 +00:00
buttons : {
cancel : true ,
confirm : {
closeModal : false
}
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
} ) . then ( value => {
2018-12-18 17:01:28 +00:00
if ( ! value ) return
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
const post = {
2018-10-09 19:52:41 +00:00
id ,
2019-09-08 01:56:29 +00:00
name : document . querySelector ( '#swalName' ) . value . trim ( ) ,
description : document . querySelector ( '#swalDescription' ) . value . trim ( ) ,
2019-08-20 02:16:34 +00:00
download : document . querySelector ( '#swalDownload' ) . checked ,
public : document . querySelector ( '#swalPublic' ) . checked ,
requestLink : document . querySelector ( '#swalRequestLink' ) . checked
2020-06-01 04:44:16 +00:00
}
2020-10-30 18:12:09 +00:00
if ( page . currentView === 'albumsAll' && page . permissions . moderator ) {
2020-06-01 04:44:16 +00:00
post . enabled = document . querySelector ( '#swalEnabled' ) . checked
2020-10-30 18:12:09 +00:00
}
2020-06-01 04:44:16 +00:00
axios . post ( 'api/albums/edit' , post ) . then ( response => {
2018-12-18 17:01:28 +00:00
if ( ! response ) return
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2018-10-09 19:52:41 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . identifier ) {
2020-06-01 04:44:16 +00:00
swal ( 'Success!' , ` The album's new identifier is: ${ response . data . identifier } . ` , 'success' )
2020-10-30 18:12:09 +00:00
} else if ( response . data . name !== album . name ) {
2020-06-01 04:44:16 +00:00
swal ( 'Success!' , ` The album was renamed to: ${ response . data . name } . ` , 'success' )
2020-10-30 18:12:09 +00:00
} else {
2020-06-01 04:44:16 +00:00
swal ( 'Success!' , 'The album was edited.' , 'success' , {
2019-10-29 12:39:44 +00:00
buttons : false ,
timer : 1500
} )
2020-10-30 18:12:09 +00:00
}
2018-10-09 19:52:41 +00:00
page . getAlbumsSidebar ( )
2020-06-01 04:44:16 +00:00
// Reload albums list
// eslint-disable-next-line compat/compat
page . getAlbums ( Object . assign ( page . views [ page . currentView ] , {
autoPage : true
} ) )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-10-09 19:52:41 +00:00
} )
2018-01-23 20:06:30 +00:00
}
2020-06-01 04:44:16 +00:00
page . disableAlbum = id => {
2018-07-14 03:42:18 +00:00
swal ( {
2018-01-23 20:06:30 +00:00
title : 'Are you sure?' ,
2020-06-01 04:44:16 +00:00
text : 'This won\'t delete the uploads associated with the album!' ,
2018-03-19 16:51:39 +00:00
icon : 'warning' ,
dangerMode : true ,
buttons : {
cancel : true ,
confirm : {
2020-06-01 04:44:16 +00:00
text : 'Yes, disable it!' ,
2018-03-19 16:51:39 +00:00
closeModal : false
2018-03-30 02:39:53 +00:00
} ,
purge : {
2020-10-30 18:12:09 +00:00
text : 'Umm, delete the uploads, please?' ,
2018-03-30 02:39:53 +00:00
value : 'purge' ,
className : 'swal-button--danger' ,
closeModal : false
2018-03-19 16:51:39 +00:00
}
}
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 06:20:11 +00:00
} ) . then ( proceed => {
2018-12-18 17:01:28 +00:00
if ( ! proceed ) return
2018-01-23 20:06:30 +00:00
2020-06-01 04:44:16 +00:00
axios . post ( 'api/albums/disable' , {
2018-10-09 19:52:41 +00:00
id ,
purge : proceed === 'purge'
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 06:20:11 +00:00
} ) . then ( response => {
2019-10-06 23:11:07 +00:00
if ( response . data . success === false ) {
const failed = Array . isArray ( response . data . failed )
? response . data . failed
: [ ]
2020-10-30 18:12:09 +00:00
if ( response . data . description === 'No token provided' ) {
2018-07-14 03:42:18 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else if ( failed . length ) {
2019-10-06 23:11:07 +00:00
return swal ( 'An error occurred!' , ` Unable to delete ${ failed . length } of the album's upload ${ failed . length === 1 ? '' : 's' } . ` , 'error' )
2020-10-30 18:12:09 +00:00
} else {
2018-07-14 03:42:18 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
2019-10-06 23:11:07 +00:00
}
2018-01-23 20:06:30 +00:00
2022-05-05 06:58:54 +00:00
swal ( 'Disabled!' , 'The album has been disabled.' , 'success' , {
buttons : false ,
timer : 1500
} )
page . getAlbumsSidebar ( )
// Reload albums list
// eslint-disable-next-line compat/compat
page . getAlbums ( Object . assign ( page . views [ page . currentView ] , {
autoPage : true
} ) )
} ) . catch ( page . onAxiosError )
} )
}
page . deleteAlbum = id => {
swal ( {
title : 'Are you sure?' ,
text : 'You won\'t be able to recover this album!\n' +
'This also won\'t delete the uploads associated with the album!' ,
icon : 'warning' ,
dangerMode : true ,
buttons : {
cancel : true ,
confirm : {
text : 'Yes, delete it!' ,
closeModal : false
} ,
purge : {
text : 'Umm, delete the uploads, please?' ,
value : 'purge' ,
className : 'swal-button--danger' ,
closeModal : false
}
}
} ) . then ( proceed => {
if ( ! proceed ) return
axios . post ( 'api/albums/delete' , {
id ,
purge : proceed === 'purge'
} ) . then ( response => {
if ( response . data . success === false ) {
const failed = Array . isArray ( response . data . failed )
? response . data . failed
: [ ]
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else if ( failed . length ) {
return swal ( 'An error occurred!' , ` Unable to delete ${ failed . length } of the album's upload ${ failed . length === 1 ? '' : 's' } . ` , 'error' )
} else {
return swal ( 'An error occurred!' , response . data . description , 'error' )
}
}
swal ( 'Disabled!' , 'The album has been deleted.' , 'success' , {
2019-10-29 12:39:44 +00:00
buttons : false ,
timer : 1500
} )
2020-06-01 04:44:16 +00:00
2018-07-14 03:42:18 +00:00
page . getAlbumsSidebar ( )
2020-06-01 04:44:16 +00:00
// Reload albums list
// eslint-disable-next-line compat/compat
page . getAlbums ( Object . assign ( page . views [ page . currentView ] , {
autoPage : true
} ) )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-10-09 19:52:41 +00:00
} )
}
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 06:20:11 +00:00
page . submitAlbum = element => {
page . updateTrigger ( element , 'loading' )
2019-09-19 07:19:11 +00:00
2018-10-09 19:52:41 +00:00
axios . post ( 'api/albums' , {
2019-09-17 04:13:41 +00:00
name : document . querySelector ( '#albumName' ) . value . trim ( ) ,
description : document . querySelector ( '#albumDescription' ) . value . trim ( )
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 06:20:11 +00:00
} ) . then ( response => {
2018-12-18 17:01:28 +00:00
if ( ! response ) return
2018-10-09 19:52:41 +00:00
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 06:20:11 +00:00
page . updateTrigger ( element )
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2018-10-09 19:52:41 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2018-10-09 19:52:41 +00:00
2019-10-29 12:39:44 +00:00
swal ( 'Woohoo!' , 'Album was created successfully.' , 'success' , {
buttons : false ,
timer : 1500
} )
2018-10-09 19:52:41 +00:00
page . getAlbumsSidebar ( )
2020-06-01 04:44:16 +00:00
page . getAlbums ( {
pageNum : - 1
} )
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 06:20:11 +00:00
} ) . catch ( error => {
page . updateTrigger ( element )
2019-09-19 07:19:11 +00:00
page . onAxiosError ( error )
2018-10-09 19:52:41 +00:00
} )
2018-07-14 03:42:18 +00:00
}
2018-05-06 14:14:57 +00:00
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 06:20:11 +00:00
page . getAlbumsSidebar = ( ) => {
2020-12-26 11:49:51 +00:00
axios . get ( 'api/albums' , { headers : { simple : '1' } } ) . then ( response => {
2018-12-18 17:01:28 +00:00
if ( ! response ) return
2018-07-14 03:42:18 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2018-10-09 19:52:41 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2018-05-06 14:14:57 +00:00
2020-06-01 04:44:16 +00:00
const albums = response . data . albums
const count = response . data . count
2020-12-26 11:49:51 +00:00
const albumsSidebar = document . querySelector ( '#albumsSidebar' )
2018-05-06 14:14:57 +00:00
2019-09-10 16:31:27 +00:00
// Clear albums sidebar if necessary
2020-12-26 11:49:51 +00:00
const oldAlbums = albumsSidebar . querySelectorAll ( 'li > a' )
const diffCount = oldAlbums . length !== count
2019-09-10 16:31:27 +00:00
if ( oldAlbums . length ) {
2020-10-30 18:12:09 +00:00
for ( let i = 0 ; i < oldAlbums . length ; i ++ ) {
2019-09-10 16:31:27 +00:00
page . menus . splice ( page . menus . indexOf ( oldAlbums [ i ] ) , 1 )
2020-10-30 18:12:09 +00:00
}
2020-12-26 11:49:51 +00:00
albumsSidebar . innerHTML = ''
2019-09-10 16:31:27 +00:00
}
2020-12-26 11:49:51 +00:00
page . albumsSidebarCollapse . innerText = page . albumsSidebarCollapsible . collapsed ( )
? page . albumsSidebarCollapse . dataset . textExpand
: page . albumsSidebarCollapse . dataset . textCollapse
if ( ! albums || ! albums . length ) {
page . albumsSidebarCollapsible . collapse ( )
page . albumsSidebarCollapse . setAttribute ( 'disabled' , 'disabled' )
return
}
2018-05-06 14:14:57 +00:00
2020-06-01 04:44:16 +00:00
for ( let i = 0 ; i < albums . length ; i ++ ) {
const album = albums [ i ]
2018-10-09 19:52:41 +00:00
const li = document . createElement ( 'li' )
const a = document . createElement ( 'a' )
a . id = album . id
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 06:20:11 +00:00
a . className = 'is-relative'
2020-06-01 04:44:16 +00:00
a . innerHTML = album . name
2018-05-06 14:14:57 +00:00
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 06:20:11 +00:00
a . addEventListener ( 'click' , event => {
page . getUploads ( {
album : parseInt ( event . currentTarget . id ) ,
trigger : event . currentTarget
} )
2018-10-09 19:52:41 +00:00
} )
2019-09-10 16:31:27 +00:00
page . menus . push ( a )
2018-05-06 14:14:57 +00:00
2018-10-09 19:52:41 +00:00
li . appendChild ( a )
2020-12-26 11:49:51 +00:00
albumsSidebar . appendChild ( li )
2018-10-09 19:52:41 +00:00
}
2020-06-01 04:44:16 +00:00
2020-12-26 11:49:51 +00:00
page . albumsSidebarCollapse . removeAttribute ( 'disabled' )
if ( ! page . albumsSidebarCollapsible . collapsed ( ) && diffCount ) {
// Since it's not possible to refresh collapsible's height with bulmaCollapsible APIs,
// forcefully collapse albums sidebar if albums count is different with the previous iteration.
page . albumsSidebarCollapsible . collapse ( )
2020-06-01 04:44:16 +00:00
}
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . changeToken = ( params = { } ) => {
2019-09-19 07:19:11 +00:00
page . dom . innerHTML = `
< div class = "field" >
< label class = "label" > Your current token : < / l a b e l >
2018-10-09 19:52:41 +00:00
< div class = "field" >
< div class = "control" >
2019-09-19 07:19:11 +00:00
< input id = "token" readonly class = "input" type = "text" placeholder = "Your token" value = "${page.token}" >
2018-10-09 19:52:41 +00:00
< / d i v >
< / d i v >
2019-09-19 07:19:11 +00:00
< / d i v >
< div class = "field" >
< div class = "control" >
< a id = "getNewToken" class = "button is-info is-outlined is-fullwidth" >
< span class = "icon" >
< i class = "icon-arrows-cw" > < / i >
< / s p a n >
< span > Request new token < / s p a n >
< / a >
< / d i v >
< / d i v >
`
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
page . scrollToDom ( )
2019-09-19 07:19:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
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 06:20:11 +00:00
2019-09-19 07:19:11 +00:00
document . querySelector ( '#getNewToken' ) . addEventListener ( 'click' , event => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
2019-09-19 07:19:11 +00:00
const trigger = event . currentTarget
page . updateTrigger ( trigger , 'loading' )
axios . post ( 'api/tokens/change' ) . then ( response => {
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
2019-09-19 07:19:11 +00:00
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else {
page . updateTrigger ( trigger )
return swal ( 'An error occurred!' , response . data . description , 'error' )
}
2020-10-30 18:12:09 +00:00
}
2018-07-14 03:42:18 +00:00
2019-09-19 07:19:11 +00:00
page . updateTrigger ( trigger )
swal ( {
title : 'Woohoo!' ,
text : 'Your token was successfully changed.' ,
2020-04-18 19:52:11 +00:00
icon : 'success' ,
buttons : false ,
timer : 1500
2019-09-19 07:19:11 +00:00
} ) . then ( ( ) => {
axios . defaults . headers . common . token = response . data . token
localStorage [ lsKeys . token ] = response . data . token
page . token = response . data . token
page . changeToken ( )
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 06:20:11 +00:00
} )
2019-09-19 07:19:11 +00:00
} ) . catch ( error => {
page . updateTrigger ( trigger )
page . onAxiosError ( error )
2018-01-23 20:06:30 +00:00
} )
2018-10-09 19:52:41 +00:00
} )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . changePassword = ( params = { } ) => {
2018-10-09 19:52:41 +00:00
page . dom . innerHTML = `
2019-08-26 22:00:57 +00:00
< form class = "prevent-default" >
< div class = "field" >
< label class = "label" > New password : < / l a b e l >
< div class = "control" >
2019-09-19 07:23:48 +00:00
< input id = "password" class = "input" type = "password" minlength = "6" maxlength = "64" >
2019-08-26 22:00:57 +00:00
< / d i v >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< div class = "field" >
< label class = "label" > Re - type new password : < / l a b e l >
< div class = "control" >
2019-09-19 07:23:48 +00:00
< input id = "passwordConfirm" class = "input" type = "password" minlength = "6" maxlength = "64" >
2019-08-26 22:00:57 +00:00
< / d i v >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< div class = "field" >
< div class = "control" >
2019-09-19 07:19:11 +00:00
< button type = "submit" id = "sendChangePassword" class = "button is-info is-outlined is-fullwidth" >
2019-08-26 22:00:57 +00:00
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-paper-plane" > < / i >
2019-08-26 22:00:57 +00:00
< / s p a n >
< span > Set new password < / s p a n >
< / b u t t o n >
< / d i v >
2018-10-09 19:52:41 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< / f o r m >
2018-10-09 19:52:41 +00:00
`
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
page . scrollToDom ( )
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
2018-01-23 20:06:30 +00:00
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 06:20:11 +00:00
document . querySelector ( '#sendChangePassword' ) . addEventListener ( 'click' , event => {
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
2020-10-30 18:12:09 +00:00
if ( ! page . dom . querySelector ( 'form' ) . checkValidity ( ) ) return
2020-05-16 17:11:10 +00:00
2020-10-30 18:12:09 +00:00
if ( document . querySelector ( '#password' ) . value === document . querySelector ( '#passwordConfirm' ) . value ) {
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 06:20:11 +00:00
page . sendNewPassword ( document . querySelector ( '#password' ) . value , event . currentTarget )
2020-10-30 18:12:09 +00:00
} else {
2018-01-23 20:06:30 +00:00
swal ( {
title : 'Password mismatch!' ,
text : 'Your passwords do not match, please try again.' ,
2018-03-19 16:51:39 +00:00
icon : 'error'
2018-01-23 20:06:30 +00:00
} )
2020-10-30 18:12:09 +00:00
}
2018-01-23 20:06:30 +00:00
} )
}
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 06:20:11 +00:00
page . sendNewPassword = ( pass , element ) => {
page . updateTrigger ( element , 'loading' )
2018-01-23 20:06:30 +00:00
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 06:20:11 +00:00
axios . post ( 'api/password/change' , { password : pass } ) . then ( response => {
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
2018-10-09 19:52:41 +00:00
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else {
2019-09-19 07:19:11 +00:00
page . updateTrigger ( element )
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2018-07-14 03:42:18 +00:00
}
2020-10-30 18:12:09 +00:00
}
2018-07-14 03:42:18 +00:00
2019-09-19 07:19:11 +00:00
page . updateTrigger ( element )
2018-10-09 19:52:41 +00:00
swal ( {
title : 'Woohoo!' ,
text : 'Your password was successfully changed.' ,
2019-10-29 12:39:44 +00:00
icon : 'success' ,
buttons : false ,
timer : 1500
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 06:20:11 +00:00
} ) . then ( ( ) => {
2018-10-09 19:52:41 +00:00
page . changePassword ( )
2018-01-23 20:06:30 +00:00
} )
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 06:20:11 +00:00
} ) . catch ( error => {
page . updateTrigger ( element )
2019-09-19 07:19:11 +00:00
page . onAxiosError ( error )
2018-10-09 19:52:41 +00:00
} )
2018-01-23 20:06:30 +00:00
}
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 06:20:11 +00:00
page . getUsers = ( params = { } ) => {
2020-10-30 18:12:09 +00:00
if ( ! page . permissions . admin ) return swal ( 'An error occurred!' , 'You cannot do this!' , 'error' )
2020-05-16 17:11:10 +00:00
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'loading' )
2018-01-23 20:06:30 +00:00
2020-10-30 18:12:09 +00:00
if ( typeof params . pageNum !== 'number' ) params . pageNum = 0
2018-10-09 19:52:41 +00:00
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 06:20:11 +00:00
const url = ` api/users/ ${ params . pageNum } `
axios . get ( url ) . then ( response => {
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
2018-10-09 19:52:41 +00:00
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else {
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 06:20:11 +00:00
page . updateTrigger ( params . trigger )
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
}
2020-10-30 18:12:09 +00:00
}
2018-10-09 19:52:41 +00:00
2019-10-07 03:34:10 +00:00
const pages = Math . ceil ( response . data . count / 25 )
2020-06-01 04:44:16 +00:00
const users = response . data . users
2020-06-09 19:06:43 +00:00
if ( params . pageNum && ( users . length === 0 ) ) {
page . updateTrigger ( params . trigger )
2019-10-06 23:11:07 +00:00
if ( params . autoPage ) {
2019-10-07 03:34:10 +00:00
params . pageNum = pages - 1
2019-10-06 23:11:07 +00:00
return page . getUsers ( params )
} else {
return swal ( 'An error occurred!' , ` There are no more users to populate page ${ params . pageNum + 1 } . ` , 'error' )
}
2020-06-09 19:06:43 +00:00
}
2018-10-09 19:52:41 +00:00
page . currentView = 'users'
2020-06-01 04:44:16 +00:00
page . cache = { }
2018-10-09 19:52:41 +00:00
2020-05-02 15:42:23 +00:00
if ( params . pageNum < 0 ) params . pageNum = Math . max ( 0 , pages + params . pageNum )
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 06:20:11 +00:00
const pagination = page . paginate ( response . data . count , 25 , params . pageNum )
2018-10-09 19:52:41 +00:00
2020-04-17 07:25:18 +00:00
const filter = `
< div class = "column" >
< form class = "prevent-default" >
< div class = "field has-addons" >
< div class = "control is-expanded" >
2020-06-01 04:44:16 +00:00
< input id = "filters" class = "input is-small" type = "text" placeholder = "Filter users (WIP)" value = "${page.escape(params.filters || '')}" disabled >
2020-04-17 07:25:18 +00:00
< / d i v >
< div class = "control" >
2020-04-18 19:52:11 +00:00
< button type = "button" class = "button is-small is-primary is-outlined" title = "Help? (WIP)" data - action = "user-filters-help" disabled >
2020-04-17 07:25:18 +00:00
< span class = "icon" >
< i class = "icon-help-circled" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< div class = "control" >
< button type = "submit" class = "button is-small is-info is-outlined" title = "Filter users (WIP)" data - action = "filter-users" disabled >
< span class = "icon" >
< i class = "icon-filter" > < / i >
< / s p a n >
< / b u t t o n >
< / d i v >
< / d i v >
< / f o r m >
< / d i v >
`
2019-01-03 04:49:56 +00:00
const extraControls = `
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 06:20:11 +00:00
< div class = "columns" >
2020-04-17 07:25:18 +00:00
$ { filter }
2019-01-03 04:49:56 +00:00
< div class = "column is-one-quarter" >
2019-08-26 22:00:57 +00:00
< form class = "prevent-default" >
< div class = "field has-addons" >
< div class = "control is-expanded" >
2019-10-07 03:34:10 +00:00
< input id = "jumpToPage" class = "input is-small" type = "number" min = "1" max = "${pages}" value = "${params.pageNum + 1}" $ { pages === 1 ? ' disabled' : '' } >
2019-08-26 22:00:57 +00:00
< / d i v >
< div class = "control" >
2019-09-19 07:19:11 +00:00
< button type = "submit" class = "button is-small is-info is-outlined" title = "Jump to page" data - action = "jump-to-page" >
2019-08-26 22:00:57 +00:00
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-paper-plane" > < / i >
2019-08-26 22:00:57 +00:00
< / s p a n >
< / b u t t o n >
< / d i v >
2019-01-03 04:49:56 +00:00
< / d i v >
2019-08-26 22:00:57 +00:00
< / f o r m >
2019-01-03 04:49:56 +00:00
< / d i v >
< / d i v >
`
2018-10-09 19:52:41 +00:00
const controls = `
2020-04-17 07:25:18 +00:00
< div class = "columns" >
2020-05-16 17:11:10 +00:00
< div class = "column exclusive-operations has-text-left" >
2020-04-18 19:52:11 +00:00
< a class = "button is-small is-primary is-outlined" title = "Create new user" data - action = "create-user" >
2020-04-17 07:25:18 +00:00
< span class = "icon" >
< i class = "icon-plus" > < / i >
< / s p a n >
2020-04-18 19:52:11 +00:00
< span > Create new user < / s p a n >
2020-05-16 17:11:10 +00:00
< / a >
2020-04-17 07:25:18 +00:00
< / d i v >
2020-05-16 17:11:10 +00:00
< div class = "column bulk-operations has-text-right" >
2020-04-17 07:25:18 +00:00
< a class = "button is-small is-info is-outlined" title = "Clear selection" data - action = "clear-selection" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-cancel" > < / i >
< / s p a n >
< / a >
2020-06-01 04:44:16 +00:00
< a class = "button is-small is-dangerish is-outlined" title = "Bulk disable (WIP)" data - action = "bulk-disable-users" disabled >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-hammer" > < / i >
< / s p a n >
< / a >
2020-04-17 07:25:18 +00:00
< a class = "button is-small is-danger is-outlined" title = "Bulk delete (WIP)" data - action = "bulk-delete-users" disabled >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< span > Bulk delete < / s p a n >
< / a >
< / d i v >
< / d i v >
`
2020-05-02 15:42:23 +00:00
// Do some string replacements for bottom controls
const bottomFiltersId = 'bFilters'
const bottomJumpId = 'bJumpToPage'
const bottomExtraControls = extraControls
. replace ( /id="filters"/ , ` id=" ${ bottomFiltersId } " ` )
. replace ( /(data-action="filter-uploads")/ , ` $ 1 data-filtersid=" ${ bottomFiltersId } " ` )
. replace ( /id="jumpToPage"/ , ` id=" ${ bottomJumpId } " ` )
. replace ( /(data-action="jump-to-page")/g , ` $ 1 data-jumpid=" ${ bottomJumpId } " ` )
const bottomPagination = pagination
. replace ( /(data-action="page-ellipsis")/g , ` $ 1 data-jumpid=" ${ bottomJumpId } " ` )
2019-09-10 16:31:27 +00:00
// Whether there are any unselected items
let unselected = false
2018-10-09 19:52:41 +00:00
page . dom . innerHTML = `
$ { pagination }
2019-01-03 04:49:56 +00:00
$ { extraControls }
2018-10-09 19:52:41 +00:00
$ { controls }
2020-07-28 14:47:48 +00:00
< div class = "table-container has-text-left" >
2018-10-09 19:52:41 +00:00
< table class = "table is-narrow is-fullwidth is-hoverable" >
< thead >
< tr >
2020-04-17 07:25:18 +00:00
< th > < input id = "selectAll" class = "checkbox" type = "checkbox" title = "Select all" data - action = "select-all" > < / t h >
2020-05-16 17:33:23 +00:00
< th title = "Key: username" > Username < / t h >
2018-10-12 09:42:16 +00:00
< th > Uploads < / t h >
2018-10-12 10:19:14 +00:00
< th > Usage < / t h >
2020-05-16 17:33:23 +00:00
< th title = "Key: permission" > Group < / t h >
< th title = "Key: registration" > Registration date < / t h >
< th title = "Key: timestamp" > Last token update < / t h >
2020-12-26 12:54:41 +00:00
< th class = "has-text-right" > ( $ { response . data . count } total ) < / t h >
2018-10-09 19:52:41 +00:00
< / t r >
< / t h e a d >
< tbody id = "table" >
< / t b o d y >
< / t a b l e >
< / d i v >
2020-05-02 15:42:23 +00:00
$ { controls }
$ { bottomExtraControls }
$ { bottomPagination }
2018-10-09 19:52:41 +00:00
`
2019-08-20 02:16:34 +00:00
const table = document . querySelector ( '#table' )
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
for ( let i = 0 ; i < users . length ; i ++ ) {
const user = users [ i ]
const selected = page . selected [ page . currentView ] . includes ( user . id )
2019-09-10 16:31:27 +00:00
if ( ! selected ) unselected = true
2018-10-09 19:52:41 +00:00
2018-10-10 17:33:11 +00:00
let displayGroup = null
2019-09-01 19:23:16 +00:00
const groups = Object . keys ( user . groups )
for ( let i = 0 ; i < groups . length ; i ++ ) {
if ( ! user . groups [ groups [ i ] ] ) break
displayGroup = groups [ i ]
2018-10-10 17:33:11 +00:00
}
2018-10-12 09:42:16 +00:00
// Server-side explicitly expects either of these two values to consider a user as disabled
const enabled = user . enabled !== false && user . enabled !== 0
2020-06-01 04:44:16 +00:00
page . cache [ user . id ] = {
2018-10-09 19:52:41 +00:00
username : user . username ,
groups : user . groups ,
2018-10-12 09:42:16 +00:00
enabled ,
2018-10-10 17:33:11 +00:00
displayGroup
2018-10-09 19:52:41 +00:00
}
2020-05-16 17:33:23 +00:00
const prettyDate = user . registration
2020-05-16 15:32:32 +00:00
? page . getPrettyDate ( new Date ( user . registration * 1000 ) )
: '-'
2020-05-16 17:33:23 +00:00
const prettyTokenUpdate = user . timestamp
2020-05-16 15:32:32 +00:00
? page . getPrettyDate ( new Date ( user . timestamp * 1000 ) )
: '-'
2018-10-09 19:52:41 +00:00
const tr = document . createElement ( 'tr' )
tr . dataset . id = user . id
tr . innerHTML = `
2020-04-17 07:25:18 +00:00
< td class = "controls" > < input type = "checkbox" class = "checkbox" title = "Select" data - index = "${i}" data - action = "select" $ { selected ? ' checked' : '' } > < / t d >
2020-06-01 04:44:16 +00:00
< th$ { enabled ? '' : ' class="has-text-grey"' } > $ { user . username } < / t d >
2019-09-10 16:31:27 +00:00
< th > $ { user . uploads } < / t h >
< td > $ { page . getPrettyBytes ( user . usage ) } < / t d >
2018-10-10 17:33:11 +00:00
< td > $ { displayGroup } < / t d >
2020-05-16 15:32:32 +00:00
< td > $ { prettyDate } < / t d >
< td > $ { prettyTokenUpdate } < / t d >
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 06:20:11 +00:00
< td class = "controls has-text-right" >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-primary is-outlined" title = "Edit user" data - action = "edit-user" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
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 06:20:11 +00:00
< i class = "icon-pencil" > < / i >
2018-10-09 19:52:41 +00:00
< / s p a n >
< / a >
2019-09-19 07:19:11 +00:00
< a class = "button is-small is-info is-outlined" title = "${user.uploads ? 'View uploads' : 'User doesn\'t have uploads'}" data - action = "view-user-uploads" $ { user . uploads ? '' : 'disabled' } >
2019-01-03 04:49:56 +00:00
< span class = "icon" >
2019-01-03 04:54:20 +00:00
< i class = "icon-docs" > < / i >
2019-01-03 04:49:56 +00:00
< / s p a n >
< / a >
2020-06-01 04:44:16 +00:00
< a class = "button is-small is-dangerish is-outlined" title = "${enabled ? 'Disable user' : 'User is disabled'}" data - action = "disable-user" $ { enabled ? '' : 'disabled' } >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-hammer" > < / i >
< / s p a n >
< / a >
2019-10-06 23:11:07 +00:00
< a class = "button is-small is-danger is-outlined" title = "Delete user" data - action = "delete-user" >
2018-10-09 19:52:41 +00:00
< span class = "icon" >
< i class = "icon-trash" > < / i >
< / s p a n >
< / a >
< / t d >
`
table . appendChild ( tr )
2020-06-01 04:44:16 +00:00
page . checkboxes = table . querySelectorAll ( '.checkbox[data-action="select"]' )
2018-10-09 19:52:41 +00:00
}
2019-09-10 16:31:27 +00:00
const selectAll = document . querySelector ( '#selectAll' )
if ( selectAll && ! unselected ) {
selectAll . checked = true
selectAll . title = 'Unselect all'
2018-10-09 19:52:41 +00:00
}
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
const pageNum = users . length ? params . pageNum : 0
if ( params . forceScroll ||
page . prevPageNums [ page . currentView ] === null ||
page . prevPageNums [ page . currentView ] !== pageNum ) {
page . scrollToDom ( )
}
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
2019-09-10 16:31:27 +00:00
2020-12-26 16:50:52 +00:00
page . views [ page . currentView ] . pageNum = page . prevPageNums [ page . currentView ] = pageNum
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 06:20:11 +00:00
} ) . catch ( error => {
page . updateTrigger ( params . trigger )
2019-09-19 07:19:11 +00:00
page . onAxiosError ( error )
2018-10-09 19:52:41 +00:00
} )
}
2020-04-17 07:25:18 +00:00
page . createUser = ( ) => {
const groupOptions = Object . keys ( page . permissions ) . map ( ( g , i , a ) => {
const disabled = ! ( a [ i + 1 ] && page . permissions [ a [ i + 1 ] ] )
return ` <option value=" ${ g } " ${ disabled ? ' disabled' : '' } > ${ g } </option> `
} ) . join ( '\n' )
const div = document . createElement ( 'div' )
div . innerHTML = `
< div class = "field" >
< label class = "label" > Username < / l a b e l >
< div class = "controls" >
< input id = "swalUsername" class = "input" type = "text" >
< / d i v >
< / d i v >
< div class = "field" >
< label class = "label" > Password ( optional ) < / l a b e l >
< div class = "controls" >
< input id = "swalPassword" class = "input" type = "text" >
< / d i v >
< / d i v >
< div class = "field" >
< label class = "label" > User group < / l a b e l >
< div class = "control" >
< div class = "select is-fullwidth" >
< select id = "swalGroup" >
$ { groupOptions }
< / s e l e c t >
< / d i v >
< / d i v >
< / d i v >
`
swal ( {
title : 'Create new user' ,
icon : 'info' ,
content : div ,
buttons : {
cancel : true ,
confirm : {
closeModal : false
}
}
} ) . then ( proceed => {
if ( ! proceed ) return
axios . post ( 'api/users/create' , {
username : document . querySelector ( '#swalUsername' ) . value ,
password : document . querySelector ( '#swalPassword' ) . value ,
group : document . querySelector ( '#swalGroup' ) . value
} ) . then ( response => {
if ( ! response ) return
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2020-04-17 07:25:18 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2020-04-17 07:25:18 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2020-04-17 07:25:18 +00:00
const div = document . createElement ( 'div' )
div . innerHTML = `
< p > Username : < b > $ { response . data . username } < / b > < / p >
< p > Password : < code > $ { response . data . password } < / c o d e > < / p >
< p > User group : < b > $ { response . data . group } < / b > < / p >
`
swal ( {
title : 'Created a new user!' ,
icon : 'success' ,
content : div
} )
2020-05-02 19:39:24 +00:00
// Load last page of users list
2020-05-02 15:42:23 +00:00
// eslint-disable-next-line compat/compat
page . getUsers ( Object . assign ( page . views . users , {
pageNum : - 1
} ) )
2020-04-17 07:25:18 +00:00
} ) . catch ( page . onAxiosError )
} )
}
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 06:20:11 +00:00
page . editUser = id => {
2020-06-01 04:44:16 +00:00
const user = page . cache [ id ]
2018-12-18 17:01:28 +00:00
if ( ! user ) return
2018-10-09 19:52:41 +00:00
2021-01-08 19:51:23 +00:00
let isHigher = false
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 06:20:11 +00:00
const groupOptions = Object . keys ( page . permissions ) . map ( ( g , i , a ) => {
2018-10-10 17:33:11 +00:00
const selected = g === user . displayGroup
2021-01-08 19:51:23 +00:00
if ( selected ) {
isHigher = typeof a [ i + 1 ] !== 'undefined' && page . permissions [ a [ i + 1 ] ]
}
2018-10-10 17:33:11 +00:00
const disabled = ! ( a [ i + 1 ] && page . permissions [ a [ i + 1 ] ] )
return ` <option value=" ${ g } " ${ selected ? ' selected' : '' } ${ disabled ? ' disabled' : '' } > ${ g } </option> `
} ) . join ( '\n' )
2021-01-08 19:51:23 +00:00
const isDisabledHelper = isHigher ? '' : ' disabled'
2018-10-09 19:52:41 +00:00
const div = document . createElement ( 'div' )
div . innerHTML = `
2020-05-16 15:32:32 +00:00
< div class = "field" >
< p > User ID : $ { id } < / p >
< / d i v >
2018-10-09 19:52:41 +00:00
< div class = "field" >
< label class = "label" > Username < / l a b e l >
< div class = "controls" >
2021-01-08 19:51:23 +00:00
< input id = "swalUsername" class = "input" type = "text" value = "${user.username || ''}" $ { isDisabledHelper } >
2018-10-09 19:52:41 +00:00
< / d i v >
< / d i v >
2018-10-10 17:33:11 +00:00
< div class = "field" >
< label class = "label" > User group < / l a b e l >
< div class = "control" >
< div class = "select is-fullwidth" >
2021-01-08 19:51:23 +00:00
< select id = "swalGroup" $ { isDisabledHelper } >
2018-10-10 17:33:11 +00:00
$ { groupOptions }
< / s e l e c t >
< / d i v >
< / d i v >
< / d i v >
2018-10-09 19:52:41 +00:00
< div class = "field" >
< div class = "control" >
< label class = "checkbox" >
2021-01-08 19:51:23 +00:00
< input id = "swalEnabled" type = "checkbox" $ { user . enabled ? ' checked' : '' } $ { isDisabledHelper } >
2018-10-09 19:52:41 +00:00
Enabled
< / l a b e l >
< / d i v >
< / d i v >
< div class = "field" >
< div class = "control" >
< label class = "checkbox" >
2021-01-08 19:51:23 +00:00
< input id = "swalResetPassword" type = "checkbox" $ { isDisabledHelper } >
2018-10-09 19:52:41 +00:00
Reset password
< / l a b e l >
< / d i v >
< / d i v >
2021-01-08 19:51:23 +00:00
$ { isHigher
? ''
: ` <div class="notification is-danger">
2022-05-05 06:17:32 +00:00
You < b > cannot < / b > m o d i f y u s e r i n t h e s a m e o r h i g h e r g r o u p a s y o u .
2021-01-08 19:51:23 +00:00
< / d i v > `
}
2018-10-09 19:52:41 +00:00
`
swal ( {
title : 'Edit user' ,
icon : 'info' ,
content : div ,
buttons : {
cancel : true ,
confirm : {
closeModal : false
}
}
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 06:20:11 +00:00
} ) . then ( proceed => {
2019-01-01 19:39:08 +00:00
if ( ! proceed ) return
2018-10-09 19:52:41 +00:00
axios . post ( 'api/users/edit' , {
id ,
2019-08-20 02:16:34 +00:00
username : document . querySelector ( '#swalUsername' ) . value ,
group : document . querySelector ( '#swalGroup' ) . value ,
enabled : document . querySelector ( '#swalEnabled' ) . checked ,
resetPassword : document . querySelector ( '#swalResetPassword' ) . checked
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 06:20:11 +00:00
} ) . then ( response => {
2018-12-18 17:01:28 +00:00
if ( ! response ) return
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2018-10-09 19:52:41 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2018-10-09 19:52:41 +00:00
2020-04-18 19:52:11 +00:00
let autoClose = true
const div = document . createElement ( 'div' )
let displayName = user . username
if ( response . data . update . username !== user . username ) {
div . innerHTML += ` <p> ${ user . username } was renamed into: <b> ${ response . data . update . username } </b>.</p> `
autoClose = false
displayName = response . data . update . username
}
if ( response . data . update . password ) {
div . innerHTML += `
< p > $ { displayName } ' s new password is : < / p >
< p > < code > $ { response . data . update . password } < / c o d e > < / p >
2018-10-09 19:52:41 +00:00
`
2020-04-18 19:52:11 +00:00
autoClose = false
2018-12-18 17:41:42 +00:00
}
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . update . enabled !== user . enabled ) {
2020-04-18 19:52:11 +00:00
div . innerHTML += ` <p> ${ displayName } has been ${ response . data . update . enabled ? 'enabled' : 'disabled' } !</p> `
2020-10-30 18:12:09 +00:00
}
2020-04-18 19:52:11 +00:00
2020-10-30 18:12:09 +00:00
if ( ! div . innerHTML ) {
2020-04-18 19:52:11 +00:00
div . innerHTML = ` <p> ${ displayName } was edited!</p> `
2020-10-30 18:12:09 +00:00
}
2020-04-18 19:52:11 +00:00
swal ( {
title : 'Success!' ,
icon : 'success' ,
content : div ,
buttons : ! autoClose ,
timer : autoClose ? 1500 : null
} )
2018-10-09 19:52:41 +00:00
page . getUsers ( page . views . users )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-10-09 19:52:41 +00:00
} )
}
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 06:20:11 +00:00
page . disableUser = id => {
2020-06-01 04:44:16 +00:00
const user = page . cache [ id ]
2019-01-01 19:39:08 +00:00
if ( ! user || ! user . enabled ) return
const content = document . createElement ( 'div' )
2019-10-06 23:11:07 +00:00
content . innerHTML = `
2020-06-01 04:44:16 +00:00
< p > You will be disabling a user named < b > $ { page . cache [ id ] . username } < / b > . < / p >
2019-10-06 23:11:07 +00:00
< p > Their files will remain . < / p >
`
2019-01-01 19:39:08 +00:00
2018-10-09 19:52:41 +00:00
swal ( {
title : 'Are you sure?' ,
icon : 'warning' ,
2019-01-01 19:39:08 +00:00
content ,
2018-10-09 19:52:41 +00:00
dangerMode : true ,
buttons : {
cancel : true ,
confirm : {
text : 'Yes, disable them!' ,
closeModal : false
}
}
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 06:20:11 +00:00
} ) . then ( proceed => {
2018-12-18 17:41:42 +00:00
if ( ! proceed ) return
2018-10-09 19:52:41 +00:00
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 06:20:11 +00:00
axios . post ( 'api/users/disable' , { id } ) . then ( response => {
2018-12-18 17:41:42 +00:00
if ( ! response ) return
2018-10-09 19:52:41 +00:00
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
if ( response . data . description === 'No token provided' ) {
2018-10-09 19:52:41 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else {
2018-10-09 19:52:41 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
}
2018-10-09 19:52:41 +00:00
2020-06-01 04:44:16 +00:00
swal ( 'Success!' , ` ${ page . cache [ id ] . username } has been disabled. ` , 'success' , {
2019-10-29 12:39:44 +00:00
buttons : false ,
timer : 1500
} )
2018-10-09 19:52:41 +00:00
page . getUsers ( page . views . users )
2019-09-19 07:19:11 +00:00
} ) . catch ( page . onAxiosError )
2018-10-09 19:52:41 +00:00
} )
2018-10-08 18:54:16 +00:00
}
2019-01-01 19:39:08 +00:00
2019-10-06 23:11:07 +00:00
page . deleteUser = id => {
2020-06-01 04:44:16 +00:00
const user = page . cache [ id ]
2019-10-06 23:16:47 +00:00
if ( ! user ) return
2019-10-06 23:11:07 +00:00
const content = document . createElement ( 'div' )
content . innerHTML = `
2020-06-01 04:44:16 +00:00
< p > You will be deleting a user named < b > $ { page . cache [ id ] . username } < / b > . < p >
2021-06-06 11:31:17 +00:00
< p > Their uploads will still remain , unless you choose otherwise . < / p >
2019-10-06 23:11:07 +00:00
`
swal ( {
title : 'Are you sure?' ,
icon : 'warning' ,
content ,
dangerMode : true ,
buttons : {
cancel : true ,
confirm : {
2021-06-06 11:31:17 +00:00
text : 'Yes, ONLY the user!' ,
2019-10-06 23:11:07 +00:00
closeModal : false
} ,
purge : {
2021-06-06 11:31:17 +00:00
text : 'Yes, AND their uploads too!' ,
2019-10-06 23:11:07 +00:00
value : 'purge' ,
className : 'swal-button--danger' ,
closeModal : false
}
}
} ) . then ( proceed => {
if ( ! proceed ) return
axios . post ( 'api/users/delete' , {
id ,
purge : proceed === 'purge'
} ) . then ( response => {
if ( ! response ) return
if ( response . data . success === false ) {
const failed = Array . isArray ( response . data . failed )
? response . data . failed
: [ ]
2020-10-30 18:12:09 +00:00
if ( response . data . description === 'No token provided' ) {
2019-10-06 23:11:07 +00:00
return page . verifyToken ( page . token )
2020-10-30 18:12:09 +00:00
} else if ( failed . length ) {
2019-10-06 23:11:07 +00:00
return swal ( 'An error occurred!' , ` Unable to delete ${ failed . length } of the user's upload ${ failed . length === 1 ? '' : 's' } . ` , 'error' )
2020-10-30 18:12:09 +00:00
} else {
2019-10-06 23:11:07 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
2020-10-30 18:12:09 +00:00
}
2019-10-06 23:11:07 +00:00
}
2020-06-01 04:44:16 +00:00
swal ( 'Success!' , ` ${ page . cache [ id ] . username } has been deleted. ` , 'success' , {
2019-10-29 12:39:44 +00:00
buttons : false ,
timer : 1500
} )
2019-10-06 23:11:07 +00:00
// Reload users list
// eslint-disable-next-line compat/compat
2020-05-02 15:42:23 +00:00
page . getUsers ( Object . assign ( page . views . users , {
2019-10-06 23:11:07 +00:00
autoPage : true
2020-05-02 15:42:23 +00:00
} ) )
2019-10-06 23:11:07 +00:00
} ) . catch ( page . onAxiosError )
} )
}
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 06:20:11 +00:00
// Roughly based on https://github.com/mayuska/pagination/blob/master/index.js
page . paginate = ( totalItems , itemsPerPage , currentPage ) => {
2019-01-01 19:39:08 +00:00
currentPage = currentPage + 1
const step = 3
const numPages = Math . ceil ( totalItems / itemsPerPage )
let template = ''
const elementsToShow = step * 2
const add = {
pageNum ( start , end ) {
2020-10-30 18:12:09 +00:00
for ( let i = start ; i <= end ; ++ i ) {
2019-01-07 22:54:12 +00:00
template += ` <li><a class="button pagination-link ${ i === currentPage ? ' is-current' : '' } " aria-label="Goto page ${ i } " data-action="page-goto" data-goto=" ${ i - 1 } "> ${ i } </a></li> `
2020-10-30 18:12:09 +00:00
}
2019-01-01 19:39:08 +00:00
} ,
startDots ( ) {
template += `
2019-01-07 22:54:12 +00:00
< li > < a class = "button pagination-link" aria - label = "Goto page 1" data - action = "page-goto" data - goto = "0" > 1 < / a > < / l i >
2019-08-26 22:23:54 +00:00
< li data - action = "page-ellipsis" > < span class = "pagination-ellipsis" > & hellip ; < / s p a n > < / l i >
2019-01-01 19:39:08 +00:00
`
} ,
endDots ( ) {
template += `
2019-08-26 22:23:54 +00:00
< li data - action = "page-ellipsis" > < span class = "pagination-ellipsis" > & hellip ; < / s p a n > < / l i >
2019-01-07 22:54:12 +00:00
< li > < a class = "button pagination-link" aria - label = "Goto page ${numPages}" data - action = "page-goto" data - goto = "${numPages - 1}" > $ { numPages } < / a > < / l i >
2019-01-01 19:39:08 +00:00
`
}
}
2019-06-17 19:34:15 +00:00
if ( elementsToShow + 1 >= numPages ) {
2019-01-01 19:39:08 +00:00
add . pageNum ( 1 , numPages )
} else if ( currentPage < elementsToShow ) {
add . pageNum ( 1 , elementsToShow )
add . endDots ( )
2019-06-17 19:34:15 +00:00
} else if ( currentPage > numPages - elementsToShow + 1 ) {
2019-01-01 19:39:08 +00:00
add . startDots ( )
2019-06-17 19:34:15 +00:00
add . pageNum ( numPages - elementsToShow + 1 , numPages )
2019-01-01 19:39:08 +00:00
} else {
add . startDots ( )
2019-06-17 19:34:15 +00:00
add . pageNum ( currentPage - step + 1 , currentPage + step - 1 )
2019-01-01 19:39:08 +00:00
add . endDots ( )
}
return `
< nav class = "pagination is-centered is-small" >
2019-10-07 03:34:10 +00:00
< a class = "button pagination-previous" data - action = "page-prev" $ { currentPage === 1 ? ' disabled' : '' } > Previous < / a >
2020-05-02 15:47:04 +00:00
< a class = "button pagination-next" data - action = "page-next" $ { currentPage >= numPages ? ' disabled' : '' } > Next page < / a >
2019-01-01 19:39:08 +00:00
< ul class = "pagination-list" > $ { template } < / u l >
< / n a v >
`
}
2018-10-08 18:54:16 +00:00
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 06:20:11 +00:00
page . getStatistics = ( params = { } ) => {
2020-10-30 18:12:09 +00:00
if ( ! page . permissions . admin ) return swal ( 'An error occurred!' , 'You cannot do this!' , 'error' )
2019-04-05 17:32:52 +00:00
2020-10-30 18:12:09 +00:00
if ( page . isSomethingLoading ) return page . warnSomethingLoading ( )
2020-05-16 17:11:10 +00:00
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'loading' )
2019-09-19 07:19:11 +00:00
2019-04-05 17:32:52 +00:00
const url = 'api/stats'
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 06:20:11 +00:00
axios . get ( url ) . then ( response => {
2020-10-30 18:12:09 +00:00
if ( response . data . success === false ) {
2019-04-05 17:32:52 +00:00
if ( response . data . description === 'No token provided' ) {
return page . verifyToken ( page . token )
} else {
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 06:20:11 +00:00
page . updateTrigger ( params . trigger )
2019-04-05 17:32:52 +00:00
return swal ( 'An error occurred!' , response . data . description , 'error' )
}
2020-10-30 18:12:09 +00:00
}
2019-04-05 17:32:52 +00:00
2019-04-12 00:45:33 +00:00
let content = ''
2019-09-01 19:23:16 +00:00
const keys = Object . keys ( response . data . stats )
for ( let i = 0 ; i < keys . length ; i ++ ) {
2019-04-12 00:45:33 +00:00
let rows = ''
2020-10-30 18:12:09 +00:00
if ( ! response . data . stats [ keys [ i ] ] ) {
2019-04-12 00:45:33 +00:00
rows += `
< tr >
2019-06-03 19:40:24 +00:00
< td > Generating , please try again later\u2026 < / t d >
< td > < / t d >
2019-04-12 00:45:33 +00:00
< / t r >
`
2020-10-30 18:12:09 +00:00
} else {
2019-09-08 01:56:29 +00:00
try {
const valKeys = Object . keys ( response . data . stats [ keys [ i ] ] )
for ( let j = 0 ; j < valKeys . length ; j ++ ) {
2020-12-25 14:06:21 +00:00
const data = response . data . stats [ keys [ i ] ] [ valKeys [ j ] ]
const type = typeof data === 'object' ? data . type : 'auto'
const value = typeof data === 'object' ? data . value : data
let parsed
switch ( type ) {
case 'byte' :
parsed = page . getPrettyBytes ( value )
break
2021-01-27 16:50:45 +00:00
case 'byteUsage' : {
// Reasoning: https://github.com/sebhildebrandt/systeminformation/issues/464#issuecomment-756406053
const totalForPercentage = typeof value . available !== 'undefined'
? ( value . used + value . available )
: value . total
parsed = ` ${ page . getPrettyBytes ( value . used ) } / ${ page . getPrettyBytes ( value . total ) } ( ${ ( value . used / totalForPercentage * 100 ) . toFixed ( 2 ) } %) `
2020-12-25 14:06:21 +00:00
break
2021-01-27 16:50:45 +00:00
}
2020-12-25 14:06:21 +00:00
case 'uptime' :
parsed = page . getPrettyUptime ( value )
break
case 'auto' :
switch ( typeof value ) {
case 'number' :
parsed = value . toLocaleString ( )
break
default :
parsed = value
}
break
default :
parsed = value
2020-10-30 18:12:09 +00:00
}
2019-09-10 16:31:27 +00:00
2019-09-08 01:56:29 +00:00
rows += `
< tr >
2020-12-25 14:06:21 +00:00
< th > $ { valKeys [ j ] } < / t h >
2019-09-10 16:31:27 +00:00
< td > $ { parsed } < / t d >
2019-09-08 01:56:29 +00:00
< / t r >
`
}
} catch ( error ) {
rows = `
< tr >
< td > Error parsing response . Try again ? < / t d >
< td > < / t d >
< / t r >
`
2019-09-19 07:19:11 +00:00
page . onError ( error )
2019-06-03 19:40:24 +00:00
}
2020-10-30 18:12:09 +00:00
}
2019-06-03 19:40:24 +00:00
2019-04-12 00:45:33 +00:00
content += `
2020-07-28 14:47:48 +00:00
< div class = "table-container has-text-left" >
2020-05-16 20:35:54 +00:00
< table id = "statistics" class = "table is-narrow is-fullwidth is-hoverable" >
2019-04-12 00:45:33 +00:00
< thead >
< tr >
2020-05-16 20:35:54 +00:00
< th class = "capitalize" > $ { keys [ i ] } < / t h >
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 06:20:11 +00:00
< td > < / t d >
2019-04-12 00:45:33 +00:00
< / t r >
< / t h e a d >
< tbody >
$ { rows }
< / t b o d y >
< / t a b l e >
< / d i v >
2019-04-05 17:32:52 +00:00
`
}
2020-10-30 18:12:09 +00:00
if ( Array . isArray ( response . data . hrtime ) ) {
2020-08-24 01:08:21 +00:00
content += `
< article class = "message is-size-7" >
< div class = "message-body has-text-left" >
Time taken : $ { response . data . hrtime [ 0 ] } s $ { Math . ceil ( response . data . hrtime [ 1 ] / 1000000 ) } ms .
< / d i v >
< / a r t i c l e >
`
2020-10-30 18:12:09 +00:00
}
2020-08-24 01:08:21 +00:00
2019-09-10 16:31:27 +00:00
page . dom . innerHTML = content
2020-12-26 16:50:52 +00:00
page . fadeInDom ( )
page . scrollToDom ( )
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 06:20:11 +00:00
page . updateTrigger ( params . trigger , 'active' )
} ) . catch ( error => {
page . updateTrigger ( params . trigger )
2019-09-19 07:19:11 +00:00
page . onAxiosError ( error )
2019-04-05 17:32:52 +00:00
} )
}
2020-06-19 19:30:57 +00:00
window . addEventListener ( 'DOMContentLoaded' , ( ) => {
2019-09-19 07:19:11 +00:00
// Polyfill Object.assign()
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 06:20:11 +00:00
// eslint-disable-next-line compat/compat
2020-10-30 18:12:09 +00:00
if ( typeof Object . assign !== 'function' ) {
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 06:20:11 +00:00
// Must be writable: true, enumerable: false, configurable: true
Object . defineProperty ( Object , 'assign' , {
value : function assign ( target , varArgs ) { // .length of function is 2
'use strict'
2021-01-27 17:06:05 +00:00
if ( target === null || typeof target === 'undefined' ) {
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 06:20:11 +00:00
throw new TypeError ( 'Cannot convert undefined or null to object' )
2020-10-30 18:12:09 +00:00
}
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 06:20:11 +00:00
const to = Object ( target )
for ( let i = 1 ; i < arguments . length ; i ++ ) {
const nextSource = arguments [ i ]
2021-01-27 17:06:05 +00:00
if ( nextSource !== null && typeof nextSource !== 'undefined' ) {
2020-10-30 18:12:09 +00:00
for ( const nextKey in nextSource ) {
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 06:20:11 +00:00
// Avoid bugs when hasOwnProperty is shadowed
2020-10-30 18:12:09 +00:00
if ( Object . prototype . hasOwnProperty . call ( nextSource , nextKey ) ) {
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 06:20:11 +00:00
to [ nextKey ] = nextSource [ nextKey ]
2020-10-30 18:12:09 +00:00
}
}
}
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 06:20:11 +00:00
}
return to
} ,
writable : true ,
configurable : true
} )
2020-10-30 18:12:09 +00:00
}
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 06:20:11 +00:00
2018-03-28 11:36:28 +00:00
// Add 'no-touch' class to non-touch devices
2020-10-30 18:12:09 +00:00
if ( ! ( 'ontouchstart' in document . documentElement ) ) {
2018-05-01 14:41:25 +00:00
document . documentElement . classList . add ( 'no-touch' )
2020-10-30 18:12:09 +00:00
}
2018-03-28 20:05:01 +00:00
2020-06-01 04:44:16 +00:00
const selectedKeys = [ 'uploads' , 'uploadsAll' , 'albums' , 'albumsAll' , 'users' ]
2019-09-01 19:23:16 +00:00
for ( let i = 0 ; i < selectedKeys . length ; i ++ ) {
const ls = localStorage [ lsKeys . selected [ selectedKeys [ i ] ] ]
if ( ls ) page . selected [ selectedKeys [ i ] ] = JSON . parse ( ls )
2018-03-29 23:22:08 +00:00
}
2018-04-29 12:47:24 +00:00
page . preparePage ( )
2018-03-28 20:05:01 +00:00
2018-04-29 12:47:24 +00:00
page . clipboardJS = new ClipboardJS ( '.clipboard-js' )
2018-03-28 20:05:01 +00:00
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 06:20:11 +00:00
page . clipboardJS . on ( 'success' , ( ) => {
2019-10-29 12:39:44 +00:00
return swal ( '' , 'The link has been copied to clipboard.' , 'success' , {
buttons : false ,
timer : 1500
} )
2018-03-28 20:05:01 +00:00
} )
2019-09-19 07:19:11 +00:00
page . clipboardJS . on ( 'error' , page . onError )
2018-04-29 12:47:24 +00:00
page . lazyLoad = new LazyLoad ( )
2020-12-26 11:49:51 +00:00
page . albumsSidebarCollapse = document . querySelector ( '#albumsSidebarCollapse' )
/* eslint-disable-next-line new-cap */
page . albumsSidebarCollapsible = new bulmaCollapsible ( document . querySelector ( '#albumsSidebar' ) )
page . albumsSidebarCollapsible . on ( 'before:expand' , event => {
page . albumsSidebarCollapse . innerText = page . albumsSidebarCollapse . dataset . textCollapse
} )
page . albumsSidebarCollapsible . on ( 'before:collapse' , event => {
page . albumsSidebarCollapse . innerText = page . albumsSidebarCollapse . dataset . textExpand
} )
2020-06-19 19:30:57 +00:00
} )