Changeset 172


Ignore:
Timestamp:
05/11/13 00:02:29 (6 years ago)
Author:
nhoyt
Message:

ai-common.js

  • Added styling objects used by new utilities fn. createXHTMLElement.

view-category.js

  • Changed over to using XHTML to style content of Selected Rule vbox.

view-category.xul

  • Changed textbox to vbox in order to utilize XHTML content.

view-details.js

  • Changed over to using XHTML to style content of top vbox and Rule Information vbox.

view-details.xul

  • Changed textbox to vbox in order to utilize XHTML content.

ai-sidebar.properties

  • Added info.* properties.

ai-sidebar.css

  • Added vbox styling for ainspector-selected-rule, ainspector-rule-details and ainspector-details-rule-info.

install.rdf

  • Changed version to 0.1.13-02
Location:
trunk/proto-13
Files:
8 edited

Legend:

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

    r169 r172  
    4848    warn:    '--', 
    4949    mc:      '--' 
    50   } 
     50  }, 
     51 
     52  // XHTML styling objects 
     53  h2FirstStyle: { "style": "margin: 0; margin-top: 0; font-size: inherit; font-weight: bold" }, 
     54  h2Style:      { "style": "margin: 0; margin-top: 1em; font-size: inherit; font-weight: bold" }, 
     55  pStyle:       { "style": "margin: 0" }, 
     56  ulStyle:      { "style": "margin: 0; padding: 0; padding-left: 2em" } 
    5157}; 
  • trunk/proto-13/chrome/content/view-category.js

    r169 r172  
    295295  var isRowSelected = tree.view.selection.isSelected(index); 
    296296  var nls = ainspectorSidebar.nlsProperties; 
    297   var textbox = ainspectorSidebar.selectedRule; 
     297  var getHTML  = OAA_WEB_ACCESSIBILITY_UTILS.createXHTMLElement; 
     298  var clearContent = OAA_WEB_ACCESSIBILITY_UTILS.removeChildNodes; 
     299 
     300  var h2, p; 
     301  var h2FirstStyle = ainspector.h2FirstStyle; 
     302  var h2Style = ainspector.h2Style; 
     303  var pStyle  = ainspector.pStyle; 
     304  var vbox = ainspectorSidebar.selectedRule; 
    298305 
    299306  // set state of Rule Details button 
    300307  document.getElementById("ainspector-rule-details-button").disabled = !isRowSelected; 
    301308 
    302   // specify text for Selected Rule textbox 
    303   textbox.value = isRowSelected ? 
    304     nls.getString('info.definition') + ainspectorSidebar.rulesTable[index].filteredResult.getRuleDefinition() + 
    305     "\n\n" + nls.getString('info.result') + ainspectorSidebar.rulesTable[index].filteredResult.getResultMessage() : 
    306     nls.getString('info.noSelection'); 
    307 }; 
     309  // specify text for Selected Rule vbox 
     310  clearContent(vbox); 
     311 
     312  if (isRowSelected) { 
     313    h2 = getHTML("h2", nls.getString('info.definition'), h2FirstStyle); 
     314    vbox.appendChild(h2); 
     315    p = getHTML("p", ainspectorSidebar.rulesTable[index].filteredResult.getRuleDefinition(), pStyle); 
     316    vbox.appendChild(p); 
     317 
     318    h2 = getHTML("h2", nls.getString('info.result'), h2Style); 
     319    vbox.appendChild(h2); 
     320    p = getHTML("p", ainspectorSidebar.rulesTable[index].filteredResult.getResultMessage(), pStyle); 
     321    vbox.appendChild(p); 
     322  } 
     323  else { 
     324    p = getHTML("p", nls.getString('info.noSelection'), pStyle); 
     325    vbox.appendChild(p); 
     326  } 
     327}; 
  • trunk/proto-13/chrome/content/view-category.xul

    r168 r172  
    122122        <label class="header-label" value="&ai-label.selectedRule;"/> 
    123123      </hbox> 
    124       <hbox> 
    125         <textbox id="ainspector-selected-rule" 
    126           flex="4" multiline="true" readonly="true" 
    127           rows="4" value="&ai-label.noSelection;"/> 
    128       </hbox> 
    129124    </vbox> 
    130125 
     126    <vbox id="ainspector-selected-rule" 
     127      width="360" height="108" 
     128      style="overflow-y: scroll; border: solid lightgray thin; background-color: white; margin: 0; margin-left: 4px; margin-right: 4px; padding: 4px;"/> 
    131129    <spacer height="4"/> 
    132130 
  • trunk/proto-13/chrome/content/view-details.js

    r166 r172  
    2525  var index = tree.currentIndex; 
    2626 
     27  var getHTML  = OAA_WEB_ACCESSIBILITY_UTILS.createXHTMLElement; 
     28  var clearContent = OAA_WEB_ACCESSIBILITY_UTILS.removeChildNodes; 
     29  var h2, p, ul, li; 
     30  var h2FirstStyle = ainspector.h2FirstStyle; 
     31  var h2Style = ainspector.h2Style; 
     32  var pStyle  = ainspector.pStyle; 
     33  var ulStyle = ainspector.ulStyle; 
     34 
    2735  // construct and set view title 
    2836  var titleSuffix = ainspectorSidebar.nlsProperties.getString('view.title.details-suffix'); 
     
    3442  // get selected rule info 
    3543  var ruleResult = ainspectorSidebar.rulesTable[index].filteredResult; 
    36   var textbox = document.getElementById("ainspector-rule-details"); 
    37   textbox.value = labels.DEFINITION + ruleResult.getRuleDefinition() + 
    38     "\n\n" + labels.TARGET_ELEMENTS + ruleResult.getTargetResources().join(", ") + 
    39     "\n\n" + labels.RESULT + ruleResult.getResultMessage(); 
     44 
     45  // set the vbox XHTML content 
     46  var vbox1 = document.getElementById("ainspector-rule-details"); 
     47  clearContent(vbox1); 
     48 
     49  h2 = getHTML("h2", labels.SUMMARY, h2FirstStyle); 
     50  vbox1.appendChild(h2); 
     51  p = getHTML("p", ruleResult.getRuleSummary(), pStyle); 
     52  vbox1.appendChild(p); 
     53 
     54  h2 = getHTML("h2", labels.RESULT, h2Style); 
     55  vbox1.appendChild(h2); 
     56  p = getHTML("p", ruleResult.getResultMessage(), pStyle); 
     57  vbox1.appendChild(p); 
     58 
     59  // set the Rule Information panel XHTML content 
     60  var vbox2 = document.getElementById("ainspector-details-rule-info"); 
     61  clearContent(vbox2); 
     62 
     63  h2 = getHTML("h2", labels.DEFINITION, h2FirstStyle); 
     64  vbox2.appendChild(h2); 
     65  p = getHTML("p", ruleResult.getRuleDefinition(), pStyle); 
     66  vbox2.appendChild(p); 
     67 
     68  h2 = getHTML("h2", labels.PURPOSE, h2Style); 
     69  vbox2.appendChild(h2); 
     70  p = getHTML("p", ruleResult.getPurpose(), pStyle); 
     71  vbox2.appendChild(p); 
     72 
     73  h2 = getHTML("h2", labels.TECHNIQUES, h2Style); 
     74  vbox2.appendChild(h2); 
     75 
     76  ul = getHTML("ul", null, ulStyle); 
     77  var techniques = ruleResult.getTechniques(); 
     78  for (var i = 0; i < techniques.length; i++) { 
     79    li = getHTML("li", techniques[i], null); 
     80    ul.appendChild(li) 
     81  } 
     82  vbox2.appendChild(ul); 
     83 
     84  h2 = getHTML("h2", labels.TARGET_ELEMENTS, h2Style); 
     85  vbox2.appendChild(h2); 
     86  p = getHTML("p", ruleResult.getTargetResources().join(", "), pStyle); 
     87  vbox2.appendChild(p); 
    4088 
    4189  // select rule details template 
     
    4896 * @memberOf ainspectorSidebar 
    4997 * 
    50  * @desc  
     98 * @desc Clear data from all of the associated widgets, containers, trees. 
    5199 */ 
    52100 
    53101ainspectorSidebar.clearDetailsView = function () { 
    54   var textbox = document.getElementById("ainspector-rule-details"); 
    55   textbox.value = ''; 
     102  var vbox1 = document.getElementById("ainspector-rule-details"); 
     103  clearContent(vbox1); 
     104 
     105  var vbox2 = document.getElementById("ainspector-details-rule-info"); 
     106  clearContent(vbox2); 
    56107}; 
    57108 
     
    67118  var nls = ainspectorSidebar.nlsProperties; 
    68119  return { 
     120    SUMMARY:         nls.getString("info.summary"), 
    69121    DEFINITION:      nls.getString("info.definition"), 
    70122    TARGET_ELEMENTS: nls.getString("info.target-elements"), 
    71     RESULT:          nls.getString("info.result") 
     123    RESULT:          nls.getString("info.result"), 
     124    PURPOSE:         nls.getString("info.purpose"), 
     125    TECHNIQUES:      nls.getString("info.techniques") 
    72126  } 
    73127}; 
  • trunk/proto-13/chrome/content/view-details.xul

    r169 r172  
    1010  <vbox id="ainspector-details-view"> 
    1111 
    12     <vbox> 
    13       <hbox> 
    14         <textbox id="ainspector-rule-details" 
    15           flex="4" rows="6" 
    16           multiline="true" 
    17           readonly="true"/> 
    18       </hbox> 
    19     </vbox> 
     12    <spacer height="8"/> 
    2013 
    21     <spacer height="8"/> 
     14    <vbox id="ainspector-rule-details" 
     15      width="360" height="108"/> 
     16 
     17    <spacer height="12"/> 
    2218 
    2319    <tabbox id="ainspector-details-tabbox" persist="selectedIndex label"> 
     
    2723      </tabs> 
    2824      <tabpanels style="padding: 16px 0px 0px"> 
    29         <tabpanel height="287" style="background: white"> 
     25        <tabpanel height="303" style="padding: 0; background: white"> 
    3026          <vbox id="ainspector-details-elements"/> 
    3127        </tabpanel> 
    32         <tabpanel> 
    33           <vbox id="ainspector-details-rule-info"/> 
     28        <tabpanel height="303" style="background: white"> 
     29          <vbox id="ainspector-details-rule-info" 
     30            width="381"/> 
    3431        </tabpanel> 
    3532      </tabpanels> 
  • trunk/proto-13/chrome/locale/en-US/ai-sidebar.properties

    r168 r172  
    2727view.title.details-suffix = \u0020Rule 
    2828 
    29 info.definition      = DEFINITION:\u0020 
    30 info.target-elements = TARGET ELEMENTS:\u0020 
    31 info.result          = RESULT:\u0020 
     29info.summary         = SUMMARY 
     30info.result          = RESULT 
     31info.target-elements = TARGET ELEMENTS 
     32info.definition      = DEFINITION 
     33info.purpose         = PURPOSE 
     34info.techniques      = TECHNIQUES 
     35info.criteria        = WCAG 2.0 SUCCESS CRITERIA 
     36info.links           = INFORMATIONAL LINKS 
    3237info.noSelection     = nothing selected 
    3338 
  • trunk/proto-13/chrome/skin/ai-sidebar.css

    r165 r172  
    9595} 
    9696 
     97/* miscellaneous */ 
     98 
    9799tabpanel { 
    98100  border-right: 1px solid #bbb; 
     
    100102  border-left: 1px solid #bbb; 
    101103} 
     104 
     105vbox#ainspector-selected-rule, 
     106vbox#ainspector-rule-details { 
     107  overflow-y: scroll; 
     108  border: 1px solid #bbb; 
     109  background-color: white; 
     110  margin: 0; 
     111  margin-left: 4px; 
     112  margin-right: 4px; 
     113  padding: 4px; 
     114} 
     115 
     116vbox#ainspector-details-rule-info { 
     117  overflow-y: scroll; 
     118  border-top: 1px solid #bbb; 
     119  background-color: white; 
     120  margin: 0; 
     121  padding: 4px; 
     122} 
  • trunk/proto-13/install.rdf

    r170 r172  
    1010        <em:name>AInspector Sidebar</em:name> 
    1111        <em:type>2</em:type> 
    12         <em:version>0.1.13-01</em:version> 
     12        <em:version>0.1.13-02</em:version> 
    1313 
    1414        <em:targetApplication> 
Note: See TracChangeset for help on using the changeset viewer.