refactor(Solvespace): Creates own tpl and moves js at the bottom

This commit is contained in:
sovanna 2019-07-22 12:46:55 +02:00
parent 62aaa02d32
commit d0194e6245
3 changed files with 71 additions and 66 deletions

View File

@ -1,7 +1,7 @@
+++ +++
title = "SolveSpace" title = "SolveSpace"
weight = 1 weight = 1
template = "page.html" template = "page-solvespace.html"
[extra] [extra]
layout_css = "col-12 col-md-10 mx-auto" layout_css = "col-12 col-md-10 mx-auto"
@ -124,68 +124,3 @@ Currently, the focus of development is to improve SolveSpace's handling of compl
**For commercial support and licensing**, please contact sales@m-l***s.hk. **For commercial support and licensing**, please contact sales@m-l***s.hk.
{% div() %}
<script src="/js/models/kf25.js"></script>
<script src="/js/models/viewport.js"></script>
<script src="/js/models/multiport.js"></script>
<script src="/js/models/chamber.js"></script>
<script src="/js/models/k526s-body.js"></script>
<script src="/js/models/k526s-head.js"></script>
<script src="/js/models/k526s-fixture.js"></script>
<script src="/js/models/k526s-adapter.js"></script>
<script src="/js/models/k526s-adapter-assy.js"></script>
<script>
(function () {
var nodes = [{
id: 'kf25',
model: solvespace_model_kf25,
params: {width: 400, height: 300, scale: 10, offset: new THREE.Vector3(-8, 0, 0)},
}, {
id: 'viewport',
model: solvespace_model_viewport,
params: {width: 400, height: 300, scale: 3},
}, {
id: 'multiport',
model: solvespace_model_multiport,
params: {width: 400, height: 300, scale: 3},
}, {
id: 'chamber',
model: solvespace_model_chamber,
params: {width: 800, height: 600, scale: 3},
}, {
id: 'k526s-body',
model: solvespace_model_k526s_body,
params: {width: 400, height: 300, scale: 6, offset: new THREE.Vector3(-10, -15, 0)},
}, {
id: 'k526s-head',
model: solvespace_model_k526s_head,
params: {width: 400, height: 300, scale: 8, offset: new THREE.Vector3(25, 0, 0)},
}, {
id: 'k526s-fixture',
model: solvespace_model_k526s_fixture,
params: {width: 800, height: 400, scale: 12},
}, {
id: 'k526s-adapter',
model: solvespace_model_k526s_adapter,
params: {width: 400, height: 300, scale: 8, offset: new THREE.Vector3(-8, 0, 0)},
}, {
id: 'k526s-adapter-assy',
model: solvespace_model_k526s_adapter_assy,
params: {width: 400, height: 300, scale: 8},
}];
var node;
for (var i = nodes.length - 1; i >= 0; i--) {
node = document.getElementById(nodes[i].id);
node.parentNode.replaceChild(solvespace(nodes[i].model, nodes[i].params), node);
}
})();
</script>
{% end %}

View File

@ -178,6 +178,9 @@
}); });
</script> </script>
{% block js %}
{% endblock %}
</body> </body>
</html> </html>

View File

@ -0,0 +1,67 @@
{% extends 'page.html' %}
{% block js %}
<script src="/js/models/kf25.js"></script>
<script src="/js/models/viewport.js"></script>
<script src="/js/models/multiport.js"></script>
<script src="/js/models/chamber.js"></script>
<script src="/js/models/k526s-body.js"></script>
<script src="/js/models/k526s-head.js"></script>
<script src="/js/models/k526s-fixture.js"></script>
<script src="/js/models/k526s-adapter.js"></script>
<script src="/js/models/k526s-adapter-assy.js"></script>
<script>
(function () {
var nodes = [{
id: 'kf25',
model: solvespace_model_kf25,
params: {width: 400, height: 300, scale: 10, offset: new THREE.Vector3(-8, 0, 0)},
}, {
id: 'viewport',
model: solvespace_model_viewport,
params: {width: 400, height: 300, scale: 3},
}, {
id: 'multiport',
model: solvespace_model_multiport,
params: {width: 400, height: 300, scale: 3},
}, {
id: 'chamber',
model: solvespace_model_chamber,
params: {width: 800, height: 600, scale: 3},
}, {
id: 'k526s-body',
model: solvespace_model_k526s_body,
params: {width: 400, height: 300, scale: 6, offset: new THREE.Vector3(-10, -15, 0)},
}, {
id: 'k526s-head',
model: solvespace_model_k526s_head,
params: {width: 400, height: 300, scale: 8, offset: new THREE.Vector3(25, 0, 0)},
}, {
id: 'k526s-fixture',
model: solvespace_model_k526s_fixture,
params: {width: 800, height: 400, scale: 12},
}, {
id: 'k526s-adapter',
model: solvespace_model_k526s_adapter,
params: {width: 400, height: 300, scale: 8, offset: new THREE.Vector3(-8, 0, 0)},
}, {
id: 'k526s-adapter-assy',
model: solvespace_model_k526s_adapter_assy,
params: {width: 400, height: 300, scale: 8},
}];
var node;
for (var i = nodes.length - 1; i >= 0; i--) {
node = document.getElementById(nodes[i].id);
node.parentNode.replaceChild(solvespace(nodes[i].model, nodes[i].params), node);
}
})();
</script>
{% endblock %}