MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Specifikace Strana 291

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 504
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 290
A simple floating panel example 291
4. When the floating panel is visible, the following actions occur:
When the selection changes, the selectionChanged() function is called, if it is
defined.
When the user makes changes to the document, the documentEdited() function is
called, if it is defined.
Event handlers that are attached to the fields in the floating panel interface execute as
the user encounters them. (For example, a button with an
onClick event handler that
executes
dw.getDocumentDOM().body.innerHTML='' removes everything between
the opening and closing
BODY tags in the document when it is clicked.)
Floating panels support two special events on the
body tag: onShow() and onHide().
5. When the user quits Dreamweaver, the current visibility, position, and tab grouping of the
floating panel are saved. The next time Dreamweaver starts up, it loads the floating panel
files for any floating panels that were visible at the last shutdown and displays the floating
panels in their last position and tab grouping.
A simple floating panel example
In this example, you create a Script Editor extension that creates a floating panel to display the
JavaScript code that underlies a selected script marker in Design view. The Script Editor
displays the JavaScript code in the
textarea element of an HTML form that is defined in a
floating panel called
scriptlayer. If you make changes to the selected code in the floating
panel, the extension calls the
updateScript() function to save your changes. If you have not
selected a script marker when you invoke the Script Editor, the extension displays
(no
script selected)
in a floating panel called blanklayer.
You create this extension by performing the following steps:
Creating the floating panels
Writing the JavaScript code
Creating a menu item
Creating the floating panels
The beginning of the HTML file for this extension contains the standard document header
information and a
title tag that puts the words Script Editor in the title bar of the floating
panels.
Zobrazit stránku 290
1 2 ... 286 287 288 289 290 291 292 293 294 295 296 ... 503 504

Komentáře k této Příručce

Žádné komentáře