Files
DzzOffice/static/dzzthumb/jquery.dzzthumb.js
小胡 5c6ade30ef V1.88.5更新内容:
核心功能修复与优化
1. 网盘空间管理优化:
    修复了删除网盘文件后,剩余空间未正确更新的问题,确保用户空间显示准确。
2. 机构用户导航体验提升:
    优化了机构用户在使用中的导航栏返回逻辑,提升了用户在不同页面间跳转时的流畅性和一致性。
用户体验与界面改进
1. 登录页面样式优化:
    解决了登录页面样式重复引用的问题,提升了页面加载速度和用户体验。
2. 移动端界面适配:
    优化了移动端界面的头部名称居中显示,增强了在不同移动设备上的视觉一致性。
3. 卡片显示效果调整:
    修改了卡片的显示效果,使信息展示更加美观和易于阅读。
性能与稳定性提升
1. JS代码压缩问题修复:
    修复了压缩JS代码过程中导致的报错问题,确保了应用的稳定性和性能。
插件与系统升级
1. jstree插件升级:
    升级了jstree插件版本,解决了在某些使用场景中无法选中节点的问题,提升了用户与树形结构交互的可靠性。
2. 应用市场UI优化:
    对应用市场界面进行了UI优化,提升了应用展示的美观度和易用性,使用户能够更方便地查找和安装所需的应用。
2024-07-22 17:45:59 +08:00

9 lines
7.4 KiB
JavaScript

