refactor plugin
|
@ -5,11 +5,9 @@ import javax.xml.bind.JAXBException;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.bench4q.share.helper.ExceptionLog;
|
import org.bench4q.share.helper.ExceptionLog;
|
||||||
import org.bench4q.web.model.BaseResponseModel;
|
import org.bench4q.web.model.BaseResponseModel;
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
||||||
|
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
public class GlobalExceptionController {
|
public class GlobalExceptionController {
|
||||||
|
|
|
@ -37,12 +37,12 @@ display:none;
|
||||||
padding-right:5px;
|
padding-right:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-left{
|
.left{
|
||||||
float:left;
|
float:left;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-right{
|
.right{
|
||||||
float:right;
|
float:right;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,76 +1,73 @@
|
||||||
|
.inset {
|
||||||
.inset{
|
width: 85%;
|
||||||
width:85% ;
|
height: 80%;
|
||||||
height:80%;
|
align: center;
|
||||||
align:center;
|
margin: 5px;
|
||||||
margin: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.scroll{
|
.scroll {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
color:#ECE9D8;
|
color: #ECE9D8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-div {
|
||||||
|
margin-top: 50px;
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-div div {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.behavior_box {
|
||||||
|
border: 1px inset;
|
||||||
|
width: 200px;
|
||||||
|
height: 300px;
|
||||||
|
margin-right: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sample_frame {
|
||||||
|
margin-bottom: 0px;
|
||||||
|
border: #3689BB solid thin;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sample_sub_frame {
|
||||||
|
border: #F0ECE0 solid thin;
|
||||||
|
margin-top: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listArea {
|
||||||
|
height: 340px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
outline-style: outset;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.behavior-box {
|
||||||
|
height: 400px;
|
||||||
|
border: solid 1px black;
|
||||||
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.behavior_box{
|
#myModal_Behavior {
|
||||||
border:1px inset;
|
width: 800px;
|
||||||
width:200px;
|
left:40%;
|
||||||
height:300px;
|
|
||||||
margin-right:0px;
|
|
||||||
margin-left:0px;
|
|
||||||
}
|
}
|
||||||
|
.listArea,#insertPluginAreaPlugins,#pluginMethod p,a {
|
||||||
.sample_frame{
|
padding-top: 10px;
|
||||||
margin-bottom:0px;
|
padding-left: 20px;
|
||||||
border:#3689BB solid thin;
|
|
||||||
}
|
}
|
||||||
|
p,a{
|
||||||
.sample_sub_frame{
|
color: #4E9BCB;
|
||||||
border:#F0ECE0 solid thin;
|
border-bottom: 1px solid #F0ECE0;
|
||||||
margin-top:5px;
|
|
||||||
margin-bottom:5px;
|
|
||||||
margin-left:10px;
|
|
||||||
margin-right:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
table, th, td,thead,tbody
|
|
||||||
{
|
|
||||||
border: 1px solid #FFE37E;
|
|
||||||
width:40px;
|
|
||||||
height:18px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#pluginArea{
|
|
||||||
width:280px;
|
|
||||||
height:340px;
|
|
||||||
margin-bottom:15px;
|
|
||||||
outline-style: outset;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#behaviorArea{
|
|
||||||
width:280px;
|
|
||||||
height:340px;
|
|
||||||
margin-bottom:15px;
|
|
||||||
outline-style: inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.behavior-box{
|
|
||||||
width:180px;
|
|
||||||
height:200px;
|
|
||||||
border:solid thin #F0ECE0;
|
|
||||||
margin-left:5px;
|
|
||||||
outline-style:inset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pluginChoosedList{
|
|
||||||
border-bottom:1px solid #F0ECE0 ;
|
|
||||||
color: #4E9BCB ;
|
|
||||||
width:220px;
|
|
||||||
height:32px;
|
|
||||||
}
|
}
|
|
@ -1 +0,0 @@
|
||||||
/Thumbs.db
|
|
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 30 KiB |
|
@ -37,7 +37,7 @@ body {
|
||||||
<link href='css/uploadify.css' rel='stylesheet'>
|
<link href='css/uploadify.css' rel='stylesheet'>
|
||||||
<link href='css/buttons.css' rel='stylesheet'>
|
<link href='css/buttons.css' rel='stylesheet'>
|
||||||
<link href='bench4q-css/plugin.css' rel='stylesheet'>
|
<link href='bench4q-css/plugin.css' rel='stylesheet'>
|
||||||
|
<link href='bench4q-css/bench4q.css' rel='stylesheet'>
|
||||||
<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
|
<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
|
||||||
<!--[if lt IE 9]>
|
<!--[if lt IE 9]>
|
||||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||||
|
@ -84,158 +84,138 @@ body {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row-fluid sortable">
|
<div class="row-fluid sortable">
|
||||||
<div class="box span5">
|
<div class="box span6">
|
||||||
<div>
|
<div class="box-header well" data-original-title>
|
||||||
<div class="box-header well" data-original-title>
|
<i class="icon-pencil left"></i>
|
||||||
<i class="icon-pencil" style="float: left;"></i>
|
<h2>
|
||||||
<h2>
|
<span>Plug-ins</span>
|
||||||
<span>Plug-ins</span>
|
</h2>
|
||||||
</h2>
|
<div class="box-icon">
|
||||||
<div class="box-icon">
|
<a href="#" class="btn btn-setting btn-round"><i
|
||||||
<a href="#" class="btn btn-setting btn-round"><i
|
class="icon-plus"></i></a> <a href="#" class="btn btn-round"><i
|
||||||
class="icon-plus"></i></a> <a href="#" class="btn btn-round"><i
|
class="icon-list"></i></a> <a href="#"
|
||||||
class="icon-list"></i></a> <a href="#"
|
class="btn btn-minimize btn-round"><i
|
||||||
class="btn btn-minimize btn-round"><i
|
class="icon-chevron-up"></i></a>
|
||||||
class="icon-chevron-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="box-content">
|
</div>
|
||||||
<div class="operatePlugins center">
|
<div class="box-content row-fluid">
|
||||||
<div class="span8" style="float: left;">
|
|
||||||
<div id="pluginArea"></div>
|
|
||||||
</div>
|
|
||||||
<div class="pluginButton">
|
|
||||||
<p>
|
|
||||||
<button type="submit" class="btn btn-inverse" id="addPlugin"
|
|
||||||
onClick="addPlugin();">Add</button>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
<div id="pluginArea" class="listArea span9"></div>
|
||||||
<button type="submit" class="btn btn-inverse"
|
<div class=" span3 button-div">
|
||||||
id="removePlugin" onClick="removePlugin();">Remove</button>
|
<div>
|
||||||
</p>
|
<button type="submit" class="btn btn-inverse" id="addPlugin"
|
||||||
<p>
|
onClick="addPlugin();">Add</button>
|
||||||
<button type="submit" class="btn btn-inverse"
|
</div>
|
||||||
id="removeAllPlugin" onClick="#">Remove all</button>
|
<div>
|
||||||
</p>
|
<button type="submit" class="btn btn-inverse"
|
||||||
</div>
|
id="removePlugin" onClick="removePlugin();">Remove</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button type="submit" class="btn btn-inverse"
|
||||||
|
id="removeAllPlugin" onClick="#">Remove all</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--/span-->
|
<!--/span-->
|
||||||
<!-- Behavior start -->
|
<!-- Behavior start -->
|
||||||
<div class="box span5" style="float: left;">
|
<div class="box span6">
|
||||||
<div>
|
<div class="box-header well" data-original-title>
|
||||||
<div class="box-header well" data-original-title>
|
<i class="icon-pencil left"></i>
|
||||||
<i class="icon-pencil" style="float: left;"></i>
|
<h2>
|
||||||
<h2>
|
<i></i> Behavior
|
||||||
<i></i> Behavior
|
</h2>
|
||||||
</h2>
|
<div class="box-icon">
|
||||||
<div class="box-icon">
|
<a href="#" class="btn btn-setting btn-round"><i
|
||||||
<a href="#" class="btn btn-setting btn-round"><i
|
class="icon-plus"></i></a> <a href="#" class="btn btn-round"><i
|
||||||
class="icon-plus"></i></a> <a href="#" class="btn btn-round"><i
|
class="icon-list"></i></a> <a href="#"
|
||||||
class="icon-list"></i></a> <a href="#"
|
class="btn btn-minimize btn-round"><i
|
||||||
class="btn btn-minimize btn-round"><i
|
class="icon-chevron-up"></i></a>
|
||||||
class="icon-chevron-up"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="box-content">
|
|
||||||
<div class="operatePlugins center">
|
|
||||||
<div class="span8 behavior" style="float: left;">
|
|
||||||
<div id="behaviorArea">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="behaviorButton">
|
|
||||||
<p>
|
|
||||||
<button type="submit" class="btn btn-inverse"
|
|
||||||
id="insertBehavior_Plugin" onClick="insertPlugin();">Insert</button>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<button type="submit" class="btn btn-inverse"
|
|
||||||
id="removeBehavior_Plugin" onClick="removeInsertPlugin();">Remove</button>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="box-content row-fluid">
|
||||||
|
<div id="behaviorArea" class="listArea span9"></div>
|
||||||
|
<div class="span3 button-div">
|
||||||
|
<div>
|
||||||
|
<button type="submit" class="btn btn-inverse"
|
||||||
|
id="insertBehavior_Plugin" onClick="insertPlugin();">Insert</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button type="submit" class="btn btn-inverse"
|
||||||
|
id="removeBehavior_Plugin" onClick="removeInsertPlugin();">Remove</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
<div id="showPluginMethod" class="showPluginMethod">
|
<div id="showPluginMethod" class="showPluginMethod">
|
||||||
<!-- 显示方法文档,开始动态生成 ,只显示一个-->
|
<!-- 显示方法文档,开始动态生成 ,只显示一个-->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!--/row-->
|
||||||
|
<!-- content ends -->
|
||||||
</div>
|
</div>
|
||||||
<!--/row-->
|
<!--/#content.span10-->
|
||||||
<!-- content ends -->
|
|
||||||
</div>
|
</div>
|
||||||
<!--/#content.span10-->
|
<hr>
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<div class="modal hide fade span4" id="myModal_Plugin">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" id="myModal-close" class="close"
|
|
||||||
data-dismiss="modal">×</button>
|
|
||||||
<h3>Add a new plug-in</h3>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body" style="height: 260px;">
|
|
||||||
<div class="inset scroll" id="choosePlugin">
|
|
||||||
<!-- 显示plugin列表 -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="modal hide fade " id="myModal_Plugin">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" id="myModal-close" class="close"
|
||||||
|
data-dismiss="modal">×</button>
|
||||||
|
<h3>Add a new plug-in</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="modal-body" style="height: 260px;">
|
||||||
<div class="modal-footer">
|
<div class="inset scroll" id="choosePlugin">
|
||||||
|
<!-- 显示plugin列表 -->
|
||||||
<button type="button" class="btn btn-inverse"
|
|
||||||
onClick="pluginFinish();" id="pluginFinish">Finish</button>
|
|
||||||
<button type="button" class="btn btn-inverse"
|
|
||||||
onClick="pluginCancel();" id="pluginCancel">Cancel</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal hide fade span6" id="myModal_Behavior">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" id="myModal-close" class="close"
|
|
||||||
data-dismiss="modal">×</button>
|
|
||||||
<h3>Choose the behaviors of plug-in.</h3>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body" style="height: 320px;">
|
|
||||||
<div class="inset span4 center">
|
|
||||||
<div class="span2 behavior-box scroll"
|
|
||||||
style="height: 200px; width: 220px;">
|
|
||||||
<div id="pluginMethod"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="span2 behavior-box scroll"
|
</div>
|
||||||
style="height: 200px; width: 220px;">
|
<div class="modal-footer">
|
||||||
<div id="insertPluginAreaPlugins">
|
|
||||||
<!-- 显示上个modal中的内容 -->
|
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-inverse"
|
||||||
|
onClick="pluginFinish();" id="pluginFinish">Finish</button>
|
||||||
|
<button type="button" class="btn btn-inverse"
|
||||||
|
onClick="pluginCancel();" id="pluginCancel">Cancel</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal hide fade " id="myModal_Behavior">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" id="myModal-close" class="close"
|
||||||
|
data-dismiss="modal">×</button>
|
||||||
|
<h3>Choose the behaviors of plug-in.</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body"">
|
||||||
|
<div class="row-fluid">
|
||||||
|
<div class="span6 behavior-box scroll" >
|
||||||
|
<div id="insertPluginAreaPlugins"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="span6 behavior-box scroll">
|
||||||
|
<div id="pluginMethod"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="modal-footer">
|
||||||
<div class="modal-footer">
|
|
||||||
|
|
||||||
<button type="button" class="btn btn-inverse"
|
<button type="button" class="btn btn-inverse"
|
||||||
onClick="behaviorFinish();" id="behaviorFinish">Finish</button>
|
onClick="behaviorFinish();" id="behaviorFinish">Finish</button>
|
||||||
<button type="button" class="btn btn-inverse" onClick="#"
|
<button type="button" class="btn btn-inverse" onClick="#"
|
||||||
id="behaviorCancel">Cancel</button>
|
id="behaviorCancel">Cancel</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
||||||
</div>
|
</div>
|
||||||
<jsp:include page="publiccontrol/footer.jsp"></jsp:include>
|
|
||||||
|
|
||||||
<!--/.fluid-container-->
|
<!--/.fluid-container-->
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
PluginMethodListModel = function(pluginName, methodList) {
|
var PluginMethodListModel = function(pluginName, methodList) {
|
||||||
this.pluginName = pluginName;
|
this.pluginName = pluginName;
|
||||||
this.methodList = methodList;
|
this.methodList = methodList;
|
||||||
};
|
};
|
||||||
|
var pluginChoosedList = new Array();
|
||||||
|
var num = 0;
|
||||||
var pluginList = new Array();
|
var pluginList = new Array();
|
||||||
var pluginMethodList = new Array();
|
// var pluginMethodList = new Array();
|
||||||
var index = 0;
|
var index = 0;
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
loadPluginList();
|
loadPluginList();
|
||||||
|
@ -16,7 +18,7 @@ function loadPluginList() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data = data.data;// List<String> pluginList
|
data = data.data;// List<String> pluginList
|
||||||
for (var i = 0; i < data.length; i++) {
|
for ( var i = 0; i < data.length; i++) {
|
||||||
pluginList.push(data[i]);
|
pluginList.push(data[i]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -32,7 +34,7 @@ function getMethod(pluglin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data = data.data;// List<String> methodList
|
data = data.data;// List<String> methodList
|
||||||
for (var i = 0; i < data.length; i++) {
|
for ( var i = 0; i < data.length; i++) {
|
||||||
aMethodList.push(data[i]);
|
aMethodList.push(data[i]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -41,51 +43,53 @@ function getMethod(pluglin) {
|
||||||
|
|
||||||
function addPlugin() {
|
function addPlugin() {
|
||||||
var html = "";
|
var html = "";
|
||||||
for (var j = 0; j < pluginList.length; j++) {
|
for ( var j = 0; j < pluginList.length; j++) {
|
||||||
var textNode = document.createTextNode(pluginList[j]);
|
|
||||||
var divNode = document.createElement("div");
|
html += createLineWithRadio(pluginList[j],"plugin");
|
||||||
var inputNode = document.createElement("input");
|
|
||||||
var brNode = document.createElement("br");
|
|
||||||
inputNode.setAttribute("type", "radio");
|
|
||||||
inputNode.setAttribute("name", "radio");
|
|
||||||
inputNode.setAttribute("class", "chooseOnePlugin");
|
|
||||||
inputNode.setAttribute("value", pluginList[j]);
|
|
||||||
divNode.appendChild(inputNode);
|
|
||||||
divNode.appendChild(textNode);
|
|
||||||
divNode.appendChild(brNode);
|
|
||||||
html += $(divNode).html() + "<br>";
|
|
||||||
}
|
}
|
||||||
document.getElementById("choosePlugin").innerHTML = html;
|
$('#choosePlugin').html(html);
|
||||||
$('#myModal_Plugin').modal('show');
|
$('#myModal_Plugin').modal('show');
|
||||||
|
|
||||||
$("input:radio").click(function() {
|
$("input:radio").click(function() {
|
||||||
$(this).attr("checked", "checked");
|
$(this).attr("checked", "checked");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function createLineWithRadio(lineText,nameAttr) {
|
||||||
|
var textNode = document.createTextNode(lineText);
|
||||||
|
var divNode = document.createElement("div");
|
||||||
|
var inputNode = document.createElement("input");
|
||||||
|
var brNode = document.createElement("br");
|
||||||
|
inputNode.setAttribute("type", "radio");
|
||||||
|
inputNode.setAttribute("name", nameAttr);
|
||||||
|
inputNode.setAttribute("class", "chooseOnePlugin");
|
||||||
|
inputNode.setAttribute("value", lineText);
|
||||||
|
divNode.appendChild(inputNode);
|
||||||
|
divNode.appendChild(textNode);
|
||||||
|
divNode.appendChild(brNode);
|
||||||
|
return $(divNode).html() + "<br>";
|
||||||
|
}
|
||||||
// 选中的plug-in list
|
// 选中的plug-in list
|
||||||
var pluginChoosedList = new Array();
|
|
||||||
var num = 0;
|
|
||||||
function pluginFinish() {
|
function pluginFinish() {
|
||||||
|
|
||||||
$('#myModal_Plugin').modal('hide');
|
$('#myModal_Plugin').modal('hide');
|
||||||
var data;
|
var pluginName;
|
||||||
var item = $("input[name='radio']:checked").val();
|
var item = $("input[type='radio']:checked").val();
|
||||||
data = item + "_" + num;
|
pluginName = item + "_" + num;
|
||||||
pluginChoosedList.push(data);
|
pluginChoosedList.push(pluginName);
|
||||||
num++;
|
num++;
|
||||||
|
document.getElementById("pluginArea").innerHTML += createLine(pluginName);
|
||||||
|
}
|
||||||
|
function createLine(pluginName) {
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
var p = document.createElement("p");
|
var p = document.createElement("p");
|
||||||
var textNode = document.createTextNode(data);
|
var textNode = document.createTextNode(pluginName);
|
||||||
p.setAttribute("class", "pluginChoosedList");// 样式设计
|
|
||||||
p.setAttribute("onClick", "showInsertPlugin(this)");// 引入的plugin
|
p.setAttribute("onClick", "showInsertPlugin(this)");// 引入的plugin
|
||||||
p.setAttribute("style", "cursor:pointer;float:left;");
|
p.setAttribute("style", "cursor:pointer;float:left;");
|
||||||
p.appendChild(textNode);
|
p.appendChild(textNode);
|
||||||
div.appendChild(p);
|
div.appendChild(p);
|
||||||
|
return $(div).html();
|
||||||
document.getElementById("pluginArea").innerHTML += $(div).html();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePlugin() {
|
function removePlugin() {
|
||||||
pluginChoosedList.pop();
|
pluginChoosedList.pop();
|
||||||
var last = document.getElementById("pluginArea").lastChild;
|
var last = document.getElementById("pluginArea").lastChild;
|
||||||
|
@ -95,15 +99,15 @@ function removePlugin() {
|
||||||
function insertPlugin() {
|
function insertPlugin() {
|
||||||
document.getElementById("pluginMethod").innerHTML = "";
|
document.getElementById("pluginMethod").innerHTML = "";
|
||||||
$('#myModal_Behavior').modal('show');
|
$('#myModal_Behavior').modal('show');
|
||||||
var table = $('#pluginArea').html();
|
var chooesedPluginHtml = "";
|
||||||
document.getElementById("insertPluginAreaPlugins").innerHTML = table;
|
for ( var i = 0; i < pluginChoosedList.length; i++) {
|
||||||
|
chooesedPluginHtml += createLineWithRadio(pluginChoosedList[i],"plugin");
|
||||||
|
}
|
||||||
|
$("#insertPluginAreaPlugins").html(chooesedPluginHtml);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showInsertPlugin(selectNode) {
|
function showInsertPlugin(pluginName) {
|
||||||
$('#behaviorFinish').attr('disabled', true);
|
getMethodList(pluginName);
|
||||||
var textNode = selectNode.firstChild;
|
|
||||||
var methodData = textNode.nodeValue;
|
|
||||||
getMethodList(methodData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeInsertPlugin() {
|
function removeInsertPlugin() {
|
||||||
|
@ -116,7 +120,6 @@ function getMethodList(methodData) {
|
||||||
var methodList = new Array();
|
var methodList = new Array();
|
||||||
// plug-in.method列表
|
// plug-in.method列表
|
||||||
var plugin_method_List = new Array();
|
var plugin_method_List = new Array();
|
||||||
var plugin_method_List_count = 0;
|
|
||||||
|
|
||||||
// 得到_前的内容
|
// 得到_前的内容
|
||||||
var type = methodData.split("_");
|
var type = methodData.split("_");
|
||||||
|
@ -130,26 +133,31 @@ function getMethodList(methodData) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data = data.data;// List<String> methodList
|
data = data.data;// List<String> methodList
|
||||||
for (var i = 0; i < data.length; i++) {
|
for ( var i = 0; i < data.length; i++) {
|
||||||
plugin_method_List.push(methodData + "." + data[i]);// httpPlugin_0.post
|
plugin_method_List.push(methodData + "." + data[i]);// httpPlugin_0.post
|
||||||
plugin_method_List_count++;
|
|
||||||
methodList.push(data[i]);
|
methodList.push(data[i]);
|
||||||
|
methodHtml += createLineWithRadio(methodList[i],"method");
|
||||||
}
|
}
|
||||||
for (var j = 0; j < methodList.length; j++) {
|
// for ( var j = 0; j < methodList.length; j++) {
|
||||||
var hideTextNode = document.createTextNode(plugin_method_List
|
// var hideTextNode = document.createTextNode(plugin_method_List
|
||||||
.valueOf(j));
|
// .valueOf(j));
|
||||||
var hideNode = document.createElement("p");
|
// var hideNode = document.createElement("p");
|
||||||
hideNode.setAttribute("class", "hide");
|
// hideNode.setAttribute("class", "hide");
|
||||||
hideNode.appendChild(hideTextNode);
|
// hideNode.appendChild(hideTextNode);
|
||||||
|
//
|
||||||
methodHtml += "<div id='" + plugin_method_List.valueOf(j)
|
// methodHtml += "<div id='" + plugin_method_List.valueOf(j)
|
||||||
+ "'><a style='cursor: pointer;' onClick='show(this);'>"
|
// + "'><a style='cursor: pointer;' onClick='show(this);'>"
|
||||||
+ methodList[j] + "</a><p class='hide'>"
|
// + methodList[j] + "</a><p class='hide'>"
|
||||||
+ plugin_method_List.valueOf(j) + "</div>";
|
// + plugin_method_List.valueOf(j) + "</div>";
|
||||||
}
|
// }
|
||||||
document.getElementById("pluginMethod").innerHTML = methodHtml;
|
document.getElementById("pluginMethod").innerHTML = methodHtml;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
$('#insertPluginAreaPlugins').click(function() {
|
||||||
|
var item = $("input[type='radio']:checked").val();
|
||||||
|
showInsertPlugin(item);
|
||||||
|
});
|
||||||
function show(selectedNode) {
|
function show(selectedNode) {
|
||||||
var node = selectedNode.nextSibling.firstChild;
|
var node = selectedNode.nextSibling.firstChild;
|
||||||
var behaviorData = node.nodeValue;
|
var behaviorData = node.nodeValue;
|
||||||
|
@ -177,7 +185,7 @@ function showMethodDocument(selectedNode) {
|
||||||
var div = $("#showPluginMethod").children();
|
var div = $("#showPluginMethod").children();
|
||||||
$(div[behaviorIndex]).attr("class", "show");
|
$(div[behaviorIndex]).attr("class", "show");
|
||||||
$(div[behaviorIndex]).show();
|
$(div[behaviorIndex]).show();
|
||||||
for (var i = 0; i < length; i++) {
|
for ( var i = 0; i < length; i++) {
|
||||||
if (div[i].getAttribute("id") != behaviorIndex) {
|
if (div[i].getAttribute("id") != behaviorIndex) {
|
||||||
$(div[i]).hide();
|
$(div[i]).hide();
|
||||||
}
|
}
|
||||||
|
@ -206,10 +214,10 @@ function loadMethodParams(behaviorData, behaviorIndex) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data = data.data;
|
data = data.data;
|
||||||
for (var i = 0; i < data.length; i++) {
|
for ( var i = 0; i < data.length; i++) {
|
||||||
methodParams.push(data[i]);
|
methodParams.push(data[i]);
|
||||||
}
|
}
|
||||||
for (var j = 0; j < methodParams.length; j++) {
|
for ( var j = 0; j < methodParams.length; j++) {
|
||||||
var methodParamModel = new MethodParamModel(
|
var methodParamModel = new MethodParamModel(
|
||||||
methodParams[j].name,
|
methodParams[j].name,
|
||||||
methodParams[j].lable,
|
methodParams[j].lable,
|
||||||
|
@ -218,7 +226,7 @@ function loadMethodParams(behaviorData, behaviorIndex) {
|
||||||
methodParams[j].paramType,
|
methodParams[j].paramType,
|
||||||
methodParams[j].methodParamProperties);
|
methodParams[j].methodParamProperties);
|
||||||
var methodParamProperties = new Array();
|
var methodParamProperties = new Array();
|
||||||
for (var q = 0; q < methodParamModel.methodParamProperties.length; q++) {
|
for ( var q = 0; q < methodParamModel.methodParamProperties.length; q++) {
|
||||||
var methodParamPropertyModel = new MethodParamPropertyModel(
|
var methodParamPropertyModel = new MethodParamPropertyModel(
|
||||||
methodParamModel.methodParamProperties[q].key,
|
methodParamModel.methodParamProperties[q].key,
|
||||||
methodParamModel.methodParamProperties[q].value);
|
methodParamModel.methodParamProperties[q].value);
|
||||||
|
@ -227,7 +235,7 @@ function loadMethodParams(behaviorData, behaviorIndex) {
|
||||||
}
|
}
|
||||||
var type = methodParamModel.paramType;
|
var type = methodParamModel.paramType;
|
||||||
var size = 0, cols = "", rows = "";
|
var size = 0, cols = "", rows = "";
|
||||||
for (var p = 0; p < methodParamProperties.length; p++) {
|
for ( var p = 0; p < methodParamProperties.length; p++) {
|
||||||
var methodParamProertyModel = methodParamProperties[p];
|
var methodParamProertyModel = methodParamProperties[p];
|
||||||
if (methodParamProertyModel.key == "size") {
|
if (methodParamProertyModel.key == "size") {
|
||||||
size = methodParamProertyModel.value;
|
size = methodParamProertyModel.value;
|
||||||
|
@ -400,7 +408,7 @@ function createTable(methodParamModel, cols, behaviorIndex) {
|
||||||
var table_content = cols.split(valueSeperator);
|
var table_content = cols.split(valueSeperator);
|
||||||
// 创建Table head
|
// 创建Table head
|
||||||
var tr = document.createElement("tr");
|
var tr = document.createElement("tr");
|
||||||
for (var i = 0; i < table_content.length; i++) {
|
for ( var i = 0; i < table_content.length; i++) {
|
||||||
var th = document.createElement("th");
|
var th = document.createElement("th");
|
||||||
var text = document.createTextNode(table_content[i]);
|
var text = document.createTextNode(table_content[i]);
|
||||||
th.appendChild(text);
|
th.appendChild(text);
|
||||||
|
@ -408,7 +416,7 @@ function createTable(methodParamModel, cols, behaviorIndex) {
|
||||||
}
|
}
|
||||||
// 创建一行
|
// 创建一行
|
||||||
var tr_content = document.createElement("tr");
|
var tr_content = document.createElement("tr");
|
||||||
for (var j = 0; j < table_content.length; j++) {
|
for ( var j = 0; j < table_content.length; j++) {
|
||||||
var td_content = document.createElement("td");
|
var td_content = document.createElement("td");
|
||||||
var text_content = document.createElement("input");
|
var text_content = document.createElement("input");
|
||||||
text_content.setAttribute("type", "text");
|
text_content.setAttribute("type", "text");
|
||||||
|
@ -464,7 +472,7 @@ function addCol(selectedNode) {
|
||||||
var tbody = selectedNode.nextSibling.nextSibling.nextSibling.lastChild;
|
var tbody = selectedNode.nextSibling.nextSibling.nextSibling.lastChild;
|
||||||
var length = tbody.previousSibling.firstChild.childNodes.length;
|
var length = tbody.previousSibling.firstChild.childNodes.length;
|
||||||
var tr = document.createElement("tr");
|
var tr = document.createElement("tr");
|
||||||
for (var i = 0; i < length; i++) {
|
for ( var i = 0; i < length; i++) {
|
||||||
var td = document.createElement("td");
|
var td = document.createElement("td");
|
||||||
var input = document.createElement("input");
|
var input = document.createElement("input");
|
||||||
td.appendChild(input);
|
td.appendChild(input);
|
||||||
|
@ -499,7 +507,7 @@ function createCheckBox(methodParamModel, rows, behaviorIndex) {
|
||||||
div.setAttribute("class", "sample_sub_frame");
|
div.setAttribute("class", "sample_sub_frame");
|
||||||
p.appendChild(labelNode);
|
p.appendChild(labelNode);
|
||||||
|
|
||||||
for (var i = 0; i < cb_content.length; i++) {
|
for ( var i = 0; i < cb_content.length; i++) {
|
||||||
var checkBoxNode = document.createElement("input");
|
var checkBoxNode = document.createElement("input");
|
||||||
var brInput = document.createElement("br");
|
var brInput = document.createElement("br");
|
||||||
checkBoxNode.setAttribute("type", "checkbox");
|
checkBoxNode.setAttribute("type", "checkbox");
|
||||||
|
@ -547,7 +555,7 @@ function uploadBehavior(selectedNode) {
|
||||||
var tableList = "";
|
var tableList = "";
|
||||||
var checkList = "";
|
var checkList = "";
|
||||||
|
|
||||||
for (var i = 0; i < length; i++) {
|
for ( var i = 0; i < length; i++) {
|
||||||
var node = div[i];
|
var node = div[i];
|
||||||
alert("node=" + $(node).attr("class"));
|
alert("node=" + $(node).attr("class"));
|
||||||
if ($(node).attr("class") == "Field sample_frame") {
|
if ($(node).attr("class") == "Field sample_frame") {
|
||||||
|
@ -555,7 +563,7 @@ function uploadBehavior(selectedNode) {
|
||||||
} else if ($(node).attr("class") == "MultiField sample_frame") {
|
} else if ($(node).attr("class") == "MultiField sample_frame") {
|
||||||
var fieldNode = $(node).find("table").children();
|
var fieldNode = $(node).find("table").children();
|
||||||
var fieldLength = $(fieldNode).length;
|
var fieldLength = $(fieldNode).length;
|
||||||
for (var j = 0; j < fieldLength; j++) {
|
for ( var j = 0; j < fieldLength; j++) {
|
||||||
multiFieldList += $(fieldNode[j]).find("input").val() + ",";
|
multiFieldList += $(fieldNode[j]).find("input").val() + ",";
|
||||||
}
|
}
|
||||||
} else if ($(node).attr("class") == "Table sample_frame") {
|
} else if ($(node).attr("class") == "Table sample_frame") {
|
||||||
|
@ -564,8 +572,8 @@ function uploadBehavior(selectedNode) {
|
||||||
var row = table.find("tbody").children().length;
|
var row = table.find("tbody").children().length;
|
||||||
alert("col=" + col + ",row=" + row);
|
alert("col=" + col + ",row=" + row);
|
||||||
var tbody = $(node).find("tbody");
|
var tbody = $(node).find("tbody");
|
||||||
for (var m = 0; m < row; m++) {
|
for ( var m = 0; m < row; m++) {
|
||||||
for (var n = 0; n < col; n++) {
|
for ( var n = 0; n < col; n++) {
|
||||||
var rowNode = $(tbody).children()[m];
|
var rowNode = $(tbody).children()[m];
|
||||||
var colNode = $(rowNode).children()[n];
|
var colNode = $(rowNode).children()[n];
|
||||||
var value = $(colNode).find("input").val();
|
var value = $(colNode).find("input").val();
|
||||||
|
|