Changeset 250


Ignore:
Timestamp:
11/22/13 17:28:34 (6 years ago)
Author:
nhoyt
Message:

ai-sidebar.js

  • Added fn. handleEvaluationPrefChange, which is now the callback for ai-sidebar's evaluation preferences listener, replacing updateContext.
  • Replaced property ruleCategorySummary with categorySummaryData; added categorySummaryHeader prop. Each references new or updated id in view-category.xul.

summary-grid.xml

  • Added hidePass method to binding elements ainspector-summary-header, ainspector-summary-data and ainspector-tbl-summary-data.

summary-rc.xul

  • Added id ainspector-category-label-pass to table header 'P' label.

summary-wcag.xul

  • Added id ainspector-guideline-label-pass to table header 'P' label.

view-category.js

  • Modified getRuleResultsTable fn. to filter out rule results of PASS and NOT_APPLICABLE when preference passAndNotApplicable is set to false.
  • Modified setCategoryView fn. to hide 'P' label and data when warranted by pref. setting.

view-category.xul

  • Renamed id ainspector-rule-category-summary to ainspector-category-summary-data; added id ainspector-category-summary-header.

view-summary.js

  • Changed ref. to id ainspector-page-summary to ainspector-page-summary-data.
  • Added fn. showHidePassLabels for setting state corresponding to passAndNotApplicable pref.
  • Modified fn. setSummaryView to handle value of passAndNotApplicable pref.

view-summary.xul

  • Renamed id ainspector-page-summary to ainspector-page-summary-data; added id ainspector-page-summary-header.

preferences/evaluation.js

  • Added handling of passAndNotApplicable pref. in getPref and onEvaluationPrefChange fns.

preferences/evaluation.xul

  • Added groupbox with checkbox for setting boolean pref. passAndNotApplicable.

locale/en-US/ai-sidebar.dtd

  • Changed context label from 'Incl. recommended rules' to 'Rec. Rules'

locale/en-US/ai-sidebar.properties

  • Changed value for 'Rec. Rules' setting from 'Yes' and 'No' to 'Included' and 'Excluded'

locale/en-US/options.dtd

  • Added punctuation to "Include 'Recommended' rules"
  • Added "Rule Results" label and "Include 'Pass' and 'N/A' results"

defaults/preferences/prefs.js

  • Added passAndNotApplicable preference to evaluation branch.

install.rdf

  • Changed version to 0.14.4
Location:
trunk/proto-14
Files:
15 edited

