{{ t('riotchat', '"enabled" enables the feature for all users. "disable" disables the feature for all users. "labs" adds the feature to the user\'s settings.') }}
+
+
+
+
+
+
@@ -108,13 +134,29 @@ export default {
"server_name": loadState('riotchat', 'server_name'),
"disable_custom_urls": loadState('riotchat', 'disable_custom_urls') === 'true',
"disable_login_language_selector": loadState('riotchat', 'disable_login_language_selector') === 'true',
- "jitsi_preferred_domain": loadState('riotchat', 'jitsi_preferrred_domain'),
+ "jitsi_preferred_domain": loadState('riotchat', 'jitsi_preferred_domain'),
+ "labs": JSON.parse(loadState('riotchat', 'labs')),
};
},
+ computed: {
+ featureDocumentation () {
+ return t('riotchat', 'These are experimental features in Riot.im that you can enable. For information on what each feature is, check out the documentation for it {linkstart}here{linkend}')
+ .replace('{linkstart}', ``)
+ .replace('{linkend}', ``);
+ },
+
+ },
methods: {
updateSetting (setting) {
const value = this[setting].toString();
const settingName = this.$refs[setting].innerText.split("(")[0].split(":")[0].trim();
+ this.sendUpdate(setting, settingName, value);
+ },
+ updateLabSetting (setting) {
+ const value = this.labs[setting].toString();
+ this.sendUpdate(setting, t('riotchat', 'Experimental feature {feature}', { feature: setting }), value);
+ },
+ sendUpdate (setting, settingName, value) {
Axios.put(generateUrl(`apps/riotchat/settings/${setting}`), {
value,
}).then(() => {
diff --git a/webpack.config.js b/webpack.config.js
index c89ecec8..5708d4d2 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,7 @@
const path = require('path');
+const { execSync } = require('child_process');
const { VueLoaderPlugin } = require('vue-loader');
+const webpack = require('webpack');
module.exports = {
entry: {
@@ -35,6 +37,9 @@ module.exports = {
},
plugins: [
new VueLoaderPlugin(),
+ new webpack.DefinePlugin({
+ RIOT_WEB_HASH: JSON.stringify(execSync('git rev-parse HEAD', { cwd: path.resolve(__dirname, './3rdparty/riot-web') }).toString()),
+ }),
],
resolve: {
extensions: ['.js', '.vue'],