This commit is contained in:
Liang Ding 2014-10-22 15:51:48 +08:00
parent a7b5fb1bcd
commit cd7dfb725a
1 changed files with 33 additions and 1 deletions

View File

@ -496,7 +496,38 @@ var wide = {
},
// 构建.
build: function () {
// TODO: 构建
var currentPath = editors.getCurrentPath();
if (!currentPath) {
return false;
}
if ($(".menu li.run").hasClass("disabled")) {
return false;
}
if ($(".toolbars .ico-stop").length === 1) {
wide.stop();
return false;
}
var request = newWideRequest();
request.file = currentPath;
request.code = wide.curEditor.getValue();
request.nextCmd = ""; // 只构建,无下一步操作
$.ajax({
type: 'POST',
url: '/build',
data: JSON.stringify(request),
dataType: "json",
beforeSend: function (data) {
$('.bottom-window-group .output').text('');
},
success: function (data) {
$(".toolbars .ico-buildrun").addClass("ico-stop")
.removeClass("ico-buildrun").attr("title", config.label.stop);
}
});
},
// 构建并运行.
run: function () {
@ -517,6 +548,7 @@ var wide = {
var request = newWideRequest();
request.file = currentPath;
request.code = wide.curEditor.getValue();
request.nextCmd = "run";
$.ajax({
type: 'POST',