Commit 2c22f158 by 周添尉

网盘

parent 2df712a3
......@@ -114,7 +114,7 @@ $.extend({
return -1;//不是ie浏览器
}
},
//获得浏览器的宽度
//获得浏览器滚动条的宽度
getScrollbarWidth:function(){
var oP = document.createElement('p'), styles = {
width: '100px',
......@@ -215,6 +215,153 @@ $.extend({
var date2=new Date(end_list[0],end_list[1],end_list[2]);
var date=(date2.getTime()-date1.getTime())/(1000*60*60*24);/*不用考虑闰年否*/
return date;
},
/**树的搜索功能
* @param zTreeId ztree对象的id,不需要#
* @param searchField 输入框选择器
* @param isHighLight 是否高亮,默认高亮,传入false禁用
* @param isExpand 是否展开,默认合拢,传入true展开
* @param searchBtn 绑定要点击的那个按钮的选择器
*/
fuzzySearch:function(zTreeId, searchField, isHighLight, isExpand,searchBtn){
var zTreeObj = $.fn.zTree.getZTreeObj(zTreeId);//get the ztree object by ztree id
if(!zTreeObj){
alter("fail to get ztree object");
}
var nameKey = zTreeObj.setting.data.key.name; //get the key of the node name
isHighLight = isHighLight===false?false:true;//default true, only use false to disable highlight
isExpand = isExpand?true:false; // not to expand in default
zTreeObj.setting.view.nameIsHTML = isHighLight; //allow use html in node name for highlight use
var metaChar = '[\\[\\]\\\\\^\\$\\.\\|\\?\\*\\+\\(\\)]'; //js meta characters
var rexMeta = new RegExp(metaChar, 'gi');//regular expression to match meta characters
// keywords filter function
function ztreeFilter(zTreeObj,_keywords,callBackFunc) {
if(!_keywords){
_keywords =''; //default blank for _keywords
}
// function to find the matching node
function filterFunc(node) {
if(node && node.oldname && node.oldname.length>0){
node[nameKey] = node.oldname; //recover oldname of the node if exist
}
zTreeObj.updateNode(node); //update node to for modifications take effect
if (_keywords.length == 0) {
//return true to show all nodes if the keyword is blank
zTreeObj.showNode(node);
//zTreeObj.expandNode(node,isExpand);
//如果没有输入值时,则显示所有的目录,并且折叠
zTreeObj.expandNode(node,false);
return true;
}
//transform node name and keywords to lowercase
if (node[nameKey] && node[nameKey].toLowerCase().indexOf(_keywords.toLowerCase())!=-1) {
if(isHighLight){ //highlight process
//a new variable 'newKeywords' created to store the keywords information
//keep the parameter '_keywords' as initial and it will be used in next node
//process the meta characters in _keywords thus the RegExp can be correctly used in str.replace
var newKeywords = _keywords.replace(rexMeta,function(matchStr){
//add escape character before meta characters
return '\\' + matchStr;
});
node.oldname = node[nameKey]; //store the old name
var rexGlobal = new RegExp(newKeywords, 'gi');//'g' for global,'i' for ignore case
//use replace(RegExp,replacement) since replace(/substr/g,replacement) cannot be used here
node[nameKey] = node.oldname.replace(rexGlobal, function(originalText){
//highlight the matching words in node name
var highLightText =
'<span style="margin-left:0;color: whitesmoke;background-color: darkred;">'
+ originalText
+'</span>';
return highLightText;
});
zTreeObj.updateNode(node); //update node for modifications take effect
}
zTreeObj.showNode(node);//show node with matching keywords
return true; //return true and show this node
}
zTreeObj.hideNode(node); // hide node that not matched
return false; //return false for node not matched
}
var nodesShow = zTreeObj.getNodesByFilter(filterFunc); //get all nodes that would be shown
processShowNodes(nodesShow, _keywords);//nodes should be reprocessed to show correctly
}
/**
* reprocess of nodes before showing
*/
function processShowNodes(nodesShow,_keywords){
if(nodesShow && nodesShow.length>0){
//process the ancient nodes if _keywords is not blank
if(_keywords.length>0){
$.each(nodesShow, function(n,obj){
var pathOfOne = obj.getPath();//get all the ancient nodes including current node
if(pathOfOne && pathOfOne.length>0){
//i < pathOfOne.length-1 process every node in path except self
for(var i=0;i<pathOfOne.length-1;i++){
zTreeObj.showNode(pathOfOne[i]); //show node
zTreeObj.expandNode(pathOfOne[i],true); //expand node
}
}
});
}else{ //show all nodes when _keywords is blank and expand the root nodes
var rootNodes = zTreeObj.getNodesByParam('level','0');//get all root nodes
$.each(rootNodes,function(n,obj){
zTreeObj.expandNode(obj,true); //expand all root nodes
});
}
}
}
//listen to change in input element
/*$(searchField).bind('input propertychange', function() {
var _keywords = $(this).val();
searchNodeLazy(_keywords); //call lazy load
});
var timeoutId = null;
// excute lazy load once after input change, the last pending task will be cancled
function searchNodeLazy(_keywords) {
if (timeoutId) {
//clear pending task
clearTimeout(timeoutId);
}
timeoutId = setTimeout(function() {
ztreeFilter(zTreeObj,_keywords); //lazy load ztreeFilter function
$(searchField).focus();//focus input field again after filtering
}, 500);
}*/
//绑定要点击的那个按钮
$(searchBtn).bind('click',function(){
var _keywords = $(searchField).val();
ztreeFilter(zTreeObj,_keywords);
})
//输入框的回车键操作
$(searchField).bind("keydown",function(e){
  // 兼容FF和IE和Opera
  var theEvent = e || window.event;
  var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
   if (code == 13) {
//回车执行查询
var _keywords = $(searchField).val();
ztreeFilter(zTreeObj,_keywords);
  }
});
},
/**去掉Html标签代码
* @param str 带有Html的字符串
*/
removeHtml:function(str){
str = str || "";//防止空指针
str = str.replace(/<(?!\/?p\b)[^>]+>|(<p)\b[^>]*(>)/ig, "$1$2");
str = str.replace(/\s+/g,"");
str = str.replace(new RegExp("&nbsp;","gm"),"");
return str;
}
//
}
......
......@@ -21,14 +21,14 @@
<div class="disk_container container-fluid">
<div class="row disk_search">
<div class="col-md-2">
<div class="col-md-6" onclick="location.href='disk'"><img src="${ctx}/custom/images/disk_home.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-6" onclick="disk_back_home()"><img src="${ctx}/custom/images/disk_home.png" wdith="14" height="14" /><span>|</span></div>
<%-- <div class="col-md-3" id="disk_backFolder_prev" onclick="disk_backFolder_prev(this)"><img src="${ctx}/custom/images/disk_last.png" wdith="14" height="14" /><span>|</span></div>
<div class="col-md-3" id="disk_backFolder_next" onclick="disk_backFolder_next(this)"><img src="${ctx}/custom/images/disk_next.png" wdith="14" height="14" /><span>|</span></div> --%>
<div id="disk_rubbish" class="col-md-6" onclick="disk_rubbish()"><img src="${ctx}/custom/images/disk_circle.png" wdith="14" height="14" /></div>
</div>
<div class="col-md-7">
<div class="disk_search_center">
<a href="disk"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a>
<a href="javascript:disk_back_home()"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a>
<!-- <a onclick="disk_backFolder(this)"><span class="glyphicon glyphicon-folder-close"></span><span>我的网盘</span><span class="glyphicon glyphicon-triangle-right"></span></a> -->
</div>
</div>
......@@ -44,7 +44,7 @@
<div class="col-md-12 disk_content_header">
<div class="col-md-11">
<a href="javascript:disk_uploadFolder()"><img src="${ctx}/custom/images/disk_upload.png" width="16" height="16" /><span>上传文件</span></a>
<a class="disk_document_default" href="javascript:disk_enjoyFolder()"><img src="${ctx}/custom/images/disk_gongxiang.png" width="16" height="16" /><span>共享文件</span></a>
<a class="disk_document_default" href="javascript:disk_enjoyFolder()"><img src="${ctx}/custom/images/disk_gongxiang.png" width="16" height="16" /><span>共享</span></a>
<a href="javascript:disk_addFolder()"><img src="${ctx}/custom/images/disk_add.png" width="16" height="16" /><span>新建文件夹</span></a>
<a class="disk_document_default" href="javascript:disk_deleteFolder()"><img src="${ctx}/custom/images/disk_delete.png" width="16" height="16" /><span>删除</span></a>
<a class="disk_document_default" href="javascript:disk_shareFolder()"><img src="${ctx}/custom/images/disk_share.png" width="16" height="16" /><span>分享</span></a>
......
......@@ -1514,7 +1514,7 @@ function init_index_color(color) {
palette : [
[ "rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)", /*"rgb(153, 153, 153)","rgb(183, 183, 183)",*/
"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ "rgb(255, 255, 255)" ],
"rgb(204, 204, 204)", "rgb(217, 217, 217)", /*"rgb(239, 239, 239)", "rgb(243, 243, 243)",*/ /*"rgb(255, 255, 255)"*/ ],
[ "rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)" ],
[ "rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
......
......@@ -121,6 +121,7 @@ function init_share_detail(infos){
if(infos.length==1){
if(!infos[0].fileImg){
$('.shareDetail_container_header>img').attr('src',ctx+'/photo/photo.jsp?ls_photo='+infos[0].FILE_SAVE_PATH+infos[0].FILE_SVAE_NAME);
$('.shareDetail_container_header>img').css('border-radius','5px');
}
else{
$('.shareDetail_container_header>img').attr('src',ctx+'/custom/images/'+infos[0].fileImg);
......@@ -200,7 +201,7 @@ function init_shareDetail_list(infos){
return '<img style="margin-right:10px;vertical-align:top;" src="'+ctx+'/custom/images/'+ row.fileImg +'" height="44" width="61"><span style="margin-top:12px;display:inline-block;">'+value+'</span>';
}
else{
return '<img style="margin-right:10px;vertical-align:top;" src="'+ctx+'/photo/photo.jsp?ls_photo='+row.FILE_SAVE_PATH+row.FILE_SVAE_NAME+'" height="44" width="61"><span style="margin-top:12px;display:inline-block;">'+value+'</span>';
return '<img style="border-radius:5px;margin-right:10px;vertical-align:top;" src="'+ctx+'/photo/photo.jsp?ls_photo='+row.FILE_SAVE_PATH+row.FILE_SVAE_NAME+'" height="44" width="61"><span style="margin-top:12px;display:inline-block;">'+value+'</span>';
}
}
}, {
......
......@@ -85,11 +85,6 @@
method="office">
<result name="office">/jfcas04/office.jsp</result>
</action>
<!-- 办事大厅的详情页 -->
<action name="officeDetail" class="com.jw.app.portlet.action.viewAction"
method="officeDetail">
<result name="officeDetail">/jfcas04/officeDetail.jsp</result>
</action>
<action name="userchoiceData_*" class="com.jw.app.userchoice.action.dataAction" method="{1}">
<result name="json" type="json">
......
......@@ -59,8 +59,4 @@ public class viewAction extends BasicAction {
return "office";
}
public String officeDetail() throws BusinessException {
return "officeDetail";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment