rem: newItem.onclick = function() { 
add: queryNode.onclick = function() { 
context: function saveQueryHistory(query, appendFlag) {    debug("saveQueryHistory: " + query);    var listNode = getQueryHistoryListNode(true);    // simple de-dupe check    // abort when we see the first duplicate:    // this is most likely to happen with the most recent query    // also implements history limit...    var listItems = listNode.childNodes;    var normalizedQuery = normalize(query);    if (query == null || query == "") {        return;    }    if (listItems && listItems[0]) {        debug("saveQueryHistory: checking " + listItems.length);        for (var i = 0; i < listItems.length; i++) {            //debug("saveQueryHistory: " + i);            if (normalize(listItems[i].childNodes[0].nodeValue) == normalizedQuery) {                // we want to remove a node and then break                listNode.removeChild(listItems[i]);                debug("saveQueryHistory: " + i + " matched!");                if (g_cq_history_limit != null && g_cq_history_limit > 0)                    break;            }            if (g_cq_history_limit != null && i > g_cq_history_limit)                listNode.removeChild(listItems[i]);        }    }    var newItem = document.createElement("li");    newItem.appendChild(document.createTextNode(query));    // onclick, copy to current textarea    newItem.onclick = function() {         var buf = getBuffer();         buf.value = this.childNodes[0].nodeValue;         // don't refresh buffer list         //refreshBufferList(g_cq_buffer_current, "saveQueryHistory");    }    // tool-tip    newItem.title = "Click here to copy this query into the current buffer.";    // delete widget    var deleteLink = document.createElement("span");    deleteLink.className = "query-delete";    deleteLink.onclick = function() {        if (confirm("Are you sure you want to delete this history item?")) {            this.parentNode.parentNode.removeChild(this.parentNode);        }        // this approach won't work: cookies get too big        //setCookie(g_cq_history_cookie, this.parentNode.parentNode.innerHTML);    };    // tool-tip    deleteLink.title = "Click here to delete this query from your history.";    deleteLink.appendChild(document.createTextNode(" (x) "));    newItem.appendChild(deleteLink);    // spacing: css padding, margin don't seem to work with ol    newItem.appendChild(document.createElement("hr"));    // it's nice to have the most-recent at the top...    if (listItems && listItems[0] && (!appendFlag)) {        listNode.insertBefore(newItem, listItems[0]);    } else {        listNode.appendChild(newItem);    }    // finally, update the saved-queries cookie    // this approach won't work: cookies get too big    //setCookie(g_cq_history_cookie, listNode.innerHTML);} // saveQueryHistory
meta: 952	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/952/499e513a3cc333dbcb784318ca05ad90a90b7c8e/cq.js/clean/cq.js