replace all mt- to sad-
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* Image uploader functions
|
||||
*/
|
||||
|
||||
@ -51,9 +51,9 @@ jQuery(($) => {
|
||||
'use strict';
|
||||
|
||||
// Initialize jQuery UI buttonset for radio image controls
|
||||
$('.mt-meta-options-wrap .buttonset').buttonset();
|
||||
$('.sad-meta-options-wrap .buttonset').buttonset();
|
||||
|
||||
// Initialize image upload/delete functionality
|
||||
initUploadMediaImage('.mt-upload-button');
|
||||
initDeleteMediaImage('.mt-delete-button');
|
||||
initUploadMediaImage('.sad-upload-button');
|
||||
initDeleteMediaImage('.sad-delete-button');
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@ -26,10 +26,10 @@ jQuery(document).ready(function($) {
|
||||
/**
|
||||
* Header Search script
|
||||
*/
|
||||
const $searchIcon = $('.mt-menu-search .mt-search-icon');
|
||||
const $searchIcon = $('.sad-menu-search .sad-search-icon');
|
||||
$searchIcon.click(function() {
|
||||
$('.mt-form-wrap').toggleClass('search-activate').find('.search-field').focus();
|
||||
const $element = $('.mt-form-wrap.search-activate');
|
||||
$('.sad-form-wrap').toggleClass('search-activate').find('.search-field').focus();
|
||||
const $element = $('.sad-form-wrap.search-activate');
|
||||
if ($element.length) {
|
||||
$(document).on('keydown', function(e) {
|
||||
const focusable = $element.find('input, button, [href], select, textarea, [tabindex]:not([tabindex="-1"])');
|
||||
@ -57,9 +57,9 @@ jQuery(document).ready(function($) {
|
||||
}
|
||||
}
|
||||
|
||||
$('.mt-form-wrap .mt-form-close').click(function() {
|
||||
$('.mt-form-wrap').toggleClass('search-activate');
|
||||
$(this).parents('.mt-menu-search').find('.mt-search-icon a').focus();
|
||||
$('.sad-form-wrap .sad-form-close').click(function() {
|
||||
$('.sad-form-wrap').toggleClass('search-activate');
|
||||
$(this).parents('.sad-menu-search').find('.sad-search-icon a').focus();
|
||||
});
|
||||
|
||||
/**
|
||||
@ -68,7 +68,7 @@ jQuery(document).ready(function($) {
|
||||
$(document).on('keydown', function(event) {
|
||||
if (event.keyCode === 27) {
|
||||
event.preventDefault();
|
||||
$('.mt-menu-search .mt-form-wrap').removeClass('search-activate');
|
||||
$('.sad-menu-search .sad-form-wrap').removeClass('search-activate');
|
||||
}
|
||||
});
|
||||
|
||||
@ -84,7 +84,7 @@ jQuery(document).ready(function($) {
|
||||
*/
|
||||
if (sophia_after_darkObject.menu_sticky === 'on') {
|
||||
const wpAdminBar = $('#wpadminbar').length ? $('#wpadminbar') : 0;
|
||||
$(".mt-social-menu-wrapper").sticky({
|
||||
$(".sad-social-menu-wrapper").sticky({
|
||||
topSpacing: wpAdminBar.length ? wpAdminBar.height() : 0
|
||||
});
|
||||
}
|
||||
@ -94,13 +94,13 @@ jQuery(document).ready(function($) {
|
||||
*/
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > 1000) {
|
||||
$('#mt-scrollup').fadeIn('slow');
|
||||
$('#sad-scrollup').fadeIn('slow');
|
||||
} else {
|
||||
$('#mt-scrollup').fadeOut('slow');
|
||||
$('#sad-scrollup').fadeOut('slow');
|
||||
}
|
||||
});
|
||||
|
||||
$('#mt-scrollup').click(function() {
|
||||
$('#sad-scrollup').click(function() {
|
||||
$("html, body").animate({
|
||||
scrollTop: 0
|
||||
}, 600);
|
||||
@ -128,14 +128,14 @@ jQuery(document).ready(function($) {
|
||||
}
|
||||
|
||||
initializeSlider('.front-slider');
|
||||
initializeSlider('.mt-gallery-slider', false);
|
||||
initializeSlider('.sad-gallery-slider', false);
|
||||
|
||||
/**
|
||||
* Responsive menu
|
||||
*/
|
||||
$('.mt-social-menu-wrapper .menu-toggle').click(function() {
|
||||
$('.sad-social-menu-wrapper .menu-toggle').click(function() {
|
||||
$('#site-navigation').toggleClass('isActive').slideToggle('slow');
|
||||
const $element = $('.mt-header-menu-wrap');
|
||||
const $element = $('.sad-header-menu-wrap');
|
||||
if ($element.length) {
|
||||
$(document).on('keydown', function(e) {
|
||||
if ($('#site-navigation.isActive').length) {
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user