diff --git a/res/css/views/rooms/_RoomSettings.scss b/res/css/views/rooms/_RoomSettings.scss index f04042ea77..b3858f3ba7 100644 --- a/res/css/views/rooms/_RoomSettings.scss +++ b/res/css/views/rooms/_RoomSettings.scss @@ -28,6 +28,13 @@ limitations under the License. margin-right: 8px; } +.mx_RoomSettings_devtoolsButton { + @mixin mx_DialogButton; + position: relative; + padding: 4px 1.5em; + margin-top: 8px; +} + .mx_RoomSettings_upgradeButton, .mx_RoomSettings_leaveButton:hover, .mx_RoomSettings_unbanButton:hover { diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 129278907f..f32026511b 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -82,6 +82,7 @@ const SIMPLE_SETTINGS = [ { id: "TagPanel.disableTagPanel" }, { id: "enableWidgetScreenshots" }, { id: "RoomSubList.showEmpty" }, + { id: "showDeveloperTools" }, ]; // These settings must be defined in SettingsStore diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 46869c1773..b69938a117 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -590,6 +590,11 @@ module.exports = React.createClass({ } }, + _openDevtools: function() { + const DevtoolsDialog = sdk.getComponent('dialogs.DevtoolsDialog'); + Modal.createDialog(DevtoolsDialog, {roomId: this.props.room.roomId}); + }, + _renderEncryptionSection: function() { const SettingsFlag = sdk.getComponent("elements.SettingsFlag"); @@ -942,6 +947,11 @@ module.exports = React.createClass({ ; } + const devtoolsButton = SettingsStore.getValue("showDeveloperTools") ? + ( + { _t("Open Devtools") } + ) : null; + return (
@@ -1055,6 +1065,7 @@ module.exports = React.createClass({ { _t('Internal room ID: ') } { this.props.room.roomId }
{ _t('Room version number: ') } { this.props.room.getVersion() }
{ roomUpgradeButton } + { devtoolsButton }
); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 2885eb68a7..8e1f75f25c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1268,5 +1268,7 @@ "Import": "Import", "Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", - "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room" + "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", + "Open Devtools": "Open Devtools", + "Show developer tools": "Show developer tools" } diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 021942c6f2..547c71bac8 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -290,4 +290,9 @@ export const SETTINGS = { displayName: _td('Show empty room list headings'), default: true, }, + "showDeveloperTools": { + supportedLevels: LEVELS_ACCOUNT_SETTINGS, + displayName: _td('Show developer tools'), + default: false, + }, };