mirror of
https://github.com/microsoft/vscode.git
synced 2026-03-03 23:39:31 +00:00
Move strings to own file
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
8
extensions/markdown/preview-src/strings.ts
Normal file
8
extensions/markdown/preview-src/strings.ts
Normal 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'));
|
||||
}
|
||||
Reference in New Issue
Block a user