From 20079a7b9e818e16fab74f025cbb8c145ab73aab Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Tue, 30 Oct 2018 02:16:54 +0100 Subject: [PATCH 01/19] Added asl icon support, icons and colors can be enabled or disabled in config --- components/CustomNicklistUser.vue | 128 ++++++++++++++++++++++++++++++ custom-welcome.js | 26 +++++- 2 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 components/CustomNicklistUser.vue diff --git a/components/CustomNicklistUser.vue b/components/CustomNicklistUser.vue new file mode 100644 index 0000000..5af63b3 --- /dev/null +++ b/components/CustomNicklistUser.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/custom-welcome.js b/custom-welcome.js index 4278cd6..89d4d21 100644 --- a/custom-welcome.js +++ b/custom-welcome.js @@ -1,12 +1,25 @@ import CustomWelcome from './components/CustomWelcome.vue'; import CustomUserBox from './components/CustomUserBox.vue'; +import CustomNicklistUser from './components/CustomNicklistUser.vue'; import * as utils from './libs/utils.js'; // eslint-disable-next-line no-undef kiwi.plugin('custom-welcome', (kiwi) => { kiwi.addStartup('custom-welcome', CustomWelcome); kiwi.replaceModule('components/UserBox', CustomUserBox); + kiwi.replaceModule('components/NicklistUser', CustomNicklistUser); + + let icons = true; + let colours = true; + + if(kiwi.state.setting('asl.icons')) { + icons = kiwi.state.setting('asl.icons'); + } + if(kiwi.state.setting('asl.colours')) { + colours = kiwi.state.setting('asl.colours'); + } + kiwi.on('irc.join', function(event, net) { if (event.gecos) { kiwi.state.addUser(net, { @@ -14,7 +27,8 @@ kiwi.plugin('custom-welcome', (kiwi) => { username: event.ident, host: event.hostname, realname: event.gecos, - colour: getColour(event.gecos), + colour: (colours == true ) ? getColour(event.gecos) : '', + gender : (icons == true ) ? getGender(user.real_name) : null , }); } }); @@ -23,7 +37,8 @@ kiwi.plugin('custom-welcome', (kiwi) => { event.users.forEach((user) => { kiwi.state.addUser(net, { nick: user.nick, - colour: getColour(user.real_name), + colour: (colours == true ) ? getColour(event.gecos) : '', + gender : (icons == true ) ? getGender(user.real_name) : null , }); }); }); @@ -42,5 +57,10 @@ kiwi.plugin('custom-welcome', (kiwi) => { return '#000'; } } -}); + function getGender(gecos) { + let asl = utils.getASL(gecos); + return asl.s; + } + +}); \ No newline at end of file From d8972963953637025c23855b5c1687b052b89284 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Tue, 30 Oct 2018 02:31:50 +0100 Subject: [PATCH 02/19] Fixed event.gecos --- custom-welcome.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-welcome.js b/custom-welcome.js index 89d4d21..ac2c771 100644 --- a/custom-welcome.js +++ b/custom-welcome.js @@ -28,7 +28,7 @@ kiwi.plugin('custom-welcome', (kiwi) => { host: event.hostname, realname: event.gecos, colour: (colours == true ) ? getColour(event.gecos) : '', - gender : (icons == true ) ? getGender(user.real_name) : null , + gender : (icons == true ) ? getGender(event.gecos) : null , }); } }); @@ -38,7 +38,7 @@ kiwi.plugin('custom-welcome', (kiwi) => { kiwi.state.addUser(net, { nick: user.nick, colour: (colours == true ) ? getColour(event.gecos) : '', - gender : (icons == true ) ? getGender(user.real_name) : null , + gender : (icons == true ) ? getGender(event.gecos) : null , }); }); }); From 87d46ebefa390da8dfbed168c2fadc3455a4fffa Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Tue, 30 Oct 2018 02:39:05 +0100 Subject: [PATCH 03/19] Fixed user.real_name --- custom-welcome.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-welcome.js b/custom-welcome.js index ac2c771..2108218 100644 --- a/custom-welcome.js +++ b/custom-welcome.js @@ -37,8 +37,8 @@ kiwi.plugin('custom-welcome', (kiwi) => { event.users.forEach((user) => { kiwi.state.addUser(net, { nick: user.nick, - colour: (colours == true ) ? getColour(event.gecos) : '', - gender : (icons == true ) ? getGender(event.gecos) : null , + colour: (colours == true ) ? getColour(user.real_name) : '', + gender : (icons == true ) ? getGender(user.real_name) : null , }); }); }); From 5fae5011aee16ecfd48f65006358e18d7f954503 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Tue, 30 Oct 2018 03:04:48 +0100 Subject: [PATCH 04/19] Fixed get config value --- custom-welcome.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-welcome.js b/custom-welcome.js index 2108218..feb70ff 100644 --- a/custom-welcome.js +++ b/custom-welcome.js @@ -12,11 +12,11 @@ kiwi.plugin('custom-welcome', (kiwi) => { let icons = true; let colours = true; - if(kiwi.state.setting('asl.icons')) { + if(kiwi.state.setting('asl.icons') === false) { icons = kiwi.state.setting('asl.icons'); } - if(kiwi.state.setting('asl.colours')) { + if(kiwi.state.setting('asl.colours') === false) { colours = kiwi.state.setting('asl.colours'); } From 8c1a590286faf21d41c89a78fe48847ffa887766 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Tue, 30 Oct 2018 17:03:36 +0100 Subject: [PATCH 05/19] Age, sex, location values can now be get from url --- components/CustomWelcome.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/CustomWelcome.vue b/components/CustomWelcome.vue index 2fadc4c..5177ddf 100644 --- a/components/CustomWelcome.vue +++ b/components/CustomWelcome.vue @@ -141,6 +141,9 @@ export default { let options = state.settings.startupOptions; this.nick = this.processNickRandomNumber(Misc.queryStringVal('nick') || options.nick || ''); + this.age = Misc.queryStringVal('age') || ''; + this.sex = Misc.queryStringVal('sex') || ''; + this.location = Misc.queryStringVal('location') || ''; this.password = options.password || ''; this.channel = decodeURI(window.location.hash) || options.channel || ''; this.showChannel = typeof options.showChannel === 'boolean' ? From 3a4c0862897bd44abcffc1bc591446a85b6f32aa Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Sat, 3 Nov 2018 13:39:41 +0100 Subject: [PATCH 06/19] Fixed gecos not from storage if net exist --- components/CustomWelcome.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/CustomWelcome.vue b/components/CustomWelcome.vue index 5177ddf..16c33b9 100644 --- a/components/CustomWelcome.vue +++ b/components/CustomWelcome.vue @@ -141,9 +141,9 @@ export default { let options = state.settings.startupOptions; this.nick = this.processNickRandomNumber(Misc.queryStringVal('nick') || options.nick || ''); - this.age = Misc.queryStringVal('age') || ''; - this.sex = Misc.queryStringVal('sex') || ''; - this.location = Misc.queryStringVal('location') || ''; + this.age = Misc.queryStringVal('age') || ''; + this.sex = Misc.queryStringVal('sex') || ''; + this.location = Misc.queryStringVal('location') || ''; this.password = options.password || ''; this.channel = decodeURI(window.location.hash) || options.channel || ''; this.showChannel = typeof options.showChannel === 'boolean' ? @@ -217,6 +217,7 @@ export default { // the user has just put in place if (net) { net.nick = this.nick; + net.gecos = this.buildGecos(); net.connection.password = this.password; } From 1f24315b8381d318814658d1b08544945cc300c3 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Fri, 23 Nov 2018 22:44:57 +0100 Subject: [PATCH 07/19] Updated to current plugins and added get asl value from startup options --- package.json | 5 +- .../components}/CustomNicklistUser.vue | 0 .../components}/CustomUserBox.vue | 0 .../components}/CustomWelcome.vue | 20 ++-- {libs => src/libs}/utils.js | 2 +- custom-welcome.js => src/plugin.js | 0 webpack.config.js | 13 ++- yarn.lock | 98 +++++++++++++++---- 8 files changed, 100 insertions(+), 38 deletions(-) rename {components => src/components}/CustomNicklistUser.vue (100%) rename {components => src/components}/CustomUserBox.vue (100%) rename {components => src/components}/CustomWelcome.vue (96%) rename {libs => src/libs}/utils.js (85%) rename custom-welcome.js => src/plugin.js (100%) diff --git a/package.json b/package.json index e7961c7..91c98fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "plugin-custom-welcome-asl", "version": "0.0.1", - "main": "custom-welcome.js", + "main": "./src/plugin.js", "license": "Apache-2.0", "private": true, "scripts": { @@ -16,6 +16,8 @@ "babel-core": "^6.26.0", "babel-eslint": "^8.1.2", "babel-loader": "7.1.1", + "babel-plugin-transform-runtime": "^6.23.0", + "babel-preset-env": "^1.7.0", "css-loader": "^0.28.8", "eslint": "^4.15.0", "eslint-config-airbnb-base": "^12.1.0", @@ -25,6 +27,7 @@ "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1", "eslint-plugin-vue": "^4.5.0", + "exports-loader": "^0.7.0", "less": "^3.8.1", "less-loader": "^4.1.0", "style-loader": "^0.21.0", diff --git a/components/CustomNicklistUser.vue b/src/components/CustomNicklistUser.vue similarity index 100% rename from components/CustomNicklistUser.vue rename to src/components/CustomNicklistUser.vue diff --git a/components/CustomUserBox.vue b/src/components/CustomUserBox.vue similarity index 100% rename from components/CustomUserBox.vue rename to src/components/CustomUserBox.vue diff --git a/components/CustomWelcome.vue b/src/components/CustomWelcome.vue similarity index 96% rename from components/CustomWelcome.vue rename to src/components/CustomWelcome.vue index 16c33b9..8bc2ea4 100644 --- a/components/CustomWelcome.vue +++ b/src/components/CustomWelcome.vue @@ -33,22 +33,22 @@ type="password" />
- Sex: + Sesso:
Date: Fri, 23 Nov 2018 22:46:32 +0100 Subject: [PATCH 08/19] Forget ablout .babelrc --- .babelrc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..a38cd0e --- /dev/null +++ b/.babelrc @@ -0,0 +1,15 @@ +{ + "presets": [ + ["env", { + "useBuiltIns": "usage" + }], + "stage-2" + ], + "plugins": ["transform-runtime"], + "comments": false, + "env": { + "test": { + "plugins": [ "istanbul" ] + } + } +} From e416dd513f8f0fb5d83f6fe6e4c37624e4640d01 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Mon, 28 Jan 2019 22:28:24 +0100 Subject: [PATCH 09/19] Updated custom nicklistuser vue to match new default nicklistuser vue --- src/components/CustomNicklistUser.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/CustomNicklistUser.vue b/src/components/CustomNicklistUser.vue index 5af63b3..6f69eaf 100644 --- a/src/components/CustomNicklistUser.vue +++ b/src/components/CustomNicklistUser.vue @@ -41,11 +41,13 @@ export default { From de6b4075ecebd7c4c84c0d230d11ef4481b10778 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Mon, 28 Jan 2019 22:30:38 +0100 Subject: [PATCH 10/19] Removed map.js generation --- webpack.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index e955b4a..2601b2a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -33,7 +33,6 @@ module.exports = { plugins: [ new VueLoaderPlugin() ], - devtool: 'source-map', devServer: { filename: 'asl.js', contentBase: path.join(__dirname, "dist"), From d2cb1dc790130fe03cb6c06f72c92050f20cdaa1 Mon Sep 17 00:00:00 2001 From: KiwiIRC Date: Tue, 30 Apr 2019 00:09:47 +0200 Subject: [PATCH 11/19] Updated vues to match current client features --- package.json | 2 +- src/components/CustomNicklistUser.vue | 48 +++++----- src/components/CustomUserBox.vue | 131 +++++++++++++++++--------- src/components/CustomWelcome.vue | 103 ++++++++++++++------ yarn.lock | 8 +- 5 files changed, 191 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index 91c98fd..7265ab8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "stylelint": "^9.3.0", "stylelint-config-standard": "^18.2.0", "vue-loader": "^15.2.4", - "vue-template-compiler": "^2.0.0", + "vue-template-compiler": "^2.6.10", "webpack": "^4.6.0", "webpack-cli": "^2.1.2", "webpack-dev-server": "^3.1.3" diff --git a/src/components/CustomNicklistUser.vue b/src/components/CustomNicklistUser.vue index 6f69eaf..9f5cb5d 100644 --- a/src/components/CustomNicklistUser.vue +++ b/src/components/CustomNicklistUser.vue @@ -6,26 +6,40 @@ user.ignore ? 'kiwi-nicklist-user--ignore' : '', user.gender ? 'kiwi-nicklist-user--gender-' + user.gender : '', ]" + :data-nick="(user.nick||'').toLowerCase()" class="kiwi-nicklist-user" @click="nicklist.openUserbox(user)" > + {{ nicklist.userModePrefix(user) }} - {{ user.nick }}