File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1358,6 +1358,18 @@ var CodeMirror = (function() {
13581358 }
13591359 return mfactory ( options , config ) ;
13601360 }
1361+ CodeMirror . listModes = function ( ) {
1362+ var list = [ ] ;
1363+ for ( var m in modes )
1364+ if ( modes . propertyIsEnumerable ( m ) ) list . push ( m ) ;
1365+ return list ;
1366+ } ;
1367+ CodeMirror . listMIMEs = function ( ) {
1368+ var list = [ ] ;
1369+ for ( var m in mimeModes )
1370+ if ( mimeModes . propertyIsEnumerable ( m ) ) list . push ( m ) ;
1371+ return list ;
1372+ } ;
13611373
13621374 CodeMirror . fromTextArea = function ( textarea , options ) {
13631375 if ( ! options ) options = { } ;
Original file line number Diff line number Diff line change @@ -117,7 +117,10 @@ <h2 id="config">Configuration</h2>
117117 a < code > name</ code > property that names the mode (for
118118 example < code > {name: "javascript", json: true}</ code > ). The demo
119119 pages for each mode contain information about what configuration
120- parameters the mode supports.</ dd >
120+ parameters the mode supports. You can ask CodeMirror which modes
121+ and MIME types are loaded with
122+ the < code > CodeMirror.listModes</ code >
123+ and < code > CodeMirror.listMIMEs</ code > functions.</ dd >
121124
122125 < dt id ="option_indentUnit "> < code > indentUnit (integer)</ code > </ dt >
123126 < dd > How many spaces a block (whatever that means in the edited
You can’t perform that action at this time.
0 commit comments