From 7b0b2cc93e8f40e52abd89010b18afdcab9d74c3 Mon Sep 17 00:00:00 2001 From: ogerly Date: Wed, 4 Dec 2019 15:14:57 +0100 Subject: [PATCH] rename checkedBlur to blurImage, testing checkbox --- .../ContributionForm/ContributionForm.spec.js | 7 +- .../ContributionForm/ContributionForm.vue | 46 +---- webapp/pages/moderation/images.vue | 173 ------------------ webapp/pages/post/_id/_slug/index.vue | 6 +- .../checkbox-set-blank-checked-line.png | Bin 1742 -> 0 bytes 5 files changed, 13 insertions(+), 219 deletions(-) delete mode 100644 webapp/pages/moderation/images.vue delete mode 100644 webapp/static/img/checkbox/checkbox-set-blank-checked-line.png diff --git a/webapp/components/ContributionForm/ContributionForm.spec.js b/webapp/components/ContributionForm/ContributionForm.spec.js index e8f5eef9a..889995595 100644 --- a/webapp/components/ContributionForm/ContributionForm.spec.js +++ b/webapp/components/ContributionForm/ContributionForm.spec.js @@ -244,10 +244,13 @@ describe('ContributionForm.vue', () => { describe('questionable images should be blurred', () => { it('questionable images unset be blurred', async () => { - + expectedParams.variables.imageUpload = imageUpload + wrapper.find(TeaserImage).vm.$emit('addTeaserImage', imageUpload) + expect(wrapper.find('.images-set-blur').exists()).toBe(false) await wrapper.find('input[type="checkbox"]').trigger('click') expect(wrapper.find('input[type="checkbox"]').exists()).toBe(true) - expect(wrapper.find('img.img-blur-in').exists()).toBe(true) + expect(wrapper.find('.images-set-blur').exists()).toBe(true) + }) }) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index 25be9d753..7831d8fe0 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -40,12 +40,12 @@ @@ -227,8 +227,7 @@ export default { created() {}, mounted() { if (this.contribution && this.contribution.blurImage === true) { - this.checkedChange() - this.$el.querySelector('.hc-attachments-upload-area-post img').classList.add('img-blur-in') + this.checkedBlur = true } }, computed: { @@ -242,28 +241,7 @@ export default { methods: { unBlur() { if (this.checkedBlur) { - this.checkedChange() - } - }, - checkedChange() { - if (this.$el) { - console.log(this.$el.querySelector('.crop-overlay')) - console.log(document.querySelector('.crop-overlay')) - this.elem = this.$el.querySelector('img') - } else { - } - if (this.checkedBlur) { - this.elem.classList.remove('img-blur-in') - document.querySelector('.crop-overlay').classList.remove('images-set-blur') this.checkedBlur = false - this.form.checkbox = false - } else { - if (this.elem != null) { - - this.elem.classList.add('img-blur-in') - } - this.checkedBlur = true - this.form.checkbox = true } }, submit() { @@ -362,7 +340,7 @@ export default { -o-transition: all ease 0.2s; transition: all ease 0.2s; } -.images-set-blur img{ +.images-set-blur img { -webkit-filter: blur(32px); -moz-filter: blur(32px); -ms-filter: blur(32px); @@ -417,18 +395,4 @@ export default { cursor: default; } } -input[type='checkbox'] { - display: none; -} -input[type='checkbox'] + label span { - display: inline-block; - width: 29px; - height: 27px; - vertical-align: middle; - background: url(../../static/img/checkbox/checkbox-set-blank-checked-line.png) left top no-repeat; - cursor: pointer; -} -input[type='checkbox']:checked + label span { - background: url(../../static/img/checkbox/checkbox-set-blank-checked-line.png) -30px top no-repeat; -} diff --git a/webapp/pages/moderation/images.vue b/webapp/pages/moderation/images.vue deleted file mode 100644 index 86e222f0e..000000000 --- a/webapp/pages/moderation/images.vue +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue index 769b978b8..7331daf6d 100644 --- a/webapp/pages/post/_id/_slug/index.vue +++ b/webapp/pages/post/_id/_slug/index.vue @@ -12,21 +12,21 @@ > 4?c0`HNEPGp0b{fVk9GaCa*Ra?9(jm98<<{Dw!-Ss3Bz`cL z9l6%TC_lJ7R@iYlcA+rRvBb{YAD{R87x>8!^49tGea`bdpXc-WJny$+dLXw~a{pu^ z>XkPsC!Z)`CEm~WNW^nWc55G^M4CROU;;uSLu84VNQl%$#*ndOn2eB7m$ZhgCCg-m zth!n@#Fm(eg;-sy7!pguBtoJH(&qi!rBYmH@N z#aMMLkYsC^4U1uQq);o?2pbV23XW(sYK^i{F^Z{R4KR=fOVC0NgMkfbV4+!^AQ$7X zwPLM0eHe>~*|JzxCl@S`6t*H(6zV|=wN}}xScN?J0h;KB9ncRFPzcrl18J~CDR^Ko zumKG$bBX^L^tdJCkTc@ zum%`NqZ72i1A~DLXmu-c)kq`8QEUuGLLbH=5>>ZAZ~cyiw^6rGZ%K}n=et|4XQkul zx#PC&33ik{4Q}}!EvLYn1ZZ3bYzgK;lQ+t{iGTf3ym?D1J`P%!AD96e|K#~oQwQAP zWvK1BW>V2wqLf?imvCTs$^fEnOY(BY7Hm8mi;fLE&!+4L%|p9BZrw7lt^9pc#j(uF zgpw1#Mtp0n+}M3*>ELR98K2l550`DzyT{`hE%WZ*`@Xx_-|xu5j?!WC3YVuRWp;Eu z|Lk8_pSq{@weQ^Hn$<~1n>y19{be7QuB)%jdQnv3@AouPG!AX6e}(nx%JGZCSR~F zem*VI-Znh-Qu*N@E2f1y->fRCjqkm%p(^)7s5)L9-O=bD@}#+|rL;0SzEP)U#JYZ> z?Rq?;<1$_r^geenwz^^Nm4=_ARxBR%=yc1o`#0Y{m~|uMYp=>p3Y7(Xy{DxenVj;h zvH8%c-9A{u_Uxgg*cP