Dotclear

source: admin/js/codemirror.js @ 3934:eab07f30f99b

Revision 3934:eab07f30f99b, 555 bytes checked in by franck <carnet.franck.paul@…>, 7 years ago (diff)

Switching from inline JS variables to JSON script. CodeMirror? is on stage

Line 
1/*global getData, CodeMirror */
2'use strict';
3
4// Store all instances
5let codemirror_instance = {};
6
7// Launch all requested codemirror instance
8for (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.

Sites map