@@ -18,9 +18,9 @@ document.addEventListener("DOMContentLoaded", () => {
1818 }
1919 const container = document . getElementById ( "popupContent" ) ;
2020 container . innerHTML = `
21- <h2> ${ data . title } </h2 >
21+ <h3>Problem: ${ data . title } </h3 >
2222 <p>Difficulty: ${ data . difficulty } </p>
23- <p id="status">${ data . status || "Unsolved" } </p>
23+ <p id="status"><strong> ${ data . status || "Unsolved" } </strong> </p>
2424 ` ;
2525
2626 // Listen for problem solved message
@@ -50,11 +50,27 @@ document.addEventListener("DOMContentLoaded", () => {
5050 problems . forEach ( problem => {
5151 const item = document . createElement ( "div" ) ;
5252 item . className = "problem-item" ;
53+ // Add difficulty as a class for color styling
54+ const difficultyClass = problem . difficulty ? problem . difficulty . toLowerCase ( ) : "" ;
5355 item . innerHTML = `
5456 <a href="${ problem . url } " target="_blank">${ problem . title } </a>
55- <span class="difficulty">${ problem . difficulty } </span>
57+ <span class="difficulty ${ difficultyClass } ">${ problem . difficulty } </span>
5658 ` ;
5759 list . appendChild ( item ) ;
5860 } )
5961 } )
6062} )
63+
64+ document . addEventListener ( "DOMContentLoaded" , ( ) => {
65+ const optionsBtn = document . getElementById ( "optionsBtn" ) ;
66+ if ( optionsBtn ) {
67+ optionsBtn . addEventListener ( "click" , ( ) => {
68+ if ( browser . runtime && browser . runtime . openOptionsPage ) {
69+ browser . runtime . openOptionsPage ( ) ;
70+ } else {
71+ // fallback for browsers that don't support openOptionsPage
72+ window . open ( "../options/options.html" , "_blank" ) ;
73+ }
74+ } ) ;
75+ }
76+ } ) ;
0 commit comments