Adobe Dreamweaver API Reference CS5 Manuale Utente Pagina 380

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 533
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 379
375
DREAMWEAVER API REFERENCE
Dynamic documents
Last updated 8/27/2013
Description
Returns the following list of properties, which let you access:
Translator URL patterns
File references
Type
Arguments
None.
Returns
A list of objects, one for each searchPattern. Each object has the following three properties:
Example
The following code snippet from a participant file shows a translator searchPatterns tag:
<searchPatterns whereToSearch="comment">
<searchPattern paramNames=",ssi_comment_includeUrl">
<![CDATA[/<!--\s*#include\s+(file|virtual)\s*=\s*"([^"]*)"\s*-->/i]]>
</searchPattern>
</searchPatterns>
The search pattern contains a JavaScript regular expression that specifies two submatches (both of which are contained
within parentheses). The first submatch is for the text string
file or virtual. The second submatch is a file reference.
To access the translator URL pattern, your code should look like the following example:
var serverModel = dw.getDocumentDOM().serverModel;
var includeArray = new Array();
includeArray = serverModel.getServerIncludeUrlPatterns();
The call to serverModel.getServerIncludeUrlPatterns() returns the following three properties:
Property Description
pattern A JavaScript regular expression that is specified in the searchPattern field of an EDML file. (A
regular expression is delimited by a pair of forward slashes (
//).)
fileRef The 1-based index of the regular expression submatch that corresponds to the included file
reference.
type The portion of the paramName value that remains after removing the _includeUrl suffix. This type is
assigned to the type attribute of the
<MM:BeginLock> tag. For an example, see Server Model
SSI.htm in the Configuration/Translators folder.
Property Return value
pattern /<!--\s*#include\s+(file|virtual)\s*=\s*"([^"]*)"\s*-->/i
fileRef 2
type ssi_comment
Vedere la pagina 379
1 2 ... 375 376 377 378 379 380 381 382 383 384 385 ... 532 533

Commenti su questo manuale

Nessun commento