diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/challengelist.php | 16 | ||||
-rw-r--r-- | pages/chat.php | 110 |
2 files changed, 113 insertions, 13 deletions
diff --git a/pages/challengelist.php b/pages/challengelist.php index a3b5ca7..8b60bd7 100644 --- a/pages/challengelist.php +++ b/pages/challengelist.php @@ -287,19 +287,21 @@ function showChallengeTiers() { </style> <div id="challengelist_wrapper" class="wrapper" style='overflow: auto;'> -<h3>Challenges - I'z working on this stuff.</h3> +<h3>Challenges</h3> <div id='backBtn' style='float:left;'><a href='javascript:back();' class='next'>Back</a></div> <div id='dialogBox'>Greetings tester of test-needed things.</div> + + <div id='mainDisplay' style='width:99%;overflow: hidden;'> - <div onclick='navShowLevels(0);' style='float:left; margin:20px; border:20px solid white;padding:40px'> - <h2>Easy</h2> + <div title='Start Here' onclick='navShowLevels(0);' style='float:left; margin:20px; border:20px solid white;padding:40px'> + <h2>Challenges</h2> </div> - <div onclick='navShowLevels(1);' style='float:left; margin:20px; border:20px solid white;padding:40px'> - <h2>Normal</h2> + <div style='float:left; margin:20px; border:20px solid white;padding:40px'> + <a href='home'><h2>Daily Maps</h2></a> </div> - <div style='float:left; margin:10px; border:10px solid gray;padding:20px'> - Hard + <div style='float:left; margin:20px; border:20px solid gray;padding:40px'> + <h2>Coming Soon</h2> </div> </div> diff --git a/pages/chat.php b/pages/chat.php index f55476f..a1870a6 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -20,10 +20,13 @@ if (!$accepted) { <script>
var lastID = 1;
-const chatTimerDelayUpper = 9000;
-const chatTimerDelayLower = 2000;
-const chatTimerDelayDefault = 5000;
-const chatTimerDelayWindowHidden = 90000;
+//Internet Explorer doesn't support "const"
+//CONSTANTS: ...
+var chatTimerDelayUpper = 9000;
+var chatTimerDelayLower = 2000;
+var chatTimerDelayDefault = 5000;
+var chatTimerDelayWindowHidden = 90000;
+
var chatTimerDelay = chatTimerDelayDefault;
var isChatWindowVisible = true;
var skipNextGetChat = false;
@@ -74,6 +77,11 @@ function getChatDone(data) { chat.displayName = 'SERVER'
}
+ if (chat.isJoinLeave == 'true') {
+ console.log('IsJoin Leave!')
+ //return true;
+ }
+
//Message is legitmently new or a server message?
if (chat.ID > lastID || typeof(chat.ID) == 'undefined') {
addChatMessage(chat.displayName, chat.message, postDate, isSelf, isServer, chat.wallColor, chat.wallEmblem,
@@ -248,6 +256,73 @@ function getChat(message) { });
}
+function pollChannelList() {
+ $.ajax({
+ //type: "POST",
+ url: "ajax/chat.ajax.php?pollChannelList=1",
+ error: function() {
+ console.log('Error: Failed pollChannelList');
+ },
+ success: function(data) {
+ console.log("ChannelPoll data recieved", data);
+ pollChannelListDone(data);
+ }
+ });
+}
+
+function pollChannelListDone(data) {
+
+ console.log('data recieved:', data);
+ if (data.length < 3 || data == 'false') return;
+ json = jQuery.parseJSON(data);
+
+ console.log('Loading channel.');
+ var c = channelListShow(json)
+ console.log(c);
+
+ var b = $("#channelContainer");
+ b.html(c);
+}
+
+
+function channelListShow(JO) {
+ console.log("Formating channelList");
+
+ var p = "<table class='membersList score' style='max-height:400px; width:220px; background-color:transparent; '>";
+
+ console.log('beginloop');
+
+ var previousI = 0;
+ for (var i in JO.users) {
+ console.log('loop')
+ var u = JO.users[i];
+ var styleClass = '';
+
+ if (previousI != i + 1) {
+ if (previousI < i - 1 && previousI != 0) {
+ styleClass = 'border-top: 6px solid #777799;';
+ }
+ }
+
+ if (u.wallEmblem == undefined) u.wallEmblem = 'blank.png';
+ p = p+ "<tr style='"+styleClass+" background-color: "+u.background+"; color:"+u.displayColor+";' title='Last Active: "+u.dateLastActive+"'>";
+
+ p = p+ "<td style='vertical-align: middle;width:100px;'>";
+ p = p+ " <div class='grid_td' style='float:left; width:35px; height:35px; background:"+u.wallColor+" url("+linkEmblem(u.wallEmblem, u.wallOrientation)+");'>";
+ p = p+ " <div style='background-color:transparent;' class='grid_td_inner grid_td_rocks'>";
+ p = p+ " </div>";
+ p = p+ " </div>";
+ p = p+ " <span class='scoreName' style='float:left;'><a target='_blank' href='achievements?id="+u.ID+"' style='color:"+u.displayColor+"'>"+u.display+"</a></span>";
+ p = p+ "</td>";
+
+ previousI = i;
+ }
+ p = p+"</table>";
+ return p;
+}
+
+
+
function sendChat() {
var message = $("input#message").val().replace("|:|", "||");
if (message == '') return false;
@@ -363,14 +438,35 @@ function setChatMute() { savePref('chatMute', value);
}
+pollChannelList();
+
</script>
<div class='wrapper'>
<h3>Pathery Chat - BETA</h3>
+<style>
+
+ #channelContainer, #chatContainer {
+ overflow:hidden;
+ overflow-y:auto;
+ display:inline-block;
+ float:right;
+ height:400px;
+
+ }
+
+
+</style>
+
<div class='chatContainer2'>
- <div id='chatContainer'>
- </div>
+
+ <div id='channelContainer' style='float:right; width:220px; overflow-y:scroll; display:inline-block;'>Loading...</div>
+
+ <div id='chatContainer' style='float:right; width:590px; '></div>
+
+ <div id='bb' style="clear:both"></div>
+
<form id='sendChat' onsubmit="return false">
<? if($accepted) { /*Only show the chat button if we're logged in*/ ?>
<input type="hidden" name="stuff" value="1724">
@@ -386,6 +482,8 @@ function setChatMute() { </form>
</div>
+
+
</div>
<?
|