PageSourceSearch

https://dstsikkim.gov.in/core-summernote-dropdown-menu-bs-5.js

js dstsikkim.gov.in collected 2026-10-02 18:50:11 UTC 13,040 bytes, 1 lines download raw bytes

1!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(window.jQuery)}((function(t){"use strict";var e,n="navDropdown",o="bs.nav-dropdown",r="."+o,i=".data-api",s=t.fn[n],a={HIDE:"hide"+r,HIDDEN:"hidden"+r,SHOW:"show"+r,SHOWN:"shown"+r,CLICK:"click"+r,READY:"ready"+r,COLLAPSE:"collapse"+r,LOAD_DATA_API:"ready"+r+i,CLICK_DATA_API:"click"+r+i,RESIZE_DATA_API:"resize"+r+i,KEYDOWN_DATA_API:"keydown"+r+i,NAVBAR_COLLAPSE:"collapse.bs.navbar-dropdown"},p={ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40},l={XS:544,SM:768,MD:992,LG:1200,XL:1/0},d="dropdown-backdrop",u="disabled",c="open",h="nav-dropdown-sm",f={BASE:".nav-dropdown",DROPDOWN:".dropdown",DROPDOWN_MENU:".dropdown-menu",BACKDROP:"."+d,DATA_BUTTON:"[data-button]",DATA_TOGGLE:'[data-toggle="dropdown-submenu"]',FORM_CHILD:".dropdown form"},g=function(){function e(e,n){"length"in e||(e=[e]),this.props={},this.length=e.length,n&&(this.prevItem=n,t.extend(this.props,n.props));for(var o=0;o<e.length;o++)this[o]=e[o]}return e.prototype.eq=function(t){return new e(this[t]?this[t]:[],this)},e.prototype.parent=function(){return new e(t(this).map((function(){var n=new e(this);return n.is(":upper")?null:t(n.is(":toggle")?this.parentNode.parentNode:this).closest(f.DROPDOWN).find(">"+f.DATA_TOGGLE)[0]})),this)},e.prototype.parents=function(n){var o=t(this).map((function(){return new e(this).is(":toggle")?this.parentNode:this})).parentsUntil(f.BASE,f.DROPDOWN);return":upper"===n&&(o=o.last()),new e(o=o.find(">"+f.DATA_TOGGLE),this)},e.prototype.children=function(n){var o=[];return t(this).each((function(){var r,i=new e(this);if(i.is(":root"))r=t(this);else{if(!i.is(":toggle"))return;r=t(this).parent().find(">"+f.DROPDOWN_MENU)}(n?r.find("a"):i.is(":root")?r.find(">li>a"):r.find(">a, >"+f.DROPDOWN+">a")).each((function(){n&&!this.offsetWidth&&!this.offsetHeight||this.disabled||t(this).is(f.DATA_BUTTON)||t(this).hasClass(u)||~t.inArray(this,o)||o.push(this)}))})),new e(o,this)},e.prototype.root=function(){return new e(t(this).closest(f.BASE),this)},e.prototype.jump=function(n){if(n=n||"next",!this.length)return new e([],this);var o,r=this.eq(0);o=this.is(":flat")||r.is(":upper")?r.root().children(this.is(":flat")):r.parent().children();var i=t.inArray(this[0],o);if(!o.length||!~i)return new e([],this);if("next"==n){if((i+=1)<o.length)return new e(o[i],this);n="first"}else if("prev"==n){if((i-=1)>=0)return new e(o[i],this);n="last"}return new e("first"==n?o[0]:"last"==n?o[o.length-1]:[],this)},e.prototype.next=function(){return this.jump("next")},e.prototype.prev=function(){return this.jump("prev")},e.prototype.first=function(){return this.jump("first")},e.prototype.last=function(){return this.jump("last")},e.prototype.prop=function(e,n){return arguments.length?arguments.length>1?(this.props[e]=n,this):"object"==typeof arguments[0]?(t.extend(this.props,arguments[0]),this):e in this.props?this.props[e]:null:t.extend({},this.props)},e.prototype.removeProp=function(t){return delete this.props[t],this},e.prototype.is=function(e){for(var n=t(this),o=(e||"").split(/(?=[*#.\[:\s])/);e=o.pop();)switch(e){case":root":if(!n.is(f.BASE))return!1;break;case":upper":if(!n.parent().parent().is(f.BASE))return!1;break;case":opened":case":closed":if(":opened"==e!=n.parent().hasClass(c))return!1;case":toggle":if(!n.is(f.DATA_TOGGLE))return!1;break;default:if(!this.props[e])return!1}return!0},e.prototype.open=function(){return this.is(":closed")&&this.click(),this},e.prototype.close=function(){return this.is(":opened")&&this.click(),this},e.prototype.focus=function(){return this.length&&this[0].focus(),this},e.prototype.click=function(){return this.length&&t(this[0]).trigger("click"),this},function(t){return new e(t)}}(),v=function(e){this._element=e,t(this._element).on(a.CLICK,this.toggle)};v.prototype.toggle=function(e){if(this.disabled||t(this).hasClass(u))return!1;var n=t(this.parentNode),o=n.hasClass(c),r=v._isCollapsed(t(this).closest(f.BASE));if(v._clearMenus(t.Event("click",{target:this,data:{toggles:r?[this]:null}})),o)return!1;if("ontouchstart"in document.documentElement&&!n.closest(f.DROPDOWN+"."+c).length){var i=document.createElement("div");i.className=d,t(i).insertBefore(t(this).closest(f.BASE)),t(i).on("click",v._clearMenus)}var s={relatedTarget:this},p=t.Event(a.SHOW,s);return n.trigger(p),p.isDefaultPrevented()||(this.focus(),this.setAttribute("aria-expanded","true"),n.toggleClass(c),n.trigger(t.Event(a.SHOWN,s))),!1},v.prototype.dispose=function(){t.removeData(this._element,o),t(this._element).off(r),this._element=null},v._clearMenus=function(e){if(3!==(e=e||{}).which){var n,o=function(){return!1};if(e.target){if(this===document)if(t(e.target).is("a:not([disabled], ."+u+")"))n=t.Event(a.COLLAPSE,{relatedTarget:e.target});else{var r=e.targetWrapper&&t(e.targetWrapper).find(f.BASE)||t(e.target).closest(f.BASE);if(v._isCollapsed(r))return}else if(t(e.target).hasClass(d)){var i=t(e.target).next();if(i.is(f.BASE)&&v._isCollapsed(i))return}
1t(e.target).is(f.DATA_TOGGLE)?o=t(e.target.parentNode).parents(f.DROPDOWN).find(">"+f.DATA_TOGGLE):t(f.BACKDROP).remove()}for(var s=e.data&&e.data.toggles&&t(e.data.toggles).parent().find(f.DATA_TOGGLE)||t.makeArray(t(f.DATA_TOGGLE).not(o)),p=0;p<s.length;p++){var l=s[p].parentNode,h={relatedTarget:s[p]};if(t(l).hasClass(c)&&("click"!==e.type||!/input|textarea/i.test(e.target.tagName)||!t.contains(l,e.target))){var g=t.Event(a.HIDE,h);t(l).trigger(g),g.isDefaultPrevented()||(s[p].setAttribute("aria-expanded","false"),t(l).removeClass(c).trigger(t.Event(a.HIDDEN,h)))}}n&&t(document).trigger(n)}},v._dataApiKeydownHandler=function(e){if(!/input|textarea/i.test(e.target.tagName)){var n;for(var o in p)if(n=p[o]===e.which)break;if(n){if(e.preventDefault(),e.stopPropagation(),e.which==p.ESC){if(v._isCollapsed(this))return;var r=t(e.target).parents(f.DROPDOWN+"."+c).last().find(">"+f.DATA_TOGGLE);return v._clearMenus(),void r.trigger("focus")}if("A"==e.target.tagName){var i=g(e.target);if(i.prop(":flat",v._isCollapsed(i.root())),i.is(":flat"))e.which===p.DOWN||e.which===p.UP?i[e.which===p.UP?"prev":"next"]().focus():e.which===p.LEFT?i.is(":opened")?i.close():i.parent().close().focus():e.which===p.RIGHT&&i.is(":toggle")&&i.open();else if(i.is(":upper"))e.which===p.LEFT||e.which===p.RIGHT?(i[e.which===p.LEFT?"prev":"next"]().focus().open(),i.is(":toggle")&&i.close()):e.which!==p.DOWN&&e.which!==p.UP||!i.is(":toggle")||i.children()[e.which===p.DOWN?"first":"last"]().focus();else if(e.which===p.LEFT){var s=i.parent();s.is(":upper")?s.close().prev().focus().open():s.focus().close()}else if(e.which===p.RIGHT){var a=i.children();a.length?(i.open(),a.first().focus()):i.parents(":upper").close().next().focus().open()}else e.which!==p.DOWN&&e.which!==p.UP||i[e.which===p.UP?"prev":"next"]().focus()}}}},v._isCollapsed=function(t){var e;return t.length&&(t=t[0]),t&&(e=/navbar-toggleable-(xs|sm|md|lg|xl)/.exec(t.className))&&window.innerWidth<l[e[1].toUpperCase()]},v._dataApiResizeHandler=function(){t(f.BASE).each((function(){var e=v._isCollapsed(this);t(this).find(f.DROPDOWN).removeClass(c),t(this).find('[aria-expanded="true"]').attr("aria-expanded","false");var n=t(f.BACKDROP)[0];n&&n.parentNode.removeChild(n),e!=t(this).hasClass(h)&&(e?t(this).addClass(h):t(this).removeClass(h))}))},t.fn[n]=function(e){return this.each((function(){var n=t(this).data(o);if(n||t(this).data(o,n=new v(this)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e].call(this)}}))},t.fn[n].noConflict=function(){return t.fn[n]=s,this},t.fn[n].Constructor=v,t.fn[n].$$=g,t(window).on(a.RESIZE_DATA_API+" "+a.LOAD_DATA_API,v._dataApiResizeHandler),t(document).on(a.KEYDOWN_DATA_API,f.BASE,v._dataApiKeydownHandler).on(a.NAVBAR_COLLAPSE,v._clearMenus).on(a.CLICK_DATA_API,v._clearMenus).on(a.CLICK_DATA_API,f.DATA_TOGGLE,v.prototype.toggle).on(a.CLICK_DATA_API,f.FORM_CHILD,(function(t){t.stopPropagation()})),t(window).trigger(a.READY);var m=t.summernote.renderer.getTemplate();t.summernote.addPlugin(function(n){if(!n.name)throw new Error("Plugin name not found.");e=n.name;var o=n.langs||{},r=t.summernote.options,i={};o["en-US"]=o["en-US"]||{},r.icons[e]={},n.events=n.events||{},n.buttons=n.buttons||{};for(var s in t.each(n.buttons,(function(t){var s=e+t.charAt(0).toUpperCase()+t.substr(1);i[s]=function(t,n){return function(o,r){return m.iconButton(r.iconPrefix+r.icons[e][t],{event:n,title:o[e][t],hide:!0}).replace("<button",'<button data-toggle="tooltip"')}}(t,s),n.events[s]=this.click,o["en-US"][t]=this.title||"",r.icons[e][t]=this.icon||""})),n.langs={},o)for(var a in n.langs[s]={},n.langs[s][e]={},o[s])n.langs[s][e][a]=o[s][a];return n.buttons=i,n}({name:"dropdownMenu",buttons:{addItem:{title:"Add Item",icon:"plus",click:function(e,n,o){var r=o.editable(),i=t.fn.navDropdown.$$(r),s=r.clone();s.removeClass("summernote-air note-air-editor note-editable dropdown-toggle").removeAttr("id contenteditable data-toggle data-bs-toggle"),(i.is(":upper")||i.is(":toggle"))&&(i[0]=i[0].parentNode),t(i).after(s),"LI"==t(i).prop("tagName")&&(t(i).hasClass("nav-btn")?s.wrap('<li class="nav-item nav-btn"></li>'):s.wrap('<li class="nav-item"></li>')),parseInt(t.fn.tooltip.Constructor.VERSION)>3?o.popover().find("button").tooltip("dispose"):o.popover().find("button").tooltip("destroy"),s.trigger("mousedown")}},addSubItem:{title:"Add Submenu",icon:"stream",click:function(e,n,o){var r=o.editable(),i=t.fn.navDropdown.$$(r),s=r.clone();if(s.addClass("dropdown-item").removeClass("summernote-air note-air-editor note-editable dropdown-toggle nav-link link").removeAttr("id contenteditable data-toggle").html("New Item"),i.is(":toggle")){var a=i.open().children().last(
1);a.is(":toggle")?t(a).parent().after(s):t(a).after(s)}else{var p=t(".dropdown-toggle"),l=function(){var e=Math.floor(900*Math.random()+100);return p.each((function(n,o){return e==t(o).attr("id")?l():e})),e};t(i).addClass("dropdown-toggle").attr({href:"#","data-toggle":"dropdown-submenu","data-bs-toggle":"dropdown","data-bs-auto-close":"outside",id:"dropdown-"+l()}),i.is(":upper")?t(i).parent().addClass("dropdown open"):(s.rivetsOff(),t(i).wrap('<div class="dropdown open"></div>')),t(i).after(s),i.is(":upper")?s.wrap('<div class="dropdown-menu" data-bs-popper="none" aria-labelledby="dropdown-'+l()+'"></div>'):s.wrap('<div class="dropdown-menu dropdown-submenu" data-bs-popper="none" aria-labelledby="dropdown-'+l()+'"></div>')}parseInt(t.fn.tooltip.Constructor.VERSION)>3?o.popover().find("button").tooltip("dispose"):o.popover().find("button").tooltip("destroy"),s.trigger("mousedown")}},addButton:{title:"Add",icon:"plus",click:function(t,n,o){return this[e+"AddItem"].apply(this,arguments)}},moveLeft:{title:"Move Left",icon:"arrow-left",click:function(e,n,o){var r,i=o.editable(),s=t.fn.navDropdown.$$(i),a=e.data&&e.data.direction||"left";r=s.is(":upper")?s.root().children():s.parent().children();var p,l=t.inArray(s[0],r);r.length<2||!~l||((s.is(":upper")||s.is(":toggle"))&&(s[0]=s[0].parentNode),(l+=/up|left/.test(a)?-1:1)<0?p=r.eq(r.length-1).prop(":last",!0):l>=r.length?p=r.eq(0).prop(":first",!0):(p=r.eq(l),l+1==r.length&&p.prop(":last",!0),0==l&&p.prop(":first",!0)),(p.is(":upper")||p.is(":toggle"))&&(p[0]=p[0].parentNode),i.rivetsOff(),/up|left/.test(a)?p.is(":last")?t(p).after(s):t(p).before(s):p.is(":first")?t(p).before(s):t(p).after(s),n.afterCommand(i),i.focus())}},moveRight:{title:"Move Right",icon:"arrow-right",click:function(t,n,o){return t.data={direction:"right"},this[e+"MoveLeft"].apply(this,arguments)}},moveUp:{title:"Move Up",icon:"arrow-up",click:function(t,n,o){return t.data={direction:"up"},this[e+"MoveLeft"].apply(this,arguments)}},moveDown:{title:"Move Down",icon:"arrow-down",click:function(t,n,o){return t.data={direction:"down"},this[e+"MoveLeft"].apply(this,arguments)}},remove:{title:"Remove",icon:"trash",click:function(e,n,o){var r=e.data&&e.data.action||"",i=o.editable(),s=t.fn.navDropdown.$$(i);if(("removeButton"==r||s.is(":upper"))&&t(s.root()).find("removeButton"==r?"a[data-button]":"> li > a:not([data-button])").length<2){o.popover().hide(),setTimeout((function(){o.popover().find("> *").css("display","none").end().show()}),150);try{mbrAppCore.APP.fire.call(mbrAppCore.APP,"removeButton"==r?"removeLastButton":"removeLastMenuItem")}catch(t){}}else{var a;a=s.is(":upper")?s.root().children():s.parent().children(),parseInt(t.fn.tooltip.Constructor.VERSION)>3?o.popover().find("button").tooltip("dispose"):o.popover().find("button").tooltip("destroy"),i.destroy();var p=s.is(":upper");if((s.is(":upper")||s.is(":toggle"))&&(s[0]=s[0].parentNode),!p&&a.length<2){var l=s.parent();t(s).parent().remove(),t(l).parent().removeClass("dropdown open"),t(l).removeClass("dropdown open").removeAttr("data-toggle").removeAttr("data-bs-toggle").removeAttr("data-bs-auto-close").removeClass("dropdown-toggle"),l.is(":upper")||t(l).unwrap()}else t(s).remove()}}},removeButton:{title:"Remove",icon:"trash",click:function(t,n,o){return t.data={action:"removeButton"},this[e+"Remove"].apply(this,arguments)}}}}))}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.