bnbweb/back/assets/js/ace-elements.min.js

5 lines
40 KiB
JavaScript
Raw Permalink Normal View History

2022-11-14 15:49:28 +00:00
/*!
* Ace v1.4.0
*/
if("undefined"==typeof jQuery)throw new Error("Ace's JavaScript requires jQuery");!function(a,b){var c=function(b,c){function d(a){a.preventDefault(),a.stopPropagation();var b=A.offset(),c=b[o],d=u?a.pageY:a.pageX;d>c+G?(G=d-c-F+I,G>H&&(G=H)):(G=d-c-I,0>G&&(G=0)),l.update_scroll()}function e(b){b.preventDefault(),b.stopPropagation(),ba=aa=u?b.pageY:b.pageX,Q=!0,a("html").off("mousemove.ace_scroll").on("mousemove.ace_scroll",f),a(R).off("mouseup.ace_scroll").on("mouseup.ace_scroll",g),A.addClass("active"),S&&l.$element.trigger("drag.start")}function f(a){a.preventDefault(),a.stopPropagation(),ba=u?a.pageY:a.pageX,ba-aa+G>H?ba=aa+H-G:0>ba-aa+G&&(ba=aa-G),G+=ba-aa,aa=ba,0>G?G=0:G>H&&(G=H),l.update_scroll()}function g(b){b.preventDefault(),b.stopPropagation(),Q=!1,a("html").off(".ace_scroll"),a(R).off(".ace_scroll"),A.removeClass("active"),S&&l.$element.trigger("drag.end"),w&&W&&!Y&&i()}function h(a){var b=+new Date;if(Z&&b-da>1e3){var c=z[t];$!=c&&($=c,_=!0,l.reset(!0)),da=b}w&&W&&(null!=ca&&(clearTimeout(ca),ca=null),A.addClass("not-idle"),Y||1!=a||i())}function i(){null!=ca&&(clearTimeout(ca),ca=null),ca=setTimeout(function(){ca=null,A.removeClass("not-idle")},X)}function j(){A.css("visibility","hidden").addClass("scroll-hover"),N=u?parseInt(A.outerWidth())||0:parseInt(A.outerHeight())||0,A.css("visibility","").removeClass("scroll-hover")}function k(){if(V!==!1){var a=y.offset(),b=a.left,c=a.top;u?M||(b+=y.outerWidth()-N):M||(c+=y.outerHeight()-N),V===!0?A.css({top:parseInt(c),left:parseInt(b)}):"left"===V?A.css("left",parseInt(b)):"top"===V&&A.css("top",parseInt(c))}}var l=this,m=ace.helper.getAttrSettings(b,a.fn.ace_scroll.defaults),n=a.extend({},a.fn.ace_scroll.defaults,c,m);this.size=0,this.lock=!1,this.lock_anyway=!1,this.$element=a(b),this.element=b;var o,p,q,r,s,t,u=!0,v=!1,w=!1,x=!1,y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=0,G=0,H=0,I=0,J=!0,K=!1,L="",M=!1,N=0,O=1,P=!1,Q=!1,R="onmouseup"in window?window:"html",S=n.dragEvent||!1,T=c.scrollEvent||!1,U=n.detached||!1,V=n.updatePos||!1,W=n.hideOnIdle||!1,X=n.hideDelay||1500,Y=!1,Z=n.observeContent||!1,$=0,_=!0;this.ref=function(){return this},this.create=function(b){if(!x){b&&(n=a.extend({},a.fn.ace_scroll.defaults,b)),this.size=parseInt(this.$element.attr("data-size"))||n.size||200,u=!n.horizontal,o=u?"top":"left",p=u?"height":"width",q=u?"maxHeight":"maxWidth",r=u?"clientHeight":"clientWidth",s=u?"scrollTop":"scrollLeft",t=u?"scrollHeight":"scrollWidth",this.$element.addClass("ace-scroll"),"static"==this.$element.css("position")?(P=this.element.style.position,this.element.style.position="relative"):P=!1;var c=null;U?c=a('<div class="scroll-track scroll-detached"><div class="scroll-bar"></div></div>').appendTo("body"):(this.$element.wrapInner('<div class="scroll-content" />'),this.$element.prepend('<div class="scroll-track"><div class="scroll-bar"></div></div>')),y=this.$element,U||(y=this.$element.find(".scroll-content").eq(0)),u||y.wrapInner("<div />"),z=y.get(0),U?(A=c,k()):A=this.$element.find(".scroll-track").eq(0),B=A.find(".scroll-bar").eq(0),C=A.get(0),D=B.get(0),E=D.style,u||A.addClass("scroll-hz"),n.styleClass&&(L=n.styleClass,A.addClass(L),M=!!L.match(/scroll\-left|scroll\-top/)),0==N&&(A.show(),j()),A.hide(),A.on("mousedown",d),B.on("mousedown",e),y.on("scroll",function(){J&&(G=parseInt(Math.round(this[s]*O)),E[o]=G+"px"),J=!1,T&&this.$element.trigger("scroll",[z])}),n.mouseWheel&&(this.lock=n.mouseWheelLock,this.lock_anyway=n.lockAnyway,this.$element.on(a.event.special.mousewheel?"mousewheel.ace_scroll":"mousewheel.ace_scroll DOMMouseScroll.ace_scroll",function(b){if(!v){if(h(!0),!w)return!l.lock_anyway;Q&&(Q=!1,a("html").off(".ace_scroll"),a(R).off(".ace_scroll"),S&&l.$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=z[r],f=z[s];l.lock||(d=-1==c?z[t]<=f+e:0==f),l.move_bar(!0);var g=parseInt(e/8);return 80>g&&(g=80),g>l.size&&(g=l.size),g+=1,z[s]=f-c*g,d&&!l.lock_anyway}}));var f=ace.vars.touch&&"ace_drag"in a.event.special&&n.touchDrag;if(f){var g="",m=f?"ac
activeToolbarClass:"active",toolbarSelector:b},d.wysiwyg||{});a(this).wysiwyg(n)}),this}}(window.jQuery),function(a,b){function c(b,c){var d=ace.helper.getAttrSettings(b,a.fn.ace_spinner.defaults),e=a.extend({},a.fn.ace_spinner.defaults,c,d),f=e.max;f=(""+f).length;var g=parseInt(Math.max(20*f+40,90)),h=a(b),i="btn-sm",j=2;h.hasClass("input-sm")?(i="btn-xs",j=1):h.hasClass("input-lg")&&(i="btn-lg",j=3),2==j?g+=25:3==j&&(g+=50),h.addClass("spinbox-input form-control text-center").wrap('<div class="ace-spinner middle">');var k=h.closest(".ace-spinner").spinbox(e).wrapInner("<div class='input-group'></div>"),l=k.data("fu.spinbox");e.on_sides?(h.before('<div class="spinbox-buttons input-group-btn"> <button type="button" class="btn spinbox-down '+i+" "+e.btn_down_class+'"> <i class="icon-only '+ace.vars.icon+e.icon_down+'"></i> </button> </div>').after('<div class="spinbox-buttons input-group-btn"> <button type="button" class="btn spinbox-up '+i+" "+e.btn_up_class+'"> <i class="icon-only '+ace.vars.icon+e.icon_up+'"></i> </button> </div>'),k.addClass("touch-spinner"),k.css("width",g+"px")):(h.after('<div class="spinbox-buttons input-group-btn"> <button type="button" class="btn spinbox-up '+i+" "+e.btn_up_class+'"> <i class="icon-only '+ace.vars.icon+e.icon_up+'"></i> </button> <button type="button" class="btn spinbox-down '+i+" "+e.btn_down_class+'"> <i class="icon-only '+ace.vars.icon+e.icon_down+'"></i> </button> </div>'),ace.vars.touch||e.touch_spinner?(k.addClass("touch-spinner"),k.css("width",g+"px")):(h.next().addClass("btn-group-vertical"),k.css("width",g+"px"))),k.on("changed",function(){h.trigger("change")}),this._call=function(a,b){l[a](b)}}a.fn.ace_spinner=function(d,e){var f,g=this.each(function(){var b=a(this),g=b.data("ace_spinner"),h="object"==typeof d&&d;g||(h=a.extend({},a.fn.ace_spinner.defaults,d),b.data("ace_spinner",g=new c(this,h))),"string"==typeof d&&(f=g._call(d,e))});return f===b?g:f},a.fn.ace_spinner.defaults={icon_up:"fa fa-chevron-up",icon_down:"fa fa-chevron-down",on_sides:!1,btn_up_class:"",btn_down_class:"",max:999,touch_spinner:!1}}(window.jQuery),function(a,b){a.fn.aceTree=a.fn.ace_tree=function(b){var c={"open-icon":ace.vars.icon+"fa fa-folder-open","close-icon":ace.vars.icon+"fa fa-folder","toggle-icon":ace.vars.icon+"fa fa-play","selected-icon":ace.vars.icon+"fa fa-check","unselected-icon":ace.vars.icon+"fa fa-times","base-icon":ace.vars.icon+"fa","folder-open-icon":"fa fa-plus-square-o","folder-close-icon":"fa fa-plus-minus-o",loadingHTML:"Loading..."};return this.each(function(){var d=ace.helper.getAttrSettings(this,c),e=a.extend({},c,b,d),f=a(this);f.addClass("tree").attr("role","tree"),f.html('<li class="tree-branch hide" data-template="treebranch" role="treeitem" aria-expanded="false"> '+(e.folderSelect?'<i class="icon-caret '+e["folder-open-icon"]+'"></i>&nbsp;':"")+' <div class="tree-branch-header"> <span class="tree-branch-name"> <i class="icon-folder '+e["close-icon"]+'"></i> <span class="tree-label"></span> </span> </div> <ul class="tree-branch-children" role="group"></ul> <div class="tree-loader" role="alert">'+e.loadingHTML+'</div> </li> <li class="tree-item hide" data-template="treeitem" role="treeitem"> <span class="tree-item-name"> '+(null==e["unselected-icon"]?"":'<i class="icon-item '+e["unselected-icon"]+'"></i>')+' <span class="tree-label"></span> </span> </li>'),f.addClass(1==e.selectable?"tree-selectable":"tree-unselectable"),f.tree(e)}),this}}(window.jQuery),function(a,b){a.fn.aceWizard=a.fn.ace_wizard=function(b){return this.each(function(){var c=a(this);c.wizard(),ace.vars.old_ie&&c.find("ul.steps > li").last().addClass("last-child");var d=b&&b.buttons?a(b.buttons):c.siblings(".wizard-actions").eq(0),e=c.data("fu.wizard");e.$prevBtn.remove(),e.$nextBtn.remove(),e.$prevBtn=d.find(".btn-prev").eq(0).on(ace.click_event,function(){e.previous()}).attr("disabled","disabled"),e.$nextBtn=d.find(".btn-next").eq(0).on(ace.click_event,function(){e.next()}).remov