--- books/www/corrections.html 2003/03/13 17:16:39 1.86 +++ books/www/corrections.html 2003/03/23 18:54:49 1.104 @@ -1,6 +1,6 @@

Corrections @@ -12,7 +12,7 @@ section on the chapter pages, or send a href="mailto:reviewers@mozdev.org">reviewers@mozdev.org mailing list.

Note: All errors in the text and examples are shown in red and all corrections are shown in green. +class="fixed">blue.

Preface @@ -83,9 +83,17 @@ changed to 'selecting F to 'CenterWindowOnScreen( ) function'

  • On page 25: 'Under that directory, create the three new directories, content, locale, and skin, as -shown in Figure 2-5.' has been changed to 'Under that directory, create the three new directories, content, +shown in Figure 2-5.' has been changed to 'Under that directory, create the three new directories, content, locale, and skin, as shown in Figure 2-5. The locale directory will have the default 'en-US' language pack -structure.'

    +structure.
    '

    + +
  • On page 25: There is 1 error in Figure 2-5 ...

    + +1) The locale folder should have an en-US subfolder.

    + +Here is a correct image (Click for bigger version):

    + +New Figure 2-5
  • On page 31: In Example 2-14 'locale/' has been changed to 'locale/en-US/'

    @@ -106,6 +114,16 @@ to 'We've packed a lot
  • On page 35: 'secondLevelNodes[I] = docEl.childNodes[i];' has been changed to 'secondLevelNodes[I] = docEl.childNodes[I];'

    +
  • On page 38: In Example 3-3 the namespace declarations have been changed to (note the addition of quotes and the removal of italics) + + + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:nc="http://home.netscape.com/NC-rdf#"> + + +
  • On page 38: In Example 3-3 '<image src="page1.png">' has been changed to '<image +src="page1.png"/>'

    +
  • On page 40: '<toolbarbutton id="printBtn" label="Open" oncommand="doPrint( );" />' has been changed to '<toolbarbutton id="printBtn" label="Print" oncommand="doPrint( );" >'

    @@ -113,6 +131,9 @@ id="printBtn" label="Print" oncommand="d
  • On page 51: '<decription>The mozdev.org site [...] your own development project</decription>' has been changed to '<description>The mozdev.org site [...] your own development project</description>'

    +
  • On page 54: 'Clicking on the box sets the clicked attribute' has been +changed to 'Clicking on the box sets the checked attribute'

    +
  • On pages 58 and 59: Example 3-15 has been changed to (note the addition of spaces to seperate values) @@ -140,6 +161,11 @@ changed to '<b class="fixed">&lt;descrip </window> +
  • On page 63: 'But there are also CSS versions of these properties that +use the prefix box-pack becomes box-pack when it's defined in CSS, for example.' has been +changed to 'But there are also CSS versions of these properties that +use the prefix box-. pack becomes box-pack when it's defined in CSS, for example.'

    + @@ -151,8 +177,8 @@ changed to '<descrip
  • On page 88: 'these are selectors are identical' has been changed to 'these selectors are identical'

    -
  • On page 109: 'The chome URL that the -moz-binding property points to' has been changed to 'The chrome URL that the -moz-binding property points to'

    +
  • On page 109: 'The chome URL that the -moz-binding property points to' has been changed to 'The chrome URL that the -moz-binding property points to'

    @@ -173,9 +199,25 @@ class="fixed">The chrome URL that the -m
  • On page 120: 'dump(l+'\n');' has been changed to 'dump(len+'\n');'

  • -
  • On page 135: Example 5-11 has been changed to +
  • On page 123: Example 5-3 + +for (var i=0; i<chex.length; i++) + chex[i].setAttributte("checked", "false"); +for (var i=0; i<unchex.length; i++) + unchex[i].setAttributte("checked", "true"); + +has been changed to +for (var i=0; i<chex.length; i++) + chex[i].setAttribute("disabled", "false"); +for (var i=0; i<unchex.length; i++) + unchex[i].setAttribute("disabled", "true"); + +
    +
  • +
  • On page 135: Example 5-11 has been changed to + <head> <title>Sound Service Play Example</title> <script> @@ -196,7 +238,6 @@ class="fixed">The chrome URL that the -m <form name="form"> <input type="button" value="Play Sound" onclick="play();"> </form> -
  • On page 137: 'var connection = Components.classes ["@mozilla.org/network/ldap-connection;1";' @@ -215,7 +256,7 @@ load('chrome/jslib/jslib.js');'
    <
      -
    • On page 145: Example 6-1 has been changed to
      +
    • On page 145: Example 6-1 has been changed to var myFile = "xFly.jar"; @@ -240,45 +281,126 @@ else // otherwi </ul> +<a name="ch07"></a> +<p><b>Chapter 7</b> + +<ul> + +<li>On page 181: There are 3 errors in Figure 7-2 ...<br><br> + +1) In the XUL box, '<b class="broken">klabel="Input Field"</b>' should be '<b class="fixed">label="Input Field"</b>'<br><br> + +2) In the XBL box, '<b class="broken">&lt;binding id+"inputfield"&gt;</b>' should be '<b class="fixed">&lt;binding id="inputfield"&gt;</b>'<br><br> + +3) In the XBL box, '<b class="broken">&lt;xul:label xbl:inherits="value+label"?&gt;</b>' should be '<b class="fixed">&lt;xul:label xbl:inherits="value=label"/&gt;</b>'<br><br> + +Here is a correct image <b>(Click for bigger version)</b>:<br><br> + +<a href="http://books.mozdev.org/screenshots/moz_0702.gif"><img src="http://books.mozdev.org/screenshots/moz_0702_small.gif" alt="New Figure 7-2"></a> + +</li> + +</ul> + +</p> <a name="ch08"></a> <p><b>Chapter 8</b> <ul> -<li>On page 211: In 2nd sentence of paragraph '<b class="broken">QueryInterace</b>' has been changed to '<b -class="fixed">QueryInterface</b>'<br><br> +<li>On page 211: In 2nd sentence of paragraph '<b class="broken">QueryInterace</b>' has been +changed to '<b class="fixed">QueryInterface</b>'<br><br></li> -<li>On page 222: In Example 8-4 '<b class="broken">mName: "a default value"</b>' has been changed to '<b class="fixed">mName: "a default -value",</b>'<br><br> +<li>On page 222: In Example 8-4 has been changed to: -<li>On page 222: In Example 8-4 +<xmp class="fixed"> +function SimpleComponent(){} - <xmp class="broken"> - this.myCID, - "My JS Component", - this.myProgID, fileSpec, - location, true, true, - type); - +SimpleComponent.prototype = { -has been changed to + get yourName() { return this.mName; }, + set yourName(aName) { return this.mName = aName; }, - - compMgr.registerComponentWithType( - this.myCID, - "My JS Component", - this.myProgID, fileSpec, - location, true, true, - type); - + write: function () { dump("Hello " + this.mName + "\n"); }, + change: function (aValue) { this.mName = aValue; }, + mName: "a default value", + + QueryInterface: function (iid) { + if (!iid.equals(Components.interfaces.nsISimple) + && !iid.equals(Components.interfaces.nsISupports)) + { + throw Components.results.NS_ERROR_NO_INTERFACE; + } + return this; + } +} + +var Module = { + firstTime: true, + + registerSelf: function (compMgr, fileSpec, location, type) { + if (this.firstTime) { + dump("*** Deferring registration of simple JS components\n"); + this.firstTime = false; + throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN; + } + debug("*** Registering sample JS components\n"); + compMgr = +compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar); + compMgr.registerFactoryLocation(this.myCID, + "Simple JS Component", + this.myProgID, + fileSpec, + location, + type); + }, + + getClassObject : function (compMgr, cid, iid) { + if (!cid.equals(this.myCID)) + throw Components.results.NS_ERROR_NO_INTERFACE + if (!iid.equals(Components.interfaces.nsIFactory)) + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; + return this.myFactory; + }, + + myCID: Components.ID("{98aa9afd-8b08-415b-91ed-01916a130d16}"), + myProgID: "@mozilla.org/js_simple_component;1", + + myFactory: { + createInstance: function (outer, iid) { + dump("CI: " + iid + "\n"); + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + return (new SimpleComponent()).QueryInterface(iid); + } + }, + + canUnload: function(compMgr) { + dump("****** Unloading: Simple JS component! ****** \n"); + return true; + } +}; // END Module -
    • On page 222: In Example 8-4 one of the duplicate 'dump(" ***** Registering: Simple JS component! -****\n");' lines has been removed

      +function NSGetModule(compMgr, fileSpec) { return Module; } + +
    • -
    • On page 223: In Example 8-4 one of the duplicate 'if (outer != null)' lines has been removed

      +
    • On page 237: Example 8-13, line 9 + + NS_INIT_REFCNT( ); // has been depricated use NS_INIT_ISUPPORTS() + mValue = PL_strdup("default value"); + +has been changed to + + // NS_INIT_REFCNT( ); // has been depricated use NS_INIT_ISUPPORTS() + NS_INIT_ISUPPORTS(); + mValue = PL_strdup("default value"); + +
      +
    • -
    • On page 239: Example 8-15 has been changed to
      +
    • On page 239: Example 8-15 has been changed to
    • DEPTH = ../../.. @@ -406,16 +528,56 @@ href="http://certs.mozdev.org">http://ce <li>On page 365: '<b class="broken">http://www.mozilla.org/source.tml</b>' has been changed to '<b class="fixed">http://www.mozilla.org/source.html</b>'<br><br> +</li> -</ul> +<li>On page 367 and 368: CVS Instructions ... +<br/><br/> +Linux Instructions (p367)<br/> +<xmp class="broken"> +1. Set the CVSROOT variable: + $ setenv CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot +2. Log in as anonymous@cvs-mirror.mozilla.org using the password "anonymous": + +has been changed to (note the adding to '=' after CVSROOT, +the changing of 'setenv' to 'export', +and the simplification of instruction 2) + + +1. Set the CVSROOT variable: + $ export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot +2. Log in using the password "anonymous": + + +

      +Windows Instructions (p368)
      + +1. Set the CVSROOT variable: + > set CVSROOT :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot +2. Log in as anonymous@cvs-mirror.mozilla.org using the password "anonymous": + + +has been changed to (note the adding to '=' after CVSROOT, +and the simplification of instruction 2) + + +1. Set the CVSROOT variable: + > set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot +2. Log in using the password "anonymous": + + + + +

    Index

      -
    • On page 437: 'Chimera, 2' has been changed to 'Camino, 2'

      +
    • +On page 437: 'Chimera, 2' has been changed to 'Camino, 2'

      +