Changeset 166


Ignore:
Timestamp:
04/30/13 22:45:28 (6 years ago)
Author:
nhoyt
Message:

Changed "parent.AIS" namespace to "parent.AINSPECTOR"

Location:
trunk/proto-13/chrome/content
Files:
5 edited

Legend:

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

    r165 r166  
    4040  ainspectorSidebar.clearCurrentView(); 
    4141  ainspectorSidebar.showProgressMeter(); 
    42   if (parent.AIS.currentView === ainspector.viewConst.DETAILS) 
    43     parent.AIS.currentView = parent.AIS.previousView; 
     42  if (parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS) 
     43    parent.AINSPECTOR.currentView = parent.AINSPECTOR.previousView; 
    4444}; 
    4545 
     
    7272ainspectorSidebar.init = function () { 
    7373  // set default value for view 
    74   if (parent.AIS.currentView === null) 
    75     parent.AIS.currentView = ainspector.viewEnum.SUMMARY; 
    76  
    77   if (parent.AIS.currentView === ainspector.viewConst.DETAILS) 
    78     parent.AIS.currentView = parent.AIS.previousView; 
     74  if (parent.AINSPECTOR.currentView === null) 
     75    parent.AINSPECTOR.currentView = ainspector.viewEnum.SUMMARY; 
     76 
     77  if (parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS) 
     78    parent.AINSPECTOR.currentView = parent.AINSPECTOR.previousView; 
    7979 
    8080  // instantiate progressListener 
     
    103103 
    104104  // register callback for tab selection 
    105   parent.AIS.updateContext = ainspectorSidebar.updateContext; 
     105  parent.AINSPECTOR.updateContext = ainspectorSidebar.updateContext; 
    106106 
    107107// instantiate and register PrefListener for preferences in evaluation branch. 
     
    210210 
    211211ainspectorSidebar.updateView = function () { 
    212   if (parent.AIS.currentView === null) return; 
    213   ainspector.logger.log.debug("updateView: " + ainspector.getViewName(parent.AIS.currentView)); 
    214  
    215   ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AIS.currentView); 
     212  if (parent.AINSPECTOR.currentView === null) return; 
     213  ainspector.logger.log.debug("updateView: " + ainspector.getViewName(parent.AINSPECTOR.currentView)); 
     214 
     215  ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AINSPECTOR.currentView); 
    216216 
    217217  var view = ainspector.viewEnum; 
    218   switch (parent.AIS.currentView) { 
     218  switch (parent.AINSPECTOR.currentView) { 
    219219    case view.SUMMARY: 
    220220      ainspectorSidebar.setSummaryView(); 
     
    244244  ainspector.logger.log.debug("selectView: " + ainspector.getViewName(viewConst)); 
    245245 
    246   if (parent.AIS.currentView === ainspector.viewConst.DETAILS && 
    247       viewConst === parent.AIS.previousView) { 
     246  if (parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS && 
     247      viewConst === parent.AINSPECTOR.previousView) { 
    248248    ainspectorSidebar.selectPreviousView(); 
    249249    return; 
    250250  } 
    251251 
    252   if (viewConst !== parent.AIS.currentView) { 
     252  if (viewConst !== parent.AINSPECTOR.currentView) { 
    253253    // Save the current view as previous view 
    254     parent.AIS.previousView = parent.AIS.currentView; 
     254    parent.AINSPECTOR.previousView = parent.AINSPECTOR.currentView; 
    255255 
    256256    // Uncheck the previously selected item 
    257     var menuitem = ainspectorSidebar.getViewsMenuitem(parent.AIS.currentView); 
     257    var menuitem = ainspectorSidebar.getViewsMenuitem(parent.AINSPECTOR.currentView); 
    258258    if (menuitem) menuitem.removeAttribute("checked"); 
    259259 
    260260    // Save the new selection and update the view 
    261     parent.AIS.currentView = viewConst; 
     261    parent.AINSPECTOR.currentView = viewConst; 
    262262    ainspectorSidebar.updateView(); 
    263263  } 
     
    278278ainspectorSidebar.selectPreviousView = function () { 
    279279  // update currentView 
    280   parent.AIS.currentView = parent.AIS.previousView; 
     280  parent.AINSPECTOR.currentView = parent.AINSPECTOR.previousView; 
    281281 
    282282  // update viewTitle 
    283   ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AIS.currentView); 
     283  ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AINSPECTOR.currentView); 
    284284 
    285285  // select rule category template 
     
    296296 
    297297ainspectorSidebar.clearCurrentView = function () { 
    298   if (parent.AIS.currentView === null) return; 
     298  if (parent.AINSPECTOR.currentView === null) return; 
    299299 
    300300  var view = ainspector.viewEnum; 
    301   switch (parent.AIS.currentView) { 
     301  switch (parent.AINSPECTOR.currentView) { 
    302302    case view.SUMMARY: 
    303303      ainspectorSidebar.clearSummaryView(); 
     
    365365 
    366366  // unregister callback for tab selection 
    367   parent.AIS.updateContext = null; 
     367  parent.AINSPECTOR.updateContext = null; 
    368368}; 
    369369 
  • trunk/proto-13/chrome/content/ff-overlay.js

    r165 r166  
    5757 
    5858// create namespace in parent window context 
    59 parent.AIS = { 
     59parent.AINSPECTOR = { 
    6060  currentView: null, 
    6161  previousView: null, 
     
    104104 * @function isSidebarVisible 
    105105 * 
    106  * @memberOf parent.AIS 
     106 * @memberOf parent.AINSPECTOR 
    107107 * 
    108108 * @desc Helper function used by closeSidebarIfOpen. 
    109109 */ 
    110110 
    111 parent.AIS.isSidebarVisible = function () { 
     111parent.AINSPECTOR.isSidebarVisible = function () { 
    112112  var sidebarUrl = "chrome://ai-sidebar/content/ai-sidebar.xul"; 
    113113  var sidebarWindow = document.getElementById("sidebar").contentWindow; 
     
    123123 */ 
    124124 
    125 parent.AIS.onTabSelect = function () { 
    126   var isVisible = parent.AIS.isSidebarVisible(); 
     125parent.AINSPECTOR.onTabSelect = function () { 
     126  var isVisible = parent.AINSPECTOR.isSidebarVisible(); 
    127127  var shouldBeVisible = parent.gBrowser.selectedTab.getAttribute(ainspector.tabAttrName) == "true"; 
    128128 
    129   if (parent.AIS.currentView === ainspector.viewConst.DETAILS) 
    130     parent.AIS.currentView = parent.AIS.previousView; 
     129  if (parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS) 
     130    parent.AINSPECTOR.currentView = parent.AINSPECTOR.previousView; 
    131131 
    132132  if ((!isVisible && shouldBeVisible) || (isVisible && !shouldBeVisible)) 
    133133    parent.toggleSidebar('ainspector-view-sidebar'); 
    134134  else 
    135     if (isVisible && parent.AIS.updateContext) parent.AIS.updateContext(); 
     135    if (isVisible && parent.AINSPECTOR.updateContext) parent.AINSPECTOR.updateContext(); 
    136136}; 
    137137 
     
    145145 
    146146ainspector.closeSidebarIfOpen = function () { 
    147   if (parent.AIS.startup && parent.AIS.isSidebarVisible()) { 
    148     parent.AIS.startup = false; 
    149     var elapsed = Date.now() - parent.AIS.startTime; 
     147  if (parent.AINSPECTOR.startup && parent.AINSPECTOR.isSidebarVisible()) { 
     148    parent.AINSPECTOR.startup = false; 
     149    var elapsed = Date.now() - parent.AINSPECTOR.startTime; 
    150150    ainspector.logger.log.info("Elapsed time at startup: " + elapsed); 
    151151    toggleSidebar('ainspector-view-sidebar'); 
     
    175175 
    176176  // respond to tab selections 
    177   parent.gBrowser.tabContainer.addEventListener("TabSelect", parent.AIS.onTabSelect, false); 
     177  parent.gBrowser.tabContainer.addEventListener("TabSelect", parent.AINSPECTOR.onTabSelect, false); 
    178178 
    179179  // when new browser window opens... 
    180   parent.AIS.startTime = Date.now(); 
     180  parent.AINSPECTOR.startTime = Date.now(); 
    181181  for (var mult = 1; mult <= 4; mult++) setTimeout(ainspector.closeSidebarIfOpen, 150 * mult); 
    182182}; 
  • trunk/proto-13/chrome/content/view-category.js

    r165 r166  
    4848 
    4949ainspectorSidebar.getRulesData = function () { 
    50   var filteredRuleResults = ainspectorSidebar.ruleGroupResults[parent.AIS.currentView].filtered_rule_results; 
     50  var filteredRuleResults = ainspectorSidebar.ruleGroupResults[parent.AINSPECTOR.currentView].filtered_rule_results; 
    5151  var resultsCount = filteredRuleResults.length; 
    5252  var table = []; 
     
    247247 
    248248  // update summary grid 
    249   summary.setData(ainspectorSidebar.getSummaryData(parent.AIS.currentView)); 
     249  summary.setData(ainspectorSidebar.getSummaryData(parent.AINSPECTOR.currentView)); 
    250250 
    251251  // update rule results tree 
  • trunk/proto-13/chrome/content/view-details.js

    r165 r166  
    2727  // construct and set view title 
    2828  var titleSuffix = ainspectorSidebar.nlsProperties.getString('view.title.details-suffix'); 
    29   ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AIS.previousView) + titleSuffix; 
     29  ainspectorSidebar.viewTitle.value = ainspectorSidebar.getViewTitle(parent.AINSPECTOR.previousView) + titleSuffix; 
    3030 
    3131  // get prefix labels for rule info 
  • trunk/proto-13/chrome/content/views-button.js

    r165 r166  
    136136 
    137137ainspectorSidebar.setViewsMenu = function () { 
    138   var menuitem = parent.AIS.currentView === ainspector.viewConst.DETAILS ? 
    139     ainspectorSidebar.getViewsMenuitem(parent.AIS.previousView) : 
    140     ainspectorSidebar.getViewsMenuitem(parent.AIS.currentView); 
     138  var menuitem = parent.AINSPECTOR.currentView === ainspector.viewConst.DETAILS ? 
     139    ainspectorSidebar.getViewsMenuitem(parent.AINSPECTOR.previousView) : 
     140    ainspectorSidebar.getViewsMenuitem(parent.AINSPECTOR.currentView); 
    141141  if (menuitem) menuitem.setAttribute("checked", "true"); 
    142142  ainspectorSidebar.setViewsMenuOptions(); 
Note: See TracChangeset for help on using the changeset viewer.