prototype for new slingit, updated system reference
This commit is contained in:
parent
2edb135f1b
commit
2f1c438406
6
api.php
6
api.php
@ -1,13 +1,9 @@
|
||||
<?php
|
||||
require_once 'lib/system/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'lib/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'slingit/autoload.inc'; //Project Classes
|
||||
require_once '/home/web/web/config/get_config.php';
|
||||
|
||||
\SYSTEM\system::start(\WEBCRAFT\get_config(dirname(__FILE__)));
|
||||
\SYSTEM\system::include_ExceptionShortcut();
|
||||
\SYSTEM\system::include_ResultShortcut();
|
||||
\SYSTEM\system::register_errorhandler_dbwriter();
|
||||
\SYSTEM\system::register_errorhandler_jsonoutput();
|
||||
|
||||
echo \SYSTEM\API\api::run('\SYSTEM\API\verify','api_slingit',array_merge($_POST,$_GET));
|
||||
new \SYSTEM\LOG\COUNTER("API was called sucessfully.");
|
||||
@ -1,13 +1,9 @@
|
||||
<?php
|
||||
require_once 'lib/system/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'lib/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'slingit/autoload.inc'; //Project Classes
|
||||
require_once '/home/web/web/config/get_config.php';
|
||||
|
||||
\SYSTEM\system::start(\WEBCRAFT\get_config(dirname(__FILE__)));
|
||||
\SYSTEM\system::include_ExceptionShortcut();
|
||||
\SYSTEM\system::include_ResultShortcut();
|
||||
\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);
|
||||
new \SYSTEM\LOG\COUNTER("Page was called sucessfully.");
|
||||
3
lib/autoload.inc
Normal file
3
lib/autoload.inc
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
require_once dirname(__FILE__).'/system/autoload.inc';
|
||||
//require_once dirname(__FILE__).'/webtorrent/autoload.inc';
|
||||
@ -1 +1 @@
|
||||
Subproject commit 583883cfda06a2fc724a96d76ba3ade9eada06f7
|
||||
Subproject commit 248e216e46b2e06fd92bc98df1b674a603c00ddd
|
||||
9
sai.php
9
sai.php
@ -1,13 +1,8 @@
|
||||
<?php
|
||||
require_once 'lib/system/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'lib/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'slingit/autoload.inc'; //Project Classes
|
||||
require_once '/home/web/web/config/get_config.php';
|
||||
|
||||
\SYSTEM\system::start(\WEBCRAFT\get_config(dirname(__FILE__)));
|
||||
SYSTEM\system::include_ExceptionShortcut(); //allow ERROR() instead of \SYSTEM\LOG\ERROR()
|
||||
SYSTEM\system::include_ResultShortcut(); //allow JsonResult() instead of \SYSTEM\LOG\JsonResult()
|
||||
SYSTEM\system::register_errorhandler_dbwriter(); //write errors to database (must be first errorhandler to register)
|
||||
SYSTEM\system::register_errorhandler_jsonoutput(); //print errors as json to caller
|
||||
|
||||
$sai = new SYSTEM\SAI\saigui();
|
||||
echo $sai->html();
|
||||
echo (new SYSTEM\SAI\saigui())->html();
|
||||
8
setup.php
Normal file
8
setup.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
require_once 'lib/autoload.inc'; //SYSTEM Classes
|
||||
require_once 'slingit/autoload.inc'; //Project Classes
|
||||
require_once '/home/web/web/config/get_config.php';
|
||||
|
||||
\SYSTEM\system::start(\WEBCRAFT\get_config(dirname(__FILE__)));
|
||||
|
||||
echo \SYSTEM\SQL\setup::install();
|
||||
@ -1,17 +1,16 @@
|
||||
<?php
|
||||
class default_page extends \SYSTEM\PAGE\Page {
|
||||
private static function js(){
|
||||
return '<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'jquery/jquery-1.9.1.min.js').'"></script>'.
|
||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'bootstrap/js/bootstrap.min.js').'"></script>'.
|
||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'webtorrent/webtorrent.min.js').'"></script>'.
|
||||
'<script type="text/javascript" language="JavaScript" src="./api.php?call=files&cat=sys&id=system.js"></script>'.
|
||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/default_page.js').'"></script>';
|
||||
return \SYSTEM\HTML\html::script(\LIB\lib_jquery::js()).
|
||||
\SYSTEM\HTML\html::script(\LIB\lib_bootstrap::js()).
|
||||
\SYSTEM\HTML\html::script(\SYSTEM\WEBPATH(new \PLIB(),'webtorrent/webtorrent.min.js')).
|
||||
\SYSTEM\HTML\html::script(\LIB\lib_system::js()).
|
||||
\SYSTEM\HTML\html::script(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/js/default_page.js'));
|
||||
}
|
||||
|
||||
private static function css(){
|
||||
return '<link href="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/css/default_page.css').'" rel="stylesheet" type="text/css">'.
|
||||
'<link href="'.SYSTEM\WEBPATH(new PLIB(),'bootstrap/css/bootstrap.min.css').'" rel="stylesheet" type="text/css">'.
|
||||
'<link href="'.SYSTEM\WEBPATH(new PLIB(),'bootstrap/css/bootstrap-theme.min.css').'" rel="stylesheet" type="text/css">';
|
||||
return \SYSTEM\HTML\html::link(\LIB\lib_bootstrap::css()).
|
||||
\SYSTEM\HTML\html::link(\SYSTEM\WEBPATH(new \PPAGE(),'default_page/css/default_page.css'));
|
||||
}
|
||||
|
||||
public function html($_escaped_fragment_ = null){
|
||||
@ -21,6 +20,6 @@ class default_page extends \SYSTEM\PAGE\Page {
|
||||
$vars['js'] = self::js();}
|
||||
$vars['css'] = self::css();
|
||||
$vars['langswitcher'] = \SYSTEM\SAI\saimod_sys_langswitcher::lang_menu();
|
||||
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/tpl/default_page.tpl'), $vars);
|
||||
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new \PPAGE(),'default_page/tpl/default_page.tpl'), $vars);
|
||||
}
|
||||
}
|
||||
@ -76,13 +76,13 @@ LogContext.prototype.log_file_done = function(torrent,url,file){
|
||||
'<td>' +
|
||||
'<a href="' + url + '"' +
|
||||
' download="' + file.name + '">' +
|
||||
'Download ' + file.name +
|
||||
'Save ' + file.name +
|
||||
'</a>' +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
|
||||
' target="_blank">' +
|
||||
'direct link: ' +
|
||||
'Share: ' +
|
||||
'</a>' +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
|
||||
@ -20,19 +20,9 @@ function init_start(){
|
||||
slingit_upload(client,files);
|
||||
});
|
||||
|
||||
//download
|
||||
$('#btn_load_infohash').click(function(e){
|
||||
if ($('#input_load_infohash').val()){
|
||||
e.preventDefault();
|
||||
slingit_download(client,$('#input_load_infohash').val());
|
||||
} else {
|
||||
$('#input_load_infohash').focus();
|
||||
}});
|
||||
|
||||
|
||||
//start download if hash provided
|
||||
if($('#input_load_infohash').val() !== ''){
|
||||
slingit_download(client,$('#input_load_infohash').val());}
|
||||
if($('#dropZone').attr('hash') !== ''){
|
||||
slingit_download(client,$('#dropZone').attr('hash'));}
|
||||
}
|
||||
function handleFileSelect(evt) {
|
||||
var files = evt.target.files; // FileList object
|
||||
@ -61,7 +51,7 @@ function log_file_start(torrent){
|
||||
'<td>' +
|
||||
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
|
||||
' target="_blank">' +
|
||||
'direct link: ' +
|
||||
'Share: ' +
|
||||
'</a>' +
|
||||
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
|
||||
' ' +
|
||||
@ -84,7 +74,7 @@ function log_file_add(torrent){
|
||||
'<td>' +
|
||||
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
|
||||
' target="_blank">' +
|
||||
'direct link: ' +
|
||||
'Share: ' +
|
||||
'</a>' +
|
||||
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
|
||||
' ' +
|
||||
@ -108,7 +98,7 @@ function log_file_upd(torrent){
|
||||
'<td>' +
|
||||
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
|
||||
' target="_blank">' +
|
||||
'direct link: ' +
|
||||
'Share: ' +
|
||||
'</a>' +
|
||||
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
|
||||
'</td>');
|
||||
@ -140,13 +130,13 @@ function log_file_done(torrent,url,file){
|
||||
'<td>' +
|
||||
'<a href="' + url + '"' +
|
||||
' download="' + file.name + '">' +
|
||||
'Download ' + file.name +
|
||||
'Save: ' + file.name +
|
||||
'</a>' +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
'<a href="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '"' +
|
||||
' target="_blank">' +
|
||||
'direct link: ' +
|
||||
'Share: ' +
|
||||
'</a>' +
|
||||
'<input type="text" value="http://www.slingit.org/#!start;hash.' + torrent.infoHash + '" onClick="this.setSelectionRange(0, this.value.length)"/>' +
|
||||
' ' +
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
<div id="start_main" >
|
||||
<div id="dropZone">
|
||||
<div id="dropZone" hash="${hash}">
|
||||
<p>
|
||||
${center_text}
|
||||
<a class="btn btn-primary btn-sm" href="#!start;hash.${hash}" id="btn_load_infohash"><span class="glyphicon glyphicon-download-alt"></span> ${getfile}</a>
|
||||
<!--<a class="btn btn-primary btn-sm" href="#!start;hash.${hash}" id="btn_load_infohash"><span class="glyphicon glyphicon-download-alt"></span> ${getfile}</a>
|
||||
${via}
|
||||
<input type="text" placeholder="#hash" id="input_load_infohash" value="${hash}">
|
||||
<input type="text" placeholder="#hash" id="input_load_infohash" value="${hash}">-->
|
||||
</p>
|
||||
</div>
|
||||
<table id="link_container">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user