www-thermferm/js/index.js

changeset 709
5b6d7b640e52
parent 708
13555c27b592
child 710
abe60578d695
equal deleted inserted replaced
708:13555c27b592 709:5b6d7b640e52
1 /*****************************************************************************
2 * Copyright (C) 2014-2015
3 *
4 * Michiel Broek <mbroek at mbse dot eu>
5 *
6 * This file is part of ThermFerm
7 *
8 * This is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * ThermFerm is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with ThermFerm; see the file COPYING. If not, write to the Free
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *****************************************************************************/
22
23
24 $(document).ready(function () {
25 setInterval(function(){
26 $.getJSON("getroom.php", function(data) {
27 $("#room_temp").html(data.temperature + ' &deg;C');
28 $("#room_hum").html(data.humidity + ' %');
29 });
30 }, 60000);
31 // Create jqxTabs.
32 var index = $.jqx.cookie.cookie("jqxTabs_jqxWidget");
33 if (undefined == index) index = 0;
34 $("#jqxTabs").jqxTabs({ selectedItem: index, width: 978, height: 428, position: 'top', theme: 'ui-redmond'});
35 $("#jqxTabs").on('selected', function (event) {
36 $.jqx.cookie.cookie("jqxTabs_jqxWidget", event.args.item);
37 });
38 $("#maintenance").jqxButton({ width: 150, height: 25, theme: 'ui-redmond' });
39 });
40

mercurial