raspberry-pi-absensi/assets/scripts/treeview.init.min.js

2 lines
2.5 KiB
JavaScript
Executable File

$(function(){var e=[{text:"Parent 1",href:"#parent1",tags:["4"],nodes:[{text:"Child 1",href:"#child1",tags:["2"],nodes:[{text:"Grandchild 1",href:"#grandchild1",tags:["0"]},{text:"Grandchild 2",href:"#grandchild2",tags:["0"]}]},{text:"Child 2",href:"#child2",tags:["0"]}]},{text:"Parent 2",href:"#parent2",tags:["0"]},{text:"Parent 3",href:"#parent3",tags:["0"]},{text:"Parent 4",href:"#parent4",tags:["0"]},{text:"Parent 5",href:"#parent5",tags:["0"]}];$("#treeview1").treeview({data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)",expandIcon:"fa fa-plus",collapseIcon:"fa fa-minus",nodeIcon:"fa fa-folder"}),$("#treeview2").treeview({levels:1,data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)",expandIcon:"fa fa-plus",collapseIcon:"fa fa-minus",nodeIcon:"fa fa-folder"}),$("#treeview3").treeview({levels:99,data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)",expandIcon:"fa fa-plus",collapseIcon:"fa fa-minus",nodeIcon:"fa fa-folder"}),$("#treeview4").treeview({color:"#304ffe",data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)",expandIcon:"fa fa-plus",collapseIcon:"fa fa-minus",nodeIcon:"fa fa-folder"}),$("#treeview5").treeview({color:"#304ffe",expandIcon:"fa fa-chevron-right",collapseIcon:"fa fa-chevron-down",nodeIcon:"fa fa-bookmark",data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)"}),$("#treeview6").treeview({color:"#304ffe",expandIcon:"fa fa-square",collapseIcon:"fa fa-square-o",nodeIcon:"fa fa-user",showTags:!0,data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)"}),$("#treeview10").treeview({color:"#304ffe",enableLinks:!0,data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)",expandIcon:"fa fa-plus",collapseIcon:"fa fa-minus",nodeIcon:"fa fa-folder"});var t=$("#treeview-searchable").treeview({data:e,selectedBackColor:"#304ffe",onhoverColor:"rgba(0, 0, 0, 0.05)",expandIcon:"fa fa-plus",collapseIcon:"fa fa-minus",nodeIcon:"fa fa-folder"}),n=function(){var e=$("#input-search").val(),n={ignoreCase:$("#chk-ignore-case").is(":checked"),exactMatch:$("#chk-exact-match").is(":checked"),revealResults:$("#chk-reveal-results").is(":checked")},o=t.treeview("search",[e,n]),i="<p>"+o.length+" matches found</p>";return $.each(o,function(e,t){i+="<p>- "+t.text+"</p>"}),$("#search-output").html(i),!1};$("#btn-search").on("click",n),$("#input-search").on("keyup",n),$("#btn-clear-search").on("click",function(){return t.treeview("clearSearch"),$("#input-search").val(""),$("#search-output").html(""),!1})});