"use strict"; /* Basic -------------------------------------------------------------- */ (function($) { var abrMetabox = {}; ( function() { var $this; abrMetabox = { /* * Initialize */ init: function( e ) { $this = abrMetabox; // Variables. $this.wrap = $( '.abr-metabox-wrap' ); // Init. $this.metaboxInit( e ); // Init events. $this.events( e ); }, /* * Events */ events: function( e ) { // Custom Events $this.wrap.on( 'click change keyup keydown', '.abr-metabox-repeater .attribute-name', $this.setSignature ); $this.wrap.on( 'click', '.abr-metabox-repeater .row-topbar', $this.toggleItems ); $this.wrap.on( 'click', '.abr-metabox-repeater .btn-remove-row', $this.removeRepeaterRow ); $this.wrap.on( 'click', '.abr-metabox-repeater .btn-add-row', $this.addRepeaterRow ); }, /* * Init metabox elements */ metaboxInit: function( e ) { // Add tabs for Meta Box (UI) $this.wrap.find( '.abr-metabox-tabs' ).tabs(); // Repeater sortable $this.wrap.find( '.abr-metabox-repeater tbody' ).sortable( { items: 'tr', placeholder: 'ui-state-highlight', handle: '.row-topbar, .row-handle', start: function( e, ui ) { ui.placeholder.height( ui.item.height() ); }, } ); }, /* * Toggle items */ toggleItems: function() { if ( $( this ).hasClass( 'closed' ) ) { $( this ).removeClass( 'closed' ); $( this ).siblings( '.row-fields' ).slideDown(); } else { $( this ).addClass( 'closed' ); $( this ).siblings( '.row-fields' ).slideUp(); } }, /* * Set signature */ setSignature: function() { var label = '' + $( this ).data( 'label' ) + ''; var value = $( this ).val() ? $( this ).val() : label; $( this ).parents( '.row-content' ).find( '.signature' ).html( value ); }, /* * Add repeater row */ addRepeaterRow: function() { var repeater = $( this ).siblings( '.abr-metabox-repeater-table' ) // Get html row. var html = repeater.find( 'tbody tr.hidden' ).html(); // Add new row. repeater.find( 'tbody' ).append( '
[vc_row][vc_column][vc_row_inner][vc_column_inner width=”1\/4″][vc_single_image image=”3437″ img_size=”full”][\/vc_column_inner][vc_column_inner width=”3\/4″][vc_column_text]<\/p>\n
[\/vc_column_text][\/vc_column_inner][\/vc_row_inner][vc_separator color=”custom” border_width=”3″ accent_color=”#f26520″ css=”.vc_custom_1565636467537{padding-top: 30px !important;padding-bottom: 30px !important;}”][vc_row_inner][vc_column_inner width=”1\/4″][\/vc_column_inner][vc_column_inner width=”3\/4″][vc_raw_html css=”.vc_custom_1630207809351{padding-top: 20px !important;padding-right: 40px !important;padding-bottom: 20px !important;padding-left: 40px !important;background-color: #d3d3d3 !important;}”]JTVCc2NoZWR1bGluZyUyMHNpdGUlM0QlMjJodHRwcyUzQSUyRiUyRmh5cGVyZmFybWVyY29uc3VsdGF0aW9uY2FsbC5hcy5tZSUyRnNjaGVkdWxlLnBocCUyMiU1RA==[\/vc_raw_html][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row full_width=”stretch_row_content_no_spaces” ppadding=”vc_pixrow-no-padding” css=”.vc_custom_1565643750974{padding-bottom: 0px !important;}”][vc_column][vc_single_image image=”16988″ img_size=”full” alignment=”center”][\/vc_column][\/vc_row]<\/p>\n","protected":false},"excerpt":{"rendered":"
[vc_row][vc_column][vc_row_inner][vc_column_inner width=”1\/4″][vc_single_image image=”3437″ img_size=”full”][\/vc_column_inner][vc_column_inner width=”3\/4″][vc_column_text] Get The Most From The Hyper-Farmer Experience By Requesting A Consultation\/Update Call Below: [\/vc_column_text][\/vc_column_inner][\/vc_row_inner][vc_separator color=”custom” border_width=”3″ accent_color=”#f26520″ css=”.vc_custom_1565636467537{padding-top: 30px !important;padding-bottom: 30px !important;}”][vc_row_inner][vc_column_inner width=”1\/4″][\/vc_column_inner][vc_column_inner width=”3\/4″][vc_raw_html css=”.vc_custom_1630207809351{padding-top: 20px !important;padding-right: 40px !important;padding-bottom: 20px !important;padding-left: 40px !important;background-color: #d3d3d3 !important;}”]JTVCc2NoZWR1bGluZyUyMHNpdGUlM0QlMjJodHRwcyUzQSUyRiUyRmh5cGVyZmFybWVyY29uc3VsdGF0aW9uY2FsbC5hcy5tZSUyRnNjaGVkdWxlLnBocCUyMiU1RA==[\/vc_raw_html][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row full_width=”stretch_row_content_no_spaces” ppadding=”vc_pixrow-no-padding” css=”.vc_custom_1565643750974{padding-bottom: 0px !important;}”][vc_column][vc_single_image image=”16988″ img_size=”full” alignment=”center”][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":285,"featured_media":19863,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"fullwidth.php","meta":{"footnotes":""},"class_list":["post-16983","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages\/16983"}],"collection":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/users\/285"}],"replies":[{"embeddable":true,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/comments?post=16983"}],"version-history":[{"count":6,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages\/16983\/revisions"}],"predecessor-version":[{"id":21559,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages\/16983\/revisions\/21559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/media\/19863"}],"wp:attachment":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/media?parent=16983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}