mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 16:56:32 +02:00
save work
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import StringStream from "../../util/StringStream.js"
|
||||
import * as modeMethods from "../../modes.js"
|
||||
|
||||
// declare global: globalThis, CodeMirror
|
||||
|
||||
// Create a minimal CodeMirror needed to use runMode, and assign to root.
|
||||
var root = typeof globalThis !== 'undefined' ? globalThis : window
|
||||
root.CodeMirror = {}
|
||||
|
||||
// Copy StringStream and mode methods into CodeMirror object.
|
||||
CodeMirror.StringStream = StringStream
|
||||
for (var exported in modeMethods) CodeMirror[exported] = modeMethods[exported]
|
||||
|
||||
// Minimal default mode.
|
||||
CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()}))
|
||||
CodeMirror.defineMIME("text/plain", "null")
|
||||
|
||||
CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min
|
||||
CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) }
|
||||
|
||||
CodeMirror.defaults = { indentUnit: 2 }
|
||||
export default CodeMirror
|
||||
21
static/filemanager/src/addon/runmode/codemirror.node.js
Normal file
21
static/filemanager/src/addon/runmode/codemirror.node.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import StringStream from "../../util/StringStream.js"
|
||||
import * as modeMethods from "../../modes.js"
|
||||
import {countColumn} from "../../util/misc.js"
|
||||
|
||||
// Copy StringStream and mode methods into exports (CodeMirror) object.
|
||||
exports.StringStream = StringStream
|
||||
exports.countColumn = countColumn
|
||||
for (var exported in modeMethods) exports[exported] = modeMethods[exported]
|
||||
|
||||
// Shim library CodeMirror with the minimal CodeMirror defined above.
|
||||
require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")]
|
||||
require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")]
|
||||
|
||||
// Minimal default mode.
|
||||
exports.defineMode("null", () => ({token: stream => stream.skipToEnd()}))
|
||||
exports.defineMIME("text/plain", "null")
|
||||
|
||||
exports.registerHelper = exports.registerGlobalHelper = Math.min
|
||||
exports.splitLines = function(string) { return string.split(/\r?\n|\r/) }
|
||||
|
||||
exports.defaults = { indentUnit: 2 }
|
||||
@@ -0,0 +1,2 @@
|
||||
import "./codemirror-standalone.js"
|
||||
import "../../../addon/runmode/runmode.js"
|
||||
2
static/filemanager/src/addon/runmode/runmode.node.js
Normal file
2
static/filemanager/src/addon/runmode/runmode.node.js
Normal file
@@ -0,0 +1,2 @@
|
||||
import "./codemirror.node.js"
|
||||
import "../../../addon/runmode/runmode.js"
|
||||
Reference in New Issue
Block a user