first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,376 @@
(function( $ ){
let settingAjax = function( action, block_id ){
var data = {
action : action,
nonce : GUTENTOR_SETTINGS.ajax_nonce,
block_id : block_id
};
$.ajax({
url : GUTENTOR_SETTINGS.ajax_url,
type: "POST",
data: data,
success: function(result){
// console.log( result );
},
beforeSend: function(){
},
complete : function(){
}
});
};
$( document ).ready( function(){
$("#gutentor-admin-element-tab").click(function () {
$(this).addClass("tablist-item-active").siblings().removeClass("tablist-item-active");
$(".gutentor-admin-element-content").addClass("gutentor-active").siblings().removeClass("gutentor-active");
});
$("#gutentor-admin-module-tab").click(function () {
$(this).addClass("tablist-item-active").siblings().removeClass("tablist-item-active");
$(".gutentor-admin-module-content").addClass("gutentor-active").siblings().removeClass("gutentor-active");
});
$("#gutentor-admin-post-tab").click(function () {
$(this).addClass("tablist-item-active").siblings().removeClass("tablist-item-active");
$(".gutentor-admin-post-content").addClass("gutentor-active").siblings().removeClass("gutentor-active");
});
$("#gutentor-admin-term-tab").click(function () {
$(this).addClass("tablist-item-active").siblings().removeClass("tablist-item-active");
$(".gutentor-admin-term-content").addClass("gutentor-active").siblings().removeClass("gutentor-active");
});
$("#gutentor-admin-widget-tab").click(function () {
$(this).addClass("tablist-item-active").siblings().removeClass("tablist-item-active");
$(".gutentor-admin-widget-content").addClass("gutentor-active").siblings().removeClass("gutentor-active");
});
$( document ).on( 'click', '.onoffswitch', function( e ){
e.preventDefault();
let block_id = $( this ).find('input').data( 'action' );
$( this ).find('input').prop( 'checked', !$( this ).find('input').prop( 'checked' ) );
let val = $( this ).find('input').prop( 'checked' );
let action = val ? 'gutentor_activate_block' : 'gutentor_deactivate_block';
if( 'bulk' === block_id ){
action = val ? 'gutentor_bulk_activate_blocks' : 'gutentor_bulk_deactivate_blocks';
}
settingAjax( action, block_id );
});
/*Video*/
/*WOW*/
if ($('.gutentor-getting-started-watch-video').length) {
$('.gutentor-getting-started-watch-video').magnificPopup({
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false,
});
}
/*Color Picker
* Copied for FieldPress
* https://github.com/addonspress/fieldpress
* */
if( typeof Color === 'function' ) {
/*adding alpha support for Automattic Color.js toString function.*/
Color.fn.toString = function () {
/*check for alpha*/
if ( this._alpha < 1 ) {
return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
}
var hex = parseInt( this._color, 10 ).toString( 16 );
if ( this.error ) { return ''; }
/*maybe left pad it*/
if ( hex.length < 6 ) {
for (var i = 6 - hex.length - 1; i >= 0; i--) {
hex = '0' + hex;
}
}
return '#' + hex;
};
}
var FPPARSERGBACOLOR = function( val ) {
var value = val.replace(/\s+/g, ''),
alpha = ( value.indexOf('rgba') !== -1 ) ? parseFloat( value.replace(/^.*,(.+)\)/, '$1') * 100 ) : 100,
rgba = ( alpha < 100 );
return { value: value, alpha: alpha, rgba: rgba };
};
var FPCOLORPICKER = function( $this ) {
/*Default Color Picker*/
if( $this.data('rgba') && $this.data('rgba') === 1 ){
/*parse rgba*/
var picker = FPPARSERGBACOLOR( $this.val() );
$this.wpColorPicker({
/*wpColorPicker.clear*/
clear: function() {
$this.trigger('keyup');
},
/*wpColorPicker.change*/
change: function( event, ui ) {
var ui_color_value = ui.color.toString();
/*update checkerboard background color*/
$this.closest('.wp-picker-container').find('.fp-rgba-slider-offset').css('background-color', ui_color_value);
$this.val(ui_color_value).trigger('change');
},
/*wpColorPicker.create*/
create: function() {
/*set variables for alpha slider*/
var a8cIris = $this.data('a8cIris'),
$container = $this.closest('.wp-picker-container'),
/*appending alpha wrapper*/
$alpha_wrap = $('<div class="fp-rgba-wrap">' +
'<div class="fp-rgba-slider"></div>' +
'<div class="fp-rgba-slider-offset"></div>' +
'<div class="fp-rgba-text"></div>' +
'</div>').appendTo( $container.find('.wp-picker-holder') ),
$alpha_slider = $alpha_wrap.find('.fp-rgba-slider'),
$alpha_text = $alpha_wrap.find('.fp-rgba-text'),
$alpha_offset = $alpha_wrap.find('.fp-rgba-slider-offset');
/*alpha slider*/
$alpha_slider.slider({
/*slider.slide*/
slide: function( event, ui ) {
var slide_value = parseFloat( ui.value / 100 );
/*update iris data alpha && wpColorPicker color option && alpha text*/
a8cIris._color._alpha = slide_value;
$this.wpColorPicker( 'color', a8cIris._color.toString() );
$alpha_text.text( ( slide_value < 1 ? slide_value : '' ) );
},
/*slider: create*/
create: function() {
var slide_value = parseFloat( picker.alpha / 100 ),
alpha_text_value = slide_value < 1 ? slide_value : '';
/*update alpha text && checkerboard background color*/
$alpha_text.text(alpha_text_value);
$alpha_offset.css('background-color', picker.value);
/*wpColorPicker clear for update iris data alpha && alpha text && slider color option*/
$container.on('click', '.wp-picker-clear', function() {
a8cIris._color._alpha = 1;
$alpha_text.text('').trigger('change');
$alpha_slider.slider('option', 'value', 100).trigger('slide');
});
/*wpColorPicker default button for update iris data alpha && alpha text && slider color option*/
$container.on('click', '.wp-picker-default', function() {
var default_picker = FPPARSERGBACOLOR( $this.data('default-color') ),
default_value = parseFloat( default_picker.alpha / 100 ),
default_text = default_value < 1 ? default_value : '';
a8cIris._color._alpha = default_value;
$alpha_text.text(default_text);
$alpha_slider.slider('option', 'value', default_picker.alpha).trigger('slide');
});
/*show alpha wrapper on click color picker button*/
$container.on('click', '.wp-color-result', function() {
$alpha_wrap.toggle();
});
/*hide alpha wrapper on click body*/
$(document).on( 'click.wpcolorpicker', function() {
$alpha_wrap.hide();
});
},
/* slider: options */
value: picker.alpha,
step: 1,
min: 1,
max: 100
});
}
});
}
else{
$this.wpColorPicker( {
change: _.throttle( function() { /* For Customizer */
$this.trigger( 'change' );
}, 3000 ),
clear: _.throttle( function() { /* For Customizer */
$this.trigger( 'change' );
}, 4000 )
});
}
};
$('body').find('.gutentor-color-picker').each(function(){
FPCOLORPICKER($(this));
});
/*image loader*/
var FPIMAGEUPLOAD = function () {
$(document).on('click', '.gutentor-img-uploader-open', function (e){
e.preventDefault();
var image_uploader_open = $(this),
image_wrapper = image_uploader_open.closest('.gutentor-fields'),
preview = image_wrapper.find('.gutentor-img-preview'),
input = image_wrapper.find('input'),
image = image_wrapper.find('img'),
wp_media_frame;
/* Check if the `wp.media.gallery` API exists. */
if ( typeof wp === 'undefined' || ! wp.media || ! wp.media.gallery ) {
return;
}
/* If the media frame already exists, reopen it. */
if ( wp_media_frame ) {
wp_media_frame.open();
return;
}
/* Create the media frame. */
wp_media_frame = wp.media({
library: {
type: 'image'
},
title: image_uploader_open.data('upload'),
button: {
text: image_uploader_open.data('button-text')
}
});
/*select selected image*/
wp_media_frame.on('open', function(){
var selected = input.val(); // the id of the image
if (selected) {
var selection = wp_media_frame.state().get('selection'),
attachment = wp.media.attachment(selected);
selection.add(attachment);
}
});
/* When an image is selected, run a callback. */
wp_media_frame.on( 'select', function() {
var attachment = wp_media_frame.state().get('selection').first().toJSON(),
thumbnail = ( typeof attachment.sizes.thumbnail !== 'undefined' ) ? attachment.sizes.thumbnail.url : attachment.url;
preview.removeClass('hidden');
image.attr('src', thumbnail);
input.val( attachment.id );
input.trigger('change');
});
/* Finally, open the modal. */
wp_media_frame.open();
});
/* Remove image */
$(document).on('click','.gutentor-clear-img',function (e) {
e.preventDefault();
var image_wrapper = $(this).closest('.gutentor-fields'),
preview = image_wrapper.find('.gutentor-img-preview'),
input = image_wrapper.find('input');
input.val('');
preview.addClass('hidden');
});
};
FPIMAGEUPLOAD();
/*video loader*/
var FPVIDEOUPLOAD = function () {
/*Video Meta*/
$( document ).on('click', '.gutentor-media-video-upload', function(e){
// Prevents the default action from occuring.
e.preventDefault();
var media_title = $( this ).data( 'title' ),
media_button = $( this ).data( 'button' ),
media_input_val = $( this ).prev(),
media_image_url = $( this ).siblings( '.gutentor-video-preview-wrap' );
meta_image_frame = wp.media.frames.meta_image_frame = wp.media(
{
title: media_title,
button: { text: media_button },
library: {
type: [ 'video/mp4' ]
},
}
);
// Opens the media library frame.
meta_image_frame.open();
// Runs when an video is selected.
meta_image_frame.on(
'select',
function(){
// Grabs the attachment selection and creates a JSON representation of the model.
var media_attachment = meta_image_frame.state().get( 'selection' ).first().toJSON();
// Sends the attachment ID/URL to our custom video input field.
media_input_val.val( media_attachment.id );
var video = $(
'<video />',
{
class: 'gutentor-video-preview',
src: media_attachment.url,
type: 'video/mp4',
controls: true
}
);
media_image_url.html( video );
media_image_url.show();
media_input_val.trigger( 'change' );
}
);
}
);
// Runs when the video remove button is clicked.
$( document ).on('click', '.gutentor-media-video-remove', function(e){
$( this ).siblings( '.gutentor-video-preview-wrap' ).html( '' );
$( this ).prev().prev().val( '' );
}
);
};
FPVIDEOUPLOAD();
/*Video Src Selection*/
$( '#gutentor_meta_video_src_option' ).change(
function(){
var selected_val = $( this ).find( ":selected" ).val(),
g_video_url = $( '.header_video' ),
g_video_upload = $( '.gutentor-meta-video-upload-wrap' );
if (selected_val === 'external-url' ) {
g_video_url.show();
g_video_url.siblings().hide();
} else if (selected_val === 'self-hosted' ) {
g_video_upload.show();
g_video_upload.siblings().hide();
}
}
).trigger( "change" );
});
})( jQuery );

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,435 @@
const lodStaticCssOnHead = (staticCss) => {
if (staticCss.id && staticCss.href) {
let styleSelector = window.document;
let iframes = document.getElementsByName('editor-canvas');
if (iframes.length) {
styleSelector = iframes[0].contentDocument;
}
if (styleSelector.getElementById(staticCss.id) === null) {
let link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.id = staticCss.id;
if (styleSelector.getElementsByTagName('head').length != 0) {
styleSelector.getElementsByTagName('head')[0].appendChild(link);
link.href = staticCss.href;
} else {
styleSelector.getElementsByTagName('body')[0].appendChild(link);
link.href = staticCss.href;
}
} else {
styleSelector.getElementById(staticCss.id).href = staticCss.href;
}
}
};
function EditorReady($, iframes = undefined) {
let gutentorDocument = $(document);
if (typeof iframes !== 'undefined' && iframes.length) {
/*https://stackoverflow.com/questions/5992791/get-iframe-contents-with-a-jquery-selector*/
gutentorDocument = $('iframe[name="editor-canvas"]').contents();
}
// bind filter button click
$('.gutentor-filter-group').on(
'click',
'.gutentor-filter-inside',
function () {
var filterValue = $(this).attr('data-filter');
$grid.isotope({ filter: filterValue });
}
);
//close single Item data
gutentorDocument.on(
'click',
'.gutentor-single-item-close-action,.block-editor-block-contextual-toolbar-wrapper',
function () {
var this_button = $(this),
this_column = this_button.closest('.gutentor-column-inside');
this_column.removeClass('single-item-active');
this_column
.closest('.gutentor-section')
.removeClass('hide-gutentor-controls-actions');
//$('.edit-post-layout__content').css('overflow-y','');
$(
'.block-editor-editor-skeleton__sidebar, .interface-interface-skeleton__sidebar'
).css({
'z-index': '',
});
}
);
gutentorDocument.click(function (e) {
let popoverContent = gutentorDocument.find(
'.gutentor-single-item-edit-actions'
);
if (
!$(e.target).closest('.gutentor-single-item-edit-actions').length &&
popoverContent.is(':visible')
) {
if (
!(
$(e.target).hasClass('dashicons-admin-generic') &&
$(e.target).parent().hasClass('gutentor-single-item-action-button')
) &&
!(
$(e.target).hasClass('g-icon-picker-single-btn') ||
$(e.target).parent().hasClass('g-icon-picker-single-btn')
)
) {
if (popoverContent.find('.g-popover-open ').length) {
return false;
}
$('.gutentor-single-item-close-action').trigger('click');
}
}
});
//Image Slider single item options show/hide
gutentorDocument.on(
'click',
'.gutentor-single-item-action-button',
function () {
var this_button = $(this),
this_column = this_button.closest('.gutentor-column-inside'),
popoverContent = this_column.find('.gutentor-single-item-edit-actions'),
leftPos =
this_button[0].getBoundingClientRect().left +
$(window)['scrollLeft']();
$('.gutentor-column-inside').removeClass('single-item-active');
$('.gutentor-section').removeClass('hide-gutentor-controls-actions');
/*Position Fixed*/
let css = {};
if (leftPos < 310) {
css.right = '';
css.left = 0;
popoverContent.addClass('g-single-item-popup-left');
} else {
popoverContent.removeClass('g-single-item-popup-left');
}
popoverContent.css(css);
this_column.addClass('single-item-active');
this_column
.closest('.gutentor-section')
.addClass('hide-gutentor-controls-actions');
}
);
//social Icon single item options show/hide
gutentorDocument.on(
'click',
'.gutentor-social-single-item-button',
function () {
var this_button = $(this),
this_column = this_button.closest('.gutentor-social-item-inside');
// hide already opened single item
$('.gutentor-column-inside').removeClass('single-item-active');
$('.gutentor-section').removeClass('hide-gutentor-controls-actions');
$('.gutentor-social-item-inside').removeClass(
'social-single-item-active'
);
this_button
.closest('.gutentor-column-inside')
.addClass('social-active-control-action');
this_column.addClass('social-single-item-active');
this_column
.closest('.gutentor-section')
.addClass('hide-gutentor-controls-actions');
//$('.edit-post-layout__content').css('overflow-y','visible');
$(
'.block-editor-editor-skeleton__sidebar, .interface-interface-skeleton__sidebar'
).css({
'z-index': '-1',
});
}
);
// social Icon close single Item
gutentorDocument.on(
'click',
'.gutentor-social-single-item-close-action',
function () {
var this_button = $(this),
this_column = this_button.closest('.gutentor-social-item-inside');
this_button
.closest('.gutentor-column-inside')
.removeClass('social-active-control-action');
this_column.removeClass('social-single-item-active');
this_column
.closest('.gutentor-section')
.removeClass('hide-gutentor-controls-actions');
//$('.edit-post-layout__content').css('overflow-y','');
$(
'.block-editor-editor-skeleton__sidebar, .interface-interface-skeleton__sidebar'
).css({
'z-index': '',
});
}
);
// video popup
gutentorDocument.on(
'click',
'.gutentor-video-popup-holder, .g-v-btn, .g-v-fp-btn ',
function () {
$(this).magnificPopup({
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false,
});
}
);
/**
* Call Down
*
* @param {array} sectionID
* @return {string}
*/
let setCountdownInterval = null;
function count_down(sectionID) {
if (setCountdownInterval) {
clearInterval(setCountdownInterval);
}
var gutentor_this = gutentorDocument
.find('#' + sectionID)
.find('.gutentor-countdown-wrapper');
// Set the date we're counting down to
var gutentor_event_date = gutentor_this.attr('data-eventdate');
if (gutentor_event_date === undefined || gutentor_event_date === null) {
if (!gutentor_this.children('.gutentor-count-down-invalid-msg').length) {
gutentor_this.append(
"<span class='gutentor-count-down-invalid-msg'>Please set validate Date and time for countdown </span>"
);
}
gutentor_this.children().addClass('hidden');
gutentor_this
.children('.gutentor-count-down-invalid-msg')
.removeClass('hidden');
return false;
}
gutentor_this.children().removeClass('hidden');
gutentor_this.children('.gutentor-count-down-invalid-msg').remove();
var expired_text = gutentor_this.attr('data-expiredtext'),
gutentor_day = gutentor_this.find('.day'),
gutentor_hour = gutentor_this.find('.hour'),
gutentor_min = gutentor_this.find('.min'),
gutentor_sec = gutentor_this.find('.sec'),
gutentor_date_time = gutentor_event_date.split('T');
if (gutentor_date_time.length !== 2) {
return false;
}
var date_collection = gutentor_date_time[0],
time_collection = gutentor_date_time[1],
date_explode = date_collection.split('-');
if (date_explode.length !== 3) {
return false;
}
var time_explode = time_collection.split(':');
if (time_explode.length !== 3) {
return false;
}
var gutentor_year_value = parseInt(date_explode[0]),
gutentor_month_value = parseInt(date_explode[1]) - 1,
gutentor_day_value = parseInt(date_explode[2]),
gutentor_hour_value = parseInt(time_explode[0]),
gutentor_minutes_value = parseInt(time_explode[1]),
gutentor_second_value = parseInt(time_explode[2]),
countDownDate = new Date(
gutentor_year_value,
gutentor_month_value,
gutentor_day_value,
gutentor_hour_value,
gutentor_minutes_value,
gutentor_second_value,
0
).getTime();
// Update the count down every 1 second
setCountdownInterval = setInterval(function () {
// Get todays date and time
var now = new Date().getTime();
// Find the distance between now an the count down date
var distance = countDownDate - now;
// Time calculations for days, hours, minutes and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor(
(distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
);
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Display the result in the element
gutentor_day.html(days);
gutentor_hour.html(hours);
gutentor_min.html(minutes);
gutentor_sec.html(seconds);
// If the count down is finished, write some text
if (distance < 0) {
clearInterval(setCountdownInterval);
gutentor_this.children().addClass('hidden');
gutentor_this.append(
"<span class='gutentor-count-down-expire'>" + expired_text + '</span>'
);
} else {
gutentor_this.children().removeClass('hidden');
gutentor_this.children('.gutentor-count-down-expire').remove();
}
}, 1000);
}
// Call count Down
gutentorDocument.on('click', '.gutentor-countdown-start', function () {
let sectionID = $(this).attr('data-sectionid');
count_down(sectionID);
});
/*google font load on head*/
gutentorDocument.on(
'change',
'.gutentor-font-type select, .gutentor-google-font select, .gutentor-font-weight select',
function () {
let thisTypography = $(this).closest('.gutentor-typography-main-wrap');
/*give small time to change font weight*/
setTimeout(function () {
let gutentorFontTypeWrap = thisTypography.find('.gutentor-font-type'),
gutentorFontType = gutentorFontTypeWrap.find('select').val();
if (!thisTypography.attr('id')) {
thisTypography.uniqueId();
}
let uniqueID = thisTypography.attr('id');
if ('google' === gutentorFontType) {
let gutentorFontFamilyWrap = thisTypography.find(
'.gutentor-google-font'
),
gutentorIsFontFamily = gutentorFontFamilyWrap.find('select').val()
? gutentorFontFamilyWrap.find('select').val()
: 'Acme',
gutentorFontFamilyVal =
gutentorIsFontFamily === 'default'
? 'Acme'
: gutentorIsFontFamily,
gutentorFontFamily = gutentorFontFamilyVal.replace(' ', '+'),
gutentorFontWeightWrap = thisTypography.find(
'.gutentor-font-weight'
),
gutentorFontWeight = gutentorFontWeightWrap.find('select').val();
gutentorFontFamily = gutentorFontFamily + ':' + gutentorFontWeight;
gutentorFontFamily = gutentorFontFamily.replace('italic', 'i');
gutentorFontFamily = gutentorFontFamily.replace('default', 'regular');
let url = '//fonts.googleapis.com/css';
url += '?family=' + gutentorFontFamily;
lodStaticCssOnHead({
id: '#gutentor-google-' + uniqueID,
href: url,
});
}
}, 300);
}
);
$('.g-html-preview').each(function () {
const targetElement = $(this)[0];
const observer = new MutationObserver(function (mutationsList, observer) {
mutationsList.forEach(function (mutation) {
let elem = $(mutation.target);
if (elem.children().length > 0) {
let cHeight = elem.children().eq(0).outerHeight();
let pHeight = elem.outerHeight();
elem.removeClass('g-child-greater-height g-child-smaller-height');
if (cHeight > pHeight) {
elem.addClass('g-child-greater-height');
} else {
elem.addClass('g-child-smaller-height');
}
}
});
});
const observerConfig = {
childList: true,
subtree: true,
};
observer.observe(targetElement, observerConfig);
});
// filter module
gutentorDocument.on(
'click',
'.g-filter-col-inspectors .css-10nd86i',
function () {
$(this)
.closest('.g-filter-col-inspectors')
.toggleClass('g-filter-selected');
}
);
}
(function ($) {
function preEditor() {
if (window.location.href.indexOf('site-editor.php') > -1) {
let blockLoaded = false;
let blockLoadedInterval = setInterval(function () {
let iframes = $('iframe[name="editor-canvas"]');
if (iframes.length) {
/*post-title-0 is ID of Post Title Textarea*/
//Actual functions goes here
EditorReady($, iframes);
blockLoaded = true;
}
if (blockLoaded) {
clearInterval(blockLoadedInterval);
}
}, 500);
} else {
EditorReady($);
}
}
preEditor();
/*https://stackoverflow.com/questions/47917596/listener-event-for-when-url-parameters-change*/
(function (history) {
const pushState = history.pushState;
history.pushState = function (state) {
if (typeof history.onpushstate == 'function') {
history.onpushstate({ state: state });
}
// Call your custom function here
preEditor();
return pushState.apply(history, arguments);
};
})(window.history);
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
let blocksStatus = GUTENTOR_BLOCKS.status;
if( typeof wp.blocks.unregisterBlockType !== "undefined" ){
Object.keys( blocksStatus ).map( function( key ){
if(blocksStatus[ key ] !== null) {
if (blocksStatus[key] === 'disabled') {
wp.domReady(() => {
wp.blocks.unregisterBlockType('gutentor/' + key);
});
}
}
});
}

View File

@@ -0,0 +1 @@
(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=2)})({2:function(){let a=GUTENTOR_BLOCKS.status;'undefined'!=typeof wp.blocks.unregisterBlockType&&Object.keys(a).map(function(b){null!==a[b]&&'disabled'===a[b]&&wp.domReady(()=>{wp.blocks.unregisterBlockType('gutentor/'+b)})})}});

