Browse Source

在utils中新加汉化报错提示函数,修改数据模型名称和描述输入重复。

jie 1 year ago
parent
commit
12eafe7677

File diff suppressed because it is too large
+ 0 - 0
atlas/js/external_lib/pnotify/pnotify.custom.min.js


+ 8 - 2
atlas/js/utils/Utils.js

@@ -101,7 +101,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
             modal.stack = myStack;
         }
         notify(_.extend({
-            title: "Confirmation",
+            title: "确定",
             hide: !1,
             confirm: {
                 confirm: !0,
@@ -153,7 +153,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         } else skipDefaultError !== !0 && Utils.serverErrorHandler(error, defaultErrorMessage); else skipDefaultError !== !0 && Utils.serverErrorHandler(error, defaultErrorMessage);
     }, Utils.serverErrorHandler = function(response, defaultErrorMessage) {
         var responseJSON = response ? response.responseJSON : response, message = defaultErrorMessage ? defaultErrorMessage : Messages.defaultErrorMessage;
-        response && responseJSON && (message = responseJSON.errorMessage || responseJSON.message || responseJSON.error || message);
+        response && responseJSON && (message = Utils.replaceToChinese(responseJSON.errorMessage) || responseJSON.message || responseJSON.error || message);
         var existingError = $(".ui-pnotify-container.alert-danger .ui-pnotify-text").text();
         existingError !== message && Utils.notifyError({
             content: message
@@ -618,5 +618,11 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         }
 
     },
+        Utils.replaceToChinese = function(name) {
+          return  name
+              .replace("Names must consist of a letter followed by a sequence of letter, number, space, or _ characters","名称必须由一个字母和一系列字母、数字、空格或_字符组成")
+              .replace("invalid name for CLASSIFICATION.","分类的名称无效。")
+
+        },
         Utils;
 });

+ 1 - 1
atlas/js/views/tag/TagLayoutView.js

@@ -251,7 +251,7 @@ define([ "require", "backbone", "hbs!tmpl/tag/TagLayoutView_tmpl", "utils/Utils"
                     allowCancel: !0
                 }).open();
                 modal.$el.find("button.ok").attr("disabled", "true"), view.ui.tagName.on("keyup input", function(e) {
-                    view.ui.description.val($(this).val().replace(/\s+/g, " "));
+                    $(this).val($(this).val().replace(/\s+/g, " "));
                 }), view.ui.description.on("input keydown", function(e) {
                     $(this).val($(this).val().replace(/\s+/g, " "));
                 }), modal.on("shownModal", function() {

Some files were not shown because too many files changed in this diff