mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { SimpleBrowserManager } from './simpleBrowserManager';
|
||||
import { SimpleBrowserView } from './simpleBrowserView';
|
||||
|
||||
@@ -13,8 +12,6 @@ declare class URL {
|
||||
hostname: string;
|
||||
}
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
const openApiCommand = 'simpleBrowser.api.open';
|
||||
const showCommand = 'simpleBrowser.show';
|
||||
|
||||
@@ -48,8 +45,8 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
context.subscriptions.push(vscode.commands.registerCommand(showCommand, async (url?: string) => {
|
||||
if (!url) {
|
||||
url = await vscode.window.showInputBox({
|
||||
placeHolder: localize('simpleBrowser.show.placeholder', "https://example.com"),
|
||||
prompt: localize('simpleBrowser.show.prompt', "Enter url to visit")
|
||||
placeHolder: vscode.l10n.t("https://example.com"),
|
||||
prompt: vscode.l10n.t("Enter url to visit")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,7 +81,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
}, {
|
||||
schemes: ['http', 'https'],
|
||||
label: localize('openTitle', "Open in simple browser"),
|
||||
label: vscode.l10n.t("Open in simple browser"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { Disposable } from './dispose';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export interface ShowOptions {
|
||||
readonly preserveFocus?: boolean;
|
||||
@@ -17,7 +15,7 @@ export interface ShowOptions {
|
||||
export class SimpleBrowserView extends Disposable {
|
||||
|
||||
public static readonly viewType = 'simpleBrowser.view';
|
||||
private static readonly title = localize('view.title', "Simple Browser");
|
||||
private static readonly title = vscode.l10n.t("Simple Browser");
|
||||
|
||||
private readonly _webviewPanel: vscode.WebviewPanel;
|
||||
|
||||
@@ -134,15 +132,15 @@ export class SimpleBrowserView extends Disposable {
|
||||
<header class="header">
|
||||
<nav class="controls">
|
||||
<button
|
||||
title="${localize('control.back.title', "Back")}"
|
||||
title="${vscode.l10n.t("Back")}"
|
||||
class="back-button icon"><i class="codicon codicon-arrow-left"></i></button>
|
||||
|
||||
<button
|
||||
title="${localize('control.forward.title', "Forward")}"
|
||||
title="${vscode.l10n.t("Forward")}"
|
||||
class="forward-button icon"><i class="codicon codicon-arrow-right"></i></button>
|
||||
|
||||
<button
|
||||
title="${localize('control.reload.title', "Reload")}"
|
||||
title="${vscode.l10n.t("Reload")}"
|
||||
class="reload-button icon"><i class="codicon codicon-refresh"></i></button>
|
||||
</nav>
|
||||
|
||||
@@ -150,12 +148,12 @@ export class SimpleBrowserView extends Disposable {
|
||||
|
||||
<nav class="controls">
|
||||
<button
|
||||
title="${localize('control.openExternal.title', "Open in browser")}"
|
||||
title="${vscode.l10n.t("Open in browser")}"
|
||||
class="open-external-button icon"><i class="codicon codicon-link-external"></i></button>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="content">
|
||||
<div class="iframe-focused-alert">${localize('view.iframe-focused', "Focus Lock")}</div>
|
||||
<div class="iframe-focused-alert">${vscode.l10n.t("Focus Lock")}</div>
|
||||
<iframe sandbox="allow-scripts allow-forms allow-same-origin"></iframe>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user