Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Commit 706cb9e

Browse files
committed
tmp
1 parent a282b76 commit 706cb9e

File tree

8 files changed

+82
-6
lines changed

8 files changed

+82
-6
lines changed

.babelrc

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

lib/views/layout/2column.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
{% block title %}{{ config.crowi['app:title'] }}{% endblock %}
1010
</a>
1111
{% if searchConfigured() %}
12-
<form class="navbar-form navbar-left search-top" role="search">
12+
<div class="navbar-form navbar-left search-top" role="search" id="search-top">
1313
<div class="form-group input-group search-top-input-group">
1414
<input type="text" id="search-top-input" class="search-top-input form-control" placeholder="Search ...">
1515
<span class="input-group-btn">
1616
<button class="btn btn-default" type="button"><i class="search-top-icon fa fa-search"></i></button>
1717
</span>
1818
</div>
19-
</form>
19+
</div>
2020
<div class="search-suggest" id="search-suggest">
2121
</div>
2222
{% endif %}

lib/views/layout/layout.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ <h3>-</h3>
108108
</body>
109109
{% endblock %}
110110

111+
<script src="/js/app.js"></script>
111112
</html>
112113

113-
114-

lib/views/page_list.html

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ <h1 class="title">
3838
{% block content_main_before %}
3939
{% endblock %}
4040

41+
<div id="xxx"></div>
42+
4143
<div class="page-list content-main {% if req.body.pageForm %}on-edit{% endif %}"
4244
id="content-main"
4345
data-path="{{ path }}"

package.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"dependencies": {
3131
"async": "~1.5.0",
3232
"aws-sdk": "~2.2.26",
33+
"axios": "~0.9.1",
34+
"babel-core": "~6.7.6",
35+
"babel-loader": "~6.2.4",
36+
"babel-preset-es2015": "~6.6.0",
37+
"babel-preset-react": "~6.5.0",
3338
"basic-auth-connect": "~1.0.0",
3439
"bluebird": "~3.0.5",
3540
"body-parser": "~1.14.1",
@@ -69,22 +74,25 @@
6974
"kerberos": "0.0.17",
7075
"marked": "~0.3.5",
7176
"method-override": "~2.3.1",
72-
"mkdirp": "^0.5.1",
77+
"mkdirp": "~0.5.1",
7378
"moment": "~2.13.0",
7479
"mongoose": "4.2.5",
7580
"mongoose-paginate": "4.2.0",
7681
"morgan": "~1.5.1",
7782
"multer": "~0.1.8",
7883
"nodemailer": "~1.2.2",
7984
"nodemailer-ses-transport": "~1.1.0",
85+
"react": "~15.0.1",
86+
"react-dom": "~15.0.1",
8087
"redis": "~0.12.1",
8188
"reveal.js": "~3.2.0",
8289
"socket.io": "~1.3.0",
8390
"socket.io-client": "~1.3.0",
8491
"sprintf": "~0.1.5",
8592
"swig": "~1.4.0",
8693
"time": "~0.11.0",
87-
"vinyl-source-stream": "~1.1.0"
94+
"vinyl-source-stream": "~1.1.0",
95+
"webpack": "~1.13.0"
8896
},
8997
"devDependencies": {
9098
"chai": "~1.10.0",
@@ -98,6 +106,7 @@
98106
"start": "node app.js",
99107
"test": "gulp test",
100108
"build": "gulp",
109+
"jsbuild": "webpack",
101110
"postinstall": "gulp"
102111
},
103112
"env": {

resource/js/app.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
4+
import HeaderSearchBox from './components/Header/SearchBox';
5+
6+
class Crowi extends React.Component {
7+
constructor(props) {
8+
super(props);
9+
//this.state = {count: props.initialCount};
10+
//this.tick = this.tick.bind(this);
11+
}
12+
13+
render() {
14+
return (
15+
<h1>Hello</h1>
16+
);
17+
}
18+
}
19+
20+
ReactDOM.render(<Hello />, document.getElementById('xxx'));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import React from 'react';
2+
3+
export class SearchBox extends React.Component {
4+
}

webpack.config.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
var path = require('path');
2+
var webpack = require('webpack');
3+
4+
module.exports = {
5+
entry: {
6+
app: './resource/js/app.js',
7+
},
8+
output: {
9+
path: path.join(__dirname + "/public/js"),
10+
filename: "[name].js"
11+
},
12+
resolve: {
13+
modulesDirectories: [
14+
'./node_modules',
15+
],
16+
},
17+
module: {
18+
loaders: [
19+
{
20+
test: /.jsx?$/,
21+
loader: 'babel-loader',
22+
exclude: /node_modules/,
23+
query: {
24+
presets: ['es2015', 'react']
25+
}
26+
}
27+
]
28+
},
29+
plugins: [
30+
new webpack.ProvidePlugin({
31+
jQuery: "jquery",
32+
$: "jquery",
33+
jquery: "jquery"
34+
})
35+
]
36+
};

0 commit comments

Comments
 (0)