# HG changeset patch # User Michiel Broek # Date 1406323724 -7200 # Node ID 0882292322b3041d22bcf21b97af18b74d975f5b # Parent f05601490415d2e8e58344e6cea1028af6c3fab1 Removed obsolete files diff -r f05601490415 -r 0882292322b3 www-thermferm/js/maintenance_panel.js --- a/www-thermferm/js/maintenance_panel.js Fri Jul 25 23:27:08 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -/***************************************************************************** - * Copyright (C) 2014 - * - * Michiel Broek - * - * This file is part of ThermFerm - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * ThermFerm is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ThermFerm; see the file COPYING. If not, write to the Free - * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - *****************************************************************************/ - -$(document).ready(function () { - - var data = {}; - var theme = 'ui-redmond'; - - /* - * 1-Wire bus - */ - var source_bus = { - datatype: "json", - datafields: [ - { name: 'Address', type: 'string' }, - { name: 'Refcnt', type: 'int' }, - { name: 'Chip', type: 'string' }, - { name: 'Description', type: 'string' } - ], - url: 'getbus.php' - }; - var dataAdapter_bus = new $.jqx.dataAdapter(source_bus); - $("#jqxgrid_bus").jqxGrid( { - width: 770, height: 280, - source: dataAdapter_bus, - theme: theme, - columnsresize: true, - columns: [ - { text: 'Address', datafield: 'Address', width: 150 }, - { text: 'References', datafield: 'Refcnt', width: 100 }, - { text: 'Chipset', datafield: 'Chip', width: 120 }, - { text: 'Description', datafield: 'Description', minwidth: 120 } - ] - }); - - /* - * Profiles - */ - var source_profiles = { - datatype: "json", - datafields: [ - { name: 'UUID', type: 'string' }, - { name: 'Name', type: 'string' }, - { name: 'Steps', type: 'int' } - ], - id: 'UUID', - url: 'getprofiles.php', - insertrow: function (rowid, commit) { - var data = "insert=true&" + $.param({Name: rowid}); - $.ajax({ - dataType: 'json', - url: 'getprofiles.php', - data: data, - cache: false, - success: function (data, status, xhr) { - // insert command is executed. - commit(true); - }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } - }); - }, - deleterow: function (rowid, commit) { - var data = "delete=true&" + $.param({UUID: rowid}); - $.ajax({ - dataType: 'json', - url: 'getprofiles.php', - data: data, - cache: false, - success: function (data, status, xhr) { - // insert command is executed. - commit(true); - }, - error: function(jqXHR, textStatus, errorThrown) { - commit(false); - } - }); - }, - updaterow: function (rowid, rowdata, commit) { - // synchronize with the server - send update command - var data = "update=true&UUID=" + rowdata.UUID + "&Name=" + rowdata.Name; - $.ajax({ - dataType: 'json', - url: 'getprofiles.php', - data: data, - success: function (data, status, xhr) { - // update command is executed. - commit(true); - }, - error: function () { - // cancel changes. - commit(false); - } - }); - } - }; - var dataAdapter_profiles = new $.jqx.dataAdapter(source_profiles); - $("#jqxgrid_profiles").jqxGrid( { - width: 770, height: 280, - selectionmode: 'singlecell', - source: dataAdapter_profiles, - theme: theme, - columnsresize: true, - editable: true, - showstatusbar: true, - renderstatusbar: function (statusbar) { - // appends buttons to the status bar. - var container = $("
"); - var addButton = $("
Add
"); - var deleteButton = $("
Delete
"); - var reloadButton = $("
Reload
"); - container.append(addButton); - container.append(deleteButton); - container.append(reloadButton); - statusbar.append(container); - addButton.jqxButton({ width: 60, height: 20 }); - deleteButton.jqxButton({ width: 65, height: 20 }); - reloadButton.jqxButton({ width: 65, height: 20 }); - // add new row. - addButton.click(function (event) { - /* - * Ask a new profile name using a popup window. - * Send "ADD PROFILE name" to the server using the getprofiles.php script. - * Refresh the data - */ - $("#jqxwindow_addprofile").jqxWindow('open'); - $("#jqxgrid_profiles").jqxGrid({ source: dataAdapter_profiles }); - }); - // delete selected row. - deleteButton.click(function (event) { - var selectedrowindex = $("#jqxgrid_profiles").jqxGrid('getselectedrowindex'); - var rowscount = $("#jqxgrid_profiles").jqxGrid('getdatainformation').rowscount; - var id = $("#jqxgrid_profiles").jqxGrid('getrowid', selectedrowindex); - $("#jqxgrid_profiles").jqxGrid('deleterow', id); - }); - // reload grid data. - reloadButton.click(function (event) { - $("#jqxgrid_profiles").jqxGrid({ source: dataAdapter_profiles }); - }); - }, - columns: [ - { text: 'UUID', editable: false, datafield: 'UUID', width: 280 }, - { text: 'Name', datafield: 'Name', minwidth: 120 }, - { text: 'Steps', editable: false, datafield: 'Steps', width: 50 } - ] - }); - $("#jqxwindow_addprofile").jqxWindow({ - theme: theme, - resizable: false, - isModal: true, - modalOpacity: 0.5, - autoOpen: false, - width: 210, - height: 180, - cancelButton: $("#profile_cancelButton"), - initContent: function () { - $("#profile_addButton").jqxButton({ width: 70, height: 25, theme: theme }); - $("#profile_cancelButton").jqxButton({ width: 70, height: 25, theme: theme }); - $("#profile_addButton").click(function () { - var id = $("#profile_inputField").val(); - $("#jqxgrid_profiles").jqxGrid('insertrow', id); - $("#jqxwindow_addprofile").jqxWindow('hide'); - }); - } - }); - - /* - * Units - */ - var source_units = { - datatype: "json", - datafields: [ - { name: 'UUID', type: 'string' }, - { name: 'Name', type: 'string' }, - { name: 'Mode', type: 'string' } - ], - url: 'getunits.php' - }; - var dataAdapter_units = new $.jqx.dataAdapter(source_units); - $("#jqxgrid_units").jqxGrid( { - width: 770, height: 280, - source: dataAdapter_units, - theme: theme, - columnsresize: true, - editable: true, - columns: [ - { text: 'UUID', editable: false, datafield: 'UUID', width: 280 }, - { text: 'Name', datafield: 'Name', minwidth: 120 }, - { text: 'Mode', datafield: 'Mode', width: 70 } - ] - }); -}); diff -r f05601490415 -r 0882292322b3 www-thermferm/maintenance_panel.php --- a/www-thermferm/maintenance_panel.php Fri Jul 25 23:27:08 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ - - * - * This file is part of ThermFerm - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * ThermFerm is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with ThermFerm; see the file COPYING. If not, write to the Free - * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - *****************************************************************************/ - -/* - * Look for the style names in the jqwidgets/styles directory. - */ -$my_style = 'ui-redmond'; - - - -/* The maintenance popup window */ -function maintenance_panel() -{ - global $my_style; - - $outstr = PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' '.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' Maintenance panel'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
    '.PHP_EOL; - $outstr .= '
  • General
  • '.PHP_EOL; - $outstr .= '
  • 1-Wire Bus
  • '.PHP_EOL; - $outstr .= '
  • Profiles
  • '.PHP_EOL; - $outstr .= '
  • Units
  • '.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' General'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' Add Profile
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' Profile Name:
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' '.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' '.PHP_EOL; - $outstr .= ' '.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' '.PHP_EOL; - $outstr .= '
'.PHP_EOL; - $outstr .= ' '.PHP_EOL; - $outstr .= '
'.PHP_EOL; - - return $outstr; -} -