File manager - Edit - /home/premiey/www/wp-includes/images/media/gutenberg.tar
Back
amelia-events/amelia-events-gutenberg.js 0000666 00000023226 15165407706 0014372 0 ustar 00 (function (wp) { var wpAmeliaLabels = 'wpAmeliaLabels' in window ? window.wpAmeliaLabels : {data: {}} var el = wp.element.createElement var components = wp.components var blockControls = wp.editor.BlockControls var inspectorControls = wp.editor.InspectorControls var data = wpAmeliaLabels.data var events = [] var tags = [] var blockStyle = { color: 'red' } if (data.events.length !== 0) { for (let i = 0; i < data.events.length; i++) { events.push({ value: data.events[i].id, text: data.events[i].name + ' (id: ' + data.events[i].id + ') - ' + data.events[i].formattedPeriodStart }) } } else { events = [] } if (data.tags.length !== 0) { for (let i = 0; i < data.tags.length; i++) { tags.push({ value: data.tags[i].name, text: data.tags[i].name }) } } else { tags = [] } // Registering the Block for events shortcode wp.blocks.registerBlockType('amelia/events-gutenberg-block', { title: wpAmeliaLabels.events_gutenberg_block.title, description: wpAmeliaLabels.events_gutenberg_block.description, icon: el('svg', {width: '25', height: '27', viewBox: '0 0 25 27'}, el('path', { style: {fill: '#1A84EE'}, d: 'M11.4937358,10.7089033 L11.4937358,2.00347742 C11.4937358,0.463573647 9.83438046,-0.498899048 8.50694847,0.271096622 L0.995613218,4.6279253 C0.379532759,4.98520749 1.74329502e-05,5.64565414 1.74329502e-05,6.36030609 L1.74329502e-05,15.0243117 C1.74329502e-05,16.5606252 1.65222529,17.5235357 2.97965728,16.7608958 L10.4910797,12.4454874 C11.1110826,12.0891685 11.4937358,11.4265326 11.4937358,10.7089033' }), el('path', { style: {fill: '#005AEE'}, d: 'M13.4849535,2.00346866 L13.4849535,10.7088945 C13.4849535,11.4265238 13.8676068,12.0891597 14.4876097,12.4453911 L21.9991193,16.7608871 C23.3265512,17.5235269 24.9787591,16.5606164 24.9787591,15.024303 L24.9787591,6.36029734 C24.9787591,5.64564538 24.5992438,4.98519874 23.9831633,4.62791654 L16.4717409,0.271000296 C15.1443089,-0.498907805 13.4849535,0.46356489 13.4849535,2.00346866' }), el('path', { style: {fill: '#3BA6FF'}, transform: 'translate(2.876437, 13.843371)', d: 'M8.62445527,0.32630898 L1.0701478,4.66641195 C-0.263647222,5.43264214 -0.267569636,7.36354223 1.06300029,8.13537686 L8.61730776,12.5170752 C9.23338822,12.8744449 9.99241887,12.8744449 10.6084993,12.5170752 L18.162894,8.13537686 C19.4934639,7.36354223 19.4895415,5.43264214 18.1557465,4.66641195 L10.601439,0.32630898 C9.98893228,-0.0256314947 9.23687481,-0.0256314947 8.62445527,0.32630898' }) ), category: 'amelia-blocks', keywords: [ 'amelia', 'events' ], supports: { customClassName: false, html: false }, attributes: { short_code: { type: 'string', default: '[ameliaevents]' }, trigger: { type: 'string', default: '' }, event: { type: 'string', default: '' }, type: { type: 'string', default: 'list' }, recurring: { type: 'boolean', default: false }, tag: { type: 'string', default: '' }, eventOptions: { type: 'string', default: '' }, parametars: { type: 'boolean', default: false } }, edit: function (props) { var inspectorElements = [] var attributes = props.attributes var options = { events: [{value: '', label: wpAmeliaLabels.show_all_events}], tags: [{value: '', label: wpAmeliaLabels.show_all_tags}], eventOptions: [ {value: 'events', label: wpAmeliaLabels.show_event}, {value: 'tags', label: wpAmeliaLabels.show_tag} ], type: [{value: 'list', label: wpAmeliaLabels.show_event_view_list}] } function getOptions (data) { var options = [] data = Object.keys(data).map(function (key) { return data[key] }) data.sort(function (a, b) { if (parseInt(a.value) < parseInt(b.value)) { return -1 } if (parseInt(a.value) > parseInt(b.value)) { return 1 } return 0 }) data.forEach(function (element) { options.push({value: element.value, label: element.text}) }) return options } getOptions(events) .forEach(function (element) { options['events'].push(element) }) getOptions(tags) .forEach(function (element) { options['tags'].push(element) }) function getShortCode (props, attributes) { var shortCodeString = '', shortCode = '' if (events.length !== 0) { if (attributes.event !== '') { shortCodeString += ' event=' + attributes.event + '' if (attributes.recurring) { shortCodeString += ' recurring=1' } } if (tags.length !== 0) { if (attributes.tag !== '') { shortCodeString += ` tag="${attributes.tag}"` } } shortCode += '[ameliaevents' + shortCodeString if (attributes.trigger) { shortCode += ' trigger=' + attributes.trigger + '' } if (attributes.type) { shortCode += ' type=' + attributes.type + '' } shortCode += ']' } else { shortCode = 'Notice: Please create event first.' } props.setAttributes({short_code: shortCode}) return shortCode } if (events.length !== 0) { inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-parametars'}, wpAmeliaLabels.filter), el(components.FormToggle, { id: 'amelia-js-parametars', checked: attributes.parametars, onChange: function () { return props.setAttributes({parametars: !props.attributes.parametars}) } }) )) inspectorElements.push(el(components.SelectControl, { id: 'am-js-events-type', label: wpAmeliaLabels.show_event_view_type, value: attributes.type, options: options.type, onChange: function (selectControl) { return props.setAttributes({type: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (attributes.parametars) { if (tags.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-tag', label: wpAmeliaLabels.select_tag, value: attributes.tag, options: options.tags, onChange: function (selectControl) { return props.setAttributes({tag: selectControl}) } })) } if (events.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-event', label: wpAmeliaLabels.select_event, value: attributes.event, options: options.events, onChange: function (selectControl) { return props.setAttributes({event: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-today'}, wpAmeliaLabels.recurring_event), el(components.FormToggle, { id: 'amelia-js-recurring', checked: attributes.recurring, onChange: function () { return props.setAttributes({recurring: !props.attributes.recurring}) } }) )) } inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.TextControl, { id: 'amelia-js-trigger', label: wpAmeliaLabels.manually_loading, value: attributes.trigger, help: wpAmeliaLabels.manually_loading_description, onChange: function (TextControl) { return props.setAttributes({trigger: TextControl}) } })) } else { attributes.event = '' attributes.tag = '' } return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {}, getShortCode(props, props.attributes) ) ] } else { inspectorElements.push(el('p', {style: {'margin-bottom': '1em'}}, 'Please create event first. You can find instructions in our documentation on link below.')); inspectorElements.push(el('a', {href: 'https://wpamelia.com/quickstart/', target: '_blank', style: {'margin-bottom': '1em'}}, 'Start working with Amelia WordPress Appointment Booking plugin')); return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {style: blockStyle}, getShortCode(props, props.attributes) ) ] } }, save: function (props) { return ( el('div', {}, props.attributes.short_code ) ) } }) })( window.wp ) amelia-catalog/amelia-catalog-gutenberg.js 0000666 00000034724 15165407706 0014613 0 ustar 00 (function (wp) { var el = wp.element.createElement var components = wp.components var blockControls = wp.editor.BlockControls var inspectorControls = wp.editor.InspectorControls var data = wpAmeliaLabels.data var categories = [] var services = [] var employees = [] var locations = [] var packages = [] var blockStyle = { color: 'red' } if (data.categories.length !== 0) { for (let i = 0; i < data.categories.length; i++) { categories.push({ value: data.categories[i].id, text: data.categories[i].name + ' (id: ' + data.categories[i].id + ')' }) } } else { categories = [] } if (data.servicesList.length !== 0) { // Create array of services objects for (let i = 0; i < data.servicesList.length; i++) { if (data.servicesList[i].length !== 0) { services.push({ value: data.servicesList[i].id, text: data.servicesList[i].name + ' (id: ' + data.servicesList[i].id + ')' }) } } } else { services = [] } if (data.employees.length !== 0) { // Create array of employees objects for (let i = 0; i < data.employees.length; i++) { employees.push({ value: data.employees[i].id, text: data.employees[i].firstName + ' ' + data.employees[i].lastName + ' (id: ' + data.employees[i].id + ')' }) } } else { employees = [] } if (data.locations.length !== 0) { // Create array of locations objects for (let i = 0; i < data.locations.length; i++) { locations.push({ value: data.locations[i].id, text: data.locations[i].name + ' (id: ' + data.locations[i].id + ')' }) } } else { locations = [] } if (data.packages.length !== 0) { // Create array of packages objects for (let i = 0; i < data.packages.length; i++) { packages.push({ value: data.packages[i].id, text: data.packages[i].name + ' (id: ' + data.packages[i].id + ')' }) } } else { packages = [] } // Registering the Block for catalog shortcode wp.blocks.registerBlockType('amelia/catalog-gutenberg-block', { title: wpAmeliaLabels.catalog_gutenberg_block.title, description: wpAmeliaLabels.catalog_gutenberg_block.description, icon: el('svg', {width: '25', height: '27', viewBox: '0 0 25 27'}, el('path', { style: {fill: '#1A84EE'}, d: 'M11.4937358,10.7089033 L11.4937358,2.00347742 C11.4937358,0.463573647 9.83438046,-0.498899048 8.50694847,0.271096622 L0.995613218,4.6279253 C0.379532759,4.98520749 1.74329502e-05,5.64565414 1.74329502e-05,6.36030609 L1.74329502e-05,15.0243117 C1.74329502e-05,16.5606252 1.65222529,17.5235357 2.97965728,16.7608958 L10.4910797,12.4454874 C11.1110826,12.0891685 11.4937358,11.4265326 11.4937358,10.7089033' }), el('path', { style: {fill: '#005AEE'}, d: 'M13.4849535,2.00346866 L13.4849535,10.7088945 C13.4849535,11.4265238 13.8676068,12.0891597 14.4876097,12.4453911 L21.9991193,16.7608871 C23.3265512,17.5235269 24.9787591,16.5606164 24.9787591,15.024303 L24.9787591,6.36029734 C24.9787591,5.64564538 24.5992438,4.98519874 23.9831633,4.62791654 L16.4717409,0.271000296 C15.1443089,-0.498907805 13.4849535,0.46356489 13.4849535,2.00346866' }), el('path', { style: {fill: '#3BA6FF'}, transform: 'translate(2.876437, 13.843371)', d: 'M8.62445527,0.32630898 L1.0701478,4.66641195 C-0.263647222,5.43264214 -0.267569636,7.36354223 1.06300029,8.13537686 L8.61730776,12.5170752 C9.23338822,12.8744449 9.99241887,12.8744449 10.6084993,12.5170752 L18.162894,8.13537686 C19.4934639,7.36354223 19.4895415,5.43264214 18.1557465,4.66641195 L10.601439,0.32630898 C9.98893228,-0.0256314947 9.23687481,-0.0256314947 8.62445527,0.32630898' }) ), category: 'amelia-blocks', keywords: [ 'amelia', 'catalog' ], supports: { customClassName: false, html: false }, attributes: { short_code: { type: 'string', default: '[ameliacatalog]' }, trigger: { type: 'string', default: '' }, show: { type: 'string', default: '' }, location: { type: 'string', default: '' }, package: { type: 'string', default: '' }, category: { type: 'string', default: '' }, categoryOptions: { type: 'string', default: '' }, service: { type: 'string', default: '' }, employee: { type: 'string', default: '' }, parametars: { type: 'boolean', default: false } }, edit: function (props) { var inspectorElements = [], attributes = props.attributes, options = [] options['categoryOptions'] = [ {value: '', label: wpAmeliaLabels.show_catalog}, {value: 'categories', label: wpAmeliaLabels.show_category}, {value: 'services', label: wpAmeliaLabels.show_service} ] if (packages.length) { options['categoryOptions'].push({value: 'packages', label: wpAmeliaLabels.show_package}) } options['categories'] = [] options['services'] = [] options['packages'] = [] options['employees'] = [{value: '', label: wpAmeliaLabels.show_all_employees}] options['locations'] = [{value: '', label: wpAmeliaLabels.show_all_locations}] options['show'] = [{value: '', label: wpAmeliaLabels.show_all}, {value: 'services', label: wpAmeliaLabels.services}, {value: 'packages', label: wpAmeliaLabels.packages}] function getOptions(data) { var options = [] data = Object.keys(data).map(function (key) { return data[key] }) data.sort(function (a, b) { if (parseInt(a.value) < parseInt(b.value)) return -1 if (parseInt(a.value) > parseInt(b.value)) return 1 return 0 }) data.forEach(function (element) { options.push({value: element.value, label: element.text}) }) return options } getOptions(packages) .forEach(function (element) { options['packages'].push(element) }) getOptions(categories) .forEach(function (element) { options['categories'].push(element) }) getOptions(services) .forEach(function (element) { options['services'].push(element) }) getOptions(employees) .forEach(function (element) { options['employees'].push(element) }) if (locations.length) { getOptions(locations) .forEach(function (element) { options['locations'].push(element) }) } function getShortCode(props, attributes) { var short_code_string = '', shortCode = '' if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { if (attributes.employee !== '') { short_code_string += ' employee=' + attributes.employee + '' } if (attributes.location !== '') { short_code_string += ' location=' + attributes.location + '' } if (attributes.categoryOptions === 'categories') { shortCode += '[ameliacatalog category=' + attributes.category + short_code_string } else if (attributes.categoryOptions === 'services') { shortCode += '[ameliacatalog service=' + attributes.service + short_code_string } else if (attributes.categoryOptions === 'packages') { shortCode += '[ameliacatalog package=' + attributes.package + short_code_string } else { shortCode += '[ameliacatalog' + short_code_string } if (attributes.show && attributes.categoryOptions !== 'packages' && attributes.categoryOptions !== 'services') { shortCode += ' show=' + attributes.show + '' } if (attributes.trigger) { shortCode += ' trigger=' + attributes.trigger + '' } shortCode += ']' } else { shortCode = "Notice: Please create category, service and employee first." } props.setAttributes({short_code: shortCode}) return shortCode } if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-category', label: wpAmeliaLabels.select_catalog_view, value: attributes.categoryOptions, options: options.categoryOptions, onChange: function (selectControl) { return props.setAttributes({categoryOptions: selectControl}) } })) if (attributes.categoryOptions === 'categories') { if (attributes.category === '' || attributes.category === options.services[0].value) { attributes.category = options.categories[0].value } attributes.service = "" attributes.package = "" inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-category', value: attributes.category, options: options.categories, onChange: function (selectControl) { return props.setAttributes({category: selectControl}) } })) } else if (attributes.categoryOptions === 'services') { if (attributes.service === '' || attributes.service === options.services[0].value) { attributes.service = options.services[0].value } attributes.category = '' attributes.package = '' inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-service', value: attributes.service, options: options.services, onChange: function (selectControl) { return props.setAttributes({service: selectControl}) } })) } else if (attributes.categoryOptions === 'packages') { if (attributes.package === '' || attributes.package === options.packages[0].value) { attributes.package = options.packages[0].value } attributes.category = '' attributes.service = '' inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-package', value: attributes.package, options: options.packages, onChange: function (selectControl) { return props.setAttributes({package: selectControl}) } })) } inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-parametars'}, wpAmeliaLabels.filter), el(components.FormToggle, { id: 'amelia-js-parametars', checked: attributes.parametars, onChange: function () { return props.setAttributes({parametars: !props.attributes.parametars}) }, }) )) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (attributes.parametars) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-employee', label: wpAmeliaLabels.select_employee, value: attributes.employee, options: options.employees, onChange: function (selectControl) { return props.setAttributes({employee: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (locations.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-location', label: wpAmeliaLabels.select_location, value: attributes.location, options: options.locations, onChange: function (selectControl) { return props.setAttributes({location: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) } inspectorElements.push(el(components.TextControl, { id: 'amelia-js-trigger', label: wpAmeliaLabels.manually_loading, value: attributes.trigger, help: wpAmeliaLabels.manually_loading_description, onChange: function (TextControl) { return props.setAttributes({trigger: TextControl}) } })) if (options.packages.length && attributes.categoryOptions !== 'packages' && attributes.categoryOptions !== 'services' ) { inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-type', label: wpAmeliaLabels.show_all, value: attributes.show, options: options.show, onChange: function (selectControl) { return props.setAttributes({show: selectControl}) } })) } } else { attributes.employee = '' attributes.location = '' } return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {}, getShortCode(props, props.attributes) ) ] } else { inspectorElements.push(el('p', {style: {'margin-bottom': '1em'}}, 'Please create category, services and employee first. You can find instructions in our documentation on link below.')); inspectorElements.push(el('a', {href:'https://wpamelia.com/quickstart/', target:'_blank', style: {'margin-bottom': '1em'}}, 'Start working with Amelia WordPress Appointment Booking plugin')); return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {style: blockStyle}, getShortCode(props, props.attributes) ) ] } }, save: function (props) { return ( el('div', {}, props.attributes.short_code ) ) } }) })( window.wp ) amelia-step-booking/amelia-gutenberg-styles.css 0000666 00000001224 15165407706 0015654 0 ustar 00 /*.components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-step-booking-gutenberg-block .block-editor-block-icon{ width: 44px !important; } .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-step-booking-gutenberg-block svg{ max-width: 44px !important; } .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-step-booking-gutenberg-block .block-editor-block-types-list__item-icon { padding-right: 5px; } .block-editor-block-card span { position: relative } .amelia-step-booking-gutenberg { position: absolute; max-width: 44px !important; }*/ amelia-step-booking/amelia-step-booking-gutenberg.js 0000666 00000033200 15165407706 0016555 0 ustar 00 (function (wp) { var el = wp.element.createElement var components = wp.components var blockControls = wp.editor.BlockControls var inspectorControls = wp.editor.InspectorControls var data = wpAmeliaLabels.data var categories = [] var services = [] var employees = [] var locations = [] var packages = [] var blockStyle = { color: 'red' } if (data.categories.length !== 0) { for (let i = 0; i < data.categories.length; i++) { categories.push({ value: data.categories[i].id, text: data.categories[i].name + ' (id: ' + data.categories[i].id + ')' }) } } else { categories = [] } if (data.servicesList.length !== 0) { // Create array of services objects for (let i = 0; i < data.servicesList.length; i++) { if (data.servicesList[i].length !== 0) { services.push({ value: data.servicesList[i].id, text: data.servicesList[i].name + ' (id: ' + data.servicesList[i].id + ')' }) } } } else { services = [] } if (data.employees.length !== 0) { // Create array of employees objects for (let i = 0; i < data.employees.length; i++) { employees.push({ value: data.employees[i].id, text: data.employees[i].firstName + ' ' + data.employees[i].lastName + ' (id: ' + data.employees[i].id + ')' }) } } else { employees = [] } if (data.locations.length !== 0) { // Create array of locations objects for (let i = 0; i < data.locations.length; i++) { locations.push({ value: data.locations[i].id, text: data.locations[i].name + ' (id: ' + data.locations[i].id + ')' }) } } else { locations = [] } if (data.packages.length !== 0) { // Create array of packages objects for (let i = 0; i < data.packages.length; i++) { packages.push({ value: data.packages[i].id, text: data.packages[i].name + ' (id: ' + data.packages[i].id + ')' }) } } else { packages = [] } // Registering the Block for booking shotcode wp.blocks.registerBlockType('amelia/step-booking-gutenberg-block', { title: wpAmeliaLabels.step_booking_gutenberg_block.title, description: wpAmeliaLabels.step_booking_gutenberg_block.description, icon: el('svg', {width: '25', height: '27', viewBox: '0 0 25 27'}, el('path', { style: {fill: '#1A84EE'}, d: 'M11.4937358,10.7089033 L11.4937358,2.00347742 C11.4937358,0.463573647 9.83438046,-0.498899048 8.50694847,0.271096622 L0.995613218,4.6279253 C0.379532759,4.98520749 1.74329502e-05,5.64565414 1.74329502e-05,6.36030609 L1.74329502e-05,15.0243117 C1.74329502e-05,16.5606252 1.65222529,17.5235357 2.97965728,16.7608958 L10.4910797,12.4454874 C11.1110826,12.0891685 11.4937358,11.4265326 11.4937358,10.7089033' }), el('path', { style: {fill: '#005AEE'}, d: 'M13.4849535,2.00346866 L13.4849535,10.7088945 C13.4849535,11.4265238 13.8676068,12.0891597 14.4876097,12.4453911 L21.9991193,16.7608871 C23.3265512,17.5235269 24.9787591,16.5606164 24.9787591,15.024303 L24.9787591,6.36029734 C24.9787591,5.64564538 24.5992438,4.98519874 23.9831633,4.62791654 L16.4717409,0.271000296 C15.1443089,-0.498907805 13.4849535,0.46356489 13.4849535,2.00346866' }), el('path', { style: {fill: '#3BA6FF'}, transform: 'translate(2.876437, 13.843371)', d: 'M8.62445527,0.32630898 L1.0701478,4.66641195 C-0.263647222,5.43264214 -0.267569636,7.36354223 1.06300029,8.13537686 L8.61730776,12.5170752 C9.23338822,12.8744449 9.99241887,12.8744449 10.6084993,12.5170752 L18.162894,8.13537686 C19.4934639,7.36354223 19.4895415,5.43264214 18.1557465,4.66641195 L10.601439,0.32630898 C9.98893228,-0.0256314947 9.23687481,-0.0256314947 8.62445527,0.32630898' }) ), category: 'amelia-blocks', keywords: [ 'amelia', 'booking' ], supports: { customClassName: false, html: false }, attributes: { short_code: { type: 'string', default: '[ameliastepbooking]' }, trigger: { type: 'string', default: '' }, trigger_type: { type: 'string', default: 'id' }, show: { type: 'string', default: '' }, location: { type: 'string', default: '' }, package: { type: 'string', default: '' }, category: { type: 'string', default: '' }, service: { type: 'string', default: '' }, employee: { type: 'string', default: '' }, parametars: { type: 'boolean', default: false } }, edit: function (props) { var inspectorElements = [] var attributes = props.attributes var options = [] options['categories'] = [{value: '', label: wpAmeliaLabels.show_all_categories}] options['services'] = [{value: '', label: wpAmeliaLabels.show_all_services}] options['employees'] = [{value: '', label: wpAmeliaLabels.show_all_employees}] options['locations'] = [{value: '', label: wpAmeliaLabels.show_all_locations}] options['packages'] = [{value: '', label: wpAmeliaLabels.show_all_packages}] options['show'] = [{value: '', label: wpAmeliaLabels.show_all}, {value: 'services', label: wpAmeliaLabels.services}, {value: 'packages', label: wpAmeliaLabels.packages}] options['trigger_type'] = [{value: 'id', label: wpAmeliaLabels.trigger_type_id}, {value: 'class', label: wpAmeliaLabels.trigger_type_class}] function getOptions(data) { var options = [] data = Object.keys(data).map(function (key) { return data[key] }) data.sort(function (a, b) { if (parseInt(a.pos) < parseInt(b.pos)) return -1 if (parseInt(a.pos) > parseInt(b.pos)) return 1 return 0 }) data.forEach(function (element) { options.push({value: element.value, label: element.text}) }) return options } getOptions(categories) .forEach(function (element) { options['categories'].push(element) }) getOptions(services) .forEach(function (element) { options['services'].push(element) }) getOptions(employees) .forEach(function (element) { options['employees'].push(element) }) if (locations.length) { getOptions(locations) .forEach(function (element) { options['locations'].push(element) }) } if (packages.length) { getOptions(packages) .forEach(function (element) { options['packages'].push(element) }) } function getShortCode(props, attributes) { var shortCode = '' if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { if (attributes.parametars) { shortCode = '[ameliastepbooking' if (attributes.show) { shortCode += ' show=' + attributes.show + '' } if (attributes.service) { shortCode += ' service=' + attributes.service + '' } else if (attributes.category) { shortCode += ' category=' + attributes.category + '' } if (attributes.employee) { shortCode += ' employee=' + attributes.employee + '' } if (attributes.location) { shortCode += ' location=' + attributes.location + '' } if (attributes.package) { shortCode += ' package=' + attributes.package + '' } } else { shortCode = '[ameliastepbooking' } if (attributes.trigger) { shortCode += ' trigger=' + attributes.trigger + '' } if (attributes.trigger && attributes.trigger_type) { shortCode += ' trigger_type=' + attributes.trigger_type + '' } shortCode += ']' } else { shortCode = "Notice: Please create category, service and employee first." } props.setAttributes({short_code: shortCode}) return shortCode } if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-parametars'}, wpAmeliaLabels.filter), el(components.FormToggle, { id: 'amelia-js-parametars', checked: attributes.parametars, onChange: function () { return props.setAttributes({parametars: !props.attributes.parametars}) }, }) )) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (attributes.parametars) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-category', label: wpAmeliaLabels.select_category, value: attributes.category, options: options.categories, onChange: function (selectControl) { return props.setAttributes({category: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-service', label: wpAmeliaLabels.select_service, value: attributes.service, options: options.services, onChange: function (selectControl) { return props.setAttributes({service: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-employee', label: wpAmeliaLabels.select_employee, value: attributes.employee, options: options.employees, onChange: function (selectControl) { return props.setAttributes({employee: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-location', label: wpAmeliaLabels.select_location, value: attributes.location, options: options.locations, onChange: function (selectControl) { return props.setAttributes({location: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (packages.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-package', label: wpAmeliaLabels.select_package, value: attributes.package, options: options.packages, onChange: function (selectControl) { return props.setAttributes({package: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) } if (packages.length) { inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-type', label: wpAmeliaLabels.show_all, value: attributes.show, options: options.show, onChange: function (selectControl) { return props.setAttributes({show: selectControl}) } })) } } inspectorElements.push(el(components.TextControl, { id: 'amelia-js-trigger', label: wpAmeliaLabels.manually_loading, value: attributes.trigger, help: wpAmeliaLabels.manually_loading_description, onChange: function (TextControl) { return props.setAttributes({trigger: TextControl}) } })) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-trigger_type', label: wpAmeliaLabels.trigger_type, value: attributes.trigger_type, options: options.trigger_type, help: wpAmeliaLabels.trigger_type_tooltip, onChange: function (selectControl) { return props.setAttributes({trigger_type: selectControl}) } })) return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {}, getShortCode(props, props.attributes) ) ] } else { inspectorElements.push(el('p', {style: {'margin-bottom': '1em'}}, 'Please create category, services and employee first. You can find instructions in our documentation on link below.')); inspectorElements.push(el('a', {href:'https://wpamelia.com/quickstart/', target:'_blank', style: {'margin-bottom': '1em'}}, 'Start working with Amelia WordPress Appointment Booking plugin')); return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {style: blockStyle}, getShortCode(props, props.attributes) ) ] } }, save: function (props) { return ( el('div', {}, props.attributes.short_code ) ) } }) })( window.wp ) amelia-catalog-booking/amelia-catalog-booking-gutenberg.css 0000666 00000001234 15165407706 0020031 0 ustar 00 .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-catalog-booking-gutenberg-block .block-editor-block-icon{ width: 44px !important; } .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-catalog-booking-gutenberg-block svg{ max-width: 44px !important; } .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-catalog-booking-gutenberg-block .block-editor-block-types-list__item-icon { padding-right: 5px; } .block-editor-block-card span { position: relative } .amelia-catalog-booking-gutenberg { position: absolute; max-width: 44px !important; } amelia-catalog-booking/amelia-catalog-booking-gutenberg.js 0000666 00000041146 15165407706 0017663 0 ustar 00 (function (wp) { var el = wp.element.createElement var components = wp.components var blockControls = wp.editor.BlockControls var inspectorControls = wp.editor.InspectorControls var data = wpAmeliaLabels.data var categories = [] var services = [] var employees = [] var locations = [] var packages = [] var blockStyle = { color: 'red' } if (data.categories.length !== 0) { for (let i = 0; i < data.categories.length; i++) { categories.push({ value: data.categories[i].id, text: data.categories[i].name + ' (id: ' + data.categories[i].id + ')' }) } } else { categories = [] } if (data.servicesList.length !== 0) { // Create array of services objects for (let i = 0; i < data.servicesList.length; i++) { if (data.servicesList[i].length !== 0) { services.push({ value: data.servicesList[i].id, text: data.servicesList[i].name + ' (id: ' + data.servicesList[i].id + ')' }) } } } else { services = [] } if (data.employees.length !== 0) { // Create array of employees objects for (let i = 0; i < data.employees.length; i++) { employees.push({ value: data.employees[i].id, text: data.employees[i].firstName + ' ' + data.employees[i].lastName + ' (id: ' + data.employees[i].id + ')' }) } } else { employees = [] } if (data.locations.length !== 0) { // Create array of locations objects for (let i = 0; i < data.locations.length; i++) { locations.push({ value: data.locations[i].id, text: data.locations[i].name + ' (id: ' + data.locations[i].id + ')' }) } } else { locations = [] } if (data.packages.length !== 0) { // Create array of packages objects for (let i = 0; i < data.packages.length; i++) { packages.push({ value: data.packages[i].id, text: data.packages[i].name + ' (id: ' + data.packages[i].id + ')' }) } } else { packages = [] } // Registering the Block for booking shotcode wp.blocks.registerBlockType('amelia/catalog-booking-gutenberg-block', { title: wpAmeliaLabels.catalog_booking_gutenberg_block.title, description: wpAmeliaLabels.catalog_booking_gutenberg_block.description, icon: el('svg', {width: '44', height: '27', viewBox: '0 0 44 27', class: 'amelia-catalog-booking-gutenberg'}, el('path', { style: {fill: '#1A84EE'}, d: 'M11.5035 10.8582V2.03134C11.5035 0.469951 9.84276 -0.505952 8.5142 0.274788L0.996474 4.69241C0.379869 5.05468 3.05176e-05 5.72434 3.05176e-05 6.44897V15.2339C3.05176e-05 16.7916 1.65364 17.768 2.98221 16.9947L10.5 12.6191C11.1206 12.2578 11.5035 11.5859 11.5035 10.8582Z' }), el('path', { style: {fill: '#005AEE'}, d: 'M13.4964 2.03138V10.8583C13.4964 11.5859 13.8794 12.2578 14.4999 12.619L22.0178 16.9947C23.3464 17.768 25 16.7917 25 15.2339V6.449C25 5.72438 24.6202 5.05472 24.0036 4.69245L16.4858 0.274738C15.1572 -0.505914 13.4964 0.46999 13.4964 2.03138Z' }), el('path', { style: {fill: '#3BA6FF'}, d: 'M11.5107 14.3675L3.94995 18.7682C2.61502 19.5451 2.61109 21.5029 3.9428 22.2855L11.5035 26.7284C12.1201 27.0907 12.8798 27.0907 13.4964 26.7284L21.0572 22.2855C22.3889 21.5029 22.385 19.5451 21.0501 18.7682L13.4894 14.3675C12.8763 14.0106 12.1236 14.0106 11.5107 14.3675Z' }), el('rect', { style: {fill: '#E6EFFD'}, x: '18', width: '26', height: '12', rx: '6' }), el('path', { style: {fill: '#005AEE'}, d: 'M21.6392 9V3.18182H23.7699C24.1828 3.18182 24.5246 3.25 24.7955 3.38636C25.0663 3.52083 25.2689 3.7036 25.4034 3.93466C25.5379 4.16383 25.6051 4.42235 25.6051 4.71023C25.6051 4.95265 25.5606 5.1572 25.4716 5.32386C25.3826 5.48864 25.2633 5.62121 25.1136 5.72159C24.9659 5.82008 24.803 5.89205 24.625 5.9375V5.99432C24.8182 6.00379 25.0066 6.06629 25.1903 6.18182C25.3759 6.29545 25.5294 6.45739 25.6506 6.66761C25.7718 6.87784 25.8324 7.13352 25.8324 7.43466C25.8324 7.73201 25.7623 7.99905 25.6222 8.2358C25.4839 8.47064 25.2699 8.6572 24.9801 8.79545C24.6903 8.93182 24.3201 9 23.8693 9H21.6392ZM22.517 8.24716H23.7841C24.2045 8.24716 24.5057 8.16572 24.6875 8.00284C24.8693 7.83996 24.9602 7.63636 24.9602 7.39205C24.9602 7.20833 24.9138 7.03977 24.821 6.88636C24.7282 6.73295 24.5956 6.6108 24.4233 6.51989C24.2528 6.42898 24.0502 6.38352 23.8153 6.38352H22.517V8.24716ZM22.517 5.69886H23.6932C23.8902 5.69886 24.0672 5.66098 24.2244 5.58523C24.3835 5.50947 24.5095 5.40341 24.6023 5.26705C24.697 5.12879 24.7443 4.96591 24.7443 4.77841C24.7443 4.53788 24.66 4.33617 24.4915 4.1733C24.3229 4.01042 24.0644 3.92898 23.7159 3.92898H22.517V5.69886ZM26.8736 9V3.18182H30.5213V3.9375H27.7514V5.71023H30.331V6.46307H27.7514V8.24432H30.5554V9H26.8736ZM31.407 3.9375V3.18182H35.9098V3.9375H34.0945V9H33.2195V3.9375H31.407ZM36.7088 9H35.777L37.8707 3.18182H38.8849L40.9787 9H40.0469L38.402 4.23864H38.3565L36.7088 9ZM36.8651 6.72159H39.8878V7.46023H36.8651V6.72159Z' }) ), category: 'amelia-blocks', keywords: [ 'amelia', 'catalog' ], supports: { customClassName: false, html: false }, attributes: { short_code: { type: 'string', default: '[ameliacatalogbooking]' }, trigger: { type: 'string', default: '' }, trigger_type: { type: 'string', default: 'id' }, show: { type: 'string', default: '' }, location: { type: 'string', default: '' }, package: { type: 'string', default: '' }, category: { type: 'string', default: '' }, categoryOptions: { type: 'string', default: '' }, service: { type: 'string', default: '' }, employee: { type: 'string', default: '' }, parametars: { type: 'boolean', default: false } }, edit: function (props) { var inspectorElements = [] var attributes = props.attributes var options = [] options['categoryOptions'] = [ {value: '', label: wpAmeliaLabels.show_catalog}, {value: 'categories', label: wpAmeliaLabels.show_category}, {value: 'services', label: wpAmeliaLabels.show_service} ] if (packages.length) { options['categoryOptions'].push({value: 'packages', label: wpAmeliaLabels.show_package}) } options['categories'] = [] options['services'] = [] options['packages'] = [] options['employees'] = [{value: '', label: wpAmeliaLabels.show_all_employees}] options['locations'] = [{value: '', label: wpAmeliaLabels.show_all_locations}] options['show'] = [{value: '', label: wpAmeliaLabels.show_all}, {value: 'services', label: wpAmeliaLabels.services}, {value: 'packages', label: wpAmeliaLabels.packages}] options['trigger_type'] = [{value: 'id', label: wpAmeliaLabels.trigger_type_id}, {value: 'class', label: wpAmeliaLabels.trigger_type_class}] function getOptions (data) { var options = [] data = Object.keys(data).map(function (key) { return data[key] }) data.sort(function (a, b) { if (parseInt(a.value) < parseInt(b.value)) return -1 if (parseInt(a.value) > parseInt(b.value)) return 1 return 0 }) data.forEach(function (element) { options.push({value: element.value, label: element.text}) }) return options } getOptions(packages) .forEach(function (element) { options['packages'].push(element) }) getOptions(categories) .forEach(function (element) { options['categories'].push(element) }) getOptions(services) .forEach(function (element) { options['services'].push(element) }) getOptions(employees) .forEach(function (element) { options['employees'].push(element) }) if (locations.length) { getOptions(locations) .forEach(function (element) { options['locations'].push(element) }) } function getShortCode (props, attributes) { let shortCodeString = '' let shortCode = '' if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { if (attributes.employee !== '') { shortCodeString += ' employee=' + attributes.employee + '' } if (attributes.location !== '') { shortCodeString += ' location=' + attributes.location + '' } if (attributes.categoryOptions === 'categories') { if (attributes.show) { shortCodeString += ' show=' + attributes.show } shortCode += '[ameliacatalogbooking category=' + attributes.category + shortCodeString } else if (attributes.categoryOptions === 'services') { if (attributes.show && attributes.show !== 'packages') { shortCodeString += ' show=' + attributes.show } shortCode += '[ameliacatalogbooking service=' + attributes.service + shortCodeString } else if (attributes.categoryOptions === 'packages') { shortCode += '[ameliacatalogbooking package=' + attributes.package + shortCodeString } else { if (attributes.show) { shortCodeString += ' show=' + attributes.show } shortCode += '[ameliacatalogbooking' + shortCodeString } if (attributes.trigger) { shortCode += ' trigger=' + attributes.trigger + '' } if (attributes.trigger && attributes.trigger_type) { shortCode += ' trigger_type=' + attributes.trigger_type + '' } shortCode += ']' } else { shortCode = 'Notice: Please create category, service and employee first.' } props.setAttributes({short_code: shortCode}) return shortCode } if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-category', label: wpAmeliaLabels.select_catalog_view, value: attributes.categoryOptions, options: options.categoryOptions, onChange: function (selectControl) { return props.setAttributes({categoryOptions: selectControl}) } })) if (attributes.categoryOptions === 'categories') { if (attributes.category === '' || attributes.category === options.services[0].value) { attributes.category = options.categories[0].value } attributes.service = '' attributes.package = '' inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-category', value: attributes.category, options: options.categories, onChange: function (selectControl) { return props.setAttributes({category: selectControl}) } })) } else if (attributes.categoryOptions === 'services') { if (attributes.service === '' || attributes.service === options.services[0].value) { attributes.service = options.services[0].value } attributes.category = '' attributes.package = '' inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-service', value: attributes.service, options: options.services, onChange: function (selectControl) { return props.setAttributes({service: selectControl}) } })) } else if (attributes.categoryOptions === 'packages') { if (attributes.package === '' || attributes.package === options.packages[0].value) { attributes.package = options.packages[0].value } attributes.category = '' attributes.service = '' inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-package', value: attributes.package, options: options.packages, onChange: function (selectControl) { return props.setAttributes({package: selectControl}) } })) } inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-parametars'}, wpAmeliaLabels.filter), el(components.FormToggle, { id: 'amelia-js-parametars', checked: attributes.parametars, onChange: function () { return props.setAttributes({parametars: !props.attributes.parametars}) } }) )) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (attributes.parametars) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-employee', label: wpAmeliaLabels.select_employee, value: attributes.employee, options: options.employees, onChange: function (selectControl) { return props.setAttributes({employee: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (locations.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-location', label: wpAmeliaLabels.select_location, value: attributes.location, options: options.locations, onChange: function (selectControl) { return props.setAttributes({location: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) } if (options.packages.length && attributes.categoryOptions !== 'packages') { inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-type', label: wpAmeliaLabels.show_all, value: attributes.show, options: options.show, onChange: function (selectControl) { return props.setAttributes({show: selectControl}) } })) } } else { attributes.employee = '' attributes.location = '' } inspectorElements.push(el(components.TextControl, { id: 'amelia-js-trigger', label: wpAmeliaLabels.manually_loading, value: attributes.trigger, help: wpAmeliaLabels.manually_loading_description, onChange: function (TextControl) { return props.setAttributes({trigger: TextControl}) } })) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-trigger_type', label: wpAmeliaLabels.trigger_type, value: attributes.trigger_type, options: options.trigger_type, help: wpAmeliaLabels.trigger_type_tooltip, onChange: function (selectControl) { return props.setAttributes({trigger_type: selectControl}) } })) return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {}, getShortCode(props, props.attributes) ) ] } else { inspectorElements.push(el('p', {style: {'margin-bottom': '1em'}}, 'Please create category, services and employee first. You can find instructions in our documentation on link below.')) inspectorElements.push(el('a', {href: 'https://wpamelia.com/quickstart/', target: '_blank', style: {'margin-bottom': '1em'}}, 'Start working with Amelia WordPress Appointment Booking plugin')) return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {style: blockStyle}, getShortCode(props, props.attributes) ) ] } }, save: function (props) { return ( el('div', {}, props.attributes.short_code ) ) } }) })( window.wp ) amelia-booking/amelia-booking-gutenberg.js 0000666 00000027612 15165407706 0014645 0 ustar 00 (function (wp) { var el = wp.element.createElement var components = wp.components var blockControls = wp.editor.BlockControls var inspectorControls = wp.editor.InspectorControls var data = wpAmeliaLabels.data var categories = [] var services = [] var employees = [] var locations = [] var packages = [] var blockStyle = { color: 'red' } if (data.categories.length !== 0) { for (let i = 0; i < data.categories.length; i++) { categories.push({ value: data.categories[i].id, text: data.categories[i].name + ' (id: ' + data.categories[i].id + ')' }) } } else { categories = [] } if (data.servicesList.length !== 0) { // Create array of services objects for (let i = 0; i < data.servicesList.length; i++) { if (data.servicesList[i].length !== 0) { services.push({ value: data.servicesList[i].id, text: data.servicesList[i].name + ' (id: ' + data.servicesList[i].id + ')' }) } } } else { services = [] } if (data.employees.length !== 0) { // Create array of employees objects for (let i = 0; i < data.employees.length; i++) { employees.push({ value: data.employees[i].id, text: data.employees[i].firstName + ' ' + data.employees[i].lastName + ' (id: ' + data.employees[i].id + ')' }) } } else { employees = [] } if (data.locations.length !== 0) { // Create array of locations objects for (let i = 0; i < data.locations.length; i++) { locations.push({ value: data.locations[i].id, text: data.locations[i].name + ' (id: ' + data.locations[i].id + ')' }) } } else { locations = [] } if (data.packages.length !== 0) { // Create array of packages objects for (let i = 0; i < data.packages.length; i++) { packages.push({ value: data.packages[i].id, text: data.packages[i].name + ' (id: ' + data.packages[i].id + ')' }) } } else { packages = [] } // Registering the Block for booking shotcode wp.blocks.registerBlockType('amelia/booking-gutenberg-block', { title: wpAmeliaLabels.booking_gutenberg_block.title, description: wpAmeliaLabels.booking_gutenberg_block.description, icon: el('svg', {width: '25', height: '27', viewBox: '0 0 25 27'}, el('path', { style: {fill: '#1A84EE'}, d: 'M11.4937358,10.7089033 L11.4937358,2.00347742 C11.4937358,0.463573647 9.83438046,-0.498899048 8.50694847,0.271096622 L0.995613218,4.6279253 C0.379532759,4.98520749 1.74329502e-05,5.64565414 1.74329502e-05,6.36030609 L1.74329502e-05,15.0243117 C1.74329502e-05,16.5606252 1.65222529,17.5235357 2.97965728,16.7608958 L10.4910797,12.4454874 C11.1110826,12.0891685 11.4937358,11.4265326 11.4937358,10.7089033' }), el('path', { style: {fill: '#005AEE'}, d: 'M13.4849535,2.00346866 L13.4849535,10.7088945 C13.4849535,11.4265238 13.8676068,12.0891597 14.4876097,12.4453911 L21.9991193,16.7608871 C23.3265512,17.5235269 24.9787591,16.5606164 24.9787591,15.024303 L24.9787591,6.36029734 C24.9787591,5.64564538 24.5992438,4.98519874 23.9831633,4.62791654 L16.4717409,0.271000296 C15.1443089,-0.498907805 13.4849535,0.46356489 13.4849535,2.00346866' }), el('path', { style: {fill: '#3BA6FF'}, transform: 'translate(2.876437, 13.843371)', d: 'M8.62445527,0.32630898 L1.0701478,4.66641195 C-0.263647222,5.43264214 -0.267569636,7.36354223 1.06300029,8.13537686 L8.61730776,12.5170752 C9.23338822,12.8744449 9.99241887,12.8744449 10.6084993,12.5170752 L18.162894,8.13537686 C19.4934639,7.36354223 19.4895415,5.43264214 18.1557465,4.66641195 L10.601439,0.32630898 C9.98893228,-0.0256314947 9.23687481,-0.0256314947 8.62445527,0.32630898' }) ), category: 'amelia-blocks', keywords: [ 'amelia', 'booking' ], supports: { customClassName: false, html: false }, attributes: { short_code: { type: 'string', default: '[ameliabooking]' }, trigger: { type: 'string', default: '' }, show: { type: 'string', default: '' }, location: { type: 'string', default: '' }, category: { type: 'string', default: '' }, service: { type: 'string', default: '' }, employee: { type: 'string', default: '' }, parametars: { type: 'boolean', default: false } }, edit: function (props) { var inspectorElements = [] var attributes = props.attributes var options = [] options['categories'] = [{value: '', label: wpAmeliaLabels.show_all_categories}] options['services'] = [{value: '', label: wpAmeliaLabels.show_all_services}] options['employees'] = [{value: '', label: wpAmeliaLabels.show_all_employees}] options['locations'] = [{value: '', label: wpAmeliaLabels.show_all_locations}] options['show'] = [{value: '', label: wpAmeliaLabels.show_all}, {value: 'services', label: wpAmeliaLabels.services}, {value: 'packages', label: wpAmeliaLabels.packages}] function getOptions(data) { var options = [] data = Object.keys(data).map(function (key) { return data[key] }) data.sort(function (a, b) { if (parseInt(a.pos) < parseInt(b.pos)) return -1 if (parseInt(a.pos) > parseInt(b.pos)) return 1 return 0 }) data.forEach(function (element) { options.push({value: element.value, label: element.text}) }) return options } getOptions(categories) .forEach(function (element) { options['categories'].push(element) }) getOptions(services) .forEach(function (element) { options['services'].push(element) }) getOptions(employees) .forEach(function (element) { options['employees'].push(element) }) if (locations.length) { getOptions(locations) .forEach(function (element) { options['locations'].push(element) }) } function getShortCode(props, attributes) { var shortCode = '' if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { if (attributes.parametars) { shortCode = '[ameliabooking' if (attributes.show) { shortCode += ' show=' + attributes.show + '' } if (attributes.trigger) { shortCode += ' trigger=' + attributes.trigger + '' } if (attributes.service) { shortCode += ' service=' + attributes.service + '' } else if (attributes.category) { shortCode += ' category=' + attributes.category + '' } if (attributes.employee) { shortCode += ' employee=' + attributes.employee + '' } else if (attributes.location) { shortCode += ' location=' + attributes.location + '' } shortCode += ']' } else { shortCode = '[ameliabooking]' } } else { shortCode = "Notice: Please create category, service and employee first." } props.setAttributes({short_code: shortCode}) return shortCode } if (categories.length !== 0 && services.length !== 0 && employees.length !== 0) { inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-parametars'}, wpAmeliaLabels.filter), el(components.FormToggle, { id: 'amelia-js-parametars', checked: attributes.parametars, onChange: function () { return props.setAttributes({parametars: !props.attributes.parametars}) }, }) )) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (attributes.parametars) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-category', label: wpAmeliaLabels.select_category, value: attributes.category, options: options.categories, onChange: function (selectControl) { return props.setAttributes({category: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-service', label: wpAmeliaLabels.select_service, value: attributes.service, options: options.services, onChange: function (selectControl) { return props.setAttributes({service: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-employee', label: wpAmeliaLabels.select_employee, value: attributes.employee, options: options.employees, onChange: function (selectControl) { return props.setAttributes({employee: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-location', label: wpAmeliaLabels.select_location, value: attributes.location, options: options.locations, onChange: function (selectControl) { return props.setAttributes({location: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.TextControl, { id: 'amelia-js-trigger', label: wpAmeliaLabels.manually_loading, value: attributes.trigger, help: wpAmeliaLabels.manually_loading_description, onChange: function (TextControl) { return props.setAttributes({trigger: TextControl}) } })) if (packages.length) { inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-type', label: wpAmeliaLabels.show_all, value: attributes.show, options: options.show, onChange: function (selectControl) { return props.setAttributes({show: selectControl}) } })) } } return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {}, getShortCode(props, props.attributes) ) ] } else { inspectorElements.push(el('p', {style: {'margin-bottom': '1em'}}, 'Please create category, services and employee first. You can find instructions in our documentation on link below.')); inspectorElements.push(el('a', {href:'https://wpamelia.com/quickstart/', target:'_blank', style: {'margin-bottom': '1em'}}, 'Start working with Amelia WordPress Appointment Booking plugin')); return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {style: blockStyle}, getShortCode(props, props.attributes) ) ] } }, save: function (props) { return ( el('div', {}, props.attributes.short_code ) ) } }) })( window.wp ) amelia-events-list-booking/amelia-events-list-booking-gutenberg.js 0000666 00000024606 15165407706 0021373 0 ustar 00 (function (wp) { var wpAmeliaLabels = 'wpAmeliaLabels' in window ? window.wpAmeliaLabels : {data: {}} var el = wp.element.createElement var components = wp.components var blockControls = wp.editor.BlockControls var inspectorControls = wp.editor.InspectorControls var data = wpAmeliaLabels.data var events = [] var tags = [] var blockStyle = { color: 'red' } if (data.events.length !== 0) { for (let i = 0; i < data.events.length; i++) { events.push({ value: data.events[i].id, text: data.events[i].name + ' (id: ' + data.events[i].id + ') - ' + data.events[i].formattedPeriodStart }) } } else { events = [] } if (data.tags.length !== 0) { for (let i = 0; i < data.tags.length; i++) { tags.push({ value: data.tags[i].name, text: data.tags[i].name }) } } else { tags = [] } // Registering the Block for events shortcode wp.blocks.registerBlockType('amelia/events-list-booking-gutenberg-block', { title: wpAmeliaLabels.events_list_booking_gutenberg_block.title, description: wpAmeliaLabels.events_list_booking_gutenberg_block.description, icon: el('svg', {width: '44', height: '27', viewBox: '0 0 44 27', class: 'amelia-events-list-booking-gutenberg'}, el('path', { style: {fill: '#1A84EE'}, d: 'M11.5035 10.8582V2.03134C11.5035 0.469951 9.84276 -0.505952 8.5142 0.274788L0.996474 4.69241C0.379869 5.05468 3.05176e-05 5.72434 3.05176e-05 6.44897V15.2339C3.05176e-05 16.7916 1.65364 17.768 2.98221 16.9947L10.5 12.6191C11.1206 12.2578 11.5035 11.5859 11.5035 10.8582Z' }), el('path', { style: {fill: '#005AEE'}, d: 'M13.4964 2.03138V10.8583C13.4964 11.5859 13.8794 12.2578 14.4999 12.619L22.0178 16.9947C23.3464 17.768 25 16.7917 25 15.2339V6.449C25 5.72438 24.6202 5.05472 24.0036 4.69245L16.4858 0.274738C15.1572 -0.505914 13.4964 0.46999 13.4964 2.03138Z' }), el('path', { style: {fill: '#3BA6FF'}, d: 'M11.5107 14.3675L3.94995 18.7682C2.61502 19.5451 2.61109 21.5029 3.9428 22.2855L11.5035 26.7284C12.1201 27.0907 12.8798 27.0907 13.4964 26.7284L21.0572 22.2855C22.3889 21.5029 22.385 19.5451 21.0501 18.7682L13.4894 14.3675C12.8763 14.0106 12.1236 14.0106 11.5107 14.3675Z' }), el('rect', { style: {fill: '#E6EFFD'}, x: '18', width: '26', height: '12', rx: '6' }), el('path', { style: {fill: '#005AEE'}, d: 'M21.6392 9V3.18182H23.7699C24.1828 3.18182 24.5246 3.25 24.7955 3.38636C25.0663 3.52083 25.2689 3.7036 25.4034 3.93466C25.5379 4.16383 25.6051 4.42235 25.6051 4.71023C25.6051 4.95265 25.5606 5.1572 25.4716 5.32386C25.3826 5.48864 25.2633 5.62121 25.1136 5.72159C24.9659 5.82008 24.803 5.89205 24.625 5.9375V5.99432C24.8182 6.00379 25.0066 6.06629 25.1903 6.18182C25.3759 6.29545 25.5294 6.45739 25.6506 6.66761C25.7718 6.87784 25.8324 7.13352 25.8324 7.43466C25.8324 7.73201 25.7623 7.99905 25.6222 8.2358C25.4839 8.47064 25.2699 8.6572 24.9801 8.79545C24.6903 8.93182 24.3201 9 23.8693 9H21.6392ZM22.517 8.24716H23.7841C24.2045 8.24716 24.5057 8.16572 24.6875 8.00284C24.8693 7.83996 24.9602 7.63636 24.9602 7.39205C24.9602 7.20833 24.9138 7.03977 24.821 6.88636C24.7282 6.73295 24.5956 6.6108 24.4233 6.51989C24.2528 6.42898 24.0502 6.38352 23.8153 6.38352H22.517V8.24716ZM22.517 5.69886H23.6932C23.8902 5.69886 24.0672 5.66098 24.2244 5.58523C24.3835 5.50947 24.5095 5.40341 24.6023 5.26705C24.697 5.12879 24.7443 4.96591 24.7443 4.77841C24.7443 4.53788 24.66 4.33617 24.4915 4.1733C24.3229 4.01042 24.0644 3.92898 23.7159 3.92898H22.517V5.69886ZM26.8736 9V3.18182H30.5213V3.9375H27.7514V5.71023H30.331V6.46307H27.7514V8.24432H30.5554V9H26.8736ZM31.407 3.9375V3.18182H35.9098V3.9375H34.0945V9H33.2195V3.9375H31.407ZM36.7088 9H35.777L37.8707 3.18182H38.8849L40.9787 9H40.0469L38.402 4.23864H38.3565L36.7088 9ZM36.8651 6.72159H39.8878V7.46023H36.8651V6.72159Z' }) ), category: 'amelia-blocks', keywords: [ 'amelia', 'events' ], supports: { customClassName: false, html: false }, attributes: { short_code: { type: 'string', default: '[ameliaeventslistbooking]' }, trigger: { type: 'string', default: '' }, event: { type: 'string', default: '' }, recurring: { type: 'boolean', default: false }, tag: { type: 'string', default: '' }, eventOptions: { type: 'string', default: '' }, parametars: { type: 'boolean', default: false } }, edit: function (props) { var inspectorElements = [] var attributes = props.attributes var options = { events: [{value: '', label: wpAmeliaLabels.show_all_events}], tags: [{value: '', label: wpAmeliaLabels.show_all_tags}], eventOptions: [ {value: 'events', label: wpAmeliaLabels.show_event}, {value: 'tags', label: wpAmeliaLabels.show_tag} ] } function getOptions (data) { var options = [] data = Object.keys(data).map(function (key) { return data[key] }) data.sort(function (a, b) { if (parseInt(a.value) < parseInt(b.value)) { return -1 } if (parseInt(a.value) > parseInt(b.value)) { return 1 } return 0 }) data.forEach(function (element) { options.push({value: element.value, label: element.text}) }) return options } getOptions(events) .forEach(function (element) { options['events'].push(element) }) getOptions(tags) .forEach(function (element) { options['tags'].push(element) }) function getShortCode (props, attributes) { let shortCodeString = '' let shortCode = '' if (events.length !== 0) { if (attributes.event !== '') { shortCodeString += ' event=' + attributes.event + '' if (attributes.recurring) { shortCodeString += ' recurring=1' } } if (tags.length !== 0) { if (attributes.tag !== '') { shortCodeString += ' tag=' + "'" + attributes.tag + "'" } } shortCode += '[ameliaeventslistbooking' + shortCodeString if (attributes.trigger) { shortCode += ' trigger=' + attributes.trigger + '' } shortCode += ']' } else { shortCode = 'Notice: Please create event first.' } props.setAttributes({short_code: shortCode}) return shortCode } if (events.length !== 0) { inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-parametars'}, wpAmeliaLabels.filter), el(components.FormToggle, { id: 'amelia-js-parametars', checked: attributes.parametars, onChange: function () { return props.setAttributes({parametars: !props.attributes.parametars}) } }) )) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) if (attributes.parametars) { if (tags.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-tag', label: wpAmeliaLabels.select_tag, value: attributes.tag, options: options.tags, onChange: function (selectControl) { return props.setAttributes({tag: selectControl}) } })) } if (events.length) { inspectorElements.push(el(components.SelectControl, { id: 'amelia-js-select-event', label: wpAmeliaLabels.select_event, value: attributes.event, options: options.events, onChange: function (selectControl) { return props.setAttributes({event: selectControl}) } })) inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.PanelRow, {}, el('label', {htmlFor: 'amelia-js-today'}, wpAmeliaLabels.recurring_event), el(components.FormToggle, { id: 'amelia-js-recurring', checked: attributes.recurring, onChange: function () { return props.setAttributes({recurring: !props.attributes.recurring}) } }) )) } inspectorElements.push(el('div', {style: {'margin-bottom': '1em'}}, '')) inspectorElements.push(el(components.TextControl, { id: 'amelia-js-trigger', label: wpAmeliaLabels.manually_loading, value: attributes.trigger, help: wpAmeliaLabels.manually_loading_description, onChange: function (TextControl) { return props.setAttributes({trigger: TextControl}) } })) } else { attributes.event = '' attributes.tag = '' } return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {}, getShortCode(props, props.attributes) ) ] } else { inspectorElements.push(el('p', {style: {'margin-bottom': '1em'}}, 'Please create event first. You can find instructions in our documentation on link below.')) inspectorElements.push(el('a', {href: 'https://wpamelia.com/quickstart/', target: '_blank', style: {'margin-bottom': '1em'}}, 'Start working with Amelia WordPress Appointment Booking plugin')) return [ el(blockControls, {key: 'controls'}), el(inspectorControls, {key: 'inspector'}, el(components.PanelBody, {initialOpen: true}, inspectorElements ) ), el('div', {style: blockStyle}, getShortCode(props, props.attributes) ) ] } }, save: function (props) { return ( el('div', {}, props.attributes.short_code ) ) } }) })( window.wp ) amelia-events-list-booking/amelia-gutenberg-styles.css 0000666 00000001247 15165407706 0017163 0 ustar 00 .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-events-list-booking-gutenberg-block .block-editor-block-icon{ width: 44px !important; } .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-events-list-booking-gutenberg-block svg{ max-width: 44px !important; } .components-button.block-editor-block-types-list__item.editor-block-list-item-amelia-events-list-booking-gutenberg-block .block-editor-block-types-list__item-icon { padding-right: 5px; } .block-editor-block-card span { position: relative } .amelia-step-booking-gutenberg { position: absolute; max-width: 44px !important; }
| ver. 1.4 |
Github
|
.
| PHP 5.4.45 | Generation time: 0 |
proxy
|
phpinfo
|
Settings