PageSourceSearch

https://lcampus.co/wp-content/cache/min/1/wp-content/plugins/fileb…/lib/comboTreePlugin.js?ver=1791433843

js lcampus.co collected 2026-10-08 07:56:39 UTC 13,902 bytes, 11 lines download raw bytes

1/*!
2 * jQuery ComboTree Plugin
3 * Author:  Erhan FIRAT
4 * Mail:    [email protected]
5 * Licensed under the MIT license
6 * Version: 1.3.1
7*/!function(t,e,s,o){let n="comboTree",l={source:[],isMultiple:!1,cascadeSelect:!1,selected:[],collapse:!1,selectAll:!1,animationTime:200};function r(e,s){this.options=t.extend({},l,s),this._defaults=l,this._name=n,this.constructorFunc(e,s)}r.prototype.constructorFunc=function(e,s){this.input=e,this._input=t(e),this.init()},r.prototype.init=function(){this.id="ct-"+Math.floor(999999*Math.random()),this._input.addClass("ct-input-box"),this._input.wrap('<div id="'+this.id+'-wrapper" class="ct-wrapper"></div>'),this._input.wrap('<div class="ct-input-wrapper"></div>'),this._wrapper=t("#"+this.id+"-wrapper"),this._arrowBtn=t('<button class="ct-arrow-btn" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>chevron-down</title><path d="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z" /></svg></button>'),this._input.after(this._arrowBtn),this._wrapper.append('<div class="ct-drop-down-container"></div>'),this._dropDownContainer=this._wrapper.find(".ct-drop-down-container"),this._dropDownContainer.html(this.createSourceHTML()),this._filterInput=this.options.isMultiple?this._wrapper.find("#"+this.id+"-multi-filter"):null,this._selectAllInput=this.options.isMultiple&&this.options.selectAll?this._wrapper.find(".select-all-input"):null,this._sourceUl=this._wrapper.find(".ct-source-ul-main"),this._listItems=this._dropDownContainer.find("li"),this._listItemsTitle=this._dropDownContainer.find("span.ct-list-item-title"),this._selectedItem={},this._selectedItems=[],this.processSelected(),this.bindings()},r.prototype.unbind=function(){this._arrowBtn.off("click"),this._input.off("click"),this._listItems.off("click"),this._listItemsTitle.off("click"),this._listItemsTitle.off("mousemove"),this._input.off("keyup"),this._input.off("keydown"),this._input.off("mouseup."+this.id),t(s).off("mouseup."+this.id)},r.prototype.destroy=function(){this.unbind(),this._wrapper.before(this._input),this._wrapper.remove(),this._input.removeData("plugin_"+n)},r.prototype.removeSourceHTML=function(){this._dropDownContainer.html("")},r.prototype.createSourceHTML=function(){let t="";return this.options.isMultiple&&(t+=this.createFilterHTMLForMultiSelect()),t+=this.createSourceSubItemsHTML(this.options.source,!1)},r.prototype.createFilterHTMLForMultiSelect=function(){return'<input id="'+this.id+'-multi-filter" type="text" class="ct-multiples-filter" placeholder="Type to filter"/>'},r.prototype.createSelectAllHTMLForMultiSelect=function(){return'<li id="ct-select-all-li"><label class="select-all"><input type="checkbox" id="'+this.id+'-select-all-input"class="select-all-input">[Select All]</label></li>'},r.prototype.createSourceSubItemsHTML=function(t,e,s=!1){let o='<ul id="'+this.id+"-source-ul"+(e||"-main")+'" class="ct-source-ul-'+(e?"parent":"main")+'" style="'+((this.options.collapse||s)&&e?"display:none;":"")+'">';!1===e&&this.options.isMultiple&&this.options.selectAll&&(o+=this.createSelectAllHTMLForMultiSelect());for(let n=0;n<t.length;n++)o+=this.createSourceItemHTML(t[n]);return o+"</ul>"},r.prototype.createSourceItemHTML=function(t){let e="",s=t.hasOwnProperty("subs"),n=!!t.hasOwnProperty("collapse")&&t.hasOwnProperty("collapse"),l=o===t.isSelectable||t.isSelectable;return e+='<li id="ct-'+this.id+"-li-"+t.id+'" class="ct-item-'+(s?"parent":"child")+'"> ',e+=`${s?`<span class="ct-parent-plus">${this.options.collapse||n?"+":"-"}</span>`:""}<span
8data-id="${t.id}"
9data-selectable="${l}"
10class="ct-list-item-title ${l?"selectable":"not-selectable"}"
11>${this.options.isMultiple&&l?'<input type="checkbox" />':""}${t.title}</span>`,s&&(e+=this.createSourceSubItemsHTML(t.subs,t.id,n)),e+="</li>"},r.prototype.bindings=function(){let e=this;t(this._input).focus(function(s){e._dropDownContainer.is(":visible")||t(e._dropDownContainer).slideToggle(e.options.animationTime)}),this._arrowBtn.on("click",function(t){t.stopPropagation(),e.toggleDropDown()}),this._input.on("click",function(t){t.stopPropagation(),e._dropDownContainer.is(":visible")||e.toggleDropDown()}),this._listItems.on("click",function(s){s.stopPropagation(),t(this).hasClass("ct-item-parent")&&e.toggleSelectionTree(this)}),this._listItemsTitle.on("click",function(t){t.stopPropagation(),e.options.isMultiple?e.multiItemClick(this):e.singleItemClick(this)}),this._listItemsTitle.on("mousemove",function(t){t.stopPropagation(),e.dropDownMenuHover(this)}),this._selectAllInput&&this._selectAllInput.parent("label").on("mousemove",function(t){t.stopPropagation(),e.dropDownMenuHover(this)}),this._input.on("keyup",function(t){switch(t.stopPropagation(),t.keyCode){case 27:e.closeDropDownMenu();break;case 13:case 39:case 37:case 40:case 38:t.preventDefault();break;default:e.options.isMultiple||e.filterDropDownMenu()}}),this._filterInput&&this._filterInput.on("keyup",function(s){switch(s.stopPropagation(),s.keyCode){case 27:t(this).val()?(t(this).val(""),e.filterDropDownMenu()):e.closeDropDownMenu();break;case 40:case 38:s.preventDefault(),e.dropDownInputKeyControl(s.keyCode-39);break;case 37:case 39:s.preventDefault(),e.dropDownInputKeyToggleTreeControl(s.keyCode-38);break;case 13:e.multiItemClick(e._elemHoveredItem),s.preventDefault();break;default:e.filterDropDownMenu()}}
11),this._input.on("keydown",function(t){switch(t.stopPropagation(),t.keyCode){case 9:e.closeDropDownMenu();break;case 40:case 38:t.preventDefault(),e.dropDownInputKeyControl(t.keyCode-39);break;case 37:case 39:t.preventDefault(),e.dropDownInputKeyToggleTreeControl(t.keyCode-38);break;case 13:e.options.isMultiple?e.multiItemClick(e._elemHoveredItem):e.singleItemClick(e._elemHoveredItem),t.preventDefault();break;default:e.options.isMultiple&&t.preventDefault()}}),t(s).on("mouseup."+e.id,function(t){!e._wrapper.is(t.target)&&0===e._wrapper.has(t.target).length&&e._dropDownContainer.is(":visible")&&e.closeDropDownMenu()}),this._selectAllInput&&this._selectAllInput.on("click",function(s){s.stopPropagation();t(s.target).prop("checked")?e.selectAll():e.clearSelection()})},r.prototype.toggleDropDown=function(){let e=this;t(this._dropDownContainer).slideToggle(this.options.animationTime,function(){e._dropDownContainer.is(":visible")&&t(e._input).focus()})},r.prototype.closeDropDownMenu=function(){t(this._dropDownContainer).slideUp(this.options.animationTime)},r.prototype.toggleSelectionTree=function(e,s){let n=t(e).children("ul")[0];s===o?(t(n).is(":visible")?t(e).children("span.ct-parent-plus").html("+"):t(e).children("span.ct-parent-plus").html("-"),t(n).slideToggle(this.options.animationTime)):1!=s||t(n).is(":visible")?-1==s&&(t(n).is(":visible")?(t(e).children("span.ct-parent-plus").html("+"),t(n).slideUp(this.options.animationTime)):this.dropDownMenuHover(e)):(t(e).children("span.ct-parent-plus").html("-"),t(n).slideDown(this.options.animationTime))},r.prototype.selectMultipleItem=function(e){if(t(e).parent("li").hasClass("ct-item-parent")&&!1==t(e).data("selectable")&&this.toggleSelectionTree(t(e).parent("li")),!0==t(e).data("selectable")){this._selectedItem={id:t(e).attr("data-id"),title:t(e).text()};let s=this.isItemInArray(this._selectedItem,this.options.source);if(s){let o=this.isItemInArray(this._selectedItem,this._selectedItems);o?(this._selectedItems.splice(parseInt(o),1),t(e).find("input").prop("checked",!1)):(this._selectedItems.push(this._selectedItem),t(e).find("input").prop("checked",!0))}}},r.prototype.singleItemClick=function(e){!0==t(e).data("selectable")?(this._selectedItem={id:t(e).attr("data-id"),title:t(e).text()},this.refreshInputVal(),this.closeDropDownMenu()):t(e).parent("li").hasClass("ct-item-parent")&&this.toggleSelectionTree(t(e).parent("li"))},r.prototype.multiItemClick=function(e){if(this.selectMultipleItem(e),this.options.cascadeSelect&&t(e).data("selectable")&&t(e).parent("li").hasClass("ct-item-parent")){let s=t(e).parent("li").children("ul").first().find('input[type="checkbox"]');s.each(function(){let s=t(this);t(e).children('input[type="checkbox"]').first().prop("checked")!==s.prop("checked")&&(s.prop("checked",!t(e).children('input[type="checkbox"]').first().prop("checked")),s.trigger("click"))})}this.refreshInputVal()},r.prototype.isItemInArray=function(t,e){for(let s=0;s<e.length;s++){if(t.id==e[s].id&&t.title==e[s].title)return s+"";if(e[s].hasOwnProperty("subs")){let o=this.isItemInArray(t,e[s].subs);if(o)return o}}return!1},r.prototype.refreshInputVal=function(){let t="";if(this.options.isMultiple)for(let e=0;e<this._selectedItems.length;e++)t+=this._selectedItems[e].title,e<this._selectedItems.length-1&&(t+=", ");else t=this._selectedItem.title;this._input.val(t),this._input.trigger("change"),this.changeHandler&&this.changeHandler()},r.prototype.dropDownMenuHover=function(e,s){this._wrapper.find(".ct-tree-item-hover").removeClass("ct-tree-item-hover"),t(e).addClass("ct-tree-item-hover"),this._elemHoveredItem=t(e),s&&e&&this.dropDownScrollToHoveredItem(this._elemHoveredItem)},r.prototype.dropDownScrollToHoveredItem=function(t){this._sourceUl.parent().scrollTop(t[0].offsetTop-30)},r.prototype.dropDownInputKeyToggleTreeControl=function(e){let s=this._elemHoveredItem;t(s).parent("li").hasClass("ct-item-parent")?this.toggleSelectionTree(t(s).parent("li"),e):-1==e&&this.dropDownMenuHover(s)},r.prototype.dropDownInputKeyControl=function(t){this._dropDownContainer.is(":visible")||this.toggleDropDown();let e=this._listItems.find("span.ct-list-item-title:visible"),s=this._elemHoveredItem?e.index(this._elemHoveredItem)+t:0;s=(e.length+s)%e.length,this.dropDownMenuHover(e[s],!0)},r.prototype.filterDropDownMenu=function(){let e="";""!=(e=this.options.isMultiple?this._wrapper.find("#"+this.id+"-multi-filter").val():this._input.val())?(this._listItemsTitle.hide(),this._listItemsTitle.siblings("span.ct-parent-plus").hide(),list=this._listItems.filter(function(t,s){return-1!=s.innerHTML.toLowerCase().indexOf(e.toLowerCase())}).each(function(e,s){t(this.children).show(),t(this).siblings("span.ct-parent-plus").show()})):(this._listItemsTitle.show(),this._listItemsTitle.siblings("span.ct-parent-plus").show())},r.prototype.processSelected=function(){let e=this._listItemsTitle,s=this._selectedItem,o=this._selectedItems;this.options.selected.forEach(function(n){let l=t(e).filter(function(){return t(this).data("id")==n});l.length>0&&(t(l).find("input").attr("checked",!0),s={id:l.data("id"),title:l.text()},o.push(s))}),this._selectedItem=s,this.refreshInputVal()},r.prototype.findItembyId=function(t,e){if(t&&e)for(let s=0;s<e.length;s++){if(e[s].id==t)return{id:e[s].id,title:e[s].title};if(e[s].hasOwnProperty("subs")){let o=this.findItembyId(t,e[s].subs);if(o)return o}}return null},r.prototype.getSelectedIds=function(){if(this.options.isMultiple&&this._selectedItems.length>0){let t=[];for(i=0;i<this._selectedItems.length;i++)t.push(this._selectedItems[i].id);return t}return!this.options.isMultiple&&this._selectedItem.hasOwnProperty("id")?[this._selectedItem.id]:null},r.prototype.getSelectedNames=function(){if(this.options.isMultiple&&this._selectedItems.length>0){let t=[];for(i=0;i<this._selectedItems.length;i++)t.push(this._selectedItems[i].title);return t}return!this.options.isMultiple&&this._selectedItem.hasOwnProperty("id")?this._selectedItem.title:null},r.prototype.setSource=function(t){this._selectedItems=[],this.destroy(),this.options.source=t,this.constructorFunc(this.input,this.options)},r.prototype.clearSelection=function(){for(i=0;i<this._selectedItems.length;i++){let e="#ct-"+this.id+"-li-"+this._selectedItems[i].id;e=e.replaceAll(".","\\.");t(this._wrapper.find(e)).find("input").prop("checked",!1)}this._selectedItems=[],this._selectedItem={},this._selectAllInput&&this._selectAllInput.prop("checked",!1),this.refreshInputVal()},r.prototype.setSelection=function(e){if(e&&e.length&&e.length>0)for(let s=0;s<e.length;s++){let o=this.findItembyId(e[s],this.options.source);if(o&&this.isItemInArray(o,this.options.source)){let n=this.isItemInArray(o,this._selectedItems);if(!n){let l="#"+this.id+"-li"+e[s],r=t(l=l.replaceAll(".","\\."));this._selectedItems.push(o),this._selectedItem=o,this.options.cascadeSelect?t(r).find("input").prop("checked",!0):t(r).find("input:first").prop("checked",!0)}}}this.refreshInputVal()},r.prototype.selectAll=function(){let e=this;this._selectedItems=[],this._wrapper.find("#"+this.id+"-source-ul-main").find("[data-selectable=true] input[type='checkbox']").each(function(s,o){let n=t(o).parent("span").first(),l={id:n.data("id"),title:n.text()};t(o).prop("checked",!0),e._selectedItems.push(l)}),this._selectAllInput&&this._selectAllInput.prop("checked",!0),this.refreshInputVal()},r.prototype.onChange=function(t){t&&"function"==typeof t&&(this.changeHandler=t)},t.fn[n]=function(e){let s=[];return(this.each(function(){t.data(this,"plugin_"+n)||(t.data(this,"plugin_"+n,new r(this,e)),s.push(t(this).data()["plugin_"+n]))}),1==this.length)?s[0]:s}}(jQuery,window,document);const comboTreeIcons={downIcon:'<?xml version="1.0" encoding="utf-8"?><svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7 10L12 15L17 10" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',plus:'<?xml version="1.0" encoding="utf-8"?><svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 12H15" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
11<path d="M12 9L12 15" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',minus:'<?xml version="1.0" encoding="utf-8"?><svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 12H15" stroke="#323232" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}

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.