Move strings to own file

This commit is contained in:
Matt Bierner
2018-03-05 11:06:37 -08:00
parent 32e0e2d66c
commit c43fe75976
2 changed files with 12 additions and 3 deletions

View File

@@ -4,11 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import { getSettings } from './settings';
import { getStrings } from './strings';
import { postCommand } from './messaging';
const strings = JSON.parse(document.getElementById('vscode-markdown-preview-data').getAttribute('data-strings'));
const settings = getSettings();
/**
* Shows an alert when there is a content security policy violation.
*/
@@ -28,6 +26,9 @@ export class CspAlerter {
}
private showCspWarning() {
const strings = getStrings();
const settings = getSettings();
if (this.didShow || settings.disableSecurityWarnings) {
return;
}

View File

@@ -0,0 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export function getStrings(): { [key: string]: string } {
return JSON.parse(document.getElementById('vscode-markdown-preview-data').getAttribute('data-strings'));
}