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,288 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="kiwi-aboutbuffer">
|
|
3
|
+
<h3>{{ b.name }}</h3>
|
|
4
|
+
|
|
5
|
+
<div
|
|
6
|
+
:class="{'kiwi-aboutbuffer-section--closed': closedSections.about}"
|
|
7
|
+
class="kiwi-aboutbuffer-section"
|
|
8
|
+
>
|
|
9
|
+
<h4 @click="toggleSection('about')">
|
|
10
|
+
<i class="fa fa-angle-right" /> {{ $t('about') }}
|
|
11
|
+
</h4>
|
|
12
|
+
<div>
|
|
13
|
+
<p v-if="b.topic" v-html="formattedTopic" />
|
|
14
|
+
<p v-else>{{ $t('no_topic_set') }}</p>
|
|
15
|
+
|
|
16
|
+
<p v-if="b.created_at">
|
|
17
|
+
{{ $t('created_at', { when: new Intl.DateTimeFormat().format(b.created_at) }) }}
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p class="kiwi-aboutbuffer-usercount">
|
|
21
|
+
<a class="u-link " @click="sidebarState.showNicklist()">
|
|
22
|
+
{{ $t('person', {count: Object.keys(b.users || {}).length}) }}
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
:class="{'kiwi-aboutbuffer-section--closed': closedSections.highlights}"
|
|
30
|
+
class="kiwi-aboutbuffer-section"
|
|
31
|
+
>
|
|
32
|
+
<h4 @click="toggleSection('highlights')">
|
|
33
|
+
<i class="fa fa-angle-right" /> {{ $t('highlights') }}
|
|
34
|
+
</h4>
|
|
35
|
+
<div>
|
|
36
|
+
<ul v-if="highlights.length > 0">
|
|
37
|
+
<li
|
|
38
|
+
v-for="msg in highlights"
|
|
39
|
+
:key="msg.id"
|
|
40
|
+
class="kiwi-aboutbuffer-highlight"
|
|
41
|
+
@click="buffer.scrollToMessage(msg.id)"
|
|
42
|
+
>
|
|
43
|
+
{{ msg.nick ? msg.nick + ': ' : '' }}<span v-html="msg.html" />
|
|
44
|
+
</li>
|
|
45
|
+
</ul>
|
|
46
|
+
<p v-else>{{ $t('nobody_mentioned_you') }}</p>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
v-if="areWeAnOp"
|
|
52
|
+
:class="{'kiwi-aboutbuffer-section--closed': closedSections.invite}"
|
|
53
|
+
class="kiwi-aboutbuffer-section"
|
|
54
|
+
>
|
|
55
|
+
<h4 @click="toggleSection('invite')">
|
|
56
|
+
<i class="fa fa-angle-right" /> {{ $t('invite_user') }}
|
|
57
|
+
</h4>
|
|
58
|
+
<div>
|
|
59
|
+
<div class="kiwi-aboutbuffer-invite u-form">
|
|
60
|
+
<input
|
|
61
|
+
v-model="inviteNick"
|
|
62
|
+
type="text"
|
|
63
|
+
class="u-input"
|
|
64
|
+
@keydown="inviteKeyDown"
|
|
65
|
+
>
|
|
66
|
+
<a class="u-button u-button-secondary" @click="inviteUser">
|
|
67
|
+
{{ $t('invite_user') }}
|
|
68
|
+
</a>
|
|
69
|
+
</div>
|
|
70
|
+
<auto-complete
|
|
71
|
+
v-if="invitableUsers.length > 0"
|
|
72
|
+
ref="autocomplete"
|
|
73
|
+
class="kiwi-aboutbuffer-invite-auto-complete"
|
|
74
|
+
items-per-page="5"
|
|
75
|
+
:items="invitableUsers"
|
|
76
|
+
:filter="inviteNick"
|
|
77
|
+
@selected="inviteSelected"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div
|
|
83
|
+
v-for="plugin in pluginUiSections"
|
|
84
|
+
:key="plugin.id"
|
|
85
|
+
:class="{'kiwi-aboutbuffer-section--closed': closedSections[plugin.id]}"
|
|
86
|
+
class="kiwi-aboutbuffer-section"
|
|
87
|
+
>
|
|
88
|
+
<h4 @click="toggleSection(plugin.id)">
|
|
89
|
+
<i class="fa fa-angle-right" /> {{ plugin.title() }}
|
|
90
|
+
</h4>
|
|
91
|
+
<component
|
|
92
|
+
:is="plugin.component"
|
|
93
|
+
:plugin-props="{
|
|
94
|
+
buffer: buffer,
|
|
95
|
+
aboutbuffer: self,
|
|
96
|
+
}"
|
|
97
|
+
v-bind="plugin.props"
|
|
98
|
+
:network="network"
|
|
99
|
+
:buffer="buffer"
|
|
100
|
+
:sidebar-state="sidebarState"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<script>
|
|
107
|
+
|
|
108
|
+
'kiwi public';
|
|
109
|
+
|
|
110
|
+
import GlobalApi from '@/libs/GlobalApi';
|
|
111
|
+
import toHtml from '@/libs/renderers/Html';
|
|
112
|
+
import parseMessage from '@/libs/MessageParser';
|
|
113
|
+
import AutoComplete from './AutoComplete';
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
components: {
|
|
117
|
+
AutoComplete,
|
|
118
|
+
},
|
|
119
|
+
props: ['network', 'buffer', 'sidebarState'],
|
|
120
|
+
data() {
|
|
121
|
+
return {
|
|
122
|
+
self: this,
|
|
123
|
+
pluginUiSections: GlobalApi.singleton().aboutBufferPlugins,
|
|
124
|
+
closedSections: {},
|
|
125
|
+
inviteNick: '',
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
computed: {
|
|
129
|
+
b() {
|
|
130
|
+
return this.buffer || {};
|
|
131
|
+
},
|
|
132
|
+
formattedTopic() {
|
|
133
|
+
let blocks = parseMessage(this.b.topic || '', { extras: false });
|
|
134
|
+
let content = toHtml(blocks);
|
|
135
|
+
return content;
|
|
136
|
+
},
|
|
137
|
+
highlights() {
|
|
138
|
+
// Tap into buffer.message_count to force vuejs to update this function when
|
|
139
|
+
// it changes
|
|
140
|
+
/* eslint-disable no-unused-vars */
|
|
141
|
+
let tmp = this.buffer.message_count;
|
|
142
|
+
return this.buffer.getMessages()
|
|
143
|
+
.filter((m) => m.isHighlight)
|
|
144
|
+
.filter((m) => m.type !== 'traffic')
|
|
145
|
+
.filter((m) => m.type !== 'topic')
|
|
146
|
+
.filter((m) => m.type !== 'mode')
|
|
147
|
+
.filter((m) => m.html)
|
|
148
|
+
.sort((a, b) => b.time - a.time);
|
|
149
|
+
},
|
|
150
|
+
areWeAnOp() {
|
|
151
|
+
return this.buffer.isUserAnOp(this.network.nick);
|
|
152
|
+
},
|
|
153
|
+
invitableUsers() {
|
|
154
|
+
const wantedBuffer = (userBuffer) => userBuffer.buffer.name === this.buffer.name;
|
|
155
|
+
return Object.values(this.network.users)
|
|
156
|
+
.filter((user) => !Object.values(user.buffers).find(wantedBuffer))
|
|
157
|
+
.map((user) => ({ text: user.nick }));
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
methods: {
|
|
161
|
+
toggleSection(section) {
|
|
162
|
+
this.$set(this.closedSections, section, !this.closedSections[section]);
|
|
163
|
+
},
|
|
164
|
+
inviteUser() {
|
|
165
|
+
if (!this.inviteNick) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
this.network.ircClient.invite(this.buffer.name, this.inviteNick);
|
|
169
|
+
this.inviteNick = '';
|
|
170
|
+
},
|
|
171
|
+
inviteSelected(value, item) {
|
|
172
|
+
this.inviteNick = value;
|
|
173
|
+
},
|
|
174
|
+
inviteKeyDown(event) {
|
|
175
|
+
if (event.key === 'Tab') {
|
|
176
|
+
this.$refs.autocomplete.selectCurrentItem();
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
this.$refs.autocomplete.handleOnKeyDown(event);
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<style lang="less">
|
|
186
|
+
|
|
187
|
+
/* Adjust the sidebars width when this component is in view */
|
|
188
|
+
.kiwi-sidebar.kiwi-sidebar-section-about {
|
|
189
|
+
max-width: 300px;
|
|
190
|
+
width: 300px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.kiwi-aboutbuffer {
|
|
194
|
+
overflow-y: auto;
|
|
195
|
+
box-sizing: border-box;
|
|
196
|
+
min-height: 100px;
|
|
197
|
+
margin: auto;
|
|
198
|
+
width: 100%;
|
|
199
|
+
//Padding bottom is needed, otherwise the scrollbar will show on the right side.
|
|
200
|
+
padding-bottom: 1px;
|
|
201
|
+
height: 100%;
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
align-items: flex-start;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.kiwi-aboutbuffer-invite {
|
|
208
|
+
display: flex;
|
|
209
|
+
width: 100%;
|
|
210
|
+
box-sizing: border-box;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.kiwi-aboutbuffer-invite > input {
|
|
214
|
+
flex-grow: 1;
|
|
215
|
+
margin-right: 10px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.kiwi-aboutbuffer-invite-auto-complete {
|
|
219
|
+
position: relative;
|
|
220
|
+
margin-top: 1em;
|
|
221
|
+
bottom: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.kiwi-aboutbuffer-invite-auto-complete .kiwi-autocomplete-item {
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.kiwi-aboutbuffer-highlight {
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.kiwi-aboutbuffer h3 {
|
|
233
|
+
padding: 10px;
|
|
234
|
+
width: 100%;
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.kiwi-aboutbuffer-section {
|
|
239
|
+
display: block;
|
|
240
|
+
width: 100%;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.kiwi-aboutbuffer-section h4 {
|
|
244
|
+
padding: 10px;
|
|
245
|
+
cursor: pointer;
|
|
246
|
+
user-select: none;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.kiwi-aboutbuffer-section h4 i {
|
|
250
|
+
margin-right: 5px;
|
|
251
|
+
transition: transform 0.2s;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.kiwi-aboutbuffer-section--closed h4 i {
|
|
255
|
+
transform: rotate(90deg);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.kiwi-aboutbuffer-section > div {
|
|
259
|
+
padding: 1em;
|
|
260
|
+
transition: max-height 0.2s, padding 0.2s, opacity 0.2s;
|
|
261
|
+
overflow: hidden;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.kiwi-aboutbuffer-section .kiwi-aboutbuffer-usercount {
|
|
265
|
+
text-align: center;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.kiwi-aboutbuffer-section > div p {
|
|
269
|
+
margin: 0 0 1em 0;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.kiwi-aboutbuffer-section > div p:last-of-type {
|
|
273
|
+
margin-bottom: 0;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.kiwi-aboutbuffer-section--closed > div {
|
|
277
|
+
max-height: 0;
|
|
278
|
+
padding: 0;
|
|
279
|
+
opacity: 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
@media screen and (max-width: 769px) {
|
|
283
|
+
.kiwi-sidebar.kiwi-sidebar-section-about {
|
|
284
|
+
width: 100%;
|
|
285
|
+
max-width: 100%;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
</style>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
'kiwi public';
|
|
3
|
+
|
|
4
|
+
import Vue from 'vue';
|
|
5
|
+
|
|
6
|
+
export default Vue.extend({
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
sidebarOpen: false,
|
|
10
|
+
// sidebarSection may contain: '', 'user', 'settings', 'nicklist', 'about', 'component'
|
|
11
|
+
sidebarSection: '',
|
|
12
|
+
sidebarUser: null,
|
|
13
|
+
activeComponent: null,
|
|
14
|
+
activeComponentProps: null,
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
computed: {
|
|
18
|
+
isDrawn() {
|
|
19
|
+
return this.sidebarOpen && this.section() && this.$state.ui.app_width <= 769;
|
|
20
|
+
},
|
|
21
|
+
isOpen() {
|
|
22
|
+
return this.sidebarOpen && this.section() && this.$state.ui.app_width > 769;
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
created() {
|
|
26
|
+
this.listen(this.$state, 'sidebar.component', (component, props) => {
|
|
27
|
+
this.resetSidebarState();
|
|
28
|
+
this.sidebarOpen = !!component;
|
|
29
|
+
this.activeComponent = component;
|
|
30
|
+
this.activeComponentProps = props || {};
|
|
31
|
+
this.sidebarSection = component ? 'component' : '';
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Allow forcing the sidebar open at startup
|
|
35
|
+
this.$nextTick(() => {
|
|
36
|
+
// nextTick is needed because app_width is 0 on created()
|
|
37
|
+
let sidebarDefault = this.$state.setting('sidebarDefault');
|
|
38
|
+
if (sidebarDefault && this.$state.ui.app_width > 769) {
|
|
39
|
+
this.sidebarOpen = true;
|
|
40
|
+
this.sidebarSection = sidebarDefault;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
methods: {
|
|
45
|
+
section() {
|
|
46
|
+
if (!this.sidebarOpen) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let section = this.sidebarSection;
|
|
51
|
+
if (section === 'component') {
|
|
52
|
+
return section;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
let buffer = this.$state.getActiveBuffer();
|
|
56
|
+
if (buffer.isQuery()) {
|
|
57
|
+
// This is a query with only one possible sidebar dont change the current state
|
|
58
|
+
// instead attempt to show the user, this allows channels to show their nicklist
|
|
59
|
+
let user = this.$state.getUser(buffer.getNetwork().id, buffer.name);
|
|
60
|
+
if (user) {
|
|
61
|
+
this.sidebarUser = user;
|
|
62
|
+
return 'user';
|
|
63
|
+
}
|
|
64
|
+
return '';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// The following code is for channels only
|
|
68
|
+
if (!buffer.isChannel()) {
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (section === 'user' && this.sidebarUser) {
|
|
73
|
+
if (buffer.hasNick(this.sidebarUser.nick)) {
|
|
74
|
+
return 'user';
|
|
75
|
+
}
|
|
76
|
+
// This was going to show a user that is not even present in the current channel
|
|
77
|
+
// permantly switch back to nicklist so it does not jump back to user
|
|
78
|
+
// when they switch to a channel with that user
|
|
79
|
+
this.sidebarSection = 'nicklist';
|
|
80
|
+
return this.sidebarSection;
|
|
81
|
+
} else if (section === 'nicklist') {
|
|
82
|
+
return 'nicklist';
|
|
83
|
+
} else if (section === 'settings') {
|
|
84
|
+
return 'settings';
|
|
85
|
+
} else if (section === 'about') {
|
|
86
|
+
return 'about';
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return '';
|
|
90
|
+
},
|
|
91
|
+
resetSidebarState() {
|
|
92
|
+
this.sidebarOpen = false;
|
|
93
|
+
this.sidebarSection = '';
|
|
94
|
+
this.sidebarUser = null;
|
|
95
|
+
this.activeComponent = null;
|
|
96
|
+
this.activeComponentProps = null;
|
|
97
|
+
},
|
|
98
|
+
close() {
|
|
99
|
+
this.resetSidebarState();
|
|
100
|
+
},
|
|
101
|
+
showUser(user) {
|
|
102
|
+
this.resetSidebarState();
|
|
103
|
+
this.sidebarOpen = true;
|
|
104
|
+
this.sidebarUser = user;
|
|
105
|
+
this.sidebarSection = 'user';
|
|
106
|
+
},
|
|
107
|
+
showNicklist() {
|
|
108
|
+
this.resetSidebarState();
|
|
109
|
+
this.sidebarOpen = true;
|
|
110
|
+
this.sidebarSection = 'nicklist';
|
|
111
|
+
},
|
|
112
|
+
showBufferSettings() {
|
|
113
|
+
this.resetSidebarState();
|
|
114
|
+
this.sidebarOpen = true;
|
|
115
|
+
this.sidebarSection = 'settings';
|
|
116
|
+
},
|
|
117
|
+
showAbout() {
|
|
118
|
+
this.resetSidebarState();
|
|
119
|
+
this.sidebarOpen = true;
|
|
120
|
+
this.sidebarSection = 'about';
|
|
121
|
+
},
|
|
122
|
+
toggleUser(user) {
|
|
123
|
+
this.section() === 'user' ?
|
|
124
|
+
this.close() :
|
|
125
|
+
this.showUser(user);
|
|
126
|
+
},
|
|
127
|
+
toggleNicklist() {
|
|
128
|
+
this.section() === 'nicklist' ?
|
|
129
|
+
this.close() :
|
|
130
|
+
this.showNicklist();
|
|
131
|
+
},
|
|
132
|
+
toggleBufferSettings() {
|
|
133
|
+
this.section() === 'settings' ?
|
|
134
|
+
this.close() :
|
|
135
|
+
this.showBufferSettings();
|
|
136
|
+
},
|
|
137
|
+
toggleAbout() {
|
|
138
|
+
this.section() === 'about' ?
|
|
139
|
+
this.close() :
|
|
140
|
+
this.showAbout();
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
</script>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="kiwi-wrap kiwi-wrap-error">
|
|
3
|
+
<h2>Kiwi IRC could not start :(</h2>
|
|
4
|
+
<div>{{ error }}</div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
'kiwi public';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
props: ['error'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style>
|
|
18
|
+
|
|
19
|
+
.kiwi-wrap-error {
|
|
20
|
+
height: 100%;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-align: center;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.kiwi-wrap-error > div {
|
|
26
|
+
margin-top: 0.5em;
|
|
27
|
+
padding: 1em;
|
|
28
|
+
font-size: 1.2em;
|
|
29
|
+
border: 1px solid #b51111;
|
|
30
|
+
background: #ffbaba;
|
|
31
|
+
display: inline-block;
|
|
32
|
+
text-align: left;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
</style>
|