popup_container.phtml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Popup container template.
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. *
  8. * @var \Magento\Backend\Block\Template $block
  9. */
  10. // @codingStandardsIgnoreFile
  11. ?>
  12. <script>
  13. require([
  14. "jquery",
  15. 'Magento_Ui/js/modal/confirm',
  16. "jquery/ui",
  17. "Magento_Integration/js/integration",
  18. 'mage/dataPost'
  19. ], function ($, Confirm) {
  20. window.integration = new Integration(
  21. '<?= /* @escapeNotVerified */ $block->getUrl('*/*/permissionsDialog', ['id' => ':id', 'reauthorize' => ':isReauthorize', '_escape_params' => false]) ?>',
  22. '<?= /* @escapeNotVerified */ $block->getUrl('*/*/tokensDialog', ['id' => ':id', 'reauthorize' => ':isReauthorize', '_escape_params' => false]) ?>',
  23. '<?= /* @escapeNotVerified */ $block->getUrl('*/*/tokensExchange', ['id' => ':id', 'reauthorize' => ':isReauthorize', '_escape_params' => false]) ?>',
  24. '<?= /* @escapeNotVerified */ $block->getUrl('*/*') ?>',
  25. '<?= /* @escapeNotVerified */ $block->getUrl('*/*/loginSuccessCallback') ?>'
  26. );
  27. /**
  28. * Confirm dialog for delete integration action
  29. */
  30. $(function () {
  31. $('div#integrationGrid').on('click', 'button#delete', function (e) {
  32. new Confirm({
  33. title: '<?= /* @escapeNotVerified */ __('Are you sure?') ?>',
  34. content: "<?= /* @escapeNotVerified */ __("Are you sure you want to delete this integration? You can't undo this action.") ?>",
  35. actions: {
  36. confirm: function () {
  37. $.mage.dataPost().postData({action: $(e.target).data('url'), data: {}});
  38. }
  39. }
  40. });
  41. e.stopPropagation();
  42. });
  43. });
  44. });
  45. </script>
  46. <div id="integration-popup-container" style="display: none;"></div>