diff --git a/dist/css/home.css b/dist/css/home.css index 8e4c595..f63bd45 100644 --- a/dist/css/home.css +++ b/dist/css/home.css @@ -1,2 +1,2 @@ -#b{width:200px;height:200px;border-radius:100%;display:inline-block;margin-bottom:40px;vertical-align:top;-webkit-animation-delay:.5s;animation-delay:.5s;-webkit-animation-duration:1.5s;animation-duration:1.5s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:floatUp;animation-name:floatUp;-webkit-animation-timing-function:cubic-bezier(0,.71,.29,1);animation-timing-function:cubic-bezier(0,.71,.29,1);box-shadow:0 20px 60px rgba(10,10,10,.05),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2)}#b img.logo{max-height:200px}#dropzone *{pointer-events:none}#panel,#tokenContainer{display:none}#maxSize{font-size:1rem}.dz-preview .dz-details{display:flex}.dz-preview .dz-details .dz-filename,.dz-preview .dz-details .dz-size{flex:1}.dz-preview .dz-error-mark,.dz-preview .dz-success-mark,.dz-preview img{display:none}@-webkit-keyframes floatUp{0%{opacity:0;box-shadow:0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0);transform:scale(.86)}25%{opacity:1}67%{box-shadow:0 0 0 rgba(10,10,10,0),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}to{box-shadow:0 20px 60px rgba(10,10,10,.05),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}}@keyframes floatUp{0%{opacity:0;box-shadow:0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0);transform:scale(.86)}25%{opacity:1}67%{box-shadow:0 0 0 rgba(10,10,10,0),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}to{box-shadow:0 20px 60px rgba(10,10,10,.05),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}}.uploads>div{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s;margin:1rem}.uploads>div:first-child{margin-top:1.5rem}.uploads.nojs{margin-bottom:0}.uploads .field>.icon:not(.icon-block){color:#3794d2}.uploads .field>.icon.icon-block{color:#da4453}.uploads progress{margin-top:.5rem;margin-bottom:1rem}.uploads img{max-width:200px}.name{font-size:1rem;color:#bdc3c7}.link>a,.name{word-break:break-all}.clipboard-mobile{margin-top:5px}#albumDiv{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#albumDiv .control{text-align:inherit}#linksColumn{margin-top:-.25rem;margin-left:-.25rem;margin-right:-.25rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#linksColumn .column{padding:.25rem}#linksColumn>span{padding:0 .3rem;color:#7f8c8d}.git-commit a{display:inline-block;word-break:break-all}#tabs{margin-bottom:1rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#tabs ul{border-bottom:1px solid #898b8d}#tabs li a{color:#bdc3c7;border-bottom-color:#898b8d}#tabs.is-boxed li.is-active a{color:#3794d2;background:#232629;border-color:#898b8d #898b8d #232629}#tabs.is-boxed li:not(.is-active) a:hover{background:#4d4d4d}.tab-content{margin-bottom:-.75rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}.tab-content .label{color:#bdc3c7;font-weight:400}#tab-config.tab-content form{margin-bottom:.75rem}#urlMaxSize{font-weight:700}.render{position:fixed;right:0;bottom:0;font-size:1rem;color:#bdc3c7;cursor:pointer}.render.button{border-bottom-left-radius:0;border-bottom-right-radius:0;right:1%;opacity:.25;transition:opacity .25s}.render.button:hover{opacity:1} +#b{width:200px;height:200px;border-radius:100%;display:inline-block;margin-bottom:40px;vertical-align:top;-webkit-animation-delay:.5s;animation-delay:.5s;-webkit-animation-duration:1.5s;animation-duration:1.5s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:floatUp;animation-name:floatUp;-webkit-animation-timing-function:cubic-bezier(0,.71,.29,1);animation-timing-function:cubic-bezier(0,.71,.29,1);box-shadow:0 20px 60px rgba(10,10,10,.05),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2)}#b img.logo{max-height:200px}#dropzone *{pointer-events:none}#panel,#tokenContainer{display:none}#maxSize{font-size:1rem}.dz-preview .dz-details{display:flex}.dz-preview .dz-details .dz-filename,.dz-preview .dz-details .dz-size{flex:1}.dz-preview .dz-error-mark,.dz-preview .dz-success-mark,.dz-preview img{display:none}@-webkit-keyframes floatUp{0%{opacity:0;box-shadow:0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0);transform:scale(.86)}25%{opacity:1}67%{box-shadow:0 0 0 rgba(10,10,10,0),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}to{box-shadow:0 20px 60px rgba(10,10,10,.05),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}}@keyframes floatUp{0%{opacity:0;box-shadow:0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0),0 0 0 rgba(10,10,10,0);transform:scale(.86)}25%{opacity:1}67%{box-shadow:0 0 0 rgba(10,10,10,0),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}to{box-shadow:0 20px 60px rgba(10,10,10,.05),0 5px 10px rgba(10,10,10,.1),0 1px 1px rgba(10,10,10,.2);transform:scale(1)}}.uploads.is-reversed{display:flex;flex-direction:column-reverse}.uploads>div{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s;margin:1rem}.uploads.is-reversed>div{flex:0 0 auto}.uploads>div:first-child{margin-top:1.5rem}.uploads.nojs{margin-bottom:0}.uploads>div>.icon:not(.icon-block){color:#3794d2}.uploads>div>.icon.icon-block{color:#da4453}.uploads progress{margin-top:.5rem;margin-bottom:1rem}.uploads img{max-width:200px}.name{font-size:1rem;color:#bdc3c7}.link>a,.name{word-break:break-all}.clipboard-mobile{margin-top:5px}#albumDiv{-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#albumDiv .control{text-align:inherit}#linksColumn{margin-top:-.25rem;margin-left:-.25rem;margin-right:-.25rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#linksColumn .column{padding:.25rem}#linksColumn>span{padding:0 .3rem;color:#7f8c8d}.git-commit a{display:inline-block;word-break:break-all}#tabs{margin-bottom:1rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}#tabs ul{border-bottom:1px solid #898b8d}#tabs li a{color:#bdc3c7;border-bottom-color:#898b8d}#tabs.is-boxed li.is-active a{color:#3794d2;background:#232629;border-color:#898b8d #898b8d #232629}#tabs.is-boxed li:not(.is-active) a:hover{background:#4d4d4d}.tab-content{margin-bottom:-.75rem;-webkit-animation:fadeInOpacity .5s;animation:fadeInOpacity .5s}.tab-content .label{color:#bdc3c7;font-weight:400}#tab-config.tab-content form{margin-bottom:.75rem}#urlMaxSize{font-weight:700}.render{position:fixed;right:0;bottom:0;font-size:1rem;color:#bdc3c7;cursor:pointer}.render.button{border-bottom-left-radius:0;border-bottom-right-radius:0;right:1%;opacity:.25;transition:opacity .25s}.render.button:hover{opacity:1} /*# sourceMappingURL=home.css.map */ diff --git a/dist/css/home.css.map b/dist/css/home.css.map index 8803b5a..e4368a3 100644 --- a/dist/css/home.css.map +++ b/dist/css/home.css.map @@ -1 +1 @@ -{"version":3,"sources":["home.css"],"names":[],"mappings":"AAAA,GACE,WAAY,CACZ,YAAa,CACb,kBAAmB,CACnB,oBAAqB,CACrB,kBAAmB,CACnB,kBAAmB,CACnB,2BAAqB,CAArB,mBAAqB,CACrB,+BAAwB,CAAxB,uBAAwB,CACxB,gCAAyB,CAAzB,wBAAyB,CACzB,8BAAuB,CAAvB,sBAAuB,CACvB,2DAAyD,CAAzD,mDAAyD,CACzD,kGACF,CAEA,YACE,gBACF,CAEA,YACE,mBACF,CAEA,uBAEE,YACF,CAEA,SACE,cACF,CAEA,wBACE,YACF,CAEA,sEAEE,MACF,CAEA,wEAGE,YACF,CAEA,2BACE,GACE,SAAU,CACV,+EAA2F,CAC3F,oBACF,CAEA,IACE,SACF,CAEA,IACE,0FAAwG,CACxG,kBACF,CAEA,GACE,kGAAiH,CACjH,kBACF,CACF,CAEA,mBACE,GACE,SAAU,CACV,+EAA2F,CAC3F,oBACF,CAEA,IACE,SACF,CAEA,IACE,0FAAwG,CACxG,kBACF,CAEA,GACE,kGAAiH,CACjH,kBACF,CACF,CAEA,aACE,mCAA6B,CAA7B,2BAA6B,CAC7B,WACF,CAEA,yBACE,iBACF,CAEA,cACE,eACF,CAEA,uCACE,aACF,CAEA,iCACE,aACF,CAEA,kBACE,gBAAkB,CAClB,kBACF,CAEA,aACE,eACF,CAEA,MACE,cAAe,CACf,aAEF,CAEA,cAHE,oBAKF,CAEA,kBACE,cACF,CAEA,UACE,mCAA4B,CAA5B,2BACF,CAEA,mBACE,kBACF,CAEA,aACE,kBAAoB,CACpB,mBAAqB,CACrB,oBAAsB,CACtB,mCAA4B,CAA5B,2BACF,CAEA,qBACE,cACF,CAEA,kBACE,eAAiB,CACjB,aACF,CAEA,cACE,oBAAqB,CACrB,oBACF,CAEA,MACE,kBAAmB,CACnB,mCAA4B,CAA5B,2BACF,CAEA,SACE,+BACF,CAEA,WACE,aAAc,CACd,2BACF,CAEA,8BACE,aAAc,CACd,kBAAmB,CAEnB,oCACF,CAEA,0CACE,kBACF,CAEA,aACE,qBAAuB,CACvB,mCAA4B,CAA5B,2BACF,CAEA,oBACE,aAAc,CACd,eACF,CAEA,6BACE,oBACF,CAEA,YACE,eACF,CAEA,QACE,cAAe,CACf,OAAQ,CACR,QAAS,CACT,cAAe,CACf,aAAc,CACd,cACF,CAEA,eACE,2BAA4B,CAC5B,4BAA6B,CAC7B,QAAS,CACT,WAAa,CACb,uBACF,CAEA,qBACE,SACF","file":"home.css","sourcesContent":["#b {\n width: 200px;\n height: 200px;\n border-radius: 100%;\n display: inline-block;\n margin-bottom: 40px;\n vertical-align: top;\n animation-delay: 0.5s;\n animation-duration: 1.5s;\n animation-fill-mode: both;\n animation-name: floatUp;\n animation-timing-function: cubic-bezier(0, 0.71, 0.29, 1);\n box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2)\n}\n\n#b img.logo {\n max-height: 200px\n}\n\n#dropzone * {\n pointer-events: none\n}\n\n#tokenContainer,\n#panel {\n display: none\n}\n\n#maxSize {\n font-size: 1rem\n}\n\n.dz-preview .dz-details {\n display: flex\n}\n\n.dz-preview .dz-details .dz-size,\n.dz-preview .dz-details .dz-filename {\n flex: 1\n}\n\n.dz-preview img,\n.dz-preview .dz-success-mark,\n.dz-preview .dz-error-mark {\n display: none\n}\n\n@-webkit-keyframes floatUp {\n 0% {\n opacity: 0;\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0);\n transform: scale(0.86)\n }\n\n 25% {\n opacity: 100\n }\n\n 67% {\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n\n 100% {\n box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n}\n\n@keyframes floatUp {\n 0% {\n opacity: 0;\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0);\n transform: scale(0.86)\n }\n\n 25% {\n opacity: 100\n }\n\n 67% {\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n\n 100% {\n box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n}\n\n.uploads > div {\n animation: fadeInOpacity 0.5s;\n margin: 1rem\n}\n\n.uploads > div:first-child {\n margin-top: 1.5rem\n}\n\n.uploads.nojs {\n margin-bottom: 0\n}\n\n.uploads .field > .icon:not(.icon-block) {\n color: #3794d2\n}\n\n.uploads .field > .icon.icon-block {\n color: #da4453\n}\n\n.uploads progress {\n margin-top: 0.5rem;\n margin-bottom: 1rem\n}\n\n.uploads img {\n max-width: 200px\n}\n\n.name {\n font-size: 1rem;\n color: #bdc3c7;\n word-break: break-all\n}\n\n.link > a {\n word-break: break-all\n}\n\n.clipboard-mobile {\n margin-top: 5px\n}\n\n#albumDiv {\n animation: fadeInOpacity 0.5s\n}\n\n#albumDiv .control {\n text-align: inherit\n}\n\n#linksColumn {\n margin-top: -0.25rem;\n margin-left: -0.25rem;\n margin-right: -0.25rem;\n animation: fadeInOpacity 0.5s\n}\n\n#linksColumn .column {\n padding: 0.25rem\n}\n\n#linksColumn > span {\n padding: 0 0.3rem;\n color: #7f8c8d\n}\n\n.git-commit a {\n display: inline-block;\n word-break: break-all\n}\n\n#tabs {\n margin-bottom: 1rem;\n animation: fadeInOpacity 0.5s\n}\n\n#tabs ul {\n border-bottom: 1px solid #898b8d\n}\n\n#tabs li a {\n color: #bdc3c7;\n border-bottom-color: #898b8d\n}\n\n#tabs.is-boxed li.is-active a {\n color: #3794d2;\n background: #232629;\n border-color: #898b8d;\n border-bottom-color: #232629\n}\n\n#tabs.is-boxed li:not(.is-active) a:hover {\n background: #4d4d4d\n}\n\n.tab-content {\n margin-bottom: -0.75rem;\n animation: fadeInOpacity 0.5s\n}\n\n.tab-content .label {\n color: #bdc3c7;\n font-weight: normal\n}\n\n#tab-config.tab-content form {\n margin-bottom: 0.75rem\n}\n\n#urlMaxSize {\n font-weight: bold\n}\n\n.render {\n position: fixed;\n right: 0;\n bottom: 0;\n font-size: 1rem;\n color: #bdc3c7;\n cursor: pointer\n}\n\n.render.button {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n right: 1%;\n opacity: 0.25;\n transition: opacity 0.25s\n}\n\n.render.button:hover {\n opacity: 1\n}\n"]} \ No newline at end of file +{"version":3,"sources":["home.css"],"names":[],"mappings":"AAAA,GACE,WAAY,CACZ,YAAa,CACb,kBAAmB,CACnB,oBAAqB,CACrB,kBAAmB,CACnB,kBAAmB,CACnB,2BAAqB,CAArB,mBAAqB,CACrB,+BAAwB,CAAxB,uBAAwB,CACxB,gCAAyB,CAAzB,wBAAyB,CACzB,8BAAuB,CAAvB,sBAAuB,CACvB,2DAAyD,CAAzD,mDAAyD,CACzD,kGACF,CAEA,YACE,gBACF,CAEA,YACE,mBACF,CAEA,uBAEE,YACF,CAEA,SACE,cACF,CAEA,wBACE,YACF,CAEA,sEAEE,MACF,CAEA,wEAGE,YACF,CAEA,2BACE,GACE,SAAU,CACV,+EAA2F,CAC3F,oBACF,CAEA,IACE,SACF,CAEA,IACE,0FAAwG,CACxG,kBACF,CAEA,GACE,kGAAiH,CACjH,kBACF,CACF,CAEA,mBACE,GACE,SAAU,CACV,+EAA2F,CAC3F,oBACF,CAEA,IACE,SACF,CAEA,IACE,0FAAwG,CACxG,kBACF,CAEA,GACE,kGAAiH,CACjH,kBACF,CACF,CAEA,qBACE,YAAa,CACb,6BACF,CAEA,aACE,mCAA6B,CAA7B,2BAA6B,CAC7B,WACF,CAEA,yBACE,aACF,CAEA,yBACE,iBACF,CAEA,cACE,eACF,CAEA,oCACE,aACF,CAEA,8BACE,aACF,CAEA,kBACE,gBAAkB,CAClB,kBACF,CAEA,aACE,eACF,CAEA,MACE,cAAe,CACf,aAEF,CAEA,cAHE,oBAKF,CAEA,kBACE,cACF,CAEA,UACE,mCAA4B,CAA5B,2BACF,CAEA,mBACE,kBACF,CAEA,aACE,kBAAoB,CACpB,mBAAqB,CACrB,oBAAsB,CACtB,mCAA4B,CAA5B,2BACF,CAEA,qBACE,cACF,CAEA,kBACE,eAAiB,CACjB,aACF,CAEA,cACE,oBAAqB,CACrB,oBACF,CAEA,MACE,kBAAmB,CACnB,mCAA4B,CAA5B,2BACF,CAEA,SACE,+BACF,CAEA,WACE,aAAc,CACd,2BACF,CAEA,8BACE,aAAc,CACd,kBAAmB,CAEnB,oCACF,CAEA,0CACE,kBACF,CAEA,aACE,qBAAuB,CACvB,mCAA4B,CAA5B,2BACF,CAEA,oBACE,aAAc,CACd,eACF,CAEA,6BACE,oBACF,CAEA,YACE,eACF,CAEA,QACE,cAAe,CACf,OAAQ,CACR,QAAS,CACT,cAAe,CACf,aAAc,CACd,cACF,CAEA,eACE,2BAA4B,CAC5B,4BAA6B,CAC7B,QAAS,CACT,WAAa,CACb,uBACF,CAEA,qBACE,SACF","file":"home.css","sourcesContent":["#b {\n width: 200px;\n height: 200px;\n border-radius: 100%;\n display: inline-block;\n margin-bottom: 40px;\n vertical-align: top;\n animation-delay: 0.5s;\n animation-duration: 1.5s;\n animation-fill-mode: both;\n animation-name: floatUp;\n animation-timing-function: cubic-bezier(0, 0.71, 0.29, 1);\n box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2)\n}\n\n#b img.logo {\n max-height: 200px\n}\n\n#dropzone * {\n pointer-events: none\n}\n\n#tokenContainer,\n#panel {\n display: none\n}\n\n#maxSize {\n font-size: 1rem\n}\n\n.dz-preview .dz-details {\n display: flex\n}\n\n.dz-preview .dz-details .dz-size,\n.dz-preview .dz-details .dz-filename {\n flex: 1\n}\n\n.dz-preview img,\n.dz-preview .dz-success-mark,\n.dz-preview .dz-error-mark {\n display: none\n}\n\n@-webkit-keyframes floatUp {\n 0% {\n opacity: 0;\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0);\n transform: scale(0.86)\n }\n\n 25% {\n opacity: 100\n }\n\n 67% {\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n\n 100% {\n box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n}\n\n@keyframes floatUp {\n 0% {\n opacity: 0;\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0), 0 0 0 rgba(10, 10, 10, 0);\n transform: scale(0.86)\n }\n\n 25% {\n opacity: 100\n }\n\n 67% {\n box-shadow: 0 0 0 rgba(10, 10, 10, 0), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n\n 100% {\n box-shadow: 0 20px 60px rgba(10, 10, 10, 0.05), 0 5px 10px rgba(10, 10, 10, 0.1), 0 1px 1px rgba(10, 10, 10, 0.2);\n transform: scale(1)\n }\n}\n\n.uploads.is-reversed {\n display: flex;\n flex-direction: column-reverse\n}\n\n.uploads > div {\n animation: fadeInOpacity 0.5s;\n margin: 1rem\n}\n\n.uploads.is-reversed > div {\n flex: 0 0 auto\n}\n\n.uploads > div:first-child {\n margin-top: 1.5rem\n}\n\n.uploads.nojs {\n margin-bottom: 0\n}\n\n.uploads > div > .icon:not(.icon-block) {\n color: #3794d2\n}\n\n.uploads > div > .icon.icon-block {\n color: #da4453\n}\n\n.uploads progress {\n margin-top: 0.5rem;\n margin-bottom: 1rem\n}\n\n.uploads img {\n max-width: 200px\n}\n\n.name {\n font-size: 1rem;\n color: #bdc3c7;\n word-break: break-all\n}\n\n.link > a {\n word-break: break-all\n}\n\n.clipboard-mobile {\n margin-top: 5px\n}\n\n#albumDiv {\n animation: fadeInOpacity 0.5s\n}\n\n#albumDiv .control {\n text-align: inherit\n}\n\n#linksColumn {\n margin-top: -0.25rem;\n margin-left: -0.25rem;\n margin-right: -0.25rem;\n animation: fadeInOpacity 0.5s\n}\n\n#linksColumn .column {\n padding: 0.25rem\n}\n\n#linksColumn > span {\n padding: 0 0.3rem;\n color: #7f8c8d\n}\n\n.git-commit a {\n display: inline-block;\n word-break: break-all\n}\n\n#tabs {\n margin-bottom: 1rem;\n animation: fadeInOpacity 0.5s\n}\n\n#tabs ul {\n border-bottom: 1px solid #898b8d\n}\n\n#tabs li a {\n color: #bdc3c7;\n border-bottom-color: #898b8d\n}\n\n#tabs.is-boxed li.is-active a {\n color: #3794d2;\n background: #232629;\n border-color: #898b8d;\n border-bottom-color: #232629\n}\n\n#tabs.is-boxed li:not(.is-active) a:hover {\n background: #4d4d4d\n}\n\n.tab-content {\n margin-bottom: -0.75rem;\n animation: fadeInOpacity 0.5s\n}\n\n.tab-content .label {\n color: #bdc3c7;\n font-weight: normal\n}\n\n#tab-config.tab-content form {\n margin-bottom: 0.75rem\n}\n\n#urlMaxSize {\n font-weight: bold\n}\n\n.render {\n position: fixed;\n right: 0;\n bottom: 0;\n font-size: 1rem;\n color: #bdc3c7;\n cursor: pointer\n}\n\n.render.button {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n right: 1%;\n opacity: 0.25;\n transition: opacity 0.25s\n}\n\n.render.button:hover {\n opacity: 1\n}\n"]} \ No newline at end of file diff --git a/dist/js/home.js b/dist/js/home.js index 39804a4..3246de9 100644 --- a/dist/js/home.js +++ b/dist/js/home.js @@ -1,2 +1,2 @@ -var lsKeys={token:"token",chunkSize:"chunkSize",parallelUploads:"parallelUploads",fileLength:"fileLength",uploadAge:"uploadAge"},page={token:localStorage[lsKeys.token],private:null,enableUserAccounts:null,maxSize:null,chunkSize:null,temporaryUploadAges:null,fileIdentifierLength:null,album:null,parallelUploads:null,fileLength:null,uploadAge:null,maxSizeBytes:null,urlMaxSize:null,urlMaxSizeBytes:null,tabs:[],activeTab:null,albumSelect:null,previewTemplate:null,dropzone:null,clipboardJS:null,lazyLoad:null,imageExtensions:[".webp",".jpg",".jpeg",".bmp",".gif",".png",".svg"],checkIfPublic:function(e){return axios.get("api/check").then((function(a){return page.private=a.data.private,page.enableUserAccounts=a.data.enableUserAccounts,page.maxSize=parseInt(a.data.maxSize),page.maxSizeBytes=1e6*page.maxSize,page.chunkSize=parseInt(a.data.chunkSize),page.temporaryUploadAges=a.data.temporaryUploadAges,page.fileIdentifierLength=a.data.fileIdentifierLength,page.preparePage(e)})).catch(e)},preparePage:function(e){if(!page.private)return page.prepareUpload(e);if(page.token)return page.verifyToken(page.token,e,!0);var a=document.querySelector("#loginToUpload");a.href="auth",a.classList.remove("is-loading"),page.enableUserAccounts?a.innerText="Anonymous upload is disabled. Log in to upload.":a.innerText="Running in private mode. Log in to upload."},verifyToken:function(e,a,t){return axios.post("api/tokens/verify",{token:e}).then((function(r){return!1===r.data.success?swal({title:"An error occurred!",text:r.data.description,icon:"error"}).then((function(){t&&(localStorage.removeItem("token"),location.reload())})):(localStorage.token=e,page.token=e,page.prepareUpload(a))})).catch(a)},prepareUpload:function(e){page.token&&(document.querySelector("#albumDiv").classList.remove("is-hidden"),page.albumSelect=document.querySelector("#albumSelect"),page.albumSelect.addEventListener("change",(function(){page.album=parseInt(page.albumSelect.value),"function"==typeof page.prepareShareX&&page.prepareShareX()})),page.fetchAlbums(e)),page.prepareUploadConfig(),document.querySelector("#maxSize > span").innerHTML=page.getPrettyBytes(page.maxSizeBytes),document.querySelector("#loginToUpload").classList.add("is-hidden"),!page.token&&page.enableUserAccounts&&(document.querySelector("#loginLinkText").innerHTML="Create an account and keep track of your uploads"),page.prepareDropzone(),"function"==typeof page.prepareShareX&&page.prepareShareX();var a=document.querySelector("#urlMaxSize");a&&(page.urlMaxSize=parseInt(a.innerHTML),page.urlMaxSizeBytes=1e6*page.urlMaxSize,a.innerHTML=page.getPrettyBytes(page.urlMaxSizeBytes),document.querySelector("#uploadUrls").addEventListener("click",(function(e){page.uploadUrls(e.currentTarget)})));for(var t=document.querySelector("#tabs"),r=t.querySelectorAll("li"),n=function(e){var a=r[e].dataset.id,t=document.querySelector("#"+a);t&&(r[e].addEventListener("click",(function(){page.setActiveTab(e)})),page.tabs.push({tab:r[e],content:t}))},l=0;l a"),r=e.previewElement.querySelector(".clipboard-mobile > .clipboard-js");t.href=t.innerHTML=r.dataset.clipboardText=a.url,r.parentElement.classList.remove("is-hidden");var n=/.[\w]+(\?|$)/.exec(a.url);if(n&&n[0]&&page.imageExtensions.includes(n[0].toLowerCase())){var l=e.previewElement.querySelector("img");l.setAttribute("alt",a.name||""),l.dataset.src=a.url,l.classList.remove("is-hidden"),l.onerror=function(a){a.currentTarget.classList.add("is-hidden"),page.updateTemplateIcon(e.previewElement,"icon-picture")},page.lazyLoad.update(e.previewElement.querySelectorAll("img"))}else page.updateTemplateIcon(e.previewElement,"icon-doc-inv");if(a.expirydate){var i=e.previewElement.querySelector(".expiry-date");i.innerHTML="Expiry date: "+page.getPrettyDate(new Date(1e3*a.expirydate)),i.classList.remove("is-hidden")}}},createAlbum:function(){var e=document.createElement("div");e.innerHTML='\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n ',swal({title:"Create new album",icon:"info",content:e,buttons:{cancel:!0,confirm:{closeModal:!1}}}).then((function(e){if(e){var a=document.querySelector("#swalName").value.trim();axios.post("api/albums",{name:a,description:document.querySelector("#swalDescription").value.trim(),download:document.querySelector("#swalDownload").checked,public:document.querySelector("#swalPublic").checked},{headers:{token:page.token}}).then((function(e){if(!1===e.data.success)return swal("An error occurred!",e.data.description,"error");var t=document.createElement("option");page.albumSelect.appendChild(t),t.value=e.data.id,t.innerHTML=a,t.selected=!0,swal("Woohoo!","Album was created successfully.","success")})).catch((function(e){return console.error(e),swal("An error occurred!","There was an error with the request, please check the console for more information.","error")}))}}))},prepareUploadConfig:function(){var e={chunkSize:page.chunkSize,parallelUploads:2};page.chunkSize=parseInt(localStorage[lsKeys.chunkSize])||e.chunkSize,page.parallelUploads=parseInt(localStorage[lsKeys.parallelUploads])||e.parallelUploads,document.querySelector("#chunkSize").value=page.chunkSize,document.querySelector("#parallelUploads").value=page.parallelUploads;var a={chunkSize:{min:1,max:95},parallelUploads:{min:1,max:8}};document.querySelector("#chunkSizeDiv .help").innerHTML="Default is "+e.chunkSize+" MB. Max is "+a.chunkSize.max+" MB.",document.querySelector("#parallelUploadsDiv .help").innerHTML="Default is "+e.parallelUploads+". Max is "+a.parallelUploads.max+".";var t=document.querySelector("#fileLengthDiv");if(page.fileIdentifierLength&&t){var r=document.querySelector("#fileLength"),n=parseInt(localStorage[lsKeys.fileLength]);e.fileLength=page.fileIdentifierLength.default;var l="Default is "+page.fileIdentifierLength.default+".",i="number"==typeof page.fileIdentifierLength.min&&"number"==typeof page.fileIdentifierLength.max;i&&(l+=" Min is "+page.fileIdentifierLength.min+". Max is "+page.fileIdentifierLength.max,a.fileLength={min:page.fileIdentifierLength.min,max:page.fileIdentifierLength.max}),page.fileIdentifierLength.force&&(l+=" This option is currently disabled.",r.disabled=!0),page.fileIdentifierLength.force||isNaN(n)||!i||npage.fileIdentifierLength.max?(r.value=e.fileLength,page.fileLength=null):(r.value=n,page.fileLength=n),t.classList.remove("is-hidden"),t.querySelector(".help").innerHTML=l}Object.keys(a).forEach((function(e){document.querySelector("#"+e).setAttribute("min",a[e].min),document.querySelector("#"+e).setAttribute("max",a[e].max)}));var o=document.querySelector("#uploadAgeDiv");if(Array.isArray(page.temporaryUploadAges)&&page.temporaryUploadAges.length&&o){for(var s=document.querySelector("#uploadAge"),c=parseFloat(localStorage[lsKeys.uploadAge]),p=0;p0&&s!==e[l[i]]?localStorage[lsKeys[l[i]]]=s:localStorage.removeItem(lsKeys[l[i]])}swal({title:"Woohoo!",text:"Configuration saved into this browser.",icon:"success"}).then((function(){location.reload()}))}}))},getPrettyUploadAge:function(e){if(0===e)return"Permanent";if(e<1){var a=60*e;return a+" minute"+(1===a?"":"s")}if(e>=24){var t=e/24;return t+" day"+(1===t?"":"s")}return e+" hour"+(1===e?"":"s")}};window.addEventListener("paste",(function(e){for(var a=(e.clipboardData||e.originalEvent.clipboardData).items,t=Object.keys(a),r=0;r",swal({title:"An error occurred!",icon:"error",content:n})}}page.checkIfPublic(e),page.clipboardJS=new ClipboardJS(".clipboard-js"),page.clipboardJS.on("success",(function(){return swal("Copied!","The link has been copied to clipboard.","success")})),page.clipboardJS.on("error",e),page.lazyLoad=new LazyLoad({elements_selector:".field.uploads img"}),document.querySelector("#createAlbum").addEventListener("click",(function(){page.createAlbum()}))}; +var lsKeys={token:"token",chunkSize:"chunkSize",parallelUploads:"parallelUploads",uploadsHistoryOrder:"uploadsHistoryOrder",fileLength:"fileLength",uploadAge:"uploadAge"},page={token:localStorage[lsKeys.token],private:null,enableUserAccounts:null,maxSize:null,chunkSize:null,temporaryUploadAges:null,fileIdentifierLength:null,album:null,parallelUploads:null,uploadsHistoryOrder:null,fileLength:null,uploadAge:null,maxSizeBytes:null,urlMaxSize:null,urlMaxSizeBytes:null,tabs:[],activeTab:null,albumSelect:null,previewTemplate:null,dropzone:null,clipboardJS:null,lazyLoad:null,imageExtensions:[".webp",".jpg",".jpeg",".bmp",".gif",".png",".svg"],checkIfPublic:function(e){return axios.get("api/check").then((function(a){return page.private=a.data.private,page.enableUserAccounts=a.data.enableUserAccounts,page.maxSize=parseInt(a.data.maxSize),page.maxSizeBytes=1e6*page.maxSize,page.chunkSize=parseInt(a.data.chunkSize),page.temporaryUploadAges=a.data.temporaryUploadAges,page.fileIdentifierLength=a.data.fileIdentifierLength,page.preparePage(e)})).catch(e)},preparePage:function(e){if(!page.private)return page.prepareUpload(e);if(page.token)return page.verifyToken(page.token,e,!0);var a=document.querySelector("#loginToUpload");a.href="auth",a.classList.remove("is-loading"),page.enableUserAccounts?a.innerText="Anonymous upload is disabled. Log in to upload.":a.innerText="Running in private mode. Log in to upload."},verifyToken:function(e,a,t){return axios.post("api/tokens/verify",{token:e}).then((function(r){return!1===r.data.success?swal({title:"An error occurred!",text:r.data.description,icon:"error"}).then((function(){t&&(localStorage.removeItem("token"),location.reload())})):(localStorage.token=e,page.token=e,page.prepareUpload(a))})).catch(a)},prepareUpload:function(e){page.token&&(document.querySelector("#albumDiv").classList.remove("is-hidden"),page.albumSelect=document.querySelector("#albumSelect"),page.albumSelect.addEventListener("change",(function(){page.album=parseInt(page.albumSelect.value),"function"==typeof page.prepareShareX&&page.prepareShareX()})),page.fetchAlbums(e)),page.prepareUploadConfig(),document.querySelector("#maxSize > span").innerHTML=page.getPrettyBytes(page.maxSizeBytes),document.querySelector("#loginToUpload").classList.add("is-hidden"),!page.token&&page.enableUserAccounts&&(document.querySelector("#loginLinkText").innerHTML="Create an account and keep track of your uploads"),page.prepareDropzone(),"function"==typeof page.prepareShareX&&page.prepareShareX();var a=document.querySelector("#urlMaxSize");a&&(page.urlMaxSize=parseInt(a.innerHTML),page.urlMaxSizeBytes=1e6*page.urlMaxSize,a.innerHTML=page.getPrettyBytes(page.urlMaxSizeBytes),document.querySelector("#uploadUrls").addEventListener("click",(function(e){page.uploadUrls(e.currentTarget)})));for(var t=document.querySelector("#tabs"),r=t.querySelectorAll("li"),n=function(e){var a=r[e].dataset.id,t=document.querySelector("#"+a);t&&(r[e].addEventListener("click",(function(){page.setActiveTab(e)})),page.tabs.push({tab:r[e],content:t}))},l=0;l a"),r=e.previewElement.querySelector(".clipboard-mobile > .clipboard-js");t.href=t.innerHTML=r.dataset.clipboardText=a.url,r.parentElement.classList.remove("is-hidden");var n=/.[\w]+(\?|$)/.exec(a.url);if(n&&n[0]&&page.imageExtensions.includes(n[0].toLowerCase())){var l=e.previewElement.querySelector("img");l.setAttribute("alt",a.name||""),l.dataset.src=a.url,l.classList.remove("is-hidden"),l.onerror=function(a){a.currentTarget.classList.add("is-hidden"),page.updateTemplateIcon(e.previewElement,"icon-picture")},page.lazyLoad.update(e.previewElement.querySelectorAll("img"))}else page.updateTemplateIcon(e.previewElement,"icon-doc-inv");if(a.expirydate){var o=e.previewElement.querySelector(".expiry-date");o.innerHTML="Expiry date: "+page.getPrettyDate(new Date(1e3*a.expirydate)),o.classList.remove("is-hidden")}}},createAlbum:function(){var e=document.createElement("div");e.innerHTML='\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n ',swal({title:"Create new album",icon:"info",content:e,buttons:{cancel:!0,confirm:{closeModal:!1}}}).then((function(e){if(e){var a=document.querySelector("#swalName").value.trim();axios.post("api/albums",{name:a,description:document.querySelector("#swalDescription").value.trim(),download:document.querySelector("#swalDownload").checked,public:document.querySelector("#swalPublic").checked},{headers:{token:page.token}}).then((function(e){if(!1===e.data.success)return swal("An error occurred!",e.data.description,"error");var t=document.createElement("option");page.albumSelect.appendChild(t),t.value=e.data.id,t.innerHTML=a,t.selected=!0,swal("Woohoo!","Album was created successfully.","success")})).catch((function(e){return console.error(e),swal("An error occurred!","There was an error with the request, please check the console for more information.","error")}))}}))},prepareUploadConfig:function(){var e={chunkSize:page.chunkSize,parallelUploads:2};page.chunkSize=parseInt(localStorage[lsKeys.chunkSize])||e.chunkSize,page.parallelUploads=parseInt(localStorage[lsKeys.parallelUploads])||e.parallelUploads,document.querySelector("#chunkSize").value=page.chunkSize,document.querySelector("#parallelUploads").value=page.parallelUploads;var a={chunkSize:{min:1,max:95},parallelUploads:{min:1,max:8}};document.querySelector("#chunkSizeDiv .help").innerHTML="Default is "+e.chunkSize+" MB. Max is "+a.chunkSize.max+" MB.",document.querySelector("#parallelUploadsDiv .help").innerHTML="Default is "+e.parallelUploads+". Max is "+a.parallelUploads.max+".";var t=document.querySelector("#fileLengthDiv");if(page.fileIdentifierLength&&t){var r=document.querySelector("#fileLength"),n=parseInt(localStorage[lsKeys.fileLength]);e.fileLength=page.fileIdentifierLength.default;var l="Default is "+page.fileIdentifierLength.default+".",o="number"==typeof page.fileIdentifierLength.min&&"number"==typeof page.fileIdentifierLength.max;o&&(l+=" Min is "+page.fileIdentifierLength.min+". Max is "+page.fileIdentifierLength.max,a.fileLength={min:page.fileIdentifierLength.min,max:page.fileIdentifierLength.max}),page.fileIdentifierLength.force&&(l+=" This option is currently disabled.",r.disabled=!0),page.fileIdentifierLength.force||isNaN(n)||!o||npage.fileIdentifierLength.max?(r.value=e.fileLength,page.fileLength=null):(r.value=n,page.fileLength=n),t.classList.remove("is-hidden"),t.querySelector(".help").innerHTML=l}Object.keys(a).forEach((function(e){document.querySelector("#"+e).setAttribute("min",a[e].min),document.querySelector("#"+e).setAttribute("max",a[e].max)}));var i=document.querySelector("#uploadAgeDiv");if(Array.isArray(page.temporaryUploadAges)&&page.temporaryUploadAges.length&&i){for(var s=document.querySelector("#uploadAge"),c=parseFloat(localStorage[lsKeys.uploadAge]),p=0;p .uploads"),f=0;f0&&s!==e[l[o]]?localStorage[lsKeys[l[o]]]=s:localStorage.removeItem(lsKeys[l[o]])}swal({title:"Woohoo!",text:"Configuration saved into this browser.",icon:"success"}).then((function(){location.reload()}))}}))},getPrettyUploadAge:function(e){if(0===e)return"Permanent";if(e<1){var a=60*e;return a+" minute"+(1===a?"":"s")}if(e>=24){var t=e/24;return t+" day"+(1===t?"":"s")}return e+" hour"+(1===e?"":"s")}};window.addEventListener("paste",(function(e){for(var a=(e.clipboardData||e.originalEvent.clipboardData).items,t=Object.keys(a),r=0;r",swal({title:"An error occurred!",icon:"error",content:n})}}page.checkIfPublic(e),page.clipboardJS=new ClipboardJS(".clipboard-js"),page.clipboardJS.on("success",(function(){return swal("Copied!","The link has been copied to clipboard.","success")})),page.clipboardJS.on("error",e),page.lazyLoad=new LazyLoad({elements_selector:".field.uploads img"}),document.querySelector("#createAlbum").addEventListener("click",(function(){page.createAlbum()}))}; //# sourceMappingURL=home.js.map diff --git a/dist/js/home.js.map b/dist/js/home.js.map index f7c3256..c85f7ce 100644 --- a/dist/js/home.js.map +++ b/dist/js/home.js.map @@ -1 +1 @@ -{"version":3,"sources":["home.js"],"names":["const","lsKeys","token","chunkSize","parallelUploads","fileLength","uploadAge","page","localStorage","private","enableUserAccounts","maxSize","temporaryUploadAges","fileIdentifierLength","album","maxSizeBytes","urlMaxSize","urlMaxSizeBytes","tabs","activeTab","albumSelect","previewTemplate","dropzone","clipboardJS","lazyLoad","imageExtensions","checkIfPublic","onFailure","axios","get","then","response","data","parseInt","preparePage","catch","prepareUpload","verifyToken","button","document","querySelector","href","classList","remove","innerText","reloadOnError","post","success","swal","title","text","description","icon","removeItem","location","reload","addEventListener","value","prepareShareX","fetchAlbums","prepareUploadConfig","innerHTML","getPrettyBytes","add","prepareDropzone","event","uploadUrls","currentTarget","tabsContainer","querySelectorAll","loop","i","id","dataset","tabContent","setActiveTab","push","tab","content","length","index","let","headers","Array","isArray","albums","option","createElement","name","appendChild","previewNode","parentNode","removeChild","tabDiv","div","className","previewsContainer","Dropzone","body","url","paramName","clickable","maxFilesize","uploadMultiple","createImageThumbnails","autoProcessQueue","chunking","Boolean","parallelChunkUploads","chunksUploaded","file","done","previewElement","setAttribute","files","uuid","upload","original","type","albumid","filelength","age","error","toString","updateTemplate","on","xhr","chunked","setRequestHeader","progress","test","size","updateTemplateIcon","contains","urls","split","filter","trim","join","map","firstChild","posted","result","removeAttribute","run","templateElement","iconClass","iconElement","a","clipboard","clipboardText","parentElement","exec","includes","toLowerCase","img","src","onerror","update","expirydate","expiryDate","getPrettyDate","Date","createAlbum","buttons","cancel","confirm","closeModal","download","checked","public","selected","console","fallback","numConfig","min","max","fileLengthDiv","element","stored","default","helpText","range","force","disabled","isNaN","Object","keys","forEach","key","uploadAgeDiv","parseFloat","getPrettyUploadAge","form","preventDefault","siBytes","checkValidity","prefKeys","elements","numKeys","parsed","Math","hours","minutes","days","window","items","clipboardData","originalEvent","item","kind","blob","getAsFile","File","match","addFile","onload","undefined","uploadButton","statusText","520","521","522","523","524","525","526","527","530","status","ClipboardJS","LazyLoad","elements_selector"],"mappings":"AAEAA,IAA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EAAa,SAEnEnD,IAAM8E,EAAUvC,SAASgD,cAAc,OAEvC,OADAT,EAAQjB,UAAY,SAAS6D,EAAMC,WAAU,UACtC3E,KAAK,CACVC,MAAO,qBACPG,KAAM,QA/BN0B,QAgCAA,KAKNvE,KAAKmB,cAAcC,GAEnBpB,KAAKgB,YAAc,IAAI+M,YAAY,iBAEnC/N,KAAKgB,YAAYsG,GAAG,WAAS,WAC3B,OAAO7E,KAAK,UAAW,yCAA0C,cAGnEzC,KAAKgB,YAAYsG,GAAG,QAASlG,GAE7BpB,KAAKiB,SAAW,IAAI+M,SAAS,CAC3BC,kBAAmB,uBAGrBjM,SAASC,cAAc,gBAAgBgB,iBAAiB,SAAO,WAC7DjD,KAAK4J","file":"home.js","sourcesContent":["/* global swal, axios, Dropzone, ClipboardJS, LazyLoad */\n\nconst lsKeys = {\n token: 'token',\n chunkSize: 'chunkSize',\n parallelUploads: 'parallelUploads',\n fileLength: 'fileLength',\n uploadAge: 'uploadAge'\n}\n\nconst page = {\n // user token\n token: localStorage[lsKeys.token],\n\n // configs from api/check\n private: null,\n enableUserAccounts: null,\n maxSize: null,\n chunkSize: null,\n temporaryUploadAges: null,\n fileIdentifierLength: null,\n\n // store album id that will be used with upload requests\n album: null,\n\n parallelUploads: null,\n fileLength: null,\n uploadAge: null,\n\n maxSizeBytes: null,\n urlMaxSize: null,\n urlMaxSizeBytes: null,\n\n tabs: [],\n activeTab: null,\n albumSelect: null,\n previewTemplate: null,\n\n dropzone: null,\n clipboardJS: null,\n lazyLoad: null,\n\n imageExtensions: ['.webp', '.jpg', '.jpeg', '.bmp', '.gif', '.png', '.svg']\n}\n\npage.checkIfPublic = onFailure => {\n return axios.get('api/check')\n .then(response => {\n page.private = response.data.private\n page.enableUserAccounts = response.data.enableUserAccounts\n page.maxSize = parseInt(response.data.maxSize)\n page.maxSizeBytes = page.maxSize * 1e6\n page.chunkSize = parseInt(response.data.chunkSize)\n page.temporaryUploadAges = response.data.temporaryUploadAges\n page.fileIdentifierLength = response.data.fileIdentifierLength\n return page.preparePage(onFailure)\n })\n .catch(onFailure)\n}\n\npage.preparePage = onFailure => {\n if (page.private)\n if (page.token) {\n return page.verifyToken(page.token, onFailure, true)\n } else {\n const button = document.querySelector('#loginToUpload')\n button.href = 'auth'\n button.classList.remove('is-loading')\n if (page.enableUserAccounts)\n button.innerText = 'Anonymous upload is disabled. Log in to upload.'\n else\n button.innerText = 'Running in private mode. Log in to upload.'\n }\n else\n return page.prepareUpload(onFailure)\n}\n\npage.verifyToken = (token, onFailure, reloadOnError) => {\n return axios.post('api/tokens/verify', { token }).then(response => {\n if (response.data.success === false)\n return swal({\n title: 'An error occurred!',\n text: response.data.description,\n icon: 'error'\n }).then(() => {\n if (!reloadOnError) return\n localStorage.removeItem('token')\n location.reload()\n })\n\n localStorage.token = token\n page.token = token\n return page.prepareUpload(onFailure)\n }).catch(onFailure)\n}\n\npage.prepareUpload = onFailure => {\n // I think this fits best here because we need to check for a valid token before we can get the albums\n if (page.token) {\n // Display the album selection\n document.querySelector('#albumDiv').classList.remove('is-hidden')\n\n page.albumSelect = document.querySelector('#albumSelect')\n page.albumSelect.addEventListener('change', () => {\n page.album = parseInt(page.albumSelect.value)\n // Re-generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n })\n\n // Fetch albums\n page.fetchAlbums(onFailure)\n }\n\n // Prepare & generate config tab\n page.prepareUploadConfig()\n\n // Update elements wherever applicable\n document.querySelector('#maxSize > span').innerHTML = page.getPrettyBytes(page.maxSizeBytes)\n document.querySelector('#loginToUpload').classList.add('is-hidden')\n\n if (!page.token && page.enableUserAccounts)\n document.querySelector('#loginLinkText').innerHTML = 'Create an account and keep track of your uploads'\n\n // Prepare & generate files upload tab\n page.prepareDropzone()\n\n // Generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n\n // Prepare urls upload tab\n const urlMaxSize = document.querySelector('#urlMaxSize')\n if (urlMaxSize) {\n page.urlMaxSize = parseInt(urlMaxSize.innerHTML)\n page.urlMaxSizeBytes = page.urlMaxSize * 1e6\n urlMaxSize.innerHTML = page.getPrettyBytes(page.urlMaxSizeBytes)\n document.querySelector('#uploadUrls').addEventListener('click', event => {\n page.uploadUrls(event.currentTarget)\n })\n }\n\n // Get all tabs\n const tabsContainer = document.querySelector('#tabs')\n const tabs = tabsContainer.querySelectorAll('li')\n for (let i = 0; i < tabs.length; i++) {\n const id = tabs[i].dataset.id\n const tabContent = document.querySelector(`#${id}`)\n if (!tabContent) continue\n\n tabs[i].addEventListener('click', () => {\n page.setActiveTab(i)\n })\n page.tabs.push({ tab: tabs[i], content: tabContent })\n }\n\n // Set first valid tab as the default active tab\n if (page.tabs.length) {\n page.setActiveTab(0)\n tabsContainer.classList.remove('is-hidden')\n }\n}\n\npage.setActiveTab = index => {\n for (let i = 0; i < page.tabs.length; i++)\n if (i === index) {\n page.tabs[i].tab.classList.add('is-active')\n page.tabs[i].content.classList.remove('is-hidden')\n page.activeTab = index\n } else {\n page.tabs[i].tab.classList.remove('is-active')\n page.tabs[i].content.classList.add('is-hidden')\n }\n}\n\npage.fetchAlbums = onFailure => {\n return axios.get('api/albums', { headers: { token: page.token } }).then(response => {\n if (response.data.success === false)\n return swal('An error occurred!', response.data.description, 'error')\n\n // Create an option for each album\n if (Array.isArray(response.data.albums) && response.data.albums.length)\n for (let i = 0; i < response.data.albums.length; i++) {\n const album = response.data.albums[i]\n const option = document.createElement('option')\n option.value = album.id\n option.innerHTML = album.name\n page.albumSelect.appendChild(option)\n }\n }).catch(onFailure)\n}\n\npage.prepareDropzone = () => {\n // Parse template element\n const previewNode = document.querySelector('#tpl')\n page.previewTemplate = previewNode.innerHTML\n previewNode.parentNode.removeChild(previewNode)\n\n // Generate files upload tab\n const tabDiv = document.querySelector('#tab-files')\n const div = document.createElement('div')\n div.className = 'control is-expanded'\n div.innerHTML = `\n
\n \n \n \n Click here or drag & drop files\n
\n `\n tabDiv.querySelector('.dz-container').appendChild(div)\n\n const previewsContainer = tabDiv.querySelector('#tab-files .field.uploads')\n\n page.dropzone = new Dropzone(document.body, {\n url: 'api/upload',\n paramName: 'files[]',\n clickable: tabDiv.querySelector('#dropzone'),\n maxFilesize: page.maxSizeBytes / 1024 / 1024, // this option expects MiB\n parallelUploads: page.parallelUploads,\n uploadMultiple: false,\n previewsContainer,\n previewTemplate: page.previewTemplate,\n createImageThumbnails: false,\n autoProcessQueue: true,\n headers: { token: page.token },\n chunking: Boolean(page.chunkSize),\n chunkSize: page.chunkSize * 1e6, // the option below expects Bytes\n parallelChunkUploads: false, // when set to true, it often hangs with hundreds of parallel uploads\n chunksUploaded (file, done) {\n file.previewElement.querySelector('.progress').setAttribute('value', 100)\n file.previewElement.querySelector('.progress').innerHTML = '100%'\n\n return axios.post('api/upload/finishchunks', {\n // This API supports an array of multiple files\n files: [{\n uuid: file.upload.uuid,\n original: file.name,\n type: file.type,\n albumid: page.album,\n filelength: page.fileLength,\n age: page.uploadAge\n }]\n }, { headers: { token: page.token } }).catch(error => {\n // Format error for display purpose\n return error.response.data ? error.response : {\n data: {\n success: false,\n description: error.toString()\n }\n }\n }).then(response => {\n file.previewElement.querySelector('.progress').classList.add('is-hidden')\n\n if (response.data.success === false)\n file.previewElement.querySelector('.error').innerHTML = response.data.description\n\n if (response.data.files && response.data.files[0])\n page.updateTemplate(file, response.data.files[0])\n\n return done()\n })\n }\n })\n\n page.dropzone.on('addedfile', file => {\n // Set active tab to file uploads, if necessary\n if (page.activeTab !== 0)\n page.setActiveTab(0)\n // Add file entry\n tabDiv.querySelector('.uploads').classList.remove('is-hidden')\n file.previewElement.querySelector('.name').innerHTML = file.name\n })\n\n page.dropzone.on('sending', (file, xhr) => {\n if (file.upload.chunked) return\n // Add headers if not uploading chunks\n if (page.album !== null) xhr.setRequestHeader('albumid', page.album)\n if (page.fileLength !== null) xhr.setRequestHeader('filelength', page.fileLength)\n if (page.uploadAge !== null) xhr.setRequestHeader('age', page.uploadAge)\n })\n\n // Update the total progress bar\n page.dropzone.on('uploadprogress', (file, progress) => {\n // For some reason, chunked uploads fire 100% progress event\n // for each chunk's successful uploads\n if (file.upload.chunked && progress === 100) return\n file.previewElement.querySelector('.progress').setAttribute('value', progress)\n file.previewElement.querySelector('.progress').innerHTML = `${progress}%`\n })\n\n page.dropzone.on('success', (file, response) => {\n if (!response) return\n file.previewElement.querySelector('.progress').classList.add('is-hidden')\n\n if (response.success === false)\n file.previewElement.querySelector('.error').innerHTML = response.description\n\n if (response.files && response.files[0])\n page.updateTemplate(file, response.files[0])\n })\n\n page.dropzone.on('error', (file, error) => {\n // Clean up file size errors\n if ((typeof error === 'string' && /^File is too big/.test(error)) ||\n (typeof error === 'object' && /File too large/.test(error.description)))\n error = `File too large (${page.getPrettyBytes(file.size)}).`\n\n page.updateTemplateIcon(file.previewElement, 'icon-block')\n file.previewElement.querySelector('.progress').classList.add('is-hidden')\n file.previewElement.querySelector('.name').innerHTML = file.name\n file.previewElement.querySelector('.error').innerHTML = error.description || error\n })\n}\n\npage.uploadUrls = button => {\n const tabDiv = document.querySelector('#tab-urls')\n if (!tabDiv || button.classList.contains('is-loading'))\n return\n\n button.classList.add('is-loading')\n\n function done (error) {\n if (error) swal('An error occurred!', error, 'error')\n button.classList.remove('is-loading')\n }\n\n function run () {\n const headers = {\n token: page.token,\n albumid: page.album,\n age: page.uploadAge,\n filelength: page.fileLength\n }\n\n const previewsContainer = tabDiv.querySelector('.uploads')\n const urls = document.querySelector('#urls').value\n .split(/\\r?\\n/)\n .filter(url => {\n return url.trim().length\n })\n document.querySelector('#urls').value = urls.join('\\n')\n\n if (!urls.length)\n return done('You have not entered any URLs.')\n\n tabDiv.querySelector('.uploads').classList.remove('is-hidden')\n const files = urls.map(url => {\n const previewTemplate = document.createElement('template')\n previewTemplate.innerHTML = page.previewTemplate.trim()\n const previewElement = previewTemplate.content.firstChild\n previewElement.querySelector('.name').innerHTML = url\n previewsContainer.appendChild(previewElement)\n return { url, previewElement }\n })\n\n function post (i) {\n if (i === files.length)\n return done()\n\n function posted (result) {\n files[i].previewElement.querySelector('.progress').classList.add('is-hidden')\n if (result.success) {\n page.updateTemplate(files[i], result.files[0])\n } else {\n page.updateTemplateIcon(files[i].previewElement, 'icon-block')\n files[i].previewElement.querySelector('.error').innerHTML = result.description\n }\n return post(i + 1)\n }\n\n // Animate progress bar\n files[i].previewElement.querySelector('.progress').removeAttribute('value')\n\n return axios.post('api/upload', { urls: [files[i].url] }, { headers }).then(response => {\n return posted(response.data)\n }).catch(error => {\n return posted({\n success: false,\n description: error.response ? error.response.data.description : error.toString()\n })\n })\n }\n return post(0)\n }\n return run()\n}\n\npage.updateTemplateIcon = (templateElement, iconClass) => {\n const iconElement = templateElement.querySelector('.icon')\n if (!iconElement) return\n iconElement.classList.add(iconClass)\n iconElement.classList.remove('is-hidden')\n}\n\npage.updateTemplate = (file, response) => {\n if (!response.url) return\n\n const a = file.previewElement.querySelector('.link > a')\n const clipboard = file.previewElement.querySelector('.clipboard-mobile > .clipboard-js')\n a.href = a.innerHTML = clipboard.dataset.clipboardText = response.url\n clipboard.parentElement.classList.remove('is-hidden')\n\n const exec = /.[\\w]+(\\?|$)/.exec(response.url)\n if (exec && exec[0] && page.imageExtensions.includes(exec[0].toLowerCase())) {\n const img = file.previewElement.querySelector('img')\n img.setAttribute('alt', response.name || '')\n img.dataset.src = response.url\n img.classList.remove('is-hidden')\n img.onerror = event => {\n // Hide image elements that fail to load\n // Consequently include WEBP in browsers that do not have WEBP support (e.i. IE)\n event.currentTarget.classList.add('is-hidden')\n page.updateTemplateIcon(file.previewElement, 'icon-picture')\n }\n page.lazyLoad.update(file.previewElement.querySelectorAll('img'))\n } else {\n page.updateTemplateIcon(file.previewElement, 'icon-doc-inv')\n }\n\n if (response.expirydate) {\n const expiryDate = file.previewElement.querySelector('.expiry-date')\n expiryDate.innerHTML = `Expiry date: ${page.getPrettyDate(new Date(response.expirydate * 1000))}`\n expiryDate.classList.remove('is-hidden')\n }\n}\n\npage.createAlbum = () => {\n const div = document.createElement('div')\n div.innerHTML = `\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n `\n\n swal({\n title: 'Create new album',\n icon: 'info',\n content: div,\n buttons: {\n cancel: true,\n confirm: {\n closeModal: false\n }\n }\n }).then(value => {\n if (!value) return\n\n const name = document.querySelector('#swalName').value.trim()\n axios.post('api/albums', {\n name,\n description: document.querySelector('#swalDescription').value.trim(),\n download: document.querySelector('#swalDownload').checked,\n public: document.querySelector('#swalPublic').checked\n }, {\n headers: {\n token: page.token\n }\n }).then(response => {\n if (response.data.success === false)\n return swal('An error occurred!', response.data.description, 'error')\n\n const option = document.createElement('option')\n page.albumSelect.appendChild(option)\n option.value = response.data.id\n option.innerHTML = name\n option.selected = true\n\n swal('Woohoo!', 'Album was created successfully.', 'success')\n }).catch(error => {\n console.error(error)\n return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')\n })\n })\n}\n\npage.prepareUploadConfig = () => {\n const fallback = {\n chunkSize: page.chunkSize,\n parallelUploads: 2\n }\n\n page.chunkSize = parseInt(localStorage[lsKeys.chunkSize]) || fallback.chunkSize\n page.parallelUploads = parseInt(localStorage[lsKeys.parallelUploads]) || fallback.parallelUploads\n document.querySelector('#chunkSize').value = page.chunkSize\n document.querySelector('#parallelUploads').value = page.parallelUploads\n\n const numConfig = {\n chunkSize: { min: 1, max: 95 },\n parallelUploads: { min: 1, max: 8 }\n }\n\n document.querySelector('#chunkSizeDiv .help').innerHTML =\n `Default is ${fallback.chunkSize} MB. Max is ${numConfig.chunkSize.max} MB.`\n document.querySelector('#parallelUploadsDiv .help').innerHTML =\n `Default is ${fallback.parallelUploads}. Max is ${numConfig.parallelUploads.max}.`\n\n const fileLengthDiv = document.querySelector('#fileLengthDiv')\n if (page.fileIdentifierLength && fileLengthDiv) {\n const element = document.querySelector('#fileLength')\n const stored = parseInt(localStorage[lsKeys.fileLength])\n\n fallback.fileLength = page.fileIdentifierLength.default\n let helpText = `Default is ${page.fileIdentifierLength.default}.`\n\n const range = typeof page.fileIdentifierLength.min === 'number' &&\n typeof page.fileIdentifierLength.max === 'number'\n\n if (range) {\n helpText += ` Min is ${page.fileIdentifierLength.min}. Max is ${page.fileIdentifierLength.max}`\n numConfig.fileLength = {\n min: page.fileIdentifierLength.min,\n max: page.fileIdentifierLength.max\n }\n }\n\n if (page.fileIdentifierLength.force) {\n helpText += ' This option is currently disabled.'\n element.disabled = true\n }\n\n if (page.fileIdentifierLength.force ||\n isNaN(stored) ||\n !range ||\n stored < page.fileIdentifierLength.min ||\n stored > page.fileIdentifierLength.max) {\n element.value = fallback.fileLength\n page.fileLength = null\n } else {\n element.value = stored\n page.fileLength = stored\n }\n\n fileLengthDiv.classList.remove('is-hidden')\n fileLengthDiv.querySelector('.help').innerHTML = helpText\n }\n\n Object.keys(numConfig).forEach(key => {\n document.querySelector(`#${key}`).setAttribute('min', numConfig[key].min)\n document.querySelector(`#${key}`).setAttribute('max', numConfig[key].max)\n })\n\n const uploadAgeDiv = document.querySelector('#uploadAgeDiv')\n if (Array.isArray(page.temporaryUploadAges) && page.temporaryUploadAges.length && uploadAgeDiv) {\n const element = document.querySelector('#uploadAge')\n const stored = parseFloat(localStorage[lsKeys.uploadAge])\n for (let i = 0; i < page.temporaryUploadAges.length; i++) {\n const age = page.temporaryUploadAges[i]\n const option = document.createElement('option')\n option.value = i === 0 ? 'default' : age\n option.innerHTML = page.getPrettyUploadAge(age) +\n (i === 0 ? ' (default)' : '')\n element.appendChild(option)\n if (age === stored) {\n element.value = option.value\n page.uploadAge = stored\n }\n }\n uploadAgeDiv.classList.remove('is-hidden')\n }\n\n const tabContent = document.querySelector('#tab-config')\n const form = tabContent.querySelector('form')\n form.addEventListener('submit', event => {\n event.preventDefault()\n })\n\n const siBytes = localStorage[lsKeys.siBytes] !== '0'\n if (!siBytes) document.querySelector('#siBytes').value = '0'\n\n document.querySelector('#saveConfig').addEventListener('click', () => {\n if (!form.checkValidity())\n return\n\n const prefKeys = ['siBytes', 'uploadAge']\n for (let i = 0; i < prefKeys.length; i++) {\n const value = form.elements[prefKeys[i]].value\n if (value !== 'default' && value !== fallback[prefKeys[i]])\n localStorage[lsKeys[prefKeys[i]]] = value\n else\n localStorage.removeItem(lsKeys[prefKeys[i]])\n }\n\n const numKeys = Object.keys(numConfig)\n for (let i = 0; i < numKeys.length; i++) {\n const parsed = parseInt(form.elements[numKeys[i]].value) || 0\n const value = Math.min(Math.max(parsed, numConfig[numKeys[i]].min), numConfig[numKeys[i]].max)\n if (value > 0 && value !== fallback[numKeys[i]])\n localStorage[lsKeys[numKeys[i]]] = value\n else\n localStorage.removeItem(lsKeys[numKeys[i]])\n }\n\n swal({\n title: 'Woohoo!',\n text: 'Configuration saved into this browser.',\n icon: 'success'\n }).then(() => {\n location.reload()\n })\n })\n}\n\npage.getPrettyUploadAge = hours => {\n if (hours === 0) {\n return 'Permanent'\n } else if (hours < 1) {\n const minutes = hours * 60\n return `${minutes} minute${minutes === 1 ? '' : 's'}`\n } else if (hours >= 24) {\n const days = hours / 24\n return `${days} day${days === 1 ? '' : 's'}`\n } else {\n return `${hours} hour${hours === 1 ? '' : 's'}`\n }\n}\n\n// Handle image paste event\nwindow.addEventListener('paste', event => {\n const items = (event.clipboardData || event.originalEvent.clipboardData).items\n const index = Object.keys(items)\n for (let i = 0; i < index.length; i++) {\n const item = items[index[i]]\n if (item.kind === 'file') {\n const blob = item.getAsFile()\n const file = new File([blob], `pasted-image.${blob.type.match(/(?:[^/]*\\/)([^;]*)/)[1]}`, {\n type: blob.type\n })\n page.dropzone.addFile(file)\n }\n }\n})\n\nwindow.onload = () => {\n // Global error callback\n function onFailure (error) {\n if (error === undefined) return\n console.error(error)\n\n // Hide these elements\n document.querySelector('#albumDiv').classList.add('is-hidden')\n document.querySelector('#tabs').classList.add('is-hidden')\n document.querySelectorAll('.tab-content').forEach(element => {\n return element.classList.add('is-hidden')\n })\n\n // Update upload button\n const uploadButton = document.querySelector('#loginToUpload')\n uploadButton.innerText = 'An error occurred. Try to reload?'\n uploadButton.classList.remove('is-loading')\n uploadButton.classList.remove('is-hidden')\n\n uploadButton.addEventListener('click', () => {\n location.reload()\n })\n\n // Show alert modal\n if (error.response) {\n console.error(error.response)\n // Better error messages for Cloudflare errors\n const cloudflareErrors = {\n 520: 'Unknown Error',\n 521: 'Web Server Is Down',\n 522: 'Connection Timed Out',\n 523: 'Origin Is Unreachable',\n 524: 'A Timeout Occurred',\n 525: 'SSL Handshake Failed',\n 526: 'Invalid SSL Certificate',\n 527: 'Railgun Error',\n 530: 'Origin DNS Error'\n }\n const statusText = cloudflareErrors[error.response.status] || error.response.statusText\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'Please check the console for more information.'\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n } else {\n const content = document.createElement('div')\n content.innerHTML = `${error.toString()}`\n return swal({\n title: 'An error occurred!',\n icon: 'error',\n content\n })\n }\n }\n\n page.checkIfPublic(onFailure)\n\n page.clipboardJS = new ClipboardJS('.clipboard-js')\n\n page.clipboardJS.on('success', () => {\n return swal('Copied!', 'The link has been copied to clipboard.', 'success')\n })\n\n page.clipboardJS.on('error', onFailure)\n\n page.lazyLoad = new LazyLoad({\n elements_selector: '.field.uploads img'\n })\n\n document.querySelector('#createAlbum').addEventListener('click', () => {\n page.createAlbum()\n })\n}\n"]} \ No newline at end of file +{"version":3,"sources":["home.js"],"names":["const","lsKeys","token","chunkSize","parallelUploads","uploadsHistoryOrder","fileLength","uploadAge","page","localStorage","private","enableUserAccounts","maxSize","temporaryUploadAges","fileIdentifierLength","album","maxSizeBytes","urlMaxSize","urlMaxSizeBytes","tabs","activeTab","albumSelect","previewTemplate","dropzone","clipboardJS","lazyLoad","imageExtensions","checkIfPublic","onFailure","axios","get","then","response","data","parseInt","preparePage","catch","prepareUpload","verifyToken","button","document","querySelector","href","classList","remove","innerText","reloadOnError","post","success","swal","title","text","description","icon","removeItem","location","reload","addEventListener","value","prepareShareX","fetchAlbums","prepareUploadConfig","innerHTML","getPrettyBytes","add","prepareDropzone","event","uploadUrls","currentTarget","tabsContainer","querySelectorAll","loop","i","id","dataset","tabContent","setActiveTab","push","tab","content","length","index","let","headers","Array","isArray","albums","option","createElement","name","appendChild","previewNode","parentNode","removeChild","tabDiv","div","className","previewsContainer","Dropzone","body","url","paramName","clickable","maxFilesize","uploadMultiple","createImageThumbnails","autoProcessQueue","chunking","Boolean","parallelChunkUploads","chunksUploaded","file","done","previewElement","setAttribute","files","uuid","upload","original","type","albumid","filelength","age","error","toString","updateTemplate","on","xhr","chunked","setRequestHeader","progress","test","size","updateTemplateIcon","contains","urls","split","filter","trim","join","map","firstChild","posted","result","removeAttribute","run","templateElement","iconClass","iconElement","a","clipboard","clipboardText","parentElement","exec","includes","toLowerCase","img","src","onerror","update","expirydate","expiryDate","getPrettyDate","Date","createAlbum","buttons","cancel","confirm","closeModal","download","checked","public","selected","console","fallback","numConfig","min","max","fileLengthDiv","element","stored","default","helpText","range","force","disabled","isNaN","Object","keys","forEach","key","uploadAgeDiv","parseFloat","getPrettyUploadAge","form","preventDefault","siBytes","uploadFields","checkValidity","prefKeys","elements","numKeys","parsed","Math","hours","minutes","days","window","items","clipboardData","originalEvent","item","kind","blob","getAsFile","File","match","addFile","onload","undefined","uploadButton","statusText","520","521","522","523","524","525","526","527","530","status","ClipboardJS","LazyLoad","elements_selector"],"mappings":"AAEAA,IAAMC,OAAS,CACbC,MAAO,QACPC,UAAW,YACXC,gBAAiB,kBACjBC,oBAAqB,sBACrBC,WAAY,aACZC,UAAW,aAGPC,KAAO,CAEXN,MAAOO,aAAaR,OAAOC,OAG3BQ,QAAS,KACTC,mBAAoB,KACpBC,QAAS,KACTT,UAAW,KACXU,oBAAqB,KACrBC,qBAAsB,KAGtBC,MAAO,KAEPX,gBAAiB,KACjBC,oBAAqB,KACrBC,WAAY,KACZC,UAAW,KAEXS,aAAc,KACdC,WAAY,KACZC,gBAAiB,KAEjBC,KAAM,GACNC,UAAW,KACXC,YA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K,CACVC,MAAO,qBACPG,KAAM,QA/BN0B,QAgCAA,KAKNvE,KAAKmB,cAAcC,GAEnBpB,KAAKgB,YAAc,IAAIgN,YAAY,iBAEnChO,KAAKgB,YAAYsG,GAAG,WAAS,WAC3B,OAAO7E,KAAK,UAAW,yCAA0C,cAGnEzC,KAAKgB,YAAYsG,GAAG,QAASlG,GAE7BpB,KAAKiB,SAAW,IAAIgN,SAAS,CAC3BC,kBAAmB,uBAGrBlM,SAASC,cAAc,gBAAgBgB,iBAAiB,SAAO,WAC7DjD,KAAK4J","file":"home.js","sourcesContent":["/* global swal, axios, Dropzone, ClipboardJS, LazyLoad */\n\nconst lsKeys = {\n token: 'token',\n chunkSize: 'chunkSize',\n parallelUploads: 'parallelUploads',\n uploadsHistoryOrder: 'uploadsHistoryOrder',\n fileLength: 'fileLength',\n uploadAge: 'uploadAge'\n}\n\nconst page = {\n // user token\n token: localStorage[lsKeys.token],\n\n // configs from api/check\n private: null,\n enableUserAccounts: null,\n maxSize: null,\n chunkSize: null,\n temporaryUploadAges: null,\n fileIdentifierLength: null,\n\n // store album id that will be used with upload requests\n album: null,\n\n parallelUploads: null,\n uploadsHistoryOrder: null,\n fileLength: null,\n uploadAge: null,\n\n maxSizeBytes: null,\n urlMaxSize: null,\n urlMaxSizeBytes: null,\n\n tabs: [],\n activeTab: null,\n albumSelect: null,\n previewTemplate: null,\n\n dropzone: null,\n clipboardJS: null,\n lazyLoad: null,\n\n imageExtensions: ['.webp', '.jpg', '.jpeg', '.bmp', '.gif', '.png', '.svg']\n}\n\npage.checkIfPublic = onFailure => {\n return axios.get('api/check')\n .then(response => {\n page.private = response.data.private\n page.enableUserAccounts = response.data.enableUserAccounts\n page.maxSize = parseInt(response.data.maxSize)\n page.maxSizeBytes = page.maxSize * 1e6\n page.chunkSize = parseInt(response.data.chunkSize)\n page.temporaryUploadAges = response.data.temporaryUploadAges\n page.fileIdentifierLength = response.data.fileIdentifierLength\n return page.preparePage(onFailure)\n })\n .catch(onFailure)\n}\n\npage.preparePage = onFailure => {\n if (page.private)\n if (page.token) {\n return page.verifyToken(page.token, onFailure, true)\n } else {\n const button = document.querySelector('#loginToUpload')\n button.href = 'auth'\n button.classList.remove('is-loading')\n if (page.enableUserAccounts)\n button.innerText = 'Anonymous upload is disabled. Log in to upload.'\n else\n button.innerText = 'Running in private mode. Log in to upload.'\n }\n else\n return page.prepareUpload(onFailure)\n}\n\npage.verifyToken = (token, onFailure, reloadOnError) => {\n return axios.post('api/tokens/verify', { token }).then(response => {\n if (response.data.success === false)\n return swal({\n title: 'An error occurred!',\n text: response.data.description,\n icon: 'error'\n }).then(() => {\n if (!reloadOnError) return\n localStorage.removeItem('token')\n location.reload()\n })\n\n localStorage.token = token\n page.token = token\n return page.prepareUpload(onFailure)\n }).catch(onFailure)\n}\n\npage.prepareUpload = onFailure => {\n // I think this fits best here because we need to check for a valid token before we can get the albums\n if (page.token) {\n // Display the album selection\n document.querySelector('#albumDiv').classList.remove('is-hidden')\n\n page.albumSelect = document.querySelector('#albumSelect')\n page.albumSelect.addEventListener('change', () => {\n page.album = parseInt(page.albumSelect.value)\n // Re-generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n })\n\n // Fetch albums\n page.fetchAlbums(onFailure)\n }\n\n // Prepare & generate config tab\n page.prepareUploadConfig()\n\n // Update elements wherever applicable\n document.querySelector('#maxSize > span').innerHTML = page.getPrettyBytes(page.maxSizeBytes)\n document.querySelector('#loginToUpload').classList.add('is-hidden')\n\n if (!page.token && page.enableUserAccounts)\n document.querySelector('#loginLinkText').innerHTML = 'Create an account and keep track of your uploads'\n\n // Prepare & generate files upload tab\n page.prepareDropzone()\n\n // Generate ShareX config file\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n\n // Prepare urls upload tab\n const urlMaxSize = document.querySelector('#urlMaxSize')\n if (urlMaxSize) {\n page.urlMaxSize = parseInt(urlMaxSize.innerHTML)\n page.urlMaxSizeBytes = page.urlMaxSize * 1e6\n urlMaxSize.innerHTML = page.getPrettyBytes(page.urlMaxSizeBytes)\n document.querySelector('#uploadUrls').addEventListener('click', event => {\n page.uploadUrls(event.currentTarget)\n })\n }\n\n // Get all tabs\n const tabsContainer = document.querySelector('#tabs')\n const tabs = tabsContainer.querySelectorAll('li')\n for (let i = 0; i < tabs.length; i++) {\n const id = tabs[i].dataset.id\n const tabContent = document.querySelector(`#${id}`)\n if (!tabContent) continue\n\n tabs[i].addEventListener('click', () => {\n page.setActiveTab(i)\n })\n page.tabs.push({ tab: tabs[i], content: tabContent })\n }\n\n // Set first valid tab as the default active tab\n if (page.tabs.length) {\n page.setActiveTab(0)\n tabsContainer.classList.remove('is-hidden')\n }\n}\n\npage.setActiveTab = index => {\n for (let i = 0; i < page.tabs.length; i++)\n if (i === index) {\n page.tabs[i].tab.classList.add('is-active')\n page.tabs[i].content.classList.remove('is-hidden')\n page.activeTab = index\n } else {\n page.tabs[i].tab.classList.remove('is-active')\n page.tabs[i].content.classList.add('is-hidden')\n }\n}\n\npage.fetchAlbums = onFailure => {\n return axios.get('api/albums', { headers: { token: page.token } }).then(response => {\n if (response.data.success === false)\n return swal('An error occurred!', response.data.description, 'error')\n\n // Create an option for each album\n if (Array.isArray(response.data.albums) && response.data.albums.length)\n for (let i = 0; i < response.data.albums.length; i++) {\n const album = response.data.albums[i]\n const option = document.createElement('option')\n option.value = album.id\n option.innerHTML = album.name\n page.albumSelect.appendChild(option)\n }\n }).catch(onFailure)\n}\n\npage.prepareDropzone = () => {\n // Parse template element\n const previewNode = document.querySelector('#tpl')\n page.previewTemplate = previewNode.innerHTML\n previewNode.parentNode.removeChild(previewNode)\n\n // Generate files upload tab\n const tabDiv = document.querySelector('#tab-files')\n const div = document.createElement('div')\n div.className = 'control is-expanded'\n div.innerHTML = `\n
\n \n \n \n Click here or drag & drop files\n
\n `\n tabDiv.querySelector('.dz-container').appendChild(div)\n\n const previewsContainer = tabDiv.querySelector('#tab-files .field.uploads')\n\n page.dropzone = new Dropzone(document.body, {\n url: 'api/upload',\n paramName: 'files[]',\n clickable: tabDiv.querySelector('#dropzone'),\n maxFilesize: page.maxSizeBytes / 1024 / 1024, // this option expects MiB\n parallelUploads: page.parallelUploads,\n uploadMultiple: false,\n previewsContainer,\n previewTemplate: page.previewTemplate,\n createImageThumbnails: false,\n autoProcessQueue: true,\n headers: { token: page.token },\n chunking: Boolean(page.chunkSize),\n chunkSize: page.chunkSize * 1e6, // the option below expects Bytes\n parallelChunkUploads: false, // when set to true, it often hangs with hundreds of parallel uploads\n chunksUploaded (file, done) {\n file.previewElement.querySelector('.progress').setAttribute('value', 100)\n file.previewElement.querySelector('.progress').innerHTML = '100%'\n\n return axios.post('api/upload/finishchunks', {\n // This API supports an array of multiple files\n files: [{\n uuid: file.upload.uuid,\n original: file.name,\n type: file.type,\n albumid: page.album,\n filelength: page.fileLength,\n age: page.uploadAge\n }]\n }, { headers: { token: page.token } }).catch(error => {\n // Format error for display purpose\n return error.response.data ? error.response : {\n data: {\n success: false,\n description: error.toString()\n }\n }\n }).then(response => {\n file.previewElement.querySelector('.progress').classList.add('is-hidden')\n\n if (response.data.success === false)\n file.previewElement.querySelector('.error').innerHTML = response.data.description\n\n if (response.data.files && response.data.files[0])\n page.updateTemplate(file, response.data.files[0])\n\n return done()\n })\n }\n })\n\n page.dropzone.on('addedfile', file => {\n // Set active tab to file uploads, if necessary\n if (page.activeTab !== 0)\n page.setActiveTab(0)\n // Add file entry\n tabDiv.querySelector('.uploads').classList.remove('is-hidden')\n file.previewElement.querySelector('.name').innerHTML = file.name\n })\n\n page.dropzone.on('sending', (file, xhr) => {\n if (file.upload.chunked) return\n // Add headers if not uploading chunks\n if (page.album !== null) xhr.setRequestHeader('albumid', page.album)\n if (page.fileLength !== null) xhr.setRequestHeader('filelength', page.fileLength)\n if (page.uploadAge !== null) xhr.setRequestHeader('age', page.uploadAge)\n })\n\n // Update the total progress bar\n page.dropzone.on('uploadprogress', (file, progress) => {\n // For some reason, chunked uploads fire 100% progress event\n // for each chunk's successful uploads\n if (file.upload.chunked && progress === 100) return\n file.previewElement.querySelector('.progress').setAttribute('value', progress)\n file.previewElement.querySelector('.progress').innerHTML = `${progress}%`\n })\n\n page.dropzone.on('success', (file, response) => {\n if (!response) return\n file.previewElement.querySelector('.progress').classList.add('is-hidden')\n\n if (response.success === false)\n file.previewElement.querySelector('.error').innerHTML = response.description\n\n if (response.files && response.files[0])\n page.updateTemplate(file, response.files[0])\n })\n\n page.dropzone.on('error', (file, error) => {\n // Clean up file size errors\n if ((typeof error === 'string' && /^File is too big/.test(error)) ||\n (typeof error === 'object' && /File too large/.test(error.description)))\n error = `File too large (${page.getPrettyBytes(file.size)}).`\n\n page.updateTemplateIcon(file.previewElement, 'icon-block')\n file.previewElement.querySelector('.progress').classList.add('is-hidden')\n file.previewElement.querySelector('.name').innerHTML = file.name\n file.previewElement.querySelector('.error').innerHTML = error.description || error\n })\n}\n\npage.uploadUrls = button => {\n const tabDiv = document.querySelector('#tab-urls')\n if (!tabDiv || button.classList.contains('is-loading'))\n return\n\n button.classList.add('is-loading')\n\n function done (error) {\n if (error) swal('An error occurred!', error, 'error')\n button.classList.remove('is-loading')\n }\n\n function run () {\n const headers = {\n token: page.token,\n albumid: page.album,\n age: page.uploadAge,\n filelength: page.fileLength\n }\n\n const previewsContainer = tabDiv.querySelector('.uploads')\n const urls = document.querySelector('#urls').value\n .split(/\\r?\\n/)\n .filter(url => {\n return url.trim().length\n })\n document.querySelector('#urls').value = urls.join('\\n')\n\n if (!urls.length)\n return done('You have not entered any URLs.')\n\n tabDiv.querySelector('.uploads').classList.remove('is-hidden')\n const files = urls.map(url => {\n const previewTemplate = document.createElement('template')\n previewTemplate.innerHTML = page.previewTemplate.trim()\n const previewElement = previewTemplate.content.firstChild\n previewElement.querySelector('.name').innerHTML = url\n previewsContainer.appendChild(previewElement)\n return { url, previewElement }\n })\n\n function post (i) {\n if (i === files.length)\n return done()\n\n function posted (result) {\n files[i].previewElement.querySelector('.progress').classList.add('is-hidden')\n if (result.success) {\n page.updateTemplate(files[i], result.files[0])\n } else {\n page.updateTemplateIcon(files[i].previewElement, 'icon-block')\n files[i].previewElement.querySelector('.error').innerHTML = result.description\n }\n return post(i + 1)\n }\n\n // Animate progress bar\n files[i].previewElement.querySelector('.progress').removeAttribute('value')\n\n return axios.post('api/upload', { urls: [files[i].url] }, { headers }).then(response => {\n return posted(response.data)\n }).catch(error => {\n return posted({\n success: false,\n description: error.response ? error.response.data.description : error.toString()\n })\n })\n }\n return post(0)\n }\n return run()\n}\n\npage.updateTemplateIcon = (templateElement, iconClass) => {\n const iconElement = templateElement.querySelector('.icon')\n if (!iconElement) return\n iconElement.classList.add(iconClass)\n iconElement.classList.remove('is-hidden')\n}\n\npage.updateTemplate = (file, response) => {\n if (!response.url) return\n\n const a = file.previewElement.querySelector('.link > a')\n const clipboard = file.previewElement.querySelector('.clipboard-mobile > .clipboard-js')\n a.href = a.innerHTML = clipboard.dataset.clipboardText = response.url\n clipboard.parentElement.classList.remove('is-hidden')\n\n const exec = /.[\\w]+(\\?|$)/.exec(response.url)\n if (exec && exec[0] && page.imageExtensions.includes(exec[0].toLowerCase())) {\n const img = file.previewElement.querySelector('img')\n img.setAttribute('alt', response.name || '')\n img.dataset.src = response.url\n img.classList.remove('is-hidden')\n img.onerror = event => {\n // Hide image elements that fail to load\n // Consequently include WEBP in browsers that do not have WEBP support (e.i. IE)\n event.currentTarget.classList.add('is-hidden')\n page.updateTemplateIcon(file.previewElement, 'icon-picture')\n }\n page.lazyLoad.update(file.previewElement.querySelectorAll('img'))\n } else {\n page.updateTemplateIcon(file.previewElement, 'icon-doc-inv')\n }\n\n if (response.expirydate) {\n const expiryDate = file.previewElement.querySelector('.expiry-date')\n expiryDate.innerHTML = `Expiry date: ${page.getPrettyDate(new Date(response.expirydate * 1000))}`\n expiryDate.classList.remove('is-hidden')\n }\n}\n\npage.createAlbum = () => {\n const div = document.createElement('div')\n div.innerHTML = `\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n
\n `\n\n swal({\n title: 'Create new album',\n icon: 'info',\n content: div,\n buttons: {\n cancel: true,\n confirm: {\n closeModal: false\n }\n }\n }).then(value => {\n if (!value) return\n\n const name = document.querySelector('#swalName').value.trim()\n axios.post('api/albums', {\n name,\n description: document.querySelector('#swalDescription').value.trim(),\n download: document.querySelector('#swalDownload').checked,\n public: document.querySelector('#swalPublic').checked\n }, {\n headers: {\n token: page.token\n }\n }).then(response => {\n if (response.data.success === false)\n return swal('An error occurred!', response.data.description, 'error')\n\n const option = document.createElement('option')\n page.albumSelect.appendChild(option)\n option.value = response.data.id\n option.innerHTML = name\n option.selected = true\n\n swal('Woohoo!', 'Album was created successfully.', 'success')\n }).catch(error => {\n console.error(error)\n return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')\n })\n })\n}\n\npage.prepareUploadConfig = () => {\n const fallback = {\n chunkSize: page.chunkSize,\n parallelUploads: 2\n }\n\n page.chunkSize = parseInt(localStorage[lsKeys.chunkSize]) || fallback.chunkSize\n page.parallelUploads = parseInt(localStorage[lsKeys.parallelUploads]) || fallback.parallelUploads\n document.querySelector('#chunkSize').value = page.chunkSize\n document.querySelector('#parallelUploads').value = page.parallelUploads\n\n const numConfig = {\n chunkSize: { min: 1, max: 95 },\n parallelUploads: { min: 1, max: 8 }\n }\n\n document.querySelector('#chunkSizeDiv .help').innerHTML =\n `Default is ${fallback.chunkSize} MB. Max is ${numConfig.chunkSize.max} MB.`\n document.querySelector('#parallelUploadsDiv .help').innerHTML =\n `Default is ${fallback.parallelUploads}. Max is ${numConfig.parallelUploads.max}.`\n\n const fileLengthDiv = document.querySelector('#fileLengthDiv')\n if (page.fileIdentifierLength && fileLengthDiv) {\n const element = document.querySelector('#fileLength')\n const stored = parseInt(localStorage[lsKeys.fileLength])\n\n fallback.fileLength = page.fileIdentifierLength.default\n let helpText = `Default is ${page.fileIdentifierLength.default}.`\n\n const range = typeof page.fileIdentifierLength.min === 'number' &&\n typeof page.fileIdentifierLength.max === 'number'\n\n if (range) {\n helpText += ` Min is ${page.fileIdentifierLength.min}. Max is ${page.fileIdentifierLength.max}`\n numConfig.fileLength = {\n min: page.fileIdentifierLength.min,\n max: page.fileIdentifierLength.max\n }\n }\n\n if (page.fileIdentifierLength.force) {\n helpText += ' This option is currently disabled.'\n element.disabled = true\n }\n\n if (page.fileIdentifierLength.force ||\n isNaN(stored) ||\n !range ||\n stored < page.fileIdentifierLength.min ||\n stored > page.fileIdentifierLength.max) {\n element.value = fallback.fileLength\n page.fileLength = null\n } else {\n element.value = stored\n page.fileLength = stored\n }\n\n fileLengthDiv.classList.remove('is-hidden')\n fileLengthDiv.querySelector('.help').innerHTML = helpText\n }\n\n Object.keys(numConfig).forEach(key => {\n document.querySelector(`#${key}`).setAttribute('min', numConfig[key].min)\n document.querySelector(`#${key}`).setAttribute('max', numConfig[key].max)\n })\n\n const uploadAgeDiv = document.querySelector('#uploadAgeDiv')\n if (Array.isArray(page.temporaryUploadAges) && page.temporaryUploadAges.length && uploadAgeDiv) {\n const element = document.querySelector('#uploadAge')\n const stored = parseFloat(localStorage[lsKeys.uploadAge])\n for (let i = 0; i < page.temporaryUploadAges.length; i++) {\n const age = page.temporaryUploadAges[i]\n const option = document.createElement('option')\n option.value = i === 0 ? 'default' : age\n option.innerHTML = page.getPrettyUploadAge(age) +\n (i === 0 ? ' (default)' : '')\n element.appendChild(option)\n if (age === stored) {\n element.value = option.value\n page.uploadAge = stored\n }\n }\n uploadAgeDiv.classList.remove('is-hidden')\n }\n\n const tabContent = document.querySelector('#tab-config')\n const form = tabContent.querySelector('form')\n form.addEventListener('submit', event => {\n event.preventDefault()\n })\n\n const siBytes = localStorage[lsKeys.siBytes] !== '0'\n if (!siBytes) document.querySelector('#siBytes').value = '0'\n\n const olderOnTop = localStorage[lsKeys.uploadsHistoryOrder] !== '0'\n if (!olderOnTop) {\n document.querySelector('#uploadsHistoryOrder').value = '0'\n const uploadFields = document.querySelectorAll('.tab-content > .uploads')\n for (let i = 0; i < uploadFields.length; i++)\n uploadFields[i].classList.add('is-reversed')\n }\n\n document.querySelector('#saveConfig').addEventListener('click', () => {\n if (!form.checkValidity())\n return\n\n const prefKeys = ['siBytes', 'uploadsHistoryOrder', 'uploadAge']\n for (let i = 0; i < prefKeys.length; i++) {\n const value = form.elements[prefKeys[i]].value\n if (value !== 'default' && value !== fallback[prefKeys[i]])\n localStorage[lsKeys[prefKeys[i]]] = value\n else\n localStorage.removeItem(lsKeys[prefKeys[i]])\n }\n\n const numKeys = Object.keys(numConfig)\n for (let i = 0; i < numKeys.length; i++) {\n const parsed = parseInt(form.elements[numKeys[i]].value) || 0\n const value = Math.min(Math.max(parsed, numConfig[numKeys[i]].min), numConfig[numKeys[i]].max)\n if (value > 0 && value !== fallback[numKeys[i]])\n localStorage[lsKeys[numKeys[i]]] = value\n else\n localStorage.removeItem(lsKeys[numKeys[i]])\n }\n\n swal({\n title: 'Woohoo!',\n text: 'Configuration saved into this browser.',\n icon: 'success'\n }).then(() => {\n location.reload()\n })\n })\n}\n\npage.getPrettyUploadAge = hours => {\n if (hours === 0) {\n return 'Permanent'\n } else if (hours < 1) {\n const minutes = hours * 60\n return `${minutes} minute${minutes === 1 ? '' : 's'}`\n } else if (hours >= 24) {\n const days = hours / 24\n return `${days} day${days === 1 ? '' : 's'}`\n } else {\n return `${hours} hour${hours === 1 ? '' : 's'}`\n }\n}\n\n// Handle image paste event\nwindow.addEventListener('paste', event => {\n const items = (event.clipboardData || event.originalEvent.clipboardData).items\n const index = Object.keys(items)\n for (let i = 0; i < index.length; i++) {\n const item = items[index[i]]\n if (item.kind === 'file') {\n const blob = item.getAsFile()\n const file = new File([blob], `pasted-image.${blob.type.match(/(?:[^/]*\\/)([^;]*)/)[1]}`, {\n type: blob.type\n })\n page.dropzone.addFile(file)\n }\n }\n})\n\nwindow.onload = () => {\n // Global error callback\n function onFailure (error) {\n if (error === undefined) return\n console.error(error)\n\n // Hide these elements\n document.querySelector('#albumDiv').classList.add('is-hidden')\n document.querySelector('#tabs').classList.add('is-hidden')\n document.querySelectorAll('.tab-content').forEach(element => {\n return element.classList.add('is-hidden')\n })\n\n // Update upload button\n const uploadButton = document.querySelector('#loginToUpload')\n uploadButton.innerText = 'An error occurred. Try to reload?'\n uploadButton.classList.remove('is-loading')\n uploadButton.classList.remove('is-hidden')\n\n uploadButton.addEventListener('click', () => {\n location.reload()\n })\n\n // Show alert modal\n if (error.response) {\n console.error(error.response)\n // Better error messages for Cloudflare errors\n const cloudflareErrors = {\n 520: 'Unknown Error',\n 521: 'Web Server Is Down',\n 522: 'Connection Timed Out',\n 523: 'Origin Is Unreachable',\n 524: 'A Timeout Occurred',\n 525: 'SSL Handshake Failed',\n 526: 'Invalid SSL Certificate',\n 527: 'Railgun Error',\n 530: 'Origin DNS Error'\n }\n const statusText = cloudflareErrors[error.response.status] || error.response.statusText\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'Please check the console for more information.'\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n } else {\n const content = document.createElement('div')\n content.innerHTML = `${error.toString()}`\n return swal({\n title: 'An error occurred!',\n icon: 'error',\n content\n })\n }\n }\n\n page.checkIfPublic(onFailure)\n\n page.clipboardJS = new ClipboardJS('.clipboard-js')\n\n page.clipboardJS.on('success', () => {\n return swal('Copied!', 'The link has been copied to clipboard.', 'success')\n })\n\n page.clipboardJS.on('error', onFailure)\n\n page.lazyLoad = new LazyLoad({\n elements_selector: '.field.uploads img'\n })\n\n document.querySelector('#createAlbum').addEventListener('click', () => {\n page.createAlbum()\n })\n}\n"]} \ No newline at end of file diff --git a/src/css/home.css b/src/css/home.css index ea9a4df..8d91c7b 100644 --- a/src/css/home.css +++ b/src/css/home.css @@ -89,11 +89,20 @@ } } +.uploads.is-reversed { + display: flex; + flex-direction: column-reverse +} + .uploads > div { animation: fadeInOpacity 0.5s; margin: 1rem } +.uploads.is-reversed > div { + flex: 0 0 auto +} + .uploads > div:first-child { margin-top: 1.5rem } @@ -102,11 +111,11 @@ margin-bottom: 0 } -.uploads .field > .icon:not(.icon-block) { +.uploads > div > .icon:not(.icon-block) { color: #3794d2 } -.uploads .field > .icon.icon-block { +.uploads > div > .icon.icon-block { color: #da4453 } diff --git a/src/js/home.js b/src/js/home.js index 8ca4d59..87f1fba 100644 --- a/src/js/home.js +++ b/src/js/home.js @@ -4,6 +4,7 @@ const lsKeys = { token: 'token', chunkSize: 'chunkSize', parallelUploads: 'parallelUploads', + uploadsHistoryOrder: 'uploadsHistoryOrder', fileLength: 'fileLength', uploadAge: 'uploadAge' } @@ -24,6 +25,7 @@ const page = { album: null, parallelUploads: null, + uploadsHistoryOrder: null, fileLength: null, uploadAge: null, @@ -591,11 +593,19 @@ page.prepareUploadConfig = () => { const siBytes = localStorage[lsKeys.siBytes] !== '0' if (!siBytes) document.querySelector('#siBytes').value = '0' + const olderOnTop = localStorage[lsKeys.uploadsHistoryOrder] !== '0' + if (!olderOnTop) { + document.querySelector('#uploadsHistoryOrder').value = '0' + const uploadFields = document.querySelectorAll('.tab-content > .uploads') + for (let i = 0; i < uploadFields.length; i++) + uploadFields[i].classList.add('is-reversed') + } + document.querySelector('#saveConfig').addEventListener('click', () => { if (!form.checkValidity()) return - const prefKeys = ['siBytes', 'uploadAge'] + const prefKeys = ['siBytes', 'uploadsHistoryOrder', 'uploadAge'] for (let i = 0; i < prefKeys.length; i++) { const value = form.elements[prefKeys[i]].value if (value !== 'default' && value !== fallback[prefKeys[i]]) diff --git a/todo.md b/todo.md index 6615210..ef62831 100644 --- a/todo.md +++ b/todo.md @@ -14,6 +14,8 @@ Normal priority: * [*] Use Gatsby logo for link to [blog.fiery.me](https://blog.fiery.me/) on the homepage. * [ ] Auto-detect missing columns in `database/db.js`. * [*] Better error message when server is down. +* [ ] Show expiry date in thumbs view. +* [ ] Add Select all checkbox somewhere in thumbs view. Low priority: diff --git a/views/_globals.njk b/views/_globals.njk index 062c522..4a78361 100644 --- a/views/_globals.njk +++ b/views/_globals.njk @@ -16,7 +16,7 @@ v3: CSS and JS files (libs such as bulma, lazyload, etc). v4: Renders in /public/render/* directories (to be used by render.js). #} -{% set v1 = "23xR9kTFtk" %} +{% set v1 = "JxzI0kN09F" %} {% set v2 = "hiboQUzAzp" %} {% set v3 = "fFS2CGH95j" %} {% set v4 = "S3TAWpPeFS" %} diff --git a/views/home.njk b/views/home.njk index 3e60e56..f7810c3 100644 --- a/views/home.njk +++ b/views/home.njk @@ -169,6 +169,18 @@

+
+ +
+
+ +
+
+

Newer files on top only works in these browsers.

+