├── .gitignore ├── LICENSE ├── README.md └── chatapp ├── .meteor ├── .finished-upgraders ├── .gitignore ├── .id ├── packages ├── release └── versions ├── client ├── client.css ├── client.html └── client.js ├── models.js ├── smart.json └── smart.lock /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | 10 | pids 11 | logs 12 | results 13 | 14 | npm-debug.log 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Sebastian Dahlgren 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | meteor-chat-tutorial 2 | ==================== 3 | 4 | This is an example [Meteor](http://www.meteor.com) application. It's a basic chat app where users login using their GitHub accounts to chat. Please read the tutorial at [sebastiandahlgren.se](http://sebastiandahlgren.se) 5 | 6 | License 7 | ------- 8 | 9 | The MIT License (MIT) 10 | 11 | Copyright (c) 2013 Sebastian Dahlgren 12 | 13 | Permission is hereby granted, free of charge, to any person obtaining a copy of 14 | this software and associated documentation files (the "Software"), to deal in 15 | the Software without restriction, including without limitation the rights to 16 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 17 | the Software, and to permit persons to whom the Software is furnished to do so, 18 | subject to the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be included in all 21 | copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 25 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 26 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 27 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 28 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 29 | -------------------------------------------------------------------------------- /chatapp/.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | -------------------------------------------------------------------------------- /chatapp/.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /chatapp/.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | i6vwsdn3ihl91k6jq48 8 | -------------------------------------------------------------------------------- /chatapp/.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # 3 | # 'meteor add' and 'meteor remove' will edit this file for you, 4 | # but you can also edit it by hand. 5 | 6 | autopublish 7 | insecure 8 | accounts-ui 9 | accounts-github 10 | standard-app-packages 11 | -------------------------------------------------------------------------------- /chatapp/.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@0.9.2.1 2 | -------------------------------------------------------------------------------- /chatapp/.meteor/versions: -------------------------------------------------------------------------------- 1 | accounts-base@1.1.0 2 | accounts-github@1.0.0 3 | accounts-oauth@1.1.0 4 | accounts-ui-unstyled@1.1.1 5 | accounts-ui@1.1.0 6 | application-configuration@1.0.2 7 | autopublish@1.0.0 8 | autoupdate@1.1.0 9 | base64@1.0.0 10 | binary-heap@1.0.0 11 | blaze-tools@1.0.0 12 | blaze@2.0.0 13 | boilerplate-generator@1.0.0 14 | callback-hook@1.0.0 15 | check@1.0.0 16 | ctl-helper@1.0.3 17 | ctl@1.0.1 18 | ddp@1.0.8 19 | deps@1.0.3 20 | ejson@1.0.2 21 | fastclick@1.0.0 22 | follower-livedata@1.0.1 23 | geojson-utils@1.0.0 24 | github@1.1.0 25 | html-tools@1.0.0 26 | htmljs@1.0.1 27 | http@1.0.5 28 | id-map@1.0.0 29 | insecure@1.0.0 30 | jquery@1.0.0 31 | json@1.0.0 32 | less@1.0.8 33 | livedata@1.0.9 34 | localstorage@1.0.0 35 | logging@1.0.3 36 | meteor-platform@1.1.0 37 | meteor@1.1.0 38 | minifiers@1.1.0 39 | minimongo@1.0.3 40 | mobile-status-bar@1.0.0 41 | mongo@1.0.5 42 | oauth2@1.1.0 43 | oauth@1.1.0 44 | observe-sequence@1.0.2 45 | ordered-dict@1.0.0 46 | random@1.0.0 47 | reactive-dict@1.0.2 48 | reactive-var@1.0.1 49 | reload@1.1.0 50 | retry@1.0.0 51 | routepolicy@1.0.1 52 | service-configuration@1.0.1 53 | session@1.0.1 54 | spacebars-compiler@1.0.2 55 | spacebars@1.0.1 56 | standard-app-packages@1.0.1 57 | templating@1.0.6 58 | tracker@1.0.2 59 | ui@1.0.2 60 | underscore@1.0.0 61 | url@1.0.0 62 | webapp-hashing@1.0.0 63 | webapp@1.1.1 64 | -------------------------------------------------------------------------------- /chatapp/client/client.css: -------------------------------------------------------------------------------- 1 | html { 2 | padding: 10px; 3 | font-family: Verdana, sans-serif; 4 | } 5 | 6 | .login-buttons-dropdown-align-right { 7 | float: right; 8 | } -------------------------------------------------------------------------------- /chatapp/client/client.html: -------------------------------------------------------------------------------- 1 | 2 | Chat app 3 | 4 | 5 | 6 | {{> loginButtons align="right"}}
7 |

Chatapp

8 | {{> welcome }} 9 | {{> input }} 10 | {{> messages }} 11 | 12 | 13 | 18 | 19 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /chatapp/client/client.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Templates 3 | */ 4 | Template.messages.helpers({ 5 | messages: function() { 6 | return Messages.find({}, { sort: { time: -1}}); 7 | } 8 | }) 9 | 10 | Template.input.events = { 11 | 'keydown input#message' : function (event) { 12 | if (event.which == 13) { // 13 is the enter key event 13 | if (Meteor.user()) 14 | var name = Meteor.user().profile.name; 15 | else 16 | var name = 'Anonymous'; 17 | var message = document.getElementById('message'); 18 | 19 | if (message.value != '') { 20 | Messages.insert({ 21 | name: name, 22 | message: message.value, 23 | time: Date.now(), 24 | }); 25 | 26 | document.getElementById('message').value = ''; 27 | message.value = ''; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /chatapp/models.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Models 3 | */ 4 | Messages = new Meteor.Collection('messages'); 5 | -------------------------------------------------------------------------------- /chatapp/smart.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": {} 3 | } 4 | -------------------------------------------------------------------------------- /chatapp/smart.lock: -------------------------------------------------------------------------------- 1 | { 2 | "meteor": {}, 3 | "dependencies": { 4 | "basePackages": {}, 5 | "packages": {} 6 | } 7 | } 8 | --------------------------------------------------------------------------------