Move test pages to /test/manual/

This commit is contained in:
Alex Dima 2021-11-16 22:25:24 +01:00
parent 32f9897bf2
commit 430d8e6e17
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
147 changed files with 8 additions and 8 deletions

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
overflow: hidden;
}
#container {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.dev-setup-control {
display: none;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="../../../metadata.js"></script>
<script src="../dev-setup.js"></script>
<script src="iframe.js"></script>
</body>
</html>

View file

@ -0,0 +1,22 @@
const init = () => {
loadEditor(function () {
// create the editor
const target = document.getElementById('container');
const editor = monaco.editor.create(target, { language: 'html' });
// load some sample data
(async () => {
const response = await fetch('https://microsoft.github.io/monaco-editor/');
const html = await response.text();
editor.getModel().setValue(html);
})();
});
};
window.addEventListener('DOMContentLoaded', () => {
if (!window.innerWidth || !window.innerHeight) {
window.addEventListener('resize', init, { once: true });
} else {
init();
}
});

View file

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<script type="module">
class MonacoEditorElement extends HTMLElement {
constructor() {
super();
this.style = 'display: block;';
const shadow = this.attachShadow({ mode: 'open' });
const iframe = document.createElement('iframe');
iframe.src = new URL('iframe.html?editor=src', import.meta.url).href;
iframe.style = `width: 100%; height: 100%;`;
shadow.appendChild(iframe);
}
}
customElements.define('monaco-editor', MonacoEditorElement);
</script>
<style>
section {
margin: 80px;
}
iframe,
monaco-editor {
width: 640px;
height: 400px;
}
</style>
</head>
<body>
<section>
<h1>Monaco in a shadowRoot + iframe context</h1>
<monaco-editor></monaco-editor>
</section>
<hr />
<section>
<h1>Monaco in an iframe context</h1>
<iframe src="iframe.html?editor=src"></iframe>
</section>
</body>
</html>

View file

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<title>Editor in tiny iframe</title>
<style>
#myIframe {
border: 1px solid pink;
}
</style>
</head>
<body>
<h2>Monaco Editor inside iframes sample</h2>
<br />
<br />
<iframe id="myIframe"></iframe>
<br />
<script>
var myIframe = document.getElementById('myIframe');
myIframe.style.width = '400px';
myIframe.style.height = '100px';
myIframe.style.display = 'block';
myIframe.style.visibility = 'visible';
const longText = `function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}function x() {\n\tconsole.log("Hello world!");\n}function x()
{\n\tconsole.log("Hello world!");\n}`;
const iframeDoc = myIframe.contentDocument;
const iframeWin = myIframe.contentWindow;
const injectSourceFiles = function () {
iframeWin.require.config({
paths: {
vs: '/vscode/out/vs'
}
});
iframeWin.require(['vs/editor/editor.main'], function () {
const container = iframeDoc.createElement('div');
container.setAttribute('id', 'container');
container.style.height = '100vh';
iframeDoc.body.appendChild(container);
var editor = iframeWin.monaco.editor.create(iframeDoc.getElementById('container'), {
value: longText,
language: 'javascript'
});
iframeWin.onresize = function () {
editor.layout();
};
});
};
const script = iframeDoc.createElement('script');
script.src = '/vscode/out/vs/loader.js';
script.onload = injectSourceFiles;
iframeDoc.head.appendChild(script);
</script>
</body>
</html>

View file

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style>
html,
body {
height: 100%;
}
body {
margin: 0;
overflow: hidden;
}
#container {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.dev-setup-control {
display: none;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="../../../metadata.js"></script>
<script src="../dev-setup.js"></script>
<script src="iframe.js"></script>
</body>
</html>

View file

@ -0,0 +1,22 @@
const init = () => {
loadEditor(function () {
// create the editor
const target = document.getElementById('container');
const editor = monaco.editor.create(target, { language: 'html' });
// load some sample data
(async () => {
const response = await fetch('https://microsoft.github.io/monaco-editor/');
const html = await response.text();
editor.getModel().setValue(html);
})();
});
};
window.addEventListener('DOMContentLoaded', () => {
if (!window.innerWidth || !window.innerHeight) {
window.addEventListener('resize', init, { once: true });
} else {
init();
}
});

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head> </head>
<body>
<iframe
src="http://localhost:8088/monaco-editor/test/manual/2264/iframe.html?editor=src"
style="width: 800px; height: 600px"
sandbox="allow-same-origin allow-scripts allow-popups allow-modals allow-forms allow-downloads"
></iframe>
</body>
</html>

54
test/manual/colorize.html Normal file
View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<h2>Colorize example</h2>
<pre id="code" data-lang="text/css" style="width: 500px">
/* Some example CSS */
@import url("something.css");
body {
margin: 0;
padding: 3em 6em;
font-family: tahoma, arial, sans-serif;
color: #000;
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.7em;
}
h1:before, h2:before {
content: "some contents";
}
code {
font-family: courier, monospace;
font-size: 80%;
color: #418A8A;
}
</pre
>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
monaco.editor.colorizeElement(document.getElementById('code'));
});
</script>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<h2>Monaco Editor wrong cross origin</h2>
<div style="clear: both"></div>
<div
id="container"
style="float: left; width: 800px; height: 450px; border: 1px solid grey"
></div>
<div style="clear: both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
monaco.editor.create(document.getElementById('container'), {
value: document.documentElement.innerHTML,
language: 'css'
});
}, 'http://localhost:8088');
</script>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<h2>Monaco Editor cross origin correct</h2>
<div style="clear: both"></div>
<div
id="container"
style="float: left; width: 800px; height: 450px; border: 1px solid grey"
></div>
<div style="clear: both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
window.MonacoEnvironment = {
getWorkerUrl: function () {
return 'cross-origin-worker-proxy.js#http://localhost:8088' + RESOLVED_CORE_PATH;
}
};
</script>
<script>
loadEditor(function () {
monaco.editor.create(document.getElementById('container'), {
value: document.documentElement.innerHTML,
language: 'css'
});
}, 'http://localhost:8088');
</script>
</body>
</html>

View file

@ -0,0 +1,10 @@
var baseUrl = self.location.hash;
baseUrl = baseUrl.replace(/^#/, '');
baseUrl = baseUrl.replace(/vs$/, '');
console.log('WORKER BASE_URL: ' + baseUrl);
self.MonacoEnvironment = {
baseUrl: baseUrl
};
importScripts(baseUrl + 'vs/base/worker/workerMain.js');

244
test/manual/dev-setup.js Normal file
View file

@ -0,0 +1,244 @@
(function () {
let IS_FILE_PROTOCOL = window.location.protocol === 'file:';
let DIRNAME = null;
if (IS_FILE_PROTOCOL) {
let port = window.location.port;
if (port.length > 0) {
port = ':' + port;
}
DIRNAME =
window.location.protocol +
'//' +
window.location.hostname +
port +
window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/'));
let bases = document.getElementsByTagName('base');
if (bases.length > 0) {
DIRNAME = DIRNAME + '/' + bases[0].getAttribute('href');
}
}
let LOADER_OPTS = (function () {
function parseQueryString() {
let str = window.location.search;
str = str.replace(/^\?/, '');
let pieces = str.split(/&/);
let result = {};
pieces.forEach(function (piece) {
let config = piece.split(/=/);
result[config[0]] = config[1];
});
return result;
}
let overwrites = parseQueryString();
let result = {};
result['editor'] = overwrites['editor'] || 'npm/dev';
METADATA.PLUGINS.map(function (plugin) {
result[plugin.name] = overwrites[plugin.name] || 'dev';
});
return result;
})();
function toHREF(search) {
let port = window.location.port;
if (port.length > 0) {
port = ':' + port;
}
return (
window.location.protocol +
'//' +
window.location.hostname +
port +
window.location.pathname +
search +
window.location.hash
);
}
function Component(name, modulePrefix, paths, rootPath, contrib) {
this.name = name;
this.modulePrefix = modulePrefix;
this.paths = paths;
this.rootPath = rootPath;
this.contrib = contrib;
this.selectedPath = LOADER_OPTS[name];
}
Component.prototype.isRelease = function () {
return /release/.test(this.selectedPath);
};
Component.prototype.getResolvedPath = function (PATH_PREFIX) {
let resolvedPath = this.paths[this.selectedPath];
if (/\.\//.test(resolvedPath)) {
// starts with ./ => treat as relative to the root path
if (IS_FILE_PROTOCOL) {
resolvedPath = DIRNAME + '/../' + this.rootPath + '/' + resolvedPath;
} else {
resolvedPath = PATH_PREFIX + '/monaco-editor/' + this.rootPath + '/' + resolvedPath;
}
} else if (
this.selectedPath === 'npm/dev' ||
this.selectedPath === 'npm/min' ||
this.isRelease()
) {
if (IS_FILE_PROTOCOL) {
resolvedPath = DIRNAME + '/../' + resolvedPath;
} else {
resolvedPath = PATH_PREFIX + '/monaco-editor/' + resolvedPath;
}
} else {
if (IS_FILE_PROTOCOL) {
resolvedPath = DIRNAME + '/../..' + resolvedPath;
} else {
resolvedPath = PATH_PREFIX + resolvedPath;
}
}
return resolvedPath;
};
Component.prototype.generateLoaderConfig = function (dest, PATH_PREFIX) {
dest[this.modulePrefix] = this.getResolvedPath(PATH_PREFIX);
};
Component.prototype.generateUrlForPath = function (pathName) {
let NEW_LOADER_OPTS = {};
Object.keys(LOADER_OPTS).forEach(function (key) {
NEW_LOADER_OPTS[key] = LOADER_OPTS[key] === 'npm/dev' ? undefined : LOADER_OPTS[key];
});
NEW_LOADER_OPTS[this.name] = pathName === 'npm/dev' ? undefined : pathName;
let search = Object.keys(NEW_LOADER_OPTS)
.map(function (key) {
let value = NEW_LOADER_OPTS[key];
if (value) {
return key + '=' + value;
}
return '';
})
.filter(function (assignment) {
return !!assignment;
})
.join('&amp;');
if (search.length > 0) {
search = '?' + search;
}
return toHREF(search);
};
Component.prototype.renderLoadingOptions = function () {
return (
'<strong style="width:130px;display:inline-block;">' +
this.name +
'</strong>:&#160;&#160;&#160;' +
Object.keys(this.paths)
.map(
function (pathName) {
if (pathName === this.selectedPath) {
return '<strong>' + pathName + '</strong>';
}
return '<a href="' + this.generateUrlForPath(pathName) + '">' + pathName + '</a>';
}.bind(this)
)
.join('&#160;&#160;&#160;')
);
};
let RESOLVED_CORE = new Component('editor', 'vs', METADATA.CORE.paths);
self.RESOLVED_CORE_PATH = RESOLVED_CORE.getResolvedPath('');
let RESOLVED_PLUGINS = METADATA.PLUGINS.map(function (plugin) {
return new Component(
plugin.name,
plugin.modulePrefix,
plugin.paths,
plugin.rootPath,
plugin.contrib
);
});
METADATA = null;
function loadScript(path, callback) {
let script = document.createElement('script');
script.onload = callback;
script.async = true;
script.type = 'text/javascript';
script.src = path;
document.head.appendChild(script);
}
(function () {
let allComponents = [RESOLVED_CORE];
if (!RESOLVED_CORE.isRelease()) {
allComponents = allComponents.concat(RESOLVED_PLUGINS);
}
let div = document.createElement('div');
div.className = 'dev-setup-control';
div.style.position = 'fixed';
div.style.top = 0;
div.style.right = 0;
div.style.background = 'lightgray';
div.style.padding = '5px 20px 5px 5px';
div.style.zIndex = '1000';
div.innerHTML =
'<ul><li>' +
allComponents
.map(function (component) {
return component.renderLoadingOptions();
})
.join('</li><li>') +
'</li></ul>';
document.body.appendChild(div);
let aElements = document.getElementsByTagName('a');
for (let i = 0; i < aElements.length; i++) {
let aElement = aElements[i];
if (aElement.className === 'loading-opts') {
aElement.href += window.location.search;
}
}
})();
self.getCodiconPath = function (PATH_PREFIX) {
PATH_PREFIX = PATH_PREFIX || '';
const result = RESOLVED_CORE.getResolvedPath(PATH_PREFIX);
return result + '/base/browser/ui/codicons/codicon/codicon.ttf';
};
self.loadEditor = function (callback, PATH_PREFIX) {
PATH_PREFIX = PATH_PREFIX || '';
loadScript(RESOLVED_CORE.getResolvedPath(PATH_PREFIX) + '/loader.js', function () {
let loaderPathsConfig = {};
if (!RESOLVED_CORE.isRelease()) {
RESOLVED_PLUGINS.forEach(function (plugin) {
plugin.generateLoaderConfig(loaderPathsConfig, PATH_PREFIX);
});
}
RESOLVED_CORE.generateLoaderConfig(loaderPathsConfig, PATH_PREFIX);
console.log('LOADER CONFIG: ');
console.log(JSON.stringify(loaderPathsConfig, null, '\t'));
require.config({
paths: loaderPathsConfig
// 'vs/nls' : {
// availableLanguages: {
// '*': 'de'
// }
// }
});
require(['vs/editor/editor.main'], function () {
if (!RESOLVED_CORE.isRelease()) {
// At this point we've loaded the monaco-editor-core
require(RESOLVED_PLUGINS.map(function (plugin) {
return plugin.contrib;
}), function () {
// At this point we've loaded all the plugins
callback();
});
} else {
callback();
}
});
});
};
})();

21
test/manual/diff.html Normal file
View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<div
id="container"
style="float: left; width: 800px; height: 450px; border: 1px solid grey"
></div>
<div style="clear: both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
require(['./diff'], function () {});
});
</script>
</body>
</html>

451
test/manual/diff.js Normal file
View file

@ -0,0 +1,451 @@
/// <reference path="../../node_modules/monaco-editor-core/monaco.d.ts" />
define(['require'], function (require) {
var container = document.getElementById('container');
var original = monaco.editor.createModel(getOriginalStr(), 'javascript');
var modified = monaco.editor.createModel(getModifiedStr(), 'javascript');
var diffEditor = monaco.editor.createDiffEditor(container, {});
diffEditor.setModel({
original: original,
modified: modified
});
});
function getOriginalStr() {
return [
'/*',
' © Microsoft. All rights reserved.',
'',
' This library is supported for use in Windows Tailored Apps only.',
'',
' Build: 6.2.8100.0',
' Version: 0.5',
'*/',
'',
'(function (global, undefined) {',
' "use strict";',
' undefinedVariable = {};',
' undefinedVariable.prop = 5;',
'',
' function initializeProperties(target, members) {',
' var keys = Object.keys(members);',
' var properties;',
' var i, len;',
' for (i = 0, len = keys.length; i < len; i++) {',
' var key = keys[i];',
' var enumerable = key.charCodeAt(0) !== /*_*/95;',
' var member = members[key];',
" if (member && typeof member === 'object') {",
" if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {",
' if (member.enumerable === undefined) {',
' member.enumerable = enumerable;',
' }',
' properties = properties || {};',
' properties[key] = member;',
' continue;',
' }',
' }',
' // These next lines will be deleted',
' if (!enumerable) {',
' properties = properties || {};',
' properties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true }',
' continue;',
' }',
' target[key] = member;',
' }',
' if (properties) {',
' Object.defineProperties(target, properties);',
' }',
' }',
'',
' (function (rootNamespace) {',
'',
' // Create the rootNamespace in the global namespace',
' if (!global[rootNamespace]) {',
' global[rootNamespace] = Object.create(Object.prototype);',
' }',
'',
' // Cache the rootNamespace we just created in a local variable',
' var _rootNamespace = global[rootNamespace];',
' if (!_rootNamespace.Namespace) {',
' _rootNamespace.Namespace = Object.create(Object.prototype);',
' }',
'',
' function defineWithParent(parentNamespace, name, members) {',
' /// <summary locid="1">',
' /// Defines a new namespace with the specified name, under the specified parent namespace.',
' /// </summary>',
' /// <param name="parentNamespace" type="Object" locid="2">',
' /// The parent namespace which will contain the new namespace.',
' /// </param>',
' /// <param name="name" type="String" locid="3">',
' /// Name of the new namespace.',
' /// </param>',
' /// <param name="members" type="Object" locid="4">',
' /// Members in the new namespace.',
' /// </param>',
' /// <returns locid="5">',
' /// The newly defined namespace.',
' /// </returns>',
' var currentNamespace = parentNamespace,',
' namespaceFragments = name.split(".");',
'',
' for (var i = 0, len = namespaceFragments.length; i < len; i++) {',
' var namespaceName = namespaceFragments[i];',
' if (!currentNamespace[namespaceName]) {',
' Object.defineProperty(currentNamespace, namespaceName,',
' { value: {}, writable: false, enumerable: true, configurable: true }',
' );',
' }',
' currentNamespace = currentNamespace[namespaceName];',
' }',
'',
' if (members) {',
' initializeProperties(currentNamespace, members);',
' }',
'',
' return currentNamespace;',
' }',
'',
' function define(name, members) {',
' /// <summary locid="6">',
' /// Defines a new namespace with the specified name.',
' /// </summary>',
' /// <param name="name" type="String" locid="7">',
' /// Name of the namespace. This could be a dot-separated nested name.',
' /// </param>',
' /// <param name="members" type="Object" locid="4">',
' /// Members in the new namespace.',
' /// </param>',
' /// <returns locid="5">',
' /// The newly defined namespace.',
' /// </returns>',
' return defineWithParent(global, name, members);',
' }',
'',
' // Establish members of the "WinJS.Namespace" namespace',
' Object.defineProperties(_rootNamespace.Namespace, {',
'',
' defineWithParent: { value: defineWithParent, writable: true, enumerable: true },',
'',
' define: { value: define, writable: true, enumerable: true }',
'',
' });',
'',
' })("WinJS");',
'',
' (function (WinJS) {',
'',
' function define(constructor, instanceMembers, staticMembers) {',
' /// <summary locid="8">',
' /// Defines a class using the given constructor and with the specified instance members.',
' /// </summary>',
' /// <param name="constructor" type="Function" locid="9">',
' /// A constructor function that will be used to instantiate this class.',
' /// </param>',
' /// <param name="instanceMembers" type="Object" locid="10">',
' /// The set of instance fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <param name="staticMembers" type="Object" locid="11">',
' /// The set of static fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <returns type="Function" locid="12">',
' /// The newly defined class.',
' /// </returns>',
' constructor = constructor || function () { };',
' if (instanceMembers) {',
' initializeProperties(constructor.prototype, instanceMembers);',
' }',
' if (staticMembers) {',
' initializeProperties(constructor, staticMembers);',
' }',
' return constructor;',
' }',
'',
' function derive(baseClass, constructor, instanceMembers, staticMembers) {',
' /// <summary locid="13">',
' /// Uses prototypal inheritance to create a sub-class based on the supplied baseClass parameter.',
' /// </summary>',
' /// <param name="baseClass" type="Function" locid="14">',
' /// The class to inherit from.',
' /// </param>',
' /// <param name="constructor" type="Function" locid="9">',
' /// A constructor function that will be used to instantiate this class.',
' /// </param>',
' /// <param name="instanceMembers" type="Object" locid="10">',
' /// The set of instance fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <param name="staticMembers" type="Object" locid="11">',
' /// The set of static fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <returns type="Function" locid="12">',
' /// The newly defined class.',
' /// </returns>',
' if (baseClass) {',
' constructor = constructor || function () { };',
' var basePrototype = baseClass.prototype;',
' constructor.prototype = Object.create(basePrototype);',
' Object.defineProperty(constructor.prototype, "_super", { value: basePrototype });',
' Object.defineProperty(constructor.prototype, "constructor", { value: constructor });',
' if (instanceMembers) {',
' initializeProperties(constructor.prototype, instanceMembers);',
' }',
' if (staticMembers) {',
' initializeProperties(constructor, staticMembers);',
' }',
' return constructor;',
' } else {',
' return define(constructor, instanceMembers, staticMembers);',
' }',
' }',
'',
' function mix(constructor) {',
' /// <summary locid="15">',
' /// Defines a class using the given constructor and the union of the set of instance members',
' /// specified by all the mixin objects. The mixin parameter list can be of variable length.',
' /// </summary>',
' /// <param name="constructor" locid="9">',
' /// A constructor function that will be used to instantiate this class.',
' /// </param>',
' /// <returns locid="12">',
' /// The newly defined class.',
' /// </returns>',
' constructor = constructor || function () { };',
' var i, len;',
' for (i = 0, len = arguments.length; i < len; i++) {',
' initializeProperties(constructor.prototype, arguments[i]);',
' }',
' return constructor;',
' }',
'',
' // Establish members of "WinJS.Class" namespace',
' WinJS.Namespace.define("WinJS.Class", {',
' define: define,',
' derive: derive,',
' mix: mix',
' });',
'',
' })(WinJS);',
'',
'})(this);'
].join('\n');
}
function getModifiedStr() {
return [
'/*',
' © Microsoft. All rights reserved.',
'',
' This library is supported for use in Windows Tailored Apps only.',
'',
' Build: 6.2.8100.0',
' Version: 0.5',
'*/',
'',
'// Here are some inserted lines',
'// with some extra comments',
'',
'(function (global, undefined) {',
' "use strict";',
' var definedVariable = {};',
' definedVariable.prop = 5;',
'',
' function initializeProperties(target, members) {',
' var keys = Object.keys(members);',
' var properties;',
' var i, len;',
' for (i = 0, len = keys.length; i < len; i++) {',
' var key = keys[i];',
' var enumerable = key.charCodeAt(0) !== /*_*/95;',
' var member = members[key];',
" if (member && typeof member === 'object') {",
" if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {",
' if (member.enumerable === undefined) {',
' member.enumerable = enumerable;',
' }',
' properties = properties || {};',
' properties[key] = member;',
' continue;',
' }',
' }',
' target[key] = member;',
' }',
' if (properties) {',
' Object.defineProperties(target, properties);',
' }',
' }',
'',
' (function (rootNamespace) {',
'',
' // Create the rootNamespace in the global namespace',
' if (!global[rootNamespace]) {',
' global[rootNamespace] = Object.create(Object.prototype);',
' }',
'',
' // Cache the rootNamespace we just created in a local variable',
' var _rootNamespace = global[rootNamespace];',
' if (!_rootNamespace.Namespace) {',
' _rootNamespace.Namespace = Object.create(Object.prototype);',
' }',
'',
' function defineWithParent(parentNamespace, name, members) {',
' /// <summary locid="1">',
' /// Defines a new namespace with the specified name, under the specified parent namespace.',
' /// </summary>',
' /// <param name="parentNamespace" type="Object" locid="2">',
' /// The parent namespace which will contain the new namespace.',
' /// </param>',
' /// <param name="name" type="String" locid="3">',
' /// Name of the new namespace.',
' /// </param>',
' /// <param name="members" type="Object" locid="4">',
' /// Members in the new namespace.',
' /// </param>',
' /// <returns locid="5">',
' /// The newly defined namespace.',
' /// </returns>',
' var currentNamespace = parentNamespace,',
' namespaceFragments = name.split(".");',
'',
' for (var i = 0, len = namespaceFragments.length; i < len; i++) {',
' var namespaceName = namespaceFragments[i];',
' if (!currentNamespace[namespaceName]) {',
' Object.defineProperty(currentNamespace, namespaceName,',
' { value: {}, writable: false, enumerable: true, configurable: true }',
' );',
' }',
' currentNamespace = currentNamespace[namespaceName];',
' }',
'',
' if (members) {',
' initializeProperties(currentNamespace, members);',
' }',
'',
' return currentNamespace;',
' }',
'',
' function define(name, members) {',
' /// <summary locid="6">',
' /// Defines a new namespace with the specified name.',
' /// </summary>',
' /// <param name="name" type="String" locid="7">',
' /// Name of the namespace. This could be a dot-separated nested name.',
' /// </param>',
' /// <param name="members" type="Object" locid="4">',
' /// Members in the new namespace.',
' /// </param>',
' /// <returns locid="5">',
' /// The newly defined namespace.',
' /// </returns>',
' return defineWithParent(global, name, members);',
' }',
'',
' // Establish members of the "WinJS.Namespace" namespace',
' Object.defineProperties(_rootNamespace.Namespace, {',
'',
' defineWithParent: { value: defineWithParent, writable: true, enumerable: true },',
'',
' define: { value: define, writable: true, enumerable: true }',
'',
' });',
'',
' })("WinJS");',
'',
' (function (WinJS) {',
'',
' function define(constructor, instanceMembers, staticMembers) {',
' /// <summary locid="8">',
' /// Defines a class using the given constructor and with the specified instance members.',
' /// </summary>',
' /// <param name="constructor" type="Function" locid="9">',
' /// A constructor function that will be used to instantiate this class.',
' /// </param>',
' /// <param name="instanceMembers" type="Object" locid="10">',
' /// The set of instance fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <param name="staticMembers" type="Object" locid="11">',
' /// The set of static fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <returns type="Function" locid="12">',
' /// The newly defined class.',
' /// </returns>',
' constructor = constructor || function () { };',
' if (instanceMembers) {',
' initializeProperties(constructor.prototype, instanceMembers);',
' }',
' if (staticMembers) {',
' initializeProperties(constructor, staticMembers);',
' }',
' return constructor;',
' }',
'',
' function derive(baseClass, constructor, instanceMembers, staticMembers) {',
' /// <summary locid="13">',
' /// Uses prototypal inheritance to create a sub-class based on the supplied baseClass parameter.',
' /// </summary>',
' /// <param name="baseClass" type="Function" locid="14">',
' /// The class to inherit from.',
' /// </param>',
' /// <param name="constructor" type="Function" locid="9">',
' /// A constructor function that will be used to instantiate this class.',
' /// </param>',
' /// <param name="instanceMembers" type="Object" locid="10">',
' /// The set of instance fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <param name="staticMembers" type="Object" locid="11">',
' /// The set of static fields, properties and methods to be made available on the class.',
' /// </param>',
' /// <returns type="Function" locid="12">',
' /// The newly defined class.',
' /// </returns>',
' if (baseClass) {',
' constructor = constructor || function () { };',
' var basePrototype = baseClass.prototype;',
' constructor.prototype = Object.create(basePrototype);',
' Object.defineProperty(constructor.prototype, "_super", { value: basePrototype });',
' Object.defineProperty(constructor.prototype, "constructor", { value: constructor });',
' if (instanceMembers) {',
' initializeProperties(constructor.prototype, instanceMembers);',
' }',
' if (staticMembers) {',
' initializeProperties(constructor, staticMembers);',
' }',
' return constructor;',
' } else {',
' return define(constructor, instanceMembers, staticMembers);',
' }',
' }',
'',
' function mix(constructor) {',
' /// <summary locid="15">',
' /// Defines a class using the given constructor and the union of the set of instance members',
' /// specified by all the mixin objects. The mixin parameter list can be of variable length.',
' /// </summary>',
' /// <param name="constructor" locid="9">',
' /// A constructor function that will be used to instantiate this class.',
' /// </param>',
' /// <returns locid="12">',
' /// The newly defined class.',
' /// </returns>',
' constructor = constructor || function () { };',
' var i, len;',
' for (i = 0, len = arguments.length; i < len; i++) {',
' initializeProperties(constructor.prototype, arguments[i]);',
' }',
' return constructor;',
' }',
'',
' // Establish members of "WinJS.Class" namespace',
' WinJS.Namespace.define("WinJS.Class", {',
' define: define,',
' derive: derive,',
' mix: mix',
' });',
'',
' })(WinJS);',
'',
'})(this);'
].join('\n');
}

