From ffea905ff4590d20f4b80e68940b63c1a013791a Mon Sep 17 00:00:00 2001 From: Van Date: Sat, 1 Nov 2014 12:36:42 +0800 Subject: [PATCH] Fix #67 --- i18n/en_US.json | 3 +- i18n/ja_JP.json | 3 +- i18n/zh_CN.json | 3 +- i18n/zh_TW.json | 3 +- static/css/dialog.css | 3 +- static/js/dialog.js | 4 +- static/js/editors.js | 10 ++++- static/js/wide.js | 2 +- views/index.html | 96 ++++++++++++++++++++++--------------------- 9 files changed, 71 insertions(+), 56 deletions(-) diff --git a/i18n/en_US.json b/i18n/en_US.json index 4fdc95e..e75b584 100644 --- a/i18n/en_US.json +++ b/i18n/en_US.json @@ -111,5 +111,6 @@ "team": "Team", "sing_up_error": "Sign Up Error", "user_name_ruler": "Username only by az, AZ, 0-9, _ consisting of a length of 16", - "password_no_match": "Password doesn't match the confirmation" + "password_no_match": "Password doesn't match the confirmation", + "discard": "Discard" } \ No newline at end of file diff --git a/i18n/ja_JP.json b/i18n/ja_JP.json index 464bfbc..467e944 100644 --- a/i18n/ja_JP.json +++ b/i18n/ja_JP.json @@ -111,5 +111,6 @@ "team": "チーム", "sing_up_error": "登録に失敗しました", "user_name_ruler": "16の長さからなる_ AZ、AZ、0-9、によってユーザ名のみ", - "password_no_match": "一貫性のないパスワード入力" + "password_no_match": "一貫性のないパスワード入力", + "discard": "あきらめる" } diff --git a/i18n/zh_CN.json b/i18n/zh_CN.json index 25cc3a8..dd755b7 100644 --- a/i18n/zh_CN.json +++ b/i18n/zh_CN.json @@ -111,5 +111,6 @@ "team": "团队", "sing_up_error": "注册失败", "user_name_ruler": "用户名只能由 a-z, A-Z, 0-9, _ 组成,长度为16", - "password_no_match": "密码输入不一致" + "password_no_match": "密码输入不一致", + "discard": "放弃" } \ No newline at end of file diff --git a/i18n/zh_TW.json b/i18n/zh_TW.json index 3c803f8..fc597c9 100644 --- a/i18n/zh_TW.json +++ b/i18n/zh_TW.json @@ -111,5 +111,6 @@ "team": "團隊", "sing_up_error": "註冊失敗", "user_name_ruler": "用戶名只能由az, AZ, 0-9, _ 組成,長度為16", - "password_no_match": "密碼輸入不一致" + "password_no_match": "密碼輸入不一致", + "discard": "放棄" } \ No newline at end of file diff --git a/static/css/dialog.css b/static/css/dialog.css index ae5297f..46edbaf 100644 --- a/static/css/dialog.css +++ b/static/css/dialog.css @@ -64,7 +64,8 @@ text-align: right; } -.dialog-footer button { +.dialog-footer button, +#dialogCloseEditor button { margin: 0 5px; } diff --git a/static/js/dialog.js b/static/js/dialog.js index 08a3e15..73b5656 100644 --- a/static/js/dialog.js +++ b/static/js/dialog.js @@ -264,11 +264,11 @@ $("." + styleClass.background).show(); } - $("#" + id + "Dialog .dialog-footer button:eq(0)").focus(); - if (typeof settings.afterOpen === "function") { settings.afterOpen(msg); } + + $("#" + id + "Dialog .dialog-footer button:eq(0)").focus(); }, _updateDialog: function (target, data) { var inst = this._getInst(target); diff --git a/static/js/editors.js b/static/js/editors.js index 7dfbb07..3b5b7d3 100644 --- a/static/js/editors.js +++ b/static/js/editors.js @@ -4,10 +4,15 @@ var editors = { init: function () { $("#dialogCloseEditor").dialog({ "modal": true, - "height": 26, + "height": 66, "width": 260, "title": config.label.tip, "hideFooter": true, + "afterOpen": function (fileName) { + $("#dialogCloseEditor > div:eq(0)").html(config.label.file + + ' ' + fileName + '. ' + config.label.confirm_save + '?'); + $("#dialogCloseEditor button:eq(0)").focus(); + }, "afterInit": function () { $("#dialogCloseEditor button.save").click(function () { var i = $("#dialogCloseEditor").data("index"); @@ -60,7 +65,8 @@ var editors = { if (editors.data[i].editor.doc.isClean()) { return true; } else { - $("#dialogCloseEditor").dialog("open"); + $("#dialogCloseEditor").dialog("open", $(".edit-panel .tabs > div[data-index=" + + editors.data[i].id + "] > span:eq(0)").text()); $("#dialogCloseEditor").data("index", i); return false; } diff --git a/static/js/wide.js b/static/js/wide.js index 9665e4d..3bd32db 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -695,7 +695,7 @@ var wide = { if (curEditor.doc.isClean()) { // 没有修改过,不需要保存 return false; } - + var mode = curEditor.getOption("mode"); var cursor = curEditor.getCursor(); diff --git a/views/index.html b/views/index.html index 1f45c29..4ef4def 100644 --- a/views/index.html +++ b/views/index.html @@ -223,54 +223,58 @@
- - - +

+
+ + + +