Skip to content

Commit

Permalink
see UPDATELOG.md for details
Browse files Browse the repository at this point in the history
  • Loading branch information
Bosn committed Jun 18, 2014
1 parent 13a2d46 commit c92c3ac
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
5 changes: 4 additions & 1 deletion UPDATELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
### RAP v0.9.2 ###
* [BUG] 修复工作区mock=true时console报错的问题。2014-06-18
* [体验] 本次存储记录Mock视图状态。 2014-06-18
* [功能] 增加对请求参数列表的JSON导入功能 2014-06-18
* [功能] 增加管理员万用密码,修改PRIVATE_CONFIG.adminPassword不为空即可使用万用密码登录,方便调试问题。注意不要上传带有内容的PRIVATE_CONFIG.java 2014-06-17
* [体验] 修复用户名密码自动完成位置错误的问题 2014-06-17
* [体验] 修复用户名密码自动完成位置错误的问题 2014-06-17


### RAP v0.9.1 ###
Expand Down
22 changes: 19 additions & 3 deletions WebContent/stat/js/core/rap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ if (!window.console) {
"REQUEST_BEGIN" : "<h2>请求参数列表</h2><table class=\"table-a\"><tr class=\"head\"><td class=\"head-expander\"></td><td class=\"head-identifier\">变量名</td><td class=\"head-name\">含义</td><td class=\"head-type\">类型</td><td class=\"head-remark\">备注</td></tr>",
"REQUEST_BEGIN_EDIT" : "<h2>请求参数列表</h2><table class=\"table-a\"><tr class=\"head\"><td class=\"head-expander\"></td><td class=\"head-op\">OP</td><td class=\"head-identifier\">变量名</td><td class=\"head-name\">含义</td><td class=\"head-type\">类型</td><td class=\"head-remark\">备注</td></tr>",
"REQUEST_END" : "</table>",
"REQUEST_PARAMETER_ADD_BUTTON" : "<div class='btns-container'><a href=\"#\" class=\"btn btn-default\" onclick=\"ws.addParam('request'); return false;\">新增请求参数</a></div>",
"REQUEST_PARAMETER_ADD_BUTTON" : "<div class='btns-container'><a href=\"#\" class=\"btn btn-default\" onclick=\"ws.addParam('request'); return false;\">新增请求参数</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href\"#\" class='btn btn-success' onclick=\"ws.importJSON(true); return false;\">导入JSON</a></div>",

"RESPONSE_BEGIN" : "<h2>响应参数列表</h2><table class=\"table-a\"><tr class=\"head\"><td class=\"head-expander\"></td><td class=\"head-identifier\">变量名</td><td class=\"head-name\">含义</td><td class=\"head-type\">类型</td><td class=\"head-remark\">备注</td></tr>",
"RESPONSE_BEGIN_EDIT" : "<h2>响应参数列表</h2><table class=\"table-a\"><tr class=\"head\"><td class=\"head-expander\"></td><td class=\"head-op\">OP</td><td class=\"head-identifier\">变量名</td><td class=\"head-name\">含义</td><td class=\"head-type\">类型</td><td class=\"head-remark\">备注</td></tr>",
Expand Down Expand Up @@ -1279,6 +1279,10 @@ if (!window.console) {
*/
ws.init = function(workspaceObj, urlObj, actionId) {
var me = this;
var cb = arguments[arguments.length - 1];
if (!cb || typeof cb !== 'function') {
cb = function(){};
}
_isLocalStorageEnabled = typeof(localStorage) != 'undefined';
_isMockDisplay = false;
URL = urlObj;
Expand Down Expand Up @@ -1337,6 +1341,9 @@ if (!window.console) {
ecui.ui.Tree.prototype.onclick = function (event) {
return event.target == this.getBase();
};

// callback invokation
cb();
});


Expand Down Expand Up @@ -2106,8 +2113,9 @@ if (!window.console) {
ecui.get('importJSONFloater').hide();
};

ws.importJSON = function() {
ws.importJSON = function(doesImportToRequest) {
ecFloater.show("importJSONFloater");
this._doesImportToRequest = !!doesImportToRequest;
};

/**
Expand Down Expand Up @@ -2367,6 +2375,9 @@ if (!window.console) {
}
var html = b.g('btnToggleMockDisplay').innerHTML;
_isMockDisplay = !_isMockDisplay;
if (typeof window.localStorage !== 'undefined') {
localStorage.setItem('_isMockDisplay', _isMockDisplay);
}
ws.switchA(_curActionId, true);
};

Expand Down Expand Up @@ -3189,9 +3200,14 @@ if (!window.console) {
*/
function processJSONImport(f, k, pId, notFirst) {
var id, param, item;
var doesImportToRequest = ws._doesImportToRequest;
if (notFirst) {
if (!pId) {
id = p.addResponseParameter(_curActionId);
if (doesImportToRequest === true) {
id = p.addRequestParameter(_curActionId);
} else {
id = p.addResponseParameter(_curActionId);
}
param = p.getParameter(id);
param.identifier = k;
} else {
Expand Down
14 changes: 10 additions & 4 deletions WebContent/workspace/myWorkspace.vm
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,17 @@
data.projectData.moduleList = [{"id":ws.generateId(),"name":"某模块(点击编辑后双击修改)","introduction":"","pageList":[{"moduleId":ws.generateId(),"name":"某页面","introduction":"","id":ws.generateId(),"isIdGenerated":true,"actionList":[{"pageId":ws.generateId(),"name":"某请求","requestType":"1","requestUrl":"","responseTemplate":"","description":"","id":ws.generateId(),"requestParameterList":[{"id":ws.generateId(),"identifier":"reqParam","name":"某请求参数","remark":"","validator":"","dataType":"number","parameterList":[]}],"responseParameterList":[{"id":ws.generateId(),"identifier":"resParam","name":"某响应参数","remark":"","validator":"","dataType":"number","parameterList":[]}]}]}]}];
}

ws.init(data, urlObj#if($actionId),$actionId#end);
ws.init(data, urlObj#if($actionId),$actionId#end, callbackHandler);

#if($mock)
ws.toggleMockDisplay();
#end
function callbackHandler() {
#if($mock == true)
ws.toggleMockDisplay();
#else
if (window.location.toString().indexOf("mock=") == -1 && window.localStorage && window.localStorage.getItem("_isMockDisplay") === 'true') {
ws.toggleMockDisplay();
}
#end
}

</script>
</html>

0 comments on commit c92c3ac

Please sign in to comment.