This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from i3thuan5/包成套件
包成套件
- Loading branch information
Showing
33 changed files
with
879 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
node_modules/ | ||
.npmignore | ||
.gitignore | ||
.babelrc | ||
.eslintrc.json | ||
|
||
# demo | ||
webpack.config.dev.js | ||
webpack.config.prod.js | ||
devServer.js | ||
taupahji.config.js | ||
index.html | ||
demo/ | ||
favicons/ | ||
build/ | ||
|
||
# unittest | ||
app-css-dnt-compiler.js | ||
test/ | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import { render } from "react-dom"; | ||
import MyProvider from "../src"; | ||
|
||
const root = document.getElementById("app"); | ||
|
||
// tau_pah_ji or sia_siann_mih | ||
// min, hakka, or uan | ||
|
||
render( | ||
<MyProvider/> | ||
, root, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import config from "../config"; | ||
|
||
const api = {}; | ||
const self = api; | ||
|
||
api.網域 = () => ("https://服務.意傳.台灣/"); | ||
|
||
api.標漢字音標 = () => `${self.網域()}標漢字音標`; | ||
|
||
api.正規化翻譯 = () => `${self.網域()}正規化翻譯`; | ||
|
||
api.語音合成 = ({ 腔口 = "", 分詞 = "" } = {}) => | ||
encodeURI(`${self.網域()}語音合成?` + | ||
`查詢腔口=${腔口}&查詢語句=${分詞}`); | ||
|
||
api.取得查詢函式名稱 = (專案 = config.專案()) => { | ||
switch (專案) { | ||
case "寫啥物": | ||
return "正規化翻譯"; | ||
case "鬥拍字": | ||
return "標漢字音標"; | ||
default: | ||
return null; | ||
} | ||
}; | ||
|
||
api.取得查詢函式 = (專案 = config.專案()) => | ||
api[self.取得查詢函式名稱(專案)]; | ||
|
||
export default api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import config from "../../taupahji.config"; | ||
|
||
const configGenerator = { | ||
專案: () => (config.專案), | ||
全部腔口: () => (config.腔口), | ||
預設腔口: () => (config.腔口[0]), | ||
範例查詢: () => (config.範例查詢), | ||
頁尾連結: () => (config.頁尾連結), | ||
}; | ||
|
||
export default configGenerator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1 @@ | ||
import React from "react"; | ||
import { render } from "react-dom"; | ||
import { Router, Route, IndexRoute, browserHistory } from "react-router"; | ||
import thunk from "redux-thunk"; | ||
import { Provider } from "react-redux"; | ||
import { createStore, applyMiddleware } from "redux"; | ||
import createLogger from "redux-logger"; | ||
import Debug from "debug"; | ||
import 網站 from "./網站/網站"; | ||
import 查 from "./頁/查/查.container"; | ||
import reducer from "./reducers"; | ||
|
||
Debug.enable("tau3:*"); | ||
|
||
const root = document.getElementById("app"); | ||
const middlewares = [thunk]; | ||
if (process.env.NODE_ENV !== "production") { | ||
middlewares.push(createLogger); | ||
} | ||
|
||
const store = createStore( | ||
reducer, | ||
applyMiddleware(...middlewares), | ||
); | ||
|
||
render( | ||
<Provider store={store}> | ||
<Router history={browserHistory}> | ||
<Route path='/' component={網站 }> | ||
<IndexRoute component={查}/> | ||
<Route path='%E8%AC%9B/:khiunn/:ku' component={查}/> | ||
<Route path='%E8%AC%9B(/:ku)' component={查}/> | ||
<Route path='%E8%AC%9B' component={查}/> | ||
<Route path='**/:ku' component={查}/> | ||
</Route> | ||
</Router> | ||
</Provider>, | ||
root, | ||
); | ||
export default from "./providers"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
import { Router, Route, IndexRoute, browserHistory } from "react-router"; | ||
import thunk from "redux-thunk"; | ||
import { Provider } from "react-redux"; | ||
import { createStore, applyMiddleware } from "redux"; | ||
import createLogger from "redux-logger"; | ||
import 網站 from "../網站/網站"; | ||
import 查 from "../頁/查/查"; | ||
import reducer from "../reducers"; | ||
|
||
const getAppStore = () => { | ||
const middlewares = [thunk]; | ||
if (process.env.NODE_ENV !== "production") { | ||
middlewares.push(createLogger); | ||
} | ||
const store = createStore( | ||
reducer, | ||
applyMiddleware(...middlewares), | ||
); | ||
return store; | ||
}; | ||
|
||
const MyProvider = () => { | ||
const store = getAppStore(); | ||
return ( | ||
<Provider store={store}> | ||
<Router history={browserHistory}> | ||
<Route path='/' component={網站}> | ||
<IndexRoute component={查}/> | ||
<Route path='%E8%AC%9B/:khiunn/:ku' component={查}/> | ||
<Route path='%E8%AC%9B(/:ku)' component={查}/> | ||
<Route path='%E8%AC%9B' component={查}/> | ||
<Route path='**/:ku' component={查}/> | ||
</Route> | ||
</Router> | ||
</Provider> | ||
); | ||
}; | ||
|
||
export default MyProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const 計算複製內容 = (綜合標音 = []) => { | ||
if (!綜合標音 || 綜合標音.length < 1) { | ||
return 綜合標音; | ||
} | ||
|
||
return 綜合標音 | ||
.map((item) => { | ||
const 漢字 = item.漢字.replace(/ /g, ""); | ||
return { | ||
漢字羅馬: [漢字, item.羅馬字].join("\n"), | ||
羅馬字: item.羅馬字, | ||
漢字, | ||
}; | ||
}) | ||
.reduce((acc, item) => ({ | ||
漢字羅馬: [acc.漢字羅馬, item.漢字羅馬].join("\n"), | ||
漢字: [acc.漢字, item.漢字].join("\n"), | ||
羅馬字: [acc.羅馬字, item.羅馬字].join("\n"), | ||
})); | ||
}; | ||
|
||
export default 計算複製內容; |
Oops, something went wrong.