"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( '' + html + '' ); // Visible all input and textarea. repeater.find( 'tr' ).not( '.hidden' ).find( 'input, textarea' ).removeAttr( 'disabled' ); return false; }, /* * Remove repeater row */ removeRepeaterRow: function() { $( this ).parents( '.row' ).remove(); return false; } }; } )(); // Initialize. $( function() { abrMetabox.init(); } ); })(jQuery); /* Reviews -------------------------------------------------------------- */ (function($) { var abrReviews = {}; ( function() { var $this; abrReviews = { /* * Initialize */ init: function( e ) { $this = abrReviews; // Variables. $this.wrap = $( '.review-wrap' ); // Init. $this.reviewsInit( e ); // Init events. $this.events( e ); }, /* * Events */ events: function( e ) { // Custom Events $this.wrap.on( 'click', 'input[name="abr_review_settings"]', $this.toggleMetaBox ); $this.wrap.on( 'click', 'input[name="abr_review_auto_score"]', $this.actionAutoScore ); $this.wrap.on( 'change', 'select[name="abr_review_schema_author"]', $this.actionSchemaAuthor ); }, /* * Init reviews elements */ reviewsInit: function( e ) { $this.actionAutoScore( 'input[name="abr_review_auto_score"]' ); $this.actionSchemaAuthor( 'select[name="abr_review_schema_author"]' ); }, /* * Toggle metabox view */ toggleMetaBox: function() { if ( $( this ).prop( 'checked' ) ) { $this.wrap.find( '.abr-metabox-tabs' ).attr( 'checked', 'checked' ); } else { $this.wrap.find( '.abr-metabox-tabs' ).removeAttr( 'checked' ); } }, /* * Action auto score */ actionAutoScore: function( e ) { let checked = $( typeof e === 'string' ? e : this ).prop('checked'); if ( checked ) { $( '.review-field-total-score' ).addClass( 'hidden' ); } else { $( '.review-field-total-score' ).removeClass( 'hidden' ); } }, /* * Action schema author */ actionSchemaAuthor: function( e ) { let val = $( typeof e === 'string' ? e : this ).val(); if ( 'custom' !== val ) { $( '.review-field-schema-author-custom' ).addClass( 'hidden' ); } else { $( '.review-field-schema-author-custom' ).removeClass( 'hidden' ); } }, }; } )(); // Initialize. $( function() { abrReviews.init(); }); })(jQuery);{"id":13990,"date":"2018-11-05T06:07:27","date_gmt":"2018-11-05T06:07:27","guid":{"rendered":"https:\/\/www.hyperfarmer.com\/?post_type=product&p=13990"},"modified":"2018-12-28T13:36:13","modified_gmt":"2018-12-28T20:36:13","slug":"3-5x8-5-door-hangers","status":"publish","type":"product","link":"https:\/\/hyperfarmer.com\/product\/3-5x8-5-door-hangers\/","title":{"rendered":"3.5\u00d78.5 Door Hangers"},"content":{"rendered":"","protected":false},"excerpt":{"rendered":"
\n
\n

16pt with UV<\/strong>
\nDesign $25<\/strong><\/p>\n<\/div>\n<\/div>\n

\n
\n\n\n\n\n\n\n
QUANTITY<\/td>\nPRICING<\/td>\n<\/tr>\n
500<\/td>\n$125<\/td>\n<\/tr>\n
1000<\/td>\n$175 | Perforated $225<\/td>\n<\/tr>\n
2500<\/td>\n$275 | Perforated $375<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n","protected":false},"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"product_cat":[247],"product_tag":[],"class_list":{"0":"post-13990","1":"product","2":"type-product","3":"status-publish","5":"product_cat-design-and-print","7":"first","8":"instock","9":"shipping-taxable","10":"purchasable","11":"product-type-variable"},"_links":{"self":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/product\/13990"}],"collection":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/types\/product"}],"replies":[{"embeddable":true,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/comments?post=13990"}],"wp:attachment":[{"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/media?parent=13990"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/product_cat?post=13990"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/hyperfarmer.com\/wp-json\/wp\/v2\/product_tag?post=13990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}