Adobe Extending Dreamweaver CS4 User Manual
Page 338
332
EXTENDING DREAMWEAVER CS4
Data translators
type="tagNameOrType" depFiles="dependentFilesList" ¬ The values in this example have the following significance: • The translatorClass value is the unique identifier for the translator; it is the first string in the array that the getTranslatorInfo() function returns. • The tagNameOrType value is a string that identifies the type of markup (or the tag name that is associated with the canInspectSelection() function of a custom Property inspector to Property inspectors for locked content ” on page 333. Locked content cannot be inspected by the Dreamweaver built-in Property inspectors. For example, specifying type="IMG" does not make the Image panel appear. • The dependentFilesList value is a string that contains a comma-separated list of files on which the locked markup • The encodedOriginalMarkup value is a string that contains the original, untranslated markup, encoded using a %22 for " , %3C for < , %3E for > , and %25 for % ). The quickest way to URL-encode a string is to use the escape() method. For example, if myString equals '' , escape(myString) returns %3Cimg%20src=%22foo.gif%22%3E . The following example shows the locked portion of code that might be generated from the translation of the server- : depFiles="C:\sites\webdev\footer.html" orig="%3C!--#include ¬ Creating a translator that locks code inside a script tag can cause the translator to fail. For example, suppose you have the following code:
orig="encodedOriginalMarkup">
Translated content
markup) that is contained in the lock. The string can contain only alphanumeric, hyphen (-), or underscore (_)
characters. You can check this value in the
depends. Files are referenced as URLs, relative to the user’s document. If the user updates one of the files named in
the dependentFilesList string, Dreamweaver automatically retranslates the content in the document that contains
the list.
small subset of URL encoding (use
side include
virtual=%22/footer.html%22%20--%3E">
[home]
[products]
[services]
[support]
[about us]
[help]