Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pack web_src/js/draw.js to public/js/index.js #8975

Merged
merged 2 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions public/js/draw.js

This file was deleted.

2 changes: 1 addition & 1 deletion public/js/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/index.js.map

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions public/vendor/librejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@
<tr>
<td><a href="../js/index.js">index.js</a></td>
<td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td>
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">index.js</a></td>
</tr>
<tr>
<td><a href="../js/draw.js">draw.js</a></td>
<td><a href="https://github.com/go-gitea/gitea/blob/master/LICENSE">Expat</a></td>
<td><a href="https://github.com/go-gitea/gitea/tree/master/public/js">draw.js</a></td>
<td><a href="https://github.com/go-gitea/gitea/tree/master/web_src/js">*.js</a></td>
</tr>
<tr>
<td><a href="./plugins/clipboard/clipboard.min.js">clipboard.min.js</a></td>
Expand Down
1 change: 0 additions & 1 deletion templates/base/footer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
{{if .RequireGitGraph}}
<!-- graph -->
<script src="{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js"></script>
<script src="{{StaticUrlPrefix}}/js/draw.js"></script>
{{end}}

<!-- Third-party libraries -->
Expand Down
1 change: 0 additions & 1 deletion templates/pwa/serviceworker_js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ var urlsToCache = [
'{{StaticUrlPrefix}}/vendor/plugins/semantic/semantic.min.js',
'{{StaticUrlPrefix}}/js/index.js?v={{MD5 AppVer}}',
'{{StaticUrlPrefix}}/js/semantic.dropdown.custom.js?v={{MD5 AppVer}}',
'{{StaticUrlPrefix}}/js/draw.js',
'{{StaticUrlPrefix}}/vendor/plugins/clipboard/clipboard.min.js',
'{{StaticUrlPrefix}}/vendor/plugins/gitgraph/gitgraph.js',
'{{StaticUrlPrefix}}/vendor/plugins/vue/vue.min.js',
Expand Down
15 changes: 15 additions & 0 deletions web_src/js/draw.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* globals gitGraph */

$(() => {
const graphList = [];

if (!document.getElementById('graph-canvas')) {
return;
}

$('#graph-raw-list li span.node-relation').each(function () {
graphList.push($(this).text());
});

gitGraph(document.getElementById('graph-canvas'), graphList);
});
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
mode: 'production',
entry: {
index: './web_src/js/index.js',
index: ['./web_src/js/index', './web_src/js/draw']
},
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'public/js'),
filename: '[name].js'
filename: 'index.js'
},
optimization: {
minimize: true,
Expand Down