src/ZKEACMS.WebHost/wwwroot/js/EasyPlug/Easy.min.js

(完整代码) 13KB

/*! http://www.zkea.net/
 * Copyright (c) ZKEASOFT. All rights reserved.
 * http://www.zkea.net/licenses */
Array.prototype.ContainsValue=function(n){for(var i=-1,t=0;t<this.length;t++)this[t]==n&&(i=t);return i==-1?!1:!0};Array.prototype.ValueIndex=function(n){for(var i=-1,t=0;t<this.length;t++)if(this[t]==n){i=t;break}return i};String.prototype.replaceAll=function(n,t){var i=this;return i.split(n).join(t)};var Easy={};Easy.MaxZindex=1;Easy.Processor=function(n,t){clearTimeout(this.tid);typeof t!="number"&&(t=60);this.tid=setTimeout(function(){n&&n.call()},t)};Easy.WindowSize=function(){var n,t;return(window.attachEvent&&!window.opera)?(t=document.documentElement.clientHeight,n=document.documentElement.clientWidth):(t=window.innerHeight,n=window.innerWidth),{width:n,height:t}};Easy.Cookie=function(){function t(n,t,i){var r=new Date;r.setDate(r.getDate()+i);document.cookie=n+"="+escape(t)+(i==null?"":";expires="+r.toGMTString())+";path=/;"}function n(n){if(document.cookie.length>0){if(c_start=document.cookie.indexOf(n+"="),c_start!=-1)return c_start=c_start+n.length+1,c_end=document.cookie.indexOf(";",c_start),c_end==-1&&(c_end=document.cookie.length),unescape(document.cookie.substring(c_start,c_end))}else return""}function i(t){n(t)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT")}return{SetCookie:t,GetCookie:n,DeleteCookie:i}}();Easy.MousePosition=function(n){var t,i,r=n||window.event;return t=r.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i=r.clientY+document.body.scrollTop+document.documentElement.scrollTop,{X:t,Y:i}};Easy.OpacityBackGround=function(){function i(i,r){typeof i!="number"&&(i=1);var u;n===0?(u=$("<div class='OpacityBackGround OtherFixed'><\/div>"),$("body").append(u),u.fadeTo(0,0),u.css("z-index",i)):u=$("div.OpacityBackGround");u.fadeTo(300,t,function(){r&&r.call()});n++}function r(t){if(n--,n<0&&(n=0),n===0){var i=$(".OpacityBackGround");i.fadeTo(300,0,function(){n===0&&$(this).remove();t&&t.call()})}else t&&t.call()}function u(n){t=n}var t=.5,n=0;return{Show:i,Close:r,SetOpacity:u}}();Easy.Block=function(){Easy.Block.IsBlocked=!0;$(".easy-block").size()===0&&(Easy.OpacityBackGround.Show(),$(".OpacityBackGround").addClass("busy"),$("body").append("<div class='easy-block' />"))};Easy.UnBlock=function(){Easy.Block.IsBlocked&&(Easy.Block.IsBlocked=!1,$(".OpacityBackGround").removeClass("busy"),Easy.OpacityBackGround.Close(),$(".easy-block").remove())};Easy.ShowMessageBox=function(n,t,i,r,u){var f=$("<div class='MessageBox BoxShadow'><div class='MBContent'><div id='MessageBoxTitle' class='MBTitle'><\/div><div id='MessageBoxMsg' class='MBMSgText'><\/div><div class='MBFoot'><div id='MessageBoxActions' class='MBActions'><\/div><div style='clear: both'><\/div><\/div><\/div><\/div>"),e,o;f.find("#MessageBoxMsg").html(t);f.find("#MessageBoxTitle").html(n);f.css("position","fixed");typeof u!="number"&&(u=1);f.css("z-index",u);f.fadeTo(0,0);e=$("<input id='MessageBoxOkBtn' type='button' class='btn btn-primary' value='确定' />");f.find("#MessageBoxActions").append(e);e.click(function(){i&&i.call();Easy.OpacityBackGround.Close();f.animate({top:"45%",opacity:0},200,function(){$(this).remove()})});typeof r=="boolean"&&r&&(o=$("<input id='MessageBoxCancelBtn' type='button' class='btn btn-default' value='取消' />"),o.click(function(){Easy.OpacityBackGround.Close();f.animate({top:"45%",opacity:0},200,function(){$(this).remove()})}),f.find("#MessageBoxActions").append(o));Easy.OpacityBackGround.Show(u);$("body").append(f);f.animate({top:"50%",opacity:1},200,function(){f.find("#MessageBoxOkBtn").focus()})};Easy.MessageTip=function(){function t(t){var i=$(".MessageTip"),r;i.size()==0?(r=[],r.push("<div class='MessageTip'>"),r.push("<\/div>"),i=$(r.join("")),i.css("bottom",10),i.append("<p>"+t+"<\/p>"),$("body").append(i),i.css("right",0-i.width()),i.animate({right:-2},200,function(){n=setTimeout(function(){i.animate({right:0-i.width()},200,function(){$(this).remove()})},5e3)})):(i.append("<p>"+t+"<\/p>"),clearTimeout(n),n=setTimeout(function(){i.animate({right:0-i.width()},200,function(){$(this).remove()})},5e3))}var n=0;return{Show:t}}();Easy.ShowUrlWindow=function(n){var t=$("<div class='WeiWindow BoxShadow'><div class='TitleBar'><div class='Left TitleBarLeft'><\/div><div class='Mid TitleBarMid'><\/div><div class='Right TitleBarRight'><div class='CloseWindow'><\/div><\/div><\/div><div class='Content'><div class='Left ContentLeft'><\/div><div class='Mid ContentMid'><iframe src='' width='100%' height='100%' frameborder='0'><\/iframe><\/div><div class='Right ContentRight'><\/div><\/div><div class='Botoom'><div class='Left BottomLeft'><\/div><div class='Mid BottomMid'><\/div><div class='Right BottomRight'><\/div><\/div><\/div>"),i={url:"",title:"",callBack:function(){},isDialog:!0,animate:!1,onLoad:function(){}},r,u;i=$.extend(i,n);i.isDialog&&(n.zindex?Easy.OpacityBackGround.Show(n.zindex-1):Easy.OpacityBackGround.Show(++Easy.MaxZindex));t.appendTo("body");t.find(".Mid.TitleBarMid").DragElement(t,t.find(".CloseWindow"),t.find(".Right.ContentRight"),t.find(".Right.BottomRight"),t.find(".Mid.BottomMid"));n.zindex?t.css("z-index",n.zindex):t.css("z-index",++Easy.MaxZindex);t.find(".CloseWindow").click(function(){i.isDialog?Easy.OpacityBackGround.Close(i.callBack):i.callBack.call()});t.close=function(){t.find(".CloseWindow").click()};t.center=function(){t.animate({left:(Easy.WindowSize().width-t.outerWidth())/2,top:(Easy.WindowSize().height-t.outerHeight())/2},{speed:200})};$(window).resize(function(){Easy.Processor(t.center,300)});r=Easy.WindowSize();i.width&&i.width<r.width?t.width(i.width):t.width(r.width*.8);i.height&&i.height<r.height?t.height(i.height):t.height(r.height*.8);t.css("left",(r.width-t.outerWidth())/2);t.css("top",(r.height-t.outerHeight())/2);t.find(".Mid.TitleBarMid").html(i.title);u=!0;t.find("iframe").on("load",function(){i.title==""&&t.find(".Mid.TitleBarMid").html(this.contentWindow.document.title);var r=Number($(this.contentWindow.document).find("body").attr("width")),f=Number($(this.contentWindow.document).find("body").attr("height")),n={width:t.width(),left:t.css("left"),height:t.height(),top:t.css("top"),go:!1};r&&(n.width=r,n.go=!0,n.left=Number(t.css("left").replace("px",""))-(r-t.width())/2);f&&(n.height=f,n.go=!0,n.top=Number(t.css("top").replace("px",""))-(f-t.height())/2);n.go&&u&&t.animate(n,300);u=!1;i.onLoad.call(this.contentWindow,t)});return t.find("iframe").attr("src",i.url),t};Easy.jQueryEasing=function(){return{linear:"linear",swing:"swing",easeInQuad:"easeInQuad",easeOutQuad:"easeOutQuad",easeInOutQuad:"easeInOutQuad",easeInCubic:"easeInCubic",easeOutCubic:"easeOutCubic",easeInOutCubic:"easeInOutCubic",easeInQuart:"easeInQuart",easeOutQuart:"easeOutQuart",easeInOutQuart:"easeInOutQuart",easeInQuint:"easeInQuint",easeOutQuint:"easeOutQuint",easeInOutQuint:"easeInOutQuint",easeInSine:"easeInSine",easeOutSine:"easeOutSine",easeInOutSine:"easeInOutSine",easeInExpo:"easeInExpo",easeOutExpo:"easeOutExpo",easeInOutExpo:"easeInOutExpo",easeInCirc:"easeInCirc",easeOutCirc:"easeOutCirc",easeInOutCirc:"easeInOutCirc",easeInElastic:"easeInElastic",easeOutElastic:"easeOutElastic",easeInOutElastic:"easeInOutElastic",easeInBack:"easeInBack",easeOutBack:"easeOutBack",easeInOutBack:"easeInOutBack",easeInBounce:"easeInBounce",easeOutBounce:"easeOutBounce",easeInOutBounce:"easeInOutBounce"}}();jQuery.fn.extend({DragElement:function(n,t,i,r,u){function s(n){e=Easy.MousePosition(n).X;o=Easy.MousePosition(n).Y;var t=c(n.data.ac);return t.bind("mousemove",{ac:n.data.ac},h),t.mouseup(l),!1}function h(t){var u=Easy.MousePosition(t).X,s=Easy.MousePosition(t).Y,i=0,r=0;return t.data.ac=="move"?n instanceof jQuery?(i=parseInt(n.css("left")),r=parseInt(n.css("top")),n.css("left",i+u-e),n.css("top",r+s-o)):(i=parseInt(f.css("left")),r=parseInt(f.css("top")),f.css("left",i+u-e),f.css("top",r+s-o)):t.data.ac=="e-resize"?n instanceof jQuery?(i=n.width(),n.width(i+u-e)):(i=f.width(),f.width(i+u-e)):t.data.ac=="nw-resize"?n instanceof jQuery?(i=n.width(),r=n.height(),n.width(i+u-e),n.height(r+s-o)):(i=f.width(),r=f.height(),f.width(i+u-e),f.height(r+s-o)):t.data.ac=="n-resize"&&(n instanceof jQuery?(r=n.height(),n.height(r+s-o)):(r=f.height(),f.height(r+s-o))),e=u,o=s,!1}function c(n){typeof n!="string"&&(n="move");var t=$("<div style='cursor:"+n+";background-color:Black;z-index:100000'><\/div>");return t.addClass("OtherFixed"),t.fadeTo(0,0),$("body").append(t),t}function l(){return $(this).remove(),!1}var e=0,o=0,f=this;n instanceof jQuery?n.css("position")!="absolute"&&n.css("position")!="fixed"&&n.css("position")!="relative"&&n.css("position","relative"):f.css("position")!="absolute"&&f.css("position")!="fixed"&&f.css("position")!="relative"&&f.css("position","relative");f.css("cursor","move");f.bind("mousedown",{ac:"move"},s);t instanceof jQuery&&t.click(function(){n instanceof jQuery?n.remove():f.remove()});i instanceof jQuery&&(i.css("cursor","e-resize"),i.bind("mousedown",{ac:"e-resize"},s));r instanceof jQuery&&(r.css("cursor","nw-resize"),r.bind("mousedown",{ac:"nw-resize"},s));u instanceof jQuery&&(u.css("cursor","n-resize"),u.bind("mousedown",{ac:"n-resize"},s))}});jQuery.fn.extend({mousewheel:function(n,t,i){return this.hover(function(){jQuery.event.mousewheel.giveFocus(this,n,t,i)},function(){jQuery.event.mousewheel.removeFocus(this)})},mousewheeldown:function(n,t){return this.mousewheel(function(){},n,t)},mousewheelup:function(n,t){return this.mousewheel(n,function(){},t)},unmousewheel:function(){return this.each(function(){jQuery(this).unmouseover().unmouseout();jQuery.event.mousewheel.removeFocus(this)})},unmousewheeldown:jQuery.fn.unmousewheel,unmousewheelup:jQuery.fn.unmousewheel});jQuery.event.mousewheel={giveFocus:function(n,t,i,r){n._handleMousewheel&&jQuery(n).unmousewheel();r==window.undefined&&i&&i.constructor!=Function&&(r=i,i=null);n._handleMousewheel=function(u){u||(u=window.event);r&&(u.preventDefault?u.preventDefault():u.returnValue=!1);var f=0;u.wheelDelta?(f=u.wheelDelta/120,window.opera&&(f=-f)):u.detail&&(f=-u.detail/3);t&&(f>0||!i)?t.apply(n,[u,f]):i&&f<0&&i.apply(n,[u,f])};window.addEventListener&&window.addEventListener("DOMMouseScroll",n._handleMousewheel,!1);window.onmousewheel=document.onmousewheel=n._handleMousewheel},removeFocus:function(n){n._handleMousewheel&&(window.removeEventListener&&window.removeEventListener("DOMMouseScroll",n._handleMousewheel,!1),window.onmousewheel=document.onmousewheel=null,n._handleMousewheel=null)}};jQuery.fn.extend({AutoScroll:function(){function f(n){var t=Easy.MousePosition(n).Y-$(this).offset().top,r=Easy.MousePosition(n).X-$(this).offset().left;i>0&&$(this).scrollTop(i*t);u>0&&$(this).scrollLeft(u*r)}function e(){t=n.children().height()*n.children().size();i=(t-n.height())/n.height();r=n.children().width();u=(r-n.width())/n.width()}var n=$(this),t=100;n.children().each(function(){t+=$(this).outerHeight()});var i=(t-n.height())/n.height(),r=n.children().width(),u=(r-n.width())/n.width();return n.bind("mousemove",f),e},MarqueeH:function(n){function f(){r||(i==1?t.scrollLeft(t.scrollLeft()+n):t.scrollLeft(t.scrollLeft()-n));t.scrollLeft()>=u&&(i=2);t.scrollLeft()==0&&(i=1)}var t,u,i,r;if(typeof n!="number"&&(n=2),t=this,u=t.children().width()-t.width(),u<0)return!1;i=1;r=!1;setInterval(f,50);t.mouseenter(function(){r=!0});t.mouseleave(function(){r=!1})},MarqueeV:function(n){function f(){r||(i==1?t.scrollTop(t.scrollTop()+n):t.scrollTop(t.scrollTop()-n));t.scrollTop()>=u&&(i=2);t.scrollTop()==0&&(i=1)}var t,u,i,r;if(typeof n!="number"&&(n=2),t=this,u=t.children().height()-t.height(),u<0)return!1;i=1;r=!1;setInterval(f,50);t.mouseenter(function(){r=!0});t.mouseleave(function(){r=!1})}});jQuery.fn.extend({ImageCenter_Adapt:function(n,t,i){var r=1;this.each(function(){var s=r,u=$(this),f,o,e;u.css("display","block");u.hide();f=u.parent();f.css("display","block");typeof n=="number"&&f.width(n);typeof t=="number"&&f.height(t);f.css("background-color",i);o=f.width()/f.height();e=new Image;e.onload=function(){var n=e.width,t=e.height,i=n/t;o>i?(u.height(f.height()),u.css("width","auto"),u.css("margin","0px auto")):(u.width(f.width()),u.css("height","auto"),u.css("margin-top",(f.height()-u.height())/2));setTimeout(function(){u.fadeIn(300)},s*50)};e.src=u.attr("src");r++})},ImageCenter_Full:function(n,t){var i=1;this.each(function(){var o=i,r=$(this),u,e,f;r.hide();u=r.parent();u.css("overflow","hidden");typeof n=="number"&&u.width(n);typeof t=="number"&&u.height(t);e=u.width()/u.height();f=new Image;f.onload=function(){var n=f.width,t=f.height,i=n/t;e>i?(r.width(u.width()),r.css("height",""),r.css("margin-top",(u.height()-r.height())/2)):(r.height(u.height()),r.css("width",""),r.css("margin-left",(u.width()-r.width())/2));setTimeout(function(){r.fadeIn(300)},o*50)};f.src=r.attr("src");i++})}});$.fn.size=function(){return this.length};$.ajaxSetup({beforeSend:function(n){n.busyTimer=setTimeout(function(){Easy.Block()},3e3)},complete:function(n){clearTimeout(n.busyTimer);Easy.UnBlock()}});$(function(){if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))$(document).on("click",".pop-dialog",function(){return Easy.ShowUrlWindow({url:$(this).data("url")||$(this).attr("href"),title:$(this).data("title")||$(this).attr("title"),width:$(this).data("width")||800,height:$(this).data("height")||500,isDialog:!0}),!1})});

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。