diff --git a/config.php b/config.php index 6ef1d96..2ebedfd 100644 --- a/config.php +++ b/config.php @@ -8,10 +8,9 @@ $slingit_config=array(array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, 'mojotrolls_mysql'), array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, 'dajsabeaisvd345'), array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME, 'host_slingit'), - array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_NAVIMG, '/web/system/sai/page/img/logo.png'),//not working, cuz paths are not set yet! \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'page/default_page/img/logo.png')), - array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_BASEURL, 'http://www.slingit.org/sai.php?'), array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE, 'Slingit - Admin Bereich'), - array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT, ' © WebCraft Media 2013'), + array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT, ' © WebCraft Media 2015'), + array(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT, 'slingit'), array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL, 'lib/system/'), array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS, array('deDE','enUS', 'frFR', 'esES', 'trTR', 'jaJA')), array(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG, 'deDE'), diff --git a/index.php b/index.php index 29f4a57..564344d 100644 --- a/index.php +++ b/index.php @@ -9,5 +9,5 @@ require_once 'config.php'; \SYSTEM\system::register_errorhandler_dbwriter(); \SYSTEM\system::register_errorhandler_jsonoutput(); -echo \SYSTEM\API\api::run('\SYSTEM\API\verify', 'page_slingit', array_merge($_POST,$_GET), 1, true, true)->html(); +echo \SYSTEM\API\api::run('\SYSTEM\API\verify', 'page_slingit', array_merge($_POST,$_GET), 1, true, true); new \SYSTEM\LOG\COUNTER("Page was called sucessfully."); \ No newline at end of file diff --git a/slingit/files/img/loader.gif b/slingit/files/img/loader.gif new file mode 100644 index 0000000..d0bce15 Binary files /dev/null and b/slingit/files/img/loader.gif differ 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..1738cd7 100644 --- a/slingit/page/default_page/default_page.php +++ b/slingit/page/default_page/default_page.php @@ -1,29 +1,26 @@ '. ''. - ''. - //''. - //''. - //''. + ''. ''. - ''. - ''; - + ''; } - private function css(){ + private static function css(){ return ''. ''. ''. ''; } - public function html(){ - $vars = array(); - $vars['js'] = $this->js(); - $vars['css'] = $this->css(); + public function html($_escaped_fragment_ = null){ + $vars = array(); + $vars['js'] = ''; + if(!$_escaped_fragment_){ + $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/default_page.js b/slingit/page/default_page/js/default_page.js index fb963ae..eea5eab 100644 --- a/slingit/page/default_page/js/default_page.js +++ b/slingit/page/default_page/js/default_page.js @@ -1,3 +1,7 @@ $(document).ready(function() { new SYSTEM('./api.php',1,'start'); + $('#about').click(function(){ + $('#modal_text').modal('show');}); + $('#impressum').click(function(){ + $('#modal_text').modal('show');}); }); \ No newline at end of file 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..9cba726 100644 --- a/slingit/page/default_page/tpl/default_page.tpl +++ b/slingit/page/default_page/tpl/default_page.tpl @@ -2,8 +2,10 @@ - - + + + + SlingiT ${css} ${js} @@ -24,8 +26,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 1096e50..bf8b930 100644 --- a/slingit/page/default_start/default_start.php +++ b/slingit/page/default_start/default_start.php @@ -12,7 +12,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..a09ce97 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) { @@ -46,6 +44,7 @@ function handleFileSelect(evt) { } function log_file_start(torrent){ + $('#init_loader').hide(); $('#link_container tr:last').after( '' + '' + @@ -67,7 +66,8 @@ function log_file_start(torrent){ } function log_file_add(torrent){ - var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1) + $('#init_loader').hide(); + var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1); $('#link_container tr:last').after( '' + '' + @@ -90,8 +90,9 @@ $.getScript("http://platform.twitter.com/widgets.js"); } function log_file_upd(torrent){ + $('#init_loader').hide(); 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 +106,7 @@ function log_file_upd(torrent){ 'direct link: ' + '' + '' + - '   ' + - 'Tweet' + - '') + ''); } else { log_file_add(torrent); } @@ -116,6 +115,7 @@ function log_initialize() { $('#link_container tr:last').after( '' + '' + + '... '+ 'initializing' + '' + '' + '' + @@ -125,6 +125,7 @@ function log_initialize() { } function log_file_done(torrent,url,file){ + $('#init_loader').hide(); log_file_upd(torrent); $('#link_container tr:last').after( '' + @@ -147,20 +148,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 +172,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 +192,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 26fc2f0..ebfec6b 100644 --- a/slingit/page/page_slingit.php +++ b/slingit/page/page_slingit.php @@ -1,20 +1,19 @@ html($_escaped_fragment_);} - public static function page_start($hash){ - return new default_start($hash);} + public static function page_start($hash = null){ + return (new default_start($hash))->html();} public static function page_about(){ - return new default_about('');} + return (new default_about(''))->html();} public static function page_impressum(){ - return new default_impressum('');} - - public static function page_status(){ - return new default_status('');} + return (new default_impressum(''))->html();} } \ No newline at end of file