Restructure file base.

This commit is contained in:
Lars Jung 2015-05-12 16:08:20 +02:00
parent 057a5f05a5
commit ee241e7e3f
151 changed files with 88 additions and 86 deletions

View file

@ -60,7 +60,7 @@ module.exports = function (suite) {
var fs = require('fs');
var jshint = JSON.parse(fs.readFileSync('.jshintrc', 'utf8'));
$(src + '/_h5ai/client/js: **/*.js, ! lib/**')
$(src + '/_h5ai/public/js: **/*.js, ! lib/**')
.jshint(jshint, jshint.globals);
});
@ -72,15 +72,15 @@ module.exports = function (suite) {
var mapSrc = $.map.p(src, build).s('.less', '.css').s('.jade', '');
var mapRoot = $.map.p(root, path.join(build, '_h5ai'));
$(src + ': _h5ai/client/js/*.js')
.newerThan(mapSrc, $(src + ': _h5ai/client/js/**'))
$(src + ': _h5ai/public/js/*.js')
.newerThan(mapSrc, $(src + ': _h5ai/public/js/**'))
.includeit()
.if(!suite.args.uncompressed, function () { this.uglifyjs(); })
.wrap(header)
.write(mapSrc, true);
$(src + ': _h5ai/client/css/*.less')
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
$(src + ': _h5ai/public/css/*.less')
.newerThan(mapSrc, $(src + ': _h5ai/public/css/**'))
.includeit()
.less()
.autoprefixer()
@ -93,7 +93,7 @@ module.exports = function (suite) {
.jade(env)
.write(mapSrc, true);
$(src + ': **, ! _h5ai/client/js/**, ! _h5ai/client/css/**, ! **/*.jade')
$(src + ': **, ! _h5ai/public/js/**, ! _h5ai/public/css/**, ! **/*.jade')
.newerThan(mapSrc)
.handlebars(env)
.write(mapSrc, true);
@ -135,13 +135,13 @@ module.exports = function (suite) {
var env = {pkg: pkg};
$(src + '/_h5ai/client/css/styles.less')
$(src + '/_h5ai/public/css/styles.less')
.includeit()
.less()
.autoprefixer()
.write(build + '/test/h5ai-styles.css', true);
$(src + '/_h5ai/client/js/scripts.js')
$(src + '/_h5ai/public/js/scripts.js')
.includeit()
.write(build + '/test/h5ai-scripts.js', true);

View file

@ -1,46 +1,3 @@
DirectoryIndex index.html
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .css .js .json .svg
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 week"
# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!)
ExpiresByType image/x-icon "access plus 1 week"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 week"
# Media
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
# Web fonts
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>
Satisfy all
Order deny,allow
Deny from all

View file

@ -17,7 +17,7 @@ class Bootstrap {
date_default_timezone_set(@date_default_timezone_get());
session_start();
require __DIR__ . '/../config.php';
require __DIR__ . '/../../conf/passhash.php';
$session = new Session($_SESSION);
$request = new Request($_REQUEST);

View file

@ -29,7 +29,7 @@ class Fallback {
$path = $this->get_current_path();
}
$app_href = $this->setup->get('APP_HREF');
$fallback_images_href = $this->setup->get('APP_HREF') . 'public/images/fallback/';
$cache = [];
$folder = Item::get($this->context, $path, $cache);
@ -47,7 +47,7 @@ class Fallback {
if ($folder->get_parent($cache)) {
$html .= '<tr>';
$html .= '<td class="fb-i"><img src="' . $app_href . 'client/images/fallback/folder-parent.png" alt="folder-parent"/></td>';
$html .= '<td class="fb-i"><img src="' . $fallback_images_href . 'folder-parent.png" alt="folder-parent"/></td>';
$html .= '<td class="fb-n"><a href="..">Parent Directory</a></td>';
$html .= '<td class="fb-d"></td>';
$html .= '<td class="fb-s"></td>';
@ -58,7 +58,7 @@ class Fallback {
$type = $item->is_folder ? 'folder' : 'file';
$html .= '<tr>';
$html .= '<td class="fb-i"><img src="' . $app_href . 'client/images/fallback/' . $type . '.png" alt="' . $type . '"/></td>';
$html .= '<td class="fb-i"><img src="' . $fallback_images_href . $type . '.png" alt="' . $type . '"/></td>';
$html .= '<td class="fb-n"><a href="' . $item->href . '">' . basename($item->path) . '</a></td>';
$html .= '<td class="fb-d">' . date('Y-m-d H:i', $item->date) . '</td>';
$html .= '<td class="fb-s">' . ($item->size !== null ? intval($item->size / 1000) . ' KB' : '' ) . '</td>';

View file

@ -86,7 +86,7 @@ class Setup {
private function add_admin_check() {
$this->set('HAS_CUSTOM_PASSHASH', strtolower(PASSHASH) === Setup::$DEFAULT_PASSHASH);
$this->set('HAS_CUSTOM_PASSHASH', strtolower(PASSHASH) !== Setup::$DEFAULT_PASSHASH);
}
private function add_server_metadata_and_check() {
@ -112,23 +112,23 @@ class Setup {
$script_name = preg_replace('#^.*?//#', '/', $script_name);
}
$this->set('APP_HREF', Util::normalize_path(dirname(dirname(dirname($script_name))), true));
$this->set('APP_PATH', Util::normalize_path(dirname(dirname(dirname(dirname(dirname(__FILE__))))), false));
$this->set('APP_HREF', Util::normalize_path(dirname(dirname($script_name)), true));
$this->set('APP_PATH', Util::normalize_path(dirname(dirname(dirname(dirname(__FILE__)))), false));
$this->set('ROOT_HREF', Util::normalize_path(dirname($this->get('APP_HREF')), true));
$this->set('ROOT_PATH', Util::normalize_path(dirname($this->get('APP_PATH')), false));
$index_href = null;
if (@is_readable(Util::normalize_path($this->get('APP_PATH') . '/server/php/index.php', false))) {
$index_href = Util::normalize_path($this->get('APP_HREF') . '/server/php/index.php', false);
if (@is_readable(Util::normalize_path($this->get('APP_PATH') . '/public/index.php', false))) {
$index_href = Util::normalize_path($this->get('APP_HREF') . '/public/index.php', false);
}
$this->set('INDEX_HREF', $index_href);
}
private function add_cache_paths_and_check() {
$this->set('CACHE_HREF', Util::normalize_path($this->get('APP_HREF') . '/cache', true));
$this->set('CACHE_PATH', Util::normalize_path($this->get('APP_PATH') . '/cache', false));
$this->set('CACHE_HREF', Util::normalize_path($this->get('APP_HREF') . '/public/cache', true));
$this->set('CACHE_PATH', Util::normalize_path($this->get('APP_PATH') . '/public/cache', false));
$this->set('HAS_WRITABLE_CACHE', @is_writable($this->get('CACHE_PATH')));
}

View file

@ -12,11 +12,11 @@ head
title index · powered by #{pkg.name} #{pkg.version} (#{pkg.homepage})
meta( name="description", content="index - powered by #{pkg.name} #{pkg.version} (#{pkg.homepage})" )
meta( name="viewport", content="width=device-width, initial-scale=1" )
link( rel="shortcut icon", href!="#{APP_HREF}client/images/favicon/favicon-16-32.ico" )
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{APP_HREF}client/images/favicon/favicon-152.png" )
link( rel="shortcut icon", href!="#{APP_HREF}public/images/favicon/favicon-16-32.ico" )
link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{APP_HREF}public/images/favicon/favicon-152.png" )
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
link( rel="stylesheet", href!="#{APP_HREF}client/css/styles.css" )
script( src!="#{APP_HREF}client/js/scripts.js", data-module="index" )
link( rel="stylesheet", href!="#{APP_HREF}public/css/styles.css" )
script( src!="#{APP_HREF}public/js/scripts.js", data-module="index" )
body#root

View file

@ -0,0 +1,45 @@
Satisfy all
Order allow,deny
Allow from all
DirectoryIndex info.html
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .css .html .js .json .php .svg
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 week"
# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!)
ExpiresByType image/x-icon "access plus 1 week"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 week"
# Media
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
# Web fonts
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>

View file

@ -65,7 +65,7 @@
#hint {
margin: 12px auto;
width: 400px;
width: 300px;
font-weight: lighter;
}

View file

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 428 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 268 B

After

Width:  |  Height:  |  Size: 268 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 299 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 534 B

After

Width:  |  Height:  |  Size: 534 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 319 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 274 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 279 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 294 B

After

Width:  |  Height:  |  Size: 294 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 366 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 265 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 241 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 331 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 267 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 253 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 217 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 222 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 423 B

After

Width:  |  Height:  |  Size: 423 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 213 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 274 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 239 B

Before After
Before After

View file

@ -8,5 +8,5 @@ if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '<')) {
exit;
}
require_once __DIR__ . '/inc/class-bootstrap.php';
require_once __DIR__ . '/../backend/php/class-bootstrap.php';
Bootstrap::main();

View file

@ -8,11 +8,11 @@ head
title #{pkg.name} #{pkg.version} Server Setup
meta( name="description", content="#{pkg.name} #{pkg.version} Server Setup" )
meta( name="viewport", content="width=device-width, initial-scale=1" )
link( rel="shortcut icon", href="client/images/favicon/favicon-16-32.ico" )
link( rel="apple-touch-icon-precomposed", type="image/png", href="client/images/favicon/favicon-152.png" )
link( rel="shortcut icon", href="images/favicon/favicon-16-32.ico" )
link( rel="apple-touch-icon-precomposed", type="image/png", href="images/favicon/favicon-152.png" )
link( rel="stylesheet", href="//fonts.googleapis.com/css?family=Roboto:300,400,700" )
link( rel="stylesheet", href="client/css/styles.css" )
script( src="client/js/scripts.js", data-module="info" )
link( rel="stylesheet", href="css/styles.css" )
script( src="js/scripts.js", data-module="info" )
body#root.info
@ -36,6 +36,6 @@ body#root.info
form( action="https://www.paypal.com/cgi-bin/webscr", method="post", target="_top" )
input( type="hidden", name="cmd", value="_s-xclick" )
input( type="hidden", name="hosted_button_id", value="8WSPKWT7YBTSQ" )
input( type="image", src="client/images/ui/paypal.svg", width="100px", border="0", name="submit", alt="PayPal - The safer, easier way to pay online!" )
input( type="image", src="images/ui/paypal.svg", width="100px", border="0", name="submit", alt="PayPal - The safer, easier way to pay online!" )
</html>

View file

@ -12,7 +12,7 @@ modulejs.define('boot', ['$'], function ($) {
href = '.';
} else if (module === 'info') {
data.refresh = true;
href = 'server/php/index.php';
href = 'index.php';
} else {
return;
}

Some files were not shown because too many files have changed in this diff Show more