Permalink
Browse files

fix bugs

  • Loading branch information...
1 parent a195751 commit a36d1509e20929bf94223fda0af201aa48bfef2c @hpf1908 committed Nov 13, 2011
View
@@ -19,7 +19,7 @@ module.exports = [{
excute : function(req, res , next ) {
var id = req.param('id');
userService.destroy(id);
- res.sendJson(Success_Flag, 'ok', { rss: mem.rss,vsize:mem.vsize,heapTotal:mem.heapTotal,heapUsed:mem.heapUsed });
+ res.sendJson(Success_Flag, 'ok', { rss: mem.rss,heapTotal:mem.heapTotal,heapUsed:mem.heapUsed });
}
},{
url : ['/users/sendMsg'],
@@ -35,7 +35,7 @@ module.exports = [{
}
session.poke();
userService.sendMsg(session.nick, text);
- res.sendJson(Success_Flag, 'ok', { rss: mem.rss,vsize:mem.vsize,heapTotal:mem.heapTotal,heapUsed:mem.heapUsed });
+ res.sendJson(Success_Flag, 'ok', { rss: mem.rss,heapTotal:mem.heapTotal,heapUsed:mem.heapUsed });
}
},{
url : ['/users/sendOper'],
@@ -53,7 +53,7 @@ module.exports = [{
}
session.poke();
userService.sendOper(session.nick, pos, options ,subtype);
- res.sendJson(Success_Flag, 'ok', { rss: mem.rss,vsize:mem.vsize,heapTotal:mem.heapTotal,heapUsed:mem.heapUsed });
+ res.sendJson(Success_Flag, 'ok', { rss: mem.rss,heapTotal:mem.heapTotal,heapUsed:mem.heapUsed });
}
},{
url : ['/users/subscribse'],
@@ -98,7 +98,6 @@ module.exports = [{
id: session.id,
nick: session.nick,
rss: mem.rss,
- vsize:mem.vsize,
heapTotal:mem.heapTotal,
heapUsed:mem.heapUsed,
starttime: starttime,
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -188,7 +188,7 @@ $(function(){
vsize = data.vsize,
heapTotal=data.heapTotal,
heapUsed=data.heapUsed;
- //paint.setTitle('画板'+' '+'内存使用情况:vsize:'+vsize+' heapTotal:'+heapTotal+' heapUsed:'+heapUsed);
+ paint.setTitle('画板'+' '+' rss:'+ rss+ ' heapTotal:'+heapTotal+' heapUsed:'+heapUsed);
log('rss:'+rss);
}
@@ -288,14 +288,18 @@ $(function(){
}
});
- client.M.css({ left: paint.M[0].offsetLeft+paint.M[0].offsetWidth-client.M[0].offsetWidth -20, top:paint.M[0].offsetTop +50 });
+ client.M.css({ left: paint.M[0].offsetLeft+paint.M[0].offsetWidth-client.M[0].offsetWidth + 310, top:paint.M[0].offsetTop});
-//if we can, notify the server that we're going away.
- $(window).unload(function () {
- jQuery.get("/users/exit", {id: CONFIG.id}, function (data) { }, "json");
- });
+ var _exit = function(){
+ jQuery.get("/users/exit", {id: CONFIG.id}, function (data) { }, "json");
+ };
+//if we can, notify the server that we're going away.
+window.onbeforeunload = _exit;
+
+window.onunload = _exit;
+
Painter.updateImageHandler=function(pos,options){
jQuery.post("/users/sendOper", {id: CONFIG.id, subtype:'mousemove' ,pos: pos, options:options}, function (data) { }, "json");
}
View
@@ -47,6 +47,11 @@ $(function(){
self.login(val);
});
+ $loginInputEl.keypress(function(e){
+ if(e.keyCode==13)
+ $loginBtn.trigger('click');
+ });
+
this.showError=function(msg){
$loginEL.find('div.error').html('<em>'+msg+'</em>').show();
}
View
@@ -61,12 +61,12 @@ $(function(){
<img src="images/brush.png" onclick="Painter.tool.brush.load();" style="width:40px;height:40px;"/>\
<img src="images/eraser.png" onclick="Painter.tool.eraser.load();" style="width:40px;height:40px;"/>\
<img src="images/picker.png" onclick="Painter.tool.picker.load();Painter.canvas.temp[0].style.cursor=\'url(images/picker.png),pointer\';" style="width:40px;height:40px;"/>\
- <span onclick="Painter.tool.beeline.load();canvas.temp[0].style.cursor=\'crosshair\';" >直线</span>\
<img src="images/shape_ellipses.png" onclick="Painter.tool.rotundity.load();Painter.canvas.temp[0].style.cursor=\'crosshair\';" style="width:40px;height:40px;"/>\
- <img src="images/shape_polygon.png" onclick="Painter.tool.rectangle.load();Painter.canvas.temp[0].style.cursor=\'crosshair\';" style="width:40px;height:40px;"/></div>\
+ <img src="images/shape_polygon.png" onclick="Painter.tool.rectangle.load();Painter.canvas.temp[0].style.cursor=\'crosshair\';" style="width:40px;height:40px;"/>\
+ <img src="images/draw_line.png" onclick="Painter.tool.beeline.load();Painter.canvas.temp[0].style.cursor=\'crosshair\';" style="width:32px;height:32px;" /></div>\
<div id="'+Config.color+'" style="margin-top:10px;margin-left:5px;width: 34px; height: 23px; border: 1px solid #fff; float: left;"></div>\
<div onclick="Painter.clearPaint();" style="margin-left:10px;cursor:pointer;font-weight:bold;line-height:40px;font-size:20px;float:left;">重画</div>\
- <div onclick="location.href=Painter.canvas.main[0].toDataURL();" style="margin-left:10px;cursor:pointer;font-weight:bold;line-height:40px;font-size:20px;float:left;">保存</div>']
+ <div onclick="window.open(Painter.canvas.main[0].toDataURL())" style="margin-left:10px;cursor:pointer;font-weight:bold;line-height:40px;font-size:20px;float:left;">保存</div>']
});
tools.M.css({ left: Math.max(0, paint.M[0].offsetLeft - tools.M[0].offsetWidth - 10) + "px", top: paint.M[0].offsetTop + "px" });
@@ -105,6 +105,7 @@ $(function(){
ctx_palette.stroke();
$c_palette.mousedown(function (e) {
+
var x = (e.layerX - 10 || e.offsetX) - 1, y = (e.layerY || e.offsetY) - 1;
if (x < 0) x = 0;
else if (x >= w) x = w - 1;
@@ -114,14 +115,17 @@ $(function(){
var data = ctx_palette.getImageData(x, y, 1, 1);
var r = data.data;
r[3] = r[3] / 255;
- var rgba = "rgba(" + (Sys.firefox ? r.toString() : r[0] + "," + r[1] + "," + r[2] + "," + r[3]) + ")";
+
+ var rgba = "rgba(" + r[0] + "," + r[1] + "," + r[2] + "," + r[3] + ")";
tool.fillStyle = rgba;
+
+ console.log(rgba);
canvas.temp.ctx.fillStyle = rgba;
canvas.temp.ctx.strokeStyle = rgba;
fillBrush();
$("#"+Config.color).css("backgroundColor", rgba);
- });
+ });
}
});
View
@@ -3,7 +3,7 @@ var sys = require("util"),
qs = require("querystring");
var MESSAGE_BACKLOG = 200,
- SESSION_TIMEOUT = 60 * 1000,
+ SESSION_TIMEOUT = 15 * 1000,
MESSAGE_NUM = 0,
HISTORY_NUM = 20;
@@ -94,7 +94,7 @@ setInterval(function () {
session.destroy();
}
}
-}, 1000);
+}, 5000);
module.exports = {

0 comments on commit a36d150

Please sign in to comment.