-
Notifications
You must be signed in to change notification settings - Fork 46
/
index.html
97 lines (86 loc) · 3.65 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html> <html> <head>
<title>Factorio Calc</title>
<script type="text/javascript">
window.DATALIBS = [
'core-0-16-51',
'core-0-15-9',
'core-0-15-2',
'core-0-14-22',
'core-0-14-20',
'core-0-13-20',
'core-0-13-15',
'core-0-12-33',
'core-0-11-3',
'core-0-10-2',
'core-0-9-8'
];
window.DEFAULT_LIB = window.DATALIBS[0];
window.App = {}
</script>
<script type="text/javascript" src="lua.vm.js"></script>
<script type="text/javascript" src="ffi.js"></script>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.1/babel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-modal/1.7.7/react-modal.js" integrity="sha256-wQ9go2p9/RzvdqC0RzS2djz4aujaK10VA5UnV9A5eXI=" crossorigin="anonymous"></script>
<script src="bower_components/d3/d3.min.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/graphlib/dist/graphlib.core.js"></script>
<script src="bower_components/dagre/dist/dagre.core.js"></script>
<script src="bower_components/dagre-d3/dist/dagre-d3.core.js"></script>
<link rel="stylesheet" href="calc.css">
<script type="text/jsx" src="calculator.js"></script>
<script type="text/jsx" src="datasource.jsx"></script>
<script type="text/jsx" src="input.jsx"></script>
<script type="text/jsx" src="options.jsx"></script>
<script type="text/jsx" src="ingredients.jsx"></script>
<script type="text/jsx" src="graph.jsx"></script>
<script type="text/jsx" src="explain.jsx"></script>
<script type="text/jsx" src="bulk.jsx"></script>
<script type="text/jsx" src="calc.jsx"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script type="text/lua">
if #window.location.hash == 0 then
window.location.hash = '#' .. js.global.DEFAULT_LIB
end
datalib = window.location.hash:sub(2)
js.global.CURRENT_LIB = datalib
require('dataloader')
require('data.'..datalib)
require('ffi')
function js_get_data()
return to_js_val(get_data())
end
js.global.App.getData = js_get_data
js.global.App.luaInitialized = true
console('Lua finished')
</script>
<script type = "text/jsx">
var run = function() {
if (App.luaInitialized) {
App.Calculator.init();
ReactDOM.render(
<Calc datalibs={window.DATALIBS} currentlib={window.CURRENT_LIB}/>,
document.getElementById('calc')
);
} else {
console.log("Waiting for lua...");
window.setTimeout(run, 50);
}
};
run();
</script>
</head>
<body>
<a href="https://github.com/rubyruy/factorio-calc"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<div id="calc"></div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-825268-3', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>