2010-12-31 03:24:38 +01:00
|
|
|
{
|
|
|
|
"name" : "touch",
|
|
|
|
|
|
|
|
"info" : {
|
|
|
|
"syntax" : "touch <file name>",
|
|
|
|
"brief" : "Create a new (empty) file with the specified name",
|
|
|
|
},
|
|
|
|
|
|
|
|
"action" : function ( arg )
|
|
|
|
{
|
|
|
|
if ( !arg || arg.length == 0 )
|
|
|
|
{
|
|
|
|
return "touch: Parameter expected<br/>\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
shell.auto_prompt_focus = false;
|
|
|
|
shell.auto_prompt_refresh = false;
|
|
|
|
arg = shell.expandPath ( arg );
|
|
|
|
|
|
|
|
var users_php = window.location.href;
|
|
|
|
users_php = users_php.replace ( /\/([a-zA-Z\.]+)$/, '/modules/users/users.php' );
|
|
|
|
params = 'action=touch&file=' + escape ( arg );
|
|
|
|
|
|
|
|
var http = new XMLHttpRequest();
|
|
|
|
http.open ( "POST", users_php, true );
|
|
|
|
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
http.setRequestHeader("Content-length", params.length);
|
|
|
|
http.setRequestHeader("Connection", "close");
|
|
|
|
|
|
|
|
http.onreadystatechange = function ()
|
|
|
|
{
|
|
|
|
if ( http.readyState == 4 && http.status == 200 )
|
|
|
|
{
|
2011-01-11 12:18:45 +01:00
|
|
|
shell.cmdOut.innerHTML = http.responseText;
|
|
|
|
shell.refreshFiles();
|
2010-12-31 03:24:38 +01:00
|
|
|
shell.refreshPrompt ( false, false );
|
|
|
|
shell.auto_prompt_focus = true;
|
|
|
|
shell.auto_prompt_refresh = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
http.send ( params );
|
|
|
|
shell.cmdOut.innerHTML = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|