@@ -22,20 +22,60 @@ relative foo: {{ '/foo' | relative_url }}
22
22
[ bad link] ({{ 'notexist.html' | relative_url}})
23
23
[ self link] ({{ 'misc/debug.html' | relative_url}})
24
24
25
+ ---
25
26
26
- {% include color-check.html %}
27
+ <script >
28
+ var refreshDebug = function () {
29
+ document .getElementById (' ls-check' ).textContent = DARKMODE .lsOk () ? ' OK' : ' FAILED' ;
30
+ document .getElementById (' dm-closed' ).textContent = sessionStorage .getItem (' dm-closed' ) || ' (unset)' ;
31
+ document .getElementById (' dm-close-count' ).textContent = DARKMODE .closeCount ();
32
+ document .getElementById (' bar-used' ).textContent = localStorage .getItem (' bar-used' ) || ' (unset)' ;
33
+ }
27
34
28
- <style >
29
- #props span , .mono {
30
- font-family : monospace ;
31
- white-space : pre ;
32
- }
35
+ window .addEventListener (' DOMContentLoaded' , function () {
36
+ refreshDebug ();
37
+ document .getElementById (' clear-closed' ).addEventListener (' click' ,
38
+ function () {
39
+ sessionStorage .removeItem (' dm-closed' );
40
+ refreshDebug ();
41
+ }
42
+ );
43
+ document .getElementById (' clear-count' ).addEventListener (' click' ,
44
+ function () {
45
+ localStorage .removeItem (' dm-close-count' );
46
+ refreshDebug ();
47
+ }
48
+ );
49
+ document .getElementById (' clear-bar-used' ).addEventListener (' click' ,
50
+ function () {
51
+ localStorage .removeItem (' bar-used' );
52
+ refreshDebug ();
53
+ }
54
+ );
55
+ });
56
+ </script >
33
57
34
- #props span {
35
- background-color : lightgrey ;
58
+ <style >
59
+ .dm-debug button , .spacer {
60
+ display : inline-block ;
61
+ width : 50px ;
62
+ margin-bottom : 5px ;
36
63
}
37
64
</style >
38
65
66
+ <div style =" font-size : 0.75em ; font-family : monospace " >
67
+ <p><strong>Theme debugging:</strong></p>
68
+ {%- include color-check.html -%}
69
+ <div class="dm-debug" style="white-space: pre-wrap">
70
+ <span class =" spacer " > </span > localStorage : <span id =" ls-check " ></span >
71
+ <button id =" clear-closed " >clear</button > dm-closed (session) : <span id =" dm-closed " ></span >
72
+ <button id =" clear-count " >clear</button > dm-close-count : <span id =" dm-close-count " ></span >
73
+ <button id =" clear-bar-used " >clear</button > bar-used : <span id =" bar-used " ></span >
74
+ </div >
75
+ </div >
76
+
77
+ ---
78
+
39
79
<div class =" mono " >
40
80
<script >
41
81
document .write (' location.href : ' + location .href + ' <br>' )
0 commit comments