merge
This commit is contained in:
parent
cee5208e15
commit
196480e2f8
@ -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','');
|
||||||
|
|
||||||
|
|||||||
@ -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'));}
|
||||||
|
|||||||
95
slingit/page/default_start/js/default_log.js
Normal file
95
slingit/page/default_start/js/default_log.js
Normal 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)"/>' +
|
||||||
|
' ' +
|
||||||
|
'</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)"/>' +
|
||||||
|
' ' +
|
||||||
|
'</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)"/>' +
|
||||||
|
' ' +
|
||||||
|
'</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>');
|
||||||
|
};
|
||||||
10
slingit/page/default_status/default_status.php
Normal file
10
slingit/page/default_status/default_status.php
Normal 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'));
|
||||||
|
}
|
||||||
|
}
|
||||||
3
slingit/page/default_status/js/default_status.js
Normal file
3
slingit/page/default_status/js/default_status.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
function init_status(){
|
||||||
|
|
||||||
|
}
|
||||||
1
slingit/page/default_status/tpl/status.tpl
Normal file
1
slingit/page/default_status/tpl/status.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
test
|
||||||
@ -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('');}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user