{"size": 2990, "ext": "js", "max_stars_repo_path": "jquery.tg.layer.min.js", "max_stars_repo_name": "TinyAnn/alert", "max_stars_repo_stars_event_min_datetime": "2016-01-19T03:32:30.000Z", "max_stars_repo_stars_event_max_datetime": "2016-01-19T03:32:38.000Z", "max_issues_repo_path": "jquery.tg.layer.min.js", "max_issues_repo_name": "TinyAnn/layer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "jquery.tg.layer.min.js", "max_forks_repo_name": "TinyAnn/layer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2990.0, "max_line_length": 2990, "alphanum_fraction": 0.6394648829}
window.TGUI={},function(a,b){"use strict";var c=window.document,d=a(window),e={title:"信息",area:[580,"auto"],button:{showBtn:!0},shade:!1},f=0,g=["tgLayer","tg-ly-title"],h={version:"1.0",open:function(a){var b=new i(a);return b.layIndex},close:function(a){j.closeLayer(a)}},i=function(b){var c=this;c.layIndex=++f,c.settings=a.extend({},e,b),c.init()},j=i.prototype;j.init=function(){var a=this.settings||{},b=a.dragable||!1;this.createVessel(),this.initLayerBtns(),this.layerOffset(),b&&(this.$layerFragment.find(".tg-ly-title").css({cursor:"move"}),this.layerDragable())},j.createVessel=function(){var b=this,c=this.settings,d=['<div class="tgly-m-wraper" id="'+g[0]+this.layIndex+'">',c.shade?'<div class="tg-ly-mask">遮罩层</div>':"",'   <div class="tg-ly-main">','       <div class="tg-ly-title">','           <i class="tg-ly-close">x</i>','           <div class="tg-lyt-word" id="tglyWord">'+(c.title?c.title:"信息")+"</div>","       </div>",'       <div class="tg-ly-content" id="tglyContent">',c.content?c.content:"","       </div>",'       <div class="tg-ly-footer" id="tglyFooter">',"       </div>","   </div>","</div>"].join("");this.$layerFragment=a(d),this.$layerFragment.on("click",".tg-ly-close",function(){return b.closeLayer(),!1}),this.$layerFragment.on("mousedown",".tg-ly-close",function(){return!1})},j.initLayerBtns=function(){var h,i,b=this,c=this.settings,d=c.button||{},e=d&&d.btns,f=e&&e.length||0,g=0,j=this.$layerFragment;if(d.showBtn){if(f)for(;f>g;g++)h=e[g],i=a('<button class="'+h.className+' tg-ly-btn">'+h.valueStr+"</button>"),i.click(h.callback||function(){});else i=a('<button class="ok-btn tg-ly-btn">确定</button>'),i.click(function(){b.closeLayer()});j.find("#tglyFooter").append(i)}},j.layerOffset=function(){var h,i,j,k,b=this.settings,e=this.$layerFragment,f=d.height(),g=d.width(),l=[],m=b.position||[],n=e.find(".tg-ly-main");l[0]=parseInt(b.area[0])||580,l[1]=parseInt(b.area[1])||"auto",n.css({width:l[0],height:l[1]}),a(c.body).append(e),j=parseInt(n.outerWidth())||580,k=parseInt(n.outerHeight())||400,h=void 0!==m[0]?m[0]:(g-j)/2,i=void 0!==m[1]?m[1]:(f-k)/2,h=h>0?h:0,i=i>0?i:0,n.css({left:h,top:i})},j.closeLayer=function(b){var b=g[0]+(b||this.layIndex);a("#"+b).remove()},j.layerDragable=function(){function i(b){a(c).off("mousemove.layer",j).off("mouseup.layer",i),d.find(".tg-ly-main").css({left:b.clientX-e,top:b.clientY-f}),g.remove()}function j(a){g.css({left:a.clientX-e,top:a.clientY-f})}var g,d=this.$layerFragment,e=0,f=0,h=d.find(".tg-ly-main");d.on("mousedown",".tg-ly-title",function(b){var n,o,p,q,k,l,m,r,s;b.preventDefault(),b.stopPropagation(),k=d.find(".tg-ly-title"),l=k.offset(),m=h.offset(),r=l.top||0,s=l.left||0,e=b.clientX-s,f=b.clientY-r,n=h.outerHeight(),o=h.outerWidth(),p=m.left,q=m.top,g=a('<div id="layui-layer-moves" class="layui-layer-moves" style="height:'+n+"px;width:"+o+"px;left:"+p+"px;top:"+q+'px";></div>'),a(c.body).append(g),a(c).on("mousemove.layer",j).on("mouseup.layer",i)})},b.layer=h}(jQuery,TGUI);