< Day Day Up > |
Code collapse functions let you visually collapse and expand code. You can collapse or expand arbitrary selections of code, or fragments between opening and closing tags. Although the code collapse functions exist in both the dom and htmlInspector, the collapsed ranges are the same in both Code view and the Cold Inspector. dom.collapseFullTag()Availability Dreamweaver 8. Description This function determines whether the selection in Code view is entirely within a single pair of start and end tags or contains a single pair of start and end tags. If so, it collapses the code fragment that starts just before the start tag and ends after the end tag; if not, the function does nothing. Arguments allowCodeFragmentAdjustment
Returns Nothing. Example The following example collapses the code fragment in the current selection in Code view that starts just before the start tag and ends just after the end tag: var currentDOM = dw.getDocumentDOM(); currentDOM.collapseFullTag(false); dom.collapseFullTagInverse()Availability Dreamweaver 8. Description This function determines whether the selection in Code view is entirely within a single pair of start and end tags or contains a single pair of start and end tags. If so, it collapses the code that precedes the start tag and the code that follows the end tag; if not, the function does nothing. Arguments allowAdjustmentOfCodeFragments
Returns Nothing. Example The following example adjusts the boundaries of the code before the starting tag after the ending tag to perform a smart collapse that preserves indenting and spacing: var currentDOM = dw.getDocumentDOM(); currentDOM.collapseFullTagInverse(true); dom.collapseSelectedCodeFragment()Availability Dreamweaver 8. Description This function collapses the selected code in Code view. If the selection is already collapsed, this function does nothing. Arguments allowCodeFragmentAdjustment
Returns Nothing. Example The following example collapses the selected code fragment, without modification, in Code view: var currentDOM = dw.getDocumentDOM(); currentDOM.collapseSelectedCodeFragment(false); dom.collapseSelectedCodeFragmentInverse()Availability Dreamweaver 8. Description This function collapses all code before and after the selected code in Code view. Arguments allowAdjustmentOfCodeFragments
Returns Nothing. Example The following example adjusts and then collapses all code before and after the selected code in Code view: var currentDOM = dw.getDocumentDOM(); currentDOM.collapseSelectedCodeFragmentInverse(true); dom.expandAllCodeFragments()Availability Dreamweaver 8. Description This function expands all collapsed code fragments in Code view, including nested collapsed code fragments. Arguments None. Returns Nothing. Example The following example expands all collapsed code in Code view: var currentDOM = dw.getDocumentDOM(); currentDOM.expandAllCodeFragments(); dom.expandSelectedCodeFragments()Availability Dreamweaver 8. Description This function expands all collapsed code fragments in Code view that are within the current selection. If the selection is already expanded, this function does nothing. Arguments None. Returns Nothing. Example The following example expands all collapsed code in the current selection in Code view: var currentDOM = dw.getDocumentDOM(); currentDOM.expandSelectedCodeFragments(); dreamweaver.htmlInspector.collapseFullTag()Availability Dreamweaver 8. Description This function determines whether the selection in the Code inspector is entirely within a single pair of start and end tags or contains a single pair of start and end tags. If so, it collapses the code fragment that starts just before the start tag and ends after the end tag; if not, the function does nothing. Arguments allowACodeFragmentAdjustment
Returns Nothing. Example The following example collapses the code fragment in the current selection in the Code inspector that starts just before the start tag and ends just after the end tag: dreamweaver.htmlInspector.collapseFullTag(false); dreamweaver.htmlInspector.collapseFullTagInverse()Availability Dreamweaver 8. Description This function determines whether the selection in the Code inspector is entirely within a single pair of start and end tags or contains a single pair of start and end tags. If so, it collapses the code before the start tag and the code after the end tag; if not, the function does nothing. Arguments allowAdjustmentOfCodeFragments
Returns Nothing. Example The following example performs a smart collapse on the code sections occurring before the starting tag and after the ending tag of the current selection: dreamweaver.htmlInspector.collapseFullTagInverse(true); dreamweaver.htmlInspector.collapseSelectedCodeFragment()Availability Dreamweaver 8. Description This function collapses the selected code in the Code inspector. If the selection is already collapsed, this function does nothing. Arguments allowCodeFragmentAdjustment
Returns Nothing. Example The following example adjusts and collapses the selected code in the Code inspector: dreamweaver.htmlInspector.collapseSelectedCodeFragment(true); dreamweaver.htmlInspector.collapseSelectedCodeFragmentInverse()Availability Dreamweaver 8. Description This function collapses all code before and after the selected code in the Code inspector. If the selection is already collapsed, this function does nothing. Arguments allowAdjustmentOfCodeFragments
Returns Nothing. Example The following example collapses all code before and after the selected code in the Code inspector, exactly as indicated by the selection: dreamweaver.htmlInspector.collapseSelectedCodeFragmentInverse(false); dreamweaver.htmlInspector.expandAllCodeFragments()Availability Dreamweaver 8. Description This function expands all collapsed code fragments in the Code inspector, including nested collapsed code fragments. Arguments None. Returns Nothing. Example The following example expands all collapsed code in the Code inspector: dreamweaver.htmlInspector.expandAllCodeFragments(); dreamweaver.htmlInspector.expandSelectedCodeFragments()Availability Dreamweaver 8. Description This function expands all collapsed code fragments within the current selection in the Code inspector. If the selection is already expanded, this function does nothing. Arguments None. Returns Nothing. Example The following example expands all collapsed code in the current selection in the Code inspector: dreamweaver.htmlInspector.expandSelectedCodeFragments(); |
< Day Day Up > |