mediacms/static/js/featured.js

1 line
16 KiB
JavaScript

!function(){"use strict";var t={7781:function(t,e,n){var r=n(2667),o=(n(5101),n(5466)),i=n(3074),u=n.n(i),c=n(8204),f=n(4426),l=n(9174),s=n(5261);function a(t){return(a="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 y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var m=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&&y(t,e)}(c,t);var e,n,r,i,u=(r=c,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=b(r);if(i){var n=b(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return h(this,t)});function c(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),u.call(this,t,"featured-media")}return e=c,(n=[{key:"pageContent",value:function(){return o.createElement(l._,{title:this.props.title,className:"items-list-ver"},o.createElement(s.J,{requestUrl:this.props.api_url,hideViews:!f.Z.get("config-media-item").displayViews,hideAuthor:!f.Z.get("config-media-item").displayAuthor,hideDate:!f.Z.get("config-media-item").displayPublishDate}))}}])&&p(e.prototype,n),c}(c.T);m.propTypes={title:u().string.isRequired,api_url:u().string.isRequired},m.defaultProps={title:f.Z.get("config-enabled").pages.featured.title,api_url:f.Z.get("api-featured")},(0,r.X)("page-featured",m)},5261:function(t,e,n){n.d(e,{J:function(){return g}}),n(5101),n(5466),n(6116);var r=n(4426),o=n(8421);function i(t){return(i="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 u(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 c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?l(t):e}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var a=n(5953);function p(t){return(p="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 y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){b(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function v(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function w(t){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var g=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&&d(t,e)}(o,t);var e,n,r=(e=o,n=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,r=w(e);if(n){var o=w(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return v(this,t)});function o(){return m(this,o),r.apply(this,arguments)}return o}(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&&c(t,e)}(y,t);var e,n,i,a,p=(i=y,a=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=s(i);if(a){var n=s(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return f(this,t)});function y(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y),(e=p.call(this,t)).onWindowScroll=e.onWindowScroll.bind(l(e)),e.onDocumentVisibilityChange=e.onDocumentVisibilityChange.bind(l(e)),e}return e=y,(n=[{key:"componentDidMount",value:function(){this.listHandler=new o.g(this.props.pageItems,this.props.maxItems,this.props.firstItemRequestUrl,this.props.requestUrl,this.onItemsCount,this.onItemsLoad),r.Z.on("window_scroll",this.onWindowScroll),r.Z.on("document_visibility_change",this.onDocumentVisibilityChange)}},{key:"componentWillUnmount",value:function(){r.Z.removeListener("window_scroll",this.onWindowScroll),r.Z.removeListener("document_visibility_change",this.onDocumentVisibilityChange)}},{key:"onWindowScroll",value:function(){void 0!==this.refs.ItemsList&&window.scrollY+2*window.outerHeight>=this.refs.ItemsList.offsetTop+this.refs.ItemsList.offsetHeight&&this.listHandler.loadItems()}},{key:"onDocumentVisibilityChange",value:function(){document.hidden||setTimeout(this.onWindowScroll,10)}},{key:"afterItemsLoad",value:function(){this.onWindowScroll(),this.listHandler.loadedAllItems()&&r.Z.removeListener("window_scroll",this.onWindowScroll)}}])&&u(e.prototype,n),y}(a.g));g.defaultProps=h(h({},a.g.defaultProps),{},{pageItems:2})},9009:function(t,e,n){n(6394),n(5334),n(7588),n(4559),n(6028)},6203:function(t,e,n){n(2322),n(9268),n(3233),e.Z=function(){var t,e,n,r=null;if(document.cookie&&""!==document.cookie)for(e=document.cookie.split(";"),t=0;t<e.length;){if("csrftoken="===(n=e[t].trim()).substring(0,10)){r=decodeURIComponent(n.substring(10));break}t+=1}return r}},8420:function(t,e,n){n.d(e,{A_:function(){return r.Z},GH:function(){return o.Z},v$:function(){return i.Z},uf:function(){return u.Z},$4:function(){return c.Z},m5:function(){return f.Z}});var r=n(1712),o=(n(9752),n(84)),i=(n(9009),n(1438)),u=n(4135),c=n(3140),f=(n(1752),n(7514),n(1569),n(6203));n(7188)},2701:function(t,e,n){n.d(e,{s:function(){return p}}),n(5101);var r=n(5466),o=(n(6116),n(3074)),i=n.n(o);function u(t){return(u="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 c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(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 l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){return!e||"object"!==u(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var p=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&&l(t,e)}(p,t);var e,n,o,i,u=(o=p,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=a(o);if(i){var n=a(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return s(this,t)});function p(){return c(this,p),u.apply(this,arguments)}return e=p,(n=[{key:"render",value:function(){return r.createElement("div",{className:(void 0===this.props.className||null===this.props.className?"":this.props.className+" ")+"media-list-header",style:this.props.style},r.createElement("h2",null,this.props.title),void 0===this.props.viewAllLink||null===this.props.viewAllLink?null:r.createElement("h3",null,r.createElement("a",{href:this.props.viewAllLink,alt:this.props.viewAllText,title:this.props.viewAllText},this.props.viewAllText)))}}])&&f(e.prototype,n),p}(r.PureComponent);p.propTypes={style:i().object,className:i().string,title:i().string.isRequired,viewAllLink:i().string,viewAllText:i().string},p.defaultProps={viewAllText:"VIEW ALL"}},3085:function(t,e,n){n.d(e,{G:function(){return y}}),n(5101);var r=n(5466),o=(n(6116),n(3074)),i=n.n(o),u=n(2701);function c(t){return(c="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 f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=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&&s(t,e)}(y,t);var e,n,o,i,c=(o=y,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=p(o);if(i){var n=p(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return a(this,t)});function y(){return f(this,y),c.apply(this,arguments)}return e=y,(n=[{key:"render",value:function(){return r.createElement("div",{className:(void 0===this.props.className||null===this.props.className?"":this.props.className+" ")+"media-list-row",style:this.props.style},void 0===this.props.title||null===this.props.title?null:r.createElement(u.s,{title:this.props.title,viewAllLink:this.props.viewAllLink,viewAllText:this.props.viewAllText}),this.props.children||null)}}])&&l(e.prototype,n),y}(r.PureComponent);y.propTypes={style:i().object,className:i().string,title:i().string,viewAllLink:i().string,viewAllText:i().string},y.defaultProps={}},9174:function(t,e,n){n.d(e,{_:function(){return y}}),n(5101);var r=n(5466),o=(n(6116),n(3074)),i=n.n(o),u=n(3085);function c(t){return(c="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 f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(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 s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function a(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=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&&s(t,e)}(y,t);var e,n,o,i,c=(o=y,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=p(o);if(i){var n=p(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return a(this,t)});function y(){return f(this,y),c.apply(this,arguments)}return e=y,(n=[{key:"render",value:function(){return r.createElement("div",{className:(void 0===this.props.className||null===this.props.className?"":this.props.className+" ")+"media-list-wrapper",style:this.props.style},r.createElement(u.G,{title:this.props.title,viewAllLink:this.props.viewAllLink,viewAllText:this.props.viewAllText},this.props.children||null))}}])&&l(e.prototype,n),y}(r.PureComponent);y.propTypes={style:i().object,className:i().string},y.defaultProps={}}},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=248,function(){var t={248:0},e=[[7781,431]],r=function(){},o=function(o,i){for(var u,c,f=i[0],l=i[1],s=i[2],a=i[3],p=0,y=[];p<f.length;p++)c=f[p],n.o(t,c)&&t[c]&&y.push(t[c][0]),t[c]=0;for(u in l)n.o(l,u)&&(n.m[u]=l[u]);for(s&&s(n),o&&o(i);y.length;)y.shift()();return a&&e.push.apply(e,a),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,c=1;c<i.length;c++){var f=i[c];0!==t[f]&&(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 c=n.x;n.x=function(){return n.x=c||function(){},(r=u)()}}(),n.x()}();