2016-09-12 14:05:24 +03:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
2017-05-14 11:55:22 +03:00
|
|
|
|
<meta charset="utf-8">
|
2016-09-12 14:05:24 +03:00
|
|
|
|
<title>MirrorSharp Demo</title>
|
2017-05-22 12:52:40 +03:00
|
|
|
|
<link rel="stylesheet" href="node_modules/codemirror/lib/codemirror.css">
|
|
|
|
|
<link rel="stylesheet" href="node_modules/codemirror/addon/lint/lint.css">
|
|
|
|
|
<link rel="stylesheet" href="node_modules/codemirror/addon/hint/show-hint.css">
|
|
|
|
|
<link rel="stylesheet" href="node_modules/codemirror-addon-lint-fix/dist/lint-fix.css">
|
|
|
|
|
<link rel="stylesheet" href="node_modules/mirrorsharp/mirrorsharp.css">
|
2017-05-14 11:55:22 +03:00
|
|
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans">
|
2016-09-13 13:32:05 +03:00
|
|
|
|
<style>
|
2017-05-14 11:55:22 +03:00
|
|
|
|
* { box-sizing: border-box; }
|
2016-09-13 13:32:05 +03:00
|
|
|
|
html, body { width: 100%; height: 100%; }
|
2017-05-14 11:55:22 +03:00
|
|
|
|
body {
|
|
|
|
|
padding: 0;
|
|
|
|
|
margin: 0;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
}
|
|
|
|
|
nav { display: flex; font-family: 'Open Sans', sans-serif; }
|
2017-05-15 01:20:13 +03:00
|
|
|
|
nav ul {
|
2017-05-14 11:55:22 +03:00
|
|
|
|
list-style: none;
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 0;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
2017-05-15 01:20:13 +03:00
|
|
|
|
nav li {
|
2017-05-14 11:55:22 +03:00
|
|
|
|
margin-left: 10px;
|
|
|
|
|
}
|
|
|
|
|
a { text-decoration: none; }
|
|
|
|
|
a:hover { text-decoration: underline; }
|
2016-10-09 12:48:10 +03:00
|
|
|
|
.CodeMirror {
|
2017-05-14 11:55:22 +03:00
|
|
|
|
flex-grow: 1;
|
|
|
|
|
margin-top: 10px;
|
2016-10-09 12:48:10 +03:00
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
|
}
|
2016-09-13 13:32:05 +03:00
|
|
|
|
</style>
|
2016-09-12 14:05:24 +03:00
|
|
|
|
</head>
|
|
|
|
|
<body>
|
2017-05-14 11:55:22 +03:00
|
|
|
|
<nav>
|
|
|
|
|
Language:
|
|
|
|
|
<ul>
|
|
|
|
|
<li><a href="index.html?language=CSharp">C#</a></li>
|
|
|
|
|
<li><a href="index.html?language=FSharp">F#</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
2016-10-03 10:12:50 +03:00
|
|
|
|
<textarea>using System;
|
2016-12-28 04:31:46 +03:00
|
|
|
|
class C {
|
|
|
|
|
void M() {
|
|
|
|
|
}
|
2016-10-24 10:52:35 +03:00
|
|
|
|
}</textarea>
|
2016-09-12 14:05:24 +03:00
|
|
|
|
|
2017-05-22 12:52:40 +03:00
|
|
|
|
<script src="node_modules/codemirror/lib/codemirror.js"></script>
|
|
|
|
|
<script src="node_modules/codemirror/mode/clike/clike.js"></script>
|
|
|
|
|
<script src="node_modules/codemirror/mode/mllike/mllike.js"></script>
|
|
|
|
|
<script src="node_modules/codemirror/addon/lint/lint.js"></script>
|
|
|
|
|
<script src="node_modules/codemirror/addon/hint/show-hint.js"></script>
|
|
|
|
|
<script src="node_modules/codemirror-addon-lint-fix/dist/lint-fix.js"></script>
|
|
|
|
|
<script src="node_modules/mirrorsharp/mirrorsharp.js"></script>
|
2016-09-13 13:32:05 +03:00
|
|
|
|
<script>
|
2017-05-14 11:55:22 +03:00
|
|
|
|
'use strict';
|
2017-05-15 01:20:13 +03:00
|
|
|
|
const language = ((window.location.search.match(/language=([^&]+)/) || [])[1] || 'CSharp').replace('Sharp', '#');
|
2017-05-14 11:55:22 +03:00
|
|
|
|
const textarea = document.getElementsByTagName('textarea')[0];
|
|
|
|
|
if (language === 'F#')
|
2017-05-15 01:20:13 +03:00
|
|
|
|
textarea.value = '[<EntryPoint>]\r\nlet main argv = \r\n 0';
|
2017-05-14 11:55:22 +03:00
|
|
|
|
|
|
|
|
|
mirrorsharp(textarea, {
|
|
|
|
|
serviceUrl: window.location.href.replace(/^http(s?:\/\/[^/]+).*$/i, 'ws$1/mirrorsharp'),
|
|
|
|
|
selfDebugEnabled: true,
|
2017-05-15 01:20:13 +03:00
|
|
|
|
language: language
|
2016-09-12 14:05:24 +03:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|