version 2.5

pull/19/head
kalcaddle 2014-06-15 23:35:50 +08:00
parent de692316c5
commit 1f441d7e6d
48 changed files with 322 additions and 203 deletions

View File

@ -8,9 +8,9 @@
date_default_timezone_set('PRC');
@ini_set('session.cache_expire',600);
@set_time_limit(600);//30min pathInfoMuti,search,upload,download...
@ini_set('display_errors',0);
ini_set('session.cache_expire',600);
set_time_limit(600);//30min pathInfoMuti,search,upload,download...
ini_set('display_errors',0);
function P($path){return str_replace('\\','/',$path);}
define('WEB_ROOT',str_replace(P($_SERVER['SCRIPT_NAME']),'',P(dirname(dirname(__FILE__))).'/index.php').'/');
@ -79,5 +79,5 @@ session_start();
session_write_close();//之后要修改$_SESSION 需要先调用session_start()
$config['autorun'] = array(
array('controller'=>'user','function'=>'loginCheck'),
array('controller'=>'user','function'=>'authCheck'),
array('controller'=>'user','function'=>'authCheck')
);

View File

@ -1,2 +1,2 @@
<?php
define('KOD_VERSION','2.4');//2014.6.8
define('KOD_VERSION','2.5');//2014.6.15

View File

@ -9,9 +9,6 @@
//集群 远程接口方式访问。多台服务器管理
class api extends Controller{
/**
* 构造函数
*/
function __construct() {
parent::__construct();
}

View File

@ -7,9 +7,6 @@
*/
class app extends Controller{
/**
* 构造函数
*/
function __construct() {
parent::__construct();
$role = $_SESSION['user']['role'];
@ -28,7 +25,7 @@ class app extends Controller{
*/
public function user_app() {
$path = _DIR($this->in['path']);
if ($this->in['action'] == 'add'){
if (isset($this->in['action']) && $this->in['action'] == 'add'){
$path .= '.oexe';
}
@ -44,7 +41,7 @@ class app extends Controller{
*/
public function get() {
$list = array();
if (!$this->in['group'] || $this->in['group']=='all') {
if (!isset($this->in['group']) || $this->in['group']=='all') {
$list = $this->sql->get();
}else{
$list = $this->sql->get('group','',$this->in['group']);

View File

@ -7,17 +7,11 @@
*/
class desktop extends Controller{
/**
* 构造函数
*/
function __construct() {
parent::__construct();
$this->tpl = TEMPLATE.'desktop/';
}
/**
* 首页
*/
public function index() {
$wall = $this->config['user']['wall'];
if(strlen($wall)>3){
@ -26,6 +20,10 @@ class desktop extends Controller{
$this->assign('wall',STATIC_PATH.'images/wall_page/'.$wall.'.jpg');
}
if (!is_dir(MYHOME.'desktop/')) {
mkdir(MYHOME.'desktop/');
}
$upload_max = get_post_max();
$this->assign('upload_max',$upload_max);
$this->display('index.php');

View File

@ -7,9 +7,6 @@
*/
class editor extends Controller{
/**
* 构造函数
*/
function __construct() {
parent::__construct();
$this->tpl = TEMPLATE . 'editor/';
@ -36,8 +33,8 @@ class editor extends Controller{
$filecontents=mb_convert_encoding($filecontents,'utf-8',$charset);
}
$data = array(
'ext' => end(explode('.',$filename)),
'name' => iconv_app(end(explode('/',$filename))),
'ext' => get_path_ext($filename),
'name' => iconv_app(get_path_this($filename)),
'filename' => rawurldecode($this->in['filename']),
'charset' => $charset,
'content' => $filecontents

View File

@ -7,9 +7,6 @@
*/
class explorer extends Controller{
/**
* 构造函数
*/
public $path;
public function __construct(){
parent::__construct();
@ -20,7 +17,7 @@ class explorer extends Controller{
}
public function index(){
if($this->in['path'] !=''){
if(isset($this->in['path']) && $this->in['path'] !=''){
$dir = $_GET['path'];
}else if(isset($_SESSION['this_path'])){
$dir = $_SESSION['this_path'];
@ -30,7 +27,7 @@ class explorer extends Controller{
}
$dir = rtrim($dir,'/').'/';
$is_frame = false;//是否以iframe方式打开
if ($this->in['type'] == 'iframe') $is_frame = true;//
if (isset($this->in['type']) && $this->in['type'] == 'iframe') $is_frame = true;//
$upload_max = get_post_max();
$this->assign('upload_max',$upload_max);
$this->assign('is_frame',$is_frame);
@ -40,7 +37,7 @@ class explorer extends Controller{
public function pathInfo(){
$path = $this->path;
$type=$this->in['type'];
$type= $this->in['type'];
if ($type=="folder"){
$data = path_info($path,$this->L['time_type_info']);
}else{
@ -109,8 +106,11 @@ class explorer extends Controller{
}
public function treeList(){//树结构
$app = $this->in['app'];//是否获取文件 传folder|file
if ($this->in['type']=='init') $this->_tree_init($app);
if ($this->in['this_path']){
if (isset($this->in['type']) && $this->in['type']=='init'){
$this->_tree_init($app);
}
if (isset($this->in['this_path'])){
$path=_DIR($this->in['this_path']);
}else{
$path=_DIR($this->in['path'].$this->in['name']);
@ -277,14 +277,31 @@ class explorer extends Controller{
foreach ($clipboard as $val) {
$path_copy = _DIR($val['path']);
$filename = get_path_this($path_copy);
if ($clipboard[$i]['type'] == 'folder') {
@rename($path_copy,$path_past.$filename.'/');
}else{
@rename($path_copy,$path_past.$filename);
}
}
show_json($this->L['success']);
}
public function pathCopyDrag(){
$clipboard = json_decode($this->in['list'],true);
$path_past=$this->path;
$data = array();
if (!is_writable($path_past)) show_json($this->L['no_permission'],false);
foreach ($clipboard as $val) {
$path_copy = _DIR($val['path']);
$path = '';
if ($val['type'] == 'folder') {
$path = get_path_same_next($path_past,get_path_this($path_copy),'folder');
copy_dir($path_copy,$path);
}else{
$path = get_path_same_next($path_past,get_path_this($path_copy),'file');
copy($path_copy,$path);
}
$data[] = iconv_app(get_path_this($path));
}
show_json($data,true);
}
public function clipboard(){
$clipboard = json_decode($_SESSION['path_copy'],true);
$msg = '';
@ -339,7 +356,6 @@ class explorer extends Controller{
}else{
copy($path_copy,$path_past.$filename);
}
}else{
if ($cute_list[$i]['type'] == 'folder') {
rename($path_copy,$path_past.$filename.'/');

View File

@ -7,11 +7,8 @@
*/
class fav extends Controller{
/**
* 构造函数
*/
private $sql;
function __construct() {
function __construct(){
parent::__construct();
$this->sql=new fileCache($this->config['user_fav_file']);
}

View File

@ -6,11 +6,7 @@
* @license http://kalcaddle.com/tools/licenses/license.txt
*/
class group extends Controller
{
/**
* 构造函数
*/
class group extends Controller{
private $sql;
function __construct() {
parent::__construct();
@ -23,8 +19,7 @@ class group extends Controller
/**
* 用户添加
*/
public function add()
{
public function add(){
$group = $this->_init_data();
if($this->sql->add($this->in['role'],$group)){
show_json($this->L['success']);
@ -35,8 +30,7 @@ class group extends Controller
/**
* 编辑
*/
public function edit()
{
public function edit(){
$group = $this->_init_data();
$role_old = $this->in['role_old'];
if (!$role_old) show_json($this->L["groupname_can_not_null"],false);

View File

@ -6,11 +6,7 @@
* @license http://kalcaddle.com/tools/licenses/license.txt
*/
class member extends Controller
{
/**
* 构造函数
*/
class member extends Controller{
private $sql;
function __construct() {
parent::__construct();
@ -27,8 +23,7 @@ class member extends Controller
/**
* 用户添加
*/
public function add()
{
public function add(){
if (!$this->in['name'] ||
!$this->in['password'] ||
!$this->in['role'] ) show_json($this->L["data_not_full"],false);
@ -48,8 +43,7 @@ class member extends Controller
/**
* 编辑
*/
public function edit()
{
public function edit() {
if (!$this->in['name'] ||
!$this->in['name_to'] ||
!$this->in['role_to'] ) show_json($this->L["data_not_full"],false);

View File

@ -7,9 +7,6 @@
*/
class setting extends Controller{
/**
* 构造函数
*/
private $sql;
function __construct() {
parent::__construct();

View File

@ -10,11 +10,7 @@ class user extends Controller
{
private $user; //用户相关信息
private $auth; //用户所属组权限
/**
* 构造函数
*/
function __construct()
{
function __construct(){
parent::__construct();
$this->tpl = TEMPLATE . 'user/';
$this->user = &$_SESSION['user'];
@ -40,10 +36,9 @@ class user extends Controller
/**
* 登陆状态检测;并初始化数据状态
*/
public function loginCheck()
{
public function loginCheck(){
$this->authApi();//api方式验证
if($_SESSION['isLogin'] === true){
if(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true){
define('USER',USER_PATH.$this->user['name'].'/');
if (!file_exists(USER)) {
$this->logout();
@ -82,26 +77,41 @@ class user extends Controller
$this->login();
}
/**
* 登陆view
*/
public function login($msg = '')
{
public function login($msg = ''){
if(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true){
header('location:./index.php');
return;
}
$this->assign('msg',$msg);
$this->display('login.html');
exit;
}
/**
* 退出处理
*/
public function logout(){
session_start();
setcookie('kod_name', null, time()-3600);
setcookie('kod_token', null, time()-3600);
session_destroy();
header('location:./index.php?user/login');
}
/**
* 登陆数据提交处理
*/
public function loginSubmit()
{
$name = $this->in['name'];
if(empty($name) || empty($this->in['password'])) {
public function loginSubmit(){
if(!isset($this->in['name']) || !isset($this->in['password'])) {
$msg = $this->L['login_not_null'];
}else{
//错误三次输入验证码
session_start();//re start
$name = $this->in['name'];
if(intval($_SESSION['code_error_time']) >=3 &&
$_SESSION['check_code'] !== strtolower($this->in['check_code'])){
$this->login($this->L['code_error']);
@ -122,7 +132,7 @@ class user extends Controller
setcookie('kod_name', $user['name'], time()+3600*24*365);
setcookie('kod_token',md5($user['password'].get_client_ip()), time()+3600*24*365);
}
header('location:./');
header('location:./index.php');
return;
}else{
$_SESSION['code_error_time'] = intval($_SESSION['code_error_time']) + 1;
@ -132,23 +142,10 @@ class user extends Controller
$this->login($msg);
}
/**
* 退出处理
*/
public function logout()
{
session_start();
setcookie('kod_name', null, time()-3600);
setcookie('kod_token', null, time()-3600);
session_destroy();
header('location:./?user/login');
}
/**
* 修改密码
*/
public function changePassword()
{
public function changePassword(){
$password_now=$this->in['password_now'];
$password_new=$this->in['password_new'];
if (!$password_now && !$password_new)show_json($this->L['password_not_null'],false);

View File

@ -1 +1 @@
<?php exit;?>{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"8","musictheme":"qqmusic","movietheme":"webplayer"}
<?php exit;?>{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"9","musictheme":"qqmusic","movietheme":"webplayer"}

View File

@ -1 +1 @@
<?php exit;?>{"0.000":{"name":"0.000","path":"D:\/wwwroot\/0.000\/"},"config":{"name":"config","path":"D:\/wwwroot\/tools\/eXtplorer\/config"},"kod":{"name":"kod","path":"D:\/wwwroot\/www\/kod"},"\u5e7b\u4e61":{"name":"\u5e7b\u4e61","path":"D:\/wwwroot\/www\/kod\/dev\/data\/public\/images\/\u6211\u7684\u6536\u85cf\/\u5e7b\u4e61"}}
<?php exit;?>{"kod":{"name":"kod","path":"D:\/WWW\/www\/kod"},"config":{"name":"config","path":"D:\/WWW\/tools\/eXtplorer\/config"},"0.000":{"name":"0.000","path":"D:\/WWW\/0.000\/"}}

View File

@ -68,14 +68,15 @@ $L = array(
"public_path" => "Public path",
//right
"file" => "file",
"folder" => "folder",
"copy" => "copy",
"past" => "paste",
"cute" => "cut",
"remove" => "delete",
"file" => "File",
"folder" => "Folder",
"copy" => "Copy",
"clone" => "Duplicate",
"past" => "Paste",
"cute" => "Cut",
"remove" => "Delete",
"info" => "get info",
"list_type" => "view",
"list_type" => "View",
"list_icon" => "icons",
"list_list" => "list",
"sort_up" => "asc",

View File

@ -73,6 +73,7 @@ $L= array(
"folder" => "文件夹",
"copy" => "复制",
"past" => "粘贴",
"clone" => "创建副本",
"cute" => "剪切",
"remove" => "删除",
"info" => "属性",

View File

@ -72,6 +72,7 @@ $L= array(
"file" => "",
"folder" => "檔夾",
"copy" => "複製",
"clone" => "创建副本",
"past" => "粘貼",
"cute" => "剪切",
"remove" => "刪除",

View File

@ -118,7 +118,33 @@ function get_filename_auto($path){
* 获取扩展名
*/
function get_path_ext($path){
return strtolower(end(explode('.',$path)));
$arr = explode('.',$path);
$ext = end($arr);
return strtolower($ext);
}
/**
* 获取扩展名
*/
function get_path_same_next($path,$name,$type){
if (!file_exists($path)) return '';
$temp = $name;
$i = 1;
if ($type=='folder') {
while(file_exists($path.$name)) {
$name = $temp.'('.$i.')';
$i++;
}
}else{
$temp_ext = get_path_ext($temp);
$temp_extp = strlen($temp_ext)>0?$temp_ext='.'.$temp_ext:'';
$temp_pre = substr($temp,0,-strlen($temp_extp));
while(file_exists($path.$name)){
$name = $temp_pre.'('.$i.')'.$temp_extp;
$i++;
}
}
return $path.$name;
}
/**
@ -306,6 +332,8 @@ function del_dir($dir){
*/
function copy_dir($source, $dest){
if (!$dest) return false;
if ($source == substr($dest,0,strlen($source))) return;//防止无限递归
$result = false;
if (is_file($source)) {
if ($dest[strlen($dest)-1] == '/') {
@ -315,7 +343,7 @@ function copy_dir($source, $dest){
}
$result = copy($source, $__dest);
chmod($__dest, 0755);
} elseif (is_dir($source)) {
}elseif (is_dir($source)) {
if ($dest[strlen($dest)-1] == '/') {
$dest = $dest . basename($source);
mkdir($dest, 0755);
@ -334,8 +362,6 @@ function copy_dir($source, $dest){
}
}
closedir($dirHandle);
} else {
$result = false;
}
return $result;
}

View File

@ -72,8 +72,16 @@ define(function(require, exports) {
},
ajaxError:function(XMLHttpRequest, textStatus, errorThrown){
core.tips.close(LNG.system_error,false);
var error = '<div style="color:#f60;">'+XMLHttpRequest.responseText+'</div>';
var response = XMLHttpRequest.responseText;
var error = '<div style="color:#f60;">'+response+'</div>';
var dialog = $.dialog.list['ajaxErrorDialog'];
//已经退出
if (response.substr(0,17) == '<!--user login-->') {
FrameCall.goRefresh();
return;
}
if (dialog) {
dialog.content(error);
}else{
@ -92,7 +100,7 @@ define(function(require, exports) {
setting:function(setting){
if (setting == undefined) setting = '';
if (window.top.frames["Opensetting_mode"] == undefined) {
$.dialog.open('?setting#'+setting,{
$.dialog.open('./index.php?setting#'+setting,{
id:'setting_mode',
fixed:true,
resize:true,
@ -289,6 +297,10 @@ define(function(require, exports) {
$message.hide().html(LNG.search_info).fadeIn(fade);
return;
}
if (param.search.length<=1) {
$message.hide().html('too short!').fadeIn(fade);
return;
}
$.ajax({
url:'index.php?explorer/search',
dataType:'json',
@ -384,7 +396,7 @@ define(function(require, exports) {
core.tips.tips(urls.length + LNG.server_dwonload_desc);
for (var i=0; i<urls.length; i++) {
$.ajax({
url:'?explorer/serverDownload&save_path='+path+'&url='+urlEncode2(urls[i]),
url:'./index.php?explorer/serverDownload&save_path='+path+'&url='+urlEncode2(urls[i]),
dataType:'json',
error:core.ajaxError,
success:function(data){

View File

@ -121,7 +121,7 @@ define(function(require, exports) {
return;
}
if (window.top.frames["OpenopenEditor"] == undefined) {
var url ='?editor/edit&filename='+urlEncode(urlEncode2(path));//3次
var url ='./index.php?editor/edit&filename='+urlEncode(urlEncode2(path));//3次
var title = filename+' ——'+LNG.edit;
_openWindow(url,title.substring(title.length-50),'openEditor');
}else{

View File

@ -288,6 +288,26 @@ define(function(require, exports) {
}
});
};
// 创建副本
var copyDrag = function(param,dragTo,callback){
if (!dragTo) return;
$.ajax({
url:'index.php?explorer/pathCopyDrag',
type:'POST',
dataType:'json',
data:_json(param)+'&path='+urlEncode2(dragTo),
beforeSend: function(){
core.tips.loading(LNG.moving);
},
error:core.ajaxError,
success:function(data){
core.tips.close(data);
if (!data.code) return;
if (typeof (callback) == 'function') callback(data);
}
});
};
//==查看剪贴板
var clipboard = function(){
$.ajax({
@ -510,6 +530,7 @@ define(function(require, exports) {
info:info,
remove:remove,
cuteDrag:cuteDrag,
copyDrag:copyDrag,
past:past,
clipboard:clipboard,

View File

@ -272,6 +272,7 @@ define(function(require, exports) {
callback: function(key, options) {_menuPath(key);},
items: {
"copy":{name:LNG.copy,className:"copy",icon:"copy",accesskey: "c"},
"clone":{name:LNG.clone,className:"clone",icon:"external-link",accesskey: "m"},
"cute":{name:LNG.cute,className:"cute",icon:"cut",accesskey: "k"},
"remove":{name:LNG.remove,className:"remove",icon:"trash",accesskey: "d"},
"sep1":"--------",
@ -340,6 +341,7 @@ define(function(require, exports) {
case 'search':ui.path.search();break;
case 'copy':ui.path.copy();break;
case 'clone':ui.path.copyDrag(G.this_path,true);break;
case 'cute':ui.path.cute();break;
case 'remove':ui.path.remove();break;
case 'rname':ui.path.rname();break;

View File

@ -124,7 +124,9 @@ define(function(require, exports) {
url:Config.treeAjaxURL,//直接上次拿到的json变量。
autoParam:["ajax_name=name","ajax_path=path","this_path"],//前面是value 后面是key
dataFilter: function(treeId, parentNode, responseData){
if (!responseData.code) return null;
if (!responseData.code){
return null;
}
return responseData.data;
}
},

View File

@ -48,6 +48,7 @@ define(function(require, exports) {
dataType:'json',
type:'POST',
data:'data='+urlEncode(json_encode(data)),
error:core.ajaxError,
success:function(data){
tips(data);
if (!data.code) return;
@ -61,10 +62,9 @@ define(function(require, exports) {
break;
case 'del':
$.ajax({
url:'?app/del&name='+urlEncode(data.name),
url:'./index.php?app/del&name='+urlEncode(data.name),
dataType:'json',
beforeSend:function (data){
},
error:core.ajaxError,
success:function(data){
tips(data);
if (!data.code) return;
@ -110,7 +110,7 @@ define(function(require, exports) {
var $content = $('.main .app-list');
$.ajax({
url:'?app/get&group='+group,
url:'./index.php?app/get&group='+group,
dataType:'json',
beforeSend:function (data){
},

View File

@ -39,16 +39,6 @@
$(this).addClass(Config.SelectClassName);
fileLight.select();
}
}).unbind("mousedown").mousedown(function(e){
rightMenu.hidden();
//if (ui.isEdit()) return true;
if (e.which != 1) return true;
if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) {
fileLight.clear();
$(this).addClass(Config.SelectClassName);
fileLight.select();
}
if(e.ctrlKey) {//ctrl 跳跃选择
if ($(this).hasClass(Config.SelectClassName)) {//已经选中则反选
fileLight.resumeMenu($(this));//恢复右键菜单id
@ -76,6 +66,16 @@
}
}
}
}).unbind("mousedown").mousedown(function(e){
rightMenu.hidden();
//if (ui.isEdit()) return true;
if (e.which != 1) return true;
if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) {
fileLight.clear();
$(this).addClass(Config.SelectClassName);
fileLight.select();
}
})
}).unbind('mouseleave').live('mouseleave',function(){
$(this).removeClass(Config.HoverClassName);
@ -108,8 +108,9 @@
// 拖拽——移动 select
var _bindDragEvent= function(){
var delayTime = 300;
var delayTime = 100;
var leftOffset= 50;
var dragCopyOffset = 30;
var topOffset = 80-Global.topbar_height;
var $self;
var startTime = 0;
@ -120,7 +121,7 @@
var screenWidth;
$(Config.FileBoxClass).unbind('mousedown').live('mousedown',function(e){
if (Global.shiftKey || Global.ctrlKey) return;
if (Global.shiftKey) return;
if (ui.isEdit()) return true;
if (e.which != 1 || isSelect) return true;
$self = $(this);
@ -183,8 +184,19 @@
$('.draggable-dragging').fadeOut(200,function(){
$(this).remove();
});
if ($('.selectDragTemp').length != 0) {
var dragTo = G.this_path+fileLight.name($('.selectDragTemp'))+'/';
var dragTo = G.this_path;
var isDragCurrent = ($('.selectDragTemp').length == 0);
if (Global.ctrlKey) {
if (!isDragCurrent) {
dragTo = dragTo+fileLight.name($('.selectDragTemp'));
}
if (Math.abs(e.pageX-boxLeft) > dragCopyOffset ||
Math.abs(e.pageY-boxTop) > dragCopyOffset) {
ui.path.copyDrag(dragTo,isDragCurrent);
}
}else if (!isDragCurrent){
dragTo = dragTo+fileLight.name($('.selectDragTemp'));
ui.path.cuteDrag(dragTo);
}
};

View File

@ -53,11 +53,11 @@ define(function(require, exports) {
var load = art.dialog({title:false,content:LNG.getting,icon:'warning'});
$.ajax({
dataType:'json',
url:'./?editor/fileGet&filename='+filename,
error:function(data) {
url:'./index.php?editor/fileGet&filename='+filename,
error:function(XMLHttpRequest, textStatus, errorThrown) {
load.close();
_removeData(initData.uuid);
Tips.tips(LNG.system_error,false);
core.ajaxError(XMLHttpRequest, textStatus, errorThrown);
},
success: function(result) {
load.close();
@ -218,7 +218,7 @@ define(function(require, exports) {
}
if (key == 'theme') {
$.ajax({
url:'?setting/set&k=codetheme&v='+value,
url:'./index.php?setting/set&k=codetheme&v='+value,
dataType:'json',
success:function(data){
tips(data);
@ -254,7 +254,7 @@ define(function(require, exports) {
type:'POST',
async:false,
dataType:'json',
url:'?editor/fileSave',
url:'./index.php?editor/fileSave',
data:'path='+filename+'&charset='+edit_this.kod.charset+'&filestr='+html,
beforeSend: function(){
Tips.loading(LNG.sending);

View File

@ -11,6 +11,11 @@ define(function(require, exports, module) {
rightMenu = Tap.rightMenu;
preview = Toolbar.preview;
Global = {
topbar_height:40, // 头部高度
isIE:!-[1,], // 是否ie
};
$(document).ready(function() {
Tap.init();
Toolbar.init();

View File

@ -37,16 +37,7 @@ define(function(require, exports) {
$(this).addClass(Config.SelectClassName);
fileLight.select();
}
}).unbind("mousedown").mousedown(function(e){
rightMenu.hidden();
//if (ui.isEdit()) return true;
if (e.which != 1) return true;
if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) {
fileLight.clear();
$(this).addClass(Config.SelectClassName);
fileLight.select();
}
if(e.ctrlKey) {//ctrl 跳跃选择
if ($(this).hasClass(Config.SelectClassName)) {//已经选中则反选
fileLight.resumeMenu($(this));//恢复右键菜单id
@ -74,6 +65,17 @@ define(function(require, exports) {
}
}
}
}).unbind("mousedown").mousedown(function(e){
rightMenu.hidden();
//if (ui.isEdit()) return true;
if (e.which != 1) return true;
if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) {
fileLight.clear();
$(this).addClass(Config.SelectClassName);
fileLight.select();
}
})
}).die('mouseleave').live('mouseleave',function(){
$(this).removeClass(Config.HoverClassName);
@ -105,8 +107,9 @@ define(function(require, exports) {
// 拖拽——移动 select
var _bindDragEvent= function(){
var delayTime = 300;
var delayTime = 100;
var leftOffset= 50;
var dragCopyOffset = 30;
var topOffset = 80-Global.topbar_height;
var $self;
var startTime = 0;
@ -117,7 +120,7 @@ define(function(require, exports) {
var screenWidth;
$(Config.FileBoxClass).die('mousedown').live('mousedown',function(e){
if (Global.shiftKey || Global.ctrlKey) return;
if (Global.shiftKey) return;
if (ui.isEdit()) return true;
if (e.which != 1 || isSelect) return true;
$self = $(this);
@ -180,8 +183,19 @@ define(function(require, exports) {
$('.draggable-dragging').fadeOut(200,function(){
$(this).remove();
});
if ($('.selectDragTemp').length != 0) {
var dragTo = G.this_path+fileLight.name($('.selectDragTemp'))+'/';
var dragTo = G.this_path;
var isDragCurrent = ($('.selectDragTemp').length == 0);
if (Global.ctrlKey) {
if (!isDragCurrent) {
dragTo = dragTo+fileLight.name($('.selectDragTemp'));
}
if (Math.abs(e.pageX-boxLeft) > dragCopyOffset ||
Math.abs(e.pageY-boxTop) > dragCopyOffset) {
ui.path.copyDrag(dragTo,isDragCurrent);
}
}else if (!isDragCurrent){
dragTo = dragTo+fileLight.name($('.selectDragTemp'));
ui.path.cuteDrag(dragTo);
}
};

View File

@ -167,6 +167,7 @@ define(function(require, exports) {
beforeSend:function(){
$('.tools-left .msg').stop(true,true).fadeIn(100);
},
error:core.ajaxError,
success:function(data){
$('.tools-left .msg').fadeOut(100);
if (!data.code) {
@ -191,6 +192,7 @@ define(function(require, exports) {
beforeSend:function(){
$('.tools-left .msg').stop(true,true).fadeIn(100);
},
error:core.ajaxError,
success:function(data){
$('.tools-left .msg').fadeOut(100);
if (!data.code) {
@ -264,7 +266,6 @@ define(function(require, exports) {
core.tips.tips(LNG.path_exists,'warning');
}else{
pathOperate.newFile(G.this_path+filename,function(){
ui.tree.checkIfChange(G.this_path);
ui.f5_callback(function() {
_setSelectByFilename(filename);
});
@ -281,7 +282,6 @@ define(function(require, exports) {
_newFile(newname_ext);
}else{
pathOperate.newFile(G.this_path+filename,function(){
ui.tree.checkIfChange(G.this_path);
ui.f5_callback(function() {
_setSelectByFilename(filename);
});
@ -320,7 +320,9 @@ define(function(require, exports) {
core.tips.tips(LNG.path_exists,'warning');
}else{
pathOperate.newFolder(G.this_path+filename,function(){
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
ui.f5_callback(function() {
_setSelectByFilename(filename);
});
@ -336,7 +338,9 @@ define(function(require, exports) {
_newFolder();
}else{
pathOperate.newFolder(G.this_path+filename,function(){
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
ui.f5_callback(function() {
_setSelectByFilename(filename);
});
@ -385,7 +389,9 @@ define(function(require, exports) {
path =urlEncode(G.this_path+selectid);
rname_to=urlEncode(G.this_path+rname_to);
pathOperate.rname(path,rname_to,function(){
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
ui.f5_callback(function() {
_setSelectByFilename(select_name);
});
@ -408,7 +414,9 @@ define(function(require, exports) {
path =urlEncode(G.this_path+selectid);
rname_to=urlEncode(G.this_path+rname_to);
pathOperate.rname(path,rname_to,function(){
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
ui.f5_callback(function() {
_setSelectByFilename(select_name);
});
@ -421,7 +429,9 @@ define(function(require, exports) {
};
var refreshCallback=function(){//当前目录文件变化,刷新目录
ui.f5();
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
};
return {
//app
@ -485,11 +495,26 @@ define(function(require, exports) {
zip :function(){pathOperate.zip(_param(true),refreshCallback);},
unZip :function(){pathOperate.unZip(_param().path,ui.f5);},
cuteDrag:function(dragTo){pathOperate.cuteDrag(_param(true),dragTo,refreshCallback);},
copyDrag:function(dragTo,isDragCurrent){
pathOperate.copyDrag(_param(true),dragTo,function(list){
fileLight.clear();
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
ui.f5_callback(function() {
if (isDragCurrent){
_setSelectByFilename(list.data);
}
});
});
},
info:function(){pathOperate.info(_param(true));},
past:function(){
fileLight.clear();
pathOperate.past(G.this_path,function(list){
if (Config.pageApp == 'explorer') {
ui.tree.checkIfChange(G.this_path);
}
ui.f5_callback(function() {
_setSelectByFilename(list.data);
});

View File

@ -250,6 +250,7 @@ define(function(require, exports) {
case 'copy':ui.path.copy();break;
case 'rname':ui.path.rname();break;
case 'cute':ui.path.cute();break;
case 'clone':ui.path.copyDrag(G.this_path,true);break;
case 'past':ui.path.past();break;
case 'remove':ui.path.remove();break;
case 'zip':ui.path.zip();break;

View File

@ -19,7 +19,7 @@ define(function(require, exports) {
window.location.href ='#'+page;
$.ajax({
url:'?setting/slider&slider='+page,
url:'./index.php?setting/slider&slider='+page,
beforeSend:function (data){
$('.main').html("<img src='./static/images/loading.gif'/>");
},

View File

@ -61,7 +61,7 @@ define(function(require, exports) {
var time = function(){var date = new Date();return parseInt(date.getTime()/1000);}
var _download = function(from,to,callback){
$.ajax({
url:'?explorer/serverDownload&save_path='+to
url:'./index.php?explorer/serverDownload&save_path='+to
+'&url='+urlEncode2(from),
dataType:'json',
success:function(data){

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -161,11 +161,11 @@ artDialog.fn = artDialog.prototype = {
_titleBarHeight = DOM.title.css('height');
_titleBarHeight = _titleBarHeight.replace('px','');
DOM.wrap
.css({opacity:0.6,top:'-='+DOM.wrap.height()*0.02})
.animate(
{opacity:1,top:'+='+DOM.wrap.height()*0.02},
{easing: 'swing',duration:200});
// DOM.wrap
// .css({opacity:0.6,top:'-='+DOM.wrap.height()*0.02})
// .animate(
// {opacity:1,top:'+='+DOM.wrap.height()*0.02},
// {easing: 'swing',duration:200});
return that;
},
@ -987,7 +987,7 @@ _path = window['_artDialog_path'] || (function (script, i, me) {
// 使用uglifyjs压缩能够预先处理"+"号合并字符串
// uglifyjs: http://marijnhaverbeke.nl/uglifyjs
artDialog._templates =
'<div class="aui_outer"><div class="aui_mask"></div>'
'<div class="aui_outer pop_fadein"><div class="aui_mask"></div>'
+ '<table class="aui_border">'
+ '<tbody>'
+ '<tr>'

View File

@ -35,6 +35,7 @@ var FrameCall = (function(){
if (!window.parent.frames[iframe]) return;
//var obj = window.top.frames[iframe].document;
var obj = window.parent.frames[iframe].document;
if(!obj) return;
obj=obj.getElementById(idName);
$(obj).attr("action",action);
$(obj).attr("value",value);
@ -42,11 +43,7 @@ var FrameCall = (function(){
},
//该窗口调用父窗口的api
father:function(action,value){
if (ie){//获取兄弟frame的dom树
var obj=window.parent.document;//IE
}else{
var obj=window.parent.document;//chrome safari firefox...
}
var obj=window.parent.document;
obj=obj.getElementById(idName);
$(obj).attr("action",action);
$(obj).attr("value",value);

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
<div class="top_left">
<a href="./" class="title"><i class="icon-cloud"></i>KODExplorer</a>
<?php
$tpl="<a class='{this}' href='./?{0}' tartet='_self'><i class='icon-{2}'></i>{1}</a>\n";
$tpl="<a class='{this}' href='./index.php?{0}' tartet='_self'><i class='icon-{2}'></i>{1}</a>\n";
$menu ='desktop:'.$L['ui_desktop'].':desktop,explorer:'.$L['ui_filemanage'].':tasks,editor:'.$L['ui_editor'].':edit';
echo getTplList(',',':',$menu,$tpl,ST);
?>
@ -32,7 +32,7 @@
<li><a href="javascript:core.setting('about');"><i class="font-icon icon-info-sign"></i><?php echo $L['setting_about'];?></a></li>
<li><a href="http://www.kalcaddle.com" target="_blank"><i class="font-icon icon-code-fork"></i><?php echo $L['ui_project_home'];?></a></li>
<li role="presentation" class="divider"></li>
<li><a href="./?user/logout"><i class="font-icon icon-off"></i><?php echo $L['ui_logout'];?></a></li>
<li><a href="./index.php?user/logout"><i class="font-icon icon-off"></i><?php echo $L['ui_logout'];?></a></li>
</ul>
</div>
</div>

View File

@ -69,14 +69,14 @@
<li><a href="#" onclick="core.setting('wall');"><span><?php echo $L['setting_wall'];?></span></a></li>
<li><a href="#" onclick="core.setting('fav');"><span><?php echo $L['setting_fav'];?></span></a></li>
<li><a href="#" onclick="core.setting('theme');"><span><?php echo $L['setting_theme'];?></span></a></li>
<li><a href="?user/logout" style="margin-top:70px;"><span><?php echo $L['ui_logout'];?>></span></a></li>
<li><a href="./index.php?user/logout" style="margin-top:70px;"><span><?php echo $L['ui_logout'];?>></span></a></li>
</ul>
</div>
<script src="<?php echo STATIC_PATH;?>js/lib/seajs/sea.js"></script>
<script type="text/javascript">
var LNG = <?php echo json_encode($L);?>;
var AUTH = <?php echo json_encode($GLOBALS['auth']);?>;
<?php if(isset($GLOBALS['auth'])) echo "var AUTH = "+json_encode($GLOBALS['auth']);?>;
var G = {
is_root : <?php echo $GLOBALS['is_root'];?>,
web_root : "<?php echo $GLOBALS['web_root'];?>",

View File

@ -35,7 +35,7 @@
<div class="menuTreeFolder"></div>
<div class="menuTreeFile"></div>
<div class ='frame'>
<iframe name="OpenopenEditor" src="?editor/edit" style="width:100%;height:100%;border:0;" frameborder=0></iframe>
<iframe name="OpenopenEditor" src="./index.php?editor/edit" style="width:100%;height:100%;border:0;" frameborder=0></iframe>
</div>
</div>
</div><!-- / frame-right end-->

View File

@ -98,6 +98,8 @@
<i class="font-icon icon-cut"></i><?php echo $L['cute'];?></a></li>
<li id="past"><a href='javascript:;'>
<i class="font-icon icon-paste"></i><?php echo $L['past'];?></a></li>
<li id="clone"><a href='javascript:;'>
<i class="font-icon icon-external-link"></i><?php echo $L['clone'];?></a></li>
<li id="remove"><a href='javascript:;'>
<i class="font-icon icon-trash"></i><?php echo $L['remove'];?></a></li>
@ -147,7 +149,7 @@
<script src="<?php echo STATIC_PATH;?>js/lib/seajs/sea.js"></script>
<script type="text/javascript">
var LNG = <?php echo json_encode($L);?>;
var AUTH = <?php echo json_encode($GLOBALS['auth']);?>;
<?php if(isset($GLOBALS['auth'])) echo "var AUTH = "+json_encode($GLOBALS['auth']);?>;
var G = {
is_root : <?php echo $GLOBALS['is_root'];?>,
web_root : "<?php echo $GLOBALS['web_root'];?>",

View File

@ -36,7 +36,7 @@ http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script src="<?php echo STATIC_PATH;?>js/lib/seajs/sea.js"></script>
<script type="text/javascript">
var LNG = <?php echo json_encode($L);?>;
var AUTH = <?php echo json_encode($GLOBALS['auth']);?>;
<?php if(isset($GLOBALS['auth'])) echo "var AUTH = "+json_encode($GLOBALS['auth']);?>;
var G = {
is_root : <?php echo $GLOBALS['is_root'];?>,
web_root : "<?php echo $GLOBALS['web_root'];?>",

View File

@ -1,3 +1,4 @@
<!--user login-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@ -13,12 +14,12 @@
<div class="logo">KOD<b>Explorer</b></div>
<div class='info'>——<?php echo $L['title_name'];?></div>
</div>
<form method="post" action="./?user/loginSubmit">
<form method="post" action="./index.php?user/loginSubmit">
<div class="inputs">
<div><span><?php echo $L['username'];?></span><input id="username" name='name' type="text" placeholder="<?php echo $L['username'];?>" required/> </div>
<div><span><?php echo $L['password'];?></span><input id="password" name='password' type="password" placeholder="<?php echo $L['password'];?>" required /></div>
<?php if(intval($_SESSION['code_error_time']) >=3){?>
<div class='check_code'><span><?php echo $L['login_code'];?></span><input name='check_code' class="check_code" type="text" placeholder="<?php echo $L['login_code'];?>" required /> <img src='./?user/checkCode' onclick="this.src='./?user/checkCode'" />
<?php if(intval(isset($_SESSION['code_error_time']) && $_SESSION['code_error_time']) >=3){?>
<div class='check_code'><span><?php echo $L['login_code'];?></span><input name='check_code' class="check_code" type="text" placeholder="<?php echo $L['login_code'];?>" required /> <img src='./index.php?user/checkCode' onclick="this.src='./index.php?user/checkCode'" />
<div style="clear:both;"></div></div>
<?php }?>
</div>
@ -30,7 +31,7 @@
<div class="msg"><?php echo $msg;?></div>
<div style="clear:both;"></div>
<div class='guest'>
<a href="./?user/loginSubmit&name=guest&password=guest"><?php echo $L['guest_login'];?><i class=' icon-arrow-right'></i></a></div>
<a href="./index.php?user/loginSubmit&name=guest&password=guest"><?php echo $L['guest_login'];?><i class=' icon-arrow-right'></i></a></div>
</form>
</div>
<div class="footer">kalcaddle.com 2013 © All Rights Reserved.| <?php echo $L['us'];?></div>