Skip to content

Commit 26a431d

Browse files
author
翰文
committed
feat: change file name to jsx, update version
1 parent 814d00a commit 26a431d

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

assets/index.less

-2
This file was deleted.

examples/simple.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ var props = {
1313
}
1414
};
1515

16-
React.render(<Upload {...props}>开始上传</Upload>,
16+
React.render(<Upload {...props}><a href="#nowhere">开始上传</a></Upload>,
1717
document.getElementById('__react-content'));
File renamed without changes.

lib/iframeUploader.js renamed to lib/IframeUploader.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ var boxStyle = {
1313
var inputStyle = {
1414
position: 'absolute',
1515
filter: 'alpha(opacity=0)',
16+
outline: 0,
1617
right: 0,
1718
top: 0,
1819
fontSize: 100

lib/upload.js renamed to lib/Upload.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22
var React = require('react');
33
var PropTypes = React.PropTypes;
4-
var AjaxUpload = require('./ajaxUploader');
5-
var IframeUpload = require('./iframeUploader');
4+
var AjaxUpload = require('./AjaxUploader');
5+
var IframeUpload = require('./IframeUploader');
66
var empty = function() {};
77

88
var Upload = React.createClass({

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rc-upload",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "upload ui component for react",
55
"keywords": [
66
"react",
@@ -40,12 +40,13 @@
4040
"browser-test-cover": "node --harmony node_modules/.bin/rc-tools run browser-test-cover"
4141
},
4242
"devDependencies": {
43+
"co-busboy": "^1.3.0",
4344
"expect.js": "0.3.x",
45+
"node-dev": "2.x",
4446
"precommit-hook": "1.x",
4547
"rc-server": "2.x",
4648
"rc-tools": "2.x",
47-
"react": "0.13.x",
48-
"node-dev": "2.x"
49+
"react": "0.13.x"
4950
},
5051
"precommit": [
5152
"lint",

tests/starter.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
var app = require('rc-server')();
2+
var parse = require('co-busboy');
3+
24
app.use(function*() {
35
if (this.url === '/upload.do') {
4-
this.set('Content-Type', 'text/html');
6+
var parts = parse(this, {
7+
autoFields: true // saves the fields to parts.field(s)
8+
});
9+
var files = [];
10+
var part = yield parts;
11+
files.push(part.filename);
512
this.status = 200;
6-
this.res.end('["hello"]');
13+
this.set('Content-Type', 'text/html');
14+
this.res.end(JSON.stringify(files));
715
return;
816
}
917
});

0 commit comments

Comments
 (0)