Skip to content

Commit

Permalink
revart(pg)
Browse files Browse the repository at this point in the history
  • Loading branch information
marker dao ® committed Sep 11, 2024
1 parent 695e511 commit c724bcf
Showing 1 changed file with 5 additions and 103 deletions.
108 changes: 5 additions & 103 deletions packages/devextreme/playground/jquery.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!DOCTYPE html>
<html lang="en">

<head>
<title>DevExtreme jQuery Example</title>

Expand Down Expand Up @@ -42,15 +41,7 @@
<script type="text/javascript" src="../artifacts/js/dx.all.debug.js" charset="utf-8"></script>
<script type="text/javascript" src="./themeSelector.js"></script>
<script type="text/javascript" src="../../../node_modules/axe-core/axe.min.js"></script>

<style>
/* .dx-chat-message-avatar {
width: 64px;
height: 64px;
} */
</style>
</head>

<body class="dx-surface">
<div role="main">
<h1 style="position: fixed; left: 0; top: 0; clip: rect(1px, 1px, 1px, 1px);">Test header</h1>
Expand All @@ -60,102 +51,13 @@ <h1 style="position: fixed; left: 0; top: 0; clip: rect(1px, 1px, 1px, 1px);">Te
<br />
<div id="button"></div>
<script>
$(function () {
const avatarUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAACRCAYAAAA/zXHpAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAUGVYSWZNTQAqAAAACAACARIAAwAAAAEAAQAAh2kABAAAAAEAAAAmAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAACYoAMABAAAAAEAAACRAAAAAPaSQrgAAAIyaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVz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Q+6E+wAcnMEwZqvf9CdYAeQmyMI1nz9g+4EO4DcHEGw5usfdCfYAeTmCII1X/+gO8EOIDdHEKz5+gfdCXYAuTmCYM3XP+hOsAPIzREEa77+QXeCHUBujiBY8/UPuhPsAHJzBMGar3/QnWAHkJsjCNZ8/YPuBDuA3BxBsObrH3Qn2AHk5giCNV//oDvBDiA3RxCs+foH3Ql2ALk5gmDN1z/oTrADyM0Rj/7H22Yg/3L3j2/+3de9fvvr0cc9//z+18Ofk58/fLH9ycTvM4G/CcakmZtpSIBgIUDrMwGCzXxMQwIECwFanwkQbOZjGhIgWAjQ+kyAYDMf05AAwUKA1mcCBJv5mIYECBYCtD4TINjMxzQkQLAQoPWZAMFmPqYhAYKFAK3PBAg28zENCRAsBGh9JkCwmY9pSIBgIUDrMwGCzXxMQwIECwFanwkQbOZjGhIgWAjQ+kyAYDMf05AAwUKA1mcCBJv5mIYECBYCtD4TINjMxzQkQLAQoPWZAMFmPqYhAYKFAK3PBAg28zENCRAsBGh9JkCwmY9pSIBgIUDrMwGCzXxMQwIECwFanwkQbOZjGhIgWAjQ+kyAYDMf05AAwUKA1mcCBJv5mIYECBYCtD4TINjMxzQkQLAQoPWZAMFmPqYhAYKFAK3PBAg28zENCRAsBGh9JkCwmY9pSIBgIUDrMwGCzXxMQwIECwFanwkQbOZjGhIgWAjQ+kyAYDMf05AAwUKA1mcCvwEk7hCO5l/PKgAAAABJRU5ErkJggg==';
const lineBreaks = '\n\n';

const createUser = (id, name, url = '') => ({
id,
name,
avatarUrl: url,
$(function() {
$("#button").dxButton({
text: 'Click me!',
onClick: function() { alert("clicked"); }
});

const timestamp = new Date(1721747399083);

const getLongText = (useLineBreaks = false) => {
const uUID = '9138cf2e-ced3-426a-bb53-4478536f690b';
const longString = '182640341522285876574035911571908109718245218990724216376363976558845201472715827073837942336095076';

const result = `${uUID}:${useLineBreaks ? lineBreaks : ''}${longString}`;

return result;
};

const getShortText = (useLineBreaks) => {
const value = `Short${useLineBreaks ? lineBreaks : ' '}text`;

return value;
};

const generateMessages = (
length,
userFirst,
useLongText = false,
useLineBreaks = false,
userSecond = null,
coefficient = 4,
) => {
const messages = Array.from({ length }, (_, i) => {
const text = useLongText
? getLongText(useLineBreaks)
: getShortText(useLineBreaks);

const item = {
timestamp,
author: i % coefficient === 0 ? userFirst : userSecond ?? userFirst,
text,
};

return item;
});

return messages;
};

const generateSpecifiedNumberOfMessagesInRow = (
n,
userFirst,
userSecond,
) => {
const messages = Array.from({ length: n * 2 }, (_, i) => {
const item = {
timestamp,
author: i >= n ? userSecond : userFirst,
text: getShortText(),
};

return item;
});

return messages;
};

const useAvatarUrl = false;
const useLongName = false;

const userFirst = createUser(
1,
useLongName ? getLongText() : getShortText(),
useAvatarUrl ? avatarUrl : '',
);

const userSecond = createUser(
2,
useLongName ? getLongText() : getShortText(),
useAvatarUrl ? avatarUrl : '',
);

const items = generateMessages(2, userFirst, true, true, userSecond, 2)

const instance = $("#button").dxChat({
width: 400,
height: 600,
user: userSecond,
items,
}).dxChat('instance');
});
</script>
</div>
</body>

</html>
</html>

0 comments on commit c724bcf

Please sign in to comment.