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

5 lines
54 KiB
JavaScript
Raw 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){"ace"in window||(window.ace={}),"helper"in window.ace||(window.ace.helper={}),"vars"in window.ace||(window.ace.vars={}),window.ace.vars.icon=" ace-icon ",window.ace.vars[".icon"]=".ace-icon",ace.vars.touch="ontouchstart"in window;var b=navigator.userAgent;ace.vars.webkit=!!b.match(/AppleWebKit/i),ace.vars.safari=!!b.match(/Safari/i)&&!b.match(/Chrome/i),ace.vars.android=ace.vars.safari&&!!b.match(/Android/i),ace.vars.ios_safari=!!b.match(/OS ([4-9])(_\d)+ like Mac OS X/i)&&!b.match(/CriOS/i),ace.vars.ie=window.navigator.msPointerEnabled||document.all&&document.querySelector,ace.vars.old_ie=document.all&&!document.addEventListener,ace.vars.very_old_ie=document.all&&!document.querySelector,ace.vars.firefox="MozAppearance"in document.documentElement.style,ace.vars.non_auto_fixed=ace.vars.android||ace.vars.ios_safari,ace.click_event=ace.vars.touch&&jQuery.fn.tap?"tap":"click"}(),function(a,b){a.unCamelCase=function(a){return a.replace(/([a-z])([A-Z])/g,function(a,b,c){return b+"-"+c.toLowerCase()})},a.strToVal=function(a){var b=a.match(/^(?:(true)|(false)|(null)|(\-?[\d]+(?:\.[\d]+)?)|(\[.*\]|\{.*\}))$/i),c=a;if(b)if(b[1])c=!0;else if(b[2])c=!1;else if(b[3])c=null;else if(b[4])c=parseFloat(a);else if(b[5])try{c=JSON.parse(a)}catch(d){}return c},a.getAttrSettings=function(b,c,d){if(b){var e=c instanceof Array?1:2,d=d?d.replace(/([^\-])$/,"$1-"):"";d="data-"+d;var f={};for(var g in c)if(c.hasOwnProperty(g)){var h,i=1==e?c[g]:g,j=a.unCamelCase(i.replace(/[^A-Za-z0-9]{1,}/g,"-")).toLowerCase();if(!(h=b.getAttribute(d+j)))continue;f[i]=a.strToVal(h)}return f}},a.scrollTop=function(){return document.scrollTop||document.documentElement.scrollTop||document.body.scrollTop},a.winHeight=function(){return window.innerHeight||document.documentElement.clientHeight},a.redraw=function(a,b){if(a){var c=a.style.display;a.style.display="none",a.offsetHeight,b!==!0?a.style.display=c:setTimeout(function(){a.style.display=c},10)}}}(ace.helper),jQuery(function(a){try{ace.demo.init()}catch(b){}}),function(a,b){ace.demo={functions:{},init:function(a){var a=!!a&&!0;if("undefined"==typeof requirejs||a)for(var b in ace.demo.functions)ace.demo.functions.hasOwnProperty(b)&&ace.demo.functions[b]()}},ace.demo.functions.basics=function(){ace.vars.non_auto_fixed&&a("body").addClass("mob-safari"),ace.vars.transition=ace.vars.animation||!!a.support.transition},ace.demo.functions.enableSidebar=function(){var b=a(".sidebar");a.fn.ace_sidebar&&b.ace_sidebar(),a.fn.ace_sidebar_scroll&&b.ace_sidebar_scroll({include_toggle:ace.vars.safari||ace.vars.ios_safari}),a.fn.ace_sidebar_hover&&b.ace_sidebar_hover({sub_hover_delay:750,sub_scroll_style:"no-track scroll-thin scroll-margin scroll-visible"})},ace.demo.functions.enableDemoAjax=function(){if(a.fn.ace_ajax){window.Pace&&(window.paceOptions={ajax:!0,document:!0,eventLag:!1});var b={close_active:!0,close_mobile_menu:"#sidebar",close_dropdowns:!0,default_url:"page/index",content_url:function(a){if(!a.match(/^page\//))return!1;var b=document.location.pathname;return b.match(/(\/ajax\/)(index\.html)?/)?b.replace(/(\/ajax\/)(index\.html)?/,"/ajax/content/"+a.replace(/^page\//,"")+".html"):b+"?"+a.replace(/\//,"=")}};b.loading_overlay="body",a("[data-ajax-content=true]").ace_ajax(b),a(window).on("error.ace_ajax",function(){a("[data-ajax-content=true]").each(function(){var b=a(this);b.ace_ajax("working")&&(window.Pace&&Pace.running&&Pace.stop(),b.ace_ajax("stopLoading",!0))})})}},ace.demo.functions.handleScrollbars=function(){var b=!!a.fn.ace_scroll;b&&a(".dropdown-content").ace_scroll({reset:!1,mouseWheelLock:!0}),b&&!ace.vars.old_ie&&(a(window).on("resize.reset_scroll",function(){a(".ace-scroll:not(.scroll-disabled)").not(":hidden").ace_scroll("reset")}),b&&a(document).on("settings.ace.reset_scroll",function(b,c){"sidebar_collapsed"==c&&a(".ace-scroll:not(.scroll-disabled)").not(":hidden").ace_scroll("reset")}))},ace.demo.functions.dropdownAutoPos=function(){a(document).on("click.dropdown.pos",'.dropdown-toggle[data-position="a
this.prehide=function(a){if(this.is_scrolling&&!o.get("minimized"))if(z()+a<y())this.disable();else if(0>a){var b=q.scrollTop()+a;if(0>b)return;g.style.top=-1*b+"px"}},this._reset=function(a){a===!0&&(this.sidebar_fixed=e(b,"fixed")),ace.vars.webkit?setTimeout(function(){j.reset()},0):this.reset()},this.set_hover=function(){t&&t.addClass("scroll-hover")},this.get=function(a){return this.hasOwnProperty(a)?this[a]:void 0},this.set=function(a,b){this.hasOwnProperty(a)&&(this[a]=b)},this.ref=function(){return this},this.updateStyle=function(a){null!=u&&u.update({styleClass:a})},l.on("hidden.ace.submenu.sidebar_scroll shown.ace.submenu.sidebar_scroll",".submenu",function(a){a.stopPropagation(),o.get("minimized")||(j._reset(),"shown"==a.type&&j.set_hover())}),A(!0)}}var d=ace.vars.safari&&navigator.userAgent.match(/version\/[1-5]/i),e="getComputedStyle"in window?function(a,b){return a.offsetHeight,window.getComputedStyle(a).position==b}:function(b,c){return b.offsetHeight,a(b).css("position")==c};a(document).on("settings.ace.sidebar_scroll",function(b,c,d){a(".sidebar[data-sidebar-scroll=true]").each(function(){var b=a(this),d=b.ace_sidebar_scroll("ref");if("sidebar_collapsed"==c&&e(this,"fixed"))"true"==b.attr("data-sidebar-hover")&&b.ace_sidebar_hover("reset"),d._reset();else if("sidebar_fixed"===c||"navbar_fixed"===c){var f=d.get("is_scrolling"),g=e(this,"fixed");d.set("sidebar_fixed",g),g&&!f?d._reset():g||d.disable()}})}),a(window).on("resize.ace.sidebar_scroll",function(){a(".sidebar[data-sidebar-scroll=true]").each(function(){var b=a(this);"true"==b.attr("data-sidebar-hover")&&b.ace_sidebar_hover("reset");var c=a(this).ace_sidebar_scroll("ref"),d=e(this,"fixed");c.set("sidebar_fixed",d),c._reset()})}),a.fn.ace_sidebar_scroll||(a.fn.ace_sidebar_scroll=function(d,e){var f,g=this.each(function(){var b=a(this),g=b.data("ace_sidebar_scroll"),h="object"==typeof d&&d;g||b.data("ace_sidebar_scroll",g=new c(this,h)),"string"==typeof d&&"function"==typeof g[d]&&(f=g[d](e))});return f===b?g:f},a.fn.ace_sidebar_scroll.defaults={scroll_to_active:!0,include_shortcuts:!0,include_toggle:!1,smooth_scroll:150,scroll_outside:!1,scroll_style:"",lock_anyway:!1})}(window.jQuery),function(a,b){function c(b,c){function h(b){var c=b,d=a(c),e=null,f=!1;this.show=function(){null!=e&&clearTimeout(e),e=null,d.addClass("hover-show hover-shown"),f=!0;for(var a=0;a<g.length;a++)g[a].find(".hover-show").not(".hover-shown").each(function(){i(this).hide()})},this.hide=function(){f=!1,d.removeClass("hover-show hover-shown hover-flip"),null!=e&&clearTimeout(e),e=null;var a=d.find("> .submenu").get(0);a&&j(a,"hide")},this.hideDelay=function(a){null!=e&&clearTimeout(e),d.removeClass("hover-shown"),e=setTimeout(function(){f=!1,d.removeClass("hover-show hover-flip"),e=null;var b=d.find("> .submenu").get(0);b&&j(b,"hide"),"function"==typeof a&&a.call(this)},m.settings.sub_hover_delay)},this.is_visible=function(){return f}}function i(b){var c=a(b).data("subHide");return c||a(b).data("subHide",c=new h(b)),c}function j(b,c){var d=a(b).data("ace_scroll");return d?"string"==typeof c?(d[c](),!0):d:!1}function k(c){var d=a(this),f=a(c);c.style.top="",c.style.bottom="";var g=null;q.minimized&&(g=d.find(".menu-text").get(0))&&(g.style.marginTop="");var h=ace.helper.scrollTop(),i=0,k=h;w&&(i=b.offsetTop,k+=i+1);var m=d.offset();m.top=parseInt(m.top);var n,o=0;c.style.maxHeight="";var r=c.scrollHeight,n=d.height();g&&(o=n,m.top+=o);var t=parseInt(m.top+r),v=0,y=u.height(),z=parseInt(m.top-k-o),A=y,B=q.horizontal,C=!1;B&&this.parentNode==p&&(v=0,m.top+=d.height(),C=!0),!C&&(v=t-(y+h))>=0&&(v=z>v?v:z,0==v&&(v=20),z-v>10&&(v+=parseInt(Math.min(25,z-v))),m.top+(n-o)>t-v&&(v-=m.top+(n-o)-(t-v)),v>0&&(c.style.top=-v+"px",g&&(g.style.marginTop=-v+"px"))),0>v&&(v=0);var D=v>0&&v>n-20;if(D?d.addClass("pull_up"):d.removeClass("pull_up"),B)if(d.parent().parent().hasClass("hover-flip"))d.addClass("hover-flip");else{var E=f.offset(),F=f.width(),G=u.width();E.left+F>G&&d.addClass("hover-flip")}var H=d.hasClass("hover")&&!q.mobile_view;if(!(H&&f.find("> li > .submenu").length>0)){var I