mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 11:16:11 +01:00
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
This commit is contained in:
parent
06a8504c78
commit
42ada741e3
|
@ -1,15 +0,0 @@
|
|||
/* globals gitGraph */
|
||||
|
||||
$(document).ready(function () {
|
||||
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);
|
||||
})
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
public/vendor/librejs.html
vendored
7
public/vendor/librejs.html
vendored
|
@ -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>
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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',
|
||||
|
|
15
web_src/js/draw.js
Normal file
15
web_src/js/draw.js
Normal file
|
@ -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,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,
|
||||
|
|
Loading…
Reference in a new issue