', {style: 'color: blue'})
+ .append ('> ')
+ .append ($ ('
',
+ {class: 'message-block-chat',
+ style: 'font-style: italic'})
+ .append (datum.chatMessage)))
+ .append ($ ('')
+ .append ($ ('',
+ {class: 'message-block-answer'})
+ .append (datum.answer)))));
+ }
+
+ $ ('.message-block').on ('click', function ()
+ {
+ const dt = $ (this).find ('.message-block-dt').text ();
+ const chat = $ (this).find ('.message-block-chat').text ();
+ const answer = $ (this).find ('.message-block-answer').text ();
+
+ window.open (
+ `./talk.php?dt=${dt}&chat=${chat}&answer=${answer}`);
+ });
+
+ self.setPagination ();
+
+
+ if (data.data.length > 0)
+ $ ('nav').removeClass ('d-none');
+ else
+ {
+ $ ('nav').addClass ('d-none');
+
+ ($ ('#message-list')
+ .text ('何も見つかりませんでしたぬ゛ぅ゛ぅ゛ぅ゛ぅ゛ん゛'));
+ }
+ };
+
+ $.post ({url: './services/fetch_data.php',
+ dataType: 'json',
+ data: postData})
+ .done (done);
+ }
}
diff --git a/broadcast/services/fetch_data.php b/broadcast/services/fetch_data.php
index 255cba2..84ec0ce 100644
--- a/broadcast/services/fetch_data.php
+++ b/broadcast/services/fetch_data.php
@@ -60,7 +60,8 @@ $pages_max = (int) ((count ($log_data) - 1) / $length) + 1;
if (!($asc))
$log_data = array_reverse ($log_data);
-$log_data = array_slice ($log_data, ($page - 1) * $length, $length, true);
+$log_data = array_slice ($log_data, ($page - 1) * $length, $length, false);
-echo json_encode ($log_data);
+echo ('{"data": ' . json_encode ($log_data) . ', "max": ' . $pages_max
+ . ', "page": ' . $page . '}');