Changeset 180


Ignore:
Timestamp:
05/16/13 18:34:10 (6 years ago)
Author:
nhoyt
Message:

ai-context.js

  • moved code for getting ruleset name to ai-sidebar.js; added fn. call getRulesetName

ai-sidebar.js

  • added fn. getRulesetName

view-details.js

  • added Rule Information section: COMPLIANCE and associated labels

ai-sidebar.properties

  • added strings needed for COMPLIANCE section

ai-sidebar.css

  • Firefox 21 changed default styling of labels with class text-link: added text-decoration: underline
Location:
trunk/proto-13/chrome
Files:
5 edited

Legend:

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

    r165 r180  
    1414  var nls = ainspectorSidebar.nlsProperties; 
    1515 
    16   var rulesetOption  = ainspector.evaluationPrefs.getPref('ruleset'); 
     16  // set the Ruleset value 
     17  document.getElementById('ainspector-option-ruleset').value = ainspectorSidebar.getRulesetName(); 
     18 
     19  // set the Level value 
    1720  var levelsOption   = ainspector.evaluationPrefs.getPref('ruleLevels'); 
    18   var recRulesOption = ainspector.evaluationPrefs.getPref('recommendedRules'); 
    19  
    20   var rulesetValue = ''; 
    2121  var levelsValue = ''; 
    2222 
    23   // set the Ruleset value 
    24   switch (rulesetOption) { 
    25   case 1: 
    26     rulesetValue = nls.getString('option.ruleset.aria-transitional'); 
    27     break; 
    28   case 2: 
    29     rulesetValue = nls.getString('option.ruleset.aria-strict'); 
    30     break; 
    31   default: 
    32     break; 
    33   } 
    34   document.getElementById('ainspector-option-ruleset').value = rulesetValue; 
    35  
    36   // set the Level value 
    3723  switch (levelsOption) { 
    3824  case OpenAjax.a11y.EVALUATION_LEVELS.A_AA_AAA: 
     
    5137 
    5238  // set the Recommended Rules value 
     39  var recRulesOption = ainspector.evaluationPrefs.getPref('recommendedRules'); 
     40 
    5341  document.getElementById('ainspector-option-recommended-rules').value = recRulesOption ? 
    5442    nls.getString('option.recommended-rules.yes') : 
  • trunk/proto-13/chrome/content/ai-sidebar.js

    r179 r180  
    211211 
    212212/** 
     213 * @function getRulesetName 
     214 * 
     215 * @memberOf ainspectorSidebar 
     216 * 
     217 * @desc Return name of ruleset based on current preferences setting. 
     218 */ 
     219 
     220ainspectorSidebar.getRulesetName = function () { 
     221  var nls = ainspectorSidebar.nlsProperties; 
     222  var prefValue  = ainspector.evaluationPrefs.getPref('ruleset'); 
     223  var rulesetName = ''; 
     224 
     225  switch (prefValue) { 
     226  case 1: 
     227    rulesetName = nls.getString('option.ruleset.aria-transitional'); 
     228    break; 
     229  case 2: 
     230    rulesetName = nls.getString('option.ruleset.aria-strict'); 
     231    break; 
     232  default: 
     233    break; 
     234  } 
     235 
     236  return rulesetName; 
     237}; 
     238 
     239/** 
    213240 * @function updateView 
    214241 * 
  • trunk/proto-13/chrome/content/view-details.js

    r178 r180  
    109109    SUMMARY:         nls.getString("info.summary"), 
    110110    DEFINITION:      nls.getString("info.definition"), 
     111    COMPLIANCE:      nls.getString("info.compliance"), 
     112    WCAG_LEVEL:      nls.getString("info.wcag-level"), 
    111113    TARGET_ELEMENTS: nls.getString("info.target-elements"), 
    112114    RESULT:          nls.getString("info.result"), 
     
    114116    TECHNIQUES:      nls.getString("info.techniques"), 
    115117    WCAG_SC:         nls.getString("info.wcag-sc"), 
    116     INFO_LINKS:      nls.getString("info.info-links") 
     118    INFO_LINKS:      nls.getString("info.info-links"), 
     119    REQUIRED:        nls.getString("info.required"), 
     120    RECOMMENDED:     nls.getString("info.recommended"), 
     121 
     122    ARIA_STRICT:     nls.getString("option.ruleset.aria-strict"), 
     123    ARIA_TRANS:      nls.getString("option.ruleset.aria-transitional") 
    117124  } 
    118125}; 
     
    173180  var labels = ainspectorSidebar.getRuleInfoLabels(); 
    174181 
     182  var ruleType = ruleResult.isRuleRequired() ? labels.REQUIRED : labels.RECOMMENDED; 
     183 
    175184  // Definition 
    176185  h2 = getHTML("h2", labels.DEFINITION, h2FirstStyle); 
    177186  vbox.appendChild(h2); 
    178187  p = getHTML("p", ruleResult.getRuleDefinition(), pStyle); 
     188  vbox.appendChild(p); 
     189 
     190  // Compliance 
     191  h2 = getHTML("h2", labels.COMPLIANCE, h2Style); 
     192  vbox.appendChild(h2); 
     193  p = getHTML("p", labels.WCAG_LEVEL + ruleResult.getWCAG20Level() + "; " + 
     194              ainspectorSidebar.getRulesetName() + ": " + ruleType, pStyle); 
    179195  vbox.appendChild(p); 
    180196 
  • trunk/proto-13/chrome/locale/en-US/ai-sidebar.properties

    r175 r180  
    2727view.title.details-suffix = \u0020Rule 
    2828 
     29info.compliance      = COMPLIANCE 
     30info.definition      = DEFINITION 
     31info.noSelection     = nothing selected 
     32info.purpose         = PURPOSE 
     33info.recommended     = Recommended 
     34info.required        = Required 
     35info.result          = RESULT 
    2936info.summary         = SUMMARY 
    30 info.result          = RESULT 
    3137info.target-elements = TARGET ELEMENTS 
    32 info.definition      = DEFINITION 
    33 info.purpose         = PURPOSE 
    3438info.techniques      = TECHNIQUES 
     39info.info-links      = ADDITIONAL INFO 
     40info.wcag-level      = WCAG 2.0 Level\u0020 
    3541info.wcag-sc         = WCAG SUCCESS CRITERIA 
    36 info.info-links      = ADDITIONAL INFO 
    37 info.noSelection     = nothing selected 
    3842 
    3943rule.level.a*  = A* 
  • trunk/proto-13/chrome/skin/ai-sidebar.css

    r175 r180  
    9393  min-width: 148px; 
    9494  text-align: left; 
     95  text-decoration: underline; 
    9596} 
    9697 
Note: See TracChangeset for help on using the changeset viewer.