diff --git a/data/user_workspaces/admin/src/mytest/sdf b/data/user_workspaces/admin/src/mytest/sdf new file mode 100644 index 0000000..e69de29 diff --git a/i18n/zh_CN.json b/i18n/zh_CN.json index 144c926..ce00aca 100644 --- a/i18n/zh_CN.json +++ b/i18n/zh_CN.json @@ -33,5 +33,6 @@ "notification_2": "没有检查到 gocode,这将会导致 [自动完成] 失效", "notification_3": "没有检查到 ide_stub,这将会导致 [跳转到声明]、[查找使用] 失效", "goto_line": "跳转到行", - "goto": "跳转" + "goto": "跳转", + "input_no_empty": "输入不能为空" } \ No newline at end of file diff --git a/static/css/dialog.css b/static/css/dialog.css index 9dc9ddd..6115b51 100644 --- a/static/css/dialog.css +++ b/static/css/dialog.css @@ -71,14 +71,11 @@ } #dialogRemoveConfirm, -#dialogNewFilePrompt, -#dialogNewDirPrompt, -#dialogGoLinePrompt { +.dialog-prompt { padding: 10px 20px 0; + overflow: hidden; } -#dialogNewFilePrompt > input, -#dialogNewDirPrompt > input, -#dialogGoLinePrompt > input { +.dialog-prompt > input { width: 100%; } \ No newline at end of file diff --git a/static/js/wide.js b/static/js/wide.js index b99240f..9939d5f 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -115,8 +115,17 @@ var wide = { } }); + + $(".dialog-prompt > input").keydown(function(event) { + $(".dialog-prompt > .tip").text(''); + + if (event.which === 13) { + $(this).closest(".dialog-main").find(".dialog-footer > button:eq(0)").click(); + } + }); + $("#dialogNewFilePrompt").dialog({ - "height": 32, + "height": 52, "width": 260, "title": config.label.create_file, "okText": config.label.create, @@ -126,7 +135,12 @@ var wide = { }, "ok": function() { var request = newWideRequest(), - name = $("#dialogNewFilePrompt > input").val() + name = $("#dialogNewFilePrompt > input").val(); + if ($.trim(name) === "") { + $("#dialogNewFilePrompt > .tip").text(config.label.input_no_empty); + return false; + } + request.path = wide.curNode.path + '\\' + name; request.fileType = "f"; @@ -187,7 +201,7 @@ var wide = { }); $("#dialogNewDirPrompt").dialog({ - "height": 32, + "height": 52, "width": 260, "title": config.label.create_dir, "okText": config.label.create, @@ -198,6 +212,10 @@ var wide = { "ok": function() { var name = $("#dialogNewDirPrompt > input").val(), request = newWideRequest(); + if ($.trim(name) === "") { + $("#dialogNewDirPrompt > .tip").text(config.label.input_no_empty); + return false; + } request.path = wide.curNode.path + '\\' + name; request.fileType = "d"; @@ -224,7 +242,7 @@ var wide = { }); $("#dialogGoLinePrompt").dialog({ - "height": 32, + "height": 52, "width": 260, "title": config.label.goto_line, "okText": config.label.goto, @@ -234,7 +252,10 @@ var wide = { }, "ok": function() { var line = parseInt($("#dialogGoLinePrompt > input").val()); - + if ($.trim(line) === "") { + $("#dialogGoLinePrompt > .tip").text(config.label.input_no_empty); + return false; + } $("#dialogGoLinePrompt").dialog("close"); wide.curEditor.setCursor(CodeMirror.Pos(line - 1, 0)); wide.curEditor.focus(); diff --git a/view/index.html b/view/index.html index 9a12ed1..a1463b2 100644 --- a/view/index.html +++ b/view/index.html @@ -170,20 +170,21 @@
{{.i18n.isDelete}} ?
-
- +
+
-
- +
+
-
- +
+