Skip to content

Commit 03a1fe6

Browse files
author
Ayush Shanker
committed
init
0 parents  commit 03a1fe6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+3327
-0
lines changed

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
__pycache__
2+
*.py[cod]
3+
*$py.class
4+
*.sqlite3
5+
*.egg-info
6+
7+
.vscode/
8+
.idea/
9+
10+
env/
11+
media/
12+
example/static/
13+
14+
.DS_Store
15+
16+
dist/
17+
build/
18+
MANIFEST.in

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2020 Ayush Shanker
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Django Monaco (old)
2+
3+
This works with django 1.9
4+
5+
## Installation
6+
7+
To install the package by `pip` run following command
8+
9+
```sh
10+
$ pip install django-monaco-old
11+
```
12+
13+
todo: add README

__init__.py

Whitespace-only changes.

monaco/__init__.py

Whitespace-only changes.

monaco/models.py

Whitespace-only changes.

monaco/static/monaco.config.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* global monaco */
2+
3+
/*
4+
# Monaco Editor Interface:
5+
https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.idiffeditorconstructionoptions.html
6+
7+
# Monaco Editor Theme Example:
8+
https://github.com/microsoft/monaco-editor/blob/master/test/playground.generated/customizing-the-appearence-exposed-colors.html
9+
*/
10+
11+
12+
document.addEventListener('DOMContentLoaded', function () {
13+
require.config({
14+
paths: {
15+
'vs': '/static/monaco/vs'
16+
}
17+
});
18+
19+
var containers = Array.from(
20+
document.querySelectorAll('textarea[monaco-editor="true"]'));
21+
22+
containers.forEach(function (container) {
23+
24+
var form = container.form;
25+
26+
var editorWrapper = document.createElement('div');
27+
editorWrapper.id = container.id + '--editor';
28+
editorWrapper.classList.add('monaco-editor--conteiner');
29+
30+
require(['vs/editor/editor.main'], function () {
31+
try {
32+
container.style.display = 'none';
33+
container.parentElement.appendChild(editorWrapper);
34+
35+
36+
monaco.editor.defineTheme('myTheme', {
37+
base: 'vs',
38+
inherit: true,
39+
rules: [{ background: 'FFFFFF' }],
40+
colors: {
41+
'editor.lineHighlightBackground': '#00A1FF0F'
42+
}
43+
});
44+
monaco.editor.setTheme('myTheme');
45+
46+
var editor = monaco.editor.create(document.getElementById(container.id + '--editor'), {
47+
renderWhitespace: true,
48+
language: container.dataset.language,
49+
wordWrap: container.dataset.wordwrap || 'off',
50+
minimap: {
51+
enabled: container.dataset.minimap === 'true'
52+
},
53+
fontSize: 12 + 1,
54+
value: container.value
55+
});
56+
57+
window[container.id + '_monaco_editor'] = editor;
58+
59+
window.addEventListener('resize', function () {
60+
editor.layout();
61+
});
62+
63+
form.addEventListener('submit', function (e) {
64+
container.value = editor.getValue();
65+
});
66+
} catch (err) {
67+
container.style.display = 'block';
68+
editorWrapper.remove();
69+
}
70+
});
71+
})
72+
73+
});

monaco/static/monaco.custom.css

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.monaco-editor--conteiner {
2+
height: 420px;
3+
border: 1px solid grey;
4+
transition: 0.2s;
5+
margin-left: 10px;
6+
-webkit-transition: 0.2s;
7+
transition: 0.2s;
8+
width: calc(100% - 60px) !important
9+
}
10+
11+
@media only screen and (max-width: 782px) {
12+
.monaco-editor--conteiner {
13+
margin-left: 0 !important;
14+
width: 100% !important
15+
}
16+
}

monaco/static/monaco/loader.js

+38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monaco/static/monaco/vs/base/worker/workerMain.js

+149
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monaco/static/monaco/vs/basic-languages/abap/abap.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monaco/static/monaco/vs/basic-languages/apex/apex.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monaco/static/monaco/vs/basic-languages/azcli/azcli.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

monaco/static/monaco/vs/basic-languages/bat/bat.js

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)