@@ -61,10 +61,11 @@ require([
61
61
"jquery",
62
62
"wysiwygAdapter",
63
63
"Magento_Ui/js/modal/alert",
64
+ 'Magento_Ui/js/modal/confirm',
64
65
"mage/mage",
65
66
"Magento_Email/js/variables",
66
67
"prototype"
67
- ], function(jQuery, tinyMCE, alert){
68
+ ], function(jQuery, tinyMCE, alert, confirm ){
68
69
69
70
//<![CDATA[
70
71
jQuery('#email_template_edit_form').mage('form').mage('validation');
@@ -113,18 +114,22 @@ require([
113
114
},
114
115
115
116
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
+ });
128
133
},
129
134
unStripTags: function () {
130
135
$('convert_button').show();
@@ -164,9 +169,14 @@ require([
164
169
},
165
170
166
171
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
+ });
170
180
},
171
181
172
182
load: function() {
0 commit comments