From 741f23e03d5658ae1918b417f60c1c1f22189a9b Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Thu, 25 Jun 2015 18:07:19 +0200 Subject: [PATCH] Added form --- controllers/stream/views/index.jade | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/controllers/stream/views/index.jade b/controllers/stream/views/index.jade index a2d699a..6ef00f5 100644 --- a/controllers/stream/views/index.jade +++ b/controllers/stream/views/index.jade @@ -9,6 +9,21 @@ block extrajs script(src="/static/js/threetools.min.js") script(src="/static/js/socket.io.min.js") script(src="/static/js/streamingsimulator.min.js") + script(type='text/javascript'). + $(function() { + var filterInt = function (value) { + if(/^(\-|\+)?([0-9]+|Infinity)$/.test(value)) + return Number(value); + return NaN; + } + + $('#form').submit(function(e) { + e.preventDefault(); + var val = filterInt(document.getElementById('num').value); + console.log(val); + window.location.href = "/stream/" + val; + }); + }); block content h2 Sphere streaming @@ -24,4 +39,11 @@ block content onto the socket and the faces will be displayed as soon as you receive them. + form.form-inline#form + .form-group + label Try another resolution (between 1 and 25) + input#num(type='number', min=1, max=25, value=5, style={"margin-left":"10px"}) + .form-group + button#submit.btn.btn-primary(type='submit', style={"margin-left":"10px"}) Go + #container