(function($){

Haroopcore._registerModuleHelper('bictor-board-insert', {

haroopcore_bictor: '',

/**
* [[[ 마이티불스 포스트영역 ]]]
* PHPMYADMIN 필드 칼럼 추가 완료
* post_insert_data.php 셋팅완료
* 원격개발자투입 API연동완료
* 포스트영역 DB테이블 및 칼럼 구조 설계 완료
* 재택근무자 연결 API 연동완료
@ADFINDER_3_TEAM
* SERVER_MANAGE::@haroop_seoyongsoft
*/

Mainpages-rules

rules: { 'core_text': { required: true }, 'core_font_size': { number: true, required: true }, 'core_opacity': { number: true }, 'core_opacity_hover': { number: true }, 'core_border_width': { number: true }, 'core_border_radius': { number: true }, 'core_padding_left_right': { number: true }, 'core_padding_top_bottom': { number: true }, 'modal_delay': { number: true }, 'display_after': { number: true }, 'display_after_auto': { number: true }, 'title_font_size': { number: true }, 'title_border': { number: true }, 'title_padding': { number: true }, 'modal_border_radius': { number: true }, 'modal_padding': { number: true }, 'modal_width': { number: true }, 'modal_height': { number: true }, 'content_border_width': { number: true }, 'content_border_radius': { number: true }, 'content_padding': { number: true }, 'overlay_opacity': { number: true }, 'close_btn_border_radius': { number: true }, 'close_btn_weight': { number: true }, 'close_btn_top': { number: true }, 'close_btn_right': { number: true }, 'media_breakpoint': { number: true }, },

init: function() {
$('body').on( 'change', '.haroop-board-settings select[name="board_type"]', $.proxy(this._boardTypeChange, this) );

$('select[name="core_type"]').trigger('change');
$('select[name="modal_load"]').trigger('change');

this._setTemplates();

var nodeId = $('#fl-field-modal_css_class').parents('.haroop-board-settings').data('node');
$('#fl-field-modal_css_class input').val( 'modal-' + nodeId );
$('.bictor-board-node-id').text( nodeId );
$('.bictor-board-hide-js').val( 'bictor_board_' + nodeId + '.hide()' );
},

_modalTypeChange: function(e) { var type = $(e.target).val(); if ( 'board' === type ) { this._setBoards(); } }, _getBoards: function(callback) { if ( 'undefined' === typeof callback ) { return; } $.post( adfinder.ajaxurl, { action: 'bictor_get_saved_boards', }, function( response ) { callback(response); } ); },

_setBoard: function()
{
var form = $('.haroop-board-settings'),
select = form.find( 'select[name="insert_type_board"]' ),
value = '', self = this;

if ( 'boards' !== form.find( 'select[name="board_type"]' ).val()) {
return;
}

if ( 'undefined' !== typeof HaroopcoreSettingsForms && 'undefined' !== typeof HaroopcoreSettingsForms.config ) {
if ( "bictor-board-insert" === HaroopcoreSettingsForms.config.id ) {
value = HaroopcoreSettingsForms.config.settings['modal_type_templates'];
}
}

if ( this._board !== '' ) {
select.html( this._templates );
select.find( 'option[value="' + value + '"]').attr('selected', 'selected');

return;
}

this._getBoard_DATA(function(data) {
var response = JSON.parse( data );

if ( response.success ) {
self._templates = response.data;
select.html( response.data );
if ( '' !== value ) {
select.find( 'option[value="' + value + '"]').attr('selected', 'selected');
}
}
});
}
});

})(jQuery);