Added link preview setting.

pull/186/head
Mikunj 5 years ago
parent 27c6062351
commit 725a41a8d7

@ -1102,6 +1102,17 @@
"message": "General",
"description": "Header for general options on the settings screen"
},
"sendLinkPreviews": {
"message": "Send Link Previews",
"description":
"Option to control creation and send of link previews in setting screen"
},
"linkPreviewsDescription": {
"message":
"Enable local link previews (Restart for changes to take effect)",
"description":
"Additional detail provided for Link Previews option in settings screen"
},
"spellCheckDescription": {
"message": "Enable spell check of text entered in message composition box",
"description": "Description of the media permission description"

@ -254,6 +254,11 @@
getReadReceiptSetting: () => storage.get('read-receipt-setting'),
setReadReceiptSetting: value =>
storage.put('read-receipt-setting', value),
getLinkPreviewSetting: () => storage.get('linkPreviews', false),
setLinkPreviewSetting: value =>
storage.put('linkPreviews', value),
getNotificationSetting: () =>
storage.get('notification-setting', 'message'),
setNotificationSetting: value =>

@ -20,6 +20,7 @@ const getInitialData = async () => ({
messageTTL: await window.getMessageTTL(),
readReceiptSetting: await window.getReadReceiptSetting(),
linkPreviewSetting: await window.getLinkPreviewSetting(),
notificationSetting: await window.getNotificationSetting(),
audioNotification: await window.getAudioNotification(),

@ -155,6 +155,12 @@
value: window.initialData.hideMenuBar,
setFn: window.setHideMenuBar,
});
new CheckboxView({
el: this.$('.link-preview-setting'),
name: 'link-preview-setting',
value: window.initialData.linkPreviewSetting,
setFn: window.setLinkPreviewSetting,
});
new MediaPermissionsSettingView({
el: this.$('.media-permissions'),
value: window.initialData.mediaPermissions,

@ -1091,6 +1091,9 @@ installSettingsSetter('notification-setting');
installSettingsGetter('audio-notification');
installSettingsSetter('audio-notification');
installSettingsGetter('link-preview-setting');
installSettingsSetter('link-preview-setting');
installSettingsGetter('spell-check');
installSettingsSetter('spell-check');

@ -171,6 +171,9 @@ installSetter('notification-setting', 'setNotificationSetting');
installGetter('audio-notification', 'getAudioNotification');
installSetter('audio-notification', 'setAudioNotification');
installGetter('link-preview-setting', 'getLinkPreviewSetting');
installSetter('link-preview-setting', 'setLinkPreviewSetting');
installGetter('spell-check', 'getSpellCheck');
installSetter('spell-check', 'setSpellCheck');

@ -98,6 +98,10 @@
<input type='checkbox' name='spell-check-setting' id='spell-check-setting' />
<label for='spell-check-setting'>{{ spellCheckDescription }}</label>
</div>
<div class='link-preview-setting'>
<input type='checkbox' name='link-preview-setting' id='link-preview-setting' />
<label for='link-preview-setting'>{{ linkPreviewsDescription }}</label>
</div>
<hr>
<div class='permissions-setting'>
<h3>{{ permissions }}</h3>

@ -52,6 +52,9 @@ window.setNotificationSetting = makeSetter('notification-setting');
window.getAudioNotification = makeGetter('audio-notification');
window.setAudioNotification = makeSetter('audio-notification');
window.getLinkPreviewSetting = makeGetter('link-preview-setting');
window.setLinkPreviewSetting = makeSetter('link-preview-setting');
window.getMediaPermissions = makeGetter('media-permissions');
window.setMediaPermissions = makeSetter('media-permissions');

Loading…
Cancel
Save