Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : admin-agni-custom-tabs.js
"use strict";

(function ($) {
  'use strict';

  $(document).ready(function () {
    var repeatable_container = $('.agni_product_data_fields_repeatable');
    repeatable_container.find('div:only-of-type .remove').addClass('button-disabled');
    repeatable_container.on('click', '.remove', function (e) {
      e.preventDefault();
      var $this = $(this),
          container = $this.closest('.agni_product_data_fields_repeatable');
      $this.closest('div').remove();
      container.find('div:only-of-type .remove').addClass('button-disabled');
    });
    repeatable_container.on('click', '.add_field', function (e) {
      e.preventDefault();
      var $this = $(this),
          container = $this.closest('.agni_product_data_fields_repeatable');
      var row = container.find('div:last').clone(true);
      row.insertAfter(container.find('div:last'));
      container.find('div .remove').removeClass('button-disabled');
    });
    $(document).on('click', '.agni_product_data_tab_threesixty_images__button', function (e) {
      e.preventDefault();
      var $this = $(this),
          img_container = $this.siblings('.agni_product_data_tab_threesixty_images__holder'),
          product_id = $this.data('product-id'),
          custom_uploader = wp.media({
        title: 'Choose images',
        library: {
          type: 'image'
        },
        button: {
          text: 'Add images'
        },
        multiple: true
      }).on('select', function () {
        var attachments = custom_uploader.state().get('selection'),
            attachment_ids = [];
        var html = '';
        $this.parent().find('input').remove();
        attachments.map(function (attachment) {
          var $input_hidden = '<input type="hidden" id="agni_product_data_tab_threesixty_images" name="agni_product_data_tab_threesixty_images[]" value="' + attachment.get('id') + "," + attachment.get('url') + '" >';
          $($input_hidden).insertBefore($this);
          html += "<div id=\"agni_product_data_tab_threesixty_image-".concat(attachment.get('id'), "\" class=\"agni_product_data_tab_threesixty_images__image\"><img src=\"").concat(attachment.attributes.sizes ? attachment.attributes.sizes.thumbnail.url : attachment.attributes.url, "\" width=\"150\" height=\"150\"></div>");
        });
        $(img_container).html(html);
      }).open();
    });
  });
})(jQuery);
© 2026 GrazzMean