| Server IP : 38.190.208.107 / Your IP : 216.73.216.187 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/www.huomanshiye.com/wp-content/themes/betheme/muffin-options/fields/tabs/ |
Upload File : |
(function($) {
/* globals jQuery */
"use strict";
function mfnFieldTabs() {
var group = '.form-group.tabs ';
// add
$('.mfn-ui').on('click', group + '.mfn-button-add', function(e) {
e.preventDefault();
var $form = $(this).closest('.form-group'),
$clone = $('li.default', $form).clone(true);
$('.tabs-wrapper', $form).append( $clone );
$clone.find('input, textarea').each(function(){
$(this).attr('name', $(this).data('default') )
.removeAttr('data-default');
});
$clone.siblings().removeClass('show');
$clone.removeClass('default').addClass('show')
.hide().fadeIn(200);
});
// delete
$('.mfn-ui').on('click', group + '.mfn-tab-delete', function(e) {
e.preventDefault();
$(this).closest('.tab').fadeOut( 200, function() {
$(this).remove();
});
});
// clone
$('.mfn-ui').on('click', group + '.mfn-tab-clone', function(e) {
e.preventDefault();
var $tab = $(this).closest('.tab'),
$clone = $tab.clone(true);
$tab.removeClass('show').after( $clone );
$clone.hide().fadeIn(200);
});
// toggle
$('.mfn-ui').on('click', group + '.mfn-tab-toggle', function(e) {
e.preventDefault();
var $tab = $(this).closest('.tab');
$('input', $tab).trigger('change');
$tab.toggleClass('show')
.siblings().removeClass('show');
});
// move title to header
$('.mfn-ui').on('change', group + '.js-title', function(e) {
e.preventDefault();
var $tab = $(this).closest('.tab');
var val = $(this).val();
$('.tab-header .title', $tab).text(val);
});
// sort
$(document).on('mfn:builder:edit', function( $this, modal ){
var $modal = $(modal);
$('.tabs-wrapper', $modal).sortable({
axis: 'y',
cursor: 'ns-resize',
handle: '.tab-header',
opacity: 0.9
});
});
$(document).on('mfn:builder:close', function( $this ){
$('.tabs-wrapper.ui-sortable').sortable('destroy');
});
}
/**
* $(document).ready
* Specify a function to execute when the DOM is fully loaded.
*/
$(function($) {
mfnFieldTabs();
});
})(jQuery);