diff --git a/build/css/backend.asset.php b/build/css/backend.asset.php index 12acd15..e0cd1fa 100644 --- a/build/css/backend.asset.php +++ b/build/css/backend.asset.php @@ -1 +1 @@ - array(), 'version' => '8c5b220bf6f482881a90'); + array(), 'version' => '94f0a0b1ab64ca7caf6a'); diff --git a/build/css/backend.css b/build/css/backend.css index 8b13789..59e2cfc 100644 --- a/build/css/backend.css +++ b/build/css/backend.css @@ -1 +1,4 @@ +/*!**********************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/scss/backend.scss ***! + \**********************************************************************************************************************************************************************************************************************************************/ diff --git a/build/css/frontend.asset.php b/build/css/frontend.asset.php index bd60b79..0d5386d 100644 --- a/build/css/frontend.asset.php +++ b/build/css/frontend.asset.php @@ -1 +1 @@ - array(), 'version' => 'a4f0c497198fb9a32f33'); + array(), 'version' => '1c44fb6d6b7c0528017d'); diff --git a/build/css/frontend.css b/build/css/frontend.css index 8821cc4..cf32571 100644 --- a/build/css/frontend.css +++ b/build/css/frontend.css @@ -1 +1,96 @@ -#buddypress #whats-new-submit{align-items:center}.anonymously-post-knobs,.anonymously-post-layer{bottom:0;left:0;position:absolute;right:0;top:0}.anonymously-post-main{align-items:center;background:#e8e7e7;border-radius:50px;display:flex;margin-right:10px;padding:5px 12px 5px 10px}.anonymously-post-main label{font-size:16px;margin:0;order:2}.anonymously-post-wrap{height:24px;margin:0 10px 0 0;overflow:hidden;position:relative;top:50%;width:50px}.anonymously-post-wrap,.anonymously-post-wrap .anonymously-post-layer{border-radius:100px}.anonymously-post{cursor:pointer;height:100%!important;margin:0;opacity:0;padding:0!important;position:relative;width:100%!important;z-index:3}.anonymously-post-knobs{z-index:2}.anonymously-post-layer{background-color:#fff;transition:all .3s ease;width:100%;z-index:1}.anonymously-post-wrap .anonymously-post-knobs:before{background-color:#636e7a;border-radius:50%;content:"";height:16px;left:4px;position:absolute;top:4px;transition:all .3s cubic-bezier(.18,.89,.35,1.15);width:16px}.anonymously-post-wrap .anonymously-post:checked+.anonymously-post-knobs:before{background-color:var(--bb-primary-button-background-hover);content:"";left:30px}.anonymously-post-wrap .anonymously-post:checked~.anonymously-post-layer{background-color:#d4deff}.anonymously-post-wrap .anonymously-post-knobs,.anonymously-post-wrap .anonymously-post-knobs:before,.anonymously-post-wrap .anonymously-post-layer{transition:all .3s ease} +/*!***********************************************************************************************************************************************************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/scss/frontend.scss ***! + \***********************************************************************************************************************************************************************************************************************************************/ +#buddypress #whats-new-submit { + align-items: center; +} + +.anonymously-post-knobs, +.anonymously-post-layer { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; +} + +.anonymously-post-main { + display: flex; + align-items: center; + margin-right: 10px; + background: #e8e7e7; + padding: 5px 12px 5px 10px; + border-radius: 50px; +} + +.anonymously-post-main label { + order: 2; + font-size: 16px; + margin: 0px; +} + +.anonymously-post-wrap { + position: relative; + top: 50%; + width: 50px; + height: 24px; + margin: 0 10px 0 0; + overflow: hidden; +} + +.anonymously-post-wrap, +.anonymously-post-wrap .anonymously-post-layer { + border-radius: 100px; +} + +.anonymously-post { + position: relative; + width: 100% !important; + height: 100% !important; + padding: 0 !important; + margin: 0; + opacity: 0; + cursor: pointer; + z-index: 3; +} + +.anonymously-post-knobs { + z-index: 2; +} + +.anonymously-post-layer { + width: 100%; + background-color: #ffffff; + transition: 0.3s ease all; + z-index: 1; +} + +.anonymously-post-wrap .anonymously-post-knobs:before { + content: ""; + position: absolute; + top: 4px; + left: 4px; + width: 16px; + height: 16px; + background-color: #636e7a; + border-radius: 50%; + transition: 0.3s cubic-bezier(0.18, 0.89, 0.35, 1.15) all; +} + +.anonymously-post-wrap .anonymously-post:checked + .anonymously-post-knobs:before { + content: ""; + left: 30px; + background-color: var(--bb-primary-button-background-hover); +} + +.anonymously-post-wrap .anonymously-post:checked ~ .anonymously-post-layer { + background-color: #d4deff; +} + +.anonymously-post-wrap .anonymously-post-knobs, +.anonymously-post-wrap .anonymously-post-knobs:before, +.anonymously-post-wrap .anonymously-post-layer { + transition: 0.3s ease all; +} + +/*# sourceMappingURL=frontend.css.map*/ \ No newline at end of file diff --git a/build/css/frontend.css.map b/build/css/frontend.css.map new file mode 100644 index 0000000..3a40b07 --- /dev/null +++ b/build/css/frontend.css.map @@ -0,0 +1 @@ +{"version":3,"file":"css/frontend.css","mappings":";;;AAAA;EACC;AACD;;AAEA;;EAEE;EACA;EACA;EACA;EACA;AACF;;AAEA;EACC;EACG;EACA;EACA;EACA;EACA;AACJ;;AACA;EACE;EACE;EACA;AAEJ;;AAAA;EACI;EACA;EACA;EACA;EACA;EACA;AAGJ;;AAAA;;EAEE;AAGF;;AAAA;EACE;EACE;EACA;EACA;EACA;EACA;EACA;EACA;AAGJ;;AAAA;EACE;AAGF;;AAAA;EACE;EACA;EACA;EACA;AAGF;;AAAA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAGF;;AAAA;EACE;EACA;EACA;AAGF;;AAAA;EACE;AAGF;;AAAA;;;EAGE;AAGF,C","sources":["webpack://post-anonymously/./src/scss/frontend.scss"],"sourcesContent":["#buddypress #whats-new-submit{\n\talign-items:center;\n}\n\n.anonymously-post-knobs,\n.anonymously-post-layer {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n.anonymously-post-main{\n\tdisplay: flex;\n align-items: center;\n margin-right: 10px;\n background: #e8e7e7;\n padding: 5px 12px 5px 10px;\n border-radius: 50px;\n}\n.anonymously-post-main label{\n\t\torder: 2;\n font-size: 16px;\n margin: 0px;\n}\n.anonymously-post-wrap{\n position: relative;\n top: 50%;\n width: 50px;\n height: 24px;\n margin: 0 10px 0 0;\n overflow: hidden;\n}\n\n.anonymously-post-wrap,\n.anonymously-post-wrap .anonymously-post-layer {\n border-radius: 100px;\n}\n\n.anonymously-post {\n\t\tposition: relative;\n width: 100% !important;\n height: 100% !important;\n padding: 0 !important;\n margin: 0;\n opacity: 0;\n cursor: pointer;\n z-index: 3;\n}\n\n.anonymously-post-knobs {\n z-index: 2;\n}\n\n.anonymously-post-layer {\n width: 100%;\n background-color: #ffffff;\n transition: 0.3s ease all;\n z-index: 1;\n}\n\n.anonymously-post-wrap .anonymously-post-knobs:before {\n content: \"\";\n position: absolute;\n top: 4px;\n left: 4px;\n width: 16px;\n height: 16px;\n background-color: #636e7a;\n border-radius: 50%;\n transition: 0.3s cubic-bezier(0.18, 0.89, 0.35, 1.15) all;\n}\n\n.anonymously-post-wrap .anonymously-post:checked + .anonymously-post-knobs:before {\n content: \"\";\n left:30px;\n background-color: var(--bb-primary-button-background-hover);\n}\n\n.anonymously-post-wrap .anonymously-post:checked ~ .anonymously-post-layer {\n background-color: #d4deff;\n}\n\n.anonymously-post-wrap .anonymously-post-knobs,\n.anonymously-post-wrap .anonymously-post-knobs:before,\n.anonymously-post-wrap .anonymously-post-layer {\n transition: 0.3s ease all;\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build/js/backend.asset.php b/build/js/backend.asset.php index f534533..8813807 100644 --- a/build/js/backend.asset.php +++ b/build/js/backend.asset.php @@ -1 +1 @@ - array(), 'version' => '31d6cfe0d16ae931b73c'); + array(), 'version' => '67b3fb99c5e63f20e616'); diff --git a/build/js/backend.js b/build/js/backend.js index e69de29..dfb6b0e 100644 --- a/build/js/backend.js +++ b/build/js/backend.js @@ -0,0 +1,7 @@ +/******/ (() => { // webpackBootstrap +/*!***************************!*\ + !*** ./src/js/backend.js ***! + \***************************/ + +/******/ })() +; \ No newline at end of file diff --git a/build/js/frontend.asset.php b/build/js/frontend.asset.php index 950f677..8bed6ea 100644 --- a/build/js/frontend.asset.php +++ b/build/js/frontend.asset.php @@ -1 +1 @@ - array(), 'version' => 'c22719989000470787dd'); + array(), 'version' => '8656e8776b4195bbf712'); diff --git a/build/js/frontend.js b/build/js/frontend.js index 94106dd..40fb8fe 100644 --- a/build/js/frontend.js +++ b/build/js/frontend.js @@ -1 +1,39 @@ -bp.Views.FormSubmit=bp.Views.FormSubmit.extend({render:function(){this.$el.append(this.renderCheckbox())},renderCheckbox:function(){this.checkbox=new bp.Views.ActivityInput({type:"checkbox",id:"anonymously-post",className:"anonymously-post",name:"anonymously-post",value:"1"});var e=document.createElement("div");e.classList.add("anonymously-post-main");var n=document.createElement("label");n.textContent=paf.post_anonymously_label,e.appendChild(n);var t=document.createElement("div");t.classList.add("anonymously-post-wrap"),t.appendChild(this.checkbox.el);var a=document.createElement("div");a.classList.add("anonymously-post-knobs"),t.appendChild(a);var o=document.createElement("div");return o.classList.add("anonymously-post-layer"),t.appendChild(o),e.appendChild(t),this.checkbox.el=e}}); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/*!****************************!*\ + !*** ./src/js/frontend.js ***! + \****************************/ +// Define your custom Backbone view for the checkbox// Extend bp.Views.FormSubmit +bp.Views.FormSubmit = bp.Views.FormSubmit.extend({ + render: function () { + this.$el.append(this.renderCheckbox()); + }, + renderCheckbox: function () { + // Create and append the checkbox + this.checkbox = new bp.Views.ActivityInput({ + type: 'checkbox', + id: 'anonymously-post', + className: 'anonymously-post', + name: 'anonymously-post', + value: '1' + }); + var checkboxMain = document.createElement('div'); + checkboxMain.classList.add('anonymously-post-main'); + var checkboxLabel = document.createElement('label'); + checkboxLabel.textContent = paf.post_anonymously_label; + checkboxMain.appendChild(checkboxLabel); + var checkboxWrapper = document.createElement('div'); + checkboxWrapper.classList.add('anonymously-post-wrap'); + checkboxWrapper.appendChild(this.checkbox.el); + var checkboxknobs = document.createElement('div'); + checkboxknobs.classList.add('anonymously-post-knobs'); + checkboxWrapper.appendChild(checkboxknobs); + var checkboxlayer = document.createElement('div'); + checkboxlayer.classList.add('anonymously-post-layer'); + checkboxWrapper.appendChild(checkboxlayer); + checkboxMain.appendChild(checkboxWrapper); + return this.checkbox.el = checkboxMain; + } +}); +/******/ })() +; +//# sourceMappingURL=frontend.js.map \ No newline at end of file diff --git a/build/js/frontend.js.map b/build/js/frontend.js.map new file mode 100644 index 0000000..6318920 --- /dev/null +++ b/build/js/frontend.js.map @@ -0,0 +1 @@ +{"version":3,"file":"js/frontend.js","mappings":";;;;AAAA;AACAA,EAAE,CAACC,KAAK,CAACC,UAAU,GAAGF,EAAE,CAACC,KAAK,CAACC,UAAU,CAACC,MAAM,CAAC;EAE7CC,MAAM,EAAE,SAAAA,CAAA,EAAU;IACd,IAAI,CAACC,GAAG,CAACC,MAAM,CAAE,IAAI,CAACC,cAAc,CAAC,CAAE,CAAC;EAC5C,CAAC;EAEDA,cAAc,EAAE,SAAAA,CAAA,EAAW;IACvB;IACA,IAAI,CAACC,QAAQ,GAAG,IAAIR,EAAE,CAACC,KAAK,CAACQ,aAAa,CAAC;MACvCC,IAAI,EAAE,UAAU;MAChBC,EAAE,EAAE,kBAAkB;MACtBC,SAAS,EAAE,kBAAkB;MAC7BC,IAAI,EAAE,kBAAkB;MACxBC,KAAK,EAAE;IACX,CAAC,CAAC;IAEF,IAAIC,YAAY,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IAChDF,YAAY,CAACG,SAAS,CAACC,GAAG,CAAC,uBAAuB,CAAC;IAEnD,IAAIC,aAAa,GAAGJ,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;IACnDG,aAAa,CAACC,WAAW,GAAGC,GAAG,CAACC,sBAAsB;IACtDR,YAAY,CAACS,WAAW,CAACJ,aAAa,CAAC;IAEvC,IAAIK,eAAe,GAAGT,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IACnDQ,eAAe,CAACP,SAAS,CAACC,GAAG,CAAC,uBAAuB,CAAC;IAEtDM,eAAe,CAACD,WAAW,CAAC,IAAI,CAAChB,QAAQ,CAACkB,EAAE,CAAC;IAE7C,IAAIC,aAAa,GAAGX,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IACjDU,aAAa,CAACT,SAAS,CAACC,GAAG,CAAC,wBAAwB,CAAC;IACrDM,eAAe,CAACD,WAAW,CAACG,aAAa,CAAC;IAE1C,IAAIC,aAAa,GAAGZ,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IACjDW,aAAa,CAACV,SAAS,CAACC,GAAG,CAAC,wBAAwB,CAAC;IACrDM,eAAe,CAACD,WAAW,CAACI,aAAa,CAAC;IAE1Cb,YAAY,CAACS,WAAW,CAACC,eAAe,CAAC;IACzC,OAAO,IAAI,CAACjB,QAAQ,CAACkB,EAAE,GAAGX,YAAY;EAC1C;AACJ,CAAC,CAAC,C","sources":["webpack://post-anonymously/./src/js/frontend.js"],"sourcesContent":["// Define your custom Backbone view for the checkbox// Extend bp.Views.FormSubmit\nbp.Views.FormSubmit = bp.Views.FormSubmit.extend({\n\n render: function(){\n this.$el.append( this.renderCheckbox() );\n },\n\n renderCheckbox: function() {\n // Create and append the checkbox\n this.checkbox = new bp.Views.ActivityInput({\n type: 'checkbox',\n id: 'anonymously-post',\n className: 'anonymously-post',\n name: 'anonymously-post',\n value: '1'\n });\n \n var checkboxMain = document.createElement('div');\n checkboxMain.classList.add('anonymously-post-main');\n \n var checkboxLabel = document.createElement('label');\n checkboxLabel.textContent = paf.post_anonymously_label;\n checkboxMain.appendChild(checkboxLabel);\n \n var checkboxWrapper = document.createElement('div');\n checkboxWrapper.classList.add('anonymously-post-wrap');\n \n checkboxWrapper.appendChild(this.checkbox.el);\n \n var checkboxknobs = document.createElement('div');\n checkboxknobs.classList.add('anonymously-post-knobs'); \n checkboxWrapper.appendChild(checkboxknobs);\n \n var checkboxlayer = document.createElement('div');\n checkboxlayer.classList.add('anonymously-post-layer'); \n checkboxWrapper.appendChild(checkboxlayer);\n \n checkboxMain.appendChild(checkboxWrapper);\n return this.checkbox.el = checkboxMain;\n }\n});"],"names":["bp","Views","FormSubmit","extend","render","$el","append","renderCheckbox","checkbox","ActivityInput","type","id","className","name","value","checkboxMain","document","createElement","classList","add","checkboxLabel","textContent","paf","post_anonymously_label","appendChild","checkboxWrapper","el","checkboxknobs","checkboxlayer"],"sourceRoot":""} \ No newline at end of file diff --git a/public/partials/post-anonymously-public-render-activity.php b/public/partials/post-anonymously-public-render-activity.php index 39cc5cf..a2b3465 100644 --- a/public/partials/post-anonymously-public-render-activity.php +++ b/public/partials/post-anonymously-public-render-activity.php @@ -80,6 +80,33 @@ public function hooks() { * Hook to add filter so that the normal user can not see the Post author data */ add_filter( 'bp_groups_format_activity_action_activity_update', array( $this, 'group_activity_update' ), 1000, 2 ); + + + /** + * Update comment edit data so when reply to the hidden comment usename is not show + */ + add_filter( 'bb_activity_comment_get_edit_data', array( $this, 'comment_get_edit_data' ), 1000 ); + + } + + /** + * Updage the edit comment + */ + public function comment_get_edit_data( $edit_data ) { + + if ( ! isset( $edit_data['id'] ) ) { + return $edit_data; + } + + if ( ! $this->_functions->is_anonymously_activity( $edit_data['id'] ) ) { + return $edit_data; + } + + $edit_data['content'] = ''; + $edit_data['user_id'] = ''; + $edit_data['nickname'] = ''; + + return $edit_data; } /** @@ -192,6 +219,5 @@ function group_activity_update( $action, $activity ) { return $action; } - } diff --git a/public/partials/post-anonymously-public-save-meta.php b/public/partials/post-anonymously-public-save-meta.php index f423aa4..454543c 100644 --- a/public/partials/post-anonymously-public-save-meta.php +++ b/public/partials/post-anonymously-public-save-meta.php @@ -71,8 +71,9 @@ public function hooks() { /** * Add post meta into the Activity Meta + * Remove this in future */ - add_action( 'bp_activity_posted_update', array( $this, 'activity_posted_update' ), 1000, 3 ); + // add_action( 'bp_activity_posted_update', array( $this, 'activity_posted_update' ), 1000, 3 ); /** @@ -81,6 +82,36 @@ public function hooks() { add_action( 'bp_activity_comment_posted', array( $this, 'activity_comment_posted' ), 1000, 3 ); add_action( 'bp_activity_comment_posted_notification_skipped', array( $this, 'activity_comment_posted' ), 1000, 3 ); + /** + * Stop email for the groups new activity of anonymou post. + */ + add_action( 'bp_send_email', array( $this, 'email_sending' ), 1000, 4 ); + + } + + /** + * Do not send email for the anonymou post in groups + */ + public function email_sending( $email, $email_type, $to, $args ) { + + if ( 'groups-new-activity' != $email_type ) { + return; + } + + if ( ! isset( $args['tokens']['activity'] ) ) { + return; + } + + $activity = $args['tokens']['activity']; + if ( ! isset( $activity->id ) ) { + return; + } + + if ( ! $this->_functions->is_anonymously_activity( $activity->id ) ) { + return; + } + + $email->set_to( '' ); } /**