More example app styling
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 8d031f6 · Browse files · 3 files·+120 added−73 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+120 added−73 removed
- other:+120 added−73 removed
Provenance
- Commit
bb2e79f- Tree
0ad83fa- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
8d031f6
3 files changed+120 added−73 removed
modified:examples/public/style.css+78 added-44 removed
1234567891011121314151617181920212223242526272829303132333435363738394041424344123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778body { font-family: "Helvetica Neue", "Lucida Grande", "Arial"; font-size: 13px; text-align: center; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1); color: #555; } h1, h2 { margin: 0; font-size: 22px; color: #343434; } h1 em, h2 em { padding: 0 5px; font-weight: normal; } h1 { text-shadow: 1px 2px 2px #ddd; font-size: 60px; } #wrapper { margin: 50px auto; width: 500px; text-align: left; } ul { margin: 0; padding: 0; } ul li { margin: 5px 0; padding: 3px 8px; list-style: none; border: 1px solid #eee; -webkit-border-radius: 3px; -mox-border-radius: 3px; -webkit-transition-property: color, padding; -webkit-transition-duration: 0.1s; } ul li:hover { padding: 3px 20px; cursor: pointer; color: #2E2E2E; } No newline at end of filebody { font-family: "Helvetica Neue", "Lucida Grande", "Arial"; font-size: 13px; text-align: center; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1); color: #555;}h1, h2 { margin: 0; font-size: 22px; color: #343434;}h1 { text-shadow: 1px 2px 2px #ddd; font-size: 60px;}#wrapper { margin: 50px auto; width: 500px; text-align: left;}ul { margin: 0; padding: 0;}ul li { margin: 5px 0; padding: 3px 8px; list-style: none; border: 1px solid #eee; -webkit-border-radius: 3px; -mox-border-radius: 3px; -webkit-transition-property: color; -webkit-transition-duration: 0.1s;}ul li:hover { cursor: pointer; color: #2E2E2E;}ul { max-height: 400px; overflow-x: hidden;}input[type=text] { padding: 5px; border: 1px solid #ddd; outline: none; -webkit-border-radius: 2px; -moz-border-radius: 2px;}input[type=text]:focus { border-color: #00C3FF;}input[type=submit] { -webkit-border-radius: 2px; -moz-border-radius: 2px; -webkit-box-shadow: 0 1px 2px #ddd; -moz-box-shadow: 0 1px 2px #ddd; padding: 6px 10px; border: solid 1px #999; background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ddd)); color: #333; text-decoration: none; cursor: pointer; display: inline-block; text-align: center; text-shadow: 0px 1px 1px #fff; line-height: 1;}input[type=submit]:hover { background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#E6E4E4));}input[type=submit]:active { background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#c7c7c7));}input[name=name] { width: 80px;}No newline at end of filemodified:examples/views/chat.haml.html+31 added-29 removed
12345678910111213141516171819202122232425262728234567891011121314151617181920212223242526272829303130313233%h1 Chat %ul#messages %form{ method: 'post' } %input{ type: 'hidden', name: '__method__', value: 'put' } %input{ type: 'text', name: 'message' } %input{ type: 'submit', value: 'Send' } :javascript $(function(){ // Send message $('form').submit(function(){ var message = $('input[name=message]') if (message.val()) $.post('/chat', { message: message.val() }, function(){ message.val('') }) else message.css('border', '1px solid red') return false }) // Poll setInterval(function(){ $.getJSON('/chat/messages', function(messages){ $('#messages').empty() $.each(messages, function(i, msg){ $('#messages') .append('<li>' + msg + '</li>') })%ul#messages%form{ method: 'post' } %input{ type: 'hidden', name: '__method__', value: 'put' } %input{ type: 'text', name: 'name', value: 'guest' } %input{ type: 'text', name: 'message' } %input{ type: 'submit', value: 'Send' }:javascript $(function(){ // Send message $('form').submit(function(){ var message = $('input[name=message]'), name = $('input[name=name]') if (message.val()) $.post('/chat', { message: $.trim(name.val()) + ': ' + message.val() }, function(){ message.val('') }) else message.css('border', '1px solid red') return false }) // Poll setInterval(function(){ $.getJSON('/chat/messages', function(messages){ $('#messages').empty() $.each(messages, function(i, msg){ $('#messages') .append('<li>' + msg + '</li>') }) }) }, 400) })No newline at end of file }, 400) })No newline at end of filemodified:examples/app.js+11 added
31 unmodified lines323334353637383940414243444546474849505131 unmodified lines contentType('json') return JSON.encode(messages)})
get('/public/:file', function(file){ var path = dirname(__filename) + '/public/' + file require('path').exists(path, function(exists){ if (!exists) halt() require('posix').cat(path).addCallback(function(content){ contentType(path) halt(200, content) }) })})
get('/error', function(){ throw new Error('oh noes!')})
run()