diff options
Diffstat (limited to 'pages/chat.php')
-rw-r--r-- | pages/chat.php | 110 |
1 files changed, 11 insertions, 99 deletions
diff --git a/pages/chat.php b/pages/chat.php index ff61294..a29cf36 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -1,6 +1,6 @@ <?php
htmlHeader(
- array('stats'), 'Chat',
+ array('stats', 'chat'), 'Chat',
'BetaChat for Pathery.com',
array('scores', 'dateformat')
);
@@ -13,99 +13,9 @@ if (!$accepted) { echo "<center>Please <a href='javascript:showSignin();'>login</a> to chat!</center>";
}
-?>
-<style>
-.chatMessage {
- width:99%;
- min-height:32px;
- margin:4px;
- display:block;
- clear:both;
-}
-.chatColumn1 {
- float:left;
- min-height:31px;
- width:9%;
- margin:1px;
- padding:2px;
- height:100%;
- background-color:#222;
- text-overflow: ellipsis;
- white-space:nowrap;
- display:block;
- border-bottom-left-radius: 10px;
- border-top-left-radius: 10px;
-}
-.chatColumn2 {
- float:left;
- min-height:31px;
- width:4%;
- background-color:#222;
- margin:1px;
- padding-right:3px;
-}
-.chatColumn3 {
- float:left;
- min-height:31px;
- width:83%;
- background-color:#222;
- margin:1px;
- padding:2px;
- border-bottom-right-radius: 20px;
- border-top-right-radius: 20px;
-}
-.chatTimestamp {
- font-family:"Times New Roman", Times, serif;
- float:left;
- padding: 5px 3px 3px 3px;
- min-width:70px;
- overflow:hidden;
- text-overflow: ellipsis;
- white-space:nowrap;
-}
-.chatBadge {
- height:100%;
- float:left;
-}
-.chatUsername {
- font-family:Comic Sans MS, Comic Sans MS5, cursive;
- min-height:34px;
- text-overflow: ellipsis;
- padding: 5px 5px 5px 5px;
-}
-.chatText {
- font-family:Comic Sans MS, Comic Sans MS5, cursive;
- min-height:34px;
- padding: 5px 5px 5px 5px;
-}
-.chatInputMessage {
- font-family:Comic Sans MS, Comic Sans MS5, cursive;
- border: 1px solid gray;
- background-color:#999;
- width: 700px;
- margin: 4px;
-}
-.chatButton {
- margin: 4px;
-}
-#chatContainer {
- width:800px;
- margin:0 auto;
- height:400px;
- overflow:auto;
-}
-.chatContainer2 {
- width:810px;
- margin:0 auto;
- height:450px;
- overflow:auto;
-}
-
-
-
-</style>
+?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
@@ -161,16 +71,13 @@ function getChatDone(data) { p = '';
p = p+ " <div class='chatColumn1'>";
p = p+ " <span class='chatTimestamp'>["+timestamp+"]</span>";
- p = p+ "</div>";
-
- p = p+ " <div class='chatColumn2'>";
p = p+ " <div class='grid_td chatBadge' style='float:left; width:35px; height:35px; background:"+user.wallColor+" url(images/marks/"+user.wallEmblem+");'>";
p = p+ " <div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>";
p = p+ " </div>";
p = p+ " </div>";
p = p+ " </div>";
- p = p+ " <div class='chatColumn3'>";
+ p = p+ " <div class='chatColumn2'>";
p = p+ "<span class='chatUsername'><a href='achievements?id="+user.userID+"' style='color:"+user.displayColor+"'>";
p = p+ user.displayName+"</a>:</span>";
@@ -182,15 +89,20 @@ function getChatDone(data) { lastID = user.ID;
- items.unshift('<div class="chatMessage" id="' + key + '">' + p + '</div>');
+ var strClass = '';
+ console.log('cpm', user.userID, userObj.ID);
+ if (user.userID == userObj.ID) {
+ strClass += ' self';
+ }
+
+ items.unshift('<div class="chatMessage'+strClass+'" id="' + key + '">' + p + '</div>');
newChats = true;
});
//console.log("BUILD DONE");
if (newChats) {
- if (chatTimerDelay > chatTimerDelayLower)
- chatTimerDelay -= 1000;
+ if (chatTimerDelay > chatTimerDelayLower) chatTimerDelay -= 1000;
var new_chatDiv = $('<div/>', {
'class': 'my-new-list',
|