/* * This file is part of HOAM, copyright (C) 2002-2008 Robert D Butler Jr. * * HOAM is free software; you can redistribute it and/or modify it under the * terms of the GNU Affero General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) * any later version. * * HOAM 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 Affero General Public License for more * details. * * You should have received a copy of the GNU Affero General Public License * along with HOAM; if not, see http://www.gnu.org/licenses or write to the * Free Software Foundation,Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 * * Questions specific to HOAM should be directed to HOA Management. Please see * the HOAM web site at http://hoam.hoa-management.com/ * * Some portions of HOAM incorporate ideas and/or code from other sources, and * those portions are explicitly mentioned and attributed in the relevant * section of HOAM source code. Questions about that code should be directed to * the original authors. * */ // tasklist_editing is true (i.e. set to an object)/false if we're editing an object var tasklist_editing = false; // tasklist_temp_li is !null if we have made a copy of an li during editing var tasklist_temp_li = document.createElement ("LI"); function tasklist_catchAdd () { // If we're already editing an item, return if (tasklist_editing) return; // Get the tasklist ul object var tasklist = $("mini-tasklist"); var ul = tasklist.getElementsByTagName ("UL"); editbox = tasklist_editbox (); // Get rid of any textual information inside the tasklist. var text = tasklist.lastChild; try { // 1 is an element node, 2 attribute and 3 text if (text.nodeType == 3) { //tasklist.removeChild (text); text.nodeValue = ""; } } catch (e) { // Nothing. Just leave it. } // If there aren't any previous tasks, then the list will be empty, and there is no