From 18536e5db0d8b43cd00f068bdade582147117278 Mon Sep 17 00:00:00 2001 From: dojineko Date: Sat, 16 Apr 2016 12:56:53 +0900 Subject: [PATCH 1/6] Ignore meta files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 972eac28..b4116c1f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ +.DS_Store .env +Desktop.ini +Thumbs.db node_modules/* !node_modules/boost /dist From 24cea97e08f7c71d7bdcb01816cbca1c960b6d06 Mon Sep 17 00:00:00 2001 From: dojineko Date: Sat, 16 Apr 2016 13:58:05 +0900 Subject: [PATCH 2/6] Replace single quote to entity reference --- browser/main/modal/Preference/AppSettingTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/main/modal/Preference/AppSettingTab.js b/browser/main/modal/Preference/AppSettingTab.js index 8e284fd2..1a028440 100644 --- a/browser/main/modal/Preference/AppSettingTab.js +++ b/browser/main/modal/Preference/AppSettingTab.js @@ -118,7 +118,7 @@ export default class AppSettingTab extends React.Component { return (
-
User's info
+
User's info
From 0b8ae93727fe14c137c98e7b692c5c425aa5871e Mon Sep 17 00:00:00 2001 From: dojineko Date: Sun, 17 Apr 2016 13:12:33 +0900 Subject: [PATCH 3/6] Fix border shift --- browser/styles/main/ArticleDetail.styl | 1 - browser/styles/main/ArticleNavigator.styl | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/styles/main/ArticleDetail.styl b/browser/styles/main/ArticleDetail.styl index 53180659..9c897eb0 100644 --- a/browser/styles/main/ArticleDetail.styl +++ b/browser/styles/main/ArticleDetail.styl @@ -25,7 +25,6 @@ infoButton() padding 10px background-color #E6E6E6 border-top 1px solid borderColor - border-left 1px solid borderColor &.empty .ArticleDetail-empty-box line-height 72px diff --git a/browser/styles/main/ArticleNavigator.styl b/browser/styles/main/ArticleNavigator.styl index 8c541ed1..90835f51 100644 --- a/browser/styles/main/ArticleNavigator.styl +++ b/browser/styles/main/ArticleNavigator.styl @@ -11,6 +11,7 @@ articleCount = #999 .userInfo height 60px display block + box-sizing content-box border-bottom 1px solid borderColor .userProfileName color brandColor From 06734ec8867c6e10937594a491434e1dfb12e4c6 Mon Sep 17 00:00:00 2001 From: dojineko Date: Sat, 16 Apr 2016 17:29:41 +0900 Subject: [PATCH 4/6] Add syntax theme selector --- browser/components/CodeEditor.js | 13 +++++++++---- browser/lib/fetchConfig.js | 3 ++- browser/main/modal/Preference/AppSettingTab.js | 17 +++++++++++++++-- browser/styles/main/modal/Preferences.styl | 2 +- lib/config.js | 4 ++-- lib/main.html | 1 + 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index b1b463c7..8ecf1851 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -96,7 +96,8 @@ export default class CodeEditor extends React.Component { fontSize: config['editor-font-size'], fontFamily: config['editor-font-family'], indentType: config['editor-indent-type'], - indentSize: config['editor-indent-size'] + indentSize: config['editor-indent-size'], + themeSyntax: config['theme-syntax'] } this.silentChange = false @@ -114,7 +115,7 @@ export default class CodeEditor extends React.Component { var editor = this.editor = ace.edit(el) editor.$blockScrolling = Infinity editor.renderer.setShowGutter(true) - editor.setTheme('ace/theme/xcode') + editor.setTheme('ace/theme/' + this.state.themeSyntax) editor.moveCursorTo(0, 0) editor.setReadOnly(!!this.props.readOnly) editor.setFontSize(this.state.fontSize) @@ -202,9 +203,13 @@ export default class CodeEditor extends React.Component { fontSize: config['editor-font-size'], fontFamily: config['editor-font-family'], indentType: config['editor-indent-type'], - indentSize: config['editor-indent-size'] + indentSize: config['editor-indent-size'], + themeSyntax: config['theme-syntax'] }, function () { - var session = this.editor.getSession() + var editor = this.editor + editor.setTheme('ace/theme/' + this.state.themeSyntax) + + var session = editor.getSession() session.setUseSoftTabs(this.state.indentType === 'space') session.setTabSize(!isNaN(this.state.indentSize) ? parseInt(this.state.indentSize, 10) : 4) }) diff --git a/browser/lib/fetchConfig.js b/browser/lib/fetchConfig.js index bd57d4ca..0a8397df 100644 --- a/browser/lib/fetchConfig.js +++ b/browser/lib/fetchConfig.js @@ -13,7 +13,8 @@ const defaultConfig = { 'preview-font-size': '14', 'preview-font-family': 'Lato', 'switch-preview': 'blur', - 'disable-direct-write': false + 'disable-direct-write': false, + 'theme-syntax': 'xcode' } export default function fetchConfig () { diff --git a/browser/main/modal/Preference/AppSettingTab.js b/browser/main/modal/Preference/AppSettingTab.js index 1a028440..305495a5 100644 --- a/browser/main/modal/Preference/AppSettingTab.js +++ b/browser/main/modal/Preference/AppSettingTab.js @@ -6,6 +6,7 @@ import fetchConfig from 'browser/lib/fetchConfig' const electron = require('electron') const ipc = electron.ipcRenderer const remote = electron.remote +const ace = window.ace const OSX = global.process.platform === 'darwin' @@ -114,6 +115,7 @@ export default class AppSettingTab extends React.Component { {userAlert.message}

) : null + let aceThemeList = ace.require("ace/ext/themelist") return (
@@ -129,7 +131,7 @@ export default class AppSettingTab extends React.Component {
-
Text
+
Editor
this.handleConfigKeyDown(e)} type='text'/> @@ -154,6 +156,7 @@ export default class AppSettingTab extends React.Component {
+
Preview
this.handleConfigKeyDown(e)} type='text'/> @@ -178,7 +181,17 @@ export default class AppSettingTab extends React.Component { ) : null } - +
Theme
+
+ + +
diff --git a/browser/styles/main/modal/Preferences.styl b/browser/styles/main/modal/Preferences.styl index 9688fe0b..0bb32d97 100644 --- a/browser/styles/main/modal/Preferences.styl +++ b/browser/styles/main/modal/Preferences.styl @@ -8,7 +8,7 @@ iptFocusBorderColor = #369DCD border-radius 5px overflow hidden width 720px - height 450px + height 600px &>.header absolute top left right height 50px diff --git a/lib/config.js b/lib/config.js index e79f2bec..acabb023 100644 --- a/lib/config.js +++ b/lib/config.js @@ -12,7 +12,8 @@ const defaultConfig = { 'preview-font-size': '14', 'preview-font-family': 'Lato', 'switch-preview': 'blur', - 'disable-direct-write': false + 'disable-direct-write': false, + 'theme-syntax': 'xcode' } const configFile = 'config.json' @@ -76,4 +77,3 @@ app.on('ready', function () { applyConfig() }) }) - diff --git a/lib/main.html b/lib/main.html index 6e413f01..9f01fc34 100644 --- a/lib/main.html +++ b/lib/main.html @@ -56,6 +56,7 @@
+