File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
src/server/templates/components Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 33 console .log (" Pattern changed" , element .value );
44 let patternType = element .value ;
55 const files = document .getElementsByName (" tree-line" );
6-
6+
77 Array .from (files).forEach ((element ) => {
88 if (element .textContent .includes (" Directory structure:" )) {
99 return ;
1414 element .classList .toggle (' hover:text-inherit' );
1515 element .classList .toggle (' hover:no-underline' );
1616 element .classList .toggle (' hover:line-through' );
17- element .classList .toggle (' hover:text-gray-500' );
17+ element .classList .toggle (' hover:text-gray-500' );
1818 });
1919 }
2020 </script >
21-
2221<div class =" relative" >
2322 <div class =" w-full h-full absolute inset-0 bg-gray-900 rounded-xl translate-y-2 translate-x-2" ></div >
2423 <div class =" rounded-xl relative z-20 pl-8 sm:pl-10 pr-8 sm:pr-16 py-8 border-[3px] border-gray-900 bg-[#fff4da]" >
5554 <div class =" flex relative z-20 border-[3px] border-gray-900 rounded bg-white" >
5655 <div class =" relative flex items-center" >
5756 <select id =" pattern_type"
58- onchange = " changePattern(this)"
57+ onchange = " changePattern(this)"
5958 name =" pattern_type"
6059 class =" w-21 py-2 pl-2 pr-6 appearance-none bg-[#e6e8eb] focus:outline-none border-r-[3px] border-gray-900" >
6160 <option value =" exclude"
Original file line number Diff line number Diff line change 11<script >
22 function getFileName (line ) {
33 // Skips "|", "└", "├" found in file tree
4- const index = line .search (/ [a-zA-Z0-9 ] / );
4+ const index = line .search (/ [a-zA-Z0-9 ] / );
55 return line .substring (index).trim ();
66 }
77
1515
1616 element .classList .toggle (' line-through' );
1717 element .classList .toggle (' text-gray-500' );
18-
18+
1919 const fileName = getFileName (element .textContent );
2020 const fileIndex = patternFiles .indexOf (fileName);
2121
9191 </div >
9292 <div class =" relative" >
9393 <div class =" w-full h-full rounded bg-gray-900 translate-y-1 translate-x-1 absolute inset-0" ></div >
94- <div class =" directory-structure w-full p-4 bg-[#fff4da] border-[3px] border-gray-900 rounded font-mono text-sm resize-y focus:outline-none relative z-10 h-[215px] overflow-auto" readonly >
95- {% for line in tree .splitlines ()%}
96- <div name =" tree-line" class =" cursor-pointer hover:line-through hover:text-gray-500" onclick =" toggleFile(this)" >{{ line }}</div >
94+ <div class =" directory-structure w-full p-4 bg-[#fff4da] border-[3px] border-gray-900 rounded font-mono text-sm resize-y focus:outline-none relative z-10 h-[215px] overflow-auto"
95+ readonly >
96+ {% for line in tree .splitlines () %}
97+ <div name =" tree-line"
98+ class =" cursor-pointer hover:line-through hover:text-gray-500"
99+ onclick =" toggleFile(this)" >{{ line }}</div >
97100 {% endfor %}
98101 </div >
99102 </div >
You can’t perform that action at this time.
0 commit comments