Skip to content

Commit

Permalink
Committing codeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
rashadrussell committed Nov 9, 2012
1 parent dbb93d6 commit 2581c20
Show file tree
Hide file tree
Showing 390 changed files with 54,380 additions and 4 deletions.
2 changes: 1 addition & 1 deletion css/desktop.css
Expand Up @@ -139,7 +139,7 @@ html {
}

#text_editor textarea {
width: 600px;
width: 500px;
height: 600px;
border: solid 5px #d8dde1;
border-radius: 5px;
Expand Down
1 change: 1 addition & 0 deletions editor/Procfile
@@ -0,0 +1 @@
web: node app.js
44 changes: 44 additions & 0 deletions editor/app.js
@@ -0,0 +1,44 @@
var http = require('http');
var fs = require('fs');
var path = require('path');

var server = http.createServer(function (request, response) {

console.log('request starting...');

var filePath = '.' + request.url;
if (filePath == './') {
filePath = './index.html';
}

console.log(filePath);

var extname = path.extname(filePath);
var contentType = 'text/html';
switch (extname) {
case '.js':
contentType = 'text/javascript';
break;
case '.css':
contentType = 'text/css';
break;
}


fs.readFile(filePath, function(error, content) {
response.writeHead(200, { 'Content-Type': contentType });
response.end(content, 'utf-8');

});

}).listen(3000, "127.0.0.1");

console.log('Server running at http://127.0.0.1:3000/');

var io = require('socket.io').listen(server);

io.sockets.on('connection', function (socket) {
socket.on('code', function (data) {
socket.broadcast.emit('push code', data);
});
});
165 changes: 165 additions & 0 deletions editor/css/common.css
@@ -0,0 +1,165 @@
/* Generic */

html {
font-family: sans-serif;
}

html, body {
margin: 0;
padding: 0;
}

body {
background: #cadced url("../img/bg.png") no-repeat center center fixed;
}

h1, h2, h3, h4, h5, h6 {
color: #003366
}

a {
color: #305171;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

/* Table */
table
{
width: 100%;
border-spacing: 0;
border-collapse: collapse;
border: 1px solid #CCCCCC;
}

table caption
{
background: #FFFFFF;
border: 1px solid #CCCCCC;
text-align: left;
padding: 0.5em 1em;
margin-bottom: 0.75em;
border-radius: 5px;
background: #FAFAFA;
}

table caption h1, table caption h2, table caption h3, table caption h4, table caption h5, table caption h6
{
margin: 0;
}

table th, table td
{
padding: 0.25em 0.5em;
}

table thead th
{
background: #FAFAFA url("../img/table_thead_bg.png") repeat-x;
padding: 0.1em 1em;
font-size: 80%;
text-transform: uppercase;
text-align: left;
color: #003366
}

table tbody tr
{
border-top: 1px solid #DDDDDD;
}

table tbody tr th
{
background: #FFFFFF;
text-align: left;
}

table tbody tr td
{
background: #FFFFFF;
}

table th img
{
width: 16px;
height: 16px;
}

/* Header */

#header {
background: url("../img/header-bg.png") repeat-x;
}

#header-title a {
text-indent: -10000px;
background: url("../img/logo.png") no-repeat;
}

#header a {
color: white;
}

/* Menu Nav */
nav.menu
{
padding: 0.5em 0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 1px solid #CCCCCC;
background: #FAFAFA;
}

nav.menu img
{
vertical-align: middle;
}

nav.menu p
{
margin: 0 1em 0.5em;
}

nav.menu ul
{
margin: 0;
padding: 0;
}

nav.menu ul li
{
padding: 0 0 0 10px;
list-style: none;
}

nav.menu ul li a
{
display: block;
padding: 0.3em 0.3em 0.3em 10px;
margin-left: -10px;
background: #F4F4F4 url("../img/menu_item_bg.png") repeat-x;
border-top: 1px solid #ECECEC;
}

nav.menu ul li a:hover
{
border-top-color: #DDDDDD;
border-bottom-color: #DDDDDD;
border-left: 3px solid red;
padding-left: 7px;
background: #F5F5F5 url("../img/menu_item_hover_bg.png");
}

nav.menu ul li:last-child a
{
border-bottom: 1px solid #ECECEC
}

/* Useful styles */
.clear {
clear: both;
}

0 comments on commit 2581c20

Please sign in to comment.