14
test/manual/index.css Normal file
View file

@ -0,0 +1,14 @@
.monaco-editor .token.custom-info {
color: grey !important;
}
.monaco-editor .token.custom-error {
color: red !important;
font-weight: bold !important;
font-size: 1.2em !important;
}
.monaco-editor .token.custom-notice {
color: orange !important;
}
.monaco-editor .token.custom-date {
color: green !important;
}

50
test/manual/index.html Normal file
View file

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="./index.css" />
</head>
<body>
Jump to:
<a class="loading-opts" href="./smoketest.html">[SMOKETEST]</a>
&#160;|&#160;
<a class="loading-opts" href="./playground.generated/index.html">[PLAYGROUND]</a>
&#160;|&#160;
<a class="loading-opts" href="./mouse-fixed.html">[fixed element]</a>
&#160;|&#160;
<a class="loading-opts" href="./mouse-scrollable-body.html">[scrollable body]</a>
&#160;|&#160;
<a class="loading-opts" href="./mouse-scrollable-element.html">[scrollable element]</a><br />
&#160;|&#160;
<a class="loading-opts" href="./shadow-dom.html">[Shadow DOM]</a>
&#160;|&#160;
<a class="loading-opts" href="./colorize.html">[colorize element]</a>
&#160;|&#160;
<a class="loading-opts" href="./cross-origin-broken.html">[cross origin broken]</a>
&#160;|&#160;
<a class="loading-opts" href="./cross-origin-good.html">[cross origin good]</a>
&#160;|&#160;
<a class="loading-opts" href="./diff.html">[diff]</a>
<br /><br />
<div id="bar" style="margin-bottom: 6px"></div>
<div style="clear: both"></div>
<div
id="container"
style="float: left; width: 800px; height: 450px; border: 1px solid grey"
></div>
<div
id="options"
style="float: left; width: 220px; height: 450px; border: 1px solid grey"
></div>
<div style="clear: both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
require(['./index'], function () {});
});
</script>
</body>
</html>

427
test/manual/index.js Normal file
View file

