![]() |
![]() |
![]() |
![]() |
Home | Documentation ... Contact |
![]() |
The Core and Linux extensions are always loaded, which means that they don't have to be specified as dependencies for weblications that access them. In order to use other extensions, you must include them on the dependency list maintained in the WDF file (which can be viewed and edited under the 'Dependencies' tab of the sash-wdf-editor). If an extension depends on another extension, make sure to include all relevant extensions.
Before running the weblication make sure that all of the extensions and locations are installed (See the sash-install section).
short
or long
. In the following example, we set the cursor appearance to the Linux cursor used when an application starts:
Sash.Core.Cursor.SetStandard (Sash.Core.Cursor.APPSTARTING);
In addition, certain status properties are meant to be set to extension-specific constants.
var file = new Sash.FileSystem.File("myfile.txt");
string
properties that can be set to the name of a JavaScript function. When certain events happen in an object, the appropriate JavaScript function will be executed with the appropriate arguments. The documentation specifies what arguments will be passed to callbacks (see the handler
for each callback). In the FTP extension, there is an event that occurs when a file send begins.
// This function will receive a connection object, as well as the
// name of the file being transferred.
function on_file_send_start(ftpconn, filename){
print ("started sending file: " + filename);
}
ftpconnection.OnFileSendStart = "on_file_send_start";
When viewing properties, function parameters, and return values, sometimes you will see multiple types enclosed in braces ({}
). This means that the value type depends on the circumstances. For example, the FTP connection object's RemoveFromQueue()
method removes a file from the transfer queue. This file to be removed can be specified by its index (a long
value) in the queue or its name (a string
value).
IMPORTANT: You may notice square brackets ([]
) in our documentation. These are used for optional arguments. Unfortunately, Mozilla's JavaScript engine does not currently support optional arguments for functions, meaning that you must pass in the correct number of arguments. Pass in null
for optional arguments:
// Pass in an FTP server location and the port number.
// If the port is unspecified, 21 is used.
// Ideally, the following line would read:
// ftpconnection.Connect("ftp.mozilla.org");
// Instead, we have to do the following:
ftpconnection.Connect("ftp.mozilla.org", null);
We hope that this will be resolved in the near future.