Skip to content

Commit

Permalink
добавил shortcuts в проводнике (Ctrl+C, Ctrl+V и т.д), исправил косяк…
Browse files Browse the repository at this point in the history
…и в гибернации
  • Loading branch information
hobbytes committed Aug 13, 2018
1 parent eff22e2 commit 1005513
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 29 deletions.
2 changes: 1 addition & 1 deletion makeprocess.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function makeprocess($destination, $idprocess, $param, $key, $name){
$style_ = "'display','none'";

echo '
<div id=app'.$idprocess.' tabindex="'.$idprocess.'" style="max-width:'.$maxwidth.'; position:absolute; left:'.$left.'; top:'.$top.'; overflow:hidden;" class="ui-widget-content window windownormal windowborder" wh="" ww="" applength-'.$idprocess.'="0">
<div id=app'.$idprocess.' tabindex="'.$idprocess.'" style="max-width:'.$maxwidth.'; position:absolute; left:'.$left.'; top:'.$top.'; overflow:hidden; outline: none !important;" class="ui-widget-content window windownormal windowborder" wh="" ww="" applength-'.$idprocess.'="0">
<div id=drag'.$idprocess.' class="ui-widget-header dragwindow">
<div class="process-title" style="cursor:default; font-size:17px; margin:0 10px; text-overflow:ellipsis; overflow:hidden;">
<div style="background-color:transparent; background-image: url('.$appicon.'); background-size:cover; height:20px; width:20px; margin:0px 3px 0px 3px; float:left;">
Expand Down
101 changes: 89 additions & 12 deletions system/apps/Explorer/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function convert($string){
<span><?echo $explorer_lang['menu_file_label']?></span>
<div id="filemenu<?echo $AppID?>" style="display:none; cursor:default; position:absolute; z-index:1; background:#fff; width:auto; top:31px; left:4px;">
<ul id="mmenu<?echo $AppID?>" >
<li><div <?echo 'id="'.$dir.'/" class="loadthis'.$AppID.'" onClick="load'.$AppID.'(this);" ';?> ><?echo $explorer_lang['menu_open_label']?></div></li>
<li><div <?echo 'id="'.$dir.'/" class="loadthis'.$AppID.'" onClick="load'.$AppID.'(this);" ';?> ><?echo $explorer_lang['menu_open_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+Alt+O</span> </div></li>
<li>
<div <?echo 'id="'.$dir.'/" class="loadas" ';?> ><?echo $explorer_lang['menu_openas_label']?></div>
<ul style="background:#fff;">
Expand All @@ -280,16 +280,16 @@ function convert($string){
?>
</ul>
</li>
<li><div <?echo 'class="loadthis'.$AppID.'" onClick="mkfileshow'.$AppID.'();" ';?> ><?echo $explorer_lang['menu_newfile_label']?></div></li>
<li><div <?echo 'class="loadthis'.$AppID.'" onClick="mkfileshow'.$AppID.'();" ';?> ><?echo $explorer_lang['menu_newfile_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+Alt+N</span> </div></li>
<li><div <? echo 'id="'.$dir.'/" class="loadthis'.$AppID.'" onClick="getproperty'.$AppID.'(this);"';?>><?echo $explorer_lang['menu_rename_label']?></div></li>
<li><div <?echo 'onClick="mkdirshow'.$AppID.'();" ';?> ><?echo $explorer_lang['menu_md_label']?></div></li>
<li><div <?echo 'onClick="mkdirshow'.$AppID.'();" ';?> ><?echo $explorer_lang['menu_md_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+Alt+F</span> </div></li>
<li><div <?echo 'id="'.$dir.'/" class="mklink" onClick="link'.$AppID.'(this);" ';?> ><?echo $explorer_lang['menu_ml_label']?></div></li>
<li><div <?echo 'class="loadthis'.$AppID.'" onClick="newload'.$AppID.'('."'del'".',this.id)" ';?>><?echo $explorer_lang['menu_trash_label']?></div></li>
<li><div <?echo 'class="loadthis'.$AppID.'" onClick="newload'.$AppID.'('."'delf'".',this.id)" ';?>><?echo $explorer_lang['menu_delete_label']?></div></li>
<li><div <?echo 'class="loadthis'.$AppID.'" onClick="newload'.$AppID.'('."'del'".',this.id)" ';?>><?echo $explorer_lang['menu_trash_label']?> <span style="font-size: 10px; color:#a2a2a2;">Del</span> </div></li>
<li><div <?echo 'class="loadthis'.$AppID.'" onClick="newload'.$AppID.'('."'delf'".',this.id)" ';?>><?echo $explorer_lang['menu_delete_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+Del</span> </div></li>
<li><div <? echo 'id="'.$dir.'/" onClick="loadshow'.$AppID.'(this)"';?>><?echo $explorer_lang['menu_loadfile_label']?></div></li>
<li><div <? echo 'class="loadthis'.$AppID.'" onClick="newload'.$AppID.'('."'zipfile'".',this.id)"';?>><?echo $explorer_lang['menu_zip_label']?></div></li>
<li><div <? echo 'class="loadthis'.$AppID.'" onClick="newload'.$AppID.'('."'zipfileunpack'".',this.id)"';?>><?echo $explorer_lang['menu_zip_unpack']?></div></li>
<li><div <? echo 'id="'.$dir.'/" class="loadthis'.$AppID.'" onClick="getproperty'.$AppID.'(this);"';?>><?echo $explorer_lang['menu_property_label']?></div></li>
<li><div <? echo 'id="'.$dir.'/" class="loadthis'.$AppID.'" onClick="getproperty'.$AppID.'(this);"';?>><?echo $explorer_lang['menu_property_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+Alt+P</span> </div></li>
</ul>
</div>
</div>
Expand All @@ -298,9 +298,9 @@ function convert($string){
<span><?echo $explorer_lang['menu_edit_label']?></span>
<div id="editmenu_<?echo $AppID?>" style="display:none; cursor:default; position:absolute; z-index:1; background:#fff; width:auto; top:31px; left:68px;">
<ul id="editmenu<?echo $AppID?>" >
<li><div <?echo 'id="" class="loadthis'.$AppID.'" onClick="copy'.$AppID.'(this.id);" ';?> ><?echo $explorer_lang['menu_copy_label']?></div></li>
<li class="pastebutton"><div <?echo 'id="" class="loadthis'.$AppID.'" onClick="paste'.$AppID.'(this.id);" ';?> ><?echo $explorer_lang['menu_paste_label']?></div></li>
<li><div <?echo 'id="" class="loadthis'.$AppID.'" onClick="cut'.$AppID.'(this.id);" ';?> ><?echo $explorer_lang['menu_cut_label']?></div></li>
<li><div <?echo 'id="" class="loadthis'.$AppID.'" onClick="copy'.$AppID.'(this.id);" ';?> ><?echo $explorer_lang['menu_copy_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+C</span> </div></li>
<li class="pastebutton"><div <?echo 'id="" class="loadthis'.$AppID.'" onClick="paste'.$AppID.'(this.id);" ';?> ><?echo $explorer_lang['menu_paste_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+V</span> </div></li>
<li><div <?echo 'id="" class="loadthis'.$AppID.'" onClick="cut'.$AppID.'(this.id);" ';?> ><?echo $explorer_lang['menu_cut_label']?> <span style="font-size: 10px; color:#a2a2a2;">Ctrl+X</span> </div></li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -692,8 +692,10 @@ function checkbutton(){
}

function copy<?echo $AppID?>(file){
localStorage.setItem('copy', file);
checkbutton();
if($(".loadthis<?echo $AppID?>").attr("id")){
localStorage.setItem('copy', file);
checkbutton();
}
};

function paste<?echo $AppID?>(file){
Expand Down Expand Up @@ -737,6 +739,21 @@ function reloadApp<?echo $AppID?>(){
reload<?echo $AppID?>();
}



var map = {
'17': false,
'18': false,
'46': false,
'67': false,
'70': false,
'78': false,
'79': false,
'80': false,
'86': false,
'88': false,
};

$("#app<?echo $AppID ?>").bind('keydown', function(e){
if($("#app<?echo $AppID?>").hasClass('windowactive')){
var keycode = (e.keyCode ? e.keyCode : e.which);
Expand Down Expand Up @@ -797,6 +814,62 @@ function reloadApp<?echo $AppID?>(){
}
}

if(e.keyCode in map){
map[e.keyCode] = true;
folder_subject = $(".loadthis<?echo $AppID?>").attr("id");

//copy keycode
if(map['17'] && map['67']){
copy<?echo $AppID?>(folder_subject);
}

//paste keycode
if(map['17'] && map['86']){
paste<?echo $AppID?>(folder_subject);
}

//cut keycode
if(map['17'] && map['88']){
cut<?echo $AppID?>(folder_subject);
}

//delete keycode
if(map['46']){
newload<?echo $AppID?>('del', folder_subject);
}

//delete forever keycode
if(map['17'] && map['46']){
newload<?echo $AppID?>('delf', folder_subject);
}

//newfile keycode
if(map['17'] && map['18'] && map['78']){
mkfileshow<?echo $AppID?>();
}

//new file keycode
if(map['17'] && map['18'] && map['78']){
mkfileshow<?echo $AppID?>();
}

//new folder keycode
if(map['17'] && map['18'] && map['70']){
mkdirshow<?echo $AppID?>();
}

//open keycode
if(map['17'] && map['18'] && map['79']){
load<?echo $AppID?>(folder_subject);
}

//show property keycode
if(map['17'] && map['18'] && map['80']){
getproperty<?echo $AppID?>(folder_subject);
}

}

}else{
let keycode = null;
enterfolder = null;
Expand All @@ -805,7 +878,11 @@ function reloadApp<?echo $AppID?>(){
leftfolder = null;
let e = null;
}
});
}).keyup(function(e){
if(e.keyCode in map){
map[e.keyCode] = false;
}
});

checkbutton();
</script>
Expand Down
7 changes: 5 additions & 2 deletions system/core/design/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ body {
opacity: 0.8;
box-shadow: 0px 0px 10px 0px rgba(37,37,37,0.68);
transition: all 0.2s ease;
padding: 3px;
}

.selector-hidden{
Expand Down Expand Up @@ -358,11 +359,13 @@ body {
text-transform: uppercase;
font-weight: 700;
transition: all 0.2s ease;
width: max-content;
margin: 0 auto;
}

#labelos:hover{
color: #8bc34a;
text-shadow: 0px 0px 1px #afffb2;
color: #f45c43;
text-shadow: 0px 0px 1px #651111;
}

::-webkit-scrollbar {
Expand Down
2 changes: 1 addition & 1 deletion system/core/library/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function auth($login, $password, $keyaccess = NULL) {
$_SESSION["loginuser"] = $login;

if(!empty($keyaccess)){

$bds = new readbd;
global $getdata;

Expand Down
3 changes: 1 addition & 2 deletions system/core/library/etc/hibernation.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
global $getdata;
$security = new security;
$bd = new readbd;
$bd->readglobal2("password","forestusers","login",$_SESSION["loginuser"]);
$key = $getdata;
$key = $bd->readglobal2("password", "forestusers", "login", $_SESSION["loginuser"], true);
$content = $_POST['content'];
$id = $_POST['appid'];
$content = $security->__encode($content, $key);
Expand Down
2 changes: 2 additions & 0 deletions system/core/library/js/core-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ function runEffect() {
UpdateWindow(id, name);
});
$("#process" + id ).appendTo("#proceses");

$("#app" + id).focus();
};

<?
Expand Down
26 changes: 15 additions & 11 deletions system/core/library/prepare.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,23 @@ function desktop($delclassname)
$key = $link['key'];
$linkicon = $link['icon'];
$getExt = pathinfo($param);
$extension = '';
$appicon=str_replace(array('.','php','main'),'',$ref).'app.png';
$extension = NULL;
$appicon = str_replace(array('.','php','main'),'',$ref).'app.png';
if (!is_file($appicon)){
$appicon='system/core/design/images/app.png';
}
if(!empty($getExt['extension'])){
if(!preg_match("/\.(jpg|jpeg|png|gif|bmp)$/i",$param)){ // print extenstion if !image
if(!preg_match("/\.(jpg|jpeg|png|gif|bmp)$/i", $param)){ // print extenstion if !image
$extension = '<div style="position:absolute; top:60px; left:0; right:0; cursor:default; color:#d05858; font-size:14px; font-weight:900;">'.$getExt['extension'].'</div>';
}
}
if(!file_exists($appicon)){
$appicon='';
$appicon = NULL;
}
if($linkicon==''){
$linkicon=$hashfile->filehash($appicon);
if(empty($linkicon)){
$linkicon = $hashfile->filehash($appicon);
}else{
$linkicon=$hashfile->filehash('./'.$link['icon']);
$linkicon = $hashfile->filehash('./'.$link['icon']);
}
$classtrash = '';
if(preg_match("/$login\/trash/",$param)){
Expand Down Expand Up @@ -244,7 +244,7 @@ function desktop($delclassname)
</script>
</div>
<?
$linkname=str_replace("_"," ",$linkname);
$linkname = str_replace("_"," ",$linkname);
if(!preg_match('/.php/',$ref)){
$destination = $ref.$file.'.php';
}else{
Expand Down Expand Up @@ -294,12 +294,16 @@ function hibernation(){
}

if(!empty($content) && $_SESSION["safemode"]!='true'){
$_SESSION['appid'] = $content['last_app_id']-1;
$bd->readglobalfunction(password,users,login,$login);
$key = $getdata;
$_SESSION['appid'] = $content['last_app_id'];
$key = $bd->readglobal2("password", "forestusers", "login", $login, true);
echo $security->__decode($content['state'], $key);
file_put_contents('system/users/'.$login.'/settings/state.hdf','');
$object->newnotification("Hibernation",$language[$_SESSION['locale'].'_hibernation_name'],$language[$_SESSION['locale'].'_hibernation_notification']." <b>".$content['time_stamp']."</b>");
?>
<script>
var id = <? echo $content['last_app_id']; ?>;
</script>
<?
}else{
file_put_contents('system/users/'.$login.'/settings/state.hdf','');
}
Expand Down

0 comments on commit 1005513

Please sign in to comment.