Changeset 186


Ignore:
Timestamp:
06/05/13 02:01:18 (6 years ago)
Author:
nhoyt
Message:

tree-view.js

  • New file that defines TreeView? constructor and prototype.

view-category.js

view-details.js

install.rdf

  • Changed version number to 0.1.13-03
Location:
trunk/proto-13
Files:
1 added
3 edited

Legend:

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

    r181 r186  
    1212var ainspectorSidebar = ainspectorSidebar || {}; 
    1313 
     14// Load the TreeView definition 
     15Components.classes["@mozilla.org/moz/jssubscript-loader;1"] 
     16  .getService(Components.interfaces.mozIJSSubScriptLoader) 
     17  .loadSubScript("chrome://ai-sidebar/content/tree-view.js", ainspectorSidebar); 
     18 
     19// Load the DOM functions 
    1420Components.classes["@mozilla.org/moz/jssubscript-loader;1"] 
    1521  .getService(Components.interfaces.mozIJSSubScriptLoader) 
     
    8086 * @memberOf ainspectorSidebar 
    8187 * 
    82  * @desc  
     88 * @augments TreeView (inherits from its prototype) 
     89 * 
     90 * @desc Define property rowCount and methods getCellText, getCellValue and 
     91 *       getCellProperties. Inherit all other methods from TreeView object. 
    8392 */ 
    8493 
    8594ainspectorSidebar.TreeViewCategory = function (table) { 
     95  // call the TreeView constructor (not strictly necessary for stub fn.) 
     96  // ainspectorSidebar.TreeView.call(this); 
     97 
    8698  var resultStrings = ainspectorSidebar.getRuleResultStrings(); 
    8799 
     100  // define properties and methods specific to this constructor 
    88101  this.rowCount = table.length; 
    89102 
     
    118131 
    119132  this.getCellValue = function (row, col) { return table[row][col.id]; }; 
    120   this.setTree = function (treebox) { this.treebox = treebox; }; 
    121   this.isEditable = function (row, col) { return col.editable;  }; 
    122   this.isContainer = function (row) { return false; }; 
    123   this.isSeparator = function (row) { return false; }; 
    124   this.isSorted = function () { return false; }; 
    125   this.getLevel = function (row) { return 0; }; 
    126   this.getImageSrc = function (row, col) { return null; }; 
    127   this.getRowProperties = function (row, props) {}; 
     133 
    128134  this.getCellProperties = function (row, col, props) { 
    129135    if (col.id === "ainspector-level-col" || col.id === "ainspector-required-col") { 
     
    138144    } 
    139145  }; 
    140   this.getColumnProperties = function (colid, col, props) {}; 
    141   this.cycleHeader = function (col, elem) {}; 
    142 }; 
     146}; 
     147 
     148// Inherit the TreeView methods by setting the prototype property. 
     149// Note: In this particular case, the value for the prototype property is 
     150// an object created from another prototype object, which is the safe way of 
     151// inheriting (prototypal inheritance). Using an object literal with its own 
     152// instance properties as a prototype can cause unexpected side effects. 
     153 
     154ainspectorSidebar.TreeViewCategory.prototype = Object.create(ainspectorSidebar.TreeView.prototype); 
     155 
     156// The constructor property is used mainly for introspection, so not absolutely necessary to reset. 
     157// ainspectorSidebar.TreeViewCategory.prototype.constructor = ainspectorSidebar.TreeViewCategory; 
     158 
     159// An alternate way of setting prototype property, but involves unnecessary constructor call. 
     160// ainspectorSidebar.TreeViewCategory.prototype = new ainspectorSidebar.TreeView(); 
    143161 
    144162/** 
  • trunk/proto-13/chrome/content/view-details.js

    r182 r186  
    267267  for (var k = 0; k < infoLinks.length; k++) { 
    268268    li = getHTML("li", null, null); 
    269     a = getHTML("a", infoLinks[k].label, { 
     269    a = getHTML("a", infoLinks[k].title, { 
    270270      "href": infoLinks[k].url, 
    271271      "target": "_blank", 
  • trunk/proto-13/install.rdf

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