'},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b),b.image||(b.image=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data("image",b.image)),b},e.prototype.init=function(){this.bindEvents()},e.prototype.initGroups=function(){var b=this.$.data("groups");b||(b=a('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",b),b.each(function(b){a(this).attr("data-group-index",b)})),this.groups=b,this.groupIndex=parseInt(this.$.data("group-index"))},e.prototype.bindEvents=function(){var c=this.$,e=this,f=this.options;return f.image?void c.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(c){e.initGroups();var g=c.modal,h=e.groups,i=e.groupIndex;g.addClass("modal-lightbox").html(f.modalTeamplate.format(f)).toggleClass("lightbox-with-caption","string"==typeof f.caption).removeClass("lightbox-full").data("group-index",i);var j=g.find(".modal-dialog"),k=a(b).width();imgReady(f.image,function(){j.css({width:d.min(k,this.width)}),k
0),g.find(".next").toggleClass("show",h.filter('[data-group-index="'+(i+1)+'"]').length>0),g.find(".controller").click(function(){var e=a(this),f=g.data("group-index")+(e.hasClass("prev")?-1:1),i=h.filter('[data-group-index="'+f+'"]');if(i.length){var l=i.data("image"),m=i.data("caption");g.addClass("modal-loading").data("group-index",f).toggleClass("lightbox-with-caption","string"==typeof m).removeClass("lightbox-full"),g.find(".lightbox-img").attr("src",l),k=a(b).width(),imgReady(l,function(){j.css({width:d.min(k,this.width)}),k0),g.find(".next").toggleClass("show",h.filter('[data-group-index="'+(f+1)+'"]').length>0),!1})}}):!1},a.fn.lightbox=function(b){var c="group"+(new Date).getTime();return this.each(function(){var d=a(this),f="object"==typeof b&&b;"object"==typeof f&&f.group?d.attr("data-lightbox-group",f.group):d.data("group")?d.attr("data-lightbox-group",d.data("group")):d.attr("data-lightbox-group",c),d.data("group",d.data("lightbox-group"));var g=d.data("zui.lightbox");g||d.data("zui.lightbox",g=new e(this,f)),"string"==typeof b&&g[b]()})},a.fn.lightbox.Constructor=e,a(function(){a('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,document,Math),+function(a,b,c){"use strict";var d=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};d.DEFAULTS={container:"body",move:!0},d.prototype.getOptions=function(b){return b=a.extend({},d.DEFAULTS,this.$.data(),b)},d.prototype.init=function(){this.handleMouseEvents()},d.prototype.handleMouseEvents=function(){var b=this.$,d=this.options;b.mousedown(function(e){function f(c){o=!0;var e=c.pageX,f=c.pageY,g={left:e-m.x,top:f-m.y};b.removeClass("drag-ready").addClass("dragging"),d.move&&b.css(g),d.hasOwnProperty("drag")&&a.isFunction(d.drag)&&d.drag({event:c,element:b,startOffset:m,pos:g,offset:{x:e-l.x,y:f-l.y},smallOffset:{x:e-n.x,y:f-n.y}}),n.x=e,n.y=f,d.stopPropagation&&c.stopPropagation()}function g(e){if(a(c).unbind("mousemove",f).unbind("mouseup",g),!o)return void b.removeClass("drag-ready");var h={left:e.pageX-m.x,top:e.pageY-m.y};b.removeClass("drag-ready").removeClass("dragging"),d.move&&b.css(h),d.hasOwnProperty("finish")&&a.isFunction(d.finish)&&d.finish({event:e,element:b,pos:h,offset:{x:e.pageX-l.x,y:e.pageY-l.y},smallOffset:{x:e.pageX-n.x,y:e.pageY-n.y}}),e.preventDefault(),d.stopPropagation&&e.stopPropagation()}if(d.hasOwnProperty("before")&&a.isFunction(d.before)){var h=d.before({event:e,element:b});if(void 0!=h&&!h)return}var i=a(d.container),j=b.offset(),k=i.offset(),l={x:e.pageX,y:e.pageY},m={x:e.pageX-j.left+k.left,y:e.pageY-j.top+k.top},n=a.extend({},l),o=!1;b.addClass("drag-ready"),a(c).bind("mousemove",f).bind("mouseup",g),e.preventDefault(),d.stopPropagation&&e.stopPropagation()})},a.fn.draggable=function(b){return this.each(function(){var c=a(this),e=c.data("zui.draggable"),f="object"==typeof b&&b;e||c.data("zui.draggable",e=new d(this,f)),"string"==typeof b&&e[b]()})},a.fn.draggable.Constructor=d}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};e.DEFAULTS={container:"body",flex:!1,deviation:5,sensorOffsetX:0,sensorOffsetY:0,nested:!1},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b)},e.prototype.callEvent=function(b,c){return a.callEvent(this.options[b],c,this)},e.prototype.init=function(){this.handleMouseEvents()},e.prototype.handleMouseEvents=function(){var b=this.$,e=this,f=this.options;this.$triggerTarget=f.trigger?(a.isFunction(f.trigger)?f.trigger(b):b.find(f.trigger)).first():b,this.$triggerTarget.on("mousedown",function(g){function h(c){var g={left:c.pageX,top:c.pageY};if(!(d.abs(g.left-s.left)h&&g.top>i&&g.lefti?g.before(f):g.after(f);var j=d.children(e.selector);c(j),a.callEvent(e.order,{list:j,element:f})}},finish:function(b){e.dragCssClass&&b.element.removeClass(e.dragCssClass),a.callEvent(e.finish,{list:d.children(e.selector),element:b.element})}})},a.fn.sortable=function(c){return this.each(function(){var d=a(this),e=d.data("zui.sortable"),f="object"==typeof c&&c;e?"object"==typeof c&&e.reset():d.data("zui.sortable",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.sortable.Constructor=b}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";function e(b){var c=b.data("url");c&&(b.addClass("panel-loading").find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").addClass("icon-spin"),a.ajax({url:c,dataType:"html"}).done(function(a){b.find(".panel-body").html(a)}).fail(function(){b.addClass("panel-error")}).always(function(){b.removeClass("panel-loading"),b.find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").removeClass("icon-spin")}))}var f=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.draggable=this.$.hasClass("dashboard-draggable")||this.options.draggable,this.init()};f.DEFAULTS={height:360},f.prototype.getOptions=function(b){return b=a.extend({},f.DEFAULTS,this.$.data(),b)},f.prototype.handleRemoveEvent=function(){var b=this.options.afterPanelRemoved,c=this.options.panelRemovingTip;this.$.find(".remove-panel").click(function(){var d=a(this).closest(".panel"),e=d.data("name")||d.find(".panel-heading").text().replace("\n","").replace(/(^\s*)|(\s*$)/g,""),f=d.attr("data-id");(void 0==c||confirm(c.format(e)))&&(d.parent().remove(),b&&a.isFunction(b)&&b(f))})},f.prototype.handleRefreshEvent=function(){this.$.find(".refresh-panel").click(function(){var b=a(this).closest(".panel");e(b)})},f.prototype.handleDraggable=function(){var b=this.$,d=this.options.afterOrdered;this.$.addClass("dashboard-draggable"),this.$.find(".panel-actions").mousedown(function(a){a.preventDefault(),a.stopPropagation()}),this.$.find(".panel-heading").mousedown(function(e){function f(c){var d=k.data("mouseOffset");k.css({left:c.pageX-d.x,top:c.pageY-d.y}),j.find(".dragging-in").removeClass("dragging-in");var e=!1;j.children().each(function(){var d=a(this);if(d.hasClass("dragging-col-holder"))return e=!0,!0;var f=d.children(".panel"),g=f.offset(),h=f.width(),i=f.height(),k=g.left,l=g.top,m=c.pageX,o=c.pageY;if(m>k&&o>l&&k+h>m&&l+i>o){{j.find(".dragging-col")}return d.addClass("dragging-in"),e?n.insertAfter(d):n.insertBefore(d),b.addClass("dashboard-holding"),!1}}),c.preventDefault()}function g(e){var i=h.data("order");h.parent().insertAfter(n);var l=0,m={};j.children(":not(.dragging-col-holder)").each(function(){var b=a(this).children(".panel");b.data("order",++l),m[b.attr("id")]=l,b.parent().attr("data-order",l)}),i!=m[h.attr("id")]&&(j.data("orders",m),d&&a.isFunction(d)&&d(m)),k.remove(),b.removeClass("dashboard-holding"),b.find(".dragging-col").removeClass("dragging-col"),b.find(".panel-dragging").removeClass("panel-dragging"),j.find(".dragging-in").removeClass("dragging-in"),b.removeClass("dashboard-dragging"),a(c).unbind("mousemove",f).unbind("mouseup",g),e.preventDefault()}var h=a(this).closest(".panel"),i=h.parent(),j=h.closest(".row"),k=h.clone().addClass("panel-dragging-shadow"),l=h.offset(),m=b.offset(),n=j.find(".dragging-col-holder");n.length||(n=a("").addClass(j.children().attr("class")).removeClass("dragging-col").appendTo(j)),n.insertBefore(i).find(".panel").replaceWith(h.clone().addClass("panel-dragging panel-dragging-holder")),b.addClass("dashboard-dragging"),h.addClass("panel-dragging").parent().addClass("dragging-col"),k.css({left:l.left-m.left,top:l.top-m.top,width:h.width(),height:h.height()}).appendTo(b).data("mouseOffset",{x:e.pageX-l.left+m.left,y:e.pageY-l.top+m.top}),a(c).bind("mousemove",f).bind("mouseup",g),e.preventDefault()})},f.prototype.handlePanelPadding=function(){this.$.find(".panel-body > table, .panel-body > .list-group").closest(".panel-body").addClass("no-padding")},f.prototype.handlePanelHeight=function(){var b=this.options.height;this.$.find(".row").each(function(){var c=a(this),e=c.find(".panel"),f=c.data("height")||b;"number"!=typeof f&&(f=0,e.each(function(){f=d.max(f,a(this).innerHeight())})),e.each(function(){var b=a(this);b.find(".panel-body").css("height",f-b.find(".panel-heading").outerHeight()-2)})})},f.prototype.init=function(){this.handlePanelHeight(),this.handlePanelPadding(),this.handleRemoveEvent(),this.handleRefreshEvent(),this.draggable&&this.handleDraggable();var b=0;this.$.find(".panel").each(function(){var c=a(this);c.data("order",++b),c.attr("id")||c.attr("id","panel"+b),c.attr("data-id")||c.attr("data-id",b),e(c)})},a.fn.dashboard=function(b){return this.each(function(){var c=a(this),d=c.data("zui.dashboard"),e="object"==typeof b&&b;d||c.data("zui.dashboard",d=new f(this,e)),"string"==typeof b&&d[b]()})},a.fn.dashboard.Constructor=f}(jQuery,window,document,Math),+function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={auto:!1,foldicon:"icon-chevron-right"},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){var a=this.$.children(".nav");a.find(".nav").closest("li").addClass("nav-parent"),a.find(".nav > li.active").closest("li").addClass("active"),a.find(".nav-parent > a").append(' '),this.handleFold()},b.prototype.handleFold=function(){var b=this.options.auto,c=this.$;this.$.find(".nav-parent > a").click(function(d){b&&(c.find(".nav-parent.show").find(".nav").slideUp(function(){a(this).closest(".nav-parent").removeClass("show")}),c.find(".icon-rotate-90").removeClass("icon-rotate-90"));var e=a(this).closest(".nav-parent");return e.hasClass("show")?(e.find(".icon-rotate-90").removeClass("icon-rotate-90"),e.find(".nav").slideUp(function(){a(this).closest(".nav-parent").removeClass("show")})):(e.find(".nav-parent-fold-icon").addClass("icon-rotate-90"),e.find(".nav").slideDown(function(){a(this).closest(".nav-parent").addClass("show")})),d.preventDefault(),!1})},a.fn.menu=function(c){return this.each(function(){var d=a(this),e=d.data("zui.menu"),f="object"==typeof c&&c;e||d.data("zui.menu",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.menu.Constructor=b,a(function(){a('[data-toggle="menu"]').menu()})}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.isTable="TABLE"===this.$[0].tagName,this.isTable?this.id="datatable-"+(this.$.attr("id")||a.uuid()):(this.$datatable=this.$.addClass("datatable"),this.$.attr("id")?this.id=this.$.attr("id"):(this.id="datatable-"+a.uuid(),this.$.attr("id",this.id))),this.getOptions(c),this.load(),this.render()};e.DEFAULTS={fixedHeader:!0,checkable:!0,checkByClickRow:!0,checkSingleByClickRow:!0,sortable:!0,fixedLeftWidth:"30%",fixedRightWidth:"30%",flexWidth:"auto",flexHeadDrag:!0,rowHover:!0,colHover:!0,checkedClass:"active"},e.prototype.getOptions=function(b){var c=this.$,b=a.extend({},e.DEFAULTS,this.$.data(),b);b.tableClass||(b.tableClass="",c.hasClass("table-bordered")&&(b.tableClass+=" table-bordered"),(c.hasClass("table-hover")||b.rowHover)&&(b.tableClass+=" table-hover"),c.hasClass("table-striped")&&(b.tableClass+=" table-striped")),this.options=b},e.prototype.load=function(){var b=this.options.data,c=this.options,d=this.$;if(!b){if(!this.isTable)throw new Error("No data avaliable!");b={cols:[],rows:[]};var e,f,g,h,i=b.cols,j=b.rows;d.find("thead > tr:first").children("th").each(function(){e=a(this),i.push(a.extend({text:e.html(),flex:!1||e.hasClass("flex-col"),width:"auto",cssClass:e.attr("class"),css:e.attr("style"),type:"string",sort:!e.hasClass("sort-disabled")},e.data()))}),d.find("tbody > tr").each(function(){f=a(this),h=a.extend({data:[],checked:!1,cssClass:f.attr("class"),css:f.attr("style"),id:f.attr("id")},f.data()),f.children("td").each(function(){g=a(this),h.data.push(a.extend({cssClass:g.attr("class"),css:g.attr("style"),text:g.html()},g.data()))}),j.push(h)})}b.flexStart=-1,b.flexEnd=-1;var i=b.cols;b.colsLength=i.length;for(var k=0;k=0,b.fixedRight=b.flexEnd>=0&&b.flexEnd0,b.flexStart<0&&b.flexEnd<0&&(b.fixedLeft=!0,b.flexStart=i.length,b.flexEnd=i.length),b.flexArea&&(void 0==typeof c.flexWidth||"auto"==c.flexWidth)){for(var m=0,k=b.flexStart;k<=b.flexEnd;++k)i[k].flex=!0,m+=i[k].width;c.flexWidth=m}this.data=b},e.prototype.html=function(){var b=!a("#"+this.id).empty().length,c="",d=this.options,e=this.data,f=this.data.cols,g="",h="",i="",j=this.data.rows,k='',l='';b?c+='':d.sortable&&this.$datatable.addClass("sortable"),c+='
';for(var m,n,o,p=0;p
'+n.text+"",0==p&&d.checkable&&(m=' '+m),p=e.flexStart&&p<=e.flexEnd?i+=m:p>e.flexEnd&&(h+=m);e.fixedLeft&&(c+=l.format("fixed-left",g,"")),e.flexArea&&(c+=l.format("flexarea",i,'
')),e.fixedRight&&(c+=l.format("fixed-right",h,"")),c+=" ",c+='
';var q,r,p,s,t,u;g="",h="",i="";for(var v=0;v
',g+=q,h+=q,i+=q,p=0;p'+u.text+"",0==p&&d.checkable&&(s=' '+s),p=e.flexStart&&p<=e.flexEnd?i+=s:p>e.flexEnd&&(h+=s);g+="",h+="",i+=""}return e.fixedLeft&&(c+=k.format("fixed-left",g,"")),e.flexArea&&(c+=k.format("flexarea",i,'
')),e.fixedRight&&(c+=k.format("fixed-right",h,"")),c+=" ",b&&(c+="
"),c},e.prototype.render=function(){this.isTable?(this.$.attr("data-datatable-id",this.id).hide(),this.$.after(this.html()),this.$datatable=a("#"+this.id)):this.$.html(this.html()),this.$dataSpans=this.$datatable.children(".datatable-head, .datatable-rows").find(".datatable-span"),this.$rowsSpans=this.$datatable.children(".datatable-rows").children(".datatable-rows-span"),this.$headSpans=this.$datatable.children(".datatable-head").children(".datatable-head-span"),this.$cells=this.$dataSpans.find("td, th"),this.$dataCells=this.$cells.filter("td"),this.$headCells=this.$cells.filter("th"),this.$rows=this.$rowsSpans.find(".table > tbody > tr");var c=this.options,e=this,f=this.data,g=this.$cells,h=this.$dataCells,i=(this.$headCells,this.$datatable);if(c.rowHover){var j="hover";this.$rowsSpans.on("mouseenter","td",function(){h.filter("."+j).removeClass(j),e.$rows.filter("."+j).removeClass(j),e.$rows.filter('[data-index="'+a(this).addClass(j).closest("tr").data("index")+'"]').addClass(j)
-}).on("mouseleave","td",function(){h.filter("."+j).removeClass(j),e.$rows.filter("."+j).removeClass(j)})}if(c.colHover){var k="col-hover";this.$headSpans.on("mouseenter","th",function(){g.filter("."+k).removeClass(k),g.filter('[data-index="'+a(this).data("index")+'"]').addClass(k)}).on("mouseleave","th",function(){g.filter("."+k).removeClass(k)})}if(this.data.flexArea){var l,m,n,o,p,q,r,s=i.find(".scroll-slide"),t=i.find(".datatable-span.flexarea > .table"),u=i.find(".datatable-rows-span.flexarea > .table"),v=s.children(".bar"),w=e.id+"_scrollOffset",x=function(a,b){p=d.max(0,d.min(l-m,a)),o!==p&&(b||i.addClass("scrolling"),v.css("left",p),r=0-d.floor((n-l)*p/(l-m)),t.css("left",r),o=p,i.toggleClass("scrolled-in",p>2).toggleClass("scrolled-out",l-m-2>p),store.pageSet(w,p))},y=function(){l=s.width(),n=u.width(),m=d.floor(l*l/n),v.css("width",m),u.css("min-width",l),i.toggleClass("show-scroll-slide",n>l),q||l===m||(q=!0,x(store.pageGet(w,0),!0))};s.resize(y),u.resize(y),y();var z={move:!1,stopPropagation:!0,drag:function(a){x(v.position().left+a.smallOffset.x*(a.element.hasClass("bar")?1:-1))},finish:function(){i.removeClass("scrolling")}};v.draggable(z),c.flexHeadDrag&&i.find(".datatable-head-span.flexarea").draggable(z),s.mousedown(function(a){var b=a.pageX-s.offset().left;x(b-m/2)})}if(c.checkable){var A,B=e.id+"_"+E,C=c.checkedClass,D=function(){var b=e.$rowsSpans.first().find(".table > tbody > tr"),c=b.filter("."+C),d={checkedAll:b.length===c.length&&c.length>0,checks:c.map(function(){return A=a(this).data("id")}).toArray()};a.each(f.rows,function(b,c){c.checked=a.inArray(c.id,d.checks)>-1}),e.$headSpans.find(".check-all").toggleClass("checked",d.checkedAll),store.pageSet(B,d)};this.$rowsSpans.on("click",c.checkByClickRow?"tr":".check-row",function(){e.$rows.filter('[data-index="'+a(this).closest("tr").data("index")+'"]').toggleClass(C),D()}),this.$headSpans.find(".check-all").click(function(){e.$rows.toggleClass(C,a(this).toggleClass("checked").hasClass("checked")),D()});var E=store.pageGet(B);E&&(this.$headSpans.find(".check-all").toggleClass("checked",E.checkedAll),E.checkedAll?e.$rows.addClass(C):(e.$rows.removeClass(C),a.each(E.checks,function(a,b){e.$rows.filter('[data-id="'+b+'"]').addClass(C)})))}if(c.fixedHeader){var F,G,H,I=i.children(".datatable-head"),J=c.fixedHeaderOffset||a(".navbar.navbar-fixed-top").height()||0,K=function(){H=a(b).scrollTop(),F=i.offset().top,G=i.height(),i.toggleClass("head-fixed",H>F&&F+G>H),i.hasClass("head-fixed")?I.css({width:i.width(),top:J}):I.attr("style","")};a(b).scroll(K),K()}if(c.sortable){this.$headSpans.on("click","th:not(.sort-disabled, .check-btn)",function(){e.sortTable(a(this))})}this.refresh()},e.prototype.sortTable=function(b){var c=self.id+"_datatableSorter",d=store.pageGet(c);if(b||(b=d?this.$headCells.filter('[data-index="'+d.index+'"]').addClass("sort-"+d.type):this.$headCells.filter(".sort-up, .sort-down").first()),b.length){var e,f,g,h=this.data,i=h.cols,j=h.rows,k=this.$headCells;e=!b.hasClass("sort-up"),k.removeClass("sort-up sort-down"),b.addClass(e?"sort-up":"sort-down"),g=b.data("index"),e=b.hasClass("sort-up"),a.each(i,function(a,b){a==g||"up"!==b.sort&&"down"!==b.sort?a==g&&(b.sort=e?"up":"down",f=b.type):b.sort=!0});var l,m,n;j.sort(function(a,b){return l=a.data[g].text,m=b.data[g].text,"number"===f?(l=parseFloat(l),m=parseFloat(m)):"date"===f&&(l=Date.parse(l),m=Date.parse(m)),n=l>m?1:m>l?-1:0,e&&(n=-1*n),n});var o,p,q,r=this.$rows,s=[];a.each(j,function(b,c){o=r.filter('[data-index="'+c.index+'"]'),o.each(function(b){q=a(this),p=s[b],p?p.after(q):q.parent().prepend(q),s[b]=q})}),store.pageSet(c,{index:g,type:e?"up":"down"})}},e.prototype.refresh=function(){var a=this.$datatable,b=this.options,c=this.data.cols;a.find(".datatable-span.fixed-left").css("width",b.fixedLeftWidth),a.find(".datatable-span.fixed-right").css("width",b.fixedRightWidth);for(var d=this.$cells,e=0;e=2&&"confirm"===a?"btn-primary":"btn-default")}),a}function j(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function k(a,c,d){return b.extend(!0,{},a,j(c,d))}function l(a,b,c,d){var e={className:"bootbox-"+a,buttons:m.apply(null,b)};return n(k(e,d,c),b)}function m(){for(var a={},b=0,c=arguments.length;c>b;b++){var d=arguments[b],f=d.toLowerCase(),g=d.toUpperCase();a[f]={label:e(g)}}return a}function n(a,b){var d={};return h(b,function(a,b){d[b]=!0}),h(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var o={dialog:"",header:"",footer:"",closeButton:"× ",form:"",inputs:{text:" ",textarea:"",email:" ",select:" ",checkbox:"
",date:" ",time:" ",number:" ",password:" "}},p={locale:d(),backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0,container:"body"},q={};q.alert=function(){var a;if(a=l("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback():!0},q.dialog(a)},q.confirm=function(){var a;if(a=l("confirm",["confirm","cancel"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback(!1)},a.buttons.confirm.callback=function(){return a.callback(!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return q.dialog(a)},q.prompt=function(){var a,d,e,f,g,i,j;f=b(o.form),d={className:"bootbox-prompt",buttons:m("confirm","cancel"),value:"",inputType:"text"},a=n(k(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show;var l=["date","time","number"],p=document.createElement("input");if(p.setAttribute("type",a.inputType),l[a.inputType]&&(a.inputType=p.type),a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback(null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=g.val();break;case"checkbox":var d=g.find("input:checked");c=[],h(d,function(a,d){c.push(b(d).val())})}return a.callback(c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!o.inputs[a.inputType])throw new Error("invalid prompt type");switch(g=b(o.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":g.val(a.value);break;case"select":var r={};if(j=a.inputOptions||[],!j.length)throw new Error("prompt with select requires options");h(j,function(a,d){var e=g;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(r[d.group]||(r[d.group]=b(" ").attr("label",d.group)),e=r[d.group]),e.append(""+d.text+" ")}),h(r,function(a,b){g.append(b)}),g.val(a.value);break;case"checkbox":var s=b.isArray(a.value)?a.value:[a.value];if(j=a.inputOptions||[],!j.length)throw new Error("prompt with checkbox requires options");if(!j[0].value||!j[0].text)throw new Error("given options in wrong format");g=b("
"),h(j,function(c,d){var e=b(o.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),h(s,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),g.append(e)})}return a.placeholder&&g.attr("placeholder",a.placeholder),a.pattern&&g.attr("pattern",a.pattern),f.append(g),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=q.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){g.focus()}),i===!0&&e.modal("show"),e},q.dialog=function(a){a=i(a);var c=b(o.dialog),d=c.find(".modal-dialog"),e=c.find(".modal-body"),g=a.buttons,j="",k={onEscape:a.onEscape};if(h(g,function(a,b){j+=""+b.label+" ",k[a]=b.callback}),e.find(".bootbox-body").html(a.message),a.animate===!0&&c.addClass("fade"),a.className&&c.addClass(a.className),"large"===a.size&&d.addClass("modal-lg"),"small"===a.size&&d.addClass("modal-sm"),a.title&&e.before(o.header),a.closeButton){var l=b(o.closeButton);a.title?c.find(".modal-header").prepend(l):l.css("margin-top","-10px").prependTo(e)}return a.title&&c.find(".modal-title").html(a.title),j.length&&(e.after(o.footer),c.find(".modal-footer").html(j)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){k.onEscape&&f(a,c,k.onEscape)}),c.on("click",".modal-footer button",function(a){var d=b(this).data("bb-handler");f(a,c,k[d])}),c.on("click",".bootbox-close-button",function(a){f(a,c,k.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),b(a.container).append(c),c.modal({backdrop:a.backdrop,keyboard:!1,show:!1}),a.show&&c.modal("show"),c},q.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(p,a)},q.hideAll=function(){b(".bootbox").modal("hide")};var r={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},zh_cn:{OK:"好的",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"好的",CANCEL:"取消",CONFIRM:"確認"}};return q.init=function(c){return a(c||b)},q}),+function(a,b){"use strict";function c(){this.show=function(b,c,f,g,h){a(".messager").hide(),d++,c=c||"default",g=g||2e3,h=h||"body",f=f||"top";var i=a(e.format({message:b,type:c,placement:f,id:d})).appendTo(h);return i.find(".close-messager").click(function(){a(this).closest(".messager").fadeOut()}),("top"==f||"bottom"==f)&&i.css("left",(a(h).width()-i.width()-50)/2),i.fadeIn(),setTimeout(function(){a("#messager"+d).fadeOut(function(){a(this).remove()})},g),i},this.primary=function(a,b,c,d){return this.show(a,"primary",b,c,d)},this.success=function(a,b,c,d){return this.show(' '+a,"success",b,c,d)},this.info=function(a,b,c,d){return this.show(' '+a,"info",b,c,d)},this.warning=function(a,b,c,d){return this.show(' '+a,"warning",b,c,d)},this.danger=function(a,b,c,d){return this.show(' '+a,"danger",b,c,d)},this.important=function(a,b,c,d){return this.show(a,"important",b,c,d)},this.special=function(a,b,c,d){return this.show(a,"special",b,c,d)}}var d=0,e='',f=new c;b.messager=f}(jQuery,window,document,Math),+function(a){"use strict";if(!a.fn.droppable)throw new Error("droppable requires for boards");var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.getLang(),this.init()};b.DEFAULTS={lang:"zh-cn",langs:{"zh-cn":{appendToTheEnd:"移动到末尾"},"zh-tw":{appendToTheEnd:"移动到末尾"},en:{appendToTheEnd:"Move to the end."}}},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.getLang=function(){if(!this.options.lang){if("undefined"!=typeof config&&config.clientLang)this.options.lang=config.clientLang;else{var c=a("html").attr("lang");this.options.lang=c?c:"en"}this.options.lang=this.options.lang.replace(/-/,"_").toLowerCase()}this.lang=this.options.langs[this.options.lang]||this.options.langs[b.DEFAULTS.lang]},b.prototype.init=function(){var b=1,c=this.lang;this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function(){var d=a(this);d.attr("id")?d.attr("data-id",d.attr("id")):d.attr("data-id")||d.attr("data-id","board"+b++),d.hasClass("board")&&d.find(".board-list").append(' {appendToTheEnd}
'.format(c)).append('
'.format(c))}),this.bind()},b.prototype.bind=function(b){var c=this.$,d=this.options;"undefined"==typeof b&&(b=c.find('.board-item:not(".disable-drop, .board-item-shadow")')),b.droppable({target:'.board-item:not(".disable-drop, .board-item-shadow")',flex:!0,start:function(a){c.addClass("dragging").find(".board-item-shadow").height(a.element.outerHeight())},drag:function(a){if(c.find(".board.drop-in-empty").removeClass("drop-in-empty"),a.isIn){var b=a.target.closest(".board").addClass("drop-in"),d=b.find(".board-item-shadow"),e=a.target;c.addClass("drop-in").find(".board.drop-in").not(b).removeClass("drop-in"),d.insertBefore(e),b.toggleClass("drop-in-empty",e.hasClass("board-item-empty"))}},drop:function(b){b.isNew&&(d.hasOwnProperty("drop")&&a.isFunction(d.drop)&&d.drop(b),b.element.insertBefore(b.target))},finish:function(){c.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}})},a.fn.boards=function(c){return this.each(function(){var d=a(this),e=d.data("zui.boards"),f="object"==typeof c&&c;e||d.data("zui.boards",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.boards.Constructor=b,a(function(){a('[data-toggle="boards"]').boards()})}(jQuery,window,document,Math),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector||(this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a"),this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.initOptions(c),this.init()};e.DEFAULTS={coverColor:"#000",coverOpacity:.6,fixedRatio:!1,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},e.prototype.callEvent=function(b,c){return a.callEvent(this.options[b],c)},e.prototype.initOptions=function(b){this.options=a.extend({},e.DEFAULTS,this.$.data(),b),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},e.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},e.prototype.initDom=function(){this.$canvas=this.$.children(".canvas"),this.$img=this.$canvas.children("img"),this.$actions=this.$.children(".actions"),this.$btn=this.$.find(".img-cutter-submit"),this.$preview=this.$.find(".img-cutter-preview"),this.options.img=this.$img.attr("src"),this.$canvas.append('
'.format(this.options)),this.$cover=this.$canvas.children(".cover"),this.$controller=this.$canvas.children(".controller"),this.$cliper=this.$canvas.children(".cliper"),this.$chipImg=this.$cliper.children("img"),this.options.fixedRatio&&this.$.addClass("fixed-ratio")},e.prototype.initSize=function(){var a=this;"undefined"==typeof a.imgWidth&&imgReady(a.options.img,function(){a.imgWidth=this.width,a.imgHeight=this.height,a.callEvent("ready")});var b=setInterval(function(){"undefined"!=typeof a.imgWidth&&(clearInterval(b),a.width=d.min(a.imgWidth,a.$.width()),a.$canvas.css("width",this.width),a.$cliper.css("width",this.width),a.height=a.$canvas.height(),"undefined"==typeof a.left&&(a.left=d.floor((a.width-a.$controller.width())/2),a.top=d.floor((a.height-a.$controller.height())/2)),a.refreshSize())},0)},e.prototype.refreshSize=function(a){var b=this.options;this.clipWidth=d.max(b.minWidth,d.min(this.width,this.clipWidth)),this.clipHeight=d.max(b.minHeight,d.min(this.height,this.clipHeight)),b.fixedRatio&&(a&&"height"===a?(this.clipWidth=d.max(b.minWidth,d.min(this.width,this.clipHeight*b.defaultWidth/b.defaultHeight)),this.clipHeight=this.clipWidth*b.defaultHeight/b.defaultWidth):(this.clipHeight=d.max(b.minHeight,d.min(this.height,this.clipWidth*b.defaultHeight/b.defaultWidth)),this.clipWidth=this.clipHeight*b.defaultWidth/b.defaultHeight)),this.left=d.min(this.width-this.clipWidth,d.max(0,this.left)),this.top=d.min(this.height-this.clipHeight,d.max(0,this.top)),this.right=this.left+this.clipWidth,this.bottom=this.top+this.clipHeight,this.$controller.css({left:this.left,top:this.top,width:this.clipWidth,height:this.clipHeight}),this.$cliper.css("clip","rect({0}px {1}px {2}px {3}px".format(this.top,this.left+this.clipWidth,this.top+this.clipHeight,this.left)),this.callEvent("change",{top:this.top,left:this.left,bottom:this.bottom,right:this.right,width:this.clipWidth,height:this.clipHeight})},e.prototype.bindEvents=function(){var b=this,c=this.options;this.$.resize(a.proxy(this.initSize,this)),this.$btn.hover(function(){b.$.toggleClass("hover")}).click(function(){var d={originWidth:b.imgWidth,originHeight:b.imgHeight,width:b.width,height:b.height,left:b.left,top:b.top,right:b.right,bottom:b.bottom,scaled:b.imgWidth!=b.width||b.imgHeight!=b.height};if(b.callEvent("before",d)){var e=c.post||c.get||c.url||null;null!=e&&a.ajax({type:c.post?"POST":"GET",url:e,data:d}).done(function(a){b.callEvent("done",a)}).fail(function(a){b.callEvent("fail",a)}).always(function(a){b.callEvent("always",a)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(a){b.left+=a.smallOffset.x,b.top+=a.smallOffset.y,b.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(a){var e=a.element.data("direction"),f=a.smallOffset,g=!1;switch(e){case"left":case"top-left":case"bottom-left":b.left+=f.x,b.left=d.min(b.right-c.minWidth,d.max(0,b.left)),b.clipWidth=b.right-b.left;break;case"right":case"top-right":case"bottom-right":b.clipWidth+=f.x,b.clipWidth=d.min(b.width-b.left,d.max(c.minWidth,b.clipWidth))}switch(e){case"top":case"top-left":case"top-right":b.top+=f.y,b.top=d.min(b.bottom-c.minHeight,d.max(0,b.top)),b.clipHeight=b.bottom-b.top,g=!0;break;case"bottom":case"bottom-left":case"bottom-right":b.clipHeight+=f.y,b.clipHeight=d.min(b.height-b.top,d.max(c.minHeight,b.clipHeight)),g=!0}b.refreshSize(g)}})},a.fn.imgCutter=function(b){return this.each(function(){var c=a(this),d=c.data("zui.imgCutter"),f="object"==typeof b&&b;d||c.data("zui.imgCutter",d=new e(this,f)),"string"==typeof b&&d[b]()})},a.fn.imgCutter.Constructor=e,a(function(){a('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,window,document,Math),+function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={trigger:"toggle",selector:null,animate:"slide",easing:"linear",animateSpeed:"fast",events:"click",preventDefault:!0,cancelBubble:!0,target:null},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){this.bindEvents()},b.prototype.bindEvents=function(){var b=this.options;if(this.bindTrigger(b),a.isArray(b.triggers))for(var c in b.triggers)this.bindTrigger(a.extend({},b,b.triggers[c]));else if("string"==typeof b.triggers){var d=b.triggers.split("|");for(var c in d){var e=d[c].split(",",4);if(!(e.length<2)){var f={};e[0]&&(f.events=e[0]),e[1]&&(f.trigger=e[1]),e[2]&&(f.target=e[2]),e[3]&&(f.data=e[3]),this.bindTrigger(a.extend({},b,f))}}}},b.prototype.bindTrigger=function(b){var c=this;c.$.on(b.events,b.selector,function(d){var e=b.target&&"self"!=b.target?a(b.target):c.$,f={event:d,element:this,target:e,options:b};if(a.callEvent(b.before,f,c)){if(a.isFunction(b.trigger))a.callEvent(b.trigger,f,c);else{var g=b.trigger;switch("toggle"===g&&(g=e.hasClass("hide")?"show":"hide"),g){case"toggle":e.toggle();break;case"show":var h={duration:b.animateSpeed,easing:b.easing};e.removeClass("hide"),"slide"===b.animate?e.slideDown(h):"fade"===b.animate?e.fadeIn(h):e.show(h);break;case"hide":var h={duration:b.animateSpeed,easing:b.easing,complete:function(){e.addClass("hide")}};"slide"===b.animate?e.slideUp(h):"fade"===b.animate?e.fadeOut(h):e.hide(h);break;case"addClass":case"removeClass":case"toggleClass":e[g](b.data)}}a.callEvent(b.after,f,c),b.preventDefault&&d.preventDefault(),b.cancelBubble&&d.stopPropagation()}})},a.fn.autoTrigger=function(c){return this.each(function(){var d=a(this),e=d.data("zui.autoTrigger"),f="object"==typeof c&&c;e||d.data("zui.autoTrigger",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.autoTrigger.Constructor=b,a(function(){a('[data-toggle="autoTrigger"]').autoTrigger(),a('[data-toggle="toggle"]').autoTrigger(),a('[data-toggle="show"]').autoTrigger({trigger:"show"}),a('[data-toggle="hide"]').autoTrigger({trigger:"hide"}),a('[data-toggle="addClass"]').autoTrigger({trigger:"addClass"}),a('[data-toggle="removeClass"]').autoTrigger({trigger:"removeClass"}),a('[data-toggle="toggleClass"]').autoTrigger({trigger:"toggleClass"})})}(jQuery,window,document,Math);
\ No newline at end of file
+return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h
'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTarget();if(b)return b.find(".arrow").length<1&&a.addClass("no-arrow"),void a.html(b.html());var c=this.getTitle(),d=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](c),a.find(".popover-content")[this.options.html?"html":"text"](d),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.getTarget=function(){var b=this.$element,c=this.options,d=b.attr("data-target")||("function"==typeof c.target?c.target.call(b[0]):c.target);return d?"$next"==d?b.next(".popover"):a(d):!1},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"user strict";var b=function(a,b){this.init("pager",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");if(!a.fn.popover)throw new Error("Popover requires popover.js");b.prototype.init=function(b,c,d){this.type=b,this.$element=a(c),this.options=d,this.computeIndex(),this.$element.popover({container:"body",trigger:"manual",html:!0,template:''}).on("click."+this.type,!1,a.proxy(this.showPopover,this))},b.prototype.hidePopover=function(){var b=this.$element;"true"==b.attr("data-safe-close")?(b.popover("hide").attr("data-safe-close",!1),a(document).unbind("click",this.hidePopover)):b.attr("data-safe-close",!0)},b.prototype.showPopover=function(){var b=this.$element;b.attr("data-content")||b.attr("data-content",""),b.popover("show"),a(document).bind("click",a.proxy(this.hidePopover,this))},b.prototype.setContent=function(a){var b="";if(this.isRangeIndex)for(var c=this.indexStart;c<=this.indexEnd;c++)b+="
"+c+" ";else for(var c=this.indexs.length-1;c>=0;c--){var d=this.indexs[c];b+="
"+d+" "}return b},b.prototype.getUrl=function(){var a=this.$element,b=this.options;return a.attr("data-url")||a.attr("href")||("function"==typeof b.url?b.url.call(a[0]):b.url)||"?page=%"},b.prototype.computeIndex=function(){var a=this.$element,b=a.closest("li"),c=this.options,d=a.attr("data-index")||("function"==typeof c.index?c.index.call(a[0]):c.index)||b.prev("li").find("a").text()-0+1+"-"+(b.next("li").find("a").text()-1);if(d.indexOf("-")>0){this.isRangeIndex=!0;var e=d.split("-");this.indexStart=e[0]-0,this.indexEnd=e[1]-0,this.indexCount=this.indexEnd-this.indexStart}else this.indexs=d.split(","),this.indexCount=this.indexs.length};var c=a.fn.pager;a.fn.pager=function(c){return this.each(function(){var d=a(this),e=d.data("bs.pager"),f="object"==typeof c&&c;e||d.data("bs.pager",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.pager.Constructor=b,a.fn.pager.noConflict=function(){return a.fn.pager=c,this}}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery);var imgReady=function(){var a=[],b=null,c=function(){for(var b=0;b
1024)&&(e.call(m),h.end=!0)},h(),m.onload=function(){!h.end&&h(),f&&f.call(m),m=m.onload=m.onerror=null},void(h.end||(a.push(h),null===b&&(b=setInterval(c,40)))))}}();+function(a,b,c,d){"use strict";if(!a.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!imgReady)throw new Error("imgReady requires for lightbox");var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};e.DEFAULTS={modalTeamplate:'
'},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b),b.image||(b.image=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data("image",b.image)),b},e.prototype.init=function(){this.bindEvents()},e.prototype.initGroups=function(){var b=this.$.data("groups");b||(b=a('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",b),b.each(function(b){a(this).attr("data-group-index",b)})),this.groups=b,this.groupIndex=parseInt(this.$.data("group-index"))},e.prototype.bindEvents=function(){var c=this.$,e=this,f=this.options;return f.image?void c.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(c){e.initGroups();var g=c.modal,h=e.groups,i=e.groupIndex;g.addClass("modal-lightbox").html(f.modalTeamplate.format(f)).toggleClass("lightbox-with-caption","string"==typeof f.caption).removeClass("lightbox-full").data("group-index",i);var j=g.find(".modal-dialog"),k=a(b).width();imgReady(f.image,function(){j.css({width:d.min(k,this.width)}),k
0),g.find(".next").toggleClass("show",h.filter('[data-group-index="'+(i+1)+'"]').length>0),g.find(".controller").click(function(){var e=a(this),f=g.data("group-index")+(e.hasClass("prev")?-1:1),i=h.filter('[data-group-index="'+f+'"]');if(i.length){var l=i.data("image"),m=i.data("caption");g.addClass("modal-loading").data("group-index",f).toggleClass("lightbox-with-caption","string"==typeof m).removeClass("lightbox-full"),g.find(".lightbox-img").attr("src",l),k=a(b).width(),imgReady(l,function(){j.css({width:d.min(k,this.width)}),k0),g.find(".next").toggleClass("show",h.filter('[data-group-index="'+(f+1)+'"]').length>0),!1})}}):!1},a.fn.lightbox=function(b){var c="group"+(new Date).getTime();return this.each(function(){var d=a(this),f="object"==typeof b&&b;"object"==typeof f&&f.group?d.attr("data-lightbox-group",f.group):d.data("group")?d.attr("data-lightbox-group",d.data("group")):d.attr("data-lightbox-group",c),d.data("group",d.data("lightbox-group"));var g=d.data("zui.lightbox");g||d.data("zui.lightbox",g=new e(this,f)),"string"==typeof b&&g[b]()})},a.fn.lightbox.Constructor=e,a(function(){a('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,document,Math),+function(a,b,c){"use strict";var d=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};d.DEFAULTS={container:"body",move:!0},d.prototype.getOptions=function(b){return b=a.extend({},d.DEFAULTS,this.$.data(),b)},d.prototype.init=function(){this.handleMouseEvents()},d.prototype.handleMouseEvents=function(){var b=this.$,d=this.options;b.mousedown(function(e){function f(c){o=!0;var e=c.pageX,f=c.pageY,g={left:e-m.x,top:f-m.y};b.removeClass("drag-ready").addClass("dragging"),d.move&&b.css(g),d.hasOwnProperty("drag")&&a.isFunction(d.drag)&&d.drag({event:c,element:b,startOffset:m,pos:g,offset:{x:e-l.x,y:f-l.y},smallOffset:{x:e-n.x,y:f-n.y}}),n.x=e,n.y=f,d.stopPropagation&&c.stopPropagation()}function g(e){if(a(c).unbind("mousemove",f).unbind("mouseup",g),!o)return void b.removeClass("drag-ready");var h={left:e.pageX-m.x,top:e.pageY-m.y};b.removeClass("drag-ready").removeClass("dragging"),d.move&&b.css(h),d.hasOwnProperty("finish")&&a.isFunction(d.finish)&&d.finish({event:e,element:b,pos:h,offset:{x:e.pageX-l.x,y:e.pageY-l.y},smallOffset:{x:e.pageX-n.x,y:e.pageY-n.y}}),e.preventDefault(),d.stopPropagation&&e.stopPropagation()}if(d.hasOwnProperty("before")&&a.isFunction(d.before)){var h=d.before({event:e,element:b});if(void 0!=h&&!h)return}var i=a(d.container),j=b.offset(),k=i.offset(),l={x:e.pageX,y:e.pageY},m={x:e.pageX-j.left+k.left,y:e.pageY-j.top+k.top},n=a.extend({},l),o=!1;b.addClass("drag-ready"),a(c).bind("mousemove",f).bind("mouseup",g),e.preventDefault(),d.stopPropagation&&e.stopPropagation()})},a.fn.draggable=function(b){return this.each(function(){var c=a(this),e=c.data("zui.draggable"),f="object"==typeof b&&b;e||c.data("zui.draggable",e=new d(this,f)),"string"==typeof b&&e[b]()})},a.fn.draggable.Constructor=d}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};e.DEFAULTS={container:"body",flex:!1,deviation:5,sensorOffsetX:0,sensorOffsetY:0,nested:!1},e.prototype.getOptions=function(b){return b=a.extend({},e.DEFAULTS,this.$.data(),b)},e.prototype.callEvent=function(b,c){return a.callEvent(this.options[b],c,this)},e.prototype.init=function(){this.handleMouseEvents()},e.prototype.handleMouseEvents=function(){var b=this.$,e=this,f=this.options;this.$triggerTarget=f.trigger?(a.isFunction(f.trigger)?f.trigger(b):b.find(f.trigger)).first():b,this.$triggerTarget.on("mousedown",function(g){function h(c){var g={left:c.pageX,top:c.pageY};if(!(d.abs(g.left-s.left)h&&g.top>i&&g.lefti?g.before(f):g.after(f);var j=d.children(e.selector);c(j),a.callEvent(e.order,{list:j,element:f})}},finish:function(b){e.dragCssClass&&b.element.removeClass(e.dragCssClass),a.callEvent(e.finish,{list:d.children(e.selector),element:b.element})}})},a.fn.sortable=function(c){return this.each(function(){var d=a(this),e=d.data("zui.sortable"),f="object"==typeof c&&c;e?"object"==typeof c&&e.reset():d.data("zui.sortable",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.sortable.Constructor=b}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";function e(b){var c=b.data("url");c&&(b.addClass("panel-loading").find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").addClass("icon-spin"),a.ajax({url:c,dataType:"html"}).done(function(a){b.find(".panel-body").html(a)}).fail(function(){b.addClass("panel-error")}).always(function(){b.removeClass("panel-loading"),b.find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").removeClass("icon-spin")}))}var f=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.draggable=this.$.hasClass("dashboard-draggable")||this.options.draggable,this.init()};f.DEFAULTS={height:360},f.prototype.getOptions=function(b){return b=a.extend({},f.DEFAULTS,this.$.data(),b)},f.prototype.handleRemoveEvent=function(){var b=this.options.afterPanelRemoved,c=this.options.panelRemovingTip;this.$.find(".remove-panel").click(function(){var d=a(this).closest(".panel"),e=d.data("name")||d.find(".panel-heading").text().replace("\n","").replace(/(^\s*)|(\s*$)/g,""),f=d.attr("data-id");(void 0==c||confirm(c.format(e)))&&(d.parent().remove(),b&&a.isFunction(b)&&b(f))})},f.prototype.handleRefreshEvent=function(){this.$.find(".refresh-panel").click(function(){var b=a(this).closest(".panel");e(b)})},f.prototype.handleDraggable=function(){var b=this.$,d=this.options.afterOrdered;this.$.addClass("dashboard-draggable"),this.$.find(".panel-actions").mousedown(function(a){a.preventDefault(),a.stopPropagation()}),this.$.find(".panel-heading").mousedown(function(e){function f(c){var d=k.data("mouseOffset");k.css({left:c.pageX-d.x,top:c.pageY-d.y}),j.find(".dragging-in").removeClass("dragging-in");var e=!1;j.children().each(function(){var d=a(this);if(d.hasClass("dragging-col-holder"))return e=!0,!0;var f=d.children(".panel"),g=f.offset(),h=f.width(),i=f.height(),k=g.left,l=g.top,m=c.pageX,o=c.pageY;if(m>k&&o>l&&k+h>m&&l+i>o){{j.find(".dragging-col")}return d.addClass("dragging-in"),e?n.insertAfter(d):n.insertBefore(d),b.addClass("dashboard-holding"),!1}}),c.preventDefault()}function g(e){var i=h.data("order");h.parent().insertAfter(n);var l=0,m={};j.children(":not(.dragging-col-holder)").each(function(){var b=a(this).children(".panel");b.data("order",++l),m[b.attr("id")]=l,b.parent().attr("data-order",l)}),i!=m[h.attr("id")]&&(j.data("orders",m),d&&a.isFunction(d)&&d(m)),k.remove(),b.removeClass("dashboard-holding"),b.find(".dragging-col").removeClass("dragging-col"),b.find(".panel-dragging").removeClass("panel-dragging"),j.find(".dragging-in").removeClass("dragging-in"),b.removeClass("dashboard-dragging"),a(c).unbind("mousemove",f).unbind("mouseup",g),e.preventDefault()}var h=a(this).closest(".panel"),i=h.parent(),j=h.closest(".row"),k=h.clone().addClass("panel-dragging-shadow"),l=h.offset(),m=b.offset(),n=j.find(".dragging-col-holder");n.length||(n=a("").addClass(j.children().attr("class")).removeClass("dragging-col").appendTo(j)),n.insertBefore(i).find(".panel").replaceWith(h.clone().addClass("panel-dragging panel-dragging-holder")),b.addClass("dashboard-dragging"),h.addClass("panel-dragging").parent().addClass("dragging-col"),k.css({left:l.left-m.left,top:l.top-m.top,width:h.width(),height:h.height()}).appendTo(b).data("mouseOffset",{x:e.pageX-l.left+m.left,y:e.pageY-l.top+m.top}),a(c).bind("mousemove",f).bind("mouseup",g),e.preventDefault()})},f.prototype.handlePanelPadding=function(){this.$.find(".panel-body > table, .panel-body > .list-group").closest(".panel-body").addClass("no-padding")},f.prototype.handlePanelHeight=function(){var b=this.options.height;this.$.find(".row").each(function(){var c=a(this),e=c.find(".panel"),f=c.data("height")||b;"number"!=typeof f&&(f=0,e.each(function(){f=d.max(f,a(this).innerHeight())})),e.each(function(){var b=a(this);b.find(".panel-body").css("height",f-b.find(".panel-heading").outerHeight()-2)})})},f.prototype.init=function(){this.handlePanelHeight(),this.handlePanelPadding(),this.handleRemoveEvent(),this.handleRefreshEvent(),this.draggable&&this.handleDraggable();var b=0;this.$.find(".panel").each(function(){var c=a(this);c.data("order",++b),c.attr("id")||c.attr("id","panel"+b),c.attr("data-id")||c.attr("data-id",b),e(c)})},a.fn.dashboard=function(b){return this.each(function(){var c=a(this),d=c.data("zui.dashboard"),e="object"==typeof b&&b;d||c.data("zui.dashboard",d=new f(this,e)),"string"==typeof b&&d[b]()})},a.fn.dashboard.Constructor=f}(jQuery,window,document,Math),+function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={auto:!1,foldicon:"icon-chevron-right"},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){var a=this.$.children(".nav");a.find(".nav").closest("li").addClass("nav-parent"),a.find(".nav > li.active").closest("li").addClass("active"),a.find(".nav-parent > a").append(' '),this.handleFold()},b.prototype.handleFold=function(){var b=this.options.auto,c=this.$;this.$.find(".nav-parent > a").click(function(d){b&&(c.find(".nav-parent.show").find(".nav").slideUp(function(){a(this).closest(".nav-parent").removeClass("show")}),c.find(".icon-rotate-90").removeClass("icon-rotate-90"));var e=a(this).closest(".nav-parent");return e.hasClass("show")?(e.find(".icon-rotate-90").removeClass("icon-rotate-90"),e.find(".nav").slideUp(function(){a(this).closest(".nav-parent").removeClass("show")})):(e.find(".nav-parent-fold-icon").addClass("icon-rotate-90"),e.find(".nav").slideDown(function(){a(this).closest(".nav-parent").addClass("show")})),d.preventDefault(),!1})},a.fn.menu=function(c){return this.each(function(){var d=a(this),e=d.data("zui.menu"),f="object"==typeof c&&c;e||d.data("zui.menu",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.menu.Constructor=b,a(function(){a('[data-toggle="menu"]').menu()})}(jQuery,window,document,Math),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.isTable="TABLE"===this.$[0].tagName,this.isTable?this.id="datatable-"+(this.$.attr("id")||a.uuid()):(this.$datatable=this.$.addClass("datatable"),this.$.attr("id")?this.id=this.$.attr("id"):(this.id="datatable-"+a.uuid(),this.$.attr("id",this.id))),this.getOptions(c),this.load(),this.render()};e.DEFAULTS={fixedHeader:!0,checkable:!0,checkByClickRow:!0,checkSingleByClickRow:!0,sortable:!0,fixedLeftWidth:"30%",fixedRightWidth:"30%",flexWidth:"auto",flexHeadDrag:!0,rowHover:!0,colHover:!0,checkedClass:"active"},e.prototype.getOptions=function(b){var c=this.$,b=a.extend({},e.DEFAULTS,this.$.data(),b);b.tableClass||(b.tableClass="",c.hasClass("table-bordered")&&(b.tableClass+=" table-bordered"),(c.hasClass("table-hover")||b.rowHover)&&(b.tableClass+=" table-hover"),c.hasClass("table-striped")&&(b.tableClass+=" table-striped")),this.options=b},e.prototype.load=function(){var b=this.options.data,c=this.options,d=this.$;if(!b){if(!this.isTable)throw new Error("No data avaliable!");b={cols:[],rows:[]};var e,f,g,h,i=b.cols,j=b.rows;d.find("thead > tr:first").children("th").each(function(){e=a(this),i.push(a.extend({text:e.html(),flex:!1||e.hasClass("flex-col"),width:"auto",cssClass:e.attr("class"),css:e.attr("style"),type:"string",sort:!e.hasClass("sort-disabled")},e.data()))}),d.find("tbody > tr").each(function(){f=a(this),h=a.extend({data:[],checked:!1,cssClass:f.attr("class"),css:f.attr("style"),id:f.attr("id")},f.data()),f.children("td").each(function(){g=a(this),h.data.push(a.extend({cssClass:g.attr("class"),css:g.attr("style"),text:g.html()},g.data()))}),j.push(h)})}b.flexStart=-1,b.flexEnd=-1;var i=b.cols;b.colsLength=i.length;for(var k=0;k=0,b.fixedRight=b.flexEnd>=0&&b.flexEnd0,b.flexStart<0&&b.flexEnd<0&&(b.fixedLeft=!0,b.flexStart=i.length,b.flexEnd=i.length),b.flexArea&&(void 0==typeof c.flexWidth||"auto"==c.flexWidth)){for(var m=0,k=b.flexStart;k<=b.flexEnd;++k)i[k].flex=!0,m+=i[k].width;c.flexWidth=m}this.data=b},e.prototype.html=function(){var b=!a("#"+this.id).empty().length,c="",d=this.options,e=this.data,f=this.data.cols,g="",h="",i="",j=this.data.rows,k='',l='';b?c+='':d.sortable&&this.$datatable.addClass("sortable"),c+='
';for(var m,n,o,p=0;p
'+n.text+"",0==p&&d.checkable&&(m=' '+m),p=e.flexStart&&p<=e.flexEnd?i+=m:p>e.flexEnd&&(h+=m);e.fixedLeft&&(c+=l.format("fixed-left",g,"")),e.flexArea&&(c+=l.format("flexarea",i,'
')),e.fixedRight&&(c+=l.format("fixed-right",h,"")),c+=" ",c+='
';var q,r,p,s,t,u;g="",h="",i="";for(var v=0;v
',g+=q,h+=q,i+=q,p=0;p'+u.text+"",0==p&&d.checkable&&(s=' '+s),p=e.flexStart&&p<=e.flexEnd?i+=s:p>e.flexEnd&&(h+=s);g+="",h+="",i+=""}return e.fixedLeft&&(c+=k.format("fixed-left",g,"")),e.flexArea&&(c+=k.format("flexarea",i,'
')),e.fixedRight&&(c+=k.format("fixed-right",h,"")),c+=" ",b&&(c+="
"),c},e.prototype.render=function(){this.isTable?(this.$.attr("data-datatable-id",this.id).hide(),this.$.after(this.html()),this.$datatable=a("#"+this.id)):this.$.html(this.html()),this.$dataSpans=this.$datatable.children(".datatable-head, .datatable-rows").find(".datatable-span"),this.$rowsSpans=this.$datatable.children(".datatable-rows").children(".datatable-rows-span"),this.$headSpans=this.$datatable.children(".datatable-head").children(".datatable-head-span"),this.$cells=this.$dataSpans.find("td, th"),this.$dataCells=this.$cells.filter("td"),this.$headCells=this.$cells.filter("th"),this.$rows=this.$rowsSpans.find(".table > tbody > tr");var c=this.options,e=this,f=this.data,g=this.$cells,h=this.$dataCells,i=(this.$headCells,this.$datatable);if(c.rowHover){var j="hover";
+this.$rowsSpans.on("mouseenter","td",function(){h.filter("."+j).removeClass(j),e.$rows.filter("."+j).removeClass(j),e.$rows.filter('[data-index="'+a(this).addClass(j).closest("tr").data("index")+'"]').addClass(j)}).on("mouseleave","td",function(){h.filter("."+j).removeClass(j),e.$rows.filter("."+j).removeClass(j)})}if(c.colHover){var k="col-hover";this.$headSpans.on("mouseenter","th",function(){g.filter("."+k).removeClass(k),g.filter('[data-index="'+a(this).data("index")+'"]').addClass(k)}).on("mouseleave","th",function(){g.filter("."+k).removeClass(k)})}if(this.data.flexArea){var l,m,n,o,p,q,r,s=i.find(".scroll-slide"),t=i.find(".datatable-span.flexarea > .table"),u=i.find(".datatable-rows-span.flexarea > .table"),v=s.children(".bar"),w=e.id+"_scrollOffset",x=function(a,b){p=d.max(0,d.min(l-m,a)),o!==p&&(b||i.addClass("scrolling"),v.css("left",p),r=0-d.floor((n-l)*p/(l-m)),t.css("left",r),o=p,i.toggleClass("scrolled-in",p>2).toggleClass("scrolled-out",l-m-2>p),store.pageSet(w,p))},y=function(){l=s.width(),n=u.width(),m=d.floor(l*l/n),v.css("width",m),u.css("min-width",l),i.toggleClass("show-scroll-slide",n>l),q||l===m||(q=!0,x(store.pageGet(w,0),!0))};s.resize(y),u.resize(y),y();var z={move:!1,stopPropagation:!0,drag:function(a){x(v.position().left+a.smallOffset.x*(a.element.hasClass("bar")?1:-1))},finish:function(){i.removeClass("scrolling")}};v.draggable(z),c.flexHeadDrag&&i.find(".datatable-head-span.flexarea").draggable(z),s.mousedown(function(a){var b=a.pageX-s.offset().left;x(b-m/2)})}if(c.checkable){var A,B=e.id+"_"+E,C=c.checkedClass,D=function(){var b=e.$rowsSpans.first().find(".table > tbody > tr"),c=b.filter("."+C),d={checkedAll:b.length===c.length&&c.length>0,checks:c.map(function(){return A=a(this).data("id")}).toArray()};a.each(f.rows,function(b,c){c.checked=a.inArray(c.id,d.checks)>-1}),e.$headSpans.find(".check-all").toggleClass("checked",d.checkedAll),store.pageSet(B,d)};this.$rowsSpans.on("click",c.checkByClickRow?"tr":".check-row",function(){e.$rows.filter('[data-index="'+a(this).closest("tr").data("index")+'"]').toggleClass(C),D()}),this.$headSpans.find(".check-all").click(function(){e.$rows.toggleClass(C,a(this).toggleClass("checked").hasClass("checked")),D()});var E=store.pageGet(B);E&&(this.$headSpans.find(".check-all").toggleClass("checked",E.checkedAll),E.checkedAll?e.$rows.addClass(C):(e.$rows.removeClass(C),a.each(E.checks,function(a,b){e.$rows.filter('[data-id="'+b+'"]').addClass(C)})))}if(c.fixedHeader){var F,G,H,I=i.children(".datatable-head"),J=c.fixedHeaderOffset||a(".navbar.navbar-fixed-top").height()||0,K=function(){F=i.offset().top,H=a(b).scrollTop(),G=i.height(),i.toggleClass("head-fixed",H+J>F&&F+G>H+J),i.hasClass("head-fixed")?I.css({width:i.width(),top:J}):I.attr("style","")};a(b).scroll(K),K()}if(c.sortable){this.$headSpans.on("click","th:not(.sort-disabled, .check-btn)",function(){e.sortTable(a(this))})}this.refresh()},e.prototype.sortTable=function(b){var c=self.id+"_datatableSorter",d=store.pageGet(c);if(b||(b=d?this.$headCells.filter('[data-index="'+d.index+'"]').addClass("sort-"+d.type):this.$headCells.filter(".sort-up, .sort-down").first()),b.length){var e,f,g,h=this.data,i=h.cols,j=h.rows,k=this.$headCells;e=!b.hasClass("sort-up"),k.removeClass("sort-up sort-down"),b.addClass(e?"sort-up":"sort-down"),g=b.data("index"),e=b.hasClass("sort-up"),a.each(i,function(a,b){a==g||"up"!==b.sort&&"down"!==b.sort?a==g&&(b.sort=e?"up":"down",f=b.type):b.sort=!0});var l,m,n,o=this.$dataCells.filter('[data-index="'+g+'"]');j.sort(function(a,b){return a=a.data[g],b=b.data[g],l=o.filter('[data-row="'+a.row+'"]').text(),m=o.filter('[data-row="'+b.row+'"]').text(),"number"===f?(l=parseFloat(l),m=parseFloat(m)):"date"===f&&(l=Date.parse(l),m=Date.parse(m)),n=l>m?1:m>l?-1:0,e&&(n=-1*n),n});var p,q,r,s=this.$rows,t=[];a.each(j,function(b,c){p=s.filter('[data-index="'+c.index+'"]'),p.each(function(b){r=a(this),q=t[b],q?q.after(r):r.parent().prepend(r),t[b]=r})}),store.pageSet(c,{index:g,type:e?"up":"down"})}},e.prototype.refreshSize=function(){var a=this.$datatable,b=this.options,c=this.data.cols;a.find(".datatable-span.fixed-left").css("width",b.fixedLeftWidth),a.find(".datatable-span.fixed-right").css("width",b.fixedRightWidth);for(var d=this.$cells,e=0;e=2&&"confirm"===a?"btn-primary":"btn-default")}),a}function j(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function k(a,c,d){return b.extend(!0,{},a,j(c,d))}function l(a,b,c,d){var e={className:"bootbox-"+a,buttons:m.apply(null,b)};return n(k(e,d,c),b)}function m(){for(var a={},b=0,c=arguments.length;c>b;b++){var d=arguments[b],f=d.toLowerCase(),g=d.toUpperCase();a[f]={label:e(g)}}return a}function n(a,b){var d={};return h(b,function(a,b){d[b]=!0}),h(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var o={dialog:"",header:"",footer:"",closeButton:"× ",form:"",inputs:{text:" ",textarea:"",email:" ",select:" ",checkbox:"
",date:" ",time:" ",number:" ",password:" "}},p={locale:d(),backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0,container:"body"},q={};q.alert=function(){var a;if(a=l("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback():!0},q.dialog(a)},q.confirm=function(){var a;if(a=l("confirm",["confirm","cancel"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback(!1)},a.buttons.confirm.callback=function(){return a.callback(!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return q.dialog(a)},q.prompt=function(){var a,d,e,f,g,i,j;f=b(o.form),d={className:"bootbox-prompt",buttons:m("confirm","cancel"),value:"",inputType:"text"},a=n(k(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show;var l=["date","time","number"],p=document.createElement("input");if(p.setAttribute("type",a.inputType),l[a.inputType]&&(a.inputType=p.type),a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback(null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=g.val();break;case"checkbox":var d=g.find("input:checked");c=[],h(d,function(a,d){c.push(b(d).val())})}return a.callback(c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!o.inputs[a.inputType])throw new Error("invalid prompt type");switch(g=b(o.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":g.val(a.value);break;case"select":var r={};if(j=a.inputOptions||[],!j.length)throw new Error("prompt with select requires options");h(j,function(a,d){var e=g;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(r[d.group]||(r[d.group]=b(" ").attr("label",d.group)),e=r[d.group]),e.append(""+d.text+" ")}),h(r,function(a,b){g.append(b)}),g.val(a.value);break;case"checkbox":var s=b.isArray(a.value)?a.value:[a.value];if(j=a.inputOptions||[],!j.length)throw new Error("prompt with checkbox requires options");if(!j[0].value||!j[0].text)throw new Error("given options in wrong format");g=b("
"),h(j,function(c,d){var e=b(o.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),h(s,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),g.append(e)})}return a.placeholder&&g.attr("placeholder",a.placeholder),a.pattern&&g.attr("pattern",a.pattern),f.append(g),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=q.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){g.focus()}),i===!0&&e.modal("show"),e},q.dialog=function(a){a=i(a);var c=b(o.dialog),d=c.find(".modal-dialog"),e=c.find(".modal-body"),g=a.buttons,j="",k={onEscape:a.onEscape};if(h(g,function(a,b){j+=""+b.label+" ",k[a]=b.callback}),e.find(".bootbox-body").html(a.message),a.animate===!0&&c.addClass("fade"),a.className&&c.addClass(a.className),"large"===a.size&&d.addClass("modal-lg"),"small"===a.size&&d.addClass("modal-sm"),a.title&&e.before(o.header),a.closeButton){var l=b(o.closeButton);a.title?c.find(".modal-header").prepend(l):l.css("margin-top","-10px").prependTo(e)}return a.title&&c.find(".modal-title").html(a.title),j.length&&(e.after(o.footer),c.find(".modal-footer").html(j)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){k.onEscape&&f(a,c,k.onEscape)}),c.on("click",".modal-footer button",function(a){var d=b(this).data("bb-handler");f(a,c,k[d])}),c.on("click",".bootbox-close-button",function(a){f(a,c,k.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),b(a.container).append(c),c.modal({backdrop:a.backdrop,keyboard:!1,show:!1}),a.show&&c.modal("show"),c},q.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(p,a)},q.hideAll=function(){b(".bootbox").modal("hide")};var r={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},zh_cn:{OK:"好的",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"好的",CANCEL:"取消",CONFIRM:"確認"}};return q.init=function(c){return a(c||b)},q}),+function(a,b){"use strict";function c(){this.show=function(b,c,f,g,h){a(".messager").hide(),d++,c=c||"default",g=g||2e3,h=h||"body",f=f||"top";var i=a(e.format({message:b,type:c,placement:f,id:d})).appendTo(h);return i.find(".close-messager").click(function(){a(this).closest(".messager").fadeOut()}),("top"==f||"bottom"==f)&&i.css("left",(a(h).width()-i.width()-50)/2),i.fadeIn(),setTimeout(function(){a("#messager"+d).fadeOut(function(){a(this).remove()})},g),i},this.primary=function(a,b,c,d){return this.show(a,"primary",b,c,d)},this.success=function(a,b,c,d){return this.show(' '+a,"success",b,c,d)},this.info=function(a,b,c,d){return this.show(' '+a,"info",b,c,d)},this.warning=function(a,b,c,d){return this.show(' '+a,"warning",b,c,d)},this.danger=function(a,b,c,d){return this.show(' '+a,"danger",b,c,d)},this.important=function(a,b,c,d){return this.show(a,"important",b,c,d)},this.special=function(a,b,c,d){return this.show(a,"special",b,c,d)}}var d=0,e='',f=new c;b.messager=f}(jQuery,window,document,Math),+function(a){"use strict";if(!a.fn.droppable)throw new Error("droppable requires for boards");var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.getLang(),this.init()};b.DEFAULTS={lang:"zh-cn",langs:{"zh-cn":{appendToTheEnd:"移动到末尾"},"zh-tw":{appendToTheEnd:"移动到末尾"},en:{appendToTheEnd:"Move to the end."}}},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.getLang=function(){if(!this.options.lang){if("undefined"!=typeof config&&config.clientLang)this.options.lang=config.clientLang;else{var c=a("html").attr("lang");this.options.lang=c?c:"en"}this.options.lang=this.options.lang.replace(/-/,"_").toLowerCase()}this.lang=this.options.langs[this.options.lang]||this.options.langs[b.DEFAULTS.lang]},b.prototype.init=function(){var b=1,c=this.lang;this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function(){var d=a(this);d.attr("id")?d.attr("data-id",d.attr("id")):d.attr("data-id")||d.attr("data-id","board"+b++),d.hasClass("board")&&d.find(".board-list").append(' {appendToTheEnd}
'.format(c)).append('
'.format(c))}),this.bind()},b.prototype.bind=function(b){var c=this.$,d=this.options;"undefined"==typeof b&&(b=c.find('.board-item:not(".disable-drop, .board-item-shadow")')),b.droppable({target:'.board-item:not(".disable-drop, .board-item-shadow")',flex:!0,start:function(a){c.addClass("dragging").find(".board-item-shadow").height(a.element.outerHeight())},drag:function(a){if(c.find(".board.drop-in-empty").removeClass("drop-in-empty"),a.isIn){var b=a.target.closest(".board").addClass("drop-in"),d=b.find(".board-item-shadow"),e=a.target;c.addClass("drop-in").find(".board.drop-in").not(b).removeClass("drop-in"),d.insertBefore(e),b.toggleClass("drop-in-empty",e.hasClass("board-item-empty"))}},drop:function(b){b.isNew&&(d.hasOwnProperty("drop")&&a.isFunction(d.drop)&&d.drop(b),b.element.insertBefore(b.target))},finish:function(){c.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}})},a.fn.boards=function(c){return this.each(function(){var d=a(this),e=d.data("zui.boards"),f="object"==typeof c&&c;e||d.data("zui.boards",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.boards.Constructor=b,a(function(){a('[data-toggle="boards"]').boards()})}(jQuery,window,document,Math),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector||(this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a"),this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a,b,c,d){"use strict";var e=function(b,c){this.$=a(b),this.initOptions(c),this.init()};e.DEFAULTS={coverColor:"#000",coverOpacity:.6,fixedRatio:!1,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},e.prototype.callEvent=function(b,c){return a.callEvent(this.options[b],c)},e.prototype.initOptions=function(b){this.options=a.extend({},e.DEFAULTS,this.$.data(),b),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},e.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},e.prototype.initDom=function(){this.$canvas=this.$.children(".canvas"),this.$img=this.$canvas.children("img"),this.$actions=this.$.children(".actions"),this.$btn=this.$.find(".img-cutter-submit"),this.$preview=this.$.find(".img-cutter-preview"),this.options.img=this.$img.attr("src"),this.$canvas.append('
'.format(this.options)),this.$cover=this.$canvas.children(".cover"),this.$controller=this.$canvas.children(".controller"),this.$cliper=this.$canvas.children(".cliper"),this.$chipImg=this.$cliper.children("img"),this.options.fixedRatio&&this.$.addClass("fixed-ratio")},e.prototype.initSize=function(){var a=this;"undefined"==typeof a.imgWidth&&imgReady(a.options.img,function(){a.imgWidth=this.width,a.imgHeight=this.height,a.callEvent("ready")});var b=setInterval(function(){"undefined"!=typeof a.imgWidth&&(clearInterval(b),a.width=d.min(a.imgWidth,a.$.width()),a.$canvas.css("width",this.width),a.$cliper.css("width",this.width),a.height=a.$canvas.height(),"undefined"==typeof a.left&&(a.left=d.floor((a.width-a.$controller.width())/2),a.top=d.floor((a.height-a.$controller.height())/2)),a.refreshSize())},0)},e.prototype.refreshSize=function(a){var b=this.options;this.clipWidth=d.max(b.minWidth,d.min(this.width,this.clipWidth)),this.clipHeight=d.max(b.minHeight,d.min(this.height,this.clipHeight)),b.fixedRatio&&(a&&"height"===a?(this.clipWidth=d.max(b.minWidth,d.min(this.width,this.clipHeight*b.defaultWidth/b.defaultHeight)),this.clipHeight=this.clipWidth*b.defaultHeight/b.defaultWidth):(this.clipHeight=d.max(b.minHeight,d.min(this.height,this.clipWidth*b.defaultHeight/b.defaultWidth)),this.clipWidth=this.clipHeight*b.defaultWidth/b.defaultHeight)),this.left=d.min(this.width-this.clipWidth,d.max(0,this.left)),this.top=d.min(this.height-this.clipHeight,d.max(0,this.top)),this.right=this.left+this.clipWidth,this.bottom=this.top+this.clipHeight,this.$controller.css({left:this.left,top:this.top,width:this.clipWidth,height:this.clipHeight}),this.$cliper.css("clip","rect({0}px {1}px {2}px {3}px".format(this.top,this.left+this.clipWidth,this.top+this.clipHeight,this.left)),this.callEvent("change",{top:this.top,left:this.left,bottom:this.bottom,right:this.right,width:this.clipWidth,height:this.clipHeight})},e.prototype.bindEvents=function(){var b=this,c=this.options;this.$.resize(a.proxy(this.initSize,this)),this.$btn.hover(function(){b.$.toggleClass("hover")}).click(function(){var d={originWidth:b.imgWidth,originHeight:b.imgHeight,width:b.width,height:b.height,left:b.left,top:b.top,right:b.right,bottom:b.bottom,scaled:b.imgWidth!=b.width||b.imgHeight!=b.height};if(b.callEvent("before",d)){var e=c.post||c.get||c.url||null;null!=e&&a.ajax({type:c.post?"POST":"GET",url:e,data:d}).done(function(a){b.callEvent("done",a)}).fail(function(a){b.callEvent("fail",a)}).always(function(a){b.callEvent("always",a)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(a){b.left+=a.smallOffset.x,b.top+=a.smallOffset.y,b.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(a){var e=a.element.data("direction"),f=a.smallOffset,g=!1;switch(e){case"left":case"top-left":case"bottom-left":b.left+=f.x,b.left=d.min(b.right-c.minWidth,d.max(0,b.left)),b.clipWidth=b.right-b.left;break;case"right":case"top-right":case"bottom-right":b.clipWidth+=f.x,b.clipWidth=d.min(b.width-b.left,d.max(c.minWidth,b.clipWidth))}switch(e){case"top":case"top-left":case"top-right":b.top+=f.y,b.top=d.min(b.bottom-c.minHeight,d.max(0,b.top)),b.clipHeight=b.bottom-b.top,g=!0;break;case"bottom":case"bottom-left":case"bottom-right":b.clipHeight+=f.y,b.clipHeight=d.min(b.height-b.top,d.max(c.minHeight,b.clipHeight)),g=!0}b.refreshSize(g)}})},a.fn.imgCutter=function(b){return this.each(function(){var c=a(this),d=c.data("zui.imgCutter"),f="object"==typeof b&&b;d||c.data("zui.imgCutter",d=new e(this,f)),"string"==typeof b&&d[b]()})},a.fn.imgCutter.Constructor=e,a(function(){a('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,window,document,Math),+function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={trigger:"toggle",selector:null,animate:"slide",easing:"linear",animateSpeed:"fast",events:"click",preventDefault:!0,cancelBubble:!0,target:null},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){this.bindEvents()},b.prototype.bindEvents=function(){var b=this.options;if(this.bindTrigger(b),a.isArray(b.triggers))for(var c in b.triggers)this.bindTrigger(a.extend({},b,b.triggers[c]));else if("string"==typeof b.triggers){var d=b.triggers.split("|");for(var c in d){var e=d[c].split(",",4);if(!(e.length<2)){var f={};e[0]&&(f.events=e[0]),e[1]&&(f.trigger=e[1]),e[2]&&(f.target=e[2]),e[3]&&(f.data=e[3]),this.bindTrigger(a.extend({},b,f))}}}},b.prototype.bindTrigger=function(b){var c=this;c.$.on(b.events,b.selector,function(d){var e=b.target&&"self"!=b.target?a(b.target):c.$,f={event:d,element:this,target:e,options:b};if(a.callEvent(b.before,f,c)){if(a.isFunction(b.trigger))a.callEvent(b.trigger,f,c);else{var g=b.trigger;switch("toggle"===g&&(g=e.hasClass("hide")?"show":"hide"),g){case"toggle":e.toggle();break;case"show":var h={duration:b.animateSpeed,easing:b.easing};e.removeClass("hide"),"slide"===b.animate?e.slideDown(h):"fade"===b.animate?e.fadeIn(h):e.show(h);break;case"hide":var h={duration:b.animateSpeed,easing:b.easing,complete:function(){e.addClass("hide")}};"slide"===b.animate?e.slideUp(h):"fade"===b.animate?e.fadeOut(h):e.hide(h);break;case"addClass":case"removeClass":case"toggleClass":e[g](b.data)}}a.callEvent(b.after,f,c),b.preventDefault&&d.preventDefault(),b.cancelBubble&&d.stopPropagation()}})},a.fn.autoTrigger=function(c){return this.each(function(){var d=a(this),e=d.data("zui.autoTrigger"),f="object"==typeof c&&c;e||d.data("zui.autoTrigger",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.autoTrigger.Constructor=b,a(function(){a('[data-toggle="autoTrigger"]').autoTrigger(),a('[data-toggle="toggle"]').autoTrigger(),a('[data-toggle="show"]').autoTrigger({trigger:"show"}),a('[data-toggle="hide"]').autoTrigger({trigger:"hide"}),a('[data-toggle="addClass"]').autoTrigger({trigger:"addClass"}),a('[data-toggle="removeClass"]').autoTrigger({trigger:"removeClass"}),a('[data-toggle="toggleClass"]').autoTrigger({trigger:"toggleClass"})})}(jQuery,window,document,Math);
\ No newline at end of file
diff --git a/docs/example/datatable.html b/docs/example/datatable.html
index c41e15f5201861dce474dedd865fa210a7234110..e48e474d2d806537231873628b10af70276f5c89 100644
--- a/docs/example/datatable.html
+++ b/docs/example/datatable.html
@@ -257,7 +257,7 @@ $(function()
{
cols:
[
- {sort: 'up', width: 80, text: '#', type: 'number', flex: false, colClass: 'text-center', css: 'color: #444'},
+ {sort: 'down', width: 80, text: '#', type: 'number', flex: false, colClass: 'text-center', css: 'color: #444'},
{width: 'auto', text: 'Name', type: 'string', flex: false},
{width: 100, text: 'Mood', type: 'string', flex: false},
{width: 150, text: 'Date', type: 'date', flex: true, cssClass: 'text-center'},
@@ -267,14 +267,14 @@ $(function()
],
rows:
[
- {checked: false, data: ['1', 'Catouse', 'happy', '2014-08-07', 'null is good', '1', 'OK']},
- {checked: true, data: ['2', 'Shine', 'angry', '2014-08-06', 'god is girl', '2', 'OK']},
- {checked: false, data: ['3', 'Minus', 'Veritatis', '2014-08-07', 'Nulla', '1', 'Ipsam']},
- {cssClass:'danger', checked: false, data: ['4', 'Consequatur', 'Accusamus', '2014-08-07', 'Obcaecati', '1', 'Qui']},
- {checked: false, data: ['5', 'Lorem', 'Quos', '2014-08-07', 'Molestiae', '1', 'Qui']},
- {checked: false, data: ['6', 'Suscipit', 'Vitae', '2014-08-07', 'Suscipit', '1', 'AE']},
- {checked: false, data: ['7', 'Vel', 'Blanditiis', '2014-08-07', 'Aspernatur', '1', 'Sed']},
- {checked: false, data: ['8', 'Vero', 'Officiis', '2014-08-07', 'Quos', '1', 'Vel']}
+ {checked: false, data: ['1', 'Catouse ', 'happy', '2014-08-07', 'null is good', '1', 'OK']},
+ {checked: true, data: ['2', 'Shine ', 'angry', '2014-08-06', 'god is girl', '2', 'OK']},
+ {checked: false, data: ['3', 'Minus ', 'Veritatis', '2014-08-07', 'Nulla', '1', 'Ipsam']},
+ {cssClass:'danger', checked: false, data: ['4', 'Consequatur ', 'Accusamus', '2014-08-07', 'Obcaecati', '1', 'Qui']},
+ {checked: false, data: ['5', 'Lorem ', 'Quos', '2014-08-07', 'Molestiae', '1', 'Qui']},
+ {checked: false, data: ['6', 'Suscipit ', 'Vitae', '2014-08-07', 'Suscipit', '1', 'AE']},
+ {checked: false, data: ['7', 'Vel ', 'Blanditiis', '2014-08-07', 'Aspernatur', '1', 'Sed']},
+ {checked: false, data: ['8', 'Vero ', 'Officiis', '2014-08-07', 'Quos', '1', 'Vel']}
]
}
});
diff --git a/docs/js/doc.js b/docs/js/doc.js
index 9e07db303b77fc52c0bfcb48f42bc1a8dc28b315..7342c9cea9a19d964e5572f1fb16ff47d805e09e 100644
--- a/docs/js/doc.js
+++ b/docs/js/doc.js
@@ -95,7 +95,7 @@ $(function()
var ver = $this.data('version') + '';
if(versionToNumber(ver) > versionNum)
{
- $this.children('.page-header').children('h2').append(' DEV ');
+ $this.children('.page-header').children('h2').append(' DEV ');
}
});
diff --git a/src/js/datatable.js b/src/js/datatable.js
index cef140a3988962d1954f19b179df3f409fc9b0ed..c4b18178f384e635e1242f442b3c30bea0efc3cd 100644
--- a/src/js/datatable.js
+++ b/src/js/datatable.js
@@ -283,11 +283,11 @@
rowCol = row.data[i];
if(!$.isPlainObject(rowCol))
{
- rowCol = {text: rowCol};
+ rowCol = {text: rowCol, row: r, index: i};
row.data[i] = rowCol;
}
- td = '' + rowCol.text + ' ';
+ td = '' + rowCol.text + ' ';
if(i == 0 && options.checkable)
{
td = ' ' + td;
@@ -533,10 +533,10 @@
navbarHeight = options.fixedHeaderOffset || $('.navbar.navbar-fixed-top').height() || 0;
var handleScroll = function()
{
- scrollTop = $(window).scrollTop();
offsetTop = $datatable.offset().top;
+ scrollTop = $(window).scrollTop();
height = $datatable.height();
- $datatable.toggleClass('head-fixed', scrollTop > offsetTop && scrollTop < (offsetTop + height));
+ $datatable.toggleClass('head-fixed', (scrollTop + navbarHeight) > offsetTop && (scrollTop + navbarHeight) < (offsetTop + height));
if($datatable.hasClass('head-fixed'))
{
$dataTableHead.css(
@@ -555,6 +555,7 @@
handleScroll();
}
+ // make sortable
if(options.sortable)
{
var $th, sortdown;
@@ -564,6 +565,8 @@
});
}
+ //
+
this.refresh();
};
@@ -619,11 +622,13 @@
}
});
- var valA, valB, result;
+ var valA, valB, result, $dataRows = this.$dataCells.filter('[data-index="' + index + '"]');
rows.sort(function(cellA, cellB)
{
- valA = cellA.data[index].text;
- valB = cellB.data[index].text;
+ cellA = cellA.data[index];
+ cellB = cellB.data[index];
+ valA = $dataRows.filter('[data-row="' + cellA.row + '"]').text();
+ valB = $dataRows.filter('[data-row="' + cellB.row + '"]').text();
if(type === 'number')
{
valA = parseFloat(valA);
@@ -665,9 +670,9 @@
// save sort with local storage
store.pageSet(sorterStoreName, {index: index, type: sortUp ? 'up' : 'down'});
- }
+ };
- DataTable.prototype.refresh = function()
+ DataTable.prototype.refreshSize = function()
{
var $datatable = this.$datatable,
options = this.options,
@@ -681,7 +686,11 @@
{
$cells.filter('[data-index="' + i + '"]').css('width', cols[i].width);
}
+ };
+ DataTable.prototype.refresh = function()
+ {
+ this.refreshSize();
this.sortTable();
}