mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
address review comments - add production/dev main.html & remove comments
This commit is contained in:
@@ -1020,7 +1020,8 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
|
|
||||||
if (!href) return
|
if (!href) return
|
||||||
|
|
||||||
const regexNoteInternalLink = /main.html#(.+)/
|
const regexNoteInternalLink = process.env.NODE_ENV === 'production' ? /main.production.html#(.+)/ : /main.development.html#(.+)/
|
||||||
|
|
||||||
if (regexNoteInternalLink.test(linkHash)) {
|
if (regexNoteInternalLink.test(linkHash)) {
|
||||||
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])
|
const targetId = mdurl.encode(linkHash.match(regexNoteInternalLink)[1])
|
||||||
const targetElement = this.refs.root.contentWindow.document.getElementById(
|
const targetElement = this.refs.root.contentWindow.document.getElementById(
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import StarButton from './StarButton'
|
|||||||
import TagSelect from './TagSelect'
|
import TagSelect from './TagSelect'
|
||||||
import FolderSelect from './FolderSelect'
|
import FolderSelect from './FolderSelect'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
// import {hashHistory} from 'react-router'
|
|
||||||
import { history } from 'browser/main/store'
|
import { history } from 'browser/main/store'
|
||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
import CodeMirror from 'codemirror'
|
import CodeMirror from 'codemirror'
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import _ from 'lodash'
|
|||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import mobileAnalytics from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
import eventEmitter from 'browser/main/lib/eventEmitter'
|
import eventEmitter from 'browser/main/lib/eventEmitter'
|
||||||
// import { hashHistory } from 'react-router'
|
|
||||||
import { store, history } from 'browser/main/store'
|
import { store, history } from 'browser/main/store'
|
||||||
import i18n from 'browser/lib/i18n'
|
import i18n from 'browser/lib/i18n'
|
||||||
import { getLocales } from 'browser/lib/Languages'
|
import { getLocales } from 'browser/lib/Languages'
|
||||||
|
|||||||
@@ -22,19 +22,14 @@ class NewNoteButton extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.handleNewNoteButtonClick = this.handleNewNoteButtonClick.bind(this)
|
this.handleNewNoteButtonClick = this.handleNewNoteButtonClick.bind(this)
|
||||||
|
|
||||||
// why is there a newNoteHandler?!
|
|
||||||
this.newNoteHandler = () => {
|
|
||||||
this.handleNewNoteButtonClick()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
eventEmitter.on('top:new-note', this.newNoteHandler)
|
eventEmitter.on('top:new-note', this.handleNewNoteButtonClick)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
eventEmitter.off('top:new-note', this.newNoteHandler)
|
eventEmitter.off('top:new-note', this.handleNewNoteButtonClick)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleNewNoteButtonClick (e) {
|
handleNewNoteButtonClick (e) {
|
||||||
|
|||||||
@@ -469,16 +469,11 @@ function getOrInitItem (target, key) {
|
|||||||
|
|
||||||
const history = createHistory()
|
const history = createHistory()
|
||||||
|
|
||||||
// Query not available in HashHistory with ReactRouter >= v4
|
|
||||||
// Relevant Issue https://github.com/ReactTraining/react-router/issues/4410#issuecomment-293772446
|
|
||||||
// --> moved from query to search - so we only need query-string parsing/stringify for noteKey.
|
|
||||||
// (No need to add query to history with a listener)
|
|
||||||
|
|
||||||
const reducer = combineReducers({
|
const reducer = combineReducers({
|
||||||
data,
|
data,
|
||||||
config,
|
config,
|
||||||
status,
|
status,
|
||||||
router: connectRouter(history) // I think we could also go with-out connected-router as we're using history with imports directly
|
router: connectRouter(history)
|
||||||
})
|
})
|
||||||
|
|
||||||
const store = createStore(reducer, undefined, compose(
|
const store = createStore(reducer, undefined, compose(
|
||||||
|
|||||||
@@ -54,8 +54,7 @@ const mainWindow = new BrowserWindow({
|
|||||||
},
|
},
|
||||||
icon: path.resolve(__dirname, '../resources/app.png')
|
icon: path.resolve(__dirname, '../resources/app.png')
|
||||||
})
|
})
|
||||||
|
const url = path.resolve(__dirname, process.env.NODE_ENV === 'production' ? './main.production.html' : './main.development.html')
|
||||||
const url = path.resolve(__dirname, './main.html')
|
|
||||||
|
|
||||||
mainWindow.loadURL('file://' + url)
|
mainWindow.loadURL('file://' + url)
|
||||||
mainWindow.setMenuBarVisibility(false)
|
mainWindow.setMenuBarVisibility(false)
|
||||||
|
|||||||
157
lib/main.production.html
Normal file
157
lib/main.production.html
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="../node_modules/font-awesome/css/font-awesome.min.css" media="screen" charset="utf-8">
|
||||||
|
<link rel="shortcut icon" href="../resources/favicon.ico">
|
||||||
|
<link rel="stylesheet" href="../node_modules/codemirror/lib/codemirror.css">
|
||||||
|
<link rel="stylesheet" href="../node_modules/katex/dist/katex.min.css">
|
||||||
|
<link rel="stylesheet" href="../node_modules/codemirror/addon/dialog/dialog.css">
|
||||||
|
<link rel="stylesheet" href="../extra_scripts/codemirror/mode/bfm/bfm.css">
|
||||||
|
|
||||||
|
<title>Boostnote</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: 'OpenSans';
|
||||||
|
src: url('../resources/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
|
||||||
|
url('../resources/fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
|
||||||
|
url('../resources/fonts/Lato-Regular.ttf') format('truetype');
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Lato';
|
||||||
|
src: url('../resources/fonts/Lato-Regular.woff2') format('woff2'), /* Modern Browsers */
|
||||||
|
url('../resources/fonts/Lato-Regular.woff') format('woff'), /* Modern Browsers */
|
||||||
|
url('../resources/fonts/Lato-Regular.ttf') format('truetype');
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingCover {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 65px 0;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingCover img {
|
||||||
|
display: block;
|
||||||
|
margin: 75px auto 5px;
|
||||||
|
width: 160px;
|
||||||
|
height: 160px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#loadingCover .message {
|
||||||
|
font-size: 30px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.6;
|
||||||
|
font-weight: 100;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeEditor {
|
||||||
|
opacity: 1 !important;
|
||||||
|
pointer-events: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-ruler {
|
||||||
|
border-left-color: rgba(142, 142, 142, 0.5);
|
||||||
|
mix-blend-mode: difference;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="loadingCover">
|
||||||
|
<img src="../resources/app.png">
|
||||||
|
<div class='message'>
|
||||||
|
<i class="fa fa-spinner fa-spin" spin></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="content"></div>
|
||||||
|
|
||||||
|
<script src="../node_modules/codemirror/lib/codemirror.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/mode/meta.js"></script>
|
||||||
|
<script src="../node_modules/codemirror-mode-elixir/dist/elixir.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/mode/overlay.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/mode/loadmode.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/mode/simple.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/mode/multiplex.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/keymap/sublime.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/keymap/vim.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/keymap/emacs.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/runmode/runmode.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/display/panel.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/mode/xml/xml.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/mode/markdown/markdown.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/mode/gfm/gfm.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/mode/yaml/yaml.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js"></script>
|
||||||
|
|
||||||
|
<script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script>
|
||||||
|
<script src="../extra_scripts/codemirror/mode/bfm/bfm.js"></script>
|
||||||
|
<script src="../extra_scripts/codemirror/addon/hyperlink/hyperlink.js"></script>
|
||||||
|
<script src="../extra_scripts/codemirror/mode/bfm/bfm.js"></script>
|
||||||
|
|
||||||
|
<script src="../node_modules/codemirror/addon/edit/closebrackets.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/edit/matchbrackets.js"></script>
|
||||||
|
|
||||||
|
<script src="../node_modules/codemirror/addon/search/search.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/search/searchcursor.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/scroll/annotatescrollbar.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/scroll/scrollpastend.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/search/matchesonscrollbar.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/search/jump-to-line.js"></script>
|
||||||
|
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/brace-fold.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/markdown-fold.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/foldgutter.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/fold/foldcode.js"></script>
|
||||||
|
|
||||||
|
<script src="../node_modules/codemirror/addon/dialog/dialog.js"></script>
|
||||||
|
<script src="../node_modules/codemirror/addon/display/rulers.js"></script>
|
||||||
|
|
||||||
|
<script src="../node_modules/raphael/raphael.min.js"></script>
|
||||||
|
<script src="../node_modules/flowchart.js/release/flowchart.min.js"></script>
|
||||||
|
<script>
|
||||||
|
window._ = require('lodash')
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="../node_modules/@rokt33r/js-sequence-diagrams/dist/sequence-diagram-min.js"></script>
|
||||||
|
<script src="../node_modules/react/umd/react.production.min.js"></script>
|
||||||
|
<script src="../node_modules/react-dom/umd/react-dom.production.min.js"></script>
|
||||||
|
<script src="../node_modules/redux/dist/redux.min.js"></script>
|
||||||
|
<script src="../node_modules/react-redux/dist/react-redux.min.js"></script>
|
||||||
|
<script type='text/javascript'>
|
||||||
|
const electron = require('electron')
|
||||||
|
electron.webFrame.setVisualZoomLevelLimits(1, 1)
|
||||||
|
var scriptUrl = window._.find(electron.remote.process.argv, (a) => a === '--hot')
|
||||||
|
? 'http://localhost:8080/assets/main.js'
|
||||||
|
: '../compiled/main.js'
|
||||||
|
var scriptEl = document.createElement('script')
|
||||||
|
scriptEl.setAttribute('type', 'text/javascript')
|
||||||
|
scriptEl.setAttribute('src', scriptUrl)
|
||||||
|
document.body.appendChild(scriptEl)
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.ace_search {
|
||||||
|
background-color: #d9d9d9;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user