build run stop

This commit is contained in:
Van 2014-09-24 15:24:37 +08:00
parent 22403f3b83
commit fae810df5e
4 changed files with 27 additions and 16 deletions

View File

@ -15,9 +15,13 @@
"Password": "admin", "Password": "admin",
"Workspace": "{pwd}/data/user_workspaces/admin", "Workspace": "{pwd}/data/user_workspaces/admin",
"LatestSessionContent": { "LatestSessionContent": {
"FileTree": [], "FileTree": [
"Files": [], "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest"
"CurrentFile": "" ],
"Files": [
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\1123"
],
"CurrentFile": "E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\1123"
} }
} }
] ]

View File

@ -36,5 +36,6 @@
"goto": "跳转", "goto": "跳转",
"input_no_empty": "输入不能为空", "input_no_empty": "输入不能为空",
"tip": "提示", "tip": "提示",
"confirm": "确定" "confirm": "确定",
"stop": "停止"
} }

View File

@ -261,8 +261,9 @@ var wide = {
wide.curProcessId = data.pid; wide.curProcessId = data.pid;
} else if ('run-done' === data.cmd) { // 运行结束 } else if ('run-done' === data.cmd) { // 运行结束
wide.curProcessId = undefined; wide.curProcessId = undefined;
// 运行结束后修改 [构建&运行] 图标状态为可用状态
// TODO: 运行结束后修改 [构建&运行] 图标状态为可用状态 $(".toolbars .ico-stop").removeClass("ico-stop")
.addClass("ico-buildrun").attr("title", config.label.build_n_run);
} else if ('build' === data.cmd || 'go install' === data.cmd) { } else if ('build' === data.cmd || 'go install' === data.cmd) {
$('.bottom-window-group .output').text(data.output); $('.bottom-window-group .output').text(data.output);
@ -275,7 +276,8 @@ var wide = {
message: lint.msg, severity: lint.severity}); message: lint.msg, severity: lint.severity});
} }
// TODO: 修改 [构建&运行] 图标状态为可用状态 $(".toolbars .ico-stop").removeClass("ico-stop")
.addClass("ico-buildrun").attr("title", config.label.build_n_run);
} }
// 触发一次 gutter lint // 触发一次 gutter lint
@ -294,7 +296,7 @@ var wide = {
}, },
init: function () { init: function () {
this._initWS(); this._initWS();
this._initLayout(); this._initLayout();
this._initBottomWindowGroup(); this._initBottomWindowGroup();
@ -352,11 +354,11 @@ var wide = {
// TODO: exit // TODO: exit
}, },
stop: function () { stop: function () {
if ($(".toolbars .ico-buildrun").length === 1) { if ($(".toolbars .ico-buildrun").length === 1) {
wide.run(); wide.run();
return false; return false;
} }
var request = newWideRequest(); var request = newWideRequest();
request.pid = wide.curProcessId; request.pid = wide.curProcessId;
@ -369,7 +371,8 @@ var wide = {
// $('.bottom-window-group .output').text(''); // $('.bottom-window-group .output').text('');
}, },
success: function (data) { success: function (data) {
$(".toolbars .ico-stop").removeClass("ico-stop").addClass("ico-buildrun"); $(".toolbars .ico-stop").removeClass("ico-stop")
.addClass("ico-buildrun").attr("title", config.label.build_n_run);
} }
}); });
}, },
@ -378,8 +381,8 @@ var wide = {
if ($(".toolbars .ico-stop").length === 1) { if ($(".toolbars .ico-stop").length === 1) {
wide.stop(); wide.stop();
return false; return false;
} }
var request = newWideRequest(); var request = newWideRequest();
request.file = $(".edit-header .current span:eq(0)").attr("title"); request.file = $(".edit-header .current span:eq(0)").attr("title");
request.code = wide.curEditor.getValue(); request.code = wide.curEditor.getValue();
@ -393,7 +396,8 @@ var wide = {
$('.bottom-window-group .output').text(''); $('.bottom-window-group .output').text('');
}, },
success: function (data) { success: function (data) {
$(".toolbars .ico-buildrun").addClass("ico-stop").removeClass("ico-buildrun"); $(".toolbars .ico-buildrun").addClass("ico-stop")
.removeClass("ico-buildrun").attr("title", config.label.stop);
} }
}); });
}, },

View File

@ -195,7 +195,9 @@
"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}}",
"stop": "{{.i18n.stop}}"
}, },
"channel": { "channel": {
"editor": '{{.conf.EditorChannel}}', "editor": '{{.conf.EditorChannel}}',