From b52d182f07c1a814f79ae3772443fa1c6c1b8f64 Mon Sep 17 00:00:00 2001 From: Niels Groot Obbink Date: Mon, 10 Sep 2012 21:57:53 +0200 Subject: [PATCH] fixed embed, added location placeholder and fixed the embed URLs and preview --- lsp/functions.js | 13 +------------ lsp/main.js | 43 ++++++++++++------------------------------- src/embed.js | 24 +++++++++++++++--------- 3 files changed, 28 insertions(+), 52 deletions(-) diff --git a/lsp/functions.js b/lsp/functions.js index d6949bb6..934b03e0 100644 --- a/lsp/functions.js +++ b/lsp/functions.js @@ -190,7 +190,7 @@ */ function parseURL(url) { - var pattern = /(https?)\:\/\/([^:\/]+)\:(\d+)?/; + var pattern = /(https?)\:\/\/([^:\/]+)\:(\d+)?/i; var retobj = {protocol: '', host: '', port: ''}; var results = url.match(pattern); @@ -391,14 +391,3 @@ } } - -/* - if(status == 1) - { - $(row.children()[3]).html("Running"); - } - $(row.children()[3]).html("" + (status == 0 ? 'Offline' : (!status ? 'Unknown, checking...' : status) ) + ""); - } - -*/ - diff --git a/lsp/main.js b/lsp/main.js index f3e56a1a..65eee688 100644 --- a/lsp/main.js +++ b/lsp/main.js @@ -1,12 +1,4 @@ - -/* WERKLOG todolist -// TODO FIXME remove deze comment als het klaar is -settings.settings.statistics[streamID].log (zelfde als curr maar log = gesloten connecties, dus ex-users -TODO als server het stuurt -*/ - - /** * Local settings page * DDVTECH @@ -102,7 +94,7 @@ TODO als server het stuurt { case 'login': - var host = $('').attr('type', 'text').attr('placeholder', 'HTTP://LOCALHOST:4242'); + var host = $('').attr('type', 'text').attr('placeholder', 'HTTP://' + (location.host == '' ? 'localhost:4242' : location.host) + '/api'); var user = $('').attr('type', 'text').attr('placeholder', 'USERNAME'); var pass = $('').attr('type', 'password').attr('placeholder', 'PASSWORD'); var conn = $('