move constanst to separate file

main
Mike Fix 8 years ago
parent 1a911ce776
commit d0c0f18b45

@ -3,83 +3,12 @@ import Dropdown from './dropdown'
import ColorPicker from './colorpicker' import ColorPicker from './colorpicker'
import Settings from './settings' import Settings from './settings'
import Button from './button' import Button from './button'
import { THEMES, LANGUAGES } from '../lib/constants'
const themes = [
{
name: 'dracula'
},
{
name: 'solarized'
}
]
const langauges = [
'Auto Detect',
'Plain Text',
'AppleScript',
'BoxNote',
'C',
'C#',
'CSS',
'CSV',
'Closure',
'CoffeeScript',
'Cold Fusion',
'Crystal',
'Cypher',
'D',
'Dart',
'Diff',
'Docker',
'Erlang',
'F#',
'Fortran',
'Gherkin',
'Go',
'Groovy',
'HTML',
'Haskell',
'Haxe',
'Java',
'JavaScript',
'JSON',
'Julia',
'Kotlin',
'LaTex',
'Lisp',
'Lua',
'MATLAB',
'MUMPS',
'OCaml',
'Objective-C',
'PHP',
'Pascal',
'Perl',
'Pig',
'Post',
'Puppet',
'Python',
'R',
'Ruby',
'Rust',
'SQL',
'Sass',
'Scheme',
'Smalltalk',
'Swift',
'TSV',
'VB.NET',
'VBScript',
'Velocity',
'Verilog',
'XML',
'YAML'
].map(name => ({ name }))
const Toolbar = (props) => ( const Toolbar = (props) => (
<div id="toolbar"> <div id="toolbar">
<Dropdown list={themes} /> <Dropdown list={THEMES} />
<Dropdown list={langauges} /> <Dropdown list={LANGUAGES} />
<ColorPicker <ColorPicker
onChange={props.onBGChange} onChange={props.onBGChange}
bg={props.bg} bg={props.bg}

@ -0,0 +1,191 @@
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
require('codemirror/mode/clojure/clojure')
require('codemirror/mode/cobol/cobol')
require('codemirror/mode/coffeescript/coffeescript')
require('codemirror/mode/commonlisp/commonlisp')
require('codemirror/mode/crystal/crystal')
require('codemirror/mode/css/css')
require('codemirror/mode/d/d')
require('codemirror/mode/dart/dart')
require('codemirror/mode/django/django')
require('codemirror/mode/dockerfile/dockerfile')
require('codemirror/mode/elm/elm')
require('codemirror/mode/erlang/erlang')
require('codemirror/mode/fortran/fortran')
require('codemirror/mode/go/go')
require('codemirror/mode/groovy/groovy')
require('codemirror/mode/handlebars/handlebars')
require('codemirror/mode/haskell/haskell')
require('codemirror/mode/haxe/haxe')
require('codemirror/mode/htmlembedded/htmlembedded')
require('codemirror/mode/htmlmixed/htmlmixed')
require('codemirror/mode/javascript/javascript')
require('codemirror/mode/julia/julia')
require('codemirror/mode/lua/lua')
require('codemirror/mode/markdown/markdown')
require('codemirror/mode/mathematica/mathematica')
require('codemirror/mode/nginx/nginx')
require('codemirror/mode/pascal/pascal')
require('codemirror/mode/perl/perl')
require('codemirror/mode/php/php')
require('codemirror/mode/python/python')
require('codemirror/mode/r/r')
require('codemirror/mode/ruby/ruby')
require('codemirror/mode/rust/rust')
require('codemirror/mode/shell/shell')
require('codemirror/mode/smalltalk/smalltalk')
require('codemirror/mode/spreadsheet/spreadsheet')
require('codemirror/mode/sql/sql')
require('codemirror/mode/swift/swift')
require('codemirror/mode/tcl/tcl')
require('codemirror/mode/vb/vb')
require('codemirror/mode/verilog/verilog')
require('codemirror/mode/vhdl/vhdl')
require('codemirror/mode/vue/vue')
require('codemirror/mode/xml/xml')
require('codemirror/mode/yaml/yaml')
}
export const THEMES = [
{
name: 'dracula'
},
{
name: 'solarized'
}
]
export const LANGUAGES = [
{
name: 'Auto Detect'
},
{
name: 'Plain Text'
},
{
name: 'Clojure'
},
{
name: 'Cobol'
},
{
name: 'CoffeeScript'
},
{
name: 'Crystal'
},
{
name: 'CSS'
},
{
name: 'D'
},
{
name: 'Dart'
},
{
name: 'Django'
},
{
name: 'Docker'
},
{
name: 'Elm'
},
{
name: 'Erlang'
},
{
name: 'Fortran'
},
{
name: 'Groovy'
},
{
name: 'Handlebars'
},
{
name: 'Haskell'
},
{
name: 'Haxe'
},
{
name: 'HTML'
},
{
name: 'JavaScript'
},
{
name: 'JSX'
},
{
name: 'Julia'
},
{
name: 'Lua'
},
{
name: 'Markdown'
},
{
name: 'Mathematica'
},
{
name: 'NGINX'
},
{
name: 'Pascal'
},
{
name: 'Perl'
},
{
name: 'PHP'
},
{
name: 'Python'
},
{
name: 'R'
},
{
name: 'Ruby'
},
{
name: 'Rust'
},
{
name: 'Sass'
},
{
name: 'Smalltalk'
},
{
name: 'SQL'
},
{
name: 'Swift'
},
{
name: 'TCL'
},
{
name: 'VB.NET'
},
{
name: 'Verilog'
},
{
name: 'VHDL'
},
{
name: 'Vue'
},
{
name: 'XML'
},
{
name: 'YAML'
}
]
Loading…
Cancel
Save