text: /*!
   * Bootstrap Context Menu
   * Author: @sydcanem
   * https://github.com/sydcanem/bootstrap-contextmenu
   *
   * Inspired by Bootstrap's dropdown plugin.
   * Bootstrap (http://getbootstrap.com).
   *
   * Licensed under MIT
   * ========================================================= */
  (function(b){var a='[data-toggle="context"]';var c=function(e,d){this.$element=b(e);this.before=d.before||this.before;this.onItem=d.onItem||this.onItem;this.scopes=d.scopes||null;if(d.target){this.$element.data("target",d.target)}this.listen()};c.prototype={constructor:c,show:function(i){var h,f,j,g,d={relatedTarget:this,target:i.currentTarget};if(this.isDisabled()){return}this.closemenu();if(this.before.call(this,i,b(i.currentTarget))===false){return}h=this.getMenu();h.trigger(f=b.Event("show.bs.context",d));j=this.getPosition(i,h);g="li:not(.divider)";h.attr("style","").css(j).addClass("open").on("click.context.data-api",g,b.proxy(this.onItem,this,b(i.currentTarget))).trigger("shown.bs.context",d);b("html").on("click.context.data-api",h.selector,b.proxy(this.closemenu,this));return false},closemenu:function(i){var h,f,g,d;h=this.getMenu();if(!h.hasClass("open")){return}d={relatedTarget:this};h.trigger(f=b.Event("hide.bs.context",d));g="li:not(.divider)";h.removeClass("open").off("click.context.data-api",g).trigger("hidden.bs.context",d);b("html").off("click.context.data-api",h.selector);if(i&&b(i.target).closest("a[data-pjax]").length===0){i.stopPropagation()}},keydown:function(d){if(d.which==27){this.closemenu(d)}},before:function(d){return true},onItem:function(d){return true},listen:function(){this.$element.on("contextmenu.context.data-api",this.scopes,b.proxy(this.show,this));b("html").on("click.context.data-api",b.proxy(this.closemenu,this));b("html").on("keydown.context.data-api",b.proxy(this.keydown,this))},destroy:function(){this.$element.off(".context.data-api").removeData("context");b("html").off(".context.data-api")},isDisabled:function(){return this.$element.hasClass("disabled")||this.$element.attr("disabled")},getMenu:function(){var d=this.$element.data("target"),e;if(!d){d=this.$element.attr("href");d=d&&d.replace(/.*(?=#[^\s]*$)/,"")}e=b(d);return e&&e.length?e:this.$element.find(d)},getPosition:function(o,f){var k=o.clientX,j=o.clientY,m=b(window).width(),l=b(window).height(),n=f.find(".dropdown-menu").outerWidth(),i=f.find(".dropdown-menu").outerHeight(),p={"position":"absolute","z-index":9999},g,h,d;if(j+i>l){g={"top":j-i+b(window).scrollTop()}}else{g={"top":j+b(window).scrollTop()}}if((k+n>m)&&((k-n)>0)){h={"left":k-n+b(window).scrollLeft()}}else{h={"left":k+b(window).scrollLeft()}}d=f.offsetParent().offset();h.left=h.left-d.left;g.top=g.top-d.top;return b.extend(p,g,h)}};b.fn.contextmenu=function(d,f){return this.each(function(){var h=b(this),g=h.data("context"),e=(typeof d=="object")&&d;if(!g){h.data("context",(g=new c(h,e)))}if(typeof d=="string"){g[d].call(g,f)}})};b.fn.contextmenu.Constructor=c;b(document).on("contextmenu.context.data-api",function(){b(a).each(function(){var d=b(this).data("context");if(!d){return}d.closemenu()})}).on("contextmenu.context.data-api",a,function(d){b(this).contextmenu("show",d);d.preventDefault();d.stopPropagation()})}(jQuery));