Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ var firstTime = false; var saveCallbackFunction = null; var should_load_after_callback = false; pixflow_control_loading(); jQuery(document).ready(function ($) { "use strict"; var $t = true; $('.accordion-section-content').niceScroll({ horizrailenabled: false, cursorcolor: "rgba(204, 204, 204, 0.2)", cursorborder: "1px solid rgba(204, 204, 204, 0.2)", cursorwidth: "2px", railoffset: {top:0,left:10} }); pixflow_create_add_element_btn(); pixflow_themeVersion(); var settingSvg = ' '; var saveCountDown,settingCountDown, pannelFlag=false ; function pixflow_hidePannel() { 'use strict'; if ( pannelFlag ) { $('body').click(); var $target_el = $('.customizer-btn.setting .cd-dropdown-wrapper') ; $target_el.removeClass('active-dropdown-view'); setTimeout(function(){ $target_el.css({ display: 'none' }); } , 900); } } $('.customizer-btn.setting').click(function(){ var $target_el = $(this).find('.cd-dropdown-wrapper') ; $target_el.css({ display: 'block' }); setTimeout(function(){ $target_el.addClass('active-dropdown-view'); } , 10); }); $('.customizer-btn.setting').mouseleave(function() { settingCountDown = setTimeout(function () { pannelFlag = true; pixflow_hidePannel(); }, 500); }); $('.customizer-btn.setting').mouseenter(function() { pannelFlag = false; }); $('.customizer-btn.setting').mouseover(function() { clearTimeout(settingCountDown); }); $('#save-btn').mouseleave(function(){ saveCountDown = setTimeout(function() { $('#save-btn .cd-dropdown-wrapper .circle').css('transition-duration','1ms'); }, 500); }); $('#save-btn').mouseover(function() { clearTimeout(saveCountDown); }); $('body').click(function(){ $('.cd-dropdown-wrapper ul li .cd-dropdown-option').css({'background-image':'none'}); }); $('.cd-dropdown-wrapper ul li:not(.description)').click(function(e){ e.stopPropagation(); $('.cd-dropdown ul li .circle').removeClass('expand'); $(this).find('.circle').addClass('expand'); }); $('#customize-preview .customizer-btn .cd-dropdown-wrapper').mousemove(function(){ $(this).prev().css({'display': 'none','top': '5px','opacity':'0'}); }); var customizerLoader = $('
' + '
' + '' + '' + ' loading
' + '
'); $('.customizer-loading').css('display' , 'block'); customizerLoader.appendTo('body'); // open page on builder var leave_customizer_msg = "You're about to leave Site Setting", edit_content_msg = "You're about to edit content", add_element_msg = "You're about to add element"; $( '.md-shortcode-bt-customizer,' + '.customizer-options-menu a.dashboard,' + '.customizer-options-menu a.builder,' + '.customizer-options-menu .close a' ).click(function(e){ var $that = $(this); if($('#save').attr('value')!='Saved'){ //dont remove this line should_load_after_callback = true; saveCallbackFunction = function(){ var href = $that.attr('href'); if(typeof href == 'undefined' || href == ''){ window.location = wp.customize.previewer.previewUrl() + '?mbuilder=true' }else{ window.location = $that.attr('href'); } } if($that.hasClass('md-shortcode-bt-customizer')){ var leave_msg = add_element_msg; }else if($that.hasClass('builder')){ var leave_msg = edit_content_msg; }else{ var leave_msg = leave_customizer_msg; } pixflow_messageBox(leave_msg,'','Would you mind save your changes before leaving?','Update First',function () { $(window).unbind('beforeunload'); $('#save-btn').click(); },'Just Leave',function(){ $(window).unbind('beforeunload'); var href = $that.attr('href'); if(typeof href == 'undefined' || href == ''){ window.location = wp.customize.previewer.previewUrl() + '?mbuilder=true' }else{ window.location = $that.attr('href'); } },function () { return false; }); e.preventDefault(); return false; } }); $('.customizer-btn.builder').click(function(){ if(should_load_after_callback) { saveCallbackFunction = function() { if (wp.customize.previewer.previewUrl().search(/[?]/) == -1) { window.location = wp.customize.previewer.previewUrl() + '?mbuilder=true'; } else { window.location = wp.customize.previewer.previewUrl() + '&mbuilder=true'; } } }else{ if (wp.customize.previewer.previewUrl().search(/[?]/) == -1) { window.location = wp.customize.previewer.previewUrl() + '?mbuilder=true'; } else { window.location = wp.customize.previewer.previewUrl() + '&mbuilder=true'; } } }); $('li.close a.customizer-btn').attr('href',wp.customize.previewer.previewUrl()); }); function pixflow_themeVersion() { var mdThemeVersion = customizerValues.md_theme_version; $('#customize-controls').append('
'+ customizerValues.md_version_customizer_content + mdThemeVersion + ''+''+ customizerValues.md_version_customizer_content_2 +'
'); } function pixflow_add_element() { if(wp.customize.previewer.previewUrl().search(/[?]/)==-1) { var btn_location = wp.customize.previewer.previewUrl() + '?mbuilder=true'; }else{ var btn_location = wp.customize.previewer.previewUrl() + '&mbuilder=true'; } $('.md-shortcode-bt-customizer').attr('href',btn_location); } function pixflow_control_loading(){ setTimeout(function(){ document.querySelector('.wp-full-overlay').classList.add('show_customizer'); document.querySelector('.customizer-options-menu').classList.add('show_customizer'); } , 5000 ); } function pixflow_create_builder_bar() { var close_svg = ''; var customizer_options_menu = document.createElement('div'); customizer_options_menu.setAttribute('class', 'customizer-options-menu'); customizer_options_menu.innerHTML = '' + ''; document.body.appendChild(customizer_options_menu); var settingHtml= document.createElement('div'); settingHtml.setAttribute('class','cd-dropdown-wrapper'); settingHtml.setAttribute('id','massive-page-setting-drop'); settingHtml.innerHTML = ''; document.querySelector('.customizer-btn.setting').appendChild(settingHtml); } function pixflow_create_profile_bar(){ var header = document.createElement('div'); header.setAttribute('class','customizer-header'); header.innerHTML = "" + "

"+customizerSentences.fullname+"

"+customizerSentences.edit_profile+""; document.getElementById('customize-controls').insertBefore(header,document.getElementById('customize-header-actions')); } function pixflow_create_add_element_btn(){ var md_shortcodes_button = customizerValues.md_shortcodes_button_customizer; var add_element = document.createElement('a'); add_element.setAttribute('class','md-shortcode-bt-customizer'); add_element.innerHTML = ''+ md_shortcodes_button +''; document.getElementById('customize-controls').appendChild(add_element); pixflow_add_element(); } pixflow_create_builder_bar(); pixflow_create_profile_bar();