From bfd12c723ddc69518a7bc70df7878e057d2d0a14 Mon Sep 17 00:00:00 2001 From: That-Guy <raptors@that-guy.net> Date: Wed, 4 Apr 2012 21:18:46 +0200 Subject: [PATCH 1/2] renamed server-rel to server, added overview stats, placeholder bugfix (#17, 1h) --- server-rel.html => server.html | 38 +++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) rename server-rel.html => server.html (99%) diff --git a/server-rel.html b/server.html similarity index 99% rename from server-rel.html rename to server.html index d2eec4f1..e8a0a30c 100644 --- a/server-rel.html +++ b/server.html @@ -638,6 +638,32 @@ td case 'overview': + var svr, viewer, + numstr = 0, + numvwr = 0, + numtotstr = 0; + + for(svr in settings.settings.statistics) + { + if(settings.settings.statistics[svr].curr) + { + for(viewer in settings.settings.statistics[svr].curr) + { + numvwr++; + } + } + } + + for(svr in settings.settings.streams) + { + numtotstr++; + + if(settings.settings.streams[svr].online && settings.settings.streams[svr].online == 1) + { + numstr++; + } + } + $('#page').append( $('<div>').attr('id', 'editserver').append( $('<label>').attr('for', 'config-host').text('host').append( @@ -645,7 +671,7 @@ td ) ).append( $('<label>').attr('for', 'config-name').text('name').append( - $('<input>').attr('type', 'text').attr('placeholder', 'SOURCE').attr('id', 'config-name').attr('value', settings.settings.config.name) + $('<input>').attr('type', 'text').attr('placeholder', 'NAME').attr('id', 'config-name').attr('value', settings.settings.config.name) ) ).append( $('<label>').text('version').append( @@ -655,9 +681,19 @@ td $('<label>').text('time').append( $('<span>').text( formatDate(settings.settings.config.time) ) ) + ).append( + $('<label>').text('Streams').append( + $('<span>').text( numstr + ' of ' + numtotstr + ' online') + ) + ).append( + $('<label>').text('Viewers').append( + $('<span>').text( numvwr ) + ) ) ); + + $('#editserver').append( $('<button>').attr('class', 'floatright').click(function() { From 2325d3be5a800e8d13177a78f5807fab9cc4f0ee Mon Sep 17 00:00:00 2001 From: That-Guy <raptors@that-guy.net> Date: Thu, 5 Apr 2012 00:36:14 +0200 Subject: [PATCH 2/2] added embed page and temporary text (#17) --- server.html | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/server.html b/server.html index e8a0a30c..d37a5be2 100644 --- a/server.html +++ b/server.html @@ -323,6 +323,12 @@ label, text-transform: uppercase; } + +.nocapitals +{ + text-transform: none; +} + #editserver label input { text-transform: none; @@ -820,9 +826,12 @@ if(confirmDelete('Are you sure you want to delete this protocol?') == true) $tr.append( $('<td>').text( TypeofResource( cstr.channel.URL ) ) ); - $tr.append( $('<td>').append( $('<button>').text('embed') ) ); - // TODO do something when pressed! - // FIXME need Thulinma's embed code + $tr.append( $('<td>').append( $('<button>').text('embed').click(function() + { + var sname = $(this).parent().parent().attr('id').replace('stream-', ''); + showTab('embed', sname); + }) ) ); + $tr.append( $('<td>').text(cstr.name) ); @@ -951,7 +960,7 @@ if(confirmDelete('Are you sure you want to delete this protocol?') == true) if(streamname == 'new') { - streamname = n.val().replace(' ', '-'); + streamname = n.val().replace(/ /g, '-'); } if(!settings.settings.streams) @@ -974,6 +983,21 @@ if(confirmDelete('Are you sure you want to delete this protocol?') == true) +case 'embed': + // FIXME use server URLs from stream_links.js + + var url = settings.settings.streams[streamname].channel.URL; + + $('#page').append( $('<p>').text('This feature is not yet implemented.') ); + $('#page').append( $('<p>').text('The URL for this stream is ').append( $('<span>').attr('class', 'nocapitals').text(url) ) ); + + + break; + + + + + case 'limits': $table = $('<table>'); $table.html("<thead><th>Type</th><th>Hard/soft</th><th>Value</th><th>applies to</th><th>Action</th></thead>");