Initial (overdue) commit
TODO: - enable dynamic loading of button labels and actions
This commit is contained in:
40
CMDRConsole_old/templates/base.html
Normal file
40
CMDRConsole_old/templates/base.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}{% endblock %} - CMDRConsole</title>
|
||||
|
||||
<link href="{{ url_for('static', filename='bootstrap.min.css') }}" rel="stylesheet">
|
||||
<link href="{{ url_for('static', filename='CMDRConsole.css') }}" rel="stylesheet">
|
||||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
<div class="row header-row">
|
||||
<div class="col-xs-12 button-col">
|
||||
{% block displayName %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% block buttons %}{% endblock %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script>
|
||||
addEventListener("DOMContentLoaded", function() {
|
||||
var buttons = document.querySelectorAll("button");
|
||||
for (var ii=0, ll=buttons.length; ii<ll; ii++) {
|
||||
var btn = buttons[ii];
|
||||
btn.addEventListener("click", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var clickedButton = e.target;
|
||||
var command = clickedButton.value;
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
request.open("POST", "/button_press", true);
|
||||
request.send(command);
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
</script>
|
||||
|
||||
77
CMDRConsole_old/templates/general.html
Normal file
77
CMDRConsole_old/templates/general.html
Normal file
@@ -0,0 +1,77 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block displayName %}{% block title %}General{% endblock %}{% endblock %}
|
||||
{% block buttons %}
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Speed Boost"
|
||||
class="btn btn-default btn-block" />Speed Boost</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Hardpoints"
|
||||
class="btn btn-default btn-block">Hardpoints</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Drop Chaff"
|
||||
class="btn btn-default btn-block">Drop Chaff</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Frameshift"
|
||||
class="btn btn-default btn-block">Frameshift</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="75% Throttle"
|
||||
class="btn btn-default btn-block">75% Throttle</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Cargo Bay"
|
||||
class="btn btn-default btn-block">Cargo Bay</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Shield Cell"
|
||||
class="btn btn-default btn-block">Shield Cell</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Supercruise"
|
||||
class="btn btn-default btn-block">Supercruise</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Full Stop"
|
||||
class="btn btn-default btn-block">Full Stop</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Fuel Scoop"
|
||||
class="btn btn-default btn-block">Fuel Scoop</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Heat Sink"
|
||||
class="btn btn-default btn-block">Heat Sink</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Run Silent"
|
||||
class="btn btn-default btn-block">Run Silent</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Full Reverse"
|
||||
class="btn btn-default btn-block">Full Reverse</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Landing Gear"
|
||||
class="btn btn-default btn-block">Landing Gear</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="ECM"
|
||||
class="btn btn-default btn-block">ECM</button>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<button type="button" name="btn" value="Toggle Lights"
|
||||
class="btn btn-default btn-block">Toggle Lights</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
109
CMDRConsole_old/templates/tmp.html
Normal file
109
CMDRConsole_old/templates/tmp.html
Normal file
@@ -0,0 +1,109 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block displayName %}{% block title %}General{% endblock %}{% endblock %}
|
||||
{% block buttons %}
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Speed Boost"
|
||||
class="btn btn-default btn-block">Speed Boost</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Hardpoints"
|
||||
class="btn btn-default btn-block">Hardpoints</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Drop Chaff"
|
||||
class="btn btn-default btn-block">Drop Chaff</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Frameshift"
|
||||
class="btn btn-default btn-block">Frameshift</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="75% Throttle"
|
||||
class="btn btn-default btn-block">75% Throttle</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Cargo Bay"
|
||||
class="btn btn-default btn-block">Cargo Bay</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Shield Cell"
|
||||
class="btn btn-default btn-block">Shield Cell</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Supercruise"
|
||||
class="btn btn-default btn-block">Supercruise</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Full Stop"
|
||||
class="btn btn-default btn-block">Full Stop</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Fuel Scoop"
|
||||
class="btn btn-default btn-block">Fuel Scoop</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Heat Sink"
|
||||
class="btn btn-default btn-block">Heat Sink</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Run Silent"
|
||||
class="btn btn-default btn-block">Run Silent</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row button-row'>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Full Reverse"
|
||||
class="btn btn-default btn-block">Full Reverse</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Landing Gear"
|
||||
class="btn btn-default btn-block">Landing Gear</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="ECM"
|
||||
class="btn btn-default btn-block">ECM</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-xs-3 button-col">
|
||||
<form method="post">
|
||||
<button type="submit" name="btn" value="Toggle Lights"
|
||||
class="btn btn-default btn-block">Toggle Lights</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user