first initial

This commit is contained in:
2025-05-27 19:09:17 +07:00
commit 80375d8af3
1587 changed files with 572586 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
"use strict";
// Class definition
var KTAppChat = function () {
var chatAsideEl;
var chatContentEl;
// Private functions
var initAside = function () {
// Mobile offcanvas for mobile mode
var offcanvas = new KTOffcanvas(chatAsideEl, {
overlay: true,
baseClass: 'kt-app__aside',
closeBy: 'kt_chat_aside_close',
toggleBy: 'kt_chat_aside_mobile_toggle'
});
// User listing
var userListEl = KTUtil.find(chatAsideEl, '.kt-scroll');
if (!userListEl) {
return;
}
// Initialize perfect scrollbar(see: https://github.com/utatti/perfect-scrollbar)
KTUtil.scrollInit(userListEl, {
mobileNativeScroll: true, // enable native scroll for mobile
desktopNativeScroll: false, // disable native scroll and use custom scroll for desktop
resetHeightOnDestroy: true, // reset css height on scroll feature destroyed
handleWindowResize: true, // recalculate hight on window resize
rememberPosition: true, // remember scroll position in cookie
height: function() { // calculate height
var height;
var portletBodyEl = KTUtil.find(chatAsideEl, '.kt-portlet > .kt-portlet__body');
var widgetEl = KTUtil.find(chatAsideEl, '.kt-widget.kt-widget--users');
var searchbarEl = KTUtil.find(chatAsideEl, '.kt-searchbar');
if (KTUtil.isInResponsiveRange('desktop')) {
height = KTLayout.getContentHeight();
} else {
height = KTUtil.getViewPort().height;
}
if (chatAsideEl) {
height = height - parseInt(KTUtil.css(chatAsideEl, 'margin-top')) - parseInt(KTUtil.css(chatAsideEl, 'margin-bottom'));
height = height - parseInt(KTUtil.css(chatAsideEl, 'padding-top')) - parseInt(KTUtil.css(chatAsideEl, 'padding-bottom'));
}
if (widgetEl) {
height = height - parseInt(KTUtil.css(widgetEl, 'margin-top')) - parseInt(KTUtil.css(widgetEl, 'margin-bottom'));
height = height - parseInt(KTUtil.css(widgetEl, 'padding-top')) - parseInt(KTUtil.css(widgetEl, 'padding-bottom'));
}
if (portletBodyEl) {
height = height - parseInt(KTUtil.css(portletBodyEl, 'margin-top')) - parseInt(KTUtil.css(portletBodyEl, 'margin-bottom'));
height = height - parseInt(KTUtil.css(portletBodyEl, 'padding-top')) - parseInt(KTUtil.css(portletBodyEl, 'padding-bottom'));
}
if (searchbarEl) {
height = height - parseInt(KTUtil.css(searchbarEl, 'height'));
height = height - parseInt(KTUtil.css(searchbarEl, 'margin-top')) - parseInt(KTUtil.css(searchbarEl, 'margin-bottom'));
}
// remove additional space
height = height - 5;
return height;
}
});
}
return {
// public functions
init: function() {
// elements
chatAsideEl = KTUtil.getByID('kt_chat_aside');
// init aside and user list
initAside();
// init inline chat example
KTChat.setup(KTUtil.getByID('kt_chat_content'));
// trigger click to show popup modal chat on page load
if (KTUtil.getByID('kt_app_chat_launch_btn')) {
setTimeout(function() {
KTUtil.getByID('kt_app_chat_launch_btn').click();
}, 1000);
}
}
};
}();
KTUtil.ready(function() {
KTAppChat.init();
});

View File

@@ -0,0 +1 @@
"use strict";var KTAppChat=function(){var t;return{init:function(){t=KTUtil.getByID("kt_chat_aside"),function(){new KTOffcanvas(t,{overlay:!0,baseClass:"kt-app__aside",closeBy:"kt_chat_aside_close",toggleBy:"kt_chat_aside_mobile_toggle"});var i=KTUtil.find(t,".kt-scroll");i&&KTUtil.scrollInit(i,{mobileNativeScroll:!0,desktopNativeScroll:!1,resetHeightOnDestroy:!0,handleWindowResize:!0,rememberPosition:!0,height:function(){var i,s=KTUtil.find(t,".kt-portlet > .kt-portlet__body"),e=KTUtil.find(t,".kt-widget.kt-widget--users"),n=KTUtil.find(t,".kt-searchbar");return i=KTUtil.isInResponsiveRange("desktop")?KTLayout.getContentHeight():KTUtil.getViewPort().height,t&&(i=(i=i-parseInt(KTUtil.css(t,"margin-top"))-parseInt(KTUtil.css(t,"margin-bottom")))-parseInt(KTUtil.css(t,"padding-top"))-parseInt(KTUtil.css(t,"padding-bottom"))),e&&(i=(i=i-parseInt(KTUtil.css(e,"margin-top"))-parseInt(KTUtil.css(e,"margin-bottom")))-parseInt(KTUtil.css(e,"padding-top"))-parseInt(KTUtil.css(e,"padding-bottom"))),s&&(i=(i=i-parseInt(KTUtil.css(s,"margin-top"))-parseInt(KTUtil.css(s,"margin-bottom")))-parseInt(KTUtil.css(s,"padding-top"))-parseInt(KTUtil.css(s,"padding-bottom"))),n&&(i=(i-=parseInt(KTUtil.css(n,"height")))-parseInt(KTUtil.css(n,"margin-top"))-parseInt(KTUtil.css(n,"margin-bottom"))),i-=5}})}(),KTChat.setup(KTUtil.getByID("kt_chat_content")),KTUtil.getByID("kt_app_chat_launch_btn")&&setTimeout(function(){KTUtil.getByID("kt_app_chat_launch_btn").click()},1e3)}}}();KTUtil.ready(function(){KTAppChat.init()});