From eaa8ccaccb1091820d0a8d1223996a6dd057347d Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sun, 17 Jan 2016 14:28:04 -0600 Subject: Upgrade CodeMirror to 5.10.1 and now support fullscreen, jump-to-line in editor --- .../mode/haskell-literate/haskell-literate.js | 43 ++++ .../codemirror/mode/haskell-literate/index.html | 282 +++++++++++++++++++++ 2 files changed, 325 insertions(+) create mode 100644 public/vendor/codemirror/mode/haskell-literate/haskell-literate.js create mode 100644 public/vendor/codemirror/mode/haskell-literate/index.html (limited to 'public/vendor/codemirror/mode/haskell-literate') diff --git a/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js new file mode 100644 index 00000000..9358994d --- /dev/null +++ b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js @@ -0,0 +1,43 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function (mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../haskell/haskell")) + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../haskell/haskell"], mod) + else // Plain browser env + mod(CodeMirror) +})(function (CodeMirror) { + "use strict" + + CodeMirror.defineMode("haskell-literate", function (config, parserConfig) { + var baseMode = CodeMirror.getMode(config, (parserConfig && parserConfig.base) || "haskell") + + return { + startState: function () { + return { + inCode: false, + baseState: CodeMirror.startState(baseMode) + } + }, + token: function (stream, state) { + if (stream.sol()) { + if (state.inCode = stream.eat(">")) + return "meta" + } + if (state.inCode) { + return baseMode.token(stream, state.baseState) + } else { + stream.skipToEnd() + return "comment" + } + }, + innerMode: function (state) { + return state.inCode ? {state: state.baseState, mode: baseMode} : null + } + } + }, "haskell") + + CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate") +}) diff --git a/public/vendor/codemirror/mode/haskell-literate/index.html b/public/vendor/codemirror/mode/haskell-literate/index.html new file mode 100644 index 00000000..8c9bc60d --- /dev/null +++ b/public/vendor/codemirror/mode/haskell-literate/index.html @@ -0,0 +1,282 @@ + + +CodeMirror: Haskell-literate mode + + + + + + + + + + +
+

Haskell literate mode

+
+ +
+ +

MIME types + defined: text/x-literate-haskell.

+ +

Parser configuration parameters recognized: base to + set the base mode (defaults to "haskell").

+ + + +
-- cgit v1.2.3