mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-01-18 01:55:19 +08:00
核心功能修复与优化
1. 网盘空间管理优化:
修复了删除网盘文件后,剩余空间未正确更新的问题,确保用户空间显示准确。
2. 机构用户导航体验提升:
优化了机构用户在使用中的导航栏返回逻辑,提升了用户在不同页面间跳转时的流畅性和一致性。
用户体验与界面改进
1. 登录页面样式优化:
解决了登录页面样式重复引用的问题,提升了页面加载速度和用户体验。
2. 移动端界面适配:
优化了移动端界面的头部名称居中显示,增强了在不同移动设备上的视觉一致性。
3. 卡片显示效果调整:
修改了卡片的显示效果,使信息展示更加美观和易于阅读。
性能与稳定性提升
1. JS代码压缩问题修复:
修复了压缩JS代码过程中导致的报错问题,确保了应用的稳定性和性能。
2. 压缩css、js代码优化前端性能
对前端的CSS和JS代码进行了压缩处理,减少了文件体积,加快了加载速度,从而提升了前端性能。
插件与系统升级
1. jstree插件升级:
升级了jstree插件版本,解决了在某些使用场景中无法选中节点的问题,提升了用户与树形结构交互的可靠性。
2. 应用市场UI优化:
对应用市场界面进行了UI优化,提升了应用展示的美观度和易用性,使用户能够更方便地查找和安装所需的应用。
1 line
6.3 KiB
JavaScript
1 line
6.3 KiB
JavaScript
!function(){var t=document.createElement("canvas");function i(t,i,e){return t+i<e&&(t=e-i),t>0?0:t}t=!(!t.getContext||!t.getContext("2d"));var e="cropbox";function o(o){function s(t,i,e){this.width=null,this.height=null,this.img_width=null,this.img_height=null,this.img_left=0,this.img_top=0,this.minPercent=null,this.options=i,this.$image=t,this.$image.hide().prop("draggable",!1).addClass("cropImage").wrap('<div class="cropFrame" />'),this.$frame=this.$image.parent(),this.on_load=e||function(){},this.init()}s.prototype={init:function(){var t,i=this,s=o("<div/>",{class:"cropControls"}).append(o("<span>"+this.options.label+"</span>")).append(o("<button/>",{class:"cropZoomIn",type:"button"}).on("click",o.proxy(this.zoomIn,this))).append(o("<button/>",{class:"cropZoomOut",type:"button"}).on("click",o.proxy(this.zoomOut,this)));(this.$frame.append(this.options.controls||s),this.updateOptions(),!(BROWSER&&BROWSER.ie>8)&&BROWSER.ie||"function"!=typeof o.fn.hammer&&"undefined"==typeof Hammer)?(this.$image.on("dragstart",function(){return!1}),this.$image.on("mousedown."+e,function(t){var s={startX:i.img_left,startY:i.img_top};t.preventDefault(),o(document).on("mousemove."+e,function(e){s.dx=e.pageX-t.pageX,s.dy=e.pageY-t.pageY,i.drag.call(i,s,!0)}).on("mouseup."+e,function(){i.update.call(i),o(document).off("mouseup."+e),o(document).off("mousemove."+e)})})):("function"==typeof o.fn.hammer?this.$image.hammer():Hammer(this.$image.get(0))).on("touch",function(t){t.gesture.preventDefault()}).on("dragleft dragright dragup dragdown",function(e){t||(t={startX:i.img_left,startY:i.img_top}),t.dx=e.gesture.deltaX,t.dy=e.gesture.deltaY,e.gesture.preventDefault(),e.gesture.stopPropagation(),i.drag.call(i,t,!0)}).on("release",function(e){e.gesture.preventDefault(),t=null,i.update.call(i)}).on("doubletap",function(t){t.gesture.preventDefault(),i.zoomIn.call(i)}).on("pinchin",function(t){t.gesture.preventDefault(),i.zoomOut.call(i)}).on("pinchout",function(t){t.gesture.preventDefault(),i.zoomIn.call(i)});o.fn.mousewheel&&this.$image.on("mousewheel."+e,function(t){t.preventDefault(),t.deltaY<0?i.zoomIn.call(i):i.zoomOut.call(i)})},updateOptions:function(){var t=this;t.img_top=0,t.img_left=0,t.$image.css({width:"",left:t.img_left,top:t.img_top}),t.$frame.width(t.options.width).height(t.options.height),t.$frame.off("."+e),t.$frame.removeClass("hover"),"always"===t.options.showControls||"auto"===t.options.showControls&&("ontouchstart"in window||"onmsgesturechange"in window)?t.$frame.addClass("hover"):"never"!==t.options.showControls&&(t.$frame.on("mouseenter."+e,function(){t.$frame.addClass("hover")}),t.$frame.on("mouseleave."+e,function(){t.$frame.removeClass("hover")}));var i=new Image;i.onload=function(){t.width=i.width,t.height=i.height,i.src="",i.onload=null,t.percent=void 0,t.fit.call(t),t.options.result?t.setCrop.call(t,t.options.result):t.zoom.call(t,t.minPercent),t.$image.fadeIn("fast"),t.on_load.call(t)},i.src=t.$image.attr("src")},remove:function(){var t;"function"==typeof o.fn.hammer?t=this.$image.hammer():"undefined"!=typeof Hammer&&(t=Hammer(this.$image.get(0))),t&&t.off("mousedown dragleft dragright dragup dragdown release doubletap pinchin pinchout"),this.$frame.off("."+e),this.$image.off("."+e),this.$image.css({width:"",left:"",top:""}),this.$image.removeClass("cropImage"),this.$image.removeData(e),this.$image.insertAfter(this.$frame),this.$frame.removeClass("cropFrame"),this.$frame.removeAttr("style"),this.$frame.empty(),this.$frame.hide()},fit:function(){var t=this.options.width/this.width,i=this.options.height/this.height;this.minPercent=t>=i?t:i},setCrop:function(t){this.percent=Math.max(this.options.width/t.cropW,this.options.height/t.cropH),this.img_width=Math.ceil(this.width*this.percent),this.img_height=Math.ceil(this.height*this.percent),this.img_left=-Math.floor(t.cropX*this.percent),this.img_top=-Math.floor(t.cropY*this.percent),this.$image.css({width:this.img_width,left:this.img_left,top:this.img_top}),this.update()},zoom:function(t){var e=this.percent;if(this.percent=Math.max(this.minPercent,Math.min(this.options.maxZoom,t)),this.img_width=Math.ceil(this.width*this.percent),this.img_height=Math.ceil(this.height*this.percent),e){var o=this.percent/e;this.img_left=i((1-o)*this.options.width/2+o*this.img_left,this.img_width,this.options.width),this.img_top=i((1-o)*this.options.height/2+o*this.img_top,this.img_height,this.options.height)}else this.img_left=i((this.options.width-this.img_width)/2,this.img_width,this.options.width),this.img_top=i((this.options.height-this.img_height)/2,this.img_height,this.options.height);this.$image.css({width:this.img_width,left:this.img_left,top:this.img_top}),this.update()},zoomIn:function(){this.zoom(this.percent+(1-this.minPercent)/(this.options.zoom-1||1))},zoomOut:function(){this.zoom(this.percent-(1-this.minPercent)/(this.options.zoom-1||1))},drag:function(t,e){this.img_left=i(t.startX+t.dx,this.img_width,this.options.width),this.img_top=i(t.startY+t.dy,this.img_height,this.options.height),this.$image.css({left:this.img_left,top:this.img_top}),e&&this.update()},update:function(){this.result={cropX:-Math.ceil(this.img_left/this.percent),cropY:-Math.ceil(this.img_top/this.percent),cropW:Math.floor(this.options.width/this.percent),cropH:Math.floor(this.options.height/this.percent),stretch:this.minPercent>1},this.$image.trigger(e,[this.result,this])},getDataURL:function(){if(!t)return!1;var i=document.createElement("canvas"),e=i.getContext("2d");return i.width=this.options.width,i.height=this.options.height,e.drawImage(this.$image.get(0),this.result.cropX,this.result.cropY,this.result.cropW,this.result.cropH,0,0,this.options.width,this.options.height),i.toDataURL()},getBlob:function(){return function(t){for(var i=t.split(","),e=atob(i[1]),o=i[0].split(":")[1].split(";")[0],s=new ArrayBuffer(e.length),n=new Uint8Array(s),h=0;h<e.length;h++)n[h]=e.charCodeAt(h);return new Blob([s],{type:o})}(this.getDataURL())}},o.fn[e]=function(t,i){return this.each(function(){var n=o(this),h=n.data(e);if(h)t&&(o.extend(h.options,t),h.updateOptions());else{var a=o.extend({},o.fn[e].defaultOptions,t);n.data(e,new s(n,a,i))}})},o.fn[e].defaultOptions={width:200,height:200,zoom:10,maxZoom:1,controls:null,showControls:"auto",label:"Drag to crop"}}"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?o(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],o):o(window.jQuery||window.Zepto)}(); |