@@ -61,10 +61,11 @@ require([
6161 "jquery",
6262 "wysiwygAdapter",
6363 "Magento_Ui/js/modal/alert",
64+ 'Magento_Ui/js/modal/confirm',
6465 "mage/mage",
6566 "Magento_Email/js/variables",
6667 "prototype"
67- ], function(jQuery, tinyMCE, alert){
68+ ], function(jQuery, tinyMCE, alert, confirm ){
6869
6970//<![CDATA[
7071 jQuery('#email_template_edit_form').mage('form').mage('validation');
@@ -113,18 +114,22 @@ require([
113114 },
114115
115116 stripTags: function () {
116- if(!window.confirm("<?= $ block ->escapeJs ($ block ->escapeHtml (__ ('Are you sure you want to strip tags? ' ))) ?> ")) {
117- return false;
118- }
119- this.unconvertedText = $('template_text').value;
120- $('convert_button').hide();
121- $('template_text').value = $('template_text').value.stripScripts().replace(
122- new RegExp('<style[^>]*>[\\S\\s]*?</style>', 'img'), ''
123- ).stripTags().strip();
124- $('convert_button_back').show();
125- $('field_template_styles').hide();
126- this.typeChange = true;
127- return false;
117+ confirm({
118+ content: "<?= $ block ->escapeJs ($ block ->escapeHtml (__ ('Are you sure you want to strip tags? ' ))) ?> ",
119+ actions: {
120+ confirm: function () {
121+ this.unconvertedText = $('template_text').value;
122+ $('convert_button').hide();
123+ $('template_text').value = $('template_text').value.stripScripts().replace(
124+ new RegExp('<style[^>]*>[\\S\\s]*?</style>', 'img'), ''
125+ ).stripTags().strip();
126+ $('convert_button_back').show();
127+ $('field_template_styles').hide();
128+ this.typeChange = true;
129+ return false;
130+ }
131+ }
132+ });
128133 },
129134 unStripTags: function () {
130135 $('convert_button').show();
@@ -164,9 +169,14 @@ require([
164169 },
165170
166171 deleteTemplate: function() {
167- if(window.confirm("<?= $ block ->escapeJs ($ block ->escapeHtml (__ ('Are you sure you want to delete this template? ' ))) ?> ")) {
168- window.location.href = '<?= $ block ->escapeJs ($ block ->escapeUrl ($ block ->getDeleteUrl ())) ?> ';
169- }
172+ confirm({
173+ content: "<?= $ block ->escapeJs ($ block ->escapeHtml (__ ('Are you sure you want to delete this template? ' ))) ?> ",
174+ actions: {
175+ confirm: function () {
176+ window.location.href = '<?= $ block ->escapeJs ($ block ->escapeUrl ($ block ->getDeleteUrl ())) ?> ';
177+ }
178+ }
179+ });
170180 },
171181
172182 load: function() {
0 commit comments