提交 11ffcfcf 编写于 作者: B Benjamin Pasero

remove unused

上级 f014cbcf
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- Theming (do not remove, we want to early load it to avoid flashing background) -->
<style>
.monaco-shell.vs-dark {
background-color: #1E1E1E;
}
</style>
<!-- Helpers -->
<script type="text/javascript">
var fs = require('fs');
var path = require('path');
var electron = require('electron');
var remote = electron.remote;
var ipc = electron.ipcRenderer;
var windowId = remote.getCurrentWindow().id;
function onError(error, enableDeveloperTools) {
if (enableDeveloperTools) {
ipc.send('vscode:openDevTools', windowId);
}
console.error('[uncaught exception]: ' + error);
if (error.stack) {
console.error(error.stack);
}
}
function parseURLQueryArgs() {
var result = {};
var search = window.location.search;
if (search) {
var params = search.split(/[?&]/);
for (var i = 0; i < params.length; i++) {
var param = params[i];
if (param) {
var keyValue = param.split('=');
if (keyValue.length === 2) {
result[keyValue[0]] = decodeURIComponent(keyValue[1]);
}
}
}
}
return result;
}
function createScript(src, onload) {
var script = document.createElement('script');
script.src = src;
script.addEventListener('load', onload);
var head = document.getElementsByTagName('head')[0];
head.insertBefore(script, head.lastChild);
}
function uriFromPath(_path) {
var pathName = path.resolve(_path).replace(/\\/g, '/');
if (pathName.length > 0 && pathName.charAt(0) !== '/') {
pathName = '/' + pathName;
}
return encodeURI('file://' + pathName);
}
function registerListeners(enableDeveloperTools) {
// Devtools & reload support
if (enableDeveloperTools) {
var extractKey = function(e) {
return [
e.ctrlKey ? 'ctrl-' : '',
e.metaKey ? 'meta-' : '',
e.altKey ? 'alt-' : '',
e.shiftKey ? 'shift-' : '',
e.keyCode
].join('');
};
var TOGGLE_DEV_TOOLS_KB = (process.platform === 'darwin' ? 'meta-alt-73' : 'ctrl-shift-73'); // mac: Cmd-Alt-I, rest: Ctrl-Shift-I
var RELOAD_KB = (process.platform === 'darwin' ? 'meta-82' : 'ctrl-82'); // mac: Cmd-R, rest: Ctrl-R
window.addEventListener('keydown', function(e) {
var key = extractKey(e);
if (key === TOGGLE_DEV_TOOLS_KB) {
ipc.send('vscode:toggleDevTools', windowId);
} else if (key === RELOAD_KB) {
ipc.send('vscode:reloadWindow', windowId);
}
});
}
process.on('uncaughtException', function(error) { onError(error, enableDeveloperTools) });
}
function assign(destination, source) {
source => Object.keys(source).forEach(key => destination[key] = source[key]);
return destination;
}
</script>
<!-- Startup Code -->
<script type="text/javascript">
var webFrame = require('electron').webFrame;
var args = parseURLQueryArgs();
var configuration = JSON.parse(args['config']) || {};
var enableDeveloperTools = !configuration.isBuilt || !!configuration.extensionDevelopmentPath;
// Correctly inherit the parent's environment
assign(process.env, configuration.userEnv);
// Get the nls configuration into the process.env as early as possible.
var nlsConfig = { availableLanguages: {} };
var config = process.env['VSCODE_NLS_CONFIG'];
if (config) {
process.env['VSCODE_NLS_CONFIG'] = config;
try {
nlsConfig = JSON.parse(config);
} catch (e) {}
}
var locale = nlsConfig.availableLanguages['*'] || 'en';
if (locale === 'zh-tw') {
locale = 'zh-Hant';
} else if (locale === 'zh-cn') {
locale = 'zh-Hans';
}
window.document.documentElement.setAttribute('lang', locale);
registerListeners(enableDeveloperTools);
// We get the global settings through a remote call from the browser
// because its value can change dynamically.
var globalSettings;
var globalSettingsValue = remote.getGlobal('globalSettingsValue');
if (globalSettingsValue) {
globalSettings = JSON.parse(globalSettingsValue);
} else {
globalSettings = {
settings: {},
keybindings: []
};
}
// disable pinch zoom & apply zoom level early to avoid glitches
var windowConfiguration = globalSettings.settings && globalSettings.settings.window;
webFrame.setZoomLevelLimits(1, 1);
if (windowConfiguration && typeof windowConfiguration.zoomLevel === 'number' && windowConfiguration.zoomLevel !== 0) {
webFrame.setZoomLevel(windowConfiguration.zoomLevel);
}
// Load the loader and start loading the workbench
var rootUrl = uriFromPath(configuration.appRoot) + '/out';
// In the bundled version the nls plugin is packaged with the loader so the NLS Plugins
// loads as soon as the loader loads. To be able to have pseudo translation
createScript(rootUrl + '/vs/loader.js', function() {
define('fs', ['original-fs'], function(originalFS) { return originalFS; }); // replace the patched electron fs with the original node fs for all AMD code
require.config({
baseUrl: rootUrl,
'vs/nls': nlsConfig,
recordStats: configuration.enablePerformance,
ignoreDuplicateModules: [
'vs/workbench/parts/search/common/searchQuery'
]
});
if (nlsConfig.pseudo) {
require(['vs/nls'], function(nlsPlugin) {
nlsPlugin.setPseudoTranslation(nlsConfig.pseudo);
});
}
window.MonacoEnvironment = {};
var timers = window.MonacoEnvironment.timers = {
start: new Date()
};
if (configuration.enablePerformance) {
var programStart = remote.getGlobal('programStart');
var vscodeStart = remote.getGlobal('vscodeStart');
if (programStart) {
timers.beforeProgram = new Date(programStart);
timers.afterProgram = new Date(vscodeStart);
}
timers.vscodeStart = new Date(vscodeStart);
timers.start = new Date(programStart || vscodeStart);
}
timers.beforeLoad = new Date();
require([
'vs/workbench/workbench.main',
'vs/nls!vs/workbench/workbench.main',
'vs/css!vs/workbench/workbench.main'
], () => {
timers.afterLoad = new Date();
const main = require('vs/workbench/electron-browser/main')
.startup(configuration, globalSettings)
.done(null, error => onError(error, enableDeveloperTools));
});
});
</script>
</head>
<body class="monaco-shell vs-dark" aria-label="">
<script>
(function() {
try {
var theme = window.localStorage.getItem('storage://global/workbench.theme');
if (theme) {
var baseTheme = theme.split(' ')[0];
if (baseTheme !== 'vs-dark') {
window.document.body.className = 'monaco-shell ' + baseTheme;
}
}
} catch (error) {
console.error(error);
}
})();
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册