Add link to terms and privacy policy in about window

This commit is contained in:
Scott Nonnenberg 2018-06-01 17:43:01 -07:00
parent 0abdd5ead1
commit 9ef7c42097
4 changed files with 28 additions and 3 deletions

View file

@ -1,4 +1,8 @@
{
"privacyPolicy": {
"message": "Terms & Privacy Policy",
"description": "Shown in the about box for the link to https://signal.org/legal"
},
"mainMenuFile": {
"message": "&File",
"description": "The label that is used for the File menu in the program main menu. The '&' indicates that the following letter will be used as the keyboard 'shortcut letter' for accessing the menu with the Alt-<letter> combination."

View file

@ -11,8 +11,7 @@ body {
}
img {
margin-top: 2em;
margin-bottom: 1em;
margin-top: 1em;
}
a {
@ -47,6 +46,10 @@ a {
<div>
<a href="https://signal.org">signal.org</a>
</div>
<br>
<div>
<a class="privacy" href="https://signal.org/legal">Terms &amp; Privacy Policy</a>
</div>
<script type='text/javascript' src='node_modules/jquery/dist/jquery.js'></script>
<script>
@ -55,6 +58,8 @@ $(document).on('keyup', function(e) {
window.closeAbout();
}
});
$('.privacy').text(window.i18n('privacyPolicy'));
</script>

15
about_preload.js Normal file
View file

@ -0,0 +1,15 @@
const { ipcRenderer } = require('electron');
const url = require('url');
const i18n = require('./js/modules/i18n');
const config = url.parse(window.location.toString(), true).query;
const { locale } = config;
const localeMessages = ipcRenderer.sendSync('locale-data');
window.getEnvironment = () => config.environment;
window.getVersion = () => config.version;
window.getAppInstance = () => config.appInstance;
window.closeAbout = () => ipc.send('close-about');
window.i18n = i18n.setup(locale, localeMessages);

View file

@ -419,7 +419,8 @@ function showAbout() {
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false,
preload: path.join(__dirname, 'preload.js'),
preload: path.join(__dirname, 'about_preload.js'),
// sandbox: true,
nativeWindowOpen: true,
},
parent: mainWindow,