Commit e8a6c3c3 authored by Kannan V M's avatar Kannan V M
Browse files

add clear ideas

parent d3a6cb1b
......@@ -58,7 +58,7 @@ user.on('connection', (socket) => {
fs.writeFileSync(filepath, JSON.stringify(leavesdata), function(err) {
if(err) return console.error(err);
})
});
});
});
......@@ -73,4 +73,12 @@ mod.on('connection', (socket) => {
}
io.of('mod').emit('leaves data', leavesdata);
});
socket.on('save exit', filename => {
console.log("nsdiisd");
leavesdata = {};
leafno = 0;
socketids = [];
io.emit('leaves data', leavesdata);
io.of('mod').emit('leaves data', leavesdata);
});
});
......@@ -7,6 +7,11 @@
<body>
<ul id="listid">
</ul>
<br/>
<br/>
<br/>
<br/>
<button onclick="savenExit()">Save and Reset</button>
<script src="socket.io.js"></script>
<script>
......@@ -25,6 +30,12 @@
mod.emit('message delete', socketid);
};
function savenExit(){
var d = new Date();
var filename = d.getTime();
mod.emit('save exit', filename);
}
</script>
</body>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment