File tree Expand file tree Collapse file tree 4 files changed +13
-14
lines changed Expand file tree Collapse file tree 4 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ export default class MarkdownPreview extends React.Component {
325
325
body ,
326
326
this . props . storagePath
327
327
)
328
- const files = [ this . GetCodeThemeLink ( codeBlockTheme ) , ...CSS_FILES ]
328
+ const files = [ this . getCodeThemeLink ( codeBlockTheme ) , ...CSS_FILES ]
329
329
files . forEach ( file => {
330
330
if ( global . process . platform === 'win32' ) {
331
331
file = file . replace ( 'file:///' , '' )
@@ -637,7 +637,7 @@ export default class MarkdownPreview extends React.Component {
637
637
638
638
this . getWindow ( ) . document . getElementById (
639
639
'codeTheme'
640
- ) . href = this . GetCodeThemeLink ( codeBlockTheme )
640
+ ) . href = this . getCodeThemeLink ( codeBlockTheme )
641
641
this . getWindow ( ) . document . getElementById ( 'style' ) . innerHTML = buildStyle (
642
642
fontFamily ,
643
643
fontSize ,
@@ -650,11 +650,11 @@ export default class MarkdownPreview extends React.Component {
650
650
)
651
651
}
652
652
653
- GetCodeThemeLink ( name ) {
653
+ getCodeThemeLink ( name ) {
654
654
const theme = consts . THEMES . find ( theme => theme . name === name )
655
655
656
- return theme
657
- ? ( win ? theme . path : ` ${ appPath } / ${ theme . path } ` )
656
+ return theme != null
657
+ ? theme . path
658
658
: `${ appPath } /node_modules/codemirror/theme/elegant.css`
659
659
}
660
660
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const themes = paths
19
19
20
20
return {
21
21
name,
22
- path : path . join ( directory . split ( / \/ / g ) . slice ( - 3 ) . join ( '/' ) , file ) ,
22
+ path : path . join ( directory , file ) ,
23
23
className : `cm-s-${ name } `
24
24
}
25
25
} ) )
@@ -28,17 +28,16 @@ const themes = paths
28
28
29
29
themes . splice ( themes . findIndex ( ( { name } ) => name === 'solarized' ) , 1 , {
30
30
name : 'solarized dark' ,
31
- path : ` ${ CODEMIRROR_THEME_PATH } / solarized.css` ,
31
+ path : path . join ( paths [ 0 ] , ' solarized.css' ) ,
32
32
className : `cm-s-solarized cm-s-dark`
33
33
} , {
34
34
name : 'solarized light' ,
35
- path : ` ${ CODEMIRROR_THEME_PATH } / solarized.css` ,
35
+ path : path . join ( paths [ 0 ] , ' solarized.css' ) ,
36
36
className : `cm-s-solarized cm-s-light`
37
37
} )
38
-
39
38
themes . splice ( 0 , 0 , {
40
39
name : 'default' ,
41
- path : ` ${ CODEMIRROR_THEME_PATH } / elegant.css` ,
40
+ path : path . join ( paths [ 0 ] , ' elegant.css' ) ,
42
41
className : `cm-s-default`
43
42
} )
44
43
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ function get () {
143
143
const theme = consts . THEMES . find ( theme => theme . name === config . editor . theme )
144
144
145
145
if ( theme ) {
146
- editorTheme . setAttribute ( 'href' , win ? theme . path : `../ ${ theme . path } ` )
146
+ editorTheme . setAttribute ( 'href' , theme . path )
147
147
} else {
148
148
config . editor . theme = 'default'
149
149
}
@@ -191,7 +191,7 @@ function set (updates) {
191
191
const newTheme = consts . THEMES . find ( theme => theme . name === newConfig . editor . theme )
192
192
193
193
if ( newTheme ) {
194
- editorTheme . setAttribute ( 'href' , win ? newTheme . path : `../ ${ newTheme . path } ` )
194
+ editorTheme . setAttribute ( 'href' , newTheme . path )
195
195
}
196
196
197
197
ipcRenderer . send ( 'config-renew' , {
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { getLanguages } from 'browser/lib/Languages'
14
14
import normalizeEditorFontFamily from 'browser/lib/normalizeEditorFontFamily'
15
15
16
16
const OSX = global . process . platform === 'darwin'
17
- const win = global . process . platform === 'win32'
17
+ const WIN = global . process . platform === 'win32'
18
18
19
19
const electron = require ( 'electron' )
20
20
const ipc = electron . ipcRenderer
@@ -137,7 +137,7 @@ class UiTab extends React.Component {
137
137
const theme = consts . THEMES . find ( theme => theme . name === newCodemirrorTheme )
138
138
139
139
if ( theme ) {
140
- checkHighLight . setAttribute ( 'href' , win ? theme . path : `../ ${ theme . path } ` )
140
+ checkHighLight . setAttribute ( 'href' , theme . path )
141
141
}
142
142
}
143
143
You can’t perform that action at this time.
0 commit comments