mirror of
https://github.com/LingChair/LingChair-V0.git
synced 2025-12-10 02:55:49 +08:00
Compare commits
7 Commits
v0.7.0-rc3
...
v0.7.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6654141c18 | ||
|
|
822a4ad4da | ||
|
|
9f456b95c1 | ||
|
|
7d2798d4fd | ||
|
|
0ccee91b3e | ||
|
|
48bad65df5 | ||
|
|
5b55ca77ec |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
ling_chair_data/
|
ling_chair_data/
|
||||||
ling_chair_config/
|
|
||||||
ling_chair_http/
|
|
||||||
1
babel_lib/.gitignore
vendored
1
babel_lib/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## Babel
|
|
||||||
|
|
||||||
请从本仓库根目录的 .github 文件夹内找到对应的zip文件,并把 node_modules 解压在此,方可使用
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* 铃之椅 - 把选择权还给用户, 让聊天权掌握在用户手中
|
|
||||||
* Copyright 2024 满月叶
|
|
||||||
* GitHub: https://github.com/MoonLeeeaf/LingChair-Web-Client
|
|
||||||
* 本项目使用 Apache 2.0 协议开源
|
|
||||||
*
|
|
||||||
* Copyright 2024 MoonLeeeaf
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
.chat-message-right {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: flex-start;
|
|
||||||
margin: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-left {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: flex-start;
|
|
||||||
margin: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.message-content {
|
|
||||||
margin-top: 13px;
|
|
||||||
margin-bottom: 7px;
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-right: 5px;
|
|
||||||
max-width: 100%;
|
|
||||||
white-space: normal;
|
|
||||||
word-break: break-all;
|
|
||||||
font-size: medium;
|
|
||||||
/* 使用了 CardView 就不需要边框了 */
|
|
||||||
/* border: 1.3px solid; */
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 15px;
|
|
||||||
/* 添加圆角样式 */
|
|
||||||
/* 设置外边距为 7px */
|
|
||||||
}
|
|
||||||
|
|
||||||
.message-content-with-nickname-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin: 7px;
|
|
||||||
flex-direction: column;
|
|
||||||
/* 垂直排列元素 */
|
|
||||||
align-items: flex-end;
|
|
||||||
/* 左对齐元素 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.message-content-with-nickname-left {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin: 7px;
|
|
||||||
flex-direction: column;
|
|
||||||
/* 垂直排列元素 */
|
|
||||||
align-items: flex-start;
|
|
||||||
/* 左对齐元素 */
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-left .message-content-with-nickname-left .nickname,
|
|
||||||
.chat-message-right .message-content-with-nickname-right .nickname {
|
|
||||||
margin-right: 5px;
|
|
||||||
font-size: medium;
|
|
||||||
margin-top: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chat-message-left > .avatar,
|
|
||||||
.chat-message-right > .avatar {
|
|
||||||
width: 45px;
|
|
||||||
height: 45px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* 铃之椅 - 把选择权还给用户, 让聊天权掌握在用户手中
|
|
||||||
* Copyright 2024 满月叶
|
|
||||||
* GitHub: https://github.com/MoonLeeeaf/LingChair-Web-Client
|
|
||||||
* 本项目使用 Apache 2.0 协议开源
|
|
||||||
*
|
|
||||||
* Copyright 2024 MoonLeeeaf
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
html, body {
|
|
||||||
max-height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
/* overflow: hidden; */
|
|
||||||
/*font: initial;*/
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-on-message {
|
|
||||||
margin-top: 60px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
[n-id=pageChatSeesion]::after {
|
|
||||||
content: "";
|
|
||||||
position: sticky;
|
|
||||||
bottom: 0;
|
|
||||||
display: block;
|
|
||||||
height: var(--pseudo-height); /* 设置伪元素的高度 */
|
|
||||||
z-index: -1; /* 防止遮挡实际内容 */
|
|
||||||
}
|
|
||||||
1272
build_cache/index.js
1272
build_cache/index.js
File diff suppressed because one or more lines are too long
BIN
client_src.zip
BIN
client_src.zip
Binary file not shown.
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* 铃之椅 - 把选择权还给用户, 让聊天权掌握在用户手中
|
|
||||||
* Copyright 2024 满月叶
|
|
||||||
* GitHub: https://github.com/MoonLeeeaf/LingChair-Web-Client
|
|
||||||
* 本项目使用 Apache 2.0 协议开源
|
|
||||||
*
|
|
||||||
* Copyright 2024 MoonLeeeaf
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
html, body {
|
|
||||||
max-height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
/* overflow: hidden; */
|
|
||||||
/*font: initial;*/
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-on-message {
|
|
||||||
margin-top: 60px;
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
[n-id=pageChatSeesion]::after {
|
|
||||||
content: "";
|
|
||||||
position: sticky;
|
|
||||||
bottom: 0;
|
|
||||||
display: block;
|
|
||||||
height: var(--pseudo-height); /* 设置伪元素的高度 */
|
|
||||||
z-index: -1; /* 防止遮挡实际内容 */
|
|
||||||
}
|
|
||||||
@@ -1,339 +0,0 @@
|
|||||||
<!doctype html>
|
|
||||||
<html lang="zh-cmn-Hans">
|
|
||||||
<!--
|
|
||||||
* 铃之椅 - 把选择权还给用户, 让聊天权掌握在用户手中
|
|
||||||
* Copyright 2024 满月叶
|
|
||||||
* GitHub: https://github.com/MoonLeeeaf/LingChair-Web-Client
|
|
||||||
* 本项目使用 Apache 2.0 协议开源
|
|
||||||
*
|
|
||||||
* Copyright 2024 MoonLeeeaf
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
|
||||||
<meta name="renderer" content="webkit" />
|
|
||||||
<meta name="force-rendering" content="webkit" />
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
|
||||||
|
|
||||||
<!-- 给老旧的设备提供支持 支持不了, 照样没法运行 不 试一下红米2可不可以-->
|
|
||||||
<script src='https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2020%2Ces2021%2Ces2022%2Ces5%2Ces6%2Ces7'></script>
|
|
||||||
<!-- <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> -->
|
|
||||||
|
|
||||||
<!-- Styles -->
|
|
||||||
<link rel="stylesheet" href="https://unpkg.com/mdui@1.0.2/dist/css/mdui.min.css" />
|
|
||||||
<link rel="stylesheet" href="index.css" />
|
|
||||||
<link rel="stylesheet" href="chat-message.css" />
|
|
||||||
<link rel="stylesheet" href="mdui-prettier.css" />
|
|
||||||
|
|
||||||
<!-- 代替私人 fixed 并提供更好的兼容性 -->
|
|
||||||
<script src="https://cdn.jsdelivr.net/gh/wilddeer/stickyfill@2.1.0/dist/stickyfill.min.js"></script>
|
|
||||||
<script src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js"></script>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
|
|
||||||
<link rel="icon" href="res/icon.ico" />
|
|
||||||
<title>铃之椅</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body
|
|
||||||
class="mdui-theme-primary-teal mdui-theme-accent-teal mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-layout-auto"
|
|
||||||
id="app">
|
|
||||||
|
|
||||||
<input n-id="textCopierBtn" class="mdui-hidden" />
|
|
||||||
|
|
||||||
<div id="lingchair-app" style="height: 100%;">
|
|
||||||
<!-- 侧滑栏 -->
|
|
||||||
<div class="mdui-drawer" id="main-drawer">
|
|
||||||
<ul class="mdui-list" mdui-collapse="{accordion: true}">
|
|
||||||
<li class="mdui-list-item mdui-ripple">
|
|
||||||
<div class="mdui-list-item-avatar">
|
|
||||||
<img src="default_head.png" n-id="userHead" onerror="this.src='res/default_head.png'" />
|
|
||||||
</div>
|
|
||||||
<div class="mdui-list-item-content"><a n-id="helloText">早安</a>, <a n-id="userNick">Unknown</a></div>
|
|
||||||
</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple" onclick="new mdui.Dialog(viewBinding.dialogSettings.get(0)).open()">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">settings</i>
|
|
||||||
<div class="mdui-list-item-content">设置</div>
|
|
||||||
</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple" n-id="drawerSignOut">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">exit_to_app</i>
|
|
||||||
<div class="mdui-list-item-content">登出</div>
|
|
||||||
</li>
|
|
||||||
<div class="mdui-subheader">聊天</div>
|
|
||||||
<li class="mdui-collapse-item">
|
|
||||||
<div class="mdui-collapse-item-header mdui-list-item mdui-ripple"><i class="mdui-list-item-icon mdui-icon material-icons">contacts</i>
|
|
||||||
<div class="mdui-list-item-content">联系人</div><i
|
|
||||||
class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-collapse-item-body mdui-list" n-id="contactsList">
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul class="mdui-list mdui-hidden">
|
|
||||||
|
|
||||||
<li class="mdui-subheader">个人</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple" onclick="new mdui.Dialog(viewBinding.dialogMyProfile.get(0)).open()">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">account_circle</i>
|
|
||||||
<div class="mdui-list-item-content">资料</div>
|
|
||||||
</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple" onclick="new mdui.Dialog(viewBinding.dialogMyProfile.get(0)).open()">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">person_add</i>
|
|
||||||
<div class="mdui-list-item-content">新的好友</div>
|
|
||||||
</li>
|
|
||||||
<li class="mdui-subheader">客户端</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">settings</i>
|
|
||||||
<div class="mdui-list-item-content">设置</div>
|
|
||||||
</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple" n-id="drawerChangeServer">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">cloud_circle</i>
|
|
||||||
<div class="mdui-list-item-content">更换服务器</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 应用栏 -->
|
|
||||||
<header class="mdui-appbar mdui-appbar-fixed">
|
|
||||||
<!-- Toolbar -->
|
|
||||||
<div class="mdui-toolbar mdui-color-theme">
|
|
||||||
<a mdui-drawer="{target: '#main-drawer'}" class="mdui-btn mdui-btn-icon mdui-ripple">
|
|
||||||
<i class="mdui-icon material-icons">menu</i>
|
|
||||||
</a>
|
|
||||||
<a class="mdui-typo-title" n-id="appTitle"></a>
|
|
||||||
<div class="mdui-toolbar-spacer"></div>
|
|
||||||
<a onclick="refreshAll()" n-id="contactsRefresh" class="mdui-btn mdui-btn-icon mdui-ripple">
|
|
||||||
<i class="mdui-icon material-icons">refresh</i>
|
|
||||||
</a>
|
|
||||||
<a onclick="ContactsList.openAddDialog()" n-id="contactsAdd" class="mdui-btn mdui-btn-icon mdui-ripple">
|
|
||||||
<i class="mdui-icon material-icons">add</i>
|
|
||||||
</a>
|
|
||||||
<a class="mdui-btn mdui-btn-icon mdui-ripple" n-id="switchNotifications">
|
|
||||||
<i class="mdui-icon material-icons" n-id="switchNotificationsIcon">notifications_off</i>
|
|
||||||
</a>
|
|
||||||
<a mdui-menu="{target: '#appbar-menu'}" class="mdui-btn mdui-btn-icon mdui-ripple">
|
|
||||||
<i class="mdui-icon material-icons">more_vert</i>
|
|
||||||
</a>
|
|
||||||
<ul class="mdui-menu" id="appbar-menu">
|
|
||||||
<li class="mdui-menu-item">
|
|
||||||
<a class="mdui-ripple" n-id="menuAbout">关于</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<!-- Tab 栏 -->
|
|
||||||
<div class="mdui-tab mdui-accent-theme mdui-theme-color-auto" style="position: fixed; z-index: 114;width: 100%;"
|
|
||||||
mdui-tab n-id="chatTab">
|
|
||||||
<!-- 侧滑栏的 z-index 是2000, 在移动端会直接覆盖 -->
|
|
||||||
<a href="#page-chat-seesion" n-id="tabChatSeesion" class="mdui-ripple" style="text-transform: none;"></a>
|
|
||||||
</div>
|
|
||||||
<!-- 滚动到底部咋这么难写... -->
|
|
||||||
<div style="display: flex;flex-direction: column;">
|
|
||||||
<!-- 写时间居中写到吐了 这样式表不能要了 -->
|
|
||||||
<div
|
|
||||||
style="margin-top: 50px;overflow: auto;width: 100%;max-width: 100%;height: 100%;max-height: 100%;min-height: 0;flex: 1 1 auto;display: flex;flex-direction: column;"
|
|
||||||
n-id="chatPager">
|
|
||||||
<div class="mdui-center" style="margin: 15px;"><a href="javascript:;" onclick="ChatMsgAdapter.loadMore()"
|
|
||||||
class="mdui-text-color-theme">加载更多</a> | <a href="javascript:;"
|
|
||||||
onclick="ChatMsgAdapter.scrollToBottom()" class="mdui-text-color-theme">回到底部</a></div>
|
|
||||||
<div n-id="pageChatSeesion" style="flex: 1 1 auto;display: flex;flex-direction: column;position: relative;">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 妈的黑化了 私人玩意这么难整 早知道 z-index 弄死它得了 浪费我时间 我就没试过这么离谱的样式表 第三方库真难写CSS 就应该先写后端的 啊啊啊啊啊啊 -->
|
|
||||||
<!-- 不黑化了 因为 stickyfill -->
|
|
||||||
<div class="mdui-toolbar mdui-theme-color-auto"
|
|
||||||
style="position: sticky;max-width: 100%;margin-bottom: -30px;bottom: 0;z-index: 101;" n-id="inputToolbar">
|
|
||||||
<ul class="mdui-menu" id="msg-input-more">
|
|
||||||
<li class="mdui-menu-item">
|
|
||||||
<a class="mdui-ripple">插入图片</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="mdui-textfield" style="width: 100%;max-width: 100%;">
|
|
||||||
<textarea class="mdui-textfield-input" type="text" placeholder="(。・ω・。)" n-id="inputMsg"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-toolbar-spacer"></div>
|
|
||||||
<a n-id="sendMsg" class="mdui-btn mdui-btn-icon mdui-ripple">
|
|
||||||
<i class="mdui-icon material-icons">send</i>
|
|
||||||
</a>
|
|
||||||
<a mdui-menu="{target: '#msg-input-more', position: 'top'}" class="mdui-btn mdui-btn-icon mdui-ripple">
|
|
||||||
<i class="mdui-icon material-icons">more_vert</i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 登录对话框 -->
|
|
||||||
<div class="mdui-dialog" n-id="dialogSignIn">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
登录到 铃之椅
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
|
||||||
<div class="mdui-textfield" n-id="dialogSignInServerLabel">
|
|
||||||
<i class="mdui-icon material-icons">cloud_circle</i>
|
|
||||||
<label class="mdui-textfield-label">服务器地址</label>
|
|
||||||
<input n-id="dialogSignInServer" class="mdui-textfield-input" type="text" placeholder="留空以使用网页所在地址"
|
|
||||||
n-input-ls="server" n-id="dialogSignServer" onblur="setUpClient(viewBinding.dialogSignServer.val())" />
|
|
||||||
</div>
|
|
||||||
<div class="mdui-textfield">
|
|
||||||
<i class="mdui-icon material-icons">account_circle</i>
|
|
||||||
<label class="mdui-textfield-label">账号</label>
|
|
||||||
<input n-id="dialogSignInName" class="mdui-textfield-input" maxlength="25" type="text"
|
|
||||||
n-input-ls="userName" />
|
|
||||||
</div>
|
|
||||||
<div class="mdui-textfield">
|
|
||||||
<i class="mdui-icon material-icons">lock</i>
|
|
||||||
<label class="mdui-textfield-label">密码</label>
|
|
||||||
<input n-id="dialogSignInPasswd" class="mdui-textfield-input" maxlength="30" type="password" />
|
|
||||||
</div>
|
|
||||||
<span>注:使用非已知的服务提供商提供的服务器时, 请注意个人信息保护哦 o(。・ω・。)o</span>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple"
|
|
||||||
onclick="User.signUp(viewBinding.dialogSignInName.val(), viewBinding.dialogSignInPasswd.val(), () => mdui.snackbar('注册成功, 请直接点击登录即可~'))">注册</button>
|
|
||||||
<button class="mdui-btn mdui-ripple" n-id="dialogSignInEnter"
|
|
||||||
onclick="User.signInWithDialog(viewBinding.dialogSignInName.val(), viewBinding.dialogSignInPasswd.val())">登录</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 资料卡对话框 -->
|
|
||||||
<div class="mdui-dialog" n-id="dialogProfile">
|
|
||||||
<div class="mdui-dialog-content" style="margin-left: 15px; margin-right: 15px; height: 101px;">
|
|
||||||
<div style="display: flex;justify-content: flex-start">
|
|
||||||
<img style="width: 60px; height: 60px;" class="mdui-img-circle" n-id="dialogProfileHead">
|
|
||||||
<div n-id="dialogProfileNick" style="font-size: 22px;align-self: center;margin-left: 20px;"
|
|
||||||
class="mdui-text-color-white"></div>
|
|
||||||
</div>
|
|
||||||
<div style="margin-left: 80px;"></div>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<div class="mdui-dialog" n-id="dialogMyProfile">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
资料
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
|
||||||
<ul class="mdui-list">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- 编辑昵称对话框 -->
|
|
||||||
<div class="mdui-dialog" n-id="dialogEditNick">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
修改昵称
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
|
||||||
<div class="mdui-textfield">
|
|
||||||
<label class="mdui-textfield-label">昵称</label>
|
|
||||||
<input n-id="dialogEditNickNick" class="mdui-textfield-input" maxlength="30" type="text" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" n-id="dialogEditNickClose" mdui-dialog-close
|
|
||||||
onclick="new mdui.Dialog(viewBinding.dialogSettings.get(0)).open()">关闭</button>
|
|
||||||
<button class="mdui-btn mdui-ripple"
|
|
||||||
onclick="User.setNick(viewBinding.dialogEditNickNick.val(), () => {mdui.snackbar('已保存, 刷新页面生效');viewBinding.dialogEditNickClose.click()})">保存</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 懂得都懂 -->
|
|
||||||
<div class="mdui-dialog" n-id="dialogNewFriendRequest">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
新的好友请求
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
|
||||||
<div class="mdui-textfield">
|
|
||||||
<label class="mdui-textfield-label">昵称</label>
|
|
||||||
<input n-id="" class="mdui-textfield-input" maxlength="30" type="text" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 懂得都懂 -->
|
|
||||||
<div class="mdui-dialog" n-id="dialogNewContact">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
添加好友/群
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
|
||||||
<div class="mdui-textfield">
|
|
||||||
<label class="mdui-textfield-label">好友/群的ID (不是名称)</label>
|
|
||||||
<input n-id="dialogNewContactID" class="mdui-textfield-input" maxlength="30" type="text" />
|
|
||||||
</div>
|
|
||||||
<select class="mdui-select" mdui-select="{position: 'top'}" n-id="dialogNewContactType">
|
|
||||||
<option value="single">好友</option>
|
|
||||||
<option value="group">群聊</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close
|
|
||||||
onclick="ContactsList.add(viewBinding.dialogNewContactID.val(), viewBinding.dialogNewContactType.val())">确认并关闭</button>
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close>取消</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 懂得都懂 -->
|
|
||||||
<div class="mdui-dialog" n-id="dialogSettings">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
设置
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content">
|
|
||||||
<ul class="mdui-list">
|
|
||||||
<div class="mdui-subheader">我的资料</div>
|
|
||||||
<li class="mdui-list-item mdui-ripple" mdui-dialog-close
|
|
||||||
onclick="(async () => {viewBinding.dialogEditNickNick.val(await NickCache.getNick(localStorage.userName));new mdui.Dialog(viewBinding.dialogEditNick.get(0)).open()})()">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">edit</i>
|
|
||||||
<div class="mdui-list-item-content">修改昵称</div>
|
|
||||||
</li>
|
|
||||||
<li class="mdui-list-item mdui-ripple" onclick="User.uploadHeadImage()">
|
|
||||||
<i class="mdui-list-item-icon mdui-icon material-icons">account_circle</i>
|
|
||||||
<div class="mdui-list-item-content">上传头像</div>
|
|
||||||
</li>
|
|
||||||
<div class="mdui-subheader">客户端</div>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mdui-hidden">
|
|
||||||
<input type="file" n-id="uploadHeadImage" name="选择头像" onchange="User.uploadHeadImageCallback(this)"
|
|
||||||
accept="image/png, image/jpeg" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
<script src="https://unpkg.com/crypto-js@4.2.0/crypto-js.js"></script>
|
|
||||||
<script src="https://unpkg.com/socket.io-client@4.7.4/dist/socket.io.min.js"></script>
|
|
||||||
<script src="https://unpkg.com/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
|
||||||
<!-- 加了babel也许能解决下浏览器兼容问题 -->
|
|
||||||
<!-- <script type="module" src="index.js"></script>
|
|
||||||
<script nomodule type="text/babel" src="index.js"></script> -->
|
|
||||||
|
|
||||||
<!-- 就算弄语法兼容其他老旧设备照样用不了, 比如我的 iPad4 -->
|
|
||||||
<script src="index.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* ©2024 满月叶
|
|
||||||
* GitHub: MoonLeeeaf
|
|
||||||
* 是 UI 美化,好耶!
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 美化UI */
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: -apple-system, system-ui, -webkit-system-font;
|
|
||||||
}
|
|
||||||
.mdui-dialog {
|
|
||||||
border-radius: 23px;
|
|
||||||
}
|
|
||||||
.mdui-menu {
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.mdui-menu-item > a {
|
|
||||||
padding-right: 3px;
|
|
||||||
}
|
|
||||||
.mdui-btn:not(.mdui-btn-icon, .mdui-dialog-actions button, .mdui-dialog-actions a) {
|
|
||||||
padding-left: 20px;
|
|
||||||
padding-right: 20px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.mdui-dialog-actions a,
|
|
||||||
.mdui-dialog-actions button {
|
|
||||||
padding-left: 20px;
|
|
||||||
padding-right: 20px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 40px;
|
|
||||||
}
|
|
||||||
.mdui-select-open {
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
@media not screen and (min-width: 768px) {
|
|
||||||
.mdui-snackbar {
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 配色方案 */
|
|
||||||
|
|
||||||
.mdui-theme-color-auto {
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
|
||||||
.mdui-theme-color-auto {
|
|
||||||
background-color: #303030;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"appTitle": "",
|
|
||||||
"canChangeServer": true
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 29 KiB |
@@ -1,13 +0,0 @@
|
|||||||
Copyright 2024 MoonLeeeaf
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
.chat-message-left > .avatar,
|
.chat-message-left > .avatar,
|
||||||
.chat-message-right > .avatar {
|
.chat-message-right > .avatar {
|
||||||
width: 45px;
|
width: 50px;
|
||||||
height: 45px;
|
height: 50px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
57
ling_chair_http/index.css
Normal file
57
ling_chair_http/index.css
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* ©2024 满月叶
|
||||||
|
* Github: MoonLeeeaf
|
||||||
|
* 铃之椅 网页端
|
||||||
|
*/
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
max-height: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
/*font: initial;*/
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-on-message {
|
||||||
|
margin-top: 60px;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
[n-id=pageChatSeesion]::after {
|
||||||
|
content: "";
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-seesion {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* https://segmentfault.com/q/1010000010391524 */
|
||||||
|
img {
|
||||||
|
image-rendering: -moz-crisp-edges; /* Firefox */
|
||||||
|
image-rendering: -o-crisp-edges; /* Opera */
|
||||||
|
image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
|
||||||
|
image-rendering: crisp-edges;
|
||||||
|
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
|
||||||
|
}
|
||||||
|
|
||||||
|
img.round {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
@@ -1,26 +1,10 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="zh-cmn-Hans">
|
<html lang="zh-cmn-Hans">
|
||||||
<!--
|
<!--
|
||||||
* 铃之椅 - 把选择权还给用户, 让聊天权掌握在用户手中
|
* ©2024 满月叶
|
||||||
* Copyright 2024 满月叶
|
* Github: MoonLeeeaf
|
||||||
* GitHub: https://github.com/MoonLeeeaf/LingChair-Web-Client
|
* 铃之椅 网页端
|
||||||
* 本项目使用 Apache 2.0 协议开源
|
|
||||||
*
|
|
||||||
* Copyright 2024 MoonLeeeaf
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no" />
|
||||||
@@ -28,9 +12,8 @@
|
|||||||
<meta name="force-rendering" content="webkit" />
|
<meta name="force-rendering" content="webkit" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
|
|
||||||
<!-- 给老旧的设备提供支持 支持不了, 照样没法运行 不 试一下红米2可不可以-->
|
<!-- Maybe it can run :D -->
|
||||||
<script src='https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2020%2Ces2021%2Ces2022%2Ces5%2Ces6%2Ces7'></script>
|
<script src='https://polyfill.io/v3/polyfill.min.js?features=default%2Cdom4%2Ces2015%2Ces2016%2Ces2017%2Ces2018%2Ces2019%2Ces2020%2Ces2021%2Ces2022%2Ces5%2Ces6%2Ces7'></script>
|
||||||
<!-- <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> -->
|
|
||||||
|
|
||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<link rel="stylesheet" href="https://unpkg.com/mdui@1.0.2/dist/css/mdui.min.css" />
|
<link rel="stylesheet" href="https://unpkg.com/mdui@1.0.2/dist/css/mdui.min.css" />
|
||||||
@@ -38,7 +21,7 @@
|
|||||||
<link rel="stylesheet" href="chat-message.css" />
|
<link rel="stylesheet" href="chat-message.css" />
|
||||||
<link rel="stylesheet" href="mdui-prettier.css" />
|
<link rel="stylesheet" href="mdui-prettier.css" />
|
||||||
|
|
||||||
<!-- 代替私人 fixed 并提供更好的兼容性 -->
|
<!-- Scripts -->
|
||||||
<script src="https://cdn.jsdelivr.net/gh/wilddeer/stickyfill@2.1.0/dist/stickyfill.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/gh/wilddeer/stickyfill@2.1.0/dist/stickyfill.min.js"></script>
|
||||||
<script src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js"></script>
|
<script src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
|
||||||
@@ -148,13 +131,14 @@
|
|||||||
<div class="mdui-center" style="margin: 15px;"><a href="javascript:;" onclick="ChatMsgAdapter.loadMore()"
|
<div class="mdui-center" style="margin: 15px;"><a href="javascript:;" onclick="ChatMsgAdapter.loadMore()"
|
||||||
class="mdui-text-color-theme">加载更多</a> | <a href="javascript:;"
|
class="mdui-text-color-theme">加载更多</a> | <a href="javascript:;"
|
||||||
onclick="ChatMsgAdapter.scrollToBottom()" class="mdui-text-color-theme">回到底部</a></div>
|
onclick="ChatMsgAdapter.scrollToBottom()" class="mdui-text-color-theme">回到底部</a></div>
|
||||||
<div n-id="pageChatSeesion" style="flex: 1 1 auto;display: flex;flex-direction: column;position: relative;">
|
<div n-id="pageChatSeesion" class="chat-seesion">
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 输入框和聊天消息重叠的原因就是死人 scrollbar, 把自动调整的距离调小, margin调大就行了 -->
|
||||||
</div>
|
</div>
|
||||||
<!-- 妈的黑化了 私人玩意这么难整 早知道 z-index 弄死它得了 浪费我时间 我就没试过这么离谱的样式表 第三方库真难写CSS 就应该先写后端的 啊啊啊啊啊啊 -->
|
<!-- 妈的黑化了 私人玩意这么难整 早知道 z-index 弄死它得了 浪费我时间 我就没试过这么离谱的样式表 第三方库真难写CSS 就应该先写后端的 啊啊啊啊啊啊 -->
|
||||||
<!-- 不黑化了 因为 stickyfill -->
|
<!-- 不黑化了 因为 stickyfill -->
|
||||||
<div class="mdui-toolbar mdui-theme-color-auto"
|
<div class="mdui-toolbar mdui-theme-color-auto"
|
||||||
style="position: sticky;max-width: 100%;margin-bottom: -30px;bottom: 0;z-index: 101;" n-id="inputToolbar">
|
style="position: sticky;max-width: 100%;margin-top: 1px;bottom: 0;z-index: 101;padding-top: 7px;" n-id="inputToolbar">
|
||||||
<ul class="mdui-menu" id="msg-input-more">
|
<ul class="mdui-menu" id="msg-input-more">
|
||||||
<li class="mdui-menu-item">
|
<li class="mdui-menu-item">
|
||||||
<a class="mdui-ripple">插入图片</a>
|
<a class="mdui-ripple">插入图片</a>
|
||||||
@@ -222,21 +206,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--
|
|
||||||
<div class="mdui-dialog" n-id="dialogMyProfile">
|
|
||||||
<div class="mdui-dialog-title">
|
|
||||||
资料
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
|
||||||
<ul class="mdui-list">
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="mdui-dialog-actions">
|
|
||||||
<button class="mdui-btn mdui-ripple" mdui-dialog-close>关闭</button>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- 编辑昵称对话框 -->
|
<!-- 编辑昵称对话框 -->
|
||||||
<div class="mdui-dialog" n-id="dialogEditNick">
|
<div class="mdui-dialog" n-id="dialogEditNick">
|
||||||
<div class="mdui-dialog-title">
|
<div class="mdui-dialog-title">
|
||||||
@@ -279,7 +248,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
<div class="mdui-dialog-content" style="margin-left:15px;margin-right:15px;">
|
||||||
<div class="mdui-textfield">
|
<div class="mdui-textfield">
|
||||||
<label class="mdui-textfield-label">好友/群的ID (不是名称)</label>
|
<label class="mdui-textfield-label">账号/群的ID (不是名称)</label>
|
||||||
<input n-id="dialogNewContactID" class="mdui-textfield-input" maxlength="30" type="text" />
|
<input n-id="dialogNewContactID" class="mdui-textfield-input" maxlength="30" type="text" />
|
||||||
</div>
|
</div>
|
||||||
<select class="mdui-select" mdui-select="{position: 'top'}" n-id="dialogNewContactType">
|
<select class="mdui-select" mdui-select="{position: 'top'}" n-id="dialogNewContactType">
|
||||||
@@ -328,11 +297,6 @@
|
|||||||
<script src="https://unpkg.com/crypto-js@4.2.0/crypto-js.js"></script>
|
<script src="https://unpkg.com/crypto-js@4.2.0/crypto-js.js"></script>
|
||||||
<script src="https://unpkg.com/socket.io-client@4.7.4/dist/socket.io.min.js"></script>
|
<script src="https://unpkg.com/socket.io-client@4.7.4/dist/socket.io.min.js"></script>
|
||||||
<script src="https://unpkg.com/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
<script src="https://unpkg.com/mdui@1.0.2/dist/js/mdui.min.js"></script>
|
||||||
<!-- 加了babel也许能解决下浏览器兼容问题 -->
|
|
||||||
<!-- <script type="module" src="index.js"></script>
|
|
||||||
<script nomodule type="text/babel" src="index.js"></script> -->
|
|
||||||
|
|
||||||
<!-- 就算弄语法兼容其他老旧设备照样用不了, 比如我的 iPad4 -->
|
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
@@ -1,51 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* 铃之椅 - 把选择权还给用户, 让聊天权掌握在用户手中
|
* ©2024 满月叶
|
||||||
* Copyright 2024 满月叶
|
* Github: MoonLeeeaf
|
||||||
* GitHub: https://github.com/MoonLeeeaf/LingChair-Web-Client
|
* 铃之椅 网页端
|
||||||
* 本项目使用 Apache 2.0 协议开源
|
|
||||||
*
|
|
||||||
* Copyright 2024 MoonLeeeaf
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// 2024.5.28 睡着了
|
||||||
|
const sleep = (t) => new Promise((res) => setTimeout(res, t))
|
||||||
|
|
||||||
const UrlArgs = new URL(location.href).searchParams
|
const UrlArgs = new URL(location.href).searchParams
|
||||||
|
|
||||||
// https://www.ruanyifeng.com/blog/2021/09/detecting-mobile-browser.html
|
// https://www.ruanyifeng.com/blog/2021/09/detecting-mobile-browser.html
|
||||||
function isMobile() {
|
function isMobile() {
|
||||||
return ('ontouchstart' in document.documentElement);
|
return ('ontouchstart' in document.documentElement);
|
||||||
}
|
|
||||||
|
|
||||||
function setOnRightClick(e, cb) {
|
|
||||||
if (!(e instanceof jQuery))
|
|
||||||
e = $(e)
|
|
||||||
|
|
||||||
let longPressTimer
|
|
||||||
if (!cb) throw new Error("定义回调!!!!")
|
|
||||||
e.on('contextmenu', function (e) {
|
|
||||||
e.preventDefault() // 阻止默认右键菜单
|
|
||||||
cb()
|
|
||||||
})
|
|
||||||
|
|
||||||
e.on('mousedown', function () {
|
|
||||||
longPressTimer = setTimeout(function () {
|
|
||||||
cb()
|
|
||||||
}, 1000)
|
|
||||||
})
|
|
||||||
|
|
||||||
e.on('mouseup', function () {
|
|
||||||
clearTimeout(longPressTimer)
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UrlArgs.get("debug")) {
|
if (UrlArgs.get("debug")) {
|
||||||
@@ -128,24 +94,6 @@ $.ajax({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
/* // Toolbar 快捷按钮绑定
|
|
||||||
viewBinding.contactsRefresh.hide()
|
|
||||||
viewBinding.contactsAdd.hide()
|
|
||||||
viewBinding.tabChatList.on("show.mdui.tab", () => {
|
|
||||||
viewBinding.contactsRefresh.hide()
|
|
||||||
viewBinding.contactsAdd.hide()
|
|
||||||
})
|
|
||||||
viewBinding.tabContacts.on("show.mdui.tab", () => {
|
|
||||||
viewBinding.contactsRefresh.show()
|
|
||||||
viewBinding.contactsAdd.show()
|
|
||||||
})
|
|
||||||
viewBinding.tabChatSeesion.on("show.mdui.tab", () => {
|
|
||||||
viewBinding.contactsRefresh.hide()
|
|
||||||
viewBinding.contactsAdd.hide()
|
|
||||||
}) */
|
|
||||||
|
|
||||||
/* viewBinding.tabChatSeesion.hide() */
|
|
||||||
|
|
||||||
// 关于页面
|
// 关于页面
|
||||||
viewBinding.menuAbout.click(() => mdui.alert('这是一个开源项目<br/>作者: MoonLeeeaf<br/>欢迎访问我们的<a class="mdui-text-color-theme-accent" href="https://github.com/LingChair/LingChair">项目主页</a>', '关于 铃之椅', () => { }, { confirmText: "关闭" }))
|
viewBinding.menuAbout.click(() => mdui.alert('这是一个开源项目<br/>作者: MoonLeeeaf<br/>欢迎访问我们的<a class="mdui-text-color-theme-accent" href="https://github.com/LingChair/LingChair">项目主页</a>', '关于 铃之椅', () => { }, { confirmText: "关闭" }))
|
||||||
|
|
||||||
@@ -196,6 +144,10 @@ viewBinding.switchNotifications.click((a) => {
|
|||||||
if (localStorage.useNotifications == "true")
|
if (localStorage.useNotifications == "true")
|
||||||
viewBinding.switchNotificationsIcon.text("notifications")
|
viewBinding.switchNotificationsIcon.text("notifications")
|
||||||
|
|
||||||
|
viewBinding.inputMsg.blur(() => {
|
||||||
|
window.initInputResizerResize()
|
||||||
|
})
|
||||||
|
|
||||||
// https://www.runoob.com/w3cnote/javascript-copy-clipboard.html
|
// https://www.runoob.com/w3cnote/javascript-copy-clipboard.html
|
||||||
function copyText(t) {
|
function copyText(t) {
|
||||||
let btn = viewBinding.textCopierBtn
|
let btn = viewBinding.textCopierBtn
|
||||||
@@ -235,8 +187,6 @@ Date.prototype.format = function (tms, format) {
|
|||||||
return format;
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
// new mdui.Drawer('#main-drawer').close()
|
|
||||||
|
|
||||||
class NickCache {
|
class NickCache {
|
||||||
static data = {}
|
static data = {}
|
||||||
static async getNick(name) {
|
static async getNick(name) {
|
||||||
@@ -297,8 +247,6 @@ class 通知 {
|
|||||||
if (localStorage.useNotifications !== "true") return
|
if (localStorage.useNotifications !== "true") return
|
||||||
let n = new Notification(this.title, this.args)
|
let n = new Notification(this.title, this.args)
|
||||||
n.onclick = onclick == null ? () => n.close() : (n) => onclick(n)
|
n.onclick = onclick == null ? () => n.close() : (n) => onclick(n)
|
||||||
// n.onclose = onclose
|
|
||||||
// n.close()
|
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,13 +265,9 @@ class ContactsList {
|
|||||||
for (let index in ls) {
|
for (let index in ls) {
|
||||||
let name = ls[index]
|
let name = ls[index]
|
||||||
let dick = await NickCache.getNick(name)
|
let dick = await NickCache.getNick(name)
|
||||||
/*client.emit("user.getNick", { name: localStorage.userName }, (re) => {
|
$($.parseHTML(`<li class="mdui-list-item mdui-ripple" mdui-drawer-close><div class="mdui-list-item-avatar"><img src="` + User.getUserHeadUrl(name) + `" onerror="this.src='res/default_head.png'" /></div><div class="mdui-list-item-content">` + dick + `</div></li>`)).appendTo(viewBinding.contactsList).click(() => {
|
||||||
let nick = re.data == null ? re.data.nick : null
|
|
||||||
let name = ls[index]*/
|
|
||||||
$($.parseHTML(`<li class="mdui-list-item mdui-ripple"><div class="mdui-list-item-avatar"><img src="` + User.getUserHeadUrl(name) + `" onerror="this.src='res/default_head.png'" /></div><div class="mdui-list-item-content">` + dick + `</div></li>`)).appendTo(viewBinding.contactsList).click(() => {
|
|
||||||
ChatMsgAdapter.switchTo(name, "single")
|
ChatMsgAdapter.switchTo(name, "single")
|
||||||
})
|
})
|
||||||
//})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -339,9 +283,7 @@ class ContactsList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 第一次写前端的消息加载, 代码很乱, 还请原谅~
|
// 消息核心
|
||||||
|
|
||||||
// v0.7.0 大改UI 畏惧了 太庞大了
|
|
||||||
|
|
||||||
class ChatPage {
|
class ChatPage {
|
||||||
static cached = {}
|
static cached = {}
|
||||||
@@ -357,7 +299,6 @@ class ChatPage {
|
|||||||
class ChatMsgAdapter {
|
class ChatMsgAdapter {
|
||||||
static type
|
static type
|
||||||
static target
|
static target
|
||||||
// static msgList
|
|
||||||
static minMsgId
|
static minMsgId
|
||||||
static time
|
static time
|
||||||
static bbn
|
static bbn
|
||||||
@@ -370,7 +311,6 @@ class ChatMsgAdapter {
|
|||||||
|
|
||||||
this.type = type
|
this.type = type
|
||||||
this.target = name
|
this.target = name
|
||||||
// this.msgList = []
|
|
||||||
this.minMsgId = null
|
this.minMsgId = null
|
||||||
|
|
||||||
viewBinding.pageChatSeesion.empty()
|
viewBinding.pageChatSeesion.empty()
|
||||||
@@ -394,7 +334,7 @@ class ChatMsgAdapter {
|
|||||||
// 微机课闲的没事干玩玩 发现私聊会多发一个(一个是本地的, 另一个是发送成功的) 选择一个关掉就好了
|
// 微机课闲的没事干玩玩 发现私聊会多发一个(一个是本地的, 另一个是发送成功的) 选择一个关掉就好了
|
||||||
// 这里我选择服务端不发送回调, 不然多设备同步会吵死
|
// 这里我选择服务端不发送回调, 不然多设备同步会吵死
|
||||||
// 错了 应该是客户端少发条才对 不然不能多设备同步
|
// 错了 应该是客户端少发条才对 不然不能多设备同步
|
||||||
if (ChatMsgAdapter.target !== localStorage.userName && ChatMsgAdapter.type === "single") {
|
if ((ChatMsgAdapter.target !== localStorage.userName) && ChatMsgAdapter.type === "single") {
|
||||||
let i = ChatMsgAdapter.isAtBottom()
|
let i = ChatMsgAdapter.isAtBottom()
|
||||||
await ChatMsgAdapter.addMsg(localStorage.userName, msg, re.data.time, re.data.msgid)
|
await ChatMsgAdapter.addMsg(localStorage.userName, msg, re.data.time, re.data.msgid)
|
||||||
if (i) ChatMsgAdapter.scrollToBottom()
|
if (i) ChatMsgAdapter.scrollToBottom()
|
||||||
@@ -501,63 +441,37 @@ class ChatMsgAdapter {
|
|||||||
|
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
// 添加消息记录 作用在 UI 和 msgList
|
|
||||||
/* static async addMsgLocal(name, m, t, msgid) {
|
|
||||||
this.msgList.push({
|
|
||||||
name: name,
|
|
||||||
msg: m,
|
|
||||||
msgid: msgid,
|
|
||||||
})
|
|
||||||
|
|
||||||
this.addMsg(name, m, t)
|
|
||||||
} */
|
|
||||||
// 从服务器加载一些聊天记录, limit默认=13
|
// 从服务器加载一些聊天记录, limit默认=13
|
||||||
static async loadMsgs(limit) {
|
static async loadMsgs(limit) {
|
||||||
let histroy = await this.getHistroy(this.msgList[0] == null ? null : this.msgList[0].msgid - 1, limit == null ? 13 : limit)
|
let histroy = await this.getHistroy(this.msgList[0] == null ? null : this.msgList[0].msgid - 1, limit == null ? 13 : limit)
|
||||||
this.msgList = histroy
|
this.msgList = histroy
|
||||||
}
|
}
|
||||||
/* static async loadMsgsFromList(lst) {
|
|
||||||
for (let index in lst) {
|
|
||||||
let i = lst[index]
|
|
||||||
await this.addMsg(i.name, i.msg, i.time)
|
|
||||||
}
|
|
||||||
} */
|
|
||||||
static scrollToBottom() {
|
static scrollToBottom() {
|
||||||
// 吐了啊 原来这样就行了 我何必在子element去整啊
|
// 吐了啊 原来这样就行了 我何必在子element去整啊
|
||||||
viewBinding.chatPager.get(0).scrollBy({
|
viewBinding.chatPager.get(0).scrollBy({
|
||||||
top: 1145141919810,
|
top: 1145141919810,
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 从本地加载
|
|
||||||
/*static loadMsgsFromLocal(target) {
|
|
||||||
let data = localStorage["chat_msg_" + target]
|
|
||||||
if (data == null || data === "[]")
|
|
||||||
return []
|
|
||||||
|
|
||||||
return JSON.parse(data)
|
|
||||||
}
|
|
||||||
// 把当前聊天记录储存到本地
|
|
||||||
static saveToLocal() {
|
|
||||||
localStorage["chat_msg_" + this.target] = JSON.stringify(this.msgList)
|
|
||||||
}*/
|
|
||||||
// 自动调整使输入框置底 CSS真tm靠不住啊
|
// 自动调整使输入框置底 CSS真tm靠不住啊
|
||||||
static initInputResizer() {
|
static initInputResizer() {
|
||||||
// 实验表面移动端切出输入法时会触发1-2次resize事件
|
// 实验表面移动端切出输入法时会触发1-2次resize事件
|
||||||
// 可以利用这个特性来实现自动滚动文本
|
// 可以利用这个特性来实现自动滚动文本
|
||||||
let resize = () => {
|
let resize = () => {
|
||||||
viewBinding.pageChatSeesion.height(window.innerHeight - viewBinding.inputToolbar.height() - $("header.mdui-appbar").height() - viewBinding.chatTab.height() - 50)
|
// CSS 牵一发而动全身 因此这个减少的数值是每天都要更改的
|
||||||
|
viewBinding.pageChatSeesion.height(window.innerHeight - viewBinding.inputToolbar.height() - $("header.mdui-appbar").height() - viewBinding.chatTab.height() - 65)
|
||||||
let ledi = this.resizeDick - window.innerHeight
|
let ledi = this.resizeDick - window.innerHeight
|
||||||
if (isMobile()) viewBinding.chatPager.get(0).scrollBy({
|
if (isMobile()) viewBinding.chatPager.get(0).scrollBy({
|
||||||
// 5.19晚10:56分调配出来的秘方
|
// 5.19晚10:56分调配出来的秘方
|
||||||
// < 0 为窗口变大
|
// < 0 为窗口变大
|
||||||
// cnm的,调试十万次就你tm检测不到底是吧,就你语法天天错误是吧
|
// cnm的,调试十万次就你tm检测不到底是吧,就你语法天天错误是吧
|
||||||
// 欺负我现在用不了电脑
|
// 欺负我现在用不了电脑
|
||||||
top: -(ledi) * ( (ledi < 0 && this.isAtBottom()) ? 6 : -1 ), // (ledi < 0 ? 6 : 6),
|
top: -(ledi) * ((ledi < 0 && this.isAtBottom()) ? 6 : -1), // (ledi < 0 ? 6 : 6),
|
||||||
behavior: 'smooth'
|
behavior: 'smooth'
|
||||||
})
|
})
|
||||||
this.resizeDick = window.innerHeight
|
this.resizeDick = window.innerHeight
|
||||||
}
|
}
|
||||||
|
window.initInputResizerResize = resize
|
||||||
window.addEventListener("resize", resize)
|
window.addEventListener("resize", resize)
|
||||||
resize()
|
resize()
|
||||||
}
|
}
|
||||||
@@ -602,11 +516,13 @@ class ChatMsgAdapter {
|
|||||||
callback(self)
|
callback(self)
|
||||||
break
|
break
|
||||||
case 'mousedown':
|
case 'mousedown':
|
||||||
|
if (!isMobile()) return
|
||||||
listeners[self + ""] = setTimeout(() => {
|
listeners[self + ""] = setTimeout(() => {
|
||||||
callback(self)
|
callback(self)
|
||||||
}, 300) // 300颗够吗 应该够吧
|
}, 300) // 300颗够吗 应该够吧
|
||||||
break
|
break
|
||||||
case 'mouseup':
|
case 'mouseup':
|
||||||
|
if (!isMobile()) return
|
||||||
clearTimeout(listeners[self + ""])
|
clearTimeout(listeners[self + ""])
|
||||||
listeners[self + ""] = null
|
listeners[self + ""] = null
|
||||||
break
|
break
|
||||||
@@ -727,11 +643,13 @@ class User {
|
|||||||
if (i) ChatMsgAdapter.scrollToBottom()
|
if (i) ChatMsgAdapter.scrollToBottom()
|
||||||
}
|
}
|
||||||
|
|
||||||
let n = new 通知().setTitle("新消息 - " + await NickCache.getNick(a.target)).setMessage(a.msg.msg).setIcon(User.getUserHeadUrl(a.target)).show(async () => {
|
if (ChatMsgAdapter.target !== localStorage.userName) {
|
||||||
await ChatMsgAdapter.switchTo(a.target, a.type)
|
let n = new 通知().setTitle("" + await NickCache.getNick(a.target)).setMessage(a.msg.msg).setIcon(User.getUserHeadUrl(a.target)).show(async () => {
|
||||||
location.replace("#msgid_" + a.msg.msgid)
|
await ChatMsgAdapter.switchTo(a.target, a.type)
|
||||||
n.close()
|
location.replace("#msgid_" + a.msg.msgid)
|
||||||
})
|
n.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
static async openProfileDialog(name) {
|
static async openProfileDialog(name) {
|
||||||
@@ -6,9 +6,12 @@
|
|||||||
|
|
||||||
/* 美化UI */
|
/* 美化UI */
|
||||||
|
|
||||||
|
/* 恢复系统字体 */
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, system-ui, -webkit-system-font;
|
font-family: -apple-system, system-ui, -webkit-system-font;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 圆角化 */
|
||||||
.mdui-dialog {
|
.mdui-dialog {
|
||||||
border-radius: 23px;
|
border-radius: 23px;
|
||||||
}
|
}
|
||||||
@@ -34,7 +37,7 @@ body {
|
|||||||
.mdui-select-open {
|
.mdui-select-open {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
@media not screen and (min-width: 768px) {
|
@media screen and (min-width: 768px) {
|
||||||
.mdui-snackbar {
|
.mdui-snackbar {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
@@ -42,10 +45,14 @@ body {
|
|||||||
|
|
||||||
/* 配色方案 */
|
/* 配色方案 */
|
||||||
|
|
||||||
.mdui-theme-color-auto {
|
.mdui-list-item-avatar {
|
||||||
background-color: #fff;
|
background-color: rgba(0, 0, 0, 0) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 背景底色 */
|
||||||
|
.mdui-theme-color-auto {
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
}
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
.mdui-theme-color-auto {
|
.mdui-theme-color-auto {
|
||||||
background-color: #303030;
|
background-color: #303030;
|
||||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
797
package-lock.json
generated
797
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "lingchair",
|
"name": "lingchair",
|
||||||
"description": "A simple, lightweight and powerful Instant Messaging application.",
|
"description": "A simple, lightweight and powerful Instant Messaging application.",
|
||||||
"version": "0.6.1",
|
"version": "0.7.0",
|
||||||
"license": "Apache License 2.0",
|
"license": "Apache License 2.0",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "MoonLeeeaf",
|
"name": "MoonLeeeaf",
|
||||||
@@ -11,7 +11,8 @@
|
|||||||
"start": "node ./server_src/main.js"
|
"start": "node ./server_src/main.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mime": "^4.0.1",
|
"express": "^4.19.2",
|
||||||
|
"sharp": "^0.33.4",
|
||||||
"socket.io": "^4.7.5"
|
"socket.io": "^4.7.5"
|
||||||
},
|
},
|
||||||
"type": "commonjs"
|
"type": "commonjs"
|
||||||
|
|||||||
11
run_build.sh
11
run_build.sh
@@ -1,11 +0,0 @@
|
|||||||
# 复制资源文件,这些文件不需要编译
|
|
||||||
mkdir -p ling_chair_http
|
|
||||||
cp -r client_src/* build_cache/
|
|
||||||
|
|
||||||
# 向前兼容脚本
|
|
||||||
cd babel_lib
|
|
||||||
node node_modules/@babel/cli/bin/babel ../client_src --out-dir ../build_cache --presets=@babel/env
|
|
||||||
|
|
||||||
# 打包以减小负载
|
|
||||||
cd ../webpack_lib
|
|
||||||
node node_modules/webpack-cli/bin/cli.js --config webpack_config.js
|
|
||||||
@@ -12,7 +12,7 @@ const users = require("./api-users")
|
|||||||
let getSameHashedValue = (a, b) => {
|
let getSameHashedValue = (a, b) => {
|
||||||
let _a = [hash.md5(a) + hash.sha256(a), hash.md5(b) + hash.sha256(b)].sort()
|
let _a = [hash.md5(a) + hash.sha256(a), hash.md5(b) + hash.sha256(b)].sort()
|
||||||
let [_1, _2] = _a
|
let [_1, _2] = _a
|
||||||
return hash.sha256hex(hash.sha256hex(_1) + hash.sha256hex(_2))
|
return hash.sha256(hash.sha256(_1) + hash.sha256(_2))
|
||||||
}
|
}
|
||||||
|
|
||||||
let getSingleChatDir = (a, b) => {
|
let getSingleChatDir = (a, b) => {
|
||||||
|
|||||||
@@ -7,10 +7,8 @@
|
|||||||
const crypto = require("crypto")
|
const crypto = require("crypto")
|
||||||
|
|
||||||
let apis = {
|
let apis = {
|
||||||
sha256: (data) => crypto.createHash("sha256").update(data).digest("base64"),
|
sha256: (data) => crypto.createHash("sha256").update(data).digest("hex"),
|
||||||
md5: (data) => crypto.createHash("md5").update(data).digest("base64"),
|
md5: (data) => crypto.createHash("md5").update(data).digest("hex"),
|
||||||
sha256hex: (data) => crypto.createHash("sha256").update(data).digest("hex"),
|
|
||||||
md5hex: (data) => crypto.createHash("md5").update(data).digest("hex"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = apis
|
module.exports = apis
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ const vals = require("./val")
|
|||||||
const color = require("./color")
|
const color = require("./color")
|
||||||
|
|
||||||
//定义 Http 服务器回调
|
//定义 Http 服务器回调
|
||||||
let httpServerCallback = require("./httpApi")
|
let httpServerCallback = require("./http-api")
|
||||||
|
|
||||||
// 定义 Socket.io 服务器回调
|
// 定义 Socket.io 服务器回调
|
||||||
let wsServerCallback = require("./wsApi")
|
let wsServerCallback = require("./ws-api")
|
||||||
|
|
||||||
let httpServer
|
let httpServer
|
||||||
if (vals.LINGCHAIR_SERVER_CONFIG.useHttps)
|
if (vals.LINGCHAIR_SERVER_CONFIG.useHttps)
|
||||||
|
|||||||
1
webpack_lib/.gitignore
vendored
1
webpack_lib/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
## Webpack
|
|
||||||
|
|
||||||
请从本仓库根目录的 .github 文件夹内找到对应的zip文件,并把 node_modules 解压在此,方可使用
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
const path = require('path')
|
|
||||||
const { BannerPlugin } = require('webpack')
|
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
entry: '../build_cache/index.js',
|
|
||||||
output: {
|
|
||||||
filename: 'index.js',
|
|
||||||
path: path.resolve(__dirname, '../ling_chair_http'),
|
|
||||||
},
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.css$/i,
|
|
||||||
use: ['style-loader', 'css-loader'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user