Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Oct 20, 2021
0 parents commit 75fa8bb
Show file tree
Hide file tree
Showing 13 changed files with 4,872 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/composer.lock
/vendor/
/node_modules/
77 changes: 77 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

$header = <<<EOF
This file is part of the Contao GLightbox extension.
(c) inspiredminds
@license LGPL-3.0-or-later
EOF;

$finder = PhpCsFixer\Finder::create()
->exclude('Resources/contao/templates')
->in([
__DIR__.'/src',
])
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'comment_to_phpdoc' => true,
'compact_nullable_typehint' => true,
'escape_implicit_backslashes' => true,
'fully_qualified_strict_types' => true,
'general_phpdoc_annotation_remove' => [
'author',
'expectedException',
'expectedExceptionMessage',
],
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => ['syntax' => 'short'],
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'new_line_for_chained_calls',
],
'native_function_invocation' => [
'include' => ['@compiler_optimized'],
],
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_null_property_initialization' => true,
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_strict' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
'return_assignment' => true,
'strict_comparison' => true,
'strict_param' => true,
'string_line_ending' => true,
'void_return' => true,
])
->setFinder($finder)
->setRiskyAllowed(true)
->setUsingCache(false)
;
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[![](https://img.shields.io/packagist/v/inspiredminds/contao-glightbox.svg)](https://packagist.org/packages/inspiredminds/contao-glightbox)
[![](https://img.shields.io/packagist/dt/inspiredminds/contao-glightbox.svg)](https://packagist.org/packages/inspiredminds/contao-glightbox)

Contao GLightbox
=========================

Contao extension to integrate [GLightbox](https://biati-digital.github.io/glightbox/). To enable, activate the `js_glightbox` JavaScript template in your page layout (disable any other lightbox integrations). Create your own custom template in order to customise the GLightbox [options](https://github.com/biati-digital/glightbox/blob/master/README.md#lightbox-options).
41 changes: 41 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "inspiredminds/contao-glightbox",
"description": "Contao extension to integrate GLightbox.",
"type": "contao-bundle",
"license": "LGPL-3.0-or-later",
"homepage": "https://github.com/inspiredminds/contao-glightbox",
"authors": [
{
"name": "Fritz Michael Gschwantner",
"email": "[email protected]",
"role": "Developer"
}
],
"support": {
"issues": "https://github.com/inspiredminds/contao-glightbox/issues",
"source": "https://github.com/inspiredminds/contao-glightbox",
"forum": "https://community.contao.org/de"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/fritzmg"
}
],
"require": {
"php": ">=7.1",
"contao/core-bundle": "^4.9",
"symfony/http-kernel": "^4.4 || ^5.1"
},
"autoload": {
"psr-4": {
"InspiredMinds\\ContaoGLightbox\\": "src/"
}
},
"extra": {
"contao-manager-plugin": "InspiredMinds\\ContaoGLightbox\\ContaoManager\\Plugin"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16"
}
}
16 changes: 16 additions & 0 deletions contao/templates/js_glightbox.html5
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use Contao\Template;

$GLOBALS['TL_CSS']['glightbox'] = 'bundles/contaoglightbox/css/glightbox.min.css|static';
echo Template::generateScriptTag('bundles/contaoglightbox/js/glightbox.min.js', false, null);

?>
<script>
(function(){
'use strict';
GLightbox({
selector: 'a[data-lightbox]'
});
})();
</script>
28 changes: 28 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "contao-glightbox",
"version": "1.0.0",
"dependencies": {
"glightbox": "^3.1.0"
},
"scripts": {
"postinstall": "cp -r node_modules/glightbox/dist/* public/"
}
}
Loading

0 comments on commit 75fa8bb

Please sign in to comment.