Changeset 246


Ignore:
Timestamp:
11/11/13 23:26:41 (6 years ago)
Author:
nhoyt
Message:

ai-common.js:

  • Added pFirstStyle property to html object

rule-info.js, view-category.js:

  • Modified html output fns. to call getResultMessages and display each ACTION message as a separate paragraph.

ai-sidebar.properties:

  • Added info.actions for plural form of ACTIONS heading when needed.
Location:
trunk/proto-14/chrome
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/proto-14/chrome/content/ai-common.js

    r224 r246  
    5656    h2FirstStyle: { "style": "margin: 0; margin-top: 0; font-size: inherit; font-weight: bold" }, 
    5757    h2Style:      { "style": "margin: 0; margin-top: 1em; font-size: inherit; font-weight: bold" }, 
    58     pStyle:       { "style": "margin: 0" }, 
     58    pFirstStyle:  { "style": "margin: 0" }, 
     59    pStyle:       { "style": "margin: 0; margin-top: 0.5em" }, 
    5960    ulStyle:      { "style": "margin: 0; padding: 0; padding-left: 2em" } 
    6061  } 
  • trunk/proto-14/chrome/content/rule-info.js

    r227 r246  
    2323  return { 
    2424    ACTION:          nls.getString("info.action"), 
     25    ACTIONS:         nls.getString("info.actions"), 
    2526 
    2627    DEFINITION:      nls.getString("info.definition"), 
     
    5455  var h2, p; 
    5556  var h2FirstStyle = ainspector.html.h2FirstStyle; 
    56   var h2Style = ainspector.html.h2Style; 
    57   var pStyle  = ainspector.html.pStyle; 
     57  var h2Style      = ainspector.html.h2Style; 
     58  var pFirstStyle  = ainspector.html.pFirstStyle; 
     59  var pStyle       = ainspector.html.pStyle; 
    5860 
    5961  var vboxSummary = document.getElementById("ainspector-rule-summary"); 
     
    6769 
    6870  // Summary 
    69   p = getHTML("p", ruleResult.getRuleSummary(), pStyle); 
     71  p = getHTML("p", ruleResult.getRuleSummary(), pFirstStyle); 
    7072  addHTML(vboxSummary, p, 2); 
    7173 
    7274  // Action 
    73   h2 = getHTML("h2", labels.ACTION, h2FirstStyle); 
     75  var actionMessages = ruleResult.getResultMessages(); 
     76  var actionLabel = actionMessages.length > 1 ? labels.ACTIONS : labels.ACTION; 
     77 
     78  h2 = getHTML("h2", actionLabel, h2FirstStyle); 
    7479  addHTML(vboxResult, h2); 
    7580 
    76   p = getHTML("p", ruleResult.getResultMessage(), pStyle); 
    77   addHTML(vboxResult, p, 2); 
     81  for (var i = 0; i < actionMessages.length; i++) { 
     82    var posStyle = (i === 0) ? pFirstStyle : pStyle; 
     83    p = getHTML("p", actionMessages[i] + "\n", posStyle); 
     84    addHTML(vboxResult, p); 
     85  } 
    7886}; 
    7987 
     
    9199  var h2, p, ul, li, a; 
    92100  var h2FirstStyle = ainspector.html.h2FirstStyle; 
    93   var h2Style = ainspector.html.h2Style; 
    94   var pStyle  = ainspector.html.pStyle; 
    95   var ulStyle = ainspector.html.ulStyle; 
     101  var h2Style      = ainspector.html.h2Style; 
     102  var pFirstStyle  = ainspector.html.pFirstStyle; 
     103  var pStyle       = ainspector.html.pStyle; 
     104  var ulStyle      = ainspector.html.ulStyle; 
    96105 
    97106  var vbox = document.getElementById("ainspector-details-rule-info"); 
     
    107116  addHTML(vbox, h2); 
    108117 
    109   p = getHTML("p", ruleResult.getRuleDefinition(), pStyle); 
     118  p = getHTML("p", ruleResult.getRuleDefinition(), pFirstStyle); 
    110119  addHTML(vbox, p, 2); 
    111120 
     
    114123  addHTML(vbox, h2); 
    115124 
    116   p = getHTML("p", labels.WCAG_LEVEL + ruleResult.getWCAG20Level() + "; " + ruleType, pStyle); 
     125  p = getHTML("p", labels.WCAG_LEVEL + ruleResult.getWCAG20Level() + "; " + ruleType, pFirstStyle); 
    117126  addHTML(vbox, p, 2); 
    118127 
     
    121130  addHTML(vbox, h2); 
    122131 
    123   p = getHTML("p", ruleResult.getPurpose(), pStyle); 
     132  p = getHTML("p", ruleResult.getPurpose(), pFirstStyle); 
    124133  addHTML(vbox, p, 2); 
    125134 
     
    128137  addHTML(vbox, h2); 
    129138 
    130   p = getHTML("p", ruleResult.getTargetResources().join(", "), pStyle); 
     139  p = getHTML("p", ruleResult.getTargetResources().join(", "), pFirstStyle); 
    131140  addHTML(vbox, p, 2); 
    132141 
  • trunk/proto-14/chrome/content/view-category.js

    r245 r246  
    312312  var h2, p; 
    313313  var h2FirstStyle = ainspector.html.h2FirstStyle; 
    314   var h2Style = ainspector.html.h2Style; 
    315   var pStyle  = ainspector.html.pStyle; 
     314  var h2Style      = ainspector.html.h2Style; 
     315  var pFirstStyle  = ainspector.html.pFirstStyle; 
     316  var pStyle       = ainspector.html.pStyle; 
    316317  var vbox = ainspectorSidebar.selectedRule; 
    317318 
     
    327328    addHTML(vbox, h2); 
    328329 
    329     p = getHTML("p", ainspectorSidebar.ruleResultsTable[index].filteredResult.getRuleDefinition(), pStyle); 
     330    p = getHTML("p", ainspectorSidebar.ruleResultsTable[index].filteredResult.getRuleDefinition(), pFirstStyle); 
    330331    addHTML(vbox, p, 2); 
    331332 
    332333    // Action 
    333     h2 = getHTML("h2", nls.getString('info.action'), h2Style); 
     334    var actionMessages = ainspectorSidebar.ruleResultsTable[index].filteredResult.getResultMessages(); 
     335    var actionLabel = actionMessages.length > 1 ? nls.getString('info.actions') : nls.getString('info.action'); 
     336 
     337    h2 = getHTML("h2", actionLabel, h2Style); 
    334338    addHTML(vbox, h2); 
    335339 
    336     p = getHTML("p", ainspectorSidebar.ruleResultsTable[index].filteredResult.getResultMessage() + "\n", pStyle); 
    337     addHTML(vbox, p); 
     340    for (var i = 0; i < actionMessages.length; i++) { 
     341      var posStyle = (i === 0) ? pFirstStyle : pStyle; 
     342      p = getHTML("p", actionMessages[i] + "\n", posStyle); 
     343      addHTML(vbox, p); 
     344    } 
    338345  } 
    339346  else { 
    340     p = getHTML("p", nls.getString('info.noSelection'), pStyle); 
     347    p = getHTML("p", nls.getString('info.noSelection'), pFirstStyle); 
    341348    addHTML(vbox, p); 
    342349  } 
  • trunk/proto-14/chrome/locale/en-US/ai-sidebar.properties

    r243 r246  
    3232 
    3333info.action            = ACTION 
     34info.actions           = ACTIONS 
    3435info.compliance        = COMPLIANCE 
    3536info.definition        = DEFINITION 
Note: See TracChangeset for help on using the changeset viewer.