+
@@ -134,14 +147,19 @@
{{ .GetContent }}
-
+
{{ if eq .VideoLocation "" }}
{{ else }}
-
+
+
{{ end }}
@@ -156,11 +174,6 @@
{{ end }}
-
{{ end }}
diff --git a/index.js b/index.js
index a2fbdec..2fd15ea 100644
--- a/index.js
+++ b/index.js
@@ -2,3 +2,47 @@
This file is (C) Captain ALM
Under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License
*/
+const EntryData = []
+function CreateEntry(name, videourl, videotype, start, end, duration) {
+ return {
+ name: name,
+ videourl: videourl,
+ videotype: videotype,
+ start: Date.parse(start),
+ end: Date.parse(end),
+ duration : duration
+ };
+}
+function CreateVideoPlaceholder(id) {
+ let imgPH = document.createElement("img")
+ imgPH.src = PlayImageURL
+ imgPH.id = "play-"+id
+ imgPH.alt = "Play Video"
+ imgPH.width = 360
+ imgPH.style.cursor = "pointer"
+ if (document.addEventListener) {
+ imgPH.addEventListener("click", function () {ActivateVideo(id);})
+ } else {
+ imgPH.setAttribute("onclick", "ActivateVideo("+id+");")
+ imgPH.onclick = function () {ActivateVideo(id);}
+ }
+ document.getElementById("video-" + id).appendChild(imgPH)
+}
+function ActivateVideo(id) {
+ let holder = document.getElementById("video-" + id)
+ holder.removeChild(document.getElementById("play-"+id))
+ let vid = document.createElement("video")
+ vid.controls = true
+ let vids = document.createElement("source")
+ vids.src = EntryData[id].videourl
+ vids.type = EntryData[id].videotype
+ let vida = document.createElement("a")
+ vida.href = EntryData[id].videourl
+ vida.innerText = "The Video"
+ vid.appendChild(vids)
+ vid.appendChild(vida)
+ holder.appendChild(vid)
+ if (vid.play) {
+ vid.play()
+ }
+}
diff --git a/pageHandler/pages/index/template-marshal.go b/pageHandler/pages/index/template-marshal.go
index 32cfdea..0e5f2c4 100644
--- a/pageHandler/pages/index/template-marshal.go
+++ b/pageHandler/pages/index/template-marshal.go
@@ -13,9 +13,10 @@ type Marshal struct {
OrderName int8
OrderDuration int8
Light bool
+ Counter int
}
-func (m Marshal) GetEntries() (toReturn []EntryYaml) {
+func (m *Marshal) GetEntries() (toReturn []EntryYaml) {
toReturn = m.Data.Entries
if m.OrderStartDate > 0 {
sort.Slice(toReturn, func(i, j int) bool {
@@ -59,3 +60,9 @@ func (m Marshal) GetEntries() (toReturn []EntryYaml) {
}
return toReturn
}
+
+func (m *Marshal) CounterPlusPlus() int {
+ toret := m.Counter
+ m.Counter++
+ return toret
+}