Skip to content

Commit 42ada74

Browse files
lunnytechknowlogick
authored andcommitted
Pack web_src/js/draw.js to public/js/index.js (#8975)
* pack web_src/js/draw.js to public/js/index.js * fix eslint
1 parent 06a8504 commit 42ada74

File tree

8 files changed

+20
-27
lines changed

8 files changed

+20
-27
lines changed

public/js/draw.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

public/js/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/vendor/librejs.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@
3838
<tr>
3939
<td><a href="../js/index.js">index.js</a></td>
4040
<td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td>
41-
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">index.js</a></td>
42-
</tr>
43-
<tr>
44-
<td><a href="../js/draw.js">draw.js</a></td>
45-
<td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td>
46-
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">draw.js</a></td>
41+
<td><a href="https://github.com/go-gitea/gitea/tree/master/web_src/js">*.js</a></td>
4742
</tr>
4843
<tr>
4944
<td><a href="./plugins/clipboard/clipboard.min.js">clipboard.min.js</a></td>

templates/base/footer.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
{{if .RequireGitGraph}}
2727
<!-- graph -->
2828
<script src="{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js"></script>
29-
<script src="{{StaticUrlPrefix}}/js/draw.js"></script>
3029
{{end}}
3130

3231
<!-- Third-party libraries -->

templates/pwa/serviceworker_js.tmpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ var urlsToCache = [
77
'{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js',
88
'{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}',
99
'{{StaticUrlPrefix}}/js/semantic.dropdown.custom.js?v={{MD5 AppVer}}',
10-
'{{StaticUrlPrefix}}/js/draw.js',
1110
'{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js',
1211
'{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js',
1312
'{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js',

web_src/js/draw.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* globals gitGraph */
2+
3+
$(() => {
4+
const graphList = [];
5+
6+
if (!document.getElementById('graph-canvas')) {
7+
return;
8+
}
9+
10+
$('#graph-raw-list li span.node-relation').each(function () {
11+
graphList.push($(this).text());
12+
});
13+
14+
gitGraph(document.getElementById('graph-canvas'), graphList);
15+
});

webpack.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ const TerserPlugin = require('terser-webpack-plugin');
44
module.exports = {
55
mode: 'production',
66
entry: {
7-
index: './web_src/js/index.js',
7+
index: ['./web_src/js/index', './web_src/js/draw']
88
},
99
devtool: 'source-map',
1010
output: {
1111
path: path.resolve(__dirname, 'public/js'),
12-
filename: '[name].js'
12+
filename: 'index.js'
1313
},
1414
optimization: {
1515
minimize: true,

0 commit comments

Comments
 (0)