< Day Day Up > |
Code view toolbar functions let you insert text, remove comments, show or hide special characters for white spaces in Code view, and get the path of the current document. NOTE There are two different Coding toolbars: one for Code view and one for the Code inspector. Both are customized in the file Configuration/Toolbars/toolbars.xml. dom.getOpenPathName()Availability Dreamweaver 8. Description This function gets the absolute file path of the open document. Arguments None. Returns A string that is the absolute file path of the open document. Example The following example assigns the string that contains the path of the currently open document to the variable fileName: var fileName = dom.getOpenPathName(); dom.getShowHiddenCharacters()Availability Dreamweaver 8. Description This function determines whether the special characters for white spaces are shown in the Code view of the Document window. Arguments None. Returns A Boolean: true if the hidden characters are displayed; false otherwise. Example The following example turns off the display of the special characters for white space, if the display of special characters is turned on initially: var currentDOM = dw.getDocumentDOM(); if (currentDOM.getShowHiddenCharacters()){ currentDOM.setShowHiddenCharacters(false); } dom.setShowHiddenCharacters()Availability Dreamweaver 8. Description This function shows or hides the special characters for white spaces in the Code view of the Code inspector. Arguments show
Returns Nothing. Example See "dom.getShowHiddenCharacters()" on page 753. dom.source.applyComment()Availability Dreamweaver 8. Description This function inserts the text specified in the beforeText argument before the current selection and the text specified in the afterText argument after the current selection. The function then extends the current selection to include the added text. However, if there is no current selection, the function does not select anything. If the text specified in the afterText argument is null, the function inserts the text specified in the beforeText argument at the beginning of every line in the current selection. Arguments beforeText
Returns Nothing. Example The following example makes the current selection an HTML comment: dw.getDocumentDOM().source.applyComment('<!--', '-->') dom.source.removeComment()Availability Dreamweaver 8. Description This function removes comments. If you specify no arguments, it removes all types of comments from the current selection, except server-side includes and Dreamweaver-specific comments. If there are nested comments, it removes only the outer comment. If there is no current selection, it removes only the first line comment of the line on which the cursor is located. If you specify arguments, the function removes only comments that match the values specified in the beforeText and afterText arguments, even if the matching comments are nested inside other types of comments. Arguments beforeText
Returns Nothing. Example The following example removes an HTML comment: dw.getDocumentDOM().source.removeComment('<!--', '-->') dreamweaver.htmlInspector.getShowHiddenCharacters()Availability Dreamweaver 8. Description This function determines whether the special characters for white spaces are displayed in the Code view of the Code inspector. Arguments None. Returns A Boolean: TRue if the hidden characters are displayed; false otherwise. Example The following example turns off the display of the special characters for white space in the Code inspector, if the display of special characters is turned on initially: if (dreamweaver.htmlinspector.getShowHiddenCharacters()){ dreamweaver.htmlinspector.setShowHiddenCharacters(false); } dreamweaver.htmlInspector.setShowHiddenCharacters()Availability Dreamweaver 8. Description This function shows or hides the special characters for white spaces in the Code view of the Code inspector. Arguments show
Returns A Boolean: true if the hidden characters are displayed; false otherwise. Example See "dreamweaver.htmlInspector.getShowHiddenCharacters()" on page 756. |
< Day Day Up > |