1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

tutorial 追加

This commit is contained in:
Rokt33r
2015-11-11 00:59:14 +09:00
parent e4b2c42897
commit 2f4af3223b
11 changed files with 279 additions and 33 deletions

View File

@@ -1,16 +0,0 @@
var fs = require('fs')
var path = require('path')
var rootUrl = process.cwd()
if (rootUrl === '/') rootUrl = require('remote').require('app').getAppPath()
var url = path.resolve(rootUrl, './submodules/ace/src-min')
console.log(url)
module.exports = fs.readdirSync(url)
.filter(function (file) {
return file.match(/^mode-/)
})
.map(function (file) {
var match = file.match(/^mode-([a-z0-9\_]+).js$/)
return match[1]
})

View File

@@ -11,6 +11,7 @@ export const SWITCH_ARTICLE = 'SWITCH_ARTICLE'
export const SET_SEARCH_FILTER = 'SET_SEARCH_FILTER'
export const SET_TAG_FILTER = 'SET_TAG_FILTER'
export const CLEAR_SEARCH = 'CLEAR_SEARCH'
export const TOGGLE_TUTORIAL = 'TOGGLE_TUTORIAL'
// Status - mode
export const IDLE_MODE = 'IDLE_MODE'
@@ -96,3 +97,9 @@ export function clearSearch () {
type: CLEAR_SEARCH
}
}
export function toggleTutorial() {
return {
type: TOGGLE_TUTORIAL
}
}

View File

@@ -3,8 +3,8 @@ import superagentPromise from 'superagent-promise'
import auth from 'boost/auth'
export const API_URL = 'http://boost-api4.elasticbeanstalk.com/'
// export const WEB_URL = 'http://b00st.io/'
export const WEB_URL = 'http://localhost:3333/'
export const WEB_URL = 'https://b00st.io/'
// export const WEB_URL = 'http://localhost:3333/'
export const request = superagentPromise(superagent, Promise)

View File

@@ -1,13 +1,14 @@
import { combineReducers } from 'redux'
import _ from 'lodash'
import { SWITCH_FOLDER, SWITCH_MODE, SWITCH_ARTICLE, SET_SEARCH_FILTER, SET_TAG_FILTER, CLEAR_SEARCH, ARTICLE_UPDATE, ARTICLE_DESTROY, FOLDER_CREATE, FOLDER_UPDATE, FOLDER_DESTROY, IDLE_MODE, CREATE_MODE } from './actions'
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 dataStore from 'boost/dataStore'
import keygen from 'boost/keygen'
import activityRecord from 'boost/activityRecord'
const initialStatus = {
mode: IDLE_MODE,
search: ''
search: '',
isTutorialOpen: false
}
let data = dataStore.getData()
@@ -125,6 +126,9 @@ 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 SWITCH_FOLDER:
state.mode = IDLE_MODE
state.search = `in:${action.data} `