"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 ppadding=”vc_pixrow-no-padding”][vc_column width=”1\/2″][vc_line_chart style=”custom” values=”%5B%7B%22title%22%3A%22One%22%2C%22y_values%22%3A%2210%3B%2015%3B%2020%3B%2025%3B%2027%3B%2025%3B%2023%3B%2025%22%2C%22color%22%3A%22blue%22%2C%22custom_color%22%3A%22%23f26520%22%7D%2C%7B%22title%22%3A%22Two%22%2C%22y_values%22%3A%2225%3B%2018%3B%2016%3B%2017%3B%2020%3B%2025%3B%2030%3B%2035%22%2C%22color%22%3A%22pink%22%2C%22custom_color%22%3A%22%23494949%22%7D%5D”][\/vc_column][vc_column width=”1\/2″][vc_round_chart type=”doughnut” style=”custom” stroke_width=”2″ stroke_color=”custom” values=”%5B%7B%22title%22%3A%22One%22%2C%22value%22%3A%2260%22%2C%22color%22%3A%22peacoc%22%2C%22custom_color%22%3A%22%23f26520%22%7D%2C%7B%22title%22%3A%22Two%22%2C%22value%22%3A%2240%22%2C%22color%22%3A%22vista-blue%22%2C%22custom_color%22%3A%22%23494949%22%7D%5D” custom_stroke_color=”#f7f7f7″][vc_progress_bar values=”%5B%7B%22label%22%3A%22Development%22%2C%22value%22%3A%2290%22%2C%22color%22%3A%22custom%22%2C%22customcolor%22%3A%22%23f26520%22%2C%22customtxtcolor%22%3A%22%23ffffff%22%7D%2C%7B%22label%22%3A%22Design%22%2C%22value%22%3A%2280%22%2C%22color%22%3A%22custom%22%2C%22customcolor%22%3A%22%23dd9933%22%2C%22customtxtcolor%22%3A%22%23ffffff%22%7D%2C%7B%22label%22%3A%22Marketing%22%2C%22value%22%3A%2270%22%2C%22color%22%3A%22custom%22%2C%22customcolor%22%3A%22%23494949%22%2C%22customtxtcolor%22%3A%22%23ffffff%22%7D%5D”][\/vc_column][\/vc_row]<\/p>\n","protected":false},"excerpt":{"rendered":"
[vc_row ppadding=”vc_pixrow-no-padding”][vc_column width=”1\/2″][vc_line_chart style=”custom” values=”%5B%7B%22title%22%3A%22One%22%2C%22y_values%22%3A%2210%3B%2015%3B%2020%3B%2025%3B%2027%3B%2025%3B%2023%3B%2025%22%2C%22color%22%3A%22blue%22%2C%22custom_color%22%3A%22%23f26520%22%7D%2C%7B%22title%22%3A%22Two%22%2C%22y_values%22%3A%2225%3B%2018%3B%2016%3B%2017%3B%2020%3B%2025%3B%2030%3B%2035%22%2C%22color%22%3A%22pink%22%2C%22custom_color%22%3A%22%23494949%22%7D%5D”][\/vc_column][vc_column width=”1\/2″][vc_round_chart type=”doughnut” style=”custom” stroke_width=”2″ stroke_color=”custom” values=”%5B%7B%22title%22%3A%22One%22%2C%22value%22%3A%2260%22%2C%22color%22%3A%22peacoc%22%2C%22custom_color%22%3A%22%23f26520%22%7D%2C%7B%22title%22%3A%22Two%22%2C%22value%22%3A%2240%22%2C%22color%22%3A%22vista-blue%22%2C%22custom_color%22%3A%22%23494949%22%7D%5D” custom_stroke_color=”#f7f7f7″][vc_progress_bar values=”%5B%7B%22label%22%3A%22Development%22%2C%22value%22%3A%2290%22%2C%22color%22%3A%22custom%22%2C%22customcolor%22%3A%22%23f26520%22%2C%22customtxtcolor%22%3A%22%23ffffff%22%7D%2C%7B%22label%22%3A%22Design%22%2C%22value%22%3A%2280%22%2C%22color%22%3A%22custom%22%2C%22customcolor%22%3A%22%23dd9933%22%2C%22customtxtcolor%22%3A%22%23ffffff%22%7D%2C%7B%22label%22%3A%22Marketing%22%2C%22value%22%3A%2270%22%2C%22color%22%3A%22custom%22%2C%22customcolor%22%3A%22%23494949%22%2C%22customtxtcolor%22%3A%22%23ffffff%22%7D%5D”][\/vc_column][\/vc_row]<\/p>\n","protected":false},"author":285,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1955","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages\/1955"}],"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=1955"}],"version-history":[{"count":1,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages\/1955\/revisions"}],"predecessor-version":[{"id":3494,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/pages\/1955\/revisions\/3494"}],"wp:attachment":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/media?parent=1955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}