| @@ -75,6 +75,15 @@ install it through pip (installing pip if necessary) | |||
| `conf.json.example` to `conf.json`). These are: | |||
| { | |||
| "tmpdir": String. The directory to store temporary files in. Default: "tmp" | |||
| "subtitles": String (or false). The language code for the subtitles, or false for no subtitles. Default: "en" (english). | |||
| "tmpdir": String. The directory to store temporary files in. | |||
| Default: "tmp" | |||
| "subtitles": String (or false). The language code for the subtitles, | |||
| or false for no subtitles. Default: "en" (english). | |||
| "additional_links": Array of objects which look like this: | |||
| { "name": "some name", "url": "some URL" } | |||
| Lets you add more parts to the index page. I use it to link to an | |||
| instance of guacamole, a web based VNC client. | |||
| ( https://guacamole.incubator.apache.org/ ) | |||
| } | |||
| @@ -1,4 +1,5 @@ | |||
| { | |||
| "tmpdir": "tmp", | |||
| "subtitles": "en" | |||
| "subtitles": "en", | |||
| "additional_links": [] | |||
| } | |||
| @@ -62,3 +62,7 @@ app.post("/play/file", (req, res) => { | |||
| }); | |||
| }); | |||
| }); | |||
| app.get("/additional-links", (req, res) => { | |||
| res.json(conf.additional_links); | |||
| }); | |||
| @@ -28,5 +28,6 @@ | |||
| </div> | |||
| <script src="/webstuff.js"></script> | |||
| <script src="/script.js"></script> | |||
| </body> | |||
| </html> | |||
| @@ -0,0 +1,18 @@ | |||
| get("/additional-links", function(err, res) { | |||
| if (err) | |||
| return console.trace(err); | |||
| JSON.parse(res).forEach(function(link) { | |||
| var form = document.createElement("form"); | |||
| form.className = "part"; | |||
| form.method = "get"; | |||
| form.action = link.url; | |||
| var btn = document.createElement("button"); | |||
| btn.className = "link"; | |||
| btn.innerHTML = link.name; | |||
| form.appendChild(btn); | |||
| $$("#parts").appendChild(form); | |||
| }); | |||
| }); | |||
| @@ -21,12 +21,24 @@ | |||
| #parts .part input { | |||
| width: calc(100% - 80px); | |||
| } | |||
| #parts .part input[type=url], | |||
| #parts .part input[type=text] { | |||
| padding-left: 6px; | |||
| } | |||
| #parts .part button { | |||
| width: 75px; | |||
| float: right; | |||
| } | |||
| #parts .part button.link { | |||
| width: 100%; | |||
| height: 42px; | |||
| float: none; | |||
| } | |||
| #parts .part input, | |||
| #parts .part button { | |||
| height: 28px; | |||
| height: 34px; | |||
| line-height: 0px; | |||
| } | |||