1
0
mirror of https://github.com/lrsjng/h5ai.git synced 2025-08-13 17:34:07 +02:00

Refactor code.

This commit is contained in:
Lars Jung
2015-05-13 21:44:56 +02:00
parent 21014ff788
commit 2a7b1b1f0d
4 changed files with 17 additions and 17 deletions

View File

@@ -20,11 +20,11 @@ class Bootstrap {
if ($context->is_api_request()) {
(new Api($context))->apply();
} else if ($context->is_info_request()) {
define('PUBLIC_HREF', $setup->get('PUBLIC_HREF'));
$public_href = $setup->get('PUBLIC_HREF');
require __DIR__ . '/pages/info.php';
} else {
define('PUBLIC_HREF', $setup->get('PUBLIC_HREF'));
define('FALLBACK', (new Fallback($context))->get_html());
$public_href = $setup->get('PUBLIC_HREF');
$fallback_html = (new Fallback($context))->get_html();
require __DIR__ . '/pages/index.php';
}
}

View File

@@ -2,9 +2,9 @@ extends ./page.tpl.jade
block init
- var TITLE = 'index - powered by ' + pkg.name + ' v' + pkg.version + ' (' + pkg.homepage + ')'
- var MODULE = 'index'
- var title = 'index - powered by ' + pkg.name + ' v' + pkg.version + ' (' + pkg.homepage + ')'
- var module = 'index'
block body
div#fallback <?= FALLBACK; ?>
div#fallback <?= $fallback_html; ?>

View File

@@ -2,8 +2,8 @@ extends ./page.tpl.jade
block init
- var TITLE = pkg.name + ' info page - v' + pkg.version
- var MODULE = 'info'
- var title = pkg.name + ' info page - v' + pkg.version
- var module = 'info'
block body
@@ -17,4 +17,4 @@ block body
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="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" )

View File

@@ -1,4 +1,4 @@
- var PUBLIC_HREF = '<?= PUBLIC_HREF; ?>'
- var public_href = '<?= $public_href; ?>'
block init
@@ -10,16 +10,16 @@ doctype html
head
meta( charset="utf-8" )
meta( http-equiv="x-ua-compatible", content="ie=edge" )
title #{TITLE}
meta( name="description", content="#{TITLE}" )
title #{title}
meta( name="description", content="#{title}" )
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="apple-touch-icon-precomposed", type="image/png", href!="#{PUBLIC_HREF}images/favicon/favicon-152.png" )
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="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
link( rel="stylesheet", href!="#{PUBLIC_HREF}css/styles.css" )
script( src!="#{PUBLIC_HREF}js/scripts.js", data-module="#{MODULE}" )
link( rel="stylesheet", href!="#{public_href}css/styles.css" )
script( src!="#{public_href}js/scripts.js", data-module="#{module}" )
body#root( class="#{MODULE}" )
body#root( class="#{module}" )
div#fallback-hints
span.noJsMsg