From 1f441d7e6d95aa7f2480d0a6f870ab7c4a19d9a2 Mon Sep 17 00:00:00 2001 From: kalcaddle <824691958@qq.com> Date: Sun, 15 Jun 2014 23:35:50 +0800 Subject: [PATCH] version 2.5 --- config/config.php | 8 +-- config/version.php | 2 +- controller/api.class.php | 3 -- controller/app.class.php | 7 +-- controller/desktop.class.php | 10 ++-- controller/editor.class.php | 7 +-- controller/explorer.class.php | 48 ++++++++++++------ controller/fav.class.php | 5 +- controller/group.class.php | 12 ++--- controller/member.class.php | 12 ++--- controller/setting.class.php | 3 -- controller/user.class.php | 55 ++++++++++----------- data/User/admin/data/config.php | 2 +- data/User/admin/data/fav.php | 2 +- data/i18n/en/main.php | 15 +++--- data/i18n/zh_CN/main.php | 1 + data/i18n/zh_TW/main.php | 1 + lib/function/file.function.php | 36 ++++++++++++-- static/js/_dev/common/core.js | 18 +++++-- static/js/_dev/common/pathOpen.js | 2 +- static/js/_dev/common/pathOperate.js | 23 ++++++++- static/js/_dev/common/rightMenu.js | 2 + static/js/_dev/common/tree.js | 6 ++- static/js/_dev/src/app/page.js | 8 +-- static/js/_dev/src/desktop/fileSelect.js | 42 ++++++++++------ static/js/_dev/src/edit/edit.js | 10 ++-- static/js/_dev/src/edit/main.js | 5 ++ static/js/_dev/src/explorer/fileSelect.js | 48 +++++++++++------- static/js/_dev/src/explorer/path.js | 41 ++++++++++++--- static/js/_dev/src/explorer/ui.js | 1 + static/js/_dev/src/setting/setting.js | 2 +- static/js/_dev/update/main.js | 2 +- static/js/app/src/app/main.js | 2 +- static/js/app/src/desktop/main.js | 6 +-- static/js/app/src/edit/main.js | 2 +- static/js/app/src/editor/main.js | 6 +-- static/js/app/src/explorer/main.js | 8 +-- static/js/app/src/setting/main.js | 2 +- static/js/app/update/main.js | 2 +- static/js/lib/artDialog/jquery-artDialog.js | 12 ++--- static/js/lib/util.js | 7 +-- static/style/bootstrap.css | 14 +++++- template/common/navbar.html | 4 +- template/desktop/index.php | 4 +- template/editor/editor.php | 2 +- template/explorer/index.php | 4 +- template/setting/index.php | 2 +- template/user/login.html | 9 ++-- 48 files changed, 322 insertions(+), 203 deletions(-) diff --git a/config/config.php b/config/config.php index ab58f3e..ada65ff 100644 --- a/config/config.php +++ b/config/config.php @@ -8,9 +8,9 @@ date_default_timezone_set('PRC'); -@ini_set('session.cache_expire',600); -@set_time_limit(600);//30min pathInfoMuti,search,upload,download... -@ini_set('display_errors',0); +ini_set('session.cache_expire',600); +set_time_limit(600);//30min pathInfoMuti,search,upload,download... +ini_set('display_errors',0); function P($path){return str_replace('\\','/',$path);} define('WEB_ROOT',str_replace(P($_SERVER['SCRIPT_NAME']),'',P(dirname(dirname(__FILE__))).'/index.php').'/'); @@ -79,5 +79,5 @@ session_start(); session_write_close();//之后要修改$_SESSION 需要先调用session_start() $config['autorun'] = array( array('controller'=>'user','function'=>'loginCheck'), - array('controller'=>'user','function'=>'authCheck'), + array('controller'=>'user','function'=>'authCheck') ); \ No newline at end of file diff --git a/config/version.php b/config/version.php index 8cfd7bc..0ae83e9 100644 --- a/config/version.php +++ b/config/version.php @@ -1,2 +1,2 @@ in['path']); - if ($this->in['action'] == 'add'){ + if (isset($this->in['action']) && $this->in['action'] == 'add'){ $path .= '.oexe'; } @@ -44,7 +41,7 @@ class app extends Controller{ */ public function get() { $list = array(); - if (!$this->in['group'] || $this->in['group']=='all') { + if (!isset($this->in['group']) || $this->in['group']=='all') { $list = $this->sql->get(); }else{ $list = $this->sql->get('group','',$this->in['group']); diff --git a/controller/desktop.class.php b/controller/desktop.class.php index 2eef70a..16d335e 100644 --- a/controller/desktop.class.php +++ b/controller/desktop.class.php @@ -7,17 +7,11 @@ */ class desktop extends Controller{ - /** - * 构造函数 - */ function __construct() { parent::__construct(); $this->tpl = TEMPLATE.'desktop/'; } - /** - * 首页 - */ public function index() { $wall = $this->config['user']['wall']; if(strlen($wall)>3){ @@ -26,6 +20,10 @@ class desktop extends Controller{ $this->assign('wall',STATIC_PATH.'images/wall_page/'.$wall.'.jpg'); } + if (!is_dir(MYHOME.'desktop/')) { + mkdir(MYHOME.'desktop/'); + } + $upload_max = get_post_max(); $this->assign('upload_max',$upload_max); $this->display('index.php'); diff --git a/controller/editor.class.php b/controller/editor.class.php index a09ad83..1d79b02 100644 --- a/controller/editor.class.php +++ b/controller/editor.class.php @@ -7,9 +7,6 @@ */ class editor extends Controller{ - /** - * 构造函数 - */ function __construct() { parent::__construct(); $this->tpl = TEMPLATE . 'editor/'; @@ -36,8 +33,8 @@ class editor extends Controller{ $filecontents=mb_convert_encoding($filecontents,'utf-8',$charset); } $data = array( - 'ext' => end(explode('.',$filename)), - 'name' => iconv_app(end(explode('/',$filename))), + 'ext' => get_path_ext($filename), + 'name' => iconv_app(get_path_this($filename)), 'filename' => rawurldecode($this->in['filename']), 'charset' => $charset, 'content' => $filecontents diff --git a/controller/explorer.class.php b/controller/explorer.class.php index 9876a1d..9971f5a 100644 --- a/controller/explorer.class.php +++ b/controller/explorer.class.php @@ -7,9 +7,6 @@ */ class explorer extends Controller{ - /** - * 构造函数 - */ public $path; public function __construct(){ parent::__construct(); @@ -20,7 +17,7 @@ class explorer extends Controller{ } public function index(){ - if($this->in['path'] !=''){ + if(isset($this->in['path']) && $this->in['path'] !=''){ $dir = $_GET['path']; }else if(isset($_SESSION['this_path'])){ $dir = $_SESSION['this_path']; @@ -30,7 +27,7 @@ class explorer extends Controller{ } $dir = rtrim($dir,'/').'/'; $is_frame = false;//是否以iframe方式打开 - if ($this->in['type'] == 'iframe') $is_frame = true;// + if (isset($this->in['type']) && $this->in['type'] == 'iframe') $is_frame = true;// $upload_max = get_post_max(); $this->assign('upload_max',$upload_max); $this->assign('is_frame',$is_frame); @@ -40,7 +37,7 @@ class explorer extends Controller{ public function pathInfo(){ $path = $this->path; - $type=$this->in['type']; + $type= $this->in['type']; if ($type=="folder"){ $data = path_info($path,$this->L['time_type_info']); }else{ @@ -109,8 +106,11 @@ class explorer extends Controller{ } public function treeList(){//树结构 $app = $this->in['app'];//是否获取文件 传folder|file - if ($this->in['type']=='init') $this->_tree_init($app); - if ($this->in['this_path']){ + if (isset($this->in['type']) && $this->in['type']=='init'){ + $this->_tree_init($app); + } + + if (isset($this->in['this_path'])){ $path=_DIR($this->in['this_path']); }else{ $path=_DIR($this->in['path'].$this->in['name']); @@ -277,14 +277,31 @@ class explorer extends Controller{ foreach ($clipboard as $val) { $path_copy = _DIR($val['path']); $filename = get_path_this($path_copy); - if ($clipboard[$i]['type'] == 'folder') { - @rename($path_copy,$path_past.$filename.'/'); - }else{ - @rename($path_copy,$path_past.$filename); - } + @rename($path_copy,$path_past.$filename); } show_json($this->L['success']); - } + } + + public function pathCopyDrag(){ + $clipboard = json_decode($this->in['list'],true); + $path_past=$this->path; + $data = array(); + if (!is_writable($path_past)) show_json($this->L['no_permission'],false); + foreach ($clipboard as $val) { + $path_copy = _DIR($val['path']); + $path = ''; + if ($val['type'] == 'folder') { + $path = get_path_same_next($path_past,get_path_this($path_copy),'folder'); + copy_dir($path_copy,$path); + }else{ + $path = get_path_same_next($path_past,get_path_this($path_copy),'file'); + copy($path_copy,$path); + } + $data[] = iconv_app(get_path_this($path)); + } + show_json($data,true); + } + public function clipboard(){ $clipboard = json_decode($_SESSION['path_copy'],true); $msg = ''; @@ -338,8 +355,7 @@ class explorer extends Controller{ copy_dir($path_copy,$path_past.$filename); }else{ copy($path_copy,$path_past.$filename); - } - + } }else{ if ($cute_list[$i]['type'] == 'folder') { rename($path_copy,$path_past.$filename.'/'); diff --git a/controller/fav.class.php b/controller/fav.class.php index dc439d0..11a2aae 100644 --- a/controller/fav.class.php +++ b/controller/fav.class.php @@ -7,11 +7,8 @@ */ class fav extends Controller{ - /** - * 构造函数 - */ private $sql; - function __construct() { + function __construct(){ parent::__construct(); $this->sql=new fileCache($this->config['user_fav_file']); } diff --git a/controller/group.class.php b/controller/group.class.php index d7d30bc..5370635 100644 --- a/controller/group.class.php +++ b/controller/group.class.php @@ -6,11 +6,7 @@ * @license http://kalcaddle.com/tools/licenses/license.txt */ -class group extends Controller -{ - /** - * 构造函数 - */ +class group extends Controller{ private $sql; function __construct() { parent::__construct(); @@ -23,8 +19,7 @@ class group extends Controller /** * 用户添加 */ - public function add() - { + public function add(){ $group = $this->_init_data(); if($this->sql->add($this->in['role'],$group)){ show_json($this->L['success']); @@ -35,8 +30,7 @@ class group extends Controller /** * 编辑 */ - public function edit() - { + public function edit(){ $group = $this->_init_data(); $role_old = $this->in['role_old']; if (!$role_old) show_json($this->L["groupname_can_not_null"],false); diff --git a/controller/member.class.php b/controller/member.class.php index b5280d9..5321769 100644 --- a/controller/member.class.php +++ b/controller/member.class.php @@ -6,11 +6,7 @@ * @license http://kalcaddle.com/tools/licenses/license.txt */ -class member extends Controller -{ - /** - * 构造函数 - */ +class member extends Controller{ private $sql; function __construct() { parent::__construct(); @@ -27,8 +23,7 @@ class member extends Controller /** * 用户添加 */ - public function add() - { + public function add(){ if (!$this->in['name'] || !$this->in['password'] || !$this->in['role'] ) show_json($this->L["data_not_full"],false); @@ -48,8 +43,7 @@ class member extends Controller /** * 编辑 */ - public function edit() - { + public function edit() { if (!$this->in['name'] || !$this->in['name_to'] || !$this->in['role_to'] ) show_json($this->L["data_not_full"],false); diff --git a/controller/setting.class.php b/controller/setting.class.php index 8d461f0..3fb0dad 100644 --- a/controller/setting.class.php +++ b/controller/setting.class.php @@ -7,9 +7,6 @@ */ class setting extends Controller{ - /** - * 构造函数 - */ private $sql; function __construct() { parent::__construct(); diff --git a/controller/user.class.php b/controller/user.class.php index 71a06da..bcc147b 100644 --- a/controller/user.class.php +++ b/controller/user.class.php @@ -10,11 +10,7 @@ class user extends Controller { private $user; //用户相关信息 private $auth; //用户所属组权限 - /** - * 构造函数 - */ - function __construct() - { + function __construct(){ parent::__construct(); $this->tpl = TEMPLATE . 'user/'; $this->user = &$_SESSION['user']; @@ -40,10 +36,9 @@ class user extends Controller /** * 登陆状态检测;并初始化数据状态 */ - public function loginCheck() - { + public function loginCheck(){ $this->authApi();//api方式验证 - if($_SESSION['isLogin'] === true){ + if(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true){ define('USER',USER_PATH.$this->user['name'].'/'); if (!file_exists(USER)) { $this->logout(); @@ -82,26 +77,41 @@ class user extends Controller $this->login(); } + /** * 登陆view */ - public function login($msg = '') - { + public function login($msg = ''){ + if(isset($_SESSION['isLogin']) && $_SESSION['isLogin'] === true){ + header('location:./index.php'); + return; + } $this->assign('msg',$msg); $this->display('login.html'); exit; } + + /** + * 退出处理 + */ + public function logout(){ + session_start(); + setcookie('kod_name', null, time()-3600); + setcookie('kod_token', null, time()-3600); + session_destroy(); + header('location:./index.php?user/login'); + } + /** * 登陆数据提交处理 */ - public function loginSubmit() - { - $name = $this->in['name']; - if(empty($name) || empty($this->in['password'])) { + public function loginSubmit(){ + if(!isset($this->in['name']) || !isset($this->in['password'])) { $msg = $this->L['login_not_null']; }else{ //错误三次输入验证码 session_start();//re start + $name = $this->in['name']; if(intval($_SESSION['code_error_time']) >=3 && $_SESSION['check_code'] !== strtolower($this->in['check_code'])){ $this->login($this->L['code_error']); @@ -122,7 +132,7 @@ class user extends Controller setcookie('kod_name', $user['name'], time()+3600*24*365); setcookie('kod_token',md5($user['password'].get_client_ip()), time()+3600*24*365); } - header('location:./'); + header('location:./index.php'); return; }else{ $_SESSION['code_error_time'] = intval($_SESSION['code_error_time']) + 1; @@ -132,23 +142,10 @@ class user extends Controller $this->login($msg); } - /** - * 退出处理 - */ - public function logout() - { - session_start(); - setcookie('kod_name', null, time()-3600); - setcookie('kod_token', null, time()-3600); - session_destroy(); - header('location:./?user/login'); - } - /** * 修改密码 */ - public function changePassword() - { + public function changePassword(){ $password_now=$this->in['password_now']; $password_new=$this->in['password_new']; if (!$password_now && !$password_new)show_json($this->L['password_not_null'],false); diff --git a/data/User/admin/data/config.php b/data/User/admin/data/config.php index 6dd2ca4..9d36c9b 100644 --- a/data/User/admin/data/config.php +++ b/data/User/admin/data/config.php @@ -1 +1 @@ -{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"8","musictheme":"qqmusic","movietheme":"webplayer"} \ No newline at end of file +{"list_type":"icon","list_sort_field":"name","list_sort_order":"up","theme":"metro\/","codetheme":"github","wall":"9","musictheme":"qqmusic","movietheme":"webplayer"} \ No newline at end of file diff --git a/data/User/admin/data/fav.php b/data/User/admin/data/fav.php index f62c74d..7c4965c 100644 --- a/data/User/admin/data/fav.php +++ b/data/User/admin/data/fav.php @@ -1 +1 @@ -{"0.000":{"name":"0.000","path":"D:\/wwwroot\/0.000\/"},"config":{"name":"config","path":"D:\/wwwroot\/tools\/eXtplorer\/config"},"kod":{"name":"kod","path":"D:\/wwwroot\/www\/kod"},"\u5e7b\u4e61":{"name":"\u5e7b\u4e61","path":"D:\/wwwroot\/www\/kod\/dev\/data\/public\/images\/\u6211\u7684\u6536\u85cf\/\u5e7b\u4e61"}} \ No newline at end of file +{"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\/"}} \ No newline at end of file diff --git a/data/i18n/en/main.php b/data/i18n/en/main.php index a957a09..f0e51e2 100644 --- a/data/i18n/en/main.php +++ b/data/i18n/en/main.php @@ -68,14 +68,15 @@ $L = array( "public_path" => "Public path", //right - "file" => "file", - "folder" => "folder", - "copy" => "copy", - "past" => "paste", - "cute" => "cut", - "remove" => "delete", + "file" => "File", + "folder" => "Folder", + "copy" => "Copy", + "clone" => "Duplicate", + "past" => "Paste", + "cute" => "Cut", + "remove" => "Delete", "info" => "get info", - "list_type" => "view", + "list_type" => "View", "list_icon" => "icons", "list_list" => "list", "sort_up" => "asc", diff --git a/data/i18n/zh_CN/main.php b/data/i18n/zh_CN/main.php index dcd889e..69b5898 100644 --- a/data/i18n/zh_CN/main.php +++ b/data/i18n/zh_CN/main.php @@ -73,6 +73,7 @@ $L= array( "folder" => "文件夹", "copy" => "复制", "past" => "粘贴", + "clone" => "创建副本", "cute" => "剪切", "remove" => "删除", "info" => "属性", diff --git a/data/i18n/zh_TW/main.php b/data/i18n/zh_TW/main.php index 034b289..51ee8a4 100644 --- a/data/i18n/zh_TW/main.php +++ b/data/i18n/zh_TW/main.php @@ -72,6 +72,7 @@ $L= array( "file" => "檔", "folder" => "檔夾", "copy" => "複製", + "clone" => "创建副本", "past" => "粘貼", "cute" => "剪切", "remove" => "刪除", diff --git a/lib/function/file.function.php b/lib/function/file.function.php index 3c1190d..456a23e 100644 --- a/lib/function/file.function.php +++ b/lib/function/file.function.php @@ -118,7 +118,33 @@ function get_filename_auto($path){ * 获取扩展名 */ function get_path_ext($path){ - return strtolower(end(explode('.',$path))); + $arr = explode('.',$path); + $ext = end($arr); + return strtolower($ext); +} + +/** + * 获取扩展名 + */ +function get_path_same_next($path,$name,$type){ + if (!file_exists($path)) return ''; + $temp = $name; + $i = 1; + if ($type=='folder') { + while(file_exists($path.$name)) { + $name = $temp.'('.$i.')'; + $i++; + } + }else{ + $temp_ext = get_path_ext($temp); + $temp_extp = strlen($temp_ext)>0?$temp_ext='.'.$temp_ext:''; + $temp_pre = substr($temp,0,-strlen($temp_extp)); + while(file_exists($path.$name)){ + $name = $temp_pre.'('.$i.')'.$temp_extp; + $i++; + } + } + return $path.$name; } /** @@ -306,6 +332,8 @@ function del_dir($dir){ */ function copy_dir($source, $dest){ + if (!$dest) return false; + if ($source == substr($dest,0,strlen($source))) return;//防止无限递归 $result = false; if (is_file($source)) { if ($dest[strlen($dest)-1] == '/') { @@ -315,7 +343,7 @@ function copy_dir($source, $dest){ } $result = copy($source, $__dest); chmod($__dest, 0755); - } elseif (is_dir($source)) { + }elseif (is_dir($source)) { if ($dest[strlen($dest)-1] == '/') { $dest = $dest . basename($source); mkdir($dest, 0755); @@ -334,9 +362,7 @@ function copy_dir($source, $dest){ } } closedir($dirHandle); - } else { - $result = false; - } + } return $result; } diff --git a/static/js/_dev/common/core.js b/static/js/_dev/common/core.js index b80f782..7c3d943 100644 --- a/static/js/_dev/common/core.js +++ b/static/js/_dev/common/core.js @@ -72,8 +72,16 @@ define(function(require, exports) { }, ajaxError:function(XMLHttpRequest, textStatus, errorThrown){ core.tips.close(LNG.system_error,false); - var error = '
'+XMLHttpRequest.responseText+'
'; + var response = XMLHttpRequest.responseText; + var error = '
'+response+'
'; var dialog = $.dialog.list['ajaxErrorDialog']; + + //已经退出 + if (response.substr(0,17) == '') { + FrameCall.goRefresh(); + return; + } + if (dialog) { dialog.content(error); }else{ @@ -92,7 +100,7 @@ define(function(require, exports) { setting:function(setting){ if (setting == undefined) setting = ''; if (window.top.frames["Opensetting_mode"] == undefined) { - $.dialog.open('?setting#'+setting,{ + $.dialog.open('./index.php?setting#'+setting,{ id:'setting_mode', fixed:true, resize:true, @@ -289,6 +297,10 @@ define(function(require, exports) { $message.hide().html(LNG.search_info).fadeIn(fade); return; } + if (param.search.length<=1) { + $message.hide().html('too short!').fadeIn(fade); + return; + } $.ajax({ url:'index.php?explorer/search', dataType:'json', @@ -384,7 +396,7 @@ define(function(require, exports) { core.tips.tips(urls.length + LNG.server_dwonload_desc); for (var i=0; i dragCopyOffset || + Math.abs(e.pageY-boxTop) > dragCopyOffset) { + ui.path.copyDrag(dragTo,isDragCurrent); + } + }else if (!isDragCurrent){ + dragTo = dragTo+fileLight.name($('.selectDragTemp')); ui.path.cuteDrag(dragTo); } }; diff --git a/static/js/_dev/src/edit/edit.js b/static/js/_dev/src/edit/edit.js index 042c75f..83a2e7a 100644 --- a/static/js/_dev/src/edit/edit.js +++ b/static/js/_dev/src/edit/edit.js @@ -53,11 +53,11 @@ define(function(require, exports) { var load = art.dialog({title:false,content:LNG.getting,icon:'warning'}); $.ajax({ dataType:'json', - url:'./?editor/fileGet&filename='+filename, - error:function(data) { + url:'./index.php?editor/fileGet&filename='+filename, + error:function(XMLHttpRequest, textStatus, errorThrown) { load.close(); _removeData(initData.uuid); - Tips.tips(LNG.system_error,false); + core.ajaxError(XMLHttpRequest, textStatus, errorThrown); }, success: function(result) { load.close(); @@ -218,7 +218,7 @@ define(function(require, exports) { } if (key == 'theme') { $.ajax({ - url:'?setting/set&k=codetheme&v='+value, + url:'./index.php?setting/set&k=codetheme&v='+value, dataType:'json', success:function(data){ tips(data); @@ -254,7 +254,7 @@ define(function(require, exports) { type:'POST', async:false, dataType:'json', - url:'?editor/fileSave', + url:'./index.php?editor/fileSave', data:'path='+filename+'&charset='+edit_this.kod.charset+'&filestr='+html, beforeSend: function(){ Tips.loading(LNG.sending); diff --git a/static/js/_dev/src/edit/main.js b/static/js/_dev/src/edit/main.js index f50a5fd..e18dfac 100644 --- a/static/js/_dev/src/edit/main.js +++ b/static/js/_dev/src/edit/main.js @@ -11,6 +11,11 @@ define(function(require, exports, module) { rightMenu = Tap.rightMenu; preview = Toolbar.preview; + Global = { + topbar_height:40, // 头部高度 + isIE:!-[1,], // 是否ie + }; + $(document).ready(function() { Tap.init(); Toolbar.init(); diff --git a/static/js/_dev/src/explorer/fileSelect.js b/static/js/_dev/src/explorer/fileSelect.js index 7f699b4..df56ba0 100644 --- a/static/js/_dev/src/explorer/fileSelect.js +++ b/static/js/_dev/src/explorer/fileSelect.js @@ -37,16 +37,7 @@ define(function(require, exports) { $(this).addClass(Config.SelectClassName); fileLight.select(); } - }).unbind("mousedown").mousedown(function(e){ - rightMenu.hidden(); - //if (ui.isEdit()) return true; - if (e.which != 1) return true; - if (!e.ctrlKey && !e.shiftKey && !$(this).hasClass(Config.SelectClassName)) { - fileLight.clear(); - $(this).addClass(Config.SelectClassName); - fileLight.select(); - } if(e.ctrlKey) {//ctrl 跳跃选择 if ($(this).hasClass(Config.SelectClassName)) {//已经选中则反选 fileLight.resumeMenu($(this));//恢复右键菜单id @@ -73,7 +64,18 @@ define(function(require, exports) { _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(); + } + }) }).die('mouseleave').live('mouseleave',function(){ $(this).removeClass(Config.HoverClassName); @@ -105,8 +107,9 @@ define(function(require, exports) { // 拖拽——移动 select var _bindDragEvent= function(){ - var delayTime = 300; + var delayTime = 100; var leftOffset= 50; + var dragCopyOffset = 30; var topOffset = 80-Global.topbar_height; var $self; var startTime = 0; @@ -117,7 +120,7 @@ define(function(require, exports) { var screenWidth; $(Config.FileBoxClass).die('mousedown').live('mousedown',function(e){ - if (Global.shiftKey || Global.ctrlKey) return; + if (Global.shiftKey) return; if (ui.isEdit()) return true; if (e.which != 1 || isSelect) return true; $self = $(this); @@ -135,8 +138,8 @@ define(function(require, exports) { rightMenu.hidden(); isDraging = true; startTime = $.now(); - boxTop = e.pageY; - boxLeft = e.pageX; + boxTop = e.pageY; + boxLeft = e.pageX; screenHeight = $(document).height(); screenWidth = $(document).width(); }; @@ -180,9 +183,20 @@ define(function(require, exports) { $('.draggable-dragging').fadeOut(200,function(){ $(this).remove(); }); - if ($('.selectDragTemp').length != 0) { - var dragTo = G.this_path+fileLight.name($('.selectDragTemp'))+'/'; - ui.path.cuteDrag(dragTo); + + var dragTo = G.this_path; + var isDragCurrent = ($('.selectDragTemp').length == 0); + if (Global.ctrlKey) { + if (!isDragCurrent) { + dragTo = dragTo+fileLight.name($('.selectDragTemp')); + } + if (Math.abs(e.pageX-boxLeft) > dragCopyOffset || + Math.abs(e.pageY-boxTop) > dragCopyOffset) { + ui.path.copyDrag(dragTo,isDragCurrent); + } + }else if (!isDragCurrent){ + dragTo = dragTo+fileLight.name($('.selectDragTemp')); + ui.path.cuteDrag(dragTo); } }; var __makeDragBox = function(){ diff --git a/static/js/_dev/src/explorer/path.js b/static/js/_dev/src/explorer/path.js index 4a9edb5..5f0d6ca 100644 --- a/static/js/_dev/src/explorer/path.js +++ b/static/js/_dev/src/explorer/path.js @@ -167,6 +167,7 @@ define(function(require, exports) { beforeSend:function(){ $('.tools-left .msg').stop(true,true).fadeIn(100); }, + error:core.ajaxError, success:function(data){ $('.tools-left .msg').fadeOut(100); if (!data.code) { @@ -191,6 +192,7 @@ define(function(require, exports) { beforeSend:function(){ $('.tools-left .msg').stop(true,true).fadeIn(100); }, + error:core.ajaxError, success:function(data){ $('.tools-left .msg').fadeOut(100); if (!data.code) { @@ -264,7 +266,6 @@ define(function(require, exports) { core.tips.tips(LNG.path_exists,'warning'); }else{ pathOperate.newFile(G.this_path+filename,function(){ - ui.tree.checkIfChange(G.this_path); ui.f5_callback(function() { _setSelectByFilename(filename); }); @@ -281,7 +282,6 @@ define(function(require, exports) { _newFile(newname_ext); }else{ pathOperate.newFile(G.this_path+filename,function(){ - ui.tree.checkIfChange(G.this_path); ui.f5_callback(function() { _setSelectByFilename(filename); }); @@ -320,7 +320,9 @@ define(function(require, exports) { core.tips.tips(LNG.path_exists,'warning'); }else{ pathOperate.newFolder(G.this_path+filename,function(){ - ui.tree.checkIfChange(G.this_path); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } ui.f5_callback(function() { _setSelectByFilename(filename); }); @@ -336,7 +338,9 @@ define(function(require, exports) { _newFolder(); }else{ pathOperate.newFolder(G.this_path+filename,function(){ - ui.tree.checkIfChange(G.this_path); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } ui.f5_callback(function() { _setSelectByFilename(filename); }); @@ -385,7 +389,9 @@ define(function(require, exports) { path =urlEncode(G.this_path+selectid); rname_to=urlEncode(G.this_path+rname_to); pathOperate.rname(path,rname_to,function(){ - ui.tree.checkIfChange(G.this_path); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } ui.f5_callback(function() { _setSelectByFilename(select_name); }); @@ -408,7 +414,9 @@ define(function(require, exports) { path =urlEncode(G.this_path+selectid); rname_to=urlEncode(G.this_path+rname_to); pathOperate.rname(path,rname_to,function(){ - ui.tree.checkIfChange(G.this_path); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } ui.f5_callback(function() { _setSelectByFilename(select_name); }); @@ -421,7 +429,9 @@ define(function(require, exports) { }; var refreshCallback=function(){//当前目录文件变化,刷新目录 ui.f5(); - ui.tree.checkIfChange(G.this_path); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } }; return { //app @@ -485,11 +495,26 @@ define(function(require, exports) { zip :function(){pathOperate.zip(_param(true),refreshCallback);}, unZip :function(){pathOperate.unZip(_param().path,ui.f5);}, cuteDrag:function(dragTo){pathOperate.cuteDrag(_param(true),dragTo,refreshCallback);}, + copyDrag:function(dragTo,isDragCurrent){ + pathOperate.copyDrag(_param(true),dragTo,function(list){ + fileLight.clear(); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } + ui.f5_callback(function() { + if (isDragCurrent){ + _setSelectByFilename(list.data); + } + }); + }); + }, info:function(){pathOperate.info(_param(true));}, past:function(){ fileLight.clear(); pathOperate.past(G.this_path,function(list){ - ui.tree.checkIfChange(G.this_path); + if (Config.pageApp == 'explorer') { + ui.tree.checkIfChange(G.this_path); + } ui.f5_callback(function() { _setSelectByFilename(list.data); }); diff --git a/static/js/_dev/src/explorer/ui.js b/static/js/_dev/src/explorer/ui.js index ce881e9..e9a3a43 100644 --- a/static/js/_dev/src/explorer/ui.js +++ b/static/js/_dev/src/explorer/ui.js @@ -250,6 +250,7 @@ define(function(require, exports) { case 'copy':ui.path.copy();break; case 'rname':ui.path.rname();break; case 'cute':ui.path.cute();break; + case 'clone':ui.path.copyDrag(G.this_path,true);break; case 'past':ui.path.past();break; case 'remove':ui.path.remove();break; case 'zip':ui.path.zip();break; diff --git a/static/js/_dev/src/setting/setting.js b/static/js/_dev/src/setting/setting.js index 81b35a5..3e05dc9 100644 --- a/static/js/_dev/src/setting/setting.js +++ b/static/js/_dev/src/setting/setting.js @@ -19,7 +19,7 @@ define(function(require, exports) { window.location.href ='#'+page; $.ajax({ - url:'?setting/slider&slider='+page, + url:'./index.php?setting/slider&slider='+page, beforeSend:function (data){ $('.main').html(""); }, diff --git a/static/js/_dev/update/main.js b/static/js/_dev/update/main.js index 8a918ae..feb318a 100644 --- a/static/js/_dev/update/main.js +++ b/static/js/_dev/update/main.js @@ -61,7 +61,7 @@ define(function(require, exports) { var time = function(){var date = new Date();return parseInt(date.getTime()/1000);} var _download = function(from,to,callback){ $.ajax({ - url:'?explorer/serverDownload&save_path='+to + url:'./index.php?explorer/serverDownload&save_path='+to +'&url='+urlEncode2(from), dataType:'json', success:function(data){ diff --git a/static/js/app/src/app/main.js b/static/js/app/src/app/main.js index bcd2229..29edf8d 100644 --- a/static/js/app/src/app/main.js +++ b/static/js/app/src/app/main.js @@ -1 +1 @@ -define("app/src/app/main",["lib/jquery-lib","lib/util","lib/artDialog/jquery-artDialog","../../common/core","../../tpl/search","../../tpl/upload","./page"],function(e){e("lib/jquery-lib"),e("lib/util"),e("lib/artDialog/jquery-artDialog"),core=e("../../common/core"),App=e("./page"),App.init()}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t='
'+e.responseText+"
",a=$.dialog.list.ajaxErrorDialog;a?a.content(t):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:t})},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),o=function(){var o=template.compile(s.html);0==$(".dialog_do_search").length?(r(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:o(i)}),c(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),n(),$.dialog.list.dialog_do_search.display(!0))},n=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},c(i)},r=function(){$("#search_value,#search_ext,#search_path").keyEnter(n),$(".search_header a.button").die("click").live("click",n),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},c=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};o()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var o='
'+'
'+i+''+LNG.upload_ready+'
';$(e).find(".item").length>0?$(o).insertBefore($(e).find(".item:eq(0)")):$(e).append(o),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
{{LNG.save_path}}:
{{LNG.upload_select}}
{{LNG.upload_max_size}}:{{maxsize}}
"}}),define("app/src/app/page",[],function(){var e,t=function(){e=location.hash.split("#",2)[1],e||(e="all"),i(e),$("ul.setting li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).click(function(){e=$(this).attr("id"),i(e)}),$(".box .list").live("hover",function(){$(this).addClass("listhover")},function(){$(this).toggleClass("listhover")}).live("click",function(){var e="index.php?setting/set&k="+type+"&v="+value;$.ajax({url:e,type:"json",success:function(e){tips(e)}})}),$("a.create_app").bind("click",function(){FrameCall.father("ui.path.pathOperate.appEdit",'"","","root_add"')}),$(".app-list li .right a.button").live("click",function(){var e=json_decode($(this).parent().parent().attr("data")),t=$(this).attr("action");switch(t){case"preview":core.openApp(e);break;case"add":FrameCall.father("get","G.this_path");var a=share.data("create_app_path"),s=urlEncode(a+e.name),o="./index.php?app/user_app&action=add&path="+s;$.ajax({url:o,dataType:"json",type:"POST",data:"data="+urlEncode(json_encode(e)),success:function(e){tips(e),e.code&&FrameCall.father("ui.f5","")}});break;case"edit":FrameCall.father("ui.path.pathOperate.appEdit","'"+json_encode(e)+"','','root_edit'");break;case"del":$.ajax({url:"?app/del&name="+urlEncode(e.name),dataType:"json",beforeSend:function(){},success:function(e){tips(e),e.code&&i()}});break;default:}})},a=function(e){var t="",a="编辑 删除";G.is_root||(a="");for(var i in e){var s=e[i].icon;-1==s.search(G.static_path)&&"http"!=s.substring(0,4)&&(s=G.static_path+"images/app/"+s),t+="
  • "+e[i].name+" "+e[i].desc+"

    预览 添加 "+a+"
  • "}return t},i=function(t){(void 0==t||""==t)&&(t=e),window.location.href="#"+t,$(".selected").removeClass("selected"),$("ul.setting li#"+t).addClass("selected"),$(".main").find(".h1").html($(".selected").html());var i=$(".main .app-list");$.ajax({url:"?app/get&group="+t,dataType:"json",beforeSend:function(){},success:function(e){i.css("display","none").html(a(e.data)).fadeIn("fast")}})};return{reload:i,init:t}}); \ No newline at end of file +define("app/src/app/main",["lib/jquery-lib","lib/util","lib/artDialog/jquery-artDialog","../../common/core","../../tpl/search","../../tpl/upload","./page"],function(e){e("lib/jquery-lib"),e("lib/util"),e("lib/artDialog/jquery-artDialog"),core=e("../../common/core"),App=e("./page"),App.init()}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t=e.responseText,a='
    '+t+"
    ",i=$.dialog.list.ajaxErrorDialog;return""==t.substr(0,17)?(FrameCall.goRefresh(),void 0):(i?i.content(a):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:a}),void 0)},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("./index.php?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),o=function(){var o=template.compile(s.html);0==$(".dialog_do_search").length?(r(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:o(i)}),c(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),n(),$.dialog.list.dialog_do_search.display(!0))},n=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},c(i)},r=function(){$("#search_value,#search_ext,#search_path").keyEnter(n),$(".search_header a.button").die("click").live("click",n),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},c=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?1>=e.search.length?(a.hide().html("too short!").fadeIn(t),void 0):($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};o()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"./index.php?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var o='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(o).insertBefore($(e).find(".item:eq(0)")):$(e).append(o),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "}}),define("app/src/app/page",[],function(){var e,t=function(){e=location.hash.split("#",2)[1],e||(e="all"),i(e),$("ul.setting li").hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")}).click(function(){e=$(this).attr("id"),i(e)}),$(".box .list").live("hover",function(){$(this).addClass("listhover")},function(){$(this).toggleClass("listhover")}).live("click",function(){var e="index.php?setting/set&k="+type+"&v="+value;$.ajax({url:e,type:"json",success:function(e){tips(e)}})}),$("a.create_app").bind("click",function(){FrameCall.father("ui.path.pathOperate.appEdit",'"","","root_add"')}),$(".app-list li .right a.button").live("click",function(){var e=json_decode($(this).parent().parent().attr("data")),t=$(this).attr("action");switch(t){case"preview":core.openApp(e);break;case"add":FrameCall.father("get","G.this_path");var a=share.data("create_app_path"),s=urlEncode(a+e.name),o="./index.php?app/user_app&action=add&path="+s;$.ajax({url:o,dataType:"json",type:"POST",data:"data="+urlEncode(json_encode(e)),error:core.ajaxError,success:function(e){tips(e),e.code&&FrameCall.father("ui.f5","")}});break;case"edit":FrameCall.father("ui.path.pathOperate.appEdit","'"+json_encode(e)+"','','root_edit'");break;case"del":$.ajax({url:"./index.php?app/del&name="+urlEncode(e.name),dataType:"json",error:core.ajaxError,success:function(e){tips(e),e.code&&i()}});break;default:}})},a=function(e){var t="",a="编辑 删除";G.is_root||(a="");for(var i in e){var s=e[i].icon;-1==s.search(G.static_path)&&"http"!=s.substring(0,4)&&(s=G.static_path+"images/app/"+s),t+="
  • "+e[i].name+" "+e[i].desc+"

    预览 添加 "+a+"
  • "}return t},i=function(t){(void 0==t||""==t)&&(t=e),window.location.href="#"+t,$(".selected").removeClass("selected"),$("ul.setting li#"+t).addClass("selected"),$(".main").find(".h1").html($(".selected").html());var i=$(".main .app-list");$.ajax({url:"./index.php?app/get&group="+t,dataType:"json",beforeSend:function(){},success:function(e){i.css("display","none").html(a(e.data)).fadeIn("fast")}})};return{reload:i,init:t}}); \ No newline at end of file diff --git a/static/js/app/src/desktop/main.js b/static/js/app/src/desktop/main.js index c55593b..0f7b244 100644 --- a/static/js/app/src/desktop/main.js +++ b/static/js/app/src/desktop/main.js @@ -1,3 +1,3 @@ -define("app/src/desktop/main",["lib/jquery-lib","lib/util","lib/webuploader/webuploader-min","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","lib/picasa/picasa","../../common/taskTap","../../common/core","../../tpl/search","../../tpl/upload","../../common/rightMenu","./fileSelect","./ui","../explorer/path","../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer"],function(e){Config={BodyContent:".bodymain",FileBoxSelector:".fileContiner",FileBoxClass:".fileContiner .file",FileBoxClassName:"file",FileBoxTittleClass:".fileContiner .title",SelectClass:".fileContiner .select",SelectClassName:"select",TypeFolderClass:"folderBox",TypeFileClass:"fileBox",HoverClassName:"hover",FileOrderAttr:"number",pageApp:"desktop",navbar:"navbar",AnimateTime:200},Global={fileListAll:"",fileListNum:0,fileRowNum:0,frameLeftWidth:200,treeSpaceWide:10,topbar_height:40,ctrlKey:!1,shiftKey:!1,fileListSelect:"",fileListSelectNum:"",isIE:!-[1],isDragSelect:!1,historyStatus:{back:1,next:0}},e("lib/jquery-lib"),e("lib/util"),e("lib/webuploader/webuploader-min"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),e("lib/picasa/picasa"),TaskTap=e("../../common/taskTap"),core=e("../../common/core"),rightMenu=e("../../common/rightMenu"),fileSelect=e("./fileSelect"),ui=e("./ui"),ui.path=e("../explorer/path"),fileLight=fileSelect.fileLight,$(document).ready(function(){ui.init(),TaskTap.init(),core.update(),core.upload_init(),fileSelect.init(),rightMenu.initDesktop(),$(".init_loading").fadeOut(600),$(".bodymain").click(function(){"block"==$("#menuwin").css("display")&&$("#menuwin").css("display","none")}),$(".start").click(function(){"block"==$("#menuwin").css("display")?$("#menuwin").css("display","none"):$("#menuwin").css("display","block")}),$("#menuwin").click(function(){$("#menuwin").css("display","none")})})}),define("app/common/taskTap",[],function(){var e={},t="",a=160,i=function(){$(".task_tab .tab").die("mouseenter").live("mouseenter",function(){$(this).hasClass("this")||$(this).addClass("hover")}).die("click").live("click",function(){var e=$(this).attr("id"),t=art.dialog.list[e],a=$("."+e);"hidden"!=a.css("visibility")?t.display(!1):t.display(!0)}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("hover")}).die("dblclick").live("dblclick",function(){})},s=function(){var e,t,i,s,n=!1,o=!1,l=0,r=0,c=0,d=0,p=0,u=0;$(".task_tab .tab").die("mousedown").live("mousedown",function(){e=$(this),n=!0,this.setCapture&&this.setCapture(),$(document).mousemove(function(e){h(e)}),$(document).one("mouseup",function(e){return v(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1})});var f=function(a){o=!0,l=a.pageX,$tab_parent=$(".task_tab"),t=$(".task_tab .tab"),$(".tasktab-dragging").remove(),i=e.clone().addClass("tasktab-dragging").prependTo("body"),d=parseInt(t.css("margin-right")),p=$tab_parent.width(),u=$tab_parent.get(0).getBoundingClientRect().left,u+=$(window).scrollLeft(),r=e.get(0).getBoundingClientRect().left,c=parseInt(t.css("width"));var s=e.get(0).getBoundingClientRect().top-parseInt(e.css("margin-top")),n=a.clientX-l+r;$("body").prepend("
    "),i.css({width:c+"px",top:s,left:n}),e.css("opacity",0)},h=function(a){if(n){0==o&&f(a);var s=a.clientX-l+r;u>s||s>u+p-c||(i.css("left",s),t.each(function(){var t=$(this).get(0).getBoundingClientRect().left;if(s>t&&t+c/2+d>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"left")}if(s>t-c/2+d&&t>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"right")}}))}},m=function(i,n){if(!e.is(":animated")||s!=i){s=i,e.stop(!0,!0),$(".insertTemp").remove(),t=$(".task_tab .tab");var o=e.width(),l=$(".task_tab #"+i),r=e.clone(!0).insertAfter(e).css({"margin-right":"0px",border:"none"}).addClass("insertTemp");"left"==n?e.after(l).css("width","0px"):(e.before(l).css("width","0px"),l.before(r)),e.animate({width:o+"px"},a),r.animate({width:"0px"},a,function(){$(this).remove(),t=$(".task_tab .tab")})}},v=function(){n=!1,o=!1,startTime=0,$(".dragMaskView").remove(),void 0!=i&&(r=e.get(0).getBoundingClientRect().left,i.animate({left:r+"px"},a,function(){e.css("opacity",1),$(this).remove()}))}},n=function(e){var t=110,i=t,s=t+12,n=$(".task_tab .tab"),o=$(".task_tab .tabs").width()-50,l=n.length,r=Math.floor(o/s);switch(l>r&&(i=Math.floor(o/l)-12),e){case"add":$(".task_tab .tabs .this").css("width","0").animate({width:i+"px"},a);case"close":n.animate({width:i+"px"},a);break;case"resize":n.css("width",i+"px");break;default:}},o=function(t,a){$(".task_tab").removeClass("hidden");var i='
    '+a+"
    ";$(i).insertBefore(".task_tab .last"),n("add"),e[t]={id:t,name:name}},l=function(e){$(".task_tab .this").removeClass("this"),$(".task_tab #"+e).addClass("this"),t=e},r=function(t){delete e[t],$(".task_tab #"+t).animate({width:0},a,function(){$(".task_tab #"+t).remove(),n("close"),0==$(".tabs .tab").length&&$(".task_tab").addClass("hidden")})};return{add:o,focus:l,close:r,init:function(){var e='';$(e).appendTo("body"),$(window).bind("resize",function(){n("resize")}),i(),s()}}}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t='
    '+e.responseText+"
    ",a=$.dialog.list.ajaxErrorDialog;a?a.content(t):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:t})},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),n=function(){var n=template.compile(s.html);0==$(".dialog_do_search").length?(l(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:n(i)}),r(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),o(),$.dialog.list.dialog_do_search.display(!0))},o=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},r(i)},l=function(){$("#search_value,#search_ext,#search_path").keyEnter(o),$(".search_header a.button").die("click").live("click",o),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},r=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};n()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var n='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(n).insertBefore($(e).find(".item:eq(0)")):$(e).append(n),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "}}),define("app/common/rightMenu",[],function(){var e=".menufile",t=".menufolder",a=".menuMore",i=".menuApp",s=".menuTreeFav",n=".menuTreeRoot",o=".menuTreeFolder",l=".menuTreeFile",r=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),p(),h(),m(),_(),b(),N(),x(),v(),j(),C(),L(),$(".set_set"+G.list_type).addClass("selected"),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},c=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),f(),v(),u(),h(),m(),C(),j(),_(),L(),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},d=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),b(),N(),v(),C(),j(),k(),w(),L()},p=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e,t){g(e,t)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep1:"--------",listIcon:{name:LNG.list_type,accesskey:"v",icon:"eye-open",items:{seticon:{name:LNG.list_icon,className:"seticon",icon:"th",accesskey:"i",className:"menu_seticon set_seticon"},setlist:{name:LNG.list_list,className:"setlist",icon:"list",accesskey:"l",className:"menu_seticon set_setlist"}}},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},u=function(){$.contextMenu({selector:".menuDefault",zIndex:9999,items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"}},callback:function(e){switch(e){case"open":ui.path.open();break;default:}}})},f=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e){g(e)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep1:"--------",upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",full:{name:LNG.full_screen,className:"full",icon:"fullscreen",accesskey:"m"},setting_wall:{name:LNG.setting_wall,className:"setting_wall",icon:"picture",accesskey:"w"},setting:{name:LNG.setting,className:"setting",icon:"cogs",accesskey:"s"}}})},h=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:t,className:t,callback:function(e){y(e)},items:{open:{name:LNG.open,className:"open",icon:"folder-open-alt",accesskey:"o"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},m=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:e,className:t,callback:function(e){y(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},open_text:{name:LNG.edit,className:"open_text",icon:"edit",accesskey:"e"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},newfileOther:{name:LNG.open_with,accesskey:"h",items:{open_text:{name:LNG.edit,className:"open_text",icon:"edit"},open_kindedit:{name:LNG.others,className:"open_kindedit",icon:"edit"}}},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},unzip:{name:LNG.unzip,className:"unzip",icon:"folder-open-alt",accesskey:"u"},down:{name:LNG.download,className:"down",icon:"download",accesskey:"x"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},v=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:i,className:t,callback:function(e){"editor"==Config.pageApp?z(e):y(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},app_edit:{name:LNG.app_edit,className:"app_edit",icon:"code",accesskey:"a"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},_=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:a,className:t,callback:function(e){y(e)},items:{copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep1:"--------",playmedia:{name:LNG.add_to_play,className:"playmedia",icon:"music",accesskey:"p"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},g=function(e){switch(e){case"refresh":ui.f5(!0,!0);break;case"back":ui.path.back();case"next":ui.path.next();break;case"seticon":ui.setListType("icon");break;case"setlist":ui.setListType("list");break;case"set_sort_name":ui.setListSort("name",0);break;case"set_sort_ext":ui.setListSort("ext",0);break;case"set_sort_size":ui.setListSort("size",0);break;case"set_sort_mtime":ui.setListSort("mtime",0);break;case"set_sort_up":ui.setListSort(0,"up");break;case"set_sort_down":ui.setListSort(0,"down");break;case"upload":core.upload();break;case"past":ui.path.past();break;case"copy_see":ui.path.clipboard();break;case"newfolder":ui.path.newFolder();break;case"newfile":ui.path.newFile();break;case"newfile_html":ui.path.newFile("html");break;case"newfile_php":ui.path.newFile("php");break;case"newfile_js":ui.path.newFile("js");break;case"newfile_css":ui.path.newFile("css");break;case"newfile_oexe":ui.path.newFile("oexe");break;case"info":ui.path.info();break;case"open":ui.path.open();break;case"open_new":ui.path.open_new();break;case"app_install":ui.path.appList();break;case"app_create":ui.path.appEdit(!0);break;case"full":ui.fullScreen();break;case"setting":core.setting();break;case"setting_wall":core.setting("wall");break;default:}},y=function(e){switch(e){case"open":ui.path.open();break;case"down":ui.path.download();break;case"open_ie":ui.path.openIE();break;case"open_text":ui.path.openEditor();break;case"app_edit":ui.path.appEdit();case"open_kindedit":break;case"playmedia":ui.path.play();break;case"fav":ui.path.fav();break;case"search":ui.path.search();break;case"copy":ui.path.copy();break;case"cute":ui.path.cute();break;case"remove":ui.path.remove();break;case"rname":ui.path.rname();break;case"zip":ui.path.zip();break;case"unzip":ui.path.unZip();break;case"info":ui.path.info();break;default:}},b=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:s,callback:function(e){z(e)},items:{fav_page:{name:LNG.manage_fav,className:"fav_page",icon:"star",accesskey:"r"},refresh_all:{name:LNG.refresh_tree,className:"refresh_all",icon:"refresh",accesskey:"e"},sep1:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},N=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:n,callback:function(e){z(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},sep3:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},x=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:o,callback:function(e){z(e)},items:{refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}}) -},k=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:o,callback:function(e){z(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},sep2:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep4:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},sep5:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},w=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:l,callback:function(e){z(e)},items:{edit:{name:LNG.edit,className:"edit",icon:"edit",accesskey:"e"},open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},openIE:{name:LNG.open_ie,className:"openIE",icon:"globe",accesskey:"b"},download:{name:LNG.download,className:"download",icon:"download",accesskey:"x"},sep1:"--------",rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},L=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".taskBarMenu",items:{quitOthers:{name:LNG.close_others,className:"quitOthers",icon:"remove-circle",accesskey:"o"},quit:{name:LNG.close,className:"quit",icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quitOthers":$.each(art.dialog.list,function(e,t){a!=e&&t.close()});break;case"quit":i.close()}}})},C=function(){$.contextMenu({zIndex:9999,selector:".task_tab",items:{closeAll:{name:LNG.dialog_close_all,icon:"remove-circle",accesskey:"o"},showAll:{name:LNG.dialog_display_all,icon:"th-large",accesskey:"o"},hideAll:{name:LNG.dialog_min_all,icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id");switch(art.dialog.list[a],e){case"showAll":$.each(art.dialog.list,function(e,t){t.display(!0)});break;case"hideAll":$.each(art.dialog.list,function(e,t){t.display(!1)});break;case"closeAll":$.each(art.dialog.list,function(e,t){t.close()});break;default:}}})},j=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".dialog_menu",items:{quit:{name:LNG.close,icon:"remove",accesskey:"o"},hide:{name:LNG.dialog_min,icon:"minus",accesskey:"o"},refresh:{name:LNG.refresh,icon:"refresh",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quit":i.close();break;case"hide":i.display(!1);break;case"refresh":i.refresh();break;default:}}})},z=function(e){switch(e){case"app_edit":ui.tree.appEdit();break;case"edit":ui.tree.openEditor();break;case"open":ui.tree.open();break;case"refresh":ui.tree.refresh();break;case"copy":ui.tree.copy();break;case"cute":ui.tree.cute();break;case"past":ui.tree.past();break;case"rname":ui.tree.rname();break;case"remove":ui.tree.remove();break;case"info":ui.tree.info();break;case"download":ui.tree.download();break;case"openIE":ui.tree.openIE();break;case"search":ui.tree.search();break;case"newfolder":ui.tree.create("folder");break;case"newfile":ui.tree.create("file");break;case"explorer":ui.tree.explorer();break;case"fav_page":core.setting("fav");break;case"fav":ui.tree.fav();break;case"refresh_all":ui.tree.init();break;case"quit":break;default:}};return{initDesktop:c,initExplorer:r,initEditor:d,show:function(e,t,a){e&&(rightMenu.hidden(),$(e).contextMenu({x:t,y:a}))},isDisplay:function(){var e=!1;return $(".context-menu-list").each(function(){"none"!=$(this).css("display")&&(e=!0)}),e},hidden:function(){$(".context-menu-list").filter(":visible").trigger("contextmenu:hide")}}}),define("app/src/desktop/fileSelect",[],function(){var e=!1,t=!1,a=function(){s(),i(),n()},i=function(){$(Config.FileBoxClass).die("touchstart").live("touchstart",function(){$(this).hasClass("select")?ui.path.open():(c.clear(),$(this).removeClass("select"),$(this).addClass("select"),c.select())}),$(Config.FileBoxClass).live("mouseenter",function(){t&&$(this).hasClass(Config.TypeFolderClass)&&!$(this).hasClass(Config.SelectClassName)&&$(this).addClass("selectDragTemp"),e||t||$(this).addClass(Config.HoverClassName),$(this).unbind("mouseup").mouseup(function(e){3!=e.which||$(this).hasClass(Config.SelectClassName)||(c.clear(),$(this).addClass(Config.SelectClassName),c.select())}).unbind("mousedown").mousedown(function(e){if(rightMenu.hidden(),1!=e.which)return!0;if(e.ctrlKey||e.shiftKey||$(this).hasClass(Config.SelectClassName)||(c.clear(),$(this).addClass(Config.SelectClassName),c.select()),e.ctrlKey)$(this).hasClass(Config.SelectClassName)?(c.resumeMenu($(this)),$(this).removeClass(Config.SelectClassName)):(c.setMenu($(this)),$(this).addClass(Config.SelectClassName)),c.select();else if(e.shiftKey){var t=parseInt($(this).attr(Config.FileOrderAttr));if(0==Global.fileListSelectNum)r(0,t);else{var a=parseInt(Global.fileListSelect.first().attr(Config.FileOrderAttr)),i=parseInt(Global.fileListSelect.last().attr(Config.FileOrderAttr));a>t?r(t,a):t>i?r(i,t):t>a&&i>t&&r(a,t)}}})}).unbind("mouseleave").live("mouseleave",function(){$(this).removeClass(Config.HoverClassName),$(this).removeClass("selectDragTemp")}).unbind("click").live("click",function(e){stopPP(e),e.ctrlKey||e.shiftKey||!$(this).hasClass(Config.SelectClassName)||(c.clear(),$(this).removeClass(Config.SelectClassName),$(this).addClass(Config.SelectClassName),c.select())}),$(Config.FileBoxClass).unbind("dblclick").live("dblclick",function(e){stopPP(e),e.altKey?ui.path.pathInfo():ui.path.open()}),$(Config.FileBoxTittleClass).unbind("dblclick").live("dblclick",function(e){return ui.path.rname(),stopPP(e),!1})},s=function(){var a,i,s,n=300,o=50,l=80-Global.topbar_height,r=0,d=!1,p=0,u=0;$(Config.FileBoxClass).unbind("mousedown").live("mousedown",function(t){if(!Global.shiftKey&&!Global.ctrlKey){if(ui.isEdit())return!0;if(1!=t.which||e)return!0;a=$(this),f(t),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){h(e)}),$(document).one("mouseup",function(e){return m(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1})}});var f=function(e){rightMenu.hidden(),t=!0,r=$.now(),p=e.pageY,u=e.pageX,i=$(document).height(),s=$(document).width()},h=function(e){if(!t)return!0;$.now()-r>n&&!d&&v();var a=e.clientX>=s-50?s-50:e.clientX,c=e.clientY>=i-50?i-50:e.clientY;a=0>=a?0:a,c=0>=c?0:c,a-=o,c-=l,$(".draggable-dragging").css("left",a),$(".draggable-dragging").css("top",c),Global.isIE&&$("."+Config.TypeFolderClass).each(function(){var t=e.pageX,a=e.pageY,i=$(this).offset(),s=$(this).width(),n=$(this).height();t>i.left&&i.left+s>t&&a>i.top&&i.top+n>a?$(this).addClass("selectDragTemp"):$(this).removeClass("selectDragTemp")})},m=function(){if(!t)return!1;if(t=!1,d=!1,$("body").css("cursor","auto"),$(".draggable-dragging").fadeOut(200,function(){$(this).remove()}),0!=$(".selectDragTemp").length){var e=G.this_path+c.name($(".selectDragTemp"))+"/";ui.path.cuteDrag(e)}},v=function(){d=!0,$("body").css("cursor","move"),a.find(".ico").attr("filetype"),$('
    '+Global.fileListSelectNum+"
    "+'
    '+"
    ").appendTo("body")}},n=function(){var a=null,i=null,s=null;$(Config.BodyContent).unbind("mousedown").live("mousedown",function(e){return ui.isEdit()?!0:t||1!=e.which?!0:(n(e),this.setCapture&&this.setCapture(),$(document).unbind("mousemove").mousemove(function(e){o(e)}),$(document).one("mouseup",function(e){l(e),Global.isDragSelect=!0,this.releaseCapture&&this.releaseCapture()}),void 0)});var n=function(t){$(t.target).parent().hasClass(Config.FileBoxClassName)||$(t.target).parent().parent().hasClass(Config.FileBoxClassName)||$(t.target).hasClass("fix")||(rightMenu.hidden(),t.ctrlKey||t.shiftKey||c.clear(),0==$(t.target).hasClass("ico")&&(0==$("#selContainer").length&&($('
    ').appendTo(Config.FileBoxSelector),s=$("#selContainer")),a=t.pageX,i=t.pageY-Global.topbar_height,e=!0))},o=function(t){if(!e)return!0;"none"==s.css("display")&&s.css("display","");var n=t.pageX,o=t.pageY-Global.topbar_height;s.css({left:Math.min(n,a),top:Math.min(o,i),width:Math.abs(n-a),height:Math.abs(o-i)});for(var l=s.offset().left,r=s.offset().top-Global.topbar_height,d=s.width(),p=s.height(),u=Global.fileListNum,f=0;u>f;f++){var h=Global.fileListAll[f],m=$(Global.fileListAll[f]),v=h.offsetWidth+h.offsetLeft,_=h.offsetHeight+h.offsetTop;if(v>l&&_>r&&l+d>h.offsetLeft&&r+p>h.offsetTop){if(!m.hasClass("selectDragTemp")){if(m.hasClass("selectToggleClass"))continue;if(m.hasClass(Config.SelectClassName)){m.removeClass(Config.SelectClassName).addClass("selectToggleClass"),c.resumeMenu(m);continue}m.addClass("selectDragTemp")}}else m.removeClass("selectDragTemp"),m.hasClass("selectToggleClass")&&m.addClass(Config.SelectClassName).removeClass("selectToggleClass")}},l=function(){return e?(s.css("display","none"),$(".selectDragTemp").addClass(Config.SelectClassName).removeClass("selectDragTemp"),$(".selectToggleClass").removeClass("selectToggleClass"),c.select(),e=!1,a=null,i=null,void 0):!1}},o=function(e){var t=0,a=Global.fileListSelect;Global.fileListSelectNum;var i=Global.fileListNum,s=function(){var s=Global.fileRowNum;if(1==Global.fileListSelectNum){var n=parseInt(a.attr(Config.FileOrderAttr));switch(e){case"up":t=0>=n?n:n-1;break;case"left":t=s>n?0:n-s;break;case"down":t=n>=i-1?n:n+1;break;case"right":t=n+s>=i-1?i-1:n+s;break;default:}}else if(Global.fileListSelectNum>1){var o=parseInt(a.first().attr(Config.FileOrderAttr)),l=parseInt(a.last().attr(Config.FileOrderAttr));switch(e){case"up":t=t=0>=o?o:o-1;break;case"left":break;case"down":t=l>=i?l:l+1;break;case"right":t=l+s>=i?l:l+s;break;default:}}};return s(),Global.fileListAll.eq(t)},l=function(e){var t;switch(e){case"home":t=Global.fileListAll.first();break;case"end":t=Global.fileListAll.last();break;case"left":case"up":case"right":case"down":t=o(e);break;case"all":t=Global.fileListAll;break;default:}c.clear(),t.addClass(Config.SelectClassName),c.select()},r=function(e,t){c.clear();for(var a=e;t>=a;a++)$(Global.fileListAll[a]).addClass(Config.SelectClassName);c.select()},c={init:function(){var e=$(Config.FileBoxClass);e.each(function(e){$(this).attr(Config.FileOrderAttr,e)}),Global.fileListSelect="",Global.fileListAll=e,Global.fileListNum=e.length,Global.fileListSelectNum=0},select:function(){var e=$(Config.SelectClass);Global.fileListSelect=e,Global.fileListSelectNum=e.length,e.length>1&&c.setMenu(e)},name:function(e){return e.attr("data-name")},type:function(e){return e.find(".ico").attr("filetype")},setMenu:function(e){e.removeClass("menufile menufolder menuApp menuDefault").addClass("menuMore")},resumeMenu:function(e){var t={fileApp:"menuApp",fileBox:"menufile",folderBox:"menufolder",systemBox:"menuDefault"};for(var a in t)e.hasClass(a)&&e.removeClass("menuMore").addClass(t[a])},getAllName:function(){var e=[];if(0!=Global.fileListSelectNum){var t=Global.fileListSelect;return t.each(function(){e.push(c.name($(this)))}),e}},clear:function(){if(0!=Global.fileListSelectNum){var e=Global.fileListSelect;e.removeClass(Config.SelectClassName),e.each(function(){c.resumeMenu($(this))}),Global.fileListSelect="",Global.fileListSelectNum=0}}};return{init:a,fileLight:c,selectPos:l}}),define("app/src/desktop/ui",[],function(){var e=new Picasa;PicasaOpen=!1;var t=function(){fileLight.init(),ui.setStyle(),PicasaOpen=!1,e.initData()},a=function(e,t){var t="down"==t?-1:1;return function(a,i){return a=a[e],i=i[e],i>a?-1*t:a>i?1*t:void 0}},i=function(e,t){0!=e&&(G.sort_field=e,$(".menu_set_sort").removeClass("selected"),$(".set_sort_"+e).addClass("selected")),0!=t&&(G.sort_order=t,$(".menu_set_desc").removeClass("selected"),$(".set_sort_"+t).addClass("selected")),l(!1,!0),$.ajax({url:"index.php?setting/set&k=list_sort_field,list_sort_order&v="+G.sort_field+","+G.sort_order})},s=function(){var e=91;Global.ctrlKey=!1,$(document).keydown(function(t){if("none"!=$("#PicasaView").css("display"))return!0;if(ui.isEdit())return!0;if(rightMenu.isDisplay())return!0;var a=!1;if(Global.ctrlKey||t.keyCode==e||t.ctrlKey)switch(a=!0,Global.ctrlKey=!0,t.keyCode){case 8:ui.path.remove(),a=!0;break;case 65:fileSelect.selectPos("all");break;case 67:ui.path.copy();break;case 88:ui.path.cute();break;case 83:break;case 86:ui.path.past();break;case 70:core.search($(".header-right input").val(),G.this_path);break;default:a=!1}else if(t.shiftKey)Global.shiftKey=!0;else switch(t.keyCode){case 8:a=!0;break;case 35:fileSelect.selectPos("end");break;case 36:fileSelect.selectPos("home");break;case 37:fileSelect.selectPos("left"),a=!0;break;case 38:fileSelect.selectPos("up");break;case 39:fileSelect.selectPos("right"),a=!0;break;case 40:fileSelect.selectPos("down");break;case 13:ui.path.open(),a=!1;break;case 46:ui.path.remove();break;case 113:ui.path.rname();break;default:a=!1}return a&&(stopPP(t),t.keyCode=0,t.returnValue=!1),!0}).keyup(function(t){t.shiftKey&&(Global.shiftKey=!1),t.keyCode!=e&&t.ctrlKey||(Global.ctrlKey=!1)})},n=function(){if($.browser.msie||!(0>navigator.userAgent.indexOf("Firefox"))){var e=10,t=10,a=80,i=100,s=10,n=$(document).height()-60,o=Math.floor((n-e)/(i+s)),l=0,r=0,c=0,d=0;$(".fileContiner .file").css("position","absolute"),$(".fileContiner .file").each(function(n){l=n%o,r=Math.floor(n/o),c=t+(a+s)*r,d=e+(i+s)*l,$(this).css({left:c,top:d})})}};this._getFolderBox=function(e){var t=""},this._getFileBox=function(e){var t="";if("oexe"==e.ext&&void 0!=e.icon){var a=e.icon;-1==e.icon.search(G.static_path)&&"http"!=e.icon.substring(0,4)&&(a=G.static_path+"images/app/"+e.icon);var i=urlEncode(json_encode(e)),s=e.name.replace(".oexe","");t=""}else if(inArray(core.filetype.image,e.ext)){var n=core.path2url(G.this_path+e.name),o="index.php?explorer/image&path="+urlEncode(G.this_path+e.name);t+=""}else t+="";return t};var o=function(e){var i="",s=G.json_data.folderlist,o=G.json_data.filelist;s="size"==G.sort_field||"ext"==G.sort_field?s.sort(a("name",G.sort_order)):s.sort(a(G.sort_field,G.sort_order)),o=o.sort(a(G.sort_field,G.sort_order)),G.json_data.folderlist=s,G.json_data.filelist=o;var l="",r="";for(var c in o)l+=_getFileBox(o[c]);for(var c in s)r+=_getFolderBox(s[c]);i+="up"==G.sort_order?r+l:l+r;var d="";$(".menuDefault").each(function(){d+=$(this).get(0).outerHTML}),i=d+i,i+="
    ",e?$(Config.FileBoxSelector).hide().html(i).fadeIn(Config.AnimateTime):$(Config.FileBoxSelector).html(i),t(),n()},l=function(e,t,a){if(void 0==e&&(e=!0),void 0==t&&(t=!1),e)$.ajax({url:"index.php?explorer/pathList&path="+G.this_path,dataType:"json",error:core.ajaxError,success:function(e){return e.code?(G.json_data=e.data,o(t),"function"==typeof a&&a(e),void 0):(core.tips.tips(e),$(Config.FileBoxSelector).html(""),!1)}});else{var i=fileLight.getAllName();o(t),ui.path.setSelectByFilename(i)}},r=function(e){l(!0,!1,e)};return{f5:l,f5_callback:r,picasa:e,setListSort:i,init:function(){r(function(){}),s(),$(window).bind("resize",function(){ui.setStyle(),0!=PicasaOpen&&e.setFrameResize(),n()}),$("html").die("click").live("click",function(){rightMenu.hidden(),Global.isIE&&Global.isDragSelect}),Mousetrap.bind(["ctrl+s","command+s"],function(e){e.preventDefault(),FrameCall.top("OpenopenEditor","Editor.save","")}),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 t=String.fromCharCode(e.charCode);ui.path.setSelectByChar(t)}),Mousetrap.bind(["alt+n","alt+n"],function(e){stopPP(e),ui.path.newFile()}),Mousetrap.bind(["alt+m","alt+m"],function(e){stopPP(e),ui.path.newFolder()}),PicasaOpen=!1,e.init(".picasaImage"),e.initData()},setTheme:function(e){core.setSkin(e,"app_desktop.css"),FrameCall.top("OpenopenEditor","Editor.setTheme",'"'+e+'"'),FrameCall.top("Opensetting_mode","Setting.setThemeSelf",'"'+e+'"'),FrameCall.father("ui.setTheme",'"'+e+'"')},setWall:function(e){$(".wallbackground").attr("src",e).one("load",function(){$(".desktop").css("background-image","url("+e+")")})},isEdit:function(){var e=$(document.activeElement).get(0).tagName;return"INPUT"==e||"TEXTAREA"==e?!0:!1},setStyle:function(){Global.fileRowNum=function(){var e=$(Config.FileBoxSelector).width(),t=parseInt($(Config.FileBoxClass).css("width"))+parseInt($(Config.FileBoxClass).css("border-left-width"))+parseInt($(Config.FileBoxClass).css("border-right-width"))+parseInt($(Config.FileBoxClass).css("margin-right"));return parseInt(e/t)}()},fullScreen:function(){"true"==$("body").attr("fullScreen")&&ui.exitfullScreen(),$("body").attr("fullScreen","true");var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()},exitfullScreen:function(){$("body").attr("fullScreen","false"),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}}}),define("app/src/explorer/path",["../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer"],function(e){var t=e("../../common/pathOperate"),a=e("../../common/pathOpen"),s=void 0;ui.pathOpen=a;var n=function(e,t){var a,i,s=0,n=G.json_data.folderlist,o=G.json_data.filelist;if("desktop"==Config.pageApp&&(s=$(".menuDefault").length),"folder"==t){for(a=0;n.length>a&&!(n[a].name>=e);a++);return"up"==G.sort_order?a+s:o.length+a+s}if("file"==t){for(i=0;o.length>i&&!(o[i].name>=e);i++);return"down"==G.sort_order?i+s:n.length+i+s}return-1},o=function(e){void 0!=e&&("string"==typeof e&&(e=[e]),fileLight.clear(),$(".fileContiner .file").each(function(t){var a=fileLight.name($(this));-1!=$.inArray(a,e)&&$(Global.fileListAll).eq(t).addClass(Config.SelectClassName)}),fileLight.select())},l=function(e){if(""!=e){if(e=e.toLowerCase(),void 0==s||G.this_path!=s.path||e!=s.key){var t=[];$(".fileContiner .file").each(function(){var a=fileLight.name($(this));e==a.substring(0,e.length).toLowerCase()&&t.push(a)}),s={key:e,path:G.this_path,index:0,list:t}}0!=s.list.length&&(o(s.list[s.index++]),s.index==s.list.length&&(s.index=0))}},r=function(e,t,a){var s=e.length;for(i=0;s>i;i++)if(e[i][t]==a)return e[i]},c=function(e){var t="",a=0;return null!=G.json_data.filelist&&(t=r(G.json_data.filelist,"name",e),null!=t&&(a=1)),null!=G.json_data.folderlist&&(t=r(G.json_data.folderlist,"name",e),null!=t&&(a=1)),a},d=function(e,t){var a,i=0;if(void 0==t){if(!c(e))return e;for(a=e+"(0)";c(a);)i++,a=e+"("+i+")";return a}if(!c(e+"."+t))return e+"."+t;for(a=e+"(0)."+t;c(a);)i++,a=e+"("+i+")."+t;return a},p=function(e){if(e){var t=[];return 0==Global.fileListSelect.length?t:(Global.fileListSelect.each(function(){var e=G.this_path+fileLight.name($(this)),a="folder"==fileLight.type($(this))?"folder":"file";t.push({path:e,type:a})}),t)}if(1!=Global.fileListSelectNum)return{path:"",type:""};var a=Global.fileListSelect,i=G.this_path+fileLight.name(a),s=fileLight.type(a);return{path:i,type:s}},u=function(e,t){return e==G.this_path?(void 0!=t&&core.tips.tips(LNG.path_is_current,"info"),void 0):(G.this_path=e.replace(/\\/g,"/"),G.this_path=e.replace(/\/+/g,"/"),"/"!=G.this_path.substr(G.this_path.length-1)&&(G.this_path+="/"),ui.f5(),void 0)},f=function(){$.ajax({dataType:"json",url:"index.php?explorer/historyBack",beforeSend:function(){$(".tools-left .msg").stop(!0,!0).fadeIn(100)},success:function(e){return $(".tools-left .msg").fadeOut(100),e.code?(e=e.data,G.this_path=e.thispath,G.json_data=e.list,Global.historyStatus=e.history_status,ui.f5(!1,!0),ui.header.updateHistoryStatus(),ui.header.addressSet(),void 0):(core.tips.tips(e),$(Config.FileBoxSelector).html(""),!1)}})},h=function(){$.ajax({dataType:"json",url:"index.php?explorer/historyNext",beforeSend:function(){$(".tools-left .msg").stop(!0,!0).fadeIn(100)},success:function(e){return $(".tools-left .msg").fadeOut(100),e.code?(e=e.data,G.this_path=e.thispath,G.json_data=e.list,Global.historyStatus=e.history_status,ui.f5(!1,!0),ui.header.updateHistoryStatus(),ui.header.addressSet(),void 0):(core.tips.tips(e),$(Config.FileBoxSelector).html(""),!1)}})},m=function(e){fileLight.clear(),void 0==e&&(e="txt");var a="newfile",a=d(a,e),i=n(a,"file");i=0==i?-1:i-1;var s='';-1==i?$(Config.FileBoxSelector).html(s+$(Config.FileBoxSelector).html()):$(s).insertAfter(Config.FileBoxSelector+" .file:eq("+i+")");var l=$(".newfile"),r=l.get(0),p=a.length-e.length-1;if(Global.isIE){var u=r.createTextRange();u.moveEnd("character",-r.value.length),u.moveEnd("character",p),u.moveStart("character",0),u.select()}else r.setSelectionRange(0,p);l.focus(),l.unbind("keydown").keydown(function(e){return(13==e.keyCode||27==e.keyCode)&&(stopPP(e),e.preventDefault(),filename=l.attr("value"),c(filename)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning")):t.newFile(G.this_path+filename,function(){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(filename)})})),!0}),l.unbind("blur").blur(function(){filename=l.attr("value"),c(filename)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning"),_newFile(e)):t.newFile(G.this_path+filename,function(){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(filename)})})})},v=function(){fileLight.clear();var e=LNG.newfolder,e=d(e),a=n(e,"folder");a=0==a?-1:a-1;var i='',-1==a?$(Config.FileBoxSelector).html(i+$(Config.FileBoxSelector).html()):$(i).insertAfter(Config.FileBoxSelector+" .file:eq("+a+")"),$(".newfile").select(),$(".newfile").focus(),$(".newfile").unbind("keydown").keydown(function(e){if(13==e.keyCode||27==e.keyCode){stopPP(e),e.preventDefault();var a=$(".newfile").attr("value");c(a)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning")):t.newFolder(G.this_path+a,function(){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(a)})})}}),$(".newfile").unbind("blur").blur(function(){filename=$(".newfile").attr("value"),c(filename)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning"),_newFolder()):t.newFolder(G.this_path+filename,function(){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(filename)})})})},_=function(){var e="",a="",i=Global.fileListSelect,s=fileLight.name(i),n=fileLight.type(i);n="folder"==n?"folder":n,$(i).find(".title").html("
    ");var l=$("#pathRenameTextarea"),r=l.get(0);if("folder"==n)l.select();else{var c=s.length-n.length-1;if(Global.isIE){var d=r.createTextRange();d.moveEnd("character",-r.value.length),d.moveEnd("character",c),d.moveStart("character",0),d.select()}else r.setSelectionRange(0,c)}l.unbind("focus").focus(),l.keydown(function(r){if(13==r.keyCode){r.preventDefault(),stopPP(r),e=l.attr("value"),"oexe"==n&&(e+=".oexe");var c=e;e!=s?(a=urlEncode(G.this_path+s),e=urlEncode(G.this_path+e),t.rname(a,e,function(){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(c)})})):("oexe"==n&&(s=s.replace(".oexe","")),$(i).find(".title").html(s))}27==r.keyCode&&("oexe"==n&&(s=s.replace(".oexe","")),$(i).find(".title").html(s))}),l.unbind("blur").blur(function(){e=$("#pathRenameTextarea").attr("value"),"oexe"==n&&(e+=".oexe");var l=e;e!=s?(a=urlEncode(G.this_path+s),e=urlEncode(G.this_path+e),t.rname(a,e,function(){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(l)})})):("oexe"==n&&(s=s.replace(".oexe","")),$(i).find(".title").html(s))})},g=function(){ui.f5(),ui.tree.checkIfChange(G.this_path)};return{appEdit:function(e){if(e)t.appEdit(0,0,"user_add");else{var a=Global.fileListSelect.attr("data-app"),i=json_decode(urlDecode(a));i.path=G.this_path+fileLight.name(Global.fileListSelect),t.appEdit(i)}},appList:function(){t.appList(p().path)},appInstall:function(){t.appInstall(p().path)},openEditor:function(){a.openEditor(p().path)},openIE:function(){a.openIE(p().path)},download:function(){a.download(p().path)},open:function(e){if(void 0!=e)return a.open(e),void 0;var t=p(),i=Global.fileListSelect;if(inArray(core.filetype.image,t.type))return"icon"==G.list_type?ui.picasa.play($(i).find(".ico")):ui.picasa.play($(i)),void 0;if("oexe"==t.type){var s=i.attr("data-app");t.path=json_decode(urlDecode(s))}a.open(t.path,t.type)},play:function(){if(!(1>Global.fileListSelectNum)){var e=[];Global.fileListSelect.each(function(){var t=fileLight.type($(this));if(inArray(core.filetype.music,t)||inArray(core.filetype.movie,t)){var a=core.path2url(G.this_path+fileLight.name($(this)));e.push(a)}}),a.play(e,"music")}},pathOperate:t,search:function(){core.search("",p().path)},fav:function(){t.fav(p().path)},remove:function(){t.remove(p(!0),g),fileLight.clear()},copy:function(){t.copy(p(!0))},cute:function(){t.cute(p(!0),ui.f5)},zip:function(){t.zip(p(!0),g)},unZip:function(){t.unZip(p().path,ui.f5)},cuteDrag:function(e){t.cuteDrag(p(!0),e,g)},info:function(){t.info(p(!0))},past:function(){fileLight.clear(),t.past(G.this_path,function(e){ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(e.data)})})},back:f,next:h,list:u,newFile:m,newFolder:v,rname:_,setSelectByChar:l,setSelectByFilename:o,clipboard:t.clipboard}}),define("app/common/pathOperate",["../tpl/fileinfo","../tpl/app"],function(e){var t=e("../tpl/fileinfo"),a=["/","\\",":","*","?",'"',"<",">","|"],i=function(e){var t=function(e,t){for(var a=t.length,i=0;a>i;i++)if(e.indexOf(t[i])>0)return!0;return!1};return t(e,a)?(core.tips.tips(LNG.path_not_allow+':/ : * ? " < > |',!1),!1):!0},s=function(e){var t="list=[";for(var a in e)t+='{"type":"'+e[a].type+'","path":"'+urlEncode2(e[a].path)+'"}',a!=e.length-1&&(t+=",");return t+"]"},n=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkfile&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},o=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkdir&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},l=function(e,t,a){e&&t&&e!=t&&i(core.pathThis(t))&&$.ajax({type:"POST",dataType:"json",url:"index.php?explorer/pathRname",data:"path="+urlEncode(e)+"&rname_to="+urlEncode(t),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof a&&a(e)}})},r=function(e,t){if(!(1>e.length)){var a=e[0].path;a.length>20&&(a=a.substr(-20)+"..."),$.dialog({id:"dialog_path_remove",fixed:!0,icon:"question",title:LNG.remove_title,padding:40,lock:!0,background:"#000",opacity:.5,content:a+"
    "+LNG.remove_info+"【"+e.length+"】",ok:function(){$.ajax({url:"index.php?explorer/pathDelete",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})},cancel:!0})}},c=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCopy",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},d=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCute",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},p=function(e,t){if(e){var a="index.php?explorer/pathPast&path="+urlEncode2(e);$.ajax({url:a,dataType:"json",beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){e.code?core.tips.close(e.info):core.tips.close(e),"function"==typeof t&&t(e)}})}},u=function(e){if(1>e.length&&(e=[{path:G.this_path,type:"folder"}]),e.length>1)return f(e),void 0;e=e[0];var a="folder"==e.type?"path_info":"file_info";$.ajax({url:"index.php?explorer/pathInfo&type="+e.type+"&path="+urlEncode2(e.path),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(i){if(!i.code)return core.tips.close(i),void 0;core.tips.close(LNG.get_success,!0);var s=template.compile(t[a]);i.data.LNG=LNG,$.dialog({padding:5,fixed:!0,title:core.pathThis(e.path).substr(0,20)+"... "+LNG.info,content:s(i.data),width:"350px",cancel:!0})}})},f=function(e){$.ajax({url:"index.php?explorer/pathInfoMuti",type:"POST",data:s(e),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(e){if(!e.code)return core.tips.close(e),void 0;core.tips.close(LNG.get_success,!0);var a=template.compile(t.path_info_more);e.data.LNG=LNG,$.dialog({padding:5,fixed:!0,width:"350px",title:LNG.info,content:a(e.data),cancel:!0})}})},h=function(e,t){1>e.length||$.ajax({url:"index.php?explorer/zip",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading(LNG.ziping) -},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,core.tips.tips(e),"function"==typeof t&&t(e)}})},m=function(e,t){if(e){var a="index.php?explorer/unzip&path="+urlEncode2(e);$.ajax({url:a,beforeSend:function(){core.tips.loading(LNG.unziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,"function"==typeof t&&t(e)}})}},v=function(e,t,a){t&&$.ajax({url:"index.php?explorer/pathCuteDrag",type:"POST",dataType:"json",data:s(e)+"&path="+urlEncode2(t),beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code&&"function"==typeof a&&a(e)}})},_=function(){$.ajax({url:"index.php?explorer/clipboard",dataType:"json",error:core.ajaxError,success:function(e){e.code&&$.dialog({title:LNG.clipboard,padding:0,height:200,width:400,content:e.data})}})},g=function(e){if(e){var t="&name="+urlEncode(core.pathThis(e))+"&path="+urlEncode(e);core.setting("fav"+t)}},y=function(e){var t={};return t.type=e.find("input[type=radio]:checked").val(),t.content=e.find("textarea").val(),t.group=e.find("[name=group]").val(),e.find("input[type=text]").each(function(){var e=$(this).attr("name");t[e]=$(this).val()}),e.find("input[type=checkbox]").each(function(){var e=$(this).attr("name");t[e]="checked"==$(this).attr("checked")?1:0}),t},b=function(e){e.find(".type input").change(function(){var t=$(this).attr("apptype");e.find("[data-type]").addClass("hidden"),e.find("[data-type="+t+"]").removeClass("hidden")})},N=function(t,a,i){var s,n,o,l=LNG.app_create,r=UUID(),c=e("../tpl/app"),d=G.basic_path+"static/images/app/",p=template.compile(c.html);switch(void 0==i&&(i="user_edit"),"root_edit"==i&&(t=json_decode(t)),"user_edit"==i||"root_edit"==i?(l=LNG.app_edit,o=p({LNG:LNG,iconPath:d,uuid:r,data:t})):o=p({LNG:LNG,iconPath:d,uuid:r,data:{}}),$.dialog({fixed:!0,width:450,height:310,id:r,padding:15,title:l,content:o,button:[{name:LNG.preview,callback:function(){var e=y(s);return core.openApp(e),!1}},{name:LNG.button_save,focus:!0,callback:function(){var e=y(s);switch(i){case"user_add":var o=urlEncode2(G.this_path+e.name);n="./index.php?app/user_app&action=add&path="+o;break;case"user_edit":n="./index.php?app/user_app&path="+urlEncode2(t.path);break;case"root_add":n="./index.php?app/add&name="+e.name;break;case"root_edit":n="./index.php?app/edit&name="+e.name+"&old_name="+t.name;break;default:}$.ajax({url:n,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(e)),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){if(core.tips.close(e),e.code)if("root_edit"==i||"root_add"==i){if(!e.code)return;FrameCall.top("Openapp_store","App.reload",'""')}else"function"==typeof a?a():ui.f5()}})}}]}),s=$("."+r),t.group&&s.find("option").eq(t.group).attr("selected",1),s.find(".aui_content").css("overflow","inherit"),i){case"user_edit":s.find(".name").addClass("hidden"),s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("option[value="+t.group+"]").attr("checked",!0);break;case"user_add":s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_add":s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_edit":s.find("option[value="+t.group+"]").attr("selected",!0);break;default:}b(s)},x=function(){core.appStore()},k=function(e){e&&4>e.length&&"http"!=e.substring(0,4)||$.ajax({url:"./index.php?app/get_url_title&url="+e,dataType:"json",beforeSend:function(){core.tips.loading()},success:function(t){var a=t.data;core.tips.close(t);var i={content:e,desc:"",group:"others",type:"url",icon:"internet.png",name:a,resize:1,simple:0,height:"70%",width:"80%"},s=urlEncode2(G.this_path+a);e="./index.php?app/user_app&action=add&path="+s,$.ajax({url:e,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(i)),success:function(e){core.tips.close(e),e.code&&ui.f5()}})}})};return{appEdit:N,appList:x,appAddURL:k,newFile:n,newFolder:o,rname:l,unZip:m,zip:h,copy:c,cute:d,info:u,remove:r,cuteDrag:v,past:p,clipboard:_,fav:g}});var file_info="
    {{LNG.file_type}}:
    {{ext}} {{LNG.file}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info="
    {{LNG.type}}:
    {{LNG.folder}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.contain}}:
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.folder}}
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info_more="
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.file}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.parent_permission}}:
    {{mode}}
    ";define("app/tpl/fileinfo",[],function(){return{file_info:file_info,path_info:path_info,path_info_more:path_info_more}}),define("app/tpl/app",[],function(){return{html:"
    {{LNG.name}}
    {{LNG.app_desc}}
    {{LNG.app_icon}}
    {{LNG.app_icon_show}}
    {{LNG.app_group}}
    {{LNG.app_type}}
    {{LNG.app_display}}
    {{LNG.app_size}}
    {{LNG.width}}:   {{LNG.height}}:  
    {{LNG.app_url}}
    "}}),define("app/common/pathOpen",["./CMPlayer"],function(e){var t=function(e,t){if(void 0!=e){if(void 0==t&&(t=core.pathExt(e)),t=t.toLowerCase(),"folder"==t)return"explorer"==Config.pageApp?ui.path.list(e+"/"):core.explorer(e),void 0;if("swf"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if("oexe"==t)return core.openApp(e),void 0;if("pdf"==t){var r="pdf"+UUID(),i=core.path2url(e),c='";return $.dialog({resize:!0,fixed:!0,title:core.pathThis(e),width:800,height:400,padding:0,content:c}),new PDFObject({url:i}).embed(r),void 0}if("html"==t||"htm"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if(inArray(core.filetype.image,t)){var i=urlDecode(e);return-1==e.indexOf("http:")&&(i=core.path2url(i)),MaskView.image(i),void 0}if(inArray(core.filetype.music,t)||inArray(core.filetype.movie,t)){var i=core.path2url(e);return l(i,t),void 0}if(inArray(core.filetype.doc,t)){var i=core.path2url(e);return o(i,t),void 0}return inArray(core.filetype.bindary,t)?(a(e),void 0):(n(e),void 0)}},a=function(e){if(e){var t="index.php?explorer/fileDownload&path="+urlEncode2(e),a=''+LNG.download_ready+"...",i=$.dialog({icon:"succeed",title:!1,time:1,content:a});i.DOM.wrap.find(".aui_loading").remove()}},i=function(e){if(void 0!=e){var t=core.path2url(e);window.open(t)}},s=function(e,t,a){if(e){void 0==a&&(a="openWindow"+UUID());var i="";art.dialog.through({id:a,title:t,width:"70%",height:"65%",padding:0,content:i,resize:!0})}},n=function(e){if(e){var t=core.pathExt(e),a=core.pathThis(e);if(inArray(core.filetype.bindary,t)||inArray(core.filetype.music,t)||inArray(core.filetype.image,t)||inArray(core.filetype.movie,t)||inArray(core.filetype.doc,t))return core.tips.tips(t+LNG.edit_can_not,!1),void 0;if(void 0==window.top.frames.OpenopenEditor){var i="?editor/edit&filename="+urlEncode(urlEncode2(e)),n=a+" ——"+LNG.edit;s(i,n.substring(n.length-50),"openEditor")}else $.dialog.list.openEditor&&$.dialog.list.openEditor.display(!0),FrameCall.top("OpenopenEditor","Editor.add",'"'+urlEncode2(e)+'"')}},o=function(e,t){var a,i,s;switch(t){case"doc":case"docx":case"docm":case"dot":a="http://sg1b-word-view.officeapps.live.com/wv/wordviewerframe.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;case"ppt":case"pptm":case"pptx":a="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":a="http://sg1b-excel.officeapps.live.com/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;default:}i="http://sg1b-15-view-wopi.wopi.live.net:808/oh/wopi/files/@/wFileId?wFileId=",i+=urlEncode(e),s=a+urlEncode(i)+"&access_token=1&access_token_ttl=0";var n=core.pathThis(urlDecode(e));art.dialog.open(s,{title:n,width:"70%",height:"65%",resize:!0})},l=function(t,a){t&&("string"==typeof t&&(t=[t]),CMPlayer=e("./CMPlayer"),CMPlayer.play(t,a))};return{open:t,play:l,openEditor:n,openIE:i,download:a}}),define("app/common/CMPlayer",[],function(){var e={ting:{path:"music/ting",width:410,height:530},beveled:{path:"music/beveled",width:350,height:200},kuwo:{path:"music/kuwo",width:480,height:200},manila:{path:"music/manila",width:320,height:400},mp3player:{path:"music/mp3player",width:320,height:410},qqmusic:{path:"music/qqmusic",width:300,height:400},somusic:{path:"music/somusic",width:420,height:137},xdj:{path:"music/xdj",width:595,height:235},webplayer:{path:"movie/webplayer",width:600,height:400},qqplayer:{path:"movie/qqplayer",width:600,height:400},tvlive:{path:"movie/tvlive",width:600,height:400},youtube:{path:"movie/youtube",width:600,height:400},vplayer:{path:"movie/vplayer",width:600,height:400}},t=function(e){return"music"==e?"music_player":(void 0==e&&(e="mp3"),inArray(core.filetype.music,e)?"music_player":"movie_player")},a=function(t){var a,i,n;"music_player"==t?(a=e[G.musictheme],i="music player",n=!1):(a=e[G.movietheme],i="movie player",n=!0);var o=core.createFlash(G.static_path+"js/lib/cmp4/cmp.swf","context_menu=2&auto_play=1&play_mode=1&skin=skins/"+a.path+".zip",t),l={id:t+"_dialog",simple:!0,title:i,width:a.width,height:a.height,content:o,resize:n,padding:0,fixed:!0,close:function(){var e=s(t);e&&e.sendEvent&&e.sendEvent("view_stop")}};window.top.CMP?art.dialog.through(l):$.dialog(l)},i=function(e){var t,a="";for(t=e.length-1;t>=0;t--){var i,s;-1==e[t].search("fileProxy")?(i=urlEncode(e[t]),s=core.pathThis(e[t])):(i=e[t],s=core.pathThis(urlDecode(i))),i=i.replace(/%2F/g,"/"),i=i.replace(/%3F/g,"?"),i=i.replace(/%26/g,"&"),i=i.replace(/%3A/g,":"),i=i.replace(/%3D/g,"="),a+=''}return a},s=function(e){return window.top.CMP?window.top.CMP.get(e):CMP.get(e)},n=function(e,t){var a=i(e),n=s(t);if(n){n.config("play_mode","normal");var o=n.list().length;n.list_xml(a,!0),n.sendEvent("view_play",o+1)}};return{changeTheme:function(t,a){var i,n,o;"music"==t?(G.musictheme=a,i="music_player"):"movie"==t&&(G.movietheme=a,i="movie_player"),o=s(i),o&&(n=e[a],window.top.art.dialog.list[i+"_dialog"].size(n.width,n.height),o.sendEvent("skin_load","skins/"+n.path+".zip"))},play:function(e,i){var o=t(i),l=s(o);l?(n(e,o),window.top.art.dialog.list[o+"_dialog"].display(!0)):(a(o),setTimeout(function(){n(e,o)},1e3))}}}); \ No newline at end of file +define("app/src/desktop/main",["lib/jquery-lib","lib/util","lib/webuploader/webuploader-min","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","lib/picasa/picasa","../../common/taskTap","../../common/core","../../tpl/search","../../tpl/upload","../../common/rightMenu","./fileSelect","./ui","../explorer/path","../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer"],function(e){Config={BodyContent:".bodymain",FileBoxSelector:".fileContiner",FileBoxClass:".fileContiner .file",FileBoxClassName:"file",FileBoxTittleClass:".fileContiner .title",SelectClass:".fileContiner .select",SelectClassName:"select",TypeFolderClass:"folderBox",TypeFileClass:"fileBox",HoverClassName:"hover",FileOrderAttr:"number",pageApp:"desktop",navbar:"navbar",AnimateTime:200},Global={fileListAll:"",fileListNum:0,fileRowNum:0,frameLeftWidth:200,treeSpaceWide:10,topbar_height:40,ctrlKey:!1,shiftKey:!1,fileListSelect:"",fileListSelectNum:"",isIE:!-[1],isDragSelect:!1,historyStatus:{back:1,next:0}},e("lib/jquery-lib"),e("lib/util"),e("lib/webuploader/webuploader-min"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),e("lib/picasa/picasa"),TaskTap=e("../../common/taskTap"),core=e("../../common/core"),rightMenu=e("../../common/rightMenu"),fileSelect=e("./fileSelect"),ui=e("./ui"),ui.path=e("../explorer/path"),fileLight=fileSelect.fileLight,$(document).ready(function(){ui.init(),TaskTap.init(),core.update(),core.upload_init(),fileSelect.init(),rightMenu.initDesktop(),$(".init_loading").fadeOut(600),$(".bodymain").click(function(){"block"==$("#menuwin").css("display")&&$("#menuwin").css("display","none")}),$(".start").click(function(){"block"==$("#menuwin").css("display")?$("#menuwin").css("display","none"):$("#menuwin").css("display","block")}),$("#menuwin").click(function(){$("#menuwin").css("display","none")})})}),define("app/common/taskTap",[],function(){var e={},t="",a=160,i=function(){$(".task_tab .tab").die("mouseenter").live("mouseenter",function(){$(this).hasClass("this")||$(this).addClass("hover")}).die("click").live("click",function(){var e=$(this).attr("id"),t=art.dialog.list[e],a=$("."+e);"hidden"!=a.css("visibility")?t.display(!1):t.display(!0)}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("hover")}).die("dblclick").live("dblclick",function(){})},s=function(){var e,t,i,s,n=!1,o=!1,l=0,r=0,c=0,d=0,p=0,u=0;$(".task_tab .tab").die("mousedown").live("mousedown",function(){e=$(this),n=!0,this.setCapture&&this.setCapture(),$(document).mousemove(function(e){h(e)}),$(document).one("mouseup",function(e){return v(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1})});var f=function(a){o=!0,l=a.pageX,$tab_parent=$(".task_tab"),t=$(".task_tab .tab"),$(".tasktab-dragging").remove(),i=e.clone().addClass("tasktab-dragging").prependTo("body"),d=parseInt(t.css("margin-right")),p=$tab_parent.width(),u=$tab_parent.get(0).getBoundingClientRect().left,u+=$(window).scrollLeft(),r=e.get(0).getBoundingClientRect().left,c=parseInt(t.css("width"));var s=e.get(0).getBoundingClientRect().top-parseInt(e.css("margin-top")),n=a.clientX-l+r;$("body").prepend("
    "),i.css({width:c+"px",top:s,left:n}),e.css("opacity",0)},h=function(a){if(n){0==o&&f(a);var s=a.clientX-l+r;u>s||s>u+p-c||(i.css("left",s),t.each(function(){var t=$(this).get(0).getBoundingClientRect().left;if(s>t&&t+c/2+d>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"left")}if(s>t-c/2+d&&t>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"right")}}))}},m=function(i,n){if(!e.is(":animated")||s!=i){s=i,e.stop(!0,!0),$(".insertTemp").remove(),t=$(".task_tab .tab");var o=e.width(),l=$(".task_tab #"+i),r=e.clone(!0).insertAfter(e).css({"margin-right":"0px",border:"none"}).addClass("insertTemp");"left"==n?e.after(l).css("width","0px"):(e.before(l).css("width","0px"),l.before(r)),e.animate({width:o+"px"},a),r.animate({width:"0px"},a,function(){$(this).remove(),t=$(".task_tab .tab")})}},v=function(){n=!1,o=!1,startTime=0,$(".dragMaskView").remove(),void 0!=i&&(r=e.get(0).getBoundingClientRect().left,i.animate({left:r+"px"},a,function(){e.css("opacity",1),$(this).remove()}))}},n=function(e){var t=110,i=t,s=t+12,n=$(".task_tab .tab"),o=$(".task_tab .tabs").width()-50,l=n.length,r=Math.floor(o/s);switch(l>r&&(i=Math.floor(o/l)-12),e){case"add":$(".task_tab .tabs .this").css("width","0").animate({width:i+"px"},a);case"close":n.animate({width:i+"px"},a);break;case"resize":n.css("width",i+"px");break;default:}},o=function(t,a){$(".task_tab").removeClass("hidden");var i='
    '+a+"
    ";$(i).insertBefore(".task_tab .last"),n("add"),e[t]={id:t,name:name}},l=function(e){$(".task_tab .this").removeClass("this"),$(".task_tab #"+e).addClass("this"),t=e},r=function(t){delete e[t],$(".task_tab #"+t).animate({width:0},a,function(){$(".task_tab #"+t).remove(),n("close"),0==$(".tabs .tab").length&&$(".task_tab").addClass("hidden")})};return{add:o,focus:l,close:r,init:function(){var e='';$(e).appendTo("body"),$(window).bind("resize",function(){n("resize")}),i(),s()}}}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t=e.responseText,a='
    '+t+"
    ",i=$.dialog.list.ajaxErrorDialog;return""==t.substr(0,17)?(FrameCall.goRefresh(),void 0):(i?i.content(a):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:a}),void 0)},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("./index.php?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),n=function(){var n=template.compile(s.html);0==$(".dialog_do_search").length?(l(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:n(i)}),r(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),o(),$.dialog.list.dialog_do_search.display(!0))},o=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},r(i)},l=function(){$("#search_value,#search_ext,#search_path").keyEnter(o),$(".search_header a.button").die("click").live("click",o),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},r=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?1>=e.search.length?(a.hide().html("too short!").fadeIn(t),void 0):($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};n()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"./index.php?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var n='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(n).insertBefore($(e).find(".item:eq(0)")):$(e).append(n),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "}}),define("app/common/rightMenu",[],function(){var e=".menufile",t=".menufolder",a=".menuMore",i=".menuApp",s=".menuTreeFav",n=".menuTreeRoot",o=".menuTreeFolder",l=".menuTreeFile",r=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),p(),h(),m(),g(),b(),N(),x(),v(),j(),C(),L(),$(".set_set"+G.list_type).addClass("selected"),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},c=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),f(),v(),u(),h(),m(),C(),j(),g(),L(),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},d=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),b(),N(),v(),C(),j(),k(),w(),L()},p=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e,t){_(e,t)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep1:"--------",listIcon:{name:LNG.list_type,accesskey:"v",icon:"eye-open",items:{seticon:{name:LNG.list_icon,className:"seticon",icon:"th",accesskey:"i",className:"menu_seticon set_seticon"},setlist:{name:LNG.list_list,className:"setlist",icon:"list",accesskey:"l",className:"menu_seticon set_setlist"}}},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},u=function(){$.contextMenu({selector:".menuDefault",zIndex:9999,items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"}},callback:function(e){switch(e){case"open":ui.path.open();break;default:}}})},f=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e){_(e)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep1:"--------",upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",full:{name:LNG.full_screen,className:"full",icon:"fullscreen",accesskey:"m"},setting_wall:{name:LNG.setting_wall,className:"setting_wall",icon:"picture",accesskey:"w"},setting:{name:LNG.setting,className:"setting",icon:"cogs",accesskey:"s"}}})},h=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:t,className:t,callback:function(e){y(e)},items:{open:{name:LNG.open,className:"open",icon:"folder-open-alt",accesskey:"o"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},m=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:e,className:t,callback:function(e){y(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},open_text:{name:LNG.edit,className:"open_text",icon:"edit",accesskey:"e"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},newfileOther:{name:LNG.open_with,accesskey:"h",items:{open_text:{name:LNG.edit,className:"open_text",icon:"edit"},open_kindedit:{name:LNG.others,className:"open_kindedit",icon:"edit"}}},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},unzip:{name:LNG.unzip,className:"unzip",icon:"folder-open-alt",accesskey:"u"},down:{name:LNG.download,className:"down",icon:"download",accesskey:"x"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},v=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:i,className:t,callback:function(e){"editor"==Config.pageApp?T(e):y(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},app_edit:{name:LNG.app_edit,className:"app_edit",icon:"code",accesskey:"a"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},g=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:a,className:t,callback:function(e){y(e)},items:{copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},clone:{name:LNG.clone,className:"clone",icon:"external-link",accesskey:"m"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep1:"--------",playmedia:{name:LNG.add_to_play,className:"playmedia",icon:"music",accesskey:"p"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},_=function(e){switch(e){case"refresh":ui.f5(!0,!0);break;case"back":ui.path.back();case"next":ui.path.next();break;case"seticon":ui.setListType("icon");break;case"setlist":ui.setListType("list");break;case"set_sort_name":ui.setListSort("name",0);break;case"set_sort_ext":ui.setListSort("ext",0);break;case"set_sort_size":ui.setListSort("size",0);break;case"set_sort_mtime":ui.setListSort("mtime",0);break;case"set_sort_up":ui.setListSort(0,"up");break;case"set_sort_down":ui.setListSort(0,"down");break;case"upload":core.upload();break;case"past":ui.path.past();break;case"copy_see":ui.path.clipboard();break;case"newfolder":ui.path.newFolder();break;case"newfile":ui.path.newFile();break;case"newfile_html":ui.path.newFile("html");break;case"newfile_php":ui.path.newFile("php");break;case"newfile_js":ui.path.newFile("js");break;case"newfile_css":ui.path.newFile("css");break;case"newfile_oexe":ui.path.newFile("oexe");break;case"info":ui.path.info();break;case"open":ui.path.open();break;case"open_new":ui.path.open_new();break;case"app_install":ui.path.appList();break;case"app_create":ui.path.appEdit(!0);break;case"full":ui.fullScreen();break;case"setting":core.setting();break;case"setting_wall":core.setting("wall");break;default:}},y=function(e){switch(e){case"open":ui.path.open();break;case"down":ui.path.download();break;case"open_ie":ui.path.openIE();break;case"open_text":ui.path.openEditor();break;case"app_edit":ui.path.appEdit();case"open_kindedit":break;case"playmedia":ui.path.play();break;case"fav":ui.path.fav();break;case"search":ui.path.search();break;case"copy":ui.path.copy();break;case"clone":ui.path.copyDrag(G.this_path,!0);break;case"cute":ui.path.cute();break;case"remove":ui.path.remove();break;case"rname":ui.path.rname();break;case"zip":ui.path.zip();break;case"unzip":ui.path.unZip();break;case"info":ui.path.info();break;default:}},b=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:s,callback:function(e){T(e)},items:{fav_page:{name:LNG.manage_fav,className:"fav_page",icon:"star",accesskey:"r"},refresh_all:{name:LNG.refresh_tree,className:"refresh_all",icon:"refresh",accesskey:"e"},sep1:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},N=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:n,callback:function(e){T(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},sep3:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}}) +},x=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:o,callback:function(e){T(e)},items:{refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},k=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:o,callback:function(e){T(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},sep2:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep4:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},sep5:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},w=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:l,callback:function(e){T(e)},items:{edit:{name:LNG.edit,className:"edit",icon:"edit",accesskey:"e"},open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},openIE:{name:LNG.open_ie,className:"openIE",icon:"globe",accesskey:"b"},download:{name:LNG.download,className:"download",icon:"download",accesskey:"x"},sep1:"--------",rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},L=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".taskBarMenu",items:{quitOthers:{name:LNG.close_others,className:"quitOthers",icon:"remove-circle",accesskey:"o"},quit:{name:LNG.close,className:"quit",icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quitOthers":$.each(art.dialog.list,function(e,t){a!=e&&t.close()});break;case"quit":i.close()}}})},C=function(){$.contextMenu({zIndex:9999,selector:".task_tab",items:{closeAll:{name:LNG.dialog_close_all,icon:"remove-circle",accesskey:"o"},showAll:{name:LNG.dialog_display_all,icon:"th-large",accesskey:"o"},hideAll:{name:LNG.dialog_min_all,icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id");switch(art.dialog.list[a],e){case"showAll":$.each(art.dialog.list,function(e,t){t.display(!0)});break;case"hideAll":$.each(art.dialog.list,function(e,t){t.display(!1)});break;case"closeAll":$.each(art.dialog.list,function(e,t){t.close()});break;default:}}})},j=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".dialog_menu",items:{quit:{name:LNG.close,icon:"remove",accesskey:"o"},hide:{name:LNG.dialog_min,icon:"minus",accesskey:"o"},refresh:{name:LNG.refresh,icon:"refresh",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quit":i.close();break;case"hide":i.display(!1);break;case"refresh":i.refresh();break;default:}}})},T=function(e){switch(e){case"app_edit":ui.tree.appEdit();break;case"edit":ui.tree.openEditor();break;case"open":ui.tree.open();break;case"refresh":ui.tree.refresh();break;case"copy":ui.tree.copy();break;case"cute":ui.tree.cute();break;case"past":ui.tree.past();break;case"rname":ui.tree.rname();break;case"remove":ui.tree.remove();break;case"info":ui.tree.info();break;case"download":ui.tree.download();break;case"openIE":ui.tree.openIE();break;case"search":ui.tree.search();break;case"newfolder":ui.tree.create("folder");break;case"newfile":ui.tree.create("file");break;case"explorer":ui.tree.explorer();break;case"fav_page":core.setting("fav");break;case"fav":ui.tree.fav();break;case"refresh_all":ui.tree.init();break;case"quit":break;default:}};return{initDesktop:c,initExplorer:r,initEditor:d,show:function(e,t,a){e&&(rightMenu.hidden(),$(e).contextMenu({x:t,y:a}))},isDisplay:function(){var e=!1;return $(".context-menu-list").each(function(){"none"!=$(this).css("display")&&(e=!0)}),e},hidden:function(){$(".context-menu-list").filter(":visible").trigger("contextmenu:hide")}}}),define("app/src/desktop/fileSelect",[],function(){var e=!1,t=!1,a=function(){s(),i(),n()},i=function(){$(Config.FileBoxClass).die("touchstart").live("touchstart",function(){$(this).hasClass("select")?ui.path.open():(c.clear(),$(this).removeClass("select"),$(this).addClass("select"),c.select())}),$(Config.FileBoxClass).live("mouseenter",function(){t&&$(this).hasClass(Config.TypeFolderClass)&&!$(this).hasClass(Config.SelectClassName)&&$(this).addClass("selectDragTemp"),e||t||$(this).addClass(Config.HoverClassName),$(this).unbind("mouseup").mouseup(function(e){if(3!=e.which||$(this).hasClass(Config.SelectClassName)||(c.clear(),$(this).addClass(Config.SelectClassName),c.select()),e.ctrlKey)$(this).hasClass(Config.SelectClassName)?(c.resumeMenu($(this)),$(this).removeClass(Config.SelectClassName)):(c.setMenu($(this)),$(this).addClass(Config.SelectClassName)),c.select();else if(e.shiftKey){var t=parseInt($(this).attr(Config.FileOrderAttr));if(0==Global.fileListSelectNum)r(0,t);else{var a=parseInt(Global.fileListSelect.first().attr(Config.FileOrderAttr)),i=parseInt(Global.fileListSelect.last().attr(Config.FileOrderAttr));a>t?r(t,a):t>i?r(i,t):t>a&&i>t&&r(a,t)}}}).unbind("mousedown").mousedown(function(e){return rightMenu.hidden(),1!=e.which?!0:(e.ctrlKey||e.shiftKey||$(this).hasClass(Config.SelectClassName)||(c.clear(),$(this).addClass(Config.SelectClassName),c.select()),void 0)})}).unbind("mouseleave").live("mouseleave",function(){$(this).removeClass(Config.HoverClassName),$(this).removeClass("selectDragTemp")}).unbind("click").live("click",function(e){stopPP(e),e.ctrlKey||e.shiftKey||!$(this).hasClass(Config.SelectClassName)||(c.clear(),$(this).removeClass(Config.SelectClassName),$(this).addClass(Config.SelectClassName),c.select())}),$(Config.FileBoxClass).unbind("dblclick").live("dblclick",function(e){stopPP(e),e.altKey?ui.path.pathInfo():ui.path.open()}),$(Config.FileBoxTittleClass).unbind("dblclick").live("dblclick",function(e){return ui.path.rname(),stopPP(e),!1})},s=function(){var a,i,s,n=100,o=50,l=30,r=80-Global.topbar_height,d=0,p=!1,u=0,f=0;$(Config.FileBoxClass).unbind("mousedown").live("mousedown",function(t){if(!Global.shiftKey){if(ui.isEdit())return!0;if(1!=t.which||e)return!0;a=$(this),h(t),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){m(e)}),$(document).one("mouseup",function(e){return v(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1})}});var h=function(e){rightMenu.hidden(),t=!0,d=$.now(),u=e.pageY,f=e.pageX,i=$(document).height(),s=$(document).width()},m=function(e){if(!t)return!0;$.now()-d>n&&!p&&g();var a=e.clientX>=s-50?s-50:e.clientX,l=e.clientY>=i-50?i-50:e.clientY;a=0>=a?0:a,l=0>=l?0:l,a-=o,l-=r,$(".draggable-dragging").css("left",a),$(".draggable-dragging").css("top",l),Global.isIE&&$("."+Config.TypeFolderClass).each(function(){var t=e.pageX,a=e.pageY,i=$(this).offset(),s=$(this).width(),n=$(this).height();t>i.left&&i.left+s>t&&a>i.top&&i.top+n>a?$(this).addClass("selectDragTemp"):$(this).removeClass("selectDragTemp")})},v=function(e){if(!t)return!1;t=!1,p=!1,$("body").css("cursor","auto"),$(".draggable-dragging").fadeOut(200,function(){$(this).remove()});var a=G.this_path,i=0==$(".selectDragTemp").length;Global.ctrlKey?(i||(a+=c.name($(".selectDragTemp"))),(Math.abs(e.pageX-f)>l||Math.abs(e.pageY-u)>l)&&ui.path.copyDrag(a,i)):i||(a+=c.name($(".selectDragTemp")),ui.path.cuteDrag(a))},g=function(){p=!0,$("body").css("cursor","move"),a.find(".ico").attr("filetype"),$('
    '+Global.fileListSelectNum+"
    "+'
    '+"
    ").appendTo("body")}},n=function(){var a=null,i=null,s=null;$(Config.BodyContent).unbind("mousedown").live("mousedown",function(e){return ui.isEdit()?!0:t||1!=e.which?!0:(n(e),this.setCapture&&this.setCapture(),$(document).unbind("mousemove").mousemove(function(e){o(e)}),$(document).one("mouseup",function(e){l(e),Global.isDragSelect=!0,this.releaseCapture&&this.releaseCapture()}),void 0)});var n=function(t){$(t.target).parent().hasClass(Config.FileBoxClassName)||$(t.target).parent().parent().hasClass(Config.FileBoxClassName)||$(t.target).hasClass("fix")||(rightMenu.hidden(),t.ctrlKey||t.shiftKey||c.clear(),0==$(t.target).hasClass("ico")&&(0==$("#selContainer").length&&($('
    ').appendTo(Config.FileBoxSelector),s=$("#selContainer")),a=t.pageX,i=t.pageY-Global.topbar_height,e=!0))},o=function(t){if(!e)return!0;"none"==s.css("display")&&s.css("display","");var n=t.pageX,o=t.pageY-Global.topbar_height;s.css({left:Math.min(n,a),top:Math.min(o,i),width:Math.abs(n-a),height:Math.abs(o-i)});for(var l=s.offset().left,r=s.offset().top-Global.topbar_height,d=s.width(),p=s.height(),u=Global.fileListNum,f=0;u>f;f++){var h=Global.fileListAll[f],m=$(Global.fileListAll[f]),v=h.offsetWidth+h.offsetLeft,g=h.offsetHeight+h.offsetTop;if(v>l&&g>r&&l+d>h.offsetLeft&&r+p>h.offsetTop){if(!m.hasClass("selectDragTemp")){if(m.hasClass("selectToggleClass"))continue;if(m.hasClass(Config.SelectClassName)){m.removeClass(Config.SelectClassName).addClass("selectToggleClass"),c.resumeMenu(m);continue}m.addClass("selectDragTemp")}}else m.removeClass("selectDragTemp"),m.hasClass("selectToggleClass")&&m.addClass(Config.SelectClassName).removeClass("selectToggleClass")}},l=function(){return e?(s.css("display","none"),$(".selectDragTemp").addClass(Config.SelectClassName).removeClass("selectDragTemp"),$(".selectToggleClass").removeClass("selectToggleClass"),c.select(),e=!1,a=null,i=null,void 0):!1}},o=function(e){var t=0,a=Global.fileListSelect;Global.fileListSelectNum;var i=Global.fileListNum,s=function(){var s=Global.fileRowNum;if(1==Global.fileListSelectNum){var n=parseInt(a.attr(Config.FileOrderAttr));switch(e){case"up":t=0>=n?n:n-1;break;case"left":t=s>n?0:n-s;break;case"down":t=n>=i-1?n:n+1;break;case"right":t=n+s>=i-1?i-1:n+s;break;default:}}else if(Global.fileListSelectNum>1){var o=parseInt(a.first().attr(Config.FileOrderAttr)),l=parseInt(a.last().attr(Config.FileOrderAttr));switch(e){case"up":t=t=0>=o?o:o-1;break;case"left":break;case"down":t=l>=i?l:l+1;break;case"right":t=l+s>=i?l:l+s;break;default:}}};return s(),Global.fileListAll.eq(t)},l=function(e){var t;switch(e){case"home":t=Global.fileListAll.first();break;case"end":t=Global.fileListAll.last();break;case"left":case"up":case"right":case"down":t=o(e);break;case"all":t=Global.fileListAll;break;default:}c.clear(),t.addClass(Config.SelectClassName),c.select()},r=function(e,t){c.clear();for(var a=e;t>=a;a++)$(Global.fileListAll[a]).addClass(Config.SelectClassName);c.select()},c={init:function(){var e=$(Config.FileBoxClass);e.each(function(e){$(this).attr(Config.FileOrderAttr,e)}),Global.fileListSelect="",Global.fileListAll=e,Global.fileListNum=e.length,Global.fileListSelectNum=0},select:function(){var e=$(Config.SelectClass);Global.fileListSelect=e,Global.fileListSelectNum=e.length,e.length>1&&c.setMenu(e)},name:function(e){return e.attr("data-name")},type:function(e){return e.find(".ico").attr("filetype")},setMenu:function(e){e.removeClass("menufile menufolder menuApp menuDefault").addClass("menuMore")},resumeMenu:function(e){var t={fileApp:"menuApp",fileBox:"menufile",folderBox:"menufolder",systemBox:"menuDefault"};for(var a in t)e.hasClass(a)&&e.removeClass("menuMore").addClass(t[a])},getAllName:function(){var e=[];if(0!=Global.fileListSelectNum){var t=Global.fileListSelect;return t.each(function(){e.push(c.name($(this)))}),e}},clear:function(){if(0!=Global.fileListSelectNum){var e=Global.fileListSelect;e.removeClass(Config.SelectClassName),e.each(function(){c.resumeMenu($(this))}),Global.fileListSelect="",Global.fileListSelectNum=0}}};return{init:a,fileLight:c,selectPos:l}}),define("app/src/desktop/ui",[],function(){var e=new Picasa;PicasaOpen=!1;var t=function(){fileLight.init(),ui.setStyle(),PicasaOpen=!1,e.initData()},a=function(e,t){var t="down"==t?-1:1;return function(a,i){return a=a[e],i=i[e],i>a?-1*t:a>i?1*t:void 0}},i=function(e,t){0!=e&&(G.sort_field=e,$(".menu_set_sort").removeClass("selected"),$(".set_sort_"+e).addClass("selected")),0!=t&&(G.sort_order=t,$(".menu_set_desc").removeClass("selected"),$(".set_sort_"+t).addClass("selected")),l(!1,!0),$.ajax({url:"index.php?setting/set&k=list_sort_field,list_sort_order&v="+G.sort_field+","+G.sort_order})},s=function(){var e=91;Global.ctrlKey=!1,$(document).keydown(function(t){if("none"!=$("#PicasaView").css("display"))return!0;if(ui.isEdit())return!0;if(rightMenu.isDisplay())return!0;var a=!1;if(Global.ctrlKey||t.keyCode==e||t.ctrlKey)switch(a=!0,Global.ctrlKey=!0,t.keyCode){case 8:ui.path.remove(),a=!0;break;case 65:fileSelect.selectPos("all");break;case 67:ui.path.copy();break;case 88:ui.path.cute();break;case 83:break;case 86:ui.path.past();break;case 70:core.search($(".header-right input").val(),G.this_path);break;default:a=!1}else if(t.shiftKey)Global.shiftKey=!0;else switch(t.keyCode){case 8:a=!0;break;case 35:fileSelect.selectPos("end");break;case 36:fileSelect.selectPos("home");break;case 37:fileSelect.selectPos("left"),a=!0;break;case 38:fileSelect.selectPos("up");break;case 39:fileSelect.selectPos("right"),a=!0;break;case 40:fileSelect.selectPos("down");break;case 13:ui.path.open(),a=!1;break;case 46:ui.path.remove();break;case 113:ui.path.rname();break;default:a=!1}return a&&(stopPP(t),t.keyCode=0,t.returnValue=!1),!0}).keyup(function(t){t.shiftKey&&(Global.shiftKey=!1),t.keyCode!=e&&t.ctrlKey||(Global.ctrlKey=!1)})},n=function(){if($.browser.msie||!(0>navigator.userAgent.indexOf("Firefox"))){var e=10,t=10,a=80,i=100,s=10,n=$(document).height()-60,o=Math.floor((n-e)/(i+s)),l=0,r=0,c=0,d=0;$(".fileContiner .file").css("position","absolute"),$(".fileContiner .file").each(function(n){l=n%o,r=Math.floor(n/o),c=t+(a+s)*r,d=e+(i+s)*l,$(this).css({left:c,top:d})})}};this._getFolderBox=function(e){var t=""},this._getFileBox=function(e){var t="";if("oexe"==e.ext&&void 0!=e.icon){var a=e.icon;-1==e.icon.search(G.static_path)&&"http"!=e.icon.substring(0,4)&&(a=G.static_path+"images/app/"+e.icon);var i=urlEncode(json_encode(e)),s=e.name.replace(".oexe","");t=""}else if(inArray(core.filetype.image,e.ext)){var n=core.path2url(G.this_path+e.name),o="index.php?explorer/image&path="+urlEncode(G.this_path+e.name);t+=""}else t+="";return t};var o=function(e){var i="",s=G.json_data.folderlist,o=G.json_data.filelist;s="size"==G.sort_field||"ext"==G.sort_field?s.sort(a("name",G.sort_order)):s.sort(a(G.sort_field,G.sort_order)),o=o.sort(a(G.sort_field,G.sort_order)),G.json_data.folderlist=s,G.json_data.filelist=o;var l="",r="";for(var c in o)l+=_getFileBox(o[c]);for(var c in s)r+=_getFolderBox(s[c]);i+="up"==G.sort_order?r+l:l+r;var d="";$(".menuDefault").each(function(){d+=$(this).get(0).outerHTML}),i=d+i,i+="
    ",e?$(Config.FileBoxSelector).hide().html(i).fadeIn(Config.AnimateTime):$(Config.FileBoxSelector).html(i),t(),n()},l=function(e,t,a){if(void 0==e&&(e=!0),void 0==t&&(t=!1),e)$.ajax({url:"index.php?explorer/pathList&path="+G.this_path,dataType:"json",error:core.ajaxError,success:function(e){return e.code?(G.json_data=e.data,o(t),"function"==typeof a&&a(e),void 0):(core.tips.tips(e),$(Config.FileBoxSelector).html(""),!1)}});else{var i=fileLight.getAllName();o(t),ui.path.setSelectByFilename(i)}},r=function(e){l(!0,!1,e)};return{f5:l,f5_callback:r,picasa:e,setListSort:i,init:function(){r(function(){}),s(),$(window).bind("resize",function(){ui.setStyle(),0!=PicasaOpen&&e.setFrameResize(),n()}),$("html").die("click").live("click",function(){rightMenu.hidden(),Global.isIE&&Global.isDragSelect}),Mousetrap.bind(["ctrl+s","command+s"],function(e){e.preventDefault(),FrameCall.top("OpenopenEditor","Editor.save","")}),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 t=String.fromCharCode(e.charCode);ui.path.setSelectByChar(t)}),Mousetrap.bind(["alt+n","alt+n"],function(e){stopPP(e),ui.path.newFile()}),Mousetrap.bind(["alt+m","alt+m"],function(e){stopPP(e),ui.path.newFolder()}),PicasaOpen=!1,e.init(".picasaImage"),e.initData()},setTheme:function(e){core.setSkin(e,"app_desktop.css"),FrameCall.top("OpenopenEditor","Editor.setTheme",'"'+e+'"'),FrameCall.top("Opensetting_mode","Setting.setThemeSelf",'"'+e+'"'),FrameCall.father("ui.setTheme",'"'+e+'"')},setWall:function(e){$(".wallbackground").attr("src",e).one("load",function(){$(".desktop").css("background-image","url("+e+")")})},isEdit:function(){var e=$(document.activeElement).get(0).tagName;return"INPUT"==e||"TEXTAREA"==e?!0:!1},setStyle:function(){Global.fileRowNum=function(){var e=$(Config.FileBoxSelector).width(),t=parseInt($(Config.FileBoxClass).css("width"))+parseInt($(Config.FileBoxClass).css("border-left-width"))+parseInt($(Config.FileBoxClass).css("border-right-width"))+parseInt($(Config.FileBoxClass).css("margin-right"));return parseInt(e/t)}()},fullScreen:function(){"true"==$("body").attr("fullScreen")&&ui.exitfullScreen(),$("body").attr("fullScreen","true");var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen&&e.webkitRequestFullScreen()},exitfullScreen:function(){$("body").attr("fullScreen","false"),document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()}}}),define("app/src/explorer/path",["../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer"],function(e){var t=e("../../common/pathOperate"),a=e("../../common/pathOpen"),s=void 0;ui.pathOpen=a;var n=function(e,t){var a,i,s=0,n=G.json_data.folderlist,o=G.json_data.filelist;if("desktop"==Config.pageApp&&(s=$(".menuDefault").length),"folder"==t){for(a=0;n.length>a&&!(n[a].name>=e);a++);return"up"==G.sort_order?a+s:o.length+a+s}if("file"==t){for(i=0;o.length>i&&!(o[i].name>=e);i++);return"down"==G.sort_order?i+s:n.length+i+s}return-1},o=function(e){void 0!=e&&("string"==typeof e&&(e=[e]),fileLight.clear(),$(".fileContiner .file").each(function(t){var a=fileLight.name($(this));-1!=$.inArray(a,e)&&$(Global.fileListAll).eq(t).addClass(Config.SelectClassName)}),fileLight.select())},l=function(e){if(""!=e){if(e=e.toLowerCase(),void 0==s||G.this_path!=s.path||e!=s.key){var t=[];$(".fileContiner .file").each(function(){var a=fileLight.name($(this));e==a.substring(0,e.length).toLowerCase()&&t.push(a)}),s={key:e,path:G.this_path,index:0,list:t}}0!=s.list.length&&(o(s.list[s.index++]),s.index==s.list.length&&(s.index=0))}},r=function(e,t,a){var s=e.length;for(i=0;s>i;i++)if(e[i][t]==a)return e[i]},c=function(e){var t="",a=0;return null!=G.json_data.filelist&&(t=r(G.json_data.filelist,"name",e),null!=t&&(a=1)),null!=G.json_data.folderlist&&(t=r(G.json_data.folderlist,"name",e),null!=t&&(a=1)),a},d=function(e,t){var a,i=0;if(void 0==t){if(!c(e))return e;for(a=e+"(0)";c(a);)i++,a=e+"("+i+")";return a}if(!c(e+"."+t))return e+"."+t;for(a=e+"(0)."+t;c(a);)i++,a=e+"("+i+")."+t;return a},p=function(e){if(e){var t=[];return 0==Global.fileListSelect.length?t:(Global.fileListSelect.each(function(){var e=G.this_path+fileLight.name($(this)),a="folder"==fileLight.type($(this))?"folder":"file";t.push({path:e,type:a})}),t)}if(1!=Global.fileListSelectNum)return{path:"",type:""};var a=Global.fileListSelect,i=G.this_path+fileLight.name(a),s=fileLight.type(a);return{path:i,type:s}},u=function(e,t){return e==G.this_path?(void 0!=t&&core.tips.tips(LNG.path_is_current,"info"),void 0):(G.this_path=e.replace(/\\/g,"/"),G.this_path=e.replace(/\/+/g,"/"),"/"!=G.this_path.substr(G.this_path.length-1)&&(G.this_path+="/"),ui.f5(),void 0)},f=function(){$.ajax({dataType:"json",url:"index.php?explorer/historyBack",beforeSend:function(){$(".tools-left .msg").stop(!0,!0).fadeIn(100)},error:core.ajaxError,success:function(e){return $(".tools-left .msg").fadeOut(100),e.code?(e=e.data,G.this_path=e.thispath,G.json_data=e.list,Global.historyStatus=e.history_status,ui.f5(!1,!0),ui.header.updateHistoryStatus(),ui.header.addressSet(),void 0):(core.tips.tips(e),$(Config.FileBoxSelector).html(""),!1)}})},h=function(){$.ajax({dataType:"json",url:"index.php?explorer/historyNext",beforeSend:function(){$(".tools-left .msg").stop(!0,!0).fadeIn(100)},error:core.ajaxError,success:function(e){return $(".tools-left .msg").fadeOut(100),e.code?(e=e.data,G.this_path=e.thispath,G.json_data=e.list,Global.historyStatus=e.history_status,ui.f5(!1,!0),ui.header.updateHistoryStatus(),ui.header.addressSet(),void 0):(core.tips.tips(e),$(Config.FileBoxSelector).html(""),!1)}})},m=function(e){fileLight.clear(),void 0==e&&(e="txt");var a="newfile",a=d(a,e),i=n(a,"file");i=0==i?-1:i-1;var s='';-1==i?$(Config.FileBoxSelector).html(s+$(Config.FileBoxSelector).html()):$(s).insertAfter(Config.FileBoxSelector+" .file:eq("+i+")");var l=$(".newfile"),r=l.get(0),p=a.length-e.length-1;if(Global.isIE){var u=r.createTextRange();u.moveEnd("character",-r.value.length),u.moveEnd("character",p),u.moveStart("character",0),u.select()}else r.setSelectionRange(0,p);l.focus(),l.unbind("keydown").keydown(function(e){return(13==e.keyCode||27==e.keyCode)&&(stopPP(e),e.preventDefault(),filename=l.attr("value"),c(filename)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning")):t.newFile(G.this_path+filename,function(){ui.f5_callback(function(){o(filename)})})),!0}),l.unbind("blur").blur(function(){filename=l.attr("value"),c(filename)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning"),_newFile(e)):t.newFile(G.this_path+filename,function(){ui.f5_callback(function(){o(filename)})})})},v=function(){fileLight.clear();var e=LNG.newfolder,e=d(e),a=n(e,"folder");a=0==a?-1:a-1;var i='',-1==a?$(Config.FileBoxSelector).html(i+$(Config.FileBoxSelector).html()):$(i).insertAfter(Config.FileBoxSelector+" .file:eq("+a+")"),$(".newfile").select(),$(".newfile").focus(),$(".newfile").unbind("keydown").keydown(function(e){if(13==e.keyCode||27==e.keyCode){stopPP(e),e.preventDefault();var a=$(".newfile").attr("value");c(a)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning")):t.newFolder(G.this_path+a,function(){"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(a)})})}}),$(".newfile").unbind("blur").blur(function(){filename=$(".newfile").attr("value"),c(filename)?($("#makefile").remove(),core.tips.tips(LNG.path_exists,"warning"),_newFolder()):t.newFolder(G.this_path+filename,function(){"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(filename)})})})},g=function(){var e="",a="",i=Global.fileListSelect,s=fileLight.name(i),n=fileLight.type(i);n="folder"==n?"folder":n,$(i).find(".title").html("
    ");var l=$("#pathRenameTextarea"),r=l.get(0);if("folder"==n)l.select();else{var c=s.length-n.length-1;if(Global.isIE){var d=r.createTextRange();d.moveEnd("character",-r.value.length),d.moveEnd("character",c),d.moveStart("character",0),d.select()}else r.setSelectionRange(0,c)}l.unbind("focus").focus(),l.keydown(function(r){if(13==r.keyCode){r.preventDefault(),stopPP(r),e=l.attr("value"),"oexe"==n&&(e+=".oexe");var c=e;e!=s?(a=urlEncode(G.this_path+s),e=urlEncode(G.this_path+e),t.rname(a,e,function(){"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(c)})})):("oexe"==n&&(s=s.replace(".oexe","")),$(i).find(".title").html(s))}27==r.keyCode&&("oexe"==n&&(s=s.replace(".oexe","")),$(i).find(".title").html(s))}),l.unbind("blur").blur(function(){e=$("#pathRenameTextarea").attr("value"),"oexe"==n&&(e+=".oexe");var l=e;e!=s?(a=urlEncode(G.this_path+s),e=urlEncode(G.this_path+e),t.rname(a,e,function(){"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(l)})})):("oexe"==n&&(s=s.replace(".oexe","")),$(i).find(".title").html(s))})},_=function(){ui.f5(),"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)};return{appEdit:function(e){if(e)t.appEdit(0,0,"user_add");else{var a=Global.fileListSelect.attr("data-app"),i=json_decode(urlDecode(a));i.path=G.this_path+fileLight.name(Global.fileListSelect),t.appEdit(i)}},appList:function(){t.appList(p().path)},appInstall:function(){t.appInstall(p().path)},openEditor:function(){a.openEditor(p().path)},openIE:function(){a.openIE(p().path)},download:function(){a.download(p().path)},open:function(e){if(void 0!=e)return a.open(e),void 0;var t=p(),i=Global.fileListSelect;if(inArray(core.filetype.image,t.type))return"icon"==G.list_type?ui.picasa.play($(i).find(".ico")):ui.picasa.play($(i)),void 0;if("oexe"==t.type){var s=i.attr("data-app");t.path=json_decode(urlDecode(s))}a.open(t.path,t.type)},play:function(){if(!(1>Global.fileListSelectNum)){var e=[];Global.fileListSelect.each(function(){var t=fileLight.type($(this));if(inArray(core.filetype.music,t)||inArray(core.filetype.movie,t)){var a=core.path2url(G.this_path+fileLight.name($(this)));e.push(a)}}),a.play(e,"music")}},pathOperate:t,search:function(){core.search("",p().path)},fav:function(){t.fav(p().path)},remove:function(){t.remove(p(!0),_),fileLight.clear()},copy:function(){t.copy(p(!0))},cute:function(){t.cute(p(!0),ui.f5)},zip:function(){t.zip(p(!0),_)},unZip:function(){t.unZip(p().path,ui.f5)},cuteDrag:function(e){t.cuteDrag(p(!0),e,_)},copyDrag:function(e,a){t.copyDrag(p(!0),e,function(e){fileLight.clear(),"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){a&&o(e.data)})})},info:function(){t.info(p(!0))},past:function(){fileLight.clear(),t.past(G.this_path,function(e){"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path),ui.f5_callback(function(){o(e.data)})})},back:f,next:h,list:u,newFile:m,newFolder:v,rname:g,setSelectByChar:l,setSelectByFilename:o,clipboard:t.clipboard}}),define("app/common/pathOperate",["../tpl/fileinfo","../tpl/app"],function(e){var t=e("../tpl/fileinfo"),a=["/","\\",":","*","?",'"',"<",">","|"],i=function(e){var t=function(e,t){for(var a=t.length,i=0;a>i;i++)if(e.indexOf(t[i])>0)return!0;return!1};return t(e,a)?(core.tips.tips(LNG.path_not_allow+':/ : * ? " < > |',!1),!1):!0},s=function(e){var t="list=[";for(var a in e)t+='{"type":"'+e[a].type+'","path":"'+urlEncode2(e[a].path)+'"}',a!=e.length-1&&(t+=",");return t+"]"},n=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkfile&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},o=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkdir&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},l=function(e,t,a){e&&t&&e!=t&&i(core.pathThis(t))&&$.ajax({type:"POST",dataType:"json",url:"index.php?explorer/pathRname",data:"path="+urlEncode(e)+"&rname_to="+urlEncode(t),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof a&&a(e)}})},r=function(e,t){if(!(1>e.length)){var a=e[0].path;a.length>20&&(a=a.substr(-20)+"..."),$.dialog({id:"dialog_path_remove",fixed:!0,icon:"question",title:LNG.remove_title,padding:40,lock:!0,background:"#000",opacity:.5,content:a+"
    "+LNG.remove_info+"【"+e.length+"】",ok:function(){$.ajax({url:"index.php?explorer/pathDelete",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})},cancel:!0})}},c=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCopy",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},d=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCute",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},p=function(e,t){if(e){var a="index.php?explorer/pathPast&path="+urlEncode2(e);$.ajax({url:a,dataType:"json",beforeSend:function(){core.tips.loading(LNG.moving) +},error:core.ajaxError,success:function(e){e.code?core.tips.close(e.info):core.tips.close(e),"function"==typeof t&&t(e)}})}},u=function(e){if(1>e.length&&(e=[{path:G.this_path,type:"folder"}]),e.length>1)return f(e),void 0;e=e[0];var a="folder"==e.type?"path_info":"file_info";$.ajax({url:"index.php?explorer/pathInfo&type="+e.type+"&path="+urlEncode2(e.path),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(i){if(!i.code)return core.tips.close(i),void 0;core.tips.close(LNG.get_success,!0);var s=template.compile(t[a]);i.data.LNG=LNG,$.dialog({padding:5,fixed:!0,title:core.pathThis(e.path).substr(0,20)+"... "+LNG.info,content:s(i.data),width:"350px",cancel:!0})}})},f=function(e){$.ajax({url:"index.php?explorer/pathInfoMuti",type:"POST",data:s(e),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(e){if(!e.code)return core.tips.close(e),void 0;core.tips.close(LNG.get_success,!0);var a=template.compile(t.path_info_more);e.data.LNG=LNG,$.dialog({padding:5,fixed:!0,width:"350px",title:LNG.info,content:a(e.data),cancel:!0})}})},h=function(e,t){1>e.length||$.ajax({url:"index.php?explorer/zip",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading(LNG.ziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,core.tips.tips(e),"function"==typeof t&&t(e)}})},m=function(e,t){if(e){var a="index.php?explorer/unzip&path="+urlEncode2(e);$.ajax({url:a,beforeSend:function(){core.tips.loading(LNG.unziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,"function"==typeof t&&t(e)}})}},v=function(e,t,a){t&&$.ajax({url:"index.php?explorer/pathCuteDrag",type:"POST",dataType:"json",data:s(e)+"&path="+urlEncode2(t),beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code&&"function"==typeof a&&a(e)}})},g=function(e,t,a){t&&$.ajax({url:"index.php?explorer/pathCopyDrag",type:"POST",dataType:"json",data:s(e)+"&path="+urlEncode2(t),beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code&&"function"==typeof a&&a(e)}})},_=function(){$.ajax({url:"index.php?explorer/clipboard",dataType:"json",error:core.ajaxError,success:function(e){e.code&&$.dialog({title:LNG.clipboard,padding:0,height:200,width:400,content:e.data})}})},y=function(e){if(e){var t="&name="+urlEncode(core.pathThis(e))+"&path="+urlEncode(e);core.setting("fav"+t)}},b=function(e){var t={};return t.type=e.find("input[type=radio]:checked").val(),t.content=e.find("textarea").val(),t.group=e.find("[name=group]").val(),e.find("input[type=text]").each(function(){var e=$(this).attr("name");t[e]=$(this).val()}),e.find("input[type=checkbox]").each(function(){var e=$(this).attr("name");t[e]="checked"==$(this).attr("checked")?1:0}),t},N=function(e){e.find(".type input").change(function(){var t=$(this).attr("apptype");e.find("[data-type]").addClass("hidden"),e.find("[data-type="+t+"]").removeClass("hidden")})},x=function(t,a,i){var s,n,o,l=LNG.app_create,r=UUID(),c=e("../tpl/app"),d=G.basic_path+"static/images/app/",p=template.compile(c.html);switch(void 0==i&&(i="user_edit"),"root_edit"==i&&(t=json_decode(t)),"user_edit"==i||"root_edit"==i?(l=LNG.app_edit,o=p({LNG:LNG,iconPath:d,uuid:r,data:t})):o=p({LNG:LNG,iconPath:d,uuid:r,data:{}}),$.dialog({fixed:!0,width:450,height:310,id:r,padding:15,title:l,content:o,button:[{name:LNG.preview,callback:function(){var e=b(s);return core.openApp(e),!1}},{name:LNG.button_save,focus:!0,callback:function(){var e=b(s);switch(i){case"user_add":var o=urlEncode2(G.this_path+e.name);n="./index.php?app/user_app&action=add&path="+o;break;case"user_edit":n="./index.php?app/user_app&path="+urlEncode2(t.path);break;case"root_add":n="./index.php?app/add&name="+e.name;break;case"root_edit":n="./index.php?app/edit&name="+e.name+"&old_name="+t.name;break;default:}$.ajax({url:n,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(e)),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){if(core.tips.close(e),e.code)if("root_edit"==i||"root_add"==i){if(!e.code)return;FrameCall.top("Openapp_store","App.reload",'""')}else"function"==typeof a?a():ui.f5()}})}}]}),s=$("."+r),t.group&&s.find("option").eq(t.group).attr("selected",1),s.find(".aui_content").css("overflow","inherit"),i){case"user_edit":s.find(".name").addClass("hidden"),s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("option[value="+t.group+"]").attr("checked",!0);break;case"user_add":s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_add":s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_edit":s.find("option[value="+t.group+"]").attr("selected",!0);break;default:}N(s)},k=function(){core.appStore()},w=function(e){e&&4>e.length&&"http"!=e.substring(0,4)||$.ajax({url:"./index.php?app/get_url_title&url="+e,dataType:"json",beforeSend:function(){core.tips.loading()},success:function(t){var a=t.data;core.tips.close(t);var i={content:e,desc:"",group:"others",type:"url",icon:"internet.png",name:a,resize:1,simple:0,height:"70%",width:"80%"},s=urlEncode2(G.this_path+a);e="./index.php?app/user_app&action=add&path="+s,$.ajax({url:e,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(i)),success:function(e){core.tips.close(e),e.code&&ui.f5()}})}})};return{appEdit:x,appList:k,appAddURL:w,newFile:n,newFolder:o,rname:l,unZip:m,zip:h,copy:c,cute:d,info:u,remove:r,cuteDrag:v,copyDrag:g,past:p,clipboard:_,fav:y}});var file_info="
    {{LNG.file_type}}:
    {{ext}} {{LNG.file}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info="
    {{LNG.type}}:
    {{LNG.folder}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.contain}}:
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.folder}}
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info_more="
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.file}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.parent_permission}}:
    {{mode}}
    ";define("app/tpl/fileinfo",[],function(){return{file_info:file_info,path_info:path_info,path_info_more:path_info_more}}),define("app/tpl/app",[],function(){return{html:"
    {{LNG.name}}
    {{LNG.app_desc}}
    {{LNG.app_icon}}
    {{LNG.app_icon_show}}
    {{LNG.app_group}}
    {{LNG.app_type}}
    {{LNG.app_display}}
    {{LNG.app_size}}
    {{LNG.width}}:   {{LNG.height}}:  
    {{LNG.app_url}}
    "}}),define("app/common/pathOpen",["./CMPlayer"],function(e){var t=function(e,t){if(void 0!=e){if(void 0==t&&(t=core.pathExt(e)),t=t.toLowerCase(),"folder"==t)return"explorer"==Config.pageApp?ui.path.list(e+"/"):core.explorer(e),void 0;if("swf"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if("oexe"==t)return core.openApp(e),void 0;if("pdf"==t){var r="pdf"+UUID(),i=core.path2url(e),c='";return $.dialog({resize:!0,fixed:!0,title:core.pathThis(e),width:800,height:400,padding:0,content:c}),new PDFObject({url:i}).embed(r),void 0}if("html"==t||"htm"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if(inArray(core.filetype.image,t)){var i=urlDecode(e);return-1==e.indexOf("http:")&&(i=core.path2url(i)),MaskView.image(i),void 0}if(inArray(core.filetype.music,t)||inArray(core.filetype.movie,t)){var i=core.path2url(e);return l(i,t),void 0}if(inArray(core.filetype.doc,t)){var i=core.path2url(e);return o(i,t),void 0}return inArray(core.filetype.bindary,t)?(a(e),void 0):(n(e),void 0)}},a=function(e){if(e){var t="index.php?explorer/fileDownload&path="+urlEncode2(e),a=''+LNG.download_ready+"...",i=$.dialog({icon:"succeed",title:!1,time:1,content:a});i.DOM.wrap.find(".aui_loading").remove()}},i=function(e){if(void 0!=e){var t=core.path2url(e);window.open(t)}},s=function(e,t,a){if(e){void 0==a&&(a="openWindow"+UUID());var i="";art.dialog.through({id:a,title:t,width:"70%",height:"65%",padding:0,content:i,resize:!0})}},n=function(e){if(e){var t=core.pathExt(e),a=core.pathThis(e);if(inArray(core.filetype.bindary,t)||inArray(core.filetype.music,t)||inArray(core.filetype.image,t)||inArray(core.filetype.movie,t)||inArray(core.filetype.doc,t))return core.tips.tips(t+LNG.edit_can_not,!1),void 0;if(void 0==window.top.frames.OpenopenEditor){var i="./index.php?editor/edit&filename="+urlEncode(urlEncode2(e)),n=a+" ——"+LNG.edit;s(i,n.substring(n.length-50),"openEditor")}else $.dialog.list.openEditor&&$.dialog.list.openEditor.display(!0),FrameCall.top("OpenopenEditor","Editor.add",'"'+urlEncode2(e)+'"')}},o=function(e,t){var a,i,s;switch(t){case"doc":case"docx":case"docm":case"dot":a="http://sg1b-word-view.officeapps.live.com/wv/wordviewerframe.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;case"ppt":case"pptm":case"pptx":a="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":a="http://sg1b-excel.officeapps.live.com/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;default:}i="http://sg1b-15-view-wopi.wopi.live.net:808/oh/wopi/files/@/wFileId?wFileId=",i+=urlEncode(e),s=a+urlEncode(i)+"&access_token=1&access_token_ttl=0";var n=core.pathThis(urlDecode(e));art.dialog.open(s,{title:n,width:"70%",height:"65%",resize:!0})},l=function(t,a){t&&("string"==typeof t&&(t=[t]),CMPlayer=e("./CMPlayer"),CMPlayer.play(t,a))};return{open:t,play:l,openEditor:n,openIE:i,download:a}}),define("app/common/CMPlayer",[],function(){var e={ting:{path:"music/ting",width:410,height:530},beveled:{path:"music/beveled",width:350,height:200},kuwo:{path:"music/kuwo",width:480,height:200},manila:{path:"music/manila",width:320,height:400},mp3player:{path:"music/mp3player",width:320,height:410},qqmusic:{path:"music/qqmusic",width:300,height:400},somusic:{path:"music/somusic",width:420,height:137},xdj:{path:"music/xdj",width:595,height:235},webplayer:{path:"movie/webplayer",width:600,height:400},qqplayer:{path:"movie/qqplayer",width:600,height:400},tvlive:{path:"movie/tvlive",width:600,height:400},youtube:{path:"movie/youtube",width:600,height:400},vplayer:{path:"movie/vplayer",width:600,height:400}},t=function(e){return"music"==e?"music_player":(void 0==e&&(e="mp3"),inArray(core.filetype.music,e)?"music_player":"movie_player")},a=function(t){var a,i,n;"music_player"==t?(a=e[G.musictheme],i="music player",n=!1):(a=e[G.movietheme],i="movie player",n=!0);var o=core.createFlash(G.static_path+"js/lib/cmp4/cmp.swf","context_menu=2&auto_play=1&play_mode=1&skin=skins/"+a.path+".zip",t),l={id:t+"_dialog",simple:!0,title:i,width:a.width,height:a.height,content:o,resize:n,padding:0,fixed:!0,close:function(){var e=s(t);e&&e.sendEvent&&e.sendEvent("view_stop")}};window.top.CMP?art.dialog.through(l):$.dialog(l)},i=function(e){var t,a="";for(t=e.length-1;t>=0;t--){var i,s;-1==e[t].search("fileProxy")?(i=urlEncode(e[t]),s=core.pathThis(e[t])):(i=e[t],s=core.pathThis(urlDecode(i))),i=i.replace(/%2F/g,"/"),i=i.replace(/%3F/g,"?"),i=i.replace(/%26/g,"&"),i=i.replace(/%3A/g,":"),i=i.replace(/%3D/g,"="),a+=''}return a},s=function(e){return window.top.CMP?window.top.CMP.get(e):CMP.get(e)},n=function(e,t){var a=i(e),n=s(t);if(n){n.config("play_mode","normal");var o=n.list().length;n.list_xml(a,!0),n.sendEvent("view_play",o+1)}};return{changeTheme:function(t,a){var i,n,o;"music"==t?(G.musictheme=a,i="music_player"):"movie"==t&&(G.movietheme=a,i="movie_player"),o=s(i),o&&(n=e[a],window.top.art.dialog.list[i+"_dialog"].size(n.width,n.height),o.sendEvent("skin_load","skins/"+n.path+".zip"))},play:function(e,i){var o=t(i),l=s(o);l?(n(e,o),window.top.art.dialog.list[o+"_dialog"].display(!0)):(a(o),setTimeout(function(){n(e,o)},1e3))}}}); \ No newline at end of file diff --git a/static/js/app/src/edit/main.js b/static/js/app/src/edit/main.js index cbab8e3..bdb7a22 100644 --- a/static/js/app/src/edit/main.js +++ b/static/js/app/src/edit/main.js @@ -1,2 +1,2 @@ -var animate_time=160;define("app/src/edit/main",["lib/jquery-lib","lib/util","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","./taskTap","./toolbar","./edit","./mode","../../common/core","../../tpl/search","../../tpl/upload"],function(e){e("lib/jquery-lib"),e("lib/util"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),Tap=e("./taskTap"),Toolbar=e("./toolbar"),Editor=e("./edit"),core=e("../../common/core"),rightMenu=Tap.rightMenu,preview=Toolbar.preview,$(document).ready(function(){Tap.init(),Toolbar.init(),""!=G.frist_file&&Editor.add(G.frist_file),window.onbeforeunload=function(){return Editor.hasFileSave()?LNG.if_save_file:void 0}})}),define("app/src/edit/taskTap",[],function(){var e=function(){$(".edit_tab .tab").live("mouseenter",function(){$(this).hasClass("this")||$(this).addClass("hover"),$(this).unbind("mousedown").mousedown(function(e){$(this).hasClass("this")||$.nodeName(e.target,"A")||($(this).removeClass("hover").addClass("this"),Editor.select($(this).attr("uuid")))})}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("hover")}).die("dblclick").live("dblclick",function(e){Editor.remove($(this).attr("uuid")),stopPP(e)}),$(".edit_tab").die("dblclick").live("dblclick",function(e){Editor.add(),stopPP(e)}),$(".edit_tab .tab .close").live("click",function(){var e=$(this).parent().attr("uuid");Editor.remove(e)})},t=function(){$(".context-menu-list").filter(":visible").trigger("contextmenu:hide")},a=function(){$("body").click(t).contextmenu(t),$.contextMenu({zIndex:9999,selector:".edit_tab_menu",items:{close:{name:LNG.close,icon:"remove",accesskey:"d"},close_right:{name:LNG.close_right,icon:"remove-sign",accesskey:"r"},close_others:{name:LNG.close_others,icon:"remove-circle",accesskey:"o"},sep1:"--------",create:{name:LNG.newfile,icon:"plus",accesskey:"n"},preview:{name:LNG.preview,icon:"globe",accesskey:"p"}},callback:function(e,t){var a=t.$trigger,i=a.attr("uuid");switch(e){case"close":Editor.remove();break;case"close_right":var s=$(".edit_tab .tabs .tab").index(a);$(".edit_tab .tabs .tab:gt("+s+")").each(function(){Editor.remove($(this).attr("uuid"))});break;case"close_others":$(".edit_tab .tabs .tab").each(function(){var e=$(this).attr("uuid");e!=i&&Editor.remove(e)});break;case"create":Editor.add();break;case"preview":Toolbar.doAction("preview");break;default:}}})},i=function(){var e,t,a,i,s=!1,o=!1,n=0,l=0,r=0,c=0,d=0,p=0;$(".edit_tab .tab").die("mousedown").live("mousedown",function(t){$.nodeName(t.target,"A")||(e=$.nodeName(t.target,"SPAN")?$(t.target).parent():$(this),s=!0,this.setCapture&&this.setCapture(),$(document).mousemove(function(e){f(e)}),$(document).one("mouseup",function(e){return m(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1}))});var u=function(i){o=!0,n=i.pageX,$tab_parent=$(".edit_tab"),t=$(".edit_tab .tab"),$(".draggable-dragging").remove(),a=e.clone().addClass("draggable-dragging").prependTo("body"),c=parseInt(t.css("margin-right")),d=$tab_parent.width(),p=$tab_parent.get(0).getBoundingClientRect().left,p+=$(window).scrollLeft(),l=e.get(0).getBoundingClientRect().left,r=parseInt(t.css("width"));var s=e.get(0).getBoundingClientRect().top-parseInt(e.css("margin-top")),u=i.clientX-n+l;$("body").prepend("
    "),a.css({width:r+"px",top:s,left:u}),e.css("opacity",0)},f=function(i){if(s){0==o&&u(i);var f=i.clientX-n+l;p>f||f>p+d-r||(a.css("left",f),t.each(function(){var t=$(this).get(0).getBoundingClientRect().left;if(f>t&&t+r/2+c>f){if(e.attr("uuid")==$(this).attr("uuid"))return;h($(this).attr("uuid"),"left")}if(f>t-r/2+c&&t>f){if(e.attr("uuid")==$(this).attr("uuid"))return;h($(this).attr("uuid"),"right")}}))}},h=function(a,s){if(!e.is(":animated")||i!=a){i=a,e.stop(!0,!0),$(".insertTemp").remove(),t=$(".edit_tab .tab");var o=e.width(),n=$(".edit_tab .tab_"+a),l=e.clone(!0).insertAfter(e).css({"margin-right":"0px",border:"none"}).addClass("insertTemp");"left"==s?e.after(n).css("width","0px"):(e.before(n).css("width","0px"),n.before(l)),e.animate({width:o+"px"},animate_time),l.animate({width:"0px"},animate_time,function(){$(this).remove(),t=$(".edit_tab .tab")})}},m=function(){s=!1,o=!1,startTime=0,$(".dragMaskView").remove(),void 0!=a&&(l=e.get(0).getBoundingClientRect().left,a.animate({left:l+"px"},animate_time,function(){e.css("opacity",1),$(this).remove()}))}},s=function(e,t,a){var i=1.5*animate_time,s=122,o=s,n=$(".edit_tab .tab"),l=$(".edit_tab .tabs").width()-4,r=parseInt(n.css("margin-right"))+parseInt(n.css("border-right")),c=parseInt($(".edit_tab .add").outerWidth())+2*r,d=n.length,p=Math.floor((l-c)/(s+r));switch(d>p&&(o=Math.floor((l-c)/d)-r),e){case"add":$(".edit_tab .tabs .this").css({"margin-top":"30px",width:o}).animate({"margin-top":"0px"},i),n.animate({width:o+"px"},i);break;case"remove":void 0!=a&&Editor.select(a),t.animate({width:"0","margin-top":"+=30"},i,function(){t.remove()}),n.animate({width:o+"px"},i);break;case"resize":n.css("width",o+"px");break;default:}};return{rightMenu:{hidden:t},resetWidth:s,init:function(){$("body").live("resize",function(){s("resize")}),e(),i(),a(),Mousetrap.bind(["ctrl+s","command+s"],function(e){e.preventDefault(),e.returnvalue=!1,Editor.save()})}}}),define("app/src/edit/toolbar",[],function(){var e=function(){$(window).bind("resize",function(){i.resize()}),$("#fontsize li").mouseenter(function(){$(this).addClass("lihover"),$(this).unbind("click").click(function(){var e=$(this).text();$("a.font span").text(e),Editor.config("fontsize",e),$(".dropbox").css("display","none"),$("#fontsize li.this").removeClass("this"),$(this).addClass("this"),Editor.current()&&Editor.current().focus()})}).mouseleave(function(){$(this).toggleClass("lihover")}),$(".tools a[action=wordbreak],.tools a[action=display],.tools a[action=auto_complete]").bind("click",function(){$(this).toggleClass("select")}),$(".tools a").bind("click",function(){var e=$(this).attr("action");t(e),Editor.current()&&Editor.current().focus()}),$("#codetheme li").mouseenter(function(){$(this).addClass("lihover"),$(this).unbind("click").click(function(){var e=$(this).attr("theme");Editor.config("theme",e),$("a[action=codetheme] span").text($(this).html()),$(".dropbox").css("display","none"),$("#codetheme li.this").removeClass("this"),$(this).addClass("this")})}).mouseleave(function(){$(this).toggleClass("lihover")}),$(".tools .left a").tooltip({placement:"bottom"})},t=function(e){switch(e){case"max":FrameCall.father("core.editorFull","''");break;default:}if(Editor.current())switch(e){case"save":Editor.save();break;case"saveall":Editor.saveall();break;case"pre":Editor.current().undo();break;case"next":Editor.current().redo();break;case"find":Editor.current().execCommand("find");break;case"gotoline":Editor.current().commands.exec("gotoline",Editor.current());break;case"font":"block"==$("#fontsize").css("display")?$("#fontsize").fadeOut(100):$("#fontsize").fadeIn(100);break;case"codetheme":"block"==$("#codetheme").css("display")?$("#codetheme").fadeOut(100):$("#codetheme").fadeIn(100);break;case"wordbreak":Editor.config("wrap");break;case"display":Editor.config("display");break;case"setting":Editor.config("setting");break;case"auto_complete":Editor.config("auto_complete");break;case"preview":var t=urlDecode(urlDecode(Editor.current().kod.filename));t=core.path2url(t),i.open(t);break;case"close":Editor.remove();break;default:}},a=function(){$(".frame_right input").keyEnter(i.refresh);var e=!1,t=0,a=0;$drag=$(".frame_right .resize"),$box_left=$(".frame_left"),$box=$drag.parent(),$drag.die("mousedown").live("mousedown",function(e){return 1!=e.which?!0:(s(e),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){o(e)}),$(document).one("mouseup",function(e){return n(e),this.releaseCapture&&this.releaseCapture(),!1}),void 0)});var s=function(i){e=!0,t=i.pageX,a=$box.width(),$drag.addClass("resize_active"),$("body").css("cursor","col-resize"),$box.append('
    ')},o=function(i){if(!e)return!0;var s=i.pageX-t,o=a-s,n=$(window).width();o>=n-50&&(o=n-50),100>=o&&(o=100),$box_left.css("width",n-o).find(".edit_body").css("width",n-o),$box.width(o),Tap.resetWidth("resize"),Editor.config("resize")},n=function(){return e?(e=!1,$drag.removeClass("resize_active"),$("body").css("cursor","default"),$box.find(".mask_view").remove(),void 0):!1}},i=function(){var e=$(".frame_right"),t=$(".frame_left"),a=e.find("input"),s=400;return{open:function(t){if("block"!=e.css("display")){e.css("display","block").css("width",s);var o=$(window).width()-s;$(".frame_left").css("width",o).find(".edit_body").css("width",o)}a.val(t),e.find(".open_ie").attr("href",t),e.find("iframe").attr("src",t),i.resize()},resize:function(){if("block"==e.css("display")){var a=e.width(),i=$(window).width();a>=i-50&&(a=i-50),100>=a&&(a=100),e.width(a),t.css("width",i-a).find(".edit_body").css("width",i-a)}Tap.resetWidth("resize"),Editor.config("resize")},close:function(){e.css("display","none"),a.val(""),e.find("iframe").attr("src",""),$(".frame_left").css("width","100%").find(".edit_body").css("width","100%"),Tap.resetWidth("resize"),Editor.config("resize")},refresh:function(){var t=a.attr("value");e.find(".open_ie").attr("href",t),e.find("iframe").attr("src",t)}}}();return{preview:i,doAction:t,init:function(){e(),a()}}}),define("app/src/edit/edit",["./mode"],function(e){var t={theme:G.codetheme,auto_complete:!0,fontsize:14,wrap:!0,display:!1},a={},i=void 0,s=e("./mode");ace.require("ace/ext/language_tools");var o=function(e,t){if(void 0==t||void 0==e||1>a.length)return"";for(var i in a)if(a[i].kod[e]==t)return a[i].kod.uuid;return""},n=function(e){var t,i="id_"+UUID();if(void 0==e)return t={uuid:i,name:"newfile.txt",charset:"utf-8",filename:"",mode:s.get("txt")},l(t),r(t),$(".edit_body .this").removeClass("this"),$(".edit_body pre#"+i).addClass("this"),void 0;t={charset:"utf-8",uuid:i,name:core.pathThis(urlDecode(urlDecode(e))),filename:e,mode:s.get(core.pathExt(urlDecode(e)))},l(t,!0);var o=art.dialog({title:!1,content:LNG.getting,icon:"warning"});$.ajax({dataType:"json",url:"./?editor/fileGet&filename="+e,error:function(){o.close(),v(t.uuid),Tips.tips(LNG.system_error,!1)},success:function(e){if(o.close(),!e.code)return Tips.tips(e),v(t.uuid),void 0;var s=e.data;a[i]=void 0,$("pre#"+i).text(s.content),r(t),$(".edit_body .this").removeClass("this"),$(".edit_body pre#"+i).addClass("this");var n=a[i];n.kod.charset=s.charset,n.navigateTo(0),n.moveCursorTo(0,0)}})},l=function(e,t){var a='
    '+'
    '+e.name+"
    "+' '+'
    '+"
    ";$(a).insertBefore(".edit_tab .add");var i='
    ';if($(".edit_body .tabs").append(i),c(e.uuid),t){var s=animate_time;animate_time=1,Tap.resetWidth("add"),animate_time=s}else Tap.resetWidth("add")},r=function(e){var s=ace.edit(e.uuid);s.setTheme("ace/theme/"+t.theme),void 0!=e.mode&&s.getSession().setMode("ace/mode/"+e.mode),s.getSession().setTabSize(4),s.getSession().setUseSoftTabs(!0),s.getSession().setUseWrapMode(t.wrap),s.setShowPrintMargin(!1),s.setDragDelay(100),s.setShowInvisibles(t.display),s.setFontSize(t.fontsize),s.setOptions({enableBasicAutocompletion:t.auto_complete,enableSnippets:!0}),s.on("change",function(e){t.auto_complete&&2>s.multiSelect.rangeCount&&"insertText"==e.data.action&&s.commands.exec("startAutocomplete",s),u(s,!0)}),s.commands.addCommand({name:"editSave",bindKey:{win:"Ctrl-S",mac:"Command-S",sender:"editor|cli"},exec:function(e){f(e.kod.uuid)}}),s.commands.addCommand({name:"preview",bindKey:{win:"Ctrl-Shift-S",mac:"Command-Shift-S"},exec:function(){preview.open(),Toolbar.doAction("preview")}}),s.kod={uuid:e.uuid,name:e.name,charset:"ansii",filename:e.filename},a[e.uuid]=s,i=e.uuid,a[i].focus()},c=function(e,t){$(".edit_tab .this").removeClass("this"),$(".edit_tab .tab_"+e).addClass("this"),i=e,void 0!=a[e]&&a[e].focus(),1==t&&$(".edit_tab .this").stop(!0,!0).animate({opacity:.3},100).animate({opacity:.8},100).animate({opacity:.5},40).animate({opacity:1},40,function(){a[e].focus()})},d=function(e,t){void 0!=e&&""!=e&&(c(e,t),$(".edit_body .this").removeClass("this"),$(".edit_body pre#"+e).addClass("this"))},p=function(e,i,s){var o=a;void 0!=s&&(o={},o[s]=a[s]);for(var n in o){var l=o[n];switch(e){case"resize":l.resize();break;case"theme":t[e]=i,l.setTheme("ace/theme/"+i);break;case"fontsize":t[e]=i,l.setFontSize(i);break;case"wrap":t[e]=!l.getSession().getUseWrapMode(),l.getSession().setUseWrapMode(t[e]);break;case"display":t[e]=!l.getShowInvisibles(),l.setShowInvisibles(t[e]);break;case"setting":l.commands.exec("showSettingsMenu",l);break;case"auto_complete":t[e]=!l.$enableBasicAutocompletion,l.$enableBasicAutocompletion=t[e];break;default:}}"theme"==e&&$.ajax({url:"?setting/set&k=codetheme&v="+i,dataType:"json",success:function(e){tips(e)}})},u=function(e,t){t!=e.hasChanged&&(e.hasChanged=t,$(".edit_tab .tabs .tab_"+e.kod.uuid).toggleClass("edit_changed"))},f=function(e,t){if(void 0!=i){void 0==e&&(e=i),void 0==t&&(t=!1);var s=a[e];if(s.hasChanged){if(void 0==s||""==s)return tips(LNG.data_error,"warning"),void 0;b().focus();var o=urlEncode2(s.getValue()),n=s.kod.filename;$.ajax({type:"POST",async:!1,dataType:"json",url:"?editor/fileSave",data:"path="+n+"&charset="+s.kod.charset+"&filestr="+o,beforeSend:function(){Tips.loading(LNG.sending)},error:core.ajaxError,success:function(a){Tips.close(a),a.code&&(u(s,!1),t&&v(e))}})}}},h=function(){for(var e in a)f(e)},m=function(e){if(void 0==e&&(e=i),void 0!=a[e]){var t=a[e];t.hasChanged?$.dialog({title:LNG.warning,resize:!1,background:"#fff",opacity:.4,lock:!0,icon:"question",content:t.kod.name+"
    "+LNG.if_save_file,padding:30,button:[{name:LNG.button_save,focus:!0,callback:function(){f(e,!0)}},{name:LNG.button_not_save,callback:function(){v(e)}},{name:LNG.button_cancle,callback:function(){b().focus()}}]}):v(e)}},v=function(e){delete a[e];var t="",i=$(".edit_tab .tab"),s=$(".edit_tab .tab_"+e),o=$(".edit_body pre#"+e);s.hasClass("this")?(i.length>1&&($(i[0]).attr("uuid")==e?t=$(i[1]).attr("uuid"):i.each(function(){var a=$(this).attr("uuid");return a==e?!1:(t=a,void 0)})),""!=t&&$(".edit_body pre#"+t).addClass("this"),o.remove(),Tap.resetWidth("remove",s,t)):(o.remove(),Tap.resetWidth("remove",s))},g=function(){for(var e in a)if(a[e].hasChanged)return!0;return!1},_=function(e){core.setSkin(e,"app_code_edit.css")},b=function(){return i&&a[i]?a[i]:!1};return{current:b,hasFileSave:g,config:p,setTheme:_,select:d,remove:m,save:f,saveall:h,add:function(e){var t=o("filename",e);""!=t?d(t,!0):n(e)}}}),define("app/src/edit/mode",[],function(){function e(){for(var e in i)for(var t=0;i[e].length>t;t++)a[i[e][t]]=e}function t(e){return a[e]}var a={},i={abap:["abap"],actionscript:["as"],ada:["ada","adb"],apache_conf:["htaccess","htgroups","htpasswd","conf","htaccess","htgroups","htpasswd"],asciidoc:["asciidoc"],assembly_x86:["asm"],autohotkey:["ahk"],batchfile:["bat","cmd"],c9search:["c9search_results"],c_cpp:["cpp","c","cc","cxx","h","hh","hpp"],clojure:["clj"],cobol:["cbl","cob"],coffee:["coffee","cf","cson","cakefile"],coldfusion:["cfm"],csharp:["cs"],css:["css"],curly:["curly"],d:["d","di"],dart:["dart"],diff:["diff","patch"],dot:["dot"],erlang:["erl","hrl"],ejs:["ejs"],forth:["frt","fs","ldr"],ftl:["ftl"],glsl:["glsl","frag","vert"],golang:["go"],groovy:["groovy"],haml:["haml"],handlebars:["hbs","handlebars","tpl","mustache"],haskell:["hs"],haxe:["hx"],html:["html","htm","xhtml","cshtml"],html_ruby:["erb","rhtml"],ini:["ini","conf","cfg","prefs"],jack:["jack"],jade:["jade"],java:["java"],javascript:["js","jsm"],json:["json","oexe"],jsoniq:["jq"],jsp:["jsp"],jsx:["jsx"],julia:["jl"],latex:["tex","latex","ltx","bib"],less:["less"],liquid:["liquid"],lisp:["lisp"],livescript:["ls"],logiql:["logic","lql"],lsl:["lsl"],lua:["lua"],luapage:["lp"],lucene:["lucene"],makefile:["makefile","gnumakefile","makefile","ocamlmakefile","make"],matlab:["matlab"],markdown:["md","markdown"],mel:["mel"],mysql:["mysql"],mushcode:["mc","mush"],nix:["nix"],objectivec:["m","mm"],ocaml:["ml","mli"],pascal:["pas","p"],perl:["pl","pm"],pgsql:["pgsql"],php:["php","phtml"],powershell:["ps1"],prolog:["plg","prolog"],properties:["properties"],protobuf:["proto"],python:["py"],r:["r"],rdoc:["rd"],rhtml:["rhtml"],ruby:["rb","ru","gemspec","rake","guardfile","rakefile","gemfile"],rust:["rs"],sass:["sass"],scad:["scad"],scala:["scala"],scheme:["scm","rkt"],scss:["scss"],sh:["sh","bash",".bashrc"],sjs:["sjs"],space:["space"],snippets:["snippets"],soy_template:["soy"],sql:["sql"],stylus:["styl","stylus"],svg:["svg"],tcl:["tcl"],tex:["tex"],text:["txt","ini","log"],textile:["textile"],toml:["toml"],twig:["twig"],typescript:["ts","typescript","str"],vbscript:["vbs"],velocity:["vm"],verilog:["v","vh","sv","svh"],xml:["xml","rdf","rss","wsdl","xslt","atom","mathml","mml","xul","xbl"],xquery:["xq"],yaml:["yaml","yml"]};return e(),{get:t,modes:a}}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t='
    '+e.responseText+"
    ",a=$.dialog.list.ajaxErrorDialog;a?a.content(t):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:t})},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),o=function(){var o=template.compile(s.html);0==$(".dialog_do_search").length?(l(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:o(i)}),r(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),n(),$.dialog.list.dialog_do_search.display(!0))},n=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},r(i)},l=function(){$("#search_value,#search_ext,#search_path").keyEnter(n),$(".search_header a.button").die("click").live("click",n),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},r=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};o()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var o='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(o).insertBefore($(e).find(".item:eq(0)")):$(e).append(o),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "} +var animate_time=160;define("app/src/edit/main",["lib/jquery-lib","lib/util","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","./taskTap","./toolbar","./edit","./mode","../../common/core","../../tpl/search","../../tpl/upload"],function(e){e("lib/jquery-lib"),e("lib/util"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),Tap=e("./taskTap"),Toolbar=e("./toolbar"),Editor=e("./edit"),core=e("../../common/core"),rightMenu=Tap.rightMenu,preview=Toolbar.preview,Global={topbar_height:40,isIE:!-[1]},$(document).ready(function(){Tap.init(),Toolbar.init(),""!=G.frist_file&&Editor.add(G.frist_file),window.onbeforeunload=function(){return Editor.hasFileSave()?LNG.if_save_file:void 0}})}),define("app/src/edit/taskTap",[],function(){var e=function(){$(".edit_tab .tab").live("mouseenter",function(){$(this).hasClass("this")||$(this).addClass("hover"),$(this).unbind("mousedown").mousedown(function(e){$(this).hasClass("this")||$.nodeName(e.target,"A")||($(this).removeClass("hover").addClass("this"),Editor.select($(this).attr("uuid")))})}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("hover")}).die("dblclick").live("dblclick",function(e){Editor.remove($(this).attr("uuid")),stopPP(e)}),$(".edit_tab").die("dblclick").live("dblclick",function(e){Editor.add(),stopPP(e)}),$(".edit_tab .tab .close").live("click",function(){var e=$(this).parent().attr("uuid");Editor.remove(e)})},t=function(){$(".context-menu-list").filter(":visible").trigger("contextmenu:hide")},a=function(){$("body").click(t).contextmenu(t),$.contextMenu({zIndex:9999,selector:".edit_tab_menu",items:{close:{name:LNG.close,icon:"remove",accesskey:"d"},close_right:{name:LNG.close_right,icon:"remove-sign",accesskey:"r"},close_others:{name:LNG.close_others,icon:"remove-circle",accesskey:"o"},sep1:"--------",create:{name:LNG.newfile,icon:"plus",accesskey:"n"},preview:{name:LNG.preview,icon:"globe",accesskey:"p"}},callback:function(e,t){var a=t.$trigger,i=a.attr("uuid");switch(e){case"close":Editor.remove();break;case"close_right":var s=$(".edit_tab .tabs .tab").index(a);$(".edit_tab .tabs .tab:gt("+s+")").each(function(){Editor.remove($(this).attr("uuid"))});break;case"close_others":$(".edit_tab .tabs .tab").each(function(){var e=$(this).attr("uuid");e!=i&&Editor.remove(e)});break;case"create":Editor.add();break;case"preview":Toolbar.doAction("preview");break;default:}}})},i=function(){var e,t,a,i,s=!1,o=!1,n=0,l=0,r=0,c=0,d=0,p=0;$(".edit_tab .tab").die("mousedown").live("mousedown",function(t){$.nodeName(t.target,"A")||(e=$.nodeName(t.target,"SPAN")?$(t.target).parent():$(this),s=!0,this.setCapture&&this.setCapture(),$(document).mousemove(function(e){f(e)}),$(document).one("mouseup",function(e){return m(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1}))});var u=function(i){o=!0,n=i.pageX,$tab_parent=$(".edit_tab"),t=$(".edit_tab .tab"),$(".draggable-dragging").remove(),a=e.clone().addClass("draggable-dragging").prependTo("body"),c=parseInt(t.css("margin-right")),d=$tab_parent.width(),p=$tab_parent.get(0).getBoundingClientRect().left,p+=$(window).scrollLeft(),l=e.get(0).getBoundingClientRect().left,r=parseInt(t.css("width"));var s=e.get(0).getBoundingClientRect().top-parseInt(e.css("margin-top")),u=i.clientX-n+l;$("body").prepend("
    "),a.css({width:r+"px",top:s,left:u}),e.css("opacity",0)},f=function(i){if(s){0==o&&u(i);var f=i.clientX-n+l;p>f||f>p+d-r||(a.css("left",f),t.each(function(){var t=$(this).get(0).getBoundingClientRect().left;if(f>t&&t+r/2+c>f){if(e.attr("uuid")==$(this).attr("uuid"))return;h($(this).attr("uuid"),"left")}if(f>t-r/2+c&&t>f){if(e.attr("uuid")==$(this).attr("uuid"))return;h($(this).attr("uuid"),"right")}}))}},h=function(a,s){if(!e.is(":animated")||i!=a){i=a,e.stop(!0,!0),$(".insertTemp").remove(),t=$(".edit_tab .tab");var o=e.width(),n=$(".edit_tab .tab_"+a),l=e.clone(!0).insertAfter(e).css({"margin-right":"0px",border:"none"}).addClass("insertTemp");"left"==s?e.after(n).css("width","0px"):(e.before(n).css("width","0px"),n.before(l)),e.animate({width:o+"px"},animate_time),l.animate({width:"0px"},animate_time,function(){$(this).remove(),t=$(".edit_tab .tab")})}},m=function(){s=!1,o=!1,startTime=0,$(".dragMaskView").remove(),void 0!=a&&(l=e.get(0).getBoundingClientRect().left,a.animate({left:l+"px"},animate_time,function(){e.css("opacity",1),$(this).remove()}))}},s=function(e,t,a){var i=1.5*animate_time,s=122,o=s,n=$(".edit_tab .tab"),l=$(".edit_tab .tabs").width()-4,r=parseInt(n.css("margin-right"))+parseInt(n.css("border-right")),c=parseInt($(".edit_tab .add").outerWidth())+2*r,d=n.length,p=Math.floor((l-c)/(s+r));switch(d>p&&(o=Math.floor((l-c)/d)-r),e){case"add":$(".edit_tab .tabs .this").css({"margin-top":"30px",width:o}).animate({"margin-top":"0px"},i),n.animate({width:o+"px"},i);break;case"remove":void 0!=a&&Editor.select(a),t.animate({width:"0","margin-top":"+=30"},i,function(){t.remove()}),n.animate({width:o+"px"},i);break;case"resize":n.css("width",o+"px");break;default:}};return{rightMenu:{hidden:t},resetWidth:s,init:function(){$("body").live("resize",function(){s("resize")}),e(),i(),a(),Mousetrap.bind(["ctrl+s","command+s"],function(e){e.preventDefault(),e.returnvalue=!1,Editor.save()})}}}),define("app/src/edit/toolbar",[],function(){var e=function(){$(window).bind("resize",function(){i.resize()}),$("#fontsize li").mouseenter(function(){$(this).addClass("lihover"),$(this).unbind("click").click(function(){var e=$(this).text();$("a.font span").text(e),Editor.config("fontsize",e),$(".dropbox").css("display","none"),$("#fontsize li.this").removeClass("this"),$(this).addClass("this"),Editor.current()&&Editor.current().focus()})}).mouseleave(function(){$(this).toggleClass("lihover")}),$(".tools a[action=wordbreak],.tools a[action=display],.tools a[action=auto_complete]").bind("click",function(){$(this).toggleClass("select")}),$(".tools a").bind("click",function(){var e=$(this).attr("action");t(e),Editor.current()&&Editor.current().focus()}),$("#codetheme li").mouseenter(function(){$(this).addClass("lihover"),$(this).unbind("click").click(function(){var e=$(this).attr("theme");Editor.config("theme",e),$("a[action=codetheme] span").text($(this).html()),$(".dropbox").css("display","none"),$("#codetheme li.this").removeClass("this"),$(this).addClass("this")})}).mouseleave(function(){$(this).toggleClass("lihover")}),$(".tools .left a").tooltip({placement:"bottom"})},t=function(e){switch(e){case"max":FrameCall.father("core.editorFull","''");break;default:}if(Editor.current())switch(e){case"save":Editor.save();break;case"saveall":Editor.saveall();break;case"pre":Editor.current().undo();break;case"next":Editor.current().redo();break;case"find":Editor.current().execCommand("find");break;case"gotoline":Editor.current().commands.exec("gotoline",Editor.current());break;case"font":"block"==$("#fontsize").css("display")?$("#fontsize").fadeOut(100):$("#fontsize").fadeIn(100);break;case"codetheme":"block"==$("#codetheme").css("display")?$("#codetheme").fadeOut(100):$("#codetheme").fadeIn(100);break;case"wordbreak":Editor.config("wrap");break;case"display":Editor.config("display");break;case"setting":Editor.config("setting");break;case"auto_complete":Editor.config("auto_complete");break;case"preview":var t=urlDecode(urlDecode(Editor.current().kod.filename));t=core.path2url(t),i.open(t);break;case"close":Editor.remove();break;default:}},a=function(){$(".frame_right input").keyEnter(i.refresh);var e=!1,t=0,a=0;$drag=$(".frame_right .resize"),$box_left=$(".frame_left"),$box=$drag.parent(),$drag.die("mousedown").live("mousedown",function(e){return 1!=e.which?!0:(s(e),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){o(e)}),$(document).one("mouseup",function(e){return n(e),this.releaseCapture&&this.releaseCapture(),!1}),void 0)});var s=function(i){e=!0,t=i.pageX,a=$box.width(),$drag.addClass("resize_active"),$("body").css("cursor","col-resize"),$box.append('
    ')},o=function(i){if(!e)return!0;var s=i.pageX-t,o=a-s,n=$(window).width();o>=n-50&&(o=n-50),100>=o&&(o=100),$box_left.css("width",n-o).find(".edit_body").css("width",n-o),$box.width(o),Tap.resetWidth("resize"),Editor.config("resize")},n=function(){return e?(e=!1,$drag.removeClass("resize_active"),$("body").css("cursor","default"),$box.find(".mask_view").remove(),void 0):!1}},i=function(){var e=$(".frame_right"),t=$(".frame_left"),a=e.find("input"),s=400;return{open:function(t){if("block"!=e.css("display")){e.css("display","block").css("width",s);var o=$(window).width()-s;$(".frame_left").css("width",o).find(".edit_body").css("width",o)}a.val(t),e.find(".open_ie").attr("href",t),e.find("iframe").attr("src",t),i.resize()},resize:function(){if("block"==e.css("display")){var a=e.width(),i=$(window).width();a>=i-50&&(a=i-50),100>=a&&(a=100),e.width(a),t.css("width",i-a).find(".edit_body").css("width",i-a)}Tap.resetWidth("resize"),Editor.config("resize")},close:function(){e.css("display","none"),a.val(""),e.find("iframe").attr("src",""),$(".frame_left").css("width","100%").find(".edit_body").css("width","100%"),Tap.resetWidth("resize"),Editor.config("resize")},refresh:function(){var t=a.attr("value");e.find(".open_ie").attr("href",t),e.find("iframe").attr("src",t)}}}();return{preview:i,doAction:t,init:function(){e(),a()}}}),define("app/src/edit/edit",["./mode"],function(e){var t={theme:G.codetheme,auto_complete:!0,fontsize:14,wrap:!0,display:!1},a={},i=void 0,s=e("./mode");ace.require("ace/ext/language_tools");var o=function(e,t){if(void 0==t||void 0==e||1>a.length)return"";for(var i in a)if(a[i].kod[e]==t)return a[i].kod.uuid;return""},n=function(e){var t,i="id_"+UUID();if(void 0==e)return t={uuid:i,name:"newfile.txt",charset:"utf-8",filename:"",mode:s.get("txt")},l(t),r(t),$(".edit_body .this").removeClass("this"),$(".edit_body pre#"+i).addClass("this"),void 0;t={charset:"utf-8",uuid:i,name:core.pathThis(urlDecode(urlDecode(e))),filename:e,mode:s.get(core.pathExt(urlDecode(e)))},l(t,!0);var o=art.dialog({title:!1,content:LNG.getting,icon:"warning"});$.ajax({dataType:"json",url:"./index.php?editor/fileGet&filename="+e,error:function(e,a,i){o.close(),v(t.uuid),core.ajaxError(e,a,i)},success:function(e){if(o.close(),!e.code)return Tips.tips(e),v(t.uuid),void 0;var s=e.data;a[i]=void 0,$("pre#"+i).text(s.content),r(t),$(".edit_body .this").removeClass("this"),$(".edit_body pre#"+i).addClass("this");var n=a[i];n.kod.charset=s.charset,n.navigateTo(0),n.moveCursorTo(0,0)}})},l=function(e,t){var a='
    '+'
    '+e.name+"
    "+' '+'
    '+"
    ";$(a).insertBefore(".edit_tab .add");var i='
    ';if($(".edit_body .tabs").append(i),c(e.uuid),t){var s=animate_time;animate_time=1,Tap.resetWidth("add"),animate_time=s}else Tap.resetWidth("add")},r=function(e){var s=ace.edit(e.uuid);s.setTheme("ace/theme/"+t.theme),void 0!=e.mode&&s.getSession().setMode("ace/mode/"+e.mode),s.getSession().setTabSize(4),s.getSession().setUseSoftTabs(!0),s.getSession().setUseWrapMode(t.wrap),s.setShowPrintMargin(!1),s.setDragDelay(100),s.setShowInvisibles(t.display),s.setFontSize(t.fontsize),s.setOptions({enableBasicAutocompletion:t.auto_complete,enableSnippets:!0}),s.on("change",function(e){t.auto_complete&&2>s.multiSelect.rangeCount&&"insertText"==e.data.action&&s.commands.exec("startAutocomplete",s),u(s,!0)}),s.commands.addCommand({name:"editSave",bindKey:{win:"Ctrl-S",mac:"Command-S",sender:"editor|cli"},exec:function(e){f(e.kod.uuid)}}),s.commands.addCommand({name:"preview",bindKey:{win:"Ctrl-Shift-S",mac:"Command-Shift-S"},exec:function(){preview.open(),Toolbar.doAction("preview")}}),s.kod={uuid:e.uuid,name:e.name,charset:"ansii",filename:e.filename},a[e.uuid]=s,i=e.uuid,a[i].focus()},c=function(e,t){$(".edit_tab .this").removeClass("this"),$(".edit_tab .tab_"+e).addClass("this"),i=e,void 0!=a[e]&&a[e].focus(),1==t&&$(".edit_tab .this").stop(!0,!0).animate({opacity:.3},100).animate({opacity:.8},100).animate({opacity:.5},40).animate({opacity:1},40,function(){a[e].focus()})},d=function(e,t){void 0!=e&&""!=e&&(c(e,t),$(".edit_body .this").removeClass("this"),$(".edit_body pre#"+e).addClass("this"))},p=function(e,i,s){var o=a;void 0!=s&&(o={},o[s]=a[s]);for(var n in o){var l=o[n];switch(e){case"resize":l.resize();break;case"theme":t[e]=i,l.setTheme("ace/theme/"+i);break;case"fontsize":t[e]=i,l.setFontSize(i);break;case"wrap":t[e]=!l.getSession().getUseWrapMode(),l.getSession().setUseWrapMode(t[e]);break;case"display":t[e]=!l.getShowInvisibles(),l.setShowInvisibles(t[e]);break;case"setting":l.commands.exec("showSettingsMenu",l);break;case"auto_complete":t[e]=!l.$enableBasicAutocompletion,l.$enableBasicAutocompletion=t[e];break;default:}}"theme"==e&&$.ajax({url:"./index.php?setting/set&k=codetheme&v="+i,dataType:"json",success:function(e){tips(e)}})},u=function(e,t){t!=e.hasChanged&&(e.hasChanged=t,$(".edit_tab .tabs .tab_"+e.kod.uuid).toggleClass("edit_changed"))},f=function(e,t){if(void 0!=i){void 0==e&&(e=i),void 0==t&&(t=!1);var s=a[e];if(s.hasChanged){if(void 0==s||""==s)return tips(LNG.data_error,"warning"),void 0;b().focus();var o=urlEncode2(s.getValue()),n=s.kod.filename;$.ajax({type:"POST",async:!1,dataType:"json",url:"./index.php?editor/fileSave",data:"path="+n+"&charset="+s.kod.charset+"&filestr="+o,beforeSend:function(){Tips.loading(LNG.sending)},error:core.ajaxError,success:function(a){Tips.close(a),a.code&&(u(s,!1),t&&v(e))}})}}},h=function(){for(var e in a)f(e)},m=function(e){if(void 0==e&&(e=i),void 0!=a[e]){var t=a[e];t.hasChanged?$.dialog({title:LNG.warning,resize:!1,background:"#fff",opacity:.4,lock:!0,icon:"question",content:t.kod.name+"
    "+LNG.if_save_file,padding:30,button:[{name:LNG.button_save,focus:!0,callback:function(){f(e,!0)}},{name:LNG.button_not_save,callback:function(){v(e)}},{name:LNG.button_cancle,callback:function(){b().focus()}}]}):v(e)}},v=function(e){delete a[e];var t="",i=$(".edit_tab .tab"),s=$(".edit_tab .tab_"+e),o=$(".edit_body pre#"+e);s.hasClass("this")?(i.length>1&&($(i[0]).attr("uuid")==e?t=$(i[1]).attr("uuid"):i.each(function(){var a=$(this).attr("uuid");return a==e?!1:(t=a,void 0)})),""!=t&&$(".edit_body pre#"+t).addClass("this"),o.remove(),Tap.resetWidth("remove",s,t)):(o.remove(),Tap.resetWidth("remove",s))},g=function(){for(var e in a)if(a[e].hasChanged)return!0;return!1},_=function(e){core.setSkin(e,"app_code_edit.css")},b=function(){return i&&a[i]?a[i]:!1};return{current:b,hasFileSave:g,config:p,setTheme:_,select:d,remove:m,save:f,saveall:h,add:function(e){var t=o("filename",e);""!=t?d(t,!0):n(e)}}}),define("app/src/edit/mode",[],function(){function e(){for(var e in i)for(var t=0;i[e].length>t;t++)a[i[e][t]]=e}function t(e){return a[e]}var a={},i={abap:["abap"],actionscript:["as"],ada:["ada","adb"],apache_conf:["htaccess","htgroups","htpasswd","conf","htaccess","htgroups","htpasswd"],asciidoc:["asciidoc"],assembly_x86:["asm"],autohotkey:["ahk"],batchfile:["bat","cmd"],c9search:["c9search_results"],c_cpp:["cpp","c","cc","cxx","h","hh","hpp"],clojure:["clj"],cobol:["cbl","cob"],coffee:["coffee","cf","cson","cakefile"],coldfusion:["cfm"],csharp:["cs"],css:["css"],curly:["curly"],d:["d","di"],dart:["dart"],diff:["diff","patch"],dot:["dot"],erlang:["erl","hrl"],ejs:["ejs"],forth:["frt","fs","ldr"],ftl:["ftl"],glsl:["glsl","frag","vert"],golang:["go"],groovy:["groovy"],haml:["haml"],handlebars:["hbs","handlebars","tpl","mustache"],haskell:["hs"],haxe:["hx"],html:["html","htm","xhtml","cshtml"],html_ruby:["erb","rhtml"],ini:["ini","conf","cfg","prefs"],jack:["jack"],jade:["jade"],java:["java"],javascript:["js","jsm"],json:["json","oexe"],jsoniq:["jq"],jsp:["jsp"],jsx:["jsx"],julia:["jl"],latex:["tex","latex","ltx","bib"],less:["less"],liquid:["liquid"],lisp:["lisp"],livescript:["ls"],logiql:["logic","lql"],lsl:["lsl"],lua:["lua"],luapage:["lp"],lucene:["lucene"],makefile:["makefile","gnumakefile","makefile","ocamlmakefile","make"],matlab:["matlab"],markdown:["md","markdown"],mel:["mel"],mysql:["mysql"],mushcode:["mc","mush"],nix:["nix"],objectivec:["m","mm"],ocaml:["ml","mli"],pascal:["pas","p"],perl:["pl","pm"],pgsql:["pgsql"],php:["php","phtml"],powershell:["ps1"],prolog:["plg","prolog"],properties:["properties"],protobuf:["proto"],python:["py"],r:["r"],rdoc:["rd"],rhtml:["rhtml"],ruby:["rb","ru","gemspec","rake","guardfile","rakefile","gemfile"],rust:["rs"],sass:["sass"],scad:["scad"],scala:["scala"],scheme:["scm","rkt"],scss:["scss"],sh:["sh","bash",".bashrc"],sjs:["sjs"],space:["space"],snippets:["snippets"],soy_template:["soy"],sql:["sql"],stylus:["styl","stylus"],svg:["svg"],tcl:["tcl"],tex:["tex"],text:["txt","ini","log"],textile:["textile"],toml:["toml"],twig:["twig"],typescript:["ts","typescript","str"],vbscript:["vbs"],velocity:["vm"],verilog:["v","vh","sv","svh"],xml:["xml","rdf","rss","wsdl","xslt","atom","mathml","mml","xul","xbl"],xquery:["xq"],yaml:["yaml","yml"]};return e(),{get:t,modes:a}}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t=e.responseText,a='
    '+t+"
    ",i=$.dialog.list.ajaxErrorDialog;return""==t.substr(0,17)?(FrameCall.goRefresh(),void 0):(i?i.content(a):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:a}),void 0)},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("./index.php?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),o=function(){var o=template.compile(s.html);0==$(".dialog_do_search").length?(l(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:o(i)}),r(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),n(),$.dialog.list.dialog_do_search.display(!0))},n=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},r(i)},l=function(){$("#search_value,#search_ext,#search_path").keyEnter(n),$(".search_header a.button").die("click").live("click",n),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},r=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?1>=e.search.length?(a.hide().html("too short!").fadeIn(t),void 0):($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};o()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"./index.php?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var o='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(o).insertBefore($(e).find(".item:eq(0)")):$(e).append(o),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "} }); \ No newline at end of file diff --git a/static/js/app/src/editor/main.js b/static/js/app/src/editor/main.js index 515a32e..14704c3 100644 --- a/static/js/app/src/editor/main.js +++ b/static/js/app/src/editor/main.js @@ -1,3 +1,3 @@ -define("app/src/editor/main",["lib/jquery-lib","lib/util","lib/ztree/js/ztree","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","../../common/taskTap","../../common/core","../../tpl/search","../../tpl/upload","../../common/rightMenu","./ui","../../common/tree","../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer"],function(e){Config={TreeId:"folderList",AnimateTime:200,pageApp:"editor",treeAjaxURL:"index.php?explorer/treeList&app=editor"},Global={topbar_height:40,frameLeftWidth:200,treeSpaceWide:15,isIE:!-[1]},e("lib/jquery-lib"),e("lib/util"),e("lib/ztree/js/ztree"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),TaskTap=e("../../common/taskTap"),core=e("../../common/core"),rightMenu=e("../../common/rightMenu"),ui=e("./ui"),tree=e("../../common/tree"),ui.tree=tree,$(document).ready(function(){ui.init(),TaskTap.init(),core.update(),rightMenu.initEditor(),$(".init_loading").fadeOut(600)})}),define("app/common/taskTap",[],function(){var e={},t="",a=160,i=function(){$(".task_tab .tab").die("mouseenter").live("mouseenter",function(){$(this).hasClass("this")||$(this).addClass("hover")}).die("click").live("click",function(){var e=$(this).attr("id"),t=art.dialog.list[e],a=$("."+e);"hidden"!=a.css("visibility")?t.display(!1):t.display(!0)}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("hover")}).die("dblclick").live("dblclick",function(){})},s=function(){var e,t,i,s,o=!1,n=!1,r=0,l=0,c=0,d=0,p=0,u=0;$(".task_tab .tab").die("mousedown").live("mousedown",function(){e=$(this),o=!0,this.setCapture&&this.setCapture(),$(document).mousemove(function(e){h(e)}),$(document).one("mouseup",function(e){return v(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1})});var f=function(a){n=!0,r=a.pageX,$tab_parent=$(".task_tab"),t=$(".task_tab .tab"),$(".tasktab-dragging").remove(),i=e.clone().addClass("tasktab-dragging").prependTo("body"),d=parseInt(t.css("margin-right")),p=$tab_parent.width(),u=$tab_parent.get(0).getBoundingClientRect().left,u+=$(window).scrollLeft(),l=e.get(0).getBoundingClientRect().left,c=parseInt(t.css("width"));var s=e.get(0).getBoundingClientRect().top-parseInt(e.css("margin-top")),o=a.clientX-r+l;$("body").prepend("
    "),i.css({width:c+"px",top:s,left:o}),e.css("opacity",0)},h=function(a){if(o){0==n&&f(a);var s=a.clientX-r+l;u>s||s>u+p-c||(i.css("left",s),t.each(function(){var t=$(this).get(0).getBoundingClientRect().left;if(s>t&&t+c/2+d>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"left")}if(s>t-c/2+d&&t>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"right")}}))}},m=function(i,o){if(!e.is(":animated")||s!=i){s=i,e.stop(!0,!0),$(".insertTemp").remove(),t=$(".task_tab .tab");var n=e.width(),r=$(".task_tab #"+i),l=e.clone(!0).insertAfter(e).css({"margin-right":"0px",border:"none"}).addClass("insertTemp");"left"==o?e.after(r).css("width","0px"):(e.before(r).css("width","0px"),r.before(l)),e.animate({width:n+"px"},a),l.animate({width:"0px"},a,function(){$(this).remove(),t=$(".task_tab .tab")})}},v=function(){o=!1,n=!1,startTime=0,$(".dragMaskView").remove(),void 0!=i&&(l=e.get(0).getBoundingClientRect().left,i.animate({left:l+"px"},a,function(){e.css("opacity",1),$(this).remove()}))}},o=function(e){var t=110,i=t,s=t+12,o=$(".task_tab .tab"),n=$(".task_tab .tabs").width()-50,r=o.length,l=Math.floor(n/s);switch(r>l&&(i=Math.floor(n/r)-12),e){case"add":$(".task_tab .tabs .this").css("width","0").animate({width:i+"px"},a);case"close":o.animate({width:i+"px"},a);break;case"resize":o.css("width",i+"px");break;default:}},n=function(t,a){$(".task_tab").removeClass("hidden");var i='
    '+a+"
    ";$(i).insertBefore(".task_tab .last"),o("add"),e[t]={id:t,name:name}},r=function(e){$(".task_tab .this").removeClass("this"),$(".task_tab #"+e).addClass("this"),t=e},l=function(t){delete e[t],$(".task_tab #"+t).animate({width:0},a,function(){$(".task_tab #"+t).remove(),o("close"),0==$(".tabs .tab").length&&$(".task_tab").addClass("hidden")})};return{add:n,focus:r,close:l,init:function(){var e='';$(e).appendTo("body"),$(window).bind("resize",function(){o("resize")}),i(),s()}}}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t='
    '+e.responseText+"
    ",a=$.dialog.list.ajaxErrorDialog;a?a.content(t):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:t})},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),o=function(){var o=template.compile(s.html);0==$(".dialog_do_search").length?(r(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:o(i)}),l(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),n(),$.dialog.list.dialog_do_search.display(!0))},n=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},l(i)},r=function(){$("#search_value,#search_ext,#search_path").keyEnter(n),$(".search_header a.button").die("click").live("click",n),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},l=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};o()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var o='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(o).insertBefore($(e).find(".item:eq(0)")):$(e).append(o),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "}}),define("app/common/rightMenu",[],function(){var e=".menufile",t=".menufolder",a=".menuMore",i=".menuApp",s=".menuTreeFav",o=".menuTreeRoot",n=".menuTreeFolder",r=".menuTreeFile",l=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),p(),h(),m(),_(),y(),x(),N(),v(),j(),C(),L(),$(".set_set"+G.list_type).addClass("selected"),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},c=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),f(),v(),u(),h(),m(),C(),j(),_(),L(),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},d=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),y(),x(),v(),C(),j(),k(),w(),L()},p=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e,t){g(e,t)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep1:"--------",listIcon:{name:LNG.list_type,accesskey:"v",icon:"eye-open",items:{seticon:{name:LNG.list_icon,className:"seticon",icon:"th",accesskey:"i",className:"menu_seticon set_seticon"},setlist:{name:LNG.list_list,className:"setlist",icon:"list",accesskey:"l",className:"menu_seticon set_setlist"}}},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},u=function(){$.contextMenu({selector:".menuDefault",zIndex:9999,items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"}},callback:function(e){switch(e){case"open":ui.path.open();break;default:}}})},f=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e){g(e)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep1:"--------",upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",full:{name:LNG.full_screen,className:"full",icon:"fullscreen",accesskey:"m"},setting_wall:{name:LNG.setting_wall,className:"setting_wall",icon:"picture",accesskey:"w"},setting:{name:LNG.setting,className:"setting",icon:"cogs",accesskey:"s"}}})},h=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:t,className:t,callback:function(e){b(e)},items:{open:{name:LNG.open,className:"open",icon:"folder-open-alt",accesskey:"o"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},m=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:e,className:t,callback:function(e){b(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},open_text:{name:LNG.edit,className:"open_text",icon:"edit",accesskey:"e"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},newfileOther:{name:LNG.open_with,accesskey:"h",items:{open_text:{name:LNG.edit,className:"open_text",icon:"edit"},open_kindedit:{name:LNG.others,className:"open_kindedit",icon:"edit"}}},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},unzip:{name:LNG.unzip,className:"unzip",icon:"folder-open-alt",accesskey:"u"},down:{name:LNG.download,className:"down",icon:"download",accesskey:"x"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},v=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:i,className:t,callback:function(e){"editor"==Config.pageApp?z(e):b(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},app_edit:{name:LNG.app_edit,className:"app_edit",icon:"code",accesskey:"a"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},_=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:a,className:t,callback:function(e){b(e)},items:{copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep1:"--------",playmedia:{name:LNG.add_to_play,className:"playmedia",icon:"music",accesskey:"p"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},g=function(e){switch(e){case"refresh":ui.f5(!0,!0);break;case"back":ui.path.back();case"next":ui.path.next();break;case"seticon":ui.setListType("icon");break;case"setlist":ui.setListType("list");break;case"set_sort_name":ui.setListSort("name",0);break;case"set_sort_ext":ui.setListSort("ext",0);break;case"set_sort_size":ui.setListSort("size",0);break;case"set_sort_mtime":ui.setListSort("mtime",0);break;case"set_sort_up":ui.setListSort(0,"up");break;case"set_sort_down":ui.setListSort(0,"down");break;case"upload":core.upload();break;case"past":ui.path.past();break;case"copy_see":ui.path.clipboard();break;case"newfolder":ui.path.newFolder();break;case"newfile":ui.path.newFile();break;case"newfile_html":ui.path.newFile("html");break;case"newfile_php":ui.path.newFile("php");break;case"newfile_js":ui.path.newFile("js");break;case"newfile_css":ui.path.newFile("css");break;case"newfile_oexe":ui.path.newFile("oexe");break;case"info":ui.path.info();break;case"open":ui.path.open();break;case"open_new":ui.path.open_new();break;case"app_install":ui.path.appList();break;case"app_create":ui.path.appEdit(!0);break;case"full":ui.fullScreen();break;case"setting":core.setting();break;case"setting_wall":core.setting("wall");break;default:}},b=function(e){switch(e){case"open":ui.path.open();break;case"down":ui.path.download();break;case"open_ie":ui.path.openIE();break;case"open_text":ui.path.openEditor();break;case"app_edit":ui.path.appEdit();case"open_kindedit":break;case"playmedia":ui.path.play();break;case"fav":ui.path.fav();break;case"search":ui.path.search();break;case"copy":ui.path.copy();break;case"cute":ui.path.cute();break;case"remove":ui.path.remove();break;case"rname":ui.path.rname();break;case"zip":ui.path.zip();break;case"unzip":ui.path.unZip();break;case"info":ui.path.info();break;default:}},y=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:s,callback:function(e){z(e)},items:{fav_page:{name:LNG.manage_fav,className:"fav_page",icon:"star",accesskey:"r"},refresh_all:{name:LNG.refresh_tree,className:"refresh_all",icon:"refresh",accesskey:"e"},sep1:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},x=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:o,callback:function(e){z(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},sep3:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},N=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:n,callback:function(e){z(e)},items:{refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},k=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:n,callback:function(e){z(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},sep2:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep4:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},sep5:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}}) -},w=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:r,callback:function(e){z(e)},items:{edit:{name:LNG.edit,className:"edit",icon:"edit",accesskey:"e"},open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},openIE:{name:LNG.open_ie,className:"openIE",icon:"globe",accesskey:"b"},download:{name:LNG.download,className:"download",icon:"download",accesskey:"x"},sep1:"--------",rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},L=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".taskBarMenu",items:{quitOthers:{name:LNG.close_others,className:"quitOthers",icon:"remove-circle",accesskey:"o"},quit:{name:LNG.close,className:"quit",icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quitOthers":$.each(art.dialog.list,function(e,t){a!=e&&t.close()});break;case"quit":i.close()}}})},C=function(){$.contextMenu({zIndex:9999,selector:".task_tab",items:{closeAll:{name:LNG.dialog_close_all,icon:"remove-circle",accesskey:"o"},showAll:{name:LNG.dialog_display_all,icon:"th-large",accesskey:"o"},hideAll:{name:LNG.dialog_min_all,icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id");switch(art.dialog.list[a],e){case"showAll":$.each(art.dialog.list,function(e,t){t.display(!0)});break;case"hideAll":$.each(art.dialog.list,function(e,t){t.display(!1)});break;case"closeAll":$.each(art.dialog.list,function(e,t){t.close()});break;default:}}})},j=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".dialog_menu",items:{quit:{name:LNG.close,icon:"remove",accesskey:"o"},hide:{name:LNG.dialog_min,icon:"minus",accesskey:"o"},refresh:{name:LNG.refresh,icon:"refresh",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quit":i.close();break;case"hide":i.display(!1);break;case"refresh":i.refresh();break;default:}}})},z=function(e){switch(e){case"app_edit":ui.tree.appEdit();break;case"edit":ui.tree.openEditor();break;case"open":ui.tree.open();break;case"refresh":ui.tree.refresh();break;case"copy":ui.tree.copy();break;case"cute":ui.tree.cute();break;case"past":ui.tree.past();break;case"rname":ui.tree.rname();break;case"remove":ui.tree.remove();break;case"info":ui.tree.info();break;case"download":ui.tree.download();break;case"openIE":ui.tree.openIE();break;case"search":ui.tree.search();break;case"newfolder":ui.tree.create("folder");break;case"newfile":ui.tree.create("file");break;case"explorer":ui.tree.explorer();break;case"fav_page":core.setting("fav");break;case"fav":ui.tree.fav();break;case"refresh_all":ui.tree.init();break;case"quit":break;default:}};return{initDesktop:c,initExplorer:l,initEditor:d,show:function(e,t,a){e&&(rightMenu.hidden(),$(e).contextMenu({x:t,y:a}))},isDisplay:function(){var e=!1;return $(".context-menu-list").each(function(){"none"!=$(this).css("display")&&(e=!0)}),e},hidden:function(){$(".context-menu-list").filter(":visible").trigger("contextmenu:hide")}}}),define("app/src/editor/ui",[],function(){var e=function(){var e=!1,t=0,a=0,i=0,s=$(".frame-left"),o=$(".frame-resize"),n=$(".frame-right");o.die("mousedown").live("mousedown",function(e){return 1!=e.which?!0:(r(e),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){l(e)}),$(document).one("mouseup",function(e){return c(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1}),void 0)});var r=function(i){e=!0,t=i.pageX,a=$(".frame-left").width(),o.addClass("active"),$(".resizeMask").css("display","block")},l=function(r){if(!e)return!0;var l=r.pageX-t,c=a+l;i>c&&(c=i),c>$(document).width()-200&&(c=$(document).width()-200),s.css("width",c),o.css("left",c-5),n.css("left",c+1)},c=function(){return e?(e=!1,o.removeClass("active"),Global.frameLeftWidth=$(".frame-left").width(),$(".resizeMask").css("display","none"),void 0):!1}},t=function(){$(".tools-left a").click(function(){var e=$(this).attr("class");switch(e){case"home":tree.init();break;case"view":tree.explorer();break;case"folder":tree.create("folder");break;case"file":tree.create("file");break;case"refresh":tree.init();break;default:}})};return{init:function(){e(),t(),tree.init(),$("html").die("click").live("click",function(){rightMenu.hidden(),Global.isIE&&Global.isDragSelect}),Mousetrap.bind(["ctrl+s","command+s"],function(e){e.preventDefault(),e.returnvalue=!1,FrameCall.top("OpenopenEditor","Editor.save","")})},setTheme:function(e){core.setSkin(e,"app_editor.css"),FrameCall.top("OpenopenEditor","Editor.setTheme",'"'+e+'"')},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")}}}),define("app/common/tree",["./pathOperate","../tpl/fileinfo","../tpl/app","./pathOpen","./CMPlayer"],function(e){var t,a=e("./pathOperate"),i=e("./pathOpen"),s=!1;ui.pathOpen=i;var o=function(){$.ajax({url:Config.treeAjaxURL+"&type=init",dataType:"json",error:function(){$("#folderList").html('
    '+LNG.system_error+"
    ")},success:function(e){if(!e.code)return $("#folderList").html('
    '+LNG.system_error+"
    "),void 0;var t=e.data;$.fn.zTree.init($("#folderList"),r,t)}}),$(".ztree .switch").die("mouseenter").live("mouseenter",function(){$(this).addClass("switch_hover")}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("switch_hover")}),"editor"==Config.pageApp&&(Mousetrap.bind("up",function(e){n(e,"up")}).bind("down",function(e){n(e,"down")}).bind("left",function(e){n(e,"left")}).bind("right",function(e){n(e,"right")}),Mousetrap.bind("enter",function(){tree.open()}).bind(["del","command+backspace"],function(){tree.remove()}).bind("f2",function(e){stopPP(e),tree.rname()}).bind(["ctrl+f","command+f"],function(e){stopPP(e),tree.search()}).bind(["ctrl+c","command+c"],function(){tree.copy()}).bind(["ctrl+x","command+x"],function(){tree.cute()}).bind(["ctrl+v","command+v"],function(){tree.past()}).bind("alt+m",function(){tree.create("folder")}).bind("alt+n",function(){tree.create("file")}))},n=function(e,t){stopPP(e);var a=$.fn.zTree.getZTreeObj("folderList"),i=a.getSelectedNodes()[0];if(void 0!=i)switch(t){case"up":var s=i.getPreNode();if(s){if(s.open&&s.children.length>0)for(;s.open&&s.children&&s.children.length>=1;)s=s.children[s.children.length-1]}else s=i.getParentNode();a.selectNode(s);break;case"down":if(i.open&&i.children.length>=1)s=i.children[0];else{var o=i,s=o.getNextNode()||o.getParentNode().getNextNode();try{for(;!s;)o=o.getParentNode(),s=o.getNextNode()||o.getParentNode().getNextNode()}catch(e){}}a.selectNode(s);break;case"left":i.isParent?i.open?a.expandNode(i,!1):a.selectNode(i.getParentNode()):a.selectNode(i.getParentNode());break;case"right":i.open?a.selectNode(i.children[0]):a.expandNode(i,!0);break;default:}},r={async:{enable:!0,url:Config.treeAjaxURL,autoParam:["ajax_name=name","ajax_path=path","this_path"],dataFilter:function(e,t,a){return a.code?a.data:null}},edit:{enable:!0,showRemoveBtn:!1,showRenameBtn:!1,drag:{isCopy:!1,isMove:!1}},view:{showLine:!1,selectedMulti:!1,dblClickExpand:!1,addDiyDom:function(e,t){var a=Global.treeSpaceWide,i=$("#"+t.tId+"_switch"),s=$("#"+t.tId+"_ico");if(i.remove(),s.before(i),"file"==t.type&&s.removeClass("button ico_docu").addClass("file "+t.ext),"oexe"==t.ext&&s.removeClass("button ico_docu").addClass("file oexe").removeAttr("style"),t.level>=1){var o="";i.before(o)}var n="";"explorer"==Config.pageApp?("__fav__"==t.ext&&(n="menuTreeFav"),"__root__"==t.ext&&(n="menuTreeRoot"),"folder"==t.type&&(n="menuTreeFolder")):"editor"==Config.pageApp&&("__fav__"==t.ext&&(n="menuTreeFav"),"__root__"==t.ext&&(n="menuTreeRoot"),"file"==t.type&&(n="menuTreeFile"),"folder"==t.type&&(n="menuTreeFolder"),"oexe"==t.ext&&(n="menuApp"));var r=LNG.name+":"+t.name+"\n"+LNG.size+":"+t.size_friendly+"\n"+LNG.modify_time+":"+t.mtime;"file"!=t.type&&(r=t.name),i.parent().addClass(n).attr("title",r)}},callback:{onClick:function(e,t,a){var i=$.fn.zTree.getZTreeObj("folderList");return i.selectNode(a),i.expandNode(a),"folder"!=a.type||"editor"!=Config.pageApp?0==a.level?("explorer"==Config.pageApp&&"__fav__"!=a.ext&&ui.path.list(a.this_path+"/"),!1):("editor"==Config.pageApp?ui.tree.openEditor():"explorer"==Config.pageApp&&ui.tree.open(),void 0):void 0},beforeRightClick:function(e,t){var a=$.fn.zTree.getZTreeObj("folderList");a.selectNode(t)},beforeAsync:function(e,t){t.ajax_name=urlEncode(t.name),t.ajax_path=urlEncode(t.path)},onAsyncSuccess:function(){"function"==typeof t&&(t(),t=void 0)},onRename:function(e,i,s){var o=$.fn.zTree.getZTreeObj("folderList"),n=s.getParentNode();if(o.getNodesByParam("name",s.name,n).length>1)return core.tips.tips(LNG.name_isexists,!1),o.removeNode(s),void 0;if(s.create){var r=s.path+"/"+s.name;"folder"==s.type?a.newFolder(r,function(e){e.code&&(c(n),t=function(){var e=o.getNodesByParam("name",s.name,n)[0];o.selectNode(e),d()})}):a.newFile(r,function(e){e.code&&(c(n),t=function(){var e=o.getNodesByParam("name",s.name,n)[0];o.selectNode(e),d()})})}else{var l=s.path+s.beforeName,p=s.path+s.name;a.rname(l,p,function(e){e.code&&(c(n),t=function(){var e=o.getNodesByParam("name",s.name,n)[0];o.selectNode(e),d()})})}}}},l=function(e){var t=$.fn.zTree.getZTreeObj("folderList");if(t){var a=t.getSelectedNodes()[0],i="",s="";return a?(a.father?i=a.father+a.name:a.this_path?i=a.this_path:""!=a.path?i=a.path+a.name:""==a.path&&(i="/"+a.name),s=a.ext,("_null_"==s||void 0==s)&&(s="folder"),"file"==s&&(s=a.ext),e?[{path:i,type:s,node:a}]:{path:i,type:s,node:a}):{path:"",type:""}}},c=function(e){var t=$.fn.zTree.getZTreeObj("folderList");void 0==e&&(e=t.getSelectedNodes()[0]),e.isParent||(e=e.getParentNode()),t.reAsyncChildNodes(e,"refresh")},d=function(){"explorer"==Config.pageApp&&ui.f5()};return{pathOpen:i,init:o,refresh:c,openEditor:function(){i.openEditor(l().path)},openIE:function(){i.openIE(l().path)},download:function(){i.download(l().path)},open:function(){if(!($(".dialog_path_remove").length>=1)){var e=l();"oexe"==e.type&&(e.path=e.node),i.open(e.path,e.type)}},fav:function(){a.fav(l().path)},search:function(){core.search("",l().path)},appEdit:function(){var e=l(),t=e.node;t.path=e.path,a.appEdit(t,function(){c(e.node.getParentNode())})},info:function(){a.info(l(!0))},copy:function(){a.copy(l(!0))},cute:function(){a.cute(l(!0))},past:function(){var e=l();e.node.isParent||(e.node=e.node.getParentNode()),a.past(e.path,function(){d(),c(e.node)})},remove:function(){var e=l(!0),t=e[0].node.getParentNode();t?a.remove(e,function(){d(),c(t)}):$.dialog({fixed:!0,resize:!1,icon:"warning",drag:!0,title:LNG.tips,content:LNG.remove_not,ok:!0})},checkIfChange:function(e){if(!s){s=!0;var t=$.fn.zTree.getZTreeObj("folderList");t&&(t.getNodesByFilter(function(t){var a;return t.this_path?a=t.this_path:""!=t.path&&(a=t.path+t.name),a==e||a+"/"==e?(c(t),!0):!1},!0),setTimeout(function(){s=!1},1e3))}},explorer:function(){var e=l().path;e||(e=G.this_path),core.explorer(e)},fileBox:function(e){e="save_file",e="save_folder",e="select_",$(".header-left").css("width",110).next().css("left",150),$(".frame-left").width("width",142),$.dialog.open("?/explorer&plague="+e,{resize:!0,fixed:!0,title:"另存为",width:750,height:420})},create:function(e){var a=$.fn.zTree.getZTreeObj("folderList"),i=a.getSelectedNodes();if(0>=i.length){var s=a.getNodeByParam("ext","__root__",null);a.selectNode(s)}var o=l(),n=o.node,r=n.getParentNode(),d="newfile",p=0,u=LNG.newfolder;if("folder"==e){for(;a.getNodesByParam("name",u+"("+p+")",r).length>0;)p++;newNode={name:u+"("+p+")",ext:"",type:"folder",create:!0,path:o.path}}else if("file"==e){for(;a.getNodesByParam("name",d+"("+p+").txt",r).length>0;)p++;newNode={name:d+"("+p+").txt",ext:"txt",type:"file",create:!0,path:o.path}}void 0!=n.children?(treeNodeNew=a.addNodes(n,newNode),a.editName(treeNodeNew[0])):("folder"!=n.type&&(n=n.getParentNode()),t=function(){treeNodeNew=a.addNodes(n,newNode),a.editName(treeNodeNew[0])},c(n))},rname:function(){var e=$.fn.zTree.getZTreeObj("folderList"),t=e.getSelectedNodes()[0];e.editName(t),t.beforeName=t.name}}}),define("app/common/pathOperate",["../tpl/fileinfo","../tpl/app"],function(e){var t=e("../tpl/fileinfo"),a=["/","\\",":","*","?",'"',"<",">","|"],i=function(e){var t=function(e,t){for(var a=t.length,i=0;a>i;i++)if(e.indexOf(t[i])>0)return!0;return!1};return t(e,a)?(core.tips.tips(LNG.path_not_allow+':/ : * ? " < > |',!1),!1):!0},s=function(e){var t="list=[";for(var a in e)t+='{"type":"'+e[a].type+'","path":"'+urlEncode2(e[a].path)+'"}',a!=e.length-1&&(t+=",");return t+"]"},o=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkfile&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},n=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkdir&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},r=function(e,t,a){e&&t&&e!=t&&i(core.pathThis(t))&&$.ajax({type:"POST",dataType:"json",url:"index.php?explorer/pathRname",data:"path="+urlEncode(e)+"&rname_to="+urlEncode(t),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof a&&a(e)}})},l=function(e,t){if(!(1>e.length)){var a=e[0].path;a.length>20&&(a=a.substr(-20)+"..."),$.dialog({id:"dialog_path_remove",fixed:!0,icon:"question",title:LNG.remove_title,padding:40,lock:!0,background:"#000",opacity:.5,content:a+"
    "+LNG.remove_info+"【"+e.length+"】",ok:function(){$.ajax({url:"index.php?explorer/pathDelete",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})},cancel:!0})}},c=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCopy",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},d=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCute",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},p=function(e,t){if(e){var a="index.php?explorer/pathPast&path="+urlEncode2(e);$.ajax({url:a,dataType:"json",beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){e.code?core.tips.close(e.info):core.tips.close(e),"function"==typeof t&&t(e)}})}},u=function(e){if(1>e.length&&(e=[{path:G.this_path,type:"folder"}]),e.length>1)return f(e),void 0;e=e[0];var a="folder"==e.type?"path_info":"file_info";$.ajax({url:"index.php?explorer/pathInfo&type="+e.type+"&path="+urlEncode2(e.path),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(i){if(!i.code)return core.tips.close(i),void 0;core.tips.close(LNG.get_success,!0);var s=template.compile(t[a]);i.data.LNG=LNG,$.dialog({padding:5,fixed:!0,title:core.pathThis(e.path).substr(0,20)+"... "+LNG.info,content:s(i.data),width:"350px",cancel:!0})}})},f=function(e){$.ajax({url:"index.php?explorer/pathInfoMuti",type:"POST",data:s(e),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(e){if(!e.code)return core.tips.close(e),void 0;core.tips.close(LNG.get_success,!0);var a=template.compile(t.path_info_more);e.data.LNG=LNG,$.dialog({padding:5,fixed:!0,width:"350px",title:LNG.info,content:a(e.data),cancel:!0})}})},h=function(e,t){1>e.length||$.ajax({url:"index.php?explorer/zip",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading(LNG.ziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,core.tips.tips(e),"function"==typeof t&&t(e)}})},m=function(e,t){if(e){var a="index.php?explorer/unzip&path="+urlEncode2(e);$.ajax({url:a,beforeSend:function(){core.tips.loading(LNG.unziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,"function"==typeof t&&t(e)}})}},v=function(e,t,a){t&&$.ajax({url:"index.php?explorer/pathCuteDrag",type:"POST",dataType:"json",data:s(e)+"&path="+urlEncode2(t),beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code&&"function"==typeof a&&a(e)}})},_=function(){$.ajax({url:"index.php?explorer/clipboard",dataType:"json",error:core.ajaxError,success:function(e){e.code&&$.dialog({title:LNG.clipboard,padding:0,height:200,width:400,content:e.data})}})},g=function(e){if(e){var t="&name="+urlEncode(core.pathThis(e))+"&path="+urlEncode(e);core.setting("fav"+t)}},b=function(e){var t={};return t.type=e.find("input[type=radio]:checked").val(),t.content=e.find("textarea").val(),t.group=e.find("[name=group]").val(),e.find("input[type=text]").each(function(){var e=$(this).attr("name");t[e]=$(this).val()}),e.find("input[type=checkbox]").each(function(){var e=$(this).attr("name");t[e]="checked"==$(this).attr("checked")?1:0}),t},y=function(e){e.find(".type input").change(function(){var t=$(this).attr("apptype");e.find("[data-type]").addClass("hidden"),e.find("[data-type="+t+"]").removeClass("hidden")})},x=function(t,a,i){var s,o,n,r=LNG.app_create,l=UUID(),c=e("../tpl/app"),d=G.basic_path+"static/images/app/",p=template.compile(c.html);switch(void 0==i&&(i="user_edit"),"root_edit"==i&&(t=json_decode(t)),"user_edit"==i||"root_edit"==i?(r=LNG.app_edit,n=p({LNG:LNG,iconPath:d,uuid:l,data:t})):n=p({LNG:LNG,iconPath:d,uuid:l,data:{}}),$.dialog({fixed:!0,width:450,height:310,id:l,padding:15,title:r,content:n,button:[{name:LNG.preview,callback:function(){var e=b(s);return core.openApp(e),!1}},{name:LNG.button_save,focus:!0,callback:function(){var e=b(s);switch(i){case"user_add":var n=urlEncode2(G.this_path+e.name);o="./index.php?app/user_app&action=add&path="+n;break;case"user_edit":o="./index.php?app/user_app&path="+urlEncode2(t.path);break;case"root_add":o="./index.php?app/add&name="+e.name;break;case"root_edit":o="./index.php?app/edit&name="+e.name+"&old_name="+t.name;break;default:}$.ajax({url:o,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(e)),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){if(core.tips.close(e),e.code)if("root_edit"==i||"root_add"==i){if(!e.code)return;FrameCall.top("Openapp_store","App.reload",'""')}else"function"==typeof a?a():ui.f5()}})}}]}),s=$("."+l),t.group&&s.find("option").eq(t.group).attr("selected",1),s.find(".aui_content").css("overflow","inherit"),i){case"user_edit":s.find(".name").addClass("hidden"),s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("option[value="+t.group+"]").attr("checked",!0);break;case"user_add":s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_add":s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_edit":s.find("option[value="+t.group+"]").attr("selected",!0);break;default:}y(s)},N=function(){core.appStore()},k=function(e){e&&4>e.length&&"http"!=e.substring(0,4)||$.ajax({url:"./index.php?app/get_url_title&url="+e,dataType:"json",beforeSend:function(){core.tips.loading()},success:function(t){var a=t.data;core.tips.close(t);var i={content:e,desc:"",group:"others",type:"url",icon:"internet.png",name:a,resize:1,simple:0,height:"70%",width:"80%"},s=urlEncode2(G.this_path+a);e="./index.php?app/user_app&action=add&path="+s,$.ajax({url:e,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(i)),success:function(e){core.tips.close(e),e.code&&ui.f5()}})}})};return{appEdit:x,appList:N,appAddURL:k,newFile:o,newFolder:n,rname:r,unZip:m,zip:h,copy:c,cute:d,info:u,remove:l,cuteDrag:v,past:p,clipboard:_,fav:g}});var file_info="
    {{LNG.file_type}}:
    {{ext}} {{LNG.file}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info="
    {{LNG.type}}:
    {{LNG.folder}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.contain}}:
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.folder}}
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info_more="
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.file}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.parent_permission}}:
    {{mode}}
    ";define("app/tpl/fileinfo",[],function(){return{file_info:file_info,path_info:path_info,path_info_more:path_info_more}}),define("app/tpl/app",[],function(){return{html:"
    {{LNG.name}}
    {{LNG.app_desc}}
    {{LNG.app_icon}}
    {{LNG.app_icon_show}}
    {{LNG.app_group}}
    {{LNG.app_type}}
    {{LNG.app_display}}
    {{LNG.app_size}}
    {{LNG.width}}:   {{LNG.height}}:  
    {{LNG.app_url}}
    "}}),define("app/common/pathOpen",["./CMPlayer"],function(e){var t=function(e,t){if(void 0!=e){if(void 0==t&&(t=core.pathExt(e)),t=t.toLowerCase(),"folder"==t)return"explorer"==Config.pageApp?ui.path.list(e+"/"):core.explorer(e),void 0;if("swf"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if("oexe"==t)return core.openApp(e),void 0;if("pdf"==t){var l="pdf"+UUID(),i=core.path2url(e),c='";return $.dialog({resize:!0,fixed:!0,title:core.pathThis(e),width:800,height:400,padding:0,content:c}),new PDFObject({url:i}).embed(l),void 0}if("html"==t||"htm"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if(inArray(core.filetype.image,t)){var i=urlDecode(e);return-1==e.indexOf("http:")&&(i=core.path2url(i)),MaskView.image(i),void 0}if(inArray(core.filetype.music,t)||inArray(core.filetype.movie,t)){var i=core.path2url(e);return r(i,t),void 0}if(inArray(core.filetype.doc,t)){var i=core.path2url(e);return n(i,t),void 0}return inArray(core.filetype.bindary,t)?(a(e),void 0):(o(e),void 0)}},a=function(e){if(e){var t="index.php?explorer/fileDownload&path="+urlEncode2(e),a=''+LNG.download_ready+"...",i=$.dialog({icon:"succeed",title:!1,time:1,content:a});i.DOM.wrap.find(".aui_loading").remove()}},i=function(e){if(void 0!=e){var t=core.path2url(e);window.open(t)}},s=function(e,t,a){if(e){void 0==a&&(a="openWindow"+UUID());var i="";art.dialog.through({id:a,title:t,width:"70%",height:"65%",padding:0,content:i,resize:!0})}},o=function(e){if(e){var t=core.pathExt(e),a=core.pathThis(e);if(inArray(core.filetype.bindary,t)||inArray(core.filetype.music,t)||inArray(core.filetype.image,t)||inArray(core.filetype.movie,t)||inArray(core.filetype.doc,t))return core.tips.tips(t+LNG.edit_can_not,!1),void 0;if(void 0==window.top.frames.OpenopenEditor){var i="?editor/edit&filename="+urlEncode(urlEncode2(e)),o=a+" ——"+LNG.edit;s(i,o.substring(o.length-50),"openEditor")}else $.dialog.list.openEditor&&$.dialog.list.openEditor.display(!0),FrameCall.top("OpenopenEditor","Editor.add",'"'+urlEncode2(e)+'"')}},n=function(e,t){var a,i,s;switch(t){case"doc":case"docx":case"docm":case"dot":a="http://sg1b-word-view.officeapps.live.com/wv/wordviewerframe.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;case"ppt":case"pptm":case"pptx":a="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":a="http://sg1b-excel.officeapps.live.com/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;default:}i="http://sg1b-15-view-wopi.wopi.live.net:808/oh/wopi/files/@/wFileId?wFileId=",i+=urlEncode(e),s=a+urlEncode(i)+"&access_token=1&access_token_ttl=0";var o=core.pathThis(urlDecode(e));art.dialog.open(s,{title:o,width:"70%",height:"65%",resize:!0})},r=function(t,a){t&&("string"==typeof t&&(t=[t]),CMPlayer=e("./CMPlayer"),CMPlayer.play(t,a))};return{open:t,play:r,openEditor:o,openIE:i,download:a}}),define("app/common/CMPlayer",[],function(){var e={ting:{path:"music/ting",width:410,height:530},beveled:{path:"music/beveled",width:350,height:200},kuwo:{path:"music/kuwo",width:480,height:200},manila:{path:"music/manila",width:320,height:400},mp3player:{path:"music/mp3player",width:320,height:410},qqmusic:{path:"music/qqmusic",width:300,height:400},somusic:{path:"music/somusic",width:420,height:137},xdj:{path:"music/xdj",width:595,height:235},webplayer:{path:"movie/webplayer",width:600,height:400},qqplayer:{path:"movie/qqplayer",width:600,height:400},tvlive:{path:"movie/tvlive",width:600,height:400},youtube:{path:"movie/youtube",width:600,height:400},vplayer:{path:"movie/vplayer",width:600,height:400}},t=function(e){return"music"==e?"music_player":(void 0==e&&(e="mp3"),inArray(core.filetype.music,e)?"music_player":"movie_player") -},a=function(t){var a,i,o;"music_player"==t?(a=e[G.musictheme],i="music player",o=!1):(a=e[G.movietheme],i="movie player",o=!0);var n=core.createFlash(G.static_path+"js/lib/cmp4/cmp.swf","context_menu=2&auto_play=1&play_mode=1&skin=skins/"+a.path+".zip",t),r={id:t+"_dialog",simple:!0,title:i,width:a.width,height:a.height,content:n,resize:o,padding:0,fixed:!0,close:function(){var e=s(t);e&&e.sendEvent&&e.sendEvent("view_stop")}};window.top.CMP?art.dialog.through(r):$.dialog(r)},i=function(e){var t,a="";for(t=e.length-1;t>=0;t--){var i,s;-1==e[t].search("fileProxy")?(i=urlEncode(e[t]),s=core.pathThis(e[t])):(i=e[t],s=core.pathThis(urlDecode(i))),i=i.replace(/%2F/g,"/"),i=i.replace(/%3F/g,"?"),i=i.replace(/%26/g,"&"),i=i.replace(/%3A/g,":"),i=i.replace(/%3D/g,"="),a+=''}return a},s=function(e){return window.top.CMP?window.top.CMP.get(e):CMP.get(e)},o=function(e,t){var a=i(e),o=s(t);if(o){o.config("play_mode","normal");var n=o.list().length;o.list_xml(a,!0),o.sendEvent("view_play",n+1)}};return{changeTheme:function(t,a){var i,o,n;"music"==t?(G.musictheme=a,i="music_player"):"movie"==t&&(G.movietheme=a,i="movie_player"),n=s(i),n&&(o=e[a],window.top.art.dialog.list[i+"_dialog"].size(o.width,o.height),n.sendEvent("skin_load","skins/"+o.path+".zip"))},play:function(e,i){var n=t(i),r=s(n);r?(o(e,n),window.top.art.dialog.list[n+"_dialog"].display(!0)):(a(n),setTimeout(function(){o(e,n)},1e3))}}}); \ No newline at end of file +define("app/src/editor/main",["lib/jquery-lib","lib/util","lib/ztree/js/ztree","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","../../common/taskTap","../../common/core","../../tpl/search","../../tpl/upload","../../common/rightMenu","./ui","../../common/tree","../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer"],function(e){Config={TreeId:"folderList",AnimateTime:200,pageApp:"editor",treeAjaxURL:"index.php?explorer/treeList&app=editor"},Global={topbar_height:40,frameLeftWidth:200,treeSpaceWide:15,isIE:!-[1]},e("lib/jquery-lib"),e("lib/util"),e("lib/ztree/js/ztree"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),TaskTap=e("../../common/taskTap"),core=e("../../common/core"),rightMenu=e("../../common/rightMenu"),ui=e("./ui"),tree=e("../../common/tree"),ui.tree=tree,$(document).ready(function(){ui.init(),TaskTap.init(),core.update(),rightMenu.initEditor(),$(".init_loading").fadeOut(600)})}),define("app/common/taskTap",[],function(){var e={},t="",a=160,i=function(){$(".task_tab .tab").die("mouseenter").live("mouseenter",function(){$(this).hasClass("this")||$(this).addClass("hover")}).die("click").live("click",function(){var e=$(this).attr("id"),t=art.dialog.list[e],a=$("."+e);"hidden"!=a.css("visibility")?t.display(!1):t.display(!0)}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("hover")}).die("dblclick").live("dblclick",function(){})},s=function(){var e,t,i,s,o=!1,n=!1,r=0,l=0,c=0,d=0,p=0,u=0;$(".task_tab .tab").die("mousedown").live("mousedown",function(){e=$(this),o=!0,this.setCapture&&this.setCapture(),$(document).mousemove(function(e){h(e)}),$(document).one("mouseup",function(e){return v(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1})});var f=function(a){n=!0,r=a.pageX,$tab_parent=$(".task_tab"),t=$(".task_tab .tab"),$(".tasktab-dragging").remove(),i=e.clone().addClass("tasktab-dragging").prependTo("body"),d=parseInt(t.css("margin-right")),p=$tab_parent.width(),u=$tab_parent.get(0).getBoundingClientRect().left,u+=$(window).scrollLeft(),l=e.get(0).getBoundingClientRect().left,c=parseInt(t.css("width"));var s=e.get(0).getBoundingClientRect().top-parseInt(e.css("margin-top")),o=a.clientX-r+l;$("body").prepend("
    "),i.css({width:c+"px",top:s,left:o}),e.css("opacity",0)},h=function(a){if(o){0==n&&f(a);var s=a.clientX-r+l;u>s||s>u+p-c||(i.css("left",s),t.each(function(){var t=$(this).get(0).getBoundingClientRect().left;if(s>t&&t+c/2+d>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"left")}if(s>t-c/2+d&&t>s){if(e.attr("id")==$(this).attr("id"))return;m($(this).attr("id"),"right")}}))}},m=function(i,o){if(!e.is(":animated")||s!=i){s=i,e.stop(!0,!0),$(".insertTemp").remove(),t=$(".task_tab .tab");var n=e.width(),r=$(".task_tab #"+i),l=e.clone(!0).insertAfter(e).css({"margin-right":"0px",border:"none"}).addClass("insertTemp");"left"==o?e.after(r).css("width","0px"):(e.before(r).css("width","0px"),r.before(l)),e.animate({width:n+"px"},a),l.animate({width:"0px"},a,function(){$(this).remove(),t=$(".task_tab .tab")})}},v=function(){o=!1,n=!1,startTime=0,$(".dragMaskView").remove(),void 0!=i&&(l=e.get(0).getBoundingClientRect().left,i.animate({left:l+"px"},a,function(){e.css("opacity",1),$(this).remove()}))}},o=function(e){var t=110,i=t,s=t+12,o=$(".task_tab .tab"),n=$(".task_tab .tabs").width()-50,r=o.length,l=Math.floor(n/s);switch(r>l&&(i=Math.floor(n/r)-12),e){case"add":$(".task_tab .tabs .this").css("width","0").animate({width:i+"px"},a);case"close":o.animate({width:i+"px"},a);break;case"resize":o.css("width",i+"px");break;default:}},n=function(t,a){$(".task_tab").removeClass("hidden");var i='
    '+a+"
    ";$(i).insertBefore(".task_tab .last"),o("add"),e[t]={id:t,name:name}},r=function(e){$(".task_tab .this").removeClass("this"),$(".task_tab #"+e).addClass("this"),t=e},l=function(t){delete e[t],$(".task_tab #"+t).animate({width:0},a,function(){$(".task_tab #"+t).remove(),o("close"),0==$(".tabs .tab").length&&$(".task_tab").addClass("hidden")})};return{add:n,focus:r,close:l,init:function(){var e='';$(e).appendTo("body"),$(window).bind("resize",function(){o("resize")}),i(),s()}}}),define("app/common/core",["../tpl/search","../tpl/upload"],function(require,exports){return{filetype:{music:["mp3","wma","wav","mid","aac","ogg","oga","midi","ram","ac3","aif","aiff","m3a","m4a","m4b","mka","mp1","mx3","mp2"],movie:["avi","flv","f4v","wmv","3gp","rmvb","mp4","rm","rmvb","flv","mkv","wmv","asf","avi","aiff","mp4","divx","dv","m4v","mov","mpeg","vob","mpg","mpv","ogm","ogv","qt"],image:["jpg","jpeg","png","bmp","gif","ico","tif","tiff","dib","rle"],code:["html","htm","js","css","less","scss","sass","py","php","rb","erl","lua","pl","c","cpp","m","h","java","jsp","cs","asp","sql","as","go","lsp","yml","json","tpl","xml","cmd","reg","bat","vbs","sh"],doc:["doc","docx","docm","xls","xlsx","xlsb","xlsm","ppt","pptx","pptm"],text:["txt","ini","inc","inf","conf","oexe","md","htaccess","csv","log","asc","tsv"],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"]},contextmenu:function(e){rightMenu.hidden();var t=e||window.event;return t&&($.nodeName(t.target,"TEXTAREA")||$.nodeName(t.target,"INPUT"))?!0:void 0},pathThis:function(e){e=e.replace(/\\/g,"/");var t=e.split("/"),a=t[t.length-1];return""==a&&(a=t[t.length-2]),a},pathFather:function(e){e=e.replace(/\\/g,"/");var t=e.lastIndexOf("/");return e.substr(0,t+1)},pathExt:function(e){e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/");var t=e.lastIndexOf(".");return e=e.substr(t+1),e.toLowerCase()},path2url:function(e){if("http"==e.substr(0,4))return e;if(e=e.replace(/\\/g,"/"),e=e.replace(/\/+/g,"/"),e=e.replace(/\/\.*\//g,"/"),e.substring(0,G.public_path.length)==G.public_path)return G.app_host+"data/public/"+e.replace(G.public_path,"");if(G.is_root){if(e.substring(0,G.web_root.length)==G.web_root)return G.web_host+e.replace(G.web_root,"");var t=G.basic_path.replace(G.web_root,"")+"/";return t=G.web_host+t,t+"index.php?explorer/fileProxy&path="+urlEncode(e)}return G.web_host+G.web_root+e},ajaxError:function(e){core.tips.close(LNG.system_error,!1);var t=e.responseText,a='
    '+t+"
    ",i=$.dialog.list.ajaxErrorDialog;return""==t.substr(0,17)?(FrameCall.goRefresh(),void 0):(i?i.content(a):$.dialog({id:"ajaxErrorDialog",fixed:!0,resize:!0,title:"ajax error",width:450,height:200,content:a}),void 0)},setting:function(e){void 0==e&&(e=""),void 0==window.top.frames.Opensetting_mode?$.dialog.open("./index.php?setting#"+e,{id:"setting_mode",fixed:!0,resize:!0,title:LNG.setting,width:960,height:580}):($.dialog.list.setting_mode.display(!0),FrameCall.top("Opensetting_mode","Setting.setGoto",'"'+e+'"'))},appStore:function(){$.dialog.open("./index.php?app",{id:"app_store",fixed:!0,resize:!0,title:LNG.app_store,width:800,height:500})},openApp:function(app){if("url"==app.type)"number"!=typeof app.width&&-1==app.width.search("%")&&(app.width=parseInt(app.width)),"number"!=typeof app.height&&-1==app.height.search("%")&&(app.height=parseInt(app.height)),$.dialog.open(app.content,{title:app.name,fixed:!0,resize:app.resize,simple:app.simple,title:app.name.replace(".oexe",""),width:app.width,height:app.height});else{var exec=app.content;eval("{"+exec+"}")}},update:function(e){var t=base64_decode("aHR0cDovL3N0YXRpYy5rYWxjYWRkbGUuY29tL3VwZGF0ZS9tYWluLmpz");require.async(t,function(t){try{t.todo(e)}catch(a){}})},explorer:function(e){void 0==e&&(e=""),$.dialog.open("?/explorer&type=iframe&path="+e,{resize:!0,fixed:!0,title:LNG.ui_filemanage,width:880,height:550})},setSkin:function(e,t){var a="./../../../style/skin/"+e+t,i=G.static_path+"style/skin/"+e+t;require.async(a,function(){$("#link_css_list").attr("href",i),$("link[rel=stylesheet]").each(function(){var e=$(this).attr("href");e.substring(e.length-t.length)==t&&"link_css_list"!=$(this).attr("id")&&$(this).remove()})})},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")},language:function(e){Cookie.set("kod_user_language",e,8760),window.location.reload()},tips:{loading:function(e){Tips.loading(e,"info",Global.topbar_height)},close:function(e,t){"object"==typeof e?Tips.close(e.data,e.code,Global.topbar_height):Tips.close(e,t,Global.topbar_height)},tips:function(e,t){"object"==typeof e?Tips.tips(e.data,e.code,Global.topbar_height):Tips.tips(e,t,Global.topbar_height)}},createFlash:function(e,t,a){var i=''+''+''+''+''+''+"";return i},search:function(e,t){var a,i,s=require("../tpl/search"),o=function(){var o=template.compile(s.html);0==$(".dialog_do_search").length?(r(),i={search:e,path:t,is_content:void 0,is_case:void 0,ext:"",LNG:LNG},a=$.dialog({id:"dialog_do_search",padding:0,fixed:!0,resize:!0,title:LNG.search,width:450,content:o(i)}),l(i),$("#search_ext").tooltip({placement:"bottom",html:!0}),$("#search_path").tooltip({placement:"bottom",html:!0,title:function(){return $("#search_path").val()}})):($("#search_value").val(e),$("#search_path").val(t),n(),$.dialog.list.dialog_do_search.display(!0))},n=function(){i={search:$("#search_value").val(),path:$("#search_path").val(),is_content:$("#search_is_content").attr("checked"),is_case:$("#search_is_case").attr("checked"),ext:$("#search_ext").val()},l(i)},r=function(){$("#search_value,#search_ext,#search_path").keyEnter(n),$(".search_header a.button").die("click").live("click",n),$(".search_result .list .name").die("click").live("click",function(){var e=$(this).find("a").html(),t=$(this).parent().find(".path a").html()+e;$(this).parent().hasClass("file")?ui.pathOpen.open(t):"explorer"==Config.pageApp?ui.path.list(t+"/","tips"):core.explorer(t+"/")}),$(".search_result .list .path a").die("click").live("click",function(){var e=$(this).html();"explorer"==Config.pageApp?ui.path.list(e,"tips"):core.explorer(e)})},l=function(e){var t=150;$("#search_value").focus(),$(".search_result .list").remove();var a=$(".search_result .message td");return e.search&&e.path?1>=e.search.length?(a.hide().html("too short!").fadeIn(t),void 0):($.ajax({url:"index.php?explorer/search",dataType:"json",type:"POST",data:e,beforeSend:function(){a.hide().html(LNG.searching+'').fadeIn(t)},error:core.ajaxError,success:function(e){if(!e.code)return a.hide().html(e.data).fadeIn(t),void 0;if(0==e.data.filelist.length&&0==e.data.folderlist.length)return a.hide().html(LNG.search_null).fadeIn(t),void 0;a.hide();var i=template.compile(s.list);e.data.LNG=LNG,$(i(e.data)).insertAfter(".search_result .message").fadeIn(t)}}),void 0):(a.hide().html(LNG.search_info).fadeIn(t),void 0)};o()},upload:function(){G.upload_path=G.this_path;var e=urlDecode(G.upload_path);uploader.option("server","index.php?explorer/fileUpload&path="+G.upload_path);var t=30>=e.length?e:"..."+e.substr(e.length-30);if(0!=$(".dialog_file_upload").length)return $(".file_upload .upload_path b").html(t),$.dialog.list.dialog_file_upload.display(!0),void 0;var a=require("../tpl/upload"),i=template.compile(a.html),s=WebUploader.Base.formatSize(G.upload_max);$.dialog({padding:5,height:430,resize:!0,id:"dialog_file_upload",fixed:!0,title:LNG.upload_muti,content:i({LNG:LNG,maxsize:s}),close:function(){$.each(uploader.getFiles(),function(e,t){uploader.skipFile(t),uploader.removeFile(t)})}}),$(".file_upload .tips").tooltip({placement:"bottom"}),$(".file_upload .upload_path").tooltip({placement:"bottom",title:function(){return G.upload_path}}),$(".file_upload .upload_path b").html(t),$(".file_upload .top_nav a.menu").unbind("click").bind("click",function(){$(this).hasClass("tab_upload")?($(".file_upload .tab_upload").addClass("this"),$(".file_upload .tab_download").removeClass("this"),$(".file_upload .upload_box").removeClass("hidden"),$(".file_upload .download_box").addClass("hidden")):($(".file_upload .tab_upload").removeClass("this"),$(".file_upload .tab_download").addClass("this"),$(".file_upload .upload_box").addClass("hidden"),$(".file_upload .download_box").removeClass("hidden"))}),$(".file_upload .download_box .submit input").unbind("click").bind("click",function(){core.server_dwonload(G.upload_path)}),uploader.addButton({id:"#picker"})},server_dwonload:function(e){var t=[];$(".list input").each(function(){""!=$(this).val()&&t.push($(this).val())}),core.tips.tips(t.length+LNG.server_dwonload_desc);for(var a=0;t.length>a;a++)$.ajax({url:"./index.php?explorer/serverDownload&save_path="+e+"&url="+urlEncode2(t[a]),dataType:"json",error:core.ajaxError,success:function(e){e.code&&FrameCall.father("ui.f5",""),core.tips.tips(e)}})},upload_init:function(){var e="#thelist",t="span.state";uploader=WebUploader.create({swf:G.static_path+"js/lib/webuploader/Uploader.swf",dnd:"body",threads:3,fileSizeLimit:G.upload_max,resize:!1});var a=[];uploader.on("uploadBeforeSend",function(e,t){var a=urlEncode(e.file.fullPath);(void 0==a||"undefined"==a)&&(a=""),t.fullPath=a}).on("fileQueued",function(t){var i,s=$(e),i=t.fullPath;(void 0==i||"undefined"==i)&&(i=t.name),$(e).find(".item").length>0&&(s=$(e).find(".item:eq(0)"));var o='
    '+'
    '+i+''+LNG.upload_ready+'
    ';$(e).find(".item").length>0?$(o).insertBefore($(e).find(".item:eq(0)")):$(e).append(o),a.push(t.name),uploader.upload()}).on("uploadProgress",function(e,a){var i=$("#"+e.id),s=i.find(".progress .progress-bar");s.length||(s=$('
    ').appendTo(i).find(".progress-bar")),i.find(t).text((100*a).toFixed(2)+"%"),s.css("width",100*a+"%")}).on("uploadAccept",function(e,t){e.file.serverData=t}).on("uploadSuccess",function(e){var i=e.serverData;i.code?$("#"+e.id).find(t).text(i.data):$("#"+e.id).find(t).addClass("error").text(i.data),uploader.removeFile(e),$("#"+e.id).find(".progress").fadeOut();var s=a;ui.f5_callback(function(){ui.path.setSelectByFilename(s)})}).on("uploadError",function(e){$("#"+e.id).find(t).addClass("error").text(LNG.upload_error)}).on("uploadFinished",function(){$(e).find(".item").delay(2e3).each(function(e){$(this).delay(300*e).slideUp(600)}),a=[],"explorer"==Config.pageApp&&ui.tree.checkIfChange(G.this_path)}).on("error",function(){});var i;inState=!1,dragOver=function(){0==inState&&(inState=!0,MaskView.tips(LNG.upload_drag_tips)),i&&window.clearTimeout(i)},dragLeave=function(e){stopPP(e),i&&window.clearTimeout(i),i=window.setTimeout(function(){inState=!1,MaskView.close()},100)},dragDrop=function(e){e=e.originalEvent||e;var t=e.dataTransfer.getData("text/plain");t&&"http"==t.substring(0,4)?(ui.path.pathOperate.appAddURL(t),console.log(t)):core.upload(),stopPP(e),inState&&(inState=!1,MaskView.close())}}}}),define("app/tpl/search",[],function(){var e="",t="{{each folderlist as v i}} {{v.name}} {{LNG.folder}} 0 {{v.path}} {{/each}} {{each filelist as v i}} {{v.name}} {{v.ext}} {{v.size_friendly}} {{v.path}} {{/each}}";return{html:e,list:t}}),define("app/tpl/upload",[],function(){return{html:"
    {{LNG.save_path}}:
    {{LNG.upload_select}}
    {{LNG.upload_max_size}}:{{maxsize}}
    "}}),define("app/common/rightMenu",[],function(){var e=".menufile",t=".menufolder",a=".menuMore",i=".menuApp",s=".menuTreeFav",o=".menuTreeRoot",n=".menuTreeFolder",r=".menuTreeFile",l=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),p(),h(),m(),g(),y(),x(),N(),v(),j(),C(),L(),$(".set_set"+G.list_type).addClass("selected"),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},c=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),f(),v(),u(),h(),m(),C(),j(),g(),L(),$(".set_sort_"+G.sort_field).addClass("selected"),$(".set_sort_"+G.sort_order).addClass("selected")},d=function(){$('').appendTo("body"),$(".context-menu-list").die("click").live("click",function(e){return stopPP(e),!1}),y(),x(),v(),C(),j(),k(),w(),L()},p=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e,t){_(e,t)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep1:"--------",listIcon:{name:LNG.list_type,accesskey:"v",icon:"eye-open",items:{seticon:{name:LNG.list_icon,className:"seticon",icon:"th",accesskey:"i",className:"menu_seticon set_seticon"},setlist:{name:LNG.list_list,className:"setlist",icon:"list",accesskey:"l",className:"menu_seticon set_setlist"}}},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},u=function(){$.contextMenu({selector:".menuDefault",zIndex:9999,items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"}},callback:function(e){switch(e){case"open":ui.path.open();break;default:}}})},f=function(){$.contextMenu({selector:Config.BodyContent,zIndex:9999,callback:function(e){_(e)},items:{refresh:{name:LNG.refresh,className:"refresh",icon:"refresh",accesskey:"e"},sortBy:{name:LNG.order_type,accesskey:"o",icon:"sort",items:{set_sort_name:{name:LNG.name,className:"menu_set_sort set_sort_name"},set_sort_ext:{name:LNG.type,className:"menu_set_sort set_sort_ext"},set_sort_size:{name:LNG.size,className:"menu_set_sort set_sort_size"},set_sort_mtime:{name:LNG.modify_time,className:"menu_set_sort set_sort_mtime"},set_sort_up:{name:LNG.sort_up,className:"set_sort_up",icon:"sort-up",className:"menu_set_desc set_sort_up"},set_sort_down:{name:LNG.sort_down,className:"set_sort_down",icon:"sort-down",className:"menu_set_desc set_sort_down"}}},sep1:"--------",upload:{name:LNG.upload,className:"upload",icon:"upload",accesskey:"u"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},copy_see:{name:LNG.clipboard,className:"copy_see",icon:"eye",accesskey:"b"},sep2:"--------",app_install:{name:LNG.app_store,className:"app_install",icon:"tasks",accesskey:"a"},app_create:{name:LNG.app_create,className:"app_create",icon:"puzzle-piece",accesskey:"k"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},newfileOther:{name:LNG.newothers,items:{newfile_html:{name:"html "+LNG.file},newfile_php:{name:"php "+LNG.file},newfile_js:{name:"js "+LNG.file},newfile_css:{name:"css "+LNG.file}}},sep3:"--------",full:{name:LNG.full_screen,className:"full",icon:"fullscreen",accesskey:"m"},setting_wall:{name:LNG.setting_wall,className:"setting_wall",icon:"picture",accesskey:"w"},setting:{name:LNG.setting,className:"setting",icon:"cogs",accesskey:"s"}}})},h=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:t,className:t,callback:function(e){b(e)},items:{open:{name:LNG.open,className:"open",icon:"folder-open-alt",accesskey:"o"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},m=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:e,className:t,callback:function(e){b(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},open_text:{name:LNG.edit,className:"open_text",icon:"edit",accesskey:"e"},open_ie:{name:LNG.open_ie,className:"open_ie",icon:"globe",accesskey:"b"},newfileOther:{name:LNG.open_with,accesskey:"h",items:{open_text:{name:LNG.edit,className:"open_text",icon:"edit"},open_kindedit:{name:LNG.others,className:"open_kindedit",icon:"edit"}}},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},unzip:{name:LNG.unzip,className:"unzip",icon:"folder-open-alt",accesskey:"u"},down:{name:LNG.download,className:"down",icon:"download",accesskey:"x"},sep3:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},v=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:i,className:t,callback:function(e){"editor"==Config.pageApp?z(e):b(e)},items:{open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},app_edit:{name:LNG.app_edit,className:"app_edit",icon:"code",accesskey:"a"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},g=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:a,className:t,callback:function(e){b(e)},items:{copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},clone:{name:LNG.clone,className:"clone",icon:"external-link",accesskey:"m"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep1:"--------",playmedia:{name:LNG.add_to_play,className:"playmedia",icon:"music",accesskey:"p"},zip:{name:LNG.zip,className:"zip",icon:"folder-close",accesskey:"z"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}})},_=function(e){switch(e){case"refresh":ui.f5(!0,!0);break;case"back":ui.path.back();case"next":ui.path.next();break;case"seticon":ui.setListType("icon");break;case"setlist":ui.setListType("list");break;case"set_sort_name":ui.setListSort("name",0);break;case"set_sort_ext":ui.setListSort("ext",0);break;case"set_sort_size":ui.setListSort("size",0);break;case"set_sort_mtime":ui.setListSort("mtime",0);break;case"set_sort_up":ui.setListSort(0,"up");break;case"set_sort_down":ui.setListSort(0,"down");break;case"upload":core.upload();break;case"past":ui.path.past();break;case"copy_see":ui.path.clipboard();break;case"newfolder":ui.path.newFolder();break;case"newfile":ui.path.newFile();break;case"newfile_html":ui.path.newFile("html");break;case"newfile_php":ui.path.newFile("php");break;case"newfile_js":ui.path.newFile("js");break;case"newfile_css":ui.path.newFile("css");break;case"newfile_oexe":ui.path.newFile("oexe");break;case"info":ui.path.info();break;case"open":ui.path.open();break;case"open_new":ui.path.open_new();break;case"app_install":ui.path.appList();break;case"app_create":ui.path.appEdit(!0);break;case"full":ui.fullScreen();break;case"setting":core.setting();break;case"setting_wall":core.setting("wall");break;default:}},b=function(e){switch(e){case"open":ui.path.open();break;case"down":ui.path.download();break;case"open_ie":ui.path.openIE();break;case"open_text":ui.path.openEditor();break;case"app_edit":ui.path.appEdit();case"open_kindedit":break;case"playmedia":ui.path.play();break;case"fav":ui.path.fav();break;case"search":ui.path.search();break;case"copy":ui.path.copy();break;case"clone":ui.path.copyDrag(G.this_path,!0);break;case"cute":ui.path.cute();break;case"remove":ui.path.remove();break;case"rname":ui.path.rname();break;case"zip":ui.path.zip();break;case"unzip":ui.path.unZip();break;case"info":ui.path.info();break;default:}},y=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:s,callback:function(e){z(e)},items:{fav_page:{name:LNG.manage_fav,className:"fav_page",icon:"star",accesskey:"r"},refresh_all:{name:LNG.refresh_tree,className:"refresh_all",icon:"refresh",accesskey:"e"},sep1:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},x=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:o,callback:function(e){z(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},sep3:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},N=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:n,callback:function(e){z(e)},items:{refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep1:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep2:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"}}}) +},k=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:n,callback:function(e){z(e)},items:{explorer:{name:LNG.manage_folder,className:"explorer",icon:"laptop",accesskey:"v"},refresh:{name:LNG.refresh_tree,className:"refresh",icon:"refresh",accesskey:"e"},fav:{name:LNG.add_to_fav,className:"fav",icon:"star",accesskey:"f"},search:{name:LNG.search_in_path,className:"search",icon:"search",accesskey:"s"},sep3:"--------",newfolder:{name:LNG.newfolder,className:"newfolder",icon:"folder-close-alt",accesskey:"n"},newfile:{name:LNG.newfile,className:"newfile",icon:"file-alt",accesskey:"j"},sep2:"--------",copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},past:{name:LNG.past,className:"past",icon:"paste",accesskey:"p"},rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},sep4:"--------",remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},sep5:"--------",quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},w=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:r,callback:function(e){z(e)},items:{edit:{name:LNG.edit,className:"edit",icon:"edit",accesskey:"e"},open:{name:LNG.open,className:"open",icon:"external-link",accesskey:"o"},openIE:{name:LNG.open_ie,className:"openIE",icon:"globe",accesskey:"b"},download:{name:LNG.download,className:"download",icon:"download",accesskey:"x"},sep1:"--------",rname:{name:LNG.rename,className:"rname",icon:"pencil",accesskey:"r"},copy:{name:LNG.copy,className:"copy",icon:"copy",accesskey:"c"},cute:{name:LNG.cute,className:"cute",icon:"cut",accesskey:"k"},remove:{name:LNG.remove,className:"remove",icon:"trash",accesskey:"d"},sep2:"--------",info:{name:LNG.info,className:"info",icon:"info",accesskey:"i"},quit:{name:LNG.close_menu,className:"quit",icon:"remove",accesskey:"q"}}})},L=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".taskBarMenu",items:{quitOthers:{name:LNG.close_others,className:"quitOthers",icon:"remove-circle",accesskey:"o"},quit:{name:LNG.close,className:"quit",icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quitOthers":$.each(art.dialog.list,function(e,t){a!=e&&t.close()});break;case"quit":i.close()}}})},C=function(){$.contextMenu({zIndex:9999,selector:".task_tab",items:{closeAll:{name:LNG.dialog_close_all,icon:"remove-circle",accesskey:"o"},showAll:{name:LNG.dialog_display_all,icon:"th-large",accesskey:"o"},hideAll:{name:LNG.dialog_min_all,icon:"remove",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id");switch(art.dialog.list[a],e){case"showAll":$.each(art.dialog.list,function(e,t){t.display(!0)});break;case"hideAll":$.each(art.dialog.list,function(e,t){t.display(!1)});break;case"closeAll":$.each(art.dialog.list,function(e,t){t.close()});break;default:}}})},j=function(){$('').appendTo("#rightMenu"),$.contextMenu({zIndex:9999,selector:".dialog_menu",items:{quit:{name:LNG.close,icon:"remove",accesskey:"o"},hide:{name:LNG.dialog_min,icon:"minus",accesskey:"o"},refresh:{name:LNG.refresh,icon:"refresh",accesskey:"q"}},callback:function(e,t){var a=t.$trigger.attr("id"),i=art.dialog.list[a];switch(e){case"quit":i.close();break;case"hide":i.display(!1);break;case"refresh":i.refresh();break;default:}}})},z=function(e){switch(e){case"app_edit":ui.tree.appEdit();break;case"edit":ui.tree.openEditor();break;case"open":ui.tree.open();break;case"refresh":ui.tree.refresh();break;case"copy":ui.tree.copy();break;case"cute":ui.tree.cute();break;case"past":ui.tree.past();break;case"rname":ui.tree.rname();break;case"remove":ui.tree.remove();break;case"info":ui.tree.info();break;case"download":ui.tree.download();break;case"openIE":ui.tree.openIE();break;case"search":ui.tree.search();break;case"newfolder":ui.tree.create("folder");break;case"newfile":ui.tree.create("file");break;case"explorer":ui.tree.explorer();break;case"fav_page":core.setting("fav");break;case"fav":ui.tree.fav();break;case"refresh_all":ui.tree.init();break;case"quit":break;default:}};return{initDesktop:c,initExplorer:l,initEditor:d,show:function(e,t,a){e&&(rightMenu.hidden(),$(e).contextMenu({x:t,y:a}))},isDisplay:function(){var e=!1;return $(".context-menu-list").each(function(){"none"!=$(this).css("display")&&(e=!0)}),e},hidden:function(){$(".context-menu-list").filter(":visible").trigger("contextmenu:hide")}}}),define("app/src/editor/ui",[],function(){var e=function(){var e=!1,t=0,a=0,i=0,s=$(".frame-left"),o=$(".frame-resize"),n=$(".frame-right");o.die("mousedown").live("mousedown",function(e){return 1!=e.which?!0:(r(e),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){l(e)}),$(document).one("mouseup",function(e){return c(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1}),void 0)});var r=function(i){e=!0,t=i.pageX,a=$(".frame-left").width(),o.addClass("active"),$(".resizeMask").css("display","block")},l=function(r){if(!e)return!0;var l=r.pageX-t,c=a+l;i>c&&(c=i),c>$(document).width()-200&&(c=$(document).width()-200),s.css("width",c),o.css("left",c-5),n.css("left",c+1)},c=function(){return e?(e=!1,o.removeClass("active"),Global.frameLeftWidth=$(".frame-left").width(),$(".resizeMask").css("display","none"),void 0):!1}},t=function(){$(".tools-left a").click(function(){var e=$(this).attr("class");switch(e){case"home":tree.init();break;case"view":tree.explorer();break;case"folder":tree.create("folder");break;case"file":tree.create("file");break;case"refresh":tree.init();break;default:}})};return{init:function(){e(),t(),tree.init(),$("html").die("click").live("click",function(){rightMenu.hidden(),Global.isIE&&Global.isDragSelect}),Mousetrap.bind(["ctrl+s","command+s"],function(e){e.preventDefault(),e.returnvalue=!1,FrameCall.top("OpenopenEditor","Editor.save","")})},setTheme:function(e){core.setSkin(e,"app_editor.css"),FrameCall.top("OpenopenEditor","Editor.setTheme",'"'+e+'"')},editorFull:function(){var e=$("iframe[name=OpenopenEditor]");e.toggleClass("frame_fullscreen")}}}),define("app/common/tree",["./pathOperate","../tpl/fileinfo","../tpl/app","./pathOpen","./CMPlayer"],function(e){var t,a=e("./pathOperate"),i=e("./pathOpen"),s=!1;ui.pathOpen=i;var o=function(){$.ajax({url:Config.treeAjaxURL+"&type=init",dataType:"json",error:function(){$("#folderList").html('
    '+LNG.system_error+"
    ")},success:function(e){if(!e.code)return $("#folderList").html('
    '+LNG.system_error+"
    "),void 0;var t=e.data;$.fn.zTree.init($("#folderList"),r,t)}}),$(".ztree .switch").die("mouseenter").live("mouseenter",function(){$(this).addClass("switch_hover")}).die("mouseleave").live("mouseleave",function(){$(this).removeClass("switch_hover")}),"editor"==Config.pageApp&&(Mousetrap.bind("up",function(e){n(e,"up")}).bind("down",function(e){n(e,"down")}).bind("left",function(e){n(e,"left")}).bind("right",function(e){n(e,"right")}),Mousetrap.bind("enter",function(){tree.open()}).bind(["del","command+backspace"],function(){tree.remove()}).bind("f2",function(e){stopPP(e),tree.rname()}).bind(["ctrl+f","command+f"],function(e){stopPP(e),tree.search()}).bind(["ctrl+c","command+c"],function(){tree.copy()}).bind(["ctrl+x","command+x"],function(){tree.cute()}).bind(["ctrl+v","command+v"],function(){tree.past()}).bind("alt+m",function(){tree.create("folder")}).bind("alt+n",function(){tree.create("file")}))},n=function(e,t){stopPP(e);var a=$.fn.zTree.getZTreeObj("folderList"),i=a.getSelectedNodes()[0];if(void 0!=i)switch(t){case"up":var s=i.getPreNode();if(s){if(s.open&&s.children.length>0)for(;s.open&&s.children&&s.children.length>=1;)s=s.children[s.children.length-1]}else s=i.getParentNode();a.selectNode(s);break;case"down":if(i.open&&i.children.length>=1)s=i.children[0];else{var o=i,s=o.getNextNode()||o.getParentNode().getNextNode();try{for(;!s;)o=o.getParentNode(),s=o.getNextNode()||o.getParentNode().getNextNode()}catch(e){}}a.selectNode(s);break;case"left":i.isParent?i.open?a.expandNode(i,!1):a.selectNode(i.getParentNode()):a.selectNode(i.getParentNode());break;case"right":i.open?a.selectNode(i.children[0]):a.expandNode(i,!0);break;default:}},r={async:{enable:!0,url:Config.treeAjaxURL,autoParam:["ajax_name=name","ajax_path=path","this_path"],dataFilter:function(e,t,a){return a.code?a.data:null}},edit:{enable:!0,showRemoveBtn:!1,showRenameBtn:!1,drag:{isCopy:!1,isMove:!1}},view:{showLine:!1,selectedMulti:!1,dblClickExpand:!1,addDiyDom:function(e,t){var a=Global.treeSpaceWide,i=$("#"+t.tId+"_switch"),s=$("#"+t.tId+"_ico");if(i.remove(),s.before(i),"file"==t.type&&s.removeClass("button ico_docu").addClass("file "+t.ext),"oexe"==t.ext&&s.removeClass("button ico_docu").addClass("file oexe").removeAttr("style"),t.level>=1){var o="";i.before(o)}var n="";"explorer"==Config.pageApp?("__fav__"==t.ext&&(n="menuTreeFav"),"__root__"==t.ext&&(n="menuTreeRoot"),"folder"==t.type&&(n="menuTreeFolder")):"editor"==Config.pageApp&&("__fav__"==t.ext&&(n="menuTreeFav"),"__root__"==t.ext&&(n="menuTreeRoot"),"file"==t.type&&(n="menuTreeFile"),"folder"==t.type&&(n="menuTreeFolder"),"oexe"==t.ext&&(n="menuApp"));var r=LNG.name+":"+t.name+"\n"+LNG.size+":"+t.size_friendly+"\n"+LNG.modify_time+":"+t.mtime;"file"!=t.type&&(r=t.name),i.parent().addClass(n).attr("title",r)}},callback:{onClick:function(e,t,a){var i=$.fn.zTree.getZTreeObj("folderList");return i.selectNode(a),i.expandNode(a),"folder"!=a.type||"editor"!=Config.pageApp?0==a.level?("explorer"==Config.pageApp&&"__fav__"!=a.ext&&ui.path.list(a.this_path+"/"),!1):("editor"==Config.pageApp?ui.tree.openEditor():"explorer"==Config.pageApp&&ui.tree.open(),void 0):void 0},beforeRightClick:function(e,t){var a=$.fn.zTree.getZTreeObj("folderList");a.selectNode(t)},beforeAsync:function(e,t){t.ajax_name=urlEncode(t.name),t.ajax_path=urlEncode(t.path)},onAsyncSuccess:function(){"function"==typeof t&&(t(),t=void 0)},onRename:function(e,i,s){var o=$.fn.zTree.getZTreeObj("folderList"),n=s.getParentNode();if(o.getNodesByParam("name",s.name,n).length>1)return core.tips.tips(LNG.name_isexists,!1),o.removeNode(s),void 0;if(s.create){var r=s.path+"/"+s.name;"folder"==s.type?a.newFolder(r,function(e){e.code&&(c(n),t=function(){var e=o.getNodesByParam("name",s.name,n)[0];o.selectNode(e),d()})}):a.newFile(r,function(e){e.code&&(c(n),t=function(){var e=o.getNodesByParam("name",s.name,n)[0];o.selectNode(e),d()})})}else{var l=s.path+s.beforeName,p=s.path+s.name;a.rname(l,p,function(e){e.code&&(c(n),t=function(){var e=o.getNodesByParam("name",s.name,n)[0];o.selectNode(e),d()})})}}}},l=function(e){var t=$.fn.zTree.getZTreeObj("folderList");if(t){var a=t.getSelectedNodes()[0],i="",s="";return a?(a.father?i=a.father+a.name:a.this_path?i=a.this_path:""!=a.path?i=a.path+a.name:""==a.path&&(i="/"+a.name),s=a.ext,("_null_"==s||void 0==s)&&(s="folder"),"file"==s&&(s=a.ext),e?[{path:i,type:s,node:a}]:{path:i,type:s,node:a}):{path:"",type:""}}},c=function(e){var t=$.fn.zTree.getZTreeObj("folderList");void 0==e&&(e=t.getSelectedNodes()[0]),e.isParent||(e=e.getParentNode()),t.reAsyncChildNodes(e,"refresh")},d=function(){"explorer"==Config.pageApp&&ui.f5()};return{pathOpen:i,init:o,refresh:c,openEditor:function(){i.openEditor(l().path)},openIE:function(){i.openIE(l().path)},download:function(){i.download(l().path)},open:function(){if(!($(".dialog_path_remove").length>=1)){var e=l();"oexe"==e.type&&(e.path=e.node),i.open(e.path,e.type)}},fav:function(){a.fav(l().path)},search:function(){core.search("",l().path)},appEdit:function(){var e=l(),t=e.node;t.path=e.path,a.appEdit(t,function(){c(e.node.getParentNode())})},info:function(){a.info(l(!0))},copy:function(){a.copy(l(!0))},cute:function(){a.cute(l(!0))},past:function(){var e=l();e.node.isParent||(e.node=e.node.getParentNode()),a.past(e.path,function(){d(),c(e.node)})},remove:function(){var e=l(!0),t=e[0].node.getParentNode();t?a.remove(e,function(){d(),c(t)}):$.dialog({fixed:!0,resize:!1,icon:"warning",drag:!0,title:LNG.tips,content:LNG.remove_not,ok:!0})},checkIfChange:function(e){if(!s){s=!0;var t=$.fn.zTree.getZTreeObj("folderList");t&&(t.getNodesByFilter(function(t){var a;return t.this_path?a=t.this_path:""!=t.path&&(a=t.path+t.name),a==e||a+"/"==e?(c(t),!0):!1},!0),setTimeout(function(){s=!1},1e3))}},explorer:function(){var e=l().path;e||(e=G.this_path),core.explorer(e)},fileBox:function(e){e="save_file",e="save_folder",e="select_",$(".header-left").css("width",110).next().css("left",150),$(".frame-left").width("width",142),$.dialog.open("?/explorer&plague="+e,{resize:!0,fixed:!0,title:"另存为",width:750,height:420})},create:function(e){var a=$.fn.zTree.getZTreeObj("folderList"),i=a.getSelectedNodes();if(0>=i.length){var s=a.getNodeByParam("ext","__root__",null);a.selectNode(s)}var o=l(),n=o.node,r=n.getParentNode(),d="newfile",p=0,u=LNG.newfolder;if("folder"==e){for(;a.getNodesByParam("name",u+"("+p+")",r).length>0;)p++;newNode={name:u+"("+p+")",ext:"",type:"folder",create:!0,path:o.path}}else if("file"==e){for(;a.getNodesByParam("name",d+"("+p+").txt",r).length>0;)p++;newNode={name:d+"("+p+").txt",ext:"txt",type:"file",create:!0,path:o.path}}void 0!=n.children?(treeNodeNew=a.addNodes(n,newNode),a.editName(treeNodeNew[0])):("folder"!=n.type&&(n=n.getParentNode()),t=function(){treeNodeNew=a.addNodes(n,newNode),a.editName(treeNodeNew[0])},c(n))},rname:function(){var e=$.fn.zTree.getZTreeObj("folderList"),t=e.getSelectedNodes()[0];e.editName(t),t.beforeName=t.name}}}),define("app/common/pathOperate",["../tpl/fileinfo","../tpl/app"],function(e){var t=e("../tpl/fileinfo"),a=["/","\\",":","*","?",'"',"<",">","|"],i=function(e){var t=function(e,t){for(var a=t.length,i=0;a>i;i++)if(e.indexOf(t[i])>0)return!0;return!1};return t(e,a)?(core.tips.tips(LNG.path_not_allow+':/ : * ? " < > |',!1),!1):!0},s=function(e){var t="list=[";for(var a in e)t+='{"type":"'+e[a].type+'","path":"'+urlEncode2(e[a].path)+'"}',a!=e.length-1&&(t+=",");return t+"]"},o=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkfile&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},n=function(e,t){if(e){var a=core.pathThis(e);i(a)&&$.ajax({dataType:"json",url:"index.php?explorer/mkdir&path="+urlEncode2(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})}},r=function(e,t,a){e&&t&&e!=t&&i(core.pathThis(t))&&$.ajax({type:"POST",dataType:"json",url:"index.php?explorer/pathRname",data:"path="+urlEncode(e)+"&rname_to="+urlEncode(t),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof a&&a(e)}})},l=function(e,t){if(!(1>e.length)){var a=e[0].path;a.length>20&&(a=a.substr(-20)+"..."),$.dialog({id:"dialog_path_remove",fixed:!0,icon:"question",title:LNG.remove_title,padding:40,lock:!0,background:"#000",opacity:.5,content:a+"
    "+LNG.remove_info+"【"+e.length+"】",ok:function(){$.ajax({url:"index.php?explorer/pathDelete",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){core.tips.close(e),"function"==typeof t&&t(e)}})},cancel:!0})}},c=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCopy",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},d=function(e){1>e.length||$.ajax({url:"index.php?explorer/pathCute",type:"POST",dataType:"json",data:s(e),error:core.ajaxError,success:function(e){core.tips.tips(e)}})},p=function(e,t){if(e){var a="index.php?explorer/pathPast&path="+urlEncode2(e);$.ajax({url:a,dataType:"json",beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){e.code?core.tips.close(e.info):core.tips.close(e),"function"==typeof t&&t(e)}})}},u=function(e){if(1>e.length&&(e=[{path:G.this_path,type:"folder"}]),e.length>1)return f(e),void 0;e=e[0];var a="folder"==e.type?"path_info":"file_info";$.ajax({url:"index.php?explorer/pathInfo&type="+e.type+"&path="+urlEncode2(e.path),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(i){if(!i.code)return core.tips.close(i),void 0;core.tips.close(LNG.get_success,!0);var s=template.compile(t[a]);i.data.LNG=LNG,$.dialog({padding:5,fixed:!0,title:core.pathThis(e.path).substr(0,20)+"... "+LNG.info,content:s(i.data),width:"350px",cancel:!0})}})},f=function(e){$.ajax({url:"index.php?explorer/pathInfoMuti",type:"POST",data:s(e),beforeSend:function(){core.tips.loading(LNG.getting)},error:core.ajaxError,success:function(e){if(!e.code)return core.tips.close(e),void 0;core.tips.close(LNG.get_success,!0);var a=template.compile(t.path_info_more);e.data.LNG=LNG,$.dialog({padding:5,fixed:!0,width:"350px",title:LNG.info,content:a(e.data),cancel:!0})}})},h=function(e,t){1>e.length||$.ajax({url:"index.php?explorer/zip",type:"POST",dataType:"json",data:s(e),beforeSend:function(){core.tips.loading(LNG.ziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,core.tips.tips(e),"function"==typeof t&&t(e)}})},m=function(e,t){if(e){var a="index.php?explorer/unzip&path="+urlEncode2(e);$.ajax({url:a,beforeSend:function(){core.tips.loading(LNG.unziping)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code=100,"function"==typeof t&&t(e)}})}},v=function(e,t,a){t&&$.ajax({url:"index.php?explorer/pathCuteDrag",type:"POST",dataType:"json",data:s(e)+"&path="+urlEncode2(t),beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code&&"function"==typeof a&&a(e)}})},g=function(e,t,a){t&&$.ajax({url:"index.php?explorer/pathCopyDrag",type:"POST",dataType:"json",data:s(e)+"&path="+urlEncode2(t),beforeSend:function(){core.tips.loading(LNG.moving)},error:core.ajaxError,success:function(e){core.tips.close(e),e.code&&"function"==typeof a&&a(e)}})},_=function(){$.ajax({url:"index.php?explorer/clipboard",dataType:"json",error:core.ajaxError,success:function(e){e.code&&$.dialog({title:LNG.clipboard,padding:0,height:200,width:400,content:e.data})}})},b=function(e){if(e){var t="&name="+urlEncode(core.pathThis(e))+"&path="+urlEncode(e);core.setting("fav"+t)}},y=function(e){var t={};return t.type=e.find("input[type=radio]:checked").val(),t.content=e.find("textarea").val(),t.group=e.find("[name=group]").val(),e.find("input[type=text]").each(function(){var e=$(this).attr("name");t[e]=$(this).val()}),e.find("input[type=checkbox]").each(function(){var e=$(this).attr("name");t[e]="checked"==$(this).attr("checked")?1:0}),t},x=function(e){e.find(".type input").change(function(){var t=$(this).attr("apptype");e.find("[data-type]").addClass("hidden"),e.find("[data-type="+t+"]").removeClass("hidden")})},N=function(t,a,i){var s,o,n,r=LNG.app_create,l=UUID(),c=e("../tpl/app"),d=G.basic_path+"static/images/app/",p=template.compile(c.html);switch(void 0==i&&(i="user_edit"),"root_edit"==i&&(t=json_decode(t)),"user_edit"==i||"root_edit"==i?(r=LNG.app_edit,n=p({LNG:LNG,iconPath:d,uuid:l,data:t})):n=p({LNG:LNG,iconPath:d,uuid:l,data:{}}),$.dialog({fixed:!0,width:450,height:310,id:l,padding:15,title:r,content:n,button:[{name:LNG.preview,callback:function(){var e=y(s);return core.openApp(e),!1}},{name:LNG.button_save,focus:!0,callback:function(){var e=y(s);switch(i){case"user_add":var n=urlEncode2(G.this_path+e.name);o="./index.php?app/user_app&action=add&path="+n;break;case"user_edit":o="./index.php?app/user_app&path="+urlEncode2(t.path);break;case"root_add":o="./index.php?app/add&name="+e.name;break;case"root_edit":o="./index.php?app/edit&name="+e.name+"&old_name="+t.name;break;default:}$.ajax({url:o,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(e)),beforeSend:function(){core.tips.loading()},error:core.ajaxError,success:function(e){if(core.tips.close(e),e.code)if("root_edit"==i||"root_add"==i){if(!e.code)return;FrameCall.top("Openapp_store","App.reload",'""')}else"function"==typeof a?a():ui.f5()}})}}]}),s=$("."+l),t.group&&s.find("option").eq(t.group).attr("selected",1),s.find(".aui_content").css("overflow","inherit"),i){case"user_edit":s.find(".name").addClass("hidden"),s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("option[value="+t.group+"]").attr("checked",!0);break;case"user_add":s.find(".desc").addClass("hidden"),s.find(".group").addClass("hidden"),s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_add":s.find("[apptype=url]").attr("checked",!0),s.find("[data-type=url] input[name=resize]").attr("checked",!0),s.find("input[name=width]").attr("value","800"),s.find("input[name=height]").attr("value","600"),s.find("input[name=icon]").attr("value","oexe.png");break;case"root_edit":s.find("option[value="+t.group+"]").attr("selected",!0);break;default:}x(s)},k=function(){core.appStore()},w=function(e){e&&4>e.length&&"http"!=e.substring(0,4)||$.ajax({url:"./index.php?app/get_url_title&url="+e,dataType:"json",beforeSend:function(){core.tips.loading()},success:function(t){var a=t.data;core.tips.close(t);var i={content:e,desc:"",group:"others",type:"url",icon:"internet.png",name:a,resize:1,simple:0,height:"70%",width:"80%"},s=urlEncode2(G.this_path+a);e="./index.php?app/user_app&action=add&path="+s,$.ajax({url:e,type:"POST",dataType:"json",data:"data="+urlEncode2(json_encode(i)),success:function(e){core.tips.close(e),e.code&&ui.f5()}})}})};return{appEdit:N,appList:k,appAddURL:w,newFile:o,newFolder:n,rname:r,unZip:m,zip:h,copy:c,cute:d,info:u,remove:l,cuteDrag:v,copyDrag:g,past:p,clipboard:_,fav:b}});var file_info="
    {{LNG.file_type}}:
    {{ext}} {{LNG.file}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info="
    {{LNG.type}}:
    {{LNG.folder}}
    {{LNG.address}}:
    {{path}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.contain}}:
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.folder}}
    {{LNG.create_time}}
    {{ctime}}
    {{LNG.modify_time}}
    {{mtime}}
    {{LNG.last_time}}
    {{atime}}
    {{LNG.permission}}:
    {{mode}}
    ",path_info_more="
    {{file_num}} {{LNG.file}},{{folder_num}} {{LNG.file}}
    {{LNG.size}}:
    {{size_friendly}} ({{size}} Byte)
    {{LNG.parent_permission}}:
    {{mode}}
    ";define("app/tpl/fileinfo",[],function(){return{file_info:file_info,path_info:path_info,path_info_more:path_info_more}}),define("app/tpl/app",[],function(){return{html:"
    {{LNG.name}}
    {{LNG.app_desc}}
    {{LNG.app_icon}}
    {{LNG.app_icon_show}}
    {{LNG.app_group}}
    {{LNG.app_type}}
    {{LNG.app_display}}
    {{LNG.app_size}}
    {{LNG.width}}:   {{LNG.height}}:  
    {{LNG.app_url}}
    "}}),define("app/common/pathOpen",["./CMPlayer"],function(e){var t=function(e,t){if(void 0!=e){if(void 0==t&&(t=core.pathExt(e)),t=t.toLowerCase(),"folder"==t)return"explorer"==Config.pageApp?ui.path.list(e+"/"):core.explorer(e),void 0;if("swf"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if("oexe"==t)return core.openApp(e),void 0;if("pdf"==t){var l="pdf"+UUID(),i=core.path2url(e),c='";return $.dialog({resize:!0,fixed:!0,title:core.pathThis(e),width:800,height:400,padding:0,content:c}),new PDFObject({url:i}).embed(l),void 0}if("html"==t||"htm"==t){var i=core.path2url(e);return s(i,core.pathThis(e)),void 0}if(inArray(core.filetype.image,t)){var i=urlDecode(e);return-1==e.indexOf("http:")&&(i=core.path2url(i)),MaskView.image(i),void 0}if(inArray(core.filetype.music,t)||inArray(core.filetype.movie,t)){var i=core.path2url(e);return r(i,t),void 0}if(inArray(core.filetype.doc,t)){var i=core.path2url(e);return n(i,t),void 0}return inArray(core.filetype.bindary,t)?(a(e),void 0):(o(e),void 0)}},a=function(e){if(e){var t="index.php?explorer/fileDownload&path="+urlEncode2(e),a=''+LNG.download_ready+"...",i=$.dialog({icon:"succeed",title:!1,time:1,content:a});i.DOM.wrap.find(".aui_loading").remove()}},i=function(e){if(void 0!=e){var t=core.path2url(e);window.open(t)}},s=function(e,t,a){if(e){void 0==a&&(a="openWindow"+UUID());var i="";art.dialog.through({id:a,title:t,width:"70%",height:"65%",padding:0,content:i,resize:!0})}},o=function(e){if(e){var t=core.pathExt(e),a=core.pathThis(e);if(inArray(core.filetype.bindary,t)||inArray(core.filetype.music,t)||inArray(core.filetype.image,t)||inArray(core.filetype.movie,t)||inArray(core.filetype.doc,t))return core.tips.tips(t+LNG.edit_can_not,!1),void 0; +if(void 0==window.top.frames.OpenopenEditor){var i="./index.php?editor/edit&filename="+urlEncode(urlEncode2(e)),o=a+" ——"+LNG.edit;s(i,o.substring(o.length-50),"openEditor")}else $.dialog.list.openEditor&&$.dialog.list.openEditor.display(!0),FrameCall.top("OpenopenEditor","Editor.add",'"'+urlEncode2(e)+'"')}},n=function(e,t){var a,i,s;switch(t){case"doc":case"docx":case"docm":case"dot":a="http://sg1b-word-view.officeapps.live.com/wv/wordviewerframe.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;case"ppt":case"pptm":case"pptx":a="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":a="http://sg1b-excel.officeapps.live.com/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=";break;default:}i="http://sg1b-15-view-wopi.wopi.live.net:808/oh/wopi/files/@/wFileId?wFileId=",i+=urlEncode(e),s=a+urlEncode(i)+"&access_token=1&access_token_ttl=0";var o=core.pathThis(urlDecode(e));art.dialog.open(s,{title:o,width:"70%",height:"65%",resize:!0})},r=function(t,a){t&&("string"==typeof t&&(t=[t]),CMPlayer=e("./CMPlayer"),CMPlayer.play(t,a))};return{open:t,play:r,openEditor:o,openIE:i,download:a}}),define("app/common/CMPlayer",[],function(){var e={ting:{path:"music/ting",width:410,height:530},beveled:{path:"music/beveled",width:350,height:200},kuwo:{path:"music/kuwo",width:480,height:200},manila:{path:"music/manila",width:320,height:400},mp3player:{path:"music/mp3player",width:320,height:410},qqmusic:{path:"music/qqmusic",width:300,height:400},somusic:{path:"music/somusic",width:420,height:137},xdj:{path:"music/xdj",width:595,height:235},webplayer:{path:"movie/webplayer",width:600,height:400},qqplayer:{path:"movie/qqplayer",width:600,height:400},tvlive:{path:"movie/tvlive",width:600,height:400},youtube:{path:"movie/youtube",width:600,height:400},vplayer:{path:"movie/vplayer",width:600,height:400}},t=function(e){return"music"==e?"music_player":(void 0==e&&(e="mp3"),inArray(core.filetype.music,e)?"music_player":"movie_player")},a=function(t){var a,i,o;"music_player"==t?(a=e[G.musictheme],i="music player",o=!1):(a=e[G.movietheme],i="movie player",o=!0);var n=core.createFlash(G.static_path+"js/lib/cmp4/cmp.swf","context_menu=2&auto_play=1&play_mode=1&skin=skins/"+a.path+".zip",t),r={id:t+"_dialog",simple:!0,title:i,width:a.width,height:a.height,content:n,resize:o,padding:0,fixed:!0,close:function(){var e=s(t);e&&e.sendEvent&&e.sendEvent("view_stop")}};window.top.CMP?art.dialog.through(r):$.dialog(r)},i=function(e){var t,a="";for(t=e.length-1;t>=0;t--){var i,s;-1==e[t].search("fileProxy")?(i=urlEncode(e[t]),s=core.pathThis(e[t])):(i=e[t],s=core.pathThis(urlDecode(i))),i=i.replace(/%2F/g,"/"),i=i.replace(/%3F/g,"?"),i=i.replace(/%26/g,"&"),i=i.replace(/%3A/g,":"),i=i.replace(/%3D/g,"="),a+=''}return a},s=function(e){return window.top.CMP?window.top.CMP.get(e):CMP.get(e)},o=function(e,t){var a=i(e),o=s(t);if(o){o.config("play_mode","normal");var n=o.list().length;o.list_xml(a,!0),o.sendEvent("view_play",n+1)}};return{changeTheme:function(t,a){var i,o,n;"music"==t?(G.musictheme=a,i="music_player"):"movie"==t&&(G.movietheme=a,i="movie_player"),n=s(i),n&&(o=e[a],window.top.art.dialog.list[i+"_dialog"].size(o.width,o.height),n.sendEvent("skin_load","skins/"+o.path+".zip"))},play:function(e,i){var n=t(i),r=s(n);r?(o(e,n),window.top.art.dialog.list[n+"_dialog"].display(!0)):(a(n),setTimeout(function(){o(e,n)},1e3))}}}); \ No newline at end of file diff --git a/static/js/app/src/explorer/main.js b/static/js/app/src/explorer/main.js index c7423d4..32da6a7 100644 --- a/static/js/app/src/explorer/main.js +++ b/static/js/app/src/explorer/main.js @@ -1,4 +1,4 @@ -define("app/src/explorer/main",["lib/jquery-lib","lib/util","lib/webuploader/webuploader-min","lib/ztree/js/ztree","lib/contextMenu/jquery-contextMenu","lib/artDialog/jquery-artDialog","lib/picasa/picasa","./ui","./fileSelect","../../common/taskTap","../../common/core","../../tpl/search","../../tpl/upload","../../common/rightMenu","../../common/tree","../../common/pathOperate","../../tpl/fileinfo","../../tpl/app","../../common/pathOpen","../../common/CMPlayer","./path"],function(e){Config={BodyContent:".bodymain",FileBoxSelector:".fileContiner",FileBoxClass:".fileContiner .file",FileBoxClassName:"file",FileBoxTittleClass:".fileContiner .title",SelectClass:".fileContiner .select",SelectClassName:"select",TypeFolderClass:"folderBox",TypeFileClass:"fileBox",HoverClassName:"hover",FileOrderAttr:"number",TreeId:"folderList",pageApp:"explorer",treeAjaxURL:"index.php?explorer/treeList&app=explorer",AnimateTime:200},Global={fileListAll:"",fileListNum:0,fileRowNum:0,frameLeftWidth:200,treeSpaceWide:10,topbar_height:40,ctrlKey:!1,shiftKey:!1,fileListSelect:"",fileListSelectNum:"",isIE:!-[1],isDragSelect:!1,historyStatus:{back:1,next:0}},e("lib/jquery-lib"),e("lib/util"),e("lib/webuploader/webuploader-min"),e("lib/ztree/js/ztree"),e("lib/contextMenu/jquery-contextMenu"),e("lib/artDialog/jquery-artDialog"),e("lib/picasa/picasa"),ui=e("./ui"),TaskTap=e("../../common/taskTap"),core=e("../../common/core"),rightMenu=e("../../common/rightMenu"),ui.tree=e("../../common/tree"),ui.path=e("./path"),fileSelect=e("./fileSelect"),fileLight=fileSelect.fileLight,$(document).ready(function(){Global.topbar_height="none"==$(".topbar").css("display")?0:$(".topbar").height(),$(".init_loading").fadeOut(600),ui.init(),ui.tree.init(),TaskTap.init(),core.update(),core.upload_init(),fileSelect.init(),rightMenu.initExplorer()})}),define("app/src/explorer/ui",["./fileSelect"],function(require,exports){var fileSelect=require("./fileSelect"),fileLight=fileSelect.fileLight,MyPicasa=new Picasa;PicasaOpen=!1;var _ajaxLive=function(){fileLight.init(),ui.setStyle(),PicasaOpen=!1,MyPicasa.initData(),$(".fileContiner .picture img").lazyload({container:$(".bodymain")})},_initListType=function(e){$(".tools-right button").removeClass("active"),$("#set_"+e).addClass("active"),"list"==e?($(Config.FileBoxSelector).removeClass("fileList_icon").addClass("fileList_list"),$("#list_type_list").html('
    '+LNG.name+"
    "+'
    '+LNG.type+"
    "+'
    '+LNG.size+"
    "+'
    '+LNG.modify_time+"
    "+'
    '+"
    "),$(Config.FileBoxSelector+" textarea").autoTextarea({minHeight:19,padding:4})):($(Config.FileBoxSelector).removeClass("fileList_list").addClass("fileList_icon"),$("#list_type_list").html(""),$(Config.FileBoxSelector+" textarea").autoTextarea({minHeight:32,padding:4})),$(".menu_seticon").removeClass("selected"),$(".set_set"+G.list_type).addClass("selected")},_setListType=function(e,t){G.list_type=e,void 0==t?$.ajax({url:"index.php?setting/set&k=list_type&v="+e,dataType:"json",success:function(){_initListType(e),_f5(!1,!1)}}):(_initListType(e),_f5(!1,!0))},_sortBy=function(e,t){var t="down"==t?-1:1;return function(a,i){return a=a[e],i=i[e],i>a?-1*t:a>i?1*t:void 0}},_setListSort=function(e,t){0!=e&&(G.sort_field=e,$(".menu_set_sort").removeClass("selected"),$(".set_sort_"+e).addClass("selected")),0!=t&&(G.sort_order=t,$(".menu_set_desc").removeClass("selected"),$(".set_sort_"+t).addClass("selected")),_f5(!1,!0),$.ajax({url:"index.php?setting/set&k=list_sort_field,list_sort_order&v="+G.sort_field+","+G.sort_order})},_jsonSortTitle=function(){var up='',down='';$("#main_title .this").toggleClass("this").attr("id","").find("span").html(""),$("#main_title div[field="+G.sort_field+"]").addClass("this").attr("id",G.sort_order).find("span").html(eval(G.sort_order))},_bindEventSort=function(){$("#main_title div").die("click").live("click",function(){"up"==$(this).attr("id")?$(this).attr("id","down"):$(this).attr("id","up"),_setListSort($(this).attr("field"),$(this).attr("id"))})},_bindEventTools=function(){$(".tools a,.tools button").bind("click",function(){var e=$(this).attr("id");_toolsAction(e)})},_bindEventTheme=function(){$(".dropdown-menu-theme li").click(function(){var e=$(this).attr("theme");$.ajax({url:"index.php?setting/set&k=theme&v="+e,dataType:"json",success:function(){ui.setTheme(e)}}),$(".dropdown-menu li").removeClass("this"),$(this).addClass("this")})},_bindFrameSizeEvent=function(){var e=!1,t=0,a=0,i=0,s=$(".frame-left"),n=$(".frame-resize"),o=$(".frame-right");n.die("mousedown").live("mousedown",function(e){return 1!=e.which?!0:(l(e),this.setCapture&&this.setCapture(),$(document).mousemove(function(e){r(e)}),$(document).one("mouseup",function(e){return c(e),this.releaseCapture&&this.releaseCapture(),stopPP(e),!1}),void 0)});var l=function(i){e=!0,t=i.pageX,a=$(".frame-left").width(),n.addClass("active")},r=function(l){if(!e)return!0;var r=l.pageX-t,c=a+r;i>c&&(c=i),c>$(document).width()-200&&(c=$(document).width()-200),s.css("width",c),n.css("left",c-5),o.css("left",c+1),ui.setStyle()},c=function(){return e?(e=!1,n.removeClass("active"),Global.frameLeftWidth=$(".frame-left").width(),void 0):!1}},_bindHotKey=function(){var e=91;Global.ctrlKey=!1,$(document).keydown(function(t){if("none"!=$("#PicasaView").css("display"))return!0;if(ui.isEdit())return!0;if(rightMenu.isDisplay())return!0;var a=!1;if(Global.ctrlKey||t.keyCode==e||t.ctrlKey)switch(a=!0,Global.ctrlKey=!0,t.keyCode){case 8:ui.path.remove(),a=!0;break;case 65:fileSelect.selectPos("all");break;case 8:ui.path.next(),a=!0;break;case 67:ui.path.copy();break;case 88:ui.path.cute();break;case 83:break;case 86:ui.path.past();break;case 70:core.search($(".header-right input").val(),G.this_path);break;default:a=!1}else if(t.shiftKey)Global.shiftKey=!0;else switch(t.keyCode){case 8:ui.path.back(),a=!0;break;case 35:fileSelect.selectPos("end");break;case 36:fileSelect.selectPos("home");break;case 37:fileSelect.selectPos("left"),a=!0;break;case 38:fileSelect.selectPos("up");break;case 39:fileSelect.selectPos("right"),a=!0;break;case 40:fileSelect.selectPos("down");break;case 13:ui.path.open(),a=!1;break;case 46:ui.path.remove();break;case 113:ui.path.rname();break;default:a=!1}return a&&(stopPP(t),t.keyCode=0,t.returnValue=!1),!0}).keyup(function(t){t.shiftKey||(Global.shiftKey=!1),t.keyCode!=e&&t.ctrlKey||(Global.ctrlKey=!1)})},_menuActionBind=function(){$(".drop-menu-action li").bind("click",function(){if(!$(this).hasClass("disabled")){var e=$(this).attr("id");switch(e){case"open":ui.path.open();break;case"copy":ui.path.copy();break;case"rname":ui.path.rname();break;case"cute":ui.path.cute();break;case"past":ui.path.past();break;case"remove":ui.path.remove();break;case"zip":ui.path.zip();break;case"download":ui.path.download();break;case"info":ui.path.info();break;default:}}})};this._getFolderBox=function(e){var t="";return t+=""},this._getFileBox=function(e){var t="";if("oexe"==e.ext&&void 0!=e.icon){var a=e.icon;-1==e.icon.search(G.static_path)&&"http"!=e.icon.substring(0,4)&&(a=G.static_path+"images/app/"+e.icon);var i=urlEncode(json_encode(e)),s=e.name.replace(".oexe","");t=""}else if(inArray(core.filetype.image,e.ext)){var n=core.path2url(G.this_path+e.name),o="index.php?explorer/image&path="+urlEncode(G.this_path+e.name);t+=""}else t+="";return t},this._getFolderBoxList=function(e){var t="";return t+=""},this._getFileBoxList=function(e){var t="";if("oexe"==e.ext){var a=urlEncode(json_encode(e));t="