View file ftp/include/script.js

File size: 1.42Kb
ie=false;
nn=false;
if(document.all) ie = true;
if(document.layers) nn = true;

function anonymousAccess()
{
	if(document.logon.user.value == 'anonymous')
	{
	  document.logon.user.value = '';
	  document.logon.user.focus();
	} else {
	  document.logon.user.value = 'anonymous';
	  document.logon.password.focus();
	}
};

function submitForm(action, file, file2)
{
  document.actionform.action.value = action;
  document.actionform.file.value = file;
  document.actionform.file2.value = file2;
  document.actionform.submit();
};

function createDirectory(directory)
{
  if(directory)
  {submitForm("createdir", directory);}
  else
  {alert('Введи сначала имя папки');}
};

function changeMode(mode)
{
  document.actionform.mode.value = mode;
  document.putForm.mode.value = mode;
  mode==1?document.currentMode.showmode.value = "FTP_BINARY":document.currentMode.showmode.value = "FTP_ASCII";
};

function renameFile(oldName)
{
  newName = window.prompt("Введи имя для "+oldName,""+oldName);
  if(newName)
    {submitForm("rename", oldName, newName);}
    else
    {alert('Имя сохранено !');}
};

function Confirmation(URL)
{
  if (confirm("Ты точно хочешь удалить ?\n"))
  {location = String(URL);}
  else
  {
	  //Do nothing
  }
};

function ConfirmationUnzip(URL)
{
  if (confirm("Разархивировать zip-архив в эту папку ?\n"))
  {location = String(URL);}
};