Re-organizing 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 3777bfd · Browse files · 6 files·+108 added−108 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+108 added−108 removed
- other:+108 added−108 removed
Provenance
- Commit
57ccf86- Tree
79f6c92- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
3777bfd
6 files changed+108 added−108 removed
added:examples/public/images/bubble.pngbinary
A binary file, added.
added:examples/public/javascripts/app.js+28 added
12345678910111213141516171819202122232425262728
$(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 }) // Longpoll ;(function poll(){ $.getJSON('/chat/messages', function(messages){ $('#messages').empty() $.each(messages, function(i, msg){ $('#messages') .append('<li>' + msg + '</li>') .get(0).scrollTop = $('#messages').get(0).scrollHeight }) poll() }) })()})No newline at end of fileadded:examples/public/stylesheets/style.css+78 added
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778body { 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: 350px; 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 filedeleted:examples/public/app.js-28 removed
12345678910111213141516171819202122232425262728
$(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 }) // Longpoll ;(function poll(){ $.getJSON('/chat/messages', function(messages){ $('#messages').empty() $.each(messages, function(i, msg){ $('#messages') .append('<li>' + msg + '</li>') .get(0).scrollTop = $('#messages').get(0).scrollHeight }) poll() }) })()})No newline at end of filedeleted:examples/public/style.css-78 removed
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778body { 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: 350px; 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/layout.haml.html+2 added-2 removed
1234565678%html %head %title Chat %script{ src: 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' } %script{ src: '/public/app.js' } %link{ rel: 'stylesheet', href: '/public/style.css' } %script{ src: '/public/javascripts/app.js' } %link{ rel: 'stylesheet', href: '/public/stylesheets/style.css' } %body #wrapper= body