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,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="kiwi-serverview">
|
|
3
|
+
<div class="kiwi-serverview-inner">
|
|
4
|
+
<tabbed-view ref="tabs" :key="network.id" @changed="tabChanged">
|
|
5
|
+
<tabbed-tab :header="$t('messages')" :focus="hasMessages" name="messages">
|
|
6
|
+
<message-list :buffer="serverBuffer" />
|
|
7
|
+
</tabbed-tab>
|
|
8
|
+
<tabbed-tab
|
|
9
|
+
v-if="!restrictedServer"
|
|
10
|
+
:header="$t('settings')"
|
|
11
|
+
:focus="!hasMessages"
|
|
12
|
+
name="settings"
|
|
13
|
+
>
|
|
14
|
+
<network-settings :network="network" />
|
|
15
|
+
</tabbed-tab>
|
|
16
|
+
<tabbed-tab
|
|
17
|
+
v-if="networkConnected"
|
|
18
|
+
:header="$t('channels')"
|
|
19
|
+
name="channels"
|
|
20
|
+
>
|
|
21
|
+
<channel-list :network="network" />
|
|
22
|
+
</tabbed-tab>
|
|
23
|
+
<tabbed-tab
|
|
24
|
+
v-for="item in pluginUiElements"
|
|
25
|
+
:key="item.id"
|
|
26
|
+
:header="item.title()"
|
|
27
|
+
:name="item.tabName"
|
|
28
|
+
>
|
|
29
|
+
<component
|
|
30
|
+
:is="item.component"
|
|
31
|
+
v-bind="item.props"
|
|
32
|
+
:network="network"
|
|
33
|
+
/>
|
|
34
|
+
</tabbed-tab>
|
|
35
|
+
</tabbed-view>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
'kiwi public';
|
|
42
|
+
|
|
43
|
+
import GlobalApi from '@/libs/GlobalApi';
|
|
44
|
+
import MessageList from './MessageList';
|
|
45
|
+
import NetworkSettings from './NetworkSettings';
|
|
46
|
+
import ChannelList from './ChannelList';
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
components: {
|
|
50
|
+
MessageList,
|
|
51
|
+
NetworkSettings,
|
|
52
|
+
ChannelList,
|
|
53
|
+
},
|
|
54
|
+
props: ['network'],
|
|
55
|
+
data: function data() {
|
|
56
|
+
return {
|
|
57
|
+
pluginUiElements: GlobalApi.singleton().serverViewPlugins,
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
computed: {
|
|
61
|
+
hasMessages() {
|
|
62
|
+
return this.network.serverBuffer().getMessages().length > 0;
|
|
63
|
+
},
|
|
64
|
+
serverBuffer() {
|
|
65
|
+
return this.network.serverBuffer();
|
|
66
|
+
},
|
|
67
|
+
restrictedServer() {
|
|
68
|
+
return this.$state.setting('restricted');
|
|
69
|
+
},
|
|
70
|
+
networkConnected() {
|
|
71
|
+
return this.network.state === 'connected';
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
watch: {
|
|
75
|
+
networkConnected() {
|
|
76
|
+
this.$nextTick(() => {
|
|
77
|
+
// Vue won't update the tabs being displayed here so we to
|
|
78
|
+
// manually update a property to force a re-render of the tabs
|
|
79
|
+
this.$refs.tabs.a++;
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
created() {
|
|
84
|
+
this.listen(this.$state, 'server.tab.show', (tabName) => {
|
|
85
|
+
this.showTab(tabName);
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
showTab(tabName) {
|
|
90
|
+
this.$refs.tabs.setActiveByName(tabName);
|
|
91
|
+
},
|
|
92
|
+
tabChanged(tabName) {
|
|
93
|
+
this.serverBuffer.show_input = (tabName === 'messages');
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style>
|
|
100
|
+
|
|
101
|
+
.kiwi-serverview {
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
position: relative;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.kiwi-serverview .kiwi-messagelist {
|
|
108
|
+
padding-top: 0;
|
|
109
|
+
height: 100%;
|
|
110
|
+
margin: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.kiwi-serverview-inner {
|
|
114
|
+
/* Mobile safari can't work out the height for scrolling to work without this wrapper element */
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: 0;
|
|
117
|
+
bottom: 0;
|
|
118
|
+
left: 0;
|
|
119
|
+
right: 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.kiwi-serverview-alerts {
|
|
123
|
+
margin-bottom: 1em;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
</style>
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="kiwi-settings-advanced">
|
|
3
|
+
<div class="kiwi-settings-advanced-notice">{{ $t('settings_advanced_header') }}</div>
|
|
4
|
+
<form class="u-form">
|
|
5
|
+
<div class="kiwi-settings-advanced-filter-container">
|
|
6
|
+
<input
|
|
7
|
+
v-model="filterString"
|
|
8
|
+
:placeholder="$t('settings_advanced_filter')"
|
|
9
|
+
class="u-input"
|
|
10
|
+
>
|
|
11
|
+
<i v-if="!filterString" class="fa fa-search" aria-hidden="true" />
|
|
12
|
+
<i v-else class="fa fa-times" aria-hidden="true" @click="filterString = ''" />
|
|
13
|
+
</div>
|
|
14
|
+
<table class="u-table kiwi-settings-advanced-table" cellspacing="0">
|
|
15
|
+
<tr v-if="filteredSettings.length === 0">
|
|
16
|
+
<td class="kiwi-settings-advanced-noresult">
|
|
17
|
+
{{ filterString }} - {{ $t('not_found') }}
|
|
18
|
+
</td>
|
|
19
|
+
</tr>
|
|
20
|
+
<tr
|
|
21
|
+
v-for="setting in filteredSettings" v-else
|
|
22
|
+
:key="setting.key"
|
|
23
|
+
:class="{'kiwi-advanced-setting': !setting.modified,
|
|
24
|
+
'kiwi-advanced-setting--modified': setting.modified,
|
|
25
|
+
}"
|
|
26
|
+
>
|
|
27
|
+
<td><label :for="'setting-' + setting.key">{{ setting.key }}</label></td>
|
|
28
|
+
<td v-if="setting.modified">
|
|
29
|
+
<a class="u-link" @click="resetValue($event, setting.key)">
|
|
30
|
+
{{ $t('settings_advanced_reset') }}
|
|
31
|
+
<i class="fa fa-undo" style="margin-left: 10px;" />
|
|
32
|
+
</a>
|
|
33
|
+
</td>
|
|
34
|
+
<td v-else />
|
|
35
|
+
<td>
|
|
36
|
+
<input
|
|
37
|
+
v-if="setting.type === 'boolean'"
|
|
38
|
+
:id="'setting-' + setting.key"
|
|
39
|
+
:checked="setting.val"
|
|
40
|
+
type="checkbox"
|
|
41
|
+
@change="updateSetting($event, setting.key)"
|
|
42
|
+
>
|
|
43
|
+
<input
|
|
44
|
+
v-else-if="setting.type === 'number'"
|
|
45
|
+
:id="'setting-' + setting.key"
|
|
46
|
+
:value="setting.val"
|
|
47
|
+
class="u-input"
|
|
48
|
+
type="number"
|
|
49
|
+
@keydown.13="$event.target.blur()"
|
|
50
|
+
@change="updateSetting($event, setting.key)"
|
|
51
|
+
@blur="updateSetting($event, setting.key)"
|
|
52
|
+
>
|
|
53
|
+
<input
|
|
54
|
+
v-else
|
|
55
|
+
:id="'setting-' + setting.key"
|
|
56
|
+
:value="setting.val"
|
|
57
|
+
class="u-input"
|
|
58
|
+
@keydown.13="$event.target.blur()"
|
|
59
|
+
@blur="updateSetting($event, setting.key)"
|
|
60
|
+
>
|
|
61
|
+
</td>
|
|
62
|
+
</tr>
|
|
63
|
+
</table>
|
|
64
|
+
</form>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script>
|
|
69
|
+
'kiwi public';
|
|
70
|
+
|
|
71
|
+
import _ from 'lodash';
|
|
72
|
+
import * as settingTools from '@/libs/settingTools';
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
data: function data() {
|
|
76
|
+
return {
|
|
77
|
+
filterString: '',
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
filteredSettings() {
|
|
82
|
+
let settings = this.settings;
|
|
83
|
+
let filter = this.filterString.toLowerCase();
|
|
84
|
+
let out = [];
|
|
85
|
+
Object.keys(settings).forEach((key) => {
|
|
86
|
+
let value = settings[key];
|
|
87
|
+
if (value.key.toLowerCase().indexOf(filter) !== -1) {
|
|
88
|
+
out.push(value);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return out;
|
|
92
|
+
},
|
|
93
|
+
settings() {
|
|
94
|
+
let out = {};
|
|
95
|
+
let base = [];
|
|
96
|
+
settingTools.buildTree(out, base, this.$state.getSetting('settings'), false);
|
|
97
|
+
settingTools.buildTree(out, base, this.$state.getSetting('user_settings'), true);
|
|
98
|
+
|
|
99
|
+
return _.orderBy(Object.keys(out).map((key) => out[key]), [
|
|
100
|
+
(o) => o.key.split('.').length - 1,
|
|
101
|
+
'key',
|
|
102
|
+
], ['asc']);
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
resetValue(event, settingKey) {
|
|
107
|
+
let newVal = this.$state.getSetting('settings.' + settingKey);
|
|
108
|
+
if (!newVal) {
|
|
109
|
+
newVal = null;
|
|
110
|
+
}
|
|
111
|
+
this.$state.setting(settingKey, newVal);
|
|
112
|
+
},
|
|
113
|
+
updateSetting(event, settingKey) {
|
|
114
|
+
let target = event.target;
|
|
115
|
+
let val = target.type === 'checkbox' ? target.checked : target.value;
|
|
116
|
+
switch (target.type) {
|
|
117
|
+
case 'checkbox':
|
|
118
|
+
val = target.checked;
|
|
119
|
+
break;
|
|
120
|
+
case 'number':
|
|
121
|
+
val = parseInt(target.value, 10);
|
|
122
|
+
break;
|
|
123
|
+
default:
|
|
124
|
+
val = target.value;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
if (this.$state.setting(settingKey) === val) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
this.$state.setting(settingKey, val);
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<style>
|
|
138
|
+
|
|
139
|
+
.kiwi-settings-advanced {
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.kiwi-settings-advanced-table .u-input {
|
|
144
|
+
border-bottom: 2px solid red;
|
|
145
|
+
height: auto;
|
|
146
|
+
margin-top: 10px;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.kiwi-settings-advanced-table label {
|
|
150
|
+
margin: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.kiwi-settings-advanced-table td {
|
|
154
|
+
height: 30px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.kiwi-settings-advanced-table td:nth-child(2) {
|
|
158
|
+
min-width: 100px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.kiwi-settings-advanced-table td:nth-child(3) {
|
|
162
|
+
min-width: 350px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.kiwi-settings-advanced tr.kiwi-advanced-setting--modified {
|
|
166
|
+
font-weight: 900;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.kiwi-settings-advanced .u-table td .u-input {
|
|
170
|
+
height: 30px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.kiwi-settings-advanced-filter {
|
|
174
|
+
border-bottom: 1px solid rgba(128, 128, 128, 0.5);
|
|
175
|
+
padding: 0 0 5px 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.kiwi-settings-advanced-filter-container {
|
|
179
|
+
position: relative;
|
|
180
|
+
display: inline-block;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.kiwi-settings-advanced-filter-container input::-ms-clear {
|
|
184
|
+
display: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.kiwi-settings-advanced-filter-container .fa-search,
|
|
188
|
+
.kiwi-settings-advanced-filter-container .fa-times {
|
|
189
|
+
position: absolute;
|
|
190
|
+
top: 8px;
|
|
191
|
+
right: 10px;
|
|
192
|
+
z-index: 10;
|
|
193
|
+
cursor: default;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.kiwi-settings-advanced-filter-container .fa-times {
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.kiwi-settings-advanced-filter label {
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.kiwi-settings-advanced .u-form .kiwi-settings-advanced-filter .u-input {
|
|
205
|
+
display: inline-block;
|
|
206
|
+
border: 1px solid #000;
|
|
207
|
+
height: 40px;
|
|
208
|
+
padding: 0 10px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.kiwi-settings-advanced-notice {
|
|
212
|
+
text-align: center;
|
|
213
|
+
padding: 10px 0;
|
|
214
|
+
margin: 5px 0 15px 0;
|
|
215
|
+
font-weight: 900;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.kiwi-settings-advanced .kiwi-settings-advanced-noresult {
|
|
219
|
+
width: 100%;
|
|
220
|
+
margin: 50px 0 30px 0;
|
|
221
|
+
text-align: center;
|
|
222
|
+
font-weight: 900;
|
|
223
|
+
font-size: 1em;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@media screen and (max-width: 600px) {
|
|
227
|
+
.kiwi-settings-advanced .u-form {
|
|
228
|
+
overflow-x: scroll;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
</style>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="kiwi-settings-aliases">
|
|
3
|
+
<form class="u-form">
|
|
4
|
+
<a
|
|
5
|
+
class="u-link kiwi-settings-aliases-showhelp"
|
|
6
|
+
@click="show_help=!show_help"
|
|
7
|
+
>
|
|
8
|
+
{{ $t('what_are_aliases') }}
|
|
9
|
+
</a>
|
|
10
|
+
|
|
11
|
+
<div v-if="show_help" class="kiwi-settings-aliases-help">
|
|
12
|
+
<p>Aliases let you rename existing IRC commands or even build entirely new ones.</p>
|
|
13
|
+
<p>
|
|
14
|
+
They must be one per line and in the form of <em>/name /what it should do</em>.
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<h4>Variables</h4>
|
|
18
|
+
<p>
|
|
19
|
+
There are several variables that may be used to refer to the current environment
|
|
20
|
+
such as the active channel or active nick.
|
|
21
|
+
<ul>
|
|
22
|
+
<li><em>$server</em> The current network name</li>
|
|
23
|
+
<li><em>$channel / $destination</em> The current channel / buffer name</li>
|
|
24
|
+
<li><em>$nick</em> The current nick</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</p>
|
|
27
|
+
<p>
|
|
28
|
+
You can also use variables to read input from the typed command. <br>
|
|
29
|
+
<ul>
|
|
30
|
+
<li><em>$0</em> The command name</li>
|
|
31
|
+
<li><em>$1</em> The first argument from the typed input</li>
|
|
32
|
+
<li><em>$2</em> The second argument from the typed input</li>
|
|
33
|
+
<li><em>$1+</em> From the first argument to the last argument</li>
|
|
34
|
+
</ul>
|
|
35
|
+
<b>Example 1:</b> <em>/greet /msg $1 Hello, $1!</em><br>
|
|
36
|
+
This creates an IRC command /greet that accepts one argument. Typing "/greet
|
|
37
|
+
username" will execute "/msg username Hello, username!". <br>
|
|
38
|
+
<b>Example 2:</b> <em>/ban /quote mode $channel +b $1+</em><br>
|
|
39
|
+
This creates an IRC command /ban that does a few things. Typing "/ban nick1
|
|
40
|
+
nick2" will execute "/quote mode #activechannel +b nick1 nick2". $channel is
|
|
41
|
+
replaced with the active channel name, $1+ is replaced with all the typed input
|
|
42
|
+
from the first word to the end.
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<h4>Helper commands</h4>
|
|
46
|
+
<p>
|
|
47
|
+
<ul>
|
|
48
|
+
<li>
|
|
49
|
+
<em>/echo</em><br>Sends a message to the active buffer without sending
|
|
50
|
+
it to the IRC network. Eg, /echo Something happened
|
|
51
|
+
</li>
|
|
52
|
+
<li>
|
|
53
|
+
<em>/lines</em><br>
|
|
54
|
+
Similar to Mirc script, this lets you execute multiples lines of
|
|
55
|
+
commands separated by a pipe, "|".<br>
|
|
56
|
+
Example: "/lines /ban nick1 | /echo Banned user" would first execute the
|
|
57
|
+
/ban command, and then the /echo command. This comes in handy with
|
|
58
|
+
creating short aliases such as the common "/cycle" command that parts
|
|
59
|
+
and re-joins the active channel: "/cycle /lines /part $channel | /join
|
|
60
|
+
$channel".
|
|
61
|
+
</li>
|
|
62
|
+
</ul>
|
|
63
|
+
|
|
64
|
+
</p>
|
|
65
|
+
</div>
|
|
66
|
+
<textarea v-model="aliasText" class="kiwi-settings-aliases-input" />
|
|
67
|
+
</form>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script>
|
|
72
|
+
'kiwi public';
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
data: function data() {
|
|
76
|
+
return {
|
|
77
|
+
show_help: false,
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
computed: {
|
|
81
|
+
aliasText: {
|
|
82
|
+
get: function getAliasText() {
|
|
83
|
+
return this.$state.setting('aliases').trim();
|
|
84
|
+
},
|
|
85
|
+
set: function setAliasText(newVal) {
|
|
86
|
+
this.$state.setting('aliases', newVal.trim());
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<style>
|
|
94
|
+
|
|
95
|
+
.kiwi-settings-aliases-input {
|
|
96
|
+
width: 80%;
|
|
97
|
+
height: 200px;
|
|
98
|
+
font-size: 0.8em;
|
|
99
|
+
line-height: 1.4em;
|
|
100
|
+
font-family: monospace;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.kiwi-settings-aliases-showhelp {
|
|
104
|
+
display: block;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.kiwi-settings-aliases-help {
|
|
108
|
+
padding: 1em;
|
|
109
|
+
margin: 1em 0;
|
|
110
|
+
border: 1px dashed rgba(0, 0, 0, 0.4);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.kiwi-settings-aliases .u-form textarea {
|
|
114
|
+
min-height: 300px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.kiwi-settings-aliases-help em {
|
|
118
|
+
padding: 1px 2px;
|
|
119
|
+
font-weight: 900;
|
|
120
|
+
}
|
|
121
|
+
</style>
|