Changeset 164


Ignore:
Timestamp:
04/29/13 22:13:22 (6 years ago)
Author:
nhoyt
Message:

Added use of NLS property strings and comments to view-details.js.

Location:
trunk/proto-13/chrome
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/proto-13/chrome/content/view-details.js

    r163 r164  
    1212var ainspectorSidebar = ainspectorSidebar || {}; 
    1313 
     14/** 
     15 * @function setDetailsView 
     16 * 
     17 * @memberOf ainspectorSidebar 
     18 * 
     19 * @desc  
     20 */ 
     21 
    1422ainspectorSidebar.setDetailsView = function () { 
    1523  // get selection index 
    1624  var tree = ainspectorSidebar.ruleCategoryTree; 
    1725  var index = tree.currentIndex; 
    18   var isRowSelected = tree.view.selection.isSelected(index); 
    1926 
    2027  // construct and set view title 
    21   var suffix = ainspectorSidebar.nlsProperties.getString('view.title.details-suffix'); 
    22   ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AIS.previousView) + suffix; 
     28  var titleSuffix = ainspectorSidebar.nlsProperties.getString('view.title.details-suffix'); 
     29  ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AIS.previousView) + titleSuffix; 
     30 
     31  // get prefix labels for rule info 
     32  var labels = ainspectorSidebar.getRuleInfoLabels(); 
    2333 
    2434  // get selected rule info 
    2535  var ruleResult = ainspectorSidebar.rulesTable[index].filteredResult; 
    2636  var textbox = document.getElementById("ai-rule-details"); 
    27   textbox.value = "DEFINITION: " + ruleResult.getRuleDefinition() + 
    28     "\n\nTARGET RESOURCES: " + ruleResult.getTargetResources().join(", ") + 
    29     "\n\nRESULT: " + ruleResult.getResultMessage(); 
     37  textbox.value = labels.DEFINITION + ruleResult.getRuleDefinition() + 
     38    "\n\n" + labels.TARGET_ELEMENTS + ruleResult.getTargetResources().join(", ") + 
     39    "\n\n" + labels.RESULT + ruleResult.getResultMessage(); 
    3040 
    3141  // select rule details template 
     
    3343}; 
    3444 
     45/** 
     46 * @function clearDetailsView 
     47 * 
     48 * @memberOf ainspectorSidebar 
     49 * 
     50 * @desc  
     51 */ 
     52 
    3553ainspectorSidebar.clearDetailsView = function () { 
    3654  var textbox = document.getElementById("ai-rule-details"); 
    3755  textbox.value = ''; 
    3856}; 
     57 
     58/** 
     59 * @function getRuleInfoLabels 
     60 * 
     61 * @memberOf ainspectorSidebar 
     62 * 
     63 * @desc  
     64 */ 
     65 
     66ainspectorSidebar.getRuleInfoLabels = function () { 
     67  var nls = ainspectorSidebar.nlsProperties; 
     68  return { 
     69    DEFINITION:      nls.getString("info.definition"), 
     70    TARGET_ELEMENTS: nls.getString("info.target-elements"), 
     71    RESULT:          nls.getString("info.result") 
     72  } 
     73}; 
  • trunk/proto-13/chrome/locale/en-US/ai-sidebar.properties

    r163 r164  
    2727view.title.details-suffix = \u0020Rule 
    2828 
    29 info.definition  = DEFINITION:\u0020 
    30 info.result      = RESULT:\u0020 
    31 info.noSelection = nothing selected 
     29info.definition      = DEFINITION:\u0020 
     30info.target-elements = TARGET ELEMENTS:\u0020 
     31info.result          = RESULT:\u0020 
     32info.noSelection     = nothing selected 
    3233 
    3334rule.level.a*  = A* 
Note: See TracChangeset for help on using the changeset viewer.