/* Filename:    J020_sendStorageFiles.js
 * Description: on 'X' command, upload *.dat files (and remove them after upload)
 * Copyright:   2006 The Code Corporation. Please see http://www.codecorp.com/jsLicensing.html for information regarding copyright and grant of license.
 * $Revision: 118 $
 * $Date: 2006-12-05 16:26:51 -0700 (Tue, 05 Dec 2006) $
 */

include(".crx.js");


reader.onCommandOld = reader.onCommand;

reader.onCommand = function(commandType, commandData)
{
    if( commandType == 'X' )
    {
        for(var f = storage.findFirst(/.*\.dat$/);  f;  f = storage.findNext())
        {
                if( storage.upload(f) )
                     storage.erase(f);
        }
    }
        
     return reader.onCommandOld(commandType, commandData); //let the original onCommand function handle everything else.
}


//EOT
