diff --git a/lib/system b/lib/system index 49e18f1..9b30021 160000 --- a/lib/system +++ b/lib/system @@ -1 +1 @@ -Subproject commit 49e18f1c3cf61c62952a3be957f1093a88cb1782 +Subproject commit 9b300210290eb0d7234b10ce84831a9b92800b2e diff --git a/slingit/page/default_page/css/default_page.css b/slingit/page/default_page/css/default_page.css index 3eae595..5154dc9 100644 --- a/slingit/page/default_page/css/default_page.css +++ b/slingit/page/default_page/css/default_page.css @@ -14,10 +14,12 @@ body{} #content {} -#footer { +#footer { position: absolute; height: 20px; - bottom: 0; + bottom: 0px; + left: 0; + right: 0; text-align: center; width: 100%; background: whitesmoke; diff --git a/slingit/page/default_page/default_page.php b/slingit/page/default_page/default_page.php index 2da6b9b..a123f67 100644 --- a/slingit/page/default_page/default_page.php +++ b/slingit/page/default_page/default_page.php @@ -1,19 +1,14 @@ '. ''. - ''. - //''. - //''. - //''. + ''. ''. - ''. - ''; - + ''; } - private function css(){ + private static function css(){ return ''. ''. ''. @@ -22,8 +17,8 @@ class default_page extends \SYSTEM\PAGE\Page { public function html(){ $vars = array(); - $vars['js'] = $this->js(); - $vars['css'] = $this->css(); + $vars['js'] = self::js(); + $vars['css'] = self::css(); $vars['PATH_LOCAL_IMG'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/img/'); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/default_page.tpl'), $vars); diff --git a/slingit/page/default_page/js/lang_switcher.js b/slingit/page/default_page/js/lang_switcher.js deleted file mode 100644 index 07164fc..0000000 --- a/slingit/page/default_page/js/lang_switcher.js +++ /dev/null @@ -1,30 +0,0 @@ -function switchLocale(locale){ - reloadWithQueryStringVars({"_lang": locale}); -} - -function reloadWithQueryStringVars (queryStringVars) { - var existingQueryVars = location.search ? location.search.substring(1).split("&") : [], - //currentUrl = location.search ? location.href.replace(location.search,"") : location.href, - newQueryVars = {}, - newUrl = "http://www.slingit.org/?_lang="+queryStringVars._lang+"#"; - if(existingQueryVars.length > 0) { - for (var i = 0; i < existingQueryVars.length; i++) { - var pair = existingQueryVars[i].split("="); - newQueryVars[pair[0]] = pair[1]; - } - } - if(queryStringVars) { - for (var queryStringVar in queryStringVars) { - newQueryVars[queryStringVar] = queryStringVars[queryStringVar]; - } - } - if(newQueryVars) { - for (var newQueryVar in newQueryVars) { - newUrl += newQueryVar + "=" + newQueryVars[newQueryVar] + "&"; - } - newUrl = newUrl.substring(0, newUrl.length-1); - window.location.href = newUrl; - } else { - window.location.href = location.href; - } -} diff --git a/slingit/page/default_page/tpl/default_page.tpl b/slingit/page/default_page/tpl/default_page.tpl index 00936d7..a1c70a8 100644 --- a/slingit/page/default_page/tpl/default_page.tpl +++ b/slingit/page/default_page/tpl/default_page.tpl @@ -24,8 +24,8 @@ \ No newline at end of file diff --git a/slingit/page/default_start/css/default_start.css b/slingit/page/default_start/css/default_start.css index 4fd6cbc..9682fc2 100644 --- a/slingit/page/default_start/css/default_start.css +++ b/slingit/page/default_start/css/default_start.css @@ -14,7 +14,7 @@ list-style-type: none; } -#dropZone p, #pullZone p{ +#dropZone p{ position:relative; top:45%; left:0; @@ -22,14 +22,6 @@ text-align: center; } -#pullZone{ - width: 400px; - height: 400px; - float: left; - outline: 3px solid #eee; - margin-left: 15px; -} - #link_container { padding-top: 40px; font-size: 8pt; diff --git a/slingit/page/default_start/default_start.php b/slingit/page/default_start/default_start.php index 7c661e0..4c220aa 100644 --- a/slingit/page/default_start/default_start.php +++ b/slingit/page/default_start/default_start.php @@ -11,7 +11,7 @@ class default_start extends SYSTEM\PAGE\Page { return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/css/default_start.css'));} public function html(){ $vars = array(); - $vars['hash'] = $this->hash == '${hash}' ? '' : $this->hash; + $vars['hash'] = $this->hash ? $this->hash : ''; $vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE), \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_TEXT)); return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/tpl/default_start.tpl'), $vars); diff --git a/slingit/page/default_start/js/default_start.js b/slingit/page/default_start/js/default_start.js index 2e34f7f..8e1bbef 100644 --- a/slingit/page/default_start/js/default_start.js +++ b/slingit/page/default_start/js/default_start.js @@ -1,8 +1,6 @@ var client = new WebTorrent({ - rtcConfig: { iceServers: - [{url: "stun:23.21.150.121"}, - {url: "stun:stun.1.google.com:19302"}] - } + rtcConfig: { iceServers: [ {url: "stun:23.21.150.121"}, + {url: "stun:stun.1.google.com:19302"}]} }); function init_start(){ @@ -28,7 +26,7 @@ function init_start(){ slingit_download(client,$('#input_load_infohash').val());}); //start download if hash provided - if($('#input_load_infohash').val() != ''){ + if($('#input_load_infohash').val() !== ''){ slingit_download(client,$('#input_load_infohash').val());} } function handleFileSelect(evt) { @@ -67,7 +65,7 @@ function log_file_start(torrent){ } function log_file_add(torrent){ - var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1) + var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1); $('#link_container tr:last').after( '' + '' + @@ -91,7 +89,7 @@ $.getScript("http://platform.twitter.com/widgets.js"); function log_file_upd(torrent){ if($('#'+torrent.infoHash).length){ - var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1) + var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1); $('#'+torrent.infoHash).html( '' + progress + '%' + @@ -105,9 +103,7 @@ function log_file_upd(torrent){ 'direct link: ' + '' + '' + - '   ' + - 'Tweet' + - '') + ''); } else { log_file_add(torrent); } @@ -147,20 +143,20 @@ function log_file_done(torrent,url,file){ 'Tweet' + '' + ''); + $.getScript("http://platform.twitter.com/widgets.js"); } function slingit_upload(client,files){ log_initialize(); var fileStore = new Array(); - console.log(files) + console.log(files); for (var i=0, file; file=files[i]; i++) { var reader = new FileReader(); - reader.onload = function(e2) { // finished reading file data. - } + reader.onload = function(e2) {}; // finished reading file data. reader.readAsDataURL(file); // start reading the file data. fileStore.push(file); console.log(file); - var fname = file.name + var fname = file.name; client.seed(file,onTorrent); } } @@ -171,11 +167,11 @@ function onTorrent (torrent) { torrent.swarm.on('download', function () { log_file_upd(torrent); - }) + }); torrent.swarm.on('upload', function () { log_file_upd(torrent); - }) + }); torrent.files.forEach(function (file) { /*var extname = path.extname(file.name) @@ -191,11 +187,11 @@ function onTorrent (torrent) { file.createReadStream().pipe(audio) } else {*/ file.getBlobURL(function (err, url) { - if (err) throw err + if (err) throw err; log_file_done(torrent,url,file); - }) + }); //} - }) + }); } function slingit_download(client,hash){ diff --git a/slingit/page/page_slingit.php b/slingit/page/page_slingit.php index 9b55fa4..618a806 100644 --- a/slingit/page/page_slingit.php +++ b/slingit/page/page_slingit.php @@ -6,7 +6,7 @@ class page_slingit extends \SYSTEM\API\api_default { public static function default_page(){ return new default_page();} - public static function page_start($hash){ + public static function page_start($hash = null){ return new default_start($hash);} public static function page_about(){