Skip to content
Snippets Groups Projects
Commit 00c528dc authored by Trirst's avatar Trirst
Browse files

Update new build

parent 012ade47
No related branches found
No related tags found
No related merge requests found
#image-container[data-v-198eb460]{position:relative}img[data-v-198eb460]{height:100%;width:100%}#checkmark[data-v-198eb460]{font-family:Lucida Console,monospace;font-weight:700;color:#fff;background:#d12727;position:absolute;top:.4em;left:.4em;padding:.4em .6em}#list-container[data-v-5e7dae37]{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;position:relative}#item-container[data-v-5e7dae37]{max-width:20%;display:flex;flex-direction:column}button[data-v-5e7dae37]{position:fixed;bottom:1em;right:1em;padding:1em 1em;background:#add8e6;color:#2f2a2a}.login-button[data-v-b6e9e1e8]{margin-left:.5rem;display:inline-block;stroke:currentColor;--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.login-button[data-v-b6e9e1e8]:hover{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}#user-section[data-v-77c1fd34]{display:flex;flex-flow:column;position:sticky;top:0;height:100vh}#home-container[data-v-77c1fd34]{display:flex;flex-flow:row}img[data-v-086aeb6a]{height:100%}#image-container[data-v-086aeb6a]{height:100vh;display:flex;justify-content:center}
/*! tailwindcss v2.2.4 | MIT License | https://tailwindcss.com */
/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],button{-webkit-appearance:button}legend{padding:0}progress{vertical-align:baseline}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:after,:before{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.absolute{position:absolute}.relative{position:relative}.top-0{top:0}.top-0\.5{top:.125rem}.right-0{right:0}.right-0\.5{right:.125rem}.bottom-0{bottom:0}.z-10{z-index:10}.m-2{margin:.5rem}.m-4{margin:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.ml-1{margin-left:.25rem}.inline-block{display:inline-block}.flex{display:flex}.table{display:table}.h-48{height:12rem}.h-full{height:100%}.max-h-28{max-height:7rem}.w-1\/3{width:33.333333%}.w-full{width:100%}.max-w-xs{max-width:20rem}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{transform:scale(2);opacity:0}}@keyframes ping{75%,to{transform:scale(2);opacity:0}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}@keyframes bounce{0%,to{transform:translateY(-25%);-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1)}}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.overflow-y-auto{overflow-y:auto}.whitespace-normal{white-space:normal}.rounded{border-radius:.25rem}.border-4{border-width:4px}.border{border-width:1px}.border-dotted{border-style:dotted}.border-transparent{border-color:transparent}.border-gray-400{--tw-border-opacity:1;border-color:rgba(156,163,175,var(--tw-border-opacity))}.border-gray-500{--tw-border-opacity:1;border-color:rgba(107,114,128,var(--tw-border-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity:1;background-color:rgba(248,113,113,var(--tw-bg-opacity))}.hover\:bg-gray-800:hover{--tw-bg-opacity:1;background-color:rgba(31,41,55,var(--tw-bg-opacity))}.stroke-current{stroke:currentColor}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-5{padding:1.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-semibold{font-weight:600}.text-gray-50{--tw-text-opacity:1;color:rgba(249,250,251,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.hover\:text-gray-100:hover{--tw-text-opacity:1;color:rgba(243,244,246,var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.hover\:opacity-75:hover{opacity:.75}*,:after,:before{--tw-shadow:0 0 transparent}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 rgba(0,0,0,0.06);box-shadow:var(--tw-ring-offset-shadow,0 0 transparent),var(--tw-ring-shadow,0 0 transparent),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,0.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent}.focus\:ring-2:focus,.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 transparent)}.ring-red-500{--tw-ring-opacity:1;--tw-ring-color:rgba(239,68,68,var(--tw-ring-opacity))}.focus\:ring-gray-400:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(156,163,175,var(--tw-ring-opacity))}
\ No newline at end of file
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/web/favicon.ico"><title>imageboard-web</title><link href="/web/css/app.e9f65b79.css" rel="preload" as="style"><link href="/web/js/app.e93518f9.js" rel="preload" as="script"><link href="/web/js/chunk-vendors.8fe4ecea.js" rel="preload" as="script"><link href="/web/css/app.e9f65b79.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but imageboard-web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/web/js/chunk-vendors.8fe4ecea.js"></script><script src="/web/js/app.e93518f9.js"></script></body></html> <!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/web/favicon.ico"><title>imageboard-web</title><link href="/web/css/app.5c8d36f0.css" rel="preload" as="style"><link href="/web/js/app.c644db16.js" rel="preload" as="script"><link href="/web/js/chunk-vendors.4c5f132c.js" rel="preload" as="script"><link href="/web/css/app.5c8d36f0.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but imageboard-web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/web/js/chunk-vendors.4c5f132c.js"></script><script src="/web/js/app.c644db16.js"></script></body></html>
\ No newline at end of file \ No newline at end of file
(function(e){function t(t){for(var n,s,c=t[0],o=t[1],u=t[2],d=0,h=[];d<c.length;d++)s=c[d],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&h.push(r[s][0]),r[s]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n]);l&&l(t);while(h.length)h.shift()();return i.push.apply(i,u||[]),a()}function a(){for(var e,t=0;t<i.length;t++){for(var a=i[t],n=!0,c=1;c<a.length;c++){var o=a[c];0!==r[o]&&(n=!1)}n&&(i.splice(t--,1),e=s(s.s=a[0]))}return e}var n={},r={app:0},i=[];function s(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=e,s.c=n,s.d=function(e,t,a){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(a,n,function(t){return e[t]}.bind(null,n));return a},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/web/";var c=window["webpackJsonp"]=window["webpackJsonp"]||[],o=c.push.bind(c);c.push=t,c=c.slice();for(var u=0;u<c.length;u++)t(c[u]);var l=o;i.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"00f7":function(e,t,a){},"4feb":function(e,t,a){"use strict";a("a595")},"515e":function(e,t,a){},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");var n=a("2b0e"),r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app"}},[a("router-view")],1)},i=[],s=a("2877"),c={},o=Object(s["a"])(c,r,i,!1,null,null,null),u=o.exports,l=a("8c4f"),d=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"home-container"}},[a("section",{staticClass:"w-1/3",attrs:{id:"user-section"}},[a("div",[a("ImageUpload"),a("TagCreation"),a("UserAuthentication",{staticClass:"absolute bottom-0"})],1)]),a("ImageList",{attrs:{hashArray:e.stateHashArray}})],1)},h=[],p=a("1da1"),g=a("5530"),f=(a("96cf"),a("d3b7"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("section",{attrs:{id:"list-container"}},[e._l(e.hashArray,(function(t,n){return a("div",{key:n,attrs:{id:"item-container"}},[a("ImageItem",{attrs:{hash:t},on:{checked:e.appendToDeleteArray}})],1)})),a("button",{directives:[{name:"show",rawName:"v-show",value:e.deleteArray.length,expression:"deleteArray.length"}],on:{click:function(t){return e.deleteImages(e.deleteArray)}}},[e._v(" Delete ")])],2)}),m=[],v=(a("a434"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"image-container"},on:{click:function(t){return t.ctrlKey&&t.shiftKey?t.altKey||t.metaKey?null:(e.checked=!e.checked,void e.$emit("checked",e.checked,e.hash)):null}}},[a("div",{directives:[{name:"show",rawName:"v-show",value:e.checked,expression:"checked"}],attrs:{id:"checkmark"},on:{click:function(t){e.checked=!e.checked,e.$emit("checked",e.checked,e.hash)}}},[e._v(" X ")]),a("router-link",{attrs:{to:"/image/"+e.hash},nativeOn:{click:function(e){return e.ctrlKey&&e.shiftKey?void e.preventDefault():null}}},[a("img",{attrs:{src:"/api/image/"+e.hash+"/file"}})])],1)}),y=[],b={data:function(){return{checked:!1}},props:{hash:{required:!0}},methods:{}},w=b,x=(a("a9dd"),Object(s["a"])(w,v,y,!1,null,"198eb460",null)),k=x.exports,_=a("2f62"),j={components:{ImageItem:k},data:function(){return{deleteArray:[]}},props:{hashArray:{required:!0}},computed:Object(g["a"])({},Object(_["c"])(["stateUser"])),methods:{appendToDeleteArray:function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var n=t[0],r=t[1];n?this.deleteArray.push(r):this.deleteArray.splice(this.deleteArray.indexOf(r),1)},deleteImages:function(e){for(var t={method:"DELETE",headers:{secret:this.stateUser.secret}},a=0;a<e.length;a++)fetch("/api/image/".concat(e[a]),t);this.deleteArray=[]}}},O=j,T=(a("c6d3"),Object(s["a"])(O,f,m,!1,null,"5e7dae37",null)),A=T.exports,C=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"h-48 m-4 border-dotted border-4 border-gray-400",on:{drop:function(t){t.preventDefault(),e.updateWrapper(t),t.currentTarget.classList.remove("bg-gray-200")},dragover:function(e){return e.preventDefault(),e.currentTarget.classList.add("bg-gray-200")},dragleave:function(e){return e.preventDefault(),e.currentTarget.classList.remove("bg-gray-200")}}},[a("div",{staticClass:"relative h-full"},[a("input",{ref:"imageInput",staticClass:"h-full w-full opacity-0 absolute z-10 cursor-pointer",attrs:{type:"file",accept:"image/png, image/jpeg,\n image/gif",multiple:""},on:{change:function(t){return e.updateWrapper()}}}),a("div",{directives:[{name:"show",rawName:"v-show",value:!e.imageList.length,expression:"!imageList.length"}],staticClass:"\n h-full\n font-semibold\n opacity-25\n flex\n justify-center\n items-center\n "},[e._v(" Drag and drop images here or click here to browse. ")]),a("div",{directives:[{name:"show",rawName:"v-show",value:e.imageList.length,expression:"imageList.length"}],staticClass:"h-full flex flex-row flex-wrap content-start overflow-y-auto"},e._l(e.previews,(function(t,n){return a("img",{key:n,staticClass:"max-h-28 relative z-10",attrs:{src:t.url,alt:""},on:{click:function(a){return e.removeImage(t.image)}}})})),0)])]),a("div",{staticClass:"flex flex-col items-center m-4"},[e.invalidType?a("WarningBox",{on:{click:function(t){e.invalidType=!1}}},[e._v(" Please upload PNG, JPEG or GIF image only. ")]):e._e(),a("button",{directives:[{name:"show",rawName:"v-show",value:e.imageList.length,expression:"imageList.length"}],staticClass:"\n border border-gray-500\n p-2\n rounded\n mx-auto\n font-semibold\n text-gray-800\n hover:bg-gray-800\n hover:text-gray-100\n ",on:{click:e.submitImage}},[e._v(" Submit ")])],1)])},I=[],S=a("2909"),U=(a("159b"),a("3ca3"),a("ddb0"),a("2b3d"),a("99af"),a("caad"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"\n p-5\n m-2\n font-semibold\n bg-red-400\n ring-2 ring-red-500\n rounded\n text-gray-50\n relative\n max-w-xs\n whitespace-normal\n "},[e._t("default"),a("XCircle",{staticClass:"\n absolute\n top-0.5\n right-0.5\n stroke-current\n text-red-600\n opacity-40\n hover:opacity-75\n ",nativeOn:{click:function(t){return e.$emit("click")}}})],2)}),L=[],H=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:e.width,height:e.height,viewBox:"0 0 24 24",fill:"none",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[a("circle",{attrs:{cx:"12",cy:"12",r:"10"}}),a("line",{attrs:{x1:"15",y1:"9",x2:"9",y2:"15"}}),a("line",{attrs:{x1:"9",y1:"9",x2:"15",y2:"15"}})])},$=[],E={props:{width:{default:24},height:{default:24}}},P=E,D=Object(s["a"])(P,H,$,!1,null,null,null),N=D.exports,R={components:{XCircle:N}},W=R,F=Object(s["a"])(W,U,L,!1,null,null,null),M=F.exports,B={components:{WarningBox:M},data:function(){return{imageList:[],invalidType:!1}},computed:Object(g["a"])({previews:function(){var e=[];return this.imageList.forEach((function(t){return e.push({url:URL.createObjectURL(t),image:t})})),e}},Object(_["c"])(["stateUser"])),methods:Object(g["a"])({updateWrapper:function(e){this.checkImageType(e)?this.updateImageList(e):this.$refs.imageInput.value=""},updateImageList:function(e){this.imageList=this.imageList.concat(e?Object(S["a"])(e.dataTransfer.files):Object(S["a"])(this.$refs.imageInput.files))},checkImageType:function(e){for(var t=["image/png","image/jpeg","image/gif"],a=e?Object(S["a"])(e.dataTransfer.files):Object(S["a"])(this.$refs.imageInput.files),n=0;n<a.length;n++)if(!t.includes(a[n].type))return this.invalidType=!0,!1;return this.invalidType=!1,!0},removeImage:function(e){this.imageList.splice(this.imageList.indexOf(e),1)},submitImage:function(){for(var e=new FormData,t=0;t<this.imageList.length;t++)e.set("image",this.imageList[t]),this.postImage(e);this.invalidType=!1,this.imageList=[]},postImage:function(e){var t=this;return Object(p["a"])(regeneratorRuntime.mark((function a(){var n,r,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,n={method:"POST",headers:{secret:t.stateUser.secret},body:e},a.next=4,fetch("/api/image",n);case 4:return r=a.sent,a.next=7,r.json();case 7:i=a.sent,t.addStateHashArray(i.hash),a.next=14;break;case 11:a.prev=11,a.t0=a["catch"](0);case 14:case"end":return a.stop()}}),a,null,[[0,11]])})))()}},Object(_["b"])(["addStateHashArray"]))},K=B,G=Object(s["a"])(K,C,I,!1,null,null,null),X=G.exports,z=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",[e._v("Add tag/Change tag type")]),a("div",[a("input",{directives:[{name:"model",rawName:"v-model",value:e.tag,expression:"tag"}],attrs:{placeholder:"Tag to add"},domProps:{value:e.tag},on:{input:function(t){t.target.composing||(e.tag=t.target.value)}}}),a("select",{directives:[{name:"model",rawName:"v-model",value:e.tagType,expression:"tagType"}],on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.tagType=t.target.multiple?a:a[0]}}},[a("option",{attrs:{disabled:""}},[e._v("Tag type")]),a("option",{attrs:{value:"artist"}},[e._v("Artist")]),a("option",{attrs:{value:"character"}},[e._v("Character")]),a("option",{attrs:{value:"copyright"}},[e._v("Copyright")]),a("option",{attrs:{value:"generic"}},[e._v("Generic")]),a("option",{attrs:{value:"group"}},[e._v("Group")]),a("option",{attrs:{value:"meta"}},[e._v("Meta")])])]),a("div",[a("button",{attrs:{disabled:e.tagIncorrect},on:{click:function(t){e.setTag(),e.setType(),e.resetTagAndType()}}},[e._v(" Submit ")])]),e.tagIncorrect?a("div",[e._v(" Tag incorrect. Make sure your tag doesn't exceed 128 characters and matches "),a("b",[e._v("/^[a-z0-9()_-]*$/g")])]):e._e(),a("div",[e._v("Type: "+e._s(e.tagType)+", Tag: "+e._s(e.tag))])])},J=[],q=(a("ac1f"),a("466d"),{data:function(){return{tag:"",tagType:"generic"}},computed:Object(g["a"])({tagIncorrect:function(){var e=/^[a-z0-9()_-]*$/g;return!this.tag.match(e)||this.tag.length>128}},Object(_["c"])(["stateUser"])),methods:{setTag:function(){fetch("/api/tag/".concat(this.tag),{method:"PUT",headers:{secret:this.stateUser.secret}}).then((function(e){console.log(e)})).catch((function(e){return console.error(e)}))},setType:function(){var e={method:"PATCH",headers:{"Content-Type":"application/json",secret:this.stateUser.secret},body:JSON.stringify({type:this.tagType})};fetch("/api/tag/".concat(this.tag,"/info"),e).then((function(e){return console.log(e)})).catch((function(e){return console.error(e)}))},resetTagAndType:function(){this.tag="",this.tagType="generic"}}}),V=q,Q=Object(s["a"])(V,z,J,!1,null,null,null),Y=Q.exports,Z=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e.stateUser.id?a("div",{staticClass:"text-lg ml-1 mb-1"},[e._v(" Welcome, "+e._s(e.stateUser.username)+" ")]):a("div",[e.authenticating?e._e():a("button",{staticClass:"\n hover:text-gray-600\n focus:outline-none\n text-gray-800\n font-semibold\n p-2\n ",on:{click:function(t){e.authenticating=!0}}},[e._v(" Authenticate ")]),e.authenticating?a("div",[e.authenticationFailed?a("WarningBox",{on:{click:function(t){e.authenticationFailed=!1}}},[e._v(" Authentication failed. Please check your secret token. ")]):e._e(),a("input",{directives:[{name:"model",rawName:"v-model",value:e.secret,expression:"secret"}],staticClass:"\n border border-transparent\n rounded\n m-4\n p-1\n shadow-inner\n bg-gray-200\n focus:ring-2 focus:ring-gray-400\n ",attrs:{type:"text",placeholder:"Secret token"},domProps:{value:e.secret},on:{keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.authenticate(e.secret.trim())},input:function(t){t.target.composing||(e.secret=t.target.value)}}}),a("span",[a("button",{on:{click:function(t){e.authenticate(e.secret.trim())}}},[a("Checkmark",{staticClass:"login-button",attrs:{width:"30",height:"30"}})],1),a("button",{on:{click:function(t){e.authenticating=!1,e.authenticationFailed=!1,e.secret=""}}},[a("XCircle",{staticClass:"login-button",attrs:{width:"30",height:"30"}})],1)])],1):e._e()])])},ee=[],te=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:e.width,height:e.height,viewBox:"0 0 24 24",fill:"none",stroke:"#000000","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}},[a("path",{attrs:{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}}),a("polyline",{attrs:{points:"22 4 12 14.01 9 11.01"}})])},ae=[],ne={props:{width:{default:24},height:{default:24}}},re=ne,ie=Object(s["a"])(re,te,ae,!1,null,null,null),se=ie.exports,ce={components:{Checkmark:se,XCircle:N,WarningBox:M},data:function(){return{authenticating:!1,authenticationFailed:!1,secret:""}},computed:Object(g["a"])({},Object(_["c"])(["stateUser"])),methods:Object(g["a"])({authenticate:function(e){var t=this;return Object(p["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,fetch("/api/user/this",{headers:{secret:e}});case 3:return n=a.sent,a.next=6,n.json();case 6:r=a.sent,n.ok?t.saveStateUser({id:r.id,privileged:r.privileged,username:r.username,secret:e}):t.authenticationFailed=!0,a.next=13;break;case 10:a.prev=10,a.t0=a["catch"](0);case 13:case"end":return a.stop()}}),a,null,[[0,10]])})))()}},Object(_["b"])(["saveStateUser"]))},oe=ce,ue=(a("4feb"),Object(s["a"])(oe,Z,ee,!1,null,"b6e9e1e8",null)),le=ue.exports,de={components:{ImageList:A,ImageUpload:X,TagCreation:Y,UserAuthentication:le},computed:Object(g["a"])({},Object(_["c"])(["stateHashArray"])),created:function(){this.updateHashArray()},methods:Object(g["a"])({updateHashArray:function(){var e=this;return Object(p["a"])(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,fetch("../api/image");case 2:return a=t.sent,t.next=5,a.json();case 5:n=t.sent,n&&(e.setStateHashArray(n),console.log("Set State Hash Array"));case 7:case"end":return t.stop()}}),t)})))()}},Object(_["b"])(["setStateHashArray"]))},he=de,pe=(a("9821"),Object(s["a"])(he,d,h,!1,null,"77c1fd34",null)),ge=pe.exports,fe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{attrs:{id:"image-container"}},[a("img",{attrs:{src:"/api/image/"+e.hash+"/file",alt:""}})])])},me=[],ve=(a("1276"),{computed:{hash:function(){return window.location.pathname.split("/")[3]}}}),ye=ve,be=(a("f4d7"),Object(s["a"])(ye,fe,me,!1,null,"086aeb6a",null)),we=be.exports;n["a"].use(l["a"]);var xe=[{path:"/",name:"Home",component:ge},{path:"/image/:hash",name:"ImageView",component:we}],ke=new l["a"]({mode:"history",base:"/web/",routes:xe}),_e=ke,je=a("0e44");n["a"].use(_["a"]);var Oe=Object(je["a"])({key:"imageboard",paths:["stateUser"]}),Te=new _["a"].Store({state:{stateHashArray:[],stateUser:{id:null,privileged:null,username:null,secret:null}},mutations:{setStateHashArray:function(e,t){e.stateHashArray=t},addStateHashArray:function(e,t){e.stateHashArray.unshift(t)},saveStateUser:function(e,t){e.stateUser.id=t.id,e.stateUser.privileged=t.privileged,e.stateUser.username=t.username,e.stateUser.secret=t.secret}},actions:{setStateHashArray:function(e,t){e.commit("setStateHashArray",t)},addStateHashArray:function(e,t){e.commit("addStateHashArray",t)},saveStateUser:function(e,t){e.commit("saveStateUser",t)}},modules:{},plugins:[Oe]});a("def6");n["a"].config.productionTip=!1,new n["a"]({router:_e,store:Te,render:function(e){return e(u)}}).$mount("#app")},9821:function(e,t,a){"use strict";a("515e")},a595:function(e,t,a){},a9dd:function(e,t,a){"use strict";a("c412")},c412:function(e,t,a){},c6d3:function(e,t,a){"use strict";a("00f7")},def6:function(e,t,a){},df8d:function(e,t,a){},f4d7:function(e,t,a){"use strict";a("df8d")}});
//# sourceMappingURL=app.c644db16.js.map
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment