Changeset 177


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

ai-sidebar.js: Added reference lookup to ruleDetailsSummary in init fn.
view-details.js:

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

Legend:

Unmodified
Added
Removed
  • trunk/proto-13/chrome/content/ai-sidebar.js

    r176 r177  
    101101  ainspectorSidebar.ruleCategorySummary = document.getElementById("ainspector-rule-category-summary"); 
    102102  ainspectorSidebar.ruleCategoryTree    = document.getElementById("ainspector-rule-category-tree"); 
     103  ainspectorSidebar.ruleDetailsSummary  = document.getElementById("ainspector-rule-details-summary"); 
    103104  ainspectorSidebar.selectedRule        = document.getElementById("ainspector-selected-rule"); 
    104105  ainspectorSidebar.viewTitle           = document.getElementById("ainspector-view-title"); 
  • trunk/proto-13/chrome/content/view-details.js

    r176 r177  
    2525 
    2626ainspectorSidebar.setDetailsView = function () { 
    27   // get selection index 
     27  var summary = ainspectorSidebar.ruleDetailsSummary; 
    2828  var tree = ainspectorSidebar.ruleCategoryTree; 
    2929  var index = tree.currentIndex; 
     
    4141  var ruleResult = ainspectorSidebar.rulesTable[index].filteredResult; 
    4242 
     43  // update summary grid 
     44  summary.setData(ainspectorSidebar.getRuleResultSummaryData(ruleResult)); 
     45 
    4346  // fill content areas 
    4447  ainspectorSidebar.setDetailsSummaryContent(ruleResult); 
     
    5861 
    5962ainspectorSidebar.clearDetailsView = function () { 
     63  // clear summary grid 
     64  var summary = ainspectorSidebar.ruleDetailsSummary; 
     65  summary.setData(ainspector.nullData); 
     66 
    6067  var vboxSummary = document.getElementById("ainspector-details-summary"); 
    6168  ainspectorSidebar.clearContent(vboxSummary); 
     
    6370  var vboxRuleInfo = document.getElementById("ainspector-details-rule-info"); 
    6471  ainspectorSidebar.clearContent(vboxRuleInfo); 
     72}; 
     73 
     74/** 
     75 * @function getRuleResultSummaryData 
     76 * 
     77 * @memberOf ainspectorSidebar 
     78 * 
     79 * @desc Get summary information from RuleResult object. 
     80 */ 
     81 
     82ainspectorSidebar.getRuleResultSummaryData = function (ruleResult) { 
     83  var summary = ruleResult.getResultSummary(); 
     84 
     85  // return null data if no results 
     86  if (!summary.hasResults()) return ainspector.nullData; 
     87   
     88  var data = { 
     89    pctpass: summary.percent_passed, 
     90    viol:    summary.violations, 
     91    warn:    summary.warnings, 
     92    mc:      summary.manual_checks 
     93  }; 
     94 
     95  return data; 
    6596}; 
    6697 
  • trunk/proto-13/chrome/content/view-details.xul

    r175 r177  
    1010  <vbox id="ainspector-details-view"> 
    1111 
    12     <spacer height="8"/> 
     12    <vbox> 
     13      <hbox> 
     14        <spacer flex="4"/> 
     15        <grid> 
     16          <rows> 
     17            <row class="summary-header"/> 
     18            <row class="summary-data" 
     19              id="ainspector-rule-details-summary"/> 
     20          </rows> 
     21        </grid> 
     22        <spacer flex="4"/> 
     23      </hbox> 
     24    </vbox> 
     25 
     26    <spacer height="16"/> 
    1327 
    1428    <vbox id="ainspector-details-summary" 
     
    2539      </tabs> 
    2640      <tabpanels style="padding: 16px 0px 0px"> 
    27         <tabpanel height="303" style="background: white"> 
     41        <tabpanel height="100" style="background: white"> 
    2842          <vbox id="ainspector-details-elements"/> 
    2943        </tabpanel> 
    30         <tabpanel height="303" style="background: white"> 
     44        <tabpanel height="251" style="background: white"> 
    3145          <vbox id="ainspector-details-rule-info" 
    3246            width="381"/> 
Note: See TracChangeset for help on using the changeset viewer.