mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-14 01:44:06 +02:00
Refactor code.
This commit is contained in:
@@ -20,11 +20,11 @@ class Bootstrap {
|
|||||||
if ($context->is_api_request()) {
|
if ($context->is_api_request()) {
|
||||||
(new Api($context))->apply();
|
(new Api($context))->apply();
|
||||||
} else if ($context->is_info_request()) {
|
} else if ($context->is_info_request()) {
|
||||||
define('PUBLIC_HREF', $setup->get('PUBLIC_HREF'));
|
$public_href = $setup->get('PUBLIC_HREF');
|
||||||
require __DIR__ . '/pages/info.php';
|
require __DIR__ . '/pages/info.php';
|
||||||
} else {
|
} else {
|
||||||
define('PUBLIC_HREF', $setup->get('PUBLIC_HREF'));
|
$public_href = $setup->get('PUBLIC_HREF');
|
||||||
define('FALLBACK', (new Fallback($context))->get_html());
|
$fallback_html = (new Fallback($context))->get_html();
|
||||||
require __DIR__ . '/pages/index.php';
|
require __DIR__ . '/pages/index.php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@ extends ./page.tpl.jade
|
|||||||
|
|
||||||
block init
|
block init
|
||||||
|
|
||||||
- var TITLE = 'index - powered by ' + pkg.name + ' v' + pkg.version + ' (' + pkg.homepage + ')'
|
- var title = 'index - powered by ' + pkg.name + ' v' + pkg.version + ' (' + pkg.homepage + ')'
|
||||||
- var MODULE = 'index'
|
- var module = 'index'
|
||||||
|
|
||||||
block body
|
block body
|
||||||
|
|
||||||
div#fallback <?= FALLBACK; ?>
|
div#fallback <?= $fallback_html; ?>
|
||||||
|
@@ -2,8 +2,8 @@ extends ./page.tpl.jade
|
|||||||
|
|
||||||
block init
|
block init
|
||||||
|
|
||||||
- var TITLE = pkg.name + ' info page - v' + pkg.version
|
- var title = pkg.name + ' info page - v' + pkg.version
|
||||||
- var MODULE = 'info'
|
- var module = 'info'
|
||||||
|
|
||||||
block body
|
block body
|
||||||
|
|
||||||
@@ -17,4 +17,4 @@ block body
|
|||||||
form( action="https://www.paypal.com/cgi-bin/webscr", method="post", target="_blank" )
|
form( action="https://www.paypal.com/cgi-bin/webscr", method="post", target="_blank" )
|
||||||
input( type="hidden", name="cmd", value="_s-xclick" )
|
input( type="hidden", name="cmd", value="_s-xclick" )
|
||||||
input( type="hidden", name="hosted_button_id", value="8WSPKWT7YBTSQ" )
|
input( type="hidden", name="hosted_button_id", value="8WSPKWT7YBTSQ" )
|
||||||
input( type="image", src!="#{PUBLIC_HREF}images/ui/paypal.svg", name="submit", alt="PayPal" )
|
input( type="image", src!="#{public_href}images/ui/paypal.svg", name="submit", alt="PayPal" )
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
- var PUBLIC_HREF = '<?= PUBLIC_HREF; ?>'
|
- var public_href = '<?= $public_href; ?>'
|
||||||
|
|
||||||
block init
|
block init
|
||||||
|
|
||||||
@@ -10,16 +10,16 @@ doctype html
|
|||||||
head
|
head
|
||||||
meta( charset="utf-8" )
|
meta( charset="utf-8" )
|
||||||
meta( http-equiv="x-ua-compatible", content="ie=edge" )
|
meta( http-equiv="x-ua-compatible", content="ie=edge" )
|
||||||
title #{TITLE}
|
title #{title}
|
||||||
meta( name="description", content="#{TITLE}" )
|
meta( name="description", content="#{title}" )
|
||||||
meta( name="viewport", content="width=device-width, initial-scale=1" )
|
meta( name="viewport", content="width=device-width, initial-scale=1" )
|
||||||
link( rel="shortcut icon", href!="#{PUBLIC_HREF}images/favicon/favicon-16-32.ico" )
|
link( rel="shortcut icon", href!="#{public_href}images/favicon/favicon-16-32.ico" )
|
||||||
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{PUBLIC_HREF}images/favicon/favicon-152.png" )
|
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{public_href}images/favicon/favicon-152.png" )
|
||||||
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
|
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
|
||||||
link( rel="stylesheet", href!="#{PUBLIC_HREF}css/styles.css" )
|
link( rel="stylesheet", href!="#{public_href}css/styles.css" )
|
||||||
script( src!="#{PUBLIC_HREF}js/scripts.js", data-module="#{MODULE}" )
|
script( src!="#{public_href}js/scripts.js", data-module="#{module}" )
|
||||||
|
|
||||||
body#root( class="#{MODULE}" )
|
body#root( class="#{module}" )
|
||||||
|
|
||||||
div#fallback-hints
|
div#fallback-hints
|
||||||
span.noJsMsg
|
span.noJsMsg
|
||||||
|
Reference in New Issue
Block a user