| Line | |
|---|
| 1 | /*global getData, CodeMirror */ |
|---|
| 2 | 'use strict'; |
|---|
| 3 | |
|---|
| 4 | // Store all instances |
|---|
| 5 | let codemirror_instance = {}; |
|---|
| 6 | |
|---|
| 7 | // Launch all requested codemirror instance |
|---|
| 8 | for (let i of getData('codemirror')) { |
|---|
| 9 | codemirror_instance[i.name] = CodeMirror.fromTextArea(document.getElementById(i.id), { |
|---|
| 10 | mode: i.mode, |
|---|
| 11 | tabMode: 'indent', |
|---|
| 12 | lineWrapping: 1, |
|---|
| 13 | lineNumbers: 1, |
|---|
| 14 | matchBrackets: 1, |
|---|
| 15 | autoCloseBrackets: 1, |
|---|
| 16 | extraKeys: { |
|---|
| 17 | 'F11': function(cm) { |
|---|
| 18 | cm.setOption("fullScreen", !cm.getOption("fullScreen")); |
|---|
| 19 | } |
|---|
| 20 | }, |
|---|
| 21 | theme: i.theme |
|---|
| 22 | }); |
|---|
| 23 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.