diff --git a/README.md b/README.md index 82a7932..da96ed1 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ did not install via Composer or you want to publish the assets yourself, move th the library's **assets/** directory into your **public/** directory. You can then include them in your `` tag or use the **Assets** config file to load them for certain routes: -``` +```php public $routes = [ '' => [ 'vendor/bootstrap/bootstrap.min.css', @@ -47,7 +47,14 @@ in your `` tag or use the **Assets** config file to load them for certain ], ``` -If you install assets manually be sure to include Bootstrap. +If you install assets manually be sure to include Bootstrap. Once the files are in place set +the site URL with a ` +``` ### Authentication @@ -62,7 +69,7 @@ your own. The easiest way to start a chat is with the helper. Load the helper file (`helper('chat')`) and then use the `chat($uid, $title)` command wherever you would use a partial view: -``` +```html

Yellow Widgets

Main product info here!

diff --git a/assets/chat.js b/assets/chat.js index 65be035..aaae83e 100644 --- a/assets/chat.js +++ b/assets/chat.js @@ -35,7 +35,7 @@ $(".card-body").scrollTop(10000); // Handle submitting messages via AJAX function sendMessage(formElement) { - const url = siteUrl + 'chatapi/messages'; + const url = siteUrl + '/chatapi/messages'; const data = new URLSearchParams(new FormData(formElement)); fetch(url, { diff --git a/src/Views/conversation.php b/src/Views/conversation.php index 94e7f92..5512246 100644 --- a/src/Views/conversation.php +++ b/src/Views/conversation.php @@ -6,6 +6,15 @@ messages as $message): ?> + created_at->format('n/j/Y')): ?> + created_at->format('n/j/Y'); ?> +
+

+
+

+
+ + $message]) ?> diff --git a/src/Views/message.php b/src/Views/message.php index 988c0fe..ac81f34 100644 --- a/src/Views/message.php +++ b/src/Views/message.php @@ -2,15 +2,69 @@ participant->user_id == user_id()): ?>
- content ?> - participant->username, 0, 2) ?> + content ?> + participant->username, 0, 2) ?>
- participant->username, 0, 2) ?> - content ?> + participant->username, 0, 2) ?> + content ?>