home *** CD-ROM | disk | FTP | other *** search
- g_ModuleID = 3002;
-
- // Disable Drag-and-drop support
- document.ondragstart = function(){return false;}
-
- // The g_fStartingScan variable is used to disable the launching of new scans
- // for a bit after it has been pressed. It's a hack to get around not knowing
- // when we are currently executing a scan.
- var g_fStartingScan = false;
-
- // Currently selected row, if any.
- //
- var g_CurrentRow;
-
- // MessageBox() Flags
- var MB_OK = 0x00000000;
- var MB_OKCANCEL = 0x00000001;
- var MB_ABORTRETRYIGNORE = 0x00000002;
- var MB_YESNOCANCEL = 0x00000003;
- var MB_YESNO = 0x00000004;
- var MB_RETRYCANCEL = 0x00000005;
-
- var MB_ICONHAND = 0x00000010;
- var MB_ICONQUESTION = 0x00000020;
- var MB_ICONEXCLAMATION = 0x00000030;
- var MB_ICONASTERISK = 0x00000040;
-
- var MB_USERICON = 0x00000080;
- var MB_ICONWARNING = MB_ICONEXCLAMATION;
- var MB_ICONERROR = MB_ICONHAND;
-
- var MB_ICONINFORMATION = MB_ICONASTERISK;
- var MB_ICONSTOP = MB_ICONHAND;
-
- var IDOK = 1;
- var IDCANCEL = 2;
- var IDABORT = 3;
- var IDRETRY = 4;
- var IDIGNORE = 5;
- var IDYES = 6;
- var IDNO = 7;
-
- var g_strScanTasksInterface = "Symantec.Norton.AntiVirus.ScanTasks";
- var g_strWebWndInterface = "CcWebWnd.ccWebWindow";
- var g_strNAVTaskSchedulerInterface = "NAVTasks.Scheduler";
- var g_NAVScanTasks;
- var g_webWnd;
- var g_bSchedulerInstalled = 0;
-
- function onLoad ()
- {
- try
- {
- g_NAVScanTasks = new ActiveXObject (g_strScanTasksInterface);
- }
- catch (err)
- {
- var msg = document.frames("Errors").document.all.ERR_MSG_NO_NAVTASKS.innerText;
- var id = document.frames("Errors").document.all.ERR_ID_NO_NAVTASKS.innerText;
- g_ErrorHandler.DisplayNAVError (msg, id);
- DisableUI();
- return;
- }
-
- try
- {
- g_webWnd = new ActiveXObject (g_strWebWndInterface);
- }
- catch(err)
- {
- var msg = document.frames("Errors").document.all.ERR_MSG_NO_WEBWND.innerText;
- var id = document.frames("Errors").document.all.ERR_ID_NO_WEBWND.innerText;
- g_ErrorHandler.DisplayNAVError (msg, id);
- DisableUI();
- return;
- }
-
- try
- {
- g_Scheduler = new ActiveXObject (g_strNAVTaskSchedulerInterface);
- }
- catch (err)
- {
- var msg = document.frames("Errors").document.all.ERR_MSG_NO_SCHEDULER.innerText;
- var id = document.frames("Errors").document.all.ERR_ID_NO_SCHEDULER.innerText;
- g_ErrorHandler.DisplayNAVError (msg, id);
- DisableUI();
- return;
- }
-
- try
- {
- g_bSchedulerInstalled = g_Scheduler.Installed;
- }
- catch (err)
- {
- g_Scheduler.NAVError.LogAndDisplay(0);
- DisableUI();
- return;
- }
-
- // Make sure all objects are create BEFORE loading the scan_list.js code.
- // We do this by calling the onLoad () manually, rather than from the scan_list HTML.
- //
- document.frames("frmScanTasksList").onLoad();
-
- ListFocus();
- }
-
-
- function onNew()
- {
- document.frames("frmScanTasksList").createTask ();
- }
-
- function onEdit()
- {
- // We store the tasks by name, but that can change here. So we
- // store the row number, which won't change, then rebuild the
- // row.
- //
- try
- {
- var iTaskIndex = g_NAVScanTasks.TaskIndex(g_CurrentRow.strScanTask);
- g_NAVScanTasks(g_CurrentRow.strScanTask).Edit();
- document.frames("frmScanTasksList").clearRow ( g_CurrentRow );
- var strNewName = g_NAVScanTasks(iTaskIndex).TaskName;
- document.frames("frmScanTasksList").makeTask ( strNewName, g_CurrentRow );
- }
- catch(err)
- {
- g_NAVScanTasks.NAVError.LogAndDisplay(0);
- }
- }
-
- function onDelete()
- {
- // Prompt users to see if they really want to delete the task
- //
- iMsgBoxReturn = g_webWnd.MsgBox(strAreYouSureDeleteTask.innerText, strNortonAntiVirus.innerText, MB_YESNO | MB_ICONINFORMATION);
-
- if (iMsgBoxReturn == IDYES)
- {
- document.frames("frmScanTasksList").deleteTask ( g_CurrentRow );
- }
- }
-
- function onSchedule()
- {
- try
- {
- g_NAVScanTasks(g_CurrentRow.strScanTask).Schedule(false);
- }
- catch(err)
- {
- g_NAVScanTasks(g_CurrentRow.strScanTask).NAVError.LogAndDisplay(0);
- }
-
- document.frames("frmScanTasksList").clearRow ( g_CurrentRow );
- document.frames("frmScanTasksList").makeTask ( g_CurrentRow.strScanTask, g_CurrentRow );
- }
-
- function ListFocus ()
- {
- var row = document.frames("frmScanTasksList").ScanTasksList.rows.item(0);
-
- if ( row )
- {
- row.onclick ();
- //row.cells(1).focus (); // doesn't work anyway
- }
- }
-
- function ScanDisableDelay()
- {
- // Let the scan now button be pressed again.
- g_fStartingScan = false;
- }
-
- function onScan ()
- {
- if (!g_fStartingScan)
- {
- // Disable the button for until our timeout happens.
- // This prevents people from clicking the button again and
- // launching another scan. It's not perfect but it deters
- // the customer from pressing it again for a bit.
- g_fStartingScan = true;
-
-
- try
- {
- g_NAVScanTasks(g_CurrentRow.strScanTask).Scan();
- }
-
- catch(err)
- {
- g_NAVScanTasks.NAVError.LogAndDisplay(0);
- }
-
- window.setTimeout("ScanDisableDelay()",1000)
- }
- }
-
- function DisableUI ()
- {
- TaskCommandsOn.style.display = "none";
- TaskCommandsOff.style.display = "none";
- TaskCommandsDisabled.style.display = "block";
-
- ScheduleButtonOn.style.display = "none";
- ScheduleButtonOff.style.display = "block";
- }