Skip to content

Commit dc37084

Browse files
committed
add logos
Signed-off-by: Doug Davis <[email protected]>
1 parent 84500e2 commit dc37084

File tree

1 file changed

+53
-22
lines changed

1 file changed

+53
-22
lines changed

registry/httpStuff.go

+53-22
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func (pw *PageWriter) Done() {
331331
} else if strings.Contains(pw.Info.BaseURL, "/reg-"+name) {
332332
checked = " selected"
333333
}
334-
list += fmt.Sprintf("\n <option%s>%s</option>", checked, name)
334+
list += fmt.Sprintf("\n <option%s>%s</option>", checked, name)
335335
}
336336
list += "\n"
337337

@@ -356,7 +356,7 @@ func (pw *PageWriter) Done() {
356356
if pw.Info.RootPath == r.u {
357357
name = "<b>" + name + "</b>"
358358
}
359-
roots += fmt.Sprintf(" <li><a href=\"%s?ui\">%s</a></li>\n",
359+
roots += fmt.Sprintf(" <li><a href=\"%s?ui\">%s</a></li>\n",
360360
pw.Info.BaseURL+"/"+r.u, name)
361361
}
362362

@@ -610,6 +610,22 @@ func (pw *PageWriter) Done() {
610610
#myURL {
611611
width: 40em ;
612612
}
613+
614+
#registry {
615+
display: flex ;
616+
align-items: baseline ;
617+
margin-right: -10 ;
618+
margin-top: 2 ;
619+
}
620+
621+
#xRegLogo {
622+
cursor: pointer ;
623+
height: 20px ;
624+
width: 20px ;
625+
// margin-left: auto ;
626+
padding-left: 5px ;
627+
}
628+
613629
button {
614630
// margin-left: 5px ;
615631
}
@@ -663,14 +679,6 @@ func (pw *PageWriter) Done() {
663679
#applyBtn:active { background: #c4c4c4 ; color : black ; }
664680
#applyBtn:focus { background: darkgray ; color : black ; }
665681
666-
#commit {
667-
background-color: #e3e3e3 ; // lightsteelblue ;
668-
font-size: 12px ;
669-
font-family: courier ;
670-
position: fixed ;
671-
bottom: 0 ;
672-
z-index: 0 ;
673-
}
674682
textarea {
675683
margin-bottom: 10px ;
676684
min-width: 100%% ;
@@ -684,6 +692,7 @@ func (pw *PageWriter) Done() {
684692
}
685693
select {
686694
font-weight: bold ;
695+
margin-left: 3px ;
687696
}
688697
.export {
689698
margin-top: 5px ;
@@ -798,21 +807,30 @@ func (pw *PageWriter) Done() {
798807
}
799808
</style>
800809
<div id=left>
801-
<b>Registry:</b>
802-
<select onchange="changeRegistry(value)">`+list+` </select>
803-
<br>
804-
<hr>
810+
<div id=registry>
811+
<svg id=xRegLogo viewBox="0 0 663 800" fill="none" onclick="opensrc()">
812+
<title>https://xRegistry.io</title>
813+
<g clip-path="url(#clip0_1_142)">
814+
<path d="M490.6 800H662.2L494.2 461.6C562.2 438.2 648.6 380.5 648.6 238.8C648.6 5.3 413.9 0 413.9 0H3.40002L80.39 155.3H391.8C391.8 155.3 492.3 153.8 492.3 238.9C492.3 323.9 391.8 322.5 391.8 322.5H390.6L316.2 449L490.6 800Z" fill="black"/>
815+
<path d="M392.7 322.4H281L266.7 346.6L196.4 466.2L111.7 322.4H0L140.5 561.2L0 800H111.7L196.4 656.2L281 800H392.7L252.2 561.2L317.9 449.6L392.7 322.4Z" fill="#0066FF"/>
816+
</g>
817+
<defs>
818+
<clipPath id="clip0_1_142">
819+
<rect width="662.2" height="800" fill="white"/>
820+
</clipPath>
821+
</defs>
822+
</svg>
823+
<b>egistry:</b>
824+
<select onchange="changeRegistry(value)">`+list+` </select>
825+
</div>
826+
<hr style="margin-right:-15">
805827
`+roots+`
806828
<div id=buttonList>
807829
`+applyBtn+`
808830
`+structureButton+`
809831
</div>
810-
<div style="height:12px"></div> <!-- buffer for "Commmit:" line -->
811-
<div id=commit><a target=_blank
812-
href="http://github.com/duglin/xreg-github/tree/`+
813-
GitCommit+`">Commit: `+fmt.Sprintf("%.12s", GitCommit)+
814-
`&nbsp;&nbsp;</a></div>
815-
</div>
832+
<br style="height:20px"> <!-- buffer for octocat logo -->
833+
</div> <!-- left -->
816834
817835
<script>
818836
@@ -827,6 +845,14 @@ function changeRegistry(name) {
827845
window.location = loc
828846
}
829847
848+
function opensrc(loc) {
849+
if (loc == null) loc = "https://xregistry.io"
850+
else if (loc == "commit") {
851+
loc = "https://github.com/duglin/xreg-github/tree/`+GitCommit+`"
852+
}
853+
window.open( loc )
854+
}
855+
830856
function apply() {
831857
var loc = "`+pw.Info.BaseURL+`/`+strings.Join(pw.Info.Parts, "/")+`"
832858
@@ -905,8 +931,13 @@ function dokeydown(event) {
905931
</div>
906932
<div id=myOutput tabindex=0 onkeydown=dokeydown(event)><div class=expandAll>
907933
<span id=expAll class=expandBtn title="Collapse/Expand all" onclick=toggleExp(null,false)>`+HTML_MIN+`</span>
908-
</div><div id='text'>%s</div></div> <!--myOutput-->
909-
</div> <!--right-->
934+
</div><div id='text'>%s</div></div> <!-- myOutput -->
935+
</div> <!-- right -->
936+
937+
<svg height="20" aria-hidden="true" viewBox="0 0 24 24" width="20" style="position:absolute;left:0;bottom:0;cursor:pointer;margin:5" onclick="opensrc('commit')">
938+
<title>Open commit: `+GitCommit+`</title>
939+
<path d="M12.5.75C6.146.75 1 5.896 1 12.25c0 5.089 3.292 9.387 7.863 10.91.575.101.79-.244.79-.546 0-.273-.014-1.178-.014-2.142-2.889.532-3.636-.704-3.866-1.35-.13-.331-.69-1.352-1.18-1.625-.402-.216-.977-.748-.014-.762.906-.014 1.553.834 1.769 1.179 1.035 1.74 2.688 1.25 3.349.948.1-.747.402-1.25.733-1.538-2.559-.287-5.232-1.279-5.232-5.678 0-1.25.445-2.285 1.178-3.09-.115-.288-.517-1.467.115-3.048 0 0 .963-.302 3.163 1.179.92-.259 1.897-.388 2.875-.388.977 0 1.955.13 2.875.388 2.2-1.495 3.162-1.179 3.162-1.179.633 1.581.23 2.76.115 3.048.733.805 1.179 1.825 1.179 3.09 0 4.413-2.688 5.39-5.247 5.678.417.36.776 1.05.776 2.128 0 1.538-.014 2.774-.014 3.162 0 .302.216.662.79.547C20.709 21.637 24 17.324 24 12.25 24 5.896 18.854.75 12.5.75Z"></path>
940+
</svg>
910941
911942
</html>
912943
`, RegHTMLify(pw.Info.OriginalRequest, buf))))

0 commit comments

Comments
 (0)