Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor
This commit is contained in:
111
public/vendor/codemirror/mode/clike/index.html
vendored
Executable file → Normal file
111
public/vendor/codemirror/mode/clike/index.html
vendored
Executable file → Normal file
@@ -206,6 +206,103 @@ object FilterTest extends App {
|
||||
}
|
||||
</textarea></div>
|
||||
|
||||
<h2>Kotlin mode</h2>
|
||||
|
||||
<div><textarea id="kotlin-code">
|
||||
package org.wasabi.http
|
||||
|
||||
import java.util.concurrent.Executors
|
||||
import java.net.InetSocketAddress
|
||||
import org.wasabi.app.AppConfiguration
|
||||
import io.netty.bootstrap.ServerBootstrap
|
||||
import io.netty.channel.nio.NioEventLoopGroup
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel
|
||||
import org.wasabi.app.AppServer
|
||||
|
||||
public class HttpServer(private val appServer: AppServer) {
|
||||
|
||||
val bootstrap: ServerBootstrap
|
||||
val primaryGroup: NioEventLoopGroup
|
||||
val workerGroup: NioEventLoopGroup
|
||||
|
||||
init {
|
||||
// Define worker groups
|
||||
primaryGroup = NioEventLoopGroup()
|
||||
workerGroup = NioEventLoopGroup()
|
||||
|
||||
// Initialize bootstrap of server
|
||||
bootstrap = ServerBootstrap()
|
||||
|
||||
bootstrap.group(primaryGroup, workerGroup)
|
||||
bootstrap.channel(javaClass<NioServerSocketChannel>())
|
||||
bootstrap.childHandler(NettyPipelineInitializer(appServer))
|
||||
}
|
||||
|
||||
public fun start(wait: Boolean = true) {
|
||||
val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
|
||||
|
||||
if (wait) {
|
||||
channel?.closeFuture()?.sync()
|
||||
}
|
||||
}
|
||||
|
||||
public fun stop() {
|
||||
// Shutdown all event loops
|
||||
primaryGroup.shutdownGracefully()
|
||||
workerGroup.shutdownGracefully()
|
||||
|
||||
// Wait till all threads are terminated
|
||||
primaryGroup.terminationFuture().sync()
|
||||
workerGroup.terminationFuture().sync()
|
||||
}
|
||||
}
|
||||
</textarea></div>
|
||||
|
||||
<h2>Ceylon mode</h2>
|
||||
|
||||
<div><textarea id="ceylon-code">
|
||||
"Produces the [[stream|Iterable]] that results from repeated
|
||||
application of the given [[function|next]] to the given
|
||||
[[first]] element of the stream, until the function first
|
||||
returns [[finished]]. If the given function never returns
|
||||
`finished`, the resulting stream is infinite.
|
||||
|
||||
For example:
|
||||
|
||||
loop(0)(2.plus).takeWhile(10.largerThan)
|
||||
|
||||
produces the stream `{ 0, 2, 4, 6, 8 }`."
|
||||
tagged("Streams")
|
||||
shared {Element+} loop<Element>(
|
||||
"The first element of the resulting stream."
|
||||
Element first)(
|
||||
"The function that produces the next element of the
|
||||
stream, given the current element. The function may
|
||||
return [[finished]] to indicate the end of the
|
||||
stream."
|
||||
Element|Finished next(Element element))
|
||||
=> let (start = first)
|
||||
object satisfies {Element+} {
|
||||
first => start;
|
||||
empty => false;
|
||||
function nextElement(Element element)
|
||||
=> next(element);
|
||||
iterator()
|
||||
=> object satisfies Iterator<Element> {
|
||||
variable Element|Finished current = start;
|
||||
shared actual Element|Finished next() {
|
||||
if (!is Finished result = current) {
|
||||
current = nextElement(result);
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
return finished;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
</textarea></div>
|
||||
|
||||
<script>
|
||||
var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
|
||||
lineNumbers: true,
|
||||
@@ -232,6 +329,16 @@ object FilterTest extends App {
|
||||
matchBrackets: true,
|
||||
mode: "text/x-scala"
|
||||
});
|
||||
var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
mode: "text/x-kotlin"
|
||||
});
|
||||
var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
|
||||
lineNumbers: true,
|
||||
matchBrackets: true,
|
||||
mode: "text/x-ceylon"
|
||||
});
|
||||
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
|
||||
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
|
||||
</script>
|
||||
@@ -247,5 +354,7 @@ object FilterTest extends App {
|
||||
(Java), <code>text/x-csharp</code> (C#),
|
||||
<code>text/x-objectivec</code> (Objective-C),
|
||||
<code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
|
||||
and <code>x-shader/x-fragment</code> (shader programs).</p>
|
||||
<code>x-shader/x-fragment</code> (shader programs),
|
||||
<code>text/x-squirrel</code> (Squirrel) and
|
||||
<code>text/x-ceylon</code> (Ceylon)</p>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user