diff --git a/_server/editor_file.js b/_server/editor_file.js index 711a1bb1..82247ee0 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -104,6 +104,7 @@ editor_file = function (editor, callback) { } datastr = datastr.concat(['\n}']); datastr = datastr.join(''); + alertWhenCompress(); fs.writeFile(filename, encode(datastr), 'base64', function (err, data) { callback(err); }); @@ -717,9 +718,17 @@ editor_file = function (editor, callback) { })) } + var alertWhenCompress = function(){ + if(editor.useCompress===true){ + editor.useCompress=null; + setTimeout("alert('当前游戏使用的是压缩文件,修改完成后请重新压缩')",1000) + } + } + var saveSetting = function (file, actionList, callback) { //console.log(file); //console.log(actionList); + alertWhenCompress(); if (file == 'icons') { actionList.forEach(function (value) { diff --git a/_server/fs.js b/_server/fs.js index 59bd1441..c95065d3 100644 --- a/_server/fs.js +++ b/_server/fs.js @@ -2,37 +2,44 @@ fs = {}; + var _isset = function (val) { + if (val == undefined || val == null || (typeof val=='number' && isNaN(val))) { + return false; + } + return true + } + var _http = function (type, url, formData, success, error, mimeType, responseType) { var xhr = new XMLHttpRequest(); xhr.open(type, url, true); - if (core.isset(mimeType)) + if (_isset(mimeType)) xhr.overrideMimeType(mimeType); - if (core.isset(responseType)) + if (_isset(responseType)) xhr.responseType = responseType; xhr.onload = function(e) { if (xhr.status==200) { - if (core.isset(success)) { + if (_isset(success)) { success(xhr.response); } } else { - if (core.isset(error)) + if (_isset(error)) error("HTTP "+xhr.status); } }; xhr.onabort = function () { - if (core.isset(error)) + if (_isset(error)) error("Abort"); } xhr.ontimeout = function() { - if (core.isset(error)) + if (_isset(error)) error("Timeout"); } xhr.onerror = function() { - if (core.isset(error)) + if (_isset(error)) error("Error on Connection"); } - if (core.isset(formData)) + if (_isset(formData)) xhr.send(formData); else xhr.send(); } diff --git a/editor.html b/editor.html index f83105d0..c21f70bd 100644 --- a/editor.html +++ b/editor.html @@ -429,6 +429,8 @@ if (location.protocol.indexOf("http")!=0) {