< Day Day Up > |
Find/replace functionsFind/replace functions handle find and replace operations. They cover basic functionality, such as finding the next instance of a search pattern, and complex replacement operations that require no user interaction. dreamweaver.findNext()Availability Dreamweaver 3; modified in Dreamweaver MX 2004. Description Finds the next instance of the search string that was specified previously by dreamweaver.setUpFind(), by dreamweaver.setUpComplexFind(), or by the user in the Find dialog box, and selects the instance in the document. Arguments {bUseLastSetupSearch}
Returns Nothing. Enabler See "dreamweaver.canFindNext()" on page 1071. dreamweaver.replace()Availability Dreamweaver 3. Description Verifies that the current selection matches the search criteria that was specified by dreamweaver.setUpFindReplace(), by dreamweaver.setUpComplexFindReplace(), or by the user in the Replace dialog box; the function then replaces the selection with the replacement text that is specified by the search request. Arguments None. Returns Nothing. dreamweaver.replaceAll()Availability Dreamweaver 3. Description Replaces each section of the current document that matches the search criteria that was specified by dreamweaver.setUpFindReplace(), by dreamweaver.setUpComplexFindReplace(), or by the user in the Replace dialog box, with the specified replacement content. Arguments None. Returns Nothing. dreamweaver.setUpComplexFind()Availability Dreamweaver 3. Description Prepares for an advanced text or tag search by loading the specified XML query. Arguments xmlQueryString
Returns Nothing. Example The first line of the following example sets up a tag search and specifies that the scope of the search should be the current document. The second line performs the search operation. dreamweaver.setUpComplexFind('<dwquery><queryparams matchcase="false" ignorewhitespace="true" useregexp="false"/><find> <qtag qname="a"><qattribute qname="href" qcompare="="qvalue="#"> </qattribute><qattribute qname="onMouseOut" qcompare="=" qvalue="" qnegate="true"></qattribute></qtag></find></dwquery>');dw.findNext(); dreamweaver.setUpComplexFindReplace()Availability Dreamweaver 3. Description Prepares for an advanced text or tag search by loading the specified XML query. Arguments xmlQueryString
Returns Nothing. Example The first statement in the following example sets up a tag search and specifies that the scope of the search should be four files. The second statement performs the search and replace operation. dreamweaver.setUpComplexFindReplace('<dwquery><queryparams matchcase="false" ignorewhitespace="true" useregexp="false"/><find><qtag qname="a"><qattribute qname="href" qcompare="=" qvalue="#"></qattribute><qattribute qname="onMouseOut" qcompare="=" qvalue="" qnegate="true"></qattribute></qtag> </find><replace action="setAttribute" param1="onMouseOut" param2="this.style.color='#000000';this.style.fontWeight='normal'"/>< /dwquery>'); dw.replaceAll(); dreamweaver.setUpFind()Availability Dreamweaver 3. Description Prepares for a text or HTML source search by defining the search parameters for a subsequent dreamweaver.findNext() operation. Arguments searchObject The searchObject argument is an object for which the following properties can be defined:
Returns Nothing. Example The following code demonstrates three ways to create a searchObject object: var searchParams; searchParams.searchString = 'bgcolor="#FFCCFF"'; searchParams.searchSource = true; dreamweaver.setUpFind(searchParams); var searchParams = {searchString: 'bgcolor="#FFCCFF"', searchSource: true}; dreamweaver.setUpFind(searchParams); dreamweaver.setUpFind({searchString: 'bgcolor="#FFCCFF"', searchSource: true}); dreamweaver.setUpFindReplace()Availability Dreamweaver 3. Description Prepares for a text or HTML source search by defining the search parameters and the scope for a subsequent dreamweaver.replace() or dreamweaver.replaceAll() operation. Arguments searchObject The searchObject argument is an object for which the following properties can be defined:
Returns Nothing. Example The following code demonstrates three ways to create a searchObject object: var searchParams; searchParams.searchString = 'bgcolor="#FFCCFF"'; searchParams.replaceString = 'bgcolor="#CCFFCC"'; searchParams.searchSource = true; dreamweaver.setUpFindReplace(searchParams); var searchParams = {searchString: 'bgcolor="#FFCCFF"', replaceString: bgcolor="#CCFFCC"', searchSource: true}; dreamweaver.setUpFindReplace(searchParams); dreamweaver.setUpFindReplace({searchString: 'bgcolor="#FFCCFF"', replaceString: 'bgcolor="#CCFFCC"', searchSource: true}); dreamweaver.showFindDialog()Availability Dreamweaver 3. Description Opens the Find dialog box. Arguments None. Returns Nothing. Enabler See "dreamweaver.canShowFindDialog()" on page 1077. dreamweaver.showFindReplaceDialog()Availability Dreamweaver 3. Description Opens the Replace dialog box. Arguments None. Returns Nothing. Enabler See "dreamweaver.canShowFindDialog()" on page 1077. |
< Day Day Up > |