Skip to content

Commit

Permalink
revert(pg)
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Jul 24, 2024
1 parent cefbbd9 commit 86514f9
Showing 1 changed file with 6 additions and 36 deletions.
42 changes: 6 additions & 36 deletions packages/devextreme/playground/jquery.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,43 +49,13 @@ <h1 style="position: fixed; left: 0; top: 0; clip: rect(1px, 1px, 1px, 1px);">Te
<select id="theme-selector" style="display: block;">
</select>
<br />
<div id="chat"></div>
<div id="button"></div>
<script>
const MOCK_CHAT_HEADER_TEXT = 'Chat title';
const MOCK_CURRENT_USER_ID = Math.random()

const userFirst = {
id: Math.random(),
name: 'First',
}

const userSecond = {
id: MOCK_CURRENT_USER_ID,
name: 'Second',
}

const now = Date.now()

const messages = Array.from({ length: 30 }, (_, i) => {
const item = {
timestamp: String(now + i),
author: i % 4 === 0 ? userFirst : userSecond,
text: String(Math.random()),
}

return item
})

$(() => {
const dxChat = $("#chat").dxChat({
title: MOCK_CHAT_HEADER_TEXT,
items: messages,
user: userSecond,
}).dxChat('instance');

setTimeout(() => {
dxChat.option({ user: userFirst });
}, 5000);
$(function() {
$("#button").dxButton({
text: 'Click me!',
onClick: function() { alert("clicked"); }
});
});
</script>
</div>
Expand Down

0 comments on commit 86514f9

Please sign in to comment.