v9.6.2017.0808   重构正向工程,基于映射表查找数据库字段类型到实体类型的映射
大石头 编写于 2017-08-08 21:38:06
X
/*!
	Colorbox 1.5.14
	license: MIT
	http://www.jacklmoore.com/colorbox
*/
!function(a,b,c){function d(c,d,e){var f=b.createElement(c);return d&&(f.id=_+d),e&&(f.style.cssText=e),a(f)}function e(){return c.innerHeight?c.innerHeight:a(c).height()}function f(b,c){c!==Object(c)&&(c={}),this.cache={},this.el=b,this.value=function(b){var d;return void 0===this.cache[b]&&(d=a(this.el).attr("data-cbox-"+b),void 0!==d?this.cache[b]=d:void 0!==c[b]?this.cache[b]=c[b]:void 0!==Z[b]&&(this.cache[b]=Z[b])),this.cache[b]},this.get=function(b){var c=this.value(b);return a.isFunction(c)?c.call(this.el,this):c}}function g(a){var b=A.length,c=(R+a)%b;return 0>c?b+c:c}function h(a,b){return Math.round((/%/.test(a)?("x"===b?B.width():e())/100:1)*parseInt(a,10))}function i(a,b){return a.get("photo")||a.get("photoRegex").test(b)}function j(a,b){return a.get("retinaUrl")&&c.devicePixelRatio>1?b.replace(a.get("photoRegex"),a.get("retinaSuffix")):b}function k(a){"contains"in t[0]&&!t[0].contains(a.target)&&a.target!==s[0]&&(a.stopPropagation(),t.focus())}function l(a){l.str!==a&&(t.add(s).removeClass(l.str).addClass(a),l.str=a)}function m(b){R=0,b&&b!==!1&&"nofollow"!==b?(A=a("."+ab).filter(function(){var c=a.data(this,$),d=new f(this,c);return d.get("rel")===b}),R=A.index(M.el),-1===R&&(A=A.add(M.el),R=A.length-1)):A=a(M.el)}function n(c){a(b).trigger(c),hb.triggerHandler(c)}function o(c){var e;if(!V){if(e=a(c).data($),M=new f(c,e),m(M.get("rel")),!T){T=U=!0,l(M.get("className")),t.css({visibility:"hidden",display:"block",opacity:""}),C=d(ib,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),v.css({width:"",height:""}).append(C),N=w.height()+z.height()+v.outerHeight(!0)-v.height(),O=x.width()+y.width()+v.outerWidth(!0)-v.width(),P=C.outerHeight(!0),Q=C.outerWidth(!0);var g=h(M.get("initialWidth"),"x"),i=h(M.get("initialHeight"),"y"),j=M.get("maxWidth"),o=M.get("maxHeight");M.w=(j!==!1?Math.min(g,h(j,"x")):g)-Q-O,M.h=(o!==!1?Math.min(i,h(o,"y")):i)-P-N,C.css({width:"",height:M.h}),X.position(),n(bb),M.get("onOpen"),L.add(F).hide(),t.focus(),M.get("trapFocus")&&b.addEventListener&&(b.addEventListener("focus",k,!0),hb.one(fb,function(){b.removeEventListener("focus",k,!0)})),M.get("returnFocus")&&hb.one(fb,function(){a(M.el).focus()})}var p=parseFloat(M.get("opacity"));s.css({opacity:p===p?p:"",cursor:M.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),M.get("closeButton")?K.html(M.get("close")).appendTo(v):K.appendTo("<div/>"),r()}}function p(){t||(Y=!1,B=a(c),t=d(ib).attr({id:$,"class":a.support.opacity===!1?_+"IE":"",role:"dialog",tabindex:"-1"}).hide(),s=d(ib,"Overlay").hide(),E=a([d(ib,"LoadingOverlay")[0],d(ib,"LoadingGraphic")[0]]),u=d(ib,"Wrapper"),v=d(ib,"Content").append(F=d(ib,"Title"),G=d(ib,"Current"),J=a('<button type="button"/>').attr({id:_+"Previous"}),I=a('<button type="button"/>').attr({id:_+"Next"}),H=d("button","Slideshow"),E),K=a('<button type="button"/>').attr({id:_+"Close"}),u.append(d(ib).append(d(ib,"TopLeft"),w=d(ib,"TopCenter"),d(ib,"TopRight")),d(ib,!1,"clear:left").append(x=d(ib,"MiddleLeft"),v,y=d(ib,"MiddleRight")),d(ib,!1,"clear:left").append(d(ib,"BottomLeft"),z=d(ib,"BottomCenter"),d(ib,"BottomRight"))).find("div div").css({"float":"left"}),D=d(ib,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),L=I.add(J).add(G).add(H)),b.body&&!t.parent().length&&a(b.body).append(s,t.append(u,D))}function q(){function c(a){a.which>1||a.shiftKey||a.altKey||a.metaKey||a.ctrlKey||(a.preventDefault(),o(this))}return t?(Y||(Y=!0,I.click(function(){X.next()}),J.click(function(){X.prev()}),K.click(function(){X.close()}),s.click(function(){M.get("overlayClose")&&X.close()}),a(b).bind("keydown."+_,function(a){var b=a.keyCode;T&&M.get("escKey")&&27===b&&(a.preventDefault(),X.close()),T&&M.get("arrowKey")&&A[1]&&!a.altKey&&(37===b?(a.preventDefault(),J.click()):39===b&&(a.preventDefault(),I.click()))}),a.isFunction(a.fn.on)?a(b).on("click."+_,"."+ab,c):a("."+ab).live("click."+_,c)),!0):!1}function r(){var b,e,f,g=X.prep,k=++jb;if(U=!0,S=!1,n(gb),n(cb),M.get("onLoad"),M.h=M.get("height")?h(M.get("height"),"y")-P-N:M.get("innerHeight")&&h(M.get("innerHeight"),"y"),M.w=M.get("width")?h(M.get("width"),"x")-Q-O:M.get("innerWidth")&&h(M.get("innerWidth"),"x"),M.mw=M.w,M.mh=M.h,M.get("maxWidth")&&(M.mw=h(M.get("maxWidth"),"x")-Q-O,M.mw=M.w&&M.w<M.mw?M.w:M.mw),M.get("maxHeight")&&(M.mh=h(M.get("maxHeight"),"y")-P-N,M.mh=M.h&&M.h<M.mh?M.h:M.mh),b=M.get("href"),W=setTimeout(function(){E.show()},100),M.get("inline")){var l=a(b);f=a("<div>").hide().insertBefore(l),hb.one(gb,function(){f.replaceWith(l)}),g(l)}else M.get("iframe")?g(" "):M.get("html")?g(M.get("html")):i(M,b)?(b=j(M,b),S=new Image,a(S).addClass(_+"Photo").bind("error",function(){g(d(ib,"Error").html(M.get("imgError")))}).one("load",function(){k===jb&&setTimeout(function(){var b;a.each(["alt","longdesc","aria-describedby"],function(b,c){var d=a(M.el).attr(c)||a(M.el).attr("data-"+c);d&&S.setAttribute(c,d)}),M.get("retinaImage")&&c.devicePixelRatio>1&&(S.height=S.height/c.devicePixelRatio,S.width=S.width/c.devicePixelRatio),M.get("scalePhotos")&&(e=function(){S.height-=S.height*b,S.width-=S.width*b},M.mw&&S.width>M.mw&&(b=(S.width-M.mw)/S.width,e()),M.mh&&S.height>M.mh&&(b=(S.height-M.mh)/S.height,e())),M.h&&(S.style.marginTop=Math.max(M.mh-S.height,0)/2+"px"),A[1]&&(M.get("loop")||A[R+1])&&(S.style.cursor="pointer",S.onclick=function(){X.next()}),S.style.width=S.width+"px",S.style.height=S.height+"px",g(S)},1)}),S.src=b):b&&D.load(b,M.get("data"),function(b,c){k===jb&&g("error"===c?d(ib,"Error").html(M.get("xhrError")):a(this).contents())})}var s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return a(this).attr("href")},title:function(){return this.title}},$="colorbox",_="cbox",ab=_+"Element",bb=_+"_open",cb=_+"_load",db=_+"_complete",eb=_+"_cleanup",fb=_+"_closed",gb=_+"_purge",hb=a("<a/>"),ib="div",jb=0,kb={},lb=function(){function a(){clearTimeout(g)}function b(){(M.get("loop")||A[R+1])&&(a(),g=setTimeout(X.next,M.get("slideshowSpeed")))}function c(){H.html(M.get("slideshowStop")).unbind(i).one(i,d),hb.bind(db,b).bind(cb,a),t.removeClass(h+"off").addClass(h+"on")}function d(){a(),hb.unbind(db,b).unbind(cb,a),H.html(M.get("slideshowStart")).unbind(i).one(i,function(){X.next(),c()}),t.removeClass(h+"on").addClass(h+"off")}function e(){f=!1,H.hide(),a(),hb.unbind(db,b).unbind(cb,a),t.removeClass(h+"off "+h+"on")}var f,g,h=_+"Slideshow_",i="click."+_;return function(){f?M.get("slideshow")||(hb.unbind(eb,e),e()):M.get("slideshow")&&A[1]&&(f=!0,hb.one(eb,e),M.get("slideshowAuto")?c():d(),H.show())}}();a[$]||(a(p),X=a.fn[$]=a[$]=function(b,c){var d,e=this;if(b=b||{},a.isFunction(e))e=a("<a/>"),b.open=!0;else if(!e[0])return e;return e[0]?(p(),q()&&(c&&(b.onComplete=c),e.each(function(){var c=a.data(this,$)||{};a.data(this,$,a.extend(c,b))}).addClass(ab),d=new f(e[0],b),d.get("open")&&o(e[0])),e):e},X.position=function(b,c){function d(){w[0].style.width=z[0].style.width=v[0].style.width=parseInt(t[0].style.width,10)-O+"px",v[0].style.height=x[0].style.height=y[0].style.height=parseInt(t[0].style.height,10)-N+"px"}var f,g,i,j=0,k=0,l=t.offset();if(B.unbind("resize."+_),t.css({top:-9e4,left:-9e4}),g=B.scrollTop(),i=B.scrollLeft(),M.get("fixed")?(l.top-=g,l.left-=i,t.css({position:"fixed"})):(j=g,k=i,t.css({position:"absolute"})),k+=M.get("right")!==!1?Math.max(B.width()-M.w-Q-O-h(M.get("right"),"x"),0):M.get("left")!==!1?h(M.get("left"),"x"):Math.round(Math.max(B.width()-M.w-Q-O,0)/2),j+=M.get("bottom")!==!1?Math.max(e()-M.h-P-N-h(M.get("bottom"),"y"),0):M.get("top")!==!1?h(M.get("top"),"y"):Math.round(Math.max(e()-M.h-P-N,0)/2),t.css({top:l.top,left:l.left,visibility:"visible"}),u[0].style.width=u[0].style.height="9999px",f={width:M.w+Q+O,height:M.h+P+N,top:j,left:k},b){var m=0;a.each(f,function(a){return f[a]!==kb[a]?void(m=b):void 0}),b=m}kb=f,b||t.css(f),t.dequeue().animate(f,{duration:b||0,complete:function(){d(),U=!1,u[0].style.width=M.w+Q+O+"px",u[0].style.height=M.h+P+N+"px",M.get("reposition")&&setTimeout(function(){B.bind("resize."+_,X.position)},1),a.isFunction(c)&&c()},step:d})},X.resize=function(a){var b;T&&(a=a||{},a.width&&(M.w=h(a.width,"x")-Q-O),a.innerWidth&&(M.w=h(a.innerWidth,"x")),C.css({width:M.w}),a.height&&(M.h=h(a.height,"y")-P-N),a.innerHeight&&(M.h=h(a.innerHeight,"y")),a.innerHeight||a.height||(b=C.scrollTop(),C.css({height:"auto"}),M.h=C.height()),C.css({height:M.h}),b&&C.scrollTop(b),X.position("none"===M.get("transition")?0:M.get("speed")))},X.prep=function(c){function e(){return M.w=M.w||C.width(),M.w=M.mw&&M.mw<M.w?M.mw:M.w,M.w}function h(){return M.h=M.h||C.height(),M.h=M.mh&&M.mh<M.h?M.mh:M.h,M.h}if(T){var k,m="none"===M.get("transition")?0:M.get("speed");C.remove(),C=d(ib,"LoadedContent").append(c),C.hide().appendTo(D.show()).css({width:e(),overflow:M.get("scrolling")?"auto":"hidden"}).css({height:h()}).prependTo(v),D.hide(),a(S).css({"float":"none"}),l(M.get("className")),k=function(){function c(){a.support.opacity===!1&&t[0].style.removeAttribute("filter")}var d,e,h=A.length;T&&(e=function(){clearTimeout(W),E.hide(),n(db),M.get("onComplete")},F.html(M.get("title")).show(),C.show(),h>1?("string"==typeof M.get("current")&&G.html(M.get("current").replace("{current}",R+1).replace("{total}",h)).show(),I[M.get("loop")||h-1>R?"show":"hide"]().html(M.get("next")),J[M.get("loop")||R?"show":"hide"]().html(M.get("previous")),lb(),M.get("preloading")&&a.each([g(-1),g(1)],function(){var c,d=A[this],e=new f(d,a.data(d,$)),g=e.get("href");g&&i(e,g)&&(g=j(e,g),c=b.createElement("img"),c.src=g)})):L.hide(),M.get("iframe")?(d=b.createElement("iframe"),"frameBorder"in d&&(d.frameBorder=0),"allowTransparency"in d&&(d.allowTransparency="true"),M.get("scrolling")||(d.scrolling="no"),a(d).attr({src:M.get("href"),name:(new Date).getTime(),"class":_+"Iframe",allowFullScreen:!0}).one("load",e).appendTo(C),hb.one(gb,function(){d.src="//about:blank"}),M.get("fastIframe")&&a(d).trigger("load")):e(),"fade"===M.get("transition")?t.fadeTo(m,1,c):c())},"fade"===M.get("transition")?t.fadeTo(m,0,function(){X.position(0,k)}):X.position(m,k)}},X.next=function(){!U&&A[1]&&(M.get("loop")||A[R+1])&&(R=g(1),o(A[R]))},X.prev=function(){!U&&A[1]&&(M.get("loop")||R)&&(R=g(-1),o(A[R]))},X.close=function(){T&&!V&&(V=!0,T=!1,n(eb),M.get("onCleanup"),B.unbind("."+_),s.fadeTo(M.get("fadeOut")||0,0),t.stop().fadeTo(M.get("fadeOut")||0,0,function(){t.hide(),s.hide(),n(gb),C.remove(),setTimeout(function(){V=!1,n(fb),M.get("onClosed")},1)}))},X.remove=function(){t&&(t.stop(),a[$].close(),t.stop(!1,!0).remove(),s.remove(),V=!1,t=null,a("."+ab).removeData($).removeClass(ab),a(b).unbind("click."+_).unbind("keydown."+_))},X.element=function(){return a(M.el)},X.settings=Z)}(jQuery,document,window);