提交 b1938909 编写于 作者: C Catouse

* removed test code.

上级 20bf2d0c
if("undefined"==typeof jQuery)throw new Error("ZUI requires jQuery");!function(t){function e(e){if("string"==typeof e.data){var i=e.handler,o=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var n="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],a=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==n&&(s+="alt+"),e.ctrlKey&&"ctrl"!==n&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==n&&(s+="meta+"),e.shiftKey&&"shift"!==n&&(s+="shift+"),n?r[s+n]=!0:(r[s+a]=!0,r[s+t.hotkeys.shiftNums[a]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[a]]=!0));for(var l=0,d=o.length;d>l;l++)if(r[o[l]])return i.apply(this,arguments)}}}}t.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),+function(t,e,i,o){"use strict";t.extend({uuid:function(){for(var t=(new Date).getTime();1e16>t;)t*=10;return t+o.floor(9999*o.random())},getPropertyCount:function(t){return"object"!=typeof t||null==t?0:Object.getOwnPropertyNames(t).length},callEvent:function(e,i,o){if(t.isFunction(e)){"undefined"!=typeof o&&(e=t.proxy(e,o));var n=e(i);return!(void 0!=n&&!n)}return 1}}),jQuery.fn.selectText=function(){var t=i,o=this[0];if(t.body.createTextRange){var n=i.body.createTextRange();n.moveToElementText(o),n.select()}else if(e.getSelection){var a=e.getSelection(),n=i.createRange();n.selectNodeContents(o),a.removeAllRanges(),a.addRange(n)}}}(jQuery,window,document,Math),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]}}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one(t.support.transition.end,function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.prototype.close=function(e){function i(){a.trigger("closed.bs.alert").remove()}var o=t(this),n=o.attr("data-target");n||(n=o.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,""));var a=t(n);e&&e.preventDefault(),a.length||(a=o.hasClass("alert")?o:o.parent()),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one(t.support.transition.end,i).emulateTransitionEnd(150):i())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),n=o.data("bs.alert");n||o.data("bs.alert",n=new i(this)),"string"==typeof e&&n[e].call(o)})},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(window.jQuery),+function(t){"use strict";var e=function(i,o){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,o),this.isLoading=!1};e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",a=o.data();e+="Text",a.resetText||o.data("resetText",o[n]()),o[n](a[e]||this.options[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=function(i){return this.each(function(){var o=t(this),n=o.data("bs.button"),a="object"==typeof i&&i;n||o.data("bs.button",n=new e(this,a)),"toggle"==i?n.toggle():i&&n.setState(i)})},t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),e.preventDefault()})}(jQuery),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},e.prototype.touchable=function(){function e(e){var e=e||window.event;e.originalEvent&&(e=e.originalEvent);var a=t(this);switch(e.type){case"touchstart":o=e.touches[0].pageX,n=e.touches[0].pageY;break;case"touchend":var s=e.changedTouches[0].pageX-o,r=e.changedTouches[0].pageY-n;if(Math.abs(s)>Math.abs(r))i(a,s);else{var l=t(window);t("body,html").animate({scrollTop:l.scrollTop()-r},400)}}e.preventDefault()}function i(t,e){e>10&&t.find(".left.carousel-control").click(),-10>e&&t.find(".right.carousel-control").click()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",e);var o,n}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,o=this.getActiveIndex();return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid",function(){i.to(e)}):o==e?this.pause().cycle():this.slide(e>o?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){return this.sliding?void 0:this.slide("next")},e.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},e.prototype.slide=function(e,i){var o=this.$element.find(".item.active"),n=i||o[e](),a=this.interval,s="next"==e?"left":"right",r="next"==e?"first":"last",l=this;if(!n.length){if(!this.options.wrap)return;n=this.$element.find(".item")[r]()}this.sliding=!0,a&&this.pause();var d=t.Event("slide.bs.carousel",{relatedTarget:n[0],direction:s});if(!n.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var e=t(l.$indicators.children()[l.getActiveIndex()]);e&&e.addClass("active")})),t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;n.addClass(e),n[0].offsetWidth,o.addClass(s),n.addClass(s),o.one(t.support.transition.end,function(){n.removeClass([e,s].join(" ")).addClass("active"),o.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;o.removeClass("active"),n.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return a&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=function(i){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),a=t.extend({},e.DEFAULTS,o.data(),"object"==typeof i&&i),s="string"==typeof i?i:a.slide;n||o.data("bs.carousel",n=new e(this,a)),"number"==typeof i?n.to(i):s?n[s]():a.interval&&n.pause().cycle(),a.touchable&&n.touchable()})},t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this},t(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(e){var i,o=t(this),n=t(o.attr("data-target")||(i=o.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),a=t.extend({},n.data(),o.data()),s=o.attr("data-slide-to");s&&(a.interval=!1),n.carousel(a),(s=o.attr("data-slide-to"))&&n.data("bs.carousel").to(s),e.preventDefault()}),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);e.carousel(e.data())})})}(window.jQuery),+function(t){"use strict";var e=function(i,o){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,o),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e=t.Event("show.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.$parent&&this.$parent.find("> .panel > .in");if(i&&i.length){var o=i.data("bs.collapse");if(o&&o.transitioning)return;i.collapse("hide"),o||i.data("bs.collapse",null)}var n=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[n](0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("in")[n]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var s=t.camelCase(["scroll",n].join("-"));this.$element.one(t.support.transition.end,t.proxy(a,this)).emulateTransitionEnd(350)[n](this.$element[0][s])}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return t.support.transition?(this.$element[i](0).one(t.support.transition.end,t.proxy(o,this)).emulateTransitionEnd(350),void 0):o.call(this)}}},e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var i=t.fn.collapse;t.fn.collapse=function(i){return this.each(function(){var o=t(this),n=o.data("bs.collapse"),a=t.extend({},e.DEFAULTS,o.data(),"object"==typeof i&&i);n||o.data("bs.collapse",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.collapse.Constructor=e,t.fn.collapse.noConflict=function(){return t.fn.collapse=i,this},t(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(e){var i,o=t(this),n=o.attr("data-target")||e.preventDefault()||(i=o.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""),a=t(n),s=a.data("bs.collapse"),r=s?"toggle":o.data(),l=o.attr("data-parent"),d=l&&t(l);s&&s.transitioning||(d&&d.find('[data-toggle=collapse][data-parent="'+l+'"]').not(o).addClass("collapsed"),o[a.hasClass("in")?"addClass":"removeClass"]("collapsed")),a.collapse(r)})}(window.jQuery),+function(t){"use strict";function e(){t(o).remove(),t(n).each(function(e){var o=i(t(this));o.hasClass("open")&&(o.trigger(e=t.Event("hide.bs.dropdown")),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden.bs.dropdown"))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}var o=".dropdown-backdrop",n="[data-toggle=dropdown]",a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var a=i(n),s=a.hasClass("open");if(e(),!s){if("ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e),a.trigger(o=t.Event("show.bs.dropdown")),o.isDefaultPrevented())return;a.toggleClass("open").trigger("shown.bs.dropdown"),n.focus()}return!1}},a.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var o=t(this);if(e.preventDefault(),e.stopPropagation(),!o.is(".disabled, :disabled")){var a=i(o),s=a.hasClass("open");if(!s||s&&27==e.keyCode)return 27==e.which&&a.find(n).focus(),o.click();var r=t("[role=menu] li:not(.divider):visible a",a);if(r.length){var l=r.index(r.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<r.length-1&&l++,~l||(l=0),r.eq(l).focus()}}}};var s=t.fn.dropdown;t.fn.dropdown=function(e){return this.each(function(){var i=t(this),o=i.data("dropdown");o||i.data("dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})},t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=s,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",n,a.prototype.toggle).on("keydown.bs.dropdown.data-api",n+", [role=menu]",a.prototype.keydown)}(window.jQuery),+function(t){"use strict";var e=function(e,i){this.options=i,this.$element=t(e),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.load(this.options.remote)};e.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"},e.prototype.toggle=function(t){return this[this.isShown?"hide":"show"](t)},e.prototype.show=function(e){var i=this,o=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(o),this.isShown||o.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.backdrop(function(){var o=t.support.transition&&i.$element.hasClass("fade");if(i.$element.parent().length||i.$element.appendTo(document.body),i.$element.show(),o&&i.$element[0].offsetWidth,i.$element.addClass("in").attr("aria-hidden",!1),i.options.position){var n=i.$element.find(".modal-dialog"),a=Math.max(0,(t(window).height()-n.outerHeight())/2),s="fit"==i.options.position?2*a/3:"center"==i.options.position?a:i.options.position;n.css("margin-top",s)}i.enforceFocus();var r=t.Event("shown.bs.modal",{relatedTarget:e});o?i.$element.find(".modal-dialog").one(t.support.transition.end,function(){i.$element.focus().trigger(r)}).emulateTransitionEnd(300):i.$element.focus().trigger(r)}))},e.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one(t.support.transition.end,t.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},e.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.focus()},this))},e.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keyup.dismiss.bs.modal",t.proxy(function(e){if(27==e.which){var i=t.Event("escaping.bs.modal"),o=this.$element.triggerHandler(i,"esc");if(void 0!=o&&!o)return;this.hide()}},this)):this.isShown||t(document).off("keyup.dismiss.bs.modal")},e.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.removeBackdrop(),t.$element.trigger("hidden.bs.modal")})},e.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},e.prototype.backdrop=function(e){var i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=t.support.transition&&i;if(this.$backdrop=t('<div class="modal-backdrop '+i+'" />').appendTo(document.body),this.$element.on("click.dismiss.modal",t.proxy(function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;o?this.$backdrop.one(t.support.transition.end,e).emulateTransitionEnd(150):e()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,e).emulateTransitionEnd(150):e()):e&&e()};var i=t.fn.modal;t.fn.modal=function(i,o){return this.each(function(){var n=t(this),a=n.data("bs.modal"),s=t.extend({},e.DEFAULTS,n.data(),"object"==typeof i&&i);a||n.data("bs.modal",a=new e(this,s)),"string"==typeof i?a[i](o):s.show&&a.show(o)})},t.fn.modal.Constructor=e,t.fn.modal.noConflict=function(){return t.fn.modal=i,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var i=t(this),o=i.attr("href"),n=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""));if(!(n.length<1)){var a=n.data("modal")?"toggle":t.extend({remote:!/#/.test(o)&&o},n.data(),i.data());e.preventDefault(),n.modal(a,this).one("hide",function(){i.is(":visible")&&i.focus()})}}),t(document).on("show.bs.modal",".modal",function(){t(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){t(document.body).removeClass("modal-open")})}(window.jQuery),+function(t,e,i,o){"use strict";function n(i,n){if(i){var a=o.max(0,(t(e).height()-n.outerHeight())/2),s="fit"==i?2*a/3:"center"==i?a:i;n.css("margin-top",s)}}if(!t.fn.modal)throw new Error("Modal trigger requires modal.js");var a=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};a.DEFAULTS={type:"ajax",width:null,height:"auto",icon:"*",name:"modalIframe",fade:!0,position:"fit",iframeTeamplate:"<div class='icon-spinner icon-spin loader'></div><div class='modal-dialog modal-iframe' style='width: {width};'><div class='modal-content'><div class='modal-header'><button class='close' data-dismiss='modal'>×</button><h4 class='modal-title'><i class='icon-{icon}'></i> {title}</h4></div><div class='modal-body' style='height:{height}'><iframe id='{name}' name='{name}' src='{url}' frameborder='no' allowtransparency='true' scrolling='auto' hidefocus='' style='width: 100%; height: 100%; left: 0px;'></iframe></div></div></div>",ajaxTeamplate:"<div class='icon-spinner icon-spin loader'></div><div class='modal-dialog modal-ajax' style='width: {width};'><div class='modal-content'><div class='modal-header'><button class='close' data-dismiss='modal'>×</button><h4 class='modal-title'><i class='icon-{icon}'></i> {title}</h4></div><div class='modal-body' style='height:{height}'></div></div></div>"},a.prototype.getOptions=function(e){if(e=t.extend({title:this.$.text()},a.DEFAULTS,this.$.data(),e),e.height&&e.height.toString().isNum()&&(e.height+="px"),e.width&&e.width.toString().isNum()&&(e.width+="px"),"*"==e.icon){var i=this.$.find("[class^='icon-']");e.icon=i.length?i.attr("class").substring(5):""}return e},a.prototype.init=function(){this.initModal(),this.handleClick()},a.prototype.handleClick=function(){var o=this.options,a=this.modal;this.$.click(function(){var s=t(this);if("disabled"==s.attr("disabled")||s.hasClass("disabled"))return!1;o.url=(o?o.url:!1)||s.attr("href");var r=o.cssClass;if("fullscreen"==o.size){var l=t(e);o.width=l.width(),o.height=l.height(),r+=" fullscreen"}if(o.headerless?r+=" hide-header":"fullscreen"==o.size&&(o.height-=a.find(".modal-header").outerHeight()),a.addClass("modal-loading").toggleClass("fade",o.fade),"custom"===o.type&&o.custom)o.custom({modal:a,options:o,element:s,ready:function(){n(o.position,a.find(".modal-dialog")),a.removeClass("modal-loading")}});else if("ajax"===o.type)a.load(o.url,function(){setTimeout(function(){var t=a.find(".modal-body"),e=a.find(".modal-dialog");o.width&&e.css("width",o.width),"auto"!=o.height&&t.css("height",o.height),o.width&&e.css("width",o.width),n(o.position,e),a.removeClass("modal-loading")},200)});else{a.data("first",!0),a.html(o.iframeTeamplate.format(o));var d=a.find(".modal-body"),h=a.find(".modal-dialog");r&&h.addClass(o.cssClass),o.width&&h.css("width",o.width);var c=i.getElementById(o.name);c.onload=c.onreadystatechange=function(){if(a.data("first")||a.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){a.data("first",!1);try{var i=t(e.frames[o.name].document);if("auto"==o.height&&"fullscreen"!=o.size){var s=i.find("body");setTimeout(function(){d.css("height",s.addClass("body-modal").outerHeight()),n(o.position,h),a.removeClass("modal-loading")},100),s.resize(function(){d.css("height",s.outerHeight())})}else a.removeClass("modal-loading");var r=e.frames[o.name].$;r&&r.extend({closeModal:t.closeModal})}catch(l){a.removeClass("modal-loading")}}}}return a.modal("show"),a.attr("rel",o.url),!1})},a.prototype.initModal=function(){var i="triggerModal",o=this.options,n=o.location;t("#"+i).length?t(i).off("show.bs.modal shown.bs.modal hide.bs.modal hidden.bs.modal"):t('<div id="'+i+'" class="modal fade"></div>').appendTo("body");var a=t("#"+i);this.modal=a.data("options",o),t.extend({closeModal:function(i,o){o=o||n,a.on("hidden.bs.modal",function(){o&&("this"==o?e.location.reload():e.location=o),i&&t.isFunction(i)&&i()}),a.modal("hide")}}),o.afterShow&&t.isFunction(o.afterShow)&&a.on("show.bs.modal",o.afterShow),o.afterShown&&t.isFunction(o.afterShown)&&a.on("shown.bs.modal",o.afterShown),o.afterHide&&t.isFunction(o.afterHide)&&a.on("hide.bs.modal",o.afterHide),o.afterHidden&&t.isFunction(o.afterHidden)&&a.on("hidden.bs.modal",o.afterHidden)},t.fn.modalTrigger=function(e){return this.each(function(){var i=t(this),o=i.data("zui.modalTrigger"),n="object"==typeof e&&e;o||i.data("zui.dataTable",o=new a(this,n)),"string"==typeof e&&o[e]()})},t(function(){t('[data-toggle="modal"]').each(function(){try{var e=t(this);("iframe"==e.data("type")||t(e.data("target")).length<1||0!=e.attr("href").indexOf("#"))&&(e.hasClass("iframe")?e.modalTrigger({type:"iframe"}):e.modalTrigger())}catch(i){}})})}(window.jQuery,window,document,Math),+function(t){"use strict";var e=function(t,e){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,o){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o);for(var n=this.options.trigger.split(" "),a=n.length;a--;){var s=n[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show),void 0):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide),void 0):i.hide()},e.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(e),e.isDefaultPrevented())return;var i=this.tip();this.setContent(),this.options.animation&&i.addClass("fade");var o="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,n=/\s?auto?\s?/i,a=n.test(o);a&&(o=o.replace(n,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(o),this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var s=this.getPosition(),r=i[0].offsetWidth,l=i[0].offsetHeight;if(a){var d=this.$element.parent(),h=o,c=document.documentElement.scrollTop||document.body.scrollTop,p="body"==this.options.container?window.innerWidth:d.outerWidth(),u="body"==this.options.container?window.innerHeight:d.outerHeight(),f="body"==this.options.container?0:d.offset().left;o="bottom"==o&&s.top+s.height+l-c>u?"top":"top"==o&&s.top-c-l<0?"bottom":"right"==o&&s.right+r>p?"left":"left"==o&&s.left-r<f?"right":o,i.removeClass(h).addClass(o)}var g=this.getCalculatedOffset(o,s,r,l);this.applyPlacement(g,o),this.$element.trigger("shown.bs."+this.type)}},e.prototype.applyPlacement=function(t,e){var i,o=this.tip(),n=o[0].offsetWidth,a=o[0].offsetHeight,s=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(r)&&(r=0),t.top=t.top+s,t.left=t.left+r,o.offset(t).addClass("in");var l=o[0].offsetWidth,d=o[0].offsetHeight;if("top"==e&&d!=a&&(i=!0,t.top=t.top+a-d),/bottom|top/.test(e)){var h=0;t.left<0&&(h=-2*t.left,t.left=0,o.offset(t),l=o[0].offsetWidth,d=o[0].offsetHeight),this.replaceArrow(h-n+l,l,"left")}else this.replaceArrow(d-a,d,"top");i&&o.offset(t)},e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},e.prototype.hide=function(){function e(){"in"!=i.hoverState&&o.detach()}var i=this,o=this.tip(),n=t.Event("hide.bs."+this.type);return this.$element.trigger(n),n.isDefaultPrevented()?void 0:(o.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?o.one(t.support.transition.end,e).emulateTransitionEnd(150):e(),this.$element.trigger("hidden.bs."+this.type),this)},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},e.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},e.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=e?t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var i=t.fn.tooltip;t.fn.tooltip=function(i){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),a="object"==typeof i&&i;n||o.data("bs.tooltip",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(window.jQuery),+function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),t.html(e.html()),void 0;var i=this.getTitle(),o=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](o),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,o=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return o?"$next"==o?e.next(".popover"):t(o):!1},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var o=t(this),n=o.data("bs.popover"),a="object"==typeof i&&i;n||o.data("bs.popover",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"user strict";var e=function(t,e){this.init("pager",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");if(!t.fn.popover)throw new Error("Popover requires popover.js");e.prototype.init=function(e,i,o){this.type=e,this.$element=t(i),this.options=o,this.computeIndex(),this.$element.popover({container:"body",trigger:"manual",html:!0,template:'<div class="popover pager-popover"><div class="arrow"></div><div class="popover-content"></div></div>'}).on("click."+this.type,!1,t.proxy(this.showPopover,this))},e.prototype.hidePopover=function(){var e=this.$element;"true"==e.attr("data-safe-close")?(e.popover("hide").attr("data-safe-close",!1),t(document).unbind("click",this.hidePopover)):e.attr("data-safe-close",!0)},e.prototype.showPopover=function(){var e=this.$element;e.attr("data-content")||e.attr("data-content","<ul class='pager'>"+this.setContent(this.getUrl())+"</ul>"),e.popover("show"),t(document).bind("click",t.proxy(this.hidePopover,this))},e.prototype.setContent=function(t){var e="";if(this.isRangeIndex)for(var i=this.indexStart;i<=this.indexEnd;i++)e+="<li><a href='"+t.replace("%",i)+"'>"+i+"</a></li>";else for(var i=this.indexs.length-1;i>=0;i--){var o=this.indexs[i];e+="<li><a href='"+t.replace("%",o)+"'>"+o+"</a></li>"}return e
},e.prototype.getUrl=function(){var t=this.$element,e=this.options;return t.attr("data-url")||t.attr("href")||("function"==typeof e.url?e.url.call(t[0]):e.url)||"?page=%"},e.prototype.computeIndex=function(){var t=this.$element,e=t.closest("li"),i=this.options,o=t.attr("data-index")||("function"==typeof i.index?i.index.call(t[0]):i.index)||e.prev("li").find("a").text()-0+1+"-"+(e.next("li").find("a").text()-1);if(o.indexOf("-")>0){this.isRangeIndex=!0;var n=o.split("-");this.indexStart=n[0]-0,this.indexEnd=n[1]-0,this.indexCount=this.indexEnd-this.indexStart}else this.indexs=o.split(","),this.indexCount=this.indexs.length};var i=t.fn.pager;t.fn.pager=function(i){return this.each(function(){var o=t(this),n=o.data("bs.pager"),a="object"==typeof i&&i;n||o.data("bs.pager",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.pager.Constructor=e,t.fn.pager.noConflict=function(){return t.fn.pager=i,this}}(window.jQuery),+function(t){"use strict";var e=function(e){this.element=t(e)};e.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.attr("data-target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a")[0],a=t.Event("show.bs.tab",{relatedTarget:n});if(e.trigger(a),!a.isDefaultPrevented()){var s=t(o);this.activate(e.parent("li"),i),this.activate(s,s.parent(),function(){e.trigger({type:"shown.bs.tab",relatedTarget:n})})}}},e.prototype.activate=function(e,i,o){function n(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),o&&o()}var a=i.find("> .active"),s=o&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,n).emulateTransitionEnd(150):n(),a.removeClass("in")};var i=t.fn.tab;t.fn.tab=function(i){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new e(this)),"string"==typeof i&&n[i]()})},t.fn.tab.Constructor=e,t.fn.tab.noConflict=function(){return t.fn.tab=i,this},t(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery);var imgReady=function(){var t=[],e=null,i=function(){for(var e=0;e<t.length;e++)t[e].end?t.splice(e--,1):t[e]();!t.length&&o()},o=function(){clearInterval(e),e=null};return function(o,n,a,s){var r,l,d,h,c,p=new Image;return p.src=o,p.complete?(n.call(p),a&&a.call(p),void 0):(l=p.width,d=p.height,p.onerror=function(){s&&s.call(p),r.end=!0,p=p.onload=p.onerror=null},r=function(){h=p.width,c=p.height,(h!==l||c!==d||h*c>1024)&&(n.call(p),r.end=!0)},r(),p.onload=function(){!r.end&&r(),a&&a.call(p),p=p.onload=p.onerror=null},r.end||(t.push(r),null===e&&(e=setInterval(i,40))),void 0)}}();+function(t,e,i,o){"use strict";if(!t.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!imgReady)throw new Error("imgReady requires for lightbox");var n=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};n.DEFAULTS={modalTeamplate:'<div class="icon-spinner icon-spin loader"></div><div class="modal-dialog"><button class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i></button><button class="controller prev"><i class="icon icon-chevron-left"></i></button><button class="controller next"><i class="icon icon-chevron-right"></i></button><img class="lightbox-img" src="{image}" alt="" data-dismiss="modal" /><div class="caption"><div class="content">{caption}<div></div></div>'},n.prototype.getOptions=function(e){return e=t.extend({},n.DEFAULTS,this.$.data(),e),e.image||(e.image=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data("image",e.image)),e},n.prototype.init=function(){this.bindEvents()},n.prototype.initGroups=function(){var e=this.$.data("groups");e||(e=t('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",e),e.each(function(e){t(this).attr("data-group-index",e)})),this.groups=e,this.groupIndex=parseInt(this.$.data("group-index"))},n.prototype.bindEvents=function(){var i=this.$,n=this,a=this.options;return a.image?(i.modalTrigger({type:"custom",name:"lightboxModal",custom:function(i){n.initGroups();var s=i.modal,r=n.groups,l=n.groupIndex;s.addClass("modal-lightbox").html(a.modalTeamplate.format(a)).toggleClass("lightbox-with-caption","string"==typeof a.caption).removeClass("lightbox-full").data("group-index",l);var d=s.find(".modal-dialog"),h=t(e).width();imgReady(a.image,function(){d.css({width:o.min(h,this.width),height:this.height}),h<this.width+30&&s.addClass("lightbox-full"),i.ready()}),s.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(l-1)+'"]').length>0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(l+1)+'"]').length>0),s.find(".controller").click(function(){var n=t(this),a=s.data("group-index")+(n.hasClass("prev")?-1:1),l=r.filter('[data-group-index="'+a+'"]');if(l.length){var c=l.data("image"),p=l.data("caption");s.addClass("modal-loading").data("group-index",a).toggleClass("lightbox-with-caption","string"==typeof p).removeClass("lightbox-full"),s.find(".lightbox-img").attr("src",c),h=t(e).width(),imgReady(c,function(){d.css({width:o.min(h,this.width),height:this.height}),h<this.width+30&&s.addClass("lightbox-full"),i.ready()})}return s.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(a-1)+'"]').length>0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(a+1)+'"]').length>0),!1})}}),void 0):!1},t.fn.lightbox=function(e){var i="group"+(new Date).getTime();return this.each(function(){var o=t(this),a="object"==typeof e&&e;"object"==typeof a&&a.group?o.attr("data-lightbox-group",a.group):o.data("group")?o.attr("data-lightbox-group",o.data("group")):o.attr("data-lightbox-group",i),o.data("group",o.data("lightbox-group"));var s=o.data("zui.lightbox");s||o.data("zui.lightbox",s=new n(this,a)),"string"==typeof e&&s[e]()})},t.fn.lightbox.Constructor=n,t(function(){t('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,document,Math),+function(t,e,i){"use strict";var o=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};o.DEFAULTS={container:"body",move:!0},o.prototype.getOptions=function(e){return e=t.extend({},o.DEFAULTS,this.$.data(),e)},o.prototype.init=function(){this.handleMouseEvents()},o.prototype.handleMouseEvents=function(){var e=this.$,o=this.options;e.mousedown(function(n){function a(i){f=!0;var n=i.pageX,a=i.pageY,s={left:n-p.x,top:a-p.y};e.removeClass("drag-ready").addClass("dragging"),o.move&&e.css(s),o.hasOwnProperty("drag")&&t.isFunction(o.drag)&&o.drag({event:i,element:e,startOffset:p,pos:s,offset:{x:n-c.x,y:a-c.y},smallOffset:{x:n-u.x,y:a-u.y}}),u.x=n,u.y=a,o.stopPropagation&&i.stopPropagation()}function s(n){if(t(i).unbind("mousemove",a).unbind("mouseup",s),!f)return e.removeClass("drag-ready"),void 0;var r={left:n.pageX-p.x,top:n.pageY-p.y};e.removeClass("drag-ready").removeClass("dragging"),o.move&&e.css(r),o.hasOwnProperty("finish")&&t.isFunction(o.finish)&&o.finish({event:n,element:e,pos:r,offset:{x:n.pageX-c.x,y:n.pageY-c.y},smallOffset:{x:n.pageX-u.x,y:n.pageY-u.y}}),n.preventDefault(),o.stopPropagation&&n.stopPropagation()}if(o.hasOwnProperty("before")&&t.isFunction(o.before)){var r=o.before({event:n,element:e});if(void 0!=r&&!r)return}var l=t(o.container),d=e.offset(),h=l.offset(),c={x:n.pageX,y:n.pageY},p={x:n.pageX-d.left+h.left,y:n.pageY-d.top+h.top},u=t.extend({},c),f=!1;e.addClass("drag-ready"),t(i).bind("mousemove",a).bind("mouseup",s),n.preventDefault(),o.stopPropagation&&n.stopPropagation()})},t.fn.draggable=function(e){return this.each(function(){var i=t(this),n=i.data("zui.draggable"),a="object"==typeof e&&e;n||i.data("zui.draggable",n=new o(this,a)),"string"==typeof e&&n[e]()})},t.fn.draggable.Constructor=o}(jQuery,window,document,Math),+function(t,e,i){"use strict";var o=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};o.DEFAULTS={container:"body",flex:!1},o.prototype.getOptions=function(e){return e=t.extend({},o.DEFAULTS,this.$.data(),e)},o.prototype.init=function(){this.handleMouseEvents()},o.prototype.handleMouseEvents=function(){var e=this.$,o=this.options;e.mousedown(function(n){function a(i){null==h&&(h=e.clone().removeClass("drag-from").addClass("drag-shadow").css({position:"absolute",width:e.outerWidth(),transition:"none"}).appendTo(c),e.addClass("dragging"),o.hasOwnProperty("start")&&t.isFunction(o.start)&&o.start({event:i,element:e}));var n=i.pageX,a=i.pageY,s={left:n-m.x,top:a-m.y};h.css(s),u=!1;var r=-1,p=!1;o.flex||l.removeClass("drop-to"),l.each(function(i){var s=t(this),h=s.offset(),c=s.width(),g=s.height(),m=h.left,v=h.top;return n>m&&a>v&&m+c>n&&v+g>a?(u=!0,e.data("id")!=s.data("id")&&(f=!1),(null==d||d.data("id")!=s.data("id")&&!f)&&(p=!0),d=s,r=i,o.flex&&l.removeClass("drop-to"),s.addClass("drop-to"),!1):void 0}),o.flex?null!=d&&d.length&&(u=!0):(e.toggleClass("drop-in",u),h.toggleClass("drop-in",u)),o.hasOwnProperty("drag")&&t.isFunction(o.drag)&&o.drag({event:i,isIn:u,target:d,element:e,isNew:p,selfTarget:f,startOffset:m,pos:s})}function s(n){if(null==h)return e.removeClass("drag-from"),t(i).unbind("mousemove",a).unbind("mouseup",s),void 0;u||(d=null);var r=!0,c={left:n.pageX-m.x,top:n.pageY-m.y};if(o.hasOwnProperty("beforeDrop")&&t.isFunction(o.beforeDrop)){var r=o.beforeDrop({event:n,isIn:u,target:d,element:e,isNew:!f&&null!=d,selfTarget:f,pos:c});r=void 0==r||r?!0:!1}r&&u&&o.hasOwnProperty("drop")&&t.isFunction(o.drop)&&o.drop({event:n,target:d,element:e,isNew:!f&&null!=d,pos:c}),t(i).unbind("mousemove",a).unbind("mouseup",s),l.removeClass("drop-to"),e.removeClass("dragging").removeClass("drag-from"),h.remove(),o.hasOwnProperty("finish")&&t.isFunction(o.finish)&&o.finish({event:n,target:d,element:e,isNew:!f&&null!=d}),n.preventDefault()}if(o.hasOwnProperty("before")&&t.isFunction(o.before)){var r=o.before({event:n,element:e});if(void 0!=r&&!r)return}var l=t(o.target),d=null,h=null,c=t(o.container),p=e.offset(),u=!1,f=!0,g=c.offset(),m={x:n.pageX-p.left+g.left,y:n.pageY-p.top+g.top};e.addClass("drag-from"),t(i).bind("mousemove",a).bind("mouseup",s),n.preventDefault()})},t.fn.droppable=function(e){return this.each(function(){var i=t(this),n=i.data("zui.droppable"),a="object"==typeof e&&e;n||i.data("zui.droppable",n=new o(this,a)),"string"==typeof e&&n[e]()})},t.fn.droppable.Constructor=o}(jQuery,window,document,Math),+function(t,e,i,o){"use strict";function n(e){var i=e.data("url");i&&(e.addClass("panel-loading").find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").addClass("icon-spin"),t.ajax({url:i,dataType:"html"}).done(function(t){e.find(".panel-body").html(t)}).fail(function(){e.addClass("panel-error")}).always(function(){e.removeClass("panel-loading"),e.find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").removeClass("icon-spin")}))}var a=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.draggable=this.$.hasClass("dashboard-draggable")||this.options.draggable,this.init()};a.DEFAULTS={height:360},a.prototype.getOptions=function(e){return e=t.extend({},a.DEFAULTS,this.$.data(),e)},a.prototype.handleRemoveEvent=function(){var e=this.options.afterPanelRemoved,i=this.options.panelRemovingTip;this.$.find(".remove-panel").click(function(){var o=t(this).closest(".panel"),n=o.data("name")||o.find(".panel-heading").text().replace("\n","").replace(/(^\s*)|(\s*$)/g,""),a=o.attr("data-id");(void 0==i||confirm(i.format(n)))&&(o.parent().remove(),e&&t.isFunction(e)&&e(a))})},a.prototype.handleRefreshEvent=function(){this.$.find(".refresh-panel").click(function(){var e=t(this).closest(".panel");n(e)})},a.prototype.handleDraggable=function(){var e=this.$,o=this.options.afterOrdered;this.$.addClass("dashboard-draggable"),this.$.find(".panel-actions").mousedown(function(t){t.preventDefault(),t.stopPropagation()}),this.$.find(".panel-heading").mousedown(function(n){function a(i){var o=h.data("mouseOffset");h.css({left:i.pageX-o.x,top:i.pageY-o.y}),d.find(".dragging-in").removeClass("dragging-in");var n=!1;d.children().each(function(){var o=t(this);if(o.hasClass("dragging-col-holder"))return n=!0,!0;var a=o.children(".panel"),s=a.offset(),r=a.width(),l=a.height(),h=s.left,c=s.top,p=i.pageX,f=i.pageY;return p>h&&f>c&&h+r>p&&c+l>f?(d.find(".dragging-col"),o.addClass("dragging-in"),n?u.insertAfter(o):u.insertBefore(o),e.addClass("dashboard-holding"),!1):void 0}),i.preventDefault()}function s(n){var l=r.data("order");r.parent().insertAfter(u);var c=0,p={};d.children(":not(.dragging-col-holder)").each(function(){var e=t(this).children(".panel");e.data("order",++c),p[e.attr("id")]=c,e.parent().attr("data-order",c)}),l!=p[r.attr("id")]&&(d.data("orders",p),o&&t.isFunction(o)&&o(p)),h.remove(),e.removeClass("dashboard-holding"),e.find(".dragging-col").removeClass("dragging-col"),e.find(".panel-dragging").removeClass("panel-dragging"),d.find(".dragging-in").removeClass("dragging-in"),e.removeClass("dashboard-dragging"),t(i).unbind("mousemove",a).unbind("mouseup",s),n.preventDefault()}var r=t(this).closest(".panel"),l=r.parent(),d=r.closest(".row"),h=r.clone().addClass("panel-dragging-shadow"),c=r.offset(),p=e.offset(),u=d.find(".dragging-col-holder");u.length||(u=t("<div class='dragging-col-holder'><div class='panel'></div></div>").addClass(d.children().attr("class")).removeClass("dragging-col").appendTo(d)),u.insertBefore(l).find(".panel").replaceWith(r.clone().addClass("panel-dragging panel-dragging-holder")),e.addClass("dashboard-dragging"),r.addClass("panel-dragging").parent().addClass("dragging-col"),h.css({left:c.left-p.left,top:c.top-p.top,width:r.width(),height:r.height()}).appendTo(e).data("mouseOffset",{x:n.pageX-c.left+p.left,y:n.pageY-c.top+p.top}),t(i).bind("mousemove",a).bind("mouseup",s),n.preventDefault()})},a.prototype.handlePanelPadding=function(){this.$.find(".panel-body > table, .panel-body > .list-group").closest(".panel-body").addClass("no-padding")},a.prototype.handlePanelHeight=function(){var e=this.options.height;this.$.find(".row").each(function(){var i=t(this),n=i.find(".panel"),a=i.data("height")||e;"number"!=typeof a&&(a=0,n.each(function(){a=o.max(a,t(this).innerHeight())})),n.each(function(){var e=t(this);e.find(".panel-body").css("height",a-e.find(".panel-heading").outerHeight()-2)})})},a.prototype.init=function(){this.handlePanelHeight(),this.handlePanelPadding(),this.handleRemoveEvent(),this.handleRefreshEvent(),this.draggable&&this.handleDraggable();var e=0;this.$.find(".panel").each(function(){var i=t(this);i.data("order",++e),i.attr("id")||i.attr("id","panel"+e),i.attr("data-id")||i.attr("data-id",e),n(i)})},t.fn.dashboard=function(e){return this.each(function(){var i=t(this),o=i.data("zui.dashboard"),n="object"==typeof e&&e;o||i.data("zui.dashboard",o=new a(this,n)),"string"==typeof e&&o[e]()})},t.fn.dashboard.Constructor=a}(jQuery,window,document,Math),+function(t){"use strict";var e=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};e.DEFAULTS={auto:!1,foldicon:"icon-chevron-right"},e.prototype.getOptions=function(i){return i=t.extend({},e.DEFAULTS,this.$.data(),i)},e.prototype.init=function(){var t=this.$.children(".nav");t.find(".nav").closest("li").addClass("nav-parent"),t.find(".nav > li.active").closest("li").addClass("active"),t.find(".nav-parent > a").append('<i class="'+this.options.foldicon+' nav-parent-fold-icon"></i>'),this.handleFold()},e.prototype.handleFold=function(){var e=this.options.auto,i=this.$;this.$.find(".nav-parent > a").click(function(o){e&&(i.find(".nav-parent.show").find(".nav").slideUp(function(){t(this).closest(".nav-parent").removeClass("show")}),i.find(".icon-rotate-90").removeClass("icon-rotate-90"));var n=t(this).closest(".nav-parent");return n.hasClass("show")?(n.find(".icon-rotate-90").removeClass("icon-rotate-90"),n.find(".nav").slideUp(function(){t(this).closest(".nav-parent").removeClass("show")})):(n.find(".nav-parent-fold-icon").addClass("icon-rotate-90"),n.find(".nav").slideDown(function(){t(this).closest(".nav-parent").addClass("show")})),o.preventDefault(),!1})},t.fn.menu=function(i){return this.each(function(){var o=t(this),n=o.data("zui.menu"),a="object"==typeof i&&i;n||o.data("zui.menu",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.menu.Constructor=e,t(function(){t('[data-toggle="menu"]').menu()})}(jQuery,window,document,Math),+function(t,e){"use strict";var i=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};i.DEFAULTS={},i.prototype.getOptions=function(e){return e=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.init=function(){this.handleRowClickable()},i.prototype.handleRowClickable=function(){this.$,this.$.find('tr[data-url]:not(".app-btn") td:not(".actions")').click(function(i){if(!t(i.target).is("a, .caret")){var o=t(this).closest("tr").data("url");o&&(e.location=o)}})},t.fn.dataTable=function(e){return this.each(function(){var o=t(this),n=o.data("zui.dataTable"),a="object"==typeof e&&e;n||o.data("zui.dataTable",n=new i(this,a)),"string"==typeof e&&n[e]()})},t.fn.dataTable.Constructor=i,t(function(){t("table.table-data").dataTable()})}(jQuery,window,document,Math),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function o(){var t;if("undefined"!=typeof config&&config.clientLang)t=config.clientLang;else{var i=e("html").attr("lang");t=i?i:"en"}return t.replace("-","_").toLowerCase()}function n(t){var e=v[g.locale];return e?e[t]:v.en[t]}function a(t,i,o){t.stopPropagation(),t.preventDefault();var n=e.isFunction(o)&&o(t)===!1;n||i.modal("hide")}function s(t){var e,i=0;for(e in t)i++;return i}function r(t,i){var o=0;e.each(t,function(t,e){i(t,e,o++)})}function l(t){var i,o;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=e.extend({},g,t),t.buttons||(t.buttons={}),t.backdrop=t.backdrop?"static":!1,i=t.buttons,o=s(i),r(i,function(t,n){if(e.isFunction(n)&&(n=i[t]={callback:n}),"object"!==e.type(n))throw new Error("button with key "+t+" must be an object");n.label||(n.label=t),n.className||(n.className=1==o||o>=2&&"confirm"===t?"btn-primary":"btn-default")}),t}function d(t,e){var i=t.length,o={};if(1>i||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(o[e[0]]=t[0],o[e[1]]=t[1]):o=t[0],o}function h(t,i,o){return e.extend(!0,{},t,d(i,o))}function c(t,e,i,o){var n={className:"bootbox-"+t,buttons:p.apply(null,e)};return u(h(n,o,i),e)}function p(){for(var t={},e=0,i=arguments.length;i>e;e++){var o=arguments[e],a=o.toLowerCase(),s=o.toUpperCase();t[a]={label:n(s)}}return t}function u(t,e){var o={};return r(e,function(t,e){o[e]=!0}),r(t.buttons,function(t){if(o[t]===i)throw new Error("button key "+t+" is not allowed (options are "+e.join("\n")+")")}),t}var f={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'></select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},g={locale:o(),backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0,container:"body"},m={};m.alert=function(){var t;if(t=c("alert",["ok"],["message","callback"],arguments),t.callback&&!e.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return e.isFunction(t.callback)?t.callback():!0},m.dialog(t)},m.confirm=function(){var t;if(t=c("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback(!1)},t.buttons.confirm.callback=function(){return t.callback(!0)},!e.isFunction(t.callback))throw new Error("confirm requires a callback");return m.dialog(t)},m.prompt=function(){var t,o,n,a,s,l,d;a=e(f.form),o={className:"bootbox-prompt",buttons:p("confirm","cancel"),value:"",inputType:"text"},t=u(h(o,arguments,["title","callback"]),["cancel","confirm"]),l=t.show===i?!0:t.show;var c=["date","time","number"],g=document.createElement("input");if(g.setAttribute("type",t.inputType),c[t.inputType]&&(t.inputType=g.type),t.message=a,t.buttons.cancel.callback=t.onEscape=function(){return t.callback(null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=s.val();break;case"checkbox":var o=s.find("input:checked");i=[],r(o,function(t,o){i.push(e(o).val())})}return t.callback(i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if(!e.isFunction(t.callback))throw new Error("prompt requires a callback");if(!f.inputs[t.inputType])throw new Error("invalid prompt type");switch(s=e(f.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":s.val(t.value);break;case"select":var v={};if(d=t.inputOptions||[],!d.length)throw new Error("prompt with select requires options");r(d,function(t,o){var n=s;if(o.value===i||o.text===i)throw new Error("given options in wrong format");o.group&&(v[o.group]||(v[o.group]=e("<optgroup/>").attr("label",o.group)),n=v[o.group]),n.append("<option value='"+o.value+"'>"+o.text+"</option>")}),r(v,function(t,e){s.append(e)}),s.val(t.value);break;case"checkbox":var b=e.isArray(t.value)?t.value:[t.value];if(d=t.inputOptions||[],!d.length)throw new Error("prompt with checkbox requires options");if(!d[0].value||!d[0].text)throw new Error("given options in wrong format");s=e("<div/>"),r(d,function(i,o){var n=e(f.inputs[t.inputType]);n.find("input").attr("value",o.value),n.find("label").append(o.text),r(b,function(t,e){e===o.value&&n.find("input").prop("checked",!0)}),s.append(n)})}return t.placeholder&&s.attr("placeholder",t.placeholder),t.pattern&&s.attr("pattern",t.pattern),a.append(s),a.on("submit",function(t){t.preventDefault(),t.stopPropagation(),n.find(".btn-primary").click()}),n=m.dialog(t),n.off("shown.bs.modal"),n.on("shown.bs.modal",function(){s.focus()}),l===!0&&n.modal("show"),n},m.dialog=function(t){t=l(t);var i=e(f.dialog),o=i.find(".modal-dialog"),n=i.find(".modal-body"),s=t.buttons,d="",h={onEscape:t.onEscape};if(r(s,function(t,e){d+="<button data-bb-handler='"+t+"' type='button' class='btn "+e.className+"'>"+e.label+"</button>",h[t]=e.callback}),n.find(".bootbox-body").html(t.message),t.animate===!0&&i.addClass("fade"),t.className&&i.addClass(t.className),"large"===t.size&&o.addClass("modal-lg"),"small"===t.size&&o.addClass("modal-sm"),t.title&&n.before(f.header),t.closeButton){var c=e(f.closeButton);t.title?i.find(".modal-header").prepend(c):c.css("margin-top","-10px").prependTo(n)}return t.title&&i.find(".modal-title").html(t.title),d.length&&(n.after(f.footer),i.find(".modal-footer").html(d)),i.on("hidden.bs.modal",function(t){t.target===this&&i.remove()}),i.on("shown.bs.modal",function(){i.find(".btn-primary:first").focus()}),i.on("escape.close.bb",function(t){h.onEscape&&a(t,i,h.onEscape)}),i.on("click",".modal-footer button",function(t){var o=e(this).data("bb-handler");a(t,i,h[o])}),i.on("click",".bootbox-close-button",function(t){a(t,i,h.onEscape)}),i.on("keyup",function(t){27===t.which&&i.trigger("escape.close.bb")}),e(t.container).append(i),i.modal({backdrop:t.backdrop,keyboard:!1,show:!1}),t.show&&i.modal("show"),i},m.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(g,t)},m.hideAll=function(){e(".bootbox").modal("hide")};var v={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},zh_cn:{OK:"好的",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"好的",CANCEL:"取消",CONFIRM:"確認"}};return m.init=function(i){return t(i||e)},m}),+function(t,e){"use strict";function i(){this.show=function(e,i,a,s,r){t(".messager").hide(),o++,i=i||"default",s=s||2e3,r=r||"body",a=a||"top";var l=t(n.format({message:e,type:i,placement:a,id:o})).appendTo(r);return l.find(".close-messager").click(function(){t(this).closest(".messager").fadeOut()}),("top"==a||"bottom"==a)&&l.css("left",(t(r).width()-l.width()-50)/2),l.fadeIn(),setTimeout(function(){t("#messager"+o).fadeOut(function(){t(this).remove()})},s),l},this.primary=function(t,e,i,o){return this.show(t,"primary",e,i,o)},this.success=function(t,e,i,o){return this.show('<i class="icon-ok-sign icon"></i> '+t,"success",e,i,o)},this.info=function(t,e,i,o){return this.show('<i class="icon-info-sign icon"></i> '+t,"info",e,i,o)},this.warning=function(t,e,i,o){return this.show('<i class="icon-warning-sign icon"></i>'+t,"warning",e,i,o)},this.danger=function(t,e,i,o){return this.show('<i class="icon-exclamation-sign icon"></i>'+t,"danger",e,i,o)},this.important=function(t,e,i,o){return this.show(t,"important",e,i,o)},this.special=function(t,e,i,o){return this.show(t,"special",e,i,o)}}var o=0,n='<div class="messager messager-{type} {placement}" id="messager{id}" style="display:none"><div class="messager-content">{message}</div><button class="close-messager">&times;</button></div>',a=new i;e.messager=a}(jQuery,window,document,Math),String.prototype.format=function(t){var e=this;if(arguments.length>0){var i;if(1==arguments.length&&"object"==typeof t)for(var o in t)void 0!=t[o]&&(i=new RegExp("({"+o+"})","g"),e=e.replace(i,t[o]));else for(var n=0;n<arguments.length;n++)void 0!=arguments[n]&&(i=new RegExp("({["+n+"]})","g"),e=e.replace(i,arguments[n]))}return e},String.prototype.isNum=function(t){if(null!=t){var e,i;return i=/\d*/i,e=t.match(i),e==t?!0:!1}return!1},Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S+":this.getMilliseconds()};/(y+)/i.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t},function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?t(require("jquery")):t(jQuery)}(function(t){function e(t){return r.raw?t:encodeURIComponent(t)}function i(t){return r.raw?t:decodeURIComponent(t)}function o(t){return e(r.json?JSON.stringify(t):String(t))}function n(t){0===t.indexOf('"')&&(t=t.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return t=decodeURIComponent(t.replace(s," ")),r.json?JSON.parse(t):t}catch(e){}}function a(e,i){var o=r.raw?e:n(e);return t.isFunction(i)?i(o):o}var s=/\+/g,r=t.cookie=function(n,s,l){if(void 0!==s&&!t.isFunction(s)){if(l=t.extend({},r.defaults,l),"number"==typeof l.expires){var d=l.expires,h=l.expires=new Date;h.setTime(+h+864e5*d)}return document.cookie=[e(n),"=",o(s),l.expires?"; expires="+l.expires.toUTCString():"",l.path?"; path="+l.path:"",l.domain?"; domain="+l.domain:"",l.secure?"; secure":""].join("")}for(var c=n?void 0:{},p=document.cookie?document.cookie.split("; "):[],u=0,f=p.length;f>u;u++){var g=p[u].split("="),m=i(g.shift()),v=g.join("=");if(n&&n===m){c=a(v,s);break}n||void 0===(v=a(v))||(c[m]=v)}return c};r.defaults={},t.removeCookie=function(e,i){return void 0===t.cookie(e)?!1:(t.cookie(e,"",t.extend({},i,{expires:-1})),!t.cookie(e))}}),+function(t,e,i){"$:nomunge";function o(){n=e[r](function(){a.each(function(){var e=t(this),i=e.width(),o=e.height(),n=t.data(this,d);(i!==n.w||o!==n.h)&&e.trigger(l,[n.w=i,n.h=o])}),o()},s[h])}var n,a=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",d=l+"-special-event",h="delay",c="throttleWindow";s[h]=250,s[c]=!0,t.event.special[l]={setup:function(){if(!s[c]&&this[r])return!1;var e=t(this);a=a.add(e),t.data(this,d,{w:e.width(),h:e.height()}),1===a.length&&o()},teardown:function(){if(!s[c]&&this[r])return!1;var e=t(this);a=a.not(e),e.removeData(d),a.length||clearTimeout(n)},add:function(e){function o(e,o,a){var s=t(this),r=t.data(this,d);r.w=o!==i?o:s.width(),r.h=a!==i?a:s.height(),n.apply(this,arguments)}if(!s[c]&&this[r])return!1;var n;return t.isFunction(e)?(n=e,o):(n=e.handler,e.handler=o,void 0)}}}(jQuery,this),+function(t){"use strict";if(!t.fn.droppable)throw new Error("droppable requires for boards");var e=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.getLang(),this.init()};e.DEFAULTS={lang:"zh-cn",langs:{"zh-cn":{appendToTheEnd:"移动到末尾"},"zh-tw":{appendToTheEnd:"移动到末尾"},en:{appendToTheEnd:"Move to the end."}}},e.prototype.getOptions=function(i){return i=t.extend({},e.DEFAULTS,this.$.data(),i)},e.prototype.getLang=function(){if(!this.options.lang){if("undefined"!=typeof config&&config.clientLang)this.options.lang=config.clientLang;else{var i=t("html").attr("lang");this.options.lang=i?i:"en"}this.options.lang=this.options.lang.replace(/-/,"_").toLowerCase()}this.lang=this.options.langs[this.options.lang]||this.options.langs[e.DEFAULTS.lang]},e.prototype.init=function(){var e=1,i=this.lang;this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function(){var o=t(this);o.attr("id")?o.attr("data-id",o.attr("id")):o.attr("data-id")||o.attr("data-id","board"+e++),o.hasClass("board")&&o.find(".board-list").append('<div class="board-item board-item-empty"><i class="icon-plus"></i> {appendToTheEnd}</div>'.format(i)).append('<div class="board-item board-item-shadow"></div>'.format(i))}),this.bind()},e.prototype.bind=function(e){var i=this.$,o=this.options;"undefined"==typeof e&&(e=i.find('.board-item:not(".disable-drop, .board-item-shadow")')),e.droppable({target:'.board-item:not(".disable-drop, .board-item-shadow")',flex:!0,start:function(t){i.addClass("dragging").find(".board-item-shadow").height(t.element.outerHeight())},drag:function(t){if(i.find(".board.drop-in-empty").removeClass("drop-in-empty"),t.isIn){var e=t.target.closest(".board").addClass("drop-in"),o=e.find(".board-item-shadow"),n=t.target;i.addClass("drop-in").find(".board.drop-in").not(e).removeClass("drop-in"),o.insertBefore(n),e.toggleClass("drop-in-empty",n.hasClass("board-item-empty"))}},drop:function(e){e.isNew&&(o.hasOwnProperty("drop")&&t.isFunction(o.drop)&&o.drop(e),e.element.insertBefore(e.target))},finish:function(){i.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}})},t.fn.boards=function(i){return this.each(function(){var o=t(this),n=o.data("zui.boards"),a="object"==typeof i&&i;n||o.data("zui.boards",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.boards.Constructor=e,t(function(){t('[data-toggle="boards"]').boards()})}(jQuery,window,document,Math),+function(t,e,i,o){"use strict";
var n="undefined",a=0,s=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.lang=this.getLang(),this.data=this.options.data,this.dirtyData=!0,this.offsetX=0,this.offsetY=0,this.init()};s.DEFAULTS={hotkeyEnable:!0,hotkeys:{selectPrev:"Up",selectNext:"Down",selectLeft:"left",selectRight:"right",deleteNode:"del backspace",addBorther:"return",addChild:"tab insert",centerCanvas:"space"},lang:"zh_cn",langs:{zh_cn:{DefaultName:"灵光闪现",DefaultSubName:"灵光",DefaultNodeName:"闪现",ReadonlyTip:"该节点已被设置为只读,无法进行编辑。",HotkeyDisabled:'快捷键不可用,需要 <a target="_blank" href="https://github.com/jeresig/jquery.hotkeys">jquery.hotkeys</a> 插件支持。'}},data:{text:"New Project",type:"root",expand:!0,theme:"default",caption:"",id:t.uuid()+""},nodeTeamplate:"<div id='node-{id}' class='mindmap-node expand-{expand}' data-type='{type}' data-id='{id}' data-parent='{parent}'><div class='wrapper'><div class='text'>{text}</div><div class='caption'>{caption}</div></div></div>",hSpace:100,vSpace:10,canvasPadding:20,removingNodeTip:null,lineCurvature:60,subLineWidth:4,lineOpacity:1,lineSaturation:90,lineLightness:40,nodeLineWidth:2},s.prototype.getOptions=function(i){s.DEFAULTS.data.text=s.DEFAULTS.langs.zh_cn.DefaultName,i=t.extend({},s.DEFAULTS,this.$.data(),i);var o=typeof t.hotkeys!=n;return!o&&i.hotkeyEnable&&e.messager.danger(this.lang.HotkeyDisabled),i.hotkeyEnable=i.hotkeyEnable&&o,i},s.prototype.getLang=function(){if(!this.options.lang){if("undefined"!=typeof e.config&&e.config.clientLang)this.options.lang=config.clientLang;else{var i=t("html").attr("lang");this.options.lang=i?i:"en"}this.options.lang=this.options.lang.replace(/-/,"_").toLowerCase()}return this.options.langs[this.options.lang]||this.options.langs[s.DEFAULTS.lang]},s.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents(),this.render()},s.prototype.initDom=function(){var e=this.$;e.attr("id")||e.attr("id","mindmap-"+t.uuid()),this.id=e.attr("id"),this.$container=e.children(".mindmap-container"),this.$container.length||(e.prepend("<div class='mindmap-container'></div>"),this.$container=e.children(".mindmap-container")),this.$canvas=this.$container.children("canvas"),this.$canvas.length||(this.$container.prepend("<canvas class='mindmap-bg'></canvas>".format(this.options.canvasSize)),this.$canvas=this.$container.children("canvas")),this.$desktop=this.$container.children(".mindmap-desktop"),this.$desktop.length||(this.$container.append("<div class='mindmap-desktop'></div>"),this.$desktop=this.$container.children(".mindmap-desktop")),this.$desktop.attr("unselectable","on");var i=e.children(".shadow");i.length||e.append("<div class='mindmap-shadow shadow-top'></div><div class='mindmap-shadow shadow-right'></div><div class='mindmap-shadow shadow-bottom'></div><div class='mindmap-shadow shadow-left'></div>")},s.prototype.initSize=function(){var t=this.$;this.winWidth=t.width(),this.winHeight=t.height(),this.centerX=o.floor(this.winWidth/2),this.centerY=o.floor(this.winHeight/2),this.dirtyData||this.display()},s.prototype.callEvent=function(e,i){return t.callEvent(this.options[e],i,this)},s.prototype.computePosition=function(t,e){var i=e?-1:1;return typeof t.left!=n&&(t.left-=(this.left-this.options.canvasPadding)*i),typeof t.top!=n&&(t.top-=this.top*i),typeof t.x!=n&&(t.x-=(this.left-this.options.canvasPadding)*i),typeof t.y!=n&&(t.y-=this.top*i),t},s.prototype.computeColor=function(t,e){return"hsla({h}, {s}%, {l}%, {a})".format({h:t,s:this.options.lineSaturation,l:this.options.lineLightness,a:e||this.options.lineOpacity})},s.prototype.getNodeData=function(e,i){if("number"==typeof e&&(e=e.toString()),i||(i=this.data),e==i.id)return i;if(t.isArray(i.children)&&i.children.length>0)for(var o in i.children){var n=this.getNodeData(e,i.children[o]);if(n)return n}return null},s.prototype.createDefaultNodeData=function(e){var i={expand:!0,id:t.uuid()+"",parent:e.id};return"root"===e.type?(i.type="sub",i.text=this.lang.DefaultSubName):(i.type="node",i.text=this.lang.DefaultNodeName),i},s.prototype.getNode=function(t){return"string"==typeof t?this.$desktop.children('[data-id="'+t+'"]'):typeof t.id!=n?t.ui.element:void 0},s.prototype.removeNode=function(t){if(this.getNode(t).remove(),t.count>0)for(var e in t.children)this.removeNode(t.children[e])},s.prototype.update=function(e,i,o){var a=!1;if(this.options,t.isPlainObject(e)&&(e=[e]),t.isArray(e))for(var s in e){var r=e[s],l=r.data;if(l||(l=this.getNodeData(r.id)),!l)return;var d=r.action||"update";if("remove"===d||"delete"===d){var h=this.getNodeData(l.parent);h&&(h.children.splice(l.index,1),this.removeNode(l),this.clearNodeStatus(),t.isArray(h.deletions)?h.deletions.push(l):h.deletions=[l],o=!0,i=!0,a=!0,l.action="delete")}else if("add"===d)t.isArray(l.children)?l.children.push(r.newData):l.children=[r.newData],o=!0,i=!0,a=!0,l.action="add";else if("move"===d){if(r.newParent!=l.parent){var c=this.getNodeData(r.newParent),h=this.getNodeData(l.parent);h&&c&&("root"===c.type?("node"===l.type&&(l.colorHue=null),l.type="sub",l.subSide=null):(l.type="node",l.subSide=c.subSide),h.children.splice(l.index,1),h.count-=1,t.isArray(c.children)?c.children.push(l):c.children=[l],c.count+=1,o=!0,i=!0,a=!0,l.action+=" move")}}else if("sort"===d){if(l.count>1){l.children.sort(r.func);for(var s in l.children){var p=l.children[s];p.index=s,p.action+=" sort"}o=!0,i=!0,a=!0}}else typeof r.text!=n&&r.text!=l.text&&(l.text=r.text,i=!0,a=!0),typeof r.subSide!=n&&r.subSide!=l.subSide&&(l.subSide=r.subSide,o=!0,i=!0,a=!0),a&&(l.action+=" edit")}o&&this.loadNode(),i&&this.showNode(),a&&this.callEvent("onChange",{changes:e,data:this.data})},s.prototype.load=function(t){this.data=t,this.render(t)},s.prototype.render=function(){this.loadNode(),this.showNode()},s.prototype.loadNode=function(e,i){e||(e=this.data);var s=this.options,r=this.$desktop,l="object"==typeof i?i.id?i.id:"":"";typeof e.expand===n&&(e.expand=!0),typeof e.data===n&&(e.data={}),typeof e.type===n&&(e.type="node"),typeof e.id===n&&(e.id=t.uuid()+""),typeof e.readonly===n&&(e.readonly=!1),typeof e.ui===n&&(e.ui={}),e.parent=l;var d=r.children('.mindmap-node[data-id="'+e.id+'"]');if(d.length?(d.toggleClass("expand-false",!e.expand).toggleClass("expand-true",e.expand).attr("data-type",e.type).attr("data-parent",l||"root"),d.children(".text").html(e.text),d.children(".caption").html(e.caption)):(d=t(s.nodeTeamplate.format({type:e.type||"node",expand:e.expand,caption:e.caption||"",id:e.id,parent:l||"root",text:e.text})).appendTo(r),this.bindNodeEvents(d),e.ui.element=d),"root"===e.type)e.ui.subLeftSide=0,e.ui.subRightSide=0,e.ui.vLeftSpan=0,e.ui.vRightSpan=0;else if("sub"===e.type){var h=e.subSide;h||(h=i.ui.subRightSide>i.ui.subLeftSide?"left":"right"),"left"===h?i.ui.subLeftSide++:i.ui.subRightSide++,e.subSide=h,typeof e.colorHue===n&&(e.colorHue=o.floor(55*a++%360))}else e.subSide=i.subSide;d.data("origin-text",e.text),d.toggleClass("readonly",e.readonly);var c=1;if(e.count=0,t.isArray(e.children)&&e.children.length>0){e.ui.topSpanTemp="root"===e.type?{left:0,right:0}:0;var p=0,u=0,f=null;c=0,e.children.sort(function(t,e){return t.index-e.index});for(var g in e.children){var m=e.children[g];typeof m.ui===n&&(m.ui={}),"sub"!=m.type&&(m.colorHue=e.colorHue),m.ui.nextBorther=null,f?(m.ui.prevBorther=f.id,f.ui.nextBorther=m.id):m.ui.prevBorther=null,f=m,this.loadNode(m,e,g),m.index=e.count++,"undifined"==typeof m.order&&(m.order=m.index),c+=m.ui.vSpan,"sub"===m.type?"left"===m.subSide?(p+=m.ui.vSpan,m.ui.topSpan=e.ui.topSpanTemp.left,e.ui.topSpanTemp.left+=m.ui.vSpan):(u+=m.ui.vSpan,m.ui.topSpan=e.ui.topSpanTemp.right,e.ui.topSpanTemp.right+=m.ui.vSpan):(m.ui.topSpan=e.ui.topSpanTemp,e.ui.topSpanTemp+=m.ui.vSpan)}"root"===e.type&&(e.ui.vLeftSpan=p,e.ui.vRightSpan=u)}"root"!=e.type&&(e.ui.vSpan=c),this.dirtyData=!1,"root"===e.type&&this.callEvent("afterLoad",{data:e})},s.prototype.showNode=function(e,i){e||(e=this.data);var n=this.options,a=e.ui,s=e.ui.element;if(s.find(".caption").text(e.index),a.width=s.outerWidth(),a.height=s.outerHeight(),"root"===e.type)a.left=0-o.floor(a.width/2),a.top=0-o.floor(a.height/2),this.left=0-o.floor(o.max(a.width-2*n.canvasPadding,this.winWidth)/4),this.right=0-this.left,this.top=0-o.floor(o.max(a.height-2*n.canvasPadding,this.winHeight)/4),this.bottom=0-this.top;else if(t.isPlainObject(a.dragPos))a.left=a.dragPos.left,a.top=a.dragPos.top;else{if("sub"===e.type){var r=0;"left"===e.subSide?(a.left=i.ui.left-n.hSpace-20-a.width,r=i.ui.vLeftSpan):(a.left=i.ui.left+i.ui.width+n.hSpace+20,r=i.ui.vRightSpan);var l=r*a.height+(r-1)*n.vSpace,d=0-o.floor(l/2),h=a.topSpan*a.height+a.topSpan*n.vSpace,c=a.vSpan*a.height+(a.vSpan-1)*n.vSpace;a.top=d+h+o.floor((c-a.height)/2)}else{a.left="left"===e.subSide?i.ui.left-n.hSpace-a.width:i.ui.left+i.ui.width+n.hSpace;var l=i.ui.vSpan*a.height+(i.ui.vSpan-1)*n.vSpace,d=i.ui.top+o.floor(i.ui.height/2)-o.floor(l/2),h=a.topSpan*a.height+a.topSpan*n.vSpace,c=a.vSpan*a.height+(a.vSpan-1)*n.vSpace;a.top=d+h+o.floor((c-a.height)/2)}"left"===e.subSide?this.left=o.min(this.left,a.left):this.right=o.max(this.right,a.left+a.width),this.top=o.min(this.top,a.top),this.bottom=o.max(this.bottom,a.top+a.height)}if(t.isArray(e.children)&&e.children.length>0)for(var p in e.children)this.showNode(e.children[p],e);if("root"===e.type){var u=this.options.canvasPadding;this.left-=u,this.top-=u,this.right+=2*u,this.bottom+=u,this.width=this.right-this.left,this.height=this.bottom-this.top,this.display(),this.draw(),this.callEvent("afterShow",{data:e})}},s.prototype.display=function(t,e,i){"number"==typeof t&&"number"==typeof e&&(i&&(t+=this.offsetX,e+=this.offsetY),this.offsetX=t,this.offsetY=e),this.x=this.centerX+this.left+this.offsetX,this.y=this.centerY+this.top+this.offsetY,this.$container.css({width:this.width,height:this.height,top:this.y,left:this.x});var o=this.options.canvasPadding;this.$.toggleClass("shadow-left",this.x<0-o).toggleClass("shadow-right",this.x+this.width>this.winWidth+o).toggleClass("shadow-top",this.y<0-o).toggleClass("shadow-bottom",this.y+this.height>this.winHeight+o)},s.prototype.makeNodeVisble=function(t){var e=this.getNodeData(t.data("id"));if(e){var i=e.ui.left-this.left+this.x,o=e.ui.top-this.top+this.y,n=this.options.canvasPadding;if(0>i)this.offsetX+=0-i;else{var a=i+e.ui.width-(this.winWidth+n);a>0&&(this.offsetX+=0-a-80)}if(0>o)this.offsetY+=0-o;else{var a=o+e.ui.height-(this.winWidth+n);a>0&&(this.offsetY+=0-a-80)}this.display()}},s.prototype.clearCanvasArea=function(){this.$canvas[0].getContext("2d").clearRect(0,0,this.width,this.height)},s.prototype.draw=function(e,i){if(e||(e=this.data),"root"===e.type&&(this.$canvas.attr({width:this.width,height:this.height}),this.clearCanvasArea()),i){var n="left"===e.subSide,a=this.options,s=this.$canvas[0].getContext("2d"),r={x:i.ui.left+("root"===i.type?o.floor(i.ui.width/2):n?0:i.ui.width),y:i.ui.top+o.floor(i.ui.height/2)},l={x:e.ui.left+(n?e.ui.width:0),y:e.ui.top+o.floor(e.ui.height/2)},d={x:r.x+(n?-1:1)*a.lineCurvature,y:r.y},h={x:l.x+(n?1:-1)*a.lineCurvature,y:l.y};r=this.computePosition(r),l=this.computePosition(l),d=this.computePosition(d),h=this.computePosition(h),s.beginPath(),s.strokeStyle=this.computeColor(e.colorHue,e.ui.canDrop?".25":"1"),s.lineCap="round",s.lineWidth="sub"===e.type?a.subLineWidth:a.nodeLineWidth,s.moveTo(r.x,r.y),s.bezierCurveTo(d.x,d.y,h.x,h.y,l.x,l.y),s.stroke()}if(e.ui.element.css(this.computePosition({left:e.ui.left,top:e.ui.top})),t.isArray(e.children)&&e.children.length>0)for(var c in e.children)this.draw(e.children[c],e)},s.prototype.bindNodeEvents=function(t){var e,i=this;t.on("click",function(e){i.onNodeClick(e,t)}).mousedown(function(t){t.stopPropagation()}),t.find(".text").on("keyup paste blur",function(e){i.onNodeTextChanged(e,t)}).on("keydown",function(){}),"root"!=t.data("type")&&t.droppable({container:i.$,target:"#"+i.id+' .mindmap-node:not([data-id="'+t.data("id")+'"]',before:function(o){return i.callEvent("beforeDrag",{node:t})?o.element.hasClass("focus")?!1:(e=i.getNodeData(o.element.data("id")),e?void 0:!1):!1},start:function(e){e.element.hasClass("active")||(i.clearNodeStatus(),i.activeNode(t))},drag:function(t){t.pos.left-=i.x,t.pos.top-=i.y,e.ui.dragPos=i.computePosition(t.pos,!0),e.ui.canDrop=t.isIn,i.showNode()},beforeDrop:function(o){if(o.isIn){if(o.target.data("id")==e.parent)return!1}else{if(!i.callEvent("beforeSort",{node:t,event:o}))return;var n=e.subSide;"sub"===e.type&&(e.ui.left<-30?n="left":e.ui.left>30&&(n="right")),i.update([{action:"sort",data:i.getNodeData(e.parent),func:function(t,e){return t.ui.top-e.ui.top}},{data:e,subSide:n}]),i.callEvent("afterSort",{node:t,event:o})}},drop:function(o){i.callEvent("beforeMove",{node:t,event:o})&&(i.update({action:"move",data:e,newParent:o.target.data("id")}),i.callEvent("afterMove",{node:t,event:o}))},finish:function(){e.ui.dragPos=null,e.ui.canDrop=!1,i.showNode()}})},s.prototype.onNodeClick=function(t,e){e.hasClass("active")?this.focusNode(e):(this.clearNodeStatus(),this.activeNode(e)),this.callEvent("onNodeClick",{node:e}),t.stopPropagation()},s.prototype.onNodeTextChanged=function(t,e){var i=e.find(".text").text();i!=e.data("origin-text")&&(""==i&&e.find(".text").text(""),e.data("origin-text",i),this.update({id:e.data("id"),text:i}),this.callEvent("onTextChanged",{node:e}))},s.prototype.activeNode=function(t){typeof t===n&&(t=this.$desktop.children('.mindmap-node[data-type="sub"]').first()),t.length||(t=this.$desktop.children(".mindmap-node").first()),this.callEvent("beforeNodeActive",{node:t})&&(t.addClass("active"),this.makeNodeVisble(t),this.activedNode=t,this.isActive=!0,this.callEvent("onNodeActive",{node:t}))},s.prototype.focusNode=function(t,i){if(t.hasClass("readonly"))return e.messager.show(this.lang.ReadonlyTip),void 0;if(t.hasClass("active")&&this.callEvent("beforeNodeFocus",{node:t})){var o=t.addClass("focus").find(".text");o.attr("contenteditable","true"),this.makeNodeVisble(t),o.focus(),(i||typeof i===n)&&o.selectText(),this.isFocus=!0}},s.prototype.clearActiveNode=function(t){typeof t===n&&(t=this.$desktop.children(".mindmap-node.active")),t.removeClass("active"),this.isActive=!1,this.activedNode=null},s.prototype.clearFocusNode=function(t){typeof t===n&&(t=this.$desktop.children(".mindmap-node.focus")),t.removeClass("focus").find(".text").attr("contenteditable","false").blur(),this.isFocus=!1},s.prototype.bindEvents=function(){var e=this.$,i=this;e.resize(t.proxy(this.initSize,this)).click(t.proxy(this.onDesktopClick,this)),this.bindGlobalHotkeys(),this.$container.draggable({finish:function(t){i.display(t.smallOffset.x,t.smallOffset.y,!0)},drag:function(t){i.display(t.smallOffset.x,t.smallOffset.y,!0)}})},s.prototype.bindGlobalHotkeys=function(){var e=this.options;if(e.hotkeyEnable){var o=this,n=e.hotkeys;t(i).on("keydown",null,n.selectPrev,function(){o.selectNode("prev")}).on("keydown",null,n.selectNext,function(){o.selectNode("next")}).on("keydown",null,n.selectLeft,function(){o.selectNode("left")}).on("keydown",null,n.selectRight,function(){o.selectNode("right")}).on("keydown",null,n.deleteNode,function(){o.deleteNode(),8!=event.keyCode||o.isFocus||event.preventDefault()}).on("keydown",null,n.addBorther,function(){o.addBortherNode()}).on("keydown",null,n.addChild,function(t){o.addChildNode(),9==t.keyCode&&t.preventDefault()}).on("keydown",function(){if(event.keyCode>=48&&event.keyCode<=111&&o.isActive&&!o.isFocus){var t=o.activedNode;t&&(t.find(".text").text(""),o.focusNode(t))}}).on("keydown",null,n.centerCanvas,function(){o.display(0,0)})}},s.prototype.addBortherNode=function(){if(this.isActive){var t=this.getNodeData(this.activedNode.data("id"));if(t){var e="root"===t.type?t:this.getNodeData(t.parent),i=this.createDefaultNodeData(e);if(!this.callEvent("beforeAdd",{node:e,newNode:i}))return;this.update({action:"add",data:e,newData:i}),this.clearNodeStatus();var o=this.getNode(i.id);this.activeNode(o),this.focusNode(o,!0),this.callEvent("afterAdd",{node:e,newNode:i})}}},s.prototype.addChildNode=function(){if(this.isActive){var t=this.getNodeData(this.activedNode.data("id"));if(t){var e=this.createDefaultNodeData(t);if(!this.callEvent("beforeAdd",{node:t,newNode:e}))return;this.update({action:"add",data:t,newData:e}),this.clearNodeStatus();var i=this.getNode(e.id);this.activeNode(i),this.focusNode(i,!0),this.callEvent("afterAdd",{node:t,newNode:e})}}},s.prototype.deleteNode=function(){if(!this.isFocus&&this.isActive){var t=this.getNodeData(this.activedNode.data("id"));if(t){if(!this.callEvent("beforeDelte",{node:t}))return;this.update({action:"remove",data:t}),this.callEvent("afterDelete",{node:t})}}},s.prototype.selectNode=function(t){if(!this.isFocus){if(!this.isActive)return this.activeNode(),void 0;var e=null,i=this.getNodeData(this.activedNode.data("id")),o=null;switch("root"===i.type?t="prev"===t||"left"===t?"left":"right":"left"===t?t="left"==i.subSide?"child":"parent":"right"===t&&(t="right"==i.subSide?"child":"parent"),t){case"prev":o=i.ui.prevBorther;break;case"next":o=i.ui.nextBorther;break;case"parent":o=i.parent;break;case"child":i.count>0&&(o=i.children[0].id);break;case"left":if(i.count>0){o=i.children[0].id;for(var n in i.children){var a=i.children[n];if("left"==a.subSide){o=a.id;break}}}break;case"right":if(i.count>0){o=i.children[0].id;for(var n in i.children){var a=i.children[n];if("right"==a.subSide){o=a.id;break}}}}o&&(e=this.getNodeData(o)),e&&(this.clearNodeStatus(),this.activeNode(e.ui.element))}},s.prototype.selectNext=function(){if(!this.isFocus){var t=null;this.isActive||this.activeNode();var e=this.getNodeData(this.activedNode.data("id"));null!=e.ui.nextBorther&&(t=this.getNodeData(e.ui.nextBorther)),t&&(this.clearNodeStatus(),this.activeNode(t.ui.element))}},s.prototype.selectLeft=function(){if(!this.isFocus){var t=null;this.isActive||this.activeNode();var e=this.getNodeData(this.activedNode.data("id"));null!=e.ui.leftBorther&&(t=this.getNodeData(e.ui.leftBorther)),t&&(this.clearNodeStatus(),this.activeNode(t.ui.element))}},s.prototype.onDesktopClick=function(){this.$desktop,this.clearNodeStatus()},s.prototype.clearNodeStatus=function(){this.clearActiveNode(),this.clearFocusNode()},t.fn.mindmap=function(e){return this.each(function(){var i=t(this),o=i.data("zui.mindmap"),n="object"==typeof e&&e;o||i.data("zui.mindmap",o=new s(this,n)),"string"==typeof e&&o[e]()})},t.fn.mindmap.Constructor=s}(jQuery,window,document,Math),+function(t,e,i,o){"use strict";var n=function(e,i){this.$=t(e),this.initOptions(i),this.init()};n.DEFAULTS={coverColor:"#000",coverOpacity:.6,fixedRatio:!1,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},n.prototype.callEvent=function(e,i){return t.callEvent(this.options[e],i)},n.prototype.initOptions=function(e){this.options=t.extend({},n.DEFAULTS,this.$.data(),e),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},n.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},n.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('<div class="cover" style="background: {coverColor}; opacity: {coverOpacity}; filter:alpha(opacity={coverOpacityIE});"></div><div class="controller" style="width: {defaultWidth}px; height: {defaultHeight}px"><div class="control" data-direction="top"></div><div class="control" data-direction="right"></div><div class="control" data-direction="bottom"></div><div class="control" data-direction="left"></div><div class="control" data-direction="top-left"></div><div class="control" data-direction="top-right"></div><div class="control" data-direction="bottom-left"></div><div class="control" data-direction="bottom-right"></div></div><div class="cliper"><img src="{img}"/></div>'.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")},n.prototype.initSize=function(){var t=this;"undefined"==typeof t.imgWidth&&imgReady(t.options.img,function(){t.imgWidth=this.width,t.imgHeight=this.height});var e=setInterval(function(){"undefined"!=typeof t.imgWidth&&(clearInterval(e),t.width=o.min(t.imgWidth,t.$.width()),t.$canvas.css("width",this.width),t.$cliper.css("width",this.width),t.height=t.$canvas.height(),"undefined"==typeof t.left&&(t.left=o.floor((t.width-t.$controller.width())/2),t.top=o.floor((t.height-t.$controller.height())/2)),t.refreshSize())},0)},n.prototype.refreshSize=function(t){var e=this.options;this.clipWidth=o.max(e.minWidth,o.min(this.width,this.clipWidth)),this.clipHeight=o.max(e.minHeight,o.min(this.height,this.clipHeight)),e.fixedRatio&&(t&&"height"===t?(this.clipWidth=o.max(e.minWidth,o.min(this.width,this.clipHeight*e.defaultWidth/e.defaultHeight)),this.clipHeight=this.clipWidth*e.defaultHeight/e.defaultWidth):(this.clipHeight=o.max(e.minHeight,o.min(this.height,this.clipWidth*e.defaultHeight/e.defaultWidth)),this.clipWidth=this.clipHeight*e.defaultWidth/e.defaultHeight)),this.left=o.min(this.width-this.clipWidth,o.max(0,this.left)),this.top=o.min(this.height-this.clipHeight,o.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))},n.prototype.bindEvents=function(){var e=this,i=this.options;this.$.resize(t.proxy(this.initSize,this)),this.$btn.hover(function(){e.$.toggleClass("hover")}).click(function(){var o={width:e.width,height:e.height,left:e.left,top:e.top,right:e.right,bottom:e.bottom};if(e.callEvent("before",o)){var n=i.post||i.get||null;null!=n&&t.ajax({type:i.post?"POST":"GET",url:n,data:o}).done(function(t){e.callEvent("done",t)}).fail(function(t){e.callEvent("fail",t)}).always(function(t){e.callEvent("always",t)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(t){e.left+=t.smallOffset.x,e.top+=t.smallOffset.y,e.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(t){var n=t.element.data("direction"),a=t.smallOffset,s=!1;switch(n){case"left":case"top-left":case"bottom-left":e.left+=a.x,e.left=o.min(e.right-i.minWidth,o.max(0,e.left)),e.clipWidth=e.right-e.left;break;case"right":case"top-right":case"bottom-right":e.clipWidth+=a.x,e.clipWidth=o.min(e.width-e.left,o.max(i.minWidth,e.clipWidth))}switch(n){case"top":case"top-left":case"top-right":e.top+=a.y,e.top=o.min(e.bottom-i.minHeight,o.max(0,e.top)),e.clipHeight=e.bottom-e.top,s=!0;break;case"bottom":case"bottom-left":case"bottom-right":e.clipHeight+=a.y,e.clipHeight=o.min(e.height-e.top,o.max(i.minHeight,e.clipHeight)),s=!0}e.refreshSize(s)}})},t.fn.imgCutter=function(e){return this.each(function(){var i=t(this),o=i.data("zui.imgCutter"),a="object"==typeof e&&e;o||i.data("zui.imgCutter",o=new n(this,a)),"string"==typeof e&&o[e]()})},t.fn.imgCutter.Constructor=n,t(function(){t('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,window,document,Math),+function(t){"use strict";var e=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};e.DEFAULTS={trigger:"toggle",selector:null,animate:"slide",easing:"linear",animateSpeed:"fast",events:"click",preventDefault:!0,cancelBubble:!0,target:null},e.prototype.getOptions=function(i){return i=t.extend({},e.DEFAULTS,this.$.data(),i)},e.prototype.init=function(){this.bindEvents()},e.prototype.bindEvents=function(){var e=this.options;if(this.bindTrigger(e),t.isArray(e.triggers))for(var i in e.triggers)this.bindTrigger(t.extend({},e,e.triggers[i]));else if("string"==typeof e.triggers){var o=e.triggers.split("|");for(var i in o){var n=o[i].split(",",4);if(!(n.length<2)){var a={};n[0]&&(a.events=n[0]),n[1]&&(a.trigger=n[1]),n[2]&&(a.target=n[2]),n[3]&&(a.data=n[3]),this.bindTrigger(t.extend({},e,a))}}}},e.prototype.bindTrigger=function(e){var i=this;i.$.on(e.events,e.selector,function(o){var n=e.target&&"self"!=e.target?t(e.target):i.$,a={event:o,element:this,target:n,options:e};if(t.callEvent(e.before,a,i)){if(t.isFunction(e.trigger))t.callEvent(e.trigger,a,i);else{var s=e.trigger;switch("toggle"===s&&(s=n.hasClass("hide")?"show":"hide"),s){case"toggle":n.toggle();break;case"show":var r={duration:e.animateSpeed,easing:e.easing};n.removeClass("hide"),"slide"===e.animate?n.slideDown(r):"fade"===e.animate?n.fadeIn(r):n.show(r);break;case"hide":var r={duration:e.animateSpeed,easing:e.easing,complete:function(){n.addClass("hide")}};"slide"===e.animate?n.slideUp(r):"fade"===e.animate?n.fadeOut(r):n.hide(r);break;case"addClass":case"removeClass":case"toggleClass":n[s](e.data)}}t.callEvent(e.after,a,i),e.preventDefault&&o.preventDefault(),e.cancelBubble&&o.stopPropagation()}})},t.fn.autoTrigger=function(i){return this.each(function(){var o=t(this),n=o.data("zui.autoTrigger"),a="object"==typeof i&&i;n||o.data("zui.autoTrigger",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.autoTrigger.Constructor=e,t(function(){t('[data-toggle="autoTrigger"]').autoTrigger(),t('[data-toggle="toggle"]').autoTrigger(),t('[data-toggle="show"]').autoTrigger({trigger:"show"}),t('[data-toggle="hide"]').autoTrigger({trigger:"hide"}),t('[data-toggle="addClass"]').autoTrigger({trigger:"addClass"}),t('[data-toggle="removeClass"]').autoTrigger({trigger:"removeClass"}),t('[data-toggle="toggleClass"]').autoTrigger({trigger:"toggleClass"})})}(jQuery,window,document,Math);
\ No newline at end of file
var n="undefined",a=0,s=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.lang=this.getLang(),this.data=this.options.data,this.dirtyData=!0,this.offsetX=0,this.offsetY=0,this.init()};s.DEFAULTS={hotkeyEnable:!0,hotkeys:{selectPrev:"Up",selectNext:"Down",selectLeft:"left",selectRight:"right",deleteNode:"del backspace",addBorther:"return",addChild:"tab insert",centerCanvas:"space"},lang:"zh_cn",langs:{zh_cn:{DefaultName:"灵光闪现",DefaultSubName:"灵光",DefaultNodeName:"闪现",ReadonlyTip:"该节点已被设置为只读,无法进行编辑。",HotkeyDisabled:'快捷键不可用,需要 <a target="_blank" href="https://github.com/jeresig/jquery.hotkeys">jquery.hotkeys</a> 插件支持。'}},data:{text:"New Project",type:"root",expand:!0,theme:"default",caption:"",id:t.uuid()+""},nodeTeamplate:"<div id='node-{id}' class='mindmap-node expand-{expand}' data-type='{type}' data-id='{id}' data-parent='{parent}'><div class='wrapper'><div class='text'>{text}</div><div class='caption'>{caption}</div></div></div>",hSpace:100,vSpace:10,canvasPadding:20,removingNodeTip:null,lineCurvature:60,subLineWidth:4,lineOpacity:1,lineSaturation:90,lineLightness:40,nodeLineWidth:2},s.prototype.getOptions=function(i){s.DEFAULTS.data.text=s.DEFAULTS.langs.zh_cn.DefaultName,i=t.extend({},s.DEFAULTS,this.$.data(),i);var o=typeof t.hotkeys!=n;return!o&&i.hotkeyEnable&&e.messager.danger(this.lang.HotkeyDisabled),i.hotkeyEnable=i.hotkeyEnable&&o,i},s.prototype.getLang=function(){if(!this.options.lang){if("undefined"!=typeof e.config&&e.config.clientLang)this.options.lang=config.clientLang;else{var i=t("html").attr("lang");this.options.lang=i?i:"en"}this.options.lang=this.options.lang.replace(/-/,"_").toLowerCase()}return this.options.langs[this.options.lang]||this.options.langs[s.DEFAULTS.lang]},s.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents(),this.render()},s.prototype.initDom=function(){var e=this.$;e.attr("id")||e.attr("id","mindmap-"+t.uuid()),this.id=e.attr("id"),this.$container=e.children(".mindmap-container"),this.$container.length||(e.prepend("<div class='mindmap-container'></div>"),this.$container=e.children(".mindmap-container")),this.$canvas=this.$container.children("canvas"),this.$canvas.length||(this.$container.prepend("<canvas class='mindmap-bg'></canvas>".format(this.options.canvasSize)),this.$canvas=this.$container.children("canvas")),this.$desktop=this.$container.children(".mindmap-desktop"),this.$desktop.length||(this.$container.append("<div class='mindmap-desktop'></div>"),this.$desktop=this.$container.children(".mindmap-desktop")),this.$desktop.attr("unselectable","on");var i=e.children(".shadow");i.length||e.append("<div class='mindmap-shadow shadow-top'></div><div class='mindmap-shadow shadow-right'></div><div class='mindmap-shadow shadow-bottom'></div><div class='mindmap-shadow shadow-left'></div>")},s.prototype.initSize=function(){var t=this.$;this.winWidth=t.width(),this.winHeight=t.height(),this.centerX=o.floor(this.winWidth/2),this.centerY=o.floor(this.winHeight/2),this.dirtyData||this.display()},s.prototype.callEvent=function(e,i){return t.callEvent(this.options[e],i,this)},s.prototype.computePosition=function(t,e){var i=e?-1:1;return typeof t.left!=n&&(t.left-=(this.left-this.options.canvasPadding)*i),typeof t.top!=n&&(t.top-=this.top*i),typeof t.x!=n&&(t.x-=(this.left-this.options.canvasPadding)*i),typeof t.y!=n&&(t.y-=this.top*i),t},s.prototype.computeColor=function(t,e){return"hsla({h}, {s}%, {l}%, {a})".format({h:t,s:this.options.lineSaturation,l:this.options.lineLightness,a:e||this.options.lineOpacity})},s.prototype.getNodeData=function(e,i){if("number"==typeof e&&(e=e.toString()),i||(i=this.data),e==i.id)return i;if(t.isArray(i.children)&&i.children.length>0)for(var o in i.children){var n=this.getNodeData(e,i.children[o]);if(n)return n}return null},s.prototype.createDefaultNodeData=function(e){var i={expand:!0,id:t.uuid()+"",parent:e.id};return"root"===e.type?(i.type="sub",i.text=this.lang.DefaultSubName):(i.type="node",i.text=this.lang.DefaultNodeName),i},s.prototype.getNode=function(t){return"string"==typeof t?this.$desktop.children('[data-id="'+t+'"]'):typeof t.id!=n?t.ui.element:void 0},s.prototype.removeNode=function(t){if(this.getNode(t).remove(),t.count>0)for(var e in t.children)this.removeNode(t.children[e])},s.prototype.update=function(e,i,o){var a=!1;if(this.options,t.isPlainObject(e)&&(e=[e]),t.isArray(e))for(var s in e){var r=e[s],l=r.data;if(l||(l=this.getNodeData(r.id)),!l)return;var d=r.action||"update";if("remove"===d||"delete"===d){var h=this.getNodeData(l.parent);h&&(h.children.splice(l.index,1),this.removeNode(l),this.clearNodeStatus(),t.isArray(h.deletions)?h.deletions.push(l):h.deletions=[l],o=!0,i=!0,a=!0,l.action="delete")}else if("add"===d)t.isArray(l.children)?l.children.push(r.newData):l.children=[r.newData],o=!0,i=!0,a=!0,l.action="add";else if("move"===d){if(r.newParent!=l.parent){var c=this.getNodeData(r.newParent),h=this.getNodeData(l.parent);h&&c&&("root"===c.type?("node"===l.type&&(l.colorHue=null),l.type="sub",l.subSide=null):(l.type="node",l.subSide=c.subSide),h.children.splice(l.index,1),h.count-=1,t.isArray(c.children)?c.children.push(l):c.children=[l],c.count+=1,o=!0,i=!0,a=!0,l.action+=" move")}}else if("sort"===d){if(l.count>1){l.children.sort(r.func);for(var s in l.children){var p=l.children[s];p.index=s,p.action+=" sort"}o=!0,i=!0,a=!0}}else typeof r.text!=n&&r.text!=l.text&&(l.text=r.text,i=!0,a=!0),typeof r.subSide!=n&&r.subSide!=l.subSide&&(l.subSide=r.subSide,o=!0,i=!0,a=!0),a&&(l.action+=" edit")}o&&this.loadNode(),i&&this.showNode(),a&&this.callEvent("onChange",{changes:e,data:this.data})},s.prototype.load=function(t){this.data=t,this.render(t)},s.prototype.render=function(){this.loadNode(),this.showNode()},s.prototype.loadNode=function(e,i){e||(e=this.data);var s=this.options,r=this.$desktop,l="object"==typeof i?i.id?i.id:"":"";typeof e.expand===n&&(e.expand=!0),typeof e.data===n&&(e.data={}),typeof e.type===n&&(e.type="node"),typeof e.id===n&&(e.id=t.uuid()+""),typeof e.readonly===n&&(e.readonly=!1),typeof e.ui===n&&(e.ui={}),e.parent=l;var d=r.children('.mindmap-node[data-id="'+e.id+'"]');if(d.length?(d.toggleClass("expand-false",!e.expand).toggleClass("expand-true",e.expand).attr("data-type",e.type).attr("data-parent",l||"root"),d.children(".text").html(e.text),d.children(".caption").html(e.caption)):(d=t(s.nodeTeamplate.format({type:e.type||"node",expand:e.expand,caption:e.caption||"",id:e.id,parent:l||"root",text:e.text})).appendTo(r),this.bindNodeEvents(d),e.ui.element=d),"root"===e.type)e.ui.subLeftSide=0,e.ui.subRightSide=0,e.ui.vLeftSpan=0,e.ui.vRightSpan=0;else if("sub"===e.type){var h=e.subSide;h||(h=i.ui.subRightSide>i.ui.subLeftSide?"left":"right"),"left"===h?i.ui.subLeftSide++:i.ui.subRightSide++,e.subSide=h,typeof e.colorHue===n&&(e.colorHue=o.floor(55*a++%360))}else e.subSide=i.subSide;d.data("origin-text",e.text),d.toggleClass("readonly",e.readonly);var c=1;if(e.count=0,t.isArray(e.children)&&e.children.length>0){e.ui.topSpanTemp="root"===e.type?{left:0,right:0}:0;var p=0,u=0,f=null;c=0,e.children.sort(function(t,e){return t.index-e.index});for(var g in e.children){var m=e.children[g];typeof m.ui===n&&(m.ui={}),"sub"!=m.type&&(m.colorHue=e.colorHue),m.ui.nextBorther=null,f?(m.ui.prevBorther=f.id,f.ui.nextBorther=m.id):m.ui.prevBorther=null,f=m,this.loadNode(m,e,g),m.index=e.count++,"undifined"==typeof m.order&&(m.order=m.index),c+=m.ui.vSpan,"sub"===m.type?"left"===m.subSide?(p+=m.ui.vSpan,m.ui.topSpan=e.ui.topSpanTemp.left,e.ui.topSpanTemp.left+=m.ui.vSpan):(u+=m.ui.vSpan,m.ui.topSpan=e.ui.topSpanTemp.right,e.ui.topSpanTemp.right+=m.ui.vSpan):(m.ui.topSpan=e.ui.topSpanTemp,e.ui.topSpanTemp+=m.ui.vSpan)}"root"===e.type&&(e.ui.vLeftSpan=p,e.ui.vRightSpan=u)}"root"!=e.type&&(e.ui.vSpan=c),this.dirtyData=!1,"root"===e.type&&this.callEvent("afterLoad",{data:e})},s.prototype.showNode=function(e,i){e||(e=this.data);var n=this.options,a=e.ui,s=e.ui.element;if(a.width=s.outerWidth(),a.height=s.outerHeight(),"root"===e.type)a.left=0-o.floor(a.width/2),a.top=0-o.floor(a.height/2),this.left=0-o.floor(o.max(a.width-2*n.canvasPadding,this.winWidth)/4),this.right=0-this.left,this.top=0-o.floor(o.max(a.height-2*n.canvasPadding,this.winHeight)/4),this.bottom=0-this.top;else if(t.isPlainObject(a.dragPos))a.left=a.dragPos.left,a.top=a.dragPos.top;else{if("sub"===e.type){var r=0;"left"===e.subSide?(a.left=i.ui.left-n.hSpace-20-a.width,r=i.ui.vLeftSpan):(a.left=i.ui.left+i.ui.width+n.hSpace+20,r=i.ui.vRightSpan);var l=r*a.height+(r-1)*n.vSpace,d=0-o.floor(l/2),h=a.topSpan*a.height+a.topSpan*n.vSpace,c=a.vSpan*a.height+(a.vSpan-1)*n.vSpace;a.top=d+h+o.floor((c-a.height)/2)}else{a.left="left"===e.subSide?i.ui.left-n.hSpace-a.width:i.ui.left+i.ui.width+n.hSpace;var l=i.ui.vSpan*a.height+(i.ui.vSpan-1)*n.vSpace,d=i.ui.top+o.floor(i.ui.height/2)-o.floor(l/2),h=a.topSpan*a.height+a.topSpan*n.vSpace,c=a.vSpan*a.height+(a.vSpan-1)*n.vSpace;a.top=d+h+o.floor((c-a.height)/2)}"left"===e.subSide?this.left=o.min(this.left,a.left):this.right=o.max(this.right,a.left+a.width),this.top=o.min(this.top,a.top),this.bottom=o.max(this.bottom,a.top+a.height)}if(t.isArray(e.children)&&e.children.length>0)for(var p in e.children)this.showNode(e.children[p],e);if("root"===e.type){var u=this.options.canvasPadding;this.left-=u,this.top-=u,this.right+=2*u,this.bottom+=u,this.width=this.right-this.left,this.height=this.bottom-this.top,this.display(),this.draw(),this.callEvent("afterShow",{data:e})}},s.prototype.display=function(t,e,i){"number"==typeof t&&"number"==typeof e&&(i&&(t+=this.offsetX,e+=this.offsetY),this.offsetX=t,this.offsetY=e),this.x=this.centerX+this.left+this.offsetX,this.y=this.centerY+this.top+this.offsetY,this.$container.css({width:this.width,height:this.height,top:this.y,left:this.x});var o=this.options.canvasPadding;this.$.toggleClass("shadow-left",this.x<0-o).toggleClass("shadow-right",this.x+this.width>this.winWidth+o).toggleClass("shadow-top",this.y<0-o).toggleClass("shadow-bottom",this.y+this.height>this.winHeight+o)},s.prototype.makeNodeVisble=function(t){var e=this.getNodeData(t.data("id"));if(e){var i=e.ui.left-this.left+this.x,o=e.ui.top-this.top+this.y,n=this.options.canvasPadding;if(0>i)this.offsetX+=0-i;else{var a=i+e.ui.width-(this.winWidth+n);a>0&&(this.offsetX+=0-a-80)}if(0>o)this.offsetY+=0-o;else{var a=o+e.ui.height-(this.winWidth+n);a>0&&(this.offsetY+=0-a-80)}this.display()}},s.prototype.clearCanvasArea=function(){this.$canvas[0].getContext("2d").clearRect(0,0,this.width,this.height)},s.prototype.draw=function(e,i){if(e||(e=this.data),"root"===e.type&&(this.$canvas.attr({width:this.width,height:this.height}),this.clearCanvasArea()),i){var n="left"===e.subSide,a=this.options,s=this.$canvas[0].getContext("2d"),r={x:i.ui.left+("root"===i.type?o.floor(i.ui.width/2):n?0:i.ui.width),y:i.ui.top+o.floor(i.ui.height/2)},l={x:e.ui.left+(n?e.ui.width:0),y:e.ui.top+o.floor(e.ui.height/2)},d={x:r.x+(n?-1:1)*a.lineCurvature,y:r.y},h={x:l.x+(n?1:-1)*a.lineCurvature,y:l.y};r=this.computePosition(r),l=this.computePosition(l),d=this.computePosition(d),h=this.computePosition(h),s.beginPath(),s.strokeStyle=this.computeColor(e.colorHue,e.ui.canDrop?".25":"1"),s.lineCap="round",s.lineWidth="sub"===e.type?a.subLineWidth:a.nodeLineWidth,s.moveTo(r.x,r.y),s.bezierCurveTo(d.x,d.y,h.x,h.y,l.x,l.y),s.stroke()}if(e.ui.element.css(this.computePosition({left:e.ui.left,top:e.ui.top})),t.isArray(e.children)&&e.children.length>0)for(var c in e.children)this.draw(e.children[c],e)},s.prototype.bindNodeEvents=function(t){var e,i=this;t.on("click",function(e){i.onNodeClick(e,t)}).mousedown(function(t){t.stopPropagation()}),t.find(".text").on("keyup paste blur",function(e){i.onNodeTextChanged(e,t)}).on("keydown",function(){}),"root"!=t.data("type")&&t.droppable({container:i.$,target:"#"+i.id+' .mindmap-node:not([data-id="'+t.data("id")+'"]',before:function(o){return i.callEvent("beforeDrag",{node:t})?o.element.hasClass("focus")?!1:(e=i.getNodeData(o.element.data("id")),e?void 0:!1):!1},start:function(e){e.element.hasClass("active")||(i.clearNodeStatus(),i.activeNode(t))},drag:function(t){t.pos.left-=i.x,t.pos.top-=i.y,e.ui.dragPos=i.computePosition(t.pos,!0),e.ui.canDrop=t.isIn,i.showNode()},beforeDrop:function(o){if(o.isIn){if(o.target.data("id")==e.parent)return!1}else{if(!i.callEvent("beforeSort",{node:t,event:o}))return;var n=e.subSide;"sub"===e.type&&(e.ui.left<-30?n="left":e.ui.left>30&&(n="right")),i.update([{action:"sort",data:i.getNodeData(e.parent),func:function(t,e){return t.ui.top-e.ui.top}},{data:e,subSide:n}]),i.callEvent("afterSort",{node:t,event:o})}},drop:function(o){i.callEvent("beforeMove",{node:t,event:o})&&(i.update({action:"move",data:e,newParent:o.target.data("id")}),i.callEvent("afterMove",{node:t,event:o}))},finish:function(){e.ui.dragPos=null,e.ui.canDrop=!1,i.showNode()}})},s.prototype.onNodeClick=function(t,e){e.hasClass("active")?this.focusNode(e):(this.clearNodeStatus(),this.activeNode(e)),this.callEvent("onNodeClick",{node:e}),t.stopPropagation()},s.prototype.onNodeTextChanged=function(t,e){var i=e.find(".text").text();i!=e.data("origin-text")&&(""==i&&e.find(".text").text(""),e.data("origin-text",i),this.update({id:e.data("id"),text:i}),this.callEvent("onTextChanged",{node:e}))},s.prototype.activeNode=function(t){typeof t===n&&(t=this.$desktop.children('.mindmap-node[data-type="sub"]').first()),t.length||(t=this.$desktop.children(".mindmap-node").first()),this.callEvent("beforeNodeActive",{node:t})&&(t.addClass("active"),this.makeNodeVisble(t),this.activedNode=t,this.isActive=!0,this.callEvent("onNodeActive",{node:t}))},s.prototype.focusNode=function(t,i){if(t.hasClass("readonly"))return e.messager.show(this.lang.ReadonlyTip),void 0;if(t.hasClass("active")&&this.callEvent("beforeNodeFocus",{node:t})){var o=t.addClass("focus").find(".text");o.attr("contenteditable","true"),this.makeNodeVisble(t),o.focus(),(i||typeof i===n)&&o.selectText(),this.isFocus=!0}},s.prototype.clearActiveNode=function(t){typeof t===n&&(t=this.$desktop.children(".mindmap-node.active")),t.removeClass("active"),this.isActive=!1,this.activedNode=null},s.prototype.clearFocusNode=function(t){typeof t===n&&(t=this.$desktop.children(".mindmap-node.focus")),t.removeClass("focus").find(".text").attr("contenteditable","false").blur(),this.isFocus=!1},s.prototype.bindEvents=function(){var e=this.$,i=this;e.resize(t.proxy(this.initSize,this)).click(t.proxy(this.onDesktopClick,this)),this.bindGlobalHotkeys(),this.$container.draggable({finish:function(t){i.display(t.smallOffset.x,t.smallOffset.y,!0)},drag:function(t){i.display(t.smallOffset.x,t.smallOffset.y,!0)}})},s.prototype.bindGlobalHotkeys=function(){var e=this.options;if(e.hotkeyEnable){var o=this,n=e.hotkeys;t(i).on("keydown",null,n.selectPrev,function(){o.selectNode("prev")}).on("keydown",null,n.selectNext,function(){o.selectNode("next")}).on("keydown",null,n.selectLeft,function(){o.selectNode("left")}).on("keydown",null,n.selectRight,function(){o.selectNode("right")}).on("keydown",null,n.deleteNode,function(){o.deleteNode(),8!=event.keyCode||o.isFocus||event.preventDefault()}).on("keydown",null,n.addBorther,function(){o.addBortherNode()}).on("keydown",null,n.addChild,function(t){o.addChildNode(),9==t.keyCode&&t.preventDefault()}).on("keydown",function(){if(event.keyCode>=48&&event.keyCode<=111&&o.isActive&&!o.isFocus){var t=o.activedNode;t&&(t.find(".text").text(""),o.focusNode(t))}}).on("keydown",null,n.centerCanvas,function(){o.display(0,0)})}},s.prototype.addBortherNode=function(){if(this.isActive){var t=this.getNodeData(this.activedNode.data("id"));if(t){var e="root"===t.type?t:this.getNodeData(t.parent),i=this.createDefaultNodeData(e);if(!this.callEvent("beforeAdd",{node:e,newNode:i}))return;this.update({action:"add",data:e,newData:i}),this.clearNodeStatus();var o=this.getNode(i.id);this.activeNode(o),this.focusNode(o,!0),this.callEvent("afterAdd",{node:e,newNode:i})}}},s.prototype.addChildNode=function(){if(this.isActive){var t=this.getNodeData(this.activedNode.data("id"));if(t){var e=this.createDefaultNodeData(t);if(!this.callEvent("beforeAdd",{node:t,newNode:e}))return;this.update({action:"add",data:t,newData:e}),this.clearNodeStatus();var i=this.getNode(e.id);this.activeNode(i),this.focusNode(i,!0),this.callEvent("afterAdd",{node:t,newNode:e})}}},s.prototype.deleteNode=function(){if(!this.isFocus&&this.isActive){var t=this.getNodeData(this.activedNode.data("id"));if(t){if(!this.callEvent("beforeDelte",{node:t}))return;this.update({action:"remove",data:t}),this.callEvent("afterDelete",{node:t})}}},s.prototype.selectNode=function(t){if(!this.isFocus){if(!this.isActive)return this.activeNode(),void 0;var e=null,i=this.getNodeData(this.activedNode.data("id")),o=null;switch("root"===i.type?t="prev"===t||"left"===t?"left":"right":"left"===t?t="left"==i.subSide?"child":"parent":"right"===t&&(t="right"==i.subSide?"child":"parent"),t){case"prev":o=i.ui.prevBorther;break;case"next":o=i.ui.nextBorther;break;case"parent":o=i.parent;break;case"child":i.count>0&&(o=i.children[0].id);break;case"left":if(i.count>0){o=i.children[0].id;for(var n in i.children){var a=i.children[n];if("left"==a.subSide){o=a.id;break}}}break;case"right":if(i.count>0){o=i.children[0].id;for(var n in i.children){var a=i.children[n];if("right"==a.subSide){o=a.id;break}}}}o&&(e=this.getNodeData(o)),e&&(this.clearNodeStatus(),this.activeNode(e.ui.element))}},s.prototype.selectNext=function(){if(!this.isFocus){var t=null;this.isActive||this.activeNode();var e=this.getNodeData(this.activedNode.data("id"));null!=e.ui.nextBorther&&(t=this.getNodeData(e.ui.nextBorther)),t&&(this.clearNodeStatus(),this.activeNode(t.ui.element))}},s.prototype.selectLeft=function(){if(!this.isFocus){var t=null;this.isActive||this.activeNode();var e=this.getNodeData(this.activedNode.data("id"));null!=e.ui.leftBorther&&(t=this.getNodeData(e.ui.leftBorther)),t&&(this.clearNodeStatus(),this.activeNode(t.ui.element))}},s.prototype.onDesktopClick=function(){this.$desktop,this.clearNodeStatus()},s.prototype.clearNodeStatus=function(){this.clearActiveNode(),this.clearFocusNode()},t.fn.mindmap=function(e){return this.each(function(){var i=t(this),o=i.data("zui.mindmap"),n="object"==typeof e&&e;o||i.data("zui.mindmap",o=new s(this,n)),"string"==typeof e&&o[e]()})},t.fn.mindmap.Constructor=s}(jQuery,window,document,Math),+function(t,e,i,o){"use strict";var n=function(e,i){this.$=t(e),this.initOptions(i),this.init()};n.DEFAULTS={coverColor:"#000",coverOpacity:.6,fixedRatio:!1,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},n.prototype.callEvent=function(e,i){return t.callEvent(this.options[e],i)},n.prototype.initOptions=function(e){this.options=t.extend({},n.DEFAULTS,this.$.data(),e),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},n.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},n.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('<div class="cover" style="background: {coverColor}; opacity: {coverOpacity}; filter:alpha(opacity={coverOpacityIE});"></div><div class="controller" style="width: {defaultWidth}px; height: {defaultHeight}px"><div class="control" data-direction="top"></div><div class="control" data-direction="right"></div><div class="control" data-direction="bottom"></div><div class="control" data-direction="left"></div><div class="control" data-direction="top-left"></div><div class="control" data-direction="top-right"></div><div class="control" data-direction="bottom-left"></div><div class="control" data-direction="bottom-right"></div></div><div class="cliper"><img src="{img}"/></div>'.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")},n.prototype.initSize=function(){var t=this;"undefined"==typeof t.imgWidth&&imgReady(t.options.img,function(){t.imgWidth=this.width,t.imgHeight=this.height});var e=setInterval(function(){"undefined"!=typeof t.imgWidth&&(clearInterval(e),t.width=o.min(t.imgWidth,t.$.width()),t.$canvas.css("width",this.width),t.$cliper.css("width",this.width),t.height=t.$canvas.height(),"undefined"==typeof t.left&&(t.left=o.floor((t.width-t.$controller.width())/2),t.top=o.floor((t.height-t.$controller.height())/2)),t.refreshSize())},0)},n.prototype.refreshSize=function(t){var e=this.options;this.clipWidth=o.max(e.minWidth,o.min(this.width,this.clipWidth)),this.clipHeight=o.max(e.minHeight,o.min(this.height,this.clipHeight)),e.fixedRatio&&(t&&"height"===t?(this.clipWidth=o.max(e.minWidth,o.min(this.width,this.clipHeight*e.defaultWidth/e.defaultHeight)),this.clipHeight=this.clipWidth*e.defaultHeight/e.defaultWidth):(this.clipHeight=o.max(e.minHeight,o.min(this.height,this.clipWidth*e.defaultHeight/e.defaultWidth)),this.clipWidth=this.clipHeight*e.defaultWidth/e.defaultHeight)),this.left=o.min(this.width-this.clipWidth,o.max(0,this.left)),this.top=o.min(this.height-this.clipHeight,o.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))},n.prototype.bindEvents=function(){var e=this,i=this.options;this.$.resize(t.proxy(this.initSize,this)),this.$btn.hover(function(){e.$.toggleClass("hover")}).click(function(){var o={width:e.width,height:e.height,left:e.left,top:e.top,right:e.right,bottom:e.bottom};if(e.callEvent("before",o)){var n=i.post||i.get||null;null!=n&&t.ajax({type:i.post?"POST":"GET",url:n,data:o}).done(function(t){e.callEvent("done",t)}).fail(function(t){e.callEvent("fail",t)}).always(function(t){e.callEvent("always",t)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(t){e.left+=t.smallOffset.x,e.top+=t.smallOffset.y,e.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(t){var n=t.element.data("direction"),a=t.smallOffset,s=!1;switch(n){case"left":case"top-left":case"bottom-left":e.left+=a.x,e.left=o.min(e.right-i.minWidth,o.max(0,e.left)),e.clipWidth=e.right-e.left;break;case"right":case"top-right":case"bottom-right":e.clipWidth+=a.x,e.clipWidth=o.min(e.width-e.left,o.max(i.minWidth,e.clipWidth))}switch(n){case"top":case"top-left":case"top-right":e.top+=a.y,e.top=o.min(e.bottom-i.minHeight,o.max(0,e.top)),e.clipHeight=e.bottom-e.top,s=!0;break;case"bottom":case"bottom-left":case"bottom-right":e.clipHeight+=a.y,e.clipHeight=o.min(e.height-e.top,o.max(i.minHeight,e.clipHeight)),s=!0}e.refreshSize(s)}})},t.fn.imgCutter=function(e){return this.each(function(){var i=t(this),o=i.data("zui.imgCutter"),a="object"==typeof e&&e;o||i.data("zui.imgCutter",o=new n(this,a)),"string"==typeof e&&o[e]()})},t.fn.imgCutter.Constructor=n,t(function(){t('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,window,document,Math),+function(t){"use strict";var e=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};e.DEFAULTS={trigger:"toggle",selector:null,animate:"slide",easing:"linear",animateSpeed:"fast",events:"click",preventDefault:!0,cancelBubble:!0,target:null},e.prototype.getOptions=function(i){return i=t.extend({},e.DEFAULTS,this.$.data(),i)},e.prototype.init=function(){this.bindEvents()},e.prototype.bindEvents=function(){var e=this.options;if(this.bindTrigger(e),t.isArray(e.triggers))for(var i in e.triggers)this.bindTrigger(t.extend({},e,e.triggers[i]));else if("string"==typeof e.triggers){var o=e.triggers.split("|");for(var i in o){var n=o[i].split(",",4);if(!(n.length<2)){var a={};n[0]&&(a.events=n[0]),n[1]&&(a.trigger=n[1]),n[2]&&(a.target=n[2]),n[3]&&(a.data=n[3]),this.bindTrigger(t.extend({},e,a))}}}},e.prototype.bindTrigger=function(e){var i=this;i.$.on(e.events,e.selector,function(o){var n=e.target&&"self"!=e.target?t(e.target):i.$,a={event:o,element:this,target:n,options:e};if(t.callEvent(e.before,a,i)){if(t.isFunction(e.trigger))t.callEvent(e.trigger,a,i);else{var s=e.trigger;switch("toggle"===s&&(s=n.hasClass("hide")?"show":"hide"),s){case"toggle":n.toggle();break;case"show":var r={duration:e.animateSpeed,easing:e.easing};n.removeClass("hide"),"slide"===e.animate?n.slideDown(r):"fade"===e.animate?n.fadeIn(r):n.show(r);break;case"hide":var r={duration:e.animateSpeed,easing:e.easing,complete:function(){n.addClass("hide")}};"slide"===e.animate?n.slideUp(r):"fade"===e.animate?n.fadeOut(r):n.hide(r);break;case"addClass":case"removeClass":case"toggleClass":n[s](e.data)}}t.callEvent(e.after,a,i),e.preventDefault&&o.preventDefault(),e.cancelBubble&&o.stopPropagation()}})},t.fn.autoTrigger=function(i){return this.each(function(){var o=t(this),n=o.data("zui.autoTrigger"),a="object"==typeof i&&i;n||o.data("zui.autoTrigger",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.autoTrigger.Constructor=e,t(function(){t('[data-toggle="autoTrigger"]').autoTrigger(),t('[data-toggle="toggle"]').autoTrigger(),t('[data-toggle="show"]').autoTrigger({trigger:"show"}),t('[data-toggle="hide"]').autoTrigger({trigger:"hide"}),t('[data-toggle="addClass"]').autoTrigger({trigger:"addClass"}),t('[data-toggle="removeClass"]').autoTrigger({trigger:"removeClass"}),t('[data-toggle="toggleClass"]').autoTrigger({trigger:"toggleClass"})})}(jQuery,window,document,Math);
\ No newline at end of file
......@@ -612,8 +612,6 @@
ui = nodeData.ui,
node = nodeData.ui.element;
node.find('.caption').text(nodeData.index);
ui.width = node.outerWidth(),
ui.height = node.outerHeight();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册