Name Description Size
munger.js Constructs a new munger entry, using a regexp or lambda match function, and a class name (to be applied by the munger itself) or lambda replace function, and the default enabled state and a start priority (used if two rules match at the same index), as well as a default tag (when the munger adds it based on the class name) name. Regular Expressions for matching should ensure that the first capturing group is the one that contains the matched text. Non-capturing groups, of zero-width or otherwise can be used before and after, to ensure the right things are matched (e.g. to ensure whitespace before something). Note that for RegExp matching, the munger will search for the matched text (from the first capturing group) from the leftmost point of the entire match. This means that if the text that matched the first group occurs in any part of the match before the group, the munger will apply to the wrong bit. This is not usually a problem, but if it is you should use a lambdaMatch function and be sure to return the new style return value, which specifically indicates the start. The lambda match and lambda replace functions have this signature: lambdaMatch(text, containerTag, data, mungerEntry) lambdaReplace(text, containerTag, data, mungerEntry) - text is the entire text to find a match in/that has matched - containerTag is the element containing the text (not useful?) - data is a generic object containing properties kept throughout - mungerEntry is the CMungerEntry object for the munger itself The lambdaReplace function is expected to do everything needed to put |text| into |containerTab| ready for display. The return value for lambda match functions should be either: - (old style) just the text that matched (the munger will search for this text, and uses the first match) - (new style) an object with properties: - start (start index, 0 = first character) - text (matched text) (note that |text| must start at index |start|) The return value for lambda replace functions are not used. 8253
tree-utils.js An implemention of |nsITreeView| for a tree whose elements have no children. Code using BasicOView can override |getRowProperties|, |getColumnProperties|, |getCellProperties|, etc., as needed. Code using |BasicOView| will need to make the appropriate |myTree.tree .invalidate| calls when |myTree.data| changes. @syntax var myTree = new BasicOView() myTree.setColumnNames(["col 1", "col 2"]); myTree.data = [["row 1, col 1", "row 1, col 2"], ["row 2, col 1", "row 2, col 2"]]; treeBoxObject.view = myTree; 43837