Creating Property inspectors for locked content
439
[<A TARGET="_top" HREF="/support/">support</A>]
[<A TARGET="_top" HREF="/company/">about us</A>]
[<A TARGET="_top" HREF="/help/">help</A>]
</CENTER>
<!-- end footer -->
<MM:EndLock>
Creating Property inspectors for locked
content
After you create a translator, you need to create a Property inspector for the content so the
user can change its properties (for example, the file to be included or one of the conditions in
a conditional statement). Inspecting translated content is a unique problem for several
reasons:
■
The user might want to change the properties of the translated content, and those changes
must be reflected in the untranslated content.
■
The Document Object Model (DOM) contains the translated content (that is, the lock
tags and the tags they surround are nodes in the DOM), but the
outerHTML
property of
the
documentElement
object and the
dreamweaver.getSelection()
and
dreamweaver.nodeToOffsets()
functions act on the untranslated source.
■
The tags you inspect are different before and after translation.
A Property inspector for the
HAPPY
tag might have a comment that looks similar to the
following example:
<!-- tag:HAPPY,priority:5,selection:exact,hline,vline, attrName:
xxx,¬
attrValue:
yyy
-->
The Property inspector for the translated
HAPPY
tag, however, would have a comment that
looks similar to the following example:
<!-- tag:*LOCKED*,priority:5,selection:within,hline,vline -->
The
canInspectSelection()
function for the untranslated
HAPPY
Property inspector is
simple. Because the
selection
type is
exact
, it can return a value of
true
without further
analysis. For the translated
HAPPY
Property inspector, this function is more complicated; the
keyword
*LOCKED*
indicates that the Property inspector is appropriate when the selection is
within a locked region, but because a document can have several locked regions, further
checks must be performed to determine whether the Property inspector matches this
particular locked region.
Summary of Contents for DREAMWEAVER 8-EXTENDING DREAMWEAVER
Page 1: ...Extending Dreamweaver...
Page 8: ...8 Contents...
Page 14: ...14 Introduction...
Page 16: ......
Page 54: ...54 Customizing Dreamweaver...
Page 96: ...96 Customizing Code View...
Page 98: ......
Page 110: ...110 Extending Dreamweaver...
Page 138: ......
Page 166: ...166 Insert Bar Objects...
Page 180: ...180 Commands...
Page 248: ...248 Toolbars...
Page 260: ...260 Reports...
Page 278: ...278 Tag Libraries and Editors...
Page 288: ...288 Property Inspectors...
Page 378: ...378 Server Behaviors...
Page 398: ...398 Data Sources...
Page 432: ...432 Server Models...
Page 456: ...456 Data Translators...
Page 482: ......
Page 492: ...492 The Shared Folder...