✏️ 正在编辑: customizer.js
路径:
/home/ubuntu/plugins-bkp-26012025/ocean-social-sharing/assets/js/customizer.js
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
/** * Customizer enhancements for a better user experience. * * Contains handlers to make Theme Customizer preview reload changes asynchronously. */ var api = wp.customize, style = [ 'minimal', 'colored', 'dark' ], headerPosition = [ 'side', 'top' ]; api('oss_social_share_name', function(value) { value.bind(function(newVal) { var socialWraps = document.querySelectorAll('.entry-share'); if (socialWraps.length) { socialWraps.forEach(function(element) { if (newVal === true) { element.classList.add('has-name'); } else { element.classList.remove('has-name'); } }); } }); }); api('oss_social_share_heading', function(value) { var headings = document.querySelectorAll('.social-share-title span.text'); if (headings.length) { var originalHeadings = Array.from(headings).map(function(heading) { return heading.innerHTML; }); value.bind(function(newval) { headings.forEach(function(heading, index) { if (newval) { heading.innerHTML = newval; } else { heading.innerHTML = originalHeadings[index]; } }); }); } }); api('oss_social_share_heading_position', function(value) { value.bind(function(newval) { var socialWraps = document.querySelectorAll('.entry-share'); if (socialWraps.length) { socialWraps.forEach(function(socialWrap) { headerPosition.forEach(function(position) { socialWrap.classList.remove(position); }); socialWrap.classList.add(newval); }); } }); }); api('oss_social_share_style', function(value) { value.bind(function(newval) { var socialWraps = document.querySelectorAll('.entry-share'); if (socialWraps.length) { socialWraps.forEach(function(socialWrap) { style.forEach(function(styleClass) { socialWrap.classList.remove(styleClass); }); socialWrap.classList.add(newval); }); } }); });
💾 保存文件
← 返回文件管理器