<commit_before>var breadcrumbList = new Array();
var currentTreeNode;
var currentTreeChildrenNodes;
var currentOperationType;
var zTreeSetting = {
	data: { simpleData: { enable: true}},
	callback: {
		beforeClick: function(){
			$("a.curSelectedNode").removeClass("curSelectedNode");
		},
		onClick: function(event, treeId, treeNode){
			currentTreeNode = treeNode;
			breadcrumbList = new Array();
			breadcrumbList.push({name:treeNode.name, treeNodeId:treeNode.id});
			getBreadcrumb(treeNode, breadcrumbList);
			breadcrumbList.reverse();
			createBreadcrumbList(breadcrumbList);
			readSubFileAndDirectory(breadcrumbList);
			currentTreeChildrenNodes = tree.getNodesByFilter(function(node){
				return true;
			}, false, currentTreeNode);
			if(checkIsResolvent()){
				$(".toolbar > div").removeClass("btn-normal").addClass("btn-disable");
			}else{
				resetToolbarState();
			}
		}
	}
};
var tree;
$(document).ready(function(){
	$("#upload").change(function(){
		var fileName = $(this).val();
		var fName = fileName.substring(fileName.lastIndexOf("\\")+1);
		$("#fileName").val(fName);
		$("#path").val(getBreadcrumbNameList(breadcrumbList));
		try{
			$("#uploadFile").submit();
			alert("上传成功！");
			var guid = FixFlow.Utils.createGuid();
			$thumb_wrap = $('<div class="thumb-wrap" dirType="file"><div class="thumb model"></div><span class="x-editable" title="'+fName+'">'+fName+'</span></div>');
			$thumb_wrap.appendTo($("div.view_plugin"));
		}catch(e){
			alert("上传失败！");
		}
	});
	
	$.ajax({
		url: "/bpmcenter/FileAndDirectoryServlet",
		type: "POST",
		dataType: "text",
		data: {
			method: "loadTree"
		},
		success: function(data){
			eval("var d = " + data);
			tree = $.fn.zTree.init($("div.left ul.ztree"), zTreeSetting, d.result);
			$("#folderTree_1_a").click();
			var node = tree.getNodeByTId("folderTree_1");
			tree.expandNode(node, true);
		}
	});
	
	resetToolbarState();
	$("div.toolbar > div.listBtn").each(function(){
		
		$(this).click(function(event){
			if($(this).hasClass("btn-disable")){
				return;
			}
			var $selectTarget = $("div.thumb-wrap[select=true]");
			switch($(this).attr("btn-type")){
				case "createFile":
					currentOperationType = "createFile";
					$("div.thumb-wrap[dirType=empty]").remove();
					var guid = FixFlow.Utils.createGuid();
					var $newFile = $('<div class="thumb-wrap" dirType="file"><div class="thumb model"></div></div>');
					$newFile.appendTo($("div.view_plugin"));
					var $newFileName = $('<span class="editable"><input type="text" class="editName" style="width:90px;" oldValue="未命名"/></span>').appendTo($newFile);
					var $input = $("input", $newFileName);
					$input.focus();
					$input.keydown(function(event){
						if(event.keyCode == 13){
							var name = $(this).val();
							$input.parent("span").replaceWith("<span>"+name+"</span>");
							/*$.ajax({
								url: "/bpmcenter/FileAndDirectoryServlet",
								type: "POST",
								dataType: "text",
								data: {
									method: "create",
									path: getBreadcrumbNameList(breadcrumbList),
									newFileName: name
								},
								success: function(data){
									eval("var d = " + data);
									if(d.state == "error"){
										alert("文件夹重名！");
										$input.focus();
										$input.select();
										return;
									}
									$input.parent("span").replaceWith("<span>"+name+"</span>");
									tree.addNodes(currentTreeNode,{name:name, isParent:true, id:guid});
								}
							});*/
						};
					});
					break;
				case "createFolder":
					currentOperationType = "create";
					$("div.thumb-wrap[dirType=empty]").remove();
					var guid = FixFlow.Utils.createGuid();
					var $newFolder = $('<div class="thumb-wrap" dirType="dir" treeNodeId="'+guid+'"><div class="thumb"><img src="/bpmcenter/fixflow-explorer/images/nuvola/64x64/filesystems/folder_grey.png" title="End-to-End processes1" class="x-thumb-icon"></div></div>');
					$newFolder.appendTo($("div.view_plugin"));
					var $newFolderName = $('<span class="editable"><input type="text" class="editName" style="width:90px;" oldValue="未命名"/></span>').appendTo($newFolder);
					var $input = $("input", $newFolderName);
					$input.focus();
					$input.keydown(function(event){
						if(event.keyCode == 13){
							var name = $(this).val();
							//breadcrumbList.push(name);
							$.ajax({
								url: "/bpmcenter/FileAndDirectoryServlet",
								type: "POST",
								dataType: "text",
								data: {<commit_msg>流程梳理库新建文件<commit_after>var breadcrumbList = new Array();
var currentTreeNode;
var currentTreeChildrenNodes;
var currentOperationType;
var zTreeSetting = {
	data: { simpleData: { enable: true}},
	callback: {
		beforeClick: function(){
			$("a.curSelectedNode").removeClass("curSelectedNode");
		},
		onClick: function(event, treeId, treeNode){
			currentTreeNode = treeNode;
			breadcrumbList = new Array();
			breadcrumbList.push({name:treeNode.name, treeNodeId:treeNode.id});
			getBreadcrumb(treeNode, breadcrumbList);
			breadcrumbList.reverse();
			createBreadcrumbList(breadcrumbList);
			readSubFileAndDirectory(breadcrumbList);
			currentTreeChildrenNodes = tree.getNodesByFilter(function(node){
				return true;
			}, false, currentTreeNode);
			if(checkIsResolvent()){
				$(".toolbar > div").removeClass("btn-normal").addClass("btn-disable");
			}else{
				resetToolbarState();
			}
		}
	}
};
var tree;
$(document).ready(function(){
	$("#upload").change(function(){
		var fileName = $(this).val();
		var fName = fileName.substring(fileName.lastIndexOf("\\")+1);
		$("#fileName").val(fName);
		$("#path").val(getBreadcrumbNameList(breadcrumbList));
		try{
			$("#uploadFile").submit();
			alert("上传成功！");
			var guid = FixFlow.Utils.createGuid();
			$thumb_wrap = $('<div class="thumb-wrap" dirType="file"><div class="thumb model"></div><span class="x-editable" title="'+fName+'">'+fName+'</span></div>');
			$thumb_wrap.appendTo($("div.view_plugin"));
		}catch(e){
			alert("上传失败！");
		}
	});
	
	$.ajax({
		url: "/bpmcenter/FileAndDirectoryServlet",
		type: "POST",
		dataType: "text",
		data: {
			method: "loadTree"
		},
		success: function(data){
			eval("var d = " + data);
			tree = $.fn.zTree.init($("div.left ul.ztree"), zTreeSetting, d.result);
			$("#folderTree_1_a").click();
			var node = tree.getNodeByTId("folderTree_1");
			tree.expandNode(node, true);
		}
	});
	
	resetToolbarState();
	$("div.toolbar > div.listBtn").each(function(){
		
		$(this).click(function(event){
			if($(this).hasClass("btn-disable")){
				return;
			}
			var $selectTarget = $("div.thumb-wrap[select=true]");
			switch($(this).attr("btn-type")){
				case "createFile":
					currentOperationType = "createFile";
					$("div.thumb-wrap[dirType=empty]").remove();
					var guid = FixFlow.Utils.createGuid();
					var $newFile = $('<div class="thumb-wrap" dirType="file"><div class="thumb model"></div></div>');
					$newFile.appendTo($("div.view_plugin"));
					var $newFileName = $('<span class="editable"><input type="text" class="editName" style="width:90px;" oldValue="未命名"/></span>').appendTo($newFile);
					var $input = $("input", $newFileName);
					$input.focus();
					$input.keydown(function(event){
						if(event.keyCode == 13){
							var name = $(this).val();
							$.ajax({
								url: "/bpmcenter/FlowWebManagerServlet",
								type: "POST",
								dataType: "text",
								data: {
									method: "createBPMNFile",
									path: getBreadcrumbNameList(breadcrumbList),
									name: "abc",
									id:name+".bpmn"
								},
								success: function(data){
									/*eval("var d = " + data);
									if(d.state == "error"){
										alert("文件夹重名！");
										$input.focus();
										$input.select();
										return;
									}*/
									$input.parent("span").replaceWith("<span>"+name+".bpmn</span>");
									//tree.addNodes(currentTreeNode,{name:name, isParent:true, id:guid});
								}
							});
						};
					});
					break;
				case "createFolder":
					currentOperationType = "create";
					$("div.thumb-wrap[dirType=empty]").remove();
					var guid = FixFlow.Utils.createGuid();
					var $newFolder = $('<div class="thumb-wrap" dirType="dir" treeNodeId="'+guid+'"><div class="thumb"><img src="/bpmcenter/fixflow-explorer/images/nuvola/64x64/filesystems/folder_grey.png" title="End-to-End processes1" class="x-thumb-icon"></div></div>');
					$newFolder.appendTo($("div.view_plugin"));
					var $newFolderName = $('<span class="editable"><input type="text" class="editName" style="width:90px;" oldValue="未命名"/></span>').appendTo($newFolder);
					var $input = $("input", $newFolderName);
					$input.focus();
					$input.keydown(function(event){
						if(event.keyCode == 13){
							var name = $(this).val();
							//breadcrumbList.push(name);
							$.ajax({
								url: "/bpmcenter/FileAndDirectoryServlet",
								type: "POST",
								dataType: "text",
								data: {
{'fraction_non_alphanumeric': 0.2005859815190444, 'fraction_numerical': 0.003606040117196304, 'mean_word_length': 3.720744680851064, 'pattern_counts': {'":': 4, '<': 51, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6035265', 'n_tokens_mistral': 3775, 'n_tokens_neox': 2965, 'n_words': 452}