View File

@@ -0,0 +1,4 @@
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) {
// console.log(placement)
/*TODO*/
} );

View File

@@ -0,0 +1 @@
(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=3)})({3:function(){wp.customize.selectiveRefresh.bind('partial-content-rendered',function(){})}});

View File

@@ -0,0 +1,75 @@
const initMapScript = () => {
let maps = [];
maps = window.gutentorGoogleMaps;
if( maps){
maps.forEach( map => {
const googleMap = new google.maps.Map( document.getElementById( map.container ), {
center: {
lat: Number( map.attributes.latitude ),
lng: Number( map.attributes.longitude )
},
gestureHandling: 'cooperative',
zoom: map.attributes.zoom,
mapTypeId: map.attributes.type,
draggable: map.attributes.draggable,
mapTypeControl: map.attributes.mapTypeControl,
zoomControl: map.attributes.zoomControl,
fullscreenControl: map.attributes.fullscreenControl,
streetViewControl: map.attributes.streetViewControl
});
if ( ! map.attributes.id && map.attributes.location ) {
const request = {
query: map.attributes.location,
fields: [ 'name', 'geometry' ]
};
const service = new google.maps.places.PlacesService( googleMap );
service.findPlaceFromQuery( request, ( results, status ) => {
if ( status === google.maps.places.PlacesServiceStatus.OK ) {
if ( 0 < results.length ) {
googleMap.setCenter( results[0].geometry.location );
}
}
});
}
if ( map.attributes.markers && 0 < map.attributes.markers.length ) {
map.attributes.markers.forEach( marker => {
let position;
if( marker.hasOwnProperty('e4Lat')){
position = new google.maps.LatLng( marker.e4Lat, marker.e4Lon );
}
else{
position = new google.maps.LatLng( marker.latitude, marker.longitude );
}
const mark = new google.maps.Marker({
position,
map: googleMap,
title: marker.title
});
if ( marker.title || marker.description ) {
if (!window.infoWindow) {
window.infoWindow = new google.maps.InfoWindow();
}
mark.addListener( 'click', () => {
if (!window.infoWindow) return;
window.infoWindow.setContent( getInfoWindowContent( marker ) );
window.infoWindow.open( googleMap, mark );
});
}
});
}
});
}
};
function getInfoWindowContent( marker ) {
return `<div class="gutentor-map-overview"><h6 class="gutentor-map-overview-title">${ marker.title }</h6><div class="gutentor-map-overview-content">${ marker.description ? `<p>${ marker.description }</p>` : '' }</div></div>`;
}
window.initMapScript = initMapScript;

