PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 6.2.2
MainWP Dashboard: Self-hosted WordPress Management for Agencies v6.2.2
6.2.3 6.2.2 6.2.1 6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 All 156 releases
← All changes | assets/js/mainwp-ui.js +33 -23 6.1 → 6.2.2 View file →
@@ -35,9 +35,9 @@
35 35
36 36 if (e !== undefined)
37 37 e.preventDefault();
38 38
39 - jQuery('#wpbody-content').html('<div class="mainwp-loading"><img src="images/loading.gif" /> ' + __('Please wait...') + '</div>');
39 + jQuery('#wpbody-content').html('<div class="mainwp-loading"><img src="images/loading.gif" /> ' + MainWP.I18n.t('Please wait...') + '</div>');
40 40 if (jQuery(obj).hasClass('menu-top')) {
41 41 let top = jQuery(obj).closest('li.menu-top');
42 42 jQuery('#adminmenu .current').removeClass('current').addClass('wp-not-current-submenu');
43 43 jQuery('.wp-has-current-submenu').removeClass('wp-has-current-submenu').addClass('wp-not-current-submenu');
@@ -468,8 +468,18 @@
468 468 catsSelection.dropdown('refresh');
469 469 let arrVal = pSelectedCategories.split(",");
470 470 catsSelection.dropdown('set selected', arrVal);
471 471 updateCategoriesPostFunc();
472 + let popWrapper = jQuery('#categorychecklist .mainwp-html-popup');
473 + if( popWrapper.length > 0 ) {
474 + jQuery(popWrapper).each(
475 + function(){
476 + const popupContent = jQuery(this).attr('html-popup-content') ?? '';
477 + mainwp_init_html_popup(this, mainwp_escape_html(popupContent));
478 + }
479 + );
480 + }
481 +
472 482 }
473 483 };
474 484 }(selected_categories), 'json');
475 485 } else {
@@ -726,9 +736,9 @@
726 736 let slug = jQuery(iconObj).attr('item-slug');
727 737
728 738 let deleteIcon = jQuery('#mainwp_delete_image_chk').is(':checked');
729 739
730 - let msg = __('Updating the icon. Please wait...');
740 + let msg = MainWP.I18n.t('Updating the icon. Please wait...');
731 741 mainwp_set_message_zone('#mainwp-message-zone-upload', '<i class="notched circle loading icon"></i> ' + msg, '');
732 742 jQuery('#update_custom_icon_btn').attr('disabled', 'disabled');
733 743
734 744 //Add via ajax!!
@@ -749,19 +759,19 @@
749 759 let msg = '';
750 760
751 761 if (type === 'plugin') {
752 762 if (jQuery('#mainwp-show-plugins').length > 0) {
753 - msg = __('Loading...');
763 + msg = MainWP.I18n.t('Loading...');
754 764 mainwp_fetch_plugins();
755 765 }
756 766 } else if (jQuery('#mainwp_show_themes').length > 0) {
757 - msg = __('Loading...');
767 + msg = MainWP.I18n.t('Loading...');
758 768 mainwp_fetch_themes();
759 769 }
760 770 if (msg === '') {
761 771 mainwp_set_message_zone('#mainwp-message-zone-upload');
762 772 } else {
763 - mainwp_set_message_zone('#mainwp-message-zone-upload', '<i class="notched circle loading icon"></i> ' + __('Loading...'), '');
773 + mainwp_set_message_zone('#mainwp-message-zone-upload', '<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Loading...'), '');
764 774 }
765 775 setTimeout(function () {
766 776 mainwp_forceReload();
767 777 }, 3000);
@@ -767,9 +777,9 @@
767 777 }, 3000);
768 778 } else if (response.error) {
769 779 feedback('mainwp-message-zone-upload', response.error, 'red');
770 780 } else {
771 - feedback('mainwp-message-zone-upload', __('Undefined error. Please try again.'), 'red');
781 + feedback('mainwp-message-zone-upload', MainWP.I18n.t('Undefined error. Please try again.'), 'red');
772 782 }
773 783 },
774 784 error: function () {
775 785 },
@@ -868,9 +878,9 @@
868 878 });
869 879 };
870 880
871 881 let mainwp_upload_custom_types_icon = function (iconObj, uploadAct, iconItemId, iconFileSlug, deleteIcon, callback_uploaded) {
872 - let msg = __('Updating the icon. Please wait...');
882 + let msg = MainWP.I18n.t('Updating the icon. Please wait...');
873 883 mainwp_set_message_zone('#mainwp-message-zone-upload', '<i class="notched circle loading icon"></i> ' + msg, '');
874 884 jQuery('#update_custom_icon_btn').attr('disabled', 'disabled');
875 885
876 886 let upload_act = uploadAct !== undefined && uploadAct !== '' ? uploadAct : 'mainwp_upload_custom_types_icon';
@@ -900,9 +910,9 @@
900 910 }
901 911 } else if (response.error) {
902 912 feedback('mainwp-message-zone-upload', response.error, 'red');
903 913 } else {
904 - feedback('mainwp-message-zone-upload', __('Undefined error. Please try again.'), 'red');
914 + feedback('mainwp-message-zone-upload', MainWP.I18n.t('Undefined error. Please try again.'), 'red');
905 915 }
906 916 },
907 917 error: function () {
908 918 },
@@ -1018,15 +1028,15 @@
1018 1028 globalThis.mainwpUIHandleWidgetsLayout = (function () {
1019 1029 const statusElemId = '#mainwp-common-edit-widgets-layout-status';
1020 1030 let _instance = {
1021 1031 loadingStatus: function () {
1022 - jQuery(statusElemId).html('<i class="notched circle loading icon"></i> ' + __('Loading layouts. Please wait...')).show();
1032 + jQuery(statusElemId).html('<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Loading layouts. Please wait...')).show();
1023 1033 },
1024 1034 savingStatus: function () {
1025 - jQuery(statusElemId).html('<i class="notched circle loading icon"></i> ' + __('Saving layout. Please wait...')).show();
1035 + jQuery(statusElemId).html('<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Saving layout. Please wait...')).show();
1026 1036 },
1027 1037 deletingStatus: function () {
1028 - jQuery(statusElemId).html('<i class="notched circle loading icon"></i> ' + __('Deleting layout. Please wait...')).show();
1038 + jQuery(statusElemId).html('<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Deleting layout. Please wait...')).show();
1029 1039
1030 1040 },
1031 1041 showWorkingStatus: function (status, addClass) {
1032 1042 if (addClass) {
@@ -1038,9 +1048,9 @@
1038 1048 hideWorkingStatus: function () {
1039 1049 jQuery(statusElemId).removeClass('red green').hide();
1040 1050 },
1041 1051 showLayout: function (showBtn) {
1042 - jQuery('#mainwp-common-edit-widgets-layout-modal > div.header').html(__('Save Layout'));
1052 + jQuery('#mainwp-common-edit-widgets-layout-modal > div.header').html(MainWP.I18n.t('Save Layout'));
1043 1053 jQuery('#mainwp-common-edit-widgets-layout-edit-fields').show();
1044 1054 jQuery('#mainwp-common-edit-widgets-layout-save-button').show();
1045 1055 jQuery('#mainwp-common-layout-widgets-select-fields').hide();
1046 1056 jQuery('#mainwp-common-edit-widgets-select-layout-button').hide();
@@ -1057,9 +1067,9 @@
1057 1067 },
1058 1068 loadSegment: function (loadCallback) {
1059 1069 jQuery('#mainwp-common-edit-widgets-layout-edit-fields').hide();
1060 1070 jQuery('#mainwp-common-edit-widgets-layout-save-button').hide();
1061 - jQuery('#mainwp-common-edit-widgets-layout-modal > div.header').html(__('Load Layout'));
1071 + jQuery('#mainwp-common-edit-widgets-layout-modal > div.header').html(MainWP.I18n.t('Load Layout'));
1062 1072 jQuery('#mainwp-common-layout-widgets-select-fields').show();
1063 1073 jQuery('#mainwp-common-edit-widgets-select-layout-button').show();
1064 1074 jQuery('#mainwp-common-edit-widgets-layout-delete-button').show();
1065 1075 this.hideWorkingStatus();
@@ -1162,9 +1172,9 @@
1162 1172 let data = mainwp_secure_data({
1163 1173 action: 'mainwp_ui_load_widgets_layout',
1164 1174 settings_slug: jQuery('#mainwp-manage-widgets-load-saved-layout-button').attr('settings-slug')
1165 1175 });
1166 - mainwpUIHandleWidgetsLayout.showWorkingStatus('<i class="notched circle loading icon"></i> ' + __('Loading layouts. Please wait...'), '');
1176 + mainwpUIHandleWidgetsLayout.showWorkingStatus('<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Loading layouts. Please wait...'), '');
1167 1177 jQuery.post(ajaxurl, data, function (response) {
1168 1178 if (response.error != undefined) {
1169 1179 mainwpUIHandleWidgetsLayout.showWorkingStatus(response.error, 'red');
1170 1180 } else if (response.result) {
@@ -1171,9 +1181,9 @@
1171 1181 mainwpUIHandleWidgetsLayout.showResults(response.result);
1172 1182 jQuery('#mainwp-common-edit-widgets-select-layout-button').addClass('disabled');
1173 1183 jQuery('#mainwp-common-edit-widgets-layout-delete-button').addClass('disabled');
1174 1184 } else {
1175 - mainwpUIHandleWidgetsLayout.showWorkingStatus(__('No saved layouts found.'), 'yellow');
1185 + mainwpUIHandleWidgetsLayout.showWorkingStatus(MainWP.I18n.t('No saved layouts found.'), 'yellow');
1176 1186 }
1177 1187 }, 'json');
1178 1188 };
1179 1189
@@ -1215,9 +1225,9 @@
1215 1225
1216 1226 let seg_name = jQuery('#mainwp-common-edit-widgets-layout-name').val().trim();
1217 1227
1218 1228 if ('' == seg_name) {
1219 - mainwpUIHandleWidgetsLayout.showWorkingStatus(__('Please enter a layout name.'), 'yellow');
1229 + mainwpUIHandleWidgetsLayout.showWorkingStatus(MainWP.I18n.t('Please enter a layout name.'), 'yellow');
1220 1230 return false;
1221 1231 }
1222 1232
1223 1233 let data = {
@@ -1225,15 +1235,15 @@
1225 1235 seg_id: jQuery('#mainwp-manage-widgets-load-saved-layout-button').attr('selected-layout-id'),
1226 1236 settings_slug: jQuery('#mainwp-manage-widgets-load-saved-layout-button').attr('settings-slug')
1227 1237 };
1228 1238
1229 - mainwpUIHandleWidgetsLayout.showWorkingStatus('<i class="notched circle loading icon"></i> ' + __('Saving layout. Please wait...'), '');
1239 + mainwpUIHandleWidgetsLayout.showWorkingStatus('<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Saving layout. Please wait...'), '');
1230 1240
1231 1241 mainwp_common_ui_widgets_save_layout('.grid-stack-item', data, function (response) {
1232 1242 if (response.error != undefined) {
1233 1243 mainwpUIHandleWidgetsLayout.showWorkingStatus(response.error, 'red');
1234 1244 } else if (response.result == 'SUCCESS') {
1235 - mainwpUIHandleWidgetsLayout.showWorkingStatus(__('Layout saved successfully.'), 'green');
1245 + mainwpUIHandleWidgetsLayout.showWorkingStatus(MainWP.I18n.t('Layout saved successfully.'), 'green');
1236 1246 setTimeout(function () {
1237 1247 jQuery('#mainwp-common-edit-widgets-layout-status').fadeOut(300);
1238 1248 jQuery('#mainwp-common-edit-widgets-layout-modal').modal('hide');
1239 1249 mainwp_forceReload();
@@ -1238,9 +1248,9 @@
1238 1248 jQuery('#mainwp-common-edit-widgets-layout-modal').modal('hide');
1239 1249 mainwp_forceReload();
1240 1250 }, 2000);
1241 1251 } else {
1242 - mainwpUIHandleWidgetsLayout.showWorkingStatus(__('An error occurred while saving the layout.'), 'red');
1252 + mainwpUIHandleWidgetsLayout.showWorkingStatus(MainWP.I18n.t('An error occurred while saving the layout.'), 'red');
1243 1253 }
1244 1254 });
1245 1255 e.preventDefault();
1246 1256 e.stopPropagation();
@@ -1290,9 +1300,9 @@
1290 1300 action: 'mainwp_ui_delete_widgets_layout',
1291 1301 seg_id: seg_id,
1292 1302 settings_slug: jQuery('#mainwp-manage-widgets-load-saved-layout-button').attr('settings-slug')
1293 1303 });
1294 - mainwpUIHandleWidgetsLayout.showWorkingStatus('<i class="notched circle loading icon"></i> ' + __('Deleting layout. Please wait...'), '');
1304 + mainwpUIHandleWidgetsLayout.showWorkingStatus('<i class="notched circle loading icon"></i> ' + MainWP.I18n.t('Deleting layout. Please wait...'), '');
1295 1305 jQuery.post(ajaxurl, data, (response) => {
1296 1306
1297 1307 $button.removeAttr('running');
1298 1308
@@ -1298,15 +1308,15 @@
1298 1308
1299 1309 if (response.error != undefined) {
1300 1310 mainwpUIHandleWidgetsLayout.showWorkingStatus(response.error, 'red');
1301 1311 } else if (response.result == 'SUCCESS') {
1302 - mainwpUIHandleWidgetsLayout.showWorkingStatus(__('Layout deleted successfully.'), 'green');
1312 + mainwpUIHandleWidgetsLayout.showWorkingStatus(MainWP.I18n.t('Layout deleted successfully.'), 'green');
1303 1313 setTimeout(function () {
1304 1314 jQuery('#mainwp-common-edit-widgets-layout-status').fadeOut(300);
1305 1315 jQuery('#mainwp-common-edit-widgets-layout-modal').modal('hide');
1306 1316 }, 2000);
1307 1317 } else {
1308 - mainwpUIHandleWidgetsLayout.showWorkingStatus(__('An error occurred while deleting the layout.'), 'red');
1318 + mainwpUIHandleWidgetsLayout.showWorkingStatus(MainWP.I18n.t('An error occurred while deleting the layout.'), 'red');
1309 1319 }
1310 1320 }, 'json');
1311 1321 });
1312 -}
1322 +}