< Day Day Up > |
You can use tag editors to insert new tags, edit existing tags, and access reference information about tags. The Tag Chooser lets users organize their tags so that they can easily select frequently used tags. The tag libraries that come with Dreamweaver store information about tags that are used in standards-based markup languages and most widely used tag-based scripting languages. You can use the JavaScript tag editor, Tag Chooser, and tag library functions when you need to access and work with tag editors and tag libraries in your extensions. dom.getTagSelectorTag()Availability Dreamweaver MX. Description This function gets the DOM node for the tag that is currently selected in the Tag Selector bar at the bottom of the document window. Arguments None. Returns The DOM node for the currently selected tag; null if no tag is selected. dreamweaver.popupInsertTagDialog()Availability Dreamweaver MX. Description This function checks the VTM files to see if a tag editor has been defined for the tag. If so, the editor for that tag pops up and accepts the start tag. If not, the start tag is inserted unmodified into the user's document. Arguments A start tag string that includes one of the following types of initial values:
Returns A Boolean value: TRue if anything is inserted into the document; false otherwise. dreamweaver.popupEditTagDialog()Availability Dreamweaver MX. Description If a tag is selected, this function opens the tag editor for that tag, so you can edit the tag. Arguments None. Returns Nothing. Enabler See "dreamweaver.canPopupEditTagDialog()" on page 1073. dreamweaver.showTagChooser()Availability Dreamweaver MX. Description This function displays the Tag Chooser dialog box, brings it to the front, and sets it in focus. Arguments None. Returns Nothing. dreamweaver.showTagLibraryEditor()Availability Dreamweaver MX. Description This function opens the Tag Library editor. Arguments None. Returns None. dreamweaver.tagLibrary.getTagLibraryDOM()Availability Dreamweaver MX. Description Given the URL of a filename.vtm file, this function returns the DOM for that file, so that its contents can be edited. This function should be called only when the Tag Library editor is active. Arguments fileURL
Returns A DOM pointer to a new or previously existing file within the TagLibraries folder. dreamweaver.tagLibrary.getSelectedLibrary()Availability Dreamweaver MX. Description If a library node is selected in the Tag Library editor, this function gets the library name. Arguments None. Returns A string, the name of the library that is currently selected in the Tag Library editor; returns an empty string if no library is selected. dreamweaver.tagLibrary.getSelectedTag()Availability Dreamweaver MX. Description If an attribute node is currently selected, this function gets the name of the tag that contains the attribute. Arguments None. Returns A string, name of the tag that is currently selected in the Tag Library editor; returns an empty string if no tag is selected. dreamweaver.tagLibrary.importDTDOrSchema()Availability Dreamweaver MX. Description This function imports a DTD or schema file from a remote server into the tag library. Arguments fileURL, Prefix
Returns Name of the imported tag library. dreamweaver.tagLibrary.getImportedTagList()Availability Dreamweaver MX. Description This function generates a list of tagInfo objects from an imported tag library. Arguments libname
Returns Array of tagInfo objects. A taginfo object contains information about a single tag that is included in the tag library. The following properties are defined in a tagInfo object:
Example: The following example shows that using the dw.tagLibrary.getImportedTagList() function can get an array of tags from the libName library: // "fileURL" and "prefix" have been entered by the user. // tell the Tag Library to Import the DTD/Schema var libName = dw.tagLibrary.importDTDOrSchema(fileURL, prefix); // get the array of tags for this library // this is the TagInfo object var tagArray = dw.tagLibrary.getImportedTagList(libName); // now I have an array of tagInfo objects. // I can get info out of them. This gets info out of the first one. // note: this assumes there is at least one TagInfo in the array. var firstTagName = tagArray[0].name; var firstTagAttributes = tagArray[0].attributes; // note that firstTagAttributes is an array of attributes. |
< Day Day Up > |