Messages: Integrate primary attachment (image) from Contacts in message thread. Dynamically adjust thread height on window resize.
This commit is contained in:
parent
6acd640d2f
commit
e9780736ef
|
|
@ -96,7 +96,7 @@
|
|||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message direction.';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'message_date';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamp';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'timestamp';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'Enter the message date.';
|
||||
|
|
|
|||
|
|
@ -56,9 +56,31 @@
|
|||
}
|
||||
unset ($prep_statement, $sql, $row, $record);
|
||||
|
||||
//get self (primary contact attachment) image, if any
|
||||
if (!is_array($_SESSION['tmp']['messages']['contact_me'])) {
|
||||
$sql = "select attachment_filename as filename, attachment_content as image from v_contact_attachments ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and contact_uuid = :contact_uuid ";
|
||||
$sql .= "and attachment_primary = 1 ";
|
||||
$bind[':contact_uuid'] = $_SESSION['user']['contact_uuid'];
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute(is_array($bind) ? $bind : null);
|
||||
$_SESSION['tmp']['messages']['contact_me'] = $prep_statement->fetch(PDO::FETCH_NAMED);
|
||||
unset ($sql, $bind, $prep_statement);
|
||||
}
|
||||
|
||||
//additional includes
|
||||
require_once "resources/header.php";
|
||||
|
||||
//resize thread window on window resize
|
||||
echo "<script language='JavaScript' type='text/javascript'>\n";
|
||||
echo " $(document).ready(function() {\n";
|
||||
echo " $(window).on('resizeEnd', function() {\n";
|
||||
echo " $('div#thread_messages').animate({ 'max-height': $(window).height() - 480 }, 200);\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo "</script>\n";
|
||||
|
||||
//styles
|
||||
echo "<style>\n";
|
||||
|
||||
|
|
@ -189,7 +211,7 @@
|
|||
echo " </tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td id='contacts' valign='top'><center>···</center></td>\n";
|
||||
echo " <td id='thread' colspan='2' valign='top' style='border-left: 1px solid #c5d1e5; padding: 15px;'><center>···</center></td>\n";
|
||||
echo " <td id='thread' colspan='2' valign='top' style='border-left: 1px solid #c5d1e5; padding: 15px 0 15px 15px;'><center>···</center></td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<input type='hidden' id='contact_current_number' value=''>\n";
|
||||
|
|
@ -211,19 +233,21 @@
|
|||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function load_thread(number) {\n";
|
||||
echo " function load_thread(number, contact_uuid) {\n";
|
||||
echo " clearTimeout(timer_thread);\n";
|
||||
echo " $('#thread').load('messages_thread.php?number=' + encodeURIComponent(number), function(){\n";
|
||||
echo " $('#thread_messages').scrollTop(Number.MAX_SAFE_INTEGER);\n"; //chrome
|
||||
echo " $('span#thread_bottom')[0].scrollIntoView(true);\n"; //others
|
||||
//note: the order of the above two lines matters!
|
||||
echo " $('#thread').load('messages_thread.php?number=' + encodeURIComponent(number) + '&contact_uuid=' + encodeURIComponent(contact_uuid), function(){\n";
|
||||
echo " $('div#thread_messages').animate({ 'max-height': $(window).height() - 450 }, 200, function() {\n";
|
||||
echo " $('#thread_messages').scrollTop(Number.MAX_SAFE_INTEGER);\n"; //chrome
|
||||
echo " $('span#thread_bottom')[0].scrollIntoView(true);\n"; //others
|
||||
//note: the order of the above two lines matters!
|
||||
if (!http_user_agent('mobile')) {
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " $('#message_text').focus();\n";
|
||||
echo " }\n";
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " $('#message_text').focus();\n";
|
||||
echo " }\n";
|
||||
}
|
||||
echo " refresh_contacts();\n";
|
||||
echo " timer_thread = setTimeout(refresh_thread_start, thread_refresh, number);\n";
|
||||
echo " refresh_contacts();\n";
|
||||
echo " timer_thread = setTimeout(refresh_thread_start, thread_refresh, number, contact_uuid);\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
|
|
@ -235,19 +259,21 @@
|
|||
echo " refresh_contacts();\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_thread(number, onsent) {\n";
|
||||
echo " $('#thread_messages').load('messages_thread.php?refresh=true&number=' + encodeURIComponent(number), function(){\n";
|
||||
echo " $('#thread_messages').scrollTop(Number.MAX_SAFE_INTEGER);\n"; //chrome
|
||||
echo " $('span#thread_bottom')[0].scrollIntoView(true);\n"; //others
|
||||
//note: the order of the above two lines matters!
|
||||
echo " function refresh_thread(number, contact_uuid, onsent) {\n";
|
||||
echo " $('#thread_messages').load('messages_thread.php?refresh=true&number=' + encodeURIComponent(number) + '&contact_uuid=' + encodeURIComponent(contact_uuid), function(){\n";
|
||||
echo " $('div#thread_messages').animate({ 'max-height': $(window).height() - 450 }, 200, function() {\n";
|
||||
echo " $('#thread_messages').scrollTop(Number.MAX_SAFE_INTEGER);\n"; //chrome
|
||||
echo " $('span#thread_bottom')[0].scrollIntoView(true);\n"; //others
|
||||
//note: the order of the above two lines matters!
|
||||
if (!http_user_agent('mobile')) {
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " if ($('#message_new_layer').is(':hidden')) {\n";
|
||||
echo " $('#message_text').focus();\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
}
|
||||
echo " if (onsent != 'true') {\n";
|
||||
echo " timer_thread = setTimeout(refresh_thread, thread_refresh, number);\n";
|
||||
echo " }\n";
|
||||
echo " if (onsent != 'true') {\n";
|
||||
echo " timer_thread = setTimeout(refresh_thread, thread_refresh, number, contact_uuid);\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
echo " }\n";
|
||||
|
||||
|
|
@ -264,15 +290,15 @@
|
|||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_thread_stop(number) {\n";
|
||||
echo " function refresh_thread_stop(number, contact_uuid) {\n";
|
||||
echo " clearTimeout(timer_thread);\n";
|
||||
echo " document.getElementById('thread_refresh_state').innerHTML = \"<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; cursor: pointer;' onclick='refresh_thread_start(\" + number + \");' alt='".$text['label-refresh_enable']."' title='".$text['label-refresh_enable']."'>\";\n";
|
||||
?> document.getElementById('thread_refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_thread_start('" + number + "', '" + contact_uuid + "');\" alt=\"<?php echo $text['label-refresh_enable']; ?>\" title=\"<?php echo $text['label-refresh_enable']; ?>\">";<?php
|
||||
echo " }\n";
|
||||
|
||||
echo " function refresh_thread_start(number) {\n";
|
||||
echo " function refresh_thread_start(number, contact_uuid) {\n";
|
||||
echo " if (document.getElementById('thread_refresh_state')) {\n";
|
||||
echo " document.getElementById('thread_refresh_state').innerHTML = \"<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick='refresh_thread_stop(\" + number + \");' alt='".$text['label-refresh_pause']."' title='".$text['label-refresh_pause']."'>\";\n";
|
||||
echo " refresh_thread(number);\n";
|
||||
?> document.getElementById('thread_refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_thread_stop('" + number + "', '" + contact_uuid + "');\" alt=\"<?php echo $text['label-refresh_pause']; ?>\" title=\"<?php echo $text['label-refresh_pause']; ?>\">";<?php
|
||||
echo " refresh_thread(number, contact_uuid);\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@
|
|||
$selected = true;
|
||||
}
|
||||
else {
|
||||
echo "<tr><td valign='top' class='".$row_style[$c]."' onclick=\"load_thread('".urlencode($number)."');\">\n";
|
||||
echo "<tr><td valign='top' class='".$row_style[$c]."' onclick=\"load_thread('".urlencode($number)."', '".$contact[$number]['contact_uuid']."');\">\n";
|
||||
$selected = false;
|
||||
}
|
||||
if ($contact[$number]['contact_name_given'] != '' || $contact[$number]['contact_name_family'] != '') {
|
||||
|
|
|
|||
|
|
@ -41,10 +41,24 @@
|
|||
|
||||
//get number of messages to load
|
||||
$number = preg_replace('{[\D]}', '', $_GET['number']);
|
||||
$contact_uuid = $_GET['contact_uuid'];
|
||||
|
||||
//set refresh flag
|
||||
$refresh = $_GET['refresh'] == 'true' ? true : false;
|
||||
|
||||
//get contact (primary attachment) image, if any
|
||||
if (is_uuid($contact_uuid) && (!is_array($_SESSION['tmp']['messages']['contact_em'][$contact_uuid]) || $_SESSION['tmp']['messages']['contact_em'][$contact_uuid] != $contact_uuid)) {
|
||||
$sql = "select attachment_filename as filename, attachment_content as image from v_contact_attachments ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and contact_uuid = :contact_uuid ";
|
||||
$sql .= "and attachment_primary = 1 ";
|
||||
$bind[':contact_uuid'] = $contact_uuid;
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute(is_array($bind) ? $bind : null);
|
||||
$_SESSION['tmp']['messages']['contact_em'][$contact_uuid] = $prep_statement->fetch(PDO::FETCH_NAMED);
|
||||
unset ($sql, $bind, $prep_statement);
|
||||
}
|
||||
|
||||
//get messages
|
||||
if (isset($_SESSION['message']['display_last']['text']) && $_SESSION['message']['display_last']['text'] != '') {
|
||||
$array = explode(' ',$_SESSION['message']['display_last']['text']);
|
||||
|
|
@ -58,7 +72,18 @@
|
|||
}
|
||||
}
|
||||
if ($limit == '' && $since == '') { $limit = "limit 25 offset 0"; } //default (message count)
|
||||
$sql = "select * from v_messages ";
|
||||
$sql = "select ";
|
||||
$sql .= "message_uuid, ";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "user_uuid, ";
|
||||
$sql .= "contact_uuid, ";
|
||||
$sql .= "message_type, ";
|
||||
$sql .= "message_direction, ";
|
||||
$sql .= "message_date at time zone '".$_SESSION['domain']['time_zone']['name']."' as message_date, ";
|
||||
$sql .= "message_from, ";
|
||||
$sql .= "message_to, ";
|
||||
$sql .= "message_text ";
|
||||
$sql .= "from v_messages ";
|
||||
$sql .= "where user_uuid = '".$_SESSION['user_uuid']."' ";
|
||||
$sql .= "and (domain_uuid = '".$domain_uuid."' or domain_uuid is null) ";
|
||||
$sql .= $since;
|
||||
|
|
@ -101,55 +126,85 @@
|
|||
//css styles
|
||||
echo "<style>\n";
|
||||
echo " .message-bubble {\n";
|
||||
echo " display: block;\n";
|
||||
echo " display: table;\n";
|
||||
echo " padding: 10px;\n";
|
||||
echo " border: 1px solid;\n";
|
||||
echo " margin-bottom: 10px;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-bubble-em {\n";
|
||||
echo " margin-right: 10%;\n";
|
||||
echo " border-radius: 0px 20px 20px 20px;\n";
|
||||
echo " margin-right: 30%;\n";
|
||||
echo " border-radius: 0 20px 20px 20px;\n";
|
||||
echo " border-color: #cffec7;\n";
|
||||
echo " background-color: #ecffe9;\n";
|
||||
echo " }\n";
|
||||
echo " clear: both;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-bubble-me {\n";
|
||||
echo " margin-left: 10%;\n";
|
||||
echo " border-radius: 20px 20px 0px 20px;\n";
|
||||
echo " float: right;\n";
|
||||
echo " margin-left: 30%;\n";
|
||||
echo " border-radius: 20px 20px 0 20px;\n";
|
||||
echo " border-color: #cbf0ff;\n";
|
||||
echo " background-color: #e5f7ff;\n";
|
||||
echo " }\n";
|
||||
echo " clear: both;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " img.message-bubble-image-em {\n";
|
||||
echo " width: 100px;\n";
|
||||
echo " height: auto;\n";
|
||||
echo " border-radius: 0 11px 11px 11px;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " img.message-bubble-image-me {\n";
|
||||
echo " width: 100px;\n";
|
||||
echo " height: auto;\n";
|
||||
echo " border-radius: 11px 11px 0 11px;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " div.message-bubble-image-em {\n";
|
||||
echo " float: left;\n";
|
||||
echo " margin-right: 15px;\n";
|
||||
echo " text-align: left;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " div.message-bubble-image-me {\n";
|
||||
echo " float: right;\n";
|
||||
echo " margin-left: 15px;\n";
|
||||
echo " text-align: right;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-text {\n";
|
||||
echo " padding-bottom: 5px;\n";
|
||||
echo " font-size: 90%;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-bubble-when {\n";
|
||||
echo " font-size: 65%;\n";
|
||||
echo " line-height: 60%;\n";
|
||||
echo " }\n";
|
||||
echo " font-size: 71%;\n";
|
||||
echo " font-style: italic;\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-media-link-em {\n";
|
||||
echo " display: block;\n";
|
||||
echo " position: inline;\n";
|
||||
echo " margin: 5px 10px;\n";
|
||||
echo " display: inline-block;\n";
|
||||
echo " margin: 5px 10px 5px 0;\n";
|
||||
echo " padding: 8px;\n";
|
||||
echo " background: #cffec7;\n";
|
||||
echo " border-radius: 7px;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
echo " .message-media-link-me {\n";
|
||||
echo " display: block;\n";
|
||||
echo " position: inline;\n";
|
||||
echo " margin: 5px 10px;\n";
|
||||
echo " display: inline-block;\n";
|
||||
echo " margin: 5px 10px 5px 0;\n";
|
||||
echo " padding: 8px;\n";
|
||||
echo " background: #cbf0ff;\n";
|
||||
echo " border-radius: 7px;\n";
|
||||
echo " text-align: center;\n";
|
||||
echo " }\n";
|
||||
echo " }\n";
|
||||
|
||||
echo "</style>\n";
|
||||
|
||||
if (!$refresh) {
|
||||
echo "<div id='thread_messages' style='max-height: 300px; overflow: auto;'>\n";
|
||||
echo "<div id='thread_messages' style='min-height: 300px; overflow: auto; padding-right: 15px;'>\n";
|
||||
}
|
||||
|
||||
//output messages
|
||||
|
|
@ -165,28 +220,51 @@
|
|||
}
|
||||
|
||||
//message bubble
|
||||
echo "<span class='message-bubble message-bubble-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
if ($message['message_text'] != '') {
|
||||
echo str_replace("\n",'<br />',escape($message['message_text']))."<br />\n";
|
||||
}
|
||||
if (is_array($message_media[$message['message_uuid']]) && sizeof($message_media[$message['message_uuid']]) != 0) {
|
||||
echo "<span class='message-bubble message-bubble-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
//contact image
|
||||
if ($message['message_direction'] == 'inbound') { //em
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_em'][$contact_uuid]) && sizeof($_SESSION['tmp']['messages']['contact_em'][$contact_uuid]) != 0) {
|
||||
$attachment_type = strtolower(pathinfo($_SESSION['tmp']['messages']['contact_em'][$contact_uuid]['filename'], PATHINFO_EXTENSION));
|
||||
echo "<div class='message-bubble-image-em'>\n";
|
||||
echo " <img class='message-bubble-image-em' src='data:image/".$attachment_type.";base64,".$_SESSION['tmp']['messages']['contact_em'][$contact_uuid]['image']."'><br />\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
else { //me
|
||||
if (is_array($_SESSION['tmp']['messages']['contact_me']) && sizeof($_SESSION['tmp']['messages']['contact_me']) != 0) {
|
||||
$attachment_type = strtolower(pathinfo($_SESSION['tmp']['messages']['contact_me']['filename'], PATHINFO_EXTENSION));
|
||||
echo "<div class='message-bubble-image-me'>\n";
|
||||
echo " <img class='message-bubble-image-me' src='data:image/".$attachment_type.";base64,".$_SESSION['tmp']['messages']['contact_me']['image']."'><br />\n";
|
||||
echo "</div>\n";
|
||||
}
|
||||
}
|
||||
echo "<div style='display: table;'>\n";
|
||||
//message
|
||||
if ($message['message_text'] != '') {
|
||||
echo "<div class='message-text'>".str_replace("\n",'<br />',escape($message['message_text']))."</div>\n";
|
||||
}
|
||||
//attachments
|
||||
if (is_array($message_media[$message['message_uuid']]) && sizeof($message_media[$message['message_uuid']]) != 0) {
|
||||
|
||||
foreach ($message_media[$message['message_uuid']] as $media) {
|
||||
if ($media['type'] != 'txt') {
|
||||
if ($media['type'] == 'jpg' || $media['type'] == 'jpeg' || $media['type'] == 'gif' || $media['type'] == 'png') {
|
||||
echo "<a href='#' onclick=\"display_media('".$media['uuid']."','".$media_source."');\" class='message-media-link-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
foreach ($message_media[$message['message_uuid']] as $media) {
|
||||
if ($media['type'] != 'txt') {
|
||||
if ($media['type'] == 'jpg' || $media['type'] == 'jpeg' || $media['type'] == 'gif' || $media['type'] == 'png') {
|
||||
echo "<a href='#' onclick=\"display_media('".$media['uuid']."','".$media_source."');\" class='message-media-link-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
}
|
||||
else {
|
||||
echo "<a href='message_media.php?id=".$media['uuid']."&src=".$media_source."&action=download' class='message-media-link-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
}
|
||||
echo "<img src='resources/images/attachment.png' style='width: 16px; height: 16px; border: none; margin-right: 10px;'>";
|
||||
echo "<span style='font-size: 85%;'>".strtoupper($media['type']).' · '.strtoupper(byte_convert($media['size']))."</span>";
|
||||
echo "</a>\n";
|
||||
}
|
||||
}
|
||||
echo "<br />\n";
|
||||
}
|
||||
else {
|
||||
echo "<a href='message_media.php?id=".$media['uuid']."&src=".$media_source."&action=download' class='message-media-link-".($message['message_direction'] == 'inbound' ? 'em' : 'me')."'>";
|
||||
}
|
||||
echo "<img src='resources/images/attachment.png' style='width: 16px; height: 16px; border: none; margin-right: 10px;'>";
|
||||
echo "<span style='font-size: 85%;'>".strtoupper($media['type']).' · '.strtoupper(byte_convert($media['size']))."</span>";
|
||||
echo "</a>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo " <span class='message-bubble-when'>".format_when_local($message['message_date'])."</span>\n";
|
||||
echo "</span>\n";
|
||||
//message when
|
||||
echo "<span class='message-bubble-when'>".(gmdate('m-d-Y') != format_when_local($message['message_date'],'d') ? format_when_local($message['message_date']) : format_when_local($message['message_date'],'t'))."</span>\n";
|
||||
echo "</div>\n";
|
||||
echo "</span>\n";
|
||||
}
|
||||
echo "<span id='thread_bottom'></span>\n";
|
||||
}
|
||||
|
|
@ -212,7 +290,7 @@
|
|||
echo "<table cellpadding='0' cellspacing='0' border='0' width='100%' style='margin-top: 15px;'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' width='50%'><input type='reset' class='btn' value='".$text['button-clear']."' onclick=\"$('#message_text').focus();\"></td>\n";
|
||||
echo " <td align='center'><span id='thread_refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; cursor: pointer;' onclick=\"refresh_thread_stop('".$number."');\" alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span></td>\n";
|
||||
echo " <td align='center'><span id='thread_refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; cursor: pointer;' onclick=\"refresh_thread_stop('".$number."','".$contact_uuid."');\" alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span></td>\n";
|
||||
echo " <td align='right' width='50%'><input type='submit' class='btn' value='".$text['button-send']."' title=\"".$text['label-ctrl_enter']."\"></td>\n";
|
||||
echo " </td>\n";
|
||||
echo "</table>\n";
|
||||
|
|
@ -237,7 +315,7 @@
|
|||
echo " $('#message_text').focus();\n";
|
||||
echo " }\n";
|
||||
}
|
||||
echo " refresh_thread('".$number."','true');\n";
|
||||
echo " refresh_thread('".$number."', '".$contact_uuid."', 'true');\n";
|
||||
echo " }\n";
|
||||
echo " });\n";
|
||||
echo " });\n";
|
||||
|
|
|
|||
|
|
@ -278,12 +278,13 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
});
|
||||
<?php } ?>
|
||||
|
||||
//generate resizeEnd event after window resize event finishes (used when side menu and on messages app)
|
||||
$(window).resize(function() {
|
||||
if (this.resizeTO) { clearTimeout(this.resizeTO); }
|
||||
this.resizeTO = setTimeout(function() { $(this).trigger('resizeEnd'); }, 180);
|
||||
});
|
||||
|
||||
<?php if ($_SESSION['theme']['menu_style']['text'] == 'side') { ?>
|
||||
//create resizeEnd event
|
||||
$(window).resize(function() {
|
||||
if (this.resizeTO) { clearTimeout(this.resizeTO); }
|
||||
this.resizeTO = setTimeout(function() { $(this).trigger('resizeEnd'); }, 180);
|
||||
});
|
||||
//side menu: adjust content container width after window resize
|
||||
$(window).on('resizeEnd', function() {
|
||||
$('#content_container').animate({ width: $(window).width() - $('#menu_side_container').width() }, 200);
|
||||
|
|
@ -311,7 +312,7 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
$("[id*=recording_button]").not("[id*=recording_button_"+recording_id+"]").html("<?php echo $v_link_label_play; ?>");
|
||||
$("[id*=recording_progress_bar]").not("[id*=recording_progress_bar_"+recording_id+"]").css('display', 'none');
|
||||
|
||||
$('audio').each(function(){
|
||||
$('audio').each(function(){$('#menu_side_container').width()
|
||||
if ($(this).get(0) != recording_audio) {
|
||||
$(this).get(0).pause(); // Stop playing
|
||||
$(this).get(0).currentTime = 0; // Reset time
|
||||
|
|
|
|||
Loading…
Reference in New Issue