forked from lbsadmin/nodeMessageBoard
Delete Emojize Requirement and handlers
This commit is contained in:
parent
9cb20bc7fa
commit
d23fe31aea
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
2
app.js
2
app.js
@ -7,8 +7,6 @@ var debug = false; // todo move this to configfile
|
|||||||
var handle = {}
|
var handle = {}
|
||||||
handle["/"] = requestHandlers.sendInterface;
|
handle["/"] = requestHandlers.sendInterface;
|
||||||
handle["/interface"] = requestHandlers.sendInterface;
|
handle["/interface"] = requestHandlers.sendInterface;
|
||||||
// handle["/sprite/emoji.css"] = requestHandlers.sendEmojiCss;
|
|
||||||
// handle["/sprite/emoji.png"] = requestHandlers.sendEmojiPng;
|
|
||||||
handle["/js/jquery-1.12.1.min"] = requestHandlers.sendJquery;
|
handle["/js/jquery-1.12.1.min"] = requestHandlers.sendJquery;
|
||||||
handle["/js/jquery-ui.js"] = requestHandlers.sendJqueryUI;
|
handle["/js/jquery-ui.js"] = requestHandlers.sendJqueryUI;
|
||||||
handle["/css/bootstrap.min.css"] = requestHandlers.sendBootstrap;
|
handle["/css/bootstrap.min.css"] = requestHandlers.sendBootstrap;
|
||||||
|
0
board.html
Normal file → Executable file
0
board.html
Normal file → Executable file
1
clear.html
Normal file → Executable file
1
clear.html
Normal file → Executable file
@ -3,7 +3,6 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Clear Board</title>
|
<title>Clear Board</title>
|
||||||
<link rel='stylesheet' href='sprite/emoji.css' >
|
|
||||||
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
||||||
<script src="/js/jquery-1.12.1.min"></script>
|
<script src="/js/jquery-1.12.1.min"></script>
|
||||||
<script src="/js/jquery-ui.js"></script>
|
<script src="/js/jquery-ui.js"></script>
|
||||||
|
@ -12,20 +12,6 @@ function sendInterface(response) {
|
|||||||
response.end(html);
|
response.end(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
// function sendEmojiCss(response) {
|
|
||||||
// console.log("Request handler 'Emojicss' was called.");
|
|
||||||
// response.writeHead(200, {"Content-Type": "text/css"});
|
|
||||||
// var html = fs.readFileSync(__dirname + "/served/emoji.css")
|
|
||||||
// response.end(html);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// function sendEmojiPng(response) {
|
|
||||||
// console.log("Request handler 'Emojipng' was called.");
|
|
||||||
// response.writeHead(200, {"Content-Type": "image/png"});
|
|
||||||
// var html = fs.readFileSync(__dirname + "/served/emoji.png")
|
|
||||||
// response.end(html);
|
|
||||||
// }
|
|
||||||
|
|
||||||
function sendBootstrap(response) {
|
function sendBootstrap(response) {
|
||||||
console.log("Request handler 'css' was called.");
|
console.log("Request handler 'css' was called.");
|
||||||
response.writeHead(200, {"Content-Type": "text/css"});
|
response.writeHead(200, {"Content-Type": "text/css"});
|
||||||
|
0
served/bootstrap.min.css
vendored
Normal file → Executable file
0
served/bootstrap.min.css
vendored
Normal file → Executable file
0
served/jquery-1.12.1.min.js
vendored
Normal file → Executable file
0
served/jquery-1.12.1.min.js
vendored
Normal file → Executable file
0
served/jquery-ui.js
vendored
Normal file → Executable file
0
served/jquery-ui.js
vendored
Normal file → Executable file
@ -7,7 +7,6 @@ low = require('lowdb'),
|
|||||||
storage = require('lowdb/file-async'),
|
storage = require('lowdb/file-async'),
|
||||||
db = low('db.json', { storage });
|
db = low('db.json', { storage });
|
||||||
|
|
||||||
// var convert = require('emojize').emojize;
|
|
||||||
var config = low('config.json', { storage });
|
var config = low('config.json', { storage });
|
||||||
var socketServer;
|
var socketServer;
|
||||||
var port = config('mainConfig').chain().find({ param: 'port' }).value()['value'];
|
var port = config('mainConfig').chain().find({ param: 'port' }).value()['value'];
|
||||||
@ -115,7 +114,7 @@ function initSocketIO(httpServer,debug)
|
|||||||
var colors = db('messages').chain().takeRight(number).map('color').value();
|
var colors = db('messages').chain().takeRight(number).map('color').value();
|
||||||
|
|
||||||
for(var i = 0; i < messages.length; i++){
|
for(var i = 0; i < messages.length; i++){
|
||||||
socket.emit('newMessage',times[i],numbers[i],/*convert(*/messages[i]/*)*/,colors[i]);
|
socket.emit('newMessage',times[i],numbers[i],messages[i],colors[i]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -132,7 +131,7 @@ function initSocketIO(httpServer,debug)
|
|||||||
var messageRecieved = escapeHtml(message);
|
var messageRecieved = escapeHtml(message);
|
||||||
db('messages').push({ numberString: numberStringRecieved,number: numberRecieved, time: timeRecieved, message: messageRecieved,color: color });
|
db('messages').push({ numberString: numberStringRecieved,number: numberRecieved, time: timeRecieved, message: messageRecieved,color: color });
|
||||||
//add a new message to the board directly
|
//add a new message to the board directly
|
||||||
socketServer.emit('newMessage', timeRecieved, numberRecieved, /*convert(*/messageRecieved/*)*/,color);
|
socketServer.emit('newMessage', timeRecieved, numberRecieved, messageRecieved,color);
|
||||||
numberStringRecieved = null;
|
numberStringRecieved = null;
|
||||||
numberRecieved = null;
|
numberRecieved = null;
|
||||||
timeRecieved = null;
|
timeRecieved = null;
|
||||||
@ -187,7 +186,7 @@ function serialListener(debug)
|
|||||||
var messageRecieved = escapeHtml(ucs2Parse(data));
|
var messageRecieved = escapeHtml(ucs2Parse(data));
|
||||||
db('messages').push({ numberString: numberStringRecieved,number: numberRecieved, time: timeRecieved, message: messageRecieved,color: color });
|
db('messages').push({ numberString: numberStringRecieved,number: numberRecieved, time: timeRecieved, message: messageRecieved,color: color });
|
||||||
//add a new message to the board directly
|
//add a new message to the board directly
|
||||||
socketServer.emit('newMessage', timeRecieved, numberRecieved, /*convert(*/messageRecieved/*)*/,color);
|
socketServer.emit('newMessage', timeRecieved, numberRecieved, messageRecieved,color);
|
||||||
numberStringRecieved = null;
|
numberStringRecieved = null;
|
||||||
numberRecieved = null;
|
numberRecieved = null;
|
||||||
timeRecieved = null;
|
timeRecieved = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user