serverless-ircd 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +6 -1
- package/.gitmodules +3 -0
- package/CHANGELOG.md +214 -0
- package/README.md +110 -23
- package/apps/aws-stack/package.json +1 -1
- package/apps/cf-tcp-container/package.json +1 -1
- package/apps/cf-worker/package.json +1 -1
- package/apps/cf-worker/src/origin-allowlist.ts +99 -0
- package/apps/cf-worker/src/worker.ts +89 -9
- package/apps/cf-worker/tests/fixtures/web-dist/app/index.html +18 -0
- package/apps/cf-worker/tests/fixtures/web-dist/index.html +18 -0
- package/apps/cf-worker/tests/origin-allowlist.test.ts +101 -0
- package/apps/cf-worker/tests/smoke.test.ts +28 -2
- package/apps/cf-worker/tests/ws-origin.test.ts +89 -0
- package/apps/cf-worker/wrangler.test.toml +23 -0
- package/apps/cf-worker/wrangler.toml +54 -0
- package/apps/local-cli/package.json +1 -1
- package/apps/web/landing/index.html +217 -0
- package/apps/web/package.json +28 -0
- package/apps/web/scripts/build.mjs +125 -0
- package/apps/web/src/build-env.ts +43 -0
- package/apps/web/src/config-schema.ts +138 -0
- package/apps/web/static/config.json +28 -0
- package/apps/web/static/config.prod.json +28 -0
- package/apps/web/static/config.staging.json +28 -0
- package/apps/web/tests/build-env.test.ts +63 -0
- package/apps/web/tests/build-smoke.test.ts +103 -0
- package/apps/web/tests/config-schema.test.ts +432 -0
- package/apps/web/tests/workspace.test.ts +12 -0
- package/apps/web/tsconfig.json +10 -0
- package/apps/web/upstream/.browserslistrc +3 -0
- package/apps/web/upstream/.editorconfig +9 -0
- package/apps/web/upstream/.eslintignore +3 -0
- package/apps/web/upstream/.eslintrc.js +90 -0
- package/apps/web/upstream/.github/FUNDING.yml +12 -0
- package/apps/web/upstream/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/apps/web/upstream/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/apps/web/upstream/.github/workflows/push.yml +26 -0
- package/apps/web/upstream/.github/workflows/release.yml +33 -0
- package/apps/web/upstream/.github/workflows/release_manual.yml +55 -0
- package/apps/web/upstream/.prettierrc.js +9 -0
- package/apps/web/upstream/.stylelintignore +5 -0
- package/apps/web/upstream/.stylelintrc.js +21 -0
- package/apps/web/upstream/LICENSE +201 -0
- package/apps/web/upstream/README.md +76 -0
- package/apps/web/upstream/babel.config.js +25 -0
- package/apps/web/upstream/crowdin.yml +3 -0
- package/apps/web/upstream/index.html +35 -0
- package/apps/web/upstream/jest.config.js +7 -0
- package/apps/web/upstream/jsdoc.json +22 -0
- package/apps/web/upstream/package.json +80 -0
- package/apps/web/upstream/scripts/pre-commit +43 -0
- package/apps/web/upstream/src/components/App.vue +516 -0
- package/apps/web/upstream/src/components/AppSettings.vue +587 -0
- package/apps/web/upstream/src/components/AutoComplete.vue +284 -0
- package/apps/web/upstream/src/components/Avatar.vue +105 -0
- package/apps/web/upstream/src/components/AwayStatusIndicator.vue +77 -0
- package/apps/web/upstream/src/components/BufferKey.vue +121 -0
- package/apps/web/upstream/src/components/BufferSettings.vue +97 -0
- package/apps/web/upstream/src/components/Captcha.vue +85 -0
- package/apps/web/upstream/src/components/ChannelBanlist.vue +96 -0
- package/apps/web/upstream/src/components/ChannelInfo.vue +159 -0
- package/apps/web/upstream/src/components/ChannelInvitelist.vue +276 -0
- package/apps/web/upstream/src/components/ChannelList.vue +345 -0
- package/apps/web/upstream/src/components/Container.vue +401 -0
- package/apps/web/upstream/src/components/ContainerHeader.vue +522 -0
- package/apps/web/upstream/src/components/ControlInput.vue +1016 -0
- package/apps/web/upstream/src/components/LoadingAnimation.vue +104 -0
- package/apps/web/upstream/src/components/MediaViewer.vue +199 -0
- package/apps/web/upstream/src/components/MessageInfo.vue +192 -0
- package/apps/web/upstream/src/components/MessageList.vue +1028 -0
- package/apps/web/upstream/src/components/MessageListAvatar.vue +20 -0
- package/apps/web/upstream/src/components/MessageListMessageCompact.vue +361 -0
- package/apps/web/upstream/src/components/MessageListMessageInline.vue +257 -0
- package/apps/web/upstream/src/components/MessageListMessageModern.vue +430 -0
- package/apps/web/upstream/src/components/NetworkSettings.vue +528 -0
- package/apps/web/upstream/src/components/Nicklist.vue +309 -0
- package/apps/web/upstream/src/components/NicklistUser.vue +181 -0
- package/apps/web/upstream/src/components/NotConnected.vue +271 -0
- package/apps/web/upstream/src/components/SelfUser.vue +283 -0
- package/apps/web/upstream/src/components/ServerSelector.vue +162 -0
- package/apps/web/upstream/src/components/ServerView.vue +126 -0
- package/apps/web/upstream/src/components/SettingsAdvanced.vue +232 -0
- package/apps/web/upstream/src/components/SettingsAliases.vue +121 -0
- package/apps/web/upstream/src/components/Sidebar.vue +429 -0
- package/apps/web/upstream/src/components/SidebarAboutBuffer.vue +288 -0
- package/apps/web/upstream/src/components/SidebarState.vue +145 -0
- package/apps/web/upstream/src/components/StartupError.vue +35 -0
- package/apps/web/upstream/src/components/StateBrowser.vue +420 -0
- package/apps/web/upstream/src/components/StateBrowserBuffer.vue +124 -0
- package/apps/web/upstream/src/components/StateBrowserNetwork.vue +823 -0
- package/apps/web/upstream/src/components/StateBrowserUsermenu.vue +162 -0
- package/apps/web/upstream/src/components/TypingStatusIndicator.vue +34 -0
- package/apps/web/upstream/src/components/TypingUsersList.vue +56 -0
- package/apps/web/upstream/src/components/UrlEmbed.vue +149 -0
- package/apps/web/upstream/src/components/UserBox.vue +728 -0
- package/apps/web/upstream/src/components/inputtools/Emoji.vue +67 -0
- package/apps/web/upstream/src/components/inputtools/TextStyle.vue +142 -0
- package/apps/web/upstream/src/components/startups/CommonLayout.vue +208 -0
- package/apps/web/upstream/src/components/startups/CustomServer.vue +495 -0
- package/apps/web/upstream/src/components/startups/KiwiBnc.vue +361 -0
- package/apps/web/upstream/src/components/startups/Personal.vue +317 -0
- package/apps/web/upstream/src/components/startups/Welcome.vue +544 -0
- package/apps/web/upstream/src/components/startups/ZncLogin.vue +229 -0
- package/apps/web/upstream/src/components/utils/InputConfirm.vue +68 -0
- package/apps/web/upstream/src/components/utils/InputPrompt.vue +118 -0
- package/apps/web/upstream/src/components/utils/InputText.vue +172 -0
- package/apps/web/upstream/src/components/utils/IrcInput.vue +579 -0
- package/apps/web/upstream/src/components/utils/PluginWrapper.vue +26 -0
- package/apps/web/upstream/src/components/utils/TabbedView.vue +149 -0
- package/apps/web/upstream/src/components/utils/TransitionExpand.vue +97 -0
- package/apps/web/upstream/src/helpers/Colours.js +128 -0
- package/apps/web/upstream/src/helpers/IrcdDiffs.js +26 -0
- package/apps/web/upstream/src/helpers/Md5.js +193 -0
- package/apps/web/upstream/src/helpers/Misc.js +401 -0
- package/apps/web/upstream/src/helpers/TextFormatting.js +237 -0
- package/apps/web/upstream/src/libs/AliasRewriter.js +157 -0
- package/apps/web/upstream/src/libs/AudioManager.js +60 -0
- package/apps/web/upstream/src/libs/BouncerMiddleware.js +247 -0
- package/apps/web/upstream/src/libs/BouncerProvider.js +551 -0
- package/apps/web/upstream/src/libs/ChathistoryMiddleware.js +153 -0
- package/apps/web/upstream/src/libs/ConfigLoader.js +94 -0
- package/apps/web/upstream/src/libs/EmojiProvider.js +46 -0
- package/apps/web/upstream/src/libs/GlobalApi.js +346 -0
- package/apps/web/upstream/src/libs/IPC.js +51 -0
- package/apps/web/upstream/src/libs/InputHandler.js +921 -0
- package/apps/web/upstream/src/libs/IrcClient.js +1506 -0
- package/apps/web/upstream/src/libs/Logger.js +71 -0
- package/apps/web/upstream/src/libs/Message.js +169 -0
- package/apps/web/upstream/src/libs/MessageFormatter.js +364 -0
- package/apps/web/upstream/src/libs/MessageParser.js +249 -0
- package/apps/web/upstream/src/libs/Notifications.js +78 -0
- package/apps/web/upstream/src/libs/ServerConnection.js +270 -0
- package/apps/web/upstream/src/libs/ServerSession.js +102 -0
- package/apps/web/upstream/src/libs/SoundBleep.js +20 -0
- package/apps/web/upstream/src/libs/StatePersistence.js +90 -0
- package/apps/web/upstream/src/libs/ThemeManager.js +128 -0
- package/apps/web/upstream/src/libs/TypingMiddleware.js +105 -0
- package/apps/web/upstream/src/libs/WindowTitle.js +63 -0
- package/apps/web/upstream/src/libs/batchedAdd.js +74 -0
- package/apps/web/upstream/src/libs/bufferTools.js +177 -0
- package/apps/web/upstream/src/libs/polyfill/Element.closest.js +18 -0
- package/apps/web/upstream/src/libs/renderers/Html.js +113 -0
- package/apps/web/upstream/src/libs/settingTools.js +31 -0
- package/apps/web/upstream/src/libs/state/BufferState.js +703 -0
- package/apps/web/upstream/src/libs/state/NetworkState.js +158 -0
- package/apps/web/upstream/src/libs/state/UserState.js +89 -0
- package/apps/web/upstream/src/libs/state/common.js +26 -0
- package/apps/web/upstream/src/libs/state.js +961 -0
- package/apps/web/upstream/src/libs/storage/Local.js +51 -0
- package/apps/web/upstream/src/main.js +566 -0
- package/apps/web/upstream/src/res/autocompleteCommands.js +31 -0
- package/apps/web/upstream/src/res/configTemplates.js +373 -0
- package/apps/web/upstream/src/res/globalStyle.css +277 -0
- package/apps/web/upstream/src/res/kiwiLoadingLogo.png +0 -0
- package/apps/web/upstream/src/res/locales/app.af-ZA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ar-SA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.bg-BG.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.bs-BA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ca-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.cs-CZ.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.da-DK.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.de-DE.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.dev.po +1246 -0
- package/apps/web/upstream/src/res/locales/app.el-GR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.en-US.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-419.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-AR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-EM.po +536 -0
- package/apps/web/upstream/src/res/locales/app.es-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.es-US.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.eu-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.fi-FI.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.fr-FR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.gl-ES.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.he-IL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.hi-IN.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.hu-HU.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.id-ID.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.it-IT.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ja-JP.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ko-KR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.nl-NL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.no-NO.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.pl-PL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.pt-BR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.pt-PT.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ro-RO.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.ru-RU.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sl-SI.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sq-AL.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sr-SP.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.sv-SE.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.tr-TR.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.uk-UA.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.vi-VN.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.zh-CN.po +1145 -0
- package/apps/web/upstream/src/res/locales/app.zh-TW.po +1145 -0
- package/apps/web/upstream/src/res/localesList.json +27 -0
- package/apps/web/upstream/src/res/logo.png +0 -0
- package/apps/web/upstream/src/thirdparty/about.html +43 -0
- package/apps/web/upstream/src/thirdparty/index.js +5 -0
- package/apps/web/upstream/src/thirdparty/kiwiirccom.vue +185 -0
- package/apps/web/upstream/static/config.json +28 -0
- package/apps/web/upstream/static/emoticons/smile.png +0 -0
- package/apps/web/upstream/static/favicon.png +0 -0
- package/apps/web/upstream/static/highlight.mp3 +0 -0
- package/apps/web/upstream/static/highlight.ogg +0 -0
- package/apps/web/upstream/static/locales/.gitignore +2 -0
- package/apps/web/upstream/static/plugins/customise.html.example +10 -0
- package/apps/web/upstream/static/themes/coffee/theme.css +145 -0
- package/apps/web/upstream/static/themes/common/base.css +1064 -0
- package/apps/web/upstream/static/themes/dark/theme.css +196 -0
- package/apps/web/upstream/static/themes/default/theme.css +92 -0
- package/apps/web/upstream/static/themes/elite/theme.css +248 -0
- package/apps/web/upstream/static/themes/grayfox/theme.css +143 -0
- package/apps/web/upstream/static/themes/nightswatch/theme.css +367 -0
- package/apps/web/upstream/static/themes/osprey/theme.css +115 -0
- package/apps/web/upstream/static/themes/radioactive/theme.css +1211 -0
- package/apps/web/upstream/static/themes/sky/theme.css +107 -0
- package/apps/web/upstream/tests/unit/BatchAdd.spec.js +174 -0
- package/apps/web/upstream/tests/unit/MessageParser.spec.js +125 -0
- package/apps/web/upstream/tests/unit/Misc.spec.js +24 -0
- package/apps/web/upstream/tests/unit/NetworkState.spec.js +58 -0
- package/apps/web/upstream/tests/unit/StartupError.spec.js +20 -0
- package/apps/web/upstream/vue.config.js +150 -0
- package/apps/web/upstream/yarn.lock +9767 -0
- package/apps/web/vitest.config.ts +13 -0
- package/biome.json +1 -0
- package/docs/Home.md +1 -0
- package/docs/WebClientGuide.md +535 -0
- package/package.json +2 -2
- package/packages/aws-adapter/package.json +1 -1
- package/packages/cf-adapter/package.json +1 -1
- package/packages/cf-adapter/tests/cf-harness.ts +12 -1
- package/packages/in-memory-runtime/package.json +1 -1
- package/packages/irc-core/package.json +1 -1
- package/packages/irc-core/reports/mutation/mutation.html +342 -0
- package/packages/irc-core/tests/batch.test.ts +15 -0
- package/packages/irc-core/tests/numerics.test.ts +13 -0
- package/packages/irc-core/tests/parser.test.ts +109 -0
- package/packages/irc-server/package.json +1 -1
- package/packages/irc-test-support/package.json +1 -1
- package/packages/irc-test-support/src/scenarios.ts +24 -2
- package/tools/ci-hardening/package.json +1 -1
- package/tools/load-test/package.json +1 -1
- package/tools/tcp-ws-forwarder/package.json +1 -1
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="{
|
|
4
|
+
/* 'kiwi-container-' + bufferType: true, */
|
|
5
|
+
'kiwi-container--sidebar-drawn': sidebarState.isDrawn,
|
|
6
|
+
'kiwi-container--sidebar-open': sidebarState.isOpen,
|
|
7
|
+
'kiwi-container--no-sidebar': buffer && buffer.isSpecial,
|
|
8
|
+
}" class="kiwi-container"
|
|
9
|
+
>
|
|
10
|
+
<template v-if="buffer">
|
|
11
|
+
<div class="kiwi-container-toggledraw-statebrowser" @click.stop="toggleStateBrowser">
|
|
12
|
+
<div
|
|
13
|
+
:class="[
|
|
14
|
+
unreadMessages.highlight ?
|
|
15
|
+
'kiwi-container-toggledraw-statebrowser-messagecount--highlight' :
|
|
16
|
+
'',
|
|
17
|
+
]"
|
|
18
|
+
class="kiwi-container-toggledraw-statebrowser-messagecount"
|
|
19
|
+
>
|
|
20
|
+
<span class="kiwi-container-statebrowser-messagecount-alert">
|
|
21
|
+
{{ unreadMessages.count > 999 ? '999+' : unreadMessages.count }}
|
|
22
|
+
</span>
|
|
23
|
+
<span class="kiwi-container-statebrowser-messagecount-close">
|
|
24
|
+
<i class="fa fa-times" aria-hidden="true" />
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<container-header :buffer="buffer" :sidebar-state="sidebarState" />
|
|
29
|
+
|
|
30
|
+
<slot name="before" />
|
|
31
|
+
|
|
32
|
+
<not-connected
|
|
33
|
+
v-if="buffer.getNetwork().state !== 'connected' && !buffer.isServer()"
|
|
34
|
+
:buffer="buffer"
|
|
35
|
+
:network="buffer.getNetwork()"
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
<div class="kiwi-container-content">
|
|
39
|
+
<template v-if="buffer.isServer()">
|
|
40
|
+
<server-view :network="network" />
|
|
41
|
+
</template>
|
|
42
|
+
<template v-else>
|
|
43
|
+
<message-list :buffer="buffer" />
|
|
44
|
+
<sidebar
|
|
45
|
+
v-if="!buffer.isSpecial()"
|
|
46
|
+
:network="network"
|
|
47
|
+
:buffer="buffer"
|
|
48
|
+
:sidebar-state="sidebarState"
|
|
49
|
+
/>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<slot name="after" />
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
<template v-else>
|
|
56
|
+
<div class="kiwi-container-empty">
|
|
57
|
+
<h4>{{ $t('container_welcome') }}</h4>
|
|
58
|
+
<a class="u-button" @click.stop="toggleStateBrowser">
|
|
59
|
+
{{ $t('container_statebrowser') }}
|
|
60
|
+
</a>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script>
|
|
67
|
+
'kiwi public';
|
|
68
|
+
|
|
69
|
+
import ContainerHeader from './ContainerHeader';
|
|
70
|
+
import Sidebar from './Sidebar';
|
|
71
|
+
import NotConnected from './NotConnected';
|
|
72
|
+
import MessageList from './MessageList';
|
|
73
|
+
import ServerView from './ServerView';
|
|
74
|
+
|
|
75
|
+
export default {
|
|
76
|
+
components: {
|
|
77
|
+
ContainerHeader,
|
|
78
|
+
Sidebar,
|
|
79
|
+
NotConnected,
|
|
80
|
+
MessageList,
|
|
81
|
+
ServerView,
|
|
82
|
+
},
|
|
83
|
+
props: ['network', 'buffer', 'sidebarState'],
|
|
84
|
+
data: function data() {
|
|
85
|
+
return {
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
computed: {
|
|
89
|
+
bufferType: function bufferType() {
|
|
90
|
+
let type = '';
|
|
91
|
+
|
|
92
|
+
if (!this.buffer) {
|
|
93
|
+
type = 'none';
|
|
94
|
+
} else if (this.buffer.isServer()) {
|
|
95
|
+
type = 'server';
|
|
96
|
+
} else if (this.buffer.isChannel()) {
|
|
97
|
+
type = 'channel';
|
|
98
|
+
} else if (this.buffer.isQuery()) {
|
|
99
|
+
type = 'query';
|
|
100
|
+
}
|
|
101
|
+
return type;
|
|
102
|
+
},
|
|
103
|
+
unreadMessages() {
|
|
104
|
+
let count = 0;
|
|
105
|
+
let highlight = false;
|
|
106
|
+
this.$state.networks.forEach((network) => {
|
|
107
|
+
network.buffers.forEach((buffer) => {
|
|
108
|
+
count += (buffer.flags.unread || 0);
|
|
109
|
+
if (buffer.flags.highlight) {
|
|
110
|
+
highlight = true;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
return { count, highlight };
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
created: function created() {
|
|
118
|
+
this.listen(this.$state, 'sidebar.toggle', () => {
|
|
119
|
+
this.$state.$emit('sidebar.' + (this.sidebarState.isDrawn ? 'hide' : 'show'));
|
|
120
|
+
});
|
|
121
|
+
this.listen(this.$state, 'sidebar.show', () => {
|
|
122
|
+
this.sidebarState.showNicklist();
|
|
123
|
+
});
|
|
124
|
+
this.listen(this.$state, 'sidebar.hide', () => {
|
|
125
|
+
this.sidebarState.close();
|
|
126
|
+
});
|
|
127
|
+
this.listen(this.$state, 'userbox.show', (user, opts) => {
|
|
128
|
+
this.sidebarState.showUser(user);
|
|
129
|
+
});
|
|
130
|
+
this.listen(this.$state, 'userbox.hide', () => {
|
|
131
|
+
this.sidebarState.close();
|
|
132
|
+
});
|
|
133
|
+
this.listen(this.$state, 'document.keydown', (ev) => {
|
|
134
|
+
// Return if not Page Up or Page Down keys
|
|
135
|
+
if (ev.keyCode !== 33 && ev.keyCode !== 34) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// if no messagelist, select the first tabbed content to allow channel list scrolling
|
|
140
|
+
let messageList = this.$el.querySelector('.kiwi-messagelist') ||
|
|
141
|
+
this.$el.querySelector('.u-tabbed-content');
|
|
142
|
+
|
|
143
|
+
if (!messageList) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Fix for chrome issue breaking layout when page up/down is pressed while inside
|
|
148
|
+
// contenteditible or inputbox
|
|
149
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=890248
|
|
150
|
+
ev.preventDefault();
|
|
151
|
+
|
|
152
|
+
let scrollDistance = messageList.clientHeight - (0.1 * messageList.clientHeight);
|
|
153
|
+
let scrollTop = messageList.scrollTop;
|
|
154
|
+
let scrollMax = messageList.scrollHeight;
|
|
155
|
+
|
|
156
|
+
if (ev.keyCode === 33) {
|
|
157
|
+
// up
|
|
158
|
+
scrollTop -= scrollDistance;
|
|
159
|
+
if (scrollTop < 0) {
|
|
160
|
+
scrollTop = 0;
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
// down
|
|
164
|
+
scrollTop += scrollDistance;
|
|
165
|
+
if (scrollTop > scrollMax) {
|
|
166
|
+
scrollTop = scrollMax;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
messageList.scrollTop = scrollTop;
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
methods: {
|
|
174
|
+
toggleStateBrowser: function toggleStateBrowser() {
|
|
175
|
+
this.$state.$emit('statebrowser.toggle');
|
|
176
|
+
},
|
|
177
|
+
toggleSidebar: function toggleSidebar() {
|
|
178
|
+
if (this.buffer.isChannel()) {
|
|
179
|
+
this.$state.$emit('sidebar.toggle');
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<style>
|
|
187
|
+
.kiwi-container {
|
|
188
|
+
box-sizing: border-box;
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* When the sidebar is open we will put a shadow over the text area */
|
|
194
|
+
.kiwi-header {
|
|
195
|
+
z-index: 2;
|
|
196
|
+
|
|
197
|
+
/* IE 11 breaks when using the shorthand flex syntax here */
|
|
198
|
+
flex-grow: 0;
|
|
199
|
+
flex-shrink: 1;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.kiwi-sidebar {
|
|
203
|
+
position: absolute;
|
|
204
|
+
right: -443px;
|
|
205
|
+
top: 45px; /* Push the top over the top page border */
|
|
206
|
+
bottom: 0;
|
|
207
|
+
width: 443px;
|
|
208
|
+
max-width: 443px;
|
|
209
|
+
z-index: 3;
|
|
210
|
+
transition: right 0.2s, width 0.2s;
|
|
211
|
+
flex: 1;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.kiwi-container--sidebar-drawn .kiwi-sidebar {
|
|
215
|
+
right: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.kiwi-container--sidebar-open .kiwi-sidebar {
|
|
219
|
+
right: 0;
|
|
220
|
+
top: 0;
|
|
221
|
+
flex: 1;
|
|
222
|
+
position: relative;
|
|
223
|
+
border-left-width: 1px;
|
|
224
|
+
border-left-style: solid;
|
|
225
|
+
max-width: 430px;
|
|
226
|
+
z-index: 1;
|
|
227
|
+
transition: right 0.2s, top 0s;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.kiwi-container-content {
|
|
231
|
+
flex: 1;
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: row;
|
|
234
|
+
overflow: hidden;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.kiwi-messagelist {
|
|
238
|
+
flex: 1;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.kiwi-serverview {
|
|
242
|
+
flex: 1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.kiwi-container--no-sidebar .kiwi-header,
|
|
246
|
+
.kiwi-container--no-sidebar .kiwi-messagelist {
|
|
247
|
+
margin-right: 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.kiwi-container-toggledraw-statebrowser,
|
|
251
|
+
.kiwi-container-toggledraw-sidebar {
|
|
252
|
+
display: none;
|
|
253
|
+
width: 50px;
|
|
254
|
+
position: absolute;
|
|
255
|
+
top: 0;
|
|
256
|
+
height: 45px;
|
|
257
|
+
box-sizing: border-box;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
text-align: center;
|
|
260
|
+
font-size: 1.6em;
|
|
261
|
+
line-height: 50px;
|
|
262
|
+
transition: left 2s;
|
|
263
|
+
transition-delay: 0.5s;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.kiwi-container-toggledraw-statebrowser {
|
|
267
|
+
left: 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.kiwi-container-toggledraw-sidebar {
|
|
271
|
+
right: 0;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.kiwi-container-toggledraw-sidebar--disabled {
|
|
275
|
+
cursor: default;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.kiwi-container-toggledraw-statebrowser-messagecount {
|
|
279
|
+
position: absolute;
|
|
280
|
+
font-size: 0.6em;
|
|
281
|
+
border-radius: 3px;
|
|
282
|
+
line-height: 2em;
|
|
283
|
+
box-sizing: border-box;
|
|
284
|
+
top: 10px;
|
|
285
|
+
z-index: 3;
|
|
286
|
+
white-space: nowrap;
|
|
287
|
+
left: 14px;
|
|
288
|
+
width: 37px;
|
|
289
|
+
padding: 0;
|
|
290
|
+
transition: all 0.4s, z-index 0s;
|
|
291
|
+
transition-delay: 0.1s;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.kiwi-container-toggledraw-statebrowser-messagecount::after {
|
|
295
|
+
left: -15px;
|
|
296
|
+
top: 20%;
|
|
297
|
+
border: 0.6em solid transparent;
|
|
298
|
+
border-right-color: #ddd;
|
|
299
|
+
content: ' ';
|
|
300
|
+
height: 0;
|
|
301
|
+
width: 0;
|
|
302
|
+
position: absolute;
|
|
303
|
+
pointer-events: none;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.kiwi-container-statebrowser-messagecount-close {
|
|
307
|
+
display: none;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* When the Statebrowser is visible, apply new styles to the messagecount */
|
|
311
|
+
.kiwi-wrap--statebrowser-drawopen .kiwi-container-toggledraw-statebrowser-messagecount {
|
|
312
|
+
left: -19px;
|
|
313
|
+
z-index: 100;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.kiwi-wrap--statebrowser-drawopen .kiwi-container-toggledraw-statebrowser-messagecount::after {
|
|
317
|
+
right: -15px;
|
|
318
|
+
left: auto;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@keyframes kiwi-wiggle {
|
|
322
|
+
0% { margin-left: 5px; }
|
|
323
|
+
50% { margin-left: 0; }
|
|
324
|
+
100% { margin-left: 5px; }
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.kiwi-container-toggledraw-statebrowser-messagecount--highlight {
|
|
328
|
+
animation: kiwi-wiggle 0.25s 4;
|
|
329
|
+
animation-timing-function: ease-in, linear, ease-out;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.kiwi-container-toggledraw-statebrowser-messagecount--highlight:hover {
|
|
333
|
+
animation: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.kiwi-container-empty {
|
|
337
|
+
text-align: center;
|
|
338
|
+
padding: 1em;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.kiwi-container-empty .u-button {
|
|
342
|
+
border-radius: 3px;
|
|
343
|
+
font-weight: 500;
|
|
344
|
+
line-height: 50px;
|
|
345
|
+
padding: 0 14px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.kiwi-wrap .kiwi-container::after {
|
|
349
|
+
content: '';
|
|
350
|
+
position: absolute;
|
|
351
|
+
left: auto;
|
|
352
|
+
height: 120%;
|
|
353
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
354
|
+
top: 0;
|
|
355
|
+
opacity: 0;
|
|
356
|
+
z-index: 99;
|
|
357
|
+
width: 0%;
|
|
358
|
+
right: -100%;
|
|
359
|
+
transition: opacity 0.1s;
|
|
360
|
+
transition-delay: opacity 0.1s;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@media screen and (max-width: 1500px) {
|
|
364
|
+
.kiwi-container--sidebar-open .kiwi-sidebar {
|
|
365
|
+
max-width: 350px;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
@media screen and (max-width: 769px) {
|
|
370
|
+
.kiwi-wrap--statebrowser-drawopen .kiwi-container-statebrowser-messagecount-alert {
|
|
371
|
+
display: none;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.kiwi-wrap--statebrowser-drawopen .kiwi-container-statebrowser-messagecount-close {
|
|
375
|
+
display: block;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.kiwi-wrap--statebrowser-drawopen .kiwi-container::after {
|
|
379
|
+
top: 0;
|
|
380
|
+
opacity: 1;
|
|
381
|
+
width: 100%;
|
|
382
|
+
right: 0%;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.kiwi-header {
|
|
386
|
+
margin-left: 50px;
|
|
387
|
+
margin-right: 50px;
|
|
388
|
+
max-height: 50px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.kiwi-container-toggledraw-statebrowser,
|
|
392
|
+
.kiwi-container-toggledraw-sidebar {
|
|
393
|
+
display: block;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.kiwi-sidebar {
|
|
397
|
+
top: -4px;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
</style>
|