yunkong2.mobile/admin/index.html
2018-07-21 15:04:51 +08:00

92 lines
3.1 KiB
HTML

<html>
<!-- these 4 files always have to be included -->
<link rel="stylesheet" type="text/css" href="../../lib/css/themes/jquery-ui/redmond/jquery-ui.min.css"/>
<link rel="stylesheet" type="text/css" href="../../lib/css/jquery.multiselect-1.13.css"/>
<script type="text/javascript" src="../../lib/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../lib/js/jquery-ui-1.10.3.full.min.js"></script>
<!-- these two file always have to be included -->
<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<style>
.table_header {
background-color: blue;
color: white;
}
.ip {
width: 150px;
text-align: right;
}
</style>
<!-- you have to define 2 functions in the global scope: -->
<script type="text/javascript">
function setValue(id, value) {
// example: select elements with id=key and class=value and insert value
if ($('#' + id + '.value').attr('type') == 'checkbox') {
$('#' + id + '.value').prop('checked', value).change(function() {
changed = true;
$('#save').button("enable");
});
} else {
$('#' + id + '.value').val(value).change(function() {
changed = true;
$('#save').button("enable");
}).keyup(function() {
// Chack that only numbers entered
if ($(this).hasClass('number')) {
var val = $(this).val();
if (val) {
var newVal = '';
for (var i = 0; i < val.length; i++) {
if (val[i] >= '0' && val[i] <= '9') {
newVal += val[i];
}
}
if (val != newVal) $(this).val(newVal);
}
}
changed = true;
$('#save').button("enable");
});
}
}
// the function loadSettings has to exist ...
function load(settings) {
if (!settings) return;
changed = false;
$('#save').button("disable");
devices = settings.devices || [];
for (var key in settings) {
setValue(key, settings[key]);
}
}
// ... and the function save has to exist.
// you have to make sure the callback is called with the settings object as first param!
function save(callback) {
callback(null);
}
</script>
<!-- you have to put your config page in a div with id adapter-container -->
<div id="adapter-container">
<table><tr>
<td><img src="mobile.png"></td>
<td style="padding-top: 20px;padding-left: 10px"><h3 class="translate">mobile adapter settings</h3></td>
</tr></table>
<div class="translate">There is nothing to setup</h4>
</div>
</html>