jQuery(document).ready(function ($) {
"use strict";
$('.row-actions .edit a, .page-title-action, .column-title .row-title').on('click', function (e) {
e.preventDefault();
var id = 0;
var modal = $('#responsive_woo_tabs_modal');
var parent = $(this).parents('.column-title');
modal.addClass('loading');
modal.modal('show');
if (parent.length > 0) {
id = parent.find('.hidden').attr('id').split('_')[1];
$.get(window.responsivewootabsultimate.restapi + 'woo_tabs_single_data', {id: id, _wpnonce: window.responsivewootabsultimate.nonce}, function (data) {
ResponsiveWooTabsEditor(data);
modal.removeClass('loading');
});
} else {
var data = {
title: '',
priority: 20,
activation: 'yes',
condition: 'entire_site',
singular_id: '',
archive: 'products_cat',
products_cat: '',
products_tags: '',
};
ResponsiveWooTabsEditor(data);
modal.removeClass('loading');
}
var url = modal.attr('data-editor-url') + 'post.php?post=' + id + '&action=edit';
$('.open-data-btn-editor').attr('data-editor-url', url);
$('#responsive-woo-tabs-id').val(id);
});
function ShortcodeCcontrolTabsSelect() {
var responsive_woo_tabs_c = $('.responsive_woo_tabs_c').val();
if (responsive_woo_tabs_c == 'singular') {
$('.responsive_woo_tabs_singular_id-container').show();
$('.responsive_woo_tabs_archive-container').hide();
$('.responsive_woo_tabs_archive_author_id-container').hide();
$('.responsive_woo_tabs_archive_cat_id-container').hide();
$('.responsive_woo_tabs_archive_tags_id-container').hide();
} else if (responsive_woo_tabs_c == 'archive') {
$('.responsive_woo_tabs_singular_id-container').hide();
$('.responsive_woo_tabs_archive-container').show();
var condition = $('.responsive_woo_tabs_archive').val();
if (condition == 'products_cat') {
$('.responsive_woo_tabs_archive_author_id-container').hide();
$('.responsive_woo_tabs_archive_cat_id-container').show();
$('.responsive_woo_tabs_archive_tags_id-container').hide();
} else if (condition == 'products_tags') {
$('.responsive_woo_tabs_archive_author_id-container').hide();
$('.responsive_woo_tabs_archive_cat_id-container').hide();
$('.responsive_woo_tabs_archive_tags_id-container').show();
}
} else {
$('.responsive_woo_tabs_singular_id-container').hide();
$('.responsive_woo_tabs_archive-container').hide();
$('.responsive_woo_tabs_archive_author_id-container').hide();
$('.responsive_woo_tabs_archive_cat_id-container').hide();
$('.responsive_woo_tabs_archive_tags_id-container').hide();
}
}
;
$('.shortcode-control-type-text select').on('change', function () {
ShortcodeCcontrolTabsSelect();
});
$('.open-data-btn-editor').on('click', function () {
var link = $(this).attr('data-editor-url');
window.location.href = link;
});
$('#responsive_woo_tabsinput-form').on('submit', function (e) {
e.preventDefault();
var modal = $('#addons_headerfooter_modal');
modal.addClass('loading');
var form_data = $(this).serialize();
$.get(window.responsivewootabsultimate.restapi + 'tabsupdate/', form_data, function (output) {
location.reload();
});
});
$('.responsive_woo_tabs_singular_id').select2({
ajax: {
url: window.responsivewootabsultimate.restapi + 'woo_product_name',
dataType: 'json',
data: function (params) {
var query = {
qu: params.term,
_wpnonce: window.responsivewootabsultimate.nonce
}
return query;
}
},
width: '100%',
cache: true,
placeholder: "--",
});
$('.responsive_woo_tabs_archive_cat_id').select2({
ajax: {
url: window.responsivewootabsultimate.restapi + 'woo_cat_name',
dataType: 'json',
data: function (params) {
var query = {
_wpnonce: window.responsivewootabsultimate.nonce
}
return query;
}
},
width: '100%',
cache: true,
placeholder: "--",
});
$('.responsive_woo_tabs_archive_tags_id').select2({
ajax: {
url: window.responsivewootabsultimate.restapi + 'woo_tag_name',
dataType: 'json',
data: function (params) {
var query = {
_wpnonce: window.responsivewootabsultimate.nonce
}
return query;
}
},
width: '100%',
cache: true,
placeholder: "--",
});
function ResponsiveWooTabsEditor(data) {
$('.responsive_woo_tabsinput-title').val(data.title);
$('.responsive_woo_tabsinput-priority').val(data.priority);
$('.responsive_woo_tabs_c').val(data.condition).change();
$('.responsive_woo_tabs_archive').val(data.archive).change();
var activation_input = $('.responsive_woo_tabsinput-activition');
if (data.activation == 'yes') {
activation_input.attr('checked', true);
} else {
activation_input.removeAttr('checked');
}
$('.responsive_woo_tabsinput-activition, .responsive_woo_tabsinput-priority').trigger('change');
ShortcodeCcontrolTabsSelect();
if (data.singular_id !== null && data.singular_id.length > 0) {
console.log(data.singular_id.length);
var el = $('.responsive_woo_tabs_singular_id');
$.ajax({
url: window.responsivewootabsultimate.restapi + 'woo_product_name',
dataType: 'json',
data: {
ids: String(data.singular_id),
_wpnonce: window.responsivewootabsultimate.nonce
}
}).then(function (data) {
if (data !== null && data.results.length > 0) {
el.html(' ');
$.each(data.results, function (i, v) {
var option = new Option(v.text, v.id, true, true);
el.append(option).trigger('change');
});
el.trigger({
type: 'select2:select',
params: {
data: data
}
});
}
});
} else {
$('.responsive_woo_tabs_singular_id').val(null).trigger('change');
}
if (data.products_cat !== null && data.products_cat.length > 0) {
var el = $('.responsive_woo_tabs_archive_cat_id');
$.ajax({
url: window.responsivewootabsultimate.restapi + 'woo_cat_name',
dataType: 'json',
data: {
ids: String(data.products_cat),
_wpnonce: window.responsivewootabsultimate.nonce
}
}).then(function (data) {
if (data !== null && data.results.length > 0) {
el.html(' ');
$.each(data.results, function (i, v) {
var option = new Option(v.text, v.id, true, true);
el.append(option).trigger('change');
});
el.trigger({
type: 'select2:select',
params: {
data: data
}
});
}
});
}
if (data.products_tags !== null && data.products_tags.length > 0) {
var el = $('.responsive_woo_tabs_archive_tags_id');
$.ajax({
url: window.responsivewootabsultimate.restapi + 'woo_tag_name',
dataType: 'json',
data: {
ids: String(data.products_tags),
_wpnonce: window.responsivewootabsultimate.nonce
}
}).then(function (data) {
if (data !== null && data.results.length > 0) {
el.html(' ');
$.each(data.results, function (i, v) {
var option = new Option(v.text, v.id, true, true);
el.append(option).trigger('change');
});
el.trigger({
type: 'select2:select',
params: {
data: data
}
});
}
});
}
}
});/*! For license information please see editor-documents.js.LICENSE.txt */
!function(){"use strict";var t={react:function(t){t.exports=window.React},"@elementor/editor":function(t){t.exports=window.elementorV2.editor},"@elementor/editor-v1-adapters":function(t){t.exports=window.elementorV2.editorV1Adapters},"@elementor/store":function(t){t.exports=window.elementorV2.store},"@elementor/utils":function(t){t.exports=window.elementorV2.utils},"@wordpress/i18n":function(t){t.exports=window.wp.i18n}},e={};function n(i){var o=e[i];if(void 0!==o)return o.exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.d=function(t,e){for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};!function(){n.r(i),n.d(i,{__useActiveDocument:function(){return l},__useActiveDocumentActions:function(){return D},__useHostDocument:function(){return m},__useNavigateToDocument:function(){return b},getCurrentDocument:function(){return C},getV1DocumentsManager:function(){return f},init:function(){return I},setDocumentModifiedStatus:function(){return y},slice:function(){return p}});var t=n("@elementor/editor"),e=n("@elementor/store"),o=n("react"),r=n("@wordpress/i18n"),s=n("@elementor/editor-v1-adapters"),a=n("@elementor/utils"),c=t=>t.documents.entities,d=(0,e.__createSelector)(c,(t=>t.documents.activeId),((t,e)=>e&&t[e]?t[e]:null)),u=(0,e.__createSelector)(c,(t=>t.documents.hostId),((t,e)=>e&&t[e]?t[e]:null));function l(){return(0,e.__useSelector)(d)}function m(){return(0,e.__useSelector)(u)}function v(){return function(){const t=l(),e=m(),n=t&&"kit"!==t.type.value?t:e;(0,o.useEffect)((()=>{if(void 0===n?.title)return;const t=(0,r.__)('Edit "%s" with Elementor',"elementor").replace("%s",n.title);window.document.title=t}),[n?.title])}(),null}function _(t){return!(!t.activeId||!t.entities[t.activeId])}var p=(0,e.__createSlice)({name:"documents",initialState:{entities:{},activeId:null,hostId:null},reducers:{init(t,{payload:e}){t.entities=e.entities,t.hostId=e.hostId,t.activeId=e.activeId},activateDocument(t,e){t.entities[e.payload.id]=e.payload,t.activeId=e.payload.id},setAsHost(t,e){t.hostId=e.payload},updateActiveDocument(t,e){_(t)&&(t.entities[t.activeId]={...t.entities[t.activeId],...e.payload})},startSaving(t){_(t)&&(t.entities[t.activeId].isSaving=!0)},endSaving(t,e){_(t)&&(t.entities[t.activeId]={...e.payload,isSaving:!1})},startSavingDraft:t=>{_(t)&&(t.entities[t.activeId].isSavingDraft=!0)},endSavingDraft(t,e){_(t)&&(t.entities[t.activeId]={...e.payload,isSavingDraft:!1})},markAsDirty(t){_(t)&&(t.entities[t.activeId].isDirty=!0)},markAsPristine(t){_(t)&&(t.entities[t.activeId].isDirty=!1)}}});function f(){const t=window.elementor?.documents;if(!t)throw new Error("Elementor Editor V1 documents manager not found");return t}function g(t){switch(window.elementor?.getPreferences?.("exit_to")||"this_post"){case"dashboard":return t.config.urls.main_dashboard;case"all_posts":return t.config.urls.all_post_type;default:return t.config.urls.exit_to_dashboard}}function w(t){return t?.config?.panel?.show_copy_and_share??!1}function h(t){return t.config.urls.permalink??""}function S(t){const e=t.config.revisions.current_id!==t.id,n=g(t);return{id:t.id,title:t.container.settings.get("post_title"),type:{value:t.config.type,label:t.config.panel.title},status:{value:t.config.status.value,label:t.config.status.label},links:{permalink:h(t),platformEdit:n},isDirty:t.editor.isChanged||e,isSaving:t.editor.isSaving,isSavingDraft:!1,permissions:{allowAddingWidgets:t.config.panel?.allow_adding_widgets??!0,showCopyAndShare:w(t)},userCan:{publish:t.config.user.can_publish}}}function y(t){(0,s.__privateRunCommandSync)("document/save/set-is-modified",{status:t},{internal:!0})}function I(){(0,e.__registerSlice)(p),function(){const{init:t}=p.actions;(0,s.__privateListenTo)((0,s.v1ReadyEvent)(),(()=>{const n=f(),i=Object.entries(n.documents).reduce(((t,[e,n])=>(t[e]=S(n),t)),{});(0,e.__dispatch)(t({entities:i,hostId:n.getInitialId(),activeId:n.getCurrentId()}))}))}(),function(){const{activateDocument:t,setAsHost:n}=p.actions;(0,s.__privateListenTo)((0,s.commandEndEvent)("editor/documents/open"),(()=>{const i=f(),o=S(i.getCurrent());(0,e.__dispatch)(t(o)),i.getInitialId()===o.id&&(0,e.__dispatch)(n(o.id))}))}(),function(){const{startSaving:t,endSaving:n,startSavingDraft:i,endSavingDraft:o}=p.actions,r=t=>{const e=t;return"autosave"===e.args?.status};(0,s.__privateListenTo)((0,s.commandStartEvent)("document/save/save"),(n=>{r(n)?(0,e.__dispatch)(i()):(0,e.__dispatch)(t())})),(0,s.__privateListenTo)((0,s.commandEndEvent)("document/save/save"),(t=>{const i=S(f().getCurrent());r(t)?(0,e.__dispatch)(o(i)):(0,e.__dispatch)(n(i))}))}(),function(){const{updateActiveDocument:t}=p.actions,n=(0,a.debounce)((n=>{const i=n;if(!("post_title"in i.args?.settings))return;const o=f().getCurrent().container.settings.get("post_title");(0,e.__dispatch)(t({title:o}))}),400);(0,s.__privateListenTo)((0,s.commandEndEvent)("document/elements/settings"),n)}(),function(){const{markAsDirty:t,markAsPristine:n}=p.actions;(0,s.__privateListenTo)((0,s.commandEndEvent)("document/save/set-is-modified"),(()=>{const i=d((0,e.__getState)())?.isSaving;i||(f().getCurrent().editor.isChanged?(0,e.__dispatch)(t()):(0,e.__dispatch)(n()))}))}(),function(){const{updateActiveDocument:t}=p.actions,n=(0,a.debounce)((n=>{const i=n;if(!("exit_to"in i.args?.settings))return;const o=f().getCurrent(),r=g(o),s=h(o);(0,e.__dispatch)(t({links:{platformEdit:r,permalink:s}}))}),400);(0,s.__privateListenTo)((0,s.commandEndEvent)("document/elements/settings"),n)}(),(0,t.injectIntoLogic)({id:"documents-hooks",component:v})}function D(){const t=l(),e=t?.links?.permalink??"";return{save:(0,o.useCallback)((()=>(0,s.__privateRunCommand)("document/save/default")),[]),saveDraft:(0,o.useCallback)((()=>(0,s.__privateRunCommand)("document/save/draft")),[]),saveTemplate:(0,o.useCallback)((()=>(0,s.__privateOpenRoute)("library/save-template")),[]),copyAndShare:(0,o.useCallback)((()=>{navigator.clipboard.writeText(e)}),[e])}}function b(){return(0,o.useCallback)((async t=>{await(0,s.__privateRunCommand)("editor/documents/switch",{id:t,setAsInitial:!0});const e=new URL(window.location.href);e.searchParams.set("post",t.toString()),e.searchParams.delete("active-document"),history.replaceState({},"",e)}),[])}function C(){return d((0,e.__getState)())}}(),(window.elementorV2=window.elementorV2||{}).editorDocuments=i}(),window.elementorV2.editorDocuments?.init?.();/*
* Remodal - v1.0.7
* Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
* http://vodkabears.github.io/remodal/
*
* Made by Ilya Makarov
* Under MIT License
*/
/* ==========================================================================
Remodal's default mobile first theme
========================================================================== */
/* Default theme styles for the background */
.remodal-bg.remodal-is-opening,
.remodal-bg.remodal-is-opened {
-webkit-filter: blur(3px);
filter: blur(3px);
}
/* Default theme styles of the overlay */
.remodal-overlay {
background: rgba(43, 46, 56, 0.9);
}
.remodal-overlay.remodal-is-opening,
.remodal-overlay.remodal-is-closing {
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.remodal-overlay.remodal-is-opening {
-webkit-animation-name: remodal-overlay-opening-keyframes;
animation-name: remodal-overlay-opening-keyframes;
}
.remodal-overlay.remodal-is-closing {
-webkit-animation-name: remodal-overlay-closing-keyframes;
animation-name: remodal-overlay-closing-keyframes;
}
/* Default theme styles of the wrapper */
.remodal-wrapper {
padding: 10px 10px 0;
}
/* Default theme styles of the modal dialog */
.remodal {
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
margin-bottom: 10px;
padding: 35px;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
color: #2b2e38;
background: #fff;
}
.remodal.remodal-is-opening,
.remodal.remodal-is-closing {
-webkit-animation-duration: 0.3s;
animation-duration: 0.3s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
}
.remodal.remodal-is-opening {
-webkit-animation-name: remodal-opening-keyframes;
animation-name: remodal-opening-keyframes;
}
.remodal.remodal-is-closing {
-webkit-animation-name: remodal-closing-keyframes;
animation-name: remodal-closing-keyframes;
}
/* Vertical align of the modal dialog */
.remodal,
.remodal-wrapper:after {
vertical-align: middle;
}
/* Close button */
.remodal-close {
position: absolute;
top: 10px;
right: 0;
display: block;
overflow: visible;
width: 35px;
height: 35px;
margin: 0;
padding: 0;
cursor: pointer;
-webkit-transition: color 0.2s;
transition: color 0.2s;
text-decoration: none;
color: #95979c;
border: 0;
outline: 0;
background: transparent;
}
.remodal-close:hover,
.remodal-close:focus {
color: #2b2e38;
}
.remodal-close:before {
font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
font-size: 25px;
line-height: 35px;
position: absolute;
top: 0;
left: 0;
display: block;
width: 35px;
content: "\00d7";
text-align: center;
}
/* Dialog buttons */
.remodal-confirm,
.remodal-cancel {
font: inherit;
display: inline-block;
overflow: visible;
min-width: 110px;
margin: 0;
padding: 12px 0;
cursor: pointer;
-webkit-transition: background 0.2s;
transition: background 0.2s;
text-align: center;
vertical-align: middle;
text-decoration: none;
border: 0;
outline: 0;
}
.remodal-confirm {
color: #fff;
background: #81c784;
}
.remodal-confirm:hover,
.remodal-confirm:focus {
background: #66bb6a;
}
.remodal-cancel {
color: #fff;
background: #e57373;
}
.remodal-cancel:hover,
.remodal-cancel:focus {
background: #ef5350;
}
/* Remove inner padding and border in Firefox 4+ for the button tag. */
.remodal-confirm::-moz-focus-inner,
.remodal-cancel::-moz-focus-inner,
.remodal-close::-moz-focus-inner {
padding: 0;
border: 0;
}
/* Keyframes
========================================================================== */
@-webkit-keyframes remodal-opening-keyframes {
from {
-webkit-transform: scale(1.05);
transform: scale(1.05);
opacity: 0;
}
to {
-webkit-transform: none;
transform: none;
opacity: 1;
}
}
@keyframes remodal-opening-keyframes {
from {
-webkit-transform: scale(1.05);
transform: scale(1.05);
opacity: 0;
}
to {
-webkit-transform: none;
transform: none;
opacity: 1;
}
}
@-webkit-keyframes remodal-closing-keyframes {
from {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
to {
-webkit-transform: scale(0.95);
transform: scale(0.95);
opacity: 0;
}
}
@keyframes remodal-closing-keyframes {
from {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
to {
-webkit-transform: scale(0.95);
transform: scale(0.95);
opacity: 0;
}
}
@-webkit-keyframes remodal-overlay-opening-keyframes {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes remodal-overlay-opening-keyframes {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes remodal-overlay-closing-keyframes {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes remodal-overlay-closing-keyframes {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
/* Media queries
========================================================================== */
@media only screen and (min-width: 641px) {
.remodal {
max-width: 900px;
}
}
/* IE8
========================================================================== */
.lt-ie9 .remodal-overlay {
background: #2b2e38;
}
.lt-ie9 .remodal {
width: 700px;
}
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */