Misc styling for sample app
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 4d926d3 · Browse files · 3 files·+36 added−5 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+36 added−5 removed
- other:+36 added−5 removed
Provenance
- Commit
f73c3fc- Tree
8ee888b- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
4d926d3
3 files changed+36 added−5 removed
modified:examples/upload/views/style.sass.css+5 added
48 unmodified lines495051525354555657585960614 unmodified lines48 unmodified lines :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#c7c7c7))input[name=name] :width 80px form .panel :float left :clear both a :color #1ABFF1 :-webkit-transition-property padding :-webkit-transition-duration 0.15s4 unmodified linesmodified:examples/upload/views/upload.haml.html+6 added-2 removed
1234345678%h1 Upload%form{ method: 'post' } %input{ type: 'file', name: 'image' } %input{ type: 'submit', value: 'Upload' }No newline at end of file %input{ type: 'file', name: 'image[]' } %input{ type: 'file', name: 'image[]' } %input{ type: 'file', name: 'image[]' } .panel %input{ type: 'text', name: 'name', value: 'Name' } %input{ type: 'submit', value: 'Upload' }No newline at end of filemodified:lib/express/core.js+25 added-3 removed
9 unmodified lines10 process.mixin(require('express/plugin'))11 process.mixin(require('express/mime'))12 process.mixin(require('express/dsl'))13 14+var multipart = require('multipart')15+16 // --- Route17 18 Route = Class({19 194 unmodified lines214 if (backlog !== undefined) this.backlog = backlog215 require('http')216 .createServer(function(request, response){217 request.body = ''216- request.setBodyEncoding('utf8')217- request.addListener('body', function(chunk){ request.body += chunk })218- request.addListener('complete', function(){ self.route(request, response) })218+ request.setBodyEncoding('binary')219+ if (request.headers['content-type'] &&220+ request.headers['content-type'].indexOf('application/x-www-form-urlencoded') > -1) {221+ // var stream = new multipart.Stream(request)222+ // stream.addListener('part', function(part) {223+ // part.addListener('body', function(chunk) {224+ // var progress = (stream.bytesReceived / stream.bytesTotal * 100).toFixed(2);225+ // var mb = (stream.bytesTotal / 1024 / 1024).toFixed(1);226+ // 227+ // sys.print("Uploading "+mb+"mb ("+progress+"%)\015");228+ // 229+ // // chunk could be appended to a file if the uploaded file needs to be saved230+ // });231+ // });232+ // stream.addListener('complete', function() {233+ // res.sendHeader(200, {'Content-Type': 'text/plain'});234+ // res.sendBody('Thanks for playing!');235+ // res.finish();236+ // sys.puts("\n=> Done");237+ // });238+ } else239+ request.addListener('body', function(chunk){ request.body += chunk }),240+ request.addListener('complete', function(){ self.route(request, response) })241 })242 .listen(this.port, this.host, this.backlog)243 puts('Express started at http://' + this.host + ':' + this.port + '/ in ' + Express.environment + ' mode')244 },62 unmodified lines