# HG changeset patch # User Michiel Broek # Date 1421238016 -3600 # Node ID fc2fae36f4ba3c6d8a7be6437f66d1ccafb14aa6 # Parent c1be51c076c920235d3354d75e12181e10055008 Better tab switching with a cookie diff -r c1be51c076c9 -r fc2fae36f4ba www-thermferm/js/index.js --- a/www-thermferm/js/index.js Wed Jan 14 12:50:12 2015 +0100 +++ b/www-thermferm/js/index.js Wed Jan 14 13:20:16 2015 +0100 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2014 + * Copyright (C) 2014-2015 * * Michiel Broek * @@ -29,7 +29,12 @@ }); }, 60000); // Create jqxTabs. - $("#jqxTabs").jqxTabs({ width: 978, height: 428, position: 'top', theme: 'ui-redmond'}); + var index = $.jqx.cookie.cookie("jqxTabs_jqxWidget"); + if (undefined == index) index = 0; + $("#jqxTabs").jqxTabs({ selectedItem: index, width: 978, height: 428, position: 'top', theme: 'ui-redmond'}); + $("#jqxTabs").on('selected', function (event) { + $.jqx.cookie.cookie("jqxTabs_jqxWidget", event.args.item); + }); $("#maintenance").jqxButton({ width: 150, height: 25, theme: 'ui-redmond' }); }); diff -r c1be51c076c9 -r fc2fae36f4ba www-thermferm/liveview.php --- a/www-thermferm/liveview.php Wed Jan 14 12:50:12 2015 +0100 +++ b/www-thermferm/liveview.php Wed Jan 14 13:20:16 2015 +0100 @@ -1,6 +1,6 @@ * @@ -428,19 +428,6 @@ if (strlen($answer)) { $arr = explode("\r\n", $answer); - $outstr .= ' '.PHP_EOL; - $outstr .= '
'.PHP_EOL; $outstr .= '
    '.PHP_EOL; if (startsWith($arr[0], "212")) {