%treeDTD; ]> !/Mac/.test(navigator.platform) null -1 null true 0 "" -1 0) { currentX += cw; if (currentX - (cw * aThresh) > adjustedX) return col.element; } } if (aPos) aPos.value = isRTL ? "before" : "after"; return columns.pop().element; ]]> 1000) this._incrementalString = key; else this._incrementalString += key; this._lastKeyTime = event.timeStamp; var length = this._incrementalString.length; var incrementalString = this._incrementalString; var charIndex = 1; while (charIndex < length && incrementalString[charIndex] == incrementalString[charIndex - 1]) charIndex++; // If all letters in incremental string are same, just try to match the first one if (charIndex == length) { length = 1; incrementalString = incrementalString.substring(0, length); } var keyCol = this.columns.getKeyColumn(); var rowCount = this.view.rowCount; var start = 1; var c = this.currentIndex; if (length > 1) { start = 0; if (c < 0) c = 0; } for (var i = 0; i < rowCount; i++) { var l = (i + start + c) % rowCount; var cellText = this.view.getCellText(l, keyCol); cellText = cellText.substring(0, length).toLowerCase(); if (cellText == incrementalString) return l; } return -1; ]]> = this.view.rowCount || !column) return false; if (column.type != Components.interfaces.nsITreeColumn.TYPE_TEXT && column.type != Components.interfaces.nsITreeColumn.TYPE_PASSWORD) return false; if (column.cycler || !this.view.isEditable(row, column)) return false; // Beyond this point, we are going to edit the cell. if (this._editingColumn) this.stopEditing(); var input = this.inputField; var box = this.treeBoxObject; box.ensureCellIsVisible(row, column); // Get the coordinates of the text inside the cell. var textRect = box.getCoordsForCellItem(row, column, "text"); // Get the coordinates of the cell itself. var cellRect = box.getCoordsForCellItem(row, column, "cell"); // Calculate the top offset of the textbox. var style = window.getComputedStyle(input, ""); var topadj = parseInt(style.borderTopWidth) + parseInt(style.paddingTop); input.top = textRect.y - topadj; // The leftside of the textbox is aligned to the left side of the text // in LTR mode, and left side of the cell in RTL mode. var left, widthdiff; if (style.direction == "rtl") { left = cellRect.x; widthdiff = cellRect.x - textRect.x; } else { left = textRect.x; widthdiff = textRect.x - cellRect.x; } input.left = left; input.height = textRect.height + topadj + parseInt(style.borderBottomWidth) + parseInt(style.paddingBottom); input.width = cellRect.width - widthdiff; input.hidden = false; input.value = this.view.getCellText(row, column); var selectText = function selectText() { input.select(); input.inputField.focus(); } setTimeout(selectText, 0); this._editingRow = row; this._editingColumn = column; this.setAttribute("editing", "true"); box.invalidateCell(row, column); return true; ]]> 0 ? c > edge : c < edge) { if (this.view.selection.isSelected(edge) && this.view.selection.count <= 1) return; c = edge; } var cellSelType = this._cellSelType; if (cellSelType) { var column = this.view.selection.currentColumn; if (!column) return; while ((offset > 0 ? c <= edge : c >= edge) && !this.view.isSelectable(c, column)) c += offset; if (offset > 0 ? c > edge : c < edge) return; } if (!this._isAccelPressed(event)) this.view.selection.timedSelect(c, this._selectDelay); else // Ctrl+Up/Down moves the anchor without selecting this.currentIndex = c; this.treeBoxObject.ensureRowIsVisible(c); ]]> 0) { i += p - 1; if (c >= i) { i = c + p; this.treeBoxObject.ensureRowIsVisible(i > edge ? edge : i); } i = i > edge ? edge : i; } else if (c <= i) { i = c <= p ? 0 : c - p; this.treeBoxObject.ensureRowIsVisible(i); } this.view.selection.timedSelect(i, this._selectDelay); ]]> 0) { i += p - 1; if (c >= i) { i = c + p; this.treeBoxObject.ensureRowIsVisible(i > edge ? edge : i); } // Extend the selection from the existing pivot, if any this.view.selection.rangedSelect(-1, i > edge ? edge : i, this._isAccelPressed(event)); } else { if (c <= i) { i = c <= p ? 0 : c - p; this.treeBoxObject.ensureRowIsVisible(i); } // Extend the selection from the existing pivot, if any this.view.selection.rangedSelect(-1, i, this._isAccelPressed(event)); } ]]> 1) { // Multiple touch points detected, abort. In particular this aborts // the panning gesture when the user puts a second finger down after // already panning with one finger. Aborting at this point prevents // the pan gesture from being resumed until all fingers are lifted // (as opposed to when the user is back down to one finger). this._touchY = -1; } else { this._touchY = event.touches[0].screenY; } ]]> = 0) { var deltaY = this._touchY - event.touches[0].screenY; var lines = Math.trunc(deltaY / this.treeBoxObject.rowHeight); if (Math.abs(lines) > 0) { this.treeBoxObject.scrollByLines(lines); deltaY -= lines * this.treeBoxObject.rowHeight; this._touchY = event.touches[0].screenY + deltaY; } event.preventDefault(); } ]]> 0) { this.currentIndex = this.treeBoxObject.getFirstVisibleRow(); } if (this._cellSelType && !this.view.selection.currentColumn) { var col = this._getNextColumn(this.currentIndex, false); this.view.selection.currentColumn = col; } ]]> if (this._handleEnter(event)) { event.stopPropagation(); event.preventDefault(); } = 0) { if (cellSelType && !this.view.isSelectable(parentIndex, currentColumn)) { return; } this.view.selection.select(parentIndex); this.treeBoxObject.ensureRowIsVisible(parentIndex); event.preventDefault(); return; } } if (cellSelType) { var col = this._getNextColumn(row, true); if (col) { this.view.selection.currentColumn = col; this.treeBoxObject.ensureCellIsVisible(row, col); event.preventDefault(); } } ]]> 0 && !event.altKey && !this._isAccelPressed(event) && !event.metaKey && !event.ctrlKey) { var l = this._keyNavigate(event); if (l >= 0) { this.view.selection.timedSelect(l, this._selectDelay); this.treeBoxObject.ensureRowIsVisible(l); } event.preventDefault(); } ]]> if ("_ensureColumnOrder" in this.parentNode) this.parentNode._ensureColumnOrder(); -1 = 0 && view.isContainerOpen(cell.row)) { var parentIndex = view.getParentIndex(view.selection.currentIndex); while (parentIndex >= 0 && parentIndex != cell.row) parentIndex = view.getParentIndex(parentIndex); if (parentIndex == cell.row) { var parentSelectable = true; if (this.parentNode._cellSelType) { var currentColumn = view.selection.currentColumn; if (!view.isSelectable(parentIndex, currentColumn)) parentSelectable = false; } if (parentSelectable) view.selection.select(parentIndex); } } this.parentNode.changeOpenState(cell.row); return; } if (! view.selection.single) { var augment = this._isAccelPressed(event); if (event.shiftKey) { view.selection.rangedSelect(-1, cell.row, augment); b.ensureRowIsVisible(cell.row); return; } if (augment) { view.selection.toggleSelect(cell.row); b.ensureRowIsVisible(cell.row); view.selection.currentIndex = cell.row; return; } } /* We want to deselect all the selected items except what was clicked, UNLESS it was a right-click. We have to do this in click rather than mousedown so that you can drag a selected group of items */ if (!cell.col) return; // if the last row has changed in between the time we // mousedown and the time we click, don't fire the select handler. // see bug #92366 if (!cell.col.cycler && this._lastSelectedRow == cell.row && cell.col.type != Components.interfaces.nsITreeColumn.TYPE_CHECKBOX) { var cellSelType = this.parentNode._cellSelType; if (cellSelType == "text" && cell.childElt != "text" && cell.childElt != "image") return; if (cellSelType) { if (!cell.col.selectable || !view.isSelectable(cell.row, cell.col)) { return; } } view.selection.select(cell.row); b.ensureRowIsVisible(cell.row); if (cellSelType) { view.selection.currentColumn = cell.col; } } ]]> this.parentNode.parentNode._columnsDirty = true; 0 && sib.parentNode == this.parentNode) return sib; sib = sib.boxObject.previousSibling; } return null; ]]> 0) ++visible; if (visible > 1) { window.addEventListener("mousemove", this._onDragMouseMove, true); window.addEventListener("mouseup", this._onDragMouseUp, true); document.treecolDragging = this; this.mDragGesturing = true; this.mStartDragX = event.clientX; this.mStartDragY = event.clientY; } } ]]> 2) aPopup.removeChild(aPopup.firstChild); var refChild = aPopup.firstChild; var tree = this.parentNode.parentNode; for (var currCol = tree.columns.getFirstColumn(); currCol; currCol = currCol.getNext()) { // Construct an entry for each column in the row, unless // it is not being shown. var currElement = currCol.element; if (!currElement.hasAttribute("ignoreincolumnpicker")) { var popupChild = document.createElement("menuitem"); popupChild.setAttribute("type", "checkbox"); var columnName = currElement.getAttribute("display") || currElement.getAttribute("label"); popupChild.setAttribute("label", columnName); popupChild.setAttribute("colindex", currCol.index); if (currElement.getAttribute("hidden") != "true") popupChild.setAttribute("checked", "true"); if (currCol.primary) popupChild.setAttribute("disabled", "true"); aPopup.insertBefore(popupChild, refChild); } } var hidden = !tree.enableColumnDrag; const anonids = ["menuseparator", "menuitem"]; for (var i = 0; i < anonids.length; i++) { var element = document.getAnonymousElementByAttribute(this, "anonid", anonids[i]); element.hidden = hidden; } ]]>