MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Reference

Summary of DREAMWEAVER 8-DREAMWEAVER API

  • Page 1

    Dreamweaver api reference 000_dw_api_print.Book page 1 wednesday, july 20, 2005 11:58 am.

  • Page 2

    Trademarks 1 step robopdf, activeedit, activetest, authorware, blue sky software, blue sky, breeze, breezo, captivate, central, coldfusion, contribute, database explorer, director, dreamweaver, fireworks, flash, flashcast, flashhelp, flash lite, flashpaper, flex, flex builder, fontographer, freehand...

  • Page 3

    3 contents introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 extending dreamweaver . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 4

    4 contents chapter 6: the database api . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 how database api functions work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 database connection functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 databas...

  • Page 5

    Contents 5 chapter 12: site. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 report functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 site functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Page 6

    6 contents chapter 17: code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 code functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489 find/replace functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

  • Page 7

    7 introduction the dreamweaver api reference describes two application programming interfaces (apis) that let you perform various supporting tasks when developing macromedia dreamweaver 8 extensions and adding program code to your dreamweaver web pages. These two apis are the utility api and the jav...

  • Page 8

    8 introduction background this book assumes that you are familiar with dreamweaver, html, xml, javascript programming and, if applicable, c programming. If you are writing extensions for building web applications, you should also be familiar with server-side scripting on at least one platform, such ...

  • Page 9

    New functions in dreamweaver 8 9 workspace the following new window, code collapse, and code view toolbar functions have been added to the workspace chapter. Window ■ dreamweaver.Cascade() on page 231 (added support for the macintosh) ■ dreamweaver.Tilehorizontally() on page 239 (added support for t...

  • Page 10

    10 introduction site ■ dom.Getsiteurlprefixfromdoc() on page 256 ■ dom.Localpathtositerelative() on page 257 ■ dom.Siterelativetolocalpath() on page 257 ■ dreamweaver.Comparefiles() on page 258 ■ dreamweaver.Sitesyncdialog.Compare() on page 259 ■ dreamweaver.Sitesyncdialog.Markdelete() on page 260 ■...

  • Page 11

    New functions in dreamweaver 8 11 design the following new css, layout view, and zoom functions have been added to the design chapter: css ■ cssstylepalette.Getinternetexplorerrendering() on page 419 ■ cssstylepalette.Setinternetexplorerrendering() on page 420 ■ dom.Getelementview() on page 421 ■ do...

  • Page 12

    12 introduction layout view ■ dom.Getshowblockbackgrounds() on page 459 ■ dom.Getshowblockborders() on page 459 ■ dom.Getshowblockids() on page 460 ■ dom.Getshowboxmodel() on page 461 ■ dom.Setshowblockbackgrounds() on page 461 ■ dom.Setshowblockborders() on page 462 ■ dom.Setshowblockids() on page ...

  • Page 13

    Errata 13 enablers the following new functions have been added to the enablers chapter: ■ dreamweaver.Canfitselection() on page 568 ■ dreamweaver.Canpastespecial() on page 568 ■ dreamweaver.Canzoom() on page 574 ■ dreamweaver.Cssstylepalette.Canapplyselectedstyle() on page 575 (added new argument) ■...

  • Page 14

    14 introduction conventions used in this guide the following typographical conventions are used in this guide: ■ code font indicates code fragments and api literals, including class names, method names, function names, type names, scripts, sql statements, and both html and xml tag and attribute name...

  • Page 15

    15 1 part 1 utility apis learn about the macromedia dreamweaver 8 utility functions that you can use to access local and web-based files, work with macromedia fireworks, and macromedia flash objects, manage database connections, create new database connection types, access javabeans fscomponents, an...

  • Page 16

    000_dw_api_print.Book page 16 wednesday, july 20, 2005 11:58 am.

  • Page 17

    17 1 chapter 1 the file i/o api macromedia dreamweaver 8 includes a c shared library called dwfile, which gives authors of objects, commands, behaviors, data translators, floating panels, and property inspectors the ability to read and write files on the local file system. This chapter describes the...

  • Page 18

    18 the file i/o api description this function copies the specified file to a new location. Arguments originalurl, copyurl ■ the originalurl argument, which is expressed as a file:// url, is the file you want to copy. ■ the copyurl argument, which is expressed as a file:// url, is the location where ...

  • Page 20

    20 the file i/o api description this function gets the attributes of the specified file or folder. Arguments fileurl ■ the fileurl argument, which is expressed as a file:// url, is the file or folder for which you want to get attributes. Returns a string that represents the attributes of the specifi...

  • Page 21

    The file i/o api 21 returns a string that contains a hexadecimal number that represents the number of time units that have elapsed since some base time. The exact meaning of time units and base time is platform-dependent; in windows, for example, a time unit is 100ns, and the base time is january 1s...

  • Page 23

    The file i/o api 23 arguments fileurl ■ the fileurl argument, which is expressed as a file:// url, is the file for which you are checking the time of the most recent modification. Returns a javascript date object that represents the date and time when the specified file was last modified. Dwfile.Get...

  • Page 24

    24 the file i/o api ■ the constraint argument, if it is supplied, must be either "files" (return only files) or "directories" (return only folders). If it is omitted, the function returns files and folders. Returns an array of strings that represents the contents of the folder. Example the following...

  • Page 25

    The file i/o api 25 dwfile.Remove() availability dreamweaver 3. Description this function deletes the specified file. Arguments fileurl ■ the fileurl argument, which is expressed as a file:// url, is the file you want to remove. Returns a boolean value: true value if the operation succeeds; false ot...

  • Page 26

    26 the file i/o api arguments fileurl, strattrs ■ the fileurl argument, which is expressed as a file:// url, identifies the file for which you are setting the attributes. ■ the strattrs argument specifies the system-level attributes for the file that is identified by the fileurl argument. The follow...

  • Page 27

    The file i/o api 27 arguments fileurl, text, {mode} ■ the fileurl argument, which is expressed as a file:// url, is the file to which you are writing. ■ the text argument is the string to be written. ■ the mode argument, if it is supplied, must be "append" . If this argument is omitted, the contents...

  • Page 28

    28 the file i/o api 000_dw_api_print.Book page 28 wednesday, july 20, 2005 11:58 am.

  • Page 29

    29 2 chapter 2 the http api extensions are not limited to working within the local file system. Macromedia dreamweaver 8 provides a mechanism to get information from and send information to a web server by using hypertext transfer protocol (http). This chapter describes the http api and how to use i...

  • Page 30

    30 the http api functions that return an object also have a callback version. Callback functions let other functions execute while the web server processes an http request. This capability is useful if you are making multiple http requests from dreamweaver. The callback version of a function passes ...

  • Page 31

    The http api 31 mmhttp.Cleartemp() description this function deletes all the files in the configuration/temp folder, which is located in the dreamweaver application folder. Arguments none. Returns nothing. Example the following code, when saved in a file within the configuration/shutdown folder, rem...

  • Page 32

    32 the http api ■ the prompt argument, which is optional, is a boolean value that specifies whether to prompt the user to save the file. If saveurl is outside the configuration/temp folder, a prompt value of false is ignored for security reasons. ■ the saveurl argument, which is optional, is the loc...

  • Page 33

    The http api 33 example the following code gets an html file, saves all the files in the configuration/temp folder, and then opens the local copy of the html file in a browser: var httpreply = mmhttp.Getfile("http://www.Dreamcentral.Com/¬ people/profiles/scott.Html", false); if (httpreply.Statuscode...

  • Page 34

    34 the http api returns an object that represents the reply from the server. The data property of this object is a string that contains the location where the file was saved, which is expressed as a file:// url. Normally the statuscode property of the object contains the status code that is received...

  • Page 35

    The http api 35 arguments callbackfunc, url, {serverscriptsfolder} ■ the callbackfunc argument is the javascript function to call when the http request is complete. ■ the url argument is an absolute url on a web server; if http:// is omitted from the url, dreamweaver assumes http protocol. ■ the ser...

  • Page 36

    36 the http api ■ the serverscriptsfolder argument is an optional string that names a particular folder—relative to the configuration folder on the application server—to which you want to post the data. To post the data, dreamweaver uses the appropriate transfer protocol (such as ftp, webdav, or rem...

  • Page 37

    The http api 37 arguments callbackfunc, url, datatopost, {contenttype}, {serverscriptsfolder} ■ the callbackfunc argument is the name of the javascript function to call when the http request is complete. ■ the url argument is an absolute url on a web server; if http:// is omitted from the url, dream...

  • Page 38

    38 the http api 000_dw_api_print.Book page 38 wednesday, july 20, 2005 11:58 am.

  • Page 39

    39 3 chapter 3 the design notes api macromedia dreamweaver 8, macromedia fireworks, and macromedia flash give web designers and developers a way to store and retrieve extra information about documents— information such as review comments, change notes, or the source file for a gif or jpeg—in files t...

  • Page 40

    40 the design notes api the following example shows the design notes file for foghorn.Gif.Mno: dreamcentral/images/sourcefiles/foghorn.Png" /> by jay l." /> the design notes javascript api all functions in the design notes javascript api are methods of the mmnotes object. Mmnotes.Close() description...

  • Page 42

    42 the design notes api mmnotes.Getkeys() description this function gets a list of all the keys in a design notes file. Arguments filehandle ■ the filehandle argument is the file handle that the mmnotes.Open() function returns. Returns an array of strings where each string contains the name of a key...

  • Page 43

    The design notes javascript api 43 mmnotes.Getversionname() description this function gets the version name of the mmnotes shared library, which indicates the application that implemented it. Arguments none. Returns a string that contains the name of the application that implemented the mmnotes shar...

  • Page 44

    44 the design notes api returns a string that contains the local drive path for the specified file. Example a call to mmnotes.Localurltofilepath('file:///macintoshhd/images/moon.Gif') returns "macintoshhd:images:moon.Gif" . Mmnotes.Open() description this function opens the design notes file that is...

  • Page 45

    The design notes c api 45 mmnotes.Set() description this function creates or updates one key/value pair in a design notes file. Arguments filehandle, keyname, valuestring ■ the filehandle argument is the file handle that the mmnotes.Open() function returns. ■ the keyname argument is a string that co...

  • Page 46

    46 the design notes api void closenotesfile() description this function closes the specified design notes file and saves any changes. If all key/value pairs are removed from the design note file, dreamweaver deletes it. Dreamweaver deletes the _notes folder when the last design notes file is deleted...

  • Page 47

    The design notes c api 47 ■ the keyname[64] argument is a string that contains the name of the key. ■ the valuebuf argument is the buffer where the value is stored. ■ the valuebuflength argument is the integer that getnotelength(notehandle , keyname) returns, which indicates the maximum length of th...

  • Page 48

    48 the design notes api int getnoteskeycount() description this function gets the number of key/value pairs in the specified design notes file. Arguments filehandle notehandle ■ the notehandle argument is the file handle that the opennotesfile() function returns. Returns an integer that represents t...

  • Page 49

    The design notes c api 49 if (succeeded){ for (int i=0; i printf("key is: %s", keys[i]); printf("value is: %s", getnote(notehandle, keys[i]); } } delete []keys; } closenotesfile(notehandle); bool getsiterootforfile() description this function determines the site root for the specified design n...

  • Page 50

    50 the design notes api arguments char* versionnamebuf, int versionnamebufmaxlen ■ the versionnamebuf argument is the buffer where the version name is stored. ■ the versionnamebufmaxlen argument is the maximum size of the buffer that the versionnamebuf argument references. Returns a boolean value: t...

  • Page 51

    The design notes c api 51 returns a boolean value: true indicates the operation is successful; false otherwise. The drivepathbuf argument receives the local drive path. Filehandle opennotesfile() description this function opens the design notes file that is associated with the specified file or crea...

  • Page 52

    52 the design notes api bool removenote() description this function removes the specified key (and its value) from the specified design notes file. Arguments filehandle notehandle, const char keyname[64] ■ the notehandle argument is the file handle that the opennotesfile() function returns. ■ the ke...

  • Page 53

    53 4 chapter 4 fireworks integration fwlaunch is a c shared library that gives authors of objects, commands, behaviors, and property inspectors the ability to communicate with macromedia fireworks. Using fwlaunch, you write javascript to open the fireworks user interface (ui) and provide commands to...

  • Page 54

    54 fireworks integration fwlaunch.Bringfwtofront() availability dreamweaver 3, fireworks 3. Description this function brings fireworks to the front if it is running. Arguments none. Returns nothing. Fwlaunch.Execjsinfireworks() availability dreamweaver 3, fireworks 3. Description this function passe...

  • Page 55

    The fwlaunch api 55 ■ error starting fireworks process, which indicates that the function does not open a valid version of fireworks (version 3 or later). ■ user cancelled the operation. Fwlaunch.Getjsresponse() availability dreamweaver 3, fireworks 3. Description this function determines whether fi...

  • Page 56

    56 fireworks integration example the following code passes the string "prompt('please enter your name:')" to fwlaunch.Execjsinfireworks() and checks for the result: var progresscookie = fwlaunch.Execjsinfireworks("prompt('please enter your name:')"); var doneflag = false; while (!Doneflag){ // check...

  • Page 57

    The fwlaunch api 57 fwlaunch.Optimizeinfireworks() availability dreamweaver 2, fireworks 2. Description this function opens a fireworks optimization session for the specified image. Arguments docurl, imageurl, {targetwidth}, {targetheight} ■ the docurl argument is the path to the active document, wh...

  • Page 58

    58 fireworks integration fwlaunch.Validatefireworks() availability dreamweaver 2, fireworks 2. Description this function looks for the specified version of fireworks on the user’s hard disk. Arguments {versionnumber} ■ the versionnumber argument is an optional floating-point number that is greater t...

  • Page 59

    The fwlaunch api 59 function readytocancel() { gcancelclicked = true; } function promptinfireworks() { var isfireworks3 = fwlaunch.Validatefireworks(3.0); if (!Isfireworks3) { alert("you must have fireworks 3.0 or later to use this ¬ command"); return; } // tell fireworks to execute the prompt() met...

  • Page 60

    60 fireworks integration if (response == null) { // still waiting for a response, call us again in 1/2 a // second checkonemoretime(); } else if (typeof(response) == "number") { // if the response was a number, it means an error // occurred // the user cancelled in fireworks window.Close(); alert("a...

  • Page 61

    61 5 chapter 5 flash integration macromedia dreamweaver 8 provides support for macromedia flash elements as well as continuing support for the flash object api, which leverages the flash generator template file to create new flash objects. This chapter describes ways of working with flash elements (...

  • Page 62

    62 flash integration inserting flash elements flash elements are installed through the extension manager. Dreamweaver adds flash elements to documents in the same manner as the objects that are available on the insert bar or the insert menu (for details about working with dreamweaver objects, see “i...

  • Page 63

    The flash objects api 63 adding a flash element to a menu a flash element can also reside on the insert menu, or on other menus, in dreamweaver. Use the javascript function dom.Insertflashelement() with the menus.Xml file format (see “menus and menu commands” in extending dreamweaver) to specify the...

  • Page 64

    64 flash integration arguments templatefile, templateparams, swffilename, {giffilename}, {pngfilename}, {jpgfilename}, {movfilename}, {generatorparams} ■ the templatefile argument is a path to a template file, which is expressed as a file:// url. This file can be a swt file. ■ the templateparams arg...

  • Page 65

    The flash objects api 65 ■ "invaliddata" means that one or more of the templateparams name/value pairs is invalid. ■ "initgeneratorfailed" means the generator cannot be initialized. ■ "outofmemory" means there is insufficient memory to complete the operation. ■ "unknownerror" means an unknown error ...

  • Page 66

    66 flash integration swffile.Getobjecttype() description this function returns the flash object type; the value that passed in the dwtype parameter when the swffile.Createfile() function created the file. Arguments filename ■ the filename argument, which is expressed as a file:// url, is a path to a...

  • Page 67

    The flash objects api 67 example calling var params = swffile.Readfile("file:///mymac/test.Swf") returns the following values in the parameters array: "file:///mymac/test.Swt" // template file used to create this .Swf file "dwtype" // first parameter "mytype" // first parameter value "text" // secon...

  • Page 68

    68 flash integration 000_dw_api_print.Book page 68 wednesday, july 20, 2005 11:58 am.

  • Page 69

    69 6 chapter 6 the database api functions in the database api let you manage database connections and access information that is stored in databases. The database api is divided by two distinct purposes: managing and accessing database connections. In managing database connections, you can get the u...

  • Page 70

    70 the database api var bissimple = parsesimplesql(statement); statement = stripcfifsimple(statement); if (bissimple) { statement = removewhereclause(statement,false); } else { var pa = new array(); if (ss.Paramarray != null) { for (var i = 0; i pa[i] = new array(); pa[i][0] = ss.Paramarray[i].Name;...

  • Page 71

    Database connection functions 71 returns nothing. Example the following example deletes a database connection: function clickeddelete() { var selectedobj = dw.Servercomponents.Getselectednode(); if (selectedobj && selectedobj.Objecttype=="connection") { var connrec = mmdb.Getconnection(selectedobj.N...

  • Page 72

    72 the database api arguments name ■ the name argument is a string variable that specifies the name of the connection that you want to reference. Returns a reference to a named connection object. Connection objects contain the following properties: property description name connection name type indi...

  • Page 73

    Database connection functions 73 mmdb.Getconnectionlist() availability dreamweaver ultradev 1. Description this function gets a list of all the connection strings that are defined in the connection manager. Arguments none. Returns an array of strings where each string is the name of a connection as ...

  • Page 74

    74 the database api the connection strings for connection 1 and connection 2 are the same. Connection 2 connects to a more recent version of the tdsdriver driver. You should pass the driver name to this function to fully qualify the connection name you want to return. Arguments connstring, {driverna...

  • Page 75

    Database connection functions 75 example the code var connectionstring = mmdb.Getconnectionstring ("empdb") returns different strings for an ado or jdbc connection. ■ for an ado connection, the following string can return: "dsn=empdb;uid=;pwd="; ■ for a jdbc connection, the following string can retu...

  • Page 76

    76 the database api for dreamweaver mx (or later), these drivers and url templates are hard-coded in the jdbc dialog boxes. In addition, this function is an empty function definition to eliminate undefined-function errors. The following example shows how a jdbc driver and url template are hard-coded...

  • Page 77

    Database connection functions 77 description this function gets the password that is used for the specified connection. Arguments connname ■ the connname argument is a connection name that is specified in the connection manager. It identifies the connection string that dreamweaver should use to make...

  • Page 78

    78 the database api arguments none. Returns a string that contains the rds user name. Mmdb.Getremotedsnlist() availability dreamweaver ultradev 4, enhanced in dreamweaver mx. Description this function gets the odbc dsns from the site server. The getrdsusername() and getrdspassword() functions are us...

  • Page 79

    Database connection functions 79 arguments connname ■ the connname argument is a connection name that is specified in the connection manager. It identifies the connection string that dreamweaver should use to make a database connection to a live data source. Returns a string that corresponds to the ...

  • Page 80

    80 the database api mmdb.Hasconnectionwithname() availability dreamweaver ultradev 4. Description this function determines whether a connection of a given name exists. Arguments name ■ the name argument is the connection name. Returns returns a boolean value: true indicates that a connection with th...

  • Page 81

    Database connection functions 81 mmdb.Needtorefreshcoldfusiondsnlist() availability dreamweaver mx. Description this function tells the connection manager to empty the cache and get the coldfusion data source list from the application server the next time a user requests the list. Arguments none. Re...

  • Page 82

    82 the database api or connrec, bduplicate ■ the dialogfilename argument is a string that contains the name of an html file that resides in the configuration/connections/server-model folder. This html file defines the dialog box that creates a connection. This file must implement three javascript ap...

  • Page 83

    Database connection functions 83 arguments username ■ the username argument is a valid rds user name. Returns nothing. Mmdb.Showcoldfusionadmin() availability dreamweaver mx. Description this function displays the coldfusion administrator dialog box. Arguments none. Returns nothing. The coldfusion a...

  • Page 84

    84 the database api description this function displays the system odbc administration dialog box or the odbc data source administrator dialog box. Arguments none. Returns nothing. The system odbc administration dialog box or the odbc data source administrator dialog box appears. Mmdb.Showrdsuserdial...

  • Page 85

    Database connection functions 85 arguments catalog, schema ■ the catalog argument is the initial catalog value. ■ the schema argument is the initial schema value. Returns an object that contains the new values in the catalog and schema properties. If either property is not defined, it indicates that...

  • Page 86

    86 the database api database access functions database access functions let you query a database. For the collection of functions that manage a database connection, see “database connection functions” on page 70 . The following list describes some of the arguments that are common to the functions th...

  • Page 87

    Database access functions 87 example the code var columnarray = mmdb.Getcolumnandtypelist("empdb","select * from employees") returns the following array of strings: columnarray[0] = "empname" columnarray[1] = "varchar" columnarray[2] = "empfirstname" columnarray[3] = "varchar" columnarray[4] = "age"...

  • Page 88

    88 the database api description this function returns an array of objects that describe the columns in the specified table. Arguments connname, tablename ■ the connname argument is the connection name. This value identifies the connection containing the string that dreamweaver should use to make a d...

  • Page 89

    Database access functions 89 mmdb.Getcolumnsoftable() availability dreamweaver ultradev 1. Description this function gets a list of all the columns in the specified table. Arguments connname, tablename ■ the connname argument is a connection name that is specified in the connection manager. It ident...

  • Page 90

    90 the database api ■ the tablename argument is the name of the table for which you want to retrieve the set of columns that comprises the primary key of that table. Returns an array of strings. The array contains one string for each column that comprises the primary key. Example the following examp...

  • Page 91

    Database access functions 91 returns an array of procedure objects where each procedure object has the following set of three properties: example the following code gets a list of procedures: var procobjects = mmdb.Getprocedures(connectionname); for (i = 0; i { var thisprocedure = procobjects[i] thi...

  • Page 92

    92 the database api var procname = string(thisschema + thisprocedure.Procedure); } mmdb.Getspcolumnlist() availability dreamweaver ultradev 1. Description this function gets a list of result set columns that are generated by a call to the specified stored procedure. Arguments connname, statement, pa...

  • Page 93

    Database access functions 93 mmdb.Getspcolumnlistnamedparams() availability dreamweaver ultradev 1. Description this function gets a list of result set columns that are generated by a call to the specified stored procedure. Arguments connname, statement, paramnamearray, paramvaluesarray ■ the connna...

  • Page 94

    94 the database api the following values return: columnarray[0] = "empid", columnarray[1] = "lastname",¬ columnarray[2] ="startdate", columnarray[3] = "salary" mmdb.Getspparameters() availability dreamweaver mx. Description this function returns an array of parameter objects for a named procedure. A...

  • Page 95

    Database access functions 95 var tooltiptext = paramobj.Datatype; tooltiptext+=" "; tooltiptext+=getdirstring(paramobj.Directiontype); } mmdb.Getspparamsasstring() availability dreamweaver ultradev 1. Description this function gets a comma-delimited string that contains the list of parameters that t...

  • Page 96

    96 the database api description this function gets a list of all the tables that are defined for the specified database. Each table object has three properties: table , schema , and catalog . Arguments connname ■ the connname argument is a connection name that is specified in the connection manager....

  • Page 97

    Database access functions 97 returns an array of view objects where each object has three properties: catalog , schema , and view . Use catalog or schema to restrict or filter the number of views that pertain to an individual schema name or catalog name that is defined as part of the connection info...

  • Page 98

    98 the database api returns nothing. This function returns an error if the sql statement or the connection string is invalid. Example the following code displays the results of the executed sql statement: mmdb.Showresultset("empdb","select empname,empfirstname,age ¬ from employees") mmdb.Showspresul...

  • Page 99

    Database access functions 99 mmdb.Showspresultset("empdb", "getnewemployeesmakingatleast", ¬ paramvaluearray) mmdb.Showspresultsetnamedparams() availability dreamweaver ultradev 1. Description this function displays a dialog box that contains the result set of the specified stored procedure. The dia...

  • Page 100

    100 the database api 000_dw_api_print.Book page 100 wednesday, july 20, 2005 11:58 am.

  • Page 101

    101 7 chapter 7 the database connectivity api as a developer, you can create new connection types and corresponding dialog boxes for new or existing server models for macromedia dreamweaver 8. Then, when a user sets up a site to start building pages, he or she creates a new connection object after s...

  • Page 102

    102 the database connectivity api for example, the default ado connection dialog box for an asp javascript document on a windows platform is stored in the asp_js/win folder and is named connection_ado_conn_string.Htm. The configuration/servermodels folder has html files that define each server model...

  • Page 103

    The connection api 103 unless you need to define connection parameters other than the ones provided in the standard connection_includefile.Edml file, these two steps are the minimum to create a new connection dialog box. The functions listed in the next section let you create a connection dialog box...

  • Page 104

    104 the database connectivity api when the user clicks ok in a connection dialog box, dreamweaver calls the applyconnection() function to build the html, which is placed in the connection include file that is located in the configuration/connections folder. The applyconnection() function returns an ...

  • Page 105

    The connection api 105 if a connection is not found in htmlsource, a null value returns. Inspectconnection() availability dreamweaver ultradev 4. Driver name of a jdbc driver used at runtime username name of the user for the runtime connection password password used for the runtime connection design...

  • Page 106

    106 the database connectivity api description dreamweaver calls this function to initialize the dialog box data for defining a connection when the user edits an existing connection. This process lets dreamweaver populate the dialog box with the appropriate connection information. Argument parameters...

  • Page 107

    The generated include file 107 the generated include file the include file that applyconnection() generates declares all the properties of a connection.The filename for the include file is the connection name and has the file extension that is defined for the server model associated with the current...

  • Page 108

    108 the database connectivity api the ultradev 4 coldfusion include file should be named myconnection1.Cfm, where myconnection1 is the name of your connection. The following example shows the include file for a coldfusion connection to a product table: = "products"> = ""> = ""> = ""> the server beha...

  • Page 109

    The definition file for your connection type 109 the definition file for your connection type for each server model, there is a connection_includefile.Edml file that defines the connection type and maps the properties that are defined in the include file to elements in the dreamweaver interface. Dre...

  • Page 110

    110 the database connectivity api // schema="@@schema@@" var mm_@@cname@@_string = @@string@@ %> ]]> tokens in an edml file—such as @@filename@@ in this example—map values in the include file to properties of a connection object. You set the properties of connection objects in the javascript impleme...

  • Page 111

    111 8 chapter 8 the javabeans api this chapter explains the apis for javabeans; the mmjb*() functions are javascript hooks that invoke java introspection calls for javabeans support. These functions get class names, methods, properties, and events from the javabeans, which can appear in the dreamwea...

  • Page 112

    112 the javabeans api mmjb.Getclassesfrompackage() availability dreamweaver ultradev 4. Description this function reads all the javabeans classes from the package. Arguments packagename.Pathname ■ the packagename.Pathname argument is the path to the package. It must be a java jar or zip java archive...

  • Page 113

    The javabeans api 113 arguments packagename.Classname, {packagepath} ■ the packagename.Classname argument is the name of the class. The class must reside in a jar or zip java archive. If packagepath is omitted, the archive must reside in your system classpath or be a class file that is installed in ...

  • Page 114

    114 the javabeans api description introspects the javabeans class and returns its methods. Arguments packagename.Classname, {packagepath} ■ the packagename.Classname argument is the name of the class. The class must reside in a jar or zip java archive. If packagepath is omitted, the archive must res...

  • Page 115

    The javabeans api 115 description gets read-only properties for javabeans that support get accessor calls. Arguments packagename.Classname, {packagepath} ■ the packagename.Classname argument is the name of the class. The class must reside in a jar or zip java archive. If packagepath is omitted, the ...

  • Page 116

    116 the javabeans api 000_dw_api_print.Book page 116 wednesday, july 20, 2005 11:58 am.

  • Page 117

    117 9 chapter 9 the source control integration api the source control integration api lets you write shared libraries to extend the macromedia dreamweaver 8 check in/check out feature using source control systems (such as sourcesafe or cvs). Your libraries must support a minimum set of api functions...

  • Page 118

    118 the source control integration api how source control integration with dreamweaver works when a dreamweaver user selects server connection, file transfer, or design notes features, dreamweaver calls the dll’s version of the corresponding api function ( connect() , disconnect() , get() , put() , ...

  • Page 119

    The source control integration api required functions 119 the source control integration api required functions the source control integration api has required and optional functions. The functions listed in this section are required. Bool scs_getagentinfo() description this function asks the dll to...

  • Page 120

    120 the source control integration api bool scs_connect() description this function connects the user to the source control system. If the dll does not have log-in information, the dll must display a dialog box to prompt the user for the information and must store the data for later use. Arguments v...

  • Page 121

    The source control integration api required functions 121 arguments void *connectiondata ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver during the connect() call. Returns a boolean value: true if successful; false otherwise. Int scs_getrootfolderlength() ...

  • Page 122

    122 the source control integration api int scs_getfolderlistlength() description this function returns the number of items in the passed-in folder. Arguments void *connectiondata, const char *remotepath ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver durin...

  • Page 123

    The source control integration api required functions 123 ■ the numitems argument is the number of items that are allocated for the itemlist (returned from getfolderlistlength ). Returns a boolean value: true if successful; false otherwise. Bool scs_get() description this function gets a list of fil...

  • Page 124

    124 the source control integration api bool scs_put() description this function puts a list of local files or folders into the source control system. Arguments void *connectiondata, const char *localpathlist[], const char *remotepathlist[], const int numitems ■ the connectiondata argument is a point...

  • Page 125

    The source control integration api required functions 125 arguments void *connectiondata, const char *remotepathlist[], const int numitems ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver during the connect() call. ■ the remotepathlist argument is a list of...

  • Page 126

    126 the source control integration api bool scs_itemexists() description this function determines whether a file or folder exists on the server. Arguments void *connectiondata, const char *remotepath ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver during t...

  • Page 127

    The source control integration api optional functions 127 bool scs_sitedeleted() description this function notifies the dll that the site has been deleted or that the site is no longer tied to this source control system. It indicates that the source control system can delete its persistent informati...

  • Page 128

    128 the source control integration api returns an integer that indicates the number of new features to add to dreamweaver. If the function returns , dreamweaver considers it an error and tries to retrieve the error message from the dll, if supported. Bool scs_getnewfeatures() description this functi...

  • Page 129

    The source control integration api optional functions 129 bool scs_getcheckoutname() description this function returns the check-out name of the current user. If it is unsupported by the source control system and this feature is enabled by the user, this function uses the dreamweaver internal check ...

  • Page 130

    130 the source control integration api returns a boolean value: true if successful; false otherwise. Bool scs_checkout() description this function checks out a list of local files or folders from the source control system. The dll is responsible for granting the privileges that let the file be writa...

  • Page 131

    The source control integration api optional functions 131 arguments void *connectiondata, const char *remotepathlist[], const char *localpathlist[], bool successlist[], const int numitems ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver during the connect()...

  • Page 132

    132 the source control integration api bool scs_getfilecheckoutlist() description this function returns a list of users who have a file checked out. If the list is empty, no one has the file checked out. Arguments void *connectiondata, const char *remotepath, char checkoutlist[][64], char emailaddre...

  • Page 133

    The source control integration api optional functions 133 bool scs_geterrormessage() description this function returns the last error message. If you implement geterrormessage() , dreamweaver calls it each time one of your api functions returns the value false . If a routine returns -1 or false , it...

  • Page 134

    134 the source control integration api int scs_getmaxnotelength() description this function returns the length of the largest design note for the specified file or folder. If it is unsupported by the source control system, dreamweaver gets this information from the companionmno file. Arguments void ...

  • Page 135

    The source control integration api optional functions 135 ■ the showcolumnlist argument is a list of boolean values that correspond to the design note keys, which indicate whether dreamweaver can display the key as a column in the site panel. ■ the notecount argument is the number of design notes th...

  • Page 136

    136 the source control integration api returns a boolean value: true if successful; false otherwise. Bool scs_isremotenewer() description this function checks each specified remote path to see if the remote copy is newer. If it is unsupported by the source control system, dreamweaver uses its intern...

  • Page 137

    Enablers 137 enablers if the optional enablers are not supported by the source control system or the application is not connected to the server, dreamweaver determines when the menu items are enabled, based on the information it has about the remote files. Bool scs_canconnect() description this func...

  • Page 138

    138 the source control integration api bool scs_cancheckout() description this function returns whether the checkout menu item should be enabled. Arguments void *connectiondata, const char *remotepathlist[], const char *localpathlist[], const int numitems ■ the connectiondata argument is a pointer t...

  • Page 139

    Enablers 139 bool scs_cancheckin() description this function returns whether the checkin menu item should be enabled. Arguments void *connectiondata, const char *localpathlist[], const char *remotepathlist[], const int numitems ■ the connectiondata argument is a pointer to the agent’s data that pass...

  • Page 140

    140 the source control integration api bool scs_cannewfolder() description this function returns whether the new folder menu item should be enabled. Arguments void *connectiondata, const char *remotepath ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver duri...

  • Page 141

    Enablers 141 arguments void *connectiondata, const char *remotepath ■ the connectiondata argument is a pointer to the agent’s data that passed into dreamweaver during the connect() call. ■ the remotepathlist argument is the remote filenames or folder paths that can be renamed. Returns a boolean valu...

  • Page 142

    142 the source control integration api bool scs_beforeput() description dreamweaver calls this function before putting or checking in one or more files. This function lets your dll perform one operation, such as adding a check-in comment, to a group of files. Arguments *connectiondata ■ the * connec...

  • Page 143

    Enablers 143 example see “bool scs_beforeget()” on page 141 . Bool scs_afterput() description dreamweaver calls this function after putting or checking in one or more files. This function lets the dll perform any operation after a batch put or check in, such as creating a summary dialog box. Argumen...

  • Page 144

    144 the source control integration api 000_dw_api_print.Book page 144 wednesday, july 20, 2005 11:58 am.

  • Page 145

    145 2 part 2 javascript api use any of the more than 600 core javascript functions available in macromedia dreamweaver 8, which encapsulate the kinds of tasks users perform when creating or editing a document. You can use these functions to perform any task that the user can accomplish using menus, ...

  • Page 146

    000_dw_api_print.Book page 146 wednesday, july 20, 2005 11:58 am.

  • Page 147

    147 10 chapter 10 application the application functions perform operations related to macromedia dreamweaver 8’s interaction with other applications or dreamweaver operations independent of individual documents (setting preferences, exiting dreamweaver, and other functions). External application fun...

  • Page 148

    148 application ■ the browser argument, which was added in dreamweaver 3, specifies a browser. This argument can be the name of a browser, as defined in the preview in browser preferences or either 'primary' or 'secondary' . If the argument is omitted, the url opens in the user’s primary browser. Re...

  • Page 149

    External application functions 149 returns an array that contains a pair of strings for each browser in the list. The first string in each pair is the name of the browser, and the second string is its location on the user’s computer, which is expressed as a file:// url. If no browsers appear in the ...

  • Page 150

    150 application arguments none. Returns a string that contains the name of the text editor that is suitable for presentation in the user interface (ui), not the full path. Dreamweaver.Getflashpath() availability dreamweaver mx. Description gets the full path to the flash mx application in the form o...

  • Page 151

    External application functions 151 description gets the path to the primary browser. Arguments none. Returns a string that contains the path on the user’s computer to the primary browser, which is expressed as a file:// url. If no primary browser is defined, it returns nothing. Dreamweaver.Getprimar...

  • Page 152

    152 application returns a string that contains the path on the user’s computer to the secondary browser, which is expressed as a file:// url. If no secondary browser is defined, it returns nothing. Dreamweaver.Openhelpurl() availability dreamweaver mx. Description opens the specified help file in th...

  • Page 153

    External application functions 153 ■ the help.Map file the help.Map file maps a help content id to a specific help book. Dreamweaver uses the help.Map file to locate specific help content when it calls help internally. ■ the helpdoc.Js file the helpdoc.Js file lets you map variable names that you ca...

  • Page 154

    154 application returns nothing. Dreamweaver.Openwithbrowsedialog() availability dreamweaver 3. Description opens the select external editor dialog box to let the user select the application with which to open the specified file. Arguments fileurl ■ the fileurl argument is the path to the file to op...

  • Page 155

    Global application functions 155 description opens the named file with the specified image editor. Arguments fileurl, appurl ■ the fileurl argument is the path to the file to open, which is expressed as a file:// url. ■ the appurl argument is the path to the application with which to open the file, ...

  • Page 156

    156 application dreamweaver.Beep() availability dreamweaver mx. Description creates a system beep. Arguments none. Returns nothing. Example the following example calls dw.Beep() to call the user’s attention to a message that the alert() function displays: beep(){ if(confirm(“is your order complete?”...

  • Page 157

    Global application functions 157 dreamweaver.Quitapplication() availability dreamweaver 3. Description quits dreamweaver after the script that calls this function finishes executing. Arguments none. Returns nothing. Dreamweaver.Showaboutbox() availability dreamweaver 3. Description opens the about d...

  • Page 158

    158 application description displays the dynamic data or the dynamic text dialog box, and waits for the user to dismiss the dialog box. If the user clicks ok, the showdynamicdatadialog() function returns a string to insert into the user’s document. (this string returns from the data sources api func...

  • Page 159

    Global application functions 159 returns nothing. Example dw.Showpastespecialdialog(); dreamweaver.Showpreferencesdialog() availability dreamweaver 3. Added the strcategory argument in dreamweaver 8. Description this function opens the preferences dialog box. Arguments {strcategory} ■ the strcategor...

  • Page 160

    160 application dreamweaver.Showtagchooser() availability dreamweaver mx. Description toggles the visibility of the tag chooser dialog box for users to insert tags into the code view. The function shows the tag chooser dialog box on top of all other dreamweaver windows. If the dialog box is not visi...

  • Page 161

    161 11 chapter 11 workspace workspace api functions create or operate on an element of the macromedia dreamweaver 8 workspace. They perform tasks such as redoing steps that appear in the history panel, placing an object on the insert bar, navigating with keyboard functions, reloading menus, manipula...

  • Page 162

    162 workspace dom.Undo() availability dreamweaver 3. Description undoes the previous step in the document. Arguments none. Returns nothing. Enabler see “dom.Canundo()” on page 563 . Dreamweaver.Getredotext() availability dreamweaver 3. Description gets the text that is associated with the editing op...

  • Page 163

    History functions 163 dreamweaver.Getundotext() availability dreamweaver 3. Description gets the text that is associated with the editing operation that will be undone if the user selects edit > undo or presses control+z (windows) or command+z (macintosh). Arguments none. Returns a string that conta...

  • Page 164

    164 workspace dreamweaver.Redo() availability dreamweaver 3. Description redoes the step that was most recently undone in the active document window, dialog box, floating panel, or site panel. Arguments none. Returns nothing. Enabler see “dreamweaver.Canredo()” on page 570 . Dreamweaver.Startrecordi...

  • Page 165

    History functions 165 dreamweaver.Stoprecording() availability dreamweaver 3. Description stops recording without prompting the user. Arguments none. Returns nothing. Enabler see “dreamweaver.Isrecording()” on page 579 (must return a value of true ). Dreamweaver.Undo() availability dreamweaver 3. De...

  • Page 166

    166 workspace description clears all steps from the history panel and disables the undo and redo menu items. Arguments none. Returns nothing. Dreamweaver.Historypalette.Copysteps() availability dreamweaver 3. Description copies the specified history steps to the clipboard. Dreamweaver warns the user...

  • Page 167

    History functions 167 returns an array that contains the position indices of all the selected steps. The first position is position 0 (zero). Example if the second, third, and fourth steps are selected in the history panel, as shown in the following figure, a call to the dreamweaver.Historypalette.G...

  • Page 168

    168 workspace arguments arrayofindices ■ the arrayofindices argument is an array of position indices in the history panel. Returns a string that contains the javascript that corresponds to the specified history steps. Example if the three steps shown in the following example are selected in the hist...

  • Page 169

    History functions 169 dreamweaver.Historypalette.Replaysteps() availability dreamweaver 3. Description replays the specified history steps in the active document. Dreamweaver warns the user of possible unintended consequences if the specified steps include an unrepeatable action. Arguments arrayofin...

  • Page 170

    170 workspace example the following example saves the fourth, sixth, and eighth steps in the history panel as a command: dreamweaver.Historypalette.Saveascommand([3,5,7]); dreamweaver.Historypalette.Setselectedsteps() availability dreamweaver 3. Description selects the specified steps in the history...

  • Page 171

    Insert object functions 171 returns nothing. Insert object functions insert object functions handle operations related to the objects on the insert bar or listed on the insert menu. Dom.Insertflashelement() availability dreamweaver mx 2004. Description inserts a specified flash element (swc file) in...

  • Page 172

    172 workspace arguments menuid ■ the menuid argument is the string that defines the menu in the insertbar.Xml file. Returns a string value defining the id of the default item. Example the following example assigns the current default object for the media menu to the defid variable: var defid = dw.Ob...

  • Page 173

    Keyboard functions 173 dreamweaver.Reloadobjects() availability dreamweaver mx 2004. Description reloads all the objects on the insert bar. This function is the equivalent of control+left- clicking the mouse on the categories menu on the insert bar and selecting the reload extensions menu option. Ar...

  • Page 174

    174 workspace returns nothing. Dom.Arrowleft() availability dreamweaver 3. Description moves the insertion point to the left the specified number of times. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is optional, is the number of times that the insertion point must move left. If ...

  • Page 175

    Keyboard functions 175 dom.Arrowup() availability dreamweaver 3. Description this function moves the insertion point up the specified number of times. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is optional, is the number of times that the insertion point must move up. If this ar...

  • Page 176

    176 workspace dom.Deletekey() availability dreamweaver 3. Description this function is equivalent to pressing the delete key the specified number of times. The exact behavior depends on whether there is a current selection or only an insertion point. Arguments {ntimes} ■ the ntimes argument, which i...

  • Page 177

    Keyboard functions 177 dom.Endofline() availability dreamweaver 3. Description moves the insertion point to the end of the line. Arguments {bshiftisdown} ■ the bshiftisdown argument, which is optional, is a boolean value that indicates whether to extend the selection. If the argument is omitted, the...

  • Page 178

    178 workspace dom.Nextword() availability dreamweaver 3. Description moves the insertion point to the beginning of the next word or skips multiple words if ntimes is greater than 1. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is optional, is the number of words that the insertion...

  • Page 179

    Keyboard functions 179 dom.Pageup() availability dreamweaver 3. Description moves the insertion point up one page (equivalent to pressing the page up key). Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is optional, is the number of pages that the insertion point must move up. If th...

  • Page 180

    180 workspace dom.Previousword() availability dreamweaver 3. Description moves the insertion point to the beginning of the previous word or skips multiple words if ntimes is greater than 1. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is optional, is the number of words that the i...

  • Page 181

    Keyboard functions 181 dom.Startofline() availability dreamweaver 3. Description moves the insertion point to the beginning of the line. Arguments {bshiftisdown} ■ the bshiftisdown argument, which is optional, is a boolean value that indicates whether to extend the selection. If the argument is omit...

  • Page 182

    182 workspace menu functions menu functions handle optimizing and reloading the menus in dreamweaver. The dreamweaver.Getmenuneedsupdating() function and the dreamweaver.Notifymenuupdated() function are designed specifically to prevent unnecessary update routines from running on the dynamic menus th...

  • Page 183

    Results window functions 183 arguments menuid, menulistfunction ■ the menuid argument is a string that contains the value of the id attribute for the menu item, as specified in the menus.Xml file. ■ the menulistfunction argument must be one of the following strings: "dw.Cssstylepalette.Getstyles()" ...

  • Page 184

    184 workspace dreamweaver.Createresultswindow() availability dreamweaver 4. Description creates a new results window and returns a javascript object reference to the window. Arguments strname, arrcolumns ■ the strname argument is the string to use for the window’s title. ■ the arrcolumns argument is...

  • Page 185

    Results window functions 185 example the following example checks for errors at the offset of the current selection in the document and, if there are errors, displays them in the specified window ( floatername ) of the results panel. Otherwise, it opens the target browser check window of the results...

  • Page 186

    186 workspace ■ the itemdata argument is a string you can use to store specific data about the item being added such as a document line number. ■ the istartsel argument is the start of selection offset in the file. Specify the value null if you are not specifying an offset. ■ the iendsel argument is...

  • Page 187

    Results window functions 187 arguments strfilepath, stricon, strdisplay, strdesc, {ilineno}, {istartsel}, {iendsel} ■ the strfilepath argument is a fully qualified url path of the file to process. ■ the stricon argument is the path to the icon to use. To display a built-in icon, use a value "1" thro...

  • Page 188

    188 workspace returns an array of strings. The first element in the array is the name of the command that added the item; the remaining elements are the same strings that were passed to the additem() function. Reswin.Getitemcount() availability dreamweaver 4. Description retrieves the number of item...

  • Page 189

    Results window functions 189 description sets the buttons specified by the arrbuttons argument. Arguments cmddoc , arrbuttons ■ the cmddoc argument is a document object that represents the command that is calling the function. Commands should use the keyword this . ■ the arrbuttons argument is an ar...

  • Page 190

    190 workspace arguments arrwidth ■ the arrwidth argument is an array of integers that represents the widths to use for each column in the control. Returns nothing. Reswin.Setfilelist() availability dreamweaver 4. Description gives the results window a list of files, folders, or both to call a set of...

  • Page 191

    Results window functions 191 reswin.Settitle() availability dreamweaver 4. Description sets the title of the window. Arguments strtitle ■ the strtitle argument is the new name of the floating panel. Returns nothing. Reswin.Startprocessing() availability dreamweaver 4. Description starts processing t...

  • Page 192

    192 workspace returns nothing. Working with the built-in results panel group these functions produce output in the results panel group. The results panel group displays tabbed reports on searches, source validation, sitewide reports, browser targets, console reports, ftp logging, and link checking. ...

  • Page 193

    Results window functions 193 enabler see “dreamweaver.Resultspalette.Canclear()” on page 579 . Dreamweaver.Resultspalette.Copy() availability dreamweaver mx. Description sends a copied message to the window that is in focus (often used for the ftp logging window). Arguments none. Returns nothing. En...

  • Page 194

    194 workspace dreamweaver.Resultspalette.Paste() availability dreamweaver mx. Description sends a pasted message to the window in focus (often used for the ftp logging window). Arguments none. Returns nothing. Enabler see “dreamweaver.Resultspalette.Canpaste()” on page 580 . Dreamweaver.Resultspalet...

  • Page 195

    Results window functions 195 dreamweaver.Resultspalette.Openineditor() availability dreamweaver mx. Description jumps to the selected line for specific reports (site reports, browser target check, validation, and link checker), and opens the document in the editor. Arguments none. Returns nothing. E...

  • Page 196

    196 workspace dreamweaver.Resultspalette.Selectall() availability dreamweaver mx. Description sends a select all command to the window in focus. Arguments none. Returns nothing. Enabler see “dreamweaver.Resultspalette.Canselectall()” on page 582 . Server debugging dreamweaver can request files from ...

  • Page 197

    Results window functions 197 dreamweaver.Resultspalette.Debugwindow.Adddebug contextdata() availability dreamweaver mx. Description interprets a customized xml file that returns from the server that is specified in the site definition dialog box. The contents of the xml file display as tree data in ...

  • Page 198

    198 workspace for example: name.Macromedia.Com:1111;databasename=pubs]]> name.Macromedia.Com:1111;databasename=pubs]]> coldfusion.Compiler.Taginfonotfoundexception]]> coldfusion.Compiler.Taginfonotfoundexception]]> returns nothing. Toggle functions toggle functions get and set various options either...

  • Page 199

    Toggle functions 199 arguments none. Returns a boolean value: true indicates the noframes content is the active view; false otherwise. Dom.Gethideallvisualaids() availability dreamweaver 4. Description this function determines whether visual aids are set as hidden. Arguments none. Returns a boolean ...

  • Page 200

    200 workspace dom.Getshowautoindent() availability dreamweaver 4. Description this function determines whether auto-indenting is on in the code view of the document window. Arguments none. Returns a boolean value: true if auto-indenting is on; false otherwise. Dom.Getshowframeborders() availability ...

  • Page 201

    Toggle functions 201 returns a boolean value: true indicates the grid is visible; false otherwise. Dom.Getshowheadview() availability dreamweaver 3. Description this function gets the current state of the view > head content option. Arguments none. Returns a boolean value: true indicates the head co...

  • Page 202

    202 workspace arguments none. Returns a boolean value: true indicates the image maps are visible; false otherwise. Dom.Getshowinvisibleelements() availability dreamweaver 3. Description this function gets the current state of the view > invisible elements option. Arguments none. Returns a boolean va...

  • Page 203

    Toggle functions 203 description this function determines whether line numbers are shown in the code view. Arguments none. Returns a boolean value: true indicates the line numbers are shown; false otherwise. Dom.Getshowrulers() availability dreamweaver 3. Description this function gets the current s...

  • Page 204

    204 workspace dom.Getshowtableborders() availability dreamweaver 3. Description this function gets the current state of the view > table borders option. Arguments none. Returns a boolean value: true indicates the table borders are visible; false otherwise. Dom.Getshowtoolbar() availability dreamweav...

  • Page 205

    Toggle functions 205 returns a boolean value: true indicates the option is on; false otherwise. Dom.Getshowwordwrap() availability dreamweaver 4. Description this function determines whether word wrap is on in the code view of the document window. Arguments none. Returns a boolean value: true if wor...

  • Page 206

    206 workspace arguments beditnoframes ■ the beditnoframes argument is a boolean value: true turns on the edit noframes content option; false turns it off. Returns nothing. Enabler see “dom.Caneditnoframescontent()” on page 556 . Dom.Sethideallvisualaids() availability dreamweaver 4. Description this...

  • Page 207

    Toggle functions 207 returns nothing. Dom.Setshowframeborders() availability dreamweaver 3. Description this function toggles the view > frame borders option on and off. Arguments bshowframeborders ■ the bshowframeborders argument is a boolean value: true turns the frame borders on; false otherwise....

  • Page 208

    208 workspace dom.Setshowheadview() availability dreamweaver 3. Description this function toggles the view > head content option on and off. Arguments bshowhead ■ the bshowhead argument is a boolean value: true turns on the head content option; false turns it off. Returns nothing. Dom.Setshowinvalid...

  • Page 209

    Toggle functions 209 dom.Setshowimagemaps() availability dreamweaver 3. Description this function toggles the view > image maps option on and off. Arguments bshowimagemaps ■ the bshowimagemaps argument is a boolean value, true turns on the image maps option; false turns it off. Returns nothing. Dom....

  • Page 210

    210 workspace arguments bshowlayerborders ■ the bshowlayerborders argument is a boolean value, true turns on the layer borders option; false turns it off. Returns nothing. Dom.Setshowlinenumbers() availability dreamweaver 4. Description this function shows or hides the line numbers in the code view ...

  • Page 211

    Toggle functions 211 dom.Setshowsyntaxcoloring() availability dreamweaver 4. Description this function turns syntax coloring on or off in the code view of the document window. Arguments bshow ■ the bshow argument is a boolean value: true indicates that syntax coloring should be visible; false otherw...

  • Page 212

    212 workspace arguments bshow ■ the bshow argument is a boolean value: true indicates the toolbar should be visible; false otherwise. Returns nothing. Dom.Setshowtracingimage() availability dreamweaver 3. Description this function toggles the view > tracing image > show option on and off. Arguments ...

  • Page 213

    Toggle functions 213 returns nothing. Dom.Setsnaptogrid() availability dreamweaver 3. Description this function toggles the view > grid > snap to option on or off. Arguments bsnaptogrid ■ the bsnaptogrid argument is a boolean value: true turns on the snap to option; false turns it off. Returns nothi...

  • Page 214

    214 workspace dreamweaver.Getshowstatusbar() availability dreamweaver 3. Description this function gets the current state of the view > status bar option. Arguments none. Returns a boolean value: true indicates the status bar is visible; false otherwise. Dreamweaver.Htmlinspector.Getshowautoindent()...

  • Page 215

    Toggle functions 215 returns a boolean value: true if invalid html code is highlighted; false otherwise. Dreamweaver.Htmlinspector.Getshowlinenumbers() availability dreamweaver 4. Description this function determines whether line numbers appear in the code inspector. Arguments none. Returns a boolea...

  • Page 216

    216 workspace arguments none. Returns a boolean value: true if word wrap is on; false otherwise. Dreamweaver.Htmlinspector.Setshowautoindent() availability dreamweaver 4. Description this function turns the auto indent option on or off in the code inspector. Arguments bshow ■ the bshow argument is a...

  • Page 217

    Toggle functions 217 dreamweaver.Htmlinspector.Setshowlinenumbers() availability dreamweaver 4. Description this function shows or hides the line numbers in the code view of the code inspector. Arguments bshow ■ the bshow argument is a boolean value: true sets the line numbers to visible; false hide...

  • Page 218

    218 workspace dreamweaver.Htmlinspector.Setshowwordwrap() availability dreamweaver 4. Description this function turns the word wrap option off or on in the code inspector. Arguments bshow ■ the bshow argument is a boolean value: true turns word wrap on; false turns it off. Returns nothing. Dreamweav...

  • Page 219

    Toggle functions 219 arguments bshowstatusbar ■ the bshowstatusbar argument is a boolean value: true turns on the status bar option; false turns it off. Returns nothing. Site.Getshowdependents() availability dreamweaver 3. Description this function gets the current state of the show dependent files ...

  • Page 220

    220 workspace site.Getshowpagetitles() availability dreamweaver 3. Description this function gets the current state of the show page titles option. Arguments none. Returns a boolean value: true indicates that the page titles are visible in the site map; false otherwise. Site.Getshowtooltips() availa...

  • Page 221

    Toggle functions 221 arguments bshowdependentfiles ■ the bshowdependentfiles argument is a boolean value: true turns on the show dependent files option; false turns it off. Returns nothing. Site.Setshowhiddenfiles() availability dreamweaver 3. Description this function toggles the show files marked ...

  • Page 222

    222 workspace enabler see “site.Canshowpagetitles()” on page 596 . Site.Setshowtooltips() availability dreamweaver 3. Description this function toggles the tool tips option on or off. Arguments bshowtooltips ■ the bshowtooltips argument is a boolean value: true turns on the tool tips option; false t...

  • Page 223

    Toolbar functions 223 returns nothing. Dom.Getshowtoolbariconlabels() availability dreamweaver mx. Description this function determines whether labels for buttons are visible in the current document window. Dreamweaver always shows labels for non-button controls, if the labels are defined. Arguments...

  • Page 224

    224 workspace returns an array of all toolbar ids. Example the following example stores the array of toolbar ids in the tb_ids variable: var tb_ids = new array(); tb_ids = dom.Gettoolbaridarray(); dom.Gettoolbaritemvalue() availability dreamweaver mx 2004. Description gets the value of the specified...

  • Page 225

    Toolbar functions 225 dom.Gettoolbarlabel() availability dreamweaver mx. Description this function obtains the label of the specified toolbar. You can use dom.Gettoolbarlabel() for menus that show or hide toolbars. Arguments toolbar_id ■ the toolbar_id argument is the id of the toolbar, which is the...

  • Page 226

    226 workspace example the following example checks whether the toolbar myeditbar is visible in the document window, and then stores that value in the retval variable: var retval = dom.Gettoolbarvisibility("myeditbar"); return retval; dom.Settoolbaritemattribute() availability dreamweaver mx 2004. De...

  • Page 227

    Toolbar functions 227 dom.Setshowtoolbariconlabels() availability dreamweaver mx. Description this function tells dreamweaver to show the labels of buttons that have labels. Dreamweaver always shows labels for non-button controls, if the labels are defined. Arguments bshow ■ the bshow argument is a ...

  • Page 228

    228 workspace ■ the position argument specifies where dreamweaver positions the toolbar, relative to other toolbars. The possible values for position are described in the following list: ■ top is the default position. The toolbar appears at the top of the document window. ■ below makes the toolbar a...

  • Page 229

    Window functions 229 example the following example checks to see if the toolbar myeditbar is visible in the document window; if it is not visible, it sets myeditbar to be visible: var dom = dw.Getdocumentdom(); if(dom != null && dom.Gettoolbarvisibility("myeditbar") == false) { dom.Settoolbarvisibil...

  • Page 230

    230 workspace dom.Getview() availability dreamweaver 4. Description this function determines which view is visible. Arguments none. Returns "design" , "code" , or "split" , depending on the visible view. Dom.Getwindowtitle() availability dreamweaver 3. Description this function gets the title of the...

  • Page 231

    Window functions 231 arguments viewstring ■ the viewstring argument is the view to produce; it must be one of the following values: "design" , "code" , or "split". Returns nothing. Dreamweaver.Bringattentiontofloater() availability dreamweaver mx. Description brings the specified panel or inspector ...

  • Page 232

    232 workspace arguments none. Returns nothing. Example the following example cascades the open documents: dw.Cascade() dreamweaver.Getactivewindow() availability dreamweaver 3. Description this function gets the document in the active window. Arguments none. Returns the document object that correspo...

  • Page 233

    Window functions 233 dreamweaver.Getfloatervisibility() availability dreamweaver 3. Description this function checks whether the specified panel or inspector is visible. Arguments floatername ■ the floatername argument is the name of a floating panel. If floatername does not match one of the built-i...

  • Page 234

    234 workspace returns a boolean value: true if the floating panel is visible and in the front; false otherwise or if dreamweaver cannot find a floating panel named floatername . Dreamweaver.Getfocus() availability dreamweaver 4. Description this function determines what part of the application is cu...

  • Page 235

    Window functions 235 dreamweaver.Getprimaryview() availability dreamweaver 4. Description this function determines which view is visible as the primary view in the front. Arguments none. Returns the "design" or "code" strings, depending on which view is visible or on the top in a split view. Dreamwe...

  • Page 236

    236 workspace arguments bminimize ■ the bminimize argument is a boolean value: true if windows should be minimized; false if the minimized windows should be restored. Returns nothing. Dreamweaver.Setactivewindow() availability dreamweaver 3. Description this function activates the window that contai...

  • Page 237

    Window functions 237 arguments floatername, bisvisible ■ the floatername argument is the name of a floating panel. If floatername does not match one of the built-in panel names, dreamweaver searches in the configuration/ floaters folder for a file called floatername . Htm where floatername is the na...

  • Page 238

    238 workspace the bisvisible argument is a boolean value that indicates whether to make the floating panel visible. Returns nothing. Dreamweaver.Setprimaryview() availability dreamweaver 4. Description this function displays the specified view at the top of the document window. Arguments viewstring ...

  • Page 239

    Window functions 239 arguments snapdistance ■ the snapdistance argument is an integer that represents the snapping distance in pixels. The default is 10 pixels. Specify 0 to turn off the snap feature. Returns nothing. Dreamweaver.Showproperties() availability dreamweaver 3. Description this function...

  • Page 240

    240 workspace example the following example tiles the open documents horizontally: dw.Tilehorizontally() dreamweaver.Tilevertically() availability dreamweaver mx (windows only), dreamweaver 8 (added macintosh support). Description tiles the document window vertically, positioning one document window...

  • Page 241

    Code collapse functions 241 arguments floatername ■ the floatername argument is the name of the window. If the floating panel name is reference , the visible/invisible state of the reference panel is updated by the user’s selection in code view. All other panels track the selection all the time, but...

  • Page 242

    242 workspace 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...

  • Page 243

    Code collapse functions 243 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); ...

  • Page 244

    244 workspace description this function collapses all code before and after the selected code in code view. Arguments allowadjustmentofcodefragments ■ the allowadjustmentofcodefragments argument is a required, boolean value. If true , dreamweaver adjusts the boundaries of the code before and after t...

  • Page 245

    Code collapse functions 245 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 nothi...

  • Page 246

    246 workspace 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() availabil...

  • Page 247

    Code collapse functions 247 description this function collapses the selected code in the code inspector. If the selection is already collapsed, this function does nothing. Arguments allowcodefragmentadjustment ■ the allowcodefragmentadjustment is a required, boolean value. If true , dreamweaver modi...

  • Page 248

    248 workspace 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 dreamw...

  • Page 249

    Code view toolbar functions 249 example the following example expands all collapsed code in the current selection in the code inspector: dreamweaver.Htmlinspector.Expandselectedcodefragments(); code view toolbar functions code view toolbar functions let you insert text, remove comments, show or hide...

  • Page 250

    250 workspace 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 o...

  • Page 251

    Code view toolbar functions 251 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 t...

  • Page 252

    252 workspace 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 s...

  • Page 253

    Code view toolbar functions 253 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.Setsho...

  • Page 254

    254 workspace 000_dw_api_print.Book page 254 wednesday, july 20, 2005 11:58 am.

  • Page 255

    255 12 chapter 12 site site functions perform operations related to managing a website. These operations include customizing a report, defining a new site, checking in and checking out files, running validation on a site and so on. Report functions report functions provide access to the macromedia d...

  • Page 256

    256 site dreamweaver.Showreportsdialog() availability dreamweaver 4. Description opens the reports dialog box. Arguments none. Returns nothing. Site functions site functions handle operations that are related to files in the site files or site map. These functions let you perform the following tasks...

  • Page 257

    Site functions 257 returns a string, which specifies the site url prefix. Example the following example gets the site url prefix for the current document: var currentdom = dw.Getdocumentdom(); var siteprefix = dom.Getsiteurlprefixfromdoc(); dom.Localpathtositerelative() availability dreamweaver 8. D...

  • Page 258

    258 site arguments siterelativeuri ■ the siterelativeuri attribute, which is required, is a string that contains the site- relative uri. Returns a string, which specifies the path to a local file on your local computer. Example the following var filepath = siterelativetolocalpath("/mywebapp/myfile.X...

  • Page 259

    Site functions 259 dreamweaver.Loadsitesfromprefs() availability dreamweaver 4. Description loads the site information for all the sites from the system registry (windows) or the dreamweaver preferences file (macintosh) into dreamweaver. If a site is connected to a remote server when this function i...

  • Page 260

    260 site arguments none. Returns nothing. Enabler see “dreamweaver.Sitesyncdialog.Cancompare()” on page 582 . Dreamweaver.Sitesyncdialog.Markdelete() availability dreamweaver 8. Description this function changes the action for the selected items in the site synchronization dialog box to delete. Argu...

  • Page 261

    Site functions 261 returns nothing. Enabler see “dreamweaver.Sitesyncdialog.Canmarkget()” on page 583 . Dreamweaver.Sitesyncdialog.Markignore() availability dreamweaver 8. Description this function changes the action for the selected items in the site synchronization dialog box to ignore. Arguments ...

  • Page 262

    262 site enabler see “dreamweaver.Sitesyncdialog.Canmarkput()” on page 584 . Dreamweaver.Sitesyncdialog.Marksynced() availability dreamweaver 8. Description this function changes the action for the selected items in the site synchronization dialog box to synced. Arguments none. Returns nothing. Enab...

  • Page 263

    Site functions 263 site.Addlinktoexistingfile() availability dreamweaver 3. Description opens the select html file dialog box to let the user select a file and creates a link from the selected document to that file. Arguments none. Returns nothing. Enabler see “site.Canaddlink()” on page 586 . Site....

  • Page 264

    264 site site.Changelinksitewide() availability dreamweaver 3. Description opens the change link sitewide dialog box. Arguments none. Returns nothing. Site.Changelink() availability dreamweaver 3. Description opens the select html file dialog box to let the user select a new file for the link. Argum...

  • Page 265

    Site functions 265 description checks in the selected files and handles dependent files in one of the following ways: ■ if the user selects prompt on put/check in in the site ftp preferences, the dependent files dialog box appears. ■ if the user previously selected the don’t show me again option in ...

  • Page 266

    266 site site.Checkout() availability dreamweaver 3. Description checks out the selected files and handles dependent files in one of the following ways: ■ if the user selects prompt on get/check out in the site ftp preferences, the dependent files dialog box appears. ■ if the user previously selecte...

  • Page 267

    Site functions 267 site.Cloak() availability dreamweaver mx. Description cloaks the current selection in the site panel or the specified folder. Arguments siteorurl the siteorurl argument must contain one of the following two values: ■ the keyword "site" , which indicates that cloak() should act on ...

  • Page 268

    268 site enabler see “site.Cancomparefiles()” on page 589 . Example the following example compares the files selected in the site panel with their remote versions: site.Comparefiles("site"); site.Definesites() availability dreamweaver 3. Description this function opens the edit sites dialog box. Arg...

  • Page 269

    Site functions 269 site.Deployfilestotestingserverbin() availability dreamweaver mx. Description puts a specified file (or files) in the testing server’s bin folder. If the current site does not have any settings defined for deploying supporting files, this function invokes the deploy supporting fil...

  • Page 270

    270 site description exports a dreamweaver site to an xml file, which can be imported into another dreamweaver instance to duplicate the former site. All the information that is contained in the site definition dialog box is saved in an xml file that includes the list of cloaked folders and informat...

  • Page 271

    Site functions 271 localwidth="-2" remotewidth="-2" /> align="left" show="true" share="false" builtin="true" localwidth="60" remotewidth="60" /> align="left" show="true" share="false" builtin="true" localwidth="102" remotewidth="102" /> align="left" show="true" share="false" builtin="true" localwidt...

  • Page 272

    272 site site.Findlinksource() availability dreamweaver 3. Description opens the file that contains the selected link or dependent file, and highlights the text of the link or the reference to the dependent file. This function operates only on files in the site map view. Arguments none. Returns noth...

  • Page 273

    Site functions 273 returns nothing. Enabler see “site.Canget()” on page 590 . Site.Getappserveraccesstype() availability dreamweaver mx. Description returns the access method that is used for all files on the current site’s application server. The current site is the site that is associated with the...

  • Page 274

    274 site description determines the path to the remote files on the application server that is defined for the current site. The current site is the site that is associated with the document that currently has focus. If no document has focus, the site that you opened in dreamweaver is used. Argument...

  • Page 275

    Site functions 275 site.Getcheckoutuser() availability dreamweaver 3. Description gets the login and check-out name that is associated with the current site. Arguments none. Returns a string that contains a login and check-out name, if defined, or an empty string if check in/ check out is disabled. ...

  • Page 276

    276 site site.Getcloakingenabled() availability dreamweaver mx. Description determines whether cloaking is enabled for the current site. Arguments none. Returns a boolean value: true if cloaking is enabled for the current site; false otherwise. Site.Getconnectionstate() availability dreamweaver 3. D...

  • Page 277

    Site functions 277 arguments none. Returns a string that contains the name of the current site. Example if you defined several sites, a call to site.Getcurrentsite() returns the one that is currently showing in the current sites list in the site panel. Site.Getfocus() availability dreamweaver 3. Des...

  • Page 278

    278 site returns a boolean value: true if all the selected links are visible; false otherwise. Site.Getlocalpathtofiles() availability dreamweaver mx. Description determines the path to the local files that are defined for the current site. The current site is the site that is associated with the do...

  • Page 279

    Site functions 279 site.Getsiteforurl() availability dreamweaver mx. Description gets the name of the site, if any, that is associated with a specific file. Arguments fileurl ■ the fileurl argument is the fully qualified url (including the string " file://" ) for a named file. Returns a string that ...

  • Page 280

    280 site site.Getsiteurlprefix() availability dreamweaver 8. Description gets the site url prefix that is extracted from the http address defined in local info section. Arguments none. Returns a string that contains the site url prefix. Example siteprefix = getsiteurlprefix(); site.Importsite() avai...

  • Page 281

    Site functions 281 site.Invertselection() availability dreamweaver 3. Description inverts the selection in the site map. Arguments none. Returns nothing. Site.Iscloaked() availability dreamweaver mx. Description determines whether the current selection in the site panel or the specified folder is cl...

  • Page 282

    282 site site.Locateinsite() availability dreamweaver 3. Description locates the specified file (or files) in the specified pane of the site panel and selects the files. Arguments localorremote, siteorurl ■ the localorremote argument must be either "local" or "remote" . ■ the siteorurl argument must...

  • Page 283

    Site functions 283 site.Makenewdreamweaverfile() availability dreamweaver 3. Description creates a new dreamweaver file in the site panel in the same folder as the first selected file or folder. Arguments none. Returns nothing. Enabler see “site.Canmakenewfileorfolder()” on page 592 . Site.Makenewfo...

  • Page 284

    284 site site.Newhomepage() availability dreamweaver 3. Description opens the new home page dialog box to let the user create a new home page. Arguments none. Returns nothing. Site.Newsite() availability dreamweaver 3. Description opens the site definition dialog box for a new, unnamed site. Argumen...

  • Page 285

    Site functions 285 arguments none. Returns nothing. Enabler see “site.Canopen()” on page 592 . Site.Put() availability dreamweaver 3. Description puts the selected files and handles dependent files in one of the following ways: ■ if the user selects prompt on put/check in in the site ftp preferences...

  • Page 286

    286 site site.Recreatecache() availability dreamweaver 3. Description re-creates the cache for the current site. Arguments none. Returns nothing. Enabler see “site.Canrecreatecache()” on page 593 . Site.Refresh() availability dreamweaver 3. Description refreshes the file listing on the specified sid...

  • Page 287

    Site functions 287 site.Remoteisvalid() availability dreamweaver 3. Description determines whether the remote site is valid. Arguments none. Returns a boolean value that indicates whether a remote site has been defined and, if the server type is local/network, whether the drive is mounted. Site.Remo...

  • Page 288

    288 site arguments none. Returns nothing. Site.Runvalidation() availability dreamweaver mx. Description runs the validator on the entire site or only highlighted items. Arguments selection ■ the selection argument is the parameter that specifies that the validator should check only the highlighted i...

  • Page 289

    Site functions 289 site.Selectall() availability dreamweaver 3. Description selects all files in the active view (either the site map or the site files). Arguments none. Returns nothing. Site.Selecthomepage() availability dreamweaver 3. Description opens the open file dialog box to let the user sele...

  • Page 290

    290 site arguments whichside ■ the whichside argument must be either "local" or "remote" . Returns nothing. Enabler see “site.Canselectnewer()” on page 595 . Site.Serveractivity() availability dreamweaver 8. Description this function determines whether dreamweaver is currently interacting with a ser...

  • Page 291

    Site functions 291 site.Setashomepage() availability dreamweaver 3. Description designates the file that is selected in the site files view as the home page for the site. Arguments none. Returns nothing. Site.Setcloakingenabled() availability dreamweaver mx. Description determines whether cloaking s...

  • Page 292

    292 site arguments bconnected ■ the bconnected argument is a boolean value that indicates if there is a connection ( true ) or not ( false ) to the current site. Returns nothing. Site.Setcurrentsite() availability dreamweaver 3. Description opens the specified site in the local pane of the site pane...

  • Page 293

    Site functions 293 ■ the whichpane argument must be one of the following strings: "local" , "remote" , or "site map" . Returns nothing. Site.Setlayout() availability dreamweaver 3. Description opens the site map layout pane in the site definition dialog box. Arguments none. Returns nothing. Enabler ...

  • Page 294

    294 site site.Setselection() availability dreamweaver 3. Description selects files or folders in the active pane in the site panel. Arguments arrayofurls ■ the arrayofurls argument is an array of strings where each string is a path to a file or folder in the current site, which is expressed as a fil...

  • Page 295

    Site functions 295 site.Synchronize() availability dreamweaver 3. Description opens the synchronize files dialog box. Arguments none. Returns nothing. Enabler see “site.Cansynchronize()” on page 596 . Site.Uncloak() availability dreamweaver mx. Description uncloaks the current selection in the site ...

  • Page 296

    296 site site.Uncloakall() availability dreamweaver mx. Description uncloaks all folders in the current site and deselects the cloak files ending with: checkbox in the cloaking settings. Arguments nothing. Returns nothing. Enabler see “site.Canuncloak()” on page 597 . Site.Undocheckout() availabilit...

  • Page 297

    Site functions 297 site.Viewasroot() availability dreamweaver 3. Description temporarily moves the selected file to the top position in the site map. Arguments none. Returns nothing. Enabler see “site.Canviewasroot()” on page 598 . 000_dw_api_print.Book page 297 wednesday, july 20, 2005 11:58 am.

  • Page 298

    298 site 000_dw_api_print.Book page 298 wednesday, july 20, 2005 11:58 am.

  • Page 299

    299 13 chapter 13 document the document functions in macromedia dreamweaver 8 perform operations that affect the document on which the user is working. These functions perform tasks that convert tables to layers, run a command in the configuration/commands folder, browse for a file url, check spelli...

  • Page 300

    300 document dom.Converttablestolayers() availability dreamweaver 3. Description opens the convert tables to layers dialog box. Arguments none. Returns nothing. Enabler see “dom.Canconverttablestolayers()” on page 554 . Command functions command functions help you make the most of the files in the c...

  • Page 301

    Command functions 301 dreamweaver.Popupcommand() (deprecated) availability dreamweaver 2; deprecated in 3 in favor of dreamweaver.Runcommand() . Description this function executes the specified command. To the user, the effect is the same as selecting the command from a menu; if a dialog box is asso...

  • Page 302

    302 document ■ the remaining arguments, commandarg1, commandarg2 , and so on, which are optional, pass to the receivearguments() function in the commandfile argument. Returns nothing. Example you can write a custom property inspector for tables that lets users get to the format table command from a ...

  • Page 303

    File manipulation functions 303 returns an array of six integers that quantify the number of the following elements: ■ xhtml errors that dreamweaver fixed ■ the map elements that do not have an id attribute and cannot be fixed ■ the script elements that do not have a type attribute and cannot be fix...

  • Page 304

    304 document returns an array of six integers that quantify the following items: ■ xhtml errors that dreamweaver fixed ■ the map elements that do not have an id attribute and cannot be fixed ■ the script elements that do not have a type attribute and cannot be fixed ■ the style elements that do not ...

  • Page 305

    File manipulation functions 305 dreamweaver.Browseforfileurl() availability dreamweaver 1, enhanced in 2, 3, and 4. Description opens the specified type of dialog box with the specified label in the title bar. Arguments openselectorsave, {titlebarlabel}, {bshowpreviewpane}, ¬ {bsupresssiterootwarnin...

  • Page 306

    306 document dreamweaver.Browseforfolderurl() availability dreamweaver 3. Description opens the choose folder dialog box with the specified label in the title bar. Arguments {titlebarlabel}, {directorytostartin} ■ the titlebarlabel argument is the label that should appear in the title bar of the dia...

  • Page 307

    File manipulation functions 307 dreamweaver.Createdocument() availability dreamweaver 2, enhanced in dreamweaver 4. Description depending on the argument that you pass to this function, it opens a new document either in the same window or in a new window. The new document becomes the active document...

  • Page 308

    308 document dreamweaver.Createxhtmldocument() availability dreamweaver mx. Description depending on the argument that you pass to this function, it opens a new xhtml document either in the same window or in a new window. The new document becomes the active document. It is similar to the dreamweaver...

  • Page 309

    File manipulation functions 309 returns the document object for the newly created document, which is the same value that the dreamweaver.Getdocumentdom() function returns. Dreamweaver.Createxmldocument() availability dreamweaver mx. Description creates and opens a new xml file, which is empty except...

  • Page 310

    310 document dreamweaver.Exporteditableregionsasxml() (deprecated) availability dreamweaver 3; deprecated in mx. Description this function opens the export editable regions as xml dialog box. Arguments none. Returns nothing. Dreamweaver.Exporttemplatedataasxml() availability dreamweaver mx. Descript...

  • Page 312

    312 document examples the following example uses the dreamweaver.Getdocumentdom() function to access the current document: var thedom = dreamweaver.Getdocumentdom("document"); in the following example, the current document dom identifies a selection and pastes it at the end of another document: var ...

  • Page 313

    File manipulation functions 313 dreamweaver.Getrecentfilelist() availability dreamweaver 3. Description gets a list of all the files in the recent files list at the bottom of the file menu. Arguments none. Returns an array of strings that represent the paths of the most recently accessed files. Each...

  • Page 314

    314 document dreamweaver.Newdocument() availability dreamweaver mx. Description opens a document in the current site and invokes the new document dialog box. Arguments {bopenwithcursiteandshowdialog} ■ the bopenwithcursiteandshowdialog argument, which is optional, has a value of true or false . Spec...

  • Page 315

    File manipulation functions 315 dreamweaver.Opendocument() availability dreamweaver 2. Description opens a document for editing in a new dreamweaver window and gives it the focus. For a user, the effect is the same as selecting file > open and selecting a file. If the specified file is already open,...

  • Page 316

    316 document arguments filename ■ the filename argument is the file to open, which is expressed as a url. If the url is relative, it is relative to the file that contains the script that called this function. Returns the document object for the specified file, which is the same value that the dreamw...

  • Page 317

    File manipulation functions 317 documents that are referenced by the dreamweaver.Getobjecttags() , dreamweaver.Getobjectrefs() , dreamweaver.Getdocumentpath() , or dreamweaver.Getdocumentdom() functions are automatically released when the script that contains the call finishes executing. If the scri...

  • Page 318

    318 document dreamweaver.Saveall() availability dreamweaver 3. Description saves all open documents, opening the save as dialog box for any documents that have not been saved previously. Arguments none. Returns nothing. Enabler see “dreamweaver.Cansaveall()” on page 570 . Dreamweaver.Savedocument() ...

  • Page 319

    File manipulation functions 319 returns a boolean value that indicates success ( true ) or failure ( false ). Enabler see “dreamweaver.Cansavedocument()” on page 571 . Dreamweaver.Savedocumentas() availability dreamweaver 3. Description opens the save as dialog box. Arguments documentobject ■ the do...

  • Page 320

    320 document enabler see “dreamweaver.Cansavedocumentastemplate()” on page 571 . Dreamweaver.Saveframeset() availability dreamweaver 3. Description saves the specified frameset or opens the save as dialog box if the frameset has not previously been saved. Arguments documentobject ■ the documentobjec...

  • Page 321

    Global document functions 321 enabler see “dreamweaver.Cansaveframesetas()” on page 572 . Global document functions global document functions act on an entire document. They check spelling, check target browsers, set page properties, and determine correct object references for elements in the docume...

  • Page 322

    322 document dom.Getparsemode() availability dreamweaver mx 2004 description gets the current parsing mode of the document, which controls how the document is validated and whether it shows up in the main document window as html. Arguments none. Returns a string that specifies the current parsing mo...

  • Page 323

    Global document functions 323 description runs the validator on a single specified document (this function is similar to site.Runvalidation() ). The validator checks the document for conformance with the language specified in the document doctype (such as html 4.0 or html 3.2) and the language speci...

  • Page 324

    324 document example the following example runs a regular validation when the user selects the file > check page > validate markup menu option (or validate current document in the validation panel): dw.Getdocumentdom().Runvalidation(''); the following example prompts the user to save an unsaved docu...

  • Page 325

    Global document functions 325 example the following example displays two tooltip messages. The first line of code displays the message "this message is in the center" in the center of the document. The second call to showinfomessagepopup() displays the tooltip message "don’t forget the title for the...

  • Page 326

    326 document arguments instr ■ the instr argument is the string to decode. Returns a string that contains the decoded url. Example the following example calls dw.Dourldecoding() to decode the special characters in its argument and store the resulting string in outstr : outstr = dreamweaver.Dourldeco...

  • Page 327

    Global document functions 327 ■ dreamweaver returns correct references for netscape navigator for a , area , applet , embed , layer , ilayer , select , option , textarea , object , and img tags, and for absolutely positioned div and span tags. For div and span tags that are not absolutely positioned...

  • Page 328

    328 document returns an array of strings where each array is a valid javascript reference to a named instance of the requested tag type in the specified document (for example, "document.Mylayer.Document.Myimage" ) for the specified browser: ■ dreamweaver returns correct references for internet explo...

  • Page 329

    Global document functions 329 arguments sourcedoc, {tag1}, {tag2},...{tagn} ■ the sourcedoc argument must be "document" , "parent" , "parent.Frames[number]" , "parent.Frames['framename']" , or a url. The document value specifies the document that has the focus and contains the current selection. The...

  • Page 330

    330 document arguments section, key, default_value ■ the section argument is a string that specifies the preferences section that contains the entry. ■ the key argument is a string that specifies the entry of the value to retrieve. ■ the default_value argument is the default value that dreamweaver r...

  • Page 331

    Global document functions 331 returns the requested preference string, or if the string cannot be found, the default value. Example the following example returns the string value of the text editor setting in the my extension section of preferences. If there is no myextension section or no text edit...

  • Page 332

    332 document dreamweaver.Setpreferencestring() availability dreamweaver mx. Description lets you write a string preference setting for an extension. This setting is stored with dreamweaver preferences when dreamweaver is not running. Arguments section, key, new_value ■ the section argument is a stri...

  • Page 333

    Path functions 333 returns nothing. Path functions path functions get and manipulate the paths to various files and folders on a user’s hard disk. These functions determine the path to the root of the site in which the current document resides, convert relative paths to absolute urls, and more. Drea...

  • Page 334

    334 document dreamweaver.Getdocumentpath() availability dreamweaver 1.2. Description gets the path of the specified document, which is expressed as a file:// url. This function is equivalent to calling dreamweaver.Getdocumentdom() and reading the url property of the return value. Arguments sourcedoc...

  • Page 335

    Path functions 335 dreamweaver.Gettempfolderpath() availability dreamweaver mx. Description gets the full path to a temporary folder where you can store temporary or transient files. This function looks for a temp folder inside the dreamweaver configuration folder. If the system supports multiple us...

  • Page 336

    336 document ■ the siteroot argument is the path to the site root, which is expressed as a file:// url or an empty string if relurl is a document-relative url. ■ the relurl argument is the url to convert. Returns an absolute url string. The return value is generated, as described in the following li...

  • Page 337

    Selection functions 337 dom.Getselection() availability dreamweaver 3. Description gets the selection, which is expressed as character offsets into the document’s source code. Arguments {ballowmultiple} ■ the ballowmultiple argument, which is optional, is a boolean value that indicates whether the f...

  • Page 338

    338 document arguments node ■ the node argument must be a tag, comment, or range of text that is a node in the tree that the dreamweaver.Getdocumentdom() function returns. Returns an array that contains two integers. The first integer is the character offset of the beginning of the tag, text, or com...

  • Page 339

    Selection functions 339 offsets[1]); if (theselection.Nodetype == node.Element_node && ¬ theselection.Tagname == 'img'){ alert('the current selection is an image.'); } dom.Selectall() availability dreamweaver 3. Description performs a select all operation. Arguments none. Returns nothing. Dom.Setsel...

  • Page 340

    340 document ■ the bjumptonode argument, which is optional, is a boolean value that indicates whether to scroll the document window, if necessary, to make the selection visible. If it is omitted, this argument defaults to false . Returns nothing. Dom.Setselection() availability dreamweaver 3. Descri...

  • Page 341

    Selection functions 341 returns an array that contains two integers. The first integer is the byte offset for the beginning of the selection; the second integer is the byte offset for the end of the selection. If the two numbers are the same, the current selection is an insertion point. Dreamweaver....

  • Page 342

    342 document else selarr = dom.Nodetooffsets(findtable()); dom.Setselection(selarr[0],selarr[1]); } dreamweaver.Nodetooffsets() (deprecated) availability dreamweaver 2; deprecated in 3 in favor of “dom.Nodetooffsets()” on page 337 . Description gets the position of a specific node in the dom tree, w...

  • Page 343

    Selection functions 343 dreamweaver.Selectall() availability dreamweaver 3. Description performs a select all operation in the active document window, the site panel or, on the macintosh, the text field that has focus in a dialog box or floating panel. Arguments none. Returns nothing. Enabler see “d...

  • Page 344

    344 document returns nothing. String manipulation functions string manipulation functions help you get information about a string as well as convert a string from latin 1 encoding to platform-native encoding and back. Dreamweaver.Dourlencoding() availability dreamweaver 1. Description takes a string...

  • Page 345

    String manipulation functions 345 arguments searchstring, separatorcharacters ■ the searchstring argument is the string to separate into tokens. ■ the separatorcharacters argument is the character or characters that signifies the end of a token. Separator characters in quoted strings are ignored. An...

  • Page 346

    346 document dreamweaver.Nativetolatin1() availability dreamweaver 2. Description converts a string in native encoding to latin 1 encoding. Arguments stringtoconvert ■ the stringtoconvert argument is the string to convert from native encoding to latin 1 encoding. Returns the converted string. Dreamw...

  • Page 347

    String manipulation functions 347 dreamweaver calls the seven callback functions on the following occasions: 1. Dreamweaver calls opentagbegin() for each opening tag (for example, , as opposed to ) and each empty tag (for example, or ). The opentagbegin() function accepts two arguments: the name of ...

  • Page 348

    348 document arguments htmlstr, parsercallbackobj ■ the htmlstr argument is a string that contains code. ■ the parsercallbackobj argument is a javascript object that has one or more of the following methods: opentagbegin() , opentagend() , closetagbegin() , closetagend() , directive() , attribute() ...

  • Page 349

    Translation functions 349 translation functions translation functions deal either directly with translators or with translation results. These functions get information about or run a translator, edit content in a locked region, and specify that the translated source should be used when getting and ...

  • Page 350

    350 document arguments ballowedits ■ the ballowedits argument is a boolean value: true indicates that edits are allowed; false otherwise. Dreamweaver automatically restores locked regions to their default (non-editable) state when the script that calls this function finishes executing. Returns nothi...

  • Page 351

    Xslt functions 351 arguments busetranslatedsource ■ the busetranslatedsource argument is a boolean value: true if the function uses offsets into the translated source; false if the function uses the untranslated source. The default value of the argument is false . Dreamweaver automatically uses the ...

  • Page 352

    352 document example the following example gets the schema tree from the xml schema cache for menus.Xml: var theschema = mmxslt.Getxmlschema("file:///c:/program ¬ files/macromedia/dreamweaver/configuration/menus/menus.Xml""); mmxslt.Getxmlsourceuri() availability dreamweaver 8. Description this func...

  • Page 353

    Xslt functions 353 mmxslt.Launchxmlsourcedialog() availability dreamweaver 8. Description this function prompts the user to specify the xml source document that is associated with the current xslt document. The user can choose either a local or remote reference to an xml document. Arguments {xsltfil...

  • Page 354

    354 document 000_dw_api_print.Book page 354 wednesday, july 20, 2005 11:58 am.

  • Page 355

    355 14 chapter 14 page content the page content functions perform operations that affect the content of a web page. These operations include manipulating assets in the assets panel, adding behaviors, cutting and pasting elements from the clipboard, applying a template, or inserting a code snippet. A...

  • Page 356

    356 page content dreamweaver.Assetpalette.Addtofavoritesfromsite assets() availability dreamweaver 4. Description adds elements that are selected in the site list to the favorites list and gives each item a nickname in the favorites list. This function does not remove the element from the site list....

  • Page 357

    Assets panel functions 357 dreamweaver.Assetpalette.Copytosite() availability dreamweaver 4. Description copies selected elements to another site and puts them in that site’s favorites list. If the elements are files (other than colors or urls), the actual file is copied into that site. Arguments ta...

  • Page 358

    358 page content dreamweaver.Assetpalette.Getselectedcategory() availability dreamweaver 4. Description returns the currently selected category. Arguments none. Returns the currently selected category, which can be one of the following: "templates" , "library" , "images" , "movies" , "shockwave" , "...

  • Page 359

    Assets panel functions 359 example if urls is the category, and a folder myfoldername and a url myfavoriteurl are both selected in the favorites list, the function returns the following list: items[0] = "myfoldername" items[1] = "//path/foldername" items[2] = "folder" items[3] = "myfavoriteurl" item...

  • Page 360

    360 page content enabler see “dreamweaver.Assetpalette.Caninsertorapply()” on page 564 . Dreamweaver.Assetpalette.Locateinsite() availability dreamweaver 4. Description selects files that are associated with the selected elements in the local side of the site panel. This function does not work for c...

  • Page 361

    Assets panel functions 361 dreamweaver.Assetpalette.Newfolder() availability dreamweaver 4. Description creates a new folder in the current category with the default name (untitled) and puts a text box around the default name. It is available only in the favorites list. Arguments none. Returns nothi...

  • Page 362

    362 page content arguments none. Returns nothing. Dreamweaver.Assetpalette.Removefromfavorites() availability dreamweaver 4. Description removes the selected elements from the favorites list. This function does not delete the actual file on disk, except in the case of a library or template where the...

  • Page 363

    Assets panel functions 363 dreamweaver.Assetpalette.Setselectedcategory() availability dreamweaver 4. Description switches to show a different category. Arguments categorytype ■ the categorytype argument can be one of the following categories: "templates" , "library" , "images" , "movies" , "shockwa...

  • Page 364

    364 page content description this function removes the selected library item from the library panel and deletes its associated dreamweaver lbi file from the library folder at the root of the current site. Instances of the deleted item might still exist in pages throughout the site. Arguments none. R...

  • Page 365

    Assets panel functions 365 arguments breplacecurrent ■ the breplacecurrent argument is a boolean value that indicates whether to replace the selection with an instance of the newly created library item. Returns nothing. Dreamweaver.Librarypalette.Recreatefromdocument() (deprecated) availability drea...

  • Page 366

    366 page content arguments none. Returns nothing. Dreamweaver.Referencepalette.Getfontsize() availability dreamweaver 4. Description returns the current font size of the reference panel display region. Arguments none. Returns the relative font size as small , medium , or large . Dreamweaver.Referenc...

  • Page 367

    Assets panel functions 367 dreamweaver.Templatepalette.Deleteselected template() (deprecated) availability dreamweaver 3; deprecated in dreamweaver 4 in favor of using dreamweaver.Assetpalette.Setselectedcategory() with "templates" as the argument value, and then calling dreamweaver.Assetpalette.Rem...

  • Page 368

    368 page content dreamweaver.Templatepalette.Renameselectedtemp late() (deprecated) availability dreamweaver 3; deprecated in dreamweaver 4 in favor of using dreamweaver.Assetpalette.Setselectedcategory() with "templates" as the argument value, and then calling dreamweaver.Assetpalette.Renamenicknam...

  • Page 369

    Behavior functions 369 ■ the action argument is the function call that applybehavior() returns if the action is added using the behaviors panel (for example, "mm_popupmsg('hello world')") . ■ the eventbasedindex argument, which is optional, is the position at which this action should be added. The e...

  • Page 370

    370 page content description checks to make sure that the functions that are associated with any behavior calls on the specified node are in the head section of the document and inserts them if they are missing. Arguments elementnode ■ the elementnode argument is an element node within the current d...

  • Page 371

    Behavior functions 371 description gets the dom object that corresponds to the tag to which the behavior is being applied. This function is applicable only in behavior action files. Arguments none. Returns a dom object or a null value. This function returns a null value under the following circumsta...

  • Page 372

    372 page content dreamweaver.Getbehaviorevent() (deprecated) availability dreamweaver 1.2; deprecated in dreamweaver 2 because actions are now selected before events. Description in a behavior action file, this function gets the event that triggers this action. Arguments none. Returns a string that ...

  • Page 373

    Behavior functions 373 if (canbeapplied) { // display the action ui } else{ // display a helpful message that tells the user // that this action can only be applied to a // hyperlink } } dreamweaver.Popupaction() availability dreamweaver 2. Description invokes a parameters dialog box for the specifi...

  • Page 374

    374 page content dreamweaver.Behaviorinspector.Getbehaviorat() availability dreamweaver 3. Description gets the event/action pair at the specified position in the behaviors panel. Arguments positionindex ■ the positionindex argument is the position of the action in the behaviors panel. The first act...

  • Page 375

    Behavior functions 375 returns an integer that represents the number of actions that are attached to the element. This number is equivalent to the number of actions that are visible in the behaviors panel and includes dreamweaver behavior actions and custom javascript. Example a call to dreamweaver....

  • Page 376

    376 page content dreamweaver.Behaviorinspector.Movebehaviordown() availability dreamweaver 3. Description moves a behavior action lower in sequence by changing its execution order within the scope of an event. Arguments positionindex ■ the positionindex argument is the position of the action in the ...

  • Page 377

    Behavior functions 377 dreamweaver.Behaviorinspector.Movebehaviorup() availability dreamweaver 3. Description moves a behavior higher in sequence by changing its execution order within the scope of an event. Arguments positionindex ■ the positionindex argument is the position of the action in the be...

  • Page 378

    378 page content dreamweaver.Behaviorinspector.Setselectedbehavior() availability dreamweaver 3. Description selects the action at the specified position in the behaviors panel. Arguments positionindex ■ the positionindex argument is the position of the action in the behaviors panel. The first actio...

  • Page 379

    Clipboard functions 379 clipboard functions clipboard functions are related to cutting, copying, and pasting. On the macintosh, some clipboard functions can also apply to text fields in dialog boxes and floating panels. Functions that can operate in text fields are implemented as methods of the drea...

  • Page 380

    380 page content enabler see “dom.Canclipcopytext()” on page 552 . Dom.Clipcut() availability dreamweaver 3. Description removes the selection, including any html markup that defines the selection, to the clipboard. Arguments none. Returns nothing. Dom.Clippaste() availability dreamweaver 3. Descrip...

  • Page 381

    Clipboard functions 381 example if the clipboard contains abc widgets , a call to dw.Getdocumentdom().Clippaste() results in the following figure: dom.Clippastetext() (deprecated) availability dreamweaver 3. Deprecated in dreamweaver 8. Use the dom.Clippaste("text") function instead. Description pas...

  • Page 382

    382 page content example if the clipboard contains return true; , a call to dw.Getdocumentdom().Clippastetext() results in the following figure: dreamweaver.Clipcopy() availability dreamweaver 3. Description copies the current selection from the active document window, dialog box, floating panel, or...

  • Page 383

    Clipboard functions 383 dreamweaver.Clipcut() availability dreamweaver 3. Description removes the selection from the active document window, dialog box, floating panel, or site panel to the clipboard. Arguments none. Returns nothing. Enabler see “dreamweaver.Canclipcut()” on page 565 . Dreamweaver.C...

  • Page 384

    384 page content example the following example pasts the contents of the clipboard as text: dw.Clippaste("text"); dreamweaver.Getclipboardtext() availability dreamweaver 3. Description gets all the text that is stored on the clipboard. Arguments {bastext} ■ the bastext boolean value, which is option...

  • Page 385

    Library and template functions 385 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}, bmainta...

  • Page 386

    386 page content 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 d...

  • Page 387

    Library and template functions 387 returns an array of element nodes. Example “dom.Getselectededitableregion()” on page 387 . Dom.Getislibrarydocument() availability dreamweaver 3. Description determines whether the document is a library item. Arguments none. Returns a boolean value that indicates w...

  • Page 388

    388 page content 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. ...

  • Page 389

    Library and template functions 389 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...

  • Page 390

    390 page content 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.Can...

  • Page 391

    Snippets panel functions 391 dreamweaver.Updatepages() availability dreamweaver 3. Description opens the update pages dialog box and selects the specified options. Arguments {typeofupdate} ■ the optional typeofupdate argument must be "library" , "template" , or "both" , if you specify it. If the arg...

  • Page 392

    392 page content the following sample shows a snippet file: activex control" preview="code" factory="true" type="wrap" > snippet tags in csn files have the following attributes: you can use the following methods to add snippets panel functions to your extensions. Dreamweaver.Snippetpalette.Getcurren...

  • Page 393

    Snippets panel functions 393 dreamweaver.Snippetpalette.Newfolder() availability dreamweaver mx. Description creates a new folder with the default name untitled and puts an text box around the default name. Arguments none. Returns nothing. Dreamweaver.Snippetpalette.Newsnippet() availability dreamwe...

  • Page 394

    394 page content returns nothing. Enabler see “dreamweaver.Snippetpalette.Caneditsnippet()” on page 585 . Dreamweaver.Snippetpalette.Insert() availability dreamweaver mx. Description applies the selected snippet from the snippets panel to the current selection. Arguments none. Returns nothing. Enabl...

  • Page 395

    Snippets panel functions 395 example the following call to the dw.Snippetpalette.Insertsnippet() function inserts the code snippet at the location specified by the argument into the current document at the insertion point: dw.Snippetpalette.Insertsnippet('text\\different_link_color.Csn'); dreamweave...

  • Page 396

    396 page content 000_dw_api_print.Book page 396 wednesday, july 20, 2005 11:58 am.

  • Page 397

    397 15 chapter 15 dynamic documents the dynamic documents functions in macromedia dreamweaver 8 perform operations that are related to web server pages. These operations include returning a property for the selected node in the components panel, getting a list of all data sources in the user’s docum...

  • Page 398

    398 dynamic documents dreamweaver.Servercomponents.Refresh() availability dreamweaver mx. Description refreshes the view of the components tree. Arguments none. Returns nothing. Data source functions data source files are stored in the configuration/datasources folder. Each server model has its own ...

  • Page 399

    Extension data manager functions 399 returns an array that contains a concatenated list of all the data sources in the user’s document. Each element in the array is an object, and each object has the following properties: ■ the title property is the label string that appears to the right of the icon...

  • Page 400

    400 dynamic documents dreamweaver.Getextdatavalue() availability dreamweaver ultradev 4. Description this function retrieves the field values from an edml file for the specified nodes. Arguments qualifier(s) ■ the qualifier(s) argument is a variable-length list (depending on the level of information...

  • Page 401

    Extension data manager functions 401 dreamweaver.Getextparticipants() availability dreamweaver ultradev 4. Description this function retrieves the list of participants from an edml group file or participant files. Arguments value, qualifier(s) ■ the value argument is a property value, or it is blank...

  • Page 402

    402 dynamic documents dreamweaver.Refreshextdata() availability dreamweaver ultradev 4. Description reloads all extension data files. Arguments none. Returns dreamweaver expects reloaded data. Live data functions you can use the following live data functions to mimic menu functionality: ■ the showli...

  • Page 403

    Live data functions 403 dreamweaver.Getlivedatainittags() availability dreamweaver ultradev 1. Description returns the initialization tags for the currently active document. The initialization tags are the html tags that the user supplies in the live data settings dialog box. This function is typica...

  • Page 404

    404 dynamic documents live data mode lets you view a web page in the design stage (as if it has been translated by the application server and returned). Generating dynamic content to display in design view lets you view your page layout with live data and adjust it, if necessary. Before you view liv...

  • Page 405

    Live data functions 405 dreamweaver.Livedatatranslate() availability dreamweaver ultradev 1. Description sends an entire html document to an application server, asks the server to execute the scripts in the document, and returns the resulting html document. This function can be called only from a tr...

  • Page 406

    406 dynamic documents dreamweaver.Setlivedataerror() availability dreamweaver ultradev 1. Description specifies the error message that appears if an error occurs while the livedatatranslatemarkup() function executes in a translator. If the document that dreamweaver passed to livedatatranslate() cont...

  • Page 407

    Live data functions 407 returns nothing. Dreamweaver.Setlivedataparameters() availability dreamweaver mx. Description sets the url parameters that you reference in your document for use in live data mode. Live data mode lets you view a web page in the design stage (as if it has been translated by th...

  • Page 408

    408 dynamic documents description displays the live data settings dialog box. Arguments none. Returns nothing. Server behavior functions server behavior functions let you manipulate the server behaviors panel, which you can display by selecting window > server behaviors. Using these functions, you c...

  • Page 409

    Server behavior functions 409 returns this function returns an array that contains all instances of the specified participant (or, in the case of a group file, any instance of any participant in the group) that appear in the user’s document. The array contains javascript objects, with one element in...

  • Page 410

    410 dynamic documents dreamweaver.Popupserverbehavior() availability dreamweaver ultradev 1. Description applies a new server behavior to the document or modifies an existing behavior. If the user must specify parameters for the behavior, a dialog box appears. Arguments {behaviorname or behaviorobje...

  • Page 411

    Server model functions 411 dom.Servermodel.Getappurlprefix() availability dreamweaver mx. Description returns the url for the site’s root folder on the testing server. This url is the same as that specified for the testing server on the advanced tab in the site definition dialog box. When dreamweave...

  • Page 412

    412 dynamic documents returns an array of objects where each object contains the following three properties: ■ the startpattern property is a regular expression that matches the opening script delimiter. ■ the endpattern property is a regular expression that matches the closing script delimiter. ■ t...

  • Page 413

    Server model functions 413 dom.Servermodel.Getserverextension() (deprecated) availability dreamweaver ultradev 4; deprecated in dreamweaver mx. Description returns the default file extension of files that use the current server model. (the default file extension is the first in the list.) if no user...

  • Page 414

    414 dynamic documents example the following code snippet from a participant file shows a translator searchpatterns tag: /i]]> the search pattern contains a javascript regular expression that specifies two submatches (both of which are contained within parentheses). The first submatch is for the text...

  • Page 415

    Server model functions 415 you can modify the information in the html definition file or place additional variable values or functions in the file. For example, you can modify the servername , serverlanguage , and serverversion properties. The dom.Servermodel.Getserverinfo() function returns the inf...

  • Page 416

    416 dynamic documents arguments none. Returns a string that contains the supported scripting languages. Dom.Servermodel.Getservername() availability dreamweaver 1; enhanced in dreamweaver mx. Description retrieves the server name that is associated with the document and returns that value. The serve...

  • Page 417

    Server model functions 417 description determines whether the server model that is associated with the document supports the named character set. Arguments metacharsetstring ■ the metacharsetstring argument is a string value that names a particular character set. This value is the same as that of th...

  • Page 418

    418 dynamic documents arguments name ■ the name argument is a string that represents the name of a server model. Returns a string that contains the version of the named server model. Dom.Servermodel.Testappserver() availability dreamweaver mx. Description tests whether a connection to the applicatio...

  • Page 419

    419 16 chapter 16 design the design functions in macromedia dreamweaver 8 perform operations related to designing the appearance of a document. These operations include functions that apply a specified cascading style sheet (css) style, split a selected frame vertically or horizontally, align select...

  • Page 420

    420 design example the following example turns off rendering for internet explorer: if (cssstylepalette.Getinternetexplorerrendering()){ cssstylepalette.Setinternetexplorerrendering(false); } cssstylepalette.Setinternetexplorerrendering() availability dreamweaver 8. Description this function instruc...

  • Page 421

    Css functions 421 ■ the stylename argument is the name of a css style. ■ the classorid argument, which is optional, is the attribute with which the style should be applied (either "class" or "id" ). If the elementnode argument is a null value or an empty string and no tag exactly surrounds the selec...

  • Page 422

    422 design ■ "full" , which indicates that the element is " hidden" by default, but is currently in " full" view as set by the setelementview("full") function. ■ "normal" , which indicates that the element is neither "hidden" nor "full" . Example the following example changes the status of the selec...

  • Page 423

    Css functions 423 arguments none. Returns a boolean; true if the layout block box model visual aid is on; false otherwise. Example the following example checks whether the layout block box model visual aid is on and, if not, turns it on: var currentdom = dw.Getdocumentdom(); if (currentdom.Getshowdi...

  • Page 424

    424 design dom.Removecssstyle() availability dreamweaver 3. Description removes the class or id attribute from the specified element, or removes the span tag that completely surrounds the specified element. This function is valid only for the active document. Arguments elementnode, {classorid} ■ the...

  • Page 425

    Css functions 425 example the following example resets the element view of all elements in the document without forcing a refresh of the rendering: var currentdom = dw.Getdocumentdom(); currentdom.Resetallelementviews(false); dom.Setelementview() availability dreamweaver 8. Description this function...

  • Page 426

    426 design dom.Setshowdivbackgrounds() availability dreamweaver 8. Description this function turns the layout block backgrounds visual aid on or off. Arguments show ■ the show argument, which is required, is a boolean value that specifies whether to turn the layout block backgrounds visual aid on. S...

  • Page 427

    Css functions 427 dom.Setshowdivoutlines() availability dreamweaver 8. Description this function turns the layout block outlines visual aid on or off. Arguments show ■ the show argument, which is required, is a boolean value that specifies whether to turn the layout block outlines visual aid on. Set...

  • Page 428

    428 design dreamweaver.Cssruletracker.Newrule() availability dreamweaver mx 2004. Description opens the new css style dialog box, so the user can create a new rule. Arguments none. Returns nothing. Dreamweaver.Cssstylepalette.Applyselectedstyle() availability dreamweaver mx. Description applies the ...

  • Page 429

    Css functions 429 dreamweaver.Cssstylepalette.Attachstylesheet() availability dreamweaver 4. Description displays a dialog box that lets users attach a style sheet to the current active document or to one of its attached style sheets, depending on the selection in the styles panel. Arguments none. R...

  • Page 430

    430 design dreamweaver.Cssstylepalette.Duplicateselectedstyle() availability dreamweaver 3. Description duplicates the style that is currently selected in the styles panel and displays the duplicate style dialog box to let the user assign a name or selector to the new style. Arguments { pane } ■ the...

  • Page 431

    Css functions 431 arguments { pane } ■ the pane argument, which is optional, is a string that specifies the pane of the styles panel to which this function applies. Possible values are "stylelist" , which is the list of styles in “all” mode; "cascade" , which is the list of applicable, relevant rule...

  • Page 432

    432 design dreamweaver.Cssstylepalette.Editstylesheet() availability dreamweaver 3. Description opens the edit style sheet dialog box. Arguments none. Returns nothing. Enabler see “dreamweaver.Cssstylepalette.Caneditstylesheet()” on page 578 . Dreamweaver.Cssstylepalette.Getdisplaystyles() availabil...

  • Page 433

    Css functions 433 description gets target media type for rendering. The default media type is "screen". Arguments none. Returns a string value that specifies the target media type. Example var mediatype = dw.Cssstylepalette.Getmediatype(); dreamweaver.Cssstylepalette.Getselectedstyle() availability ...

  • Page 434

    434 design dreamweaver.Cssstylepalette.Getselectedtarget() (deprecated) availability dreamweaver 3; deprecated in dreamweaver mx because there is no longer an apply to menu in the styles panel. Description this function gets the selected element in the apply to pop-up menu at the top of the styles p...

  • Page 435

    Css functions 435 arguments {bgetids, bgetfullselector} ■ the bgetids argument is optional. It is a boolean value that, if true , causes the function to return just id selector names (the part after the "#"). Defaults to false . ■ the bgetfullselector argument is optional. It is a boolean value that...

  • Page 436

    436 design dreamweaver.Cssstylepalette.Renameselectedstyle() availability dreamweaver 3. Description renames the class name that is used in the currently selected rule in the styles panel and all instances of the class name in the selected rule. Arguments { pane } ■ the pane argument, which is optio...

  • Page 437

    Css functions 437 example the following example turns off rendering of css styles: dw.Cssstylepalette.Setdisplaystyles(false); dreamweaver.Cssstylepalette.Setmediatype() availability dreamweaver mx 2004. Description sets the target media type for rendering. Refreshes the rendering of all open docume...

  • Page 438

    (boxcolors[1] != "#ffffff)){ currentdom.Setblockvisboxmodelcolors(...

  • Page 439

    Css functions 439 dreamweaver.Getdivbackgroundcolors() availability dreamweaver 8. Description this function gets the colors used by the layout block backgrounds visual aid. Arguments none. Returns an array of strings that contains the 16 colors, with each color represented by the hexadecimal value ...

  • Page 440

    440 design ■ the width argument, which is required, is an integer that indicates the outline width, in pixels. ■ the style argument, which is optional, is a string that indicates the style of the outline. Possible values are "solid" , "dotted" , "dashed" , and "outset" . The "outset" value is applic...

  • Page 441

    Frame and frameset functions 441 { currentdom.Setdivbackgroundcolors("divs", shadeofgray[i]); } frame and frameset functions frame and frameset functions handle two tasks: getting the names of the frames in a frameset and splitting a frame in two. Dom.Getframenames() availability dreamweaver 3. Desc...

  • Page 442

    442 design arguments none. Returns a boolean value: true if the document is in a frameset; false otherwise. Dom.Saveallframes() availability dreamweaver 4. Description if a document is a frameset or is inside a frameset, this function saves all the frames and framesets from the document window. If t...

  • Page 443

    Layer and image map functions 443 enabler see “dom.Cansplitframe()” on page 562 . Layer and image map functions layer and image map functions handle aligning, resizing, and moving layers and image map hotspots. The function description indicates if it applies to layers or to hotspots. Dom.Align() av...

  • Page 444

    444 design returns nothing. Enabler see “dom.Canarrange()” on page 552 . Dom.Makesizesequal() availability dreamweaver 3. Description makes the selected layers or hotspots equal in height, width, or both. The last layer or hotspot selected is the guide. Arguments bhoriz, bvert ■ the bhoriz argument ...

  • Page 445

    Layer and image map functions 445 returns nothing. Dom.Resizeselectionby() availability dreamweaver 3. Description resizes the currently selected layer or hotspot. Arguments left, top, bottom, right ■ the left argument is the new position of the left boundary of the layer or hotspot. ■ the top argum...

  • Page 446

    446 design arguments tagname ■ the tagname argument must be "layer" , "ilayer" , "div" , or "span" . Returns nothing. Layout environment functions layout environment functions handle operations that are related to the settings for working on a document. They affect the source, position, and opacity ...

  • Page 447

    Layout environment functions 447 returns a string that contains one of the following values: ■ "in" ■ "cm" ■ "px" dom.Gettracingimageopacity() availability dreamweaver 3. Description gets the opacity setting for the document’s tracing image. Arguments none. Returns a value between 0 and 100, or noth...

  • Page 448

    448 design dom.Playallplugins() availability dreamweaver 3. Description plays all plug-in content in the document. Arguments none. Returns nothing. Dom.Playplugin() availability dreamweaver 3. Description plays the selected plug-in item. Arguments none. Returns nothing. Enabler see “dom.Canplayplugi...

  • Page 449

    Layout environment functions 449 arguments xcoordinate, ycoordinate ■ the xcoordinate argument is a value, expressed in pixels, on the horizontal axis. ■ the ycoordinate argument is a value, expressed in pixels, on the vertical axis. Returns nothing. Dom.Setrulerunits() availability dreamweaver 3. D...

  • Page 450

    450 design enabler see “dom.Hastracingimage()” on page 563 . Dom.Settracingimageopacity() availability dreamweaver 3. Description sets the opacity of the tracing image. Arguments opacitypercentage ■ the opacitypercentage argument must be a number between 0 and 100. Returns nothing. Enabler see “dom....

  • Page 451

    Layout environment functions 451 enabler see “dom.Hastracingimage()” on page 563 . Dom.Stopallplugins() availability dreamweaver 3. Description stops all plug-in content that is currently playing in the document. Arguments none. Returns nothing. Dom.Stopplugin() availability dreamweaver 3. Descripti...

  • Page 452

    452 design dreamweaver.Arrangefloatingpalettes() availability dreamweaver 3. Description moves the visible floating panels to their default positions. Arguments none. Returns nothing. Dreamweaver.Showgridsettingsdialog() availability dreamweaver 3. Description opens the grid settings dialog box. Arg...

  • Page 453

    Layout view functions 453 layout view functions layout view functions handle operations that change the layout elements within a document. They affect table, column, and cell settings, including position, properties, and appearance. Dom.Addspacertocolumn() availability dreamweaver 4. Description cre...

  • Page 454

    454 design ■ the width argument is the width of the cell in pixels. ■ the height argument is the height of the cell in pixels. Returns nothing. Dom.Createlayouttable() availability dreamweaver 4. Description creates a layout table in the current document at the specified position and dimensions, eit...

  • Page 455

    Layout view functions 455 ■ the colnum argument is the column to check for a spacer image. Returns returns true if the specified column in the currently selected table contains a spacer image that dreamweaver generated; false otherwise. Dom.Doesgrouphavespacers() availability dreamweaver 4. Descript...

  • Page 456

    456 design dom.Getshowlayouttabletabs() availability dreamweaver 4. Description determines whether the current document shows tabs for layout tables in layout view. Arguments none. Returns returns true if the current document displays tabs for layout tables in layout view; false otherwise. Dom.Getsh...

  • Page 457

    Layout view functions 457 arguments colnum ■ the colnum argument is the column to be automatically sized or fixed width. Returns returns true if the column at the given index in the currently selected table is set to autostretch; false otherwise. Dom.Makecellwidthsconsistent() availability dreamweav...

  • Page 458

    458 design dom.Removespacerfromcolumn() availability dreamweaver 4. Description removes the spacer image from a specified column and deletes the spacer row if there are no more spacer images that dreamweaver generated. This function fails if the current selection is not a table or if the operation i...

  • Page 459

    Layout view functions 459 dom.Getshowblockbackgrounds() availability dreamweaver 8. Description this function gets the state of the visual aid that forces background coloring for all blocks or divs. Arguments allblocks ■ the allblocks argument, which is required, is a boolean. Set the value to true ...

  • Page 460

    460 design returns a boolean value; if true , borders are displayed; if false , borders are not displayed. Example the following example checks whether the block borders visual aid is on and, if not, turns it on: var currentdom = dw.Getdocumentdom(); if (currentdom.Getshowblockborders(false) == fals...

  • Page 461

    Layout view functions 461 dom.Getshowboxmodel() availability dreamweaver 8. Description this function turns on and off the visual aid that colors the full box model for the selected block. Arguments none. Returns nothing. Example the following example checks whether the full box model for the select...

  • Page 462

    462 design example see “dom.Getshowblockbackgrounds()” on page 459 . Dom.Setshowblockborders() availability dreamweaver 8. Description this function turns on or off the visual aid that draws borders for all blocks or divs. Arguments allblocks ■ the allblocks argument, which is required, is a boolean...

  • Page 463

    Layout view functions 463 example see “dom.Getshowblockids()” on page 460 . Dom.Setshowboxmodel() availability dreamweaver 8. Description this function sets the state of the visual aid that colors the full box model for the selected block. Arguments none. Returns a boolean: true if the box model is ...

  • Page 464

    464 design dom.Setshowlayoutview() availability dreamweaver 4. Description places the current document in layout view if bshow is true . Arguments bshow ■ the bshow argument is a boolean value that toggles the current document between layout view and standard view. If bshow is true , the current doc...

  • Page 465

    Zoom functions 465 the following example sets the value of the current view’s scale to 50%: dreamweaver.Activeviewscale = 0.50; dreamweaver.Fitall() availability dreamweaver 8. Description this function zooms in or out so that the entire document fits in the currently visible portion of the design v...

  • Page 466

    466 design enabler see “dreamweaver.Canfitselection()” on page 568 . Example if (canfitseletion()){ fitselection(); } dreamweaver.Fitwidth() availability dreamweaver 8. Description this function zooms in or out so that the entire document width fits in the currently visible portion of the design vie...

  • Page 467

    Zoom functions 467 arguments none. Returns nothing. Enabler see “dreamweaver.Canzoom()” on page 574 . Example if (canzoom()){ zoomin(); } dreamweaver.Zoomout() availability dreamweaver 8. Description this function zooms out on the currently active design view. The zoom level is the next preset value...

  • Page 468

    468 design guide functions and properties guide functions and properties let you display, manipulate, and delete guides that let users measure and lay out elements on their html pages. Dom.Clearguides() availability dreamweaver 8. Description this function determines whether to delete all guides in ...

  • Page 469

    Guide functions and properties 469 ■ the location argument is the location of the guide with both the value and units as one string, with no space between the value and units. The possible units are "px" for pixels and "%" for percentage. For example, to specify 10 pixels, location = "10px" ; to spe...

  • Page 470

    470 design dom.Deletehorizontalguide() availability dreamweaver 8. Description this function deletes the horizontal guide at the specified location. Arguments location ■ the location argument is a string that represents the location in the document to test, with both the value and units as one strin...

  • Page 471

    Guide functions and properties 471 returns nothing. Example the following example deletes the vertical guide at the specified location in the document: var currentdom = dw.Getdocumentdom(); if (currentdom.Hasverticalguide("10px") == true) { currentdom.Deleteverticalguide("10px"); } dom.Guidescolor a...

  • Page 472

    472 design arguments none. Returns nothing. Example the following example makes the distance feedback color of guides gray: var currentdom = dw.Getdocumentdom(); if (currentdom.Guidesdistancecolor != "#cccccc"){ currentdom.Guidesdistancecolor = "#cccccc"; } dom.Guideslocked availability dreamweaver ...

  • Page 473

    Guide functions and properties 473 dom.Guidessnaptoelements availability dreamweaver 8. Description this mutable boolean property determines whether guides snap to elements in the document. You can set and get this property. Arguments none. Returns nothing. Example the following example makes guides...

  • Page 474

    474 design example the following example turns guides on if they are not visible: var currentdom = dw.Getdocumentdom(); if (currentdom.Guidesvisible == false) { currentdom.Guidesvisible = true; } dom.Hasguides() availability dreamweaver 8. Description this function determines whether the document ha...

  • Page 475

    Guide functions and properties 475 arguments location ■ the location argument is a string that represents the location in the document to test, with both the value and units as one string, with no space between the value and units. The possible units are "px" for pixels and "%" for percentage. For e...

  • Page 476

    476 design example the following example deletes all guides in the document if the document has a vertical guide at the specified location: var currentdom = dw.Getdocumentdom(); if (currentdom.Hasverticalguide("10px") == true) { currentdom.Clearguides(); } dom.Snaptoguides availability dreamweaver 8...

  • Page 477

    Table editing functions 477 table editing functions table functions add and remove table rows and columns, change column widths and row heights, convert measurements from pixels to percents and back, and perform other standard table-editing tasks. Dom.Convertwidthstopercent() availability dreamweave...

  • Page 478

    478 design dom.Decreasecolspan() availability dreamweaver 3. Description this function decreases the column span by one. Arguments none. Returns nothing. Enabler see “dom.Candecreasecolspan()” on page 554 . Dom.Decreaserowspan() availability dreamweaver 3. Description this function decreases the row...

  • Page 479

    Table editing functions 479 dom.Deletetablecolumn() availability dreamweaver 3. Description this function removes the selected table column or columns. Arguments none. Returns nothing. Enabler see “dom.Candeletetablecolumn()” on page 555 . Dom.Deletetablerow() availability dreamweaver 3. Description...

  • Page 480

    480 design dom.Dodeferredtableupdate() availability dreamweaver 3. Description if the faster table editing option is selected in the general preferences, this function forces the table layout to reflect recent changes without moving the selection outside the table. This function has no effect if the...

  • Page 481

    Table editing functions 481 dom.Gettableextent() availability dreamweaver 3. Description this function gets the number of columns and rows in the selected table. Arguments none. Returns an array that contains two whole numbers. The first array item is the number of columns, and the second array item...

  • Page 482

    482 design arguments none. Returns nothing. Enabler see “dom.Candecreaserowspan()” on page 555 . Dom.Inserttablecolumns() availability dreamweaver 3. Description this function inserts the specified number of table columns into the current table. Arguments numberofcols, bbeforeselection ■ the numbero...

  • Page 483

    Table editing functions 483 arguments numberofrows, bbeforeselection ■ the numberofrows argument is the number of rows to insert. ■ the bbeforeselection argument is a boolean value: true indicates that the rows should be inserted above the row that contains the selection; false otherwise. Returns no...

  • Page 484

    484 design returns nothing. Dom.Removealltablewidths() availability dreamweaver 3. Description this function removes all width attributes from the selected table. Arguments none. Returns nothing. Dom.Removecolumnwidth() availability dreamweaver mx 2004. Description this function removes all width at...

  • Page 485

    Table editing functions 485 arguments none. Returns nothing. Enabler see “dom.Canselecttable()” on page 560 . Dom.Setshowtablewidths() availability dreamweaver mx 2004. Description toggles the display of table widths on and off in standard or expanded tables mode (non- layout mode). This function se...

  • Page 486

    486 design arguments tdorth ■ the tdorth argument must be either "td" or "th" . Returns nothing. Dom.Settablecolumns() availability dreamweaver 3. Description this function sets the number of columns in the selected table. Arguments numberofcols ■ the numberofcols argument specifies the number of co...

  • Page 487

    Table editing functions 487 dom.Showinserttablerowsorcolumnsdialog() availability dreamweaver 3. Description this function opens the insert rows or columns dialog box. Arguments none. Returns nothing. Enabler see “dom.Caninserttablecolumns()” on page 557 or “dom.Caninserttablerows()” on page 558 . D...

  • Page 488

    488 design 000_dw_api_print.Book page 488 wednesday, july 20, 2005 11:58 am.

  • Page 489

    489 17 chapter 17 code the code functions let you perform operations on a document that appears in code view. These operations include adding new menu or function tags to a code hints menu, finding and replacing string patterns, deleting the current selection from a document, printing all or selecte...

  • Page 490

    490 code code coloring lets you specify code color styles and to modify existing code coloring schemes or create new ones. You can specify code coloring styles and schemes by modifying the colors.Xml and code coloring scheme files. For more information on these files, see extending dreamweaver. The ...

  • Page 491

    Code functions 491 ■ the casesensitive argument, which is optional, specifies whether the pattern is case- sensitive. The possible values for the casesensitive argument are the boolean values true or false . The value defaults to false if you omit this argument. If the casesensitive argument is a tr...

  • Page 492

    492 code ■ the casesensitive argument, which is optional, specifies whether the pattern is case- sensitive. The possible values for the casesensitive argument are the boolean values true or false . The value defaults to false if you omit this argument. If the casesensitive argument is a true value, ...

  • Page 493

    Code functions 493 returns nothing. Example your javascript code might build a code hints menu that contains user-defined session variables. Each time the list of session variables changes, that code needs to update the menu. Before the code can load the new list of session variables into the menu, ...

  • Page 494

    494 code returns nothing. Example dreamweaver.Reloadcodecoloring() find/replace functions find/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 interact...

  • Page 495

    Find/replace functions 495 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 fun...

  • Page 496

    496 code dreamweaver.Setupcomplexfind() availability dreamweaver 3. Description prepares for an advanced text or tag search by loading the specified xml query. Arguments xmlquerystring ■ the xmlquerystring argument is a string of xml code that begins with dwquery and ends with /dwquery . (to get a s...

  • Page 497

    Find/replace functions 497 arguments xmlquerystring ■ the xmlquerystring argument is a string of xml code that begins with the dwquery tag and ends with the /dwquery tag. (to get a string of the proper format, set up the query in the find dialog box, click the save query button, open the query file ...

  • Page 498

    498 code ■ the {matchcase} property, which is optional, is a boolean value that indicates whether the search is case-sensitive. If this property is not explicitly set, it defaults to false . ■ the {ignorewhitespace} property, which is optional, is a boolean value that indicates whether white space d...

  • Page 499

    Find/replace functions 499 ■ the searchsource property is a boolean value that indicates whether to search the html source. ■ the {matchcase} property, which is optional, is a boolean value that indicates whether the search is case-sensitive. If this property is not explicitly set, it defaults to a ...

  • Page 500

    500 code returns nothing. Enabler see “dreamweaver.Canshowfinddialog()” on page 573 . Dreamweaver.Showfindreplacedialog() availability dreamweaver 3. Description opens the replace dialog box. Arguments none. Returns nothing. Enabler see “dreamweaver.Canshowfinddialog()” on page 573 . General editing...

  • Page 501

    General editing functions 501 arguments tagname ■ the tagname argument is the tag name that is associated with the character markup. It must be one of the following strings: "b" , "cite" , "code" , "dfn" , "em" , "i" , "kbd" , "samp" , "s" , "strong" , "tt" , "u" , or "var" . Returns nothing. Dom.Ap...

  • Page 502

    502 code dom.Editattribute() availability dreamweaver 3. Description displays the appropriate interface for editing the specified document attribute. In most cases, this interface is a dialog box. This function is valid only for the active document. Arguments attribute ■ the attribute is a string th...

  • Page 503

    General editing functions 503 arguments none. Returns the encoding identity of the document. For example, for a latin1 document, the function returns iso-8859-1 . Dom.Getfontmarkup() availability dreamweaver 3. Description gets the value of the specified attribute of the font tag for the current sel...

  • Page 504

    504 code dom.Getlinkhref() availability dreamweaver 3. Description gets the link that surrounds the current selection. This function is equivalent to looping through the parents and grandparents of the current node until a link is found and then calling the getattribute('href') on the link. Argument...

  • Page 505

    General editing functions 505 dom.Getlisttag() availability dreamweaver 3. Description gets the style of the selected list. Arguments none. Returns a string that contains the tag that is associated with the list ( "ul" , "ol" , or "dl" ) or an empty string if no tag is associated with the list. This...

  • Page 506

    506 code arguments none. Returns a string that contains the block tag that is associated with the text (for example, "p" , "h1" , "pre" , and so on) or an empty string if no block tag is associated with the selection. This value always returns in lowercase letters. Dom.Hascharactermarkup() availabil...

  • Page 507

    General editing functions 507 returns nothing. Dom.Inserthtml() availability dreamweaver 3. Description inserts html content into the document at the current insertion point. Arguments contenttoinsert, {breplacecurrentselection} ■ the contenttoinsert argument is the content you want to insert. ■ the...

  • Page 508

    508 code dom.Insertobject() availability dreamweaver 3. Description inserts the specified object, prompting the user for parameters if necessary. Arguments objectname ■ the objectname argument is the name of an object in the configuration/objects folder. Returns nothing. Example a call to the dom.In...

  • Page 509

    General editing functions 509 returns nothing. Example the following code inserts the text: 130 into the current document: var thedom = dreamweaver.Getdocumentdom(); thedom.Inserttext('130'); the results appear in the document window, as shown in the following figure: dom.Newblock() availability dre...

  • Page 510

    510 code dom.Notifyflashobjectchanged() availability dreamweaver 4. Description tells dreamweaver that the current flash object file has changed. Dreamweaver updates the preview display, resizing it as necessary, preserving the width-height ratio from the original size. For example, flash text uses ...

  • Page 511

    General editing functions 511 arguments tagname ■ the tagname argument is the tag name that is associated with the character markup. It must be one of the following strings: "b" , "cite" , "code" , "dfn" , "em" , "i" , "kbd" , "samp" , "s" , "strong" , "tt" , "u" , or "var" . Returns nothing. Dom.Re...

  • Page 512

    512 code dom.Resizeselection() availability dreamweaver 3. Description resizes the selected object to the specified dimensions. Arguments newwidth, newheight ■ the newwidth argument specifies the new width to which the function will set the selected object. ■ the newheight argument specifies the new...

  • Page 513

    General editing functions 513 dom.Setlinkhref() availability dreamweaver 3. Description makes the selection a hypertext link or changes the url value of the href tag that encloses the current selection. Arguments linkhref ■ the linkhref argument is the url (document-relative path, root-relative path...

  • Page 514

    514 code dom.Setlistboxkind() availability dreamweaver 3. Description changes the kind of the selected select menu. Arguments kind ■ the kind argument must be either "menu" or "list box" . Returns nothing. Dom.Showlistpropertiesdialog() availability dreamweaver 3. Description opens the list properti...

  • Page 515

    General editing functions 515 arguments listtag ■ the listtag argument is the tag that is associated with the list. It must be "ol" , "ul" , "dl" , or an empty string. Returns nothing. Dom.Settextalignment() availability dreamweaver 3. Description sets the align attribute of the block that contains ...

  • Page 516

    516 code dom.Settextformat() availability dreamweaver 4. Description sets the block format of the selected text. Arguments blockformat ■ the blockformat argument is a string that specifies one of the following formats: "" (for no format), "p" , "h1" , "h2" , "h3" , "h4" , "h5" , "h6" , or "pre" . Re...

  • Page 517

    General editing functions 517 arguments none. Returns nothing. Enabler see “dreamweaver.Candeleteselection()” on page 566 . Dreamweaver.Editfontlist() availability dreamweaver 3. Description opens the edit font list dialog box. Arguments none. Returns nothing. Dreamweaver.Getfontlist() availability ...

  • Page 518

    518 code example for the default installation of dreamweaver, a call to the dreamweaver.Getfontlist() function returns an array that contains the following items: ■ "arial, helvetica, sans-serif" ■ "times new roman, times, serif" ■ "courier new, courier, mono" ■ "georgia, times new roman, times, ser...

  • Page 519

    General editing functions 519 arguments key ■ the key argument must be one of the following values: "cmd" , "ctrl" , "alt" , or "shift" . In windows, "cmd" and "ctrl" refer to the control key; on the macintosh, "alt" refers to the option key. Returns a boolean value that indicates whether the key is...

  • Page 520

    520 code dreamweaver.Getsystemfontlist() availability dreamweaver 4. Description returns a list of fonts for the system. This function can get either all fonts or only truetype fonts. These fonts are needed for the flash text object. Arguments fonttypes ■ the fonttypes argument is a string that cont...

  • Page 521

    Quick tag editor functions 521 ■ the document argument is the dom of the document to print. For information on how to obtain the dom for a document, see “dreamweaver.Getdocumentdom()” on page 311 . Returns a boolean value: true if the code can print; false otherwise. Example the following example ca...

  • Page 522

    522 code dom.Selectparent() availability dreamweaver 3. Description selects the parent of the current selection. Calling this function is equivalent to selecting the next tag to the left in the tag selector at the bottom of the document window. Arguments none. Returns nothing. Dom.Striptag() availab...

  • Page 523

    Quick tag editor functions 523 arguments starttag ■ the starttag argument is the source that is associated with the opening tag. Returns nothing. Example the following code wraps a link around the current selection: var thedom = dw.Getdocumentdom(); var thesel = thedom.Getselectednode(); if (thesel....

  • Page 524

    524 code code view functions code view functions include operations that are related to editing document source code (and that have subsequent impact on the design view). The functions in this section let you add navigational controls to code views within a split document view or the code inspector ...

  • Page 525

    Code view functions 525 returns nothing. Dom.Getshownoscript() availability dreamweaver mx. Description gets the current state of the noscript content option (from the view > noscript content menu option). On by default, the noscript tag identifies page script content that can be rendered, or not (b...

  • Page 526

    526 code ■ the numwarning property, which is the number of warnings ■ the numinfo property, which is the number of information messages example thedom = dw.Getdocumentdom(); thedom.Runvalidation(); thedom.Getautovalidationcount(); dom.Isdesignviewupdated() availability dreamweaver 4. Description det...

  • Page 527

    Code view functions 527 dom.Setshownoscript() availability dreamweaver mx. Description sets the noscript content option on or off (the same as selecting the view > noscript content option). On by default, the noscript tag identifies page script content that can be rendered, or not (by choice), in th...

  • Page 528

    528 code dom.Source.Arrowleft() availability dreamweaver 4. Description moves the insertion point to the left in the current line of the code view. If content is already selected, this function extends the selection to the left. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is opti...

  • Page 529

    Code view functions 529 dom.Source.Arrowup() availability dreamweaver 4. Description moves the insertion point up the code view document, line by line. If content is already selected, this function extends the selection line by line. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument is the nu...

  • Page 530

    530 code dom.Source.Endofdocument() availability dreamweaver 4. Description places the insertion point at the end of the current code view document. If content is already selected, this function extends the selection to the end of the document. Arguments bshiftisdown ■ the bshiftisdown argument is a...

  • Page 531

    Code view functions 531 dom.Source.Endpage() availability dreamweaver 4. Description moves the insertion point to the end of the current page or to the end of the next page if the insertion point is already at the end of a page. If content is already selected, this function extends the selection pag...

  • Page 532

    532 code dom.Source.Getselection() description gets the selection in the current document, which is expressed as character offsets into the document’s code view. Arguments none. Returns a pair of integers that represent offsets from the beginning of the source document. The first integer is the open...

  • Page 533

    Code view functions 533 ■ the startoffset argument is an integer that represents the offset from the beginning of the document. ■ the endoffset argument is an integer that represents the end of the document. Returns a string that represents the text in the source code between the offsets start and e...

  • Page 534

    534 code example the following example calls getvalidationerrorsforoffset() to check for any errors at the offset of the current selection. If the function returns an error, the code calls the alert() function to display the error message to the user. Var offset = dw.Getdocumentdom().Source.Getselec...

  • Page 535

    Code view functions 535 returns a boolean value: true if successful; false otherwise. Dom.Source.Nextword() availability dreamweaver 4. Description moves the insertion point to the beginning of the next word (or words, if specified) in the code view. If content is already selected, this function ext...

  • Page 536

    536 code dom.Source.Pagedown() availability dreamweaver 4. Description moves the insertion point down the code view document, page by page. If content is already selected, this function extends the selection page by page. Arguments {ntimes}, {bshiftisdown} ■ the ntimes argument, which is optional, i...

  • Page 537

    Code view functions 537 dom.Source.Previousword() availability dreamweaver 4. Description moves the insertion point to the beginning of the previous word (or words, if specified) in code view. If content is already selected, this function extends the selection to the left. Arguments {ntimes}, {bshif...

  • Page 538

    538 code returns a boolean value: true if successful; false otherwise. Dom.Source.Scrollendfile() availability dreamweaver 4. Description scrolls the code view to the bottom of the document file without moving the insertion point. Arguments none. Returns nothing. Dom.Source.Scrolllinedown() availabi...

  • Page 539

    Code view functions 539 dom.Source.Scrolllineup() availability dreamweaver 4. Description scrolls the code view up line by line without moving the insertion point. Arguments ntimes ■ the ntimes argument is the number of lines to scroll. If ntimes is omitted, the default is 1. Returns nothing. Dom.So...

  • Page 540

    540 code arguments ntimes ■ the ntimes argument is the number of pages to scroll. If ntimes is omitted, the default is 1. Returns nothing. Dom.Source.Scrolltopfile() availability dreamweaver 4. Description scrolls the code view to the top of the document file without moving the insertion point. Argu...

  • Page 541

    Code view functions 541 dom.Source.Setcurrentline() availability dreamweaver 4. Description puts the insertion point at the beginning of the specified line. If the linenumber argument is not a positive integer, the function does nothing and returns false . It puts the insertion point at the beginnin...

  • Page 542

    542 code dom.Source.Startofline() availability dreamweaver 4. Description places the insertion point at the beginning of the current line. If content is already selected, this function extends the selection to the beginning of the current line. Arguments bshiftisdown ■ the bshiftisdown argument is a...

  • Page 543

    Code view functions 543 dom.Source.Wrapselection() availability dreamweaver 4. Description inserts the text of starttag before the current selection and the text of endtag after the current selection. The function then selects the entire range between, and including, the inserted tags. If the curren...

  • Page 544

    544 code tag editor and tag library functions 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 ...

  • Page 545

    Tag editor and tag library functions 545 ■ a directive, such as 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, s...

  • Page 546

    546 code 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 return...

  • Page 547

    Tag editor and tag library functions 547 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 sele...

  • Page 548

    548 code 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 ■ the fileurl argument is the path to dtd or schema file, in local url format. ■ the prefix arg...

  • Page 549

    Tag editor and tag library functions 549 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 li...

  • Page 550

    550 code 000_dw_api_print.Book page 550 wednesday, july 20, 2005 11:58 am.

  • Page 551

    551 18 chapter 18 enablers macromedia dreamweaver 8 enabler functions determine whether another function can perform a specific operation in the current context. The function specifications describe the general circumstances under which each function returns a true value. However, the descriptions a...

  • Page 552

    552 enablers dom.Canapplytemplate() availability dreamweaver 3. Description checks whether dreamweaver can perform an apply to page operation. This function is valid only for the active document. Arguments none. Returns a boolean value that indicates whether the document is not a library item or a t...

  • Page 553

    Enablers 553 returns a boolean value: true if the opening and closing offsets of the selection are different; false otherwise, to indicate that nothing has been selected. Dom.Canclippaste() availability dreamweaver 3. Description checks whether dreamweaver can perform a paste operation. Arguments no...

  • Page 554

    554 enablers dom.Canconvertlayerstotable() availability dreamweaver 3. Description checks whether dreamweaver can perform a convert layers to table operation. Arguments none. Returns a boolean value: true if all the content in the body section of the document is contained within layers; false otherw...

  • Page 555

    Enablers 555 returns a boolean value: true if the current cell has a colspan attribute and that attribute’s value is greater than or equal to 2; false otherwise. Dom.Candecreaserowspan() availability dreamweaver 3. Description checks whether dreamweaver can perform a decrease rowspan operation. Argu...

  • Page 556

    556 enablers dom.Candeletetablerow() availability dreamweaver 3. Description checks whether dreamweaver can perform a delete row operation. Arguments none. Returns a boolean value: true if the insertion point is inside a cell or if a cell or row is selected; false otherwise. Site.Caneditcolumns() de...

  • Page 557

    Enablers 557 dom.Canincreasecolspan() availability dreamweaver 3. Description checks whether dreamweaver can perform an increase colspan operation. Arguments none. Returns a boolean value: true if there are any cells to the right of the current cell; false otherwise. Dom.Canincreaserowspan() availab...

  • Page 558

    558 enablers returns a boolean value: true if the selection is inside a table; false if the selection is an entire table or is not inside a table. Dom.Caninserttablerows() availability dreamweaver 3. Description checks whether dreamweaver can perform an insert row(s) operation. Arguments none. Retur...

  • Page 559

    Enablers 559 dom.Canmarkselectionaseditable() availability dreamweaver 3. Description checks whether dreamweaver can perform a mark selection as editable operation. Arguments none. Returns a boolean value: true if there is a selection and the current document is a dwt file; false otherwise . Dom.Can...

  • Page 560

    560 enablers returns a boolean value: true if the selection can be played with a plug-in. Dom.Canredo() availability dreamweaver 3. Description checks whether dreamweaver can perform a redo operation. Arguments none. Returns a boolean value: true if any steps remain to redo; false otherwise. Dom.Can...

  • Page 561

    Enablers 561 arguments none. Returns a boolean value: true if the insertion point or selection is within a table; false otherwise. Dom.Cansetlinkhref() availability dreamweaver 3. Description checks whether dreamweaver can change the link around the current selection or create one if necessary. Argu...

  • Page 563

    Enablers 563 returns a boolean value: true if the selection is currently being played with a plug-in; false otherwise. Dom.Canundo() availability dreamweaver 3. Description checks whether dreamweaver can perform an undo operation. Arguments none. Returns a boolean value: true if any steps remain to ...

  • Page 564

    564 enablers arguments none. Returns returns a boolean value: true if the asset can be edited; false otherwise. Returns a false value for colors and urls in the site list, and returns a false value for a multiple selection of colors and urls in the favorites list. Dreamweaver.Assetpalette.Caninserto...

  • Page 565

    Enablers 565 returns a boolean value: true if there is any content selected that can be copied to the clipboard; false otherwise. Dreamweaver.Canclipcut() availability dreamweaver 3. Description checks whether dreamweaver can perform a cut operation. Arguments none. Returns a boolean value: true if ...

  • Page 566

    566 enablers dreamweaver.Candeleteselection() availability dreamweaver 3. Description checks whether dreamweaver can delete the current selection. Depending on the window that has focus, the deletion might occur in the document window or the site panel (on the macintosh, in an text field in a dialog...

  • Page 567

    Enablers 567 dreamweaver.Canexporttemplatedataasxml() availability dreamweaver mx. Description checks whether dreamweaver can export the current document as xml. Arguments none. Returns a boolean value: true if you can perform an export on the current document; false otherwise. Example the following...

  • Page 568

    568 enablers dreamweaver.Canfitselection() availability dreamweaver 8. Description checks whether there is a selection in an active design view, which means that fitselection() can be called. Arguments none. Returns a boolean value: true if there is a selection in an active design view; false otherw...

  • Page 569

    Enablers 569 returns a boolean value: true if there is text, html, or dreamweaver html on the clipboard and focus is in code view, design view, or code inspector; false otherwise. Dreamweaver.Canplayrecordedcommand() availability dreamweaver 3. Description checks whether dreamweaver can perform a pl...

  • Page 570

    570 enablers dreamweaver.Canredo() availability dreamweaver 3. Description checks whether dreamweaver can perform a redo operation in the current context. Arguments none. Returns a boolean value that indicates whether any operations can be undone. Dreamweaver.Canrevertdocument() availability dreamwe...

  • Page 571

    Enablers 571 arguments none. Returns a boolean value that indicates whether one or more unsaved documents are open. Dreamweaver.Cansavedocument() availability dreamweaver 3. Description checks whether dreamweaver can perform a save operation on the specified document. Arguments documentobject ■ the ...

  • Page 572

    572 enablers dreamweaver.Cansaveframeset() availability dreamweaver 3. Description checks whether dreamweaver can perform a save frameset operation on the specified document. Arguments documentobject ■ the documentobject argument is the root of a document’s dom (the same value that the dreamweaver.G...

  • Page 573

    Enablers 573 dreamweaver.Canselectall() availability dreamweaver 3. Description checks whether dreamweaver can perform a select all operation. Arguments none. Returns a boolean value that indicates whether a select all operation can be performed. Dreamweaver.Canshowfinddialog() availability dreamwea...

  • Page 574

    574 enablers returns a boolean value that indicates whether any operations can be undone. Dreamweaver.Canzoom() availability dreamweaver 8. Description checks to see if there is an active design view, which means that basic zoom commands can be applied. Arguments none. Returns a boolean value: true ...

  • Page 575

    Enablers 575 example the following code checks whether the enabler function has been set to the value true before allowing edits to the selected rule: if(dw.Cssruletracker.Caneditselectedrule()){ dw.Cssruletracker.Editselectedrule(); } dreamweaver.Cssstylepalette.Canapplyselectedstyle() availability...

  • Page 576

    576 enablers arguments { pane } ■ the pane argument, which is optional, is a string that specifies the pane of the styles panel to which this function applies. Possible values are "stylelist" , which is the list of styles in “all” mode; "cascade" , which is the list of applicable, relevant rules in ...

  • Page 577

    Enablers 577 dreamweaver.Cssstylepalette.Caneditselectedstyle() availability dreamweaver mx. Description checks the current active document to see whether the selected style can be edited. Arguments { pane } ■ the pane argument, which is optional, is a string that specifies the pane of the styles pa...

  • Page 578

    578 enablers returns a boolean value: true if the selected style is editable; false otherwise. Dreamweaver.Cssstylepalette.Caneditstylesheet() availability dreamweaver mx. Description checks the current selection to see whether it contains style sheet elements that can be edited. Arguments none. Ret...

  • Page 579

    Enablers 579 dreamweaver.Isrecording() availability dreamweaver 3. Description reports whether dreamweaver is currently recording a command. Arguments none. Returns a boolean value that indicates whether dreamweaver is recording a command. Dreamweaver.Htmlstylepalette.Caneditselection() availability...

  • Page 580

    580 enablers returns a boolean value: true if the contents can clear; false otherwise. Dreamweaver.Resultspalette.Cancopy() availability dreamweaver mx. Description checks whether the current results window can display a copied message in its contents. Arguments none. Returns a boolean value: true i...

  • Page 581

    Enablers 581 arguments none. Returns a boolean value: true if the contents can display; false otherwise. Dreamweaver.Resultspalette.Canopeninbrowser() availability dreamweaver mx. Description checks whether the current report can display in a browser. Arguments none. Returns a boolean value: true if...

  • Page 582

    582 enablers description checks whether the save dialog box can open for the current panel. Currently, the site reports, target browser check, validation, and link checker panels support the save dialog box. Arguments none. Returns a boolean value: true if the save dialog box can appear; false other...

  • Page 583

    Enablers 583 dreamweaver.Sitesyncdialog.Canmarkdelete() availability dreamweaver 8. Description this function checks whether the change action to delete context menu in the site synchronize dialog box can be displayed. Arguments none. Returns a boolean value: true if the change action to delete cont...

  • Page 584

    584 enablers dreamweaver.Sitesyncdialog.Canmarkignore() availability dreamweaver 8. Description this function checks whether the change action to ignore context menu in the site synchronize dialog box can be displayed. Arguments none. Returns a boolean value: true if the change action to ignore cont...

  • Page 585

    Enablers 585 dreamweaver.Sitesyncdialog.Canmarksynced() availability dreamweaver 8. Description this function checks whether the change action to synced context menu in the site synchronize dialog box can be displayed. Arguments none. Returns a boolean value: true if the change action to synced cont...

  • Page 586

    586 enablers arguments none. Returns a boolean value: true if you can insert or apply the selected element; false otherwise. Site.Browsedocument() availability dreamweaver 4. Description opens all selected documents in a browser window. It is the same as using the preview in browser command. Argumen...

  • Page 587

    Enablers 587 site.Canchangelink() availability dreamweaver 3. Description checks whether dreamweaver can perform a change link operation. Arguments none. Returns a boolean value: true if an html or flash file links to the selected file in the site map; false otherwise. Site.Cancheckin() availability...

  • Page 588

    588 enablers site.Cancheckout() availability dreamweaver 3. Description determines whether dreamweaver can perform a check out operation on the specified file or files. Arguments siteorurl ■ the siteorurl argument must be the site keyword, which indicates that the function should act on the selectio...

  • Page 589

    Enablers 589 returns a boolean value: true if dreamweaver can perform the cloaking operation on the current site or the specified folder; false otherwise. Site.Cancomparefiles() availability dreamweaver 8. Description this function checks whether dreamweaver can perform the compare function on selec...

  • Page 590

    590 enablers site.Canfindlinksource() availability dreamweaver 3. Description checks whether dreamweaver can perform a find link source operation. Arguments none. Returns a boolean value that indicates that the selected link in the site map is not the home page. Site.Canget() availability dreamweave...

  • Page 591

    Enablers 591 site.Canlocateinsite() availability dreamweaver 3. Description determines whether dreamweaver can perform a locate in local site or locate in remote site operation (depending on the argument). Arguments localorremote, siteorurl ■ the localorremote argument must be either local or remote...

  • Page 592

    592 enablers returns a boolean value: true if dreamweaver can perform a turn off read only operation; false if one or more of the selected files is locked. Site.Canmakenewfileorfolder() availability dreamweaver 3. Description checks whether dreamweaver can perform a new file or new folder operation ...

  • Page 593

    Enablers 593 site.Canput() availability dreamweaver 3. Description determines whether dreamweaver can perform a put operation. Arguments siteorurl ■ the siteorurl argument must be the site keyword, which indicates that the function should act on the selection in the site panel, or the url for a sing...

  • Page 595

    Enablers 595 site.Cansetlayout() availability dreamweaver 3. Description determines whether dreamweaver can perform a layout operation. Arguments none. Returns a boolean value: true if the site map is visible; false otherwise. Site.Canselectallcheckedoutfiles() availability dreamweaver 4. Descriptio...

  • Page 596

    596 enablers arguments localorremote ■ the localorremote argument must be either the local or remote keyword . Returns a boolean value that indicates whether the document belongs to a site for which a remote site has been defined. Site.Canshowpagetitles() availability dreamweaver 3. Description dete...

  • Page 597

    Enablers 597 site.Canuncloak() availability dreamweaver mx. Description determines whether dreamweaver can perform an uncloaking operation. Arguments siteorurl ■ the siteorurl argument must be the site keyword, which indicates that the canuncloak() function should act on the selection in the site pa...

  • Page 598

    598 enablers site.Canviewasroot() availability dreamweaver 3. Description determines whether dreamweaver can perform a view as root operation. Arguments none. Returns a boolean value: true if the specified file is an html or flash file; false otherwise. 000_dw_api_print.Book page 598 wednesday, july...

  • Page 599

    599 index symbols () 474 a about dialog box 157 activeviewscale() 464 addbehavior() 368 adddebugcontextdata() 197 additem() 185 addlinktoexistingfile() 263 addlinktonewfile() 263 addresultitem() 186 addspacertocolumn() 453 alert 156 align() 443 aligning layers 443 tracing image 450 apis, types of da...

  • Page 600

    600 index attachexternalstylesheet() 429 attributes getting 20 of files, setting 25 snippet tag 392 audio alert 156 b backspace key, pressing 175 backspacekey() 175 balancebracestextview() 529 beep() 156, 158, 256, 257, 294 beginning of document 180 behavior functions 368 server 408 blocks borders 4...

  • Page 601

    Index 601 cansave() 581 cansaveall() 570 cansavedocument() 571 cansavedocumentastemplate() 571 cansaveframeset() 572 cansaveframesetas() 572 canselectall() 573, 582 canselectallcheckedoutfiles() 595 canselectnewer() 595 canselecttable() 560 cansetlayout() 595 cansetlinkhref() 561 canshowfinddialog()...

  • Page 602

    602 index code 489, 493 divs 459, 461 guides 471 layout block backgrounds 439 column span, decreasing 478 columns 87, 88, 89 getting from statements 86, 87 getting from stored procedures 92, 93 getting from tables 89 in sql select 86 names of 89 result sets 92, 93 sizing 456, 457, 458 types of 86 wi...

  • Page 603

    Index 603 d data manager 399 data property of httpreply objects 29 data source names in coldfusion 71 data sources coldfusion 81 odbc 84 database api about 69 access functions 86 connection functions 70 mmdb.Deleteconnection() 70 mmdb.Getcoldfusiondsnlist() 71 mmdb.Getcolumnandtypelist() 86 mmdb.Get...

  • Page 604

    604 index selection 501 styles 429 deployfilestotestingserverbin() 269 description attribute 392 design functions 419 design note keys 133 design notes c api 45 file structure 39 length 134 source control systems 134, 135 design notes files closing 46 creating key/value pairs 45, 52 getting key 41 k...

  • Page 605

    Index 605 applyfontmarkup() 501 applytemplate() 385 arrange() 443 arrowdown() 173 arrowleft() 174 arrowright() 174 arrowup() 175 backspacekey() 175 canalign() 551 canapplytemplate() 552 canarrange() 552 canclipcopytext() 552 canclippaste() 553 canclippastetext() 553 canconvertlayerstotable() 554 can...

  • Page 606

    606 index getparsemode() 322 getpreventlayeroverlaps() 199 getrulerorigin() 446 getrulerunits() 446 getselectededitableregion() 387 getselectednode() 336 getselection() 337 getshowautoindent() 200 getshowblockbackgrounds() 459 getshowblockborders() 459 getshowblockids() 460 getshowboxmodel() 461 get...

  • Page 607

    Index 607 removecssstyle() 424 removeeditableregion() 390 removefontmarkup() 511 removelink() 511 removespacerfromcolumn() 458 resetallelementviews() 424 resizeselection() 512 resizeselectionby() 445 runtranslator() 349 runvalidation() 322 saveallframes() 442 selectall() 339 selectchild() 521 select...

  • Page 608

    608 index source.Getselection() 532 source.Gettext() 532 source.Getvalidationerrorsforoffset() 533 source.Indenttextview() 534 source.Insert() 534 source.Nextword() 535 source.Outdenttextview() 535 source.Pagedown() 536 source.Pageup() 536 source.Previousword() 537 source.Removecomment() 251 source....

  • Page 609

    Index 609 codehints.Addfunction() 491, 493 codehints.Addmenu() 490 codehints.Resetmenu() 492 codehints.Showcodehints() 493 comparefiles() 258 createdocument() 307 createresultswindow() 184 createxhtmldocument() 308 createxmldocument() 309 cssruletracker.Caneditselectedrule() 574 cssruletracker.Edits...

  • Page 610

    610 index getundotext() 163 historypalette object 161 historypalette.Clearsteps() 165 historypalette.Copysteps() 166 historypalette.Getselectedsteps() 166 historypalette.Getstepcount() 167 historypalette.Getstepsasjavascript() 167 historypalette.Getundostate() 168 historypalette.Replaysteps() 169 hi...

  • Page 611

    Index 611 resultspalette.Selectall() 196 revertdocument() 317 runcommand() 301 saveall() 318 savedocument() 318 savedocumentas() 319 savedocumentastemplate() 319 saveframeset() 320 saveframesetas() 320 savesitestoprefs() 259 scansourcestring() 346 selectall() 343 serverbehaviorinspector.Getserverbeh...

  • Page 612

    612 index dwfile.Remove() 25 dwfile.Setattributes() 25 dwfile.Write() 26 dynamic data dialog box 158 dynamic text dialog box 158 e editattribute() 502 editcolumns() 269 editcommandlist() 300 editfontlist() 517 editlockedregions() 349 editors, lists of 149 editselectedrule() 427 editselectedstyle() 4...

  • Page 613

    Index 613 results window 190 saving 31, 33 size of 23 snippets 391 source control systems 122, 123 tesing existence 126 testing existence 19 time created 21 time modified 20 undoing checking out 130 writing strings to 26 writing to 26 findconnection() 104 findlinksource() 272 findnext() 494 firework...

  • Page 614

    614 index getautovalidationcount() 525 getbehavior() 369 getbehaviorat() 374 getbehaviorcount() 374 getbehaviorelement() 370 getbehaviorevent() 372 getbehaviortag() 372 getblockvisboxmodelcolors() 437 getblockvisoutlineproperties() 438 getbrowserlist() 148 getcharset() 502 getcheckoutuser() 275 getc...

  • Page 615

    Index 615 getparsemode() 322 getparticipants() 408 getpassword() 76 getpreferenceint() 329 getpreferencestring() 330 getpreventlayeroverlaps() 199 getprimarybrowser() 150 getprimaryextensioneditor() 151 getprimarykeys() 89 getprimaryview() 235 getprocedures() 90 getproperties() 111 getrdspassword() ...

  • Page 616

    616 index gettoolbaridarray() 223 gettoolbaritemvalue() 224 gettoolbarlabel() 225 gettoolbarvisibility() 225 gettracingimageopacity() 447 gettranslatorlist() 350 getundostate() 168 getundotext() 163 getusername() 79 getvalidationerrorsforoffset() 533 getversionname() 49 getversionnum() 50 getview() ...

  • Page 617

    Index 617 i id strings, removing 171 image editor 155 image map functions 443 importdtdorschema() 548 importsite() 280 importxmlintotemplate() 313 include files connection type definition 109 generated 107 increasecolspan() 481 increaserowspan() 481 indent 216 indent() 506 indenting 200 indenttextvi...

  • Page 618

    618 index keys backspace 175 delete 176 getting values 47 in design notes 41 in design notes files 42, 46 list of 48 page down 178 page up 179 primary 89 removing from design notes files 44 l latin1tonative() 345 launchxmlsourcedialog() 353 layer functions 443 layers 445 aligning 443 html tag 445 mo...

  • Page 619

    Index 619 mmdb.Getcolumnsoftable() 89 mmdb.Getconnection() 71 mmdb.Getconnectionlist() 73 mmdb.Getconnectionname() 73 mmdb.Getconnectionstring() 74 mmdb.Getdrivername() 75 mmdb.Getdriverurltemplatelist() 75 mmdb.Getlocaldsnlist() 76 mmdb.Getpassword() 76 mmdb.Getprimarykeys() 89 mmdb.Getprocedures()...

  • Page 620

    620 index noise 156 _notes folder 39 notifyflashobjectchanged() 510 notifymenuupdated() 182 numbers, of files checked out 131 o object type, flash 66 odbc administration 84 odbc dsns 76, 78 offsetstonode() 338, 342 opacity, tracing image 447 open documents, listing 232 open() 44, 284 opendocument() ...

  • Page 621

    Index 621 properties, javabeans 113, 114, 115 put() 285 putting files 124, 143 q quitapplication() 157 quitting dreamweaver 157 r rds login information 80, 84 passwords 77, 82 user names 77, 82 read() 24 read-only files 25 reading, flash object file 66 reapplybehaviors() 369 recorded commands 163 re...

  • Page 622

    622 index retrieve index of selected item 188 retrieving an array of items 187 retrieving number of items 188 set buttons 189 setting selected item 190 title 191 results window functions 183 resultspalette.Canclear() 579 resultspalette.Cancopy() 580 resultspalette.Cancut() 580 resultspalette.Canopen...

  • Page 623

    Index 623 scs_geterrormessagelength() 132 scs_getfilecheckoutlist() 132 scs_getfolderlist() 122 scs_getfolderlistlength() 122 scs_getmaxnotelength() 134 scs_getnewfeatures() 128 scs_getnotecount() 133 scs_getnumcheckedout() 131 scs_getnumnewfeatures() 127 scs_getrootfolder() 121 scs_getrootfolderlen...

  • Page 624

    624 index setshowinvalidhtml() 208 setshowinvisibleelements() 209 setshowlayerborders() 209 setshowlayouttabletabs() 463 setshowlayoutview() 464 setshowlinenumbers() 210 setshownoscript() 527 setshowpagetitles() 221 setshowrulers() 210 setshowstatusbar() 218 setshowsyntaxcoloring() 211 setshowtableb...

  • Page 625

    Index 625 checktargetbrowsers() 266 cloak() 267 definesites() 268 deleteselection() 268 deployfilestotestingserverbin() 269 editcolumns() 269 exportsite() 269 findlinksource() 272 get() 272 getappserveraccesstype() 273 getappserverpathtofiles() 273 getappurlprefixforsite() 274 getcheckoutuser() 275 ...

  • Page 626

    626 index scs_cancheckout() 138 scs_canconnect() 137 scs_candelete() 140 scs_canget() 137 scs_cannewfolder() 140 scs_canput() 138 scs_canrename() 140 scs_canundocheckout() 139 scs_checkin() 129 scs_checkout() 130 scs_connect() 120 scs_delete() 124 scs_disconnect() 120 scs_get() 123 scs_getagentinfo(...

  • Page 627

    Index 627 stored procedures 92, 93, 94, 98, 99 about 86 getting columns from 92, 93 getting parameters for 95 parameters 95 showing results of 98, 99 strings file contents 24 writing to files 26 striptag() 522 style sheets 429 styles applying 420, 428 deleting 429 duplicating 430 getting names of 43...

  • Page 628

    628 index posting data to 35 relative 335 to flash mx application 150 user names 79 checkout names 129 rds 77, 82, 84 user’s configuration files 17 users, checking out files 132 usetranslatedsource() 350 v validatefireworks() 58 validateflash() 155 validating documents 323 validator method 192 versi...