Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

piehole

  • Loading branch information...
commit 1dce841deb2b49228210f1a1ebdbd0a9af8d5a65 1 parent ee1cf8f
@alivesay authored
View
2  piehole/.meteor/.gitignore
@@ -0,0 +1,2 @@
+local
+meteorite
View
11 piehole/.meteor/packages
@@ -0,0 +1,11 @@
+# Meteor packages used by this project, one per line.
+#
+# 'meteor add' and 'meteor remove' will edit this file for you,
+# but you can also edit it by hand.
+
+autopublish
+insecure
+preserve-inputs
+jade-handlebars
+bootstrap
+stylus
View
23 piehole/piehole.jade
@@ -0,0 +1,23 @@
+head
+ title piehole
+ link(rel="stylesheet", href="piehole.css")
+
+body
+ .container
+ .chat-well
+ {{> chat}}
+ {{> input}}
+
+template(name="chat")
+ .chat-message-box
+ .ul
+ {{#each message}}
+ li
+ span.timestamp[{{displayTime timestamp}}]
+ span.name{{name}}
+ span.class{{text}}
+ {{/each}}
+
+template(name="input")
+ input#name_input(type="text", size="10")
+ input#chat_input(type="text", size="50")
View
34 piehole/piehole.js
@@ -0,0 +1,34 @@
+Messages = new Meteor.Collection("messages");
+
+if (Meteor.isClient) {
+ Template.chat.message = Messages.find();
+
+ Template.chat.displayTime = function(timestamp) {
+ if (timestamp == undefined) {
+ return "Past";
+ } else {
+ var d = new Date(timestamp);
+ function pad(n) { return n < 10 ? '0'+n : n};
+ return "" + pad(d.getHours()) + ":" + pad(d.getMinutes()) + ":" + pad(d.getSeconds());
+ }
+ }
+
+ Template.chat.events = { "DOMNodeInserted" : function(evt) {
+ $(".chat").scrollTop(100000);
+ }}
+
+ Template.input.events = { "keydown": function (evt) {
+ if (evt.which == 13) {
+ Messages.insert({ name: $("#name_input").val(),
+ text: $("#chat_input").val(),
+ timestamp: (new Date()).getTime() });
+ $("#chat_input").val("");
+ }
+ }}
+}
+
+if (Meteor.isServer) {
+ Meteor.startup(function () {
+ // code to run on server at startup
+ });
+}
View
24 piehole/piehole.styl
@@ -0,0 +1,24 @@
+@import 'nib';
+
+$controlBackgroundColor = rgb(30,30,30);
+$controlForegroundColor = rgb(255,255,255);
+$controlGradientColor = rgb(30,30,30);
+$controlGradientHighlightColor = rgb(60,60,60);
+
+body
+ background-color: $controlBackgroundColor;
+
+
+.chat-message-box ul
+ border: 1px solid white;
+ list-style: none;
+
+.chat-message-box li
+ border-top: 1px
+ background: linear-gradient(top, $controlGradientHighlightColor, $controlGradientColor);
+ color: $controlForegroundColor;
+ display: block;
+ min-height: 40px;
+
+.chat-message-box li span
+ padding-right: 10px;
View
9 piehole/smart.json
@@ -0,0 +1,9 @@
+{
+ "meteor": {
+ "git": "https://github.com/meteor/meteor.git",
+ "branch": "devel"
+ },
+ "packages": {
+ "jade-handlebars": {}
+ }
+}
View
19 piehole/smart.lock
@@ -0,0 +1,19 @@
+{
+ "meteor": {
+ "git": "https://github.com/meteor/meteor.git",
+ "branch": "devel",
+ "commit": "b2cc217cfb34994bc18bd2b1d39f7fb4964ab22d"
+ },
+ "dependencies": {
+ "basePackages": {
+ "jade-handlebars": {}
+ },
+ "packages": {
+ "jade-handlebars": {
+ "git": "https://github.com/SimonDegraeve/meteor-jade-handlebars.git",
+ "tag": "v0.2.7",
+ "commit": "82f6f9ac43a68ffabe1d9b9620be2a4ca6790b56"
+ }
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.