View File

@@ -0,0 +1 @@
(function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=4)})({4:function(){function a(a){return`<div class="gutentor-map-overview"><h6 class="gutentor-map-overview-title">${a.title}</h6><div class="gutentor-map-overview-content">${a.description?`<p>${a.description}</p>`:''}</div></div>`}window.initMapScript=()=>{let b=[];b=window.gutentorGoogleMaps,b&&b.forEach((b)=>{const c=new google.maps.Map(document.getElementById(b.container),{center:{lat:+b.attributes.latitude,lng:+b.attributes.longitude},gestureHandling:'cooperative',zoom:b.attributes.zoom,mapTypeId:b.attributes.type,draggable:b.attributes.draggable,mapTypeControl:b.attributes.mapTypeControl,zoomControl:b.attributes.zoomControl,fullscreenControl:b.attributes.fullscreenControl,streetViewControl:b.attributes.streetViewControl});if(!b.attributes.id&&b.attributes.location){const a={query:b.attributes.location,fields:['name','geometry']},d=new google.maps.places.PlacesService(c);d.findPlaceFromQuery(a,(a,b)=>{b===google.maps.places.PlacesServiceStatus.OK&&0<a.length&&c.setCenter(a[0].geometry.location)})}b.attributes.markers&&0<b.attributes.markers.length&&b.attributes.markers.forEach((b)=>{let d=b.hasOwnProperty('e4Lat')?new google.maps.LatLng(b.e4Lat,b.e4Lon):new google.maps.LatLng(b.latitude,b.longitude);const e=new google.maps.Marker({position:d,map:c,title:b.title});(b.title||b.description)&&(!window.infoWindow&&(window.infoWindow=new google.maps.InfoWindow),e.addListener('click',()=>{window.infoWindow&&(window.infoWindow.setContent(a(b)),window.infoWindow.open(c,e))}))})})}}});

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long