script editor

This commit is contained in:
hmm 2014-08-18 09:53:36 +08:00
parent 127d4afe1c
commit af0a78629d
3 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,7 @@
$(function() {
$("#tabs").tabs();
var usePlugin = new UsePlugin();
//初始化所有可选的插件
usePlugin.getPluginList();
var behavior = new Behavior();
var collectScriptData = new CollectScriptData(usePlugin, behavior);

View File

@ -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 = $("<div style='cursor:pointer;'>");
line.click(function(){

View File

@ -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")