/*jsl:import ipa.js */ /* Authors: * Adam Young * Endi S. Dewata * * Copyright (C) 2010 Red Hat * see file 'COPYING' for use and warranty information * * This program 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; version 2 only * * This program 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 this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ IPA.attributes_widget = function(spec) { spec = spec || {}; var that = IPA.checkboxes_widget(spec); that.object_type = spec.object_type; var id = spec.name; that.setup = function() { }; that.create = function(container) { that.container = container; that.table = $('', { id:id, 'class':'search-table aci-attribute-table' }). append(''). append(''). appendTo(container); var tr = $('').appendTo($('thead', that.table)); tr.append($('
', { style:"height:2em; vertical-align:bottom;", html:$('',{ type: "checkbox", click: function(){ $('.aci-attribute', that.table). attr('checked', $(this).attr('checked')); that.show_undo(); } }) })).append($('', { 'class': 'aci-attribute-column', html: IPA.messages.objects.aci.attribute })); if (that.undo) { that.create_undo(container); that.get_undo().click(function(){ that.reset(); that.hide_undo(); }); } if (that.object_type){ that.populate (that.object_type); } }; that.load = function(record) { that.record = record; that.values = []; var values = record[that.name] || []; for (var i=0; i').appendTo(tbody); var td = $('').appendTo(aci_tr); td.append($('',{ type: 'checkbox', name: that.name, value: value, 'class': 'aci-attribute', click: function() { that.show_undo(); } })); td = $('').appendTo(aci_tr); td.append($('').appendTo(tr); td.append($('', { type: 'checkbox', name: that.name, value: value, 'class': 'aci-attribute', change: function() { that.show_undo(); } })); td = $('').appendTo(tr); td.append($('