This commit is contained in:
Van 2014-11-01 12:36:42 +08:00
parent 4e078d31d1
commit ffea905ff4
9 changed files with 71 additions and 56 deletions

View File

@ -111,5 +111,6 @@
"team": "Team", "team": "Team",
"sing_up_error": "Sign Up Error", "sing_up_error": "Sign Up Error",
"user_name_ruler": "Username only by az, AZ, 0-9, _ consisting of a length of 16", "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"
} }

View File

@ -111,5 +111,6 @@
"team": "チーム", "team": "チーム",
"sing_up_error": "登録に失敗しました", "sing_up_error": "登録に失敗しました",
"user_name_ruler": "16の長さからなる_ AZ、AZ、0-9、によってユーザ名のみ", "user_name_ruler": "16の長さからなる_ AZ、AZ、0-9、によってユーザ名のみ",
"password_no_match": "一貫性のないパスワード入力" "password_no_match": "一貫性のないパスワード入力",
"discard": "あきらめる"
} }

View File

@ -111,5 +111,6 @@
"team": "团队", "team": "团队",
"sing_up_error": "注册失败", "sing_up_error": "注册失败",
"user_name_ruler": "用户名只能由 a-z, A-Z, 0-9, _ 组成长度为16", "user_name_ruler": "用户名只能由 a-z, A-Z, 0-9, _ 组成长度为16",
"password_no_match": "密码输入不一致" "password_no_match": "密码输入不一致",
"discard": "放弃"
} }

View File

@ -111,5 +111,6 @@
"team": "團隊", "team": "團隊",
"sing_up_error": "註冊失敗", "sing_up_error": "註冊失敗",
"user_name_ruler": "用戶名只能由az, AZ, 0-9, _ 組成長度為16", "user_name_ruler": "用戶名只能由az, AZ, 0-9, _ 組成長度為16",
"password_no_match": "密碼輸入不一致" "password_no_match": "密碼輸入不一致",
"discard": "放棄"
} }

View File

@ -64,7 +64,8 @@
text-align: right; text-align: right;
} }
.dialog-footer button { .dialog-footer button,
#dialogCloseEditor button {
margin: 0 5px; margin: 0 5px;
} }

View File

@ -264,11 +264,11 @@
$("." + styleClass.background).show(); $("." + styleClass.background).show();
} }
$("#" + id + "Dialog .dialog-footer button:eq(0)").focus();
if (typeof settings.afterOpen === "function") { if (typeof settings.afterOpen === "function") {
settings.afterOpen(msg); settings.afterOpen(msg);
} }
$("#" + id + "Dialog .dialog-footer button:eq(0)").focus();
}, },
_updateDialog: function (target, data) { _updateDialog: function (target, data) {
var inst = this._getInst(target); var inst = this._getInst(target);

View File

@ -4,10 +4,15 @@ var editors = {
init: function () { init: function () {
$("#dialogCloseEditor").dialog({ $("#dialogCloseEditor").dialog({
"modal": true, "modal": true,
"height": 26, "height": 66,
"width": 260, "width": 260,
"title": config.label.tip, "title": config.label.tip,
"hideFooter": true, "hideFooter": true,
"afterOpen": function (fileName) {
$("#dialogCloseEditor > div:eq(0)").html(config.label.file
+ ' <b>' + fileName + '</b>. ' + config.label.confirm_save + '?');
$("#dialogCloseEditor button:eq(0)").focus();
},
"afterInit": function () { "afterInit": function () {
$("#dialogCloseEditor button.save").click(function () { $("#dialogCloseEditor button.save").click(function () {
var i = $("#dialogCloseEditor").data("index"); var i = $("#dialogCloseEditor").data("index");
@ -60,7 +65,8 @@ var editors = {
if (editors.data[i].editor.doc.isClean()) { if (editors.data[i].editor.doc.isClean()) {
return true; return true;
} else { } 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); $("#dialogCloseEditor").data("index", i);
return false; return false;
} }

View File

@ -695,7 +695,7 @@ var wide = {
if (curEditor.doc.isClean()) { // 没有修改过,不需要保存 if (curEditor.doc.isClean()) { // 没有修改过,不需要保存
return false; return false;
} }
var mode = curEditor.getOption("mode"); var mode = curEditor.getOption("mode");
var cursor = curEditor.getCursor(); var cursor = curEditor.getCursor();

View File

@ -223,54 +223,58 @@
<input placeholder="{{.i18n.file_format}}" /> <input placeholder="{{.i18n.file_format}}" />
</div> </div>
<div id="dialogCloseEditor" class="dialog-form fn-none"> <div id="dialogCloseEditor" class="dialog-form fn-none">
<button class="save">save</button> <div></div><br/>
<button class="discard">discard</button> <div class="fn-right">
<button class="cancel">cancel</button> <button class="save">{{.i18n.save}}</button>
<button class="discard">{{.i18n.discard}}</button>
<button class="cancel">{{.i18n.cancel}}</button>
</div>
</div> </div>
<script> <script>
var config = { var config = {
"pathSeparator": '{{.pathSeparator}}', "pathSeparator": '{{.pathSeparator}}',
"latestSessionContent": {{.latestSessionContent}}, "latestSessionContent": {{.latestSessionContent}},
"label": { "label": {
"restore_editor": "{{.i18n.restore_editor}}", "restore_editor": "{{.i18n.restore_editor}}",
"max_editor": "{{.i18n.max_editor}}", "max_editor": "{{.i18n.max_editor}}",
"delete": "{{.i18n.delete}}", "delete": "{{.i18n.delete}}",
"cancel": "{{.i18n.cancel}}", "cancel": "{{.i18n.cancel}}",
"goto_line": "{{.i18n.goto_line}}", "goto_line": "{{.i18n.goto_line}}",
"go": "{{.i18n.go}}", "go": "{{.i18n.go}}",
"create": "{{.i18n.create}}", "create": "{{.i18n.create}}",
"create_file": "{{.i18n.create_file}}", "create_file": "{{.i18n.create_file}}",
"create_dir": "{{.i18n.create_dir}}", "create_dir": "{{.i18n.create_dir}}",
"tip": "{{.i18n.tip}}", "tip": "{{.i18n.tip}}",
"confirm": "{{.i18n.confirm}}", "confirm": "{{.i18n.confirm}}",
"build_n_run": "{{.i18n.build_n_run}}", "build_n_run": "{{.i18n.build_n_run}}",
"stop": "{{.i18n.stop}}", "stop": "{{.i18n.stop}}",
"find_usages": "{{.i18n.find_usages}}", "find_usages": "{{.i18n.find_usages}}",
"search_text": "{{.i18n.search_text}}", "search_text": "{{.i18n.search_text}}",
"search": "{{.i18n.search}}", "search": "{{.i18n.search}}",
"start_page": "{{.i18n.start_page}}", "start_page": "{{.i18n.start_page}}",
"confirm_save": "{{.i18n.confirm_save}}", "confirm_save": "{{.i18n.confirm_save}}",
"community": "{{.i18n.community}}", "community": "{{.i18n.community}}",
"about": "{{.i18n.about}}", "about": "{{.i18n.about}}",
"new_version_available": "{{.i18n.new_version_available}}", "new_version_available": "{{.i18n.new_version_available}}",
"colon": "{{.i18n.colon}}", "colon": "{{.i18n.colon}}",
"uptodate": "{{.i18n.uptodate}}" "file": "{{.i18n.file}}",
}, "uptodate": "{{.i18n.uptodate}}"
"channel": { },
"editor": '{{.conf.EditorChannel}}', "channel": {
"shell": '{{.conf.ShellChannel}}', "editor": '{{.conf.EditorChannel}}',
"output": '{{.conf.OutputChannel}}', "shell": '{{.conf.ShellChannel}}',
"session": '{{.conf.SessionChannel}}' "output": '{{.conf.OutputChannel}}',
}, "session": '{{.conf.SessionChannel}}'
"wideSessionId": '{{.session.Id}}' },
}; "wideSessionId": '{{.session.Id}}'
// 发往 Wide 的所有 AJAX 请求需要使用该函数创建请求参数. };
function newWideRequest() { // 发往 Wide 的所有 AJAX 请求需要使用该函数创建请求参数.
var ret = { function newWideRequest() {
sid: config.wideSessionId var ret = {
}; sid: config.wideSessionId
return ret; };
} return ret;
}
</script> </script>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script>