mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-07-09 12:52:48 +00:00
better PDF support
This commit is contained in:
parent
491596261e
commit
babedfa528
@ -21,7 +21,7 @@
|
|||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% case ".mp3" %}
|
{% case ".mp3", ".m4a", ".opus", ".flac" %}
|
||||||
<div class="binary-container binary-container_with-audio">
|
<div class="binary-container binary-container_with-audio">
|
||||||
<audio controls>
|
<audio controls>
|
||||||
<source src="/binary/{%s= h.CanonicalName() %}"/>
|
<source src="/binary/{%s= h.CanonicalName() %}"/>
|
||||||
@ -29,6 +29,11 @@
|
|||||||
</audio>
|
</audio>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% case ".pdf" %}
|
||||||
|
<div class="binary-container binary-container_with-pdf">
|
||||||
|
<iframe src="/binary/{%s= h.CanonicalName() %}" width="100%" height="600">{%s lc.Get("ui.media_pdf") %}</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% default %}
|
{% default %}
|
||||||
<div class="binary-container binary-container_with-nothing">
|
<div class="binary-container binary-container_with-nothing">
|
||||||
<p><a href="/binary/{%s= h.CanonicalName() %}">{%s lc.Get("ui.media_download") %}</a></p>
|
<p><a href="/binary/{%s= h.CanonicalName() %}">{%s lc.Get("ui.media_download") %}</a></p>
|
||||||
|
@ -112,7 +112,7 @@ func StreamMedia(qw422016 *qt422016.Writer, h *hyphae.MediaHypha, lc *l18n.Local
|
|||||||
|
|
||||||
`)
|
`)
|
||||||
//line mycoopts/view.qtpl:24
|
//line mycoopts/view.qtpl:24
|
||||||
case ".mp3":
|
case ".mp3", ".m4a", ".opus", ".flac":
|
||||||
//line mycoopts/view.qtpl:24
|
//line mycoopts/view.qtpl:24
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<div class="binary-container binary-container_with-audio">
|
<div class="binary-container binary-container_with-audio">
|
||||||
@ -140,51 +140,68 @@ func StreamMedia(qw422016 *qt422016.Writer, h *hyphae.MediaHypha, lc *l18n.Local
|
|||||||
|
|
||||||
`)
|
`)
|
||||||
//line mycoopts/view.qtpl:32
|
//line mycoopts/view.qtpl:32
|
||||||
default:
|
case ".pdf":
|
||||||
//line mycoopts/view.qtpl:32
|
//line mycoopts/view.qtpl:32
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<div class="binary-container binary-container_with-nothing">
|
<div class="binary-container binary-container_with-pdf">
|
||||||
<p><a href="/binary/`)
|
<iframe src="/binary/`)
|
||||||
//line mycoopts/view.qtpl:34
|
//line mycoopts/view.qtpl:34
|
||||||
qw422016.N().S(h.CanonicalName())
|
qw422016.N().S(h.CanonicalName())
|
||||||
//line mycoopts/view.qtpl:34
|
//line mycoopts/view.qtpl:34
|
||||||
|
qw422016.N().S(`" width="100%" height="600">`)
|
||||||
|
//line mycoopts/view.qtpl:34
|
||||||
|
qw422016.E().S(lc.Get("ui.media_pdf"))
|
||||||
|
//line mycoopts/view.qtpl:34
|
||||||
|
qw422016.N().S(`</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
`)
|
||||||
|
//line mycoopts/view.qtpl:37
|
||||||
|
default:
|
||||||
|
//line mycoopts/view.qtpl:37
|
||||||
|
qw422016.N().S(`
|
||||||
|
<div class="binary-container binary-container_with-nothing">
|
||||||
|
<p><a href="/binary/`)
|
||||||
|
//line mycoopts/view.qtpl:39
|
||||||
|
qw422016.N().S(h.CanonicalName())
|
||||||
|
//line mycoopts/view.qtpl:39
|
||||||
qw422016.N().S(`">`)
|
qw422016.N().S(`">`)
|
||||||
//line mycoopts/view.qtpl:34
|
//line mycoopts/view.qtpl:39
|
||||||
qw422016.E().S(lc.Get("ui.media_download"))
|
qw422016.E().S(lc.Get("ui.media_download"))
|
||||||
//line mycoopts/view.qtpl:34
|
//line mycoopts/view.qtpl:39
|
||||||
qw422016.N().S(`</a></p>
|
qw422016.N().S(`</a></p>
|
||||||
</div>
|
</div>
|
||||||
`)
|
`)
|
||||||
//line mycoopts/view.qtpl:36
|
//line mycoopts/view.qtpl:41
|
||||||
}
|
}
|
||||||
//line mycoopts/view.qtpl:36
|
//line mycoopts/view.qtpl:41
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
`)
|
`)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
}
|
}
|
||||||
|
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
func WriteMedia(qq422016 qtio422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
|
func WriteMedia(qq422016 qtio422016.Writer, h *hyphae.MediaHypha, lc *l18n.Localizer) {
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
StreamMedia(qw422016, h, lc)
|
StreamMedia(qw422016, h, lc)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
}
|
}
|
||||||
|
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
func Media(h *hyphae.MediaHypha, lc *l18n.Localizer) string {
|
func Media(h *hyphae.MediaHypha, lc *l18n.Localizer) string {
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
WriteMedia(qb422016, h, lc)
|
WriteMedia(qb422016, h, lc)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
return qs422016
|
return qs422016
|
||||||
//line mycoopts/view.qtpl:37
|
//line mycoopts/view.qtpl:42
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,7 @@ article pre.codeblock { padding:.5rem; white-space: pre-wrap; }
|
|||||||
.binary-container_with-img img,
|
.binary-container_with-img img,
|
||||||
.binary-container_with-video video,
|
.binary-container_with-video video,
|
||||||
.binary-container_with-audio audio { max-width: 100%; width: auto; }
|
.binary-container_with-audio audio { max-width: 100%; width: auto; }
|
||||||
|
.binary-container_with-pdf iframe { height: calc(max(500px, 70vh)) }
|
||||||
|
|
||||||
.subhyphae__title { padding-bottom: .5rem; clear: both; }
|
.subhyphae__title { padding-bottom: .5rem; clear: both; }
|
||||||
.navi-title { padding-bottom: .5rem; margin: .25rem 0; }
|
.navi-title { padding-bottom: .5rem; margin: .25rem 0; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user