replace all mt- to sad-

This commit is contained in:
2025-05-20 23:36:11 -07:00
parent 0869581510
commit faaaaafb39
35 changed files with 637 additions and 637 deletions

View File

@@ -1,6 +1,6 @@
( function( api ) {
( function( api ) {
api.sectionConstructor['mt-upsell'] = api.Section.extend( {
api.sectionConstructor['sad-upsell'] = api.Section.extend( {
// No events for this type of section.
attachEvents: function () {},
@@ -13,7 +13,7 @@
} )( wp.customize );
wp.customize.controlConstructor['mt-toggle'] = wp.customize.Control.extend({
wp.customize.controlConstructor['sad-toggle'] = wp.customize.Control.extend({
ready: function(){
'use strict';
@@ -37,12 +37,12 @@ jQuery(document).ready(function($) {
* Function for repeater field
*/
function sophia_after_dark_refresh_repeater_values(){
$(".mt-repeater-field-control-wrap").each(function(){
$(".sad-repeater-field-control-wrap").each(function(){
var values = [];
var $this = $(this);
$this.find(".mt-repeater-field-control").each(function(){
$this.find(".sad-repeater-field-control").each(function(){
var valueToPush = {};
$(this).find('[data-name]').each(function(){
@@ -55,21 +55,21 @@ jQuery(document).ready(function($) {
values.push(valueToPush);
});
$this.next('.mt-repeater-collector').val(JSON.stringify(values)).trigger('change');
$this.next('.sad-repeater-collector').val(JSON.stringify(values)).trigger('change');
});
}
$('#customize-theme-controls').on('click','.mt-repeater-field-title',function(){
$('#customize-theme-controls').on('click','.sad-repeater-field-title',function(){
$(this).next().slideToggle();
$(this).closest('.mt-repeater-field-control').toggleClass('expanded');
$(this).closest('.sad-repeater-field-control').toggleClass('expanded');
});
$('#customize-theme-controls').on('click', '.mt-repeater-field-close', function(){
$(this).closest('.mt-repeater-fields').slideUp();;
$(this).closest('.mt-repeater-field-control').toggleClass('expanded');
$('#customize-theme-controls').on('click', '.sad-repeater-field-close', function(){
$(this).closest('.sad-repeater-fields').slideUp();;
$(this).closest('.sad-repeater-field-control').toggleClass('expanded');
});
$("body").on("click",'.mt-repeater-add-control-field', function(){
$("body").on("click",'.sad-repeater-add-control-field', function(){
var fLimit = $(this).parent().find('.field-limit').val();
var fCount = $(this).parent().find('.field-count').val();
@@ -77,14 +77,14 @@ jQuery(document).ready(function($) {
fCount++;
$(this).parent().find('.field-count').val(fCount);
} else {
$(this).before('<span class="mt-limit-msg"><em>Only '+fLimit+' repeater field will be permitted.</em></span>');
$(this).before('<span class="sad-limit-msg"><em>Only '+fLimit+' repeater field will be permitted.</em></span>');
return;
}
var $this = $(this).parent();
if(typeof $this != 'undefined') {
var field = $this.find(".mt-repeater-field-control:first").clone();
var field = $this.find(".sad-repeater-field-control:first").clone();
if(typeof field != 'undefined'){
field.find("input[type='text'][data-name]").each(function(){
@@ -112,10 +112,10 @@ jQuery(document).ready(function($) {
}
});
field.find(".mt-repeater-icon-list").each(function(){
field.find(".sad-repeater-icon-list").each(function(){
var defaultValue = $(this).next('input[data-name]').attr('data-default');
$(this).next('input[data-name]').val(defaultValue);
$(this).prev('.mt-repeater-selected-icon').children('i').attr('class','').addClass(defaultValue);
$(this).prev('.sad-repeater-selected-icon').children('i').attr('class','').addClass(defaultValue);
$(this).find('li').each(function(){
var icon_class = $(this).find('i').attr('class');
@@ -127,9 +127,9 @@ jQuery(document).ready(function($) {
});
});
field.find('.mt-repeater-fields').show();
$this.find('.mt-repeater-field-control-wrap').append(field);
field.addClass('expanded').find('.mt-repeater-fields').show();
field.find('.sad-repeater-fields').show();
$this.find('.sad-repeater-field-control-wrap').append(field);
field.addClass('expanded').find('.sad-repeater-fields').show();
$('.accordion-section-content').animate({ scrollTop: $this.height() }, 1000);
sophia_after_dark_refresh_repeater_values();
}
@@ -138,9 +138,9 @@ jQuery(document).ready(function($) {
return false;
});
$("#customize-theme-controls").on("click", ".mt-repeater-field-remove",function(){
$("#customize-theme-controls").on("click", ".sad-repeater-field-remove",function(){
if( typeof $(this).parent() != 'undefined'){
$(this).closest('.mt-repeater-field-control').slideUp('normal', function(){
$(this).closest('.sad-repeater-field-control').slideUp('normal', function(){
$(this).remove();
sophia_after_dark_refresh_repeater_values();
});
@@ -156,7 +156,7 @@ jQuery(document).ready(function($) {
/**
* Drag and drop to change order
*/
$(".mt-repeater-field-control-wrap").sortable({
$(".sad-repeater-field-control-wrap").sortable({
orientation: "vertical",
update: function( event, ui ) {
sophia_after_dark_refresh_repeater_values();
@@ -169,11 +169,11 @@ jQuery(document).ready(function($) {
var mtFrame;
//Add image
$('.customize-control-mt-repeater').on( 'click', '.mt-upload-button', function( event ){
$('.customize-control-sad-repeater').on( 'click', '.sad-upload-button', function( event ){
event.preventDefault();
var imgContainer = $(this).closest('.mt-fields-wrap').find( '.thumbnail-image'),
placeholder = $(this).closest('.mt-fields-wrap').find( '.placeholder'),
var imgContainer = $(this).closest('.sad-fields-wrap').find( '.thumbnail-image'),
placeholder = $(this).closest('.sad-fields-wrap').find( '.placeholder'),
imgIdInput = $(this).siblings('.upload-id');
mtFrame = wp.media({
@@ -195,10 +195,10 @@ jQuery(document).ready(function($) {
});
// DELETE IMAGE LINK
$('.customize-control-mt-repeater').on( 'click', '.mt-delete-button', function( event ){
$('.customize-control-sad-repeater').on( 'click', '.sad-delete-button', function( event ){
event.preventDefault();
var imgContainer = $(this).closest('.mt-fields-wrap').find( '.thumbnail-image'),
placeholder = $(this).closest('.mt-fields-wrap').find( '.placeholder'),
var imgContainer = $(this).closest('.sad-fields-wrap').find( '.thumbnail-image'),
placeholder = $(this).closest('.sad-fields-wrap').find( '.placeholder'),
imgIdInput = $(this).siblings('.upload-id');
imgContainer.find('img').remove();
placeholder.removeClass('hidden');
@@ -208,15 +208,15 @@ jQuery(document).ready(function($) {
/**
* Repeater icon selector
*/
$('body').on('click', '.mt-repeater-icon-list li', function(){
$('body').on('click', '.sad-repeater-icon-list li', function(){
var icon_class = $(this).find('i').attr('class');
$(this).addClass('icon-active').siblings().removeClass('icon-active');
$(this).parent('.mt-repeater-icon-list').prev('.mt-repeater-selected-icon').children('i').attr('class','').addClass(icon_class);
$(this).parent('.mt-repeater-icon-list').next('input').val(icon_class).trigger('change');
$(this).parent('.sad-repeater-icon-list').prev('.sad-repeater-selected-icon').children('i').attr('class','').addClass(icon_class);
$(this).parent('.sad-repeater-icon-list').next('input').val(icon_class).trigger('change');
sophia_after_dark_refresh_repeater_values();
});
$('body').on('click', '.mt-repeater-selected-icon', function(){
$('body').on('click', '.sad-repeater-selected-icon', function(){
$(this).next().slideToggle();
});
});