corrade-http-templates – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 13... | Line 13... | |||
13 | <link rel="stylesheet" href="css/style.css?v=1.0"> |
13 | <link rel="stylesheet" href="css/style.css?v=1.0"> |
|
Line 14... | Line 14... | |||
14 | |
14 | |
|
15 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> |
15 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> |
|
16 | <script type="text/javascript"> |
16 | <script type="text/javascript"> |
|
17 | $(document).ready(function () { |
17 | $(document).ready(function () { |
|
18 | setInterval(function () { |
- | ||
19 | $.get("chat.log?t=" + Math.random(), function(data) { |
- | ||
20 | $("#chat").html(data); |
- | ||
21 | }); |
- | ||
22 | $("#chat").animate({ |
- | ||
23 | scrollTop:$("#chat")[0].scrollHeight - $("#chat").height() |
- | ||
24 | },1000); |
- | ||
25 | }, 1000); |
- | ||
26 | $("#send").click(function(e){ |
18 | function sendGroupMessage() { |
|
27 | $("#controls").animate({ opacity: 'hide' }, 'slow'); |
19 | $("#controls").animate({ opacity: 'hide' }, 'slow'); |
|
28 | $.ajax({ |
20 | $.ajax({ |
|
29 | type: 'post', |
21 | type: 'post', |
|
30 | url: "sendGroupMessage.php", |
22 | url: "sendGroupMessage.php", |
|
Line 34... | Line 26... | |||
34 | } |
26 | } |
|
35 | }).done(function(data) { |
27 | }).done(function(data) { |
|
36 | $('#message').val(""); |
28 | $('#message').val(""); |
|
37 | $("#controls").animate({ opacity: 'show' }, 'slow'); |
29 | $("#controls").animate({ opacity: 'show' }, 'slow'); |
|
38 | }); |
30 | }); |
|
- | 31 | } |
||
- | 32 | setInterval(function () { |
||
- | 33 | $.get("chat.log?t=" + Math.random(), function(data) { |
||
- | 34 | $("#chat").html(data); |
||
- | 35 | }); |
||
- | 36 | $("#chat").animate({ |
||
- | 37 | scrollTop:$("#chat")[0].scrollHeight - $("#chat").height() |
||
- | 38 | },1000); |
||
- | 39 | }, 1000); |
||
- | 40 | $("#send").click(function(e){ |
||
- | 41 | sendGroupMessage(); |
||
- | 42 | }); |
||
- | 43 | // Subscribe to pressing enter with the message input box selected. |
||
- | 44 | $("#message").keypress(function(e) { |
||
- | 45 | if (e.which == 13) { |
||
- | 46 | sendGroupMessage(); |
||
- | 47 | return false; |
||
- | 48 | } |
||
39 | }); |
49 | }); |
|
40 | }); |
50 | }); |
|
41 | </script> |
51 | </script> |
|
42 | </head> |
52 | </head> |