@ -0,0 +1,427 @@
/// <reference path="../../release/monaco.d.ts" />
define(['require', './samples'], function (require, SAMPLES) {
var domutils = require('vs/base/browser/dom');
var model = monaco.editor.createModel('', 'plaintext');
monaco.languages.typescript.typescriptDefaults.setInlayHintsOptions({
includeInlayParameterNameHints: 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName: true,
includeInlayFunctionParameterTypeHints: true,
includeInlayVariableTypeHints: true,
includeInlayPropertyDeclarationTypeHints: true,
includeInlayFunctionLikeReturnTypeHints: true,
includeInlayEnumMemberValueHints: true
});
var editor = monaco.editor.create(document.getElementById('container'), {
model: model,
glyphMargin: true,
renderWhitespace: true
});
editor.addCommand(
{
ctrlCmd: true,
key: 'F9'
},
function (ctx, args) {
alert('Command Running!!');
console.log(ctx);
}
);
editor.addAction({
id: 'my-unique-id',
label: 'My Label!!!',
keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10],
contextMenuGroupId: 'navigation',
contextMenuOrder: 2.5,
run: function (ed) {
console.log("i'm running => " + ed.getPosition());
}
});
var currentSamplePromise = null;
var samplesData = {};
SAMPLES.sort(function (a, b) {
return a.name.localeCompare(b.name);
}).forEach(function (sample) {
samplesData[sample.name] = function () {
if (currentSamplePromise !== null) {
currentSamplePromise.cancel();
currentSamplePromise = null;
}
currentSamplePromise = sample.loadText().then(function (modelText) {
currentSamplePromise = null;
updateEditor(sample.mimeType, modelText, sample.name);
});
};
});
var examplesComboBox = new ComboBox('Template', samplesData);
var modesData = {};
monaco.languages.getLanguages().forEach(function (language) {
modesData[language.id] = updateEditor.bind(this, language.id);
});
var modesComboBox = new ComboBox('Mode', modesData);
var themesData = {};
themesData['vs'] = function () {
monaco.editor.setTheme('vs');
};
themesData['vs-dark'] = function () {
monaco.editor.setTheme('vs-dark');
};
themesData['hc-black'] = function () {
monaco.editor.setTheme('hc-black');
};
var themesComboBox = new ComboBox('Theme', themesData);
// Do it in a timeout to simplify profiles
window.setTimeout(function () {
var START_SAMPLE = 'Y___DefaultJS';
var url_matches = location.search.match(/sample=([^?&]+)/i);
if (url_matches) {
START_SAMPLE = url_matches[1];
}
if (location.hash) {
START_SAMPLE = location.hash.replace(/^\#/, '');
START_SAMPLE = decodeURIComponent(START_SAMPLE);
}
samplesData[START_SAMPLE]();
examplesComboBox.set(START_SAMPLE);
createOptions(editor);
createToolbar(editor);
}, 0);
function updateEditor(mode, value, sampleName) {
if (sampleName) {
window.location.hash = sampleName;
}
if (typeof value !== 'undefined') {
var oldModel = model;
model = monaco.editor.createModel(value, mode);
editor.setModel(model);
if (oldModel) {
oldModel.dispose();
}
} else {
monaco.editor.setModelLanguage(model, mode);
}
modesComboBox.set(mode);
}
function createToolbar(editor) {
var bar = document.getElementById('bar');
bar.appendChild(examplesComboBox.domNode);
bar.appendChild(modesComboBox.domNode);
bar.appendChild(themesComboBox.domNode);
bar.appendChild(
createButton('Dispose all', function (e) {
editor.dispose();
editor = null;
if (model) {
model.dispose();
model = null;
}
})
);
bar.appendChild(
createButton('Remove Model', function (e) {
editor.setModel(null);
})
);
bar.appendChild(
createButton('Dispose Model', function (e) {
if (model) {
model.dispose();
model = null;
}
})
);
bar.appendChild(
createButton(
'Ballistic scroll',
(function () {
var friction = 1000; // px per second
var speed = 0; // px per second
var isRunning = false;
var lastTime;
var r = 0;
var scroll = function () {
var currentTime = new Date().getTime();
var ellapsedTimeS = (currentTime - lastTime) / 1000;
lastTime = currentTime;
speed = speed - friction * ellapsedTimeS;
r = r + speed * ellapsedTimeS;
editor.setScrollTop(r);
if (speed >= 0) {
domutils.scheduleAtNextAnimationFrame(scroll);
} else {
isRunning = false;
}
};
return function (e) {
speed += 2000;
if (!isRunning) {
isRunning = true;
r = editor.getScrollTop();
lastTime = new Date().getTime();
domutils.runAtThisOrScheduleAtNextAnimationFrame(scroll);
}
};
})()
)
);
}
function createButton(label, onClick) {
var result = document.createElement('button');
result.innerHTML = label;
result.onclick = onClick;
return result;
}
function createOptions(editor) {
var options = document.getElementById('options');
var lineNumbers;
options.appendChild(
createOptionToggle(
editor,
'lineNumbers',
function () {
return lineNumbers === false ? false : true;
},
function (editor, newValue) {
lineNumbers = newValue;
editor.updateOptions({ lineNumbers: lineNumbers ? 'on' : 'off' });
}
)
);
var glyphMargin;
options.appendChild(
createOptionToggle(
editor,
'glyphMargin',
function () {
return glyphMargin === false ? false : true;
},
function (editor, newValue) {
glyphMargin = newValue;
editor.updateOptions({ glyphMargin: glyphMargin });
}
)
);
var minimap;
options.appendChild(
createOptionToggle(
editor,
'minimap',
function () {
return minimap === false ? false : true;
},
function (editor, newValue) {
minimap = newValue;
editor.updateOptions({ minimap: { enabled: minimap } });
}
)
);
var roundedSelection;
options.appendChild(
createOptionToggle(
editor,
'roundedSelection',
function () {
return roundedSelection === false ? false : true;
},
function (editor, newValue) {
roundedSelection = newValue;
editor.updateOptions({ roundedSelection: roundedSelection });
}
)
);
var scrollBeyondLastLine;
options.appendChild(
createOptionToggle(
editor,
'scrollBeyondLastLine',
function () {
return scrollBeyondLastLine === false ? false : true;
},
function (editor, newValue) {
scrollBeyondLastLine = newValue;
editor.updateOptions({ scrollBeyondLastLine: scrollBeyondLastLine });
}
)
);
var renderWhitespace;
options.appendChild(
createOptionToggle(
editor,
'renderWhitespace',
function () {
return renderWhitespace === true ? true : false;
},
function (editor, newValue) {
renderWhitespace = newValue;
editor.updateOptions({ renderWhitespace: renderWhitespace });
}
)
);
var readOnly;
options.appendChild(
createOptionToggle(
editor,
'readOnly',
function () {
return readOnly === true ? true : false;
},
function (editor, newValue) {
readOnly = newValue;
editor.updateOptions({ readOnly: readOnly });
}
)
);
var wordWrap;
options.appendChild(
createOptionToggle(
editor,
'wordWrap',
function () {
return wordWrap === true ? true : false;
},
function (editor, newValue) {
wordWrap = newValue;
editor.updateOptions({ wordWrap: wordWrap ? 'on' : 'off' });
}
)
);
var folding;
options.appendChild(
createOptionToggle(
editor,
'folding',
function () {
return folding === false ? false : true;
},
function (editor, newValue) {
folding = newValue;
editor.updateOptions({ folding: folding });
}
)
);
var bracketPairColorizationEnabled = false;
options.appendChild(
createOptionToggle(
editor,
'bracketPairColorizationEnabled',
function () {
return bracketPairColorizationEnabled === false ? false : true;
},
function (editor, newValue) {
bracketPairColorizationEnabled = newValue;
editor.updateOptions({
'bracketPairColorization.enabled': bracketPairColorizationEnabled
});
}
)
);
}
function createOptionToggle(editor, labelText, stateReader, setState) {
var domNode = document.createElement('div');
domNode.className = 'option toggle';
var input = document.createElement('input');
input.type = 'checkbox';
var label = document.createElement('label');
label.appendChild(input);
label.appendChild(document.createTextNode(labelText));
domNode.appendChild(label);
var renderState = function () {
input.checked = stateReader();
};
renderState();
editor.onDidChangeConfiguration(function () {
renderState();
});
input.onchange = function () {
setState(editor, !stateReader());
};
return domNode;
}
function ComboBox(label, externalOptions) {
this.id = 'combobox-' + label.toLowerCase().replace(/\s/g, '-');
this.domNode = document.createElement('div');
this.domNode.setAttribute('style', 'display: inline; margin-right: 5px;');
this.label = document.createElement('label');
this.label.innerHTML = label;
this.label.setAttribute('for', this.id);
this.domNode.appendChild(this.label);
this.comboBox = document.createElement('select');
this.comboBox.setAttribute('id', this.id);
this.comboBox.setAttribute('name', this.id);
this.comboBox.onchange = function (e) {
var target = e.target || e.srcElement;
this.options[target.options[target.selectedIndex].value].callback();
}.bind(this);
this.domNode.appendChild(this.comboBox);
this.options = [];
for (var name in externalOptions) {
if (externalOptions.hasOwnProperty(name)) {
var optionElement = document.createElement('option');
optionElement.value = name;
optionElement.innerHTML = name;
this.options[name] = {
element: optionElement,
callback: externalOptions[name]
};
this.comboBox.appendChild(optionElement);
}
}
}
ComboBox.prototype.set = function (name) {
if (this.options[name]) {
this.options[name].element.selected = true;
}
};
});

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body style="height: 2000px">
<h2>Monaco Editor in fixed element</h2>
<div
style="
position: fixed;
left: 20%;
top: 20%;
right: 20%;
height: 400px;
border: 1px solid silver;
"
id="Editor"
></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
monaco.editor.create(document.getElementById('Editor'), {
value: document.documentElement.innerHTML,
language: 'xml'
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,287 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
#editor {
position: relative;
left: 500px;
top: 20px;
width: 600px;
height: 400px;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<h2>Monaco Editor in scrollable body</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<div id="editor"></div>
<div style="clear: both"></div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
monaco.editor.create(document.getElementById('editor'), {
value: document.documentElement.innerHTML,
language: 'xml'
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,205 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
#editor {
position: relative;
left: 500px;
top: 20px;
width: 600px;
height: 400px;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<div style="height: 500px; overflow: scroll">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<div id="editor"></div>
</div>
<div style="clear: both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function () {
monaco.editor.create(document.getElementById('editor'), {
value: document.documentElement.innerHTML,
language: 'xml'
});
});
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<base href="../../vscode-prs/out-editor-esm-bundle/" />
</head>
<body>
<h2>Monaco Editor ESM Bundle</h2>
<div style="clear: both"></div>
<div
id="container"
style="float: left; width: 800px; height: 450px; border: 1px solid grey"
></div>
<div style="clear: both"></div>
<script src="core.bundle.js"></script>
</body>
</html>

View file

@ -0,0 +1,52 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var originalModel = monaco.editor.createModel('heLLo world!', 'text/plain');
var modifiedModel = monaco.editor.createModel('hello orlando!', 'text/plain');
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'));
diffEditor.setModel({
original: originalModel,
modified: modifiedModel
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,64 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var originalModel = monaco.editor.createModel(
'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), {
// You can optionally disable the resizing
enableSplitViewResizing: false,
// Render the diff inline
renderSideBySide: false
});
diffEditor.setModel({
original: originalModel,
modified: modifiedModel
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,61 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var originalModel = monaco.editor.createModel(
'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some text\nabcz\nzzzzefgh\nSome more text.\nThis line is removed on the left.',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), {
// You can optionally disable the resizing
enableSplitViewResizing: false
});
diffEditor.setModel({
original: originalModel,
modified: modifiedModel
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,68 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// The diff editor offers a navigator to jump between changes. Once the diff is computed the <em>next()</em> and <em>previous()</em> method allow navigation. By default setting the selection in the editor manually resets the navigation state.
var originalModel = monaco.editor.createModel(
'just some text\n\nHello World\n\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some Text\n\nHello World\n\nSome more changes',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'));
diffEditor.setModel({
original: originalModel,
modified: modifiedModel
});
var navi = monaco.editor.createDiffNavigator(diffEditor, {
followsCaret: true, // resets the navigator state when the user selects something in the editor
ignoreCharChanges: true // jump from line to line
});
window.setInterval(function () {
navi.next();
}, 2000);
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,63 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// Through the options literal, the behaviour of the editor can be easily customized.
// Here are a few examples of config options that can be passed to the editor.
// You can also call editor.updateOptions at any time to change the options.
var editor = monaco.editor.create(document.getElementById('container'), {
value: "// First line\nfunction hello() {\n\talert('Hello world!');\n}\n// Last line",
language: 'javascript',
lineNumbers: 'off',
roundedSelection: false,
scrollBeyondLastLine: false,
readOnly: false,
theme: 'vs-dark'
});
setTimeout(function () {
editor.updateOptions({
lineNumbers: 'on'
});
}, 2000);
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// The Monaco Editor can be easily created, given an
// empty container and an options literal.
// Two members of the literal are "value" and "language".
// The editor takes the full size of its container.
monaco.editor.create(document.getElementById('container'), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: 'javascript'
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,82 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<pre id="code" data-lang="text/css" style="width: 500px">
/* Some example CSS */
@import url("something.css");
body {
margin: 0;
padding: 3em 6em;
font-family: tahoma, arial, sans-serif;
color: #000;
}
#navigation a {
font-weight: bold;
text-decoration: none !important;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 1.7em;
}
h1:before, h2:before {
content: "some contents";
}
code {
font-family: courier, monospace;
font-size: 80%;
color: #418A8A;
}
</pre>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// The colorizeElement-function will read the data-lang-attribute
// from the element to select the correct language mode. In this
// sample it is text/css.
monaco.editor.colorizeElement(document.getElementById('code'));
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,194 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// The editor colors can be customized through CSS or through JS
monaco.editor.defineTheme('myTheme', {
base: 'vs',
inherit: true,
rules: [{ background: 'EDF9FA' }],
colors: {
'editor.foreground': '#000000',
'editor.background': '#EDF9FA',
'editorCursor.foreground': '#8B0000',
'editor.lineHighlightBackground': '#0000FF20',
'editorLineNumber.foreground': '#008800',
'editor.selectionBackground': '#88000030',
'editor.inactiveSelectionBackground': '#88000015'
}
});
monaco.editor.setTheme('myTheme');
monaco.editor.create(document.getElementById('container'), {
value: 'My to-do list:\n* buy milk\n* buy coffee\n* write awesome code',
language: 'text/plain',
fontFamily: 'Arial',
fontSize: 20
});
// A list of color names:
('foreground'); // Overall foreground color. This color is only used if not overridden by a component.
('errorForeground'); // Overall foreground color for error messages. This color is only used if not overridden by a component.
('descriptionForeground'); // Foreground color for description text providing additional information, for example for a label.
('focusBorder'); // Overall border color for focused elements. This color is only used if not overridden by a component.
('contrastBorder'); // An extra border around elements to separate them from others for greater contrast.
('contrastActiveBorder'); // An extra border around active elements to separate them from others for greater contrast.
('selection.background'); // The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.
('textSeparator.foreground'); // Color for text separators.
('textLink.foreground'); // Foreground color for links in text.
('textLink.activeForeground'); // Foreground color for active links in text.
('textPreformat.foreground'); // Foreground color for preformatted text segments.
('textBlockQuote.background'); // Background color for block quotes in text.
('textBlockQuote.border'); // Border color for block quotes in text.
('textCodeBlock.background'); // Background color for code blocks in text.
('widget.shadow'); // Shadow color of widgets such as find/replace inside the editor.
('input.background'); // Input box background.
('input.foreground'); // Input box foreground.
('input.border'); // Input box border.
('inputOption.activeBorder'); // Border color of activated options in input fields.
('input.placeholderForeground'); // Input box foreground color for placeholder text.
('inputValidation.infoBackground'); // Input validation background color for information severity.
('inputValidation.infoBorder'); // Input validation border color for information severity.
('inputValidation.warningBackground'); // Input validation background color for information warning.
('inputValidation.warningBorder'); // Input validation border color for warning severity.
('inputValidation.errorBackground'); // Input validation background color for error severity.
('inputValidation.errorBorder'); // Input validation border color for error severity.
('dropdown.background'); // Dropdown background.
('dropdown.foreground'); // Dropdown foreground.
('dropdown.border'); // Dropdown border.
('list.focusBackground'); // List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
('list.focusForeground'); // List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
('list.activeSelectionBackground'); // List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
('list.activeSelectionForeground'); // List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.
('list.inactiveSelectionBackground'); // List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.
('list.inactiveSelectionForeground'); // List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.
('list.hoverBackground'); // List/Tree background when hovering over items using the mouse.
('list.hoverForeground'); // List/Tree foreground when hovering over items using the mouse.
('list.dropBackground'); // List/Tree drag and drop background when moving items around using the mouse.
('list.highlightForeground'); // List/Tree foreground color of the match highlights when searching inside the list/tree.
('pickerGroup.foreground'); // Quick picker color for grouping labels.
('pickerGroup.border'); // Quick picker color for grouping borders.
('button.foreground'); // Button foreground color.
('button.background'); // Button background color.
('button.hoverBackground'); // Button background color when hovering.
('badge.background'); // Badge background color. Badges are small information labels, e.g. for search results count.
('badge.foreground'); // Badge foreground color. Badges are small information labels, e.g. for search results count.
('scrollbar.shadow'); // Scrollbar shadow to indicate that the view is scrolled.
('scrollbarSlider.background'); // Slider background color.
('scrollbarSlider.hoverBackground'); // Slider background color when hovering.
('scrollbarSlider.activeBackground'); // Slider background color when active.
('progressBar.background'); // Background color of the progress bar that can show for long running operations.
('editor.background'); // Editor background color.
('editor.foreground'); // Editor default foreground color.
('editorWidget.background'); // Background color of editor widgets, such as find/replace.
('editorWidget.border'); // Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.
('editor.selectionBackground'); // Color of the editor selection.
('editor.selectionForeground'); // Color of the selected text for high contrast.
('editor.inactiveSelectionBackground'); // Color of the selection in an inactive editor.
('editor.selectionHighlightBackground'); // Color for regions with the same content as the selection.
('editor.findMatchBackground'); // Color of the current search match.
('editor.findMatchHighlightBackground'); // Color of the other search matches.
('editor.findRangeHighlightBackground'); // Color the range limiting the search.
('editor.hoverHighlightBackground'); // Highlight below the word for which a hover is shown.
('editorHoverWidget.background'); // Background color of the editor hover.
('editorHoverWidget.border'); // Border color of the editor hover.
('editorLink.activeForeground'); // Color of active links.
('diffEditor.insertedTextBackground'); // Background color for text that got inserted.
('diffEditor.removedTextBackground'); // Background color for text that got removed.
('diffEditor.insertedTextBorder'); // Outline color for the text that got inserted.
('diffEditor.removedTextBorder'); // Outline color for text that got removed.
('editorOverviewRuler.currentContentForeground'); // Current overview ruler foreground for inline merge-conflicts.
('editorOverviewRuler.incomingContentForeground'); // Incoming overview ruler foreground for inline merge-conflicts.
('editorOverviewRuler.commonContentForeground'); // Common ancestor overview ruler foreground for inline merge-conflicts.
('editor.lineHighlightBackground'); // Background color for the highlight of line at the cursor position.
('editor.lineHighlightBorder'); // Background color for the border around the line at the cursor position.
('editor.rangeHighlightBackground'); // Background color of highlighted ranges, like by quick open and find features.
('editorCursor.foreground'); // Color of the editor cursor.
('editorWhitespace.foreground'); // Color of whitespace characters in the editor.
('editorIndentGuide.background'); // Color of the editor indentation guides.
('editorLineNumber.foreground'); // Color of editor line numbers.
('editorLineNumber.activeForeground'); // Color of editor active line number.
('editorRuler.foreground'); // Color of the editor rulers.
('editorCodeLens.foreground'); // Foreground color of editor code lenses
('editorInlayHint.foreground'); // Foreground color of editor inlay hints
('editorInlayHint.background'); // Background color of editor inlay hints
('editorBracketMatch.background'); // Background color behind matching brackets
('editorBracketMatch.border'); // Color for matching brackets boxes
('editorOverviewRuler.border'); // Color of the overview ruler border.
('editorGutter.background'); // Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.
('editorError.foreground'); // Foreground color of error squigglies in the editor.
('editorError.border'); // Border color of error squigglies in the editor.
('editorWarning.foreground'); // Foreground color of warning squigglies in the editor.
('editorWarning.border'); // Border color of warning squigglies in the editor.
('editorMarkerNavigationError.background'); // Editor marker navigation widget error color.
('editorMarkerNavigationWarning.background'); // Editor marker navigation widget warning color.
('editorMarkerNavigation.background'); // Editor marker navigation widget background.
('editorSuggestWidget.background'); // Background color of the suggest widget.
('editorSuggestWidget.border'); // Border color of the suggest widget.
('editorSuggestWidget.foreground'); // Foreground color of the suggest widget.
('editorSuggestWidget.selectedBackground'); // Background color of the selected entry in the suggest widget.
('editorSuggestWidget.highlightForeground'); // Color of the match highlights in the suggest widget.
('editor.wordHighlightBackground'); // Background color of a symbol during read-access, like reading a variable.
('editor.wordHighlightStrongBackground'); // Background color of a symbol during write-access, like writing to a variable.
('peekViewTitle.background'); // Background color of the peek view title area.
('peekViewTitleLabel.foreground'); // Color of the peek view title.
('peekViewTitleDescription.foreground'); // Color of the peek view title info.
('peekView.border'); // Color of the peek view borders and arrow.
('peekViewResult.background'); // Background color of the peek view result list.
('peekViewResult.lineForeground'); // Foreground color for line nodes in the peek view result list.
('peekViewResult.fileForeground'); // Foreground color for file nodes in the peek view result list.
('peekViewResult.selectionBackground'); // Background color of the selected entry in the peek view result list.
('peekViewResult.selectionForeground'); // Foreground color of the selected entry in the peek view result list.
('peekViewEditor.background'); // Background color of the peek view editor.
('peekViewEditorGutter.background'); // Background color of the gutter in the peek view editor.
('peekViewResult.matchHighlightBackground'); // Match highlight color in the peek view result list.
('peekViewEditor.matchHighlightBackground'); // Match highlight color in the peek view editor.
/*
var colors = require('vs/platform/registry/common/platform').Registry.data.get('base.contributions.colors').colorSchema.properties
Object.keys(colors).forEach(function(key) {
var val = colors[key];
console.log( '//' + val.description + '\n' + key);
})
*/
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,86 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/* Make horizontal scrollbar, decorations overview ruler and vertical scrollbar arrows opaque */
.monaco-editor .monaco-scrollable-element .scrollbar.horizontal,
.monaco-editor .decorationsOverviewRuler,
.monaco-editor .monaco-scrollable-element .scrollbar.vertical .arrow-background {
background: rgba(230, 230, 230, 255);
}
/* Make vertical scrollbar transparent to allow decorations overview ruler to be visible */
.monaco-editor .monaco-scrollable-element .scrollbar.vertical {
background: rgba(0, 0, 0, 0);
}
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// Remember to check out the CSS too!
var htmlCode =
'<html><!--long linelong linelong linelong linelong linelong linelong linelong linelong linelong line-->\n<head>\n <!-- HTML comment -->\n <style type="text/css">\n /* CSS comment */\n </style>\n <script type="javascript">\n // JavaScript comment\n </' +
'script>\n</head>\n<body></body>\n</html>';
monaco.editor.create(document.getElementById('container'), {
value: htmlCode,
language: 'text/html',
theme: 'vs',
scrollbar: {
// Subtle shadows to the left & top. Defaults to true.
useShadows: false,
// Render vertical arrows. Defaults to false.
verticalHasArrows: true,
// Render horizontal arrows. Defaults to false.
horizontalHasArrows: true,
// Render vertical scrollbar.
// Accepted values: 'auto', 'visible', 'hidden'.
// Defaults to 'auto'
vertical: 'visible',
// Render horizontal scrollbar.
// Accepted values: 'auto', 'visible', 'hidden'.
// Defaults to 'auto'
horizontal: 'visible',
verticalScrollbarSize: 17,
horizontalScrollbarSize: 17,
arrowSize: 30
}
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,77 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// Theme matching (i.e. applying a style to a token) happens in JavaScript.
// We must therefore register the theme rules in JavaScript.
// A custom theme must name its base theme (i.e. 'vs', 'vs-dark' or 'hc-black')
// It can then choose to inherit the rules from the base theme or not
// A rule token matching is prefix based: e.g.
// - string will match a token with type: string, string.double.js or string.html
// - string.double will match a token with type string.double but will not match string or string.html
// !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!!
monaco.editor.defineTheme('myCustomTheme', {
base: 'vs', // can also be vs-dark or hc-black
inherit: true, // can also be false to completely replace the builtin rules
rules: [
{ token: 'comment', foreground: 'ffa500', fontStyle: 'italic underline' },
{ token: 'comment.js', foreground: '008800', fontStyle: 'bold' },
{ token: 'comment.css', foreground: '0000ff' } // will inherit fontStyle from `comment` above
]
});
monaco.editor.create(document.getElementById('container'), {
value: getCode(),
language: 'text/html',
theme: 'myCustomTheme'
});
function getCode() {
return (
'<html><!-- // !!! Tokens can be inspected using F1 > Developer: Inspect Tokens !!! -->\n<head>\n <!-- HTML comment -->\n <style type="text/css">\n /* CSS comment */\n </style>\n <script type="javascript">\n // JavaScript comment\n </' +
'script>\n</head>\n<body></body>\n</html>'
);
}
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,83 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var editor = monaco.editor.create(document.getElementById('container'), {
value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
language: 'json'
});
var commandId = editor.addCommand(
0,
function () {
// services available in `ctx`
alert('my command is executing!');
},
''
);
monaco.languages.registerCodeLensProvider('json', {
provideCodeLenses: function (model, token) {
return {
lenses: [
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
id: 'First Line',
command: {
id: commandId,
title: 'First Line'
}
}
],
dispose: () => {}
};
},
resolveCodeLens: function (model, codeLens, token) {
return codeLens;
}
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,106 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
monaco.languages.register({
id: 'colorLanguage'
});
monaco.editor.create(document.getElementById('container'), {
value: 'red\nblue\ngreen',
language: 'colorLanguage',
colorDecorators: true
});
monaco.languages.registerColorProvider('colorLanguage', {
provideColorPresentations: (model, colorInfo) => {
var color = colorInfo.color;
var red256 = Math.round(color.red * 255);
var green256 = Math.round(color.green * 255);
var blue256 = Math.round(color.blue * 255);
var label;
if (color.alpha === 1) {
label = 'rgb(' + red256 + ', ' + green256 + ', ' + blue256 + ')';
} else {
label = 'rgba(' + red256 + ', ' + green256 + ', ' + blue256 + ', ' + color.alpha + ')';
}
return [
{
label: label
}
];
},
provideDocumentColors: () => {
return [
{
color: { red: 1, blue: 0, green: 0, alpha: 1 },
range: {
startLineNumber: 1,
startColumn: 0,
endLineNumber: 1,
endColumn: 0
}
},
{
color: { red: 0, blue: 1, green: 0, alpha: 1 },
range: {
startLineNumber: 2,
startColumn: 0,
endLineNumber: 2,
endColumn: 0
}
},
{
color: { red: 0, blue: 0, green: 1, alpha: 1 },
range: {
startLineNumber: 3,
startColumn: 0,
endLineNumber: 3,
endColumn: 0
}
}
];
}
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,112 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
function createDependencyProposals(range) {
// returning a static list of proposals, not even looking at the prefix (filtering is done by the Monaco editor),
// here you could do a server side lookup
return [
{
label: '"lodash"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: 'The Lodash library exported as Node.js modules.',
insertText: '"lodash": "*"',
range: range
},
{
label: '"express"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: 'Fast, unopinionated, minimalist web framework',
insertText: '"express": "*"',
range: range
},
{
label: '"mkdirp"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: 'Recursively mkdir, like <code>mkdir -p</code>',
insertText: '"mkdirp": "*"',
range: range
},
{
label: '"my-third-party-library"',
kind: monaco.languages.CompletionItemKind.Function,
documentation: 'Describe your library here',
insertText: '"${1:my-third-party-library}": "${2:1.2.3}"',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
range: range
}
];
}
monaco.languages.registerCompletionItemProvider('json', {
provideCompletionItems: function (model, position) {
// find out if we are completing a property in the 'dependencies' object.
var textUntilPosition = model.getValueInRange({
startLineNumber: 1,
startColumn: 1,
endLineNumber: position.lineNumber,
endColumn: position.column
});
var match = textUntilPosition.match(
/"dependencies"\s*:\s*\{\s*("[^"]*"\s*:\s*"[^"]*"\s*,\s*)*([^"]*)?$/
);
if (!match) {
return { suggestions: [] };
}
var word = model.getWordUntilPosition(position);
var range = {
startLineNumber: position.lineNumber,
endLineNumber: position.lineNumber,
startColumn: word.startColumn,
endColumn: word.endColumn
};
return {
suggestions: createDependencyProposals(range)
};
}
});
monaco.editor.create(document.getElementById('container'), {
value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
language: 'json'
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,90 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// Add additional d.ts files to the JavaScript language service and change.
// Also change the default compilation options.
// The sample below shows how a class Facts is declared and introduced
// to the system and how the compiler is told to use ES6 (target=2).
// validation settings
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
noSemanticValidation: true,
noSyntaxValidation: false
});
// compiler options
monaco.languages.typescript.javascriptDefaults.setCompilerOptions({
target: monaco.languages.typescript.ScriptTarget.ES6,
allowNonTsExtensions: true
});
// extra libraries
var libSource = [
'declare class Facts {',
' /**',
' * Returns the next fact',
' */',
' static next():string',
'}'
].join('\n');
var libUri = 'ts:filename/facts.d.ts';
monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, libUri);
// When resolving definitions and references, the editor will try to use created models.
// Creating a model for the library allows "peek definition/references" commands to work with the library.
monaco.editor.createModel(libSource, 'typescript', monaco.Uri.parse(libUri));
var jsCode = [
'"use strict";',
'',
'class Chuck {',
' greet() {',
' return Facts.next();',
' }',
'}'
].join('\n');
monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript'
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,86 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// Configures two JSON schemas, with references.
var jsonCode = ['{', ' "p1": "v3",', ' "p2": false', '}'].join('\n');
var modelUri = monaco.Uri.parse('a://b/foo.json'); // a made up unique URI for our model
var model = monaco.editor.createModel(jsonCode, 'json', modelUri);
// configure the JSON language support with schemas and schema associations
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true,
schemas: [
{
uri: 'http://myserver/foo-schema.json', // id of the first schema
fileMatch: [modelUri.toString()], // associate with our model
schema: {
type: 'object',
properties: {
p1: {
enum: ['v1', 'v2']
},
p2: {
$ref: 'http://myserver/bar-schema.json' // reference the second schema
}
}
}
},
{
uri: 'http://myserver/bar-schema.json', // id of the second schema
schema: {
type: 'object',
properties: {
q1: {
enum: ['x1', 'x2']
}
}
}
}
]
});
monaco.editor.create(document.getElementById('container'), {
model: model
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,158 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
// Register a new language
monaco.languages.register({ id: 'mySpecialLanguage' });
// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider('mySpecialLanguage', {
tokenizer: {
root: [
[/\[error.*/, 'custom-error'],
[/\[notice.*/, 'custom-notice'],
[/\[info.*/, 'custom-info'],
[/\[[a-zA-Z 0-9:]+\]/, 'custom-date']
]
}
});
// Define a new theme that contains only rules that match this language
monaco.editor.defineTheme('myCoolTheme', {
base: 'vs',
inherit: false,
rules: [
{ token: 'custom-info', foreground: '808080' },
{ token: 'custom-error', foreground: 'ff0000', fontStyle: 'bold' },
{ token: 'custom-notice', foreground: 'FFA500' },
{ token: 'custom-date', foreground: '008800' }
]
});
// Register a completion item provider for the new language
monaco.languages.registerCompletionItemProvider('mySpecialLanguage', {
provideCompletionItems: () => {
var suggestions = [
{
label: 'simpleText',
kind: monaco.languages.CompletionItemKind.Text,
insertText: 'simpleText'
},
{
label: 'testing',
kind: monaco.languages.CompletionItemKind.Keyword,
insertText: 'testing(${1:condition})',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet
},
{
label: 'ifelse',
kind: monaco.languages.CompletionItemKind.Snippet,
insertText: ['if (${1:condition}) {', '\t$0', '} else {', '\t', '}'].join('\n'),
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
documentation: 'If-Else Statement'
}
];
return { suggestions: suggestions };
}
});
monaco.editor.create(document.getElementById('container'), {
theme: 'myCoolTheme',
value: getCode(),
language: 'mySpecialLanguage'
});
function getCode() {
return [
'[Sun Mar 7 16:02:00 2004] [notice] Apache/1.3.29 (Unix) configured -- resuming normal operations',
'[Sun Mar 7 16:02:00 2004] [info] Server built: Feb 27 2004 13:56:37',
'[Sun Mar 7 16:02:00 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)',
'[Sun Mar 7 16:05:49 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 16:45:56 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.',
"[Sun Mar 7 17:23:53 2004] statistics: Can't create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied",
'[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:00:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:10:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:19:01 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:42:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:52:30 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 18:58:52 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 19:03:58 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 19:08:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:04:35 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:11:33 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:12:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:25:31 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:44:48 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome',
'[Sun Mar 7 21:20:14 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:31:12 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:39:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Sun Mar 7 21:44:10 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 01:35:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 01:47:06 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 01:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 02:12:24 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 02:54:54 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:46:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:48:18 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:52:17 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 03:55:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:22:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:24:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:40:32 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:55:40 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 04:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 05:22:57 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed',
'<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx',
'<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx'
].join('\n');
}
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,118 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
monaco.languages.register({
id: 'foldLanguage'
});
var value = `1. Hit F1 to bring up the Command Palette
2. Type 'fold'
3. Choose 'Fold All Block Comments' or 'Fold All Regions'
5. comment1
6. comment1
7. comment1
9. unfoldable text
10. unfoldable text
11. unfoldable text
13. comment2
14. comment2
15. comment2
16. comment2
17. comment2
19. foldable text
20. foldable text
21. foldable text
23. region1
24. region1
25. region1
27. region2
28. region2
29. region2`;
monaco.editor.create(document.getElementById('container'), {
value: value,
language: 'foldLanguage'
});
monaco.languages.registerFoldingRangeProvider('foldLanguage', {
provideFoldingRanges: function (model, context, token) {
return [
// comment1
{
start: 5,
end: 7,
kind: monaco.languages.FoldingRangeKind.Comment
},
// comment2
{
start: 13,
end: 17,
kind: monaco.languages.FoldingRangeKind.Comment
},
// foldable text
{
start: 19,
end: 21
},
// region1
{
start: 23,
end: 25,
kind: monaco.languages.FoldingRangeKind.Region
},
// region2
{
start: 27,
end: 29,
kind: monaco.languages.FoldingRangeKind.Region
}
];
}
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,101 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
monaco.languages.register({ id: 'mySpecialLanguage' });
monaco.languages.registerHoverProvider('mySpecialLanguage', {
provideHover: function (model, position) {
return xhr('../playground.html').then(function (res) {
return {
range: new monaco.Range(
1,
1,
model.getLineCount(),
model.getLineMaxColumn(model.getLineCount())
),
contents: [
{ value: '**SOURCE**' },
{ value: '```html\n' + res.responseText.substring(0, 200) + '\n```' }
]
};
});
}
});
monaco.editor.create(document.getElementById('container'), {
value: '\n\nHover over this text',
language: 'mySpecialLanguage'
});
function xhr(url) {
var req = null;
return new Promise(
function (c, e) {
req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (req._canceled) {
return;
}
if (req.readyState === 4) {
if ((req.status >= 200 && req.status < 300) || req.status === 1223) {
c(req);
} else {
e(req);
}
req.onreadystatechange = function () {};
}
};
req.open('GET', url, true);
req.responseType = '';
req.send(null);
},
function () {
req._canceled = true;
req.abort();
}
);
}
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,210 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
/** @type {monaco.languages.SemanticTokensLegend} */
const legend = {
tokenTypes: [
'comment',
'string',
'keyword',
'number',
'regexp',
'operator',
'namespace',
'type',
'struct',
'class',
'interface',
'enum',
'typeParameter',
'function',
'member',
'macro',
'variable',
'parameter',
'property',
'label'
],
tokenModifiers: [
'declaration',
'documentation',
'readonly',
'static',
'abstract',
'deprecated',
'modification',
'async'
]
};
/** @type {(type: string)=>number} */
function getType(type) {
return legend.tokenTypes.indexOf(type);
}
/** @type {(modifier: string[]|string|null)=>number} */
function getModifier(modifiers) {
if (typeof modifiers === 'string') {
modifiers = [modifiers];
}
if (Array.isArray(modifiers)) {
let nModifiers = 0;
for (let modifier of modifiers) {
const nModifier = legend.tokenModifiers.indexOf(modifier);
if (nModifier > -1) {
nModifiers |= (1 << nModifier) >>> 0;
}
}
return nModifiers;
} else {
return 0;
}
}
const tokenPattern = new RegExp('([a-zA-Z]+)((?:\\.[a-zA-Z]+)*)', 'g');
monaco.languages.registerDocumentSemanticTokensProvider('plaintext', {
getLegend: function () {
return legend;
},
provideDocumentSemanticTokens: function (model, lastResultId, token) {
const lines = model.getLinesContent();
/** @type {number[]} */
const data = [];
let prevLine = 0;
let prevChar = 0;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
for (let match = null; (match = tokenPattern.exec(line)); ) {
// translate token and modifiers to number representations
let type = getType(match[1]);
if (type === -1) {
continue;
}
let modifier = match[2].length ? getModifier(match[2].split('.').slice(1)) : 0;
data.push(
// translate line to deltaLine
i - prevLine,
// for the same line, translate start to deltaStart
prevLine === i ? match.index - prevChar : match.index,
match[0].length,
type,
modifier
);
prevLine = i;
prevChar = match.index;
}
}
return {
data: new Uint32Array(data),
resultId: null
};
},
releaseDocumentSemanticTokens: function (resultId) {}
});
// add some missing tokens
monaco.editor.defineTheme('myCustomTheme', {
base: 'vs',
inherit: true,
colors: {},
rules: [
{ token: 'comment', foreground: 'aaaaaa', fontStyle: 'italic' },
{ token: 'keyword', foreground: 'ce63eb' },
{ token: 'operator', foreground: '000000' },
{ token: 'namespace', foreground: '66afce' },
{ token: 'type', foreground: '1db010' },
{ token: 'struct', foreground: '0000ff' },
{ token: 'class', foreground: '0000ff', fontStyle: 'bold' },
{ token: 'interface', foreground: '007700', fontStyle: 'bold' },
{ token: 'enum', foreground: '0077ff', fontStyle: 'bold' },
{ token: 'typeParameter', foreground: '1db010' },
{ token: 'function', foreground: '94763a' },
{ token: 'member', foreground: '94763a' },
{ token: 'macro', foreground: '615a60' },
{ token: 'variable', foreground: '3e5bbf' },
{ token: 'parameter', foreground: '3e5bbf' },
{ token: 'property', foreground: '3e5bbf' },
{ token: 'label', foreground: '615a60' },
{ token: 'type.static', fontStyle: 'bold' },
{ token: 'class.static', foreground: 'ff0000', fontStyle: 'bold' }
]
});
const editor = monaco.editor.create(document.getElementById('container'), {
value: [
'Available token types:',
' [comment] [string] [keyword] [number] [regexp] [operator] [namespace]',
' [type] [struct] [class] [interface] [enum] [typeParameter] [function]',
' [member] [macro] [variable] [parameter] [property] [label]',
'',
'Available token modifiers:',
' [type.declaration] [type.documentation] [type.member] [type.static]',
' [type.abstract] [type.deprecated] [type.modification] [type.async]',
'',
'Some examples:',
' [class.static.token] [type.static.abstract]',
' [class.static.token] [type.static]',
'',
' [struct]',
'',
' [function.private]',
'',
'An error case:',
' [notInLegend]'
].join('\n'),
language: 'plaintext',
theme: 'myCustomTheme',
// semantic tokens provider is disabled by default
'semanticHighlighting.enabled': true
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,524 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
monaco.languages.registerDocumentSymbolProvider('json', {
provideDocumentSymbols: function (model, token) {
return [
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'File',
kind: 0,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Module',
kind: 1,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Namespace',
kind: 2,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Package',
kind: 3,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Class',
kind: 4,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Method',
kind: 5,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Property',
kind: 6,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Field',
kind: 7,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Constructor',
kind: 8,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Enum',
kind: 9,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Interface',
kind: 10,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Function',
kind: 11,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Variable',
kind: 12,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Constant',
kind: 13,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'String',
kind: 14,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Number',
kind: 15,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Boolean',
kind: 16,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Array',
kind: 17,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Object',
kind: 18,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Key',
kind: 19,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Null',
kind: 20,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'EnumMember',
kind: 21,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Struct',
kind: 22,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Event',
kind: 23,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'Operator',
kind: 24,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
},
{
range: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
},
name: 'TypeParameter',
kind: 25,
detail: '',
tags: [],
selectionRange: {
startLineNumber: 1,
startColumn: 1,
endLineNumber: 2,
endColumn: 1
}
}
];
}
});
// press Ctrl+Shift+O to show the symbols in the editor
monaco.editor.create(document.getElementById('container'), {
value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
language: 'json'
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,42 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
</head>
<body>
<a class="loading-opts" href="index.html">[&lt;&lt; BACK]</a><br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`<br/><br/>
<a class="loading-opts" href="playground.generated/creating-the-editor-hello-world.html">Creating the editor &gt; Hello world!</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-editor-editor-basic-options.html">Creating the editor &gt; Editor basic options</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-editor-hard-wrapping.html">Creating the editor &gt; Hard wrapping</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-editor-syntax-highlighting-for-html-elements.html">Creating the editor &gt; Syntax highlighting for HTML elements</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-adding-a-command-to-an-editor-instance.html">Interacting with the editor &gt; Adding a command to an editor instance</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-adding-an-action-to-an-editor-instance.html">Interacting with the editor &gt; Adding an action to an editor instance</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-revealing-a-position.html">Interacting with the editor &gt; Revealing a position</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-rendering-glyphs-in-the-margin.html">Interacting with the editor &gt; Rendering glyphs in the margin</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-line-and-inline-decorations.html">Interacting with the editor &gt; Line and Inline decorations</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-customizing-the-line-numbers.html">Interacting with the editor &gt; Customizing the line numbers</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-listening-to-mouse-events.html">Interacting with the editor &gt; Listening to mouse events</a><br/>
<a class="loading-opts" href="playground.generated/interacting-with-the-editor-listening-to-key-events.html">Interacting with the editor &gt; Listening to key events</a><br/>
<a class="loading-opts" href="playground.generated/customizing-the-appearence-exposed-colors.html">Customizing the appearence &gt; Exposed colors</a><br/>
<a class="loading-opts" href="playground.generated/customizing-the-appearence-scrollbars.html">Customizing the appearence &gt; Scrollbars</a><br/>
<a class="loading-opts" href="playground.generated/customizing-the-appearence-tokens-and-colors.html">Customizing the appearence &gt; Tokens and colors</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-diffeditor-hello-diff-world.html">Creating the DiffEditor &gt; Hello diff world!</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-diffeditor-multi-line-example.html">Creating the DiffEditor &gt; Multi-line example</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-diffeditor-inline-diff-example.html">Creating the DiffEditor &gt; Inline Diff Example</a><br/>
<a class="loading-opts" href="playground.generated/creating-the-diffeditor-navigating-a-diff.html">Creating the DiffEditor &gt; Navigating a Diff</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-custom-languages.html">Extending Language Services &gt; Custom languages</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-completion-provider-example.html">Extending Language Services &gt; Completion provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-codelens-provider-example.html">Extending Language Services &gt; Codelens provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-color-provider-example.html">Extending Language Services &gt; Color provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-symbols-provider-example.html">Extending Language Services &gt; Symbols provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-folding-provider-example.html">Extending Language Services &gt; Folding provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-hover-provider-example.html">Extending Language Services &gt; Hover provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-semantic-tokens-provider-example.html">Extending Language Services &gt; Semantic tokens provider example</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-configure-javascript-defaults.html">Extending Language Services &gt; Configure JavaScript defaults</a><br/>
<a class="loading-opts" href="playground.generated/extending-language-services-configure-json-defaults.html">Extending Language Services &gt; Configure JSON defaults</a>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
</body>
</html>

View file

@ -0,0 +1,80 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var jsCode = [
'"use strict";',
'function Person(age) {',
' if (age) {',
' this.age = age;',
' }',
'}',
'Person.prototype.getAge = function () {',
' return this.age;',
'};'
].join('\n');
var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript'
});
var myCondition1 = editor.createContextKey(/*key name*/ 'myCondition1', /*default value*/ false);
var myCondition2 = editor.createContextKey(/*key name*/ 'myCondition2', /*default value*/ false);
editor.addCommand(
monaco.KeyCode.Tab,
function () {
// services available in `ctx`
alert('my command is executing!');
},
'myCondition1 && myCondition2'
);
myCondition1.set(true);
setTimeout(function () {
alert('now enabling also myCondition2, try pressing Tab!');
myCondition2.set(true);
// you can use myCondition2.reset() to go back to the default
}, 2000);
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,96 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var editor = monaco.editor.create(document.getElementById('container'), {
value: [
'',
'class Example {',
'\tprivate m:number;',
'',
'\tpublic met(): string {',
'\t\treturn "Hello world!";',
'\t}',
'}'
].join('\n'),
language: 'typescript'
});
// Explanation:
// Press F1 => the action will appear and run if it is enabled
// Press Ctrl-F10 => the action will run if it is enabled
// Press Chord Ctrl-K, Ctrl-M => the action will run if it is enabled
editor.addAction({
// An unique identifier of the contributed action.
id: 'my-unique-id',
// A label of the action that will be presented to the user.
label: 'My Label!!!',
// An optional array of keybindings for the action.
keybindings: [
monaco.KeyMod.CtrlCmd | monaco.KeyCode.F10,
// chord
monaco.KeyMod.chord(
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK,
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyM
)
],
// A precondition for this action.
precondition: null,
// A rule to evaluate on top of the precondition in order to dispatch the keybindings.
keybindingContext: null,
contextMenuGroupId: 'navigation',
contextMenuOrder: 1.5,
// Method that will be executed when the action is triggered.
// @param editor The editor instance is passed in as a convenience
run: function (ed) {
alert("i'm running => " + ed.getPosition());
}
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,69 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
function lineNumbersFunc(originalLineNumber) {
var map = ['O', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X'];
if (originalLineNumber < map.length) {
return map[originalLineNumber];
}
return originalLineNumber;
}
var jsCode = [
'"use strict";',
'function Person(age) {',
' if (age) {',
' this.age = age;',
' }',
'}',
'Person.prototype.getAge = function () {',
' return this.age;',
'};'
].join('\n');
var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript',
lineNumbers: lineNumbersFunc
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,90 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
.myInlineDecoration {
color: red !important;
cursor: pointer;
text-decoration: underline;
font-weight: bold;
font-style: oblique;
}
.myLineDecoration {
background: lightblue;
width: 5px !important;
margin-left: 3px;
}
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var jsCode = [
'"use strict";',
'function Person(age) {',
' if (age) {',
' this.age = age;',
' }',
'}',
'Person.prototype.getAge = function () {',
' return this.age;',
'};'
].join('\n');
var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript'
});
var decorations = editor.deltaDecorations(
[],
[
{
range: new monaco.Range(3, 1, 5, 1),
options: {
isWholeLine: true,
linesDecorationsClassName: 'myLineDecoration'
}
},
{
range: new monaco.Range(7, 1, 7, 24),
options: { inlineClassName: 'myInlineDecoration' }
}
]
);
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var editor = monaco.editor.create(document.getElementById('container'), {
value: "function hello() {\n\talert('Hello world!');\n}",
language: 'javascript'
});
var myBinding = editor.addCommand(monaco.KeyCode.F9, function () {
alert('F9 pressed!');
});
// You can't dispose `addCommand`
// If you need to dispose it you might use `addAction` or `registerCommand`
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,171 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
.myGlyphMarginClass {
background: red;
}
.myContentClass {
background: lightblue;
}
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="output" style="height: 29%; font-family: 'Courier New', monospace">
Last 3 events:<br />
</div>
<div style="background: #ccc; height: 1%"></div>
<div id="container" style="height: 70%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var jsCode = [
'"use strict";',
'function Person(age) {',
' if (age) {',
' this.age = age;',
' }',
'}',
'Person.prototype.getAge = function () {',
' return this.age;',
'};'
].join('\n');
var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript',
glyphMargin: true,
contextmenu: false
});
var decorations = editor.deltaDecorations(
[],
[
{
range: new monaco.Range(3, 1, 3, 1),
options: {
isWholeLine: true,
className: 'myContentClass',
glyphMarginClassName: 'myGlyphMarginClass'
}
}
]
);
// Add a zone to make hit testing more interesting
var viewZoneId = null;
editor.changeViewZones(function (changeAccessor) {
var domNode = document.createElement('div');
domNode.style.background = 'lightgreen';
viewZoneId = changeAccessor.addZone({
afterLineNumber: 3,
heightInLines: 3,
domNode: domNode
});
});
// Add a content widget (scrolls inline with text)
var contentWidget = {
domNode: null,
getId: function () {
return 'my.content.widget';
},
getDomNode: function () {
if (!this.domNode) {
this.domNode = document.createElement('div');
this.domNode.innerHTML = 'My content widget';
this.domNode.style.background = 'grey';
}
return this.domNode;
},
getPosition: function () {
return {
position: {
lineNumber: 7,
column: 8
},
preference: [
monaco.editor.ContentWidgetPositionPreference.ABOVE,
monaco.editor.ContentWidgetPositionPreference.BELOW
]
};
}
};
editor.addContentWidget(contentWidget);
// Add an overlay widget
var overlayWidget = {
domNode: null,
getId: function () {
return 'my.overlay.widget';
},
getDomNode: function () {
if (!this.domNode) {
this.domNode = document.createElement('div');
this.domNode.innerHTML = 'My overlay widget';
this.domNode.style.background = 'grey';
this.domNode.style.right = '30px';
this.domNode.style.top = '50px';
}
return this.domNode;
},
getPosition: function () {
return null;
}
};
editor.addOverlayWidget(overlayWidget);
var output = document.getElementById('output');
function showEvent(str) {
while (output.childNodes.length > 6) {
output.removeChild(output.firstChild.nextSibling.nextSibling);
}
output.appendChild(document.createTextNode(str));
output.appendChild(document.createElement('br'));
}
editor.onMouseMove(function (e) {
showEvent('mousemove - ' + e.target.toString());
});
editor.onMouseDown(function (e) {
showEvent('mousedown - ' + e.target.toString());
});
editor.onContextMenu(function (e) {
showEvent('contextmenu - ' + e.target.toString());
});
editor.onMouseLeave(function (e) {
showEvent('mouseleave');
});
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,83 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
.myGlyphMarginClass {
background: red;
}
.myContentClass {
background: lightblue;
}
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var jsCode = [
'"use strict";',
'function Person(age) {',
' if (age) {',
' this.age = age;',
' }',
'}',
'Person.prototype.getAge = function () {',
' return this.age;',
'};'
].join('\n');
var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCode,
language: 'javascript',
glyphMargin: true
});
var decorations = editor.deltaDecorations(
[],
[
{
range: new monaco.Range(3, 1, 3, 1),
options: {
isWholeLine: true,
className: 'myContentClass',
glyphMarginClassName: 'myGlyphMarginClass'
}
}
]
);
// You can now use `decorations` to change or remove the decoration
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

View file

@ -0,0 +1,85 @@
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE VIA `npm run simpleserver` -->
<html>
<head>
<base href="..">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<style>
/*----------------------------------------SAMPLE CSS START*/
/*----------------------------------------SAMPLE CSS END*/
</style>
<a class="loading-opts" href="playground.generated/index.html">[&lt;&lt; BACK]</a> <br/>
THIS IS A GENERATED FILE VIA `npm run simpleserver`
<div id="bar" style="margin-bottom: 6px;"></div>
<div style="clear:both"></div>
<div id="outer-container" style="width:800px;height:450px;border: 1px solid grey">
<!-- ----------------------------------------SAMPLE HTML START-->
<div id="container" style="height: 100%"></div>
<!-- ----------------------------------------SAMPLE HTML END-->
</div>
<div style="clear:both"></div>
<script src="../../metadata.js"></script>
<script src="dev-setup.js"></script>
<script>
loadEditor(function() {
/*----------------------------------------SAMPLE JS START*/
var jsCodeArr = [
'// ------------------------------',
'// ------------------------------',
'function Person(age) {',
' if (age) {',
' this.age = age;',
' }',
'}',
'Person.prototype.getAge = function () {',
' return this.age;',
'};',
'',
''
];
jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0));
jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0));
jsCodeArr = jsCodeArr.concat(jsCodeArr.slice(0));
jsCodeArr[49] +=
'And this is some long line. And this is some long line. And this is some long line. And this is some long line. And this is some long line. ';
var editor = monaco.editor.create(document.getElementById('container'), {
value: jsCodeArr.join('\n'),
language: 'javascript'
});
editor.revealPositionInCenter({ lineNumber: 50, column: 120 });
// Also see:
// - editor.revealLine
// - editor.revealLineInCenter
// - editor.revealLineInCenterIfOutsideViewport
// - editor.revealLines
// - editor.revealLinesInCenter
// - editor.revealLinesInCenterIfOutsideViewport
// - editor.revealPosition
// - editor.revealPositionInCenter
// - editor.revealPositionInCenterIfOutsideViewport
// - editor.revealRange
// - editor.revealRangeInCenter
// - editor.revealRangeInCenterIfOutsideViewport
/*----------------------------------------SAMPLE JS END*/
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

287
test/manual/samples.js Normal file
View file

@ -0,0 +1,287 @@
/// <reference path="../../node_modules/monaco-editor-core/monaco.d.ts" />
define(['./samples-all.generated'], function (ALL_SAMPLES) {
var XHR_SAMPLES = {};
ALL_SAMPLES.forEach(function (sample) {
XHR_SAMPLES[sample.name] = sample.content;
});
var samples = [];
var modesIds = monaco.languages.getLanguages().map(function (language) {
return language.id;
});
modesIds.sort();
modesIds.forEach(function (modeId) {
samples.push({
name: 'sample - ' + modeId,
mimeType: modeId,
loadText: function () {
return Promise.resolve(XHR_SAMPLES['sample.' + modeId + '.txt']);
}
});
});
function addXHRSample(name, modelUrl, mimeType, textModifier) {
textModifier =
textModifier ||
function (text) {
return text;
};
samples.push({
name: name,
mimeType: mimeType,
loadText: function () {
return Promise.resolve(XHR_SAMPLES[modelUrl]).then(textModifier);
}
});
}
function addStringPowerXHRSample(name, modelUrl, mimeType, power) {
addXHRSample(name, modelUrl, mimeType, function (text) {
var result = text;
for (var i = 0; i < power; ++i) {
result += '\n' + result;
}
return result;
});
}
function addSample(name, mimeType, modelText) {
samples.push({
name: name,
mimeType: mimeType,
loadText: function () {
return Promise.resolve(modelText);
}
});
}
addXHRSample('Y___FailingJS', 'run-editor-failing-js.txt', 'text/javascript');
addXHRSample('Y___DefaultJS', 'run-editor-sample-js.txt', 'text/javascript');
addStringPowerXHRSample('Y___BigJS', 'run-editor-sample-js.txt', 'text/javascript', 11);
addXHRSample('Y___BigJS_msn', 'run-editor-sample-msn-js.txt', 'text/javascript');
addXHRSample('Y___BigCSS', 'run-editor-sample-big-css.txt', 'text/css');
addStringPowerXHRSample('Y___BigHTML', 'run-editor-sample-html.txt', 'text/html', 10);
addXHRSample('Y___Korean', 'run-editor-korean.txt', 'text/plain');
addXHRSample('Y___BOM.cs', 'run-editor-sample-bom-cs.txt', 'text/x-csharp');
addXHRSample('Z___CR.ps1', 'run-editor-sample-cr-ps1.txt', 'text/x-powershell');
addXHRSample('Z___jquery-min.js', 'run-editor-jquery-min-js.txt', 'text/javascript');
addXHRSample(
'Z___scrolling-strategy.js',
'run-editor-sample-js.txt',
'text/plain',
function (text) {
console.log('here I am');
var lines = text.split('\n');
var newLines = lines.slice(0);
var problemIsAt = 80733 + 5;
while (newLines.length < problemIsAt) {
newLines = newLines.concat(lines);
}
newLines = newLines.slice(0, problemIsAt);
return newLines.join('\n');
}
);
addSample(
'Z___special-chars',
'text/plain',
[
'// single line \u000D comment', // Carriage return
'// single line \u2028 comment', // Line separator
'// single line \u2029 comment' // Paragraph separator
].join('\n')
);
// http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
addSample(
'Z___invalid-unicode',
'text/plain',
[
'\uFFFE\uFFFF',
'\uD800\uDC00',
'\uD800\uDFFF',
'\uDB7F\uDC00',
'\uDB7F\uDFFF',
'\uDB80\uDC00',
'\uDB80\uDFFF',
'\uDBFF\uDC00',
'\uDBFF\uDFFF'
].join('\n')
);
addSample(
'Z___easy-debug.js',
'text/plain',
(function () {
var myValue = 'Line1';
for (var i = 2; i < 50; i++) {
myValue += '\nLine' + i;
}
return myValue;
})()
);
addSample(
'Z___copy-paste.txt',
'text/plain',
(function () {
var i = 0,
sampleCopyPasteLine = '';
while (sampleCopyPasteLine.length < 1000) {
i++;
sampleCopyPasteLine += i;
}
var sampleCopyPaste = sampleCopyPasteLine;
for (i = 1; i <= 600; i++) {
sampleCopyPaste += '\n' + sampleCopyPasteLine;
}
return sampleCopyPaste;
})()
);
addSample(
'Z___xss',
'text/html',
(function () {
var xssRepresentations = [
'<',
'BAD\u2028CHARACTER',
'%3C',
'&lt',
'&lt;',
'&LT',
'&LT;',
'&#60',
'&#060',
'&#0060',
'&#00060',
'&#000060',
'&#0000060',
'&#60;',
'&#060;',
'&#0060;',
'&#00060;',
'&#000060;',
'&#0000060;',
'&#x3c',
'&#x03c',
'&#x003c',
'&#x0003c',
'&#x00003c',
'&#x000003c',
'&#x3c;',
'&#x03c;',
'&#x003c;',
'&#x0003c;',
'&#x00003c;',
'&#x000003c;',
'&#X3c',
'&#X03c',
'&#X003c',
'&#X0003c',
'&#X00003c',
'&#X000003c',
'&#X3c;',
'&#X03c;',
'&#X003c;',
'&#X0003c;',
'&#X00003c;',
'&#X000003c;',
'&#x3C',
'&#x03C',
'&#x003C',
'&#x0003C',
'&#x00003C',
'&#x000003C',
'&#x3C;',
'&#x03C;',
'&#x003C;',
'&#x0003C;',
'&#x00003C;',
'&#x000003C;',
'&#X3C',
'&#X03C',
'&#X003C',
'&#X0003C',
'&#X00003C',
'&#X000003C',
'&#X3C;',
'&#X03C;',
'&#X003C;',
'&#X0003C;',
'&#X00003C;',
'&#X000003C;',
'\x3c',
'\x3C',
'\u003c',
'\u003C'
];
return xssRepresentations.length + ':\n' + xssRepresentations.join('\n');
})()
);
addSample(
'Z___many-links.js',
'text/javascript',
(function () {
var result = 'bla bla a url: https://microsoft.com some more bla bla';
for (var i = 0; i < 13; ++i) {
result += '\n' + result;
}
return '/*' + result + '\n*/';
})()
);
addSample(
'Z___line-separators.js',
'text/javascript',
(function () {
return [
"var x = '1'; // And\u2028 here I have a nice comment.",
'',
"var y = x + ' +\u2028 2 = res';",
'',
"y.replace(/re\u2028s/gi, '3');"
].join('\n');
})()
);
addXHRSample('Z___intellisense.js', 'run-editor-intellisense-js.txt', 'text/javascript');
addSample(
'Z___recursion attack',
'text/html',
(function () {
var arr = [];
for (var i = 0; i < 10000; i++) {
arr.push('\n<script type="text/html">');
}
return arr.length + ':\n' + arr.join('');
})()
);
addSample('empty', 'text/plain', '');
addXHRSample('Z___dynamic', 'run-editor-sample-dynamic.txt', {
name: 'custom.1.',
tokenizer: {
root: [
[/\[error.*/, 'custom-error'],
[/\[notice.*/, 'custom-notice'],
[/\[info.*/, 'custom-info'],
[/\[[a-zA-Z 0-9:]+\]/, 'custom-date']
]
}
});
addXHRSample('Z___f12___css', 'run-editor-sample-f12-css.txt', 'text/css');
return samples;
});

View file

@ -0,0 +1,44 @@
var container = document.getElementById("container");
var cssCode = [
'body {',
' margin: 0px;',
' padding: 0px;',
'}'
].join('\n');
Monaco.Editor.create(container, {
value: cssCode,
mode: "text/css"
});
require(['vs/platform/platform', 'vs/editor/modes/modesExtensions'],
function (Platform, ModesExtensions) {
var modesRegistry = Platform.Registry.as(ModesExtensions.Extensions.EditorModes);
// Try 'ignore', 'warning', and 'error'
modesRegistry.configureMode('text/css', {
"validationSettings": {
"lint": {
compatibleVendorPrefixes": "warning",
vendorPrefix": "warning",
duplicateProperties": "warning",
emptyRules": "warning",
importStatement": "ignore",
boxModel": "ignore",
universalSelector": "warning",
zeroUnits": "ignore",
fontFaceProperties": "warning",
hexColorLength": "error",
argumentsInColorFunction": "error",
unknownProperties": "warning",
unknownVendorSpecificProperties": "warning",
propertyIgnoredDueToDisplay": "warning",
important": "ignore",
float": "ignore",
idSelector": "ignore"
}
}
});
}
);

View file

@ -0,0 +1,33 @@
"use strict";
function Person(age) {
if (age) {
this.age = age;
}
}
Person.prototype.getAge = function () {
return this.age;
};
function Student(age, grade) {
Person.call(this, age);
this.grade = grade;
}
Student.prototype = new Person();
Student.prototype.getGrade = function () {
return this.grade;
};
var s = new Student(24, 5.75);
//var age = s.
//delete s.age;
//s.getAge = function() { return {foo:"bar"}; };
//s.
//s.getAge().

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,25 @@
define(['vs/base/common/severity'], function (severity) {
'use strict';
function ValidateParticipant() {}
ValidateParticipant.ID = 'doc.validateParticipant';
ValidateParticipant.prototype.validate = function (mirrorModel, markerService) {
var marker = {
severity: severity.Error,
message: [
{ isText: true, text: '\u2188 ' },
{ tagName: 'span', style: 'color:red', text: 'I AM' },
{ isText: true, text: ' A VALIDATION PARTICIPANT \u2188' }
],
startLineNumber: 1,
startColumn: 1,
endLineNumber: 1,
endColumn: 3
};
markerService.changeOne(ValidateParticipant.ID, mirrorModel.getAssociatedResource(), [marker]);
};
return {
ValidateParticipant: ValidateParticipant
};
});

View file

@ -0,0 +1,10 @@
/*
전문
유구한 역사와 전통에 빛나는 우리 대한 국민은 3·1 운동으로 건립된 대한민국 임시 정부의 법통과 불의에 항거한 4·19 민주 이념을 계승하고, 조국의 민주 개혁과 평화적 통일의 사명에 입각하여 정의·인도와 동포애로써 민족의 단결을 공고히 하고, 모든 사회적 폐습과 불의를 타파하며, 자율과 조화를 바탕으로 자유 민주적 기본 질서를 더욱 확고히 하여 정치·경제·사회·문화의 모든 영역에 있어서 각인의 기회를 균등히 하고, 능력을 최고도로 발휘하게 하며, 자유와 권리에 따르는 책임과 의무를 완수하게 하여, 안으로는 국민 생활의 균등한 향상을 기하고 밖으로는 항구적인 세계 평화와 인류 공영에 이바지함으로써 우리들과 우리들의 자손의 안전과 자유와 행복을 영원히 확보할 것을 다짐하면서 1948년 7월 12일에 제정되고 8차에 걸쳐 개정된 헌법을 이제 국회의 의결을 거쳐 국민 투표에 의하여 개정한다.
1987년 10월 29일
前文
悠久한 歷史와 傳統에 빛나는 우리 大韓國民은 3·1 運動으로 建立된 大韓民國臨時政府의 法統과 不義에 抗拒한 4·19 民主理念을 繼承하고, 祖國의 民主改革과 平和的統一의 使命에 立脚하여 正義·人道와 同胞愛로써 民族의 團結을 鞏固히 하고, 모든 社會的弊習과 不義를 打破하며, 自律과 調和를 바탕으로 自由民主的基本秩序를 더욱 確固히 하여 政治·經濟·社會·文化의 모든 領域에 있어서 各人의 機會를 均等히 하고, 能力을 最高度로 發揮하게 하며, 自由와 權利에 따르는 責任과 義務를 完遂하게 하여, 안으로는 國民生活의 均等한 向上을 基하고 밖으로는 恒久的인 世界平和와 人類共榮에 이바지함으로써 우리들과 우리들의 子孫의 安全과 自由와 幸福을 永遠히 確保할 것을 다짐하면서 1948年 7月 12日에 制定되고 8次에 걸쳐 改正된 憲法을 이제 國會의 議決을 거쳐 國民投票에 依하여 改正한다.
1987年 10月 29日
*/

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,493 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Web.Http.ModelBinding;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.Cookies;
using Microsoft.Owin.Security.OAuth;
using WebApplication.Models;
using WebApplication.Providers;
using WebApplication.Results;
namespace WebApplication.Controllers
{
[Authorize]
[RoutePrefix("api/Account")]
public class AccountController : ApiController
{
private const string LocalLoginProvider = "Local";
private ApplicationUserManager _userManager;
public AccountController()
{
}
public AccountController(ApplicationUserManager userManager,
ISecureDataFormat<AuthenticationTicket> accessTokenFormat)
{
UserManager = userManager;
AccessTokenFormat = accessTokenFormat;
}
public ApplicationUserManager UserManager
{
get
{
return _userManager ?? Request.GetOwinContext().GetUserManager<ApplicationUserManager>();
}
private set
{
_userManager = value;
}
}
public ISecureDataFormat<AuthenticationTicket> AccessTokenFormat { get; private set; }
// GET api/Account/UserInfo
[HostAuthentication(DefaultAuthenticationTypes.ExternalBearer)]
[Route("UserInfo")]
public UserInfoViewModel GetUserInfo()
{
ExternalLoginData externalLogin = ExternalLoginData.FromIdentity(User.Identity as ClaimsIdentity);
return new UserInfoViewModel
{
Email = User.Identity.GetUserName(),
HasRegistered = externalLogin == null,
LoginProvider = externalLogin != null ? externalLogin.LoginProvider : null
};
}
// POST api/Account/Logout
[Route("Logout")]
public IHttpActionResult Logout()
{
Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType);
return Ok();
}
// GET api/Account/ManageInfo?returnUrl=%2F&generateState=true
[Route("ManageInfo")]
public async Task<ManageInfoViewModel> GetManageInfo(string returnUrl, bool generateState = false)
{
IdentityUser user = await UserManager.FindByIdAsync(User.Identity.GetUserId());
if (user == null)
{
return null;
}
List<UserLoginInfoViewModel> logins = new List<UserLoginInfoViewModel>();
foreach (IdentityUserLogin linkedAccount in user.Logins)
{
logins.Add(new UserLoginInfoViewModel
{
LoginProvider = linkedAccount.LoginProvider,
ProviderKey = linkedAccount.ProviderKey
});
}
if (user.PasswordHash != null)
{
logins.Add(new UserLoginInfoViewModel
{
LoginProvider = LocalLoginProvider,
ProviderKey = user.UserName,
});
}
return new ManageInfoViewModel
{
LocalLoginProvider = LocalLoginProvider,
Email = user.UserName,
Logins = logins,
ExternalLoginProviders = GetExternalLogins(returnUrl, generateState)
};
}
// POST api/Account/ChangePassword
[Route("ChangePassword")]
public async Task<IHttpActionResult> ChangePassword(ChangePasswordBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
IdentityResult result = await UserManager.ChangePasswordAsync(User.Identity.GetUserId(), model.OldPassword,
model.NewPassword);
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
// POST api/Account/SetPassword
[Route("SetPassword")]
public async Task<IHttpActionResult> SetPassword(SetPasswordBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
IdentityResult result = await UserManager.AddPasswordAsync(User.Identity.GetUserId(), model.NewPassword);
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
// POST api/Account/AddExternalLogin
[Route("AddExternalLogin")]
public async Task<IHttpActionResult> AddExternalLogin(AddExternalLoginBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
AuthenticationTicket ticket = AccessTokenFormat.Unprotect(model.ExternalAccessToken);
if (ticket == null || ticket.Identity == null || (ticket.Properties != null
&& ticket.Properties.ExpiresUtc.HasValue
&& ticket.Properties.ExpiresUtc.Value < DateTimeOffset.UtcNow))
{
return BadRequest("External login failure.");
}
ExternalLoginData externalData = ExternalLoginData.FromIdentity(ticket.Identity);
if (externalData == null)
{
return BadRequest("The external login is already associated with an account.");
}
IdentityResult result = await UserManager.AddLoginAsync(User.Identity.GetUserId(),
new UserLoginInfo(externalData.LoginProvider, externalData.ProviderKey));
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
// POST api/Account/RemoveLogin
[Route("RemoveLogin")]
public async Task<IHttpActionResult> RemoveLogin(RemoveLoginBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
IdentityResult result;
if (model.LoginProvider == LocalLoginProvider)
{
result = await UserManager.RemovePasswordAsync(User.Identity.GetUserId());
}
else
{
result = await UserManager.RemoveLoginAsync(User.Identity.GetUserId(),
new UserLoginInfo(model.LoginProvider, model.ProviderKey));
}
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
// GET api/Account/ExternalLogin
[OverrideAuthentication]
[HostAuthentication(DefaultAuthenticationTypes.ExternalCookie)]
[AllowAnonymous]
[Route("ExternalLogin", Name = "ExternalLogin")]
public async Task<IHttpActionResult> GetExternalLogin(string provider, string error = null)
{
if (error != null)
{
return Redirect(Url.Content("~/") + "#error=" + Uri.EscapeDataString(error));
}
if (!User.Identity.IsAuthenticated)
{
return new ChallengeResult(provider, this);
}
ExternalLoginData externalLogin = ExternalLoginData.FromIdentity(User.Identity as ClaimsIdentity);
if (externalLogin == null)
{
return InternalServerError();
}
if (externalLogin.LoginProvider != provider)
{
Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
return new ChallengeResult(provider, this);
}
ApplicationUser user = await UserManager.FindAsync(new UserLoginInfo(externalLogin.LoginProvider,
externalLogin.ProviderKey));
bool hasRegistered = user != null;
if (hasRegistered)
{
Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
ClaimsIdentity oAuthIdentity = await user.GenerateUserIdentityAsync(UserManager,
OAuthDefaults.AuthenticationType);
ClaimsIdentity cookieIdentity = await user.GenerateUserIdentityAsync(UserManager,
CookieAuthenticationDefaults.AuthenticationType);
AuthenticationProperties properties = ApplicationOAuthProvider.CreateProperties(user.UserName);
Authentication.SignIn(properties, oAuthIdentity, cookieIdentity);
}
else
{
IEnumerable<Claim> claims = externalLogin.GetClaims();
ClaimsIdentity identity = new ClaimsIdentity(claims, OAuthDefaults.AuthenticationType);
Authentication.SignIn(identity);
}
return Ok();
}
// GET api/Account/ExternalLogins?returnUrl=%2F&generateState=true
[AllowAnonymous]
[Route("ExternalLogins")]
public IEnumerable<ExternalLoginViewModel> GetExternalLogins(string returnUrl, bool generateState = false)
{
IEnumerable<AuthenticationDescription> descriptions = Authentication.GetExternalAuthenticationTypes();
List<ExternalLoginViewModel> logins = new List<ExternalLoginViewModel>();
string state;
if (generateState)
{
const int strengthInBits = 256;
state = RandomOAuthStateGenerator.Generate(strengthInBits);
}
else
{
state = null;
}
foreach (AuthenticationDescription description in descriptions)
{
ExternalLoginViewModel login = new ExternalLoginViewModel
{
Name = description.Caption,
Url = Url.Route("ExternalLogin", new
{
provider = description.AuthenticationType,
response_type = "token",
client_id = Startup.PublicClientId,
redirect_uri = new Uri(Request.RequestUri, returnUrl).AbsoluteUri,
state = state
}),
State = state
};
logins.Add(login);
}
return logins;
}
// POST api/Account/Register
[AllowAnonymous]
[Route("Register")]
public async Task<IHttpActionResult> Register(RegisterBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
IdentityResult result = await UserManager.CreateAsync(user, model.Password);
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
// POST api/Account/RegisterExternal
[OverrideAuthentication]
[HostAuthentication(DefaultAuthenticationTypes.ExternalBearer)]
[Route("RegisterExternal")]
public async Task<IHttpActionResult> RegisterExternal(RegisterExternalBindingModel model)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
var info = await Authentication.GetExternalLoginInfoAsync();
if (info == null)
{
return InternalServerError();
}
var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
IdentityResult result = await UserManager.CreateAsync(user);
if (!result.Succeeded)
{
return GetErrorResult(result);
}
result = await UserManager.AddLoginAsync(user.Id, info.Login);
if (!result.Succeeded)
{
return GetErrorResult(result);
}
return Ok();
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
UserManager.Dispose();
}
base.Dispose(disposing);
}
#region Helpers
private IAuthenticationManager Authentication
{
get { return Request.GetOwinContext().Authentication; }
}
private IHttpActionResult GetErrorResult(IdentityResult result)
{
if (result == null)
{
return InternalServerError();
}
if (!result.Succeeded)
{
if (result.Errors != null)
{
foreach (string error in result.Errors)
{
ModelState.AddModelError("", error);
}
}
if (ModelState.IsValid)
{
// No ModelState errors are available to send, so just return an empty BadRequest.
return BadRequest();
}
return BadRequest(ModelState);
}
return null;
}
private class ExternalLoginData
{
public string LoginProvider { get; set; }
public string ProviderKey { get; set; }
public string UserName { get; set; }
public IList<Claim> GetClaims()
{
IList<Claim> claims = new List<Claim>();
claims.Add(new Claim(ClaimTypes.NameIdentifier, ProviderKey, null, LoginProvider));
if (UserName != null)
{
claims.Add(new Claim(ClaimTypes.Name, UserName, null, LoginProvider));
}
return claims;
}
public static ExternalLoginData FromIdentity(ClaimsIdentity identity)
{
if (identity == null)
{
return null;
}
Claim providerKeyClaim = identity.FindFirst(ClaimTypes.NameIdentifier);
if (providerKeyClaim == null || String.IsNullOrEmpty(providerKeyClaim.Issuer)
|| String.IsNullOrEmpty(providerKeyClaim.Value))
{
return null;
}
if (providerKeyClaim.Issuer == ClaimsIdentity.DefaultIssuer)
{
return null;
}
return new ExternalLoginData
{
LoginProvider = providerKeyClaim.Issuer,
ProviderKey = providerKeyClaim.Value,
UserName = identity.FindFirstValue(ClaimTypes.Name)
};
}
}
private static class RandomOAuthStateGenerator
{
private static RandomNumberGenerator _random = new RNGCryptoServiceProvider();
public static string Generate(int strengthInBits)
{
const int bitsPerByte = 8;
if (strengthInBits % bitsPerByte != 0)
{
throw new ArgumentException("strengthInBits must be evenly divisible by 8.", "strengthInBits");
}
int strengthInBytes = strengthInBits / bitsPerByte;
byte[] data = new byte[strengthInBytes];
_random.GetBytes(data);
return HttpServerUtility.UrlTokenEncode(data);
}
}
#endregion
}
}

View file

@ -0,0 +1,12 @@
# A line that ends only in CR(0x0D) and not LF (0x0A). foreach($parameterSet in $ObjInfoArray)
{
# This line also ends only in CR(0x0D) and not LF (0x0A). if ($parameterSet["class"] -eq "blank")
{
if ($XenCenterNodeSelected)
{
continue
}
$XenCenterNodeSelected = 1; $SelectedObjectNames += "XenCenter"
}
}

View file

@ -0,0 +1,50 @@
[Sun Mar 7 16:02:00 2004] [notice] Apache/1.3.29 (Unix) configured -- resuming normal operations
[Sun Mar 7 16:02:00 2004] [info] Server built: Feb 27 2004 13:56:37
[Sun Mar 7 16:02:00 2004] [notice] Accept mutex: sysvsem (Default: sysvsem)
[Sun Mar 7 16:05:49 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 16:45:56 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:13:50 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:21:44 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:23:53 2004] statistics: Use of uninitialized value in concatenation (.) or string at /home/httpd/twiki/lib/TWiki.pm line 528.
[Sun Mar 7 17:23:53 2004] statistics: Can't create file /home/httpd/twiki/data/Main/WebStatistics.txt - Permission denied
[Sun Mar 7 17:27:37 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:31:39 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 17:58:00 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 18:00:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 18:10:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 18:19:01 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 18:42:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 18:52:30 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 18:58:52 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 19:03:58 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 19:08:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 20:04:35 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 20:11:33 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 20:12:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 20:25:31 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 20:44:48 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 20:58:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome
[Sun Mar 7 21:20:14 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 21:31:12 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 21:39:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Sun Mar 7 21:44:10 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 01:35:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 01:47:06 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 01:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 02:12:24 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 02:54:54 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 03:46:27 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 03:48:18 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 03:52:17 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 03:55:09 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 04:22:55 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 04:24:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 04:40:32 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 04:55:40 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 04:59:13 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 05:22:57 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 05:24:29 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
[Mon Mar 8 05:31:47 2004] [info] [client xx.xx.xx.xx] (104)Connection reset by peer: client stopped connection before send body completed
<11>httpd[31628]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_inf.html in 29-Mar 15:18:20.50 from xx.xx.xx.xx
<11>httpd[25859]: [error] [client xx.xx.xx.xx] File does not exist: /usr/local/installed/apache/htdocs/squirrelmail/_vti_bin/shtml.exe/_vti_rpc in 29-Mar 15:18:20.54 from xx.xx.xx.xx

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,23 @@
<!DOCTYPE HTML>
<!--
Comments are overrated
-->
<html>
<head>
<title>HTML Sample</title>
<style type="text/css">
h1 {
color: #CCA3A3;
}
body {
}
</style>
<script type="text/javascript">
window.alert("I am a sample...");
</script>
</head>
<body>
<h1>Heading No.1</h1>
<input disabled type="button" value="Click me" />
</body>
</html>

View file

@ -0,0 +1,222 @@
/*
© Microsoft. All rights reserved.
https://microsoft.com
blablahttp://en.wikipedia.org/wiki/Timisoara bla bla
blabla http://en.wikipedia.org/wiki/Timisoara bla bla
This library is supported for use in Windows Tailored Apps only.
Build: 6.2.8100.0
Version: 0.5
*/
var קודמות = "מיותר קודמות צ'ט של, אם לשון העברית שינויים ויש, אם";
'a string\
on multiple lines';
(function (global, undefined) {
"use strict";
undefinedVariable = {}; undefinedVariable.bar = 5;
undefinedVariable.foo = 5; undefinedVariable.baz = 10;
function initializeProperties(target, members) {
var keys = Object.keys(members);
var properties;
var i, len;
for (i = 0, len = keys.length; i < len; i++) {
var key = keys[i];
var enumerable = key.charCodeAt(0) !== /*_*/95;
var member = members[key];
if (member && typeof member === 'object') {
if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {
if (member.enumerable === undefined) {
member.enumerable = enumerable;
}
properties = properties || {};
properties[key] = member;
continue;
}
}
if (!enumerable) {
properties = properties || {};
properties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true }
continue;
}
target[key] = member;
}
if (properties) {
Object.defineProperties(target, properties);
}
}
(function (rootNamespace) {
// Create the rootNamespace in the global namespace
if (!global[rootNamespace]) {
global[rootNamespace] = Object.create(Object.prototype);
}
// Cache the rootNamespace we just created in a local variable
var _rootNamespace = global[rootNamespace];
if (!_rootNamespace.Namespace) {
_rootNamespace.Namespace = Object.create(Object.prototype);
}
function defineWithParent(parentNamespace, name, members) {
/// <summary locid="1">
/// Defines a new namespace with the specified name, under the specified parent namespace.
/// </summary>
/// <param name="parentNamespace" type="Object" locid="2">
/// The parent namespace which will contain the new namespace.
/// </param>
/// <param name="name" type="String" locid="3">
/// Name of the new namespace.
/// </param>
/// <param name="members" type="Object" locid="4">
/// Members in the new namespace.
/// </param>
/// <returns locid="5">
/// The newly defined namespace.
/// </returns>
var currentNamespace = parentNamespace,
namespaceFragments = name.split(".");
for (var i = 0, len = namespaceFragments.length; i < len; i++) {
var namespaceName = namespaceFragments[i];
if (!currentNamespace[namespaceName]) {
Object.defineProperty(currentNamespace, namespaceName,
{ value: {}, writable: false, enumerable: true, configurable: true }
);
}
currentNamespace = currentNamespace[namespaceName];
}
if (members) {
initializeProperties(currentNamespace, members);
}
return currentNamespace;
};
function define(name, members) {
/// <summary locid="6">
/// Defines a new namespace with the specified name.
/// </summary>
/// <param name="name" type="String" locid="7">
/// Name of the namespace. This could be a dot-separated nested name.
/// </param>
/// <param name="members" type="Object" locid="4">
/// Members in the new namespace.
/// </param>
/// <returns locid="5">
/// The newly defined namespace.
/// </returns>
return defineWithParent(global, name, members);
}
// Establish members of the "WinJS.Namespace" namespace
Object.defineProperties(_rootNamespace.Namespace, {
defineWithParent: { value: defineWithParent, writable: true, enumerable: true },
define: { value: define, writable: true, enumerable: true }
});
})("WinJS");
(function (WinJS) {
function define(constructor, instanceMembers, staticMembers) {
/// <summary locid="8">
/// Defines a class using the given constructor and with the specified instance members.
/// </summary>
/// <param name="constructor" type="Function" locid="9">
/// A constructor function that will be used to instantiate this class.
/// </param>
/// <param name="instanceMembers" type="Object" locid="10">
/// The set of instance fields, properties and methods to be made available on the class.
/// </param>
/// <param name="staticMembers" type="Object" locid="11">
/// The set of static fields, properties and methods to be made available on the class.
/// </param>
/// <returns type="Function" locid="12">
/// The newly defined class.
/// </returns>
constructor = constructor || function () { };
if (instanceMembers) {
initializeProperties(constructor.prototype, instanceMembers);
}
if (staticMembers) {
initializeProperties(constructor, staticMembers);
}
return constructor;
}
function derive(baseClass, constructor, instanceMembers, staticMembers) {
/// <summary locid="13">
/// Uses prototypal inheritance to create a sub-class based on the supplied baseClass parameter.
/// </summary>
/// <param name="baseClass" type="Function" locid="14">
/// The class to inherit from.
/// </param>
/// <param name="constructor" type="Function" locid="9">
/// A constructor function that will be used to instantiate this class.
/// </param>
/// <param name="instanceMembers" type="Object" locid="10">
/// The set of instance fields, properties and methods to be made available on the class.
/// </param>
/// <param name="staticMembers" type="Object" locid="11">
/// The set of static fields, properties and methods to be made available on the class.
/// </param>
/// <returns type="Function" locid="12">
/// The newly defined class.
/// </returns>
if (baseClass) {
constructor = constructor || function () { };
var basePrototype = baseClass.prototype;
constructor.prototype = Object.create(basePrototype);
Object.defineProperty(constructor.prototype, "_super", { value: basePrototype });
Object.defineProperty(constructor.prototype, "constructor", { value: constructor });
if (instanceMembers) {
initializeProperties(constructor.prototype, instanceMembers);
}
if (staticMembers) {
initializeProperties(constructor, staticMembers);
}
return constructor;
} else {
return define(constructor, instanceMembers, staticMembers);
}
}
function mix(constructor) {
/// <summary locid="15">
/// Defines a class using the given constructor and the union of the set of instance members
/// specified by all the mixin objects. The mixin parameter list can be of variable length.
/// </summary>
/// <param name="constructor" locid="9">
/// A constructor function that will be used to instantiate this class.
/// </param>
/// <returns locid="12">
/// The newly defined class.
/// </returns>
constructor = constructor || function () { };
var i, len;
for (i = 0, len = arguments.length; i < len; i++) {
initializeProperties(constructor.prototype, arguments[i]);
}
return constructor;
}
// Establish members of "WinJS.Class" namespace
WinJS.Namespace.define("WinJS.Class", {
define: define,
derive: derive,
mix: mix
});
})(WinJS);
})(this);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,29 @@
REPORT zrosetta_base64_encode_data.
DATA: li_client TYPE REF TO if_http_client,
lv_encoded TYPE string,
lv_data TYPE xstring.
cl_http_client=>create_by_url(
EXPORTING
url = 'http://rosettacode.org/favicon.ico'
IMPORTING
client = li_client ).
li_client->send( ).
li_client->receive( ).
lv_data = li_client->response->get_data( ).
CALL FUNCTION 'SSFC_BASE64_ENCODE'
EXPORTING
bindata = lv_data
IMPORTING
b64data = lv_encoded.
WHILE strlen( lv_encoded ) > 100.
WRITE: / lv_encoded(100).
lv_encoded = lv_encoded+100.
ENDWHILE.
WRITE: / lv_encoded.

View file

@ -0,0 +1,38 @@
// Contract simulating developers organization
contract HackBG =
record state = { developers: map(address, developer) }
record developer = { name: string
, age: int
, skillset: map(skill, experience) }
type skill = string
type experience = int
datatype event =
LogDeveloperAdded(indexed address, indexed int, string)
entrypoint init() : state = { developers = {} }
stateful entrypoint dev_add(account: address, dev_name: string, dev_age: int) =
require(!is_member(account), "ERROR_DEVELOPER_ALREADY_EXISTS")
let dev : developer = { name = dev_name
, age = dev_age
, skillset = {} }
put(state{ developers[account] = dev })
Chain.event(LogDeveloperAdded(account, Chain.timestamp, dev_name))
stateful entrypoint dev_update(account: address, dev_name: string, dev_age: int) =
require(is_member(account), "ERROR_DEVELOPER_DOES_NOT_EXIST")
put(state{ developers[account].name = dev_name })
put(state{ developers[account].age = dev_age })
function is_member(account: address) : bool =
Map.member(account, state.developers)
stateful entrypoint dev_skill_modify(account: address, skill: string, experience: int) =
put(state{ developers[account].skillset[skill] = experience })
entrypoint dev_get(account: address) : developer =
state.developers[account]

View file

@ -0,0 +1,7 @@
/* Using a single database query, find all the leads in
the database that have the same email address as any
of the leads being inserted or updated. */
for (Lead lead : [SELECT Email FROM Lead WHERE Email IN :leadMap.KeySet()]) {
Lead newLead = leadMap.get(lead.Email);
newLead.Email.addError('A lead with this email address already exists.');
}

View file

@ -0,0 +1,5 @@
# Create a resource group.
az group create --name myResourceGroup --location westeurope
# Create a new virtual machine, this creates SSH keys if not present.
az vm create --resource-group myResourceGroup --name myVM --image UbuntuLTS --generate-ssh-keys

View file

@ -0,0 +1,13 @@
rem *******Begin Comment**************
rem This program starts the superapp batch program on the network,
rem directs the output to a file, and displays the file
rem in Notepad.
rem *******End Comment**************
@echo off
if exist C:\output.txt goto EMPTYEXISTS
setlocal
path=g:\programs\superapp;%path%
call superapp>C:\output.txt
endlocal
:EMPTYEXISTS
start notepad c:\output.txt

View file

@ -0,0 +1,29 @@
targetScope = 'subscription'
param deployStorage bool = true
@description('The object ID of the principal that will get the role assignment')
param aadPrincipalId string
module stg './storage.bicep' = if(deployStorage) {
name: 'storageDeploy'
scope: resourceGroup('another-rg') // this will target another resource group in the same subscription
params: {
storageAccountName: '<YOURUNIQUESTORAGENAME>'
}
}
var contributor = 'b24988ac-6180-42a0-ab88-20f7382dd24c'
resource roleDef 'Microsoft.Authorization/roleDefinitions@2018-01-01-preview' existing = {
name: contributor
}
resource rbac 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: guid(subscription().id, aadPrincipalId, contributor)
properties: {
roleDefinitionId: roleDef.id
principalId: aadPrincipalId
}
}
output storageName array = stg.outputs.containerProps

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,17 @@
type storage = int
type parameter =
Increment of int
| Decrement of int
| Reset
type return = operation list * storage
// Two entrypoints
let add (store, delta : storage * int) : storage = store + delta
let sub (store, delta : storage * int) : storage = store - delta
(* Main access point that dispatches to the entrypoints according to
the smart contract parameter. *)
let main (action, store : parameter * storage) : return =
([] : operation list), // No operations
(match action with
Increment (n) -> add (store, n)
| Decrement (n) -> sub (store, n)
| Reset -> 0)

View file

@ -0,0 +1,54 @@
(ns game-of-life
"Conway's Game of Life, based on the work of
Christophe Grand (http://clj-me.cgrand.net/2011/08/19/conways-game-of-life)
and Laurent Petit (https://gist.github.com/1200343).")
;;; Core game of life's algorithm functions
(defn neighbors
"Given a cell's coordinates `[x y]`, returns the coordinates of its
neighbors."
[[x y]]
(for [dx [-1 0 1]
dy (if (zero? dx)
[-1 1]
[-1 0 1])]
[(+ dx x) (+ dy y)]))
(defn step
"Given a set of living `cells`, computes the new set of living cells."
[cells]
(set (for [[cell n] (frequencies (mapcat neighbors cells))
:when (or (= n 3)
(and (= n 2)
(cells cell)))]
cell)))
;;; Utility methods for displaying game on a text terminal
(defn print-grid
"Prints a `grid` of `w` columns and `h` rows, on *out*, representing a
step in the game."
[grid w h]
(doseq [x (range (inc w))
y (range (inc h))]
(when (= y 0) (println))
(print (if (grid [x y])
"[X]"
" . "))))
(defn print-grids
"Prints a sequence of `grids` of `w` columns and `h` rows on *out*,
representing several steps."
[grids w h]
(doseq [grid grids]
(print-grid grid w h)
(println)))
;;; Launches an example grid
(def grid
"`grid` represents the initial set of living cells"
#{[2 1] [2 2] [2 3]})
(print-grids (take 3 (iterate step grid)) 5 5)

View file

@ -0,0 +1,28 @@
"""
A CoffeeScript sample.
"""
class Vehicle
constructor: (@name) =>
drive: () =>
alert "Conducting #{@name}"
class Car extends Vehicle
drive: () =>
alert "Driving #{@name}"
c = new Car "Brandie"
while notAtDestination()
c.drive()
raceVehicles = (new Car for i in [1..100])
startRace = (vehicles) -> [vehicle.drive() for vehicle in vehicles]
fancyRegExp = ///
(\d+) # numbers
(\w*) # letters
$ # the end
///

View file

@ -0,0 +1,246 @@
#include "pch.h"
#include "Direct3DBase.h"
using namespace Microsoft::WRL;
using namespace Windows::UI::Core;
using namespace Windows::Foundation;
// Constructor.
Direct3DBase::Direct3DBase()
{
}
// Initialize the Direct3D resources required to run.
void Direct3DBase::Initialize(CoreWindow^ window)
{
m_window = window;
CreateDeviceResources();
CreateWindowSizeDependentResources();
}
// These are the resources that depend on the device.
void Direct3DBase::CreateDeviceResources()
{
// This flag adds support for surfaces with a different color channel ordering than the API default.
// It is recommended usage, and is required for compatibility with Direct2D.
UINT creationFlags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
#if defined(_DEBUG)
// If the project is in a debug build, enable debugging via SDK Layers with this flag.
creationFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
// This array defines the set of DirectX hardware feature levels this app will support.
// Note the ordering should be preserved.
// Don't forget to declare your application's minimum required feature level in its
// description. All applications are assumed to support 9.1 unless otherwise stated.
D3D_FEATURE_LEVEL featureLevels[] =
{
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_1
};
// Create the DX11 API device object, and get a corresponding context.
ComPtr<ID3D11Device> device;
ComPtr<ID3D11DeviceContext> context;
DX::ThrowIfFailed(
D3D11CreateDevice(
nullptr, // specify null to use the default adapter
D3D_DRIVER_TYPE_HARDWARE,
nullptr, // leave as nullptr unless software device
creationFlags, // optionally set debug and Direct2D compatibility flags
featureLevels, // list of feature levels this app can support
ARRAYSIZE(featureLevels), // number of entries in above list
D3D11_SDK_VERSION, // always set this to D3D11_SDK_VERSION
&device, // returns the Direct3D device created
&m_featureLevel, // returns feature level of device created
&context // returns the device immediate context
)
);
// Get the DirectX11.1 device by QI off the DirectX11 one.
DX::ThrowIfFailed(
device.As(&m_d3dDevice)
);
// And get the corresponding device context in the same way.
DX::ThrowIfFailed(
context.As(&m_d3dContext)
);
}
// Allocate all memory resources that change on a window SizeChanged event.
void Direct3DBase::CreateWindowSizeDependentResources()
{
// Store the window bounds so the next time we get a SizeChanged event we can
// avoid rebuilding everything if the size is identical.
m_windowBounds = m_window->Bounds;
// If the swap chain already exists, resize it.
if(m_swapChain != nullptr)
{
DX::ThrowIfFailed(
m_swapChain->ResizeBuffers(2, 0, 0, DXGI_FORMAT_B8G8R8A8_UNORM, 0)
);
}
// Otherwise, create a new one.
else
{
// Create a descriptor for the swap chain.
DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0};
swapChainDesc.Width = 0; // use automatic sizing
swapChainDesc.Height = 0;
swapChainDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // this is the most common swapchain format
swapChainDesc.Stereo = false;
swapChainDesc.SampleDesc.Count = 1; // don't use multi-sampling
swapChainDesc.SampleDesc.Quality = 0;
swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
swapChainDesc.BufferCount = 2; // use two buffers to enable flip effect
swapChainDesc.Scaling = DXGI_SCALING_NONE;
swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // we recommend using this swap effect for all applications
swapChainDesc.Flags = 0;
// Once the desired swap chain description is configured, it must be created on the same adapter as our D3D Device
// First, retrieve the underlying DXGI Device from the D3D Device
ComPtr<IDXGIDevice1> dxgiDevice;
DX::ThrowIfFailed(
m_d3dDevice.As(&dxgiDevice)
);
// Identify the physical adapter (GPU or card) this device is running on.
ComPtr<IDXGIAdapter> dxgiAdapter;
DX::ThrowIfFailed(
dxgiDevice->GetAdapter(&dxgiAdapter)
);
// And obtain the factory object that created it.
ComPtr<IDXGIFactory2> dxgiFactory;
DX::ThrowIfFailed(
dxgiAdapter->GetParent(
__uuidof(IDXGIFactory2),
&dxgiFactory
)
);
Windows::UI::Core::CoreWindow^ p = m_window.Get();
// Create a swap chain for this window from the DXGI factory.
DX::ThrowIfFailed(
dxgiFactory->CreateSwapChainForCoreWindow(
m_d3dDevice.Get(),
reinterpret_cast<IUnknown*>(p),
&swapChainDesc,
nullptr, // allow on all displays
&m_swapChain
)
);
// Ensure that DXGI does not queue more than one frame at a time. This both reduces
// latency and ensures that the application will only render after each VSync, minimizing
// power consumption.
DX::ThrowIfFailed(
dxgiDevice->SetMaximumFrameLatency(1)
);
}
// Obtain the backbuffer for this window which will be the final 3D rendertarget.
ComPtr<ID3D11Texture2D> backBuffer;
DX::ThrowIfFailed(
m_swapChain->GetBuffer(
0,
__uuidof(ID3D11Texture2D),
&backBuffer
)
);
// Create a view interface on the rendertarget to use on bind.
DX::ThrowIfFailed(
m_d3dDevice->CreateRenderTargetView(
backBuffer.Get(),
nullptr,
&m_renderTargetView
)
);
// Cache the rendertarget dimensions in our helper class for convenient use.
D3D11_TEXTURE2D_DESC backBufferDesc;
backBuffer->GetDesc(&backBufferDesc);
m_renderTargetSize.Width = static_cast<float>(backBufferDesc.Width);
m_renderTargetSize.Height = static_cast<float>(backBufferDesc.Height);
// Create a descriptor for the depth/stencil buffer.
CD3D11_TEXTURE2D_DESC depthStencilDesc(
DXGI_FORMAT_D24_UNORM_S8_UINT,
backBufferDesc.Width,
backBufferDesc.Height,
1,
1,
D3D11_BIND_DEPTH_STENCIL);
// Allocate a 2-D surface as the depth/stencil buffer.
ComPtr<ID3D11Texture2D> depthStencil;
DX::ThrowIfFailed(
m_d3dDevice->CreateTexture2D(
&depthStencilDesc,
nullptr,
&depthStencil
)
);
// Create a DepthStencil view on this surface to use on bind.
DX::ThrowIfFailed(
m_d3dDevice->CreateDepthStencilView(
depthStencil.Get(),
&CD3D11_DEPTH_STENCIL_VIEW_DESC(D3D11_DSV_DIMENSION_TEXTURE2D),
&m_depthStencilView
)
);
// Create a viewport descriptor of the full window size.
CD3D11_VIEWPORT viewPort(
0.0f,
0.0f,
static_cast<float>(backBufferDesc.Width),
static_cast<float>(backBufferDesc.Height)
);
// Set the current viewport using the descriptor.
m_d3dContext->RSSetViewports(1, &viewPort);
}
void Direct3DBase::UpdateForWindowSizeChange()
{
if (m_window->Bounds.Width != m_windowBounds.Width ||
m_window->Bounds.Height != m_windowBounds.Height)
{
m_renderTargetView = nullptr;
m_depthStencilView = nullptr;
CreateWindowSizeDependentResources();
}
}
void Direct3DBase::Present()
{
// The first argument instructs DXGI to block until VSync, putting the application
// to sleep until the next VSync. This ensures we don't waste any cycles rendering
// frames that will never be displayed to the screen.
HRESULT hr = m_swapChain->Present(1, 0);
// If the device was removed either by a disconnect or a driver upgrade, we
// must completely reinitialize the renderer.
if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET)
{
Initialize(m_window.Get());
}
else
{
DX::ThrowIfFailed(hr);
}
}

View file

@ -0,0 +1,38 @@
/*
* C# Program to Display All the Prime Numbers Between 1 to 100
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace VS
{
class Program
{
static void Main(string[] args)
{
bool isPrime = true;
Console.WriteLine("Prime Numbers : ");
for (int i = 2; i <= 100; i++)
{
for (int j = 2; j <= 100; j++)
{
if (i != j && i % j == 0)
{
isPrime = false;
break;
}
}
if (isPrime)
{
Console.Write("\t" +i);
}
isPrime = true;
}
Console.ReadKey();
}
}
}

View file

@ -0,0 +1 @@
Content-Security-Policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com

View file

@ -0,0 +1,828 @@
html {
background-color: #e2e2e2;
margin: 0;
padding: 0;
}
body {
background-color: #fff;
border-top: solid 10px #000;
color: #333;
font-size: .85em;
font-family: "Segoe UI","HelveticaNeue-Light", sans-serif;
margin: 0;
padding: 0;
}
a:link, a:visited,
a:active, a:hover {
color: #333;
outline: none;
padding-left: 0;
padding-right: 3px;
text-decoration: none;
}
a:hover {
background-color: #c7d1d6;
}
header, footer, hgroup
nav, section {
display: block;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
.highlight {
/* background-color: #a6dbed;
padding-left: 5px;
padding-right: 5px;*/
}
.clear-fix:after {
content: ".";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
h1, h2, h3,
h4, h5, h6 {
color: #000;
margin-bottom: 0;
padding-bottom: 0;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.75em;
}
h3 {
font-size: 1.2em;
}
h4 {
font-size: 1.1em;
}
h5, h6 {
font-size: 1em;
}
.tile {
/* 2px solid #7ac0da; */
border: 0;
float: left;
width: 200px;
height: 325px;
padding: 5px;
margin-right: 5px;
margin-bottom: 20px;
margin-top: 20px;
-webkit-perspective: 0;
-webkit-transform-style: preserve-3d;
-webkit-transition: -webkit-transform 0.2s;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.3);
background-position: center center;
background-repeat: no-repeat;
background-color: #fff;
}
.tile-item {
/* 2px solid #7ac0da; */
border-color: inherit;
float: left;
width: 50px;
height: 70px;
margin-right: 20px;
margin-bottom: 20px;
margin-top: 20px;
background-image: url('../Images/documents.png');
background-repeat: no-repeat;
}
.tile-wrapper {
width: 100%;
font-family: "Segoe UI" , Tahoma, Geneva, Verdana, sans-serif;
line-height: 21px;
font-size: 14px;
}
a.blue-box {
font-size: 28px;
height: 100px;
display: block;
border-style: solid;
border-width: 1px 1px 4px 1px;
border-color: #C0C0C0 #C0C0C0 #8ABAE4 #C0C0C0;
padding-top: 15px;
padding-left: 15px;
}
a.blue-box:hover {
border: 4px solid #8ABAE4;
padding-top: 12px;
padding-left: 12px;
background-color: #FFFFFF;
}
a.green-box {
font-size: 28px;
height: 100px;
display: block;
border-style: solid;
border-width: 1px 1px 4px 1px;
border-color: #C0C0C0 #C0C0C0 #9CCF42 #C0C0C0;
padding-top: 15px;
padding-left: 15px;
}
a.green-box:hover {
border: 4px solid #9CCF42;
padding-top: 12px;
padding-left: 12px;
background-color: #FFFFFF;
}
a.green-box2 {
font-size: 14px;
height: 48px;
width: 48px;
display: block; /* border-color: #C0C0C0; */
padding-top: 6px;
font-weight: bold;
}
a.green-box2:hover {
border: solid #8ABAE4;
padding-top: 0px;
padding-left: 0px;
background-image: url('../Images/documents.png');
background-color: #EFEFEF;
}
a.yellow-box {
font-size: 28px;
height: 100px;
display: block;
border-style: solid;
border-width: 1px 1px 4px 1px;
border-color: #C0C0C0 #C0C0C0 #DECF6B #C0C0C0;
padding-top: 15px;
padding-left: 15px;
}
a.yellow-box:hover {
border: 4px solid #DECF6B;
padding-top: 12px;
padding-left: 12px;
background-color: #FFFFFF;
}
a.red-box {
font-size: 28px;
height: 100px;
display: block;
border-style: solid;
border-width: 1px 1px 4px 1px;
border-color: #C0C0C0 #C0C0C0 #F79E84 #C0C0C0;
padding-top: 15px;
padding-left: 15px;
}
a.red-box:hover {
border: 4px solid #F79E84;
padding-top: 12px;
padding-left: 12px;
background-color: #FFFFFF;
}
/* main layout
----------------------------------------------------------*/
.content-wrapper {
margin: 0 auto;
max-width: 960px;
}
#body {
background-color: #efeeef;
clear: both;
padding-bottom: 35px;
}
.main-content {
background: url("../images/accent.png") no-repeat;
padding-left: 10px;
padding-top: 30px;
}
.featured + .main-content {
background: url("../images/heroaccent.png") no-repeat;
}
footer {
clear: both;
background-color: #e2e2e2;
font-size: .8em;
height: 100px;
}
/* site title
----------------------------------------------------------*/
.site-title {
color: #0066CC; /* font-family: Rockwell, Consolas, "Courier New", Courier, monospace; */
font-size: 3.3em;
margin-top: 40px;
margin-bottom: 0;
}
.site-title a, .site-title a:hover, .site-title a:active {
background: none;
color: #0066CC;
outline: none;
text-decoration: none;
}
/* login
----------------------------------------------------------*/
#login {
display: block;
font-size: .85em;
margin-top: 20px;
text-align: right;
}
#login a {
background-color: #d3dce0;
margin-left: 10px;
margin-right: 3px;
padding: 2px 3px;
text-decoration: none;
}
#login a.username {
background: none;
margin-left: 0px;
text-decoration: underline;
}
#login li {
display: inline;
list-style: none;
}
/* menu
----------------------------------------------------------*/
ul#menu {
font-size: 1.3em;
font-weight: 600;
margin: 0;
text-align: right;
text-decoration: none;
}
ul#menu li {
display: inline;
list-style: none;
padding-left: 15px;
}
ul#menu li a {
background: none;
color: #999;
text-decoration: none;
}
ul#menu li a:hover {
color: #333;
text-decoration: none;
}
/* page elements
----------------------------------------------------------*/
/* featured */
.featured {
background-color: #fff;
}
.featured .content-wrapper {
/*background-color: #7ac0da;
background-image: -ms-linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);
background-image: -o-linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);
background-image: -webkit-gradient(linear, left top, right top, color-stop(0, #7AC0DA), color-stop(1, #A4D4E6));
background-image: -webkit-linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);
background-image: linear-gradient(left, #7AC0DA 0%, #A4D4E6 100%);
color: #3e5667;
*/
padding: 0px 40px 30px 40px;
}
.featured hgroup.title h1, .featured hgroup.title h2 {
/* color: #fff;
*/
}
.featured p {
font-size: 1.1em;
}
/* page titles */
hgroup.title {
margin-bottom: 10px;
}
hgroup.title h1, hgroup.title h2 {
display: inline;
}
hgroup.title h2 {
font-weight: normal;
}
/* releases */
.milestone {
color: #fff;
background-color: #8ABAE4;
font-weight: normal;
padding: 10px 10px 10px 10px;
margin: 0 0 0 0;
}
.milestone .primary {
font-size: 1.75em;
}
.milestone .secondary {
font-size: 1.2em;
font-weight: normal;
/* padding: 5px 5px 5px 10px;*/
}
/* features */
section.feature {
width: 200px;
float: left;
padding: 10px;
}
/* ordered list */
ol.round {
list-style-type: none;
padding-left: 0;
}
ol.round li {
margin: 25px 0;
padding-left: 45px;
}
ol.round li.one {
background: url("../images/orderedlistOne.png") no-repeat;
}
ol.round li.two {
background: url("../images/orderedlistTwo.png") no-repeat;
}
ol.round li.three {
background: url("../images/orderedlistThree.png") no-repeat;
}
/* content */
article {
float: left;
width: 70%;
}
aside {
float: right;
width: 25%;
}
aside ul {
list-style: none;
padding: 0;
}
aside ul li {
background: url("../images/bullet.png") no-repeat 0 50%;
padding: 2px 0 2px 20px;
}
.label {
font-weight: 700;
}
/* login page */
#loginForm {
border-right: solid 2px #c8c8c8;
float: left;
width: 45%;
}
#loginForm .validation-error {
display: block;
margin-left: 15px;
}
#socialLoginForm {
margin-left: 40px;
float: left;
width: 50%;
}
/* contact */
.contact h3 {
font-size: 1.2em;
}
.contact p {
margin: 5px 0 0 10px;
}
.contact iframe {
border: solid 1px #333;
margin: 5px 0 0 10px;
}
/* forms */
fieldset {
border: none;
margin: 0;
padding: 0;
}
fieldset legend {
display: none;
}
fieldset ol {
padding: 0;
list-style: none;
}
fieldset ol li {
padding-bottom: 5px;
}
fieldset label {
display: block;
font-size: 1.2em;
font-weight: 600;
}
fieldset label.checkbox {
display: inline;
}
fieldset input[type="text"],
fieldset input[type="password"] {
border: 1px solid #e2e2e2;
color: #333;
font-size: 1.2em;
margin: 5px 0 6px 0;
padding: 5px;
width: 300px;
}
fieldset input[type="text"]:focus,
fieldset input[type="password"]:focus {
border: 1px solid #7ac0da;
}
fieldset input[type="submit"] {
background-color: #d3dce0;
border: solid 1px #787878;
cursor: pointer;
font-size: 1.2em;
font-weight: 600;
padding: 7px;
}
/* ajax login/registration dialog */
.modal-popup {
font-size: 0.7em;
}
/* info and errors */
.message-info {
border: solid 1px;
clear: both;
padding: 10px 20px;
}
.message-error {
clear: both;
color: #e80c4d;
font-size: 1.1em;
font-weight: bold;
margin: 20px 0 10px 0;
}
.message-success {
color: #7ac0da;
font-size: 1.3em;
font-weight: bold;
margin: 20px 0 10px 0;
}
.success {
color: #7ac0da;
}
.error {
color: #e80c4d;
}
/* styles for validation helpers */
.field-validation-error {
color: #e80c4d;
font-weight: bold;
}
.field-validation-valid {
display: none;
}
input[type="text"].input-validation-error,
input[type="password"].input-validation-error {
border: solid 1px #e80c4d;
}
.validation-summary-errors {
color: #e80c4d;
font-weight: bold;
font-size: 1.1em;
}
.validation-summary-valid {
display: none;
}
/* social */
ul#social li {
display: inline;
list-style: none;
}
ul#social li a {
color: #999;
text-decoration: none;
}
a.facebook, a.twitter {
display: block;
float: left;
height: 24px;
padding-left: 17px;
text-indent: -9999px;
width: 16px;
}
a.facebook {
background: url("../images/facebook.png") no-repeat;
}
a.twitter {
background: url("../images/twitter.png") no-repeat;
}
/********************
* Mobile Styles *
********************/
@media only screen and (max-width: 850px) {
/* header
----------------------------------------------------------*/
header .float-left,
header .float-right {
float: none;
}
/* logo */
header .site-title {
/*margin: 0; */
/*margin: 10px;*/
text-align: left;
padding-left: 0;
}
/* login */
#login {
font-size: .85em;
margin-top: 0;
text-align: center;
}
#login ul {
margin: 5px 0;
padding: 0;
}
#login li {
display: inline;
list-style: none;
margin: 0;
padding:0;
}
#login a {
background: none;
color: #999;
font-weight: 600;
margin: 2px;
padding: 0;
}
#login a:hover {
color: #333;
}
/* menu */
nav {
margin-bottom: 5px;
}
ul#menu {
margin: 0;
padding:0;
text-align: center;
}
ul#menu li {
margin: 0;
padding: 0;
}
/* main layout
----------------------------------------------------------*/
.main-content,
.featured + .main-content {
background-position: 10px 0;
}
.content-wrapper {
padding-right: 10px;
padding-left: 10px;
}
.featured .content-wrapper {
padding: 10px;
}
/* page content */
article, aside {
float: none;
width: 100%;
}
/* ordered list */
ol.round {
list-style-type: none;
padding-left: 0;
}
ol.round li {
padding-left: 10px;
margin: 25px 0;
}
ol.round li.one,
ol.round li.two,
ol.round li.three {
background: none;
}
/* features */
section.feature {
float: none;
padding: 10px;
width: auto;
}
section.feature img {
color: #999;
content: attr(alt);
font-size: 1.5em;
font-weight: 600;
}
/* forms */
fieldset input[type="text"],
fieldset input[type="password"] {
width: 90%;
}
/* login page */
#loginForm {
border-right: none;
float: none;
width: auto;
}
#loginForm .validation-error {
display: block;
margin-left: 15px;
}
#socialLoginForm {
margin-left: 0;
float: none;
width: auto;
}
/* footer
----------------------------------------------------------*/
footer .float-left,
footer .float-right {
float: none;
}
footer {
text-align: center;
height: auto;
padding: 10px 0;
}
footer p {
margin: 0;
}
ul#social {
padding:0;
margin: 0;
}
a.facebook, a.twitter {
background: none;
display: inline;
float: none;
height: auto;
padding-left: 0;
text-indent: 0;
width: auto;
}
}
.subsite {
color: #444;
}
h3 {
font-weight: normal;
font-size: 24px;
color: #444;
margin-bottom: 20px;
}
.tiles {
padding-bottom: 20px;
background-color: #e3e3e3;
}
#editor {
margin: 0 auto;
height: 500px;
border: 1px solid #ccc;
}
.monaco-editor.monaco, .monaco-editor.vs, .monaco-editor.eclipse {
background: #F9F9F9;
}
.monaco-editor.monaco .monaco-editor-background, .monaco-editor.vs .monaco-editor-background, .monaco-editor.eclipse .monaco-editor-background {
background: #F9F9F9;
}

View file

@ -0,0 +1,37 @@
import 'dart:async';
import 'dart:math' show Random;
main() async {
print('Compute π using the Monte Carlo method.');
await for (var estimate in computePi().take(100)) {
print('π ≅ $estimate');
}
}
/// Generates a stream of increasingly accurate estimates of π.
Stream<double> computePi({int batch: 100000}) async* {
var total = 0;
var count = 0;
while (true) {
var points = generateRandom().take(batch);
var inside = points.where((p) => p.isInsideUnitCircle);
total += batch;
count += inside.length;
var ratio = count / total;
// Area of a circle is A = π⋅r², therefore π = A/r².
// So, when given random points with x ∈ <0,1>,
// y ∈ <0,1>, the ratio of those inside a unit circle
// should approach π / 4. Therefore, the value of π
// should be:
yield ratio * 4;
}
}
Iterable<Point> generateRandom([int seed]) sync* {
final random = Random(seed);
while (true) {
yield Point(random.nextDouble(), random.nextDouble());
}
}
class Point {
final double x, y;
const Point(this.x, this.y);
bool get isInsideUnitCircle => x * x + y * y <= 1;
}

View file

@ -0,0 +1,32 @@
FROM mono:3.12
ENV KRE_FEED https://www.myget.org/F/aspnetvnext/api/v2
ENV KRE_USER_HOME /opt/kre
RUN apt-get -qq update && apt-get -qqy install unzip
ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh
ONBUILD RUN bash -c "source $KRE_USER_HOME/kvm/kvm.sh \
&& kvm install latest -a default \
&& kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"
# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)
RUN apt-get -qqy install \
autoconf \
automake \
build-essential \
libtool
RUN LIBUV_VERSION=1.0.0-rc2 \
&& curl -sSL https://github.com/joyent/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \
&& cd /usr/local/src/libuv-$LIBUV_VERSION \
&& sh autogen.sh && ./configure && make && make install \
&& rm -rf /usr/local/src/libuv-$LIBUV_VERSION \
&& ldconfig
ENV PATH $PATH:$KRE_USER_HOME/packages/default/bin
# Extra things to test
RUN echo "string at end"
RUN echo must work 'some str' and some more
RUN echo hi this is # not a comment
RUN echo 'String with ${VAR} and another $one here'

View file

@ -0,0 +1,80 @@
# Elixir is a dynamic, functional language for building scalable
# and maintainable applications. Learn more: https://elixir-lang.org
"Elixir" |> String.graphemes() |> Enum.frequencies()
#=> %{"E" => 1, "i" => 2, "l" => 1, "r" => 1, "x" => 1}
### Scalability ###
# All Elixir code runs inside lightweight threads of execution (called processes)
# that are isolated and exchange information via messages:
current_process = self()
# Spawn an Elixir process (not an operating system one!)
spawn_link(fn ->
send(current_process, {:msg, "hello world"})
end)
# Block until the message is received
receive do
{:msg, contents} -> IO.puts(contents)
end
### Fault-tolerance ###
# To cope with failures, Elixir provides supervisors which describe
# how to restart parts of your system when things go awry, going back
# to a known initial state that is guaranteed to work:
children = [
TCP.Pool,
{TCP.Acceptor, port: 4040}
]
Supervisor.start_link(children, strategy: :one_for_one)
### Functional programming ###
# Functional programming promotes a coding style that helps
# developers write code that is short, concise, and maintainable.
# One prominent example is pattern matching:
%User{name: name, age: age} = User.get("John Doe")
name #=> "John Doe"
# When mixed with guards, pattern matching allows us to elegantly
# match and assert specific conditions for some code to execute:
def drive(%User{age: age}) when age >= 16 do
# Code that drives a car
end
drive(User.get("John Doe"))
#=> Fails if the user is under 16
### Extensibility and DSLs ###
# Elixir has been designed to be extensible, letting developers
# naturally extend the language to particular domains,
# in order to increase their productivity.
defmodule MathTest do
use ExUnit.Case, async: true
test "can add two numbers" do
assert 1 + 1 == 2
end
end
### Erlang compatible ###
# An Elixir programmer can invoke any Erlang function with no runtime cost:
:crypto.hash(:md5, "Using crypto from Erlang OTP")
#=> <<192, 223, 75, 115, ...>>

View file

@ -0,0 +1,8 @@
(* Sample F# application *)
[<EntryPoint>]
let main argv =
printfn "%A" argv
System.Console.WriteLine("Hello from F#")
0 // return an integer exit code
//--------------------------------------------------------

View file

@ -0,0 +1,111 @@
// We often need our programs to perform operations on
// collections of data, like selecting all items that
// satisfy a given predicate or mapping all items to a new
// collection with a custom function.
// In some languages it's idiomatic to use [generic](http://en.wikipedia.org/wiki/Generic_programming)
// data structures and algorithms. Go does not support
// generics; in Go it's common to provide collection
// functions if and when they are specifically needed for
// your program and data types.
// Here are some example collection functions for slices
// of `strings`. You can use these examples to build your
// own functions. Note that in some cases it may be
// clearest to just inline the collection-manipulating
// code directly, instead of creating and calling a
// helper function.
package main
import "strings"
import "fmt"
// Returns the first index of the target string `t`, or
// -1 if no match is found.
func Index(vs []string, t string) int {
for i, v := range vs {
if v == t {
return i
}
}
return -1
}
// Returns `true` if the target string t is in the
// slice.
func Include(vs []string, t string) bool {
return Index(vs, t) >= 0
}
// Returns `true` if one of the strings in the slice
// satisfies the predicate `f`.
func Any(vs []string, f func(string) bool) bool {
for _, v := range vs {
if f(v) {
return true
}
}
return false
}
// Returns `true` if all of the strings in the slice
// satisfy the predicate `f`.
func All(vs []string, f func(string) bool) bool {
for _, v := range vs {
if !f(v) {
return false
}
}
return true
}
// Returns a new slice containing all strings in the
// slice that satisfy the predicate `f`.
func Filter(vs []string, f func(string) bool) []string {
vsf := make([]string, 0)
for _, v := range vs {
if f(v) {
vsf = append(vsf, v)
}
}
return vsf
}
// Returns a new slice containing the results of applying
// the function `f` to each string in the original slice.
func Map(vs []string, f func(string) string) []string {
vsm := make([]string, len(vs))
for i, v := range vs {
vsm[i] = f(v)
}
return vsm
}
func main() {
// Here we try out our various collection functions.
var strs = []string{"peach", "apple", "pear", "plum"}
fmt.Println(Index(strs, "pear"))
fmt.Println(Include(strs, "grape"))
fmt.Println(Any(strs, func(v string) bool {
return strings.HasPrefix(v, "p")
}))
fmt.Println(All(strs, func(v string) bool {
return strings.HasPrefix(v, "p")
}))
fmt.Println(Filter(strs, func(v string) bool {
return strings.Contains(v, "e")
}))
// The above examples all used anonymous functions,
// but you can also use named functions of the correct
// type.
fmt.Println(Map(strs, strings.ToUpper))
}

View file

@ -0,0 +1,263 @@
# GraphQL Schema Definition Language
"""
Color value
"""
scalar Color
"""
Node interface
- allows (re)fetch arbitrary entity only by ID
- allows client side cache normalization
See [Relay Global Object Identification Specification](https://facebook.github.io/relay/graphql/objectidentification.htm)
"""
interface Node {
"""
Globally unique identifier,
typically `${__typename}:${dbId}`
may be encoded in *base64*
"""
id: ID!
}
"""
A character in the Star Wars Trilogy
"""
interface Character {
"""
The id of the character.
"""
id: ID!
"""
The name of the character.
"""
name: String
"""
The friends of the character, or an empty list if they have none.
"""
friends: [Character]
"""
Which movies they appear in
"""
appearsIn: [Episode]
"""
All secrets about their past
"""
secretBackstory: String
}
"""
A mechanical creature in the Star Wars universe.
"""
type Droid implements Character {
"""
The id of the droid.
"""
id: ID!
"""
The name of the droid.
"""
name: String
"""
The friends of the droid, or an empty list if they have none.
"""
friends: [Character]
"""
Which movies they appear in.
"""
appearsIn: [Episode]
"""
Construction date and the name of the designer.
"""
secretBackstory: String
"""
The primary function of the droid.
"""
primaryFunction: String
"""
Chase color of the droid.
"""
color: Color
}
# One of the films in the Star Wars Trilogy
enum Episode {
"""
Released in 1977.
"""
NEWHOPE
"""
Released in 1980.
"""
EMPIRE
"""
Released in 1983.
"""
JEDI
}
"""
A humanoid creature in the Star Wars universe.
"""
type Human implements Character {
"""
The id of the human.
"""
id: ID!
"""
The name of the human.
"""
name: String
"""
The friends of the human, or an empty list if they have none.
"""
friends: [Character]
"""
Which movies they appear in.
"""
appearsIn: [Episode]
"""
The home planet of the human, or null if unknown.
"""
homePlanet: String
"""
Where are they from and how they came to be who they are.
"""
secretBackstory: String
}
enum LengthUnit {
METER
FEET
}
type Starship {
id: ID!
name: String!
length(unit: LengthUnit = METER): Float
}
union SearchResult = Human | Droid | Starship
input SearchInput {
name: String
episode: Episode
}
"""
Root Query
"""
type Query {
"""
Return the hero by episode.
"""
hero(
"""
If omitted, returns the hero of the whole saga. If provided, returns the hero of that particular episode.
"""
episode: Episode
): Character
"""
Return the Human by ID.
"""
human(
"""
id of the human
"""
id: ID!
): Human
"""
Return the Droid by ID.
"""
droid(
"""
id of the droid
"""
id: ID!
): Droid
"""
Search everything by name
__NOTE__: You should use Relay pagination
"""
search(search: SearchInput!): [SearchResult]
@deprecated(reason: "`search` will be replaced.")
}
"""
Root Mutation
"""
type Mutation {
"""
Save the favorite episode.
"""
favorite(
"""
Favorite episode.
"""
episode: Episode!
): Episode
}
"""
Subscriptions — live events
"""
type Subscription {
"""
Message
"""
message: String
}
extend type Query {
"""
Dummy query for highlighting test
"""
dummy(
int: Int = 123
float: Float = 123.456
str: String = "Hello World!"
boolDefaultTrue: Boolean = true
boolDefaultFalse: Boolean = false
id: ID
search: SearchInput = null
): Boolean
}
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
# GraphQL Query Language
query dummyQuery($int: Int) {
dummy(int: $int)
}
mutation favoriteEpisode($episode: Episode) {
favorite(episode: $episode)
}

View file

@ -0,0 +1,31 @@
<div class="entry">
<h1>{{title}}</h1>
{{#if author}}
<h2>{{author.firstName}} {{author.lastName}}</h2>
{{else}}
<h2>Unknown Author</h2>
{{/if}}
{{contentBody}}
</div>
{{#unless license}}
<h3 class="warning">WARNING: This entry does not have a license!</h3>
{{/unless}}
<div class="footnotes">
<ul>
{{#each footnotes}}
<li>{{this}}</li>
{{/each}}
</ul>
</div>
<h1>Comments</h1>
<div id="comments">
{{#each comments}}
<h2><a href="/posts/{{../permalink}}#{{id}}">{{title}}</a></h2>
<div>{{body}}</div>
{{/each}}
</div>

View file

@ -0,0 +1,48 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 1.0.4"
}
}
}
variable "aws_region" {}
variable "base_cidr_block" {
description = "A /16 CIDR range definition, such as 10.1.0.0/16, that the VPC will use"
default = "10.1.0.0/16"
}
variable "availability_zones" {
description = "A list of availability zones in which to create subnets"
type = list(string)
}
provider "aws" {
region = var.aws_region
}
resource "aws_vpc" "main" {
# Referencing the base_cidr_block variable allows the network address
# to be changed without modifying the configuration.
cidr_block = var.base_cidr_block
}
resource "aws_subnet" "az" {
# Create one subnet for each given availability zone.
count = length(var.availability_zones)
# For each subnet, use one of the specified availability zones.
availability_zone = var.availability_zones[count.index]
# By referencing the aws_vpc.main object, Terraform knows that the subnet
# must be created only after the VPC is created.
vpc_id = aws_vpc.main.id
# Built-in functions and operators can be used for simple transformations of
# values, such as computing a subnet address. Here we create a /20 prefix for
# each subnet, using consecutive addresses for each availability zone,
# such as 10.1.16.0/20 .
cidr_block = cidrsubnet(aws_vpc.main.cidr_block, 4, count.index+1)
}

View file

@ -0,0 +1,100 @@
<!DOCTYPE HTML>
<!--Example of comments in HTML-->
<html>
<head>
<!--This is the head section-->
<title>HTML Sample</title>
<meta charset="utf-8">
<!--This is the style tag to set style on elements-->
<style type="text/css">
h1
{
font-family: Tahoma;
font-size: 40px;
font-weight: normal;
margin: 50px;
color: #a0a0a0;
}
h2
{
font-family: Tahoma;
font-size: 30px;
font-weight: normal;
margin: 50px;
color: #fff;
}
p
{
font-family: Tahoma;
font-size: 17px;
font-weight: normal;
margin: 0px 200px;
color: #fff;
}
div.Center
{
text-align: center;
}
div.Blue
{
padding: 50px;
background-color: #7bd2ff;
}
button.Gray
{
font-family: Tahoma;
font-size: 17px;
font-weight: normal;
margin-top: 100px;
padding: 10px 50px;
background-color: #727272;
color: #fff;
outline: 0;
border: none;
cursor: pointer;
}
button.Gray:hover
{
background-color: #898888;
}
button.Gray:active
{
background-color: #636161;
}
</style>
<!--This is the script tag-->
<script type="text/javascript">
function ButtonClick(){
// Example of comments in JavaScript
window.alert("I'm an alert sample!");
}
</script>
</head>
<body>
<!--This is the body section-->
<div class="Center">
<h1>NAME OF SITE</h1>
</div>
<div class="Center Blue">
<h2>I'm h2 Header! Edit me in &lt;h2&gt;</h2>
<p>
I'm a paragraph! Edit me in &lt;p&gt;
to add your own content and make changes to the style and font.
It's easy! Just change the text between &lt;p&gt; ... &lt;/p&gt; and change the style in &lt;style&gt;.
You can make it as long as you wish. The browser will automatically wrap the lines to accommodate the
size of the browser window.
</p>
<button class="Gray" onclick="ButtonClick()">Click Me!</button>
</div>
</body>
</html>

View file

@ -0,0 +1,15 @@
# Example of a .gitconfig file
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
# Defines the master branch
[branch "master"]
remote = origin
merge = refs/heads/master

View file

@ -0,0 +1,54 @@
/*
Basic Java example using FizzBuzz
*/
import java.util.Random;
public class Example {
public static void main (String[] args){
// Generate a random number between 1-100. (See generateRandomNumber method.)
int random = generateRandomNumber(100);
// Output generated number.
System.out.println("Generated number: " + random + "\n");
// Loop between 1 and the number we just generated.
for (int i=1; i<=random; i++){
// If i is divisible by both 3 and 5, output "FizzBuzz".
if (i % 3 == 0 && i % 5 == 0){
System.out.println("FizzBuzz");
}
// If i is divisible by 3, output "Fizz"
else if (i % 3 == 0){
System.out.println("Fizz");
}
// If i is divisible by 5, output "Buzz".
else if (i % 5 == 0){
System.out.println("Buzz");
}
// If i is not divisible by either 3 or 5, output the number.
else {
System.out.println(i);
}
}
}
/**
Generates a new random number between 0 and 100.
@param bound The highest number that should be generated.
@return An integer representing a randomly generated number between 0 and 100.
*/
private static int generateRandomNumber(int bound){
// Create new Random generator object and generate the random number.
Random randGen = new Random();
int randomNum = randGen.nextInt(bound);
// If the random number generated is zero, use recursion to regenerate the number until it is not zero.
if (randomNum < 1){
randomNum = generateRandomNumber(bound);
}
return randomNum;
}
}

View file

@ -0,0 +1,214 @@
/*
© Microsoft. All rights reserved.
This library is supported for use in Windows Tailored Apps only.
Build: 6.2.8100.0
Version: 0.5
*/
(function (global, undefined) {
"use strict";
undefinedVariable = {};
undefinedVariable.prop = 5;
function initializeProperties(target, members) {
var keys = Object.keys(members);
var properties;
var i, len;
for (i = 0, len = keys.length; i < len; i++) {
var key = keys[i];
var enumerable = key.charCodeAt(0) !== /*_*/95;
var member = members[key];
if (member && typeof member === 'object') {
if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {
if (member.enumerable === undefined) {
member.enumerable = enumerable;
}
properties = properties || {};
properties[key] = member;
continue;
}
}
if (!enumerable) {
properties = properties || {};
properties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true }
continue;
}
target[key] = member;
}
if (properties) {
Object.defineProperties(target, properties);
}
}
(function (rootNamespace) {
// Create the rootNamespace in the global namespace
if (!global[rootNamespace]) {
global[rootNamespace] = Object.create(Object.prototype);
}
// Cache the rootNamespace we just created in a local variable
var _rootNamespace = global[rootNamespace];
if (!_rootNamespace.Namespace) {
_rootNamespace.Namespace = Object.create(Object.prototype);
}
function defineWithParent(parentNamespace, name, members) {
/// <summary locid="1">
/// Defines a new namespace with the specified name, under the specified parent namespace.
/// </summary>
/// <param name="parentNamespace" type="Object" locid="2">
/// The parent namespace which will contain the new namespace.
/// </param>
/// <param name="name" type="String" locid="3">
/// Name of the new namespace.
/// </param>
/// <param name="members" type="Object" locid="4">
/// Members in the new namespace.
/// </param>
/// <returns locid="5">
/// The newly defined namespace.
/// </returns>
var currentNamespace = parentNamespace,
namespaceFragments = name.split(".");
for (var i = 0, len = namespaceFragments.length; i < len; i++) {
var namespaceName = namespaceFragments[i];
if (!currentNamespace[namespaceName]) {
Object.defineProperty(currentNamespace, namespaceName,
{ value: {}, writable: false, enumerable: true, configurable: true }
);
}
currentNamespace = currentNamespace[namespaceName];
}
if (members) {
initializeProperties(currentNamespace, members);
}
return currentNamespace;
}
function define(name, members) {
/// <summary locid="6">
/// Defines a new namespace with the specified name.
/// </summary>
/// <param name="name" type="String" locid="7">
/// Name of the namespace. This could be a dot-separated nested name.
/// </param>
/// <param name="members" type="Object" locid="4">
/// Members in the new namespace.
/// </param>
/// <returns locid="5">
/// The newly defined namespace.
/// </returns>
return defineWithParent(global, name, members);
}
// Establish members of the "WinJS.Namespace" namespace
Object.defineProperties(_rootNamespace.Namespace, {
defineWithParent: { value: defineWithParent, writable: true, enumerable: true },
define: { value: define, writable: true, enumerable: true }
});
})("WinJS");
(function (WinJS) {
function define(constructor, instanceMembers, staticMembers) {
/// <summary locid="8">
/// Defines a class using the given constructor and with the specified instance members.
/// </summary>
/// <param name="constructor" type="Function" locid="9">
/// A constructor function that will be used to instantiate this class.
/// </param>
/// <param name="instanceMembers" type="Object" locid="10">
/// The set of instance fields, properties and methods to be made available on the class.
/// </param>
/// <param name="staticMembers" type="Object" locid="11">
/// The set of static fields, properties and methods to be made available on the class.
/// </param>
/// <returns type="Function" locid="12">
/// The newly defined class.
/// </returns>
constructor = constructor || function () { };
if (instanceMembers) {
initializeProperties(constructor.prototype, instanceMembers);
}
if (staticMembers) {
initializeProperties(constructor, staticMembers);
}
return constructor;
}
function derive(baseClass, constructor, instanceMembers, staticMembers) {
/// <summary locid="13">
/// Uses prototypal inheritance to create a sub-class based on the supplied baseClass parameter.
/// </summary>
/// <param name="baseClass" type="Function" locid="14">
/// The class to inherit from.
/// </param>
/// <param name="constructor" type="Function" locid="9">
/// A constructor function that will be used to instantiate this class.
/// </param>
/// <param name="instanceMembers" type="Object" locid="10">
/// The set of instance fields, properties and methods to be made available on the class.
/// </param>
/// <param name="staticMembers" type="Object" locid="11">
/// The set of static fields, properties and methods to be made available on the class.
/// </param>
/// <returns type="Function" locid="12">
/// The newly defined class.
/// </returns>
if (baseClass) {
constructor = constructor || function () { };
var basePrototype = baseClass.prototype;
constructor.prototype = Object.create(basePrototype);
Object.defineProperty(constructor.prototype, "_super", { value: basePrototype });
Object.defineProperty(constructor.prototype, "constructor", { value: constructor });
if (instanceMembers) {
initializeProperties(constructor.prototype, instanceMembers);
}
if (staticMembers) {
initializeProperties(constructor, staticMembers);
}
return constructor;
} else {
return define(constructor, instanceMembers, staticMembers);
}
}
function mix(constructor) {
/// <summary locid="15">
/// Defines a class using the given constructor and the union of the set of instance members
/// specified by all the mixin objects. The mixin parameter list can be of variable length.
/// </summary>
/// <param name="constructor" locid="9">
/// A constructor function that will be used to instantiate this class.
/// </param>
/// <returns locid="12">
/// The newly defined class.
/// </returns>
constructor = constructor || function () { };
var i, len;
for (i = 0, len = arguments.length; i < len; i++) {
initializeProperties(constructor.prototype, arguments[i]);
}
return constructor;
}
// Establish members of "WinJS.Class" namespace
WinJS.Namespace.define("WinJS.Class", {
define: define,
derive: derive,
mix: mix
});
})(WinJS);
})(this);

View file

@ -0,0 +1,68 @@
{
"type": "team",
"test": {
"testPage": "tools/testing/run-tests.htm",
"enabled": true
},
"search": {
"excludeFolders": [
".git",
"node_modules",
"tools/bin",
"tools/counts",
"tools/policheck",
"tools/tfs_build_extensions",
"tools/testing/jscoverage",
"tools/testing/qunit",
"tools/testing/chutzpah",
"server.net"
]
},
"languages": {
"vs.languages.typescript": {
"validationSettings": [{
"scope":"/",
"noImplicitAny":true,
"noLib":false,
"extraLibs":[],
"semanticValidation":true,
"syntaxValidation":true,
"codeGenTarget":"ES5",
"moduleGenTarget":"",
"lint": {
"emptyBlocksWithoutComment": "warning",
"curlyBracketsMustNotBeOmitted": "warning",
"comparisonOperatorsNotStrict": "warning",
"missingSemicolon": "warning",
"unknownTypeOfResults": "warning",
"semicolonsInsteadOfBlocks": "warning",
"functionsInsideLoops": "warning",
"functionsWithoutReturnType": "warning",
"tripleSlashReferenceAlike": "warning",
"unusedImports": "warning",
"unusedVariables": "warning",
"unusedFunctions": "warning",
"unusedMembers": "warning"
}
},
{
"scope":"/client",
"baseUrl":"/client",
"moduleGenTarget":"amd"
},
{
"scope":"/server",
"moduleGenTarget":"commonjs"
},
{
"scope":"/build",
"moduleGenTarget":"commonjs"
},
{
"scope":"/node_modules/nake",
"moduleGenTarget":"commonjs"
}],
"allowMultipleWorkers": true
}
}
}

View file

@ -0,0 +1,23 @@
# good style
function fixedpointmap(f; iv, tolerance=1E-7, maxiter=1000)
# setup the algorithm
x_old = iv
normdiff = Inf
iter = 1
while normdiff > tolerance && iter <= maxiter
x_new = f(x_old) # use the passed in map
normdiff = norm(x_new - x_old)
x_old = x_new
iter = iter + 1
end
return (value = x_old, normdiff=normdiff, iter=iter) # A named tuple
end
# define a map and parameters
p = 1.0
β = 0.9
f(v) = p + β * v # note that p and β are used in the function!
sol = fixedpointmap(f, iv=0.8, tolerance=1.0E-8) # don't need to pass
println("Fixed point = $(sol.value), and |f(x) - x| = $(sol.normdiff) in $(sol.iter)"*
" iterations")

View file

@ -0,0 +1,28 @@
const val POINTS_X_PASS: Int = 15
val EZPassAccounts: MutableMap<Int, Int> = mutableMapOf(1 to 100, 2 to 100, 3 to 100)
val EZPassReport: Map<Int, Int> = EZPassAccounts
// update points credit
fun updatePointsCredit(accountId: Int) {
if (EZPassAccounts.containsKey(accountId)) {
println("Updating $accountId...")
EZPassAccounts[accountId] = EZPassAccounts.getValue(accountId) + POINTS_X_PASS
} else {
println("Error: Trying to update a non-existing account (id: $accountId)")
}
}
fun accountsReport() {
println("EZ-Pass report:")
EZPassReport.forEach{
k, v -> println("ID $k: credit $v")
}
}
fun main() {
accountsReport()
updatePointsCredit(1)
updatePointsCredit(1)
updatePointsCredit(5)
accountsReport()
}

View file

@ -0,0 +1,46 @@
@base: #f938ab;
.box-shadow(@style, @c) when (iscolor(@c)) {
border-radius: @style @c;
}
.box-shadow(@style, @alpha: 50%) when (isnumber(@alpha)) {
.box-shadow(@style, rgba(0, 0, 0, @alpha));
}
.box {
color: saturate(@base, 5%);
border-color: lighten(@base, 30%);
div {
.box-shadow((0 0 5px), 30%);
}
}
#header {
h1 {
font-size: 26px;
font-weight: bold;
}
p { font-size: 12px;
a { text-decoration: none;
&:hover { border-width: 1px }
}
}
}
@the-border: 1px;
@base-color: #111;
@red: #842210;
#header {
color: (@base-color * 3);
border-left: @the-border;
border-right: (@the-border * 2);
}
#footer {
color: (@base-color + #003300);
border-color: desaturate(@red, 10%);
}

View file

@ -0,0 +1,21 @@
LEX Paid Escrow.
LEXON: 0.2.20
COMMENT: 3.f - an escrow that is controlled by a third party for a fee.
“Payer” is a person.
“Payee” is a person.
“Arbiter” is a person.
“Fee” is an amount.
The Payer pays an Amount into escrow,
appoints the Payee,
appoints the Arbiter,
and also fixes the Fee.
CLAUSE: Pay Out.
The Arbiter may pay from escrow the Fee to themselves,
and afterwards pay the remainder of the escrow to the Payee.
CLAUSE: Pay Back.
The Arbiter may pay from escrow the Fee to themselves,
and afterwards return the remainder of the escrow to the Payer.

View file

@ -0,0 +1,12 @@
-- defines a factorial function
function fact (n)
if n == 0 then
return 1
else
return n * fact(n-1)
end
end
print("enter a number:")
a = io.read("*number") -- read a number
print(fact(a))

View file

@ -0,0 +1,104 @@
# Header 1 #
## Header 2 ##
### Header 3 ### (Hashes on right are optional)
## Markdown plus h2 with a custom ID ## {#id-goes-here}
[Link back to H2](#id-goes-here)
```js
var x = "string";
function f() {
return x;
}
```
<!-- html madness -->
<div class="custom-class" markdown="1">
<div>
nested div
</div>
<script type='text/x-koka'>
function( x: int ) { return x*x; }
</script>
This is a div _with_ underscores
and a & <b class="bold">bold</b> element.
<style>
body { font: "Consolas" }
</style>
</div>
* Bullet lists are easy too
- Another one
+ Another one
This is a paragraph, which is text surrounded by
whitespace. Paragraphs can be on one
line (or many), and can drone on for hours.
Now some inline markup like _italics_, **bold**,
and `code()`. Note that underscores
in_words_are ignored.
````application/json
{ value: ["or with a mime type"] }
````
> Blockquotes are like quoted text in email replies
>> And, they can be nested
1. A numbered list
2. Which is numbered
3. With periods and a space
And now some code:
// Code is just text indented a bit
which(is_easy) to_remember();
And a block
~~~
// Markdown extra adds un-indented code blocks too
if (this_is_more_code == true && !indented) {
// tild wrapped code blocks, also not indented
}
~~~
Text with
two trailing spaces
(on the right)
can be used
for things like poems
### Horizontal rules
* * * *
****
--------------------------
![picture alt](/images/photo.jpeg "Title is optional")
## Markdown plus tables ##
| Header | Header | Right |
| ------ | ------ | -----: |
| Cell | Cell | $10 |
| Cell | Cell | $20 |
* Outer pipes on tables are optional
* Colon used for alignment (right versus left)
## Markdown plus definition lists ##
Bottled water
: $ 1.25
: $ 1.55 (Large)
Milk
Pop
: $ 1.75
* Multiple definitions and terms are possible
* Definitions can include multiple paragraphs too
*[ABBR]: Markdown plus abbreviations (produces an <abbr> tag)

View file

@ -0,0 +1,13 @@
# A[i] = A[i/2] + 1;
lw $t0, 0($gp) # fetch i
srl $t1, $t0, 1 # i/2
sll $t1, $t1, 2 # turn i/2 into a byte offset (*4)
add $t1, $gp, $t1 # &A[i/2] - 28
lw $t1, 28($t1) # fetch A[i/2]
addi $t1, $t1, 1 # A[i/2] + 1
sll $t2, $t0, 2 # turn i into a byte offset
add $t2, $t2, $gp # &A[i] - 28
sw $t1, 28($t2) # A[i] = ...
# A[i+1] = -1;
addi $t1, $zero, -1 # -1
sw $t1, 32($t2) # A[i+1] = -1

Some files were not shown because too many files have changed in this diff Show more