diff --git a/lib/components/modal/Tutorial.js b/lib/components/modal/Tutorial.js
index cb2f2ed4..cc927d92 100644
--- a/lib/components/modal/Tutorial.js
+++ b/lib/components/modal/Tutorial.js
@@ -88,10 +88,11 @@ export default class Tutorial extends React.Component {
return (
Easy to access with Finder
- With Finder, You can search your articles faster.
- You can open Finder by pressing Control + shift + tab
- To put the content of an article in the clipboard, press Enter.
- So you can paste it with Cmd(⌘) + V
+ The Finder helps you organize all of the files and documents.
+ There is a short-cut key [control + shift + tab] to open the Finder.
+ It is available to save your articles on the Clipboard
+ by selecting your file with pressing Enter key,
+ and to paste the contents of the Clipboard with [Command-V]
diff --git a/lib/reducer.js b/lib/reducer.js
index 52cd5916..baff2d55 100644
--- a/lib/reducer.js
+++ b/lib/reducer.js
@@ -1,14 +1,42 @@
import { combineReducers } from 'redux'
import _ from 'lodash'
-import { SWITCH_FOLDER, SWITCH_MODE, SWITCH_ARTICLE, SET_SEARCH_FILTER, SET_TAG_FILTER, CLEAR_SEARCH, TOGGLE_TUTORIAL, ARTICLE_UPDATE, ARTICLE_DESTROY, FOLDER_CREATE, FOLDER_UPDATE, FOLDER_DESTROY, IDLE_MODE, CREATE_MODE } from './actions'
+import {
+ // Status action type
+ SWITCH_FOLDER,
+ SWITCH_MODE,
+ SWITCH_ARTICLE,
+ SET_SEARCH_FILTER,
+ SET_TAG_FILTER,
+ CLEAR_SEARCH,
+ LOCK_STATUS,
+ UNLOCK_STATUS,
+ TOGGLE_TUTORIAL,
+
+ // Article action type
+ ARTICLE_UPDATE,
+ ARTICLE_DESTROY,
+
+ // Folder action type
+ FOLDER_CREATE,
+ FOLDER_UPDATE,
+ FOLDER_DESTROY,
+ FOLDER_REPLACE,
+
+ // view mode
+ IDLE_MODE,
+ CREATE_MODE
+} from './actions'
import dataStore from 'boost/dataStore'
import keygen from 'boost/keygen'
import activityRecord from 'boost/activityRecord'
+import { openModal } from 'boost/modal'
+import EditedAlert from 'boost/components/modal/EditedAlert'
const initialStatus = {
mode: IDLE_MODE,
search: '',
- isTutorialOpen: false
+ isTutorialOpen: false,
+ isStatusLocked: false
}
let data = dataStore.getData()
@@ -26,12 +54,11 @@ function folders (state = initialFolders, action) {
Object.assign(newFolder, {
key: keygen(),
createdAt: new Date(),
- updatedAt: new Date(),
- // random number (0-7)
- color: Math.round(Math.random() * 7)
+ updatedAt: new Date()
})
- if (newFolder.length === 0) throw new Error('Folder name is required')
+ if (newFolder.name == null && newFolder.name.length === 0) throw new Error('Folder name is required')
+ if (newFolder.name.match(/\//)) throw new Error('`/` is not available for folder name')
let conflictFolder = _.findWhere(state, {name: newFolder.name})
if (conflictFolder != null) throw new Error(`${newFolder.name} already exists!`)
@@ -48,7 +75,8 @@ function folders (state = initialFolders, action) {
if (!_.isString(folder.name)) throw new Error('Folder name must be a string')
folder.name = folder.name.trim().replace(/\s/, '_')
- if (folder.length === 0) throw new Error('Folder name is required')
+ if (folder.name.length === 0) throw new Error('Folder name is required')
+ if (folder.name.match(/\//)) throw new Error('`/` is not available for folder name')
// Folder existence check
if (targetFolder == null) throw new Error('Folder doesnt exist')
@@ -80,6 +108,15 @@ function folders (state = initialFolders, action) {
activityRecord.emit('FOLDER_DESTROY')
return state
}
+ case FOLDER_REPLACE:
+ {
+ let { a, b } = action.data
+ let folderA = state[a]
+ let folderB = state[b]
+ state.splice(a, 1, folderB)
+ state.splice(b, 1, folderA)
+ }
+ return state
default:
return state
}
@@ -125,13 +162,28 @@ function articles (state = initialArticles, action) {
function status (state = initialStatus, action) {
state = Object.assign({}, state)
+
switch (action.type) {
case TOGGLE_TUTORIAL:
state.isTutorialOpen = !state.isTutorialOpen
return state
+ case LOCK_STATUS:
+ state.isStatusLocked = true
+ return state
+ case UNLOCK_STATUS:
+ state.isStatusLocked = false
+ return state
+ }
+
+ // if status locked, status become unmutable
+ if (state.isStatusLocked) {
+ openModal(EditedAlert, {action})
+ return state
+ }
+ switch (action.type) {
case SWITCH_FOLDER:
state.mode = IDLE_MODE
- state.search = `in:${action.data} `
+ state.search = `//${action.data} `
return state
case SWITCH_MODE:
diff --git a/main.js b/main.js
index f96acb1a..032ac349 100644
--- a/main.js
+++ b/main.js
@@ -30,8 +30,8 @@ updater
.on('update-downloaded', function (event, releaseNotes, releaseName, releaseDate, updateUrl, quitAndUpdate) {
nn.notify({
title: 'Ready to Update!! ' + versionText,
- icon: path.join(__dirname, 'browser/main/resources/favicon-230x230.png'),
- message: 'Click tray icon to update app: ' + releaseName
+ icon: path.join(__dirname, '/resources/favicon-230x230.png'),
+ message: 'Click update button on Main window: ' + releaseName
})
update = quitAndUpdate
@@ -50,6 +50,14 @@ app.on('ready', function () {
// menu start
var template = require('./atom-lib/menu-template')
+ setInterval(function () {
+ if (update == null) updater.checkForUpdates()
+ }, 1000 * 60 * 60 * 24)
+
+ ipc.on('check-update', function (event, msg) {
+ if (update == null) updater.checkForUpdates()
+ })
+
ipc.on('update-app', function (event, msg) {
if (update != null) {
appQuit = true
diff --git a/package.json b/package.json
index f3007e40..32ec18ae 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "boost",
- "version": "0.4.0-beta.2",
+ "version": "0.4.1-beta",
"description": "Boost App",
"main": "main.js",
"scripts": {
diff --git a/webpack.config.js b/webpack.config.js
index b9492ffb..ce7cdf5d 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -68,7 +68,8 @@ var config = {
'superagent-promise',
'lodash',
'markdown-it',
- 'moment'
+ 'moment',
+ 'node-notifier'
]
}
diff --git a/webpack.config.production.js b/webpack.config.production.js
index 737e0d13..8eda4cc5 100644
--- a/webpack.config.production.js
+++ b/webpack.config.production.js
@@ -45,7 +45,8 @@ module.exports = {
'superagent-promise',
'lodash',
'markdown-it',
- 'moment'
+ 'moment',
+ 'node-notifier'
],
resolve: {
extensions: ['', '.js', '.jsx', 'styl']