UNPKG

yunkong2.admin

Version:

The adapter opens a webserver for the yunkong2 admin UI.

3 lines (2 loc) 5.73 kB
!function(n){var d,l=n(document),c=n("head"),h=null,f={},o=0,s="id",p="px",g="JColResizer",r="JCLRFlex",a=parseInt,u=Math,w=0<navigator.userAgent.indexOf("Trident/4.0");try{d=sessionStorage}catch(t){}c.append("<style type='text/css'> .JColResizer{table-layout:fixed;} .JColResizer > tbody > tr > td, .JColResizer > tbody > tr > th{overflow:hidden;padding-left:0!important; padding-right:0!important;} .JCLRgrips{ height:0px; position:relative;} .JCLRgrip{margin-left:-5px; position:absolute; z-index:5; } .JCLRgrip .JColResizer{position:absolute;background-color:red;filter:alpha(opacity=1);opacity:0;width:10px;height:100%;cursor: e-resize;top:0px} .JCLRLastGrip{position:absolute; width:1px; } .JCLRgripDrag{ border-left:1px dotted black;\t} .JCLRFlex{width:auto!important;} .JCLRgrip.JCLRdisabledGrip .JColResizer{cursor:default; display:none;}</style>");var v=function(t){var e=t.attr(s);(t=f[e])&&t.is("table")&&(t.removeClass(g+" "+r).gc.remove(),delete f[e])},m=function(o){var t=o.find(">thead>tr:first>th,>thead>tr:first>td");t.length||(t=o.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td")),t=t.filter(":visible"),o.cg=o.find("col"),o.ln=t.length,o.p&&d&&d[o.id]&&C(o,t),t.each(function(t){var e=n(this),i=-1!=o.dc.indexOf(t),r=n(o.gc.append('<div class="JCLRgrip"></div>')[0].lastChild);r.append(i?"":o.opt.gripInnerHtml).append('<div class="'+g+'"></div>'),t==o.ln-1&&(r.addClass("JCLRLastGrip"),o.f&&r.html("")),r.on("touchstart mousedown",L),i?r.addClass("JCLRdisabledGrip"):r.removeClass("JCLRdisabledGrip").on("touchstart mousedown",L),r.t=o,r.i=t,(r.c=e).w=e.width(),o.g.push(r),o.c.push(e),e.width(e.w).removeAttr("width"),r.data(g,{i:t,t:o.attr(s),last:t==o.ln-1})}),o.cg.removeAttr("width"),o.find("td, th").not(t).not("table th, table td").each(function(){n(this).removeAttr("width")}),o.f||o.removeAttr("width").addClass(r),b(o)},C=function(t,e){var i,r,o=0,s=0,a=[];if(e){if(t.cg.removeAttr("width"),t.opt.flush)return void(d[t.id]="");for(r=(i=d[t.id].split(";"))[t.ln+1],!t.f&&r&&(t.width(r*=1),t.opt.overflow&&(t.css("min-width",r+p),t.w=r));s<t.ln;s++)a.push(100*i[s]/i[t.ln]+"%"),e.eq(s).css("width",a[s]);for(s=0;s<t.ln;s++)t.cg.eq(s).css("width",a[s])}else{for(d[t.id]="";s<t.c.length;s++)i=t.c[s].width(),d[t.id]+=i+";",o+=i;d[t.id]+=o,t.f||(d[t.id]+=";"+t.width())}},b=function(t){t.gc.width(t.w);for(var e=0;e<t.ln;e++){var i=t.c[e];t.g[e].css({left:i.offset().left-t.offset().left+i.outerWidth(!1)+t.cs/2+p,height:t.opt.headerOnly?t.c[0].outerHeight(!1):t.outerHeight(!1)})}},R=function(t,e,i){var r=h.x-h.l,o=t.c[e],s=t.c[e+1],a=o.w+r,n=s.w-r;o.width(a+p),t.cg.eq(e).width(a+p),t.f?(s.width(n+p),t.cg.eq(e+1).width(n+p)):t.opt.overflow&&t.css("min-width",t.w+r),i&&(o.w=a,s.w=t.f?n:s.w)},x=function(t){var i=n.map(t.c,function(t){return t.width()});t.width(t.w=t.width()).removeClass(r),n.each(t.c,function(t,e){e.width(i[t]).w=i[t]}),t.addClass(r)},y=function(t){if(h){var e=h.t,i=t.originalEvent.touches,r=(i?i[0].pageX:t.pageX)-h.ox+h.l,o=e.opt.minWidth,s=h.i,a=1.5*e.cs+o+e.b,n=s==e.ln-1,d=s?e.g[s-1].position().left+e.cs+o:a,l=e.f?s==e.ln-1?e.w-a:e.g[s+1].position().left-e.cs-o:1/0;if(r=u.max(d,u.min(l,r)),h.x=r,h.css("left",r+p),n){var c=e.c[h.i];h.w=c.w+r-h.l}if(e.opt.liveDrag){n?(c.width(h.w),!e.f&&e.opt.overflow?e.css("min-width",e.w+r-h.l):e.w=e.width()):R(e,s),b(e);var f=e.opt.onDrag;f&&(t.currentTarget=e[0],f(t))}return!1}},J=function(t){if(l.off("touchend."+g+" mouseup."+g).off("touchmove."+g+" mousemove."+g),n("head :last-child").remove(),h){if(h.removeClass(h.t.opt.draggingClass),h.x-h.l!=0){var e=h.t,i=e.opt.onResize,r=h.i,o=r==e.ln-1,s=e.g[r].c;o?(s.width(h.w),s.w=h.w):R(e,r,!0),e.f||x(e),b(e),i&&(t.currentTarget=e[0],i(t)),e.p&&d&&C(e)}h=null}},L=function(t){var e=n(this).data(g),i=f[e.t],r=i.g[e.i],o=t.originalEvent.touches;if(r.ox=o?o[0].pageX:t.pageX,r.l=r.position().left,r.x=r.l,l.on("touchmove."+g+" mousemove."+g,y).on("touchend."+g+" mouseup."+g,J),c.append("<style type='text/css'>*{cursor:"+i.opt.dragCursor+"!important}</style>"),r.addClass(i.opt.draggingClass),h=r,i.c[e.i].l)for(var s,a=0;a<i.ln;a++)(s=i.c[a]).l=!1,s.w=s.width();return!1};n(window).on("resize."+g,function(){for(var t in f)if(f.hasOwnProperty(t)){var e,i=0;if((t=f[t]).removeClass(g),t.f){for(t.w=t.width(),e=0;e<t.ln;e++)i+=t.c[e].w;for(e=0;e<t.ln;e++)t.c[e].css("width",u.round(1e3*t.c[e].w/i)/10+"%").l=!0}else x(t),"flex"===t.mode&&t.p&&d&&C(t);b(t.addClass(g))}}),n.fn.extend({colResizable:function(t){switch((t=n.extend({resizeMode:"fit",draggingClass:"JCLRgripDrag",gripInnerHtml:"",liveDrag:!1,minWidth:15,headerOnly:!1,hoverCursor:"e-resize",dragCursor:"e-resize",postbackSafe:!1,flush:!1,marginLeft:null,marginRight:null,disable:!1,partialRefresh:!1,disabledColumns:[],onDrag:null,onResize:null},t)).fixed=!0,t.overflow=!1,t.resizeMode){case"flex":t.fixed=!1;break;case"overflow":t.fixed=!1,t.overflow=!0}return this.each(function(){!function(t,e){var i=n(t);if(i.opt=e,i.mode=e.resizeMode,i.dc=i.opt.disabledColumns,i.opt.disable)return v(i);var r=i.id=i.attr(s)||g+o++;i.p=i.opt.postbackSafe,!i.is("table")||f[r]&&!i.opt.partialRefresh||("e-resize"!==i.opt.hoverCursor&&c.append("<style type='text/css'>.JCLRgrip .JColResizer:hover{cursor:"+i.opt.hoverCursor+"!important}</style>"),i.addClass(g).attr(s,r).before('<div class="JCLRgrips"/>'),i.g=[],i.c=[],i.w=i.width(),i.gc=i.prev(),i.f=i.opt.fixed,e.marginLeft&&i.gc.css("marginLeft",e.marginLeft),e.marginRight&&i.gc.css("marginRight",e.marginRight),i.cs=a(w?t.cellSpacing||t.currentStyle.borderSpacing:i.css("border-spacing"))||2,i.b=a(w?t.border||t.currentStyle.borderLeftWidth:i.css("border-left-width"))||1,f[r]=i,m(i))}(this,t)})}})}(jQuery); //# sourceMappingURL=colResizable-1.6.min.js.map