mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-12-14 02:50:58 +01:00
1 line
5.1 KiB
JavaScript
1 line
5.1 KiB
JavaScript
!function(){"use strict";var t={5047:function(t,e,n){var r=n(2667),o=(n(5101),n(5466)),i=n(3074),u=n.n(i),s=n(8204),a=n(4426),l=n(8349),c=n(9174),f=n(1784);function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function g(t,e){return!e||"object"!==m(e)&&"function"!=typeof e?y(t):e}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function b(t,e,n){return t+"?"+e+(""===e?"":"&")+"page="+n}var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&h(t,e)}(s,t);var e,n,r,i,u=(r=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=d(r);if(i){var n=d(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return g(this,t)});function s(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),(e=u.call(this,t,"manage-comments")).state={resultsCount:null,requestUrl:t.api_url,currentPage:1,sortingArgs:"",sortBy:"add_date",ordering:"desc",refresh:0},e.getCountFunc=e.getCountFunc.bind(y(e)),e.onTablePageChange=e.onTablePageChange.bind(y(e)),e.onColumnSortClick=e.onColumnSortClick.bind(y(e)),e.onItemsRemoval=e.onItemsRemoval.bind(y(e)),e.onItemsRemovalFail=e.onItemsRemovalFail.bind(y(e)),e}return e=s,(n=[{key:"onTablePageChange",value:function(t,e){this.setState({currentPage:e,requestUrl:b(this.props.api_url,this.state.sortingArgs,e)})}},{key:"getCountFunc",value:function(t){this.setState({resultsCount:t})}},{key:"onColumnSortClick",value:function(t,e){var n="sort_by="+t+"&ordering="+e;this.setState({sortBy:t,ordering:e,sortingArgs:n,requestUrl:b(this.props.api_url,n,this.state.currentPage)})}},{key:"onItemsRemoval",value:function(t){this.setState({resultsCount:null,refresh:this.state.refresh+1,requestUrl:this.props.api_url},(function(){t?l.wN("The comments deleted successfully.","commentsRemovalSucceed"):l.wN("The comment deleted successfully.","commentRemovalSucceed")}))}},{key:"onItemsRemovalFail",value:function(t){t?l.wN("The comments removal failed. Please try again.","commentsRemovalFailed"):l.wN("The comment removal failed. Please try again.","commentRemovalFailed")}},{key:"pageContent",value:function(){return o.createElement(c._,{title:this.props.title+(null===this.state.resultsCount?"":" ("+this.state.resultsCount+")"),className:"search-results-wrap items-list-hor"},o.createElement(f.x,{pageItems:50,manageType:"comments",key:this.state.requestUrl+"["+this.state.refresh+"]",itemsCountCallback:this.getCountFunc,requestUrl:this.state.requestUrl,onPageChange:this.onTablePageChange,sortBy:this.state.sortBy,ordering:this.state.ordering,onRowsDelete:this.onItemsRemoval,onRowsDeleteFail:this.onItemsRemovalFail,onClickColumnSort:this.onColumnSortClick}))}}])&&p(e.prototype,n),s}(s.T);v.propTypes={title:u().string.isRequired,api_url:u().string.isRequired},v.defaultProps={title:"Manage comments",api_url:a.Z.get("api-manage-comments")},(0,r.X)("page-manage-comments",v)}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.m=t,n.x=function(){},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.j=800,function(){var t={800:0},e=[[5047,431]],r=function(){},o=function(o,i){for(var u,s,a=i[0],l=i[1],c=i[2],f=i[3],m=0,p=[];m<a.length;m++)s=a[m],n.o(t,s)&&t[s]&&p.push(t[s][0]),t[s]=0;for(u in l)n.o(l,u)&&(n.m[u]=l[u]);for(c&&c(n),o&&o(i);p.length;)p.shift()();return f&&e.push.apply(e,f),r()},i=self.webpackChunk_mediacms_frontend=self.webpackChunk_mediacms_frontend||[];function u(){for(var r,o=0;o<e.length;o++){for(var i=e[o],u=!0,s=1;s<i.length;s++){var a=i[s];0!==t[a]&&(u=!1)}u&&(e.splice(o--,1),r=n(n.s=i[0]))}return 0===e.length&&(n.x(),n.x=function(){}),r}i.forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var s=n.x;n.x=function(){return n.x=s||function(){},(r=u)()}}(),n.x()}(); |