This thread contains a patchset. You're looking at the original emails,
but you may wish to use the patch review UI.
Review patch
5
2
[PATCH gddo] Consolidate usage example permalinks
---
Hopefully this applies.
gddo-server/assets/site.css | 2 + -
gddo-server/assets/site.js | 4 ----
gddo-server/assets/templates/pkg.html | 4 ++ --
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/gddo-server/assets/site.css b/gddo-server/assets/site.css
index 70baba5..37a6820 100644
--- a/gddo-server/assets/site.css
+++ b/gddo-server/assets/site.css
@@ -21,7 +21,7 @@ h4 { margin-top: 20px; }
}
- :not([id^="example-"]):target {
+ :target {
background-color: #FDFF9E !important;
}
diff --git a/gddo-server/assets/site.js b/gddo-server/assets/site.js
index 614c21e..99b4a6a 100644
--- a/gddo-server/assets/site.js
+++ b/gddo-server/assets/site.js
@@ -199,10 +199,6 @@ $(function() {
var hash = window.location.hash;
if (hash.startsWith('#example-')) {
- $(hash).attr('open', '');
- }
-
- if (hash.startsWith('#ex-')) {
$(hash).parent().attr('open', '');
}
diff --git a/gddo-server/assets/templates/pkg.html b/gddo-server/assets/templates/pkg.html
index ac8929d..2242f69 100644
--- a/gddo-server/assets/templates/pkg.html
+++ b/gddo-server/assets/templates/pkg.html
@@ -168,8 +168,8 @@
{{if .}}
<div class="panel-group">
{{range .}}
- <details class="panel panel-default" id="example-{{.ID}}">
- <summary id="ex-{{.ID}}" class="panel-heading" >Example{{with .Example.Name}} ({{.}}){{end}}<a class="permalink" href="#ex-{{.ID}}">¶</a></summary>
+ <details class="panel panel-default">
+ <summary id="example-{{.ID}}" class="panel-heading" >Example{{with .Example.Name}} ({{.}}){{end}}<a class="permalink" href="#ex-{{.ID}}">¶</a></summary>
<div class="panel-collapse"><div class="panel-body">
{{with .Example.Doc}}<p>{{.|comment}}{{end}}
<p>Code:{{if .Play}}<span class="pull-right"><a href="?play={{.ID}}">play</a> </span>{{end}}
--
2.30.0
Ping in case this ended up in junk.
Pong, I'm going to review it tomorrow.
On Wed Jan 13, 2021 at 9:21 AM EST, Drew DeVault wrote:
> This one does not apply.
Is it because it was encoded in base64 for some reason? I'm not sure why
that is happening.
On Wed Jan 13, 2021 at 9:23 AM EST, Adnan Maolood wrote:
> Is it because it was encoded in base64 for some reason? I'm not sure why
> that is happening.
I'm not sure. You'll have to investigate further on your own. Or send a
request pull I guess.