From b1f885646ad7df9efea505bf3db3712891eb9e13 Mon Sep 17 00:00:00 2001 From: Jemma Date: Thu, 28 Dec 2023 17:55:24 -0600 Subject: [PATCH] Added support for reporting posts on desktop --- src/webfiles/web/css/web.css | 23 +++++++++++++++------ src/webfiles/web/css/web.min.css | 2 +- src/webfiles/web/js/web.js | 14 ++++++++++++- src/webfiles/web/js/web.min.js | 2 +- src/webfiles/web/partials/post_template.ejs | 9 ++++++-- src/webfiles/web/post.ejs | 2 +- 6 files changed, 40 insertions(+), 12 deletions(-) diff --git a/src/webfiles/web/css/web.css b/src/webfiles/web/css/web.css index 1a454b6..0e04a01 100644 --- a/src/webfiles/web/css/web.css +++ b/src/webfiles/web/css/web.css @@ -452,7 +452,7 @@ iframe { padding-bottom: 0.5ch; } .report h4, .report p { - margin: 10px 0 0 0; + margin: 0 5px 0 0; } .list-content-with-icon-and-text li.reports { flex-direction: column; @@ -468,13 +468,12 @@ button.report { max-width: 630px; width: 90vw; } -#report-post-page { - position: absolute; - top: 0; +#report-post-page { display: flex; - background: var(--background); - height: 100%; + flex-direction: column; + justify-content: center; align-items: center; + padding: 1em; } #report-form { display: flex; @@ -482,12 +481,17 @@ button.report { justify-content: center; align-items: center; padding: 1em; + max-width: 600px; + background: var(--background-alt); + border-radius: 1em; + margin-top: 4em; } .add-post-page-content.report > div { display: flex; justify-items: center; align-items: center; justify-content: center; + margin-top: 13px; } .report .textarea-text { width: 100%; @@ -499,6 +503,13 @@ button.report { margin: 1em 0; resize: none; } + +#report-post-page input[type="submit"] { + background: var(--btn); +} +#report-post-page input[type="button"] { + background: var(--btn-secondary); +} .buttons.tabs { display: flex; justify-content: center; diff --git a/src/webfiles/web/css/web.min.css b/src/webfiles/web/css/web.min.css index 0ae87ba..0b1c18f 100644 --- a/src/webfiles/web/css/web.min.css +++ b/src/webfiles/web/css/web.min.css @@ -1 +1 @@ -:root{--background:#1B1F3B;--background-alt:#2a2f50;--text:white;--text-secondary:#A1A8D9;--btn:#673DB6;--btn-secondary:#333960;--theme:var(--btn);--theme-light:#A185D6;--text-secondary-2:#8990C1;--border:rgba(255, 255, 255, 0.1);--background-alt-alt:#383f6b}button,input[type=button],input[type=submit]{cursor:pointer;background:var(--background-alt-alt);color:var(--text);border:0;border-radius:1em;font-weight:700;padding:1em}a{color:unset}a:hover{cursor:pointer;text-decoration:underline}#title{color:var(--text);display:flex;justify-content:center}#nav-bar{display:flex;background:-webkit-gradient(linear,left top,right top,from(#fff),to(#fff5f5));list-style:none;user-select:none}.badge,body,button{color:var(--text)}.badge{position:absolute;background:var(--btn);padding:3px 8px;border-radius:1em;margin-left:1.25em;display:none;margin-bottom:30px}body{background-color:var(--background);margin:0;font-family:Conv_Poppins-Light,sans-serif}header{display:flex;align-items:flex-start;margin-top:35px;flex-direction:column;position:fixed}a,header a,header>a,header>a:hover{text-decoration:none}header .logo-link,header .logo-link svg{display:block;width:5em}header a{color:var(--text-secondary);padding:.25em 1.5em .25em 1em;border-radius:2em;display:flex;margin:.1em;align-items:center}header a:first-child{padding:.5em 1em}header a:hover,header>.selected{background:var(--background-alt)}header>a>p{padding-left:1em}header>.selected{border-radius:1em;font-weight:700;color:var(--theme-light)}header>.selected>svg{stroke:var(--theme-light)}.mii-icon{width:40px;height:40px;background:#a1a8d9;border-radius:50px}#main{width:95%;max-width:1400px;margin:0 auto;overflow:hidden}.post-meta-wrapper{display:flex;color:var(--text);align-items:center;margin-left:.5em;height:2em;margin-bottom:0;font-size:small}.post-meta-wrapper>h3>a{text-decoration:none;color:var(--text)}.post-meta-wrapper>h3>a:hover{text-decoration:underline}.post-meta-wrapper>h4:last-child{padding-left:.5em;color:var(--text-secondary)}.post-user-info-wrapper{display:flex;height:2em}#wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center}.posts-wrapper{width:600px;color:var(--text);background:var(--background-alt);margin-bottom:1em;padding:1em;border-radius:1em}.icon-container>img,.user-icon{width:64px;height:64px;border-radius:.5em;background:var(--text-secondary)}.user-icon.verified{border:solid 4px var(--btn);width:60px;height:60px}.verified-badge{background:var(--btn);padding:1px 5px;border-radius:1em;color:var(--text);margin-left:.25em}.painting,.screenshot{border-radius:1em;width:100%}.painting{image-rendering:pixelated}.screenshot{margin-bottom:1em}.post-content{display:flex;flex-direction:column;cursor:pointer}.post-content>h4{margin-top:0;margin-bottom:.5em;font-weight:400;margin-left:.25em;word-wrap:break-word;white-space:pre-wrap}.post-content,.spoiler-overlay{margin-left:74px}.spoiler-overlay>button{width:100%;padding:12px 48px}.post-buttons-wrapper{margin-top:1em;display:flex;justify-content:space-between;user-select:none;margin-left:74px}.post-buttons-wrapper>span{display:flex;flex-direction:row;align-items:center;padding:.5em}.post-buttons-wrapper>span:nth-of-type(2):hover{background:rgba(0,255,0,.25)}.post-buttons-wrapper>span:last-child:hover{background:rgba(0,150,255,.25)}.post-buttons-wrapper>span:hover{cursor:pointer;background:rgba(255,0,0,.25);border-radius:.75em}.post-buttons-wrapper>span>h4{padding-left:.5em;margin:0}.post-buttons-wrapper>span.selected>svg{fill:red;stroke:red}#load-more{width:632px;margin-bottom:1em}#toast,iframe{border-radius:1em}#toast{opacity:0;min-width:250px;margin-left:-141px;background-color:var(--btn);color:var(--text);text-align:center;position:fixed;z-index:10;left:50%;bottom:5em;padding:1ch;transition:all .5s ease}#toast.show{opacity:1}.community-list-wrapper{display:grid;grid-template-areas:"icon main""icon footer";gap:0;cursor:pointer;background:var(--background-alt);padding:1em;width:90%;border-radius:1em;grid-template-columns:111px 152px}.community-list-icon{width:100px;height:100px;grid-area:icon;margin-right:1em;border-radius:1em;-webkit-border-radius:1em;-moz-border-radius:1em;-ms-border-radius:1em;-o-border-radius:1em}.community-list-title{margin:.5em 0-1em;font-size:2ch}.community-list-followers{margin:.5em 0 0;font-size:1.5ch}.communities-wrapper{display:grid;max-width:900px;grid-template-columns:auto auto auto;grid-row-gap:1em;grid-column-gap:1em}#new{margin-bottom:1em}iframe{width:100%;height:20em;margin-top:1em}.notifications-list-content{background:var(--background-alt);width:600px;min-height:4em;margin:0;display:flex;justify-content:flex-start;align-items:center;border-bottom:2px solid var(--btn-secondary);user-select:none;cursor:pointer;font-size:small}.notifications-list-content:hover{text-decoration:none;background:var(--btn-secondary)}.notifications-list-content:first-of-type{border-top-left-radius:1em;border-top-right-radius:1em}.notifications-list-content:last-of-type{border-bottom-left-radius:1em;border-bottom-right-radius:1em}.unread-badge{padding:.25em;border-radius:1em;margin:1em;background-color:var(--btn)}.community-top{background:var(--background-alt);margin-bottom:1em;padding:1em;border-radius:1em;width:600px;overflow:hidden}.community-info{display:flex}.info-boxes-wrapper{display:flex;justify-content:space-evenly;flex-wrap:wrap}.info-boxes-wrapper>div{background:var(--background-alt-alt);border-radius:1em;display:flex;flex-direction:column;align-items:center;margin:.5em;flex-grow:1}.info-boxes-wrapper>div>h4:first-child{margin:.75em 0 0;color:var(--theme-light);font-size:small;font-weight:bolder}.info-boxes-wrapper>div>h4:last-child{margin:.75em 0;color:var(--text-secondary);font-size:small}.community-title{padding-left:.5em;font-size:larger;padding-top:.5em}.banner{width:110%;margin:-1em}.community-page-follow-button-wrapper{padding:.25em;border:2px solid var(--btn);border-radius:1em;margin:1.5em 0 auto auto;cursor:pointer;height:fit-content}.community-page-follow-button-wrapper.selected,.favorite-button.checked{background:var(--btn)}.community-page-follow-button-wrapper>p,.favorite-button{margin:.25em;color:var(--text)!important}.favorite-button{border:2px solid var(--btn);border-radius:1em;margin:1.5em 0 auto auto;cursor:pointer;height:fit-content;text-decoration:none!important;padding:1ch}.list-content-with-icon-and-text{list-style:none;padding:unset}.list-content-with-icon-and-text li{display:flex;padding:.25em 0;border-bottom:1px solid var(--text-secondary)}.list-content-with-icon-and-text .body{margin-left:1em;width:100%;align-items:center;display:inherit;text-decoration:none}#news-list-content li .text .nick-name{font-weight:700}#news-list-content li .text .link{color:var(--theme-light)}#news-list-content li .text .timestamp{color:#969696;white-space:nowrap}.hover{width:600px;display:inherit;border-radius:1em;padding:1em}.hover:hover{background:var(--background-alt)}.body.messages{flex-direction:column;justify-content:center;align-items:flex-start!important}.body.messages>.text{padding-bottom:.5ch}.report h4,.report p{margin:10px 0 0 0}.list-content-with-icon-and-text li.reports{flex-direction:column}.reports .hover:hover{background:unset}.reports button{margin-bottom:1em}button.report{margin-bottom:1.5em;max-width:630px;width:90vw}#report-post-page{position:absolute;top:0;display:flex;background:var(--background);height:100%;align-items:center}#report-form{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:1em}.add-post-page-content.report>div{display:flex;justify-items:center;align-items:center;justify-content:center}.report .textarea-text{width:100%;height:100px;border-radius:1em;border:none;background:var(--text);padding:10px;margin:1em 0;resize:none}.buttons.tabs{display:flex;justify-content:center}.buttons.tabs>a,.buttons.tabs>button{width:100%;margin:0 1ch;border:1px solid var(--text-secondary);cursor:pointer;border-radius:1em;font-weight:700;padding:1em;text-decoration:none;text-align:center}.buttons.tabs>a.selected,.buttons.tabs>button.selected{background:var(--btn);border-color:transparent}.col{margin:2ch;font-size:larger}.mt-5.text-center{display:flex;justify-content:center}@media screen and (max-width:1200px){.communities-wrapper{max-width:600px;grid-template-columns:auto auto;grid-row-gap:10px;grid-column-gap:10px}header{align-items:center}header p{display:none}header a{padding:.25em .5em .25em .5em}}@media screen and (max-width:1000px){#main{width:100%;margin-bottom:60px}#news-list-content,.posts-wrapper{max-width:600px;width:90vw}.post-content,.spoiler-overlay{margin-top:.25em;margin-left:2.5em}.user-icon,.user-icon.verified{width:2em;height:2em}.user-icon.verified{border:solid 2px var(--btn)}.post-buttons-wrapper{margin-top:.5em;margin-bottom:-.5em;margin-left:2.5em}header{width:100%;margin:0;background:var(--background);flex-direction:row;justify-content:space-evenly;bottom:0;border-top:1px solid var(--text-secondary)}header>a:first-child{display:none}header>a:nth-of-type(2){position:fixed;top:2px;left:4px;border-radius:100%;width:3em;height:3em;padding:0;justify-content:center;z-index:20}header>a>p{display:none}header a{padding:.25em 1em}header svg{scale:.75}header>.selected{background:var(--background-alt);border-radius:1em;font-weight:700;color:var(--theme-light);margin:unset}header>.selected>svg{stroke:var(--theme-light)}#load-more{margin-bottom:1em;max-width:600px;width:90vw}#title{color:var(--text);width:100vw;display:flex;justify-content:center;border-bottom:1px solid var(--text-secondary);padding-top:.5em;padding-bottom:.5em;position:fixed;background:var(--background);margin-top:0}#wrapper{margin-top:4em}#wrapper.bottom{margin-top:0;margin-bottom:1em}.communities-wrapper{max-width:600px;grid-template-columns:auto;grid-row-gap:10px;grid-column-gap:10px}.notifications-list-content{width:90vw;min-height:4em}community-info>.user-icon.verified{width:60px;height:60px}.community-info>.user-icon,community-info>.user-icon{width:64px;height:64px}.community-top{max-width:600px;width:90vw}.info-boxes-wrapper>div{width:100%}.community-info>.user-icon.verified{border:solid 4px var(--btn);width:60px;height:60px}list-content-with-icon-and-text li.reports>*{width:100%;overflow:clip}li.reports .posts-wrapper{margin-left:-1em}li.reports .hover{width:auto;padding:.5em .25em}} \ No newline at end of file +:root{--background:#1B1F3B;--background-alt:#2a2f50;--text:white;--text-secondary:#A1A8D9;--btn:#673DB6;--btn-secondary:#333960;--theme:var(--btn);--theme-light:#A185D6;--text-secondary-2:#8990C1;--border:rgba(255, 255, 255, 0.1);--background-alt-alt:#383f6b}button,input[type=button],input[type=submit]{cursor:pointer;background:var(--background-alt-alt);color:var(--text);border:0;border-radius:1em;font-weight:700;padding:1em}a{color:unset}a:hover{cursor:pointer;text-decoration:underline}#title{color:var(--text);display:flex;justify-content:center}#nav-bar{display:flex;background:-webkit-gradient(linear,left top,right top,from(#fff),to(#fff5f5));list-style:none;user-select:none}.badge,body,button{color:var(--text)}.badge{position:absolute;background:var(--btn);padding:3px 8px;border-radius:1em;margin-left:1.25em;display:none;margin-bottom:30px}body{background-color:var(--background);margin:0;font-family:Conv_Poppins-Light,sans-serif}header{display:flex;align-items:flex-start;margin-top:35px;flex-direction:column;position:fixed}a,header a,header>a,header>a:hover{text-decoration:none}header .logo-link,header .logo-link svg{display:block;width:5em}header a{color:var(--text-secondary);padding:.25em 1.5em .25em 1em;border-radius:2em;display:flex;margin:.1em;align-items:center}header a:first-child{padding:.5em 1em}header a:hover,header>.selected{background:var(--background-alt)}header>a>p{padding-left:1em}header>.selected{border-radius:1em;font-weight:700;color:var(--theme-light)}header>.selected>svg{stroke:var(--theme-light)}.mii-icon{width:40px;height:40px;background:#a1a8d9;border-radius:50px}#main{width:95%;max-width:1400px;margin:0 auto;overflow:hidden}.post-meta-wrapper{display:flex;color:var(--text);align-items:center;margin-left:.5em;height:2em;margin-bottom:0;font-size:small}.post-meta-wrapper>h3>a{text-decoration:none;color:var(--text)}.post-meta-wrapper>h3>a:hover{text-decoration:underline}.post-meta-wrapper>h4:last-child{padding-left:.5em;color:var(--text-secondary)}.post-user-info-wrapper{display:flex;height:2em}#wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center}.posts-wrapper{width:600px;color:var(--text);background:var(--background-alt);margin-bottom:1em;padding:1em;border-radius:1em}.icon-container>img,.user-icon{width:64px;height:64px;border-radius:.5em;background:var(--text-secondary)}.user-icon.verified{border:solid 4px var(--btn);width:60px;height:60px}.verified-badge{background:var(--btn);padding:1px 5px;border-radius:1em;color:var(--text);margin-left:.25em}.painting,.screenshot{border-radius:1em;width:100%}.painting{image-rendering:pixelated}.screenshot{margin-bottom:1em}.post-content{display:flex;flex-direction:column;cursor:pointer}.post-content>h4{margin-top:0;margin-bottom:.5em;font-weight:400;margin-left:.25em;word-wrap:break-word;white-space:pre-wrap}.post-content,.spoiler-overlay{margin-left:74px}.spoiler-overlay>button{width:100%;padding:12px 48px}.post-buttons-wrapper{margin-top:1em;display:flex;justify-content:space-between;user-select:none;margin-left:74px}.post-buttons-wrapper>span{display:flex;flex-direction:row;align-items:center;padding:.5em}.post-buttons-wrapper>span:nth-of-type(2):hover{background:rgba(0,255,0,.25)}.post-buttons-wrapper>span:last-child:hover{background:rgba(0,150,255,.25)}.post-buttons-wrapper>span:hover{cursor:pointer;background:rgba(255,0,0,.25);border-radius:.75em}.post-buttons-wrapper>span>h4{padding-left:.5em;margin:0}.post-buttons-wrapper>span.selected>svg{fill:red;stroke:red}#load-more{width:632px;margin-bottom:1em}#toast,iframe{border-radius:1em}#toast{opacity:0;min-width:250px;margin-left:-141px;background-color:var(--btn);color:var(--text);text-align:center;position:fixed;z-index:10;left:50%;bottom:5em;padding:1ch;transition:all .5s ease}#toast.show{opacity:1}.community-list-wrapper{display:grid;grid-template-areas:"icon main""icon footer";gap:0;cursor:pointer;background:var(--background-alt);padding:1em;width:90%;border-radius:1em;grid-template-columns:111px 152px}.community-list-icon{width:100px;height:100px;grid-area:icon;margin-right:1em;border-radius:1em;-webkit-border-radius:1em;-moz-border-radius:1em;-ms-border-radius:1em;-o-border-radius:1em}.community-list-title{margin:.5em 0-1em;font-size:2ch}.community-list-followers{margin:.5em 0 0;font-size:1.5ch}.communities-wrapper{display:grid;max-width:900px;grid-template-columns:auto auto auto;grid-row-gap:1em;grid-column-gap:1em}#new{margin-bottom:1em}iframe{width:100%;height:20em;margin-top:1em}.notifications-list-content{background:var(--background-alt);width:600px;min-height:4em;margin:0;display:flex;justify-content:flex-start;align-items:center;border-bottom:2px solid var(--btn-secondary);user-select:none;cursor:pointer;font-size:small}.notifications-list-content:hover{text-decoration:none;background:var(--btn-secondary)}.notifications-list-content:first-of-type{border-top-left-radius:1em;border-top-right-radius:1em}.notifications-list-content:last-of-type{border-bottom-left-radius:1em;border-bottom-right-radius:1em}.unread-badge{padding:.25em;border-radius:1em;margin:1em;background-color:var(--btn)}.community-top{background:var(--background-alt);margin-bottom:1em;padding:1em;border-radius:1em;width:600px;overflow:hidden}.community-info{display:flex}.info-boxes-wrapper{display:flex;justify-content:space-evenly;flex-wrap:wrap}.info-boxes-wrapper>div{background:var(--background-alt-alt);border-radius:1em;display:flex;flex-direction:column;align-items:center;margin:.5em;flex-grow:1}.info-boxes-wrapper>div>h4:first-child{margin:.75em 0 0;color:var(--theme-light);font-size:small;font-weight:bolder}.info-boxes-wrapper>div>h4:last-child{margin:.75em 0;color:var(--text-secondary);font-size:small}.community-title{padding-left:.5em;font-size:larger;padding-top:.5em}.banner{width:110%;margin:-1em}.community-page-follow-button-wrapper{padding:.25em;border:2px solid var(--btn);border-radius:1em;margin:1.5em 0 auto auto;cursor:pointer;height:fit-content}.community-page-follow-button-wrapper.selected,.favorite-button.checked{background:var(--btn)}.community-page-follow-button-wrapper>p,.favorite-button{margin:.25em;color:var(--text)!important}.favorite-button{border:2px solid var(--btn);border-radius:1em;margin:1.5em 0 auto auto;cursor:pointer;height:fit-content;text-decoration:none!important;padding:1ch}.list-content-with-icon-and-text{list-style:none;padding:unset}.list-content-with-icon-and-text li{display:flex;padding:.25em 0;border-bottom:1px solid var(--text-secondary)}.list-content-with-icon-and-text .body{margin-left:1em;width:100%;align-items:center;display:inherit;text-decoration:none}#news-list-content li .text .nick-name{font-weight:700}#news-list-content li .text .link{color:var(--theme-light)}#news-list-content li .text .timestamp{color:#969696;white-space:nowrap}.hover{width:600px;display:inherit;border-radius:1em;padding:1em}.hover:hover{background:var(--background-alt)}.body.messages{flex-direction:column;justify-content:center;align-items:flex-start!important}.body.messages>.text{padding-bottom:.5ch}.report h4,.report p{margin:0 5px 0 0}.list-content-with-icon-and-text li.reports{flex-direction:column}.reports .hover:hover{background:unset}.reports button{margin-bottom:1em}button.report{margin-bottom:1.5em;max-width:630px;width:90vw}#report-post-page{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:1em}#report-form{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:1em;max-width:600px;background:var(--background-alt);border-radius:1em;margin-top:4em}.add-post-page-content.report>div{display:flex;justify-items:center;align-items:center;justify-content:center;margin-top:13px}.report .textarea-text{width:100%;height:100px;border-radius:1em;border:none;background:var(--text);padding:10px;margin:1em 0;resize:none}#report-post-page input[type=submit]{background:var(--btn)}#report-post-page input[type=button]{background:var(--btn-secondary)}.buttons.tabs{display:flex;justify-content:center}.buttons.tabs>a,.buttons.tabs>button{width:100%;margin:0 1ch;border:1px solid var(--text-secondary);cursor:pointer;border-radius:1em;font-weight:700;padding:1em;text-decoration:none;text-align:center}.buttons.tabs>a.selected,.buttons.tabs>button.selected{background:var(--btn);border-color:transparent}.col{margin:2ch;font-size:larger}.mt-5.text-center{display:flex;justify-content:center}@media screen and (max-width:1200px){.communities-wrapper{max-width:600px;grid-template-columns:auto auto;grid-row-gap:10px;grid-column-gap:10px}header{align-items:center}header p{display:none}header a{padding:.25em .5em .25em .5em}}@media screen and (max-width:1000px){#main{width:100%;margin-bottom:60px}#news-list-content,.posts-wrapper{max-width:600px;width:90vw}.post-content,.spoiler-overlay{margin-top:.25em;margin-left:2.5em}.user-icon,.user-icon.verified{width:2em;height:2em}.user-icon.verified{border:solid 2px var(--btn)}.post-buttons-wrapper{margin-top:.5em;margin-bottom:-.5em;margin-left:2.5em}header{width:100%;margin:0;background:var(--background);flex-direction:row;justify-content:space-evenly;bottom:0;border-top:1px solid var(--text-secondary)}header>a:first-child{display:none}header>a:nth-of-type(2){position:fixed;top:2px;left:4px;border-radius:100%;width:3em;height:3em;padding:0;justify-content:center;z-index:20}header>a>p{display:none}header a{padding:.25em 1em}header svg{scale:.75}header>.selected{background:var(--background-alt);border-radius:1em;font-weight:700;color:var(--theme-light);margin:unset}header>.selected>svg{stroke:var(--theme-light)}#load-more{margin-bottom:1em;max-width:600px;width:90vw}#title{color:var(--text);width:100vw;display:flex;justify-content:center;border-bottom:1px solid var(--text-secondary);padding-top:.5em;padding-bottom:.5em;position:fixed;background:var(--background);margin-top:0}#wrapper{margin-top:4em}#wrapper.bottom{margin-top:0;margin-bottom:1em}.communities-wrapper{max-width:600px;grid-template-columns:auto;grid-row-gap:10px;grid-column-gap:10px}.notifications-list-content{width:90vw;min-height:4em}community-info>.user-icon.verified{width:60px;height:60px}.community-info>.user-icon,community-info>.user-icon{width:64px;height:64px}.community-top{max-width:600px;width:90vw}.info-boxes-wrapper>div{width:100%}.community-info>.user-icon.verified{border:solid 4px var(--btn);width:60px;height:60px}list-content-with-icon-and-text li.reports>*{width:100%;overflow:clip}li.reports .posts-wrapper{margin-left:-1em}li.reports .hover{width:auto;padding:.5em .25em}} \ No newline at end of file diff --git a/src/webfiles/web/js/web.js b/src/webfiles/web/js/web.js index badd5e6..d4e7a01 100644 --- a/src/webfiles/web/js/web.js +++ b/src/webfiles/web/js/web.js @@ -142,7 +142,7 @@ function initPostModules() { return; } document.getElementById(hide).style.display = 'none'; - document.getElementById(show).style.display = 'block'; + document.getElementById(show).style.display = ''; if (header === 'true') { document.getElementById('header').style.display = 'block'; } else { @@ -332,4 +332,16 @@ function downloadURI(uri, name) { link.click(); document.body.removeChild(link); delete link; +} +function reportPost(post) { + const id = post.getAttribute('data-post'); + const button = document.getElementById('report-launcher'); + const form = document.getElementById('report-form'); + const formID = document.getElementById('report-post-id'); + if(!id || !button || !form || !formID) return; + + form.action = '/posts/' + id + '/report'; + formID.value = id; + console.log(id.replace(/(\d{3})(\d{4})(\d{3})(\d{4})(\d{3})(\d{4})/, "$1-$2-$3-$4-$5-$6")); + button.click(); } \ No newline at end of file diff --git a/src/webfiles/web/js/web.min.js b/src/webfiles/web/js/web.min.js index 469b8ba..a622c02 100644 --- a/src/webfiles/web/js/web.min.js +++ b/src/webfiles/web/js/web.min.js @@ -1 +1 @@ -let pjax;setInterval(checkForUpdates,3e4);function initNavBar(){let els=document.querySelectorAll("#nav-menu > li");if(!els)return;for(let i=0;i0&¬ificationObj.message_count<99){messages.innerHTML=notificationObj.message_count;messages.style.display="unset"}else if(notificationObj.message_count>=99){messages.innerHTML="99+";messages.style.display="unset"}else{messages.innerHTML="";messages.style.display="none"}if(notificationObj.notification_count>0&¬ificationObj.notification_count<99){news.innerHTML=notificationObj.notification_count;news.style.display="unset"}else if(notificationObj.notification_count>=99){news.innerHTML="99+";news.style.display="unset"}else{news.innerHTML="";news.style.display="none"}}};xhttp.open("GET","/notifications.json",true);xhttp.send()}function POST(url,data,callback){let xhttp=new XMLHttpRequest;xhttp.onreadystatechange=function(){if(this.readyState===4){return callback(this)}};xhttp.open("POST",url,true);xhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhttp.send(data)}function GET(url,callback){let xhttp=new XMLHttpRequest;xhttp.onreadystatechange=function(){if(this.readyState===4){return callback(this)}};xhttp.open("GET",url,true);xhttp.send()}window.onscroll=function(ev){if(window.innerHeight+window.scrollY>=document.body.scrollHeight){document.getElementById("load-more").click()}};function copyToClipboard(text){let inputc=document.getElementsByTagName("header")[0].appendChild(document.createElement("input"));inputc.value=text;inputc.focus();inputc.select();document.execCommand("copy");inputc.parentNode.removeChild(inputc);Toast("Copied to clipboard.")}function Toast(text){let x=document.getElementById("toast");x.innerText=text;x.className="show";setTimeout(function(){x.className=x.className.replace("show","")},3e3)}function downloadURI(uri,name){let link=document.createElement("a");link.download=name;link.href=uri;document.body.appendChild(link);link.click();document.body.removeChild(link);delete link} \ No newline at end of file +function initNavBar(){const e=document.querySelectorAll("#nav-menu > li");if(e)for(let t=0;t0&&e.message_count<99?(t.innerHTML=e.message_count,t.style.display="unset"):e.message_count>=99?(t.innerHTML="99+",t.style.display="unset"):(t.innerHTML="",t.style.display="none"),e.notification_count>0&&e.notification_count<99?(n.innerHTML=e.notification_count,n.style.display="unset"):e.notification_count>=99?(n.innerHTML="99+",n.style.display="unset"):(n.innerHTML="",n.style.display="none")}},e.open("GET","/notifications.json",!0),e.send()}function POST(e,t,n){const o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===this.readyState)return n(this)},o.open("POST",e,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}function GET(e,t){const n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===this.readyState)return t(this)},n.open("GET",e,!0),n.send()}function copyToClipboard(e){const t=document.getElementsByTagName("header")[0].appendChild(document.createElement("input"));t.value=e,t.focus(),t.select(),document.execCommand("copy"),t.parentNode.removeChild(t),Toast("Copied to clipboard.")}function Toast(e){const t=document.getElementById("toast");t.innerText=e,t.className="show",setTimeout(function(){t.className=t.className.replace("show","")},3e3)}function downloadURI(e,t){const n=document.createElement("a");n.download=t,n.href=e,document.body.appendChild(n),n.click(),document.body.removeChild(n),delete n}function reportPost(e){const t=e.getAttribute("data-post"),n=document.getElementById("report-launcher"),o=document.getElementById("report-form"),s=document.getElementById("report-post-id");t&&n&&o&&s&&(o.action="/posts/"+t+"/report",s.value=t,console.log(t.replace(/(\d{3})(\d{4})(\d{3})(\d{4})(\d{3})(\d{4})/,"$1-$2-$3-$4-$5-$6")),n.click())}let pjax;setInterval(checkForUpdates,3e4),console.debug("Document initialized:"+window.location.href),document.addEventListener("pjax:send",function(){console.debug("Event: pjax:send",arguments)}),document.addEventListener("pjax:complete",function(){console.debug("Event: pjax:complete",arguments)}),document.addEventListener("pjax:error",function(e){Toast("Error: Unable to load element. \nPlease send the error code and what you were doing in #support"),console.debug(e)}),document.addEventListener("pjax:success",function(){console.debug("Event: pjax:success",arguments),initAll()}),document.addEventListener("DOMContentLoaded",function(){pjax=new Pjax({elements:"a[data-pjax]",selectors:["title","#body"],switches:{"#nav-menu":Pjax.switches.replaceNode,".tab-body":Pjax.switches.replaceNode}}),console.debug("Pjax initialized.",pjax),initAll()}),window.onscroll=function(e){window.innerHeight+window.scrollY>=document.body.scrollHeight&&document.getElementById("load-more").click()}; \ No newline at end of file diff --git a/src/webfiles/web/partials/post_template.ejs b/src/webfiles/web/partials/post_template.ejs index b077b0b..0fb2470 100644 --- a/src/webfiles/web/partials/post_template.ejs +++ b/src/webfiles/web/partials/post_template.ejs @@ -1,3 +1,4 @@ +<% if(locals.mainPost === undefined) locals.mainPost = false; %>
<% if(post.removed) {%>
@@ -33,10 +34,14 @@ data-post="<%= post.id %>" class="<%if(post.yeahs && post.yeahs.indexOf(userContent.pid) !== -1){ %> selected <%}%> <%}%>">

<%= post.empathy_count %>

<%= post.reply_count %>

-
+ <% if(reply && post.pid !== pid && !locals.mainPost) {%> + + <%}%> +
<%}%> <%if(locals.mainPost && !post.removed) {%> - + + <%}%> diff --git a/src/webfiles/web/post.ejs b/src/webfiles/web/post.ejs index f8f14cb..e620733 100644 --- a/src/webfiles/web/post.ejs +++ b/src/webfiles/web/post.ejs @@ -40,7 +40,7 @@ <%- include('partials/nav_bar', { selection: 2, pid: pid }); %>
-
+
<%- include('partials/post_template', { post: post, mii_image_CDN: mii_image_CDN, lang: lang, reply: false, mainPost: true }); %>