From a5541502fbb496fbbd83ccd2e8c14b7558a9ebb0 Mon Sep 17 00:00:00 2001
From: timb Talk with pictures.
-
-
+
-
+
+
-
+
+
+
').appendTo('body')
+
+ $(id).addClass("no-cursor")
+
+ // i have to do this weirdly bc putting the cursor image where the mouse cursor is causes problems with mouse events:
+ // * it stops mousemove events on the image below the mouse cursor
+ // * it fucks up mouseover/out and even mouseenter/leave events, as well as click
+
+ // so i am doing this:
+ // on mousing over the image:
+ // make cursor visible
+ // find image co-ords
+ // bind a global mousemove func
+ // bind cursor click event
+ // mousemove func:
+ // move image to mouse co-ords
+ // if mouse co-ords are outside the image co-ords:
+ // make cursor invisible
+ // unbind mousemove func
+ // unbind cursor click event
+
+ var mousemove = function(e){
+ $(cursor).css({
+ "top": e.pageY + "px",
+ "left": e.pageX - 32 + "px" // 32: (4 pixels * 8 pixels per big pixel) to line up pointy finger with cursor
+ })
+ $(id).unbind('mouseover', imageMouseOver)
+ if (e.pageY < initBigHand.coords.top ||
+ e.pageY > initBigHand.coords.bottom ||
+ e.pageX < initBigHand.coords.left ||
+ e.pageX > initBigHand.coords.right) {
+ $(cursor).addClass('invisible')
+ $(cursor).unbind('click', cursorClick)
+ $('body').unbind('mousemove', mousemove)
+ $(id).mouseover(imageMouseOver)
+ }
+ }
+
+ var cursorClick = function(){ $(id).click() }
+
+ var imageMouseOver = function(){
+ initBigHand.coords = {
+ "left": $(id).offset().left,
+ "top": $(id).offset().top,
+ "right": $(id).offset().left + $(id).width(),
+ "bottom": $(id).offset().top + $(id).height()
+ }
+ $('body').mousemove(mousemove)
+ $(cursor).click(cursorClick)
+ $(cursor).removeClass('invisible')
+ }
+
+ $(id).mouseover(imageMouseOver)
+
}
function login() {
- $('#passwordInput, #loginSubmit').blur();
+ //$('#passwordInput, #loginSubmit').blur();
var nick = $('#nickInput').val();
var password = $('#passwordInput').val();
var hash = hex_sha1(nick + '$' + password + '$dumpfm');
@@ -50,7 +156,7 @@ function login() {
$.ajax({
type: 'GET',
timeout: 5000,
- url: 'login',
+ url: '/login',
data: {'nick': nick, ts: '', 'hash': hash },
cache: false,
dataType: 'json',
diff --git a/static/js/pichat.js b/static/js/pichat.js
index 20d3928..1c378e2 100755
--- a/static/js/pichat.js
+++ b/static/js/pichat.js
@@ -153,7 +153,7 @@ function updateUI(msgs, users) {
}
if (users !== null) {
var flattened = users.sort().join(",")
- if (!('userlist' in cache) || flattened != cache.userlist) {
+ if (!('userlist' in cache) || flattened != cache.userlist) {
$("#userList").html($.map(users, buildUserDiv).join(''));
}
cache.userlist = flattened
diff --git a/static/pichat.css b/static/pichat.css
index 0e5fb5f..cd4dd77 100755
--- a/static/pichat.css
+++ b/static/pichat.css
@@ -287,13 +287,8 @@ background-color:#f3f3f3;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
bottom
- #chatrap{
- top: 105px;
- left:0px;
- position:absolute;
- width: 100%;
- padding-bottom:20px;
}
+/*
#chatrap{
top: 105px;
left:0px;
@@ -494,3 +489,5 @@ td {
color: #000000;
}
.btnav { border: 0px #000000 solid;}
+*/
+.invisible { display: none !important; }
diff --git a/template/form_login.st b/template/form_login.st
index aee9283..a028769 100644
--- a/template/form_login.st
+++ b/template/form_login.st
@@ -3,42 +3,25 @@
- + +
-
+
+
+