diff --git a/web/css/file_manager.css b/web/css/file_manager.css index 9770b537..3a43db98 100644 --- a/web/css/file_manager.css +++ b/web/css/file_manager.css @@ -2,15 +2,17 @@ body { margin: 0; padding: 0; } .hidden { display: none; } .l-logo { + background-color: #7B7B7B; background-image: url("/images/sprite.png"); - background-position: -118px -59px; + background-position: -117px -57px; background-repeat: no-repeat; + border: 9px solid #7B7B7B; display: inline-block; float: left; height: 22px; - margin-left: 10px; - margin-top: 11px; - width: 73px; + margin-left: 0; + margin-top: 0; + width: 59px; } #main{ display: inline-block; font-family: Arial; font-size: 15px; color: #777; width: 100%; } @@ -18,10 +20,13 @@ body { margin: 0; padding: 0; } .window { display: inline-block; float: left; /*border: 1px solid #eee;*/ width: 50%; height: 100%; background-color: #ececec; /*background: url(/images/background-dots.png) #ececec;*/ } .window.active { background: #fff; } -.pwd { background-color: #7b7b7b; height: 28px; padding: 12px 0 0 17px; color: #eee; font-size: 14px; } -.window.active .pwd { background-color: #333; } +.window.active .l-logo { background-color: #333; border-color: #333; } + + +.pwd { background-color: #7b7b7b; height: 28px; padding: 12px 0 0 17px; color: #eee; font-size: 14px; overflow: hidden; } +.window.active .pwd { background-color: #333; box-shadow: -2px 0 5px -3px rgba(0, 0, 0, 0.7); } .window.active .pwd a { color: #FFF; } -.pwd a { color: #CFCFCF; margin-right: 6px; padding: 0 7px; cursor: pointer; text-decoration: none; } +.pwd a { color: #CFCFCF; cursor: pointer; text-decoration: none; } .window.active .pwd a:hover, .pwd a:hover { color: #FFCC00; } @@ -57,10 +62,14 @@ body { margin: 0; padding: 0; } .menu div.button.disabled:hover, -.menu div.button { cursor: pointer; transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; box-shadow: none; color: #999 -} +.menu div.button { cursor: pointer; transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) 0s; box-shadow: none; color: #999; } .window.active .menu div.button:hover, -.menu div.button:hover { text-decoration: none; color: #1FB9CA; border-radius: 0; } +.menu div.button:hover { text-decoration: none; color: #1FB9CA; } + +.window.active .menu div.button.del:hover, +.menu div.button.del:hover { color: #FF5A5A; } + + .menu div.button.disabled:hover, .menu div.button.disabled { opacity: 0.5; cursor: default; text-decoration: none; } @@ -92,7 +101,7 @@ body { margin: 0; padding: 0; } .menu .not-writable:hover { border: 1px solid #E2E2E0; } ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; border-left: 1px solid #DDDDDD; overflow: auto; } -.listing li { color: #999999; display: block; height: 32px; margin: 1px 0 0; line-height: 30px; border: 1px solid transparent; } +.listing li { color: #999999; display: block; height: 34px; margin: 1px 0 0; line-height: 30px; padding: 0; } .listing li span { display: inline-block; float: right; } .listing li .marker { width: 4px; float: left; height: 100%; margin-right: 31px; } .listing li.back { } @@ -100,8 +109,8 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b /* .listing li .icon { background: url("/images/document.png") no-repeat scroll -2px 6px; float: left; margin-left: -17px; width: 13px; height: 24px; }*/ -.listing li .icon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px/*-97px -100px*/; float: left; margin-left: -17px; width: 31px; height: 31px; } -.listing li .icon.filetype-dir { background: url("/images/flat_icons.png") no-repeat scroll -24px -99px /*-99px 0px 25px -69px */; } +.listing li .icon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; float: left; margin-left: -17px; width: 31px; height: 31px; margin-top: 1px; } +.listing li .icon.filetype-dir { background: url("/images/flat_icons.png") no-repeat scroll -24px -98px; } .listing li .icon.filetype-tif, .listing li .icon.filetype-gif, @@ -113,7 +122,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .listing li .icon.filetype-yuv, .listing li .icon.filetype-ai, .listing li .icon.filetype-svg, -.listing li .icon.filetype-png { background: url("/images/flat_icons.png") no-repeat scroll -138px -69px; } +.listing li .icon.filetype-png { background: url("/images/flat_icons.png") no-repeat scroll -138px -68px; } .listing li .icon.filetype-txt, .listing li .icon.filetype-csv, @@ -125,12 +134,12 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .listing li .icon.filetype-ppt, .listing li .icon.filetype-sdf, .listing li .icon.filetype-vcf, -.listing li .icon.filetype-db { background: url("/images/flat_icons.png") no-repeat scroll -97px -150px; } +.listing li .icon.filetype-db { background: url("/images/flat_icons.png") no-repeat scroll -97px -149px; } .listing li .icon.filetype-xlr, .listing li .icon.filetype-xls, -.listing li .icon.filetype-xlsx { background: url("/images/flat_icons.png") no-repeat scroll -138px -147px; } +.listing li .icon.filetype-xlsx { background: url("/images/flat_icons.png") no-repeat scroll -138px -146px; } .listing li .icon.filetype-jar, .listing li .icon.filetype-tar, @@ -144,12 +153,12 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .listing li .icon.filetype-sitx, .listing li .icon.filetype-zip, .listing li .icon.filetype-zipx, -.listing li .icon.filetype-jar { background: url("/images/flat_icons.png") no-repeat scroll -176px -34px; } +.listing li .icon.filetype-jar { background: url("/images/flat_icons.png") no-repeat scroll -176px -33px; } .listing li .icon.filetype-fnt, .listing li .icon.filetype-otf, .listing li .icon.filetype-ttf, -.listing li .icon.filetype-fon { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; } +.listing li .icon.filetype-fon { background: url("/images/flat_icons.png") no-repeat scroll -97px -99px; } .listing li .icon.filetype-3g2, .listing li .icon.filetype-3gp, @@ -164,7 +173,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .listing li .icon.filetype-rm, .listing li .icon.filetype-swf, .listing li .icon.filetype-vob, -.listing li .icon.filetype-wmv { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; } +.listing li .icon.filetype-wmv { background: url("/images/flat_icons.png") no-repeat scroll -97px -99px; } .listing li .icon.filetype-aif, .listing li .icon.filetype-iff, @@ -175,23 +184,23 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .listing li .icon.filetype-mpa, .listing li .icon.filetype-ra, .listing li .icon.filetype-wav, -.listing li .icon.filetype-wma { background: url("/images/flat_icons.png") no-repeat scroll -97px -100px; } +.listing li .icon.filetype-wma { background: url("/images/flat_icons.png") no-repeat scroll -97px -99px; } .listing li .icon.filetype-rtf, .listing li .icon.filetype-doc, -.listing li .icon.filetype-docx { background: url("/images/flat_icons.png") no-repeat scroll -138px -123px; } -.listing li .icon.filetype-pdf { background: url("/images/flat_icons.png") no-repeat scroll -138px -96px; } +.listing li .icon.filetype-docx { background: url("/images/flat_icons.png") no-repeat scroll -138px -122px; } +.listing li .icon.filetype-pdf { background: url("/images/flat_icons.png") no-repeat scroll -138px -95px; } -.listing li .icon.filetype-js { background: url("/images/flat_icons.png") no-repeat scroll -138px -204px; } -.listing li .icon.filetype-css { background: url("/images/flat_icons.png") no-repeat scroll -138px -254px; } -.listing li .icon.filetype-php { background: url("/images/flat_icons.png") no-repeat scroll -138px -179px; } +.listing li .icon.filetype-js { background: url("/images/flat_icons.png") no-repeat scroll -138px -203px; } +.listing li .icon.filetype-css { background: url("/images/flat_icons.png") no-repeat scroll -138px -253px; } +.listing li .icon.filetype-php { background: url("/images/flat_icons.png") no-repeat scroll -138px -178px; } .listing li .icon.filetype-html, .listing li .icon.filetype-htm, -.listing li .icon.filetype-xhtml { background: url("/images/flat_icons.png") no-repeat scroll -138px -228px; } +.listing li .icon.filetype-xhtml { background: url("/images/flat_icons.png") no-repeat scroll -138px -227px; } -.listing li .filename { color: #555; cursor: pointer; height: 32px; max-width: 40%; overflow: hidden; float: left; padding: 0 7px 0 7px; border-radius: 3px; transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; } +.listing li .filename { color: #555; cursor: pointer; height: 32px; max-width: 40%; overflow: hidden; float: left; padding: 2px 7px 0 7px; border-radius: 3px; transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; -webkit-transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s; } /* .listing li .filename { background: url("/images/folder_.png") no-repeat scroll -2px 6px; color: #555; cursor: pointer; float: left; margin-left: -27px; padding-left: 19px; }*/ .listing li .filename:hover { color: #333; background-color: #D1D0CF; } @@ -202,48 +211,62 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .listing li.active.selected .filename:hover { color: #FFF; background-color: #60A885; } */ .listing li .filename a { color: #7D7D7D; text-decoration: none; } -.listing li .mode { width: 51px; font-size: 11px; } -.listing li .owner { width: 11%; font-style: italic; color: #81A64F; font-size: 12px; } -.listing li .size-value { width: 70px; color: #44a8b3; font-size: 12px; padding-right: 7px; text-align: right; } -.listing li .size-unit { width: 30px; font-size: 11px; font-weight: bold; color: #A7A7A7; text-align: left; } -.listing li .date { width: 50px; font-size: 11px; } -.listing li .time { width: 50px; font-size: 11px; } +.listing li .mode { width: 51px; font-size: 11px; padding-top: 2px; } +.listing li .owner { width: 11%; font-style: italic; color: #81A64F; font-size: 12px; padding-top: 2px; } +.listing li .size-value { width: 70px; color: #44a8b3; font-size: 12px; padding-right: 7px; text-align: right; padding-top: 2px; } +.listing li .size-unit { width: 30px; font-size: 11px; font-weight: bold; color: #A7A7A7; text-align: left; padding-top: 2px; } +.listing li .date { width: 50px; font-size: 11px; padding-top: 2px; } +.listing li .time { width: 50px; font-size: 11px; padding-top: 2px; } +.window.active .listing li.selected .mode { color: #7F7550; } +.window.active .listing li.selected .owner { /* color: #7F7550; */ } +.window.active .listing li.selected .size-value { color: #7F7550; } +.window.active .listing li.selected .size-unit { color: #7F7550; } +.window.active .listing li.selected .date { color: #7F7550; } +.window.active .listing li.selected .time { color: #7F7550; } + + +/* .listing li.selected-inactive.selected { background-color: #e9e9e9; border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; } .listing li.selected-inactive .mode, .listing li.selected-inactive .time, .listing li.selected-inactive .date { color: #999 !important; } -.window.active .listing li.selected.active { background-color: #73CAA0; } +*/ -.listing li.selected { background-color: #777 /*#7FD5D9*/; } +.listing li.selected { background-color: #DEDEDE; } .listing.active li.selected { background-color: #ffd437 /*#7FD5D9*/; } .listing li.selected .filename:hover { color: #333; background-color: #F0B607; } -.listing li.selected-inactive.selected.active { background-color: #dfc891; border-top: 1px solid #cdb885; border-bottom: 1px solid #cdb885; } -.listing li.active { background-color: #e7cf96; } -.window.active .listing li.active { background-color: #ffe06c; } -.listing li.active .filename{ color: #31775A; } +/* ///.listing li.selected-inactive.selected.active { background-color: #dfc891; border-top: 1px solid #cdb885; border-bottom: 1px solid #cdb885; }*/ + +/* .listing li.selected .filename { color: #333; } .listing li.selected .date, .listing li.selected .mode, .listing li.selected .time { color: #777; } .listing li.selected .owner { color: #31775A; } .listing li.selected .size { color: #31775A; } +*/ +.window.active .listing li.active { background-color: #FFDC5A; } +.window.active .listing li.active .marker { background-color: #C2A84B; } +.listing li.active { background-color: #DEDEDE; } +.listing li.active .marker { background-color: #C2C2C2; } -.listing li.selected.active .filename { color: #fff29c; } +/* ///.listing li.selected.active .filename { color: #fff29c; } */ .listing li.selected.active .marker { background-color: #3a8a96; } -.listing li.selected-inactive .marker { background-color: #7FD5D9; } -.listing li.selected-inactive .filename { color: #54A9A9; } +.listing li.selected-inactive { background-color: #DEDEDE; } +/*///.listing li.selected-inactive .marker { background-color: #7FD5D9; } +.listing li.selected-inactive .filename { color: #54A9A9; } */ .listing li .filename a:hover { color: #3399FF; } .listing li:hover { background-color: #E5E5E5; cursor: pointer; } -.listing li.active:hover { background-color: #FFD63F; } +.window.active .listing li.active:hover { background-color: #FFE570; } .listing li.selected:hover { background-color: /*#89E6EA*/#FFE570; } -.listing li.selected.active:hover { background-color: #77D1A6; } +.listing li.selected.active:hover { background-color: #FFE570; } @@ -358,10 +381,13 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b .warning-box { width: 60%; background-color: #ff9f89; border-bottom: 5px solid #ff6c6e; color: #FFF; font-family: arial; margin-left: auto; margin-right: auto; padding-bottom: 30px; margin-bottom: 50px; left: 20%; position: absolute; top: 0; box-shadow: 0 2px 11px 0 rgba(0, 0, 0, 0.5); } .warning-box.inform { background-color: #72c5b2; border-color: #019174; } +.warning-box.reload { width: 100px; background-color: #333; border-color: #222; z-index: 5000; left: 45%; opacity: 0.9; padding: 17px 27px; border-radius: 0 0 6px 6px; border: none; opacity: 0.9; } .warning-box .message { width: 100%; padding: 30px 0 5px; text-align: center; font-size: 14px; text-transform: uppercase; font-weight: bold; } +.warning-box.reload .message-small { color: #ccc; } +.warning-box.reload .message-small span { color: #72C5B2; font-weight: bold; } .warning-box .message-small { width: 100%; text-align: center; font-size: 13px; color: #9D3407; } .warning-box.inform .message-small { color: #555; } -.warning-box .close { width: 30px; height: 30px; top: 5px; right: -5px; background-color: #FFF; float: right; cursor: pointer; background: url("/images/flat_icons.png") repeat scroll -258px -174px; } +.warning-box .close { width: 30px; height: 30px; top: 5px; right: -5px; background-color: #FFF; float: right; cursor: pointer; background: url("/images/flat_icons.png") repeat scroll -382px -174px; } .warning-box .close:hover { background-color: #DC5D5F; } .warning-box.inform .close:hover { background-color: #019174; } @@ -432,7 +458,7 @@ ul.listing { list-style-type: none; padding: 18px 0 0; margin: -4px 0 0 -1px; b } .progress-container .progress-elm .progress { - background: #ebebeb url("/images/progress.gif") no-repeat scroll -60px 0; + background: #ebebeb url("/images/progress.gif") no-repeat scroll 0px 0; border-color: #8a9079; border-radius: 3px; color: transparent; diff --git a/web/edit/package/index.php b/web/edit/package/index.php index 5662d19c..e8ecaf68 100644 --- a/web/edit/package/index.php +++ b/web/edit/package/index.php @@ -50,6 +50,10 @@ $v_ns1 = $nameservers[0]; $v_ns2 = $nameservers[1]; $v_ns3 = $nameservers[2]; $v_ns4 = $nameservers[3]; +$v_ns5 = $nameservers[4]; +$v_ns6 = $nameservers[5]; +$v_ns7 = $nameservers[6]; +$v_ns8 = $nameservers[7]; $v_backups = $data[$v_package]['BACKUPS']; $v_date = $data[$v_package]['DATE']; $v_time = $data[$v_package]['TIME']; @@ -155,9 +159,17 @@ if (!empty($_POST['save'])) { $v_ns2 = trim($_POST['v_ns2'], '.'); $v_ns3 = trim($_POST['v_ns3'], '.'); $v_ns4 = trim($_POST['v_ns4'], '.'); + $v_ns5 = trim($_POST['v_ns5'], '.'); + $v_ns6 = trim($_POST['v_ns6'], '.'); + $v_ns7 = trim($_POST['v_ns7'], '.'); + $v_ns8 = trim($_POST['v_ns8'], '.'); $v_ns = $v_ns1.",".$v_ns2; if (!empty($v_ns3)) $v_ns .= ",".$v_ns3; if (!empty($v_ns4)) $v_ns .= ",".$v_ns4; + if (!empty($v_ns5)) $v_ns .= ",".$v_ns5; + if (!empty($v_ns6)) $v_ns .= ",".$v_ns6; + if (!empty($v_ns7)) $v_ns .= ",".$v_ns7; + if (!empty($v_ns8)) $v_ns .= ",".$v_ns8; $v_ns = escapeshellarg($v_ns); $v_time = escapeshellarg(date('H:i:s')); $v_date = escapeshellarg(date('Y-m-d')); diff --git a/web/edit/user/index.php b/web/edit/user/index.php index fcb16072..83d0c866 100644 --- a/web/edit/user/index.php +++ b/web/edit/user/index.php @@ -43,6 +43,11 @@ $v_ns1 = $nameservers[0]; $v_ns2 = $nameservers[1]; $v_ns3 = $nameservers[2]; $v_ns4 = $nameservers[3]; +$v_ns5 = $nameservers[4]; +$v_ns6 = $nameservers[5]; +$v_ns7 = $nameservers[6]; +$v_ns8 = $nameservers[7]; + $v_suspended = $data[$v_username]['SUSPENDED']; if ( $v_suspended == 'yes' ) { $v_status = 'suspended'; @@ -142,17 +147,35 @@ if (!empty($_POST['save'])) { } // Change NameServers - if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) && (empty($_SESSION['error_msg']))) { + if (($v_ns1 != $_POST['v_ns1']) || ($v_ns2 != $_POST['v_ns2']) || ($v_ns3 != $_POST['v_ns3']) || ($v_ns4 != $_POST['v_ns4']) || ($v_ns5 != $_POST['v_ns5']) + || ($v_ns6 != $_POST['v_ns6']) || ($v_ns7 != $_POST['v_ns7']) || ($v_ns8 != $_POST['v_ns8']) && (empty($_SESSION['error_msg']))) { $v_ns1 = escapeshellarg($_POST['v_ns1']); $v_ns2 = escapeshellarg($_POST['v_ns2']); $v_ns3 = escapeshellarg($_POST['v_ns3']); $v_ns4 = escapeshellarg($_POST['v_ns4']); + $v_ns5 = escapeshellarg($_POST['v_ns5']); + $v_ns6 = escapeshellarg($_POST['v_ns6']); + $v_ns7 = escapeshellarg($_POST['v_ns7']); + $v_ns8 = escapeshellarg($_POST['v_ns8']); $ns_cmd = VESTA_CMD."v-change-user-ns ".$v_username." ".$v_ns1." ".$v_ns2; if (!empty($_POST['v_ns3'])) $ns_cmd = $ns_cmd." ".$v_ns3; if (!empty($_POST['v_ns4'])) $ns_cmd = $ns_cmd." ".$v_ns4; + if (!empty($_POST['v_ns5'])) $ns_cmd = $ns_cmd." ".$v_ns5; + if (!empty($_POST['v_ns6'])) $ns_cmd = $ns_cmd." ".$v_ns6; + if (!empty($_POST['v_ns7'])) $ns_cmd = $ns_cmd." ".$v_ns7; + if (!empty($_POST['v_ns8'])) $ns_cmd = $ns_cmd." ".$v_ns8; exec ($ns_cmd, $output, $return_var); check_return_code($return_var,$output); unset($output); + + $v_ns1 = str_replace("'","", $v_ns1); + $v_ns2 = str_replace("'","", $v_ns2); + $v_ns3 = str_replace("'","", $v_ns3); + $v_ns4 = str_replace("'","", $v_ns4); + $v_ns5 = str_replace("'","", $v_ns5); + $v_ns6 = str_replace("'","", $v_ns6); + $v_ns7 = str_replace("'","", $v_ns7); + $v_ns8 = str_replace("'","", $v_ns8); } // Set success message diff --git a/web/file_manager/fm_api.php b/web/file_manager/fm_api.php index f4fc28b2..92acfa28 100644 --- a/web/file_manager/fm_api.php +++ b/web/file_manager/fm_api.php @@ -4,8 +4,6 @@ //error_reporting(NULL); -session_start(); - include($_SERVER['DOCUMENT_ROOT']."/inc/main.php"); include($_SERVER['DOCUMENT_ROOT']."/file_manager/fm_core.php"); diff --git a/web/inc/main.php b/web/inc/main.php index ae103cf2..87894c7b 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -1,4 +1,5 @@ $favourite){ + $favourites[$key] = array(); + + $items = explode(',', $favourite); + foreach($items as $item){ + if($item) + $favourites[$key][trim($item)] = 1; + } + } + + $_SESSION['favourites'] = $favourites; +} + + function check_error($return_var) { if ( $return_var > 0 ) { @@ -144,6 +169,7 @@ function humanize_time($usage) { $usage = $usage / 60; if ( $usage > 24 ) { $usage = $usage / 24; + $usage = number_format($usage); if ( $usage == 1 ) { $usage = $usage." ".__('day'); diff --git a/web/js/file_manager.js b/web/js/file_manager.js index 2702b92d..008d13bc 100644 --- a/web/js/file_manager.js +++ b/web/js/file_manager.js @@ -29,11 +29,16 @@ FM.ORDER_BOX_B = $('.context-menu.sort-order.tab-b'); FM.ORDER_TAB_A = 'type_asc'; FM.ORDER_TAB_B = 'type_asc'; +FM.Env.RELOAD_IN_TIME = false; + + FM.TAB_A_CURRENT_PATH = GLOBAL.TAB_A__PATH; FM.TAB_B_CURRENT_PATH = GLOBAL.TAB_B_PATH; FM.IMAGES = {'A':[], 'B': []}; +FM.RELOAD_IN_TIME_SECONDS = 3; + FM.IMG_FILETYPES = 'png, jpg, jpeg, gif'; FM.SUPPORTED_ARCHIEVES = [ @@ -91,6 +96,7 @@ FM.showError = function(type, message) { setTimeout(function() { ref.find('.warning-message').fadeOut(); }, FM.errorMessageTimeout); + return; } } @@ -98,7 +104,7 @@ FM.showError = function(type, message) { FM.popupClose(); var tpl = Tpl.get('popup_alert', 'FM'); tpl.set(':TEXT', message); - + FM.popupOpen(tpl.finalize()); } } @@ -147,6 +153,10 @@ FM.setActive = function(index, box) { var tab = FM.getTabLetter(box); $(box + ' .selected').removeClass('selected'); $(box).find('li.dir:eq('+index+')').addClass('selected'); + + $(box + ' .active').removeClass('active'); + $(box).find('li.dir:eq('+index+')').addClass('active'); + //$(box).find('li:eq('+index+')').addClass('selected'); //var w_h = $(window).height() - 100; var w_offset = $(box).scrollTop(); @@ -173,6 +183,9 @@ FM.setActive = function(index, box) { $(box).scrollTo(w_offset + cur_elm.top - w_height/2 + cur_elm_height/2); //} + + + FM['CURRENT_' + tab + '_LINE'] = index; FM.CURRENT_TAB = box; @@ -180,6 +193,21 @@ FM.setActive = function(index, box) { $(FM.preselectedItems[tab]).each(function(i, index) { $(box).find('.dir:eq(' + index + ')').addClass('selected'); }); + + + var src = $(box).find('.dir:eq('+index+')').find('.source').val(); + src = $.parseJSON(src); + var tab = FM.getTabLetter(FM.CURRENT_TAB); + + if (FM.itemIsArchieve(src)) { + if($('.menu-'+tab+' .archive.button').first().is(':visible')) + $('.menu-'+tab+' .extract-btn').first().show(); + else + $('.menu-'+tab+' .extract-btn.small').show(); + } + else { + $('.menu-'+tab+' .extract-btn').hide(); + } } FM.setSecondInactive = function(index, box) { @@ -190,7 +218,29 @@ FM.setSecondInactive = function(index, box) { FM.BG_TAB = box; } +FM.goBackwards = function() { + if (FM.isPopupOpened()) { + return; + } + + var tab = FM.getTabLetter(FM.CURRENT_TAB); + var box = FM['TAB_' + tab]; + $(box).find('.dir:eq(0)').find('.source').val(); + + var src = $.parseJSON($(box).find('.dir:eq(0)').find('.source').val()); + var dir = src.full_path; + + FM.open(dir, box); +} + FM.goToTop = function() { + if (FM.isPopupOpened()) { + return; + } + if (FM.isPopupOpened()) { + return; + } + var tab = FM.getTabLetter(FM.CURRENT_TAB); var index = 0; @@ -198,6 +248,9 @@ FM.goToTop = function() { } FM.goToBottom = function() { + if (FM.isPopupOpened()) { + return; + } var tab = FM.getTabLetter(FM.CURRENT_TAB); var index = $(FM.CURRENT_TAB).find('.dir').length - 1; @@ -205,22 +258,35 @@ FM.goToBottom = function() { } FM.goUp = function() { + if (FM.isPopupOpened()) { + return; + } var tab = FM.getTabLetter(FM.CURRENT_TAB); var index = FM['CURRENT_' + tab + '_LINE']; index -= 1; - if (index < 0) { + /*if (index < 0) { index = $(FM.CURRENT_TAB).find('li.dir').length - 1; + }*/ + if (index < 0) { + index = 0; } - + FM.setActive(index, FM.CURRENT_TAB); } FM.goDown = function() { + if (FM.isPopupOpened()) { + return; + } + var tab = FM.getTabLetter(FM.CURRENT_TAB); var index = FM['CURRENT_' + tab + '_LINE']; index += 1; - if (index > ($(FM.CURRENT_TAB).find('li.dir').length - 1)) { + /*if (index > ($(FM.CURRENT_TAB).find('li.dir').length - 1)) { index = 0; + }*/ + if (index > ($(FM.CURRENT_TAB).find('li.dir').length - 1)) { + index = $(FM.CURRENT_TAB).find('li.dir').length - 1; } FM.setActive(index, FM.CURRENT_TAB); @@ -236,7 +302,7 @@ FM.open = function(dir, box, callback) { 'dir': dir }; App.Ajax.request('cd', params, function(reply) { - var tab = FM.getTabLetter(FM.CURRENT_TAB); + //var tab = FM.getTabLetter(FM.CURRENT_TAB); FM.preselectedItems[tab] = []; if (reply.result == true) { var html = FM.generate_listing(reply.listing, box); @@ -264,19 +330,20 @@ FM.open = function(dir, box, callback) { } FM.updateTopLevelPathBar = function(box, tab, path) { - console.log(path); + var formattedPath = []; path = path.replace(FM.ROOT_DIR, ''); formattedPath.push(''+FM.ROOT_DIR+''); - + $.each(path.split('/'), function(i, part) { if (part.trim() == '') { return; } + console.log("part - " + part); formattedPath.push(''+part+''); }); - - $('.pwd-tab-' + tab).html(formattedPath.join('/')); + + $('.pwd-tab-' + tab).html(formattedPath.join(' / ')); } FM.isItemFile = function(item) { @@ -607,7 +674,6 @@ FM.toggleCheck = function(uid) { } FM.fotoramaOpen = function(tab, img_index) { - console.log('index: ' + img_index); $('.fotorama').fotorama({ nav: 'thumbs', @@ -860,6 +926,9 @@ FM.toggleAllItemsSelected = function() { } FM.selectCurrentElementAndGoToNext = function () { + if (FM.isPopupOpened()) { + return; + } var tab = FM.getTabLetter(FM.CURRENT_TAB); var box = FM['TAB_' + tab]; @@ -946,6 +1015,7 @@ FM.selectItem = function(item, box) { var src = $(item).find('.source').val(); src = $.parseJSON(src); var tab = FM.getTabLetter(FM.CURRENT_TAB); + if (FM.itemIsArchieve(src)) { $('.menu-'+tab+' .extract-btn').show(); } @@ -1046,6 +1116,10 @@ FM.packItem = function() { FM.switchTab = function() { + if (FM.isPopupOpened()) { + return; + } + if (FM.CURRENT_TAB == FM.TAB_A) { FM.setTabActive(FM.TAB_B); $(FM.TAB_B).find('.selected-inactive').removeClass('selected-inactive'); @@ -1154,7 +1228,12 @@ FM.renameItems = function() { FM.popupOpen(tpl.finalize()); } +FM.isPopupOpened = function() { + return $('#popup').length > 0 ? true : false; +} + FM.popupOpen = function(html) { + //$('#popup').flayer_close(); $('
').attr('id', 'popup').html(html).flayer({ afterStart: function(elm) { elm.find('input[type="text"]:first').focus(); @@ -1482,6 +1561,31 @@ FM.displayError = function(msg) { //return alert(msg); } +FM.triggerRefreshActionTrick = function() { + // reload-in-time + $('#reload-in-time').remove(); + FM.Env.RELOAD_IN_TIME = true; + var tpl = Tpl.get('reload_in_time', 'FM'); + //tpl.set(':TIME_LEFT', FM.RELOAD_IN_TIME_SECONDS + 1); + + $('body').append(tpl.finalize()); + + var ref = $('#reload-in-time').find('.reload-in-time-counter'); + + var timeleft = FM.RELOAD_IN_TIME_SECONDS; + FM.Env.reload_in_time_interval = + setInterval(function() { + if (timeleft <= 0) { + clearInterval(FM.Env.reload_in_time_interval); + $('#reload-in-time').remove(); + FM.Env.RELOAD_IN_TIME = false; + } + //ref.text(timeleft); + timeleft -= 1; + }, 1000); +} + + FM.confirmCreateDir = function() { var tab = FM.getTabLetter(FM.CURRENT_TAB); var box = FM['TAB_' + tab]; @@ -1680,7 +1784,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1689,35 +1793,40 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); shortcut.add("Left",function() { - FM.setTabActive(FM.TAB_A); + if (!FM.isPopupOpened()) { + FM.setTabActive(FM.TAB_A); - var tab = FM.getTabLetter(FM.CURRENT_TAB); - if (FM['CURRENT_' + tab + '_LINE'] == -1) { - FM.setActive(0, FM.CURRENT_TAB); - } + var tab = FM.getTabLetter(FM.CURRENT_TAB); + if (FM['CURRENT_' + tab + '_LINE'] == -1) { + FM.setActive(0, FM.CURRENT_TAB); + } + } },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); shortcut.add("Right",function() { - FM.setTabActive(FM.TAB_B); + if (!FM.isPopupOpened()) { + FM.setTabActive(FM.TAB_B); + + var tab = FM.getTabLetter(FM.CURRENT_TAB); + if (FM['CURRENT_' + tab + '_LINE'] == -1) { + FM.setActive(0, FM.CURRENT_TAB); + } + } - var tab = FM.getTabLetter(FM.CURRENT_TAB); - if (FM['CURRENT_' + tab + '_LINE'] == -1) { - FM.setActive(0, FM.CURRENT_TAB); - } },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1726,7 +1835,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1735,7 +1844,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1744,7 +1853,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1753,7 +1862,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1762,7 +1871,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1772,7 +1881,7 @@ $(document).ready(function() { },{ 'type': 'keydown', 'propagate': false, - 'disable_in_input': false, + 'disable_in_input': true, 'target': document }); @@ -1800,6 +1909,115 @@ $(document).ready(function() { 'target': document }); + shortcut.add("n",function() { + FM.createFile(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + }); + shortcut.add("F7",function() { + FM.createDir(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': false, + 'target': document + }); + shortcut.add("F8",function() { + FM.deleteItems(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': false, + 'target': document + }); + shortcut.add("Delete",function() { + FM.deleteItems(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + }); + shortcut.add("shift+F6",function() { + FM.renameItems(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': false, + 'target': document + }); + shortcut.add("F2",function() { + FM.renameItems(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': false, + 'target': document + }); + shortcut.add("F5",function() { + if (FM.Env.RELOAD_IN_TIME == true) { + location.reload(); + return; + } + else { + FM.copyItems(); + FM.triggerRefreshActionTrick(); + } + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': false, + 'target': document + }); + shortcut.add("a",function() { + FM.packItem(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + }); + + shortcut.add("u",function() { +/// TODO upload file FM.uploadFile(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + }); + + shortcut.add("d",function() { + FM.downloadFiles(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + }); + shortcut.add("Backspace",function() { + FM.goBackwards(); + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + }); + /*shortcut.add("Y",function() { + if (FM.Env.RELOAD_IN_TIME == true) { + location.reload(); + } + },{ + 'type': 'keydown', + 'propagate': false, + 'disable_in_input': true, + 'target': document + });*/ + + diff --git a/web/js/i18n.js.php b/web/js/i18n.js.php index 500b98f0..0ca35378 100644 --- a/web/js/i18n.js.php +++ b/web/js/i18n.js.php @@ -62,7 +62,8 @@ App.Constants.FM_RENAME = ''; App.Constants.FM_DELETE = ''; App.Constants.FM_EXTRACT = ''; App.Constants.FM_CREATE = ''; -App.Constants.FM_PACK = ''; +App.Constants.FM_PACK = ''; +App.Constants.FM_PACK_BUTTON = ''; App.Constants.FM_OK = ''; App.Constants.FM_YOU_ARE_COPYING = ''; App.Constants.FM_YOU_ARE_REMOVING = ''; @@ -70,12 +71,12 @@ App.Constants.FM_YOU_ARE_REMOVING = ''; App.Constants.FM_CONFIRM_DELETE = ''; App.Constants.FM_INTO_KEYWORD = ''; -App.Constants.FM_EXISTING_FILES_WILL_BE_DELETED = ''; +App.Constants.FM_EXISTING_FILES_WILL_BE_REPLACED= ''; App.Constants.FM_ORIGINAL_NAME = ''; App.Constants.FM_FILE = ''; App.Constants.FM_ALREADY_EXISTS = ''; -App.Constants.FM_EXTRACT = ''; App.Constants.FM_CREATE_FILE = ''; +App.Constants.FM_CREATE_DIRECTORY = ''; diff --git a/web/js/jquery.finder.js b/web/js/jquery.finder.js index fdf6a297..74501370 100644 --- a/web/js/jquery.finder.js +++ b/web/js/jquery.finder.js @@ -203,10 +203,10 @@ }, selectAll: function(p,o) { p.on('mouseover', function(){ - d.on("keydown", turnOff); + //d.on("keydown", turnOff); }); p.on('mouseout', function(){ - d.off("keydown", turnOff); + //d.off("keydown", turnOff); }); function turnOff(e) { diff --git a/web/js/templates.js b/web/js/templates.js index dd33f790..df0ad188 100644 --- a/web/js/templates.js +++ b/web/js/templates.js @@ -12,6 +12,13 @@ App.Templates.html = { //\ FM: { + reload_in_time: [ + //'
If you want to reload, hit key "Y" to reload.
You have ~!:TIME_LEFT~!s. to do this.
Hurry up!
' + '
\ + \ +
Hit F5 to reload the page
\ +
' + ], entry_line: ['
  • \ \ \ @@ -50,18 +57,18 @@ App.Templates.html = {
  • \ '], popup_copy: [''], popup_rename: ['
    \ -
    '+App.Constants.FM_ORIGINAL_NAME+': "~!:FILENAME~!"
    \ +
    '+App.Constants.FM_RENAME+': "~!:FILENAME~!"
    \ \
    \
    \ @@ -73,12 +80,12 @@ App.Templates.html = {
    \
    \

    '+App.Constants.FM_CANCEL+'

    \ -

    '+App.Constants.FM_Rename+'

    \ +

    '+App.Constants.FM_RENAME+'

    \
    \
    '], popup_pack: ['
    \ -
    '+App.Constants.FM_PACK+' "~!:FILENAME~!" '+App.Constants.FM_INTO_KEYWORD+':
    \ +
    '+App.Constants.FM_PACK+' "~!:FILENAME~!"
    \
    \ \
    \ @@ -88,7 +95,7 @@ App.Templates.html = {
    \
    \

    '+App.Constants.FM_CANCEL+'

    \ -

    '+App.Constants.FM_PACK+'

    \ +

    '+App.Constants.FM_PACK_BUTTON+'

    \
    \ '], @@ -121,7 +128,7 @@ App.Templates.html = { \ '], popup_create_dir: ['
    \ -
    Create directory
    \ +
    '+App.Constants.FM_CREATE_DIRECTORY+'
    \ \
    \
    \ diff --git a/web/list/directory/index.php b/web/list/directory/index.php index 4c8a0795..96c0cf51 100644 --- a/web/list/directory/index.php +++ b/web/list/directory/index.php @@ -1,9 +1,17 @@ GLOBAL.START_DIR_A = "' . $path_a $GLOBAL_JS .= ''; $GLOBAL_JS .= ''; + // Footer -include($_SERVER['DOCUMENT_ROOT'].'/templates/file_manager/main.php'); +include($_SERVER['DOCUMENT_ROOT'].'/templates/file_manager/main.php'); \ No newline at end of file diff --git a/web/templates/file_manager/main.php b/web/templates/file_manager/main.php index 426cf4e9..1e1dea2f 100644 --- a/web/templates/file_manager/main.php +++ b/web/templates/file_manager/main.php @@ -250,6 +250,10 @@
    writing the reading text at the reading write writing the reading text at the reading write!
    + +