Changeset 245


Ignore:
Timestamp:
11/11/13 21:33:05 (6 years ago)
Author:
nhoyt
Message:

Added loggerCallback property to properties object passed to sortTree function, which enables output of rule information by logging facility.

Location:
trunk/proto-14/chrome/content
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/proto-14/chrome/content/element-results.js

    r215 r245  
    5050    ], 
    5151    defaultSortButton: null, 
    52     updateCallback:    null 
     52    updateCallback:    null, 
     53    loggerCallback:    null 
    5354  }; 
    5455 
  • trunk/proto-14/chrome/content/tree-sort.js

    r207 r245  
    3030  var defaultSortButton = properties.defaultSortButton; 
    3131  var updateCallback    = properties.updateCallback; 
     32  var loggerCallback    = properties.loggerCallback; 
    3233 
    3334  var order = tree.getAttribute("sortDirection") == "ascending" ? 1 : -1; 
     
    101102  // Update UI based on tree selection state. 
    102103  if (updateCallback) updateCallback(tree); 
     104 
     105  // Output logging info. 
     106  if (loggerCallback) loggerCallback(table); 
    103107}; 
  • trunk/proto-14/chrome/content/view-category.js

    r243 r245  
    6262    ], 
    6363    defaultSortButton: document.getElementById("ainspector-rc-default-sort"), 
    64     updateCallback: ainspectorSidebar.updateSelectedRuleInfo 
     64    updateCallback: ainspectorSidebar.updateSelectedRuleInfo, 
     65    loggerCallback: null 
    6566  }; 
    6667 
     
    8182  tree.setAttribute("sortResource", ainspectorSidebar.ruleResultConst.DEFAULT_COLUMN); 
    8283  ainspectorSidebar.sortRuleResults(); 
     84}; 
     85 
     86/** 
     87 * @function logRuleResultsTable 
     88 * 
     89 * @memberOf ainspectorSidebar 
     90 * 
     91 * @desc 
     92 */ 
     93 
     94ainspectorSidebar.logRuleResultsTable = function (table) { 
     95  if (!ainspector.log.enabled) return; 
     96  var numRows = table.length; 
     97 
     98  for (var i = 0; i < numRows; i++) { 
     99    var row = table[i]; 
     100    ainspector.log.debug(row["ainspector-rule-col"]); 
     101  } 
    83102}; 
    84103 
Note: See TracChangeset for help on using the changeset viewer.