/* This file is part of Jeedom. * * Jeedom 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 3 of the License, or * (at your option) any later version. * * Jeedom 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 Jeedom. If not, see . */ /* Permet la réorganisation des commandes dans l'équipement */ $("#table_cmd").sortable({ axis: "y", cursor: "move", items: ".cmd", placeholder: "ui-state-highlight", tolerance: "intersect", forcePlaceholderSize: true }) /* Fonction permettant l'affichage des commandes dans l'équipement */ function addCmdToTable(_cmd) { if (!isset(_cmd)) { var _cmd = {configuration: {}} } if (!isset(_cmd.configuration)) { _cmd.configuration = {} } var tr = '' tr += '' tr += '' tr += '' tr += '' tr += '
' tr += '' tr += '' tr += '' tr += '
' tr += '' tr += '' tr += '' tr += '' + jeedom.cmd.availableType() + '' tr += '' tr += '' tr += '' tr += ' ' tr += ' ' tr += ' ' tr += '
' tr += '' tr += '' tr += '' tr += '
' tr += '' tr += ''; tr += ''; tr += ''; tr += '' if (is_numeric(_cmd.id)) { tr += ' ' tr += ' Tester' } tr += '' tr += '' $('#table_cmd tbody').append(tr) var tr = $('#table_cmd tbody tr').last() jeedom.eqLogic.buildSelectCmd({ id: $('.eqLogicAttr[data-l1key=id]').value(), filter: {type: 'info'}, error: function (error) { $('#div_alert').showAlert({message: error.message, level: 'danger'}) }, success: function (result) { tr.find('.cmdAttr[data-l1key=value]').append(result) tr.setValues(_cmd, '.cmdAttr') jeedom.cmd.changeType(tr, init(_cmd.subType)) } }) }