forked from microsoft/monaco-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ce2107
commit b2365bd
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Monaco Editor under nodewebkit</title> | ||
<!--link rel="stylesheet" data-name="vs/editor/editor.main" href="/node_modules/monaco-editor/min/vs/editor/editor.main.css"--> | ||
<!--link rel="stylesheet" type="text/css" href="/resources/css/flex-boxes.css"--> | ||
<style type="text/css"> | ||
body,#container{margin:0px;padding:0px;box-sizing:border-box;} | ||
body{height:100vh;overflow:hidden;} | ||
#container{overflow:hidden;height:100vh;} | ||
.toolbox{ | ||
height:200px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="container"></div> | ||
</body> | ||
|
||
<!--script> | ||
// Monaco uses a custom amd loader that over-rides node's require. | ||
// Keep a reference to node's require so we can restore it after executing the amd loader file. | ||
var nodeRequire1 = require; | ||
</script--> | ||
<!--script src="/node_modules/monaco-editor/min/vs/loader1.js"></script--> | ||
<script> | ||
var ERequire = require("../../node_modules/monaco-editor/min/vs/loader.js"); | ||
//__dirname == root path of you application | ||
ERequire.config({ | ||
baseUrl: "file:https:///"+__dirname+"/node_modules/monaco-editor/min/" | ||
}) | ||
|
||
// workaround monaco-css not understanding the environment | ||
self.module = undefined; | ||
// workaround monaco-typescript not understanding the environment | ||
self.process.browser = true; | ||
ERequire(['vs/editor/editor.main'], function() { | ||
var editor = monaco.editor.create(document.getElementById('container'), { | ||
value: [ | ||
'function x() {', | ||
'\tconsole.log("Hello world!");', | ||
'}' | ||
].join('\n'), | ||
language: 'javascript', | ||
theme: "vs-dark" | ||
}); | ||
}); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "helloworld", | ||
"main": "index.html", | ||
"dependencies": { | ||
"monaco-editor": "0.x.x" | ||
} | ||
} |