< Day Day Up > |
Library and template functions handle operations that are related to library items and templates, such as creating, updating, and breaking links between a document and a template or library item. Methods of the dreamweaver.libraryPalette object either control or act on the selection in the Assets panel library items, not in the current document. Likewise, methods of the dreamweaver.templatePalette object control or act on the selection in the Assets panel template objects. dom.applyTemplate()Availability Dreamweaver 3. Description Applies a template to the current document. If no argument is supplied, the Select Template dialog box appears. This function is valid only for the document that has focus. Arguments {templateURL}, bMaintainLink
Returns Nothing. Enabler See "dom.canApplyTemplate()" on page 1056. dom.detachFromLibrary()Availability Dreamweaver 3. Description Detaches the selected library item instance from its associated LBI file by removing the locking tags from around the selection. This function is equivalent to clicking Detach from Original in the Property inspector. Arguments None. Returns Nothing. dom.detachFromTemplate()Availability Dreamweaver 3. Description Detaches the current document from its associated template. Arguments None. Returns Nothing. dom.getAttachedTemplate()Availability Dreamweaver 3. Description Gets the path of the template that is associated with the document. Arguments None. Returns A string that contains the path of the template, which is expressed as a file:// URL. dom.getEditableRegionList()Availability Dreamweaver 3. Description Gets a list of all the editable regions in the body of the document. Arguments None. Returns An array of element nodes. Example "dom.getSelectedEditableRegion()" on page 891. dom.getIsLibraryDocument()Availability Dreamweaver 3. Description Determines whether the document is a library item. Arguments None. Returns A Boolean value that indicates whether the document is an LBI file. dom.getIsTemplateDocument()Availability Dreamweaver 3. Description Determines whether the document is a template. Arguments None. Returns A Boolean value that indicates whether the document is a DWT file. dom.getSelectedEditableRegion()Availability Dreamweaver 3. Description If the selection or insertion point is inside an editable region, this function gets the position of the editable region among all others in the body of the document. Arguments None. Returns An index into the array that the dom.getEditbableRegionList() function returns. For more information, see "dom.getEditableRegionList()" on page 890. Example The following code shows a dialog box with the contents of the selected editable region: var theDOM = dw.getDocumentDOM(); var edRegs = theDOM.getEditableRegionList(); var selReg = theDOM.getSelectedEditableRegion(); alert(edRegs[selReg].innerHTML); dom.insertLibraryItem()Availability Dreamweaver 3. Description Inserts an instance of a library item into the document. Arguments libraryItemURL
Returns Nothing. dom.markSelectionAsEditable()Availability Dreamweaver 3. Description Displays the New Editable Region dialog box. When the user clicks New Region, Dreamweaver marks the selection as editable and doesn't change any text. Arguments None. Returns Nothing. Enabler See "dom.canMarkSelectionAsEditable()" on page 1063. dom.newEditableRegion()Availability Dreamweaver 3. Description Displays the New Editable Region dialog box. When the user clicks New Region, Dreamweaver inserts the name of the region, surrounded by curly braces ({ }), into the document at the insertion point location. Arguments None. Returns Nothing. Enabler See "dom.canMakeNewEditableRegion()" on page 1062. dom.removeEditableRegion()Availability Dreamweaver 3. Description Removes an editable region from the document. If the editable region contains any content, the content is preserved; only the editable region markers are removed. Arguments None. Returns Nothing. Enabler See "dom.canRemoveEditableRegion()" on page 1064. dom.updateCurrentPage()Availability Dreamweaver 3. Description Updates the document's library items, templates, or both. This function is valid only for the active document. Arguments {typeOfUpdate}
Returns Nothing. dreamweaver.updatePages()Availability Dreamweaver 3. Description Opens the Update Pages dialog box and selects the specified options. Arguments {typeOfUpdate}
Returns Nothing. |
< Day Day Up > |