235
edits
Line 33: | Line 33: | ||
==== 2. Panels ==== | ==== 2. Panels ==== | ||
Old panels were actually "real" documents, loaded into a browser window. New panels are <prefpane> elements, overlayed over the main window. | Old panels were actually "real" documents, loaded into a browser window. New panels are <prefpane> elements, overlayed over the main window. To avoid the global namespace clashes of <script>s mentioned above, SeaMonkey's prefwindow brings along some additional internal handling. | ||
Old: | |||
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" | |||
id="pref-navigator" | |||
onload="parent.initPanel('chrome://communicator/content/pref/pref-navigator.xul');" | |||
headertitle="&pref.navigator.title;"> | |||
... | |||
<script type="application/x-javascript" | |||
src="chrome://communicator/content/pref/pref-navigator.js"/> | |||
New: | |||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | |||
<prefpane id="navigator_pane" | |||
label="&pref.navigator.title;" | |||
script="chrome://communicator/content/pref/pref-navigator.js"> | |||
* The ''id'' of the <prefpane> must the value of the ''prefpane'' attribute of the <treeitem> (see above). | |||
* The ''label'' should have the same value as the the old <page>.''headertitle'' attribute. It will be shown above the panel. | |||
* The ''script'' attribute contains a whitespace delimited list of chrome URIs of the script files to be loaded into the panel's(!) scope. This means that the contents of these scripts will be accessible as members of the <prefpane> object, eg. ''document.getElementById("navigator_pane").Startup()''. | |||
* The ''onpaneload'' attribute can contain code which will be executed when the panel has finished loading. Eg. ''this.Startup()'' will work, but the special Startup() function will be called on panel load automatically anyway, if it exists. |
edits