/*
* @copyright Leyun internet Technology(Shanghai)Co.,Ltd
* @license http://www.dzzoffice.com/licenses/license.txt
* @package DzzOffice
* @link http://www.dzzoffice.com
* @author zyx(zyx@dzz.cc)
<img src="" data-original="" data-download="">
*/
!function(e){e.fn.dzzthumb=function(t){var i={root:e("body"),selector:"img[data-original]",container:e("body"),allowdownload:1},n=e.extend(i,t),o=0,r=0;$imgs=e(this),$imgs.off("click.dzzthumb").on("click.dzzthumb",function(){var e=this;return $imgs.each(function(t){this.src==e.src&&(r=t)}),p(),u(),!1});var a,d,s,l,p=function(){jQuery("html,body").addClass("dzzthumb_body"),document.getElementById("MsgContainer")?jQuery("#MsgContainer").empty().show():jQuery('<div id="MsgContainer" style=" background: url(dzz/images/b.gif); z-index:99999;width:100%;height:100%;margin:0;padding:0; right: 0px; bottom: 0px;position: fixed; top:0px; left: 0px;"></div>').appendTo(n.container);var t="";t+='<div id="preview_Container" style="position:absolute;width:100%;height:100%;top:0px;left:0px;bottom:0px;right:0px;display:none;z-index:10000">',t+='<div id="preview-box" class="preview-box">',t+='\t<div class="preview-handle" style="z-index: 118;"><b data_title="ESC'+__lang.logout+'" btn="close" class="pr-close">ESC'+__lang.logout+"</b></div>",t+='\t<div id="btn_hand" class="preview-panel" style="z-index: 117;">',t+='\t\t<ul id="contents-panel" style="right:55px;" class="contents-panel">',t+='\t\t\t<li btn="rotate" ><i class="pr-rotate"></i><b>'+__lang.rotation+"</b></li>",n.allowdownload&&(t+='\t\t\t<li class="hidden-xs" btn="download" ><i class="pr-download"></i><b>'+__lang.download+"</b></li>"),t+='\t\t\t<li btn="newwindow" ><i class="pr-newwindow"></i><b>'+__lang.look_artwork+"</b></li>",t+="\t\t</ul>",t+='\t\t<div id="file_name" class="previewer-filename hidden-xs"></div>',t+="\t</div>",t+='\t<div id="con" class="preview-contents">',t+='\t\t<div class="pr-btn-switch">',t+='\t\t\t<b data_title="'+__lang.keyboard+"“←”"+__lang.key_on+'" btn="prev" class="pr-btn-prev" style="z-index: 116;" >'+__lang.on_a+"</b>",t+='\t\t\t<b data_title="'+__lang.keyboard+"“→”"+__lang.key_under+'" btn="next" class="pr-btn-next" style="z-index: 116;">'+__lang.under_a+"</b>",t+="\t\t</div>",t+='\t\t<div id="pre_loading" style="display: none;" class="previewer-loading">'+__lang.loading_in+"</div>",t+='\t\t<div id="previewer-photo" class="previewer-photo" style="overflow: visible; z-index: 114; display: none; left: 0px; top: 40px;background-color: rgba(0,0,0,.5);"></div>',t+="\t</div>",t+="</div>",t+='<div id="prev-tips" class="prev-tips" >'+__lang.keyboard+"“←”"+__lang.key_on+"</div>",t+='<div id="next-tips" class="next-tips">'+__lang.keyboard+"“→”"+__lang.key_under+"</div>",t+='<div id="close-tips" class="esc-tips">ESC'+__lang.logout+"</div>",t+='<div id="popup-hint" style="z-index: 999999999; top: 50%; left:50%;margin-left:-86px; display:none;" class="popup-hint">',t+='\t<i rel="type" class="hint-icon hint-inf-m"></i>',t+='\t<em class="sl"><b></b></em>',t+='\t<span rel="con">'+__lang.has_last_picture1+"</span>",t+='\t<em class="sr"><b></b></em>',t+="</div>",t+="</div>",jQuery(t).appendTo("#MsgContainer"),jQuery("#preview_Container").css({height:"100%",width:"100%"}).show(),jQuery("#preview-box b").on("mouseenter",function(){var e=jQuery(this).attr("btn");jQuery("#"+e+"-tips").show()}),jQuery("#preview-box b").on("mouseleave",function(){var e=jQuery(this).attr("btn");jQuery("#"+e+"-tips").hide()}),jQuery(document).on("keyup.dzzthumb",function(e){var t;switch(""!=e.which?t=e.which:""!=e.charCode?t=e.charCode:""!=e.keyCode&&(t=e.keyCode),t){case 27:jQuery(document).off(".dzzthumb"),jQuery("#MsgContainer").empty().hide();break;case 37:0==r?(jQuery("#popup-hint").find("span").html(__lang.has_last_picture),jQuery("#popup-hint").show(),window.setTimeout(function(){jQuery("#popup-hint").hide()},3e3)):(r-=1,u());break;case 39:r==$imgs.length-1?(jQuery("#popup-hint").find("span").html(__lang.has_last_picture1),jQuery("#popup-hint").show(),window.setTimeout(function(){jQuery("#popup-hint").hide()},3e3)):(r+=1,u())}}),jQuery("#previewer-photo").on("click.dzzthumb",function(){jQuery(document).off(".dzzthumb"),jQuery("#MsgContainer").empty().hide(),jQuery("html,body").removeClass("dzzthumb_body")}),jQuery("#MsgContainer [btn],#previewer-photo").on("click.dzzthumb",function(){switch(jQuery(this).attr("btn")){case"close":jQuery(document).off(".dzzthumb"),jQuery("#MsgContainer").empty().hide(),jQuery("html,body").removeClass("dzzthumb_body");break;case"prev":0==r?(jQuery("#popup-hint").find("span").html(__lang.has_last_picture),jQuery("#popup-hint").show(),window.setTimeout(function(){jQuery("#popup-hint").hide()},3e3)):(r-=1,u());break;case"next":r==$imgs.length-1?(jQuery("#popup-hint").find("span").html(__lang.has_last_picture1),jQuery("#popup-hint").show(),window.setTimeout(function(){jQuery("#popup-hint").hide()},3e3)):(r+=1,u());break;case"download":var t=$imgs.get(r),i=e(t).data("download");document.getElementById("hideframe")||jQuery('<iframe id="hideframe" name="hideframe" src="about:blank" frameborder="0" marginheight="0" marginwidth="0" width="0" height="0" allowtransparency="true" style="display:none;z-index:-99999"></iframe>').appendTo("body"),jQuery("#hideframe").attr("src",i);break;case"newwindow":var n=e($imgs.get(r));if(n.data("original")){var a=n.data("original");a=a.replace(/&original=0/i,"")+"&original=1",window.open(a)}break;case"rotate":var d=jQuery("#previewer-photo img"),s=(o+=90)%360/90;d.css({transform:"rotate("+o+"deg)","-webkit-transform":"rotate("+o+"deg)","-moz-transform":"rotate("+o+"deg)","-o-transform":"rotate("+o+"deg)","-ms-transform":"rotate("+o+"deg)"}),BROWSER.ie&&BROWSER.ie<9&&d.css("filter","progid:DXImageTransform.Microsoft.BasicImage(Rotation="+s+"))")}return!1})},u=function(){var t=$imgs.get(r);jQuery("#file_name").html(t.title),jQuery("#popup-hint").hide(),jQuery("#previewer-photo").empty().hide(),jQuery("#pre_loading").show();var i=jQuery("#previewer-photo"),o=n.root.width(),a=n.root.height();c(e(t).data("original"),function(){var n=0,r=0,d=1*this.width,s=1*this.height,l=o-6,p=a-jQuery("#btn_hand").height()-6,u=d/s;l/p>u?p<s?(r=p,n=d/s*p):(n=d,r=s):l<d?(n=l,r=s/d*l):(n=d,r=s);var c=jQuery('<img height="'+r+'" width="'+n+'" style="cursor: move; top: '+(p-r)/2+"px; transform: rotate(0deg); left: "+(o-n)/2+'px;" src="'+e(t).data("original")+'" ws_property="1" onload="jQuery(\'#pre_loading\').fadeOut();jQuery(\'#previewer-photo\').show();" >').appendTo(i);c.get(0).onmousedown=function(e){try{dragMenu(c.get(0),e,1)}catch(e){}},c.on("click",function(){return!1}),jQuery.getScript("static/js/jquery.mousewheel.min.js",function(e){c.on("mousewheel",function(e,t,i,n){var o=100*t;return h(o*u,o),!1})})})},h=function(e,t){var i=jQuery("#previewer-photo>img"),n=i.position(),o=n.left,r=n.top,a=i.width(),d=i.height();o-=e/2,r-=t/2,a+=e,d+=t,i.css({left:o,top:r,width:a,height:d,"max-width":"none"})},c=(a=[],d=null,s=function(){for(var e=0;e<a.length;e++)a[e].end?a.splice(e--,1):a[e]();!a.length&&l()},l=function(){clearInterval(d),d=null},function(e,t,i,n){var o,r,l,p,u,h=new Image;if(h.src=e,h.complete)return t.call(h),void(i&&i.call(h));r=h.width,l=h.height,h.onerror=function(){n&&n.call(h),o.end=!0,h=h.onload=h.onerror=null},(o=function(){p=h.width,u=h.height,(p!==r||u!==l||p*u>1024)&&(t.call(h),o.end=!0)})(),h.onload=function(){!o.end&&o(),i&&i.call(h),h=h.onload=h.onerror=null},o.end||(a.push(o),null===d&&(d=setInterval(s,40)))})}}(jQuery);