Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More work on the server

  • Loading branch information...
commit fa3fc9d65475214ac3bc72548004d5eef63b0e25 1 parent 1aebf12
@nhunzaker authored
View
19 actions/compile/index.js
@@ -32,10 +32,13 @@ function compressor (directory, filetype, filename) {
return directory + "/" + f;
}
});
-
- var compressed = compress.all(directory, files, filename);
- return fs.writeFile(directory + "/" + newFile.trim(), compressed);
+ try {
+ var compressed = compress.all(directory, files, filename);
+ return fs.writeFile(directory + "/" + newFile.trim(), compressed);
+ } catch (x) {
+ return false;
+ }
});
@@ -72,21 +75,21 @@ module.exports = function compile (a) {
// Yes, watch the target
fs.watch(target, { persistent: true, interval: 1000 }, function () {
- nodebot.say("Files have changed. Compiling all %s in %s.", filetype.blue.bold, target.blue);
+ nodebot.say("Files have changed. Compiling all %s in %s.", filetype, target);
compressor(target, filetype);
});
compressor(target, filetype);
- nodebot.say("I am now compiling all %s in %s", filetype.blue.bold, target.blue);
+ nodebot.say("I am now compiling all %s in %s", filetype, target);
} else {
// No, use the current directory
fs.watch(process.cwd(), { persistent: true, interval: 1000 }, function () {
- nodebot.say("Files have changed. Compiling all %s into %s.", filetype.blue.bold, target.blue);
+ nodebot.say("Files have changed. Compiling all %s into %s.", filetype, target);
compressor(process.cwd(), filetype, target);
});
- nodebot.say("I am now compiling all %s into %s", filetype.blue.bold, target.blue);
+ nodebot.say("I am now compiling all %s into %s", filetype, target);
compressor(process.cwd(), filetype, target);
}
@@ -98,7 +101,7 @@ module.exports = function compile (a) {
// Make it so that when the user exits watching, it loads
// up another prompt
process.once('SIGINT', function () {
- nodebot.request("Okay, I am no longer compiling %s files.", filetype.bold.blue, target.blue);
+ nodebot.request("Okay, I am no longer compiling %s files.", filetype, target);
});
};
View
4 actions/compile/javascript.js
@@ -98,9 +98,7 @@ function compressAll (directory, files, filename) {
}).forEach(function(f) {
try {
stack.push([f, fs.readFileSync(f).toString()]);
- } catch (x) {
- console.log("Could not read file %s", f);
- }
+ } catch (x) {}
});
files = sortRequirements(stack, directory);
View
41 server/index.html
@@ -7,38 +7,27 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <link rel="stylesheet" href="/stylesheets/base.css" />
- <style>
- input[type="text"] {
- display: block;
- margin: 0 auto;
- }
-
- p {
- margin: 1em 0;
- }
- </style>
+ <link rel="stylesheet" href="/stylesheets/style.css" />
<link rel="shortcut icon" href="/images/favicon.ico" />
-
+
<script src="/socket.io/socket.io.js"></script>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
</head>
<body>
- <div class="container">
-
- <div class="sixteen columns alpha omega">
- <h1 class="remove-bottom">Nodebot</h1>
- <h5>A nodejs robot</h5>
- <hr/>
- <form>
- <input type="text" id="question" placeholder="Ask me something" />
- </form>
- <hr/.
- <div id="feed"></div>
- </div>
- <script src="/javascripts/nodebot.js"></script>
- </div>
+ <section>
+ <header>
+ <h1 class="remove-bottom">Nodebot</h1>
+ </header>
+
+ <div id="feed"></div>
+
+ <form>
+ <input type="text" id="question" placeholder="Ask me something" />
+ </form>
+
+ </section>
+ <script src="/javascripts/nodebot.js"></script>
</body>
</html>
View
4 server/index.js
@@ -19,6 +19,10 @@ app.log.info("Nodebot is listening on port", port);
// Install socket.io
Nodebot.io = require('socket.io').listen(app.server);
+Nodebot.io.configure(function() {
+ Nodebot.io.set('log level', 0);
+});
+
Nodebot.io.sockets.on('connection', function(socket) {
socket.emit('output', "Hello, master");
socket.on("input", function(d) {
View
BIN  server/public/images/brushed_alu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  server/public/images/dark_dotted.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
10 server/public/javascripts/nodebot.js
@@ -1,9 +1,15 @@
$(document).ready(function() {
- var socket = io.connect('http://localhost');
+ var socket = io.connect(window.location.origin),
+ $feed = $("#feed");
socket.on("output", function (data) {
- $("<p/>").html("<strong>Nodebot:</strong> " + data).prependTo("#feed");
+ $("<p/>").html("<strong>Nodebot:</strong> " + data)
+ .css("opacity", 0)
+ .appendTo($feed)
+ .animate({ opacity : 1 });
+
+ $feed.animate({scrollTop : $feed.height() });
});
View
63 server/public/sass/_layout.scss
@@ -1,63 +0,0 @@
-/*
-* Skeleton V1.1
-* Copyright 2011, Dave Gamache
-* www.getskeleton.com
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-* 8/17/2011
-*/
-
-/* Table of Content
-==================================================
- #Site Styles
- #Page Styles
- #Media Queries
- #Font-Face */
-
-/* #Site Styles
-================================================== */
-
-/* #Page Styles
-================================================== */
-
-.container {
- padding-top: 1.5em;
-// @include grid-background();
-}
-
-/* #Media Queries
-================================================== */
-
- /* Smaller than standard 960 (devices and browsers) */
- @media only screen and (max-width: 959px) {}
-
- /* Tablet Portrait size to standard 960 (devices and browsers) */
- @media only screen and (min-width: 768px) and (max-width: 959px) {}
-
- /* All Mobile Sizes (devices and browser) */
- @media only screen and (max-width: 767px) {}
-
- /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
- @media only screen and (min-width: 480px) and (max-width: 767px) {}
-
- /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
- @media only screen and (max-width: 479px) {}
-
-
-/* #Font-Face
-================================================== */
-/* This is the proper syntax for an @font-face file
- Just create a "fonts" folder at the root,
- copy your FontName into code below and remove
- comment brackets */
-
-/* @font-face {
- font-family: 'FontName';
- src: url('../fonts/FontName.eot');
- src: url('../fonts/FontName.eot?iefix') format('eot'),
- url('../fonts/FontName.woff') format('woff'),
- url('../fonts/FontName.ttf') format('truetype'),
- url('../fonts/FontName.svg#webfontZam02nTh') format('svg');
- font-weight: normal;
- font-style: normal; }
-*/
View
66 server/public/sass/layout.scss
@@ -1,66 +0,0 @@
-/*
-* Skeleton V1.1
-* Copyright 2011, Dave Gamache
-* www.getskeleton.com
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-* 8/17/2011
-*/
-
-/* Table of Content
-==================================================
- #Site Styles
- #Page Styles
- #Media Queries
- #Font-Face */
-
-/* #Site Styles
-================================================== */
-
-/* #Page Styles
-================================================== */
-
-body {
- padding-top: 60px;
-}
-
-.container {
-// @include grid-background();
-}
-
-/* #Media Queries
-================================================== */
-
- /* Smaller than standard 960 (devices and browsers) */
- @media only screen and (max-width: 959px) {}
-
- /* Tablet Portrait size to standard 960 (devices and browsers) */
- @media only screen and (min-width: 768px) and (max-width: 959px) {}
-
- /* All Mobile Sizes (devices and browser) */
- @media only screen and (max-width: 767px) {}
-
- /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
- @media only screen and (min-width: 480px) and (max-width: 767px) {}
-
- /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
- @media only screen and (max-width: 479px) {}
-
-
-/* #Font-Face
-================================================== */
-/* This is the proper syntax for an @font-face file
- Just create a "fonts" folder at the root,
- copy your FontName into code below and remove
- comment brackets */
-
-/* @font-face {
- font-family: 'FontName';
- src: url('../fonts/FontName.eot');
- src: url('../fonts/FontName.eot?iefix') format('eot'),
- url('../fonts/FontName.woff') format('woff'),
- url('../fonts/FontName.ttf') format('truetype'),
- url('../fonts/FontName.svg#webfontZam02nTh') format('svg');
- font-weight: normal;
- font-style: normal; }
-*/
View
2  server/public/sass/partials/_base_type.scss
@@ -15,7 +15,7 @@ body {
h1, h2, h3, h4, h5, h6 {
color: #181818;
- font-family: $serif;
+ font-family: $display;
font-weight: normal;
a {
View
56 server/public/sass/partials/_custom.scss
@@ -0,0 +1,56 @@
+
+
+body {
+ background: #333 url("/images/dark_dotted.png");
+ padding-top: 60px;
+}
+
+section {
+ background:#d9d9d9 url("/images/brushed_alu.png");
+ margin: 0 auto;
+ padding: 10px;
+ width: 45%;
+
+ @include border-radius(3px);
+
+ header {
+ text-align: center;
+ }
+}
+
+p {
+ margin: 1em 0;
+}
+
+#feed {
+ background: #222;
+ border: 1px solid #111;
+ border-bottom: 0;
+ color: #fff;
+ height: 400px;
+ margin-top: 20px;
+ overflow-y: scroll;
+
+ padding: 1% 2%;
+ width: 96%;
+
+ @include box-shadow(inset 0 1px 3px rgba(0,0,0,0.45), 0 1px 1px rgba(255,255,255,0.75));
+ @include border-top-radius(3px);
+ strong {
+ color: #f0f0f0;
+ }
+
+}
+
+input[type="text"] {
+ background: #111;
+ border-color: transparent #111 #000;
+ color: #fff;
+ display: block;
+ margin: 0 auto;
+ position: relative;
+ width: 98.5%;
+
+ @include border-top-radius(0);
+
+}
View
1  server/public/sass/partials/_variables.scss
@@ -29,5 +29,6 @@ $grid-background-column-color : rgba(100, 100, 100, 0.05);
// Typography
// -------------------------------------------------- //
+$display : "VT323", sans-serif;
$sans-serif : "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
$serif : "Georgia", "Times New Roman", Helvetica, Arial, sans-serif;
View
4 server/public/sass/base.scss → server/public/sass/style.scss
@@ -10,6 +10,8 @@
* 8/17/2011
*/
+@import url(http://fonts.googleapis.com/css?family=VT323);
+
@import "compass/css3";
@import "compass/layout";
@@ -51,4 +53,4 @@
// User Styles
// ================================================== //
-@import "layout";
+@import "partials/custom";
View
46 server/public/stylesheets/layout.css
@@ -1,46 +0,0 @@
-/*
-* Skeleton V1.1
-* Copyright 2011, Dave Gamache
-* www.getskeleton.com
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-* 8/17/2011
-*/
-/* Table of Content
-==================================================
- #Site Styles
- #Page Styles
- #Media Queries
- #Font-Face */
-/* #Site Styles
-================================================== */
-/* #Page Styles
-================================================== */
-/* line 23, ../sass/layout.scss */
-body {
- padding-top: 60px;
-}
-
-/* #Media Queries
-================================================== */
-/* Smaller than standard 960 (devices and browsers) */
-/* Tablet Portrait size to standard 960 (devices and browsers) */
-/* All Mobile Sizes (devices and browser) */
-/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
-/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
-/* #Font-Face
-================================================== */
-/* This is the proper syntax for an @font-face file
- Just create a "fonts" folder at the root,
- copy your FontName into code below and remove
- comment brackets */
-/* @font-face {
- font-family: 'FontName';
- src: url('../fonts/FontName.eot');
- src: url('../fonts/FontName.eot?iefix') format('eot'),
- url('../fonts/FontName.woff') format('woff'),
- url('../fonts/FontName.ttf') format('truetype'),
- url('../fonts/FontName.svg#webfontZam02nTh') format('svg');
- font-weight: normal;
- font-style: normal; }
-*/
View
135 server/public/stylesheets/base.css → server/public/stylesheets/style.css 100755 → 100644
@@ -9,6 +9,7 @@
* http://www.opensource.org/licenses/mit-license.php
* 8/17/2011
*/
+@import url(http://fonts.googleapis.com/css?family=VT323);
/* line 4, ../sass/partials/_reset.scss */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
@@ -65,7 +66,7 @@ body {
/* line 16, ../sass/partials/_base_type.scss */
h1, h2, h3, h4, h5, h6 {
color: #181818;
- font-family: "Georgia", "Times New Roman", Helvetica, Arial, sans-serif;
+ font-family: "VT323", sans-serif;
font-weight: normal;
}
/* line 21, ../sass/partials/_base_type.scss */
@@ -307,7 +308,7 @@ img {
-khtml-border-radius: 3px;
border-radius: 3px;
}
-/* line 7, ../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.7/frameworks/compass/stylesheets/compass/css3/_inline-block.scss */
+/* line 7, ../../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.11.7/frameworks/compass/stylesheets/compass/css3/_inline-block.scss */
.button, button, input[type="submit"], input[type="reset"], input[type="button"] {
*display: inline;
}
@@ -1107,49 +1108,87 @@ label span, legend span {
height: 0;
}
-/*
-* Skeleton V1.1
-* Copyright 2011, Dave Gamache
-* www.getskeleton.com
-* Free to use under the MIT license.
-* http://www.opensource.org/licenses/mit-license.php
-* 8/17/2011
-*/
-/* Table of Content
-==================================================
- #Site Styles
- #Page Styles
- #Media Queries
- #Font-Face */
-/* #Site Styles
-================================================== */
-/* #Page Styles
-================================================== */
-/* line 23, ../sass/_layout.scss */
-.container {
- padding-top: 1.5em;
-}
-
-/* #Media Queries
-================================================== */
-/* Smaller than standard 960 (devices and browsers) */
-/* Tablet Portrait size to standard 960 (devices and browsers) */
-/* All Mobile Sizes (devices and browser) */
-/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */
-/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */
-/* #Font-Face
-================================================== */
-/* This is the proper syntax for an @font-face file
- Just create a "fonts" folder at the root,
- copy your FontName into code below and remove
- comment brackets */
-/* @font-face {
- font-family: 'FontName';
- src: url('../fonts/FontName.eot');
- src: url('../fonts/FontName.eot?iefix') format('eot'),
- url('../fonts/FontName.woff') format('woff'),
- url('../fonts/FontName.ttf') format('truetype'),
- url('../fonts/FontName.svg#webfontZam02nTh') format('svg');
- font-weight: normal;
- font-style: normal; }
-*/
+/* line 3, ../sass/partials/_custom.scss */
+body {
+ background: #333333 url("/images/dark_dotted.png");
+ padding-top: 60px;
+}
+
+/* line 8, ../sass/partials/_custom.scss */
+section {
+ background: #d9d9d9 url("/images/brushed_alu.png");
+ margin: 0 auto;
+ padding: 10px;
+ width: 45%;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ -o-border-radius: 3px;
+ -ms-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ border-radius: 3px;
+}
+/* line 16, ../sass/partials/_custom.scss */
+section header {
+ text-align: center;
+}
+
+/* line 21, ../sass/partials/_custom.scss */
+p {
+ margin: 1em 0;
+}
+
+/* line 25, ../sass/partials/_custom.scss */
+#feed {
+ background: #222;
+ border: 1px solid #111;
+ border-bottom: 0;
+ color: #fff;
+ height: 400px;
+ margin-top: 20px;
+ overflow-y: scroll;
+ padding: 1% 2%;
+ width: 96%;
+ -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(255, 255, 255, 0.75);
+ -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(255, 255, 255, 0.75);
+ -o-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(255, 255, 255, 0.75);
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 1px rgba(255, 255, 255, 0.75);
+ -moz-border-radius-topleft: 3px;
+ -webkit-border-top-left-radius: 3px;
+ -o-border-top-left-radius: 3px;
+ -ms-border-top-left-radius: 3px;
+ -khtml-border-top-left-radius: 3px;
+ border-top-left-radius: 3px;
+ -moz-border-radius-topright: 3px;
+ -webkit-border-top-right-radius: 3px;
+ -o-border-top-right-radius: 3px;
+ -ms-border-top-right-radius: 3px;
+ -khtml-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+}
+/* line 39, ../sass/partials/_custom.scss */
+#feed strong {
+ color: #f0f0f0;
+}
+
+/* line 45, ../sass/partials/_custom.scss */
+input[type="text"] {
+ background: #111;
+ border-color: transparent #111 #000;
+ color: #fff;
+ display: block;
+ margin: 0 auto;
+ position: relative;
+ width: 98.5%;
+ -moz-border-radius-topleft: 0;
+ -webkit-border-top-left-radius: 0;
+ -o-border-top-left-radius: 0;
+ -ms-border-top-left-radius: 0;
+ -khtml-border-top-left-radius: 0;
+ border-top-left-radius: 0;
+ -moz-border-radius-topright: 0;
+ -webkit-border-top-right-radius: 0;
+ -o-border-top-right-radius: 0;
+ -ms-border-top-right-radius: 0;
+ -khtml-border-top-right-radius: 0;
+ border-top-right-radius: 0;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.