Version Description
Download this release
Release Info
Developer | MotoPress |
Plugin | Timetable and Event Schedule by MotoPress |
Version | 2.3.8 |
Comparing to | |
See all releases |
Code changes from version 2.3.7 to 2.3.8
- classes/class-core.php +2 -1
- classes/class-hooks.php +1 -1
- classes/models/class-events.php +9 -9
- media/js/blocks/dist/index.min.js +1 -1
- media/js/blocks/src/timetable/edit.js +1 -1
- media/js/events/event.min.js +1 -1
- media/js/mptt-functions.min.js +1 -1
- mp-timetable.php +1 -1
- readme.txt +4 -0
classes/class-core.php
CHANGED
@@ -388,6 +388,7 @@ class Core {
|
|
388 |
$event_tag_args = array(
|
389 |
'label' => __( 'Event tags', 'mp-timetable' ),
|
390 |
'labels' => $event_tag_labels,
|
|
|
391 |
'public' => true,
|
392 |
'show_in_nav_menus' => true,
|
393 |
'show_ui' => true,
|
@@ -547,7 +548,7 @@ class Core {
|
|
547 |
*
|
548 |
* @param \WP_Screen $current_screen
|
549 |
*/
|
550 |
-
public function current_screen( \WP_Screen $current_screen ) {
|
551 |
wp_register_script( 'mptt-event-object', Mp_Time_Table::get_plugin_url( 'media/js/events/event' . $this->get_prefix() . '.js' ), array( 'jquery' ), $this->version );
|
552 |
wp_localize_script(
|
553 |
'mptt-event-object',
|
388 |
$event_tag_args = array(
|
389 |
'label' => __( 'Event tags', 'mp-timetable' ),
|
390 |
'labels' => $event_tag_labels,
|
391 |
+
'show_in_rest' => true,
|
392 |
'public' => true,
|
393 |
'show_in_nav_menus' => true,
|
394 |
'show_ui' => true,
|
548 |
*
|
549 |
* @param \WP_Screen $current_screen
|
550 |
*/
|
551 |
+
public function current_screen( \WP_Screen $current_screen = null ) {
|
552 |
wp_register_script( 'mptt-event-object', Mp_Time_Table::get_plugin_url( 'media/js/events/event' . $this->get_prefix() . '.js' ), array( 'jquery' ), $this->version );
|
553 |
wp_localize_script(
|
554 |
'mptt-event-object',
|
classes/class-hooks.php
CHANGED
@@ -212,7 +212,7 @@ class Hooks extends Core {
|
|
212 |
|
213 |
//Help
|
214 |
add_submenu_page( 'edit.php?post_type=mp-event', __( 'Help', 'mp-timetable' ), __( 'Help', 'mp-timetable' ),
|
215 |
-
'
|
216 |
}
|
217 |
|
218 |
/**
|
212 |
|
213 |
//Help
|
214 |
add_submenu_page( 'edit.php?post_type=mp-event', __( 'Help', 'mp-timetable' ), __( 'Help', 'mp-timetable' ),
|
215 |
+
'edit_posts', 'mptt-help', array( $this->get_controller( 'help' ), 'action_content' ) );
|
216 |
}
|
217 |
|
218 |
/**
|
classes/models/class-events.php
CHANGED
@@ -482,11 +482,11 @@ class Events extends Model {
|
|
482 |
*
|
483 |
* @param array $params
|
484 |
*
|
485 |
-
* @return array
|
486 |
*/
|
487 |
public function get_events_data( array $params ) {
|
488 |
$events = array();
|
489 |
-
$
|
490 |
|
491 |
if ( ( ! empty( $params[ 'all' ] ) && $params[ 'all' ] ) || empty( $params[ 'list' ] ) ) {
|
492 |
|
@@ -496,11 +496,11 @@ class Events extends Model {
|
|
496 |
$params[ 'list' ] = implode( ',', $params[ 'list' ] );
|
497 |
}
|
498 |
|
499 |
-
$
|
500 |
|
501 |
-
} elseif ( is_array( $params[ 'column' ] ) && is_array( $params[ '
|
502 |
|
503 |
-
$
|
504 |
|
505 |
$last_key = key( array_slice( $params[ 'column' ], - 1, 1, true ) );
|
506 |
|
@@ -508,15 +508,15 @@ class Events extends Model {
|
|
508 |
if ( isset( $params[ 'list' ][ $column ] ) && is_array( $params[ 'list' ][ $column ] ) ) {
|
509 |
$params[ 'list' ][ $column ] = implode( ',', $params[ 'list' ][ $column ] );
|
510 |
}
|
511 |
-
$
|
512 |
-
$
|
513 |
}
|
514 |
|
515 |
}
|
516 |
|
517 |
-
$
|
518 |
|
519 |
-
$events_data = $this->wpdb->get_results( $
|
520 |
|
521 |
if ( is_array( $events_data ) ) {
|
522 |
|
482 |
*
|
483 |
* @param array $params
|
484 |
*
|
485 |
+
* @return array
|
486 |
*/
|
487 |
public function get_events_data( array $params ) {
|
488 |
$events = array();
|
489 |
+
$sql_request = "SELECT * FROM " . $this->table_name;
|
490 |
|
491 |
if ( ( ! empty( $params[ 'all' ] ) && $params[ 'all' ] ) || empty( $params[ 'list' ] ) ) {
|
492 |
|
496 |
$params[ 'list' ] = implode( ',', $params[ 'list' ] );
|
497 |
}
|
498 |
|
499 |
+
$sql_request .= " WHERE " . $params[ 'column' ] . " IN (" . $params[ 'list' ] . ")";
|
500 |
|
501 |
+
} elseif ( is_array( $params[ 'column' ] ) && is_array( $params[ 'list' ] ) ) {
|
502 |
|
503 |
+
$sql_request .= " WHERE ";
|
504 |
|
505 |
$last_key = key( array_slice( $params[ 'column' ], - 1, 1, true ) );
|
506 |
|
508 |
if ( isset( $params[ 'list' ][ $column ] ) && is_array( $params[ 'list' ][ $column ] ) ) {
|
509 |
$params[ 'list' ][ $column ] = implode( ',', $params[ 'list' ][ $column ] );
|
510 |
}
|
511 |
+
$sql_request .= $column . " IN (" . $params[ 'list' ][ $column ] . ")";
|
512 |
+
$sql_request .= ( $last_key != $key ) ? ' AND ' : '';
|
513 |
}
|
514 |
|
515 |
}
|
516 |
|
517 |
+
$sql_request .= ' ORDER BY `event_start`';
|
518 |
|
519 |
+
$events_data = $this->wpdb->get_results( $sql_request );
|
520 |
|
521 |
if ( is_array( $events_data ) ) {
|
522 |
|
media/js/blocks/dist/index.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(l){if(t[l])return t[l].exports;var a=t[l]={i:l,l:!1,exports:{}};return e[l].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(l,a,function(t){return e[t]}.bind(null,a));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){e.exports=lodash},,,function(e,t,n){"use strict";n.r(t);var l=n(0);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=wp.i18n.__,p=wp.element.Component,m=wp.editor.InspectorControls,s=wp.components,b=s.SelectControl,f=s.CheckboxControl,v=s.PanelBody,h=s.TextControl,d=function(e){function t(){var e,n,l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(e=!(l=r(t).apply(this,arguments))||"object"!==a(l)&&"function"!=typeof l?i(n):l).setOptions=e.setOptions.bind(i(e)),e}var n,s,d;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,p),n=t,(s=[{key:"setOptions",value:function(e){var t=[];return e&&(t=e.map(function(e){return{value:e.id.toString(),label:Object(l.get)(e,["title","raw"])||Object(l.get)(e,["name"])}})),t}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.col,l=t.events,a=t.event_categ,o=t.increment,r=t.view,i=t.label,u=t.hide_label,p=t.hide_hrs,s=t.hide_empty_rows,d=t.title,y=t.time,g=t.sub_title,_=t.description,w=t.user,E=t.group,C=t.disable_event_url,O=t.text_align,R=t.text_align_vertical,S=t.id,j=t.custom_class,k=t.row_height,T=t.font_size,x=t.responsive,P=e.selectedEvents,D=e.selectedColumns,I=e.selectedEventCategories,z=e.setAttributes;return React.createElement(m,null,React.createElement(v,{title:c("Settings","mp-timetable")},React.createElement(b,{multiple:!0,size:"7",label:c("Columns","mp-timetable"),help:c("In order to display multiple points hold ctrl/cmd button.","mp-timetable"),value:n,onChange:function(e){return z({col:e})},options:this.setOptions(D)}),React.createElement(b,{multiple:!0,size:"7",label:c("Specific events","mp-timetable"),value:l,onChange:function(e){return z({events:e})},options:this.setOptions(P)}),React.createElement(b,{multiple:!0,size:"7",label:c("Event categories","mp-timetable"),value:a,onChange:function(e){return z({event_categ:e})},options:this.setOptions(I)}),React.createElement(f,{label:c("Title","mp-timetable"),checked:"1"==d,onChange:function(e){z({title:e?"1":"0"})}}),React.createElement(f,{label:c("Time","mp-timetable"),checked:"1"==y,onChange:function(e){z({time:e?"1":"0"})}}),React.createElement(f,{label:c("Subtitle","mp-timetable"),checked:"1"==g,onChange:function(e){z({sub_title:e?"1":"0"})}}),React.createElement(f,{label:c("Description","mp-timetable"),checked:"1"==_,onChange:function(e){z({description:e?"1":"0"})}}),React.createElement(f,{label:c("Event Head","mp-timetable"),checked:"1"==w,onChange:function(e){z({user:e?"1":"0"})}}),React.createElement(h,{label:c("Block height in pixels","mp-timetable"),type:"number",value:isNaN(k)?0:parseInt(k),onChange:function(e){z({row_height:e.toString()})},min:1,step:1}),React.createElement(h,{label:c("Base font size","mp-timetable"),help:c("Base font size for the table. Example 12px, 2em, 80%.","mp-timetable"),value:T,onChange:function(e){return z({font_size:e})}}),React.createElement(b,{label:c("Time frame for event","mp-timetable"),value:o,onChange:function(e){return z({increment:e})},options:[{value:"1",label:c("Hour (1h)","mp-timetable")},{value:"0.5",label:c("Half hour (30min)","mp-timetable")},{value:"0.25",label:c("Quarter hour (15min)","mp-timetable")}]}),React.createElement(b,{label:c("Filter events style","mp-timetable"),value:r,onChange:function(e){return z({view:e})},options:[{value:"dropdown_list",label:c("Dropdown list","mp-timetable")},{value:"tabs",label:c("Tabs","mp-timetable")}]}),React.createElement(h,{label:c("Filter title to display all events","mp-timetable"),value:i,onChange:function(e){return z({label:e})}}),React.createElement(b,{label:c("Hide 'All Events' option","mp-timetable"),value:u,onChange:function(e){return z({hide_label:e})},options:[{value:"0",label:c("No","mp-timetable")},{value:"1",label:c("Yes","mp-timetable")}]}),React.createElement(b,{label:c("Hide column with hours","mp-timetable"),value:p,onChange:function(e){return z({hide_hrs:e})},options:[{value:"0",label:c("No","mp-timetable")},{value:"1",label:c("Yes","mp-timetable")}]}),React.createElement(b,{label:c("Do not display empty rows","mp-timetable"),value:s,onChange:function(e){return z({hide_empty_rows:e})},options:[{value:"0",label:c("No","mp-timetable")},{value:"1",label:c("Yes","mp-timetable")}]}),React.createElement(b,{label:c("Merge cells with common events","mp-timetable"),value:E,onChange:function(e){return z({group:e})},options:[{value:"0",label:c("No","mp-timetable")},{value:"1",label:c("Yes","mp-timetable")}]}),React.createElement(b,{label:c("Disable event link","mp-timetable"),value:C,onChange:function(e){return z({disable_event_url:e})},options:[{value:"0",label:c("No","mp-timetable")},{value:"1",label:c("Yes","mp-timetable")}]}),React.createElement(b,{label:c("Horizontal align","mp-timetable"),value:O,onChange:function(e){return z({text_align:e})},options:[{value:"center",label:c("center","mp-timetable")},{value:"left",label:c("left","mp-timetable")},{value:"right",label:c("right","mp-timetable")}]}),React.createElement(b,{label:c("Vertical align","mp-timetable"),value:R,onChange:function(e){return z({text_align_vertical:e})},options:[{value:"default",label:c("Default","mp-timetable")},{value:"top",label:c("top","mp-timetable")},{value:"middle",label:c("middle","mp-timetable")},{value:"bottom",label:c("bottom","mp-timetable")}]}),React.createElement(h,{label:c("Unique ID","mp-timetable"),help:c("If you use more than one table on a page specify the unique ID for a timetable. It is usually all lowercase and contains only letters, numbers, and hyphens.","mp-timetable"),value:S,onChange:function(e){return z({id:e})}}),React.createElement(h,{label:c("CSS class","mp-timetable"),value:j,onChange:function(e){return z({custom_class:e})}}),React.createElement(b,{label:c("Mobile behavior","mp-timetable"),value:x,onChange:function(e){return z({responsive:e})},options:[{value:"0",label:c("Table","mp-timetable")},{value:"1",label:c("List","mp-timetable")}]})))}}])&&o(n.prototype,s),d&&o(n,d),t}();function y(e){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function _(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function E(e,t){return(E=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}wp.i18n.__;var C=wp.element,O=C.Component,R=C.Fragment,S=wp.compose.compose,j=wp.components,k=j.Disabled,T=j.ServerSideRender,x=wp.data.withSelect,P=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_(this,w(t).apply(this,arguments))}var n,a,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&E(e,t)}(t,O),n=t,(a=[{key:"initTable",value:function(){var e=setInterval(function(){$(".mptt-shortcode-wrapper").length&&!$(".mptt-shortcode-wrapper").hasClass("table-init")&&(clearInterval(e),window.mptt.tableInit())},1)}},{key:"componentDidUpdate",value:function(e,t){Object(l.isEqual)(this.props.attributes,e.attributes)||this.initTable()}},{key:"componentDidMount",value:function(){this.initTable()}},{key:"render",value:function(){var e=this.props.attributes;e.events,e.event_categ;return React.createElement(R,null,React.createElement(d,this.props),React.createElement(k,null,React.createElement(T,{block:"mp-timetable/timetable",attributes:this.props.attributes})))}}])&&g(n.prototype,a),o&&g(n,o),t}(),D=S([x(function(e,t){var n=e("core"),a=n.getEntityRecords,o=(n.getCategories,a("postType","mp-event",{per_page:-1,orderby:"title",order:"asc"})),r=a("postType","mp-column",{per_page:-1}),i=a("taxonomy","mp-event_category",{per_page:-1});return{selectedEvents:o?o.map(function(e){return Object(l.pick)(e,["id","title"])}):null,selectedColumns:r?r.map(function(e){return Object(l.pick)(e,["id","title"])}):null,selectedEventCategories:i?i.map(function(e){return Object(l.pick)(e,["id","name"])}):null}})])(P);(0,wp.blocks.registerBlockType)("mp-timetable/timetable",{title:(0,wp.i18n.__)("Timetable","mp-timetable"),category:"common",icon:"calendar",supports:{align:["wide","full"]},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t}},edit:D,save:function(){return null}})}]);
|
1 |
+
!function(e){var t={};function n(l){if(t[l])return t[l].exports;var o=t[l]={i:l,l:!1,exports:{}};return e[l].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(l,o,function(t){return e[t]}.bind(null,o));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){e.exports=lodash},,,function(e,t,n){"use strict";n.r(t);var l=n(0);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function i(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?u(e):t}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(){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(e){return!1}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var m=wp.i18n.__,b=wp.element.Component,f=wp.editor.InspectorControls,v=wp.components,h=v.SelectControl,y=v.CheckboxControl,d=v.PanelBody,g=v.TextControl,_=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(_,e);var t,n,o,b,v=(t=_,function(){var e,n=p(t);if(c()){var l=p(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return i(this,e)});function _(){var e;return r(this,_),(e=v.apply(this,arguments)).setOptions=e.setOptions.bind(u(e)),e}return n=_,(o=[{key:"setOptions",value:function(e){var t=[];return e&&(t=e.map((function(e){return{value:e.id.toString(),label:Object(l.get)(e,["title","raw"])||Object(l.get)(e,["name"])}}))),t}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=t.col,l=t.events,o=t.event_categ,r=t.increment,a=t.view,i=t.label,u=t.hide_label,c=t.hide_hrs,p=t.hide_empty_rows,s=t.title,b=t.time,v=t.sub_title,_=t.description,w=t.user,E=t.group,R=t.disable_event_url,C=t.text_align,O=t.text_align_vertical,S=t.id,j=t.custom_class,k=t.row_height,x=t.font_size,P=t.responsive,T=e.selectedEvents,D=e.selectedColumns,I=e.selectedEventCategories,z=e.setAttributes;return React.createElement(f,null,React.createElement(d,{title:m("Settings","mp-timetable")},React.createElement(h,{multiple:!0,size:"7",label:m("Columns","mp-timetable"),help:m("In order to display multiple points hold ctrl/cmd button.","mp-timetable"),value:n,onChange:function(e){return z({col:e})},options:this.setOptions(D)}),React.createElement(h,{multiple:!0,size:"7",label:m("Specific events","mp-timetable"),value:l,onChange:function(e){return z({events:e})},options:this.setOptions(T)}),React.createElement(h,{multiple:!0,size:"7",label:m("Event categories","mp-timetable"),value:o,onChange:function(e){return z({event_categ:e})},options:this.setOptions(I)}),React.createElement(y,{label:m("Title","mp-timetable"),checked:"1"==s,onChange:function(e){z({title:e?"1":"0"})}}),React.createElement(y,{label:m("Time","mp-timetable"),checked:"1"==b,onChange:function(e){z({time:e?"1":"0"})}}),React.createElement(y,{label:m("Subtitle","mp-timetable"),checked:"1"==v,onChange:function(e){z({sub_title:e?"1":"0"})}}),React.createElement(y,{label:m("Description","mp-timetable"),checked:"1"==_,onChange:function(e){z({description:e?"1":"0"})}}),React.createElement(y,{label:m("Event Head","mp-timetable"),checked:"1"==w,onChange:function(e){z({user:e?"1":"0"})}}),React.createElement(g,{label:m("Block height in pixels","mp-timetable"),type:"number",value:isNaN(k)?0:parseInt(k),onChange:function(e){z({row_height:e.toString()})},min:1,step:1}),React.createElement(g,{label:m("Base font size","mp-timetable"),help:m("Base font size for the table. Example 12px, 2em, 80%.","mp-timetable"),value:x,onChange:function(e){return z({font_size:e})}}),React.createElement(h,{label:m("Time frame for event","mp-timetable"),value:r,onChange:function(e){return z({increment:e})},options:[{value:"1",label:m("Hour (1h)","mp-timetable")},{value:"0.5",label:m("Half hour (30min)","mp-timetable")},{value:"0.25",label:m("Quarter hour (15min)","mp-timetable")}]}),React.createElement(h,{label:m("Filter events style","mp-timetable"),value:a,onChange:function(e){return z({view:e})},options:[{value:"dropdown_list",label:m("Dropdown list","mp-timetable")},{value:"tabs",label:m("Tabs","mp-timetable")}]}),React.createElement(g,{label:m("Filter title to display all events","mp-timetable"),value:i,onChange:function(e){return z({label:e})}}),React.createElement(h,{label:m("Hide 'All Events' option","mp-timetable"),value:u,onChange:function(e){return z({hide_label:e})},options:[{value:"0",label:m("No","mp-timetable")},{value:"1",label:m("Yes","mp-timetable")}]}),React.createElement(h,{label:m("Hide column with hours","mp-timetable"),value:c,onChange:function(e){return z({hide_hrs:e})},options:[{value:"0",label:m("No","mp-timetable")},{value:"1",label:m("Yes","mp-timetable")}]}),React.createElement(h,{label:m("Do not display empty rows","mp-timetable"),value:p,onChange:function(e){return z({hide_empty_rows:e})},options:[{value:"0",label:m("No","mp-timetable")},{value:"1",label:m("Yes","mp-timetable")}]}),React.createElement(h,{label:m("Merge cells with common events","mp-timetable"),value:E,onChange:function(e){return z({group:e})},options:[{value:"0",label:m("No","mp-timetable")},{value:"1",label:m("Yes","mp-timetable")}]}),React.createElement(h,{label:m("Disable event link","mp-timetable"),value:R,onChange:function(e){return z({disable_event_url:e})},options:[{value:"0",label:m("No","mp-timetable")},{value:"1",label:m("Yes","mp-timetable")}]}),React.createElement(h,{label:m("Horizontal align","mp-timetable"),value:C,onChange:function(e){return z({text_align:e})},options:[{value:"center",label:m("center","mp-timetable")},{value:"left",label:m("left","mp-timetable")},{value:"right",label:m("right","mp-timetable")}]}),React.createElement(h,{label:m("Vertical align","mp-timetable"),value:O,onChange:function(e){return z({text_align_vertical:e})},options:[{value:"default",label:m("Default","mp-timetable")},{value:"top",label:m("top","mp-timetable")},{value:"middle",label:m("middle","mp-timetable")},{value:"bottom",label:m("bottom","mp-timetable")}]}),React.createElement(g,{label:m("Unique ID","mp-timetable"),help:m("If you use more than one table on a page specify the unique ID for a timetable. It is usually all lowercase and contains only letters, numbers, and hyphens.","mp-timetable"),value:S,onChange:function(e){return z({id:e})}}),React.createElement(g,{label:m("CSS class","mp-timetable"),value:j,onChange:function(e){return z({custom_class:e})}}),React.createElement(h,{label:m("Mobile behavior","mp-timetable"),value:P,onChange:function(e){return z({responsive:e})},options:[{value:"0",label:m("Table","mp-timetable")},{value:"1",label:m("List","mp-timetable")}]})))}}])&&a(n.prototype,o),b&&a(n,b),_}(b);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function C(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function O(){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(e){return!1}}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}wp.i18n.__;var k=wp.element,x=k.Component,P=k.Fragment,T=wp.compose.compose,D=wp.components,I=D.Disabled,z=D.ServerSideRender,M=wp.data.withSelect,N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&j(e,t)}(i,e);var t,n,o,r,a=(t=i,function(){var e,n=S(t);if(O()){var l=S(this).constructor;e=Reflect.construct(n,arguments,l)}else e=n.apply(this,arguments);return C(this,e)});function i(){return E(this,i),a.apply(this,arguments)}return n=i,(o=[{key:"initTable",value:function(){var e=setInterval((function(){jQuery(".mptt-shortcode-wrapper").length&&!jQuery(".mptt-shortcode-wrapper").hasClass("table-init")&&(clearInterval(e),window.mptt.tableInit())}),1)}},{key:"componentDidUpdate",value:function(e,t){Object(l.isEqual)(this.props.attributes,e.attributes)||this.initTable()}},{key:"componentDidMount",value:function(){this.initTable()}},{key:"render",value:function(){var e=this.props.attributes;return e.events,e.event_categ,React.createElement(P,null,React.createElement(_,this.props),React.createElement(I,null,React.createElement(z,{block:"mp-timetable/timetable",attributes:this.props.attributes})))}}])&&R(n.prototype,o),r&&R(n,r),i}(x),H=T([M((function(e,t){var n=e("core"),o=n.getEntityRecords,r=(n.getCategories,o("postType","mp-event",{per_page:-1,orderby:"title",order:"asc"})),a=o("postType","mp-column",{per_page:-1}),i=o("taxonomy","mp-event_category",{per_page:-1});return{selectedEvents:r?r.map((function(e){return Object(l.pick)(e,["id","title"])})):null,selectedColumns:a?a.map((function(e){return Object(l.pick)(e,["id","title"])})):null,selectedEventCategories:i?i.map((function(e){return Object(l.pick)(e,["id","name"])})):null}}))])(N);(0,wp.blocks.registerBlockType)("mp-timetable/timetable",{title:(0,wp.i18n.__)("Timetable","mp-timetable"),category:"common",icon:"calendar",supports:{align:["wide","full"]},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t}},edit:H,save:function(){return null}})}]);
|
media/js/blocks/src/timetable/edit.js
CHANGED
@@ -23,7 +23,7 @@ class Edit extends Component {
|
|
23 |
initTable(){
|
24 |
//Set timer and check when table is load fully, and then initialize table data, and after stop timer
|
25 |
const waitLoadTable = setInterval( () => {
|
26 |
-
if (
|
27 |
clearInterval(waitLoadTable);
|
28 |
window.mptt.tableInit();
|
29 |
}
|
23 |
initTable(){
|
24 |
//Set timer and check when table is load fully, and then initialize table data, and after stop timer
|
25 |
const waitLoadTable = setInterval( () => {
|
26 |
+
if (jQuery('.mptt-shortcode-wrapper').length && !jQuery('.mptt-shortcode-wrapper').hasClass('table-init')){
|
27 |
clearInterval(waitLoadTable);
|
28 |
window.mptt.tableInit();
|
29 |
}
|
media/js/events/event.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}({2:function(t,e){Registry.register("Event",function(t){"use strict";var e;return{getInstance:function(){return e||(e={event_id:"",eventsData:{},init:function(){e.initTimePicker(),e.addEventButton(),e.initDeleteButtons(),e.initEditButtons(),e.initColorPicker(),e.initDatePicker(),e.columnRadioBox()},initTimePicker:function(){var e=Boolean(parseInt(t("#time_format").val()));t("#event_start").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"}),t("#event_end").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"})},initSlider:function(n,i){var a=!_.isUndefined(i)&&Boolean(i),r=n.replace(/^\D+/g,"");t(n).carouFredSel({items:{visible:3},direction:"up",scroll:{items:1,easing:"swing",pauseOnHover:!0,onAfter:function(e){e.items.old.each(function(){t(this).removeClass("visible")}),e.items.visible.each(function(){t(this).addClass("visible")})}},auto:{play:a,timeoutDuration:3e3},prev:{button:"#mp_prev_button"+r},next:{button:"#mp_next_button"+r}}),t(n).trigger("currentVisible",function(t){t.addClass("visible")}),e.setColorSettings(n+" .mptt-colorized")},initDeleteButton:function(){var e=t("#events-list");e.find("li.event").find("i.operation-button.dashicons-no.dashicons").off("click").on("click",function(){e.find("li.event").length>1?t(this).parents("li.event").remove():e.remove()})},initColorPicker:function(e){_.isUndefined(e)&&(e="");var n=t(e+" input.clr-picker"),i=t(e+" input.regular-text");n.spectrum("destroy"),n.spectrum({preferredFormat:"rgb",showInput:!0,showAlpha:!0,allowEmpty:!0,palette:[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]],showPalette:!0,show:function(e){t(this).val(e)},hide:function(e){t(this).parents(".select-color").find(".regular-text").val(t(this).val())},change:function(e){t(this).parents(".select-color").find('input:not([type="hidden"])').val(t(this).val())}}),i.off("keyup").on("keyup",function(){var e=t(this).parents(".select-color"),n=e.find(".clr-picker"),i=e.find(".regular-text").val();e.find(".sp-preview-inner").css({"background-color":i}),n.spectrum("set",i)})},addEventButton:function(){t(document).on("click.admin","#add_mp_event",function(){t(this).hasClass("edit")?e.updateEventData():e.renderEventItem()})},initDeleteButtons:function(){t(document).on("click.admin","#events-list .delete-event-button",function(){var n=t(this).attr("data-id");e.deleteEvent(n)})},initEditButtons:function(){t(document).on("click.admin","#events-list .edit-event-button",function(){var n=t(this).attr("data-id"),i=t(this).parent().parent();t(this).parent().find(".spinner").addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"get_event_data",id:n},function(n){var a=t("#add_mp_event"),r=t("#events-list");r.find(".spinner").removeClass("is-active"),r.find(" tr").removeClass("active"),i.addClass("active"),t("#event_start").val(n.event_start),t("#event_end").val(n.event_end),t("#description").val(n.description),t("#user_id").val(n.user_id),t("#weekday_id").val(n.column_id),a.addClass("edit"),a.val("Update"),e.event_id=n.id},function(t){console.warn(t)})})},deleteEvent:function(e){Registry._get("adminFunctions").wpAjax({controller:"events",action:"delete",id:e},function(n){var i=t("#events-list").find('tr[data-id="'+e+'"]');i.length&&i.remove()},function(t){console.log(t)})},updateEventItem:function(){var n=t("#events-list").find('tr[data-id="'+e.event_id+'"]'),i=t("#user_id");n.find("td.event-column").text(t("#weekday_id").find("option:selected").text()),n.find("td.event-start").text(t("#event_start").val()),n.find("td.event-end").text(t("#event_end").val()),n.find("td.event-user-id").text("-1"===i.val()?"":i.find("option:selected").text()),n.find("td.event-description").text(t("#description").val()),e.event_id=null,t("#add_mp_event").removeClass("edit").val("Add New")},updateEventData:function(){var n=t("#add_event_table").find(".spinner");n.addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"update_event_data",data:{id:Registry._get("Event").event_id,event_start:t("#event_start").val(),event_end:t("#event_end").val(),description:t("#description").val(),user_id:t("#user_id").val(),weekday_ids:t("#weekday_id").val()}},function(){n.removeClass("is-active"),e.updateEventItem(),e.clearTable()},function(t){n.removeClass("is-active"),console.log(t)})},renderEventItem:function(){var n=t("#weekday_id"),i=t("#user_id"),a=n.find("option:selected").val(),r=t("#event_start"),s=t("#event_end"),o=t("#description"),d={tag:"tr",attrs:{},content:[{tag:"td",attrs:{style:"display:none;"},content:[{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][weekday_ids][]",value:a}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_start][]",value:r.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_end][]",value:s.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][description][]",value:o.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][user_id][]",value:i.val()}}]},{tag:"td",attrs:{class:"event-column"},content:[n.find("option:selected").text()]},{tag:"td",attrs:{class:"event-start"},content:[r.val()]},{tag:"td",attrs:{class:"event-end"},content:[s.val()]},{tag:"td",attrs:{class:"event-description"},content:[o.val()]},{tag:"td",attrs:{class:"event-user-id"},content:["-1"===i.val()?"":i.find("option:selected").text()]},{tag:"td",attrs:{},content:[]}]},c=Registry._get("adminFunctions").getHtml(d);t("#events-list").find("tbody").append(c),t(".events-list-wrapper").scrollTop(1e10),e.clearTable()},setEventHeight:function(e){var n=e.parent().outerHeight(),i=t("body"),a=e.height(),r=e.data("min-height"),s=e.find(".mptt-inner-event-content").height();e.css("position","").css("width","").css("min-height",""),i.hasClass("mprm_ie_browser")?(s=e.css("height","").find(".mptt-inner-event-content").height(),e.height(a),s<=r?e.css("max-height",r):(e.css("height",""),e.css("max-height",s))):s<=r?e.css("min-height",r):e.css("min-height",s),n<a&&e.height(a)},recalculate_Height:function(e,n){var i=t(".mptt-event-container",e),a=i.length,r=0,s=0,o=e.height();t("body").hasClass("mprm_ie_browser")?(r=o/(a>0?a:1),_.isUndefined(n)?t.each(i,function(){var e=t(this);if(e.height(r),_.isEmpty(e.data("min-height"))){var n=e.height();0===n?e.data("min-height",r):e.data("min-height",n)}e.css("top",s+"px"),e.removeClass("mptt-hidden"),s+=r}):n.height(r)):(r=100/(a>0?a:1),_.isUndefined(n)?t.each(i,function(){var e=t(this);e.height(r+"%"),_.isEmpty(e.data("min-height"))&&e.data("min-height",e.height()),e.css("top",s+"%"),e.removeClass("mptt-hidden"),s+=r}):n.height(r+"%"))},setEventsHeight:function(){var n=t(".mptt-shortcode-wrapper").find("table").find("td.event");t.each(n,function(){var n=t(this);e.recalculate_Height(n)})},setColorSettings:function(n){_.isUndefined(n)&&(n=".mptt-colorized");var i=t(n);t.each(i,function(){var n=t(this),i=n.attr("data-bg_hover_color"),a=n.attr("data-hover_color"),r=n.parent();switch(n.attr("data-type")){case"column":case"event":n.hover(function(){_.isEmpty(i)||n.css("background-color",i),_.isEmpty(a)||n.css("color",a),e.setEventHeight(n)},function(){n.css("max-height","").css("min-height",""),e.recalculate_Height(r,n),n.css("background-color",n.attr("data-bg_color")),n.css("color",n.attr("data-color"))});break;case"widget":n.hover(function(){n.css("background-color",n.attr("data-background-hover-color")),n.css("color",t(this).attr("data-hover-color")),n.css("border-left-color",n.attr("data-hover-border-color"))},function(){n.css("background-color",n.attr("data-background-color")),n.css("color",n.attr("data-color")),n.css("border-left-color",n.attr("data-border-color"))})}})},clearTable:function(){var e=t("#weekday_id");t("#add_event_table input:not(.button),#add_event_table textarea").val(""),e.val(e.find("option:first").attr("value"))},getRowSpan:function(e,n){for(var i=[],a=[],r=n.attr("data-column-id"),s=n.closest("tr").next("tr"),o=s.find('td[data-column-id="'+r+'"]'),d=s.length>0&&o.length>0&&o.children().length>0;!d;){if(0==s.next("tr").length){d=!0,s=!1;break}d=(o=(s=s.next("tr")).find('td[data-column-id="'+r+'"]')).children().length>0}var c=!1;s&&(c=s.data("index")),t.each(e,function(e){var n=t(this).attr("data-start"),r=t(this).attr("data-end");a[e]=n,i[e]=r});var l=Math.min.apply(Math,a),v=Math.max.apply(Math,i);c&&v>c&&(v=c);var f=v-l;return f<1?1:f},responsiveFilter:function(e){var n="all",i=e.parents(".mptt-shortcode-wrapper");n=e.is("select")?e.val():e.attr("href").replace("#","");var a=i.find(".mptt-list-event");"all"!==n?(a.hide(),i.find('.mptt-list-event[data-event-id="'+n+'"]').show()):a.show(),t.each(i.find(".mptt-column"),function(){t(this).show(),t(this).find(".mptt-list-event:visible").length<1&&t(this).hide()})},filterStatic:function(t,n){var i=t.parents(".mptt-shortcode-wrapper"),a="#all",r=_.isEmpty(i.attr("id"))?"not-set":i.attr("id");a=t.is("select")?t.val():t.attr("href").replace("#",""),0==n||void 0===n.originalEvent||(window.location.hash=r+":"+a),i.find("table").hide(),i.find('table[id="#'+a+'"]').fadeIn(),e.setEventsHeight()},setClassTd:function(){t.each(t(".mptt-event-container"),function(){t(this).parents("td").addClass("event")})},initTableData:function(){e.setClassTd(),e.setRowSpanTd();var n="."+MPTT.table_class;t(n).data("hide_empty_row")&&e.hideEmptyRows()},filterShortcodeEvents:function(){var n=t(".mptt-menu");n.length&&(n.off("change").on("change",function(n){e.filterStatic(t(this),n),e.responsiveFilter(t(this))}),t(".mptt-navigation-tabs.mptt-menu a").off("click").on("click",function(n){var i=t(this);i.parents(".mptt-navigation-tabs.mptt-menu").find("li").removeClass("active"),i.parents("li").addClass("active"),e.filterStatic(i,n),e.responsiveFilter(i)}))},showCurrentEvent:function(t,e){t.find(".mptt-menu").hasClass("mptt-navigation-tabs")?t.find(".mptt-navigation-tabs").find('a[href="#'+e+'"]').click():t.find(".mptt-menu").hasClass("mptt-navigation-select")&&t.find('.mptt-navigation-select option[value="'+e+'"]')?t.find(".mptt-navigation-select").val(e).change():t.find('table[id="#all"]').fadeIn()},getFilterByHash:function(){var n=window.location.hash;if(!_.isUndefined(n)){var i=n.split(":"),a=i[0],r=i[1],s=t(".mptt-shortcode-wrapper");r=_.isUndefined(r)?"all":r,1===s.length?e.showCurrentEvent(s,r):t.each(s,function(n,i){var s=t(i);"#"+s.attr("id")===a?e.showCurrentEvent(s,r):e.showCurrentEvent(s,"all")})}e.setEventsHeight()},removeCellsAfterChangeColSpan:function(t,e,n,i){for(;t<e;t++){var a=n.find('th[data-index="'+t+'"]').data("column-id");i.find('td:not(.event)[data-column-id="'+a+'"]').remove()}},removeCellsAfterChangeRowSpan:function(t,n,i,a){for(var r=t.parents("tr").attr("data-index"),s=n+parseInt(r)-1,o=t.attr("colspan"),d=i.find('th[data-column-id="'+a+'"]').data("index"),c=parseInt(d)+parseInt(o);r<s;r++){var l=i.find("tr.mptt-shortcode-row-"+(parseInt(r)+1));if(l.length){if(l.find('td.event[data-column-id="'+a+'"]').length&&(n-=s-r)<2){n=1;break}o>1&&e.removeCellsAfterChangeColSpan(d,c,i,l),l.find('td:not(.event)[data-column-id="'+a+'"]').remove()}}return n},setRowSpanTd:function(){var n="."+MPTT.table_class;t.each(t(n),function(){var n=t(this);t.each(n.find("td.event"),function(){var i=t(this),a=i.find(".mptt-event-container"),r=i.attr("data-column-id"),s=i.attr("data-row_height"),o=e.getRowSpan(a,i);!_.isUndefined(o)&&o>1&&(o=e.removeCellsAfterChangeRowSpan(i,o,n,r),isNaN(s)||i.css("height",o*s)),i.attr("rowspan",o)})})},hideEmptyRows:function(){var e="."+MPTT.table_class,n=t(e+" tbody tr"),i=t(e).first().find("th").length;t.each(n,function(e,n){0===t(n).find("td.event").length&&t(n).find("td").length===i&&t(n).remove()})},displaySettings:function(){var e=t(".view_settings");e.length&&e.change(function(){"all"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(".next-days").css("display","block")):t(this).parents(".mptt-container").find(".next-days").css("display","none")})},timeMode:function(e){if(e){var n="."+t(this).attr("id");t("#"+e).change(function(){"server"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(n).css("display","block")):t(this).parents(".mptt-container").find(n).css("display","none")})}},initDatePicker:function(){var e=t("#datepicker");e.length&&e.datepicker({dateFormat:"d/m/yy",setDate:Date.parse(e.val())})},columnRadioBox:function(){var e=t("#datepicker"),n=t('input.option-input[name="column[column_option]"]'),i=t("select.mp-weekday");n.length&&n.on("change",function(){switch(t(this).val()){case"simple":i.prop("disabled",!0),e.prop("disabled",!0);break;case"weekday":i.prop("disabled",!1),e.val("").prop("disabled",!0);break;case"date":i.prop("disabled",!0),e.prop("disabled",!1)}})}}),e}}}(jQuery))}});
|
1 |
+
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var a=e[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(i,a,function(e){return t[e]}.bind(null,a));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}({2:function(t,e){Registry.register("Event",function(t){"use strict";var e;return{getInstance:function(){return e||(e={event_id:"",eventsData:{},init:function(){e.initTimePicker(),e.addEventButton(),e.initDeleteButtons(),e.initEditButtons(),e.initColorPicker(),e.initDatePicker(),e.columnRadioBox()},initTimePicker:function(){var e=Boolean(parseInt(t("#time_format").val()));t("#event_start").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"}),t("#event_end").timepicker({showPeriod:e,showPeriodLabels:e,defaultTime:"00:00"})},initSlider:function(n,i){var a=!_.isUndefined(i)&&Boolean(i),r=n.replace(/^\D+/g,"");t(n).carouFredSel({items:{visible:3},direction:"up",scroll:{items:1,easing:"swing",pauseOnHover:!0,onAfter:function(e){e.items.old.each((function(){t(this).removeClass("visible")})),e.items.visible.each((function(){t(this).addClass("visible")}))}},auto:{play:a,timeoutDuration:3e3},prev:{button:"#mp_prev_button"+r},next:{button:"#mp_next_button"+r}}),t(n).trigger("currentVisible",(function(t){t.addClass("visible")})),e.setColorSettings(n+" .mptt-colorized")},initDeleteButton:function(){var e=t("#events-list");e.find("li.event").find("i.operation-button.dashicons-no.dashicons").off("click").on("click",(function(){e.find("li.event").length>1?t(this).parents("li.event").remove():e.remove()}))},initColorPicker:function(e){_.isUndefined(e)&&(e="");var n=t(e+" input.clr-picker"),i=t(e+" input.regular-text");n.spectrum("destroy"),n.spectrum({preferredFormat:"rgb",showInput:!0,showAlpha:!0,allowEmpty:!0,palette:[["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],["#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#cfe2f3","#d9d2e9","#ead1dc"],["#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#9fc5e8","#b4a7d6","#d5a6bd"],["#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6fa8dc","#8e7cc3","#c27ba0"],["#c00","#e69138","#f1c232","#6aa84f","#45818e","#3d85c6","#674ea7","#a64d79"],["#900","#b45f06","#bf9000","#38761d","#134f5c","#0b5394","#351c75","#741b47"],["#600","#783f04","#7f6000","#274e13","#0c343d","#073763","#20124d","#4c1130"]],showPalette:!0,show:function(e){t(this).val(e)},hide:function(e){t(this).parents(".select-color").find(".regular-text").val(t(this).val())},change:function(e){t(this).parents(".select-color").find('input:not([type="hidden"])').val(t(this).val())}}),i.off("keyup").on("keyup",(function(){var e=t(this).parents(".select-color"),n=e.find(".clr-picker"),i=e.find(".regular-text").val();e.find(".sp-preview-inner").css({"background-color":i}),n.spectrum("set",i)}))},addEventButton:function(){t(document).on("click.admin","#add_mp_event",(function(){t(this).hasClass("edit")?e.updateEventData():e.renderEventItem()}))},initDeleteButtons:function(){t(document).on("click.admin","#events-list .delete-event-button",(function(){var n=t(this).attr("data-id");e.deleteEvent(n)}))},initEditButtons:function(){t(document).on("click.admin","#events-list .edit-event-button",(function(){var n=t(this).attr("data-id"),i=t(this).parent().parent();t(this).parent().find(".spinner").addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"get_event_data",id:n},(function(n){var a=t("#add_mp_event"),r=t("#events-list");r.find(".spinner").removeClass("is-active"),r.find(" tr").removeClass("active"),i.addClass("active"),t("#event_start").val(n.event_start),t("#event_end").val(n.event_end),t("#description").val(n.description),t("#user_id").val(n.user_id),t("#weekday_id").val(n.column_id),a.addClass("edit"),a.val("Update"),e.event_id=n.id}),(function(t){console.warn(t)}))}))},deleteEvent:function(e){Registry._get("adminFunctions").wpAjax({controller:"events",action:"delete",id:e},(function(n){var i=t("#events-list").find('tr[data-id="'+e+'"]');i.length&&i.remove()}),(function(t){console.log(t)}))},updateEventItem:function(){var n=t("#events-list").find('tr[data-id="'+e.event_id+'"]'),i=t("#user_id");n.find("td.event-column").text(t("#weekday_id").find("option:selected").text()),n.find("td.event-start").text(t("#event_start").val()),n.find("td.event-end").text(t("#event_end").val()),n.find("td.event-user-id").text("-1"===i.val()?"":i.find("option:selected").text()),n.find("td.event-description").text(t("#description").val()),e.event_id=null,t("#add_mp_event").removeClass("edit").val("Add New")},updateEventData:function(){var n=t("#add_event_table").find(".spinner");n.addClass("is-active"),Registry._get("adminFunctions").wpAjax({controller:"events",action:"update_event_data",data:{id:Registry._get("Event").event_id,event_start:t("#event_start").val(),event_end:t("#event_end").val(),description:t("#description").val(),user_id:t("#user_id").val(),weekday_ids:t("#weekday_id").val()}},(function(){n.removeClass("is-active"),e.updateEventItem(),e.clearTable()}),(function(t){n.removeClass("is-active"),console.log(t)}))},renderEventItem:function(){var n=t("#weekday_id"),i=t("#user_id"),a=n.find("option:selected").val(),r=t("#event_start"),s=t("#event_end"),o=t("#description"),d={tag:"tr",attrs:{},content:[{tag:"td",attrs:{style:"display:none;"},content:[{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][weekday_ids][]",value:a}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_start][]",value:r.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][event_end][]",value:s.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][description][]",value:o.val()}},{tag:"input",attrs:{type:"hidden",name:"event_data["+a+"][user_id][]",value:i.val()}}]},{tag:"td",attrs:{class:"event-column"},content:[n.find("option:selected").text()]},{tag:"td",attrs:{class:"event-start"},content:[r.val()]},{tag:"td",attrs:{class:"event-end"},content:[s.val()]},{tag:"td",attrs:{class:"event-description"},content:[o.val()]},{tag:"td",attrs:{class:"event-user-id"},content:["-1"===i.val()?"":i.find("option:selected").text()]},{tag:"td",attrs:{},content:[]}]},c=Registry._get("adminFunctions").getHtml(d);t("#events-list").find("tbody").append(c),t(".events-list-wrapper").scrollTop(1e10),e.clearTable()},setEventHeight:function(e){var n=e.parent().outerHeight(),i=t("body"),a=e.height(),r=e.data("min-height"),s=e.find(".mptt-inner-event-content").height();e.css("position","").css("width","").css("min-height",""),i.hasClass("mprm_ie_browser")?(s=e.css("height","").find(".mptt-inner-event-content").height(),e.height(a),s<=r?e.css("max-height",r):(e.css("height",""),e.css("max-height",s))):s<=r?e.css("min-height",r):e.css("min-height",s),n<a&&e.height(a)},recalculate_Height:function(e,n){var i=t(".mptt-event-container",e),a=i.length,r=0,s=0,o=e.height();t("body").hasClass("mprm_ie_browser")?(r=o/(a>0?a:1),_.isUndefined(n)?t.each(i,(function(){var e=t(this);if(e.height(r),_.isEmpty(e.data("min-height"))){var n=e.height();0===n?e.data("min-height",r):e.data("min-height",n)}e.css("top",s+"px"),e.removeClass("mptt-hidden"),s+=r})):n.height(r)):(r=100/(a>0?a:1),_.isUndefined(n)?t.each(i,(function(){var e=t(this);e.height(r+"%"),_.isEmpty(e.data("min-height"))&&e.data("min-height",e.height()),e.css("top",s+"%"),e.removeClass("mptt-hidden"),s+=r})):n.height(r+"%"))},setEventsHeight:function(){var n=t(".mptt-shortcode-wrapper").find("table").find("td.event");t.each(n,(function(){var n=t(this);e.recalculate_Height(n)}))},setColorSettings:function(n){_.isUndefined(n)&&(n=".mptt-colorized");var i=t(n);t.each(i,(function(){var n=t(this),i=n.attr("data-bg_hover_color"),a=n.attr("data-hover_color"),r=n.parent();switch(n.attr("data-type")){case"column":case"event":n.hover((function(){_.isEmpty(i)||n.css("background-color",i),_.isEmpty(a)||n.css("color",a),e.setEventHeight(n)}),(function(){n.css("max-height","").css("min-height",""),e.recalculate_Height(r,n),n.css("background-color",n.attr("data-bg_color")),n.css("color",n.attr("data-color"))}));break;case"widget":n.hover((function(){n.css("background-color",n.attr("data-background-hover-color")),n.css("color",t(this).attr("data-hover-color")),n.css("border-left-color",n.attr("data-hover-border-color"))}),(function(){n.css("background-color",n.attr("data-background-color")),n.css("color",n.attr("data-color")),n.css("border-left-color",n.attr("data-border-color"))}))}}))},clearTable:function(){var e=t("#weekday_id");t("#add_event_table input:not(.button),#add_event_table textarea").val(""),e.val(e.find("option:first").attr("value"))},getRowSpan:function(e,n){for(var i=[],a=[],r=n.attr("data-column-id"),s=n.closest("tr").next("tr"),o=s.find('td[data-column-id="'+r+'"]'),d=s.length>0&&o.length>0&&o.children().length>0;!d;){if(0==s.next("tr").length){d=!0,s=!1;break}d=(o=(s=s.next("tr")).find('td[data-column-id="'+r+'"]')).children().length>0}var c=!1;s&&(c=s.data("index")),t.each(e,(function(e){var n=t(this).attr("data-start"),r=t(this).attr("data-end");a[e]=n,i[e]=r}));var l=Math.min.apply(Math,a),v=Math.max.apply(Math,i);c&&v>c&&(v=c);var f=v-l;return f<1?1:f},responsiveFilter:function(e){var n="all",i=e.parents(".mptt-shortcode-wrapper");n=e.is("select")?e.val():e.attr("href").replace("#","");var a=i.find(".mptt-list-event");"all"!==n?(a.hide(),i.find('.mptt-list-event[data-event-id="'+n+'"]').show()):a.show(),t.each(i.find(".mptt-column"),(function(){t(this).show(),t(this).find(".mptt-list-event:visible").length<1&&t(this).hide()}))},filterStatic:function(t,n){var i=t.parents(".mptt-shortcode-wrapper"),a="#all",r=_.isEmpty(i.attr("id"))?"not-set":i.attr("id");a=t.is("select")?t.val():t.attr("href").replace("#",""),0==n||void 0===n.originalEvent||(window.location.hash=r+":"+a),i.find("table").hide(),i.find('table[id="#'+a+'"]').fadeIn(),e.setEventsHeight()},setClassTd:function(){t.each(t(".mptt-event-container"),(function(){t(this).parents("td").addClass("event")}))},initTableData:function(){e.setClassTd(),e.setRowSpanTd();var n="."+MPTT.table_class;t(n).data("hide_empty_row")&&e.hideEmptyRows()},filterShortcodeEvents:function(){var n=t(".mptt-menu");n.length&&(n.off("change").on("change",(function(n){e.filterStatic(t(this),n),e.responsiveFilter(t(this))})),t(".mptt-navigation-tabs.mptt-menu a").off("click").on("click",(function(n){var i=t(this);i.parents(".mptt-navigation-tabs.mptt-menu").find("li").removeClass("active"),i.parents("li").addClass("active"),e.filterStatic(i,n),e.responsiveFilter(i)})))},showCurrentEvent:function(t,e){t.find(".mptt-menu").hasClass("mptt-navigation-tabs")?t.find(".mptt-navigation-tabs").find('a[href="#'+e+'"]').click():t.find(".mptt-menu").hasClass("mptt-navigation-select")&&t.find('.mptt-navigation-select option[value="'+e+'"]')?t.find(".mptt-navigation-select").val(e).change():t.find('table[id="#all"]').fadeIn()},getFilterByHash:function(){var n=window.location.hash;if(!_.isUndefined(n)){var i=n.split(":"),a=i[0],r=i[1],s=t(".mptt-shortcode-wrapper");r=_.isUndefined(r)?"all":r,1===s.length?e.showCurrentEvent(s,r):t.each(s,(function(n,i){var s=t(i);"#"+s.attr("id")===a?e.showCurrentEvent(s,r):e.showCurrentEvent(s,"all")}))}e.setEventsHeight()},removeCellsAfterChangeColSpan:function(t,e,n,i){for(;t<e;t++){var a=n.find('th[data-index="'+t+'"]').data("column-id");i.find('td:not(.event)[data-column-id="'+a+'"]').remove()}},removeCellsAfterChangeRowSpan:function(t,n,i,a){for(var r=t.parents("tr").attr("data-index"),s=n+parseInt(r)-1,o=t.attr("colspan"),d=i.find('th[data-column-id="'+a+'"]').data("index"),c=parseInt(d)+parseInt(o);r<s;r++){var l=i.find("tr.mptt-shortcode-row-"+(parseInt(r)+1));if(l.length){if(l.find('td.event[data-column-id="'+a+'"]').length&&(n-=s-r)<2){n=1;break}o>1&&e.removeCellsAfterChangeColSpan(d,c,i,l),l.find('td:not(.event)[data-column-id="'+a+'"]').remove()}}return n},setRowSpanTd:function(){var n="."+MPTT.table_class;t.each(t(n),(function(){var n=t(this);t.each(n.find("td.event"),(function(){var i=t(this),a=i.find(".mptt-event-container"),r=i.attr("data-column-id"),s=i.attr("data-row_height"),o=e.getRowSpan(a,i);!_.isUndefined(o)&&o>1&&(o=e.removeCellsAfterChangeRowSpan(i,o,n,r),isNaN(s)||i.css("height",o*s)),i.attr("rowspan",o)}))}))},hideEmptyRows:function(){var e="."+MPTT.table_class,n=t(e+" tbody tr"),i=t(e).first().find("th").length;t.each(n,(function(e,n){0===t(n).find("td.event").length&&t(n).find("td").length===i&&t(n).remove()}))},displaySettings:function(){var e=t(".view_settings");e.length&&e.change((function(){"all"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(".next-days").css("display","block")):t(this).parents(".mptt-container").find(".next-days").css("display","none")}))},timeMode:function(e){if(e){var n="."+t(this).attr("id");t("#"+e).change((function(){"server"===t(this).val()?(t(this).attr("id"),t(this).parents(".mptt-container").find(n).css("display","block")):t(this).parents(".mptt-container").find(n).css("display","none")}))}},initDatePicker:function(){var e=t("#datepicker");e.length&&e.datepicker({dateFormat:"d/m/yy",setDate:Date.parse(e.val())})},columnRadioBox:function(){var e=t("#datepicker"),n=t('input.option-input[name="column[column_option]"]'),i=t("select.mp-weekday");n.length&&n.on("change",(function(){switch(t(this).val()){case"simple":i.prop("disabled",!0),e.prop("disabled",!0);break;case"weekday":i.prop("disabled",!1),e.val("").prop("disabled",!0);break;case"date":i.prop("disabled",!0),e.prop("disabled",!1)}}))}}),e}}}(jQuery))}});
|
media/js/mptt-functions.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t){window.Registry=function(){"use strict";var e={};function t(e){var t=!1;return"function"==typeof e.getInstance&&(t=!0),t}return{register:function(n,i){if(!t(i))throw new Error('Invalide module "'+n+'". The function "getInstance" is not defined.');e[n]=i},unregister:function(t){delete e[t]},_get:function(t){var n=e[t];if(!n)throw new Error('The module "'+t+'" has not been registered or it was unregistered.');if("function"!=typeof n.getInstance)throw new Error('The module "'+t+'" can not be instantiated. The function "getInstance" is not defined.');return e[t].getInstance()},registryMap:function(n){for(var i in n)if(n.hasOwnProperty(i)){if(!t(n[i]))throw new Error('Invalide module "'+i+'" inside the collection. The function "getInstance" is not defined.');e[i]=n[i]}}}}(),Registry.register("adminFunctions",function(e){"use strict";var t,n;return{getInstance:function(){return t||(t={wpAjax:function(e,t,n){e.mptt_action=e.action,delete e.action,wp.ajax.send("route_url",{success:function(e){!_.isUndefined(n)&&_.isFunction(n)&&t(e)},error:function(e){!_.isUndefined(n)&&_.isFunction(n)?n(e):console.log(e)},data:e})},initJBox:function(e,i,r){e,n=i,t.buttonEvents(r)},buttonEvents:function(t){n.find("#insert-into").off("click").on("click",function(){t(e(this).parents("form").serializeArray())})},callModal:function(t,n,i){var r=e(window).outerHeight()-60,o=e(window).outerWidth()-60,s=(wp.html.string({tag:"span",attrs:{class:"spinner is-active"},content:""}),{content:t,closeOnEsc:!0,animation:{open:"zoomIn",close:"zoomOut"},width:o,height:r,closeButton:"title",title:"Shortcode Settings",onOpen:function(){var t=e("#"+this.id);n.call(this,t)},onClose:function(){e("#"+this.id).remove()}});_.isUndefined(i)||e.extend(s,i),new jBox("Modal",s).open()},parseRequest:function(t){var n,i=location.search,r={};return _.isEmpty(i)||"?"===i?r:(n=(i=i.replace("?","")).split("&"),e.each(n,function(){var e=this;e=e.split("="),r[e[0]]=e[1]}),_.isUndefined(t)?r:r[t])},generateHTML:function(n){var i,r="";if(_.isObject(n)){var o=document.createElement(n.tag);_.isUndefined(n.attrs)||e.each(n.attrs,function(e,t){_.isUndefined(t)||""===t||o.setAttribute(e,t)}),_.isArray(n.content)?(e.each(n.content,function(e,n){r+=t.generateHTML(n)}),e(o).html(r)):_.isObject(n.content)?(r=t.generateHTML(n.content),e(o).html(r)):_.isUndefined(n.content)?e(o).html(""):e(o).html(n.content),i=e(o).get(0).outerHTML}else i=!!_.isString(n)&&n;return i},getHtml:function(n,i){if(_.isUndefined(n))return!1;var r=!1;if(_.isUndefined(i)&&(_.isArray(n)?(r="",e.each(n,function(e,n){r+=t.generateHTML(n)})):r=t.generateHTML(n)),_.isObject(i)){var o=_.template(r);r=o(i)}return r}}),t}}}(jQuery)),function(e){"use strict";e(document).ready(function(){var t=function(){var t=e("body");!function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}return!1}()?t.removeClass("mprm_ie_browser"):t.hasClass("mprm_ie_browser")||t.addClass("mprm_ie_browser");var n=e(".mptt-shortcode-wrapper");if("undefined"!=typeof typenow&&pagenow===typenow)switch(typenow){case"mp-event":Registry._get("Event").init();break;case"mp-column":Registry._get("Event").initDatePicker(),Registry._get("Event").columnRadioBox()}n.length&&(Registry._get("Event").initTableData(),Registry._get("Event").filterShortcodeEvents(),Registry._get("Event").getFilterByHash(),n.show(),n.addClass("table-init")),(e(".upcoming-events-widget").length||n.length)&&Registry._get("Event").setColorSettings()};window.mptt={},window.mptt.tableInit=t,t()})}(jQuery)}]);
|
1 |
+
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t){window.Registry=function(){"use strict";var e={};function t(e){var t=!1;return"function"==typeof e.getInstance&&(t=!0),t}return{register:function(n,i){if(!t(i))throw new Error('Invalide module "'+n+'". The function "getInstance" is not defined.');e[n]=i},unregister:function(t){delete e[t]},_get:function(t){var n=e[t];if(!n)throw new Error('The module "'+t+'" has not been registered or it was unregistered.');if("function"!=typeof n.getInstance)throw new Error('The module "'+t+'" can not be instantiated. The function "getInstance" is not defined.');return e[t].getInstance()},registryMap:function(n){for(var i in n)if(n.hasOwnProperty(i)){if(!t(n[i]))throw new Error('Invalide module "'+i+'" inside the collection. The function "getInstance" is not defined.');e[i]=n[i]}}}}(),Registry.register("adminFunctions",function(e){"use strict";var t,n;return{getInstance:function(){return t||(t={wpAjax:function(e,t,n){e.mptt_action=e.action,delete e.action,wp.ajax.send("route_url",{success:function(e){!_.isUndefined(n)&&_.isFunction(n)&&t(e)},error:function(e){!_.isUndefined(n)&&_.isFunction(n)?n(e):console.log(e)},data:e})},initJBox:function(e,i,r){e,n=i,t.buttonEvents(r)},buttonEvents:function(t){n.find("#insert-into").off("click").on("click",(function(){t(e(this).parents("form").serializeArray())}))},callModal:function(t,n,i){var r=e(window).outerHeight()-60,o=e(window).outerWidth()-60,s=(wp.html.string({tag:"span",attrs:{class:"spinner is-active"},content:""}),{content:t,closeOnEsc:!0,animation:{open:"zoomIn",close:"zoomOut"},width:o,height:r,closeButton:"title",title:"Shortcode Settings",onOpen:function(){var t=e("#"+this.id);n.call(this,t)},onClose:function(){e("#"+this.id).remove()}});_.isUndefined(i)||e.extend(s,i),new jBox("Modal",s).open()},parseRequest:function(t){var n,i=location.search,r={};return _.isEmpty(i)||"?"===i?r:(n=(i=i.replace("?","")).split("&"),e.each(n,(function(){var e=this;e=e.split("="),r[e[0]]=e[1]})),_.isUndefined(t)?r:r[t])},generateHTML:function(n){var i,r="";if(_.isObject(n)){var o=document.createElement(n.tag);_.isUndefined(n.attrs)||e.each(n.attrs,(function(e,t){_.isUndefined(t)||""===t||o.setAttribute(e,t)})),_.isArray(n.content)?(e.each(n.content,(function(e,n){r+=t.generateHTML(n)})),e(o).html(r)):_.isObject(n.content)?(r=t.generateHTML(n.content),e(o).html(r)):_.isUndefined(n.content)?e(o).html(""):e(o).html(n.content),i=e(o).get(0).outerHTML}else i=!!_.isString(n)&&n;return i},getHtml:function(n,i){if(_.isUndefined(n))return!1;var r=!1;if(_.isUndefined(i)&&(_.isArray(n)?(r="",e.each(n,(function(e,n){r+=t.generateHTML(n)}))):r=t.generateHTML(n)),_.isObject(i)){var o=_.template(r);r=o(i)}return r}}),t}}}(jQuery)),function(e){"use strict";e(document).ready((function(){var t=function(){var t=e("body");!function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);if(e.indexOf("Trident/")>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}return!1}()?t.removeClass("mprm_ie_browser"):t.hasClass("mprm_ie_browser")||t.addClass("mprm_ie_browser");var n=e(".mptt-shortcode-wrapper");if("undefined"!=typeof typenow&&pagenow===typenow)switch(typenow){case"mp-event":Registry._get("Event").init();break;case"mp-column":Registry._get("Event").initDatePicker(),Registry._get("Event").columnRadioBox()}n.length&&(Registry._get("Event").initTableData(),Registry._get("Event").filterShortcodeEvents(),Registry._get("Event").getFilterByHash(),n.show(),n.addClass("table-init")),(e(".upcoming-events-widget").length||n.length)&&Registry._get("Event").setColorSettings()};window.mptt={},window.mptt.tableInit=t,t()}))}(jQuery)}]);
|
mp-timetable.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Timetable and Event Schedule
|
5 |
* Plugin URI: https://motopress.com/products/timetable-event-schedule/
|
6 |
* Description: Smart time-management tool with a clean minimalist design for featuring your timetables and upcoming events.
|
7 |
-
* Version: 2.3.
|
8 |
* Author: MotoPress
|
9 |
* Author URI: https://motopress.com
|
10 |
* License: GPLv2 or later
|
4 |
* Plugin Name: Timetable and Event Schedule
|
5 |
* Plugin URI: https://motopress.com/products/timetable-event-schedule/
|
6 |
* Description: Smart time-management tool with a clean minimalist design for featuring your timetables and upcoming events.
|
7 |
+
* Version: 2.3.8
|
8 |
* Author: MotoPress
|
9 |
* Author URI: https://motopress.com
|
10 |
* License: GPLv2 or later
|
readme.txt
CHANGED
@@ -79,6 +79,10 @@ Plugin bundles the following third-party resources:
|
|
79 |
|
80 |
== Changelog ==
|
81 |
|
|
|
|
|
|
|
|
|
82 |
= 2.3.7, Mar 10 2020 =
|
83 |
* Bug fix: fixed an issue with the erroneous positioning of events.
|
84 |
|
79 |
|
80 |
== Changelog ==
|
81 |
|
82 |
+
= 2.3.8, Apr 1 2020 =
|
83 |
+
* Bug fix: fixed an issue with the missing Event tags field.
|
84 |
+
* Bug fix: fixed an issue when a user with the read capability could access a Help menu page.
|
85 |
+
|
86 |
= 2.3.7, Mar 10 2020 =
|
87 |
* Bug fix: fixed an issue with the erroneous positioning of events.
|
88 |
|