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.
Files changed (247) hide show
  1. package/.github/workflows/ci.yml +6 -1
  2. package/.gitmodules +3 -0
  3. package/CHANGELOG.md +214 -0
  4. package/README.md +110 -23
  5. package/apps/aws-stack/package.json +1 -1
  6. package/apps/cf-tcp-container/package.json +1 -1
  7. package/apps/cf-worker/package.json +1 -1
  8. package/apps/cf-worker/src/origin-allowlist.ts +99 -0
  9. package/apps/cf-worker/src/worker.ts +89 -9
  10. package/apps/cf-worker/tests/fixtures/web-dist/app/index.html +18 -0
  11. package/apps/cf-worker/tests/fixtures/web-dist/index.html +18 -0
  12. package/apps/cf-worker/tests/origin-allowlist.test.ts +101 -0
  13. package/apps/cf-worker/tests/smoke.test.ts +28 -2
  14. package/apps/cf-worker/tests/ws-origin.test.ts +89 -0
  15. package/apps/cf-worker/wrangler.test.toml +23 -0
  16. package/apps/cf-worker/wrangler.toml +54 -0
  17. package/apps/local-cli/package.json +1 -1
  18. package/apps/web/landing/index.html +217 -0
  19. package/apps/web/package.json +28 -0
  20. package/apps/web/scripts/build.mjs +125 -0
  21. package/apps/web/src/build-env.ts +43 -0
  22. package/apps/web/src/config-schema.ts +138 -0
  23. package/apps/web/static/config.json +28 -0
  24. package/apps/web/static/config.prod.json +28 -0
  25. package/apps/web/static/config.staging.json +28 -0
  26. package/apps/web/tests/build-env.test.ts +63 -0
  27. package/apps/web/tests/build-smoke.test.ts +103 -0
  28. package/apps/web/tests/config-schema.test.ts +432 -0
  29. package/apps/web/tests/workspace.test.ts +12 -0
  30. package/apps/web/tsconfig.json +10 -0
  31. package/apps/web/upstream/.browserslistrc +3 -0
  32. package/apps/web/upstream/.editorconfig +9 -0
  33. package/apps/web/upstream/.eslintignore +3 -0
  34. package/apps/web/upstream/.eslintrc.js +90 -0
  35. package/apps/web/upstream/.github/FUNDING.yml +12 -0
  36. package/apps/web/upstream/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  37. package/apps/web/upstream/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  38. package/apps/web/upstream/.github/workflows/push.yml +26 -0
  39. package/apps/web/upstream/.github/workflows/release.yml +33 -0
  40. package/apps/web/upstream/.github/workflows/release_manual.yml +55 -0
  41. package/apps/web/upstream/.prettierrc.js +9 -0
  42. package/apps/web/upstream/.stylelintignore +5 -0
  43. package/apps/web/upstream/.stylelintrc.js +21 -0
  44. package/apps/web/upstream/LICENSE +201 -0
  45. package/apps/web/upstream/README.md +76 -0
  46. package/apps/web/upstream/babel.config.js +25 -0
  47. package/apps/web/upstream/crowdin.yml +3 -0
  48. package/apps/web/upstream/index.html +35 -0
  49. package/apps/web/upstream/jest.config.js +7 -0
  50. package/apps/web/upstream/jsdoc.json +22 -0
  51. package/apps/web/upstream/package.json +80 -0
  52. package/apps/web/upstream/scripts/pre-commit +43 -0
  53. package/apps/web/upstream/src/components/App.vue +516 -0
  54. package/apps/web/upstream/src/components/AppSettings.vue +587 -0
  55. package/apps/web/upstream/src/components/AutoComplete.vue +284 -0
  56. package/apps/web/upstream/src/components/Avatar.vue +105 -0
  57. package/apps/web/upstream/src/components/AwayStatusIndicator.vue +77 -0
  58. package/apps/web/upstream/src/components/BufferKey.vue +121 -0
  59. package/apps/web/upstream/src/components/BufferSettings.vue +97 -0
  60. package/apps/web/upstream/src/components/Captcha.vue +85 -0
  61. package/apps/web/upstream/src/components/ChannelBanlist.vue +96 -0
  62. package/apps/web/upstream/src/components/ChannelInfo.vue +159 -0
  63. package/apps/web/upstream/src/components/ChannelInvitelist.vue +276 -0
  64. package/apps/web/upstream/src/components/ChannelList.vue +345 -0
  65. package/apps/web/upstream/src/components/Container.vue +401 -0
  66. package/apps/web/upstream/src/components/ContainerHeader.vue +522 -0
  67. package/apps/web/upstream/src/components/ControlInput.vue +1016 -0
  68. package/apps/web/upstream/src/components/LoadingAnimation.vue +104 -0
  69. package/apps/web/upstream/src/components/MediaViewer.vue +199 -0
  70. package/apps/web/upstream/src/components/MessageInfo.vue +192 -0
  71. package/apps/web/upstream/src/components/MessageList.vue +1028 -0
  72. package/apps/web/upstream/src/components/MessageListAvatar.vue +20 -0
  73. package/apps/web/upstream/src/components/MessageListMessageCompact.vue +361 -0
  74. package/apps/web/upstream/src/components/MessageListMessageInline.vue +257 -0
  75. package/apps/web/upstream/src/components/MessageListMessageModern.vue +430 -0
  76. package/apps/web/upstream/src/components/NetworkSettings.vue +528 -0
  77. package/apps/web/upstream/src/components/Nicklist.vue +309 -0
  78. package/apps/web/upstream/src/components/NicklistUser.vue +181 -0
  79. package/apps/web/upstream/src/components/NotConnected.vue +271 -0
  80. package/apps/web/upstream/src/components/SelfUser.vue +283 -0
  81. package/apps/web/upstream/src/components/ServerSelector.vue +162 -0
  82. package/apps/web/upstream/src/components/ServerView.vue +126 -0
  83. package/apps/web/upstream/src/components/SettingsAdvanced.vue +232 -0
  84. package/apps/web/upstream/src/components/SettingsAliases.vue +121 -0
  85. package/apps/web/upstream/src/components/Sidebar.vue +429 -0
  86. package/apps/web/upstream/src/components/SidebarAboutBuffer.vue +288 -0
  87. package/apps/web/upstream/src/components/SidebarState.vue +145 -0
  88. package/apps/web/upstream/src/components/StartupError.vue +35 -0
  89. package/apps/web/upstream/src/components/StateBrowser.vue +420 -0
  90. package/apps/web/upstream/src/components/StateBrowserBuffer.vue +124 -0
  91. package/apps/web/upstream/src/components/StateBrowserNetwork.vue +823 -0
  92. package/apps/web/upstream/src/components/StateBrowserUsermenu.vue +162 -0
  93. package/apps/web/upstream/src/components/TypingStatusIndicator.vue +34 -0
  94. package/apps/web/upstream/src/components/TypingUsersList.vue +56 -0
  95. package/apps/web/upstream/src/components/UrlEmbed.vue +149 -0
  96. package/apps/web/upstream/src/components/UserBox.vue +728 -0
  97. package/apps/web/upstream/src/components/inputtools/Emoji.vue +67 -0
  98. package/apps/web/upstream/src/components/inputtools/TextStyle.vue +142 -0
  99. package/apps/web/upstream/src/components/startups/CommonLayout.vue +208 -0
  100. package/apps/web/upstream/src/components/startups/CustomServer.vue +495 -0
  101. package/apps/web/upstream/src/components/startups/KiwiBnc.vue +361 -0
  102. package/apps/web/upstream/src/components/startups/Personal.vue +317 -0
  103. package/apps/web/upstream/src/components/startups/Welcome.vue +544 -0
  104. package/apps/web/upstream/src/components/startups/ZncLogin.vue +229 -0
  105. package/apps/web/upstream/src/components/utils/InputConfirm.vue +68 -0
  106. package/apps/web/upstream/src/components/utils/InputPrompt.vue +118 -0
  107. package/apps/web/upstream/src/components/utils/InputText.vue +172 -0
  108. package/apps/web/upstream/src/components/utils/IrcInput.vue +579 -0
  109. package/apps/web/upstream/src/components/utils/PluginWrapper.vue +26 -0
  110. package/apps/web/upstream/src/components/utils/TabbedView.vue +149 -0
  111. package/apps/web/upstream/src/components/utils/TransitionExpand.vue +97 -0
  112. package/apps/web/upstream/src/helpers/Colours.js +128 -0
  113. package/apps/web/upstream/src/helpers/IrcdDiffs.js +26 -0
  114. package/apps/web/upstream/src/helpers/Md5.js +193 -0
  115. package/apps/web/upstream/src/helpers/Misc.js +401 -0
  116. package/apps/web/upstream/src/helpers/TextFormatting.js +237 -0
  117. package/apps/web/upstream/src/libs/AliasRewriter.js +157 -0
  118. package/apps/web/upstream/src/libs/AudioManager.js +60 -0
  119. package/apps/web/upstream/src/libs/BouncerMiddleware.js +247 -0
  120. package/apps/web/upstream/src/libs/BouncerProvider.js +551 -0
  121. package/apps/web/upstream/src/libs/ChathistoryMiddleware.js +153 -0
  122. package/apps/web/upstream/src/libs/ConfigLoader.js +94 -0
  123. package/apps/web/upstream/src/libs/EmojiProvider.js +46 -0
  124. package/apps/web/upstream/src/libs/GlobalApi.js +346 -0
  125. package/apps/web/upstream/src/libs/IPC.js +51 -0
  126. package/apps/web/upstream/src/libs/InputHandler.js +921 -0
  127. package/apps/web/upstream/src/libs/IrcClient.js +1506 -0
  128. package/apps/web/upstream/src/libs/Logger.js +71 -0
  129. package/apps/web/upstream/src/libs/Message.js +169 -0
  130. package/apps/web/upstream/src/libs/MessageFormatter.js +364 -0
  131. package/apps/web/upstream/src/libs/MessageParser.js +249 -0
  132. package/apps/web/upstream/src/libs/Notifications.js +78 -0
  133. package/apps/web/upstream/src/libs/ServerConnection.js +270 -0
  134. package/apps/web/upstream/src/libs/ServerSession.js +102 -0
  135. package/apps/web/upstream/src/libs/SoundBleep.js +20 -0
  136. package/apps/web/upstream/src/libs/StatePersistence.js +90 -0
  137. package/apps/web/upstream/src/libs/ThemeManager.js +128 -0
  138. package/apps/web/upstream/src/libs/TypingMiddleware.js +105 -0
  139. package/apps/web/upstream/src/libs/WindowTitle.js +63 -0
  140. package/apps/web/upstream/src/libs/batchedAdd.js +74 -0
  141. package/apps/web/upstream/src/libs/bufferTools.js +177 -0
  142. package/apps/web/upstream/src/libs/polyfill/Element.closest.js +18 -0
  143. package/apps/web/upstream/src/libs/renderers/Html.js +113 -0
  144. package/apps/web/upstream/src/libs/settingTools.js +31 -0
  145. package/apps/web/upstream/src/libs/state/BufferState.js +703 -0
  146. package/apps/web/upstream/src/libs/state/NetworkState.js +158 -0
  147. package/apps/web/upstream/src/libs/state/UserState.js +89 -0
  148. package/apps/web/upstream/src/libs/state/common.js +26 -0
  149. package/apps/web/upstream/src/libs/state.js +961 -0
  150. package/apps/web/upstream/src/libs/storage/Local.js +51 -0
  151. package/apps/web/upstream/src/main.js +566 -0
  152. package/apps/web/upstream/src/res/autocompleteCommands.js +31 -0
  153. package/apps/web/upstream/src/res/configTemplates.js +373 -0
  154. package/apps/web/upstream/src/res/globalStyle.css +277 -0
  155. package/apps/web/upstream/src/res/kiwiLoadingLogo.png +0 -0
  156. package/apps/web/upstream/src/res/locales/app.af-ZA.po +1145 -0
  157. package/apps/web/upstream/src/res/locales/app.ar-SA.po +1145 -0
  158. package/apps/web/upstream/src/res/locales/app.bg-BG.po +1145 -0
  159. package/apps/web/upstream/src/res/locales/app.bs-BA.po +1145 -0
  160. package/apps/web/upstream/src/res/locales/app.ca-ES.po +1145 -0
  161. package/apps/web/upstream/src/res/locales/app.cs-CZ.po +1145 -0
  162. package/apps/web/upstream/src/res/locales/app.da-DK.po +1145 -0
  163. package/apps/web/upstream/src/res/locales/app.de-DE.po +1145 -0
  164. package/apps/web/upstream/src/res/locales/app.dev.po +1246 -0
  165. package/apps/web/upstream/src/res/locales/app.el-GR.po +1145 -0
  166. package/apps/web/upstream/src/res/locales/app.en-US.po +1145 -0
  167. package/apps/web/upstream/src/res/locales/app.es-419.po +1145 -0
  168. package/apps/web/upstream/src/res/locales/app.es-AR.po +1145 -0
  169. package/apps/web/upstream/src/res/locales/app.es-EM.po +536 -0
  170. package/apps/web/upstream/src/res/locales/app.es-ES.po +1145 -0
  171. package/apps/web/upstream/src/res/locales/app.es-US.po +1145 -0
  172. package/apps/web/upstream/src/res/locales/app.eu-ES.po +1145 -0
  173. package/apps/web/upstream/src/res/locales/app.fi-FI.po +1145 -0
  174. package/apps/web/upstream/src/res/locales/app.fr-FR.po +1145 -0
  175. package/apps/web/upstream/src/res/locales/app.gl-ES.po +1145 -0
  176. package/apps/web/upstream/src/res/locales/app.he-IL.po +1145 -0
  177. package/apps/web/upstream/src/res/locales/app.hi-IN.po +1145 -0
  178. package/apps/web/upstream/src/res/locales/app.hu-HU.po +1145 -0
  179. package/apps/web/upstream/src/res/locales/app.id-ID.po +1145 -0
  180. package/apps/web/upstream/src/res/locales/app.it-IT.po +1145 -0
  181. package/apps/web/upstream/src/res/locales/app.ja-JP.po +1145 -0
  182. package/apps/web/upstream/src/res/locales/app.ko-KR.po +1145 -0
  183. package/apps/web/upstream/src/res/locales/app.nl-NL.po +1145 -0
  184. package/apps/web/upstream/src/res/locales/app.no-NO.po +1145 -0
  185. package/apps/web/upstream/src/res/locales/app.pl-PL.po +1145 -0
  186. package/apps/web/upstream/src/res/locales/app.pt-BR.po +1145 -0
  187. package/apps/web/upstream/src/res/locales/app.pt-PT.po +1145 -0
  188. package/apps/web/upstream/src/res/locales/app.ro-RO.po +1145 -0
  189. package/apps/web/upstream/src/res/locales/app.ru-RU.po +1145 -0
  190. package/apps/web/upstream/src/res/locales/app.sl-SI.po +1145 -0
  191. package/apps/web/upstream/src/res/locales/app.sq-AL.po +1145 -0
  192. package/apps/web/upstream/src/res/locales/app.sr-SP.po +1145 -0
  193. package/apps/web/upstream/src/res/locales/app.sv-SE.po +1145 -0
  194. package/apps/web/upstream/src/res/locales/app.tr-TR.po +1145 -0
  195. package/apps/web/upstream/src/res/locales/app.uk-UA.po +1145 -0
  196. package/apps/web/upstream/src/res/locales/app.vi-VN.po +1145 -0
  197. package/apps/web/upstream/src/res/locales/app.zh-CN.po +1145 -0
  198. package/apps/web/upstream/src/res/locales/app.zh-TW.po +1145 -0
  199. package/apps/web/upstream/src/res/localesList.json +27 -0
  200. package/apps/web/upstream/src/res/logo.png +0 -0
  201. package/apps/web/upstream/src/thirdparty/about.html +43 -0
  202. package/apps/web/upstream/src/thirdparty/index.js +5 -0
  203. package/apps/web/upstream/src/thirdparty/kiwiirccom.vue +185 -0
  204. package/apps/web/upstream/static/config.json +28 -0
  205. package/apps/web/upstream/static/emoticons/smile.png +0 -0
  206. package/apps/web/upstream/static/favicon.png +0 -0
  207. package/apps/web/upstream/static/highlight.mp3 +0 -0
  208. package/apps/web/upstream/static/highlight.ogg +0 -0
  209. package/apps/web/upstream/static/locales/.gitignore +2 -0
  210. package/apps/web/upstream/static/plugins/customise.html.example +10 -0
  211. package/apps/web/upstream/static/themes/coffee/theme.css +145 -0
  212. package/apps/web/upstream/static/themes/common/base.css +1064 -0
  213. package/apps/web/upstream/static/themes/dark/theme.css +196 -0
  214. package/apps/web/upstream/static/themes/default/theme.css +92 -0
  215. package/apps/web/upstream/static/themes/elite/theme.css +248 -0
  216. package/apps/web/upstream/static/themes/grayfox/theme.css +143 -0
  217. package/apps/web/upstream/static/themes/nightswatch/theme.css +367 -0
  218. package/apps/web/upstream/static/themes/osprey/theme.css +115 -0
  219. package/apps/web/upstream/static/themes/radioactive/theme.css +1211 -0
  220. package/apps/web/upstream/static/themes/sky/theme.css +107 -0
  221. package/apps/web/upstream/tests/unit/BatchAdd.spec.js +174 -0
  222. package/apps/web/upstream/tests/unit/MessageParser.spec.js +125 -0
  223. package/apps/web/upstream/tests/unit/Misc.spec.js +24 -0
  224. package/apps/web/upstream/tests/unit/NetworkState.spec.js +58 -0
  225. package/apps/web/upstream/tests/unit/StartupError.spec.js +20 -0
  226. package/apps/web/upstream/vue.config.js +150 -0
  227. package/apps/web/upstream/yarn.lock +9767 -0
  228. package/apps/web/vitest.config.ts +13 -0
  229. package/biome.json +1 -0
  230. package/docs/Home.md +1 -0
  231. package/docs/WebClientGuide.md +535 -0
  232. package/package.json +2 -2
  233. package/packages/aws-adapter/package.json +1 -1
  234. package/packages/cf-adapter/package.json +1 -1
  235. package/packages/cf-adapter/tests/cf-harness.ts +12 -1
  236. package/packages/in-memory-runtime/package.json +1 -1
  237. package/packages/irc-core/package.json +1 -1
  238. package/packages/irc-core/reports/mutation/mutation.html +342 -0
  239. package/packages/irc-core/tests/batch.test.ts +15 -0
  240. package/packages/irc-core/tests/numerics.test.ts +13 -0
  241. package/packages/irc-core/tests/parser.test.ts +109 -0
  242. package/packages/irc-server/package.json +1 -1
  243. package/packages/irc-test-support/package.json +1 -1
  244. package/packages/irc-test-support/src/scenarios.ts +24 -2
  245. package/tools/ci-hardening/package.json +1 -1
  246. package/tools/load-test/package.json +1 -1
  247. package/tools/tcp-ws-forwarder/package.json +1 -1
@@ -0,0 +1,229 @@
1
+ <template>
2
+ <startup-layout ref="layout" class="kiwi-welcome-znc">
3
+ <template v-if="!network || network.state === 'disconnected'" #connection>
4
+ <form class="u-form u-form--big kiwi-welcome-znc-form" @submit.prevent="formSubmit">
5
+ <h2 v-html="greetingText" />
6
+
7
+ <div
8
+ v-if="network && (network.last_error || network.state_error)"
9
+ class="kiwi-welcome-znc-error"
10
+ >
11
+ We couldn't connect to the server :(
12
+ <span>
13
+ {{ network.last_error || readableStateError(network.state_error) }}
14
+ </span>
15
+ </div>
16
+
17
+ <input-text
18
+ v-if="showUser"
19
+ v-model="username"
20
+ :label="$t('username')"
21
+ class="kiwi-welcome-znc-nick"
22
+ />
23
+ <input-text
24
+ v-if="showPass"
25
+ v-model="password"
26
+ :label="$t('password')"
27
+ class="kiwi-welcome-znc-password"
28
+ type="password"
29
+ />
30
+ <input-text
31
+ v-if="showNetwork"
32
+ v-model="znc_network"
33
+ :label="$t('network')"
34
+ class="kiwi-welcome-znc-channel"
35
+ />
36
+ <button
37
+ :disabled="!readyToStart"
38
+ class="u-button u-button-primary u-submit kiwi-welcome-znc-start"
39
+ type="submit"
40
+ v-html="buttonText"
41
+ />
42
+ </form>
43
+ </template>
44
+ <template v-else-if="network.state !== 'connected'" #connection>
45
+ <i class="fa fa-spin fa-spinner" style="font-size: 2em; margin-top: 1em;" />
46
+ </template>
47
+ </startup-layout>
48
+ </template>
49
+
50
+ <script>
51
+ 'kiwi public';
52
+
53
+ import _ from 'lodash';
54
+ import * as Misc from '@/helpers/Misc';
55
+ import StartupLayout from './CommonLayout';
56
+
57
+ export default {
58
+ components: {
59
+ StartupLayout,
60
+ },
61
+ data: function data() {
62
+ return {
63
+ network: null,
64
+ network_extras: null,
65
+ username: '',
66
+ password: '',
67
+ znc_network: '',
68
+ showNetwork: true,
69
+ showPass: true,
70
+ showUser: true,
71
+ show_password_box: false,
72
+ };
73
+ },
74
+ computed: {
75
+ greetingText: function greetingText() {
76
+ let greeting = this.$state.settings.startupOptions.greetingText;
77
+ return typeof greeting === 'string' ?
78
+ greeting :
79
+ this.$t('start_greeting');
80
+ },
81
+ buttonText: function buttonText() {
82
+ let greeting = this.$state.settings.startupOptions.buttonText;
83
+ return typeof greeting === 'string' ?
84
+ greeting :
85
+ this.$t('start_button');
86
+ },
87
+ readyToStart: function readyToStart() {
88
+ return this.username && (this.password || this.showPass === false);
89
+ },
90
+ infoContent: function infoContent() {
91
+ return this.$state.settings.startupOptions.infoContent || '';
92
+ },
93
+ },
94
+ created: function created() {
95
+ let options = this.$state.settings.startupOptions;
96
+
97
+ this.username = options.username || '';
98
+ this.password = options.password || '';
99
+ this.znc_network = window.location.hash.substr(1) || options.network || '';
100
+ this.showNetwork = typeof options.showNetwork === 'boolean' ?
101
+ options.showNetwork :
102
+ true;
103
+ this.showUser = typeof options.showUser === 'boolean' ?
104
+ options.showUser :
105
+ true;
106
+ this.showPass = typeof options.showPass === 'boolean' ?
107
+ options.showPass :
108
+ true;
109
+
110
+ if (options.autoConnect && this.username && this.password) {
111
+ this.startUp();
112
+ }
113
+ },
114
+ methods: {
115
+ readableStateError(err) {
116
+ return Misc.networkErrorMessage(err);
117
+ },
118
+ formSubmit: function formSubmit() {
119
+ if (this.readyToStart) {
120
+ this.startUp();
121
+ }
122
+ },
123
+ addNetwork: function addNetwork(netName) {
124
+ let options = this.$state.settings.startupOptions;
125
+ let password = this.username;
126
+ if (netName) {
127
+ password += '/' + netName;
128
+ }
129
+ password += ':' + this.password;
130
+
131
+ let net = this.$state.addNetwork(netName, 'ZNC', {
132
+ server: _.trim(options.server),
133
+ port: options.port,
134
+ tls: options.tls,
135
+ password: password,
136
+ });
137
+ return net;
138
+ },
139
+ startUp: function startUp() {
140
+ if (this.network) {
141
+ this.$state.removeNetwork(this.network.id);
142
+ }
143
+
144
+ let netList = _.compact(this.znc_network.split(','));
145
+ if (netList.length === 0) {
146
+ netList.push('');
147
+ }
148
+
149
+ // add our first network and make sure we can connect
150
+ // before trying to add other networks.
151
+ let net = this.network = this.addNetwork(netList.shift());
152
+ this.network_extras = netList;
153
+
154
+ let onRegistered = () => {
155
+ this.$state.setActiveBuffer(net.id, net.serverBuffer().name);
156
+ net.ircClient.off('registered', onRegistered);
157
+ net.ircClient.off('close', onClosed);
158
+ this.network_extras.forEach((netName, idx) => {
159
+ let extraNet = this.addNetwork(_.trim(netName));
160
+ extraNet.ircClient.connect();
161
+ });
162
+ this.$refs.layout.close();
163
+ };
164
+ let onClosed = () => {
165
+ net.ircClient.off('registered', onRegistered);
166
+ net.ircClient.off('close', onClosed);
167
+ };
168
+ net.ircClient.once('registered', onRegistered);
169
+ net.ircClient.once('close', onClosed);
170
+ net.ircClient.connect();
171
+ },
172
+ },
173
+ };
174
+ </script>
175
+
176
+ <style>
177
+
178
+ .kiwi-welcome-znc h2 {
179
+ font-size: 1.7em;
180
+ text-align: center;
181
+ padding: 0;
182
+ margin: 0.5em auto 1.5em auto;
183
+ }
184
+
185
+ .kiwi-welcome-znc-error {
186
+ text-align: center;
187
+ margin: 1em 0;
188
+ padding: 0.3em;
189
+ }
190
+
191
+ .kiwi-welcome-znc-error span {
192
+ display: block;
193
+ font-style: italic;
194
+ }
195
+
196
+ .kiwi-welcome-znc-form {
197
+ width: 300px;
198
+ background-color: #fff;
199
+ border-radius: 0.5em;
200
+ padding: 1em;
201
+ border: 1px solid #ececec;
202
+ }
203
+
204
+ .kiwi-welcome-znc .u-input-text,
205
+ .kiwi-welcome-znc .kiwi-welcome-znc-have-password input {
206
+ margin-bottom: 1.5em;
207
+ }
208
+
209
+ .kiwi-welcome-znc-have-password input:checked {
210
+ margin-bottom: 0;
211
+ }
212
+
213
+ .kiwi-welcome-znc-start {
214
+ font-size: 1.1em;
215
+ cursor: pointer;
216
+ width: 100%;
217
+ margin: 1em auto 0.5em auto;
218
+ font-weight: normal;
219
+ border: none;
220
+ height: 36px;
221
+ line-height: 36px;
222
+ padding: 0;
223
+ }
224
+
225
+ .kiwi-welcome-znc-start[disabled] {
226
+ cursor: not-allowed;
227
+ }
228
+
229
+ </style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div class="u-input-confirm">
3
+ <div v-if="state==='pre'" @click="prompt"><slot /></div>
4
+
5
+ <template v-if="state==='prompt'">
6
+ <span class="u-input-confirm-label">{{ label }}</span>
7
+ <a :class="['u-button-'+connoteCss.yes]" class="u-button" @click="complete(true)">
8
+ {{ $t('yes') }}
9
+ </a>
10
+ <a :class="['u-button-'+connoteCss.no]" class="u-button" @click="complete(false)">
11
+ {{ $t('no') }}
12
+ </a>
13
+ </template>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ 'kiwi public';
19
+
20
+ let Vue = require('vue');
21
+
22
+ export default Vue.component('input-confirm', {
23
+ props: ['label', 'flipConnotation'],
24
+ data: function data() {
25
+ return {
26
+ state: 'pre',
27
+ };
28
+ },
29
+ computed: {
30
+ connoteCss() {
31
+ return {
32
+ yes: this.flipConnotation ? 'warning' : 'primary',
33
+ no: this.flipConnotation ? 'primary' : 'warning',
34
+ };
35
+ },
36
+ },
37
+ created() {
38
+ if (!this.$slots.default) {
39
+ this.state = 'prompt';
40
+ }
41
+ },
42
+ methods: {
43
+ prompt() {
44
+ this.state = 'prompt';
45
+ },
46
+ complete(val) {
47
+ this.$emit('submit', val);
48
+ this.$emit(val ? 'ok' : 'cancel');
49
+ this.state = 'pre';
50
+ },
51
+ },
52
+ });
53
+ </script>
54
+
55
+ <style>
56
+ .u-input-confirm {
57
+ display: inline-block;
58
+ padding: 10px;
59
+ }
60
+
61
+ .u-input-confirm > a {
62
+ margin-right: 10px;
63
+ }
64
+
65
+ .u-input-confirm > a:last-of-type {
66
+ margin-right: 0;
67
+ }
68
+ </style>
@@ -0,0 +1,118 @@
1
+ <template>
2
+ <div :style="{display: block ? 'block' : 'inline-block'}" class="u-input-prompt">
3
+ <div v-if="state==='pre'" @click="prompt"><slot /></div>
4
+
5
+ <form v-if="state==='prompt'" class="u-form" @submit.prevent="complete">
6
+ <span class="u-input-prompt-label">{{ label }}</span>
7
+ <div class="u-input-prompt-inputs">
8
+ <input v-model="value" class="u-input" @keyup.esc="cancel">
9
+ <a class="u-button u-button-primary" @click="complete">
10
+ <span :class="{'u-input-prompt-hidden': waiting}">{{ $t('ok') }}</span>
11
+ <div v-if="waiting" class="u-input-prompt-waiting">
12
+ <i class="fa fa-spin fa-spinner" aria-hidden="true" />
13
+ </div>
14
+ </a>
15
+ <a
16
+ v-if="!hideCancel"
17
+ class="u-button u-button-warning"
18
+ @click="cancel"
19
+ >{{ $t('cancel') }}</a>
20
+ </div>
21
+ </form>
22
+ </div>
23
+ </template>
24
+
25
+ <script>
26
+ 'kiwi public';
27
+
28
+ let Vue = require('vue');
29
+
30
+ export default Vue.component('input-prompt', {
31
+ props: ['label', 'hideCancel', 'block'],
32
+ data() {
33
+ return {
34
+ value: '',
35
+ state: 'pre',
36
+ waiting: false,
37
+ };
38
+ },
39
+ computed: {
40
+ hasChildren() {
41
+ return !!this.$slots.default;
42
+ },
43
+ },
44
+ created() {
45
+ if (!this.hasChildren) {
46
+ this.prompt();
47
+ }
48
+ },
49
+ methods: {
50
+ prompt() {
51
+ this.state = 'prompt';
52
+ this.$nextTick(() => {
53
+ this.$el.querySelector('input').focus();
54
+ });
55
+ },
56
+ complete() {
57
+ if (this.waiting) {
58
+ return;
59
+ }
60
+
61
+ if (this.hasChildren) {
62
+ this.state = 'pre';
63
+ } else {
64
+ this.waiting = true;
65
+ }
66
+
67
+ const doneWaiting = () => {
68
+ this.waiting = false;
69
+ };
70
+
71
+ this.$emit('submit', this.value, doneWaiting);
72
+ },
73
+ cancel() {
74
+ if (this.hasChildren) {
75
+ this.state = 'pre';
76
+ }
77
+
78
+ this.$emit('cancel');
79
+ },
80
+ },
81
+ });
82
+ </script>
83
+
84
+ <style>
85
+ .u-input-prompt-inputs {
86
+ display: flex;
87
+ }
88
+
89
+ .u-input-prompt-inputs > input {
90
+ flex: 1;
91
+ margin-right: 1em;
92
+ }
93
+
94
+ .u-input-prompt-inputs > a {
95
+ margin-right: 0.5em;
96
+ }
97
+
98
+ .u-input-prompt-inputs > .u-button-primary {
99
+ position: relative;
100
+ }
101
+
102
+ .u-input-prompt-hidden {
103
+ visibility: hidden;
104
+ }
105
+
106
+ .u-input-prompt-waiting {
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ position: absolute;
111
+ font-size: 150%;
112
+ font-weight: 800;
113
+ top: 0;
114
+ right: 0;
115
+ bottom: 0;
116
+ left: 0;
117
+ }
118
+ </style>
@@ -0,0 +1,172 @@
1
+ <template>
2
+ <div class="u-input-text">
3
+ <label v-if="label" :for="inputId">{{ label }}</label>
4
+
5
+ <div class="u-input-text-inputs" style="display: flex;">
6
+ <template v-if="type==='password'">
7
+ <input
8
+ :id="inputId"
9
+ v-model="currentValue"
10
+ :type="plainTextEnabled && !isEdgeBrowser() ? 'text' : 'password'"
11
+ :class="{'u-form-input-plaintext' : !isEdgeBrowser() && showPlainText}"
12
+ autocomplete="off"
13
+ autocorrect="off"
14
+ autocapitalize="off"
15
+ spellcheck="false"
16
+ class="u-input"
17
+ @keypress="$emit('keypress', $event)"
18
+ >
19
+
20
+ <i
21
+ v-if="showPlainText && !isEdgeBrowser()"
22
+ :class="{'u-input-text-plaintext--active': plainTextEnabled}"
23
+ class="u-input-text-plaintext fa fa-eye"
24
+ aria-hidden="true"
25
+ @click="plainTextEnabled = !plainTextEnabled"
26
+ />
27
+ </template>
28
+
29
+ <input
30
+ v-else-if="type==='number'"
31
+ :id="inputId"
32
+ v-model="currentValue"
33
+ type="number"
34
+ class="u-input"
35
+ @keypress="$emit('keypress', $event)"
36
+ >
37
+ <textarea
38
+ v-else-if="type==='textarea'"
39
+ :id="inputId"
40
+ v-model="currentValue"
41
+ class="u-input"
42
+ @keypress="$emit('keypress', $event)"
43
+ />
44
+ <input
45
+ v-else
46
+ :id="inputId"
47
+ v-model="currentValue"
48
+ autocomplete="off"
49
+ autocorrect="off"
50
+ autocapitalize="off"
51
+ spellcheck="false"
52
+ class="u-input"
53
+ @keypress="$emit('keypress', $event)"
54
+ >
55
+
56
+ <div v-if="$slots.default" class="u-input-text-c">
57
+ <slot />
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </template>
62
+
63
+ <script>
64
+ 'kiwi public';
65
+
66
+ let Vue = require('vue');
67
+
68
+ export default Vue.component('input-text', {
69
+ props: ['value', 'label', 'type', 'showPlainText'],
70
+ data: function data() {
71
+ return {
72
+ plainTextEnabled: false,
73
+ inputIdCache: '',
74
+ };
75
+ },
76
+ computed: {
77
+ inputId() {
78
+ if (!this.inputIdCache) {
79
+ // eslint-disable-next-line
80
+ this.inputIdCache = 'inp_' + Math.floor(Math.random() * 1e17).toString(36);
81
+ }
82
+
83
+ return this.inputIdCache;
84
+ },
85
+ currentValue: {
86
+ get: function getCurrentValue() {
87
+ return this.value;
88
+ },
89
+ set: function setCurrentValue(newVal) {
90
+ this.$emit('input', newVal);
91
+ },
92
+ },
93
+ },
94
+ methods: {
95
+ updateValue: function updateValue(newValue) {
96
+ this.$emit('input', newValue);
97
+ },
98
+ isEdgeBrowser() {
99
+ return navigator.appVersion.indexOf('Edge') > -1;
100
+ },
101
+ },
102
+ });
103
+ </script>
104
+
105
+ <style>
106
+
107
+ .u-input-text {
108
+ position: relative;
109
+ margin: 0 0 20px 0;
110
+ box-sizing: border-box;
111
+ }
112
+
113
+ .u-input-text-inputs {
114
+ display: flex;
115
+ position: relative;
116
+ }
117
+
118
+ .u-input-text input,
119
+ .u-input-text textarea {
120
+ box-sizing: border-box;
121
+ flex: 1;
122
+ }
123
+
124
+ .u-input-text input:focus {
125
+ outline: none;
126
+ }
127
+
128
+ .u-input-text-c {
129
+ position: relative;
130
+ }
131
+
132
+ /* Remove spinners from input numbers */
133
+ .u-input-text input[type='number'] {
134
+ /* For Firefox */
135
+ -moz-appearance: textfield;
136
+ }
137
+
138
+ .u-input-text input[type='number']::-webkit-inner-spin-button,
139
+ .u-input-text input[type='number']::-webkit-outer-spin-button {
140
+ /* For webkit browsers like Safari and Chrome */
141
+ -webkit-appearance: none;
142
+ margin: 0;
143
+ }
144
+
145
+ input[type='text'].u-form-input-plaintext,
146
+ input[type='password'].u-form-input-plaintext {
147
+ padding-right: 40px;
148
+ }
149
+
150
+ .u-input-text-plaintext {
151
+ line-height: normal;
152
+ width: 30px;
153
+ text-align: center;
154
+ cursor: pointer;
155
+ opacity: 0.5;
156
+ transition: opacity 0.2s;
157
+ position: absolute;
158
+ right: 7px;
159
+ top: 9px;
160
+ }
161
+
162
+ .u-form--big .u-input-text-plaintext {
163
+ line-height: 40px;
164
+ top: 6px;
165
+ }
166
+
167
+ .u-input-text-plaintext--active,
168
+ .u-input-text-plaintext:hover {
169
+ opacity: 1;
170
+ }
171
+
172
+ </style>