diff --git a/Bench4Q-Web/src/main/webapp/script/editor/createScript.js b/Bench4Q-Web/src/main/webapp/script/editor/createScript.js index b303d29a..5c9f5c1d 100644 --- a/Bench4Q-Web/src/main/webapp/script/editor/createScript.js +++ b/Bench4Q-Web/src/main/webapp/script/editor/createScript.js @@ -1,6 +1,7 @@ $(function() { $("#tabs").tabs(); var usePlugin = new UsePlugin(); + //初始化所有可选的插件 usePlugin.getPluginList(); var behavior = new Behavior(); var collectScriptData = new CollectScriptData(usePlugin, behavior); diff --git a/Bench4Q-Web/src/main/webapp/script/editor/uiFactory.js b/Bench4Q-Web/src/main/webapp/script/editor/uiFactory.js index 8a3acbed..96696b3e 100644 --- a/Bench4Q-Web/src/main/webapp/script/editor/uiFactory.js +++ b/Bench4Q-Web/src/main/webapp/script/editor/uiFactory.js @@ -1,10 +1,16 @@ function createRadioGroup(items,name,containerId){ for ( var i = 0; i < items.length; i++) { - var radio = createRadio(items[i],name); + var radio = createRadio(items[i],name,items[i]); $("#" + containerId).append(radio); } } +/** + * @param item 显示文本 + * @param name 统一radio + * @param id 方便label标签和div选择 + * @returns + */ function createRadio (item,name,id) { var line = $("
"); line.click(function(){ diff --git a/Bench4Q-Web/src/main/webapp/script/editor/usePlugin.js b/Bench4Q-Web/src/main/webapp/script/editor/usePlugin.js index 8b185e56..ed711a76 100644 --- a/Bench4Q-Web/src/main/webapp/script/editor/usePlugin.js +++ b/Bench4Q-Web/src/main/webapp/script/editor/usePlugin.js @@ -24,7 +24,7 @@ function UsePlugin() { //添加到已有的插件列表中 $("#usePluginList").append( createRadio(pluginName + "_" + usePlugin.index, - "usePlugin")); + "usePlugin", usePlugin.index)); //在usePlugin类中存储新添加的插件 usePlugin.map.put(usePlugin.index, pluginName); //待测试 @@ -69,7 +69,7 @@ function UsePlugin() { var keys = map.getKeys(); for ( var i = 0; i < keys.length; i++) { $("#usePluginList").append( - createRadio(map.get(keys[i]) + "_" + keys[i], "usePlugin")); + createRadio(map.get(keys[i]) + "_" + keys[i], "usePlugin",keys[i])); } $("#pluginEditor").html(""); } @@ -120,7 +120,8 @@ function UsePlugin() { $("#usePluginList") .on( "click", - "input[name='usePlugin']", + //"input[name='usePlugin']", + "div[class='line']", function() { var usePluginName = $( "#usePluginList input[name='usePlugin']:checked")