upload file modification
This commit is contained in:
parent
b8d3493d6d
commit
a0b8002d55
|
@ -1,7 +1,7 @@
|
|||
var container = new Container();
|
||||
var plugin = new Plugin(container);
|
||||
var behavior = new Behavior(container, plugin);
|
||||
var files = [];
|
||||
var files = [] ;
|
||||
$(document).ready(function() {
|
||||
pluginEditorInit();
|
||||
});
|
||||
|
@ -24,14 +24,16 @@ $("#pluginFinish").click(function(e) {
|
|||
|
||||
function fileChange(event) {
|
||||
$.each(event.target.files, function(index, file) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(event) {
|
||||
object = {};
|
||||
object.filename = file.name;
|
||||
object.data = event.target.result;
|
||||
files.push(object);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
$.each(event.target.files, function(index, file) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(event) {
|
||||
object = new Object();
|
||||
object.filename = file.name;
|
||||
object.data = event.target.result;
|
||||
files.push(object);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ function createField(label, name, size, text, behaviorIndex) {
|
|||
if (text != null) {
|
||||
$(input).attr("value", text);
|
||||
}
|
||||
|
||||
p.appendChild(labelNode);
|
||||
div.appendChild(nameNode);
|
||||
div.appendChild(input);
|
||||
|
|
|
@ -2,9 +2,7 @@ var pluginChoosedList = new Array();
|
|||
var pluginIndex = new HashMap();
|
||||
var pluginList = new Array();
|
||||
var pluginMethodList = new Array();
|
||||
var usePluginList = new Array();
|
||||
var pageList = new Array();
|
||||
var behaviors = new Array();
|
||||
var behaviorList = [];// 存放所有方法及其对应的parameter
|
||||
var pluginParamList = [];// 一个plug-in名一个paramInfoModels list
|
||||
var clickPluginMethodNode = -1;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
var behaviors = new Array();
|
||||
var usePluginList = new Array();
|
||||
var pageList = new Array();
|
||||
function submit(selectedNode) {
|
||||
var scriptName = $(selectedNode.parentNode.parentNode).find("input").val();
|
||||
saveBehaviorInfo();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var files;
|
||||
var file1;
|
||||
var fileList = [];
|
||||
var fileList = new Array();
|
||||
|
||||
test("upload files and other data", function() {
|
||||
uploadFilesAndScript();
|
||||
|
@ -63,15 +63,13 @@ function createFileInput(fileList) {
|
|||
$.each(event.target.files, function(index, file) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(event) {
|
||||
object = {};
|
||||
object = new Object();
|
||||
object.filename = file.name;
|
||||
object.data = event.target.result;
|
||||
fileList.push(object);
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
reader.readAsText(file);
|
||||
console.log(file.name);
|
||||
});
|
||||
console.log(fileList.length);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue