mirror of https://gitee.com/zhang_1334717033/kiftd
Compare commits
6 Commits
v1.0.31-re
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
dbb335ca09 | |
|
|
eaf74ae6c5 | |
|
|
2a81d74a51 | |
|
|
7e44880f93 | |
|
|
79e6f2a434 | |
|
|
9d104a2de9 |
|
|
@ -77,11 +77,10 @@ _注:kift为该功能的开发名称,其实际成果命名为kiftd。_
|
|||
|
||||
> 提示:当您更新版本后,请手动清除浏览器的缓存,之后刷新网盘主页以确保数据文件保持最新!否则可能导致新版页面功能无法使用。
|
||||
|
||||
### 常规更新v1.0.31
|
||||
### 常规更新v1.0.35
|
||||
_本次更新为维护性的更新,修复一些已经发现的问题并优化使用体验,推荐所有用户升级。_
|
||||
+ 进一步完善了文件上传机制,使其能够正确识别一些含有Unix特殊字符的文件名。
|
||||
+ 进一步完善了账户登录认证机制,使其能够正确识别某些含有特殊字符账户名。
|
||||
+ 其他一些细节优化。
|
||||
+ 修复了当用户执行批量上传操作时,中途切换所在的文件夹可能会导致上传路径发生改变的问题。
|
||||
+ 升级了内置的MySQL数据库驱动的版本。
|
||||
|
||||
|
||||
> 需要查看更多版本历史信息?请访问: https://kohgylw.gitee.io/News.html
|
||||
|
|
|
|||
Binary file not shown.
BIN
kiftd说明文档.pdf
BIN
kiftd说明文档.pdf
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
|||
<!doctype html>
|
||||
<!-- 青阳网络文件传输系统 kiftd v1.0.31-RELEASE -->
|
||||
<!-- 青阳网络文件传输系统 kiftd v1.0.35-RELEASE -->
|
||||
<!-- 欢迎访问主界面 -->
|
||||
<!-- by 青阳龙野(kohgylw@163.com) -->
|
||||
<html>
|
||||
|
|
@ -101,32 +101,34 @@
|
|||
class="glyphicon glyphicon-cog"></span> 操作 <span
|
||||
class="caret"></span></a>
|
||||
<ul class="dropdown-menu" id="fileListDropDown">
|
||||
<li id="uploadFileButtonLi"><a href="javascript:void(0);">上传文件 <span
|
||||
class="pull-right"><span
|
||||
<li id="uploadFileButtonLi"><a
|
||||
href="javascript:void(0);">上传文件 <span class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+U</span></a></li>
|
||||
<li id="uploadFolderButtonLi"><a href="javascript:void(0);">上传文件夹 <span
|
||||
<li id="uploadFolderButtonLi"><a
|
||||
href="javascript:void(0);">上传文件夹 <span
|
||||
class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+F</span></a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li id="createFolderButtonLi"><a href="javascript:void(0);">新建文件夹 <span
|
||||
<li id="createFolderButtonLi"><a
|
||||
href="javascript:void(0);">新建文件夹 <span
|
||||
class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+N</span></a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li id="copyFileButtonLi"><a href="javascript:void(0);"><span id='copySignTx'>复制
|
||||
<span class="pull-right"><span
|
||||
<li id="copyFileButtonLi"><a href="javascript:void(0);"><span
|
||||
id='copySignTx'>复制 <span class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+C</span>
|
||||
</span></a></li>
|
||||
<li id="cutFileButtonLi"><a href="javascript:void(0);"><span id='cutSignTx'>剪切
|
||||
<span class="pull-right"><span
|
||||
<li id="cutFileButtonLi"><a href="javascript:void(0);"><span
|
||||
id='cutSignTx'>剪切 <span class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+X</span>
|
||||
</span></a></li>
|
||||
<li id="stickFileButtonLi" class="hidden"><a href="javascript:void(0);"><span
|
||||
id='stickSignTx'>粘贴<span id="stickFilesCount"></span>
|
||||
<span class="pull-right"><span
|
||||
<li id="stickFileButtonLi" class="hidden"><a
|
||||
href="javascript:void(0);"><span id='stickSignTx'>粘贴<span
|
||||
id="stickFilesCount"></span> <span class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+V</span>
|
||||
</span></a></li>
|
||||
<li id="deleteSeelectFileButtonLi"><a href="javascript:void(0);">删除 <span
|
||||
class="pull-right"><span
|
||||
<li id="deleteSeelectFileButtonLi"><a
|
||||
href="javascript:void(0);">删除 <span class="pull-right"><span
|
||||
class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span>+D</span></a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
|
@ -293,7 +295,8 @@
|
|||
<h5 id="deleteFolderMessage"></h5>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cancelDeleteFolderBtn" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button id="cancelDeleteFolderBtn" type="button"
|
||||
class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<span id="deleteFolderBox"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -545,7 +548,8 @@
|
|||
<h5 id="deleteFileMessage" class="wordbreak"></h5>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cancelDeleteFileBox" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button id="cancelDeleteFileBox" type="button"
|
||||
class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<span id="deleteFileBox"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -609,7 +613,8 @@
|
|||
</h5>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cancelDownloadAllCheckedBtn" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button id="cancelDownloadAllCheckedBtn" type="button"
|
||||
class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<span id="downloadAllCheckedBox"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -698,7 +703,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="cancelMoveFilesBtn" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<button id="cancelMoveFilesBtn" type="button"
|
||||
class="btn btn-default" data-dismiss="modal">取消</button>
|
||||
<span id="moveFilesBox"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ var constraintLevel;// 当前文件夹限制等级
|
|||
var account;// 用户账户
|
||||
var isUpLoading = false;// 是否正在执行上传操作
|
||||
var isImporting = false;// 是否正在执行上传文件夹操作
|
||||
var uploadTargetFolder;// 执行上传操作时的目标文件夹(单独保存以避免用户切换文件夹)
|
||||
var isChangingPassword = false;// 是否正在执行修改密码操作
|
||||
var importFolderName;// 上传文件夹时保存文件夹名称
|
||||
var xhr;// 文件或文件夹上传请求对象
|
||||
|
|
@ -988,8 +989,7 @@ function showFolderTable(folderView) {
|
|||
|
||||
// 根据一个文件对象生成对应的文件行的HTML内容
|
||||
function createFileRow(fi, aL, aD, aR, aO) {
|
||||
fi.fileName = fi.fileName.replace(/\'/g, ''').replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
fi.fileName = html2Escape(fi.fileName);
|
||||
var fileRow = "<tr id=" + fi.fileId + " onclick='checkfile(event," + '"'
|
||||
+ fi.fileId + '"' + ")' ondblclick='checkConsFile(event," + '"'
|
||||
+ fi.fileId + '"' + ")' id='" + fi.fileId
|
||||
|
|
@ -1007,7 +1007,7 @@ function createFileRow(fi, aL, aD, aR, aO) {
|
|||
+ '"'
|
||||
+ fi.fileId
|
||||
+ '","'
|
||||
+ fi.fileName
|
||||
+ replaceAllQuotationMarks(fi.fileName)
|
||||
+ '"'
|
||||
+ ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-cloud-download'></span> 下载</button>";
|
||||
// 对于各种特殊格式文件提供的预览和播放功能
|
||||
|
|
@ -1101,7 +1101,7 @@ function createFileRow(fi, aL, aD, aR, aO) {
|
|||
+ '"'
|
||||
+ fi.fileId
|
||||
+ '","'
|
||||
+ fi.fileName
|
||||
+ replaceAllQuotationMarks(fi.fileName)
|
||||
+ '"'
|
||||
+ ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
|
||||
}
|
||||
|
|
@ -1113,7 +1113,7 @@ function createFileRow(fi, aL, aD, aR, aO) {
|
|||
+ '"'
|
||||
+ ","
|
||||
+ '"'
|
||||
+ fi.fileName
|
||||
+ replaceAllQuotationMarks(fi.fileName)
|
||||
+ '"'
|
||||
+ ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 重命名</button>";
|
||||
}
|
||||
|
|
@ -1133,7 +1133,7 @@ function createFileRow(fi, aL, aD, aR, aO) {
|
|||
+ '"'
|
||||
+ fi.fileId
|
||||
+ '","'
|
||||
+ fi.fileName
|
||||
+ replaceAllQuotationMarks(fi.fileName)
|
||||
+ '"'
|
||||
+ ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-link'></span> 链接</button>";
|
||||
}
|
||||
|
|
@ -1146,8 +1146,7 @@ function createFileRow(fi, aL, aD, aR, aO) {
|
|||
|
||||
// 根据一个文件夹对象生成对应的文件行的HTML内容
|
||||
function createNewFolderRow(f, aD, aR, aO) {
|
||||
f.folderName = f.folderName.replace(/\'/g, ''').replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
f.folderName = html2Escape(f.folderName);
|
||||
var folderRow = "<tr id='"
|
||||
+ f.folderId
|
||||
+ "' onclick='checkfile(event,"
|
||||
|
|
@ -1169,7 +1168,7 @@ function createNewFolderRow(f, aD, aR, aO) {
|
|||
+ '"'
|
||||
+ f.folderId
|
||||
+ '","'
|
||||
+ f.folderName
|
||||
+ replaceAllQuotationMarks(f.folderName)
|
||||
+ '"'
|
||||
+ ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-remove'></span> 删除</button>";
|
||||
}
|
||||
|
|
@ -1179,7 +1178,7 @@ function createNewFolderRow(f, aD, aR, aO) {
|
|||
+ '"'
|
||||
+ f.folderId
|
||||
+ '","'
|
||||
+ f.folderName
|
||||
+ replaceAllQuotationMarks(f.folderName)
|
||||
+ '",'
|
||||
+ f.folderConstraint
|
||||
+ ")' class='btn btn-link btn-xs'><span class='glyphicon glyphicon-wrench'></span> 编辑</button>";
|
||||
|
|
@ -1491,13 +1490,14 @@ function checkUploadFile() {
|
|||
}
|
||||
}
|
||||
var namelist = JSON.stringify(filenames);
|
||||
uploadTargetFolder = locationpath;// 记录上传目标
|
||||
|
||||
$
|
||||
.ajax({
|
||||
type : "POST",
|
||||
dataType : "text",
|
||||
data : {
|
||||
folderId : locationpath,
|
||||
folderId : uploadTargetFolder,
|
||||
namelist : namelist,
|
||||
maxSize : maxSize,
|
||||
maxFileIndex : maxFileIndex
|
||||
|
|
@ -1600,14 +1600,14 @@ function doupload(count) {
|
|||
$("#filecount").text("(" + count + "/" + fcount + ")");// 显示当前进度
|
||||
}
|
||||
$("#uploadstatus").prepend(
|
||||
"<p>" + fname + "<span id='uls_" + count
|
||||
"<p>" + html2Escape(fname) + "<span id='uls_" + count
|
||||
+ "'>[正在上传...]</span></p>");
|
||||
xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
|
||||
|
||||
var fd = new FormData();// 用于封装文件数据的对象
|
||||
fd.append("file", uploadfile);// 将文件对象添加到FormData对象中,字段名为uploadfile
|
||||
fd.append("fname", fname);
|
||||
fd.append("folderId", locationpath);
|
||||
fd.append("folderId", uploadTargetFolder);
|
||||
if (repeModelList != null && repeModelList[fname] != null) {
|
||||
if (repeModelList[fname] == 'skip') {
|
||||
$("#uls_" + count).text("[已完成]");
|
||||
|
|
@ -1968,7 +1968,8 @@ function createViewList() {
|
|||
for (var i = 0; i < pvl.pictureViewList.length; i++) {
|
||||
$(images).append(
|
||||
"<li><img src='" + pvl.pictureViewList[i].url + "' alt='"
|
||||
+ pvl.pictureViewList[i].fileName + "' /></li>");
|
||||
+ html2Escape(pvl.pictureViewList[i].fileName)
|
||||
+ "' /></li>");
|
||||
}
|
||||
viewer = $(images);
|
||||
viewer.viewer({
|
||||
|
|
@ -1995,11 +1996,13 @@ function createViewListByPage() {
|
|||
for (var i = 0; i < viewerPageSize
|
||||
&& i < (pvl.pictureViewList.length - (viewerPageIndex - 1)
|
||||
* viewerPageSize); i++) {
|
||||
$(images).append(
|
||||
"<li><img src='" + pvl.pictureViewList[startIndex + i].url
|
||||
$(images)
|
||||
.append(
|
||||
"<li><img src='"
|
||||
+ pvl.pictureViewList[startIndex + i].url
|
||||
+ "' alt='"
|
||||
+ pvl.pictureViewList[startIndex + i].fileName
|
||||
+ "' /></li>");
|
||||
+ html2Escape(pvl.pictureViewList[startIndex
|
||||
+ i].fileName) + "' /></li>");
|
||||
}
|
||||
if (viewerPageIndex < viewerTotal) {
|
||||
$(images).append("<li><img src='css/right.png' alt='下一页' /></li>");
|
||||
|
|
@ -3009,8 +3012,7 @@ function getDownloadURL() {
|
|||
+ window.location.host
|
||||
+ "/externalLinksController/downloadFileByKey/"
|
||||
+ encodeURIComponent(getDownloadFileName.replace(
|
||||
/\'/g, '').replace(/\r/g, "").replace(
|
||||
/\n/g, "")) + "?dkey=" + result;
|
||||
/\\/g, "_")) + "?dkey=" + result;
|
||||
// 显示链接内容
|
||||
$("#downloadHrefBox").html(
|
||||
"<a href='" + dlurl + "'>" + dlurl + "</a>");
|
||||
|
|
@ -3126,6 +3128,7 @@ function checkImportFolder() {
|
|||
maxFileIndex = i;
|
||||
}
|
||||
}
|
||||
uploadTargetFolder = locationpath;// 记录上传目标
|
||||
// 发送合法性检查请求
|
||||
$
|
||||
.ajax({
|
||||
|
|
@ -3135,7 +3138,7 @@ function checkImportFolder() {
|
|||
data : {
|
||||
folderName : importFolderName,
|
||||
maxSize : maxSize,
|
||||
folderId : locationpath
|
||||
folderId : uploadTargetFolder
|
||||
},
|
||||
success : function(result) {
|
||||
var resJson = eval("(" + result + ")");
|
||||
|
|
@ -3216,7 +3219,7 @@ function importAndCover() {
|
|||
url : 'homeController/deleteFolderByName.ajax',
|
||||
type : 'POST',
|
||||
data : {
|
||||
parentId : locationpath,
|
||||
parentId : uploadTargetFolder,
|
||||
folderName : importFolderName
|
||||
},
|
||||
dataType : 'text',
|
||||
|
|
@ -3242,7 +3245,7 @@ function importAndBoth() {
|
|||
url : 'homeController/createNewFolderByName.ajax',
|
||||
type : 'POST',
|
||||
data : {
|
||||
parentId : locationpath,
|
||||
parentId : uploadTargetFolder,
|
||||
folderName : importFolderName,
|
||||
folderConstraint : fc
|
||||
},
|
||||
|
|
@ -3275,16 +3278,15 @@ function iteratorImport(i, newFolderName) {
|
|||
if (fcount > 1) {
|
||||
$("#importcount").text("(" + (i + 1) + "/" + fcount + ")");// 显示当前进度
|
||||
}
|
||||
$("#importstatus")
|
||||
.prepend(
|
||||
"<p>" + fname + "<span id='ils_" + i
|
||||
$("#importstatus").prepend(
|
||||
"<p>" + html2Escape(fname) + "<span id='ils_" + i
|
||||
+ "'>[正在上传...]</span></p>");
|
||||
xhr = new XMLHttpRequest();// 这东西类似于servlet里面的request
|
||||
|
||||
var fd = new FormData();// 用于封装文件数据的对象
|
||||
|
||||
fd.append("file", uploadfile);// 将文件对象添加到FormData对象中,字段名为uploadfile
|
||||
fd.append("folderId", locationpath);
|
||||
fd.append("folderId", uploadTargetFolder);
|
||||
fd.append("folderConstraint", fc);
|
||||
fd.append("originalFileName", fname);
|
||||
if (!!newFolderName) {
|
||||
|
|
@ -3541,9 +3543,8 @@ function getFileChain(fileId, fileName) {
|
|||
+ "//"
|
||||
+ window.location.host
|
||||
+ "/externalLinksController/chain/"
|
||||
+ encodeURIComponent(fileName
|
||||
.replace(/\'/g, '').replace(/\r/g, "")
|
||||
.replace(/\n/g, "")) + "?ckey="
|
||||
+ encodeURIComponent(fileName.replace(/\\/g,
|
||||
"_")) + "?ckey="
|
||||
+ encodeURIComponent(result));
|
||||
$("#copyChainBtn").attr('disabled', false);
|
||||
break;
|
||||
|
|
@ -3816,3 +3817,20 @@ function updateTheFolderInfo() {
|
|||
"共包含 " + folderView.folderList.length + " 个文件夹, "
|
||||
+ folderView.fileList.length + " 个文件。");
|
||||
}
|
||||
|
||||
// 替换所有引号,将其进一步转义,主要用于传递带引号的文件名
|
||||
function replaceAllQuotationMarks(txt) {
|
||||
return txt.replace(/\\/g, "\\\\").replace(/\"/g, "\\\"");
|
||||
}
|
||||
|
||||
// 对所有可能进入html的字符串进行转义操作
|
||||
function html2Escape(sHtml) {
|
||||
return sHtml.replace(/[<>&\']/g, function(c) {
|
||||
return {
|
||||
'<' : '<',
|
||||
'>' : '>',
|
||||
'&' : '&',
|
||||
'\'' : '''
|
||||
}[c];
|
||||
});
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -21,9 +21,7 @@ $(function() {
|
|||
success : function(result) {
|
||||
if (result != "ERROR") {
|
||||
f = eval("(" + result + ")");
|
||||
$("#vname").text(
|
||||
f.fileName.replace('\'', ''').replace('<',
|
||||
'<').replace('>', '>'));
|
||||
$("#vname").text(f.fileName);
|
||||
$("#vcreator").text(f.fileCreator);
|
||||
$("#vcdate").text(f.fileCreationDate);
|
||||
$("#vsize").text(f.fileSize);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource/"+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer",{preload:"auto"});a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&window.clearInterval(pingInt)},error:function(){window.clearInterval(pingInt)}})}var tReq,tTimer,pingInt;$(function(){window.onresize=function(){showCloseBtn()},pingInt=setInterval("ping()",6e4);var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName.replace("'","'").replace("<","<").replace(">",">")),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
|
||||
function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource/"+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer",{preload:"auto"});a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&window.clearInterval(pingInt)},error:function(){window.clearInterval(pingInt)}})}var tReq,tTimer,pingInt;$(function(){window.onresize=function(){showCloseBtn()},pingInt=setInterval("ping()",6e4);var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
|
||||
Loading…
Reference in New Issue