v2.6
639
README.md
|
@ -1,318 +1,377 @@
|
|||
#KODexplorer (http://kalcaddle.com/)
|
||||
###ver2.5(2014.6.15) power by warlee
|
||||
商业版授权请联系:QQ:kalcaddle#qq.com
|
||||
##KodExplorer (http://kalcaddle.com/)
|
||||
###ver2.6(2014.7.6)
|
||||
`商业版授权请联系:kalcaddle#qq.com`
|
||||
|
||||
##是什么:
|
||||
Kodexplorer为千帆网络工作室开发的一款服务器文件管理程序。
|
||||
完美取代落后的FTP管理:可用于服务器文件管理,支持图片、音乐、视频预览,在线解压缩,文件夹拖拽上传……。
|
||||
在线编程:支持几乎所有编程语言的在线编辑(高亮,多光标编辑.堪比本地的sublime)
|
||||
极佳的操作体验:及其便捷的快捷键支持,让你拥有本地化的体验
|
||||
中文等多语言支持:中文编码全面兼容,文件编辑自动适配。
|
||||
超快的速度:全面采用Ajax+Json进行数据通信,毫秒级的响应速度;
|
||||
全平台兼容性:Win Linux Mac (Apache、Nginx、IIS)
|
||||
###使用场景:
|
||||
取代古老的FTP,服务端、客户端软件等复杂的安装配置。kod可以一键安装随处使用.
|
||||
你可以用它来管理你的服务器(备份,在线解压缩,版本发布....)
|
||||
你可以把他当做管理linux的一个操作系统界面
|
||||
可以用来作为私有云存储系统,存储你的文件...
|
||||
当然你也可以用来分享文件
|
||||
更多场景等你来挖掘!……
|
||||
#### 觉得程序好用的话请尽量购买商业版
|
||||
#### 1.是什么:
|
||||
- Kodexplorer为千帆网络工作室开发的一款服务器文件管理程序。
|
||||
- 完美取代FTP管理:可用于服务器文件管理,zip解压缩 备份还原、支持图片、音乐、视频预览、office、pdf等格式在线预览。文件夹拖拽上传……。
|
||||
- 在线编程:支持几乎所有编程语言的在线编辑(高亮,多光标编辑.堪比本地的sublime)
|
||||
- 极佳的操作体验:及其便捷的快捷键支持,让你拥有本地化的体验
|
||||
- 中文等多语言支持:中文编码全面兼容,文件编辑自动适配。
|
||||
- 超快的速度:全面采用Ajax+Json进行数据通信,毫秒级的响应速度;
|
||||
- 全平台兼容性:Win Linux Mac (Apache、Nginx、IIS)
|
||||
|
||||
####------------------【使用说明】------------------
|
||||
管理员: admin/admin
|
||||
普通用户:demo/demo
|
||||
游客用户:guest/guest
|
||||
#### 2.使用场景:
|
||||
- 取代FTP,服务端、客户端软件等复杂的安装配置。kod可以一键安装随处使用.
|
||||
- 你可以用它来管理你的服务器(备份,在线解压缩,版本发布....)
|
||||
- 你可以把他当做管理linux的一个操作系统界面
|
||||
- 可以用来作为私有云存储系统,存储你的文件...
|
||||
- 当然你也可以用来分享文件
|
||||
- Web IDE / browser code editor awesomeness
|
||||
- 更多场景等你来挖掘!……
|
||||
|
||||
【如何使用】下载程序,上传到你的服务器路径下,解压,data目录设置777权限。访问体验超便捷的服务吧!
|
||||
【关于上传问题】 程序没有做任何限制,如果需要上传大文件,则修改php.ini:upload_max_filesize = 1000M post_max_size = 1000M
|
||||
【关于解压缩问题】 程序不做任何限制,如若失败请设置php内存限制。memory_limit 1000M
|
||||
【关于兼容性】建议使用chrome firefox ie9+ 体验更完整。ie8以下基本上不做兼容处理。chrome支持文件夹拖拽上传。
|
||||
【文件打开】office文件在线预览功能,服务器必须在公网(外部能访问该服务器)
|
||||
####--------------------------------------------
|
||||
#### 3.使用说明
|
||||
管理员: admin/admin
|
||||
普通用户:demo/demo
|
||||
游客用户:guest/guest
|
||||
[如何使用] 下载程序,解压上传到你的服务器路径下,data目录设置777权限。访问体验超便捷的服务吧!
|
||||
(data目录没有写权限会导致配置修改不能保存、不能新建用户等)
|
||||
[关于上传问题] 程序没有做任何限制,如果需要上传大文件,则修改
|
||||
php.ini:`upload_max_filesize = 1000M post_max_size = 1000M`
|
||||
[关于解压缩问题] 程序不做任何限制,如若失败请设置php内存限制。memory_limit 1000M
|
||||
[关于兼容性] 建议使用chrome firefox ie9+ 体验更完整。ie8以下基本上不做兼容处理。chrome支持文件夹拖拽上传。
|
||||
[文件打开] office文件在线预览功能,服务器必须在公网(外部能访问该服务器)
|
||||
[忘记密码] 修改data/system/member.php 密码为明文的md5值 例如将admin密码重设为admin
|
||||
则修改第一行:"name":"admin","password":"21232f297a57a5a743894a0e4a801fc3"
|
||||
|
||||
|
||||
## explorer
|
||||
![](https://cloud.githubusercontent.com/assets/3761968/2583304/764f562a-b9cf-11e3-8e59-afdbdffc20eb.png)
|
||||
|
||||
|
||||
ver2.5 `2014/6/15`
|
||||
=====================
|
||||
##update:
|
||||
增加创建副本功能 按住ctrl拖拽即可,可以到当前,也可以到文件夹。
|
||||
多选拖拽优化:剪切到、移动到某个文件夹
|
||||
创建副本功能
|
||||
树目录和文件列表一致性保持 更新相互通知
|
||||
##fix bug:(bug解决和程序优化)
|
||||
桌面重命名bug
|
||||
统一对话框部分bug
|
||||
php notice 提示解决
|
||||
ajax返回非json 则展示服务错误的返回
|
||||
所有入口都加入index.php 解决部分服务器没有设置默认入口问题
|
||||
###ver2.6 `2014/7/6`
|
||||
----
|
||||
####update:
|
||||
- 完全性优化;加入严格的校验机制
|
||||
- 首次运行环境检测[data目录检测,必须的函数支持提示]
|
||||
- 上传已存在处理——创建副本(另外包括粘贴,解压)
|
||||
- 选中优化 ctrl选中拖拽
|
||||
- 键盘快捷键选中文件,多个字符支持
|
||||
- 文件文件夹权限修改(右键——属性,即可修改)
|
||||
- 对话框加入ico,对应任务栏
|
||||
- 右键等部分菜单效果优化
|
||||
- 远程下载加入进度条,下载速度等信息
|
||||
|
||||
ver2.4 `2014/6/8`
|
||||
=====================
|
||||
##update:
|
||||
语言选择
|
||||
远程下载文件名优化
|
||||
树目录事件优化
|
||||
收藏夹点击 undefined
|
||||
没权限建立文件夹错误提示 红色
|
||||
打开dialog 不显示问题。先显示后打开
|
||||
ajax error 系统错误 对话框提示内容
|
||||
懒加载优化
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- 下载前判断当前目录可写
|
||||
- 文件扩展名处理,分为用户方式和扩展名权限方式
|
||||
- 上传结束提示:是否成功、失败原因
|
||||
- 上传扩展名限制 解决apache .php.*当做php执行bug
|
||||
- 文件名非法字符限定 <script>
|
||||
- 树目录展开箭头状态修复
|
||||
- 树目录新建文件,没有子节点刷新bug解决
|
||||
- 文件大小为0上传不了问题
|
||||
- windows下进入某些系统文件夹死循环bug解决
|
||||
- tips 居中显示
|
||||
- 任务栏标签选中问题:已经显示且为交点窗口 点击——隐藏;否则——显示,并且置为焦点窗口
|
||||
- 拖入url ——oexe 新窗口打开
|
||||
- 选中文件时,移动到屏幕可视区域(解决上下左右选中文件滚动条不一致问题)
|
||||
|
||||
|
||||
ver2.3 `2014/6/2`
|
||||
=====================
|
||||
##update:
|
||||
拖动url——创建ext app
|
||||
文件管理,树目录变化后(增删改)自动同步到文件列表
|
||||
文件管理,文件列表变化后(增删改)自动同步到树目录
|
||||
中文用户名限制
|
||||
对话框打开关闭动画
|
||||
其他多处优化
|
||||
##fix bug:(bug解决和程序优化)
|
||||
文件名限制bug
|
||||
同目录多个程序cookie bug修复
|
||||
地址栏 最后显示宽度问题
|
||||
服务器路径下 编辑器预览404修复
|
||||
树目录显示优化
|
||||
登陆记住密码优化
|
||||
###ver2.51 `2014/6/22`
|
||||
----
|
||||
####fix bug:(bug解决和程序优化)
|
||||
|
||||
ver2.2 `2014/5/11`
|
||||
=====================
|
||||
##update:
|
||||
公共目录支持(多个用户可以共享目录,写权限跟随用户组权限设定)
|
||||
自动升级优化
|
||||
文件管理工具栏 增加菜单选项,方便移动设备操作
|
||||
文件编辑器,文件树目录 上下左右键盘切换 快捷键加入
|
||||
树目录去掉库,改为个人目录等多处文案修改
|
||||
默认打开用户目录
|
||||
##fix bug:(bug解决和程序优化)
|
||||
桌面任务栏点不中bug
|
||||
部分文案问题
|
||||
众多细节优化
|
||||
- 登陆多次密码输入错误验证码bug解决
|
||||
- 修复漏洞:创建副本加入权限控制。和拖文件拽权限一致
|
||||
- 文件上传失败检测
|
||||
- 树目录同步优化
|
||||
|
||||
|
||||
ver2.1 `2014/4/2`
|
||||
=====================
|
||||
##update:
|
||||
文件夹拖拽上传,完美解决(保持原始目录结构)
|
||||
解压缩优化;解压中文问题。解压缩整体速度
|
||||
树目录增加快捷键支持(上下、左右展开树目录;复制、粘贴、剪切、删除、打开、搜索、新建文件(夹)、)
|
||||
pdf预览支持
|
||||
mac快捷键 ctrl 一一对应command
|
||||
音乐播放器和视频播放器相互独立
|
||||
图片懒加载、图片较多的情况下只加载首屏图片缩略图;
|
||||
编辑文件打开出错,自动关闭标签;文件打开20M限制(大于20M则不处理,浏览器会卡死)
|
||||
标签关闭提示:检测是否有未保存文件,文件修改实时修改是否修修改的按钮状态
|
||||
##fix bug:(bug解决和程序优化)
|
||||
文本文件编辑 文件名含有url编码则出错bug
|
||||
右键菜单在最下面时,右键位置重叠导致点击菜单问题
|
||||
编辑器打开文件时光标问题,处理:移动到行尾;编辑器enter建不显示自动提示
|
||||
iframe 打开url 优化。解决canvas问题
|
||||
文件编辑器,载入loading去掉
|
||||
删除错误时,或上传错误时也刷新目录。删除提示颜色错误
|
||||
对话框右键 点击右键菜单隐藏修复
|
||||
手机端 touch =双击
|
||||
文件列表 explorer 右键 不清除选才·
|
||||
树目录中文展开问题。
|
||||
ie 重命名状态textarea不可选则问题
|
||||
修复mac 下 ctrl连选出现右键菜单。
|
||||
ie 树目录右键兼容性
|
||||
|
||||
###ver2.5 `2014/6/15`
|
||||
----
|
||||
####update:
|
||||
- 增加创建副本功能 按住ctrl拖拽即可,可以到当前,也可以到文件夹。
|
||||
- 多选拖拽优化:剪切到、移动到某个文件夹
|
||||
- 创建副本功能
|
||||
- 树目录和文件列表一致性保持 更新相互通知
|
||||
|
||||
ver2.0 `2014/3/2`
|
||||
=====================
|
||||
##fix bug:(bug解决和程序优化)
|
||||
body右键屏蔽(保留input、textarea)
|
||||
重命名&新建时 右键(编辑内容系统菜单)
|
||||
对话框 不显示边框(位移处理,opacity:0)
|
||||
esc 退出程序 屏蔽该功能。
|
||||
关闭播放器,还在播放bug
|
||||
增加资源管理器任务栏。任务栏加入右键功能。
|
||||
对话框增加右键功能
|
||||
guest [三类用户 root/default/guest] guest登陆处加链接。20min
|
||||
打包程序[update user_add,admin/demo; 删除webuploader.js thumb less]
|
||||
编辑添加应用权限只能是root用户才可以。
|
||||
保存文件不可写提示!
|
||||
解压缩结果提示。(对话框)
|
||||
upload dialog display
|
||||
root登陆 目录修改为服务器路径
|
||||
artdialog 已经打开的窗口 (设了id) 最小化时,再次打开则显示
|
||||
最小化窗口后,再次打开 dialog display (setting-display)
|
||||
上传进度加入大小
|
||||
上传窗口关闭,自动停止所有上传队列
|
||||
拖拽后,更新上传地址为当前地址。(之前上传队列也会这样。bug)
|
||||
root用户非服务器路径下文件预览(图片、mp3、视频、html、swf、……php代理输出文件内容,http方式)
|
||||
对话框最小化或关闭,重置最大index为焦点窗口
|
||||
图片缩略图生成:小于5k则不生成(直接输出)
|
||||
加载文件列表改为异步方式,数据返回采用回调函数方式。增强体验
|
||||
选中优化,文件&文件夹重命名、文件&文件夹新建 后自动选中。(f5增加回调。);
|
||||
选中保持,选中后如果调整排序等等,保持选中状态。
|
||||
上传文件选中当前。
|
||||
f5改为异步(加入mask loading) 优化文件夹打开体验
|
||||
键盘按键选中文件 增加字符搜索定位功能(单个字符,增加到多个字符选中。两次响应直接延迟250ms)
|
||||
幻灯片播放[优化成fancybox或者 重写动画部分、打开时关不掉问题]
|
||||
编辑器backspace、delete时不提示。
|
||||
编辑器,增加选中效果
|
||||
增加不自动提示功能,配置项作为全局配置。影响后续建立的文件。选中标记状态。
|
||||
更换桌面背景图片【load后替换】
|
||||
更换主题【css load 后载入】
|
||||
删除。不清除选中。提前准备数据
|
||||
构建打包,合并压缩。添加版本、版权
|
||||
自动升级(本地记录版本,服务器js调用 参数 url、version;忽略此版本。cookie。统计用户)
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- 桌面重命名bug
|
||||
- 统一对话框部分bug
|
||||
- php notice 提示解决
|
||||
- ajax返回非json 则展示服务错误的返回
|
||||
- 所有入口都加入index.php 解决部分服务器没有设置默认入口问题
|
||||
|
||||
###ver2.4 `2014/6/8`
|
||||
####update:
|
||||
- 语言选择
|
||||
- 远程下载文件名优化
|
||||
- 树目录事件优化
|
||||
- 收藏夹点击 undefined
|
||||
- 没权限建立文件夹错误提示 红色
|
||||
- 打开dialog 不显示问题。先显示后打开
|
||||
- ajax error 系统错误 对话框提示内容
|
||||
- 懒加载优化
|
||||
|
||||
|
||||
ver2.0debug `2014/3/2`
|
||||
=====================
|
||||
##fix bug:(bug解决和程序优化)
|
||||
优化文件打开处理
|
||||
文件&文件夹:含有%、+号的处理(显示不出等问题,encoenURIComponent——rawurldecode)
|
||||
文件下载,支持大文件下载、断点续传。
|
||||
解决更改排序方式后 ——对应右键菜单不同步问题。
|
||||
优化右键更改列表状态,同步保存配置到服务端。
|
||||
文件浏览器打开(a点击新窗口跳转,a不支持click,用子元素冒泡来实现点击)
|
||||
优化配置文件存储方案。直接由前端操作后端key,value
|
||||
修复添加收藏夹问题(已打开设置窗口再添加失败问题)
|
||||
修复树目录中文文件名bug
|
||||
优化pic图片幻灯片播放
|
||||
优化新建文件&文件夹 清空选择状态
|
||||
对话框组件 ie8 优化;tips不显示任务栏;
|
||||
优化地址栏过长编辑状态问题
|
||||
优化新建、重命名文件(夹) 高度自适应问题
|
||||
firefox ctrl+s 系统对话框屏蔽
|
||||
树目录:收藏夹优化(右键绑定);右键操作优化,拖拽优化(文件管理&编辑器)
|
||||
收藏夹优化(右键 >编辑删除)
|
||||
##update:
|
||||
###新增功能
|
||||
多用户、权限控制:
|
||||
可以建立权限组,将功能分配给权限组
|
||||
添加用户,选择所属的权限组。
|
||||
权限按功能划分成颗粒,可以任意配置,例如普通使用者、游客等
|
||||
搜索:支持递归搜索,可选择是否搜索文件内容。
|
||||
增加桌面自定义壁纸。
|
||||
皮肤优化 ok 多色彩支持。
|
||||
应用商店,root用户可以管理应用。安装、修改、删除。普通用户可以安装应用。
|
||||
应用添加了图标。对应右键功能。
|
||||
office文档在线预览。
|
||||
###上传下载
|
||||
采用全新上传控件,跟安全,更好的体验。
|
||||
拖拽支持文件夹,多个文件。上传自动过滤不允许的文件类型
|
||||
拖拽上传 和上统一优化,修复webuploader的文件判断;火狐拖拽上传,ie9+拖拽上传。
|
||||
上传时自动过滤不合格的文件,上传失败错误返回。
|
||||
###文件编辑
|
||||
编辑器支持多光标
|
||||
支持几乎所有编程语言的代码高亮
|
||||
支持代码自动补全(基于文档、或自定义的代码快照)
|
||||
快速预览功能
|
||||
优化文件保存完美解决。编码自动识别转换。(字符串转义问题。1&#'[{'"+~%25\\\\ ////)
|
||||
文件编辑,添加收藏夹
|
||||
优化音乐播放器,添加音乐后自动播放新添加的第一首;解决之前添加列表后暂停问题。
|
||||
优化任务栏,多标签;最小化flash问题(left+10000 visiable)
|
||||
ctrl,shift 多选时拖拽优化(按住这两个键时,不能拖动;拖动加入延迟200ms)
|
||||
编辑器在没打开文件的情况下工具栏不可用问题。
|
||||
搜索、替换;vim模式
|
||||
……
|
||||
###登陆退出
|
||||
登陆优化 ok【页面&验证码&记住密码】
|
||||
三次错误需要输入验证码,保证系统的安全性
|
||||
优化自动登录安全性,客户端保存cookie自动登录信息。【tooken加入本地ip】
|
||||
###ver2.3 `2014/6/2`
|
||||
----
|
||||
####update:
|
||||
- 拖动url——创建ext app
|
||||
- 文件管理,树目录变化后(增删改)自动同步到文件列表
|
||||
- 文件管理,文件列表变化后(增删改)自动同步到树目录
|
||||
- 中文用户名限制
|
||||
- 对话框打开关闭动画
|
||||
- 其他多处优化
|
||||
|
||||
###系统优化
|
||||
解决较慢操作,阻塞其他操作问题。(同一个用户session会加锁,入口处做释放)
|
||||
前后端代码基本全部重构,前端采用模块化方法sea.js|require.js 模块化。
|
||||
凡是有模板调用的(display——页面部分php解析。并将配置注入到页面js变量,便于js使用)
|
||||
加入模板机制;通用模块采用懒加载模式;使用artTemplate 对模板绑定数据。
|
||||
kv结构存储
|
||||
路由权限控制
|
||||
后端统一json输出。
|
||||
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- 文件名限制bug
|
||||
- 同目录多个程序cookie bug修复
|
||||
- 地址栏 最后显示宽度问题
|
||||
- 服务器路径下 编辑器预览404修复
|
||||
- 树目录显示优化
|
||||
- 登陆记住密码优化
|
||||
|
||||
ver1.21 `2013/11/6`
|
||||
=====================
|
||||
##fix bug:
|
||||
* 修复文件下载bug
|
||||
* 修复编辑器自动补全问题,<aa bb /> ——> <aa bb></a>
|
||||
* 兼容部分服务器问题。
|
||||
###ver2.2 `2014/5/11`
|
||||
----
|
||||
####update:
|
||||
- 公共目录支持(多个用户可以共享目录,写权限跟随用户组权限设定)
|
||||
- 自动升级优化
|
||||
- 文件管理工具栏 增加菜单选项,方便移动设备操作
|
||||
- 文件编辑器,文件树目录 上下左右键盘切换 快捷键加入
|
||||
- 树目录去掉库,改为个人目录等多处文案修改
|
||||
- 默认打开用户目录
|
||||
|
||||
ver1.2 `2013/10/16`
|
||||
=====================
|
||||
##fix bug:
|
||||
* 设置,外部通用调用方式
|
||||
* 打包中文乱码问题。
|
||||
* simple,default主题,navbar 下拉菜单右边位置问题。
|
||||
* 文件管理:有滚动条时,上下超过可视区域框选问题修复,统一和win操作一致。
|
||||
* 文件大小写不敏感设置,扩展名获取bug
|
||||
* 目录读取权限判断,解决“系统错误”相关问题。
|
||||
##update:
|
||||
* 地址栏宽度自适应优化,支持浏览器窗口调整
|
||||
* 增加远程下载功能;上传功能优化,
|
||||
* 整体样式风格优化,
|
||||
* 右键菜单优化(可持续粘贴,剪切后粘贴清空剪贴板)。
|
||||
* 新建文件、文件重命名高度自适应优化
|
||||
* 关闭调试状态错误信息
|
||||
* 图片播放幻灯片优化,支持浏览器窗口调整,解决事件绑定bug,添加图片倒影;添加关闭按钮,关闭动画等功能
|
||||
* 优化桌面,弹出层层级问题;任务栏为最上层
|
||||
* 优化多标签,没有标签时不显示标签容器,放至层级覆盖
|
||||
* 地址栏超出宽度,自动隐藏最左边内容
|
||||
* 右键菜单状态同步,排序方式初始化当前值,设置后标记当前值。
|
||||
* 优化编辑器:拖动内容&文件到编辑区,内容处理。
|
||||
* 拖拽上传,信息框自动隐出后关闭
|
||||
* setting,editor,player最小化时,再次调用则显示出弹出层
|
||||
* 优化影音播放器,皮肤及相关配置信息存储于js中,不用之前的服务器请求方式,修改皮肤后可以直接更新到界面上。
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- 桌面任务栏点不中bug
|
||||
- 部分文案问题
|
||||
- 众多细节优化
|
||||
|
||||
|
||||
ver1.01 `2013/9/10`
|
||||
=====================
|
||||
##fix bug:
|
||||
* 添加到收藏
|
||||
* simple,default主题,navbar 下拉菜单右边位置问题。
|
||||
##update:
|
||||
* 添加到收藏夹,修改收藏夹,更新文件管理收藏夹部分。
|
||||
* 修改主题,同时修改编辑器主题。【编辑区,文件管理,桌面】
|
||||
* 优化setting部分代码,整合为一个整体。
|
||||
* 优化debug,增加less编译,导出功能优化,先编译后复制再操作
|
||||
###ver2.1 `2014/4/2`
|
||||
----
|
||||
####update:
|
||||
- 文件夹拖拽上传,完美解决(保持原始目录结构)
|
||||
- 解压缩优化;解压中文问题。解压缩整体速度
|
||||
- 树目录增加快捷键支持(上下、左右展开树目录;复制、粘贴、剪切、删除、打开、搜索、新建文件(夹)、)
|
||||
- pdf预览支持
|
||||
- mac快捷键 ctrl 一一对应command
|
||||
- 音乐播放器和视频播放器相互独立
|
||||
- 图片懒加载、图片较多的情况下只加载首屏图片缩略图;
|
||||
- 编辑文件打开出错,自动关闭标签;文件打开20M限制(大于20M则不处理,浏览器会卡死)
|
||||
- 标签关闭提示:检测是否有未保存文件,文件修改实时修改是否修修改的按钮状态
|
||||
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- 文本文件编辑 文件名含有url编码则出错bug
|
||||
- 右键菜单在最下面时,右键位置重叠导致点击菜单问题
|
||||
- 编辑器打开文件时光标问题,处理:移动到行尾;编辑器enter建不显示自动提示
|
||||
- iframe 打开url 优化。解决canvas问题
|
||||
- 文件编辑器,载入loading去掉
|
||||
- 删除错误时,或上传错误时也刷新目录。删除提示颜色错误
|
||||
- 对话框右键 点击右键菜单隐藏修复
|
||||
- 手机端 touch =双击
|
||||
- 文件列表 explorer 右键 不清除选才·
|
||||
- 树目录中文展开问题。
|
||||
- ie 重命名状态textarea不可选则问题
|
||||
- 修复mac 下 ctrl连选出现右键菜单。
|
||||
- ie 树目录右键兼容性
|
||||
-
|
||||
|
||||
|
||||
ver1.0 `2013.9.1`
|
||||
=====================
|
||||
##update:
|
||||
* 代码模块化优化,静态文件分离,可以分开部署
|
||||
* 编辑器单独逻辑提取,完整融合到文件管理,树目录融合文件管理,懒加载语法高亮
|
||||
* 多标签实现,弹层对话框多标签支持,桌面任务栏实现;编辑器多标签支持
|
||||
* 弹层功能优化,实现最大最小化,最小化关联多标签任务栏管理
|
||||
##fix bug:
|
||||
* linux 下浏览器打开文件和文件夹,中文问题
|
||||
* 重命名&新建&上传 刷新列表使用动画,当前选中失效问题,不使用动画加载方式。
|
||||
* html5拖拽上传优化
|
||||
###ver2.0 `2014/3/2`
|
||||
----
|
||||
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- body右键屏蔽(保留input、textarea)
|
||||
- 重命名&新建时 右键(编辑内容系统菜单)
|
||||
- 对话框 不显示边框(位移处理,opacity:0)
|
||||
- esc 退出程序 屏蔽该功能。
|
||||
- 关闭播放器,还在播放bug
|
||||
- 增加资源管理器任务栏。任务栏加入右键功能。
|
||||
- 对话框增加右键功能
|
||||
- guest [三类用户 root/default/guest] guest登陆处加链接。20min
|
||||
- 打包程序[update user_add,admin/demo; 删除webuploader.js thumb less]
|
||||
- 编辑添加应用权限只能是root用户才可以。
|
||||
- 保存文件不可写提示!
|
||||
- 解压缩结果提示。(对话框)
|
||||
|
||||
####upload
|
||||
- dialog display
|
||||
- root登陆 目录修改为服务器路径
|
||||
- artdialog 已经打开的窗口 (设了id) 最小化时,再次打开则显示
|
||||
- 最小化窗口后,再次打开 dialog display (setting-display)
|
||||
- 上传进度加入大小
|
||||
- 上传窗口关闭,自动停止所有上传队列
|
||||
- 拖拽后,更新上传地址为当前地址。(之前上传队列也会这样。bug)
|
||||
- root用户非服务器路径下文件预览(图片、mp3、视频、html、swf、……php代理输出文件内容,http方式)
|
||||
- 对话框最小化或关闭,重置最大index为焦点窗口
|
||||
- 图片缩略图生成:小于5k则不生成(直接输出)
|
||||
- 加载文件列表改为异步方式,数据返回采用回调函数方式。增强体验
|
||||
- 选中优化,文件&文件夹重命名、文件&文件夹新建 后自动选中。(f5增加回调。);
|
||||
- 选中保持,选中后如果调整排序等等,保持选中状态。
|
||||
- 上传文件选中当前。
|
||||
- f5改为异步(加入mask loading) 优化文件夹打开体验
|
||||
- 键盘按键选中文件 增加字符搜索定位功能(单个字符,增加到多个字符选中。两次响应直接延迟250ms)
|
||||
- 幻灯片播放[优化成fancybox或者 重写动画部分、打开时关不掉问题]
|
||||
- 编辑器backspace、delete时不提示。
|
||||
- 编辑器,增加选中效果
|
||||
- 增加不自动提示功能,配置项作为全局配置。影响后续建立的文件。选中标记状态。
|
||||
- 更换桌面背景图片【load后替换】
|
||||
- 更换主题【css load 后载入】
|
||||
- 删除。不清除选中。提前准备数据
|
||||
- 构建打包,合并压缩。添加版本、版权
|
||||
- 自动升级(本地记录版本,服务器js调用 参数 url、###version;忽略此版本。cookie。统计用户)
|
||||
|
||||
|
||||
ver0.8 `2013.6.15`
|
||||
=====================
|
||||
##update:
|
||||
* 整体优化,实现全部操作ajax本地化 ,进一步提升体验
|
||||
* 浏览器强刷新,保持之前最后所在路径
|
||||
* 重命名,新建,粘贴操作后添加选中状态
|
||||
* 代码主题列表优化,重新设计,提高可配置性
|
||||
* 优化代码,添加getTplList模版,简化关联配置获取
|
||||
* 增加设置功能,ajax刷新设置。缩略图片增加tips预览(被注释frame/setting.php)
|
||||
* 增加重命名只选择名称部分功能
|
||||
* 增加iframe js api互操作ie支持。四大浏览器内核皆支持。
|
||||
* 文件夹打开,采用ajax实现。包括头部地址栏,父级目录,左边树目录以及收藏夹
|
||||
* 历史记录完美实现,前进后退按钮实时变化状态。
|
||||
* 快捷键backspace实现后退(left header main 分别加入函数,屏蔽默认history(-1)操作)
|
||||
##fix bug:
|
||||
* 完善修改windows以及linux获取文件列表,中文路径属性获取失败问题。
|
||||
* 复制,剪切。剪贴板内容覆盖判空处理
|
||||
* 修复一些地方ajax线程同步问题,重命名后选中失效问题解决
|
||||
* 修复返回上层目录,根目录检测
|
||||
* 修复linux下 音视频播放,中文路径问题
|
||||
* 修复文件右键菜单位置出错问题
|
||||
* 修复ie下frame js相互通信问题
|
||||
* ajax更新文件列表下,各种bug修复。进一步提升操作友好性
|
||||
* 修复当前目录改变的情况下,播放器消失的问题。现在能使播放器始终保留
|
||||
###ver2.0 debug `2014/3/2`
|
||||
----
|
||||
####fix bug:(bug解决和程序优化)
|
||||
- 优化文件打开处理
|
||||
- 文件&文件夹:含有%、+号的处理(显示不出等问题,encoenURIComponent——rawurldecode)
|
||||
- 文件下载,支持大文件下载、断点续传。
|
||||
- 解决更改排序方式后 ——对应右键菜单不同步问题。
|
||||
- 优化右键更改列表状态,同步保存配置到服务端。
|
||||
- 文件浏览器打开(a点击新窗口跳转,a不支持click,用子元素冒泡来实现点击)
|
||||
- 优化配置文件存储方案。直接由前端操作后端key,value
|
||||
- 修复添加收藏夹问题(已打开设置窗口再添加失败问题)
|
||||
- 修复树目录中文文件名bug
|
||||
- 优化pic图片幻灯片播放
|
||||
- 优化新建文件&文件夹 清空选择状态
|
||||
- 对话框组件 ie8 优化;tips不显示任务栏;
|
||||
- 优化地址栏过长编辑状态问题
|
||||
- 优化新建、重命名文件(夹) 高度自适应问题
|
||||
- firefox ctrl+s 系统对话框屏蔽
|
||||
- 树目录:收藏夹优化(右键绑定);右键操作优化,拖拽优化(文件管理&编辑器)
|
||||
- 收藏夹优化(右键 >编辑删除)
|
||||
|
||||
####update:
|
||||
**新增功能**
|
||||
|
||||
- 多用户、权限控制:
|
||||
- 可以建立权限组,将功能分配给权限组
|
||||
- 添加用户,选择所属的权限组。
|
||||
- 权限按功能划分成颗粒,可以任意配置,例如普通使用者、游客等
|
||||
- 搜索:支持递归搜索,可选择是否搜索文件内容。
|
||||
- 增加桌面自定义壁纸。
|
||||
- 皮肤优化 ok 多色彩支持。
|
||||
- 应用商店,root用户可以管理应用。安装、修改、删除。普通用户可以安装应用。
|
||||
- 应用添加了图标。对应右键功能。
|
||||
- office文档在线预览。
|
||||
|
||||
**上传下载**
|
||||
|
||||
- 采用全新上传控件,跟安全,更好的体验。
|
||||
- 拖拽支持文件夹,多个文件。上传自动过滤不允许的文件类型
|
||||
- 拖拽上传 和上统一优化,修复webuploader的文件判断;火狐拖拽上传,ie9+拖拽上传。
|
||||
- 上传时自动过滤不合格的文件,上传失败错误返回。
|
||||
|
||||
**文件编辑**
|
||||
|
||||
- 编辑器支持多光标
|
||||
- 支持几乎所有编程语言的代码高亮
|
||||
- 支持代码自动补全(基于文档、或自定义的代码快照)
|
||||
- 快速预览功能
|
||||
- 优化文件保存完美解决。编码自动识别转换。(字符串转义问题。1&#'[{'"+~%25\\\\ ////)
|
||||
- 文件编辑,添加收藏夹
|
||||
- 优化音乐播放器,添加音乐后自动播放新添加的第一首;解决之前添加列表后暂停问题。
|
||||
- 优化任务栏,多标签;最小化flash问题(left+10000 visiable)
|
||||
- ctrl,shift 多选时拖拽优化(按住这两个键时,不能拖动;拖动加入延迟200ms)
|
||||
- 编辑器在没打开文件的情况下工具栏不可用问题。
|
||||
- 搜索、替换;vim模式
|
||||
- ……
|
||||
|
||||
**登陆退出**
|
||||
|
||||
- 登陆优化 ok【页面&验证码&记住密码】
|
||||
- 三次错误需要输入验证码,保证系统的安全性
|
||||
- 优化自动登录安全性,客户端保存cookie自动登录信息。【tooken加入本地ip】
|
||||
|
||||
**系统优化**
|
||||
|
||||
- 解决较慢操作,阻塞其他操作问题。(同一个用户session会加锁,入口处做释放)
|
||||
- 前后端代码基本全部重构,前端采用模块化方法sea.js|require.js 模块化。
|
||||
- 凡是有模板调用的(display——页面部分php解析。并将配置注入到页面js变量,便于js使用)
|
||||
- 加入模板机制;通用模块采用懒加载模式;使用artTemplate 对模板绑定数据。
|
||||
- kv结构存储
|
||||
- 路由权限控制
|
||||
- 后端统一json输出。
|
||||
|
||||
###ver1.21 `2013/11/6`
|
||||
----
|
||||
####fix bug:
|
||||
- 修复文件下载bug
|
||||
- 修复编辑器自动补全问题,<aa bb /> ——> <aa bb></a>
|
||||
- 兼容部分服务器问题。
|
||||
|
||||
###ver1.2 `2013/10/16`
|
||||
----
|
||||
####fix bug:
|
||||
- 设置,外部通用调用方式
|
||||
- 打包中文乱码问题。
|
||||
- simple,default主题,navbar 下拉菜单右边位置问题。
|
||||
- 文件管理:有滚动条时,上下超过可视区域框选问题修复,统一和win操作一致。
|
||||
- 文件大小写不敏感设置,扩展名获取bug
|
||||
- 目录读取权限判断,解决“系统错误”相关问题。
|
||||
|
||||
####update:
|
||||
- 地址栏宽度自适应优化,支持浏览器窗口调整
|
||||
- 增加远程下载功能;上传功能优化,
|
||||
- 整体样式风格优化,
|
||||
- 右键菜单优化(可持续粘贴,剪切后粘贴清空剪贴板)。
|
||||
- 新建文件、文件重命名高度自适应优化
|
||||
- 关闭调试状态错误信息
|
||||
- 图片播放幻灯片优化,支持浏览器窗口调整,解决事件绑定bug,添加图片倒影;添加关闭按钮,关闭动画等功能
|
||||
- 优化桌面,弹出层层级问题;任务栏为最上层
|
||||
- 优化多标签,没有标签时不显示标签容器,放至层级覆盖
|
||||
- 地址栏超出宽度,自动隐藏最左边内容
|
||||
- 右键菜单状态同步,排序方式初始化当前值,设置后标记当前值。
|
||||
- 优化编辑器:拖动内容&文件到编辑区,内容处理。
|
||||
- 拖拽上传,信息框自动隐出后关闭
|
||||
- setting,editor,player最小化时,再次调用则显示出弹出层
|
||||
- 优化影音播放器,皮肤及相关配置信息存储于js中,不用之前的服务器请求方式,修改皮肤后可以直接更新到界面上。
|
||||
|
||||
|
||||
###ver1.01 `2013/9/10`
|
||||
----
|
||||
####fix bug:
|
||||
- 添加到收藏
|
||||
- simple,default主题,navbar 下拉菜单右边位置问题。
|
||||
|
||||
####update:
|
||||
- 添加到收藏夹,修改收藏夹,更新文件管理收藏夹部分。
|
||||
- 修改主题,同时修改编辑器主题。【编辑区,文件管理,桌面】
|
||||
- 优化setting部分代码,整合为一个整体。
|
||||
- 优化debug,增加less编译,导出功能优化,先编译后复制再操作
|
||||
|
||||
|
||||
###ver1.0 `2013.9.1`
|
||||
----
|
||||
####update:
|
||||
- 代码模块化优化,静态文件分离,可以分开部署
|
||||
- 编辑器单独逻辑提取,完整融合到文件管理,树目录融合文件管理,懒加载语法高亮
|
||||
- 多标签实现,弹层对话框多标签支持,桌面任务栏实现;编辑器多标签支持
|
||||
- 弹层功能优化,实现最大最小化,最小化关联多标签任务栏管理
|
||||
|
||||
####fix bug:
|
||||
- linux 下浏览器打开文件和文件夹,中文问题
|
||||
- 重命名&新建&上传 刷新列表使用动画,当前选中失效问题,不使用动画加载方式。
|
||||
- html5拖拽上传优化
|
||||
|
||||
|
||||
###ver0.8 `2013.6.15`
|
||||
----
|
||||
####update:
|
||||
- 整体优化,实现全部操作ajax本地化 ,进一步提升体验
|
||||
- 浏览器强刷新,保持之前最后所在路径
|
||||
- 重命名,新建,粘贴操作后添加选中状态
|
||||
- 代码主题列表优化,重新设计,提高可配置性
|
||||
- 优化代码,添加getTplList模版,简化关联配置获取
|
||||
- 增加设置功能,ajax刷新设置。缩略图片增加tips预览(被注释frame/setting.php)
|
||||
- 增加重命名只选择名称部分功能
|
||||
- 增加iframe js api互操作ie支持。四大浏览器内核皆支持。
|
||||
- 文件夹打开,采用ajax实现。包括头部地址栏,父级目录,左边树目录以及收藏夹
|
||||
- 历史记录完美实现,前进后退按钮实时变化状态。
|
||||
- 快捷键backspace实现后退(left header main 分别加入函数,屏蔽默认history(-1)操作) -
|
||||
|
||||
####fix bug:
|
||||
- 完善修改windows以及linux获取文件列表,中文路径属性获取失败问题。
|
||||
- 复制,剪切。剪贴板内容覆盖判空处理
|
||||
- 修复一些地方ajax线程同步问题,重命名后选中失效问题解决
|
||||
- 修复返回上层目录,根目录检测
|
||||
- 修复linux下 音视频播放,中文路径问题
|
||||
- 修复文件右键菜单位置出错问题
|
||||
- 修复ie下frame js相互通信问题
|
||||
- ajax更新文件列表下,各种bug修复。进一步提升操作友好性
|
||||
- 修复当前目录改变的情况下,播放器消失的问题。现在能使播放器始终保留
|
||||
|
||||
|
||||
## editor
|
||||
|
|
|
@ -6,11 +6,10 @@
|
|||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
|
||||
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').'/');
|
||||
|
@ -31,10 +30,10 @@ define('USER_SYSTEM', DATA_PATH .'system/'); //用户数据存储目录
|
|||
define('LANGUAGE_PATH', DATA_PATH .'i18n/'); //多语言目录
|
||||
define('PUBLIC_PATH', DATA_PATH .'public/'); //公共共享目录 读写权限跟随用户目录的读写权限
|
||||
|
||||
define('STATIC_JS',"app");//_dev app js编译||开发状态
|
||||
define('STATIC_JS','_dev');//_dev app js编译||开发状态
|
||||
define('STATIC_PATH',"./static/");//静态文件目录
|
||||
//define('STATIC_PATH','http://static.kalcaddle.com/static/');
|
||||
define('STATIC_LESS','css');
|
||||
//define('STATIC_PATH','http://static.kalcaddle.com/static/');
|
||||
|
||||
include(FUNCTION_DIR.'web.function.php');
|
||||
include(FUNCTION_DIR.'file.function.php');
|
||||
|
@ -48,12 +47,6 @@ include(FUNCTION_DIR.'common.function.php');
|
|||
include(BASIC_PATH.'config/setting.php');
|
||||
include(BASIC_PATH.'config/version.php');
|
||||
|
||||
|
||||
//集群.远程接口访问方式
|
||||
define('REMOTE_OPEN', false);//eg:auth_key=f5e26983908f6ee6d54fbe3ada4b52db
|
||||
define('REMOTE_KEY', '7eab16c4662b853f901d6e641a93c31d');
|
||||
|
||||
|
||||
//数据地址定义。
|
||||
$config['pic_thumb'] = BASIC_PATH.'data/thumb/'; // 缩略图生成存放地址
|
||||
$config['cache_dir'] = BASIC_PATH.'data/cache/'; // 缓存文件地址
|
||||
|
|
|
@ -19,12 +19,12 @@ $config['setting_all']['language'] = "en:English,zh_CN:简体中文,zh_TW:簡體
|
|||
// 默认配置
|
||||
$config['setting_default'] = array(
|
||||
'list_type' => "icon", // list||icon
|
||||
'list_sort_field' => "mtime", // name||size||ext||mtime
|
||||
'list_sort_field' => "name", // name||size||ext||mtime
|
||||
'list_sort_order' => "up", // asc||desc
|
||||
'theme' => "metro/", // app theme
|
||||
'codetheme' => "github", // code editor theme
|
||||
'wall' => "1", // wall picture
|
||||
'musictheme' => "mp3player", // music player theme
|
||||
'musictheme' => "mp3player", // music player theme
|
||||
'movietheme' => "webplayer" // movie player theme
|
||||
);
|
||||
|
||||
|
@ -38,9 +38,9 @@ $config['system_file'] = array(
|
|||
//权限路由配置;精确到需要做权限控制的控制器和方法
|
||||
$config['role_setting'] = array(
|
||||
'explorer' => array(
|
||||
'mkdir','mkfile','pathRname','pathDelete','zip','unzip','pathCopy',
|
||||
'pathCute','pathCuteDrag','clipboard','pathPast','pathInfo',
|
||||
'pathInfoMuti','serverDownload','fileUpload','search'),
|
||||
'mkdir','mkfile','pathRname','pathDelete','zip','unzip','pathCopy','pathChmod',
|
||||
'pathCute','pathCuteDrag','pathCopyDrag','clipboard','pathPast','pathInfo',
|
||||
'serverDownload','fileUpload','search'),
|
||||
'app' => array('user_app','add','edit','del'),//
|
||||
'user' => array('changePassword'),//可以设立公用账户
|
||||
'editor' => array('fileSave'),
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<?php
|
||||
define('KOD_VERSION','2.5');//2014.6.15
|
||||
define('KOD_VERSION','2.6');
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* @link http://www.kalcaddle.com/
|
||||
* @author warlee | e-mail:kalcaddle@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kalcaddle.com/tools/licenses/license.txt
|
||||
*/
|
||||
|
||||
//集群 远程接口方式访问。多台服务器管理
|
||||
|
||||
class api extends Controller{
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
//自动创建key 远程key 可以随意设置。二次md5值即可
|
||||
public function make_key(){
|
||||
$auth_key = make_password();
|
||||
$remote_key = md5(md5($auth_key));
|
||||
echo 'auth_key:'.$auth_key.'<br/>remote_key:'.$remote_key;
|
||||
}
|
||||
|
||||
//接口代理 所有参数合并为新的参数请求远程服务器,返回结果
|
||||
public function get(){
|
||||
$url = 'http://kalcaddle.duapp.com/';
|
||||
$key = '&auth_key=f5e26983908f6ee6d54fbe3ada4b52db';
|
||||
}
|
||||
}
|
|
@ -90,8 +90,9 @@ class app extends Controller{
|
|||
if (strlen($result)>50) {
|
||||
$result = mb_substr($result,0,50,'utf-8');
|
||||
}
|
||||
if (strlen($result) == 0) {
|
||||
$result = urlencode($this->in['url']);
|
||||
if (!$result || strlen($result) == 0) {
|
||||
$result = $this->in['url'];
|
||||
$result = str_replace(array('http://','&','/'),array('','@','-'), $result);
|
||||
}
|
||||
show_json($result);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ class debug extends Controller{
|
|||
// 删除
|
||||
function _remove(){
|
||||
$file_list = array(
|
||||
$this->path_to.'/controller/debug.class.php',
|
||||
$this->path_to.'/data/system/install.lock',
|
||||
$this->path_to.'/lib/class/lessc.inc.class.php',
|
||||
$this->path_to.'/static/style/base.less',
|
||||
$this->path_to.'/static/js/lib/less-1.4.2.min.js',
|
||||
|
@ -154,6 +154,7 @@ class debug extends Controller{
|
|||
$this->path_to.'/static/js/package.json',
|
||||
$this->path_to.'/static/js/readme.txt',
|
||||
$this->path_to.'/todo.txt',
|
||||
$this->path_to.'/controller/debug.class.php',
|
||||
);
|
||||
$path_list = array(
|
||||
$this->path_to.'/data/log',
|
||||
|
@ -172,6 +173,8 @@ class debug extends Controller{
|
|||
foreach($path_list as $val){
|
||||
del_dir($val);
|
||||
}
|
||||
|
||||
mk_dir($this->path_to.'/data/thumb');
|
||||
echo '<br/>2.文件夹删除完成:';flush();
|
||||
$path = $this->path_to.'/static/style/skin/';
|
||||
$app_theme = array('default','metro','simple');
|
||||
|
@ -206,11 +209,11 @@ class debug extends Controller{
|
|||
file_put_contents($val,$content);
|
||||
echo '<br/>处理template文件:'.$val,'成功';flush();
|
||||
}
|
||||
|
||||
|
||||
$config = $this->path_to.'/config/config.php';
|
||||
$content = file_get_contents($config);
|
||||
$content = str_replace('define(\'STATIC_JS\'.*','',$content);
|
||||
$content = str_replace('define(\'STATIC_LESS\'.*','',$content);
|
||||
$content = str_replace("('STATIC_JS','_dev')","('STATIC_JS','app')",$content);
|
||||
$content = str_replace("('STATIC_LESS','less')","('STATIC_LESS','css')",$content);
|
||||
file_put_contents($config,$content);
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class editor extends Controller{
|
|||
$filestr = rawurldecode($this->in['filestr']);
|
||||
$charset = $this->in['charset'];
|
||||
$path =_DIR($this->in['path']);
|
||||
if (!is_writable($path)) show_json($this->L['no_permission'],false);
|
||||
if (!is_writable($path)) show_json($this->L['no_permission_write'],false);
|
||||
|
||||
if ($charset !='' || $charset != 'utf-8') {
|
||||
$filestr=mb_convert_encoding($filestr,$this->in['charset'],'utf-8');
|
||||
|
|
|
@ -15,7 +15,6 @@ class explorer extends Controller{
|
|||
$this->path = _DIR($this->in['path']);
|
||||
}
|
||||
}
|
||||
|
||||
public function index(){
|
||||
if(isset($this->in['path']) && $this->in['path'] !=''){
|
||||
$dir = $_GET['path'];
|
||||
|
@ -36,28 +35,49 @@ class explorer extends Controller{
|
|||
}
|
||||
|
||||
public function pathInfo(){
|
||||
$path = $this->path;
|
||||
$type= $this->in['type'];
|
||||
if ($type=="folder"){
|
||||
$data = path_info($path,$this->L['time_type_info']);
|
||||
}else{
|
||||
$data = file_info($path,$this->L['time_type_info']);
|
||||
}
|
||||
show_json($data);
|
||||
}
|
||||
public function pathInfoMuti(){
|
||||
$info_list = json_decode($this->in['list'],true);
|
||||
foreach ($info_list as &$val) {
|
||||
$val['path'] = _DIR($val['path']);
|
||||
}
|
||||
$data = path_info_muti($info_list);
|
||||
$data = path_info_muti($info_list,$this->L['time_type_info']);
|
||||
show_json($data);
|
||||
}
|
||||
}
|
||||
|
||||
public function pathChmod(){
|
||||
$info_list = json_decode($this->in['list'],true);
|
||||
$mod = octdec('0'.$this->in['mod']);
|
||||
$success=0;$error=0;
|
||||
foreach ($info_list as $val) {
|
||||
$path = _DIR($val['path']);
|
||||
if(chmod_path($path,$mod)){
|
||||
$success++;
|
||||
}else{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$state = $error==0?true:false;
|
||||
$info = $success.' success,'.$error.' error';
|
||||
if (count($info_list) == 1 && $error==0) {
|
||||
$info = $this->L['success'];
|
||||
}
|
||||
show_json($info,$state);
|
||||
}
|
||||
|
||||
public function _pathAllow($path){
|
||||
$name = get_path_this($path);
|
||||
$path_not_allow = array('*','?','"','<','>','|');
|
||||
foreach ($path_not_allow as $tip) {
|
||||
if (strstr($name,$tip)) {
|
||||
show_json($this->L['path_not_allow']."*,?,<,>,|",false);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function pathRname(){
|
||||
if (!is_writable($this->path)) {
|
||||
show_json($this->L['no_permission'],false);
|
||||
show_json($this->L['no_permission_write'],false);
|
||||
}
|
||||
$rname_to=_DIR($this->in['rname_to']);
|
||||
$this->_pathAllow($rname_to);
|
||||
if (file_exists($rname_to)) {
|
||||
show_json($this->L['name_isexists'],false);
|
||||
}
|
||||
|
@ -67,7 +87,7 @@ class explorer extends Controller{
|
|||
public function pathList(){
|
||||
load_class('history');
|
||||
session_start();//re start
|
||||
$session=$_SESSION['history'];
|
||||
$session=isset($_SESSION['history'])?$_SESSION['history']:false;
|
||||
$user_path = $this->in['path'];
|
||||
|
||||
if (is_array($session)){
|
||||
|
@ -148,29 +168,34 @@ class explorer extends Controller{
|
|||
);
|
||||
}
|
||||
|
||||
$list_root = $this->path(_DIR(MYHOME),true,true);
|
||||
$list_share = $this->path(_DIR(PUBLIC_PATH),true,true);
|
||||
$list_root = $this->path(_DIR(MYHOME),$check_file,true);
|
||||
$list_share = $this->path(_DIR(PUBLIC_PATH),$check_file,true);
|
||||
if ($check_file) {//编辑器
|
||||
$root = array_merge($list_root['folderlist'],$list_root['filelist']);
|
||||
$share = array_merge($list_share['folderlist'],$list_share['filelist']);
|
||||
$root_isparent = count($root)>0?true:false;
|
||||
$share_isparent = count($share)>0?true:false;
|
||||
|
||||
$tree_data = array(
|
||||
array('name'=>$this->L['fav'],'ext'=>'__fav__','iconSkin'=>"fav",
|
||||
'open'=>true,'children'=>$fav),
|
||||
array('name'=>$this->L['root_path'],'ext'=>'__root__','children'=>$root,
|
||||
'iconSkin'=>"my",'open'=>true,'this_path'=> MYHOME,'isParent'=>true),
|
||||
'iconSkin'=>"my",'open'=>true,'this_path'=> MYHOME,'isParent'=>$root_isparent),
|
||||
array('name'=>$this->L['public_path'],'ext'=>'__root__','children'=>$share,
|
||||
'iconSkin'=>"lib",'open'=>true,'this_path'=> PUBLIC_PATH,'isParent'=>true)
|
||||
'iconSkin'=>"lib",'open'=>true,'this_path'=> PUBLIC_PATH,'isParent'=>$share_isparent)
|
||||
);
|
||||
}else{//文件管理器
|
||||
$root = $list_root['folderlist'];
|
||||
$share = $list_share['folderlist'];
|
||||
$root_isparent = count($root)>0?true:false;
|
||||
$share_isparent = count($share)>0?true:false;
|
||||
$tree_data = array(
|
||||
array('name'=>$this->L['fav'],'ext'=>'__fav__','iconSkin'=>"fav",
|
||||
'open'=>true,'children'=>$fav),
|
||||
array('name'=>$this->L['root_path'],'ext'=>'__root__','children'=>$root,
|
||||
'iconSkin'=>"my",'open'=>true,'this_path'=> MYHOME,'isParent'=>true),
|
||||
'iconSkin'=>"my",'open'=>true,'this_path'=> MYHOME,'isParent'=>$root_isparent),
|
||||
array('name'=>$this->L['public_path'],'ext'=>'__root__','children'=>$share,
|
||||
'iconSkin'=>"lib",'open'=>true,'this_path'=> PUBLIC_PATH,'isParent'=>true)
|
||||
'iconSkin'=>"lib",'open'=>true,'this_path'=> PUBLIC_PATH,'isParent'=>$share_isparent)
|
||||
);
|
||||
}
|
||||
show_json($tree_data);
|
||||
|
@ -212,8 +237,7 @@ class explorer extends Controller{
|
|||
}
|
||||
public function pathDelete(){
|
||||
$list = json_decode($this->in['list'],true);
|
||||
$success = 0;
|
||||
$error = 0;
|
||||
$success = 0;$error = 0;
|
||||
foreach ($list as $val) {
|
||||
$path_full = _DIR($val['path']);
|
||||
if ($val['type'] == 'folder') {
|
||||
|
@ -234,6 +258,7 @@ class explorer extends Controller{
|
|||
}
|
||||
public function mkfile(){
|
||||
$new= rtrim($this->path,'/');
|
||||
$this->_pathAllow($new);
|
||||
if(touch($new)){
|
||||
show_json($this->L['create_success']);
|
||||
}else{
|
||||
|
@ -242,6 +267,7 @@ class explorer extends Controller{
|
|||
}
|
||||
public function mkdir(){
|
||||
$new = rtrim($this->path,'/');
|
||||
$this->_pathAllow($new);
|
||||
if(mkdir($new,0777)){
|
||||
show_json($this->L['create_success']);
|
||||
}else{
|
||||
|
@ -273,30 +299,36 @@ class explorer extends Controller{
|
|||
public function pathCuteDrag(){
|
||||
$clipboard = json_decode($this->in['list'],true);
|
||||
$path_past=$this->path;
|
||||
if (!is_writable($path_past)) show_json($this->L['no_permission'],false);
|
||||
if (!is_writable($this->path)) show_json($this->L['no_permission_write'],false);
|
||||
$success=0;$error=0;
|
||||
foreach ($clipboard as $val) {
|
||||
$path_copy = _DIR($val['path']);
|
||||
$filename = get_path_this($path_copy);
|
||||
@rename($path_copy,$path_past.$filename);
|
||||
$filename = get_filename_auto($path_past.$filename);//已存在处理 创建副本
|
||||
if (@rename($path_copy,$filename)) {
|
||||
$success++;
|
||||
}else{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
show_json($this->L['success']);
|
||||
$state = $error==0?true:false;
|
||||
$info = $success.' success,'.$error.' error';
|
||||
if (count($info_list) == 1 && $error==0) {
|
||||
$info = $this->L['success'];
|
||||
}
|
||||
show_json($info,$state);
|
||||
}
|
||||
|
||||
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);
|
||||
if (!is_writable($this->path)) show_json($this->L['no_permission_write'],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);
|
||||
}
|
||||
$filename = get_path_this($path_copy);
|
||||
$path = get_filename_auto($path_past.$filename);
|
||||
copy_dir($path_copy,$path);
|
||||
$data[] = iconv_app(get_path_this($path));
|
||||
}
|
||||
show_json($data,true);
|
||||
|
@ -321,12 +353,13 @@ class explorer extends Controller{
|
|||
show_json($msg);
|
||||
}
|
||||
public function pathPast(){
|
||||
session_start();//re start
|
||||
$info = '';$data = array();
|
||||
$clipboard = json_decode($_SESSION['path_copy'],true);
|
||||
if (count($clipboard) == 0){
|
||||
if (!isset($_SESSION['path_copy'])){
|
||||
show_json($data,false,$this->L['clipboard_null']);
|
||||
}
|
||||
|
||||
session_start();//re start
|
||||
$error = '';$data = array();
|
||||
$clipboard = json_decode($_SESSION['path_copy'],true);
|
||||
$copy_type = $_SESSION['path_copy_type'];
|
||||
$path_past=$this->path;
|
||||
if (!is_writable($path_past)) show_json($data,false,$this->L['no_permission_write']);
|
||||
|
@ -341,38 +374,38 @@ class explorer extends Controller{
|
|||
$filename_out = iconv_app($filename);
|
||||
|
||||
if (!file_exists($path_copy) && !is_dir($path_copy)){
|
||||
$info .=$path_copy."<li>{$filename_out}'.$this->L['copy_not_exists'].'</li>";
|
||||
$error .=$path_copy."<li>{$filename_out}'.$this->L['copy_not_exists'].'</li>";
|
||||
continue;
|
||||
}
|
||||
if ($clipboard[$i]['type'] == 'folder'){
|
||||
if ($path_copy == substr($path_past,0,strlen($path_copy))){
|
||||
$info .="<li style='color:#f33;'>{$filename_out}'.$this->L['current_has_parent'].'</li>";
|
||||
$error .="<li style='color:#f33;'>{$filename_out}'.$this->L['current_has_parent'].'</li>";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$auto_path = get_filename_auto($path_past.$filename);
|
||||
$filename = get_path_this($auto_path);
|
||||
if ($copy_type == 'copy') {
|
||||
if ($clipboard[$i]['type'] == 'folder') {
|
||||
copy_dir($path_copy,$path_past.$filename);
|
||||
copy_dir($path_copy,$auto_path);
|
||||
}else{
|
||||
copy($path_copy,$path_past.$filename);
|
||||
copy($path_copy,$auto_path);
|
||||
}
|
||||
}else{
|
||||
if ($cute_list[$i]['type'] == 'folder') {
|
||||
rename($path_copy,$path_past.$filename.'/');
|
||||
}else{
|
||||
rename($path_copy,$path_past.$filename);
|
||||
}
|
||||
rename($path_copy,$auto_path);
|
||||
}
|
||||
$data[] = iconv_app($filename);
|
||||
}
|
||||
if ($copy_type == 'copy') {
|
||||
$info=$this->L['past_success'].$info;
|
||||
$info=$this->L['past_success'].$error;
|
||||
}else{
|
||||
$_SESSION['path_copy'] = json_encode(array());
|
||||
$_SESSION['path_copy_type'] = '';
|
||||
$info=$this->L['cute_past_success'].$info;
|
||||
$info=$this->L['cute_past_success'].$error;
|
||||
}
|
||||
show_json($data,true,$info);
|
||||
$state = ($error ==''?true:false);
|
||||
show_json($data,$state,$info);
|
||||
}
|
||||
public function fileDownload(){
|
||||
file_download($this->path);
|
||||
|
@ -416,16 +449,24 @@ class explorer extends Controller{
|
|||
$path=$this->path;
|
||||
$name = get_path_this($path);
|
||||
$name = substr($name,0,strrpos($name,'.'));
|
||||
$path_father_name=get_path_father($path);
|
||||
$unzip_to = $path_father_name.$path_this_name;
|
||||
$unzip_to=get_path_father($path).$name;
|
||||
if (isset($this->in['path_to'])) {//解压到指定位置
|
||||
$unzip_to = _DIR($this->in['path_to']);
|
||||
}
|
||||
|
||||
$zip = new PclZip($path);
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$unzip_to,
|
||||
if (!is_writeable($path)) {
|
||||
show_json("{$path}".$this->L['no_permission_write'],false);
|
||||
}
|
||||
$zip = new PclZip($path);//
|
||||
if ($GLOBALS['is_root'] == 1){
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$unzip_to,
|
||||
PCLZIP_OPT_SET_CHMOD,0777,
|
||||
PCLZIP_OPT_REPLACE_NEWER);//解压到某个地方,覆盖方式
|
||||
}else{
|
||||
$result = $zip->extract(PCLZIP_OPT_PATH,$unzip_to,
|
||||
PCLZIP_OPT_SET_CHMOD,0777,
|
||||
PCLZIP_CB_PRE_EXTRACT,"checkExtUnzip",
|
||||
PCLZIP_OPT_REPLACE_NEWER);//解压到某个地方,覆盖方式
|
||||
}
|
||||
if ($result == 0) {
|
||||
show_json("Error : ".$zip->errorInfo(true),fasle);
|
||||
}else{
|
||||
|
@ -441,7 +482,7 @@ class explorer extends Controller{
|
|||
$image_md5 = md5($image);
|
||||
$image_thum = $this->config['pic_thumb'].$image_md5.'.png';
|
||||
if (!is_dir($this->config['pic_thumb'])){
|
||||
mkdir($this->config['pic_thumb'],0777);
|
||||
mkdir($this->config['pic_thumb'],"0777");
|
||||
}
|
||||
if (!file_exists($image_thum)){//如果拼装成的url不存在则没有生成过
|
||||
if ($_SESSION['this_path']==$this->config['pic_thumb']){//当前目录则不生成缩略图
|
||||
|
@ -462,28 +503,45 @@ class explorer extends Controller{
|
|||
|
||||
// 远程下载
|
||||
public function serverDownload() {
|
||||
$url = rawurldecode($this->in['url']);
|
||||
$save_path = _DIR($this->in['save_path']);
|
||||
|
||||
$name = get_path_this($url);
|
||||
if (stripos($name,'?')) $name = substr($name,0,stripos($name,'?'));
|
||||
if (!$name) $name = 'index.html';
|
||||
$ext = get_path_ext($name);
|
||||
$ext_arr = explode('|',$GLOBALS['auth']['ext_not_allow']);
|
||||
if (in_array($ext,$ext_arr)){
|
||||
$name .= '.tmp';
|
||||
}
|
||||
$save_path = $save_path.$name;
|
||||
$result = file_download_this($url,$save_path);
|
||||
if ($result == 1){
|
||||
show_json($this->L['download_success'],true,$save_path);
|
||||
}else{
|
||||
if ($result == -1){
|
||||
show_json($this->L['download_error_create'],false);
|
||||
$uuid = 'download_'.$this->in['uuid'];
|
||||
if ($this->in['type'] == 'percent') {//获取下载进度
|
||||
//show_json($_SESSION[$uuid]);
|
||||
if (isset($_SESSION[$uuid])){
|
||||
$info = $_SESSION[$uuid];
|
||||
$result = array(
|
||||
'length' => (int)$info['length'],
|
||||
'size' => (int)filesize($info['path']),
|
||||
'time' => mtime()
|
||||
);
|
||||
show_json($result);
|
||||
}else{
|
||||
show_json($this->L['download_error_exists'],false);
|
||||
show_json('',false);
|
||||
}
|
||||
}
|
||||
|
||||
//下载
|
||||
$save_path = _DIR($this->in['save_path']);
|
||||
if (!is_writeable($save_path)) show_json($this->L['no_permission_write'],false);
|
||||
|
||||
$url = rawurldecode($this->in['url']);
|
||||
$header = url_header($url);
|
||||
if (!$header) show_json($this->L['download_error_exists'],false);
|
||||
|
||||
$save_path = $save_path.urldecode($header['name']);
|
||||
if (checkExt($save_path)!= true) $save_path = checkExt($save_path,true);
|
||||
$save_path = iconv_system($save_path);
|
||||
$save_path = get_filename_auto($save_path);
|
||||
|
||||
session_start();
|
||||
$_SESSION[$uuid] = array('length'=>$header['length'],'path'=>$save_path);
|
||||
session_write_close();
|
||||
|
||||
if (file_download_this($url,$save_path)){
|
||||
$name = get_path_this(iconv_app($save_path));
|
||||
show_json($this->L['download_success'],true,$name);
|
||||
}else{
|
||||
show_json($this->L['download_error_create'],false);
|
||||
}
|
||||
}
|
||||
|
||||
// 远程下载
|
||||
|
@ -497,6 +555,7 @@ class explorer extends Controller{
|
|||
*/
|
||||
public function fileUpload(){
|
||||
$save_path = $this->path;
|
||||
if (!is_writeable($save_path)) show_json('path is not writeable',false);
|
||||
if ($save_path == '') show_json($this->L['upload_error_big'],false);
|
||||
if (strlen($this->in['fullPath']) > 1) {//folder drag upload
|
||||
$full_path = _DIR_CLEAR(rawurldecode($this->in['fullPath']));
|
||||
|
@ -508,15 +567,14 @@ class explorer extends Controller{
|
|||
}
|
||||
upload('file',$save_path);
|
||||
}
|
||||
|
||||
//获取文件列表&哦exe文件json解析
|
||||
private function path($dir,$list_file=true,$check_children=false){
|
||||
$list = path_list($dir,$list_file,$check_children);
|
||||
foreach ($list['filelist'] as $key => $val) {
|
||||
if ($val['ext'] == 'oexe') {
|
||||
foreach ($list['filelist'] as $key => &$val) {
|
||||
if ($val['ext'] == 'oexe'){
|
||||
$path = iconv_system($val['path']).'/'.iconv_system($val['name']);
|
||||
$json = json_decode(file_get_contents($path),true);
|
||||
if(is_array($json)) $list['filelist'][$key] = array_merge($val,$json);
|
||||
if(is_array($json)) $list['filelist'][$key] = array_merge($val,$json);
|
||||
}
|
||||
}
|
||||
_DIR_OUT($list);
|
||||
|
|
|
@ -8,36 +8,20 @@
|
|||
|
||||
class user extends Controller
|
||||
{
|
||||
private $user; //用户相关信息
|
||||
private $user; //用户相关信息
|
||||
private $auth; //用户所属组权限
|
||||
private $notCheck;
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->tpl = TEMPLATE . 'user/';
|
||||
$this->user = &$_SESSION['user'];
|
||||
$this->tpl = TEMPLATE . 'user/';
|
||||
$this->user = &$_SESSION['user'];
|
||||
$this->notCheck = array('loginFirst','loginSubmit','checkCode');//不需要判断的action
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* api方式访问,最高权限
|
||||
*/
|
||||
public function authApi(){
|
||||
if (!REMOTE_OPEN) return;
|
||||
if (isset($_GET['auth_key'])){
|
||||
if(md5(md5($this->in['auth_key'])) == REMOTE_KEY) {
|
||||
session_start();//记录session 写入文件
|
||||
$_SESSION['isLogin'] = true;
|
||||
$this->user['role'] = 'root';
|
||||
|
||||
}else{
|
||||
show_json('error',false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 登陆状态检测;并初始化数据状态
|
||||
*/
|
||||
public function loginCheck(){
|
||||
$this->authApi();//api方式验证
|
||||
public function loginCheck(){
|
||||
if(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true){
|
||||
define('USER',USER_PATH.$this->user['name'].'/');
|
||||
if (!file_exists(USER)) {
|
||||
|
@ -59,7 +43,7 @@ class user extends Controller
|
|||
$this->config['user_seting_file'] = USER.'data/config.php'; //用户配置文件
|
||||
$this->config['user'] = fileCache::load($this->config['user_seting_file']);
|
||||
return;
|
||||
}else if(ACT == 'loginSubmit' || ACT=='checkCode'){//登陆提交判断;或者获取验证码
|
||||
}else if(in_array(ACT,$this->notCheck)){//不需要判断的action
|
||||
return;
|
||||
}else if(isset($_COOKIE['kod_name']) && isset($_COOKIE['kod_token'])){
|
||||
$member = new fileCache($this->config['system_file']['member']);
|
||||
|
@ -71,7 +55,7 @@ class user extends Controller
|
|||
setcookie('kod_name', $_COOKIE['kod_name'], time()+3600*24*365);
|
||||
setcookie('kod_token',$_COOKIE['kod_token'],time()+3600*24*365); //密码的MD5值再次md5
|
||||
header('location:'.get_url());
|
||||
return;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
$this->login();
|
||||
|
@ -81,16 +65,24 @@ class user extends Controller
|
|||
/**
|
||||
* 登陆view
|
||||
*/
|
||||
public function login($msg = ''){
|
||||
if(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true){
|
||||
header('location:./index.php');
|
||||
return;
|
||||
}
|
||||
public function login($msg = ''){
|
||||
if (!file_exists(USER_SYSTEM.'install.lock')) {
|
||||
$this->display('install.html');exit;
|
||||
}
|
||||
$this->assign('msg',$msg);
|
||||
$this->display('login.html');
|
||||
$this->display('login.html');
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 首次登陆
|
||||
*/
|
||||
public function loginFirst(){
|
||||
touch(USER_SYSTEM.'install.lock');
|
||||
header('location:./index.php');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退出处理
|
||||
*/
|
||||
|
@ -102,13 +94,13 @@ class user extends Controller
|
|||
header('location:./index.php?user/login');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 登陆数据提交处理
|
||||
*/
|
||||
public function loginSubmit(){
|
||||
if(!isset($this->in['name']) || !isset($this->in['password'])) {
|
||||
public function loginSubmit(){
|
||||
if(!isset($this->in['name']) || !isset($this->in['password'])) {
|
||||
$msg = $this->L['login_not_null'];
|
||||
}else{
|
||||
}else{
|
||||
//错误三次输入验证码
|
||||
session_start();//re start
|
||||
$name = $this->in['name'];
|
||||
|
@ -138,11 +130,11 @@ class user extends Controller
|
|||
$_SESSION['code_error_time'] = intval($_SESSION['code_error_time']) + 1;
|
||||
$msg = $this->L['password_error'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->login($msg);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
public function changePassword(){
|
||||
|
@ -165,37 +157,30 @@ class user extends Controller
|
|||
*/
|
||||
public function authCheck(){
|
||||
if ($GLOBALS['is_root'] == 1) return;
|
||||
if(ACT == 'loginSubmit' || ACT=='checkCode') return;
|
||||
if (!array_key_exists(ST,$this->config['role_setting']) ){
|
||||
return;
|
||||
}else{
|
||||
if (!in_array(ACT,$this->config['role_setting'][ST])){
|
||||
return;
|
||||
}else{
|
||||
//有权限限制的函数
|
||||
$key = ST.':'.ACT;
|
||||
$group = new fileCache($this->config['system_file']['group']);
|
||||
$GLOBALS['auth'] = $auth = $group->get($this->user['role']);
|
||||
if ($auth[$key] !== 1) {
|
||||
show_json($this->L['no_permission'],false);
|
||||
}
|
||||
//扩展名限制:新建文件&上传文件&重命名文件&保存文件&zip解压文件
|
||||
$check_arr = array(
|
||||
'mkfile' => trim($this->in['path']),
|
||||
'pathRname' => trim($this->in['rname_to']),
|
||||
'fileUpload'=> trim($_FILES['file']['name']),
|
||||
'fileSave' => trim($this->in['path'])
|
||||
);
|
||||
if (array_key_exists(ACT,$check_arr)){
|
||||
$ext = get_path_ext($check_arr[ACT]);
|
||||
$ext_arr = explode('|',$auth['ext_not_allow']);
|
||||
if (in_array($ext,$ext_arr)){
|
||||
show_json($this->L['no_permission_ext'],false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
if (in_array(ACT,$this->notCheck)) return;
|
||||
if (!array_key_exists(ST,$this->config['role_setting']) ) return;
|
||||
if (!in_array(ACT,$this->config['role_setting'][ST])) return;
|
||||
|
||||
//有权限限制的函数
|
||||
$key = ST.':'.ACT;
|
||||
$group = new fileCache($this->config['system_file']['group']);
|
||||
$GLOBALS['auth'] = $auth = $group->get($this->user['role']);
|
||||
|
||||
//默认扩张功能等价权限
|
||||
$auth['explorer:pathChmod'] = $auth['explorer:pathRname'];
|
||||
$auth['explorer:pathCopyDrag'] = $auth['explorer:pathCuteDrag'];
|
||||
if ($auth[$key] !== 1) show_json($this->L['no_permission'],false);
|
||||
|
||||
//扩展名限制:新建文件&上传文件&重命名文件&保存文件&zip解压文件
|
||||
$check_arr = array(
|
||||
'mkfile' => isset($this->in['path'])?$this->in['path']:'',
|
||||
'pathRname' => isset($this->in['rname_to'])?$this->in['rname_to']:'',
|
||||
'fileUpload'=> isset($_FILES['file']['name'])?$_FILES['file']['name']:'',
|
||||
'fileSave' => isset($this->in['path'])?$this->in['path']:''
|
||||
);
|
||||
if (array_key_exists(ACT,$check_arr) && !checkExt($check_arr[ACT])){
|
||||
show_json($this->L['no_permission_ext'],false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,39 +17,61 @@ function _DIR_CLEAR($path){
|
|||
}
|
||||
|
||||
//处理成用户目录,并且不允许相对目录的请求操作
|
||||
function _DIR($path,$pre_path=HOME){
|
||||
function _DIR($path){
|
||||
$path = _DIR_CLEAR(rawurldecode($path));
|
||||
$path = iconv_system($path);
|
||||
if (is_dir($path)) $path.='/';
|
||||
|
||||
//公共目录处理
|
||||
$share_len = strlen(PUBLIC_PATH);
|
||||
if (substr($path,0,$share_len) == PUBLIC_PATH) {
|
||||
$pre_path = '';//如果为共享目录 则不追加普通用户的目录前缀
|
||||
if (substr($path,0,strlen(PUBLIC_PATH)) == PUBLIC_PATH) {
|
||||
return $path;
|
||||
}
|
||||
return $pre_path.$path;
|
||||
return HOME.$path;
|
||||
}
|
||||
|
||||
//处理成用户目录,并且不允许相对目录的请求操作
|
||||
function _DIR_OUT(&$arr,$pre_path=HOME){
|
||||
//处理成用户目录输出
|
||||
function _DIR_OUT(&$arr){
|
||||
if ($GLOBALS['is_root']) return;
|
||||
|
||||
//公共目录处理
|
||||
if (substr($path,0,$share_len) == PUBLIC_PATH) {
|
||||
$pre_path = '';//如果为共享目录 则不追加普通用户的目录前缀
|
||||
}
|
||||
if (is_array($arr)) {
|
||||
foreach ($arr['filelist'] as $key => $value) {
|
||||
//$arr['filelist'][$key]['path'] = '/'.str_replace($pre_path, '', $value['path']);
|
||||
$arr['filelist'][$key]['path'] = str_replace($pre_path, '', $value['path']);
|
||||
$arr['filelist'][$key]['path'] = pre_clear($value['path']);
|
||||
}
|
||||
foreach ($arr['folderlist'] as $key => $value) {
|
||||
$arr['folderlist'][$key]['path'] = str_replace($pre_path, '', $value['path']);
|
||||
}
|
||||
$arr['folderlist'][$key]['path'] = pre_clear($value['path']);
|
||||
}
|
||||
}else{
|
||||
$arr = str_replace($pre_path, '',$arr);
|
||||
$arr = pre_clear($arr);
|
||||
}
|
||||
}
|
||||
//前缀处理 非root用户目录/从HOME开始
|
||||
function pre_clear($path){
|
||||
if (substr($path,0,strlen(PUBLIC_PATH)) == PUBLIC_PATH) {
|
||||
return $path;
|
||||
}
|
||||
return str_replace(HOME, '', $path);
|
||||
}
|
||||
|
||||
//扩展名权限判断
|
||||
function checkExtUnzip($s,$info){
|
||||
return checkExt($info['stored_filename']);
|
||||
}
|
||||
//扩展名权限判断 有权限则返回true
|
||||
function checkExt($file,$changExt=false){
|
||||
if ($GLOBALS['is_root'] == 1) return true;
|
||||
if ($file=='') return false;
|
||||
$not_allow = $GLOBALS['auth']['ext_not_allow'];
|
||||
$file = rawurldecode($file);
|
||||
$ext_arr = explode('|',$not_allow);
|
||||
foreach ($ext_arr as $current) {
|
||||
if (stripos($file,'.'.$current) !== false){//含有扩展名
|
||||
if ($changExt === false) {
|
||||
return false;
|
||||
}else{
|
||||
return str_replace($ext, 'tmp', $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//语言包加载:优先级:cookie获取>自动识别
|
||||
//首次没有cookie则自动识别——存入cookie,过期时间无限
|
||||
|
|
|
@ -1 +1 @@
|
|||
<?php exit;?>{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"9","musictheme":"qqmusic","movietheme":"webplayer"}
|
||||
<?php exit;?>{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"2","musictheme":"qqmusic","movietheme":"webplayer"}
|
|
@ -1 +1 @@
|
|||
<?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\/"}}
|
||||
<?php exit;?>{"kod":{"name":"kod","path":"D:\/WWW\/www\/kod"},"0.000":{"name":"0.000","path":"D:\/WWW\/0.000\/"},"001":{"name":"001","path":"D:\/WWW\/www\/kod\/dev\/data\/User\/admin\/home\/001"}}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/baidu365.duapp.com\/wnl.html?bd_user=855814346&bd_sig=a64e6e262e8cfa1c42dd716617be2102&canvas_pos=platform","icon":"365.png","width":"544","height":"440","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/www.qiyi.com\/mini\/baidu.html?from115","icon":"iqiyi.png","width":"1000","height":"643","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/compress.cdn.duapp.com\/","icon":"js.png","width":"510","height":"380","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/bellard.org\/jslinux\/","icon":"linux.png","width":"803","height":"546","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/app.aplus.pptv.com\/tgapp\/baidu\/live\/main","icon":"pptv.jpg","width":"798","height":"534","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/www.webps.cn\/editor\/Editor.swf","icon":"ps.png","width":"800","height":"560","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/y.qq.com\/player","icon":"qqmusic.png","width":"800","height":"520","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/sz.chachaba.com\/api20110914.html","icon":"map.png","width":"800","height":"600","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/apps2.bdimg.com\/store\/static\/kvt\/bbf372221c50a9aaa35a35ea6ee7c922.swf","icon":"xiangqi.jpg","width":"650","height":"502","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/baidu.html.zcom.com\/chuangyebang\/","icon":"chuangyebang.jpg","width":"545","height":"440","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/tv.e1951.com\/tv\/index.htm","icon":"app_s2.png","width":"800","height":"600","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/www.haozhaopian.com\/flash\/","icon":"haozhaopian.jpg","width":"775","height":"650","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/baidu.kuaidi100.com\/index2.html","icon":"kuaidi.gif","width":"538","height":"418","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/tv.sohu.com\/upload\/sohuapp\/index.html?api_key=9ca7e3cdef8af010b947f4934a427a2c","icon":"souhu.jpg","width":"798","height":"583","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/hoorayos.com\/demo\/extapp\/clock\/index.php","icon":"time.png","width":"140","height":"140","simple":1,"resize":0}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/dict.youdao.com\/app\/baidu","icon":"youdao.jpg","width":"548","height":"490","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/www.youban.com\/bdapp\/mp3\/geling.html","icon":"geling.jpg","width":"728","height":"520","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/apps.bdimg.com\/tools\/popcap\/plantsvszombies\/game.html","icon":"zhiwu.jpg","width":"538","height":"404","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/ucren.com\/demos\/fruit-ninja\/","icon":"fruite.jpg","width":"640","height":"565","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/xiuxiu.web.meitu.com\/baidu\/","icon":"meitu.gif","width":"800","height":"570","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/home.meishichina.com\/app2baidu.php","icon":"meishi.png","width":"547","height":"590","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/kuang.xiami.com\/kuang\/play\/xiamiradio","icon":"xiami.jpg","width":"530","height":"282","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/apps2.bdimg.com\/store\/static\/kvt\/3e9b470e8b9fceaa66d46a935b45518e.swf","icon":"calcu.png","width":"538","height":"600","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/douban.fm\/partner\/qq_plus","icon":"douban.png","width":"545","height":"460","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/topic.kugou.com\/radio\/baiduNew.htm","icon":"kugou_radio.png","width":"554","height":"432","simple":0,"resize":1}
|
|
@ -0,0 +1 @@
|
|||
{"type":"url","content":"http:\/\/www.yinyuetai.com\/baidu\/index?bd_user=855814346&bd_sig=cac8830f2b6a731ab596413768b4606b&canvas_pos=platform","icon":"yingyuetai.png","width":"798","height":"450","simple":0,"resize":1}
|
Before Width: | Height: | Size: 1.9 KiB |
|
@ -21,7 +21,8 @@ $L = array(
|
|||
"password_not_null" => "password cant't empty!",
|
||||
"old_password_error" => "old password error!",
|
||||
"permission" => "permission",
|
||||
"no_permission" => "no permission!",
|
||||
"permission_edit" => "Permission Edit",
|
||||
"no_permission" => "User without permission!",
|
||||
"no_permission_ext" => "This type of file without permission",
|
||||
"dialog_min" => "hide",
|
||||
"dialog_min_all" => "hide all",
|
||||
|
@ -101,7 +102,6 @@ $L = array(
|
|||
"unziping" => "unzip loading...",
|
||||
"moving" => "move file",
|
||||
"remove_title" => "delete confirmation",
|
||||
"remove_not" => "system folder,cannot be deleted",
|
||||
"remove_info" => "confirmation remove the selected?",
|
||||
"name_isexists" => "wrong,the name already exists! ",
|
||||
|
||||
|
@ -175,8 +175,9 @@ $L = array(
|
|||
"download_address" => "url ",
|
||||
"download_ready" => "download start",
|
||||
"download_success" => "download success! ",
|
||||
"download_error_create" => "download failed! create a new file or write error. ",
|
||||
"download_error_exists" => "download failed! remote file does not exist or failed to open.",
|
||||
"download_error" => "Download_error.",
|
||||
"download_error_create" => "Create file error.",
|
||||
"download_error_exists" => "File does not exist.",
|
||||
"upload_error_null" => "no files!",
|
||||
"upload_error_big" => "file size too big",
|
||||
"upload_error_move" => "move file failed! ",
|
||||
|
|
|
@ -22,8 +22,9 @@ $L= array(
|
|||
"password_not_null" => "密码不能为空!",
|
||||
"old_password_error" => "原密码错误!",
|
||||
"permission" => "权限!",
|
||||
"no_permission" => "没有权限!",
|
||||
"no_permission_ext" => "该类型文件没有权限",
|
||||
"permission_edit" => "修改权限",
|
||||
"no_permission" => "您没有此权限!",
|
||||
"no_permission_ext" => "您没有该类型文件权限",
|
||||
"dialog_min" => "最小化",
|
||||
"dialog_min_all" => "最小化所有",
|
||||
"dialog_display_all" => "显示所有窗口",
|
||||
|
@ -103,8 +104,7 @@ $L= array(
|
|||
"unziping" => "正在解压...",
|
||||
"moving" => "移动操作中...",
|
||||
"remove_title" => "删除确认",
|
||||
"remove_not" => "系统文件夹,不能删除",
|
||||
"remove_info" => "确认将选中内容移至回收站吗?",
|
||||
"remove_info" => "确认删除选中内容吗?",
|
||||
"name_isexists" => "出错了,该名称已存在!",
|
||||
|
||||
"install" => '安装',
|
||||
|
@ -175,10 +175,11 @@ $L= array(
|
|||
"path_not_allow" => "文件名不允许出现",
|
||||
"download" => "下载",
|
||||
"download_address" => "下载地址",
|
||||
"download_ready" => "即将开始下载",
|
||||
"download_ready" => "即将下载",
|
||||
"download_success" => "下载成功!",
|
||||
"download_error_create" => "下载失败!新建文件或写入出错。",
|
||||
"download_error_exists" => "下载失败!远程文件不存 或打开失败。",
|
||||
"download_error" => "下载失败!",
|
||||
"download_error_create" => "写入出错!",
|
||||
"download_error_exists" => "远程文件不存在!",
|
||||
"upload_error_null" => "没有文件!",
|
||||
"upload_error_big" => "文件大小超过服务器限制",
|
||||
"upload_error_move" => "移动文件失败!",
|
||||
|
@ -319,7 +320,7 @@ $L= array(
|
|||
"copy_success" => "【复制】—— 覆盖剪贴板成功!",
|
||||
"cute_success" => "【剪切】—— 覆盖剪贴板成功!",
|
||||
"clipboard_state" => "剪切板状态:",
|
||||
"no_permission_write" => "不能写入,检查路径或权限",
|
||||
"no_permission_write" => "该文件或目录没有写权限",
|
||||
"copy_not_exists" => "来源不存在",
|
||||
"current_has_parent" => "目标文件夹是源文件夹的子文件夹!",
|
||||
"past_success" => "<b>粘贴操作完成</b>",
|
||||
|
|
|
@ -22,8 +22,9 @@ $L= array(
|
|||
"password_not_null" => "密碼不能為空!",
|
||||
"old_password_error" => "原密碼錯誤!",
|
||||
"permission" => "許可權!",
|
||||
"no_permission" => "沒有許可權!",
|
||||
"no_permission_ext" => "該類型檔沒有許可權",
|
||||
"permission_edit" => "修改权限",
|
||||
"no_permission" => "您没有此权限!",
|
||||
"no_permission_ext" => "您没有该类型文件权限",
|
||||
"dialog_min" => "最小化",
|
||||
"dialog_min_all" => "最小化所有",
|
||||
"dialog_display_all" => "显示所有窗口",
|
||||
|
@ -103,8 +104,7 @@ $L= array(
|
|||
"unziping" => "正在解壓...",
|
||||
"moving" => "移動操作中...",
|
||||
"remove_title" => "刪除確認",
|
||||
"remove_not" => "系統檔夾,不能刪除",
|
||||
"remove_info" => "確認將選中內容移至回收站嗎?",
|
||||
"remove_info" => "确认删除选中内容吗?",
|
||||
"name_isexists" => "出錯了,該名稱已存在!",
|
||||
|
||||
"install" => '安裝',
|
||||
|
@ -175,10 +175,11 @@ $L= array(
|
|||
"path_not_allow" => "檔案名不允許出現",
|
||||
"download" => "下載",
|
||||
"download_address" => "下載地址",
|
||||
"download_ready" => "即將開始下載",
|
||||
"download_ready" => "即將下載",
|
||||
"download_success" => "下載成功!",
|
||||
"download_error_create" => "下載失敗!新建檔或寫入出錯。",
|
||||
"download_error_exists" => "下載失敗!遠程檔不存 或打開失敗。",
|
||||
"download_error" => "下载失败!",
|
||||
"download_error_create" => "寫入出錯!",
|
||||
"download_error_exists" => "遠程檔不存!",
|
||||
"upload_error_null" => "沒有檔!",
|
||||
"upload_error_big" => "檔大小超過伺服器限制",
|
||||
"upload_error_move" => "移動檔失敗!",
|
||||
|
@ -319,7 +320,7 @@ $L= array(
|
|||
"copy_success" => "【複製】—— 覆蓋剪貼板成功!",
|
||||
"cute_success" => "【剪切】—— 覆蓋剪貼板成功!",
|
||||
"clipboard_state" => "剪切板狀態:",
|
||||
"no_permission_write" => "不能寫入,檢查路徑或許可權",
|
||||
"no_permission_write" => "该文件或目录没有写权限",
|
||||
"copy_not_exists" => "來源不存在",
|
||||
"current_has_parent" => "目標檔夾是原始檔案夾的子檔夾!",
|
||||
"past_success" => "<b>粘貼操作完成</b>",
|
||||
|
|
|
@ -1 +1 @@
|
|||
<?php exit;?>{"root":{"role":"root","name":"Administrator","path":"","ext_not_allow":""},"default":{"role":"default","name":"default","ext_not_allow":"php|asp|jsp","explorer:mkdir":1,"explorer:mkfile":1,"explorer:pathRname":1,"explorer:pathDelete":1,"explorer:zip":1,"explorer:unzip":1,"explorer:pathCopy":1,"explorer:pathCute":1,"explorer:pathCuteDrag":1,"explorer:clipboard":1,"explorer:pathPast":1,"explorer:pathInfo":1,"explorer:pathInfoMuti":1,"explorer:serverDownload":1,"explorer:fileUpload":1,"explorer:search":1,"app:user_app":1,"editor:fileSave":1},"guest":{"role":"guest","name":"guest","ext_not_allow":"php|asp|jsp"}}
|
||||
<?php exit;?>{"root":{"role":"root","name":"Administrator","path":"","ext_not_allow":""},"guest":{"role":"guest","name":"guest","ext_not_allow":"php|asp|jsp"},"default":{"role":"default","name":"default","ext_not_allow":"php|asp|jsp","explorer:mkdir":1,"explorer:mkfile":1,"explorer:pathDelete":1,"explorer:zip":1,"explorer:unzip":1,"explorer:pathInfo":1,"explorer:serverDownload":1,"explorer:fileUpload":1,"explorer:search":1,"app:user_app":1,"editor:fileSave":1}}
|
|
@ -101,50 +101,45 @@ function get_path_father($path){
|
|||
$path = str_replace('\\','/', rtrim(trim($path),'/'));
|
||||
return substr($path, 0, strrpos($path,'/')+1);
|
||||
}
|
||||
/**
|
||||
* 获取扩展名
|
||||
*/
|
||||
function get_path_ext($path){
|
||||
$name = get_path_this($path);
|
||||
if(strstr($name,'.')){
|
||||
$ext = substr($name,strrpos($name,'.')+1);
|
||||
return strtolower($ext);
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
//自动获取不重复文件(夹)名
|
||||
function get_filename_auto($path){
|
||||
$i=1;$dot_index = strrpos($path,'.');
|
||||
$file_pre = substr($path,0,$dot_index);
|
||||
$file_ext = substr($path,$dot_index);
|
||||
$i=1;
|
||||
$father = get_path_father($path);
|
||||
$name = get_path_this($path);
|
||||
$ext = get_path_ext($name);
|
||||
if (strlen($ext)>0) {
|
||||
$ext='.'.$ext;
|
||||
$name = substr($name,0,strlen($name)-strlen($ext));
|
||||
}
|
||||
while(file_exists($path)){
|
||||
$path = $file_pre.'('.$i.')'.$file_ext;
|
||||
$path = $father.$name.'('.$i.')'.$ext;
|
||||
$i++;
|
||||
}
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取扩展名
|
||||
* 判断文件夹是否可写
|
||||
*/
|
||||
function get_path_ext($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;
|
||||
function path_writable($path) {
|
||||
$file = $path.'/test'.time().'.txt';
|
||||
$dir = $path.'/test'.time();
|
||||
if(@is_writable($path) && @touch($file) && @unlink($file)) return true;
|
||||
if(@mkdir($dir,0777) && @rmdir($dir)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -177,7 +172,7 @@ function path_check($path){
|
|||
*/
|
||||
function _path_info_more($dir, &$file_num = 0, &$path_num = 0, &$size = 0){
|
||||
if (!$dh = opendir($dir)) return false;
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir . "/" . $file;
|
||||
if (!is_dir($fullpath)) {
|
||||
|
@ -201,7 +196,14 @@ function _path_info_more($dir, &$file_num = 0, &$path_num = 0, &$size = 0){
|
|||
/**
|
||||
* 获取多选文件信息,包含子文件夹数量,文件数量,总大小,父目录权限
|
||||
*/
|
||||
function path_info_muti($list){
|
||||
function path_info_muti($list,$time_type){
|
||||
if (count($list) == 1) {
|
||||
if ($list[0]['type']=="folder"){
|
||||
return path_info($list[0]['path'],$time_type);
|
||||
}else{
|
||||
return file_info($list[0]['path'],$time_type);
|
||||
}
|
||||
}
|
||||
$pathinfo = array(
|
||||
'file_num' => 0,
|
||||
'folder_num' => 0,
|
||||
|
@ -210,7 +212,7 @@ function path_info_muti($list){
|
|||
'father_name' => '',
|
||||
'mod' => ''
|
||||
);
|
||||
foreach ($list as $val) {
|
||||
foreach ($list as $val){
|
||||
if ($val['type'] == 'folder') {
|
||||
$pathinfo['folder_num'] ++;
|
||||
$temp = path_info($val['path']);
|
||||
|
@ -235,10 +237,11 @@ function path_info_muti($list){
|
|||
*/
|
||||
function path_list($dir,$list_file=true,$check_children=false){
|
||||
$dir = rtrim($dir,'/').'/';
|
||||
if (!is_dir($dir)) return array('folderlist'=>array(),'filelist'=>array());
|
||||
$dh = opendir($dir);
|
||||
if (!is_dir($dir) || !($dh = opendir($dir))){
|
||||
return array('folderlist'=>array(),'filelist'=>array());
|
||||
}
|
||||
$folderlist = array();$filelist = array();//文件夹与文件
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != ".." && $file != ".svn" ) {
|
||||
$fullpath = $dir . $file;
|
||||
if (is_dir($fullpath)) {
|
||||
|
@ -262,7 +265,7 @@ function path_list($dir,$list_file=true,$check_children=false){
|
|||
function path_haschildren($dir,$check_file=false){
|
||||
$dir = rtrim($dir,'/').'/';
|
||||
if (!$dh = @opendir($dir)) return false;
|
||||
while (false !== ($file = readdir($dh))){
|
||||
while (($file = readdir($dh)) !== false){
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir.$file;
|
||||
if ($check_file) {//有子目录或者文件都说明有子内容
|
||||
|
@ -295,7 +298,7 @@ function del_file($fullpath){
|
|||
*/
|
||||
function del_dir($dir){
|
||||
if (!$dh = opendir($dir)) return false;
|
||||
while (false !== ($file = readdir($dh))) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir . '/' . $file;
|
||||
if (!is_dir($fullpath)) {
|
||||
|
@ -312,7 +315,7 @@ function del_dir($dir){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
if (rmdir($dir)) {
|
||||
return true;
|
||||
|
@ -342,16 +345,16 @@ function copy_dir($source, $dest){
|
|||
$__dest = $dest;
|
||||
}
|
||||
$result = copy($source, $__dest);
|
||||
chmod($__dest, 0755);
|
||||
chmod($__dest, 0777);
|
||||
}elseif (is_dir($source)) {
|
||||
if ($dest[strlen($dest)-1] == '/') {
|
||||
$dest = $dest . basename($source);
|
||||
mkdir($dest, 0755);
|
||||
mkdir($dest, 0777);
|
||||
} else {
|
||||
mkdir($dest, 0755);
|
||||
}
|
||||
$dirHandle = opendir($source);
|
||||
while (false !== ($file = readdir($dirHandle))) {
|
||||
mkdir($dest, 0777);
|
||||
}
|
||||
if (!$dh = opendir($source)) return false;
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
if (!is_dir($source . "/" . $file)) {
|
||||
$__dest = $dest . "/" . $file;
|
||||
|
@ -361,7 +364,7 @@ function copy_dir($source, $dest){
|
|||
$result = copy_dir($source . "/" . $file, $__dest);
|
||||
}
|
||||
}
|
||||
closedir($dirHandle);
|
||||
closedir($dh);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
@ -377,7 +380,7 @@ function mk_dir($dir, $mode = 0777){
|
|||
if (is_dir($dir) || mkdir($dir, $mode))
|
||||
return true;
|
||||
if (!mk_dir(dirname($dir), $mode))
|
||||
return false;
|
||||
return false;
|
||||
return mkdir($dir, $mode);
|
||||
}
|
||||
|
||||
|
@ -390,8 +393,8 @@ function recursion_dir($path,&$dir,&$file,$deepest=-1,$deep=0){
|
|||
$path = rtrim($path,'/').'/';
|
||||
if (!is_array($file)) $file=array();
|
||||
if (!is_array($dir)) $dir=array();
|
||||
$handle=opendir($path);
|
||||
while(($val=readdir($handle)) !== false){
|
||||
if (!$dh = opendir($path)) return false;
|
||||
while(($val=readdir($dh)) !== false){
|
||||
if ($val=='.' || $val=='..') continue;
|
||||
$value = strval($path.$val);
|
||||
if (is_file($value)){
|
||||
|
@ -403,7 +406,7 @@ function recursion_dir($path,&$dir,&$file,$deepest=-1,$deep=0){
|
|||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
closedir($dh);
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
|
@ -450,6 +453,26 @@ function path_search($path,$search,$is_content=false,$file_ext='',$is_case=false
|
|||
return array('folderlist' => $folderlist,'filelist' => $filelist);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件、文件夹权限
|
||||
* @param $path 文件(夹)目录
|
||||
* @return :string
|
||||
*/
|
||||
function chmod_path($path,$mod){
|
||||
$mod = 0777;//
|
||||
if (!isset($mod)) $mod = 0777;
|
||||
if (!is_dir($path)) return chmod($path,$mod);
|
||||
if (!$dh = opendir($path)) return false;
|
||||
while (($file = readdir($dh)) !== false){
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $path . '/' . $file;
|
||||
return chmod_path($fullpath,$mod);
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
return chmod($path,$mod);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件大小格式化
|
||||
*
|
||||
|
@ -517,62 +540,62 @@ function ext_type($ext){
|
|||
* 文件下载
|
||||
*/
|
||||
function file_download($file){
|
||||
if (file_exists($file)) {
|
||||
header("Cache-Control: public");
|
||||
header("Content-Type: application/octet-stream");
|
||||
header("Content-Disposition: attachment;filename=".get_path_this($file));
|
||||
header("Accept-Ranges: bytes");
|
||||
$size = filesize($file);
|
||||
//如果有$_SERVER['HTTP_RANGE']参数 断点续传
|
||||
if (isset ($_SERVER['HTTP_RANGE'])) {
|
||||
list ($a, $range) = explode("=", $_SERVER['HTTP_RANGE']);
|
||||
str_replace($range, "-", $range);
|
||||
$size2 = $size -1; //文件总字节数
|
||||
$new_length = $size2 - $range; //获取下次下载的长度
|
||||
header("HTTP/1.1 206 Partial Content");
|
||||
header("Content-Length: $new_length"); //输入总长
|
||||
header("Content-Range: bytes $range$size2/$size");
|
||||
}else{//第一次连接
|
||||
$size2 = $size -1;
|
||||
header("Content-Range: bytes 0-$size2/$size"); //Content-Range: bytes 0-4988927/4988928
|
||||
header("Content-Length: " . $size); //输出总长
|
||||
}
|
||||
$fp = fopen($file, "rb");
|
||||
fseek($fp, $range);
|
||||
while (!feof($fp)) {
|
||||
set_time_limit(0);
|
||||
print (fread($fp, 1024 * 8)); //输出文件
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
fclose($fp);
|
||||
exit ();
|
||||
}
|
||||
if (!file_exists($file)) show_json('file not exists');
|
||||
if (isset($_SERVER['HTTP_RANGE']) && ($_SERVER['HTTP_RANGE'] != "") &&
|
||||
preg_match("/^bytes=([0-9]+)-$/i", $_SERVER['HTTP_RANGE'], $match) && ($match[1] < $fsize)) {
|
||||
$start = $match[1];
|
||||
}else{
|
||||
$start = 0;
|
||||
}
|
||||
|
||||
$size = filesize($file);
|
||||
header("Cache-Control: public");
|
||||
header("Content-Type: application/octet-stream");
|
||||
$filename = get_path_this($file);//解决在IE中下载时中文乱码问题
|
||||
if(preg_match('/MSIE/',$_SERVER['HTTP_USER_AGENT'])){
|
||||
$filename = str_replace('+','%20',urlencode($filename));
|
||||
}
|
||||
header("Content-Disposition: attachment;filename=".get_path_this($file));
|
||||
|
||||
if ($start > 0) {
|
||||
header("HTTP/1.1 206 Partial Content");
|
||||
header("Content-Length: " . ($size - $start));
|
||||
header("Content-Ranges: bytes".$start ."-".($size - 1)."/" .$size);
|
||||
}else{
|
||||
header("Content-Length: $size");
|
||||
header("Accept-Ranges: bytes");
|
||||
}
|
||||
|
||||
$fp = fopen($file, "rb");
|
||||
fseek($fp, $start);
|
||||
while (!feof($fp)) {
|
||||
set_time_limit(0);
|
||||
print (fread($fp, 1024 * 8)); //输出文件
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
fclose($fp);
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件代理输出
|
||||
*/
|
||||
function file_proxy_out($file){
|
||||
if (file_exists($file)) {
|
||||
$mime = get_file_mime(get_path_ext($file));
|
||||
header("Cache-Control:public");
|
||||
header("Content-Type:".$mime);
|
||||
$size = filesize($file);
|
||||
header("Content-Length: " . $size); //输出总长
|
||||
$fp = fopen($file, "rb");
|
||||
fseek($fp, $range);
|
||||
while (!feof($fp)) {
|
||||
set_time_limit(0);
|
||||
print (fread($fp, 1024 * 8)); //输出文件
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
fclose($fp);
|
||||
exit;
|
||||
}else{
|
||||
show_json('file not exists',false);
|
||||
if (!file_exists($file)) show_json('file not exists',false);
|
||||
$mime = get_file_mime(get_path_ext($file));
|
||||
header("Cache-Control:public");
|
||||
header("Content-Type:".$mime);
|
||||
header("Content-Length: ".filesize($file)); //输出总长
|
||||
$fp = fopen($file, "rb");
|
||||
set_time_limit(0);
|
||||
while (!feof($fp)) {
|
||||
print (fread($fp, 1024 * 8)); //输出文件
|
||||
flush();
|
||||
ob_flush();
|
||||
}
|
||||
fclose($fp);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
@ -583,17 +606,13 @@ function file_download_this($from, $file_name){
|
|||
$fp = @fopen ($from, "rb");
|
||||
if ($fp){
|
||||
$new_fp = @fopen ($file_name, "wb");
|
||||
if ($new_fp){
|
||||
while(!feof($fp)){
|
||||
fwrite($new_fp, fread($fp, 1024 * 8 ), 1024 * 8 );
|
||||
}
|
||||
}else{
|
||||
return -1;
|
||||
while(!feof($fp)){
|
||||
fwrite($new_fp, fread($fp, 1024 * 8 ), 1024 * 8);
|
||||
}
|
||||
return true;
|
||||
}else{
|
||||
return -2;
|
||||
}
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -650,18 +669,16 @@ function get_post_max(){
|
|||
*/
|
||||
function upload($fileInput, $path = './'){
|
||||
global $config,$L;
|
||||
if (!isset($_FILES[$fileInput])) show_json($L['upload_error_null'],false);
|
||||
|
||||
$file = $_FILES[$fileInput];
|
||||
if (!isset($file)) show_json($L['upload_error_null'],false);
|
||||
|
||||
$file_name = iconv_system($file['name']);
|
||||
$info = _upload($file['tmp_name'],$file['size'],$path.$file_name);
|
||||
show_json($info['data'],$info['code']);
|
||||
show_json($info['data'],$info['code'],$info['path']);
|
||||
}
|
||||
function _upload($tmp_name,$size,$save_path){
|
||||
global $L;
|
||||
if(file_exists($save_path)){
|
||||
return array('code'=>false,'data'=>$L['upload_error_exists']);
|
||||
}
|
||||
$save_path = get_filename_auto($save_path);
|
||||
if(move_uploaded_file($tmp_name,$save_path)){
|
||||
return array('code'=>true,'data'=>$L['upload_success'],'path'=>$save_path);
|
||||
}else {
|
||||
|
@ -681,7 +698,7 @@ function write_log($log, $type = 'default', $level = 'log'){
|
|||
$now_day = date('Y_m_d');
|
||||
// 根据类型设置日志目标位置
|
||||
$target = LOG_PATH . strtolower($type) . '/';
|
||||
mk_dir($target, 0755);
|
||||
mk_dir($target, 0777);
|
||||
if (! is_writable($target)) exit('path can not write!');
|
||||
switch($level){// 分级写日志
|
||||
case 'error': $target .= 'Error_' . $now_day . '.log';break;
|
||||
|
|
|
@ -36,12 +36,45 @@ function get_client_ip($b_ip = true){
|
|||
}
|
||||
|
||||
|
||||
// url头部数据
|
||||
function url_header($url){
|
||||
$name = '';$length=0;
|
||||
$header = @get_headers($url,true);
|
||||
if (!$header) return false;
|
||||
|
||||
if(isset($header['Content-Length'])){
|
||||
if(is_array($header['Content-Length'])){
|
||||
$length = array_pop($header['Content-Length']);
|
||||
}else{
|
||||
$length = $header['Content-Length'];
|
||||
}
|
||||
}
|
||||
if(isset($header['Content-Disposition'])){
|
||||
if(is_array($header['Content-Disposition'])){
|
||||
$dis = array_pop($header['Content-Disposition']);
|
||||
}else{
|
||||
$dis = $header['Content-Disposition'];
|
||||
}
|
||||
$i = strpos($dis,"filename=");
|
||||
if($i!= false){
|
||||
$name = substr($dis,$i+9);
|
||||
$name = trim($name,'"');
|
||||
}
|
||||
}
|
||||
if(!$name){
|
||||
$name = get_path_this($url);
|
||||
if (stripos($name,'?')) $name = substr($name,0,stripos($name,'?'));
|
||||
if (!$name) $name = 'index.html';
|
||||
}
|
||||
// $header['name'] = $name;
|
||||
// return $header;
|
||||
return array('length'=>$length,'name'=>$name);
|
||||
}
|
||||
|
||||
|
||||
// url检查
|
||||
function check_url($url){
|
||||
$array = get_headers($url, 1);
|
||||
$array = get_headers($url,true);
|
||||
if (preg_match('/404/', $array[0])) {
|
||||
return false;
|
||||
} elseif (preg_match('/403/', $array[0])) {
|
||||
|
@ -56,7 +89,7 @@ function check_url($url){
|
|||
*/
|
||||
function curl_get_contents($url){
|
||||
$ch = curl_init();
|
||||
$timeout = 5;
|
||||
$timeout = 4;
|
||||
$user_agent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1)";
|
||||
curl_setopt ($ch, CURLOPT_URL, $url);
|
||||
curl_setopt ($ch, CURLOPT_HEADER, 0);
|
||||
|
|
Before Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 669 B |
After Width: | Height: | Size: 728 B |
After Width: | Height: | Size: 433 B |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
|
@ -29,12 +29,14 @@ define(function(require, exports) {
|
|||
|
||||
// 创建播放器;动态获取皮肤以及对应大小尺寸
|
||||
var _create = function(player){
|
||||
var playerSkin,playerTitle,resize;
|
||||
var playerSkin,playerTitle,resize,ico;
|
||||
if (player == 'music_player') {
|
||||
ico=core.ico('mp3');
|
||||
playerSkin = _skin[G.musictheme];
|
||||
playerTitle= 'music player';
|
||||
resize = false;
|
||||
}else {
|
||||
ico=core.ico('flv');
|
||||
playerSkin = _skin[G.movietheme];
|
||||
playerTitle= 'movie player';
|
||||
resize = true;
|
||||
|
@ -44,6 +46,7 @@ define(function(require, exports) {
|
|||
var playerDialog = {
|
||||
id:player+'_dialog',
|
||||
simple:true,
|
||||
ico:ico,
|
||||
title:playerTitle,
|
||||
width:playerSkin.width,
|
||||
height:playerSkin.height,
|
||||
|
|
|
@ -14,6 +14,17 @@ define(function(require, exports) {
|
|||
'bindary':['pdf','bin','zip','swf','gzip','rar','arj','tar','gz','cab','tbz','tbz2','lzh','uue','bz2'
|
||||
,'ace','exe','so','dll','chm','rtf','odp','odt','pages','class','psd','ttf']
|
||||
},
|
||||
ico:function(type){
|
||||
var path = G.static_path + 'images/file_16/';
|
||||
var arr=['folder','file','edit','search','up','setting','appStore','error','info',
|
||||
'mp3','flv','pdf','doc','xls','ppt','html','swf'];
|
||||
var index = $.inArray(type,arr);
|
||||
if (index == -1) {
|
||||
return path+'file.png';
|
||||
}else{
|
||||
return path+type+'.png';
|
||||
}
|
||||
},
|
||||
contextmenu:function(event){
|
||||
rightMenu.hidden();
|
||||
var e = event || window.event;
|
||||
|
@ -73,7 +84,7 @@ define(function(require, exports) {
|
|||
ajaxError:function(XMLHttpRequest, textStatus, errorThrown){
|
||||
core.tips.close(LNG.system_error,false);
|
||||
var response = XMLHttpRequest.responseText;
|
||||
var error = '<div style="color:#f60;">'+response+'</div>';
|
||||
var error = '<div class="ajaxError">'+response+'</div>';
|
||||
var dialog = $.dialog.list['ajaxErrorDialog'];
|
||||
|
||||
//已经退出
|
||||
|
@ -87,11 +98,11 @@ define(function(require, exports) {
|
|||
}else{
|
||||
$.dialog({
|
||||
id:'ajaxErrorDialog',
|
||||
padding:0,
|
||||
fixed:true,
|
||||
resize:true,
|
||||
ico:core.ico('error'),
|
||||
title:'ajax error',
|
||||
width:450,
|
||||
height:200,
|
||||
content:error
|
||||
});
|
||||
}
|
||||
|
@ -103,6 +114,7 @@ define(function(require, exports) {
|
|||
$.dialog.open('./index.php?setting#'+setting,{
|
||||
id:'setting_mode',
|
||||
fixed:true,
|
||||
ico:core.ico('setting'),
|
||||
resize:true,
|
||||
title:LNG.setting,
|
||||
width:960,
|
||||
|
@ -117,6 +129,7 @@ define(function(require, exports) {
|
|||
$.dialog.open('./index.php?app',{
|
||||
id:'app_store',
|
||||
fixed:true,
|
||||
ico:core.ico('appStore'),
|
||||
resize:true,
|
||||
title:LNG.app_store,
|
||||
width:800,
|
||||
|
@ -125,6 +138,10 @@ define(function(require, exports) {
|
|||
},
|
||||
openApp:function(app){
|
||||
if (app.type == 'url') {
|
||||
var icon = app.icon;
|
||||
if (app.icon.search(G.static_path)==-1 && app.icon.substring(0,4) !='http') {
|
||||
icon = G.static_path + 'images/app/' + app.icon;
|
||||
}
|
||||
//高宽css px或者*%
|
||||
if (typeof(app.width)!='number'
|
||||
&& app.width.search('%') == -1){app.width = parseInt(app.width);}
|
||||
|
@ -133,6 +150,7 @@ define(function(require, exports) {
|
|||
$.dialog.open(app.content,{
|
||||
title:app.name,
|
||||
fixed:true,
|
||||
ico:icon,
|
||||
resize:app.resize,
|
||||
simple:app.simple,
|
||||
title:app.name.replace('.oexe',''),
|
||||
|
@ -156,6 +174,7 @@ define(function(require, exports) {
|
|||
if (path == undefined) path = '';
|
||||
$.dialog.open('?/explorer&type=iframe&path='+path,{
|
||||
resize:true,fixed:true,
|
||||
ico:core.ico('folder'),
|
||||
title:LNG.ui_filemanage,
|
||||
width:880,height:550
|
||||
});
|
||||
|
@ -233,6 +252,7 @@ define(function(require, exports) {
|
|||
id:'dialog_do_search',
|
||||
padding:0,
|
||||
fixed:true,
|
||||
ico:core.ico('search'),
|
||||
resize:true,
|
||||
title:LNG.search,
|
||||
width:450,
|
||||
|
@ -346,6 +366,7 @@ define(function(require, exports) {
|
|||
padding:5,
|
||||
height:430,
|
||||
resize:true,
|
||||
ico:core.ico('up'),
|
||||
id:'dialog_file_upload',
|
||||
fixed: true,
|
||||
title:LNG.upload_muti,
|
||||
|
@ -381,33 +402,127 @@ define(function(require, exports) {
|
|||
}
|
||||
});
|
||||
// 远程下载
|
||||
$('.file_upload .download_box .submit input').unbind('click').bind('click',function(){
|
||||
$('.file_upload .download_box button').unbind('click').bind('click',function(){
|
||||
core.server_dwonload(G.upload_path);
|
||||
});
|
||||
uploader.addButton({id: '#picker'});
|
||||
},
|
||||
server_dwonload:function(path){
|
||||
var urls = [];
|
||||
$('.list input').each(function(i){
|
||||
if ($(this).val() != '') {
|
||||
urls.push($(this).val());
|
||||
var $box = $('.download_box'),$list=$box.find('#download_list');
|
||||
var url = $box.find('input').val();
|
||||
$box.find('input').val('');
|
||||
|
||||
//url为空或不对
|
||||
if (!url || url.substr(0,4)!='http') {
|
||||
core.tips.tips('url false!',false);
|
||||
return;
|
||||
};
|
||||
|
||||
var uuid = UUID();
|
||||
var html ='<div id="' + uuid + '" class="item">' +
|
||||
'<div class="info"><span class="title" title="'+url+'">' + url
|
||||
+ '</span><span class="state">'+LNG.upload_ready
|
||||
+ '</span><div style="clear:both"></div></div></div>';
|
||||
if ($list.find('.item').length>0) {
|
||||
$(html).insertBefore($list.find('.item:eq(0)'))
|
||||
}else{
|
||||
$list.append(html)
|
||||
}
|
||||
|
||||
var repeatTime,delayTime,preInfo,preSpeed=0;
|
||||
var $state=$('#'+uuid+' .state').text(LNG.download_ready);
|
||||
var $percent = $('<div class="progress progress-striped active">' +
|
||||
'<div class="progress-bar" role="progressbar" style="width: 0%;text-align:right;">'+
|
||||
'</div></div>').appendTo('#'+uuid).find('.progress-bar');
|
||||
$.ajax({//开始下载文件
|
||||
url:'./index.php?explorer/serverDownload&type=download&save_path='+path+
|
||||
'&url='+urlEncode2(url)+'&uuid='+uuid,
|
||||
dataType:'json',
|
||||
error:function(a, b, c){
|
||||
core.ajaxError(a, b, c);
|
||||
clearInterval(repeatTime);repeatTime=false;
|
||||
clearTimeout(delayTime);repeatTime=false;
|
||||
$percent.parent().remove();
|
||||
$state.addClass('error').text(LNG.download_error);
|
||||
},
|
||||
success:function(data){
|
||||
clearInterval(repeatTime);repeatTime=false;
|
||||
clearTimeout(delayTime);repeatTime=false;
|
||||
if (!data.code) {
|
||||
$state.addClass('error').text(LNG.error);
|
||||
}else{
|
||||
FrameCall.father('ui.f5_callback',"function(){ui.path.setSelectByFilename('"
|
||||
+data.info+"');}");
|
||||
$state.text(LNG.download_success);
|
||||
$('#'+uuid+' .info .title').html(data.info);
|
||||
}
|
||||
$percent.parent().remove();
|
||||
}
|
||||
});
|
||||
core.tips.tips(urls.length + LNG.server_dwonload_desc);
|
||||
for (var i=0; i<urls.length; i++) {
|
||||
|
||||
var ajax_process = function(){//定时获取下载文件的大小,计算出下载速度和百分比。
|
||||
$.ajax({
|
||||
url:'./index.php?explorer/serverDownload&save_path='+path+'&url='+urlEncode2(urls[i]),
|
||||
url:'./index.php?explorer/serverDownload&type=percent&uuid='+uuid,
|
||||
dataType:'json',
|
||||
error:core.ajaxError,
|
||||
success:function(data){
|
||||
if (data.code) {
|
||||
FrameCall.father('ui.f5',"");
|
||||
if (!repeatTime) return;
|
||||
if (!data.code) {//header获取
|
||||
$state.text(LNG.loading);
|
||||
return;
|
||||
}
|
||||
core.tips.tips(data);
|
||||
var speedStr = '',info = data.data;
|
||||
if (!info) return;
|
||||
info.size = parseFloat(info.size);
|
||||
info.time = parseFloat(info.time);
|
||||
if (preInfo){
|
||||
var speed = (info.size-preInfo.size)/(info.time-preInfo.time);
|
||||
//速度防跳跃缓冲 忽略掉当前降低到20%的当前次
|
||||
if (speed*0.2 < preSpeed) {
|
||||
var temp = preSpeed;
|
||||
preSpeed = speed;
|
||||
speed = temp;
|
||||
}else{
|
||||
preSpeed = speed;
|
||||
}
|
||||
speedStr = core.file_size(speed)+"/s";
|
||||
}
|
||||
if (info['length']==0){
|
||||
$percent.css('width','100%' ).text(LNG.loading);
|
||||
}else{
|
||||
var percent = round(info.size/info.length*100,1);
|
||||
$percent.css('width', percent+'%').text(percent+'%');
|
||||
}
|
||||
$state.text(speedStr+'('+core.file_size(info.length)+')');
|
||||
preInfo = info;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
delayTime = setTimeout(function(){
|
||||
ajax_process();
|
||||
repeatTime = setInterval(function(){
|
||||
ajax_process();
|
||||
},1000);
|
||||
},100);
|
||||
},
|
||||
|
||||
file_size:function(size){
|
||||
if (size == 0) return "0B";
|
||||
size = parseFloat(size);
|
||||
var unit = {
|
||||
'GB' : 1073741824, // pow( 1024, 3)
|
||||
'MB' : 1048576, // pow( 1024, 2)
|
||||
'KB' : 1024, // pow( 1024, 1)
|
||||
'B ' : 0 // pow( 1024, 0)
|
||||
};
|
||||
for (var key in unit) {
|
||||
if (size >= unit[key]){
|
||||
return (size/unit[key]).toFixed(1)+key;
|
||||
}
|
||||
}
|
||||
return '0B';
|
||||
},
|
||||
|
||||
upload_init:function() {//upload init
|
||||
var list = '#thelist',state = 'span.state';
|
||||
uploader = WebUploader.create({
|
||||
|
@ -440,8 +555,7 @@ define(function(require, exports) {
|
|||
$(html).insertBefore($(list).find('.item:eq(0)'))
|
||||
}else{
|
||||
$(list).append(html)
|
||||
}
|
||||
select_name_arr.push(file.name);
|
||||
}
|
||||
uploader.upload();
|
||||
}).on('uploadProgress', function( file, percentage){
|
||||
var $li = $( '#'+file.id ),
|
||||
|
@ -453,16 +567,19 @@ define(function(require, exports) {
|
|||
'</div>' +
|
||||
'</div>').appendTo( $li ).find('.progress-bar');
|
||||
}
|
||||
$li.find(state).text((percentage*100).toFixed(2)+'%');
|
||||
$percent.css( 'width', percentage*100+'%' );
|
||||
$li.find('.state').text((percentage*100).toFixed(2)+'%');
|
||||
$percent.css( 'width', percentage*100+'%');
|
||||
}).on('uploadAccept', function(obj,server) {
|
||||
obj.file.serverData = server;//添加服务器返回变量
|
||||
try{
|
||||
select_name_arr.push(core.pathThis(server['info']));
|
||||
}catch(e){};
|
||||
}).on('uploadSuccess', function(file){
|
||||
var data = file.serverData
|
||||
if (data.code) {
|
||||
$( '#'+file.id ).find(state).text(data.data);
|
||||
var data = file.serverData;
|
||||
if (data.code){
|
||||
$('#'+file.id ).find(state).text(data.data);
|
||||
}else{
|
||||
$( '#'+file.id ).find(state).addClass('error').text(data.data);
|
||||
$('#'+file.id ).find(state).addClass('error').text(data.data);
|
||||
}
|
||||
uploader.removeFile(file);
|
||||
$('#'+file.id).find('.progress').fadeOut();
|
||||
|
@ -480,8 +597,8 @@ define(function(require, exports) {
|
|||
if (Config.pageApp == 'explorer') {
|
||||
ui.tree.checkIfChange(G.this_path);
|
||||
}
|
||||
}).on('error',function(a,b){
|
||||
//console.log(a,b);
|
||||
}).on('error',function(info,code){
|
||||
core.tips.tips(info,false);
|
||||
});
|
||||
|
||||
var timer;
|
||||
|
@ -509,7 +626,6 @@ define(function(require, exports) {
|
|||
var txt = e.dataTransfer.getData("text/plain");
|
||||
if (txt && txt.substring(0,4) == 'http') {
|
||||
ui.path.pathOperate.appAddURL(txt);
|
||||
console.log(txt);
|
||||
}else{
|
||||
core.upload();//满足 拖拽到当前,则上传到当前。
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ define(function(require, exports) {
|
|||
}
|
||||
if (ext == 'swf') {
|
||||
var url = core.path2url(path);
|
||||
_openWindow(url,core.pathThis(path));
|
||||
_openWindow(url,core.ico('swf'),core.pathThis(path));
|
||||
return;
|
||||
}
|
||||
if (ext == 'oexe') {
|
||||
|
@ -30,6 +30,7 @@ define(function(require, exports) {
|
|||
$.dialog({
|
||||
resize:true,
|
||||
fixed:true,
|
||||
ico:core.ico('pdf'),
|
||||
title:core.pathThis(path),
|
||||
width:800,
|
||||
height:400,
|
||||
|
@ -41,7 +42,7 @@ define(function(require, exports) {
|
|||
}
|
||||
if (ext=='html' || ext =='htm'){
|
||||
var url = core.path2url(path);
|
||||
_openWindow(url,core.pathThis(path));
|
||||
_openWindow(url,core.ico('html'),core.pathThis(path));
|
||||
return;
|
||||
}
|
||||
if (inArray(core.filetype['image'],ext)){//单张图片打开
|
||||
|
@ -88,7 +89,7 @@ define(function(require, exports) {
|
|||
var url=core.path2url(path);
|
||||
window.open(url);
|
||||
};
|
||||
var _openWindow = function(url,title,name) {
|
||||
var _openWindow = function(url,ico,title,name) {
|
||||
if (!url) return;
|
||||
if (name == undefined) name = 'openWindow'+UUID();
|
||||
|
||||
|
@ -100,6 +101,7 @@ define(function(require, exports) {
|
|||
art.dialog.through({
|
||||
id:name,
|
||||
title:title,
|
||||
ico:ico,
|
||||
width:'70%',
|
||||
height:'65%',
|
||||
padding:0,
|
||||
|
@ -123,30 +125,33 @@ define(function(require, exports) {
|
|||
if (window.top.frames["OpenopenEditor"] == undefined) {
|
||||
var url ='./index.php?editor/edit&filename='+urlEncode(urlEncode2(path));//3次
|
||||
var title = filename+' ——'+LNG.edit;
|
||||
_openWindow(url,title.substring(title.length-50),'openEditor');
|
||||
_openWindow(url,core.ico('edit'),title.substring(title.length-50),'openEditor');
|
||||
}else{
|
||||
if ($.dialog.list['openEditor']) $.dialog.list['openEditor'].display(true);;
|
||||
FrameCall.top('OpenopenEditor','Editor.add','"'+urlEncode2(path)+'"');//2次
|
||||
}
|
||||
};
|
||||
var _openOffice = function(url,ext){
|
||||
var app_url,temp_url,frame;
|
||||
var app_url,temp_url,frame,ico;
|
||||
switch (ext) {
|
||||
case 'doc':
|
||||
case 'docx':
|
||||
case 'docm':
|
||||
case 'dot':
|
||||
ico=core.ico('doc');
|
||||
app_url ='http://sg1b-word-view.officeapps.live.com/wv/wordviewerframe.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=';
|
||||
break;
|
||||
case 'ppt':
|
||||
case 'pptm':
|
||||
case 'pptx':
|
||||
ico=core.ico('ppt');
|
||||
app_url ='http://sg1b-powerpoint.officeapps.live.com/p/PowerPointFrame.aspx?PowerPointView=ReadingView&ui=zh-CN&rs=zh-CN&WOPISrc=';
|
||||
break;
|
||||
case 'xls':
|
||||
case 'xlsb':
|
||||
case 'xlsm':
|
||||
case 'xlsx':
|
||||
ico=core.ico('xls');
|
||||
app_url = 'http://sg1b-excel.officeapps.live.com/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=';
|
||||
break;
|
||||
default:break;
|
||||
|
@ -156,7 +161,12 @@ define(function(require, exports) {
|
|||
frame = app_url+urlEncode(temp_url)+'&access_token=1&access_token_ttl=0';
|
||||
|
||||
var title = core.pathThis(urlDecode(url));
|
||||
art.dialog.open(frame,{title:title,width:'70%',height:'65%',resize:true});
|
||||
art.dialog.open(frame,{
|
||||
ico:ico,
|
||||
title:title,width:'70%',
|
||||
height:'65%',
|
||||
resize:true
|
||||
});
|
||||
}
|
||||
//传入音乐播放地址,多个的话传入数组。可以扩展播放网络音乐
|
||||
var _player = function(list,ext){
|
||||
|
|
|
@ -32,7 +32,10 @@ define(function(require, exports) {
|
|||
var newFile = function(path,callback){
|
||||
if (!path) return;
|
||||
var filename = core.pathThis(path);
|
||||
if (!_pathAllow(filename)) return;
|
||||
if (!_pathAllow(filename)){
|
||||
if (typeof(callback) == 'function')callback();
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
dataType:'json',
|
||||
url: 'index.php?explorer/mkfile&path='+urlEncode2(path),
|
||||
|
@ -50,7 +53,10 @@ define(function(require, exports) {
|
|||
var newFolder = function(path,callback){
|
||||
if (!path) return;
|
||||
var filename = core.pathThis(path);
|
||||
if (!_pathAllow(filename)) return;
|
||||
if (!_pathAllow(filename)){
|
||||
if (typeof(callback) == 'function')callback();
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
dataType:'json',
|
||||
url: 'index.php?explorer/mkdir&path='+urlEncode2(path),
|
||||
|
@ -68,7 +74,10 @@ define(function(require, exports) {
|
|||
var rname = function(from,to,callback){
|
||||
if (!from || !to) return;
|
||||
if (from == to) return;
|
||||
if (!_pathAllow(core.pathThis(to))) return;
|
||||
if (!_pathAllow(core.pathThis(to))){
|
||||
if (typeof(callback) == 'function')callback();
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType:'json',
|
||||
|
@ -93,7 +102,7 @@ define(function(require, exports) {
|
|||
if (param.length<1) return;
|
||||
var name = param[0]['path'];
|
||||
if (name.length > 20) {
|
||||
name = name.substr(-20) + '...'
|
||||
name = '...'+name.substr(-20);
|
||||
};
|
||||
|
||||
$.dialog({
|
||||
|
@ -165,10 +174,10 @@ define(function(require, exports) {
|
|||
},
|
||||
error:core.ajaxError,
|
||||
success:function(data){
|
||||
if (!data.code){
|
||||
if (data.code){
|
||||
core.tips.close(data);
|
||||
}else{
|
||||
core.tips.close(data.info);
|
||||
core.tips.close(data.info,false);
|
||||
}
|
||||
if (typeof(callback) == 'function')callback(data);
|
||||
}
|
||||
|
@ -178,38 +187,11 @@ define(function(require, exports) {
|
|||
//获取文件夹属性
|
||||
var info = function(param){
|
||||
if (param.length<1) param = [{path:G.this_path,type:"folder"}];//当前目录属性
|
||||
if (param.length >1) {_infoMuti(param);return;};
|
||||
param = param[0];
|
||||
var info = param.type =='folder'?'path_info':'file_info';
|
||||
$.ajax({
|
||||
url:'index.php?explorer/pathInfo&type='+param.type+'&path='+urlEncode2(param.path),
|
||||
beforeSend: function(){
|
||||
core.tips.loading(LNG.getting);
|
||||
},
|
||||
error:core.ajaxError,
|
||||
success:function(data){
|
||||
if (!data.code){
|
||||
core.tips.close(data);return;
|
||||
}
|
||||
core.tips.close(LNG.get_success,true);
|
||||
var render = template.compile(tpl[info]);
|
||||
data.data.LNG = LNG;//模板中的多语言注入
|
||||
$.dialog({
|
||||
padding:5,
|
||||
fixed: true,//不跟随页面滚动
|
||||
title:core.pathThis(param.path).substr(0,20)+"... "+LNG.info,
|
||||
content:render(data.data),
|
||||
width:'350px',
|
||||
cancel: true
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var _infoMuti = function(param){
|
||||
$.ajax({//若type为muti则path为多个的json拼装
|
||||
url:'index.php?explorer/pathInfoMuti',
|
||||
url:'index.php?explorer/pathInfo',
|
||||
type:'POST',
|
||||
data:_json(param),
|
||||
dataType:'json',
|
||||
data:_json(param),
|
||||
beforeSend: function(){
|
||||
core.tips.loading(LNG.getting);
|
||||
},
|
||||
|
@ -219,20 +201,57 @@ define(function(require, exports) {
|
|||
core.tips.close(data);return;
|
||||
}
|
||||
core.tips.close(LNG.get_success,true);
|
||||
|
||||
var render = template.compile(tpl.path_info_more);
|
||||
data.data.LNG = LNG;//模板中的多语言注入
|
||||
var tpl_file = 'path_info_more';
|
||||
var title = LNG.info;
|
||||
if (param.length ==1) {
|
||||
tpl_file = ((param[0].type =='folder')?'path_info':'file_info');
|
||||
title = core.pathThis(param[0].path);
|
||||
if (title.length>15) {
|
||||
title = title.substr(0,15)+"... "+LNG.info
|
||||
}
|
||||
}
|
||||
var render = template.compile(tpl[tpl_file]);
|
||||
var dialog_id = UUID();
|
||||
data.data.LNG = LNG;//模板中的多语言注入
|
||||
$.dialog({
|
||||
id:dialog_id,
|
||||
padding:5,
|
||||
ico:core.ico('info'),
|
||||
fixed: true,//不跟随页面滚动
|
||||
width:'350px',
|
||||
title:LNG.info,
|
||||
title:title,
|
||||
content:render(data.data),
|
||||
width:'350px',
|
||||
cancel: true
|
||||
});
|
||||
_chmod(dialog_id,param);
|
||||
}
|
||||
});
|
||||
};
|
||||
var _chmod = function(dialog_id,param){
|
||||
$('.'+dialog_id).find('.edit_chmod').click(function(){
|
||||
var $input = $(this).parent().find('input');
|
||||
var $button = $(this);
|
||||
$.ajax({
|
||||
url:'index.php?explorer/pathChmod&mod='+$input.val(),
|
||||
type:'POST',
|
||||
data:_json(param),
|
||||
beforeSend: function(){
|
||||
$button.text(LNG.loading);
|
||||
},
|
||||
error:function(data){
|
||||
$button.text(LNG.button_save);
|
||||
},
|
||||
success:function(data){
|
||||
$button.text(data.data)
|
||||
.animate({opacity:0.6},400,0)
|
||||
.delay(1000)
|
||||
.animate({opacity:1},200,0,function(){
|
||||
$button.text(LNG.button_save);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var zip = function(param,callback){
|
||||
if (param.length<1) return;
|
||||
|
@ -283,7 +302,6 @@ define(function(require, exports) {
|
|||
error:core.ajaxError,
|
||||
success:function(data){
|
||||
core.tips.close(data);
|
||||
if (!data.code) return;
|
||||
if (typeof (callback) == 'function') callback(data);
|
||||
}
|
||||
});
|
||||
|
@ -302,7 +320,6 @@ define(function(require, exports) {
|
|||
error:core.ajaxError,
|
||||
success:function(data){
|
||||
core.tips.close(data);
|
||||
if (!data.code) return;
|
||||
if (typeof (callback) == 'function') callback(data);
|
||||
}
|
||||
});
|
||||
|
@ -485,16 +502,16 @@ define(function(require, exports) {
|
|||
var name = result.data;
|
||||
core.tips.close(result);
|
||||
var data = {
|
||||
content:url,
|
||||
content:"window.open('"+url+"');",
|
||||
desc: "",
|
||||
group: "others",
|
||||
type: "url",
|
||||
type: "app",
|
||||
icon: "internet.png",
|
||||
name: name,
|
||||
resize: 1,
|
||||
simple: 0,
|
||||
height: "70%",
|
||||
width: "80%"
|
||||
height: "",
|
||||
width: ""
|
||||
};
|
||||
var filename = urlEncode2(G.this_path+name);
|
||||
url = './index.php?app/user_app&action=add&path='+filename;
|
||||
|
|
|
@ -31,6 +31,7 @@ define(function(require, exports) {
|
|||
$('.set_set'+G.list_type).addClass('selected');
|
||||
$('.set_sort_'+G.sort_field).addClass('selected');
|
||||
$('.set_sort_'+G.sort_order).addClass('selected');
|
||||
$('.context-menu-root').addClass('fadein');
|
||||
};
|
||||
var _init_desktop = function(){
|
||||
$('<div id="rightMenu" class="hidden"></div>').appendTo('body');
|
||||
|
@ -47,7 +48,8 @@ define(function(require, exports) {
|
|||
_bindSelectMore();
|
||||
_bindTaskBar();
|
||||
$('.set_sort_'+G.sort_field).addClass('selected');
|
||||
$('.set_sort_'+G.sort_order).addClass('selected');
|
||||
$('.set_sort_'+G.sort_order).addClass('selected');
|
||||
$('.context-menu-root').addClass('fadein');
|
||||
};
|
||||
|
||||
//初始化编辑器 树目录右键菜单
|
||||
|
@ -65,6 +67,7 @@ define(function(require, exports) {
|
|||
_bindTreeFolderEditor();
|
||||
_bindEditorFile();
|
||||
_bindTaskBar();
|
||||
$('.context-menu-root').addClass('fadein');
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -11,11 +11,14 @@ define(function(require, exports) {
|
|||
var id = $(this).attr('id');
|
||||
var dialog = art.dialog.list[id];
|
||||
var dom = $('.'+id);
|
||||
if (dom.css('visibility') != 'hidden'){
|
||||
if (dom.css('visibility') == 'hidden'){
|
||||
dialog.display(true);
|
||||
}else if(dom.hasClass('aui_state_focus')){
|
||||
dialog.display(false);
|
||||
}else{
|
||||
dialog.display(true);
|
||||
dialog.zIndex();
|
||||
}
|
||||
|
||||
}).die('mouseleave').live('mouseleave',function(){
|
||||
$(this).removeClass('hover');
|
||||
}).die('dblclick').live('dblclick',function(){
|
||||
|
|
|
@ -4,6 +4,7 @@ define(function(require, exports) {
|
|||
var successCallback;
|
||||
var isUpdateRefresh = false;//上传连续更新树目录队列方式。没有处理完不做反应,处理完后sleep 2s;
|
||||
ui.pathOpen = pathOpen;
|
||||
var zTree;
|
||||
|
||||
// 目录树操作
|
||||
var init=function(){
|
||||
|
@ -20,6 +21,7 @@ define(function(require, exports) {
|
|||
}
|
||||
var tree_json = data.data;
|
||||
$.fn.zTree.init($("#folderList"), setting,tree_json);
|
||||
zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
}
|
||||
});
|
||||
$('.ztree .switch').die('mouseenter').live('mouseenter',function(){
|
||||
|
@ -27,7 +29,6 @@ define(function(require, exports) {
|
|||
}).die('mouseleave').live('mouseleave',function(){
|
||||
$(this).removeClass('switch_hover');
|
||||
});
|
||||
|
||||
if (Config.pageApp == 'editor') {
|
||||
Mousetrap.bind('up',function(e) {
|
||||
keyAction(e,'up');
|
||||
|
@ -60,73 +61,70 @@ define(function(require, exports) {
|
|||
}).bind('alt+n',function(e) {
|
||||
tree.create('file');
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
var keyAction = function(e,action){
|
||||
stopPP(e);
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList"),
|
||||
treeNode = zTree.getSelectedNodes()[0];
|
||||
if (treeNode != undefined) {
|
||||
switch(action){
|
||||
case 'up':
|
||||
var node = treeNode.getPreNode();
|
||||
if (!node) {
|
||||
node = treeNode.getParentNode();
|
||||
}else if(node.open && node.children.length>0) {
|
||||
while(node.open && node.children && node.children.length>=1){
|
||||
node = node.children[node.children.length-1];
|
||||
}
|
||||
//if (node.getParentNode().tId == treeNode.tId) node=treeNode;
|
||||
var treeNode = zTree.getSelectedNodes()[0];
|
||||
if (!treeNode) return;
|
||||
switch(action){
|
||||
case 'up':
|
||||
var node = treeNode.getPreNode();
|
||||
if (!node) {
|
||||
node = treeNode.getParentNode();
|
||||
}else if(node.open && node.children.length>0) {
|
||||
while(node.open && node.children && node.children.length>=1){
|
||||
node = node.children[node.children.length-1];
|
||||
}
|
||||
zTree.selectNode(node);
|
||||
break;
|
||||
case 'down':
|
||||
if (treeNode.open && treeNode.children.length>=1){
|
||||
node = treeNode.children[0];
|
||||
}else{
|
||||
var tempNode = treeNode,
|
||||
//if (node.getParentNode().tId == treeNode.tId) node=treeNode;
|
||||
}
|
||||
zTree.selectNode(node);
|
||||
break;
|
||||
case 'down':
|
||||
if (treeNode.open && treeNode.children.length>=1){
|
||||
node = treeNode.children[0];
|
||||
}else{
|
||||
var tempNode = treeNode,
|
||||
node = tempNode.getNextNode()||tempNode.getParentNode().getNextNode();
|
||||
try{
|
||||
while(!node){
|
||||
tempNode = tempNode.getParentNode();
|
||||
node = tempNode.getNextNode()||tempNode.getParentNode().getNextNode();
|
||||
try{
|
||||
while(!node){
|
||||
tempNode = tempNode.getParentNode();
|
||||
node = tempNode.getNextNode()||tempNode.getParentNode().getNextNode();
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
zTree.selectNode(node);
|
||||
break;
|
||||
case 'left':
|
||||
if (!treeNode.isParent) {
|
||||
}
|
||||
}catch(e){}
|
||||
}
|
||||
zTree.selectNode(node);
|
||||
break;
|
||||
case 'left':
|
||||
if (!treeNode.isParent) {
|
||||
zTree.selectNode(treeNode.getParentNode());
|
||||
}else{
|
||||
if (treeNode.open) {
|
||||
zTree.expandNode(treeNode,false);
|
||||
}else{
|
||||
zTree.selectNode(treeNode.getParentNode());
|
||||
}else{
|
||||
if (treeNode.open) {
|
||||
zTree.expandNode(treeNode,false);
|
||||
}else{
|
||||
zTree.selectNode(treeNode.getParentNode());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'right':
|
||||
if (treeNode.open){
|
||||
zTree.selectNode(treeNode.children[0]);
|
||||
}else{
|
||||
zTree.expandNode(treeNode,true);
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'right':
|
||||
if (treeNode.open){
|
||||
zTree.selectNode(treeNode.children[0]);
|
||||
}else{
|
||||
zTree.expandNode(treeNode,true);
|
||||
}
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
};
|
||||
|
||||
var setting={
|
||||
async: {
|
||||
enable: true,
|
||||
dataType: "json",
|
||||
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;
|
||||
}
|
||||
dataFilter: function(treeId,parentNode,responseData){
|
||||
if (!responseData.code) return null;
|
||||
return responseData.data;
|
||||
}
|
||||
},
|
||||
|
@ -196,7 +194,6 @@ define(function(require, exports) {
|
|||
},
|
||||
callback: {//事件处理回调函数
|
||||
onClick: function(event,treeId,treeNode){
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
zTree.selectNode(treeNode);
|
||||
zTree.expandNode(treeNode);
|
||||
if(treeNode.type=='folder' && Config.pageApp=='editor') return;
|
||||
|
@ -214,14 +211,17 @@ define(function(require, exports) {
|
|||
}
|
||||
},
|
||||
beforeRightClick:function(treeId, treeNode){
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
zTree.selectNode(treeNode);
|
||||
},
|
||||
beforeAsync:function(treeId, treeNode){
|
||||
treeNode.ajax_name= urlEncode(treeNode.name);
|
||||
treeNode.ajax_path= urlEncode(treeNode.path);
|
||||
},
|
||||
onAsyncSuccess:function(treeId, treeNode){//更新成功后调用
|
||||
onAsyncSuccess:function(event, treeId, treeNode, msg){//更新成功后调用
|
||||
if (msg.data.length == 0){
|
||||
zTree.removeChildNodes(treeNode);
|
||||
return;
|
||||
}
|
||||
if (typeof(successCallback) == 'function'){
|
||||
successCallback();
|
||||
successCallback = undefined;
|
||||
|
@ -229,8 +229,7 @@ define(function(require, exports) {
|
|||
},
|
||||
//新建文件夹、文件、重命名后回调(input blur时调用)
|
||||
onRename:function(event, treeId,treeNode){
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList"),
|
||||
parent = treeNode.getParentNode();;
|
||||
var parent = treeNode.getParentNode();
|
||||
//已存在检测
|
||||
if(zTree.getNodesByParam('name',treeNode.name,parent).length>1){
|
||||
core.tips.tips(LNG.name_isexists,false);
|
||||
|
@ -300,9 +299,7 @@ define(function(require, exports) {
|
|||
|
||||
//配置请求数据 通用
|
||||
var _param = function(makeArray){
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
if (!zTree) return;
|
||||
|
||||
if (!zTree) return;
|
||||
var treeNode = zTree.getSelectedNodes()[0],
|
||||
path = '',
|
||||
type ='';
|
||||
|
@ -330,10 +327,14 @@ define(function(require, exports) {
|
|||
};
|
||||
//通用刷新 不传参数则刷新选中节点
|
||||
var refresh = function(treeNode){
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
if (treeNode == undefined) treeNode=zTree.getSelectedNodes()[0];
|
||||
if (!treeNode.isParent){
|
||||
treeNode = treeNode.getParentNode();
|
||||
if (!treeNode){
|
||||
ui.tree.init();
|
||||
return;
|
||||
}
|
||||
if (treeNode && treeNode['ext'] =='__fav__') return;//不刷新收藏夹
|
||||
}
|
||||
zTree.reAsyncChildNodes(treeNode, "refresh");
|
||||
};
|
||||
|
@ -384,22 +385,15 @@ define(function(require, exports) {
|
|||
remove:function(){
|
||||
var param = _param(true);
|
||||
var parent = param[0].node.getParentNode();
|
||||
if(!parent) {
|
||||
$.dialog({fixed: true,resize: false,icon:'warning',drag: true,
|
||||
title:LNG.tips,content: LNG.remove_not,ok:true});
|
||||
}else{
|
||||
pathOperate.remove(param,function(){
|
||||
f5_refresh();
|
||||
refresh(parent);
|
||||
});
|
||||
}
|
||||
pathOperate.remove(param,function(){
|
||||
f5_refresh();
|
||||
refresh(parent);
|
||||
});
|
||||
},
|
||||
checkIfChange:function(explorer_path){
|
||||
checkIfChange:function(explorer_path){
|
||||
if (isUpdateRefresh) return;
|
||||
isUpdateRefresh = true;
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
if (!zTree) return;
|
||||
|
||||
zTree.getNodesByFilter(function(treeNode){
|
||||
var path;
|
||||
if (treeNode.this_path){
|
||||
|
@ -408,7 +402,8 @@ define(function(require, exports) {
|
|||
path = treeNode.path+treeNode.name;
|
||||
}
|
||||
if (path == explorer_path ||
|
||||
path+'/'==explorer_path) {
|
||||
path+'/'==explorer_path||
|
||||
'/'+treeNode.name+'/'==explorer_path) {
|
||||
refresh(treeNode);
|
||||
return true;
|
||||
}
|
||||
|
@ -440,7 +435,6 @@ define(function(require, exports) {
|
|||
},
|
||||
// 创建节点 让元素进入编辑状态(编辑、新建)。保存动作在ztree的onRename回调函数中
|
||||
create:function(type){//type ='file' 'folder'
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList");
|
||||
var sel = zTree.getSelectedNodes();
|
||||
if (sel.length<=0){//工具栏新建文件(夹)
|
||||
var node = zTree.getNodeByParam("ext",'__root__', null);
|
||||
|
@ -464,21 +458,18 @@ define(function(require, exports) {
|
|||
newNode = {name:file+'('+i+').txt','ext':'txt',type:'file',create:true,path:param.path};
|
||||
}
|
||||
|
||||
|
||||
if(treeNode.children != undefined){
|
||||
treeNodeNew = zTree.addNodes(treeNode,newNode);
|
||||
zTree.editName(treeNodeNew[0]);
|
||||
}else{
|
||||
var treeNodeNew = zTree.addNodes(treeNode,newNode)[0];
|
||||
zTree.editName(treeNodeNew);
|
||||
}else{
|
||||
if (treeNode.type != 'folder') treeNode = treeNode.getParentNode();
|
||||
successCallback = function(){
|
||||
treeNodeNew = zTree.addNodes(treeNode,newNode);
|
||||
zTree.editName(treeNodeNew[0]);
|
||||
}
|
||||
refresh(treeNode);
|
||||
}
|
||||
var treeNodeNew = zTree.addNodes(treeNode,newNode)[0];
|
||||
zTree.editName(treeNodeNew);
|
||||
}
|
||||
},
|
||||
rname:function(){
|
||||
var zTree = $.fn.zTree.getZTreeObj("folderList"),
|
||||
treeNode = zTree.getSelectedNodes()[0],newNode;
|
||||
var treeNode = zTree.getSelectedNodes()[0],newNode;
|
||||
zTree.editName(treeNode);
|
||||
treeNode.beforeName = treeNode.name;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(function(require, exports) {
|
||||
var isSelect = false; // 是否多选状态
|
||||
var isDraging = false; // 是否拖拽状态
|
||||
var isCtrlSelect = false; // 是否ctrl按住并选择
|
||||
|
||||
//初始化选择
|
||||
var _initSelect = function(){
|
||||
|
@ -28,11 +29,19 @@
|
|||
&& !$(this).hasClass(Config.SelectClassName)) {
|
||||
$(this).addClass('selectDragTemp');
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!isSelect && !isDraging){//框选时,由于ctrl重选时会反选有hover
|
||||
$(this).addClass(Config.HoverClassName);
|
||||
}
|
||||
$(this).unbind("mouseup").mouseup(function(e){
|
||||
|
||||
$(this).unbind("mousedown").mousedown(function(e){
|
||||
rightMenu.hidden();
|
||||
//已选中多个,点击可拖动以选中进行操作;点击未选中则清空
|
||||
if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) {
|
||||
fileLight.clear();
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
}
|
||||
//鼠标右键,有选中,且当前即为选中
|
||||
if(e.which==3 && !$(this).hasClass(Config.SelectClassName)){
|
||||
fileLight.clear();
|
||||
|
@ -40,15 +49,15 @@
|
|||
fileLight.select();
|
||||
}
|
||||
if(e.ctrlKey) {//ctrl 跳跃选择
|
||||
if ($(this).hasClass(Config.SelectClassName)) {//已经选中则反选
|
||||
fileLight.resumeMenu($(this));//恢复右键菜单id
|
||||
$(this).removeClass(Config.SelectClassName);
|
||||
if ($(this).hasClass(Config.SelectClassName)) {//已经选定 设置标志位弹起时取消选择
|
||||
isCtrlSelect = true;
|
||||
}else{
|
||||
fileLight.setMenu($(this));//修改右键菜单至多选
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
fileLight.setMenu($(this));
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
}
|
||||
fileLight.select();
|
||||
}else if(e.shiftKey){//shift 连选
|
||||
}
|
||||
if(e.shiftKey){//shift 连选
|
||||
var current = parseInt($(this).attr(Config.FileOrderAttr));
|
||||
if (Global.fileListSelectNum == 0) {
|
||||
_selectFromTo(0,current);
|
||||
|
@ -65,32 +74,25 @@
|
|||
_selectFromTo(first,current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).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(){
|
||||
}
|
||||
});
|
||||
}).die('mouseleave').live('mouseleave',function(){
|
||||
$(this).removeClass(Config.HoverClassName);
|
||||
$(this).removeClass('selectDragTemp');
|
||||
}).unbind('click').live('click',function (e) {
|
||||
}).die('click').live('click',function (e) {
|
||||
stopPP(e);//再次绑定,防止冒泡到html的click事件
|
||||
if (!e.ctrlKey && !e.shiftKey && $(this).hasClass(Config.SelectClassName)) {
|
||||
//多选后再次直接点击,已经选中则反选
|
||||
if (!e.ctrlKey && !e.shiftKey) {
|
||||
fileLight.clear();
|
||||
$(this).removeClass(Config.SelectClassName);
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
fileLight.select();
|
||||
}
|
||||
if(e.ctrlKey && isCtrlSelect) {//ctrl 跳跃选择
|
||||
isCtrlSelect = false;
|
||||
fileLight.resumeMenu($(this));//恢复右键菜单id
|
||||
$(this).removeClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
}
|
||||
});
|
||||
|
||||
//双击事件
|
||||
$(Config.FileBoxClass).unbind('dblclick').live('dblclick',function(e){//双击打开
|
||||
stopPP(e);
|
||||
|
@ -413,6 +415,9 @@
|
|||
fileLight.setMenu($list);
|
||||
}
|
||||
},
|
||||
setInView:function(){
|
||||
return;//desktop不处理
|
||||
},
|
||||
//获取文件&文件夹名字
|
||||
name:function($obj){
|
||||
return $obj.attr("data-name");
|
||||
|
|
|
@ -54,7 +54,8 @@
|
|||
core.upload_init();
|
||||
fileSelect.init();
|
||||
rightMenu.initDesktop();
|
||||
$('.init_loading').fadeOut(600);
|
||||
$('.init_loading').fadeOut(450).addClass('pop_fadeout');
|
||||
|
||||
$(".bodymain").click(function () {
|
||||
if ($("#menuwin").css("display")=='block') {
|
||||
$("#menuwin").css("display", "none");
|
||||
|
|
|
@ -261,13 +261,42 @@
|
|||
});
|
||||
|
||||
//绑定键盘定位文件名 选中文件,只只是首字母选择。
|
||||
var lastClickTime = 0;
|
||||
var lastkeyCode = '';
|
||||
var keyTimeout;
|
||||
var timeOffset = 200;//按键之间延迟,小于则认为是整体
|
||||
Mousetrap.bind(
|
||||
['1','2','3','4','5','6','7','8','9','0',
|
||||
'`','~','!','@','#','$','%','^','&','*','(',')','-','_','=','+','[','{',']','}','|','/','?','.','>',',','<',
|
||||
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],function(e) {
|
||||
var code = String.fromCharCode(e.charCode);
|
||||
ui.path.setSelectByChar(code);
|
||||
['1','2','3','4','5','6','7','8','9','0','`','~','!','@','#','$','%','^','&','*','(',')',
|
||||
'-','_','=','+','[','{',']','}','|','/','?','.','>',',','<','a','b','c','d','e',
|
||||
'f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],function(e){
|
||||
var code = String.fromCharCode(e.charCode);
|
||||
if (lastClickTime == 0) {//新的一次键盘记录
|
||||
lastClickTime = time();
|
||||
lastkeyCode = code;
|
||||
keyTimeout = setTimeout(function(){
|
||||
ui.path.setSelectByChar(lastkeyCode);
|
||||
lastClickTime = 0;
|
||||
},timeOffset);//延迟执行
|
||||
return;
|
||||
}
|
||||
if (code == lastkeyCode.substr(-1)) {//当前和之前一致
|
||||
ui.path.setSelectByChar(lastkeyCode);
|
||||
lastClickTime = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (time() - lastClickTime < timeOffset) {
|
||||
//定时之内没有输入则执行,有则追加,继续延时
|
||||
lastClickTime = time();
|
||||
lastkeyCode += code;
|
||||
clearTimeout(keyTimeout);
|
||||
keyTimeout = setTimeout(function(){
|
||||
ui.path.setSelectByChar(lastkeyCode);
|
||||
lastClickTime = 0;
|
||||
},timeOffset);//延迟执行。
|
||||
}
|
||||
});
|
||||
|
||||
Mousetrap.bind(['alt+n', 'alt+n'],function(e){
|
||||
stopPP(e);ui.path.newFile();
|
||||
});
|
||||
|
|
|
@ -66,7 +66,8 @@ define(function(require, exports) {
|
|||
default:break;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('.context-menu-root').addClass('fadein');
|
||||
};
|
||||
|
||||
// 拖拽——移动
|
||||
|
|
|
@ -27,6 +27,6 @@ define(function(require, exports, module) {
|
|||
TaskTap.init();
|
||||
core.update();
|
||||
rightMenu.initEditor();
|
||||
$('.init_loading').fadeOut(600);
|
||||
$('.init_loading').fadeOut(450).addClass('pop_fadeout');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
define(function(require, exports) {
|
||||
var isSelect = false; // 是否多选状态
|
||||
var isDraging = false; // 是否拖拽状态
|
||||
var isCtrlSelect = false; // 是否ctrl按住并选择
|
||||
|
||||
//初始化选择
|
||||
var _initSelect = function(){
|
||||
|
@ -19,7 +20,9 @@ define(function(require, exports) {
|
|||
}else{
|
||||
ui.path.open();
|
||||
}
|
||||
});// 屏蔽对话框内操作
|
||||
});
|
||||
|
||||
// 屏蔽对话框内操作
|
||||
$(Config.FileBoxClass).live('mouseenter',function (e) {
|
||||
if (isDraging) {//hover,hover 到文件夹时则添加目标选择类
|
||||
if ($(this).hasClass(Config.TypeFolderClass)
|
||||
|
@ -30,24 +33,31 @@ define(function(require, exports) {
|
|||
if(!isSelect && !isDraging){//框选时,由于ctrl重选时会反选有hover
|
||||
$(this).addClass(Config.HoverClassName);
|
||||
}
|
||||
$(this).unbind("mouseup").mouseup(function(e){
|
||||
|
||||
$(this).unbind("mousedown").mousedown(function(e){
|
||||
rightMenu.hidden();
|
||||
//已选中多个,点击可拖动以选中进行操作;点击未选中则清空
|
||||
if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) {
|
||||
fileLight.clear();
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
}
|
||||
//鼠标右键,有选中,且当前即为选中
|
||||
if(e.which==3 && !$(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
|
||||
$(this).removeClass(Config.SelectClassName);
|
||||
if ($(this).hasClass(Config.SelectClassName)) {//已经选定 设置标志位弹起时取消选择
|
||||
isCtrlSelect = true;
|
||||
}else{
|
||||
fileLight.setMenu($(this));//修改右键菜单至多选
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
fileLight.setMenu($(this));
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
}
|
||||
fileLight.select();
|
||||
}else if(e.shiftKey){//shift 连选
|
||||
}
|
||||
if(e.shiftKey){//shift 连选
|
||||
var current = parseInt($(this).attr(Config.FileOrderAttr));
|
||||
if (Global.fileListSelectNum == 0) {
|
||||
_selectFromTo(0,current);
|
||||
|
@ -65,29 +75,22 @@ 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);
|
||||
$(this).removeClass('selectDragTemp');
|
||||
}).die('click').live('click',function (e) {
|
||||
stopPP(e);//再次绑定,防止冒泡到html的click事件
|
||||
if (!e.ctrlKey && !e.shiftKey && $(this).hasClass(Config.SelectClassName)) {
|
||||
//多选后再次直接点击,已经选中则反选
|
||||
if (!e.ctrlKey && !e.shiftKey) {
|
||||
fileLight.clear();
|
||||
$(this).removeClass(Config.SelectClassName);
|
||||
$(this).addClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
fileLight.select();
|
||||
}
|
||||
if(e.ctrlKey && isCtrlSelect) {//ctrl 跳跃选择
|
||||
isCtrlSelect = false;
|
||||
fileLight.resumeMenu($(this));//恢复右键菜单id
|
||||
$(this).removeClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
}
|
||||
});
|
||||
//双击事件
|
||||
|
@ -427,7 +430,8 @@ define(function(require, exports) {
|
|||
}
|
||||
fileLight.clear();
|
||||
$select.addClass(Config.SelectClassName);
|
||||
fileLight.select();
|
||||
fileLight.select();
|
||||
fileLight.setInView();
|
||||
};
|
||||
|
||||
//shift 选择,ctrl+上下左右选择
|
||||
|
@ -463,6 +467,18 @@ define(function(require, exports) {
|
|||
}
|
||||
fileLight.menuAction('menufile');
|
||||
},
|
||||
setInView:function(){
|
||||
var $list = Global.fileListSelect;
|
||||
if ($list && $list.length >= 1) {
|
||||
var $con = $('.bodymain');
|
||||
var $last = $($list[$list.length-1]);
|
||||
$con.scrollTop($last.offset().top
|
||||
- $con.offset().top
|
||||
- $con.height()/2
|
||||
+ $con.scrollTop()
|
||||
);
|
||||
}
|
||||
},
|
||||
//获取文件&文件夹名字
|
||||
name:function($obj){
|
||||
return $obj.attr("data-name");
|
||||
|
|
|
@ -36,7 +36,7 @@ define(function(require, exports, module) {
|
|||
|
||||
require('lib/jquery-lib');
|
||||
require('lib/util');
|
||||
require('lib/webuploader/webuploader-min');//-min
|
||||
require('lib/webuploader/webuploader-min');//
|
||||
require('lib/ztree/js/ztree');
|
||||
require('lib/contextMenu/jquery-contextMenu');
|
||||
require('lib/artDialog/jquery-artDialog');
|
||||
|
@ -57,13 +57,14 @@ define(function(require, exports, module) {
|
|||
}else{
|
||||
Global.topbar_height = $('.topbar').height();
|
||||
}
|
||||
$('.init_loading').fadeOut(600);
|
||||
|
||||
ui.init();
|
||||
ui.tree.init();
|
||||
TaskTap.init();
|
||||
core.update();
|
||||
core.upload_init();
|
||||
fileSelect.init();
|
||||
rightMenu.initExplorer();
|
||||
rightMenu.initExplorer();
|
||||
$('.init_loading').fadeOut(450).addClass('pop_fadeout');
|
||||
});
|
||||
});
|
|
@ -47,6 +47,7 @@ define(function(require, exports) {
|
|||
}
|
||||
});
|
||||
fileLight.select();
|
||||
fileLight.setInView();
|
||||
};
|
||||
|
||||
//设置某个文件[夹]选中。传入字符串或数组
|
||||
|
@ -60,15 +61,15 @@ define(function(require, exports) {
|
|||
var arr = [];
|
||||
$('.fileContiner .file').each(function(){
|
||||
var current_name = fileLight.name($(this));
|
||||
if (!current_name) return;
|
||||
if (ch == current_name.substring(0,ch.length).toLowerCase()){
|
||||
arr.push(current_name);
|
||||
}
|
||||
});
|
||||
selectByChar = {key:ch,path:G.this_path,index:0,list:arr};
|
||||
}
|
||||
|
||||
|
||||
if (selectByChar.list.length == 0) return;//没有匹配项
|
||||
|
||||
//自动从匹配结果中查找
|
||||
_setSelectByFilename(selectByChar.list[selectByChar.index++]);
|
||||
if (selectByChar.index == selectByChar.list.length) {
|
||||
|
@ -498,11 +499,11 @@ define(function(require, exports) {
|
|||
copyDrag:function(dragTo,isDragCurrent){
|
||||
pathOperate.copyDrag(_param(true),dragTo,function(list){
|
||||
fileLight.clear();
|
||||
if (Config.pageApp == 'explorer') {
|
||||
if (Config.pageApp == 'explorer'){
|
||||
ui.tree.checkIfChange(G.this_path);
|
||||
}
|
||||
ui.f5_callback(function() {
|
||||
if (isDragCurrent){
|
||||
if (isDragCurrent && list['data']){
|
||||
_setSelectByFilename(list.data);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -215,13 +215,13 @@ define(function(require, exports) {
|
|||
//console.log("shiftKey+"+e.keyCode);
|
||||
}else{
|
||||
switch (e.keyCode) {
|
||||
case 8:ui.path.back();isStopPP=true;break;
|
||||
case 8:ui.path.back();break;
|
||||
case 35:fileSelect.selectPos('end');break;
|
||||
case 36:fileSelect.selectPos('home');break;
|
||||
case 37:fileSelect.selectPos('left');isStopPP=true;break;
|
||||
case 38:fileSelect.selectPos('up');break;
|
||||
case 38:fileSelect.selectPos('up');isStopPP=true;break;
|
||||
case 39:fileSelect.selectPos('right');isStopPP=true;break;
|
||||
case 40:fileSelect.selectPos('down');break;
|
||||
case 40:fileSelect.selectPos('down');isStopPP=true;break;
|
||||
case 13:ui.path.open();isStopPP=false;break;//enter 打开文件==双击
|
||||
case 46:ui.path.remove();break;
|
||||
case 113:ui.path.rname();break;//f2重命名
|
||||
|
@ -508,13 +508,42 @@ define(function(require, exports) {
|
|||
|
||||
|
||||
//绑定键盘定位文件名 选中文件,只只是首字母选择。
|
||||
var lastClickTime = 0;
|
||||
var lastkeyCode = '';
|
||||
var keyTimeout;
|
||||
var timeOffset = 200;//按键之间延迟,小于则认为是整体
|
||||
Mousetrap.bind(
|
||||
['1','2','3','4','5','6','7','8','9','0',
|
||||
'`','~','!','@','#','$','%','^','&','*','(',')','-','_','=','+','[','{',']','}','|','/','?','.','>',',','<',
|
||||
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],function(e) {
|
||||
var code = String.fromCharCode(e.charCode);
|
||||
ui.path.setSelectByChar(code);
|
||||
['1','2','3','4','5','6','7','8','9','0','`','~','!','@','#','$','%','^','&','*','(',')',
|
||||
'-','_','=','+','[','{',']','}','|','/','?','.','>',',','<','a','b','c','d','e',
|
||||
'f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],function(e){
|
||||
var code = String.fromCharCode(e.charCode);
|
||||
if (lastClickTime == 0) {//新的一次键盘记录
|
||||
lastClickTime = time();
|
||||
lastkeyCode = code;
|
||||
keyTimeout = setTimeout(function(){
|
||||
ui.path.setSelectByChar(lastkeyCode);
|
||||
lastClickTime = 0;
|
||||
},timeOffset);//延迟执行
|
||||
return;
|
||||
}
|
||||
if (code == lastkeyCode.substr(-1)) {//当前和之前一致
|
||||
ui.path.setSelectByChar(lastkeyCode);
|
||||
lastClickTime = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (time() - lastClickTime < timeOffset) {
|
||||
//定时之内没有输入则执行,有则追加,继续延时
|
||||
lastClickTime = time();
|
||||
lastkeyCode += code;
|
||||
clearTimeout(keyTimeout);
|
||||
keyTimeout = setTimeout(function(){
|
||||
ui.path.setSelectByChar(lastkeyCode);
|
||||
lastClickTime = 0;
|
||||
},timeOffset);//延迟执行。
|
||||
}
|
||||
});
|
||||
|
||||
Mousetrap.bind(['alt+n', 'alt+n'],function(e){
|
||||
stopPP(e);ui.path.newFile();
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var file_info = "<div class='pathinfo'>\
|
||||
<div class='p'>\
|
||||
<div class='icon file_icon'></div>\
|
||||
<input type='text' name='filename' value='{{name}}'/>\
|
||||
<input type='text' class='info_name' name='filename' value='{{name}}'/>\
|
||||
<div style='clear:both'></div>\
|
||||
</div>\
|
||||
<div class='line'></div>\
|
||||
|
@ -42,13 +42,19 @@ var file_info = "<div class='pathinfo'>\
|
|||
<div class='title'>{{LNG.permission}}:</div>\
|
||||
<div class='content'>{{mode}}</div>\
|
||||
<div style='clear:both'></div>\
|
||||
</div> \
|
||||
</div>\
|
||||
<div class='p'>\
|
||||
<div class='title'>{{LNG.permission_edit}}:</div>\
|
||||
<div class='content'><input type='text' class='info_chmod' value='777'/>\
|
||||
<button class='btn btn-default btn-sm edit_chmod' type='button'>{{LNG.button_save}}</button></div>\
|
||||
<div style='clear:both'></div>\
|
||||
</div>\
|
||||
</div>";
|
||||
|
||||
var path_info = "<div class='pathinfo'>\
|
||||
<div class='p'>\
|
||||
<div class='icon folder_icon'></div>\
|
||||
<input type='text' name='filename' value='{{name}}'/>\
|
||||
<input type='text' class='info_name' name='filename' value='{{name}}'/>\
|
||||
<div style='clear:both'></div>\
|
||||
</div>\
|
||||
<div class='line'></div>\
|
||||
|
@ -93,7 +99,13 @@ var path_info = "<div class='pathinfo'>\
|
|||
<div class='title'>{{LNG.permission}}:</div>\
|
||||
<div class='content'>{{mode}}</div>\
|
||||
<div style='clear:both'></div>\
|
||||
</div> \
|
||||
</div>\
|
||||
<div class='p'>\
|
||||
<div class='title'>{{LNG.permission_edit}}:</div>\
|
||||
<div class='content'><input type='text' class='info_chmod' value='777'/>\
|
||||
<button class='btn btn-default btn-sm edit_chmod' type='button'>{{LNG.button_save}}</button></div>\
|
||||
<div style='clear:both'></div>\
|
||||
</div>\
|
||||
</div>";
|
||||
|
||||
var path_info_more = "<div class='pathinfo'>\
|
||||
|
@ -111,10 +123,16 @@ var path_info_more = "<div class='pathinfo'>\
|
|||
</div>\
|
||||
<div class='line'></div>\
|
||||
<div class='p'>\
|
||||
<div class='title'>{{LNG.parent_permission}}:</div>\
|
||||
<div class='title'>{{LNG.permission}}:</div>\
|
||||
<div class='content'>{{mode}}</div>\
|
||||
<div style='clear:both'></div>\
|
||||
</div> \
|
||||
</div>\
|
||||
<div class='p'>\
|
||||
<div class='title'>{{LNG.permission_edit}}:</div>\
|
||||
<div class='content'><input type='text' class='info_chmod' value='777'/>\
|
||||
<button class='btn btn-default btn-sm edit_chmod' type='button'>{{LNG.button_save}}</button></div>\
|
||||
<div style='clear:both'></div>\
|
||||
</div>\
|
||||
</div>";
|
||||
|
||||
define(function(require, exports) {
|
||||
|
|
|
@ -17,14 +17,13 @@ define(function(require, exports) {
|
|||
</div>\
|
||||
</div>\
|
||||
<div class='download_box hidden'>\
|
||||
<form id='form' method='post'>\
|
||||
<div class='list'>{{LNG.download_address}}1: <input type='text' name='url1'/></div>\
|
||||
<div class='list'>{{LNG.download_address}}2: <input type='text' name='url2'/></div>\
|
||||
<div class='list'>{{LNG.download_address}}3: <input type='text' name='url3'/></div>\
|
||||
<div class='list'>{{LNG.download_address}}4: <input type='text' name='url4'/></div>\
|
||||
<div class='list'>{{LNG.download_address}}5: <input type='text' name='url5'/></div>\
|
||||
<div class='submit'><input type='button' name='' value='{{LNG.button_submit}}' class=''/></div>\
|
||||
</form>\
|
||||
<div class='list'>{{LNG.download_address}}<input type='text' name='url'/>\
|
||||
<button class='btn btn-default btn-sm' type='button'>{{LNG.download}}</button>\
|
||||
</div>\
|
||||
<div style='clear:both'></div>\
|
||||
<div id='downloader'>\
|
||||
<div id='download_list' class='uploader-list'></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>"
|
||||
}
|
||||
|
|
|
@ -100,6 +100,7 @@ var artDialog = function (config, ok, cancel) {
|
|||
|
||||
//添加到任务栏
|
||||
if (config.title !== false){
|
||||
config.title = '<img src="'+config.ico+'" />'+config.title;
|
||||
if (_count>=1) dialogList.add(config.id,config.title);
|
||||
}
|
||||
|
||||
|
@ -1086,6 +1087,7 @@ artDialog.defaults = {
|
|||
top: '38.2%', // Y轴坐标
|
||||
zIndex: 300, // 对话框叠加高度值(重要:此值不能超过浏览器最大限制)
|
||||
|
||||
ico:'./static/images/file_16/file.png',//默认标题小图标
|
||||
resize: false, // 是否允许用户调节尺寸
|
||||
dialogMaxFlag:'dialogMax', // 最大化状态标记class
|
||||
dialogMinFlag:'dialogMin', // 最小化状态标记class
|
||||
|
|
|
@ -1104,16 +1104,7 @@ var // currently active contextMenu trigger
|
|||
//warlee
|
||||
layer: function(opt, zIndex) {
|
||||
$visibleMenu = $('.context-menu-list').filter(':visible');
|
||||
if (typeof(Global) != "undefined") {
|
||||
$(Config.MainContent).data('contextMenuRoot', opt)
|
||||
.unbind("contextmenu")
|
||||
.contextmenu(function(e){
|
||||
$visibleMenu.trigger('contextmenu:hide');
|
||||
return true;
|
||||
});
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -63,14 +63,22 @@ $(document).ready(function() {
|
|||
FrameCall.apiOpen();
|
||||
});
|
||||
|
||||
|
||||
var time = function(){
|
||||
var time = (new Date()).valueOf();
|
||||
return time;
|
||||
}
|
||||
var urlEncode = encodeURIComponent;
|
||||
var urlDecode = decodeURIComponent;
|
||||
var urlEncode2 = function (str){
|
||||
return urlEncode(urlEncode(str));
|
||||
};
|
||||
var UUID = function(){
|
||||
return 'uuid_'+Date.parse(new Date())+'_'+Math.ceil(Math.random()*10000)
|
||||
return 'uuid_'+time()+'_'+Math.ceil(Math.random()*10000)
|
||||
}
|
||||
var round = function(val,point){
|
||||
if (!point) point = 2;
|
||||
point = Math.pow(10,parseInt(point));
|
||||
return Math.round(parseFloat(val)*point)/point;
|
||||
}
|
||||
|
||||
//跨框架数据共享
|
||||
|
@ -158,15 +166,17 @@ var tips = function(msg,code){
|
|||
Tips.tips(msg,code);
|
||||
}
|
||||
var Tips = (function(){
|
||||
var in_time = 500;
|
||||
var in_time = 400;
|
||||
var delay = 500;
|
||||
var opacity = 0.7;
|
||||
var _init = function(msg,code){
|
||||
var tipsIDname = "messageTips";
|
||||
var tipsID = "#"+tipsIDname;
|
||||
if ($(tipsID).length ==0) {
|
||||
var html = '<div id="'+tipsIDname+'" style="z-index:50;min-width:60px;position:fixed;padding:2px 2em;text-align:center;line-height:30px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;"><i style="padding: 0 6px;font-size: 15px;"></i><span></span></div>'
|
||||
$('body').append(html);
|
||||
var html = '<div id="'+tipsIDname+'" style="z-index:50;min-width:60px;max-width:80%;position:fixed;padding:2px 2em;text-align:center;line-height:30px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;"><i style="padding: 0 6px;font-size: 15px;"></i><span></span></div>'
|
||||
$('body').append(html);
|
||||
|
||||
$(tipsID).show().css({'left':($(window).width() - $(tipsID).innerWidth())/2});
|
||||
$(window).bind('resize',function(){
|
||||
if ($(tipsID).css('display') =="none") return;
|
||||
self.stop(true,true)
|
||||
|
@ -175,14 +185,14 @@ var Tips = (function(){
|
|||
}
|
||||
var self = $(tipsID),icon,color;
|
||||
switch(code){
|
||||
case 100://加长时间 5s
|
||||
case 100:delay = 3000;//加长时间 5s
|
||||
case true:
|
||||
case undefined:
|
||||
case 'succcess':color = '#5cb85c';icon = 'icon-ok';break;
|
||||
case 'info':color = '#519AF6';icon = 'icon-info';break;
|
||||
case 'warning':color = '#ed9c28';icon = 'icon-exclamation';break;
|
||||
case false:
|
||||
case 'error':color = '#d9534f';icon = 'icon-remove';break;
|
||||
case 'error':delay = 1000;color = '#d9534f';icon = 'icon-remove';break;
|
||||
default:color = '';icon = '';break;
|
||||
}
|
||||
|
||||
|
@ -191,6 +201,7 @@ var Tips = (function(){
|
|||
self.find('i').removeClass().addClass(icon);
|
||||
}
|
||||
if (msg != undefined) self.find('span').html(msg);
|
||||
$(tipsID).show().css({'left':($(window).width() - $(tipsID).innerWidth())/2});
|
||||
return self;
|
||||
};
|
||||
var tips = function(msg,code,offset_top){
|
||||
|
@ -199,14 +210,13 @@ var Tips = (function(){
|
|||
}
|
||||
if (offset_top == undefined) offset_top = 0;
|
||||
var self = _init(msg,code);
|
||||
if(code == 100){delay = 3500;}
|
||||
self.stop(true,true)
|
||||
.css({'display':'block','opacity':'0','top':offset_top-self.height(),
|
||||
'left':($(window).width() - self.width()) / 2})
|
||||
.css({'opacity':'0','top':offset_top-self.height()})
|
||||
.show()
|
||||
.animate({opacity:opacity,top:offset_top},in_time,0)
|
||||
.delay(delay)
|
||||
.animate({opacity:0,top:'-='+(offset_top+self.height())},in_time,0,function(){
|
||||
$(this).css('display','none');
|
||||
$(this).hide();
|
||||
});
|
||||
};
|
||||
var loading = function(msg,code,offset_top){
|
||||
|
@ -219,23 +229,27 @@ var Tips = (function(){
|
|||
|
||||
var self = _init(msg,code);
|
||||
self.stop(true,true)
|
||||
.css({'display':'block','opacity':'0','top':offset_top-self.height(),
|
||||
'left':($(window).width() - self.width()) / 2})
|
||||
.css({'opacity':'0','top':offset_top-self.height()})
|
||||
.animate({opacity:opacity,top:offset_top},in_time,0);
|
||||
};
|
||||
var close = function(msg,code,offset_top){
|
||||
if (typeof(msg) == 'object'){
|
||||
code=msg.code;msg = msg.data;
|
||||
try{
|
||||
code=msg.code;msg = msg.data;
|
||||
}catch(e){
|
||||
code=0;msg ='';
|
||||
};
|
||||
}
|
||||
if (offset_top == undefined) offset_top = 0;
|
||||
var self = _init(msg,code);
|
||||
|
||||
self.delay(delay)
|
||||
.show()
|
||||
.animate({
|
||||
opacity:0,
|
||||
top:'-='+(offset_top+self.height())},
|
||||
in_time,0,function(){
|
||||
$(this).css('display','none');
|
||||
$(this).hide();
|
||||
});
|
||||
};
|
||||
return{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#FFF;text-align:center;background-color:#428BCA;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease;}
|
||||
|
||||
.btns{margin-bottom: 10px;font-size: 13px;}
|
||||
.btns .tips{float:right;padding-top: 8px;}
|
||||
.btns .tips{float:right;}
|
||||
.btns #picker{width:100px;float: left;}
|
||||
#uploader{height:260px;border:1px solid #ddd;overflow: auto;}
|
||||
.uploader-list .item{border-bottom: 1px solid #eee;padding:5px;font-size: 13px;}
|
||||
|
@ -22,5 +22,5 @@
|
|||
.uploader-list .item span{display: block;float: left;}
|
||||
.uploader-list .item span.state{float: right;text-align:right;}
|
||||
.uploader-list .item span.error{color:#f30;}
|
||||
.uploader-list .item span.title{width:190px;overflow: hidden;color:#444;}
|
||||
.uploader-list .item .progress {height: 20px;margin: 0 5px 5px 0;}
|
||||
.uploader-list .item span.title{width:200px;height: 27px;overflow: hidden;color:#444;}
|
||||
.uploader-list .item .progress {height:20px;margin: 0 5px 5px 0;}
|
|
@ -4457,8 +4457,7 @@ var dragEnter=dragOver=dragLeave=dragDrop=function(){};
|
|||
_addFile: function( file ) {
|
||||
var me = this;
|
||||
// mark --warlee file-size 6?
|
||||
if ( !file || file.size < 6 || me.accept &&
|
||||
|
||||
if ( !file || me.accept &&
|
||||
// 如果名字中有后缀,才做后缀白名单处理。
|
||||
rExt.exec( file.name ) && !me.accept.test( file.name ) ) {
|
||||
return;
|
||||
|
|