Skip to content
Browse files

updated style

  • Loading branch information...
1 parent 13f3a68 commit 48c9c107ac9acc66d815af7ff062f529836ed871 Erik Johansson committed Aug 14, 2012
Showing with 80 additions and 23 deletions.
  1. +58 −2 css/chatbox.css
  2. +22 −21 twentyfour-expert-chatbox.php
View
60 css/chatbox.css
@@ -6,20 +6,76 @@
Purpose of the stylesheet follows.
*/
+.messageInfo{
+ clear: both;
+}
#qname{
+ float: left;
width: 300px;
- margin-bottom: 10px;
+ margin: 10px;
+
}
#question{
float:left;
clear: left;
width: 400px;
padding-left: 4px;
+ margin: 10px;
+ margin-top: 0px;
}
.button{
float: left;
- margin-left: 10px;
+ margin: 5px;
+}
+
+#chatbox #chat div.message{
+ text-align: left;
+}
+
+#chatbox #chat div.message p{
+}
+
+#chatbox #chat div.message p.message{
+ clear: both;
+}
+
+#chatbox #chat div.message .time{
+ float: left;
+}
+
+#chatbox #chat div.message .time p{
+ float: left;
+}
+
+#chatbox #chat div.message .time .name{
+ float: left;
+}
+
+
+/*--------------*/
+
+#chatbox #chat div.expert{
+ text-align: right;
+}
+
+#chatbox #chat div.expert p{
+}
+
+#chatbox #chat div.expert p.message{
+ clear: both;
+}
+
+#chatbox #chat div.expert .time{
+ float: right;
+}
+
+#chatbox #chat div.expert .time p{
+ float: right;
+}
+
+#chatbox #chat div.expert .time .name{
+ float: right;
}
View
43 twentyfour-expert-chatbox.php
@@ -6,6 +6,7 @@
$expert_name = get_the_author_meta("first_name", $activechat->user);
$date = new DateTime($activechat->createDate);
+
//echo "is active: " . $expertchat->is_active_chat() . "<br/>";
//echo "archived chats: " . count($expertchat->get_archived_chats());
@@ -18,7 +19,7 @@
$chatid = $_GET["chatid"];
if( intval($chatid) > 0 )
$activechat = $expertchat->get_chat(intval($chatid));
-
+
$offlinetext = "OBS! Denna chat är avslutad!";
}
else
@@ -46,18 +47,17 @@
<div id="chatbox">
<div class="chatHead">
<h2>'.$headline.' expertchatt - '. $activechat->title .'</h2>
- <span>'.$offlinetext .'</span>
+ <span>'. $offlinetext .'</span>
+ <p>'.$byline.'</p>
</div>
<div id="chat">
<div class="message expert">
<div class="time">
- <p>'.$byline.'</p>
- <p>'. $date->format('H:i') .' Administrator '.get_the_author_meta("first_name", $activechat->user).' gör sig beredd på att starta dagens diskussion</p>
- <!---<p class="name"></p>---->
+ <p>'. $date->format('H:i') .'</p>
+ <p class="name">Administrator</p>
</div>
- <!---<p class="message">'.get_the_author_meta("first_name", $activechat->user).' gör sig beredd på att starta dagens diskussion</p>--->
- </div>
-
+ <p class="message">'.get_the_author_meta("first_name", $activechat->user).' gör sig beredd på att starta dagens diskussion</p>
+ </div>
';
$questions = $expertchat->get_answered_questions($activechat->id );
@@ -69,18 +69,18 @@
echo '
<div class="message">
<div class="time">
- <p>'. $time->format('H:i') .' - '.$name.'</p>
- <!---<p class="name">'.$name.'</p>---->
+ <p>'. $time->format('H:i') .'</p>
+ <p class="name">'.$name.'</p>
</div>
<p class="message">'.$q.'</p>
</div>
<div class="message expert">
<div class="time">
- <p>'. $time->format('H:i') .' - '.get_the_author_meta("first_name", $activechat->user).'</p>
- <!----<p class="name">'.get_the_author_meta("first_name", $activechat->user).'</p>---->
+ <p>'. $time->format('H:i') .'</p>
+ <p class="name">'.get_the_author_meta("first_name", $activechat->user).'</p>
</div>
<p class="message">'.$a.'</p>
- </div>
+ </div>
';
$latest = $question->createDate;
endforeach;
@@ -93,13 +93,14 @@
';
if ( $active ):
echo '
- <div class="expertChatForm">
- <p>
- <input type="text" id="qname" class="text" value="" placeholder="Ditt namn (eller nickname)" />
- <textarea class="comment" id="question" placeholder="Skriv till experten här:"></textarea>
- <input type="submit" class="button" value="Skicka" />
- </p>
+ <div class="form commentForm expertChatForm">
+ <input type="text" id="qname" class="text" value="" placeholder="Ditt namn (eller nickname)" />
+ <textarea class="comment" id="question" placeholder="Skriv till experten här:"></textarea>
+ <input type="submit" class="button" value="Skicka" />
+
+ <img src="'. $pluginRoot .'/img/load.gif" id="loadImg" style="display:none;" />
</div>
+ <p class="messageInfo">Din kommentar eller fråga kommer modereras och därefter publiceras tillsammans med svar.</p>
';
?>
<script type="text/javascript">
@@ -150,7 +151,7 @@ function getData() {
var time = (myDate.getHours() < 10 ? "0" + myDate.getHours() : myDate.getHours()) + ":" + (myDate.getMinutes() < 10 ? "0" + myDate.getMinutes() : myDate.getMinutes());
$(".messageInfo").hide();
$(".expertChatForm").hide();
- $("#chat").append('<div class="message expert"><div class="time"><p>' + time +' - ' + <?php echo get_the_author_meta("first_name", $activechat->user); ?> + '</p></div><p class="message">'+data.message+'</p></div>');
+ $("#chat").append('<div class="message expert"><div class="time"><p>' + time +'</p><p class="name"><?php echo get_the_author_meta("first_name", $activechat->user); ?> </p></div><p class="message">'+data.message+'</p></div>');
document.getElementById('chat').scrollTop = 9999999;
}
else
@@ -165,7 +166,7 @@ function getData() {
var q = data[i].question;
var a = data[i].answer;
var expert = $('.name').html();
- $("#chat").append('<div class="message"><div class="time"><p>'+time+' - ' + name + '</p></div><p class="message">'+q+'</p></div><div class="message expert"><div class="time"><p>' + time + ' - <?php echo get_the_author_meta("display_name", $activechat->user); ?> </p> </div><p class="message">'+a+'</p></div>');
+ $("#chat").append('<div class="message"><div class="time"><p>'+time+'</p><p class="name">'+name+'</p></div><p class="message">'+q+'</p></div><div class="message expert"><div class="time"><p>' + time +'</p><p class="name"><p class="name"><?php echo get_the_author_meta("display_name", $activechat->user); ?> </p></div><p class="message">'+a+'</p></div>');
document.getElementById('chat').scrollTop = 9999999;
}

0 comments on commit 48c9c10

Please sign in to comment.
Something went wrong with that request. Please try again.