This commit is contained in:
Naeltard 2015-04-08 16:06:01 +02:00
parent cee5208e15
commit 196480e2f8
7 changed files with 115 additions and 2 deletions

View File

@ -4,5 +4,5 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_start',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_start','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_about',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_about','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_impressum',''); SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_impressum','');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_status','');

View File

@ -5,7 +5,8 @@ class default_start extends SYSTEM\PAGE\Page {
$this->hash = $hash; $this->hash = $hash;
} }
public static function js(){ public static function js(){
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/js/default_start.js')); return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/js/default_start.js'),
\SYSTEM\WEBPATH(new PPAGE(),'default_start/js/default_log.js'));
} }
public static function css(){ public static function css(){
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/css/default_start.css'));} return array( \SYSTEM\WEBPATH(new PPAGE(),'default_start/css/default_start.css'));}

View File

@ -0,0 +1,95 @@
LogContext = function(){};
LogContext.prototype.id = "";
LogContext.prototype.init = function(){
$('#link_container tr').html(
'<td>' +
'initializing' +
'</td>' +
'<td>' + '</td>' +
'<td>' +
'</td>');
};
LogContext.prototype.log_file_add = function(torrent){
var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1)
$('#link_container tr').html(
'<tr id="' + torrent.infoHash + '">' +
'<td>' +
progress + '%' +
'</td>' +
'<td>' +
'speed: ' + torrent.swarm.downloadSpeed() + '/s' +
'</td>' +
'<td>' +
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
' target="_blank">' +
'direct link: ' +
'</a>' +
'</td>' +
'<td>' +
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
'&nbsp;&nbsp;&nbsp;' +
'</td>' +
'<td>' +
'<a class="twitter-share-button" href="https://twitter.com/share" data-via="slingtweet" data-url="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '">Tweet</a>' +
'</td>' +
'</tr>');
$.getScript("http://platform.twitter.com/widgets.js");
};
LogContext.prototype.log_file_upd = function(torrent){
if($('#'+torrent.infoHash).length){
var progress = (100 * torrent.downloaded / torrent.parsedTorrent.length).toFixed(1)
$('#'+torrent.infoHash).html(
'<td>' +
progress + '%' +
'</td>' +
'<td>' +
'speed: ' + torrent.swarm.downloadSpeed() + '/s / ' + torrent.swarm.uploadSpeed() + '/s' +
'</td>' +
'<td>' +
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
' target="_blank">' +
'direct link: ' +
'</a>' +
'</td>' +
'<td>' +
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
'&nbsp;&nbsp;&nbsp;' +
'</td>' +
'<td>' +
'<a class="twitter-share-button" href="https://twitter.com/share" data-via="slingtweet" data-url="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '">Tweet</a>' +
'</td>')
} else {
this.log_file_add(torrent);
}
};
LogContext.prototype.log_file_done = function(torrent,url,file){
this.log_file_upd(torrent);
$('#link_container tr').html(
'<td>' +
'100%' +
'</td>' +
'<td>' +
'<a href="' + url + '"' +
' download="' + file.name + '">' +
'Download ' + file.name +
'</a>' +
'</td>' +
'<td>' +
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
' target="_blank">' +
'direct link: ' +
'</a>' +
'</td>' +
'<td>' +
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
'&nbsp;&nbsp;&nbsp;' +
'</td>' +
'<td>' +
'<a class="twitter-share-button" href="https://twitter.com/share" data-via="slingtweet" data-url="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '">Tweet</a>' +
'</td>');
};

View File

@ -0,0 +1,10 @@
<?php
class default_status extends \SYSTEM\PAGE\Page {
public function html(){
$vars = \SYSTEM\locale::getStrings(110);
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_status/tpl/status.tpl'), $vars);
}
public static function js(){
return array( \SYSTEM\WEBPATH(new PPAGE(),'default_status/js/default_status.js'));
}
}

View File

@ -0,0 +1,3 @@
function init_status(){
}

View File

@ -0,0 +1 @@
test

View File

@ -14,4 +14,7 @@ class page_slingit extends \SYSTEM\API\api_default {
public static function page_impressum(){ public static function page_impressum(){
return new default_impressum('');} return new default_impressum('');}
public static function page_status(){
return new default_status('');}
} }