From 75c905a985327d06a99214817aa38530d075caa2 Mon Sep 17 00:00:00 2001 From: Jakob Date: Wed, 18 Oct 2017 06:24:14 +0200 Subject: [PATCH 1/2] Feature/fix terminal notification (#681) * show terminal notification on top * show notification only when not scrolled down and new output available * terminal: move scrolled down check outside of push loop --- public/themes/pterodactyl/css/terminal.css | 1 + .../themes/pterodactyl/js/frontend/console.js | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/public/themes/pterodactyl/css/terminal.css b/public/themes/pterodactyl/css/terminal.css index 222639a1..ecdd10ff 100644 --- a/public/themes/pterodactyl/css/terminal.css +++ b/public/themes/pterodactyl/css/terminal.css @@ -61,6 +61,7 @@ opacity: .5; font-size: 16px; cursor: pointer; + z-index: 10; } .terminal-notify:hover { diff --git a/public/themes/pterodactyl/js/frontend/console.js b/public/themes/pterodactyl/js/frontend/console.js index 88ceb119..3b6d90f4 100644 --- a/public/themes/pterodactyl/js/frontend/console.js +++ b/public/themes/pterodactyl/js/frontend/console.js @@ -116,13 +116,15 @@ $(document).ready(function () { }); $terminal.on('scroll', function () { - if ($(this).scrollTop() + $(this).innerHeight() + 50 < $(this)[0].scrollHeight) { - $scrollNotify.removeClass('hidden'); - } else { + if (isTerminalScrolledDown()) { $scrollNotify.addClass('hidden'); } }); +function isTerminalScrolledDown() { + return $terminal.scrollTop() + $terminal.innerHeight() + 50 > $terminal[0].scrollHeight; +} + window.scrollToBottom = function () { $terminal.scrollTop($terminal[0].scrollHeight); }; @@ -148,16 +150,20 @@ function pushToTerminal(string) { } if (TerminalQueue.length > 0) { + var scrolledDown = isTerminalScrolledDown(); + for (var i = 0; i < CONSOLE_PUSH_COUNT && TerminalQueue.length > 0; i++) { pushToTerminal(TerminalQueue[0]); - if (! $scrollNotify.is(':visible')) { - window.scrollToBottom(); - } - window.ConsoleElements++; TerminalQueue.shift(); } + + if (scrolledDown) { + window.scrollToBottom(); + } else if ($scrollNotify.hasClass('hidden')) { + $scrollNotify.removeClass('hidden'); + } var removeElements = window.ConsoleElements - CONSOLE_OUTPUT_LIMIT; if (removeElements > 0) { From 2f9e7bdc3b08861c7e058cdcb00dfdf362120f9f Mon Sep 17 00:00:00 2001 From: Matthew Hatcher Date: Wed, 18 Oct 2017 00:26:03 -0400 Subject: [PATCH 2/2] Adding Laravel Blade Directives Package. (#695) --- .env.example | 2 +- composer.json | 1 + composer.lock | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- config/app.php | 1 + 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 4bcc8f12..fbf50715 100644 --- a/.env.example +++ b/.env.example @@ -13,7 +13,7 @@ DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret -CACHE_DRIVER=file +CACHE_DRIVER=redis SESSION_DRIVER=database HASHIDS_SALT= diff --git a/composer.json b/composer.json index b0b0265b..a9d92961 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "ext-mbstring": "*", "ext-pdo_mysql": "*", "ext-zip": "*", + "appstract/laravel-blade-directives": "^0.6.0", "aws/aws-sdk-php": "^3.29", "daneeveritt/login-notifications": "^1.0", "doctrine/dbal": "^2.5", diff --git a/composer.lock b/composer.lock index 4c112e5f..5b260d1c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,61 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "46a0a06ec8f3af50ed6ec05c2bb3b9a3", + "content-hash": "416fbdc30098799c4403f9d05413b029", "packages": [ + { + "name": "appstract/laravel-blade-directives", + "version": "0.6.0", + "source": { + "type": "git", + "url": "https://github.com/appstract/laravel-blade-directives.git", + "reference": "3b0e146b3f2511d69e51160e7312ed5e57616460" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/appstract/laravel-blade-directives/zipball/3b0e146b3f2511d69e51160e7312ed5e57616460", + "reference": "3b0e146b3f2511d69e51160e7312ed5e57616460", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^5.7" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Appstract\\BladeDirectives\\BladeDirectivesServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Appstract\\BladeDirectives\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gijs Jorissen", + "email": "hello@appstract.team", + "homepage": "https://appstract.team", + "role": "Developer" + } + ], + "description": "Handy Blade directives", + "homepage": "https://github.com/appstract/laravel-blade-directives", + "keywords": [ + "appstract", + "laravel-blade-directives" + ], + "time": "2017-10-13T08:41:27+00:00" + }, { "name": "aws/aws-sdk-php", "version": "3.36.0", diff --git a/config/app.php b/config/app.php index e3cb7170..928e1657 100644 --- a/config/app.php +++ b/config/app.php @@ -181,6 +181,7 @@ return [ Lord\Laroute\LarouteServiceProvider::class, Spatie\Fractal\FractalServiceProvider::class, Sofa\Eloquence\ServiceProvider::class, + Appstract\BladeDirectives\BladeDirectivesServiceProvider::class, ], /*