Merge branch 'dev' into module_profiler
This commit is contained in:
@@ -61,7 +61,7 @@ class EditContent implements Interaction
|
||||
$this->module->callOnString($page->moduleHandler, 'edit', [$page, $data]);
|
||||
|
||||
// move to interaction
|
||||
$keepAssigned = isset($data->keepAssigned) ? $data->keepAssigned : [];
|
||||
$keepAssigned = isset($data['keepAssigned']) ? $data['keepAssigned'] : [];
|
||||
$page->uploadRelatedFiles($relatedFiles, $keepAssigned);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\CMS\Repositories\Widgets;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Models\Widgets\Widget as WidgetModel;
|
||||
use App\Models\Widgets\WidgetType;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class Widget
|
||||
{
|
||||
public function createNew(WidgetType $widgetType, Request $request)
|
||||
{
|
||||
$data = $request->except('_token');
|
||||
|
||||
// create new widget
|
||||
$widget = new WidgetModel();
|
||||
$widget->widget_type_handler = $widgetType->handler;
|
||||
$widget->user_id = \Auth::user()->id;
|
||||
$widget->name = $data['name'];
|
||||
$widget->description = $data['description'];
|
||||
$widget->container_class = $data['containerClass'];
|
||||
$widget->container_id = $data['containerId'];
|
||||
$widget->settings = json_encode(call_user_func([$widgetType->handler, 'save'], $request));
|
||||
|
||||
// save into database
|
||||
$widget->save();
|
||||
|
||||
// fire event with newly created widget
|
||||
Event::fire(new \App\Events\CreateNewWidget($widget));
|
||||
|
||||
return $widget;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,7 @@ use App\CMS\Contracts\Widgets\WidgetRenderer;
|
||||
use App\CMS\Widgets\Menu\Menu as WidgetMenu;
|
||||
use App\Models\Widgets\Widget;
|
||||
use App\Models\Widgets\WidgetType;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class Menu implements WidgetRenderer
|
||||
@@ -36,7 +34,7 @@ class Menu implements WidgetRenderer
|
||||
return $a->order - $b->order;
|
||||
});
|
||||
|
||||
$route = Request::route()
|
||||
$routeName = Route::current()
|
||||
->getName();
|
||||
$parameters = Route::current()
|
||||
->parameters();
|
||||
@@ -55,7 +53,7 @@ class Menu implements WidgetRenderer
|
||||
}
|
||||
|
||||
$page = $pages[$pageId];
|
||||
$active = ($page->isHomepage && $route == 'page.index') || ($route == 'page.content' && isset($parameters['url']) && $parameters['url'] == $page->url);
|
||||
$active = ($page->isHomepage && $routeName == 'page.index') || ($routeName == 'page.content' && isset($parameters['url']) && $parameters['url'] == $page->url);
|
||||
$route = $page->isHomepage ? route('page.index') : route('page.content', ['url' => $page->url]);
|
||||
|
||||
$code .= '<li';
|
||||
@@ -87,7 +85,6 @@ class Menu implements WidgetRenderer
|
||||
$widget->settings = new \stdClass();
|
||||
$widget->settings->links = [];
|
||||
|
||||
|
||||
return view('admin.widgets.menu.new', [
|
||||
'type' => $type,
|
||||
'widget' => $widget,
|
||||
|
||||
@@ -12,7 +12,6 @@ class PublishTemplateResources extends Command
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'template:publish';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
@@ -27,6 +26,7 @@ class PublishTemplateResources extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->call('cache:clear');
|
||||
$this->call('vendor:publish', ['--tag' => 'module-views', '--force' => true]);
|
||||
$this->call('vendor:publish', ['--tag' => 'public-assets', '--force' => true]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\CMS\Helpers\CurrentTemplate;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class TemplateInfo extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'template:info';
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Show details about currently set template';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$template = CurrentTemplate::get();
|
||||
|
||||
if (is_null($template)) {
|
||||
$this->error('No template set.');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->line($template->name);
|
||||
$this->line($template->handler);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Commands\PublishTemplateResources;
|
||||
use App\Console\Commands\TemplateInfo;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
@@ -23,7 +24,8 @@ class Kernel extends ConsoleKernel
|
||||
Commands\InitDatabaseSchema::class,
|
||||
Commands\SetTemplate::class,
|
||||
Commands\AddLanguage::class,
|
||||
PublishTemplateResources::class
|
||||
PublishTemplateResources::class,
|
||||
TemplateInfo::class
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,11 +12,11 @@ class UploadFile extends Event
|
||||
/**
|
||||
* @var UploadedFile
|
||||
*/
|
||||
private $uploadedFile;
|
||||
public $uploadedFile;
|
||||
/**
|
||||
* @var
|
||||
*/
|
||||
private $id;
|
||||
public $id;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Widgets;
|
||||
|
||||
use App\CMS\Repositories\Widgets\Widget;
|
||||
use App\CMS\Widgets\Exceptions\MissingParameterException;
|
||||
use App\Http\Controllers\Admin\Controller;
|
||||
use App\Http\Requests\NewWidgetRequest;
|
||||
use App\Models\Widgets\Widget;
|
||||
use App\Models\Widgets\WidgetType;
|
||||
use App\CMS\Widgets\Exceptions\MissingParameterException;
|
||||
|
||||
class CreateNewWidget extends Controller
|
||||
{
|
||||
@@ -54,9 +54,9 @@ class CreateNewWidget extends Controller
|
||||
} catch (MissingParameterException $e) {
|
||||
// user omitted some value
|
||||
return $this->invalidWidget($type, $e->getMessage());
|
||||
} catch (\Exception $e) {
|
||||
// something went wrong
|
||||
return $this->invalidWidget($type, trans('admin/widgets.cannotSave', ['exception' => $e->getMessage()]));
|
||||
// } catch (\Exception $e) {
|
||||
// // something went wrong
|
||||
// return $this->invalidWidget($type, trans('admin/widgets.cannotSave', ['exception' => $e->getMessage()]));
|
||||
}
|
||||
|
||||
// redirect with success notification
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Events\UploadFile;
|
||||
use Illuminate\Support\Facades\File as FileFacade;
|
||||
use Illuminate\Support\Str;
|
||||
use Intervention\Image\Constraint;
|
||||
use Intervention\Image\Facades\Image;
|
||||
use Symfony\Component\HttpFoundation\File\File as SymphonyFile;
|
||||
|
||||
class CreateImageThumbnail
|
||||
{
|
||||
/**
|
||||
* Create the event listener.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param UploadFile $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(UploadFile $event)
|
||||
{
|
||||
$uploadedFile = $event->uploadedFile;
|
||||
|
||||
// is uploaded file an image?
|
||||
if (!Str::startsWith($uploadedFile->getMimeType(), 'image')) {
|
||||
return;
|
||||
}
|
||||
// yes, create thumbnail
|
||||
$this->createThumbnail($uploadedFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create thumbnail of given image
|
||||
*
|
||||
* @param SymphonyFile $file
|
||||
*/
|
||||
private function createThumbnail(SymphonyFile $file)
|
||||
{
|
||||
// does thumbnail directory exist?
|
||||
if (!is_dir(config('app.thumbnail_path'))) {
|
||||
FileFacade::makeDirectory(config('app.thumbnail_path'));
|
||||
}
|
||||
|
||||
// get image instance
|
||||
$image = Image::make(config('app.upload_path') . DIRECTORY_SEPARATOR . $file->getFilename());
|
||||
|
||||
// resize image and keep aspect ration
|
||||
$image->resize(env('THUMBNAIL_WIDTH', setting('previewSize', 300)), null, function (Constraint $constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
});
|
||||
|
||||
// save thumbnail with lower quality
|
||||
$image->save(config('app.thumbnail_path') . DIRECTORY_SEPARATOR . $file->getFilename(), 75);
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,7 @@ trait Content
|
||||
$changed = 0;
|
||||
|
||||
// check if any file was removed
|
||||
if ($revisionId) {
|
||||
$changed += $this->removeRelatedFiles($revisionId, $assignedFiles);
|
||||
}
|
||||
|
||||
// allow uploading only on created pages
|
||||
if (!$this->id || !$files[0]) {
|
||||
@@ -73,12 +71,10 @@ trait Content
|
||||
private function removeRelatedFiles($revisionId, $assignedFiles)
|
||||
{
|
||||
$allFiles = $this->files()
|
||||
->whereNotIn('id', $assignedFiles)
|
||||
->whereNotIn('id', array_keys($assignedFiles))
|
||||
->get();
|
||||
|
||||
foreach ($allFiles as $file) {
|
||||
$this->saveHistory($revisionId, 'file', $file->original_filename, ['file' => null]);
|
||||
|
||||
ContentHasFile::where('content_id', $this->id)
|
||||
->where('file_id', $file->id)
|
||||
->delete();
|
||||
|
||||
@@ -2,6 +2,49 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Events\AssignWidget;
|
||||
use App\Events\AttemptToEditInvalidContent;
|
||||
use App\Events\ChangeSettings;
|
||||
use App\Events\CreateNewContent;
|
||||
use App\Events\CreateNewUser;
|
||||
use App\Events\CreateNewWidget;
|
||||
use App\Events\CreateNewWidgetArea;
|
||||
use App\Events\DeleteContent;
|
||||
use App\Events\DeleteWidgetArea;
|
||||
use App\Events\EditContent;
|
||||
use App\Events\EditFile;
|
||||
use App\Events\EditUser;
|
||||
use App\Events\EditWidget;
|
||||
use App\Events\EditWidgetArea;
|
||||
use App\Events\MakeDraftFromContent;
|
||||
use App\Events\PublishContent;
|
||||
use App\Events\RemoveWidgetFromArea;
|
||||
use App\Events\SetHomepage;
|
||||
use App\Events\UploadFile;
|
||||
use App\Listeners\CreateImageThumbnail;
|
||||
use App\Listeners\Loggers\LogAssignWidget;
|
||||
use App\Listeners\Loggers\LogAttemptToInvalidContentEdit;
|
||||
use App\Listeners\Loggers\LogChangeSettings;
|
||||
use App\Listeners\Loggers\LogCreatedUser;
|
||||
use App\Listeners\Loggers\LogCreateNewContent;
|
||||
use App\Listeners\Loggers\LogDeleteContent;
|
||||
use App\Listeners\Loggers\LogDeleteWidgetArea;
|
||||
use App\Listeners\Loggers\LogDraftFromContent;
|
||||
use App\Listeners\Loggers\LogEditContent;
|
||||
use App\Listeners\Loggers\LogEditFile;
|
||||
use App\Listeners\Loggers\LogEditUser;
|
||||
use App\Listeners\Loggers\LogEditWidget;
|
||||
use App\Listeners\Loggers\LogEditWidgetArea;
|
||||
use App\Listeners\Loggers\LogLogin;
|
||||
use App\Listeners\Loggers\LogLogout;
|
||||
use App\Listeners\Loggers\LogNewWidget;
|
||||
use App\Listeners\Loggers\LogNewWidgetArea;
|
||||
use App\Listeners\Loggers\LogPublishContent;
|
||||
use App\Listeners\Loggers\LogRemoveWidgetFromArea;
|
||||
use App\Listeners\Loggers\LogSetHomepage;
|
||||
use App\Listeners\Loggers\LogUploadFile;
|
||||
use Illuminate\Auth\Events\Login;
|
||||
use Illuminate\Auth\Events\Logout;
|
||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
@@ -13,83 +56,71 @@ class EventServiceProvider extends ServiceProvider
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
'App\Events\CreateNewUser' => [
|
||||
'App\Listeners\Loggers\LogCreatedUser',
|
||||
CreateNewUser::class => [
|
||||
LogCreatedUser::class,
|
||||
],
|
||||
'App\Events\EditUser' => [
|
||||
'App\Listeners\Loggers\LogEditUser',
|
||||
EditUser::class => [
|
||||
LogEditUser::class,
|
||||
],
|
||||
'App\Events\CreateNewContent' => [
|
||||
'App\Listeners\Loggers\LogCreateNewContent'
|
||||
CreateNewContent::class => [
|
||||
LogCreateNewContent::class
|
||||
],
|
||||
'App\Events\EditContent' => [
|
||||
'App\Listeners\Loggers\LogEditContent'
|
||||
EditContent::class => [
|
||||
LogEditContent::class
|
||||
],
|
||||
'App\Events\PublishContent' => [
|
||||
'App\Listeners\Loggers\LogPublishContent'
|
||||
PublishContent::class => [
|
||||
LogPublishContent::class
|
||||
],
|
||||
'App\Events\MakeDraftFromContent' => [
|
||||
'App\Listeners\Loggers\LogDraftFromContent'
|
||||
MakeDraftFromContent::class => [
|
||||
LogDraftFromContent::class
|
||||
],
|
||||
'App\Events\SetHomepage' => [
|
||||
'App\Listeners\Loggers\LogSetHomepage'
|
||||
SetHomepage::class => [
|
||||
LogSetHomepage::class
|
||||
],
|
||||
'App\Events\AttemptToEditInvalidContent' => [
|
||||
'App\Listeners\Loggers\LogAttemptToInvalidContentEdit'
|
||||
AttemptToEditInvalidContent::class => [
|
||||
LogAttemptToInvalidContentEdit::class
|
||||
],
|
||||
'App\Events\DeleteContent' => [
|
||||
'App\Listeners\Loggers\LogDeleteContent'
|
||||
DeleteContent::class => [
|
||||
LogDeleteContent::class
|
||||
],
|
||||
|
||||
'App\Events\ChangeSettings' => [
|
||||
'App\Listeners\Loggers\LogChangeSettings',
|
||||
ChangeSettings::class => [
|
||||
LogChangeSettings::class,
|
||||
],
|
||||
'App\Events\UploadFile' => [
|
||||
'App\Listeners\Loggers\LogUploadFile'
|
||||
UploadFile::class => [
|
||||
LogUploadFile::class,
|
||||
CreateImageThumbnail::class
|
||||
],
|
||||
'App\Events\EditFile' => [
|
||||
'App\Listeners\Loggers\LogEditFile'
|
||||
EditFile::class => [
|
||||
LogEditFile::class
|
||||
],
|
||||
'App\Events\CreateNewWidgetArea' => [
|
||||
'App\Listeners\Loggers\LogNewWidgetArea'
|
||||
CreateNewWidgetArea::class => [
|
||||
LogNewWidgetArea::class
|
||||
],
|
||||
'App\Events\EditWidgetArea' => [
|
||||
'App\Listeners\Loggers\LogEditWidgetArea'
|
||||
EditWidgetArea::class => [
|
||||
LogEditWidgetArea::class
|
||||
],
|
||||
'App\Events\DeleteWidgetArea' => [
|
||||
'App\Listeners\Loggers\LogDeleteWidgetArea'
|
||||
DeleteWidgetArea::class => [
|
||||
LogDeleteWidgetArea::class
|
||||
],
|
||||
'App\Events\CreateNewWidget' => [
|
||||
'App\Listeners\Loggers\LogNewWidget'
|
||||
CreateNewWidget::class => [
|
||||
LogNewWidget::class
|
||||
],
|
||||
'App\Events\EditWidget' => [
|
||||
'App\Listeners\Loggers\LogEditWidget'
|
||||
EditWidget::class => [
|
||||
LogEditWidget::class
|
||||
],
|
||||
'App\Events\AssignWidget' => [
|
||||
'App\Listeners\Loggers\LogAssignWidget'
|
||||
AssignWidget::class => [
|
||||
LogAssignWidget::class
|
||||
],
|
||||
'App\Events\RemoveWidgetFromArea' => [
|
||||
'App\Listeners\Loggers\LogRemoveWidgetFromArea'
|
||||
RemoveWidgetFromArea::class => [
|
||||
LogRemoveWidgetFromArea::class
|
||||
],
|
||||
// internal Laravel events - should work as auth.login and auth.logout, however it doesn't...
|
||||
'Illuminate\Auth\Events\Login' => [
|
||||
'App\Listeners\Loggers\LogLogin'
|
||||
Login::class => [
|
||||
LogLogin::class
|
||||
],
|
||||
'Illuminate\Auth\Events\Logout' => [
|
||||
'App\Listeners\Loggers\LogLogout'
|
||||
Logout::class => [
|
||||
LogLogout::class
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any other events for your application.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Events\Dispatcher $events
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(DispatcherContract $events)
|
||||
{
|
||||
parent::boot($events);
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ class Category extends Entity
|
||||
|
||||
public function content()
|
||||
{
|
||||
return $this->hasMany(Content::class);
|
||||
return $this->hasMany(Content::class, 'categoryId');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,6 @@ class Presenter implements WidgetRenderer
|
||||
return null;
|
||||
}
|
||||
|
||||
$form->moduleSettings = json_decode($form->moduleSettings);
|
||||
|
||||
return view(self::$template, ['widget' => $widget, 'form' => $form]);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
namespace Templates\PragueTennisCamp;
|
||||
|
||||
use App\CMS\Contracts\Modules\TemplateHandler;
|
||||
use App\Models\Content\Content;
|
||||
use App\Models\Module;
|
||||
use App\Models\User;
|
||||
use App\Models\Widgets\WidgetArea;
|
||||
use Modules\Categories\Entities\Category;
|
||||
|
||||
class Handler implements TemplateHandler
|
||||
{
|
||||
/**
|
||||
* Register admin menu (or multiple ones)
|
||||
*
|
||||
* This cannot be in ServiceProvider because Session is started at middleware. And ServiceProvider is called before
|
||||
* starting any middleware..
|
||||
*
|
||||
* @param User $user model of logged user
|
||||
*/
|
||||
public static function registerAdminMenu(User $user)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Install module.
|
||||
*
|
||||
* This method is called after inserting info about module into database. It can be called only using Artisan in
|
||||
* CLI.
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
WidgetArea::create(['deletable' => 0, 'code' => 'mainMenu', 'name' => 'Menu']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uninstall template
|
||||
*
|
||||
* Delete some items in database, delete files etc.
|
||||
*
|
||||
* @param Module $template
|
||||
*/
|
||||
public static function uninstall(Module $template)
|
||||
{
|
||||
WidgetArea::where('code', 'mainMenu')
|
||||
->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of registered templates and supported modules.
|
||||
*
|
||||
* Returned array is expected to be array of arrays with following items: module, namespace and templateName.
|
||||
* Example:
|
||||
* return [
|
||||
* ['module' => 'Article', 'templateName' => 'article::template.name']
|
||||
* ];
|
||||
*
|
||||
* When no "namespace" is specified, value strtolower(module) is used instaed.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getPublicTemplatePaths()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'module' => 'StaticPages',
|
||||
'templateName' => 'staticpages::admin.templatePath'
|
||||
],
|
||||
[
|
||||
'module' => 'ContactForm',
|
||||
'templateName' => 'contactform::admin/adminMenu.templatePath'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare Content object to be rendered using Blade template
|
||||
*
|
||||
* @param Content $content
|
||||
*/
|
||||
public static function beforeRender(Content & $content)
|
||||
{
|
||||
if ($content->isHomepage) {
|
||||
$category = Category::where('url', 'trenersky-tym')
|
||||
->first();
|
||||
|
||||
$content->traineeTeamCategory = $category;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify input data into format which can be understood by edit template
|
||||
*
|
||||
* @param Content $content
|
||||
*/
|
||||
public static function beforePopulatingEditForm(Content & $content)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Slightly modify Content object before saving into database.
|
||||
*
|
||||
* This way we can do almost whatever we want - even in template
|
||||
*
|
||||
* @param Content $content
|
||||
* @param $request
|
||||
*/
|
||||
public static function beforeSave(Content & $content, $inputData)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
namespace Templates\PragueTennisCamp\Providers;
|
||||
|
||||
use App\CMS\Helpers\Template;
|
||||
use Modules\ContactForm\Widgets\Form\Presenter;
|
||||
|
||||
class ServiceProvider extends \Illuminate\Support\ServiceProvider {
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function boot() {
|
||||
if (\App::runningInConsole())
|
||||
return;
|
||||
|
||||
Presenter::$template = Template::name('widgets.contact.form');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
/* https://coolors.co/3f3f37-eef4d4-983628-ff7f11-daefb3 */
|
||||
|
||||
body {
|
||||
font-family: Ubuntu;
|
||||
text-align: justify;
|
||||
background: #eef4d4 url("./images/bg.png");
|
||||
}
|
||||
|
||||
header.top-bar {
|
||||
background: #3f3f37;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
header.top-bar h1 {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
header.top-bar ul {
|
||||
background: none;
|
||||
}
|
||||
|
||||
header.top-bar a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.menu .active > a {
|
||||
background: #ff7f11;
|
||||
}
|
||||
|
||||
.logo {
|
||||
max-height: 35px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 {
|
||||
font-family: Comfortaa;
|
||||
color: #ff7f11;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stripe {
|
||||
padding: 50px;
|
||||
margin: 50px 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.stripe.light {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.stripe h1 {
|
||||
color: white;
|
||||
font-size: 270%;
|
||||
}
|
||||
|
||||
.stripe p {
|
||||
padding-left: 150px;
|
||||
}
|
||||
|
||||
.content-container.row {
|
||||
line-height: 170%;
|
||||
padding: 1em;
|
||||
background: #FFFEF0;
|
||||
}
|
||||
|
||||
.orbit {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.orbit-bullets {
|
||||
margin-top: -54px;
|
||||
padding-bottom: 11px;
|
||||
}
|
||||
|
||||
.orbit .stripe {
|
||||
height: 20px;
|
||||
background: rgba(255,255,255, 0.2);
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.orbit-top {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.orbit-bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.slow {
|
||||
transition-duration: 4500ms !important;
|
||||
}
|
||||
|
||||
.trainee-team .thumbnail {
|
||||
max-height: 150px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
margin-top: 10em;
|
||||
}
|
||||
|
||||
.rounded {
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.trainer {
|
||||
max-width: 25%;
|
||||
padding: 3px;
|
||||
border: solid 1px #CCC;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 697 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
@@ -0,0 +1,289 @@
|
||||
/**
|
||||
* Lightbox library created by binarity s.r.o.
|
||||
* www.binarity.cz
|
||||
* version 1.0.0
|
||||
*
|
||||
* Vanilla JavaScript lightbox plugin.
|
||||
*
|
||||
* Can use custom invoker passed as first argument or uses a default one - .b-lightbox.
|
||||
* This allows to have more lightbox instances on one site to categorize items.
|
||||
*
|
||||
* Default behaviour:
|
||||
* - Hides on escape keydown event - settable (options.allow_escape).
|
||||
* - Hides on background click - settable (options.allow_backgroundclick).
|
||||
* - Hide button in top right corner - settable (options.close_text).
|
||||
* - Allows usage of arrow keys (left/right) to navigate through images - settable (option.allow_arrows).
|
||||
*
|
||||
* @param options
|
||||
* @param autorun
|
||||
* @constructor
|
||||
*/
|
||||
function BLightBox(options, autorun) {
|
||||
// Instance and instance variables.
|
||||
var BLightBox = this,
|
||||
escape_key_allowed = (!(options !== undefined && options.allow_escape === false)),
|
||||
hide_on_holder_allowed = (!(options !== undefined && options.allow_backgroundclick === false)),
|
||||
arrows_allowed = (!(options !== undefined && options.allow_arrows === false)),
|
||||
close_text = (options !== undefined && options.close_text !== undefined) ? options.close_text : 'Close',
|
||||
|
||||
// DOM
|
||||
lightbox_holder = document.createElement('div'),
|
||||
invoker_string = (options !== undefined && options.invoker !== undefined) ? options.invoker : '.b-lightbox',
|
||||
invokers = document.querySelectorAll(invoker_string),
|
||||
invokers_length = invokers.length,
|
||||
lightbox_image = document.createElement('img'),
|
||||
close_label = document.createElement('a'),
|
||||
previous_button = document.createElement('a'),
|
||||
next_button = document.createElement('a'),
|
||||
lightbox_label = document.createElement('span');
|
||||
|
||||
// BLightBox DOM default settings.
|
||||
lightbox_holder.className = 'b-lightbox-holder';
|
||||
lightbox_image.className = 'b-lightbox-image';
|
||||
close_label.className = 'b-lightbox-close-button';
|
||||
close_label.textContent = close_text;
|
||||
previous_button.className = 'b-lightbox-direction previous';
|
||||
previous_button.innerHTML = '‹';
|
||||
next_button.className = 'b-lightbox-direction next';
|
||||
next_button.innerHTML = '›';
|
||||
lightbox_label.className = 'b-lightbox-label';
|
||||
|
||||
/**
|
||||
* Show new image according to data-newindex attribute on directional button
|
||||
*/
|
||||
this.loadNewImage = function(event) {
|
||||
event.stopPropagation();
|
||||
var index = event.target.getAttribute('data-newindex'),
|
||||
label = invokers[index].getAttribute('data-label');
|
||||
|
||||
if(invokers[index]) {
|
||||
lightbox_image.style.display = 'none';
|
||||
this.decideFromLoad(invokers[index]);
|
||||
lightbox_image.style.display = 'block';
|
||||
if(label != '') {
|
||||
lightbox_label.innerHTML = label;
|
||||
}
|
||||
}
|
||||
|
||||
this.lightboxImageCenter(label != ''); // Center image.
|
||||
|
||||
// Change indexes to be opened.
|
||||
previous_button.setAttribute('data-newindex', this.getPreviousIndex(index));
|
||||
next_button.setAttribute('data-newindex', this.getNextIndex(index));
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns first next index possible, or return very first index to allow rotation.
|
||||
* @param index
|
||||
* @returns {number}
|
||||
*/
|
||||
this.getNextIndex = function(index) {
|
||||
// Skip to last image if we are on the first.
|
||||
return (index == invokers_length - 1) ? 0 : parseInt(index) + 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns first previous index possible, or returns last array index to allow rotation.
|
||||
* @param index
|
||||
* @returns {number}
|
||||
*/
|
||||
this.getPreviousIndex = function(index) {
|
||||
// Skip to last image if we are on the first.
|
||||
return (index == 0) ? invokers_length - 1 : index - 1;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reset ivokers_length variable for re-use.
|
||||
*/
|
||||
this.resetInvokersLength = function() {
|
||||
invokers_length = invokers.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Provides code for closing a lightbox and hiding images.
|
||||
*/
|
||||
this.listenActionClose = function(event) {
|
||||
lightbox_holder.style.display = 'none';
|
||||
lightbox_image.style.display = 'none';
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds src to lightbox image from element's style background-image.
|
||||
* Removes url() par of the string.
|
||||
* @param el
|
||||
*/
|
||||
this.loadImageFromBackgroundImage = function(el) {
|
||||
lightbox_image.src = el.style.backgroundImage.replace(/url\("?(.*[^"])"?\)/, '$1');
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds src to lightbox image from element's child img tag.
|
||||
* @param el
|
||||
*/
|
||||
this.loadImageFromChildImg = function(el) {
|
||||
var img = el.querySelector('img');
|
||||
if(img) {
|
||||
lightbox_image.src = img.src;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Move lightbox image to the center of screen.
|
||||
*/
|
||||
this.lightboxImageCenter = function(bool_label) {
|
||||
// Image
|
||||
lightbox_image.style.left = ((lightbox_holder.offsetWidth - lightbox_image.offsetWidth) / 2) + 'px';
|
||||
lightbox_image.style.top = ((lightbox_holder.offsetHeight - lightbox_image.offsetHeight) / 2) + 'px';
|
||||
|
||||
// Image label.
|
||||
if(bool_label === true) {
|
||||
lightbox_label.style.width = lightbox_image.offsetWidth + 'px';
|
||||
lightbox_label.style.left = ((lightbox_holder.offsetWidth - lightbox_image.offsetWidth) / 2) + 'px';
|
||||
lightbox_label.style.display = 'block';
|
||||
lightbox_label.style.top = (lightbox_image.offsetTop + lightbox_image.offsetHeight - lightbox_label.offsetHeight) + 'px';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns index in invokers array or false on unsuccessful attempt to find the element.
|
||||
* @param el
|
||||
* @returns {*}
|
||||
*/
|
||||
this.getIndexInInvokers = function(el) {
|
||||
var inv_length = invokers_length;
|
||||
while(inv_length--) {
|
||||
if(invokers[inv_length].isEqualNode(el)) {
|
||||
return inv_length;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* This method decides from where to load src attribute into lightbox_image.
|
||||
* @param el
|
||||
*/
|
||||
this.decideFromLoad = function(el) {
|
||||
// Decide from which source to get image url.
|
||||
if(el.hasAttribute('data-background')) {
|
||||
this.loadImageFromBackgroundImage(el);
|
||||
} else if(el.hasAttribute('data-img')) {
|
||||
this.loadImageFromChildImg(el);
|
||||
}
|
||||
|
||||
lightbox_label.style.display = 'none';
|
||||
lightbox_label.innerHTML = '';
|
||||
};
|
||||
|
||||
/**
|
||||
* Provides code for opening a lightbox and displaying images.
|
||||
*/
|
||||
this.listenActionOpen = function(el, app, event) {
|
||||
var label = el.getAttribute('data-label');
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault(); // If element is a-tag, prevent from href requesting.
|
||||
|
||||
app.decideFromLoad(el); // Load image into lightbox_image.
|
||||
|
||||
// Change indexes to be opened.
|
||||
previous_button.setAttribute('data-newindex', app.getPreviousIndex(app.getIndexInInvokers(el)));
|
||||
next_button.setAttribute('data-newindex', app.getNextIndex(app.getIndexInInvokers(el)));
|
||||
|
||||
// Show lightbox and image.
|
||||
lightbox_holder.style.display = 'block';
|
||||
lightbox_image.style.display = 'block';
|
||||
if(label != '') {
|
||||
lightbox_label.innerHTML = label;
|
||||
}
|
||||
|
||||
// Center lightbox within the screen.
|
||||
app.lightboxImageCenter(label != '');
|
||||
};
|
||||
|
||||
/**
|
||||
* Add lightbox closing method listener to given element.
|
||||
* @param el
|
||||
*/
|
||||
this.addCloseListenerFor = function(el) {
|
||||
el.addEventListener('click', this.listenActionClose.bind(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Add lightbox opening method listener to given element.
|
||||
* @param el
|
||||
*/
|
||||
this.addOpenListenerFor = function(el) {
|
||||
var app = this;
|
||||
el.addEventListener('click', app.listenActionOpen.bind(app, el, this), true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Initializes all possible listeners at once on class instance creation.
|
||||
*/
|
||||
this.initiateListeners = function() {
|
||||
// Open Listeners.
|
||||
while(invokers_length--) {
|
||||
this.addOpenListenerFor(invokers[invokers_length]);
|
||||
}
|
||||
this.resetInvokersLength();
|
||||
|
||||
// Close Listeners.
|
||||
// On background click.
|
||||
if(hide_on_holder_allowed){
|
||||
this.addCloseListenerFor(lightbox_holder);
|
||||
}
|
||||
// On escape key hit, if requested.
|
||||
if(escape_key_allowed) {
|
||||
window.addEventListener('keydown', function (event) {
|
||||
if(event.keyCode === 27) {
|
||||
BLightBox.listenActionClose();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Directional buttons.
|
||||
previous_button.addEventListener('click',this.loadNewImage.bind(this));
|
||||
next_button.addEventListener('click',this.loadNewImage.bind(this));
|
||||
// Allow directing with arrows when enabled.
|
||||
if(arrows_allowed) {
|
||||
window.addEventListener('keydown', function arrowDirections(event) {
|
||||
if(event.keyCode === 37) {
|
||||
previous_button.click();
|
||||
} else if(event.keyCode === 39) {
|
||||
next_button.click();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialization method that starts BLightBox instance.
|
||||
* @returns {*}
|
||||
*/
|
||||
this.init = function() {
|
||||
// Append lightbox background.
|
||||
document.body.appendChild(lightbox_holder);
|
||||
lightbox_holder.appendChild(previous_button);
|
||||
lightbox_holder.appendChild(lightbox_image);
|
||||
lightbox_holder.appendChild(next_button);
|
||||
lightbox_holder.appendChild(close_label);
|
||||
lightbox_holder.appendChild(lightbox_label);
|
||||
// Add event listeners for invokers.
|
||||
this.initiateListeners();
|
||||
|
||||
// Auto centering on window.resize;
|
||||
window.addEventListener('resize', function() {
|
||||
BLightBox.lightboxImageCenter();
|
||||
});
|
||||
|
||||
return BLightBox;
|
||||
};
|
||||
|
||||
// If autorun is requested, create instance.
|
||||
if(autorun !== undefined && autorun === true) {
|
||||
return this.init();
|
||||
} else {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
$(document).foundation()
|
||||
|
||||
$ ('#formSend').click (function () {
|
||||
$ (this).value = 'Odesílám...';
|
||||
|
||||
var form = $(this).closest('form');
|
||||
|
||||
$.ajax ({
|
||||
url: form.attr('action'),
|
||||
method: 'post',
|
||||
data: form.serialize ()
|
||||
}).done (function (resp) {
|
||||
if (resp.status == 'success') {
|
||||
alert ('Zpráva úspěšně odeslána. Odpovíme co nejdříve!');
|
||||
window.top.location.reload ();
|
||||
} else {
|
||||
alert (resp.message);
|
||||
}
|
||||
$ (this).value = "ODESLAT";
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,335 @@
|
||||
/**
|
||||
* what-input - A global utility for tracking the current input method (mouse, keyboard or touch).
|
||||
* @version v4.0.4
|
||||
* @link https://github.com/ten1seven/what-input
|
||||
* @license MIT
|
||||
*/
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define("whatInput", [], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["whatInput"] = factory();
|
||||
else
|
||||
root["whatInput"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ function(module, exports) {
|
||||
|
||||
module.exports = (function() {
|
||||
|
||||
/*
|
||||
---------------
|
||||
Variables
|
||||
---------------
|
||||
*/
|
||||
|
||||
// cache document.documentElement
|
||||
var docElem = document.documentElement;
|
||||
|
||||
// last used input type
|
||||
var currentInput = 'initial';
|
||||
|
||||
// last used input intent
|
||||
var currentIntent = null;
|
||||
|
||||
// form input types
|
||||
var formInputs = [
|
||||
'input',
|
||||
'select',
|
||||
'textarea'
|
||||
];
|
||||
|
||||
// list of modifier keys commonly used with the mouse and
|
||||
// can be safely ignored to prevent false keyboard detection
|
||||
var ignoreMap = [
|
||||
16, // shift
|
||||
17, // control
|
||||
18, // alt
|
||||
91, // Windows key / left Apple cmd
|
||||
93 // Windows menu / right Apple cmd
|
||||
];
|
||||
|
||||
// mapping of events to input types
|
||||
var inputMap = {
|
||||
'keyup': 'keyboard',
|
||||
'mousedown': 'mouse',
|
||||
'mousemove': 'mouse',
|
||||
'MSPointerDown': 'pointer',
|
||||
'MSPointerMove': 'pointer',
|
||||
'pointerdown': 'pointer',
|
||||
'pointermove': 'pointer',
|
||||
'touchstart': 'touch'
|
||||
};
|
||||
|
||||
// array of all used input types
|
||||
var inputTypes = [];
|
||||
|
||||
// boolean: true if touch buffer timer is running
|
||||
var isBuffering = false;
|
||||
|
||||
// map of IE 10 pointer events
|
||||
var pointerMap = {
|
||||
2: 'touch',
|
||||
3: 'touch', // treat pen like touch
|
||||
4: 'mouse'
|
||||
};
|
||||
|
||||
// touch buffer timer
|
||||
var touchTimer = null;
|
||||
|
||||
|
||||
/*
|
||||
---------------
|
||||
Set up
|
||||
---------------
|
||||
*/
|
||||
|
||||
var setUp = function() {
|
||||
|
||||
// add correct mouse wheel event mapping to `inputMap`
|
||||
inputMap[detectWheel()] = 'mouse';
|
||||
|
||||
addListeners();
|
||||
setInput();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
---------------
|
||||
Events
|
||||
---------------
|
||||
*/
|
||||
|
||||
var addListeners = function() {
|
||||
|
||||
// `pointermove`, `MSPointerMove`, `mousemove` and mouse wheel event binding
|
||||
// can only demonstrate potential, but not actual, interaction
|
||||
// and are treated separately
|
||||
|
||||
// pointer events (mouse, pen, touch)
|
||||
if (window.PointerEvent) {
|
||||
docElem.addEventListener('pointerdown', updateInput);
|
||||
docElem.addEventListener('pointermove', setIntent);
|
||||
} else if (window.MSPointerEvent) {
|
||||
docElem.addEventListener('MSPointerDown', updateInput);
|
||||
docElem.addEventListener('MSPointerMove', setIntent);
|
||||
} else {
|
||||
|
||||
// mouse events
|
||||
docElem.addEventListener('mousedown', updateInput);
|
||||
docElem.addEventListener('mousemove', setIntent);
|
||||
|
||||
// touch events
|
||||
if ('ontouchstart' in window) {
|
||||
docElem.addEventListener('touchstart', touchBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
// mouse wheel
|
||||
docElem.addEventListener(detectWheel(), setIntent);
|
||||
|
||||
// keyboard events
|
||||
docElem.addEventListener('keydown', updateInput);
|
||||
docElem.addEventListener('keyup', updateInput);
|
||||
};
|
||||
|
||||
// checks conditions before updating new input
|
||||
var updateInput = function(event) {
|
||||
|
||||
// only execute if the touch buffer timer isn't running
|
||||
if (!isBuffering) {
|
||||
var eventKey = event.which;
|
||||
var value = inputMap[event.type];
|
||||
if (value === 'pointer') value = pointerType(event);
|
||||
|
||||
if (
|
||||
currentInput !== value ||
|
||||
currentIntent !== value
|
||||
) {
|
||||
|
||||
var activeInput = (
|
||||
document.activeElement &&
|
||||
formInputs.indexOf(document.activeElement.nodeName.toLowerCase()) === -1
|
||||
) ? true : false;
|
||||
|
||||
if (
|
||||
value === 'touch' ||
|
||||
|
||||
// ignore mouse modifier keys
|
||||
(value === 'mouse' && ignoreMap.indexOf(eventKey) === -1) ||
|
||||
|
||||
// don't switch if the current element is a form input
|
||||
(value === 'keyboard' && activeInput)
|
||||
) {
|
||||
|
||||
// set the current and catch-all variable
|
||||
currentInput = currentIntent = value;
|
||||
|
||||
setInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// updates the doc and `inputTypes` array with new input
|
||||
var setInput = function() {
|
||||
docElem.setAttribute('data-whatinput', currentInput);
|
||||
docElem.setAttribute('data-whatintent', currentInput);
|
||||
|
||||
if (inputTypes.indexOf(currentInput) === -1) {
|
||||
inputTypes.push(currentInput);
|
||||
docElem.className += ' whatinput-types-' + currentInput;
|
||||
}
|
||||
};
|
||||
|
||||
// updates input intent for `mousemove` and `pointermove`
|
||||
var setIntent = function(event) {
|
||||
|
||||
// only execute if the touch buffer timer isn't running
|
||||
if (!isBuffering) {
|
||||
var value = inputMap[event.type];
|
||||
if (value === 'pointer') value = pointerType(event);
|
||||
|
||||
if (currentIntent !== value) {
|
||||
currentIntent = value;
|
||||
|
||||
docElem.setAttribute('data-whatintent', currentIntent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// buffers touch events because they frequently also fire mouse events
|
||||
var touchBuffer = function(event) {
|
||||
|
||||
// clear the timer if it happens to be running
|
||||
window.clearTimeout(touchTimer);
|
||||
|
||||
// set the current input
|
||||
updateInput(event);
|
||||
|
||||
// set the isBuffering to `true`
|
||||
isBuffering = true;
|
||||
|
||||
// run the timer
|
||||
touchTimer = window.setTimeout(function() {
|
||||
|
||||
// if the timer runs out, set isBuffering back to `false`
|
||||
isBuffering = false;
|
||||
}, 200);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
---------------
|
||||
Utilities
|
||||
---------------
|
||||
*/
|
||||
|
||||
var pointerType = function(event) {
|
||||
if (typeof event.pointerType === 'number') {
|
||||
return pointerMap[event.pointerType];
|
||||
} else {
|
||||
return (event.pointerType === 'pen') ? 'touch' : event.pointerType; // treat pen like touch
|
||||
}
|
||||
};
|
||||
|
||||
// detect version of mouse wheel event to use
|
||||
// via https://developer.mozilla.org/en-US/docs/Web/Events/wheel
|
||||
var detectWheel = function() {
|
||||
return 'onwheel' in document.createElement('div') ?
|
||||
'wheel' : // Modern browsers support "wheel"
|
||||
|
||||
document.onmousewheel !== undefined ?
|
||||
'mousewheel' : // Webkit and IE support at least "mousewheel"
|
||||
'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
---------------
|
||||
Init
|
||||
|
||||
don't start script unless browser cuts the mustard
|
||||
(also passes if polyfills are used)
|
||||
---------------
|
||||
*/
|
||||
|
||||
if (
|
||||
'addEventListener' in window &&
|
||||
Array.prototype.indexOf
|
||||
) {
|
||||
setUp();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
---------------
|
||||
API
|
||||
---------------
|
||||
*/
|
||||
|
||||
return {
|
||||
|
||||
// returns string: the current input type
|
||||
// opt: 'loose'|'strict'
|
||||
// 'strict' (default): returns the same value as the `data-whatinput` attribute
|
||||
// 'loose': includes `data-whatintent` value if it's more current than `data-whatinput`
|
||||
ask: function(opt) { return (opt === 'loose') ? currentIntent : currentInput; },
|
||||
|
||||
// returns array: all the detected input types
|
||||
types: function() { return inputTypes; }
|
||||
|
||||
};
|
||||
|
||||
}());
|
||||
|
||||
|
||||
/***/ }
|
||||
/******/ ])
|
||||
});
|
||||
;
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,t){"function"==typeof define&&define.amd?define([],function(){return t()}):"object"==typeof exports?module.exports=t():e.whatInput=t()}(this,function(){"use strict";function e(e){clearTimeout(s),n(e),f=!0,s=setTimeout(function(){f=!1},1e3)}function t(e){f||n(e)}function n(e){var t=o(e),n=r(e),d=w[e.type];"pointer"===d&&(d=i(e)),p!==d&&(!y&&p&&"keyboard"===d&&"tab"!==v[t]&&m.indexOf(n.nodeName.toLowerCase())>=0||(p=d,a.setAttribute("data-whatinput",p),-1===h.indexOf(p)&&h.push(p))),"keyboard"===d&&u(t)}function o(e){return e.keyCode?e.keyCode:e.which}function r(e){return e.target||e.srcElement}function i(e){return"number"==typeof e.pointerType?b[e.pointerType]:e.pointerType}function u(e){-1===c.indexOf(v[e])&&v[e]&&c.push(v[e])}function d(e){var t=o(e),n=c.indexOf(v[t]);-1!==n&&c.splice(n,1)}var s,c=[],a=document.body,f=!1,p=null,m=["input","select","textarea"],y=a.hasAttribute("data-whatinput-formtyping"),w={keydown:"keyboard",mousedown:"mouse",mouseenter:"mouse",touchstart:"touch",pointerdown:"pointer",MSPointerDown:"pointer"},h=[],v={9:"tab",13:"enter",16:"shift",27:"esc",32:"space",37:"left",38:"up",39:"right",40:"down"},b={2:"touch",3:"touch",4:"mouse"};return function(){var n="mousedown";window.PointerEvent?n="pointerdown":window.MSPointerEvent&&(n="MSPointerDown"),a.addEventListener(n,t),a.addEventListener("mouseenter",t),"ontouchstart"in document.documentElement&&a.addEventListener("touchstart",e),a.addEventListener("keydown",t),a.addEventListener("keyup",d)}(),{ask:function(){return p},keys:function(){return c},types:function(){return h},set:n}});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<form action="{{route('email.send', ['formId' => $page->id])}}" method="post">
|
||||
{!! csrf_field() !!}
|
||||
<div class="column medium-6">
|
||||
<input class="large" placeholder="jméno a příjmení" name="name" type="text">
|
||||
</div>
|
||||
<div class="column medium-6">
|
||||
<input class="large" placeholder="telefon" name="phone" type="text">
|
||||
</div>
|
||||
<div class="column medium-12">
|
||||
<input class="large" placeholder="e-mail" name="email" type="text">
|
||||
<textarea class="large" placeholder="zpráva" name="message"></textarea>
|
||||
</div>
|
||||
<div class="column medium-6 right">
|
||||
<a href="#" class="button expanded long secondary" id="formSend">ODESLAT</a>
|
||||
</div>
|
||||
</form>
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
@extendVisitor('defaultLayout')
|
||||
@section('content')
|
||||
|
||||
<div class="content-container">
|
||||
|
||||
<div class="column text-center m-b-25 show-for-large">
|
||||
<h2>Kontakt</h2>
|
||||
</div>
|
||||
|
||||
<div class="large-12 column columns p-lr-0 contact-detail">
|
||||
<div class="column text-right large-4">
|
||||
<h2 class="hide-for-large">Kontakt</h2>
|
||||
<p class="contact-p green-text"><b>{{$page->moduleSettings['companyName']}}</b></p>
|
||||
<p class="contact-p">
|
||||
{!! nl2br($page->moduleSettings['address']) !!}
|
||||
<br>
|
||||
-<br>
|
||||
tel.: {{$page->moduleSettings['phone']}}<br>
|
||||
e-mail: <a href="mailto:{{$page->moduleSettings['email']}}">{{$page->moduleSettings['email']}}</a>
|
||||
</p>
|
||||
<br>
|
||||
</div>
|
||||
<div id="map" class="column large-8" style="height: 250px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="large-12 column stripe light" id="contact-form">
|
||||
<div class="column large-12 medium-8 small-12 medium-centered p-lr-0 p-lr-15-sm">
|
||||
<h4 class="text-center uppercase m-b-25 bold">Napište nám</h4>
|
||||
@include('modules.contactform._partials.form')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('javascripts')
|
||||
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCjADMGOysqt0ibo9mD5Cr8rs47ZQF8rKQ&callback=initMap"
|
||||
async defer></script>
|
||||
<script type="text/javascript">
|
||||
function initMap() {
|
||||
var myLatLng = {
|
||||
lat: parseFloat ('{{$page->moduleSettings['gpsLat']}}'),
|
||||
lng: parseFloat ('{{$page->moduleSettings['gpsLng']}}')
|
||||
};
|
||||
|
||||
// Create a map object and specify the DOM element for display.
|
||||
var map = new google.maps.Map (document.getElementById ('map'), {
|
||||
center: myLatLng,
|
||||
scrollwheel: false,
|
||||
zoom: 18
|
||||
});
|
||||
|
||||
// Create a marker and set its position.
|
||||
var marker = new google.maps.Marker ({
|
||||
map: map,
|
||||
position: myLatLng,
|
||||
title: '{{$page->moduleSettings['companyName']}}'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@extendVisitor('defaultLayout')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row content-container">
|
||||
<h1>{{$page->title}}</h1>
|
||||
|
||||
{!! $page->pageContent !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
@extendVisitor('defaultLayout')
|
||||
|
||||
@section('content')
|
||||
@php $images = $page->files()->where('mime_type', 'like', 'image%')->get(); @endphp
|
||||
@if(count($images) > 0)
|
||||
<div class="orbit" role="region" data-orbit
|
||||
data-options="animationDuration:3000; animInFromLeft:fade-in; animInFromRight:fade-in; animOutToLeft:fade-out; animOutToRight:fade-out;">
|
||||
<ul class="orbit-container">
|
||||
@foreach($images as $i => $image)
|
||||
<li class="orbit-slide slow @if($i == 0) is-active @endif">
|
||||
<img class="orbit-image" src="@upload($image->filename)" alt="" />
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
<nav class="orbit-bullets">
|
||||
@foreach($images as $i => $image)
|
||||
<button @if($i == 0) class="is-active" @endif data-slide="{{$i}}"></button>
|
||||
@endforeach
|
||||
</nav>
|
||||
|
||||
<div class="stripe orbit-top"></div>
|
||||
<div class="stripe orbit-bottom"></div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row content-container">
|
||||
{!! $page->pageContent !!}
|
||||
|
||||
<div class="text-center stripe light trainee-team">
|
||||
|
||||
<h2>{{$page->traineeTeamCategory->name}}</h2>
|
||||
|
||||
@foreach($page->traineeTeamCategory->content as $i => $subpage)
|
||||
<div class="column text-center small-6 medium-{{ceil(12/count($page->traineeTeamCategory->content))}}"
|
||||
data-equalizer-watch>
|
||||
<a href="{{route('page.content', ['url' => $subpage->url])}}">
|
||||
@if(empty($subpage->titlePhoto))
|
||||
<img class="thumbnail" src="@asset('visitor/images/avatar.png')" alt="{{$subpage->title}}">
|
||||
@else
|
||||
<img class="thumbnail" src="@upload($subpage->titlePhoto)" alt="{{$subpage->title}}">
|
||||
@endif
|
||||
<h4>{{$subpage->title}}</h4>
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
@extendVisitor('defaultLayout')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row content-container">
|
||||
|
||||
<div class="text-center">
|
||||
<img src="@upload($page->titlePhoto)" class="rounded trainer" alt="">
|
||||
<h2>{{$page->title}}</h2>
|
||||
</div>
|
||||
|
||||
|
||||
{!! $page->pageContent !!}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,70 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{$page->title}} | {{setting('pageName')}}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link href='https://fonts.googleapis.com/css?family=Ubuntu:400,300,500,700&subset=latin-ext,latin' rel='stylesheet'
|
||||
type='text/css'>
|
||||
<link href="https://fonts.googleapis.com/css?family=Comfortaa&subset=latin-ext" rel="stylesheet">
|
||||
<link href="@asset('visitor/css/foundation.css')" type="text/css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/motion-ui/1.1.1/motion-ui.min.css" />
|
||||
<link rel="stylesheet" href="@asset('visitor/css/app.css')" />
|
||||
|
||||
@include('visitor.metaInformation')
|
||||
</head>
|
||||
<body>
|
||||
@if (!empty($googleAnalyticsCode))
|
||||
<script>
|
||||
(function (i, s, o, g, r, a, m) {
|
||||
i['GoogleAnalyticsObject'] = r;
|
||||
i[r] = i[r] || function () {
|
||||
(i[r].q = i[r].q || []).push (arguments)
|
||||
}, i[r].l = 1 * new Date ();
|
||||
a = s.createElement (o),
|
||||
m = s.getElementsByTagName (o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
m.parentNode.insertBefore (a, m)
|
||||
}) (window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
||||
|
||||
ga ('create', '{{$googleAnalyticsCode}}', 'auto');
|
||||
ga ('send', 'pageview');
|
||||
|
||||
</script>
|
||||
@endif
|
||||
<header class="top-bar">
|
||||
<div class="top-bar-left hide-for-small-only">
|
||||
<h1>
|
||||
<a href="{{route('page.index')}}">
|
||||
{{setting('pageName')}}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="top-bar-right">
|
||||
@widgetArea('mainMenu')
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@yield('content')
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
||||
<footer id="footer" class="stripe light">
|
||||
<div id="footer-widgets">
|
||||
@widgetArea('footer')
|
||||
</div>
|
||||
<div id="binarity" class="text-right">
|
||||
<a target="_blank" href="https://www.binarity.cz/"> binarity s.r.o.</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="@asset('visitor/js/vendor/jquery.min.js')" type="text/javascript"></script>
|
||||
<script src="@asset('visitor/js/vendor/foundation.min.js')" type="text/javascript"></script>
|
||||
<script src="@asset('visitor/js/BLightBox.js')" type="text/javascript"></script>
|
||||
<script src="@asset('visitor/js/app.js')" type="text/javascript"></script>
|
||||
|
||||
@yield('javascripts')
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
@extendVisitor('errors.layout')
|
||||
|
||||
@section('pageTitle', 'Stránka nenalezena')
|
||||
@section('content')
|
||||
Nějakým způsobem se stalo, že tato stránka neexistuje. Zkuste se podívat na <a href="{{route("page.index")}}">hlavní
|
||||
stránku</a>, případně nás
|
||||
<a href="{{route("page.content", ['url' => 'kontakt'])}}">kontaktujte</a> a dejte nám vědět, co je špatně.
|
||||
@endsection
|
||||
@@ -0,0 +1,6 @@
|
||||
@extendVisitor('errors.layout')
|
||||
|
||||
@section('pageTitle', 'Probíhá údržba stránek')
|
||||
@section('content')
|
||||
Právě na stránkách provádíme úpravy, vše bude v pořádku za několik málo okamžiků.
|
||||
@endsection
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@extendVisitor('errors.layout')
|
||||
|
||||
@section('pageTitle', 'Domovská stránka neexistuje')
|
||||
@section('content')
|
||||
V systému nikdo zatím nenastavil domovskou stránku, proto vidíte tuto obrazovku. Určitě se jedná o nějakou drobnou chybu, která bude velmi brzo opravena.
|
||||
@endsection
|
||||
@@ -0,0 +1,100 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
||||
<link href='https://fonts.googleapis.com/css?family=Hind+Siliguri:400,500,700,300&subset=latin,latin-ext'
|
||||
rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="{{asset_path('visitor/css/app.css')}}">
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@yield('pageTitle') | {{setting('pageName')}}</title>
|
||||
|
||||
<style>
|
||||
|
||||
body {
|
||||
font-size: 150%;
|
||||
line-height: 150%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 4em;
|
||||
font-weight: 100;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
header {
|
||||
background: #7cad2a;
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
footer a {
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="text-center">
|
||||
|
||||
<header>
|
||||
<a href="{{route('page.index')}}">
|
||||
<img src="{{asset_path('visitor/images/menu_logo.png')}}" class="PragueTennisCamp-logo-menu" alt="PragueTennisCamp s.r.o.">
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<h1>@yield('pageTitle')</h1>
|
||||
|
||||
<div class="row">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
<footer id="footer">
|
||||
@if (!empty(setting('facebookProfile')))
|
||||
|
||||
<a href="{{setting('facebookProfile')}}" target="_blank">
|
||||
<i class="fa fa-fw fa-facebook-official fb-color"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if (!empty(setting('linkedInProfile')))
|
||||
<a href="{{setting('linkedInProfile')}}" target="_blank">
|
||||
<i class="fa fa-fw fa-linkedin in-color"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(!empty(setting('gplusProfile')))
|
||||
<a href="{{setting('gplusProfile')}}" target="_blank">
|
||||
<i class="fa fa-fw fa-google-plus gp-color"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
</footer>
|
||||
|
||||
{{--<ul class="social-icons menu">--}}
|
||||
{{--<a href="{{setting('facebookProfile')}}" target="_blank">--}}
|
||||
{{--<i class="fa fa-fw fa-2x fa-facebook-official fb-color"></i>--}}
|
||||
{{--</a>--}}
|
||||
|
||||
{{--<li>--}}
|
||||
{{--<a href="{{setting('linkedInProfile')}}" target="_blank">--}}
|
||||
{{--<i class="fa fa-fw fa-2x fa-linkedin in-color"></i>--}}
|
||||
{{--</a>--}}
|
||||
{{--</li>--}}
|
||||
|
||||
{{--<li>--}}
|
||||
{{--<a href="{{setting('gplusProfile')}}" target="_blank">--}}
|
||||
{{--<i class="fa fa-fw fa-2x fa-google-plus gp-color"></i>--}}
|
||||
{{--</a>--}}
|
||||
{{--</li>--}}
|
||||
{{--</ul>--}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,9 @@
|
||||
@if(isset($page))
|
||||
@section('pageTitle', $page->title)
|
||||
@section('pageDescription', $page->meta_description)
|
||||
@section('pageKeywords', $page->meta_keywords)
|
||||
@section('pageTitleImage')
|
||||
@if (!empty($page->titlePhoto) && \App\CMS\Helpers\Path::upload($page->titlePhoto))@upload($page->titlePhoto)
|
||||
@else{{asset_path('visitor/images/social-cover.png')}}@endif
|
||||
@endsection
|
||||
@endif
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="row">
|
||||
|
||||
<h3 class="text-center">{{$widget->name}}</h3>
|
||||
|
||||
<div class="column small-centered large-8">
|
||||
@include('modules.contactform._partials.form', ['page' => $form ])
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return [
|
||||
'providers' => [\Templates\PragueTennisCamp\Providers\ServiceProvider::class],
|
||||
'files' => [],
|
||||
'handler' => \Templates\PragueTennisCamp\Handler::class,
|
||||
'name' => 'PragueTennisCamp s.r.o.',
|
||||
'alias' => 'PragueTennisCamp-template',
|
||||
'description' => '',
|
||||
];
|
||||
Reference in New Issue
Block a user