Legend:

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

    r231 r250  
    6868 
    6969/** 
    70 * @function updateEvaluation 
    71 * 
    72 * @memberOf ainspectorSidebar 
    73 * 
    74 * @desc Re-evaluate the current page and refresh the information display. 
    75 *       Called when the user selects the Update Evaluation button. 
    76 */ 
     70 * @function updateEvaluation 
     71 * 
     72 * @memberOf ainspectorSidebar 
     73 * 
     74 * @desc Re-evaluate the current page and refresh the information display. 
     75 *       Called when the user selects the Update Evaluation button. 
     76 */ 
    7777 
    7878ainspectorSidebar.updateEvaluation = function () { 
    7979  ainspectorSidebar.showTransition() 
    8080  setTimeout(ainspectorSidebar.updateContext, 300); 
     81}; 
     82 
     83/** 
     84 * @function handleEvaluationPrefChange 
     85 * 
     86 * @memberOf ainspectorSidebar 
     87 * 
     88 * @desc When an evaluation preference is changed, at minimum we need to 
     89 *       call updateContext, which calls, among other functions, evaluate 
     90 *       and updateView. However, if the currentView is Rule Details, the 
     91 *       rule currently being viewed may no longer be included, depending 
     92 *       on the preference change. Thus in this case, we need to call the 
     93 *       function updateEvaluation, which calls both showTransition and 
     94 *       updateContext. 
     95 */ 
     96 
     97ainspectorSidebar.handleEvaluationPrefChange = function () { 
     98  if (parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS) 
     99    ainspectorSidebar.updateEvaluation(); 
     100  else 
     101    ainspectorSidebar.updateContext(); 
    81102}; 
    82103 
     
    128149 
    129150  // initialize user interface components 
    130   ainspectorSidebar.elementResultsTree  = document.getElementById("ainspector-element-results-tree"); 
    131   ainspectorSidebar.locationInfo        = document.getElementById("ainspector-location-info"); 
    132   ainspectorSidebar.locationLabel       = document.getElementById("ainspector-location-label"); 
    133   ainspectorSidebar.progressMeter       = document.getElementById("ainspector-progress-meter"); 
    134   ainspectorSidebar.ruleCategorySummary = document.getElementById("ainspector-rule-category-summary"); 
    135   ainspectorSidebar.ruleCategoryTree    = document.getElementById("ainspector-rule-category-tree"); 
    136   ainspectorSidebar.ruleDetailsSummary  = document.getElementById("ainspector-rule-details-summary"); 
    137   ainspectorSidebar.selectedRule        = document.getElementById("ainspector-selected-rule"); 
    138   ainspectorSidebar.versionLabel        = document.getElementById("ainspector-version-label"); 
    139   ainspectorSidebar.viewTitle           = document.getElementById("ainspector-view-title"); 
    140   ainspectorSidebar.viewDeck            = document.getElementById("ainspector-view-deck"); 
     151  ainspectorSidebar.elementResultsTree    = document.getElementById("ainspector-element-results-tree"); 
     152  ainspectorSidebar.locationInfo          = document.getElementById("ainspector-location-info"); 
     153  ainspectorSidebar.locationLabel         = document.getElementById("ainspector-location-label"); 
     154  ainspectorSidebar.progressMeter         = document.getElementById("ainspector-progress-meter"); 
     155  ainspectorSidebar.categorySummaryHeader = document.getElementById("ainspector-category-summary-header"); 
     156  ainspectorSidebar.categorySummaryData   = document.getElementById("ainspector-category-summary-data"); 
     157  ainspectorSidebar.ruleCategoryTree      = document.getElementById("ainspector-rule-category-tree"); 
     158  ainspectorSidebar.ruleDetailsSummary    = document.getElementById("ainspector-rule-details-summary"); 
     159  ainspectorSidebar.selectedRule          = document.getElementById("ainspector-selected-rule"); 
     160  ainspectorSidebar.versionLabel          = document.getElementById("ainspector-version-label"); 
     161  ainspectorSidebar.viewTitle             = document.getElementById("ainspector-view-title"); 
     162  ainspectorSidebar.viewDeck              = document.getElementById("ainspector-view-deck"); 
    141163 
    142164  // display the version number 
     
    155177// instantiate and register PrefListener for preferences in evaluation branch 
    156178  ainspectorSidebar.evaluationPrefListener = new ainspector.PrefListener( 
    157     "extensions.ainspector.evaluation.", ainspectorSidebar.updateContext); 
     179    "extensions.ainspector.evaluation.", ainspectorSidebar.handleEvaluationPrefChange); 
    158180  ainspectorSidebar.evaluationPrefListener.register(); 
    159181}; 
  • trunk/proto-14/chrome/content/preferences/evaluation.js

    r247 r250  
    2929        return prefUtils.getIntPref(name); 
    3030      if (name === 'recommendedRules') 
     31        return prefUtils.getBoolPref(name); 
     32      if (name === 'passAndNotApplicable') 
    3133        return prefUtils.getBoolPref(name); 
    3234      if (name === 'layoutTables') 
     
    7779    break; 
    7880 
     81  case 'passAndNotApplicable': 
     82    break; 
     83 
    7984  case 'layoutTables': 
    8085    break; 
  • trunk/proto-14/chrome/content/preferences/evaluation.xul

    r247 r250  
    1212      <preference id="ainspector-recommended-rules-pref" type="bool" 
    1313        name="extensions.ainspector.evaluation.recommendedRules"/> 
     14      <preference id="ainspector-pass-and-not-appl-pref" type="bool" 
     15        name="extensions.ainspector.evaluation.passAndNotApplicable"/> 
    1416      <preference id="ainspector-layout-tables-pref" type="bool" 
    1517        name="extensions.ainspector.evaluation.layoutTables"/> 
     
    3436 
    3537    <groupbox class="secondary"> 
     38      <caption label="&groupbox.caption.ruleResults;"/> 
     39      <vbox> 
     40        <checkbox id="ainspector-pass-and-not-applicable" preference="ainspector-pass-and-not-appl-pref" 
     41          label="&label.results.pass-and-not-applicable;"/> 
     42      </vbox> 
     43    </groupbox> 
     44 
     45    <groupbox class="secondary"> 
    3646      <caption label="&groupbox.caption.otherOptions;"/> 
    3747      <vbox> 
  • trunk/proto-14/chrome/content/summary-grid.xml

    r224 r250  
    2424        tooltiptext="&ai-summary.tooltip.pass;"/> 
    2525    </content> 
     26    <implementation> 
     27      <method name="hidePass"> 
     28        <parameter name="value"/> 
     29        <body> 
     30          var nodes = document.getAnonymousNodes(this); 
     31          nodes[3].setAttribute('hidden', value); 
     32        </body> 
     33      </method> 
     34    </implementation> 
    2635  </binding> 
    2736 
     
    5665        </body> 
    5766      </method> 
     67      <method name="hidePass"> 
     68        <parameter name="value"/> 
     69        <body> 
     70          var nodes = document.getAnonymousNodes(this); 
     71          nodes[3].setAttribute('hidden', value); 
     72        </body> 
     73      </method> 
    5874    </implementation> 
    5975  </binding> 
     
    84100          nodes[3].setAttribute('value', data.mc); 
    85101          nodes[4].setAttribute('value', data.pass); 
     102        </body> 
     103      </method> 
     104      <method name="hidePass"> 
     105        <parameter name="value"/> 
     106        <body> 
     107          var nodes = document.getAnonymousNodes(this); 
     108          nodes[4].setAttribute('hidden', value); 
    86109        </body> 
    87110      </method> 
  • trunk/proto-14/chrome/content/summary-rc.xul

    r238 r250  
    3838              tooltiptext="&ai-summary.tooltip.mc;" 
    3939              style="border-left: 1px solid #bbb"/> 
    40             <label 
     40            <label id="ainspector-category-label-pass" 
    4141              class="tbl-summary-header-label" 
    4242              value="&ai-summary.label.pass;" 
  • trunk/proto-14/chrome/content/summary-wcag.xul

    r238 r250  
    3838              tooltiptext="&ai-summary.tooltip.mc;" 
    3939              style="border-left: 1px solid #bbb"/> 
    40             <label 
     40            <label id="ainspector-guideline-label-pass" 
    4141              class="tbl-summary-header-label" 
    4242              value="&ai-summary.label.pass;" 
  • trunk/proto-14/chrome/content/view-category.js

    r246 r250  
    140140  var resultsCount = filteredRuleResults.length; 
    141141  var table = []; 
     142  var hidePNA = ainspector.evaluationPrefs.getPref('passAndNotApplicable') ? false : true; 
    142143 
    143144  for (var i = 0; i < resultsCount; i++) { 
    144145    var filteredResult = filteredRuleResults[i]; 
    145146    var hasResults = filteredResult.hasResults(); 
     147    var resultValue = filteredResult.hasResults() ? filteredResult.getRuleResultValue() : -1; 
     148    if (hidePNA && (resultValue === OpenAjax.a11y.RESULT_VALUE.PASS || resultValue === -1)) continue; 
    146149    table.push({ 
    147150      "ainspector-rule-col":     filteredResult.getRuleSummary(), 
     
    258261 
    259262ainspectorSidebar.setCategoryView = function () { 
    260   var summary = ainspectorSidebar.ruleCategorySummary; 
     263  var summaryHeader = ainspectorSidebar.categorySummaryHeader 
     264  var summaryData   = ainspectorSidebar.categorySummaryData; 
     265  var hidden = ainspector.evaluationPrefs.getPref('passAndNotApplicable') ? false : true; 
    261266 
    262267  // update summary grid 
    263   summary.setData(ainspectorSidebar.getSummaryData(parent.AINSPECTOR.currentView)); 
     268  summaryHeader.hidePass(hidden); 
     269  summaryData.setData(ainspectorSidebar.getSummaryData(parent.AINSPECTOR.currentView)); 
     270  summaryData.hidePass(hidden); 
    264271 
    265272  // update rule results 
     
    281288 
    282289ainspectorSidebar.clearCategoryView = function () { 
    283   var summary = ainspectorSidebar.ruleCategorySummary; 
     290  var summaryData = ainspectorSidebar.categorySummaryData; 
    284291  var tree = ainspectorSidebar.ruleCategoryTree; 
    285292 
    286293  // clear summary grid 
    287   summary.setData(ainspector.nullData); 
     294  summaryData.setData(ainspector.nullData); 
    288295 
    289296  // clear rule results tree 
  • trunk/proto-14/chrome/content/view-category.xul

    r240 r250  
    1515        <grid> 
    1616          <rows> 
    17             <row class="summary-header"/> 
     17            <row class="summary-header" 
     18              id="ainspector-category-summary-header"/> 
    1819            <row class="summary-data" 
    19               id="ainspector-rule-category-summary"/> 
     20              id="ainspector-category-summary-data"/> 
    2021          </rows> 
    2122        </grid> 
  • trunk/proto-14/chrome/content/view-summary.js

    r194 r250  
    1717 
    1818ainspectorSidebar.summaryViewGridIds = [ 
    19   { id: "ainspector-page-summary" }, 
     19  { id: "ainspector-page-summary-data" }, 
    2020  { id: "ainspector-summary-structure" }, 
    2121  { id: "ainspector-summary-styles" }, 
     
    6464}; 
    6565 
     66ainspectorSidebar.showHidePassLabels = function (value) { 
     67  var pageSummaryHeader  = document.getElementById("ainspector-page-summary-header"); 
     68  var categoryLabelPass  = document.getElementById("ainspector-category-label-pass"); 
     69  var guidelineLabelPass = document.getElementById("ainspector-guideline-label-pass"); 
     70 
     71  pageSummaryHeader.hidePass(value); 
     72  categoryLabelPass.setAttribute('hidden', value); 
     73  guidelineLabelPass.setAttribute('hidden', value); 
     74}; 
     75 
    6676ainspectorSidebar.setSummaryView = function () { 
    6777  ainspectorSidebar.lazyInitSummaryViewGrids(); 
     
    7181  ainspectorSidebar.viewDeck.selectedIndex = ainspector.viewType.SUMMARY; 
    7282 
     83  // Determine whether pass data should be displayed 
     84  var hidden = ainspector.evaluationPrefs.getPref('passAndNotApplicable') ? false : true; 
     85  ainspectorSidebar.showHidePassLabels(hidden); 
     86 
    7387  // Populate the top-level summary-data and secondary tbl-summary-data objects 
    7488  for (var i = 0; i < max; i++) { 
    7589    var data = ainspectorSidebar.getSummaryData(i); 
    7690    ainspectorSidebar.summaryViewGrids[i].setData(data); 
     91    ainspectorSidebar.summaryViewGrids[i].hidePass(hidden); 
    7792  } 
    7893}; 
  • trunk/proto-14/chrome/content/view-summary.xul

    r237 r250  
    1717        <grid> 
    1818          <rows> 
    19             <row class="summary-header"/> 
     19            <row class="summary-header" 
     20              id="ainspector-page-summary-header"/> 
    2021            <row class="summary-data" 
    21               id="ainspector-page-summary"/> 
     22              id="ainspector-page-summary-data"/> 
    2223          </rows> 
    2324        </grid> 
  • trunk/proto-14/chrome/locale/en-US/ai-sidebar.dtd

    r248 r250  
    151151 
    152152<!ENTITY ai-label.option.ruleset     "Ruleset: "> 
    153 <!ENTITY ai-label.option.recommended "Incl. recommended rules: "> 
     153<!ENTITY ai-label.option.recommended "Rec. Rules: "> 
    154154 
    155155<!-- highlight options --> 
  • trunk/proto-14/chrome/locale/en-US/ai-sidebar.properties

    r246 r250  
    8282option.rule-levels.a        = A 
    8383 
    84 option.recommended-rules.yes = Yes 
    85 option.recommended-rules.no  = No 
     84option.recommended-rules.yes = Included 
     85option.recommended-rules.no  = Excluded 
  • trunk/proto-14/chrome/locale/en-US/options.dtd

    r228 r250  
    2222<!ENTITY label.ruleset.aria-strict "ARIA Strict"> 
    2323<!ENTITY label.ruleset.aria-transitional "ARIA Transitional"> 
    24 <!ENTITY label.ruleset.recommended-rules "Include recommended rules"> 
     24<!ENTITY label.ruleset.recommended-rules "Include &#8216;Recommended&#8217; rules"> 
    2525 
    26 <!ENTITY groupbox.caption.rule-levels "Rule Levels"> 
    27  
    28 <!ENTITY label.rule-levels.a-aa     "A, AA"> 
    29 <!ENTITY label.rule-levels.a        "A"> 
     26<!ENTITY groupbox.caption.ruleResults "Rule Results"> 
     27<!ENTITY label.results.pass-and-not-applicable "Include &#8216;Pass&#8217; and &#8216;N/A&#8217; results"> 
    3028 
    3129<!ENTITY groupbox.caption.otherOptions "Other Options"> 
    32  
    3330<!ENTITY label.options.page-layout  "Allow table markup for page layout"> 
  • trunk/proto-14/defaults/preferences/prefs.js

    r247 r250  
    99pref("extensions.ainspector.evaluation.ruleset", 2); 
    1010pref("extensions.ainspector.evaluation.recommendedRules", true); 
     11pref("extensions.ainspector.evaluation.passAndNotApplicable", false); 
    1112pref("extensions.ainspector.evaluation.layoutTables", false); 
    1213 
  • trunk/proto-14/install.rdf

    r247 r250  
    1010        <em:name>AInspector Sidebar</em:name> 
    1111        <em:type>2</em:type> 
    12         <em:version>0.14.3e</em:version> 
     12        <em:version>0.14.4</em:version> 
    1313 
    1414        <em:targetApplication> 
Note: See TracChangeset for help on using the changeset viewer.