Skip to content

Commit fd747ea

Browse files
committed
restarting up work on integrating react
1 parent 60d8ea5 commit fd747ea

36 files changed

+1620
-913
lines changed

.babelrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env",
4+
"@babel/preset-react"
5+
]
6+
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ node_modules/
3030
dist/
3131
dist/global/config.php
3232

33-
local.dev.js
33+
local.dev.js
34+
yarn-error.log

gruntfile.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ const config = {
177177

178178
run: {
179179
webpack_dev: {
180-
cmd: 'npm',
180+
cmd: 'yarn',
181181
args: [
182-
'start'
182+
'dev'
183183
]
184184
},
185185
webpack_prod: {
186-
cmd: 'npm',
186+
cmd: 'yarn',
187187
args: [
188188
'build'
189189
]
@@ -195,7 +195,10 @@ const config = {
195195
options: {
196196
logConcurrentOutput: true
197197
},
198-
tasks: ['watch']
198+
tasks: [
199+
'watch',
200+
'run:webpack_dev'
201+
]
199202
}
200203
}
201204
};
@@ -477,8 +480,8 @@ module.exports = function (grunt) {
477480
]);
478481

479482
// for local dev work. All you need to do is run `grunt`: that creates a dist/ folder containing all the built code,
480-
// plus sets up watchers to copy over changed files and generate the CSS from Sass. Be sure to load up the dist/
481-
// folder in your browser
483+
// sets up watchers to copy over changed files and generate the CSS from Sass. It also boots up webpack to handle
484+
// any JS conversion. Be sure to load up the dist/ subfolder in your browser
482485
grunt.registerTask('default', ['sync', 'sasslint', 'sass', 'concurrent:watchers']);
483486

484487
// builds everything into the dist folder

package.json

+16-15
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"zh_tw"
6565
],
6666
"scripts": {
67-
"test": "jest"
67+
"test": "jest",
68+
"dev": "webpack --config webpack.config.js --env development -p --progress"
6869
},
6970
"repository": {
7071
"type": "git",
@@ -82,13 +83,12 @@
8283
},
8384
"homepage": "https://github.com/formtools/core#readme",
8485
"devDependencies": {
86+
"@babel/core": "^7.5.5",
87+
"@babel/preset-env": "^7.5.5",
88+
"@babel/preset-react": "^7.0.0",
8589
"autoprefixer": "^9.1.0",
86-
"babel-core": "^6.26.3",
87-
"babel-loader": "^7.1.4",
88-
"babel-preset-env": "^1.6.1",
89-
"babel-preset-react": "^6.24.1",
90-
"babel-preset-stage-2": "^6.24.1",
91-
"css-loader": "^1.0.0",
90+
"babel-loader": "^8.0.6",
91+
"css-loader": "^3.2.0",
9292
"exec": "^0.2.1",
9393
"grunt": "^1.0.3",
9494
"grunt-cli": "^1.2.0",
@@ -103,25 +103,26 @@
103103
"jest": "^23.6.0",
104104
"line-reader": "^0.4.0",
105105
"load-grunt-tasks": "^4.0.0",
106-
"mini-css-extract-plugin": "^0.4.1",
106+
"mini-css-extract-plugin": "^0.8.0",
107107
"moment": "^2.22.2",
108108
"n-readlines": "^1.0.0",
109-
"node-sass": "^4.9.3",
109+
"node-sass": "^4.12.0",
110110
"postcss-loader": "^3.0.0",
111111
"prop-types": "^15.6.1",
112112
"reselect": "^3.0.1",
113-
"sass-loader": "^7.1.0",
114-
"style-loader": "^0.22.1",
115-
"webpack": "^4.20.2",
116-
"webpack-cli": "^3.1.1"
113+
"sass-loader": "^7.2.0",
114+
"style-loader": "^1.0.0",
115+
"webpack": "^4.39.2",
116+
"webpack-cli": "^3.3.7"
117117
},
118118
"dependencies": {
119119
"@material-ui/core": "^3.0.0",
120120
"@material-ui/icons": "^3.0.1",
121-
"react": "16.7.0",
122-
"react-dom": "16.7.0",
121+
"react": "^16.9.0",
122+
"react-dom": "^16.9.0",
123123
"react-redux": "^5.0.7",
124124
"react-router": "^5.0.0",
125+
"react-router-dom": "^5.0.1",
125126
"redux": "^4.0.0",
126127
"redux-actions": "^2.3.2",
127128
"redux-thunk": "^2.2.0"

src/global/codemirror/AUTHORS

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ Oskar Segersvärd
504504
pablo
505505
pabloferz
506506
Pablo Zubieta
507-
Page
507+
InstallationPage
508508
paladox
509509
Panupong Pasupat
510510
paris

src/global/codemirror/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ The [`refresh`](http://codemirror.net/doc/manual.html#event_refresh) event is no
358358

359359
xml-fold addon: Fix a null-dereference bug.
360360

361-
Page up and page down now do something even in single-line documents.
361+
InstallationPage up and page down now do something even in single-line documents.
362362

363363
Fix an issue where the cursor position could be off in really long (~8000 character) tokens.
364364

src/global/codemirror/doc/releases.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ <h2>Version 5.x</h2>
236236
<li><a href="http://codemirror.net/mode/erlang">erlang mode</a>: Fix mode crash when trying to read an empty context.</li>
237237
<li><a href="http://codemirror.net/doc/manual.html#addon_comment">comment addon</a>: Fix broken behavior when toggling comments inside a comment.</li>
238238
<li>xml-fold addon: Fix a null-dereference bug.</li>
239-
<li>Page up and page down now do something even in single-line documents.</li>
239+
<li>InstallationPage up and page down now do something even in single-line documents.</li>
240240
<li>Fix an issue where the cursor position could be off in really long (~8000 character) tokens.</li>
241241
<li><a href="http://codemirror.net/mode/javascript">javascript mode</a>: Better indentation when semicolons are missing. Better support for TypeScript classes, optional parameters, and the <code>type</code> keyword.</li>
242242
<li>The <a href="http://codemirror.net/doc/manual.html#event_blur"><code>blur</code></a> and <a href="http://codemirror.net/doc/manual.html#event_focus"><code>focus</code></a> events now pass the DOM event to their handlers.</li>

src/global/codemirror/mode/asterisk/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,16 @@ <h2>Asterisk dialplan mode</h2>
124124
exten => 600,n,Goto(s,6) ; Start over
125125

126126
;
127-
; You can use the Macro Page to intercom a individual user
127+
; You can use the Macro InstallationPage to intercom a individual user
128128
exten => 76245,1,Macro(page,SIP/Grandstream1)
129129
; or if your peernames are the same as extensions
130130
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
131131
;
132132
;
133-
; System Wide Page at extension 7999
133+
; System Wide InstallationPage at extension 7999
134134
;
135135
exten => 7999,1,Set(TIMEOUT(absolute)=60)
136-
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
136+
exten => 7999,2,InstallationPage(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
137137

138138
; Give voicemail at extension 8500
139139
;

src/global/codemirror/mode/markdown/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h2>Markdown mode</h2>
3636
================
3737

3838
&lt;ul id="ProjectSubmenu"&gt;
39-
&lt;li&gt;&lt;a href="/projects/markdown/" title="Markdown Project Page"&gt;Main&lt;/a&gt;&lt;/li&gt;
39+
&lt;li&gt;&lt;a href="/projects/markdown/" title="Markdown Project InstallationPage"&gt;Main&lt;/a&gt;&lt;/li&gt;
4040
&lt;li&gt;&lt;a class="selected" title="Markdown Basics"&gt;Basics&lt;/a&gt;&lt;/li&gt;
4141
&lt;li&gt;&lt;a href="/projects/markdown/syntax" title="Markdown Syntax Documentation"&gt;Syntax&lt;/a&gt;&lt;/li&gt;
4242
&lt;li&gt;&lt;a href="/projects/markdown/license" title="Pricing and License Information"&gt;License&lt;/a&gt;&lt;/li&gt;

src/install/index.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Form Tools installation</title>
5+
</head>
6+
<body>
7+
<div id="root"></div>
8+
<script src="../react/main.bundle.js"></script>
9+
</body>
10+
</html>
File renamed without changes.

src/install/files/main.css src/install_old/files/main.css

-32
Original file line numberDiff line numberDiff line change
@@ -56,44 +56,12 @@ body, table, td, span, div, p {
5656
width: 950px;
5757
}
5858

59-
#footer {
60-
margin-top: 30px;
61-
border-top: 1px dotted #cccccc;
62-
padding: 6px 0;
63-
text-align: justify;
64-
}
6559

6660
ul {
6761
margin: 0;
6862
padding-left: 16px;
6963
}
7064

71-
#footer ul {
72-
list-style: none;
73-
margin: 0;
74-
padding: 0;
75-
}
76-
77-
#footer ul li {
78-
float: left;
79-
padding: 0px 20px;
80-
border-right: 1px solid #cccccc;
81-
}
82-
83-
#footer ul li.colN {
84-
border-right: 0;
85-
}
86-
87-
#footer ul li a {
88-
color: #0066cc;
89-
display: block;
90-
}
91-
92-
#footer ul li a:hover {
93-
border-bottom: 0;
94-
color: #990000;
95-
}
96-
9765
#content {
9866
margin: 24px 10px 0 10px;
9967
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/react/bundles/installation.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import InstallationPage from '../layout/InstallationPage';
4+
5+
const App = () => (
6+
<InstallationPage>
7+
<div>Content here.</div>
8+
</InstallationPage>
9+
);
10+
11+
ReactDOM.render(
12+
<App />,
13+
document.getElementById('root')
14+
);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import styles from './Header.scss';
3+
4+
5+
const Header = ({ i18n, version }) => (
6+
<section className={styles.header}>
7+
<div className={styles.version}>
8+
<img src="../themes/default/images/account_section_left_green2x.png" border="0" width="8" height="25" />
9+
<div id="account_section">{version}</div>
10+
<img src="../themes/default/images/account_section_right_green2x.png" border="0" width="8" height="25" />
11+
</div>
12+
<span style={{ float: 'left', paddingTop: 4 }}>
13+
<a href="http://www.formtools.org" className="no_border">
14+
<img src="../themes/default/images/logo_green2x.png" border="0" width="220" height="67"/>
15+
</a>
16+
</span>
17+
</section>
18+
);
19+
20+
export default Header;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.header {
2+
height: 72px;
3+
position: relative;
4+
text-align: center;
5+
width: 950px;
6+
}
7+
8+
.version {
9+
float: right;
10+
display: flex;
11+
12+
div {
13+
color: white;
14+
font-weight: bold;
15+
padding: 2px 12px 0;
16+
}
17+
}
18+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
3+
4+
const Footer = ({ i18n }) => (
5+
<div id="footer">
6+
<ul>
7+
<li><a href="https://formtools.org" target="_blank">formtools.org</a></li>
8+
<li><a href="https://docs.formtools.org/installation/" target="_blank">{i18n.phrase_installation_help}</a></li>
9+
<li><a href="https://docs.formtools.org" target="_blank">{i18n.word_documentation}</a></li>
10+
<li className="colN"><a href="https://github.com/formtools/core/" target="_blank">Github</a></li>
11+
</ul>
12+
</div>
13+
);
14+
15+
export default Footer;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#footer {
2+
margin-top: 30px;
3+
border-top: 1px dotted #cccccc;
4+
padding: 6px 0;
5+
text-align: justify;
6+
7+
ul {
8+
list-style: none;
9+
margin: 0;
10+
padding: 0;
11+
12+
li {
13+
float: left;
14+
padding: 0 20px;
15+
border-right: 1px solid #cccccc;
16+
}
17+
}
18+
}
19+
20+
21+
#footer ul li.colN {
22+
border-right: 0;
23+
}
24+
25+
#footer ul li a {
26+
color: #0066cc;
27+
display: block;
28+
}
29+
30+
#footer ul li a:hover {
31+
border-bottom: 0;
32+
color: #990000;
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
3+
4+
const Navigation = ({ i18n }) => (
5+
<div id="nav_items">
6+
<div className="{if $step == 1}nav_current{else}nav_visited{/if}">
7+
1 <span className="delim">-</span> {i18N.word_welcome}
8+
</div>
9+
<div className="{if $step == 2}nav_current{elseif $step < 2}nav_remaining{else}nav_visited{/if}">
10+
2 <span className="delim">-</span> {i18n.phrase_system_check}
11+
</div>
12+
<div className="{if $step == 3}nav_current{elseif $step < 3}nav_remaining{else}nav_visited{/if}">
13+
3 <span className="delim">-</span> {i18n.phrase_create_database_tables}
14+
</div>
15+
<div className="{if $step == 4}nav_current{elseif $step < 4}nav_remaining{else}nav_visited{/if}">
16+
4 <span className="delim">-</span> {i18n.phrase_create_config_file}
17+
</div>
18+
<div className="{if $step == 5}nav_current{elseif $step < 5}nav_remaining{else}nav_visited{/if}">
19+
5 <span className="delim">-</span> {i18n.phrase_create_admin_account}
20+
</div>
21+
<div className="{if $step == 6}nav_current{elseif $step < 6}nav_remaining{else}nav_visited{/if}">
22+
6 <span className="delim">-</span> {i18n.phrase_clean_up}
23+
</div>
24+
</div>
25+
);
26+
27+
export default Navigation;

src/react/layout/InstallationPage.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from 'react';
2+
import Header from '../components/general/Header/Header';
3+
// import Footer from '../components/installation/InstallationFooter/InstallationFooter';
4+
import styles from './Page.scss';
5+
6+
7+
const InstallationPage = ({ children }) => (
8+
<div className={styles.page}>
9+
<Header />
10+
<section>{children}</section>
11+
...
12+
</div>
13+
);
14+
15+
export default InstallationPage;

0 commit comments

Comments
 (0)