Conflicts:
	Bench4Q-Web/src/main/webapp/script/editor/usePlugin.js
This commit is contained in:
hmm 2014-08-21 13:38:38 +08:00
commit ee901e8633
2 changed files with 14 additions and 19 deletions

View File

@ -79,7 +79,7 @@ function jstreeCreate(containerId){
"themes" : { "stripes" : true }
},
"types" : {
"#" : { "max_depth" : 4, "valid_children" : ["page"] },
"#" : { "max_depth" : 4, "valid_children" : ["page","default"] },
"page" : { "icon" : false, "valid_children" : ["batch"] },
"batch" : { "icon" : false, "valid_children" : ["default"] },
"default" : { "icon" : false, "valid_children" : [] }

View File

@ -6,21 +6,19 @@ function PluginModel(id, name) {
}
function UsePlugin() {
var containerId = "usePluginList";
var containerId = "usePluginList";
var usePlugin = this;
this.map = new HashMap();
this.index = 1;
this.usePluginEditorMap = new HashMap();
//init tree
jstreeCreate(containerId);
jstreeCreate(containerId);
$("#addPlugin").click(function() {
$("#addPlugin").addClass("clicked");
$("#selectUsePlugin").modal('show');
});
$("#deletePlugin").click(function() {
});
$("#selectUsePlugin #ok").click(
function() {
var pluginName = $(
@ -34,32 +32,28 @@ function UsePlugin() {
// $("#usePluginList").append(
// createRadio( pluginModel.id, pluginModel.nickName,
// "usePlugin",pluginModel.name));
usePlugin.map.put(pluginModel.id, pluginModel);
usePlugin.updateUsePlugin();
usePlugin.createEditor(pluginModel);
usePlugin.index++;
$("#selectUsePlugin").modal('hide');
});
$("#selectUsePlugin #cancel").click(function() {
$("#selectUsePlugin").modal('hide');
});
$("#removePlugin").click(
function() {
var pluginId = $(
"#usePluginList input[name='usePlugin']:checked").attr(
"id");
if (pluginId == undefined) {
var pluginId = getSelectedNodes(usePlugin.containerId);
if (!pluginId.length) {
return;
} else {
usePlugin.map.remove(pluginId);
usePlugin.usePluginEditorMap.remove(pluginId);
usePlugin.createUsePlugin(usePlugin.map);
}
}
usePlugin.map.remove(pluginId);
usePlugin.usePluginEditorMap.remove(pluginId);
jstreeDeleteNode(usePlugin.containerId);
// usePlugin.createUsePlugin(usePlugin.map);
$("#usePluginEditor").attr("usePlugin", "");
$("#usePluginEditor").html("");
@ -68,6 +62,7 @@ function UsePlugin() {
$("#usePluginList").html("");
usePlugin.map.clear();
usePlugin.usePluginEditorMap.clear();
//jstreeClearNode(usePlugin.containerId);
});
this.createUsePlugin = function(map) {
$("#usePluginList").html("");