/*! * Ace v1.3.3 */ if("undefined"==typeof jQuery)throw new Error("Ace's JavaScript requires jQuery");!function(a,b){var c=function(c,d){function e(a){a.preventDefault(),a.stopPropagation();var b=B.offset(),c=b[p],d=v?a.pageY:a.pageX;d>c+H?(H=d-c-G+J,H>I&&(H=I)):(H=d-c-J,0>H&&(H=0)),m.update_scroll()}function f(b){b.preventDefault(),b.stopPropagation(),cb=bb=v?b.pageY:b.pageX,R=!0,a("html").off("mousemove.ace_scroll").on("mousemove.ace_scroll",g),a(S).off("mouseup.ace_scroll").on("mouseup.ace_scroll",h),B.addClass("active"),T&&m.$element.trigger("drag.start")}function g(a){a.preventDefault(),a.stopPropagation(),cb=v?a.pageY:a.pageX,cb-bb+H>I?cb=bb+I-H:0>cb-bb+H&&(cb=bb-H),H+=cb-bb,bb=cb,0>H?H=0:H>I&&(H=I),m.update_scroll()}function h(b){b.preventDefault(),b.stopPropagation(),R=!1,a("html").off(".ace_scroll"),a(S).off(".ace_scroll"),B.removeClass("active"),T&&m.$element.trigger("drag.end"),x&&X&&!Z&&j()}function i(a){var b=+new Date;if($&&b-eb>1e3){var c=A[u];_!=c&&(_=c,ab=!0,m.reset(!0)),eb=b}x&&X&&(null!=db&&(clearTimeout(db),db=null),B.addClass("not-idle"),Z||1!=a||j())}function j(){null!=db&&(clearTimeout(db),db=null),db=setTimeout(function(){db=null,B.removeClass("not-idle")},Y)}function k(){B.css("visibility","hidden").addClass("scroll-hover"),O=v?parseInt(B.outerWidth())||0:parseInt(B.outerHeight())||0,B.css("visibility","").removeClass("scroll-hover")}function l(){if(W!==!1){var a=z.offset(),b=a.left,c=a.top;v?N||(b+=z.outerWidth()-O):N||(c+=z.outerHeight()-O),W===!0?B.css({top:parseInt(c),left:parseInt(b)}):"left"===W?B.css("left",parseInt(b)):"top"===W&&B.css("top",parseInt(c))}}var m=this,n=ace.helper.getAttrSettings(c,a.fn.ace_scroll.defaults),o=a.extend({},a.fn.ace_scroll.defaults,d,n);this.size=0,this.lock=!1,this.lock_anyway=!1,this.$element=a(c),this.element=c;var p,q,r,s,t,u,v=!0,w=!1,x=!1,y=!1,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=0,H=0,I=0,J=0,K=!0,L=!1,M="",N=!1,O=0,P=1,Q=!1,R=!1,S="onmouseup"in window?window:"html",T=o.dragEvent||!1,U=d.scrollEvent||!1,V=o.detached||!1,W=o.updatePos||!1,X=o.hideOnIdle||!1,Y=o.hideDelay||1500,Z=!1,$=o.observeContent||!1,_=0,ab=!0;this.create=function(b){if(!y){b&&(o=a.extend({},a.fn.ace_scroll.defaults,b)),this.size=parseInt(this.$element.attr("data-size"))||o.size||200,v=!o.horizontal,p=v?"top":"left",q=v?"height":"width",r=v?"maxHeight":"maxWidth",s=v?"clientHeight":"clientWidth",t=v?"scrollTop":"scrollLeft",u=v?"scrollHeight":"scrollWidth",this.$element.addClass("ace-scroll"),"static"==this.$element.css("position")?(Q=this.element.style.position,this.element.style.position="relative"):Q=!1;var c=null;V?c=a('
').appendTo("body"):(this.$element.wrapInner('
'),this.$element.prepend('
')),z=this.$element,V||(z=this.$element.find(".scroll-content").eq(0)),v||z.wrapInner("
"),A=z.get(0),V?(B=c,l()):B=this.$element.find(".scroll-track").eq(0),C=B.find(".scroll-bar").eq(0),D=B.get(0),E=C.get(0),F=E.style,v||B.addClass("scroll-hz"),o.styleClass&&(M=o.styleClass,B.addClass(M),N=!!M.match(/scroll\-left|scroll\-top/)),0==O&&(B.show(),k()),B.hide(),B.on("mousedown",e),C.on("mousedown",f),z.on("scroll",function(){K&&(H=parseInt(Math.round(this[t]*P)),F[p]=H+"px"),K=!1,U&&this.$element.trigger("scroll",[A])}),o.mouseWheel&&(this.lock=o.mouseWheelLock,this.lock_anyway=o.lockAnyway,this.$element.on(a.event.special.mousewheel?"mousewheel.ace_scroll":"mousewheel.ace_scroll DOMMouseScroll.ace_scroll",function(b){if(!w){if(i(!0),!x)return!m.lock_anyway;R&&(R=!1,a("html").off(".ace_scroll"),a(S).off(".ace_scroll"),T&&m.$element.trigger("drag.end")),b.deltaY=b.deltaY||0;var c=b.deltaY>0||b.originalEvent.detail<0||b.originalEvent.wheelDelta>0?1:-1,d=!1,e=A[s],f=A[t];m.lock||(d=-1==c?A[u]<=f+e:0==f),m.move_bar(!0);var g=parseInt(e/8);return 80>g&&(g=80),g>m.size&&(g=m.size),g+=1,A[t]=f-c*g,d&&!m.lock_anyway}}));var d=ace.vars.touch&&"ace_drag"in a.event.special&&o.touchDrag;if(d){var g="",h=d?"ace_drag":"swipe";this.$element.on(h+".ace_scroll",function(a){if(w)return void(a.retval.cancel=!0);if(i(!0),!x)return void(a.retval.cancel=this.lock_anyway);if(g=a.direction,v&&("up"==g||"down"==g)||!v&&("left"==g||"right"==g)){var b=v?a.dy:a.dx;0!=b&&(Math.abs(b)>20&&d&&(b=2*b),m.move_bar(!0),A[t]=A[t]+b)}})}X&&B.addClass("idle-hide"),$&&B.on("mouseenter.ace_scroll",function(){Z=!0,i(!1)}).on("mouseleave.ace_scroll",function(){Z=!1,0==R&&j()}),this.$element.on("mouseenter.ace_scroll touchstart.ace_scroll",function(){ab=!0,$?i(!0):o.hoverReset&&m.reset(!0),B.addClass("scroll-hover")}).on("mouseleave.ace_scroll touchend.ace_scroll",function(){B.removeClass("scroll-hover")}),v||z.children(0).css(q,this.size),z.css(r,this.size),w=!1,y=!0}},this.is_active=function(){return x},this.is_enabled=function(){return!w},this.move_bar=function(a){K=a},this.get_track=function(){return D},this.reset=function(a){if(!w){y||this.create();var b=this.size;if(!a||ab){if(ab=!1,V){var c=parseInt(Math.round((parseInt(z.css("border-top-width"))+parseInt(z.css("border-bottom-width")))/2.5));b-=c}var d=v?A[u]:b;if(v&&0==d||!v&&0==this.element.scrollWidth)return void B.removeClass("scroll-active");var e=v?b:A.clientWidth;v||z.children(0).css(q,b),z.css(r,this.size),d>e?(x=!0,B.css(q,e).show(),P=parseFloat((e/d).toFixed(5)),G=parseInt(Math.round(e*P)),J=parseInt(Math.round(G/2)),I=e-G,H=parseInt(Math.round(A[t]*P)),F[q]=G+"px",F[p]=H+"px",B.addClass("scroll-active"),0==O&&k(),L||(o.reset&&(A[t]=0,F[p]=0),L=!0),V&&l()):(x=!1,B.hide(),B.removeClass("scroll-active"),z.css(r,""))}}},this.disable=function(){A[t]=0,F[p]=0,w=!0,x=!1,B.hide(),this.$element.addClass("scroll-disabled"),B.removeClass("scroll-active"),z.css(r,"")},this.enable=function(){w=!1,this.$element.removeClass("scroll-disabled")},this.destroy=function(){x=!1,w=!1,y=!1,this.$element.removeClass("ace-scroll scroll-disabled scroll-active"),this.$element.off(".ace_scroll"),V||(v||z.find("> div").children().unwrap(),z.children().unwrap(),z.remove()),B.remove(),Q!==!1&&(this.element.style.position=Q),null!=db&&(clearTimeout(db),db=null)},this.modify=function(b){b&&(o=a.extend({},o,b)),this.destroy(),this.create(),ab=!0,this.reset(!0)},this.update=function(c){c&&(o=a.extend({},o,c)),this.size=c.size||this.size,this.lock=c.mouseWheelLock||this.lock,this.lock_anyway=c.lockAnyway||this.lock_anyway,c.styleClass!=b&&(M&&B.removeClass(M),M=c.styleClass,M&&B.addClass(M),N=!!M.match(/scroll\-left|scroll\-top/))},this.start=function(){A[t]=0},this.end=function(){A[t]=A[u]},this.hide=function(){B.hide()},this.show=function(){B.show()},this.update_scroll=function(){K=!1,F[p]=H+"px",A[t]=parseInt(Math.round(H/P))};var bb=-1,cb=-1,db=null,eb=0;return this.track_size=function(){return 0==O&&k(),O},this.create(),ab=!0,this.reset(!0),_=A[u],this};a.fn.ace_scroll=function(d,e){var f,g=this.each(function(){var b=a(this),g=b.data("ace_scroll"),h="object"==typeof d&&d;g||b.data("ace_scroll",g=new c(this,h)),"string"==typeof d&&(f=g[d](e))});return f===b?g:f},a.fn.ace_scroll.defaults={size:200,horizontal:!1,mouseWheel:!0,mouseWheelLock:!1,lockAnyway:!1,styleClass:!1,observeContent:!1,hideOnIdle:!1,hideDelay:1500,hoverReset:!0,reset:!1,dragEvent:!1,touchDrag:!0,touchSwipe:!1,scrollEvent:!1,detached:!1,updatePos:!0}}(window.jQuery),function(a,b){var c=function(b,c){var d=ace.helper.getAttrSettings(b,a.fn.ace_colorpicker.defaults),e=a.extend({},a.fn.ace_colorpicker.defaults,c,d),f=a(b),g="",h="",i=null,j=[];f.addClass("hide").find("option").each(function(){var a="colorpick-btn",b=this.value.replace(/[^\w\s,#\(\)\.]/g,"");this.value!=b&&(this.value=b),this.selected&&(a+=" selected",h=b),j.push(b),g+='
  • '}).end().on("change.color",function(){f.next().find(".btn-colorpicker").css("background-color",this.value)}).after('");var k=f.next().find(".dropdown-menu");k.on(ace.click_event,function(b){var c=a(b.target);if(!c.is(".colorpick-btn"))return!1;i&&i.removeClass("selected"),i=c,i.addClass("selected");var d=i.data("color");return f.val(d).trigger("change"),b.preventDefault(),!0}),i=f.next().find("a.selected"),this.pick=function(c,d){if("number"==typeof c){if(c>=j.length)return;b.selectedIndex=c,k.find("a:eq("+c+")").trigger(ace.click_event)}else if("string"==typeof c){var e=c.replace(/[^\w\s,#\(\)\.]/g,"");if(c=j.indexOf(e),-1==c&&d===!0&&(j.push(e),a("