diff --git a/.styleci.yml b/.styleci.yml index de6be917..f349be62 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,16 +1,30 @@ preset: symfony +enabled: + - short_array_syntax + disabled: - - multiline_array_trailing_comma + - cast_spaces + - concat_without_spaces + - function_declaration + - no_blank_lines_after_phpdoc + - no_blank_lines_after_throw + - php_unit_fqcn_annotation + - phpdoc_align + - phpdoc_no_empty_return + - phpdoc_scalar + - phpdoc_separation + - phpdoc_summary + - phpdoc_to_comment + - phpdoc_type_to_var - pre_increment + - self_accessor - single_quote - - concat_without_spaces - - empty_return - - spaces_cast - - unalign_equals + - trailing_comma_in_multiline_array - unalign_double_arrow - - phpdoc_to_comment - - phpdoc_annotation_without_dot - -enabled: - - short_array_syntax + - unalign_equals + - blank_line_before_break + - blank_line_before_continue + - blank_line_before_declare + - blank_line_before_throw + - blank_line_before_try diff --git a/.travis.yml b/.travis.yml index 0718186d..c3d83e18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,22 +3,31 @@ language: php sudo: false php: - - 5.4 - 5.5 - 5.6 + - 7.0 + - 7.1 + - 7.2 + - nightly matrix: fast_finish: true + allow_failures: + - php: 7.2 + - php: nightly services: - mysql before_install: - - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi; - - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without memcache extension"; fi; - # - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi; + - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then phpenv config-rm xdebug.ini; fi; + # load memcache.so for php 5 + - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [ $(php -r "echo PHP_MAJOR_VERSION;") == 5 ]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Continuing without memcache extension"; fi; + # load memcache.so for php >= 7.1 + - if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [ $(php -r "echo PHP_MAJOR_VERSION;") == 7 ] && [ $(php -r "echo PHP_MINOR_VERSION;") >= 1 ]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Continuing without memcache extension"; fi; # Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built - if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi; + - composer self-update - if [ -n "$GH_TOKEN" ]; then composer config --global github-oauth.github.com ${GH_TOKEN}; fi; - mysql -e 'create database zk_test;' @@ -26,12 +35,12 @@ before_install: install: - composer install - zip -qr MediaModule.zip . - - wget https://github.com/zikula/core/releases/download/1.4.3/Zikula_Core-1.4.3.build183.tar.gz - - tar -xpzf Zikula_Core-1.4.3.build183.tar.gz - - rm Zikula_Core-1.4.3.build183.tar.gz - - cd Zikula_Core-1.4.3 - - php app/console zikula:install:start -n --database_user=root --database_name=zk_test --password=12345678 --email=admin@example.com --router:request_context:host=localhost - - php app/console zikula:install:finish + - wget https://github.com/zikula/core/releases/download/2.0.11/2.0.tar.gz + - tar -xpzf 2.0.tar.gz + - rm 2.0.tar.gz + - cd 2.0 + - php bin/console zikula:install:start -n --database_user=root --database_name=zk_test --password=12345678 --email=admin@example.com --router:request_context:host=localhost + - php bin/console zikula:install:finish - cd modules - mkdir cmfcmf - cd cmfcmf @@ -39,12 +48,12 @@ install: - cd media-module - unzip -q ../../../../MediaModule - cd ../../.. - - php app/console bootstrap:bundles - - mysql -e "INSERT INTO zk_test.modules (id, name, type, displayname, url, description, directory, version, capabilities, state, securityschema, core_min, core_max) VALUES (NULL, 'CmfcmfMediaModule', '3', 'Media Module', 'media', '...', 'cmfcmf/media-module', '1.2.2', 'N;', '3', 'N;', '1.4.3', '1.4.99');" + - php bin/console bootstrap:bundles + - mysql -e "INSERT INTO zk_test.modules (id, name, type, displayname, url, description, version, capabilities, state, securityschema, core_min, core_max) VALUES (NULL, 'CmfcmfMediaModule', '3', 'Media Module', 'media', '...', '1.3.0', 'N;', '3', 'N;', '2.0.11', '3.0.0');" script: - - php app/console lint:yaml modules/cmfcmf/media-module/Resources - - php app/console lint:twig @CmfcmfMediaModule + - php bin/console lint:yaml modules/cmfcmf/media-module/Resources + - php bin/console lint:twig @CmfcmfMediaModule - phpunit --configuration modules/cmfcmf/media-module/phpunit.xml.dist --coverage-text --coverage-clover=coverage.clover -v after_success: diff --git a/Block/CollectionBlock.php b/Block/CollectionBlock.php index 7be13f1e..ce64e626 100644 --- a/Block/CollectionBlock.php +++ b/Block/CollectionBlock.php @@ -12,17 +12,24 @@ namespace Cmfcmf\Module\MediaModule\Block; use Cmfcmf\Module\MediaModule\Entity\Collection\Repository\CollectionRepository; +use Cmfcmf\Module\MediaModule\Form\Collection\CollectionBlockType; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Cmfcmf\Module\MediaModule\Security\SecurityManager; use Symfony\Component\DependencyInjection\ContainerInterface; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\Translation\TranslatorInterface; use Zikula\BlocksModule\AbstractBlockHandler; /** - * Class PageBlock. + * Collection block handler. */ class CollectionBlock extends AbstractBlockHandler { + /** + * @var TranslatorInterface + */ + private $translator; + /** * @var CollectionRepository */ @@ -38,20 +45,15 @@ class CollectionBlock extends AbstractBlockHandler */ private $twig; - /** - * @var TranslatorInterface - */ - private $translator; - public function setContainer(ContainerInterface $container = null) { parent::setContainer($container); + $this->translator = $container->get('translator'); $this->collectionRepository = $container->get('doctrine.orm.entity_manager') ->getRepository('CmfcmfMediaModule:Collection\CollectionEntity'); $this->securityManager = $container->get('cmfcmf_media_module.security_manager'); $this->twig = $container->get('twig'); - $this->translator = $container->get('translator'); } /** @@ -78,11 +80,18 @@ public function display(array $properties) return false; } - $content = $this->get('cmfcmf_media_module.collection_template_collection')->getCollectionTemplate($properties['template'])->render( + $selectedTemplateFactory = $this->get('cmfcmf_media_module.collection_template.selected_factory'); + try { + $selectedTemplate = $selectedTemplateFactory->fromDB($properties['template']); + } catch (\DomainException $e) { + throw new NotFoundHttpException(); + } + + $content = $selectedTemplate->getTemplate()->render( $collection, $this->get('cmfcmf_media_module.media_type_collection'), isset($properties['showChildCollections']) ? $properties['showChildCollections'] : false, - [] // @todo pass template options + $selectedTemplate->getOptions() ); $hook = ''; @@ -109,20 +118,7 @@ public function display(array $properties) */ public function getFormClassName() { - return 'Cmfcmf\Module\MediaModule\Form\Collection\CollectionBlockType'; - } - - /** - * {@inheritdoc} - */ - public function getFormOptions() - { - return [ - 'translator' => $this->translator, - 'securityManager' => $this->securityManager, - 'templateCollection' => $this->get('cmfcmf_media_module.collection_template_collection'), - 'collectionRepository' => $this->collectionRepository - ]; + return CollectionBlockType::class; } /** diff --git a/CmfcmfMediaModule.php b/CmfcmfMediaModule.php index bed5bdde..769cbe6b 100644 --- a/CmfcmfMediaModule.php +++ b/CmfcmfMediaModule.php @@ -11,11 +11,11 @@ namespace Cmfcmf\Module\MediaModule; -use Cmfcmf\Module\MediaModule\DependencyInjection\CollectionPermissionCompilerPass; -use Cmfcmf\Module\MediaModule\DependencyInjection\CollectionTemplateCompilerPass; -use Cmfcmf\Module\MediaModule\DependencyInjection\FontCompilerPass; -use Cmfcmf\Module\MediaModule\DependencyInjection\ImporterCompilerPass; -use Cmfcmf\Module\MediaModule\DependencyInjection\MediaTypeCompilerPass; +use Cmfcmf\Module\MediaModule\DependencyInjection\Compiler\CollectionPermissionCompilerPass; +use Cmfcmf\Module\MediaModule\DependencyInjection\Compiler\CollectionTemplateCompilerPass; +use Cmfcmf\Module\MediaModule\DependencyInjection\Compiler\FontCompilerPass; +use Cmfcmf\Module\MediaModule\DependencyInjection\Compiler\ImporterCompilerPass; +use Cmfcmf\Module\MediaModule\DependencyInjection\Compiler\MediaTypeCompilerPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Zikula\Core\AbstractModule; diff --git a/CollectionTemplate/GalleriaTemplate.php b/CollectionTemplate/GalleriaTemplate.php index 7048a37d..f3a2a9fe 100644 --- a/CollectionTemplate/GalleriaTemplate.php +++ b/CollectionTemplate/GalleriaTemplate.php @@ -11,6 +11,8 @@ namespace Cmfcmf\Module\MediaModule\CollectionTemplate; +use Cmfcmf\Module\MediaModule\Form\CollectionTemplate\GalleriaType; + /** * Displays a Galleria image slider https://galleria.io/. */ @@ -26,7 +28,7 @@ public function getTitle() public function getSettingsForm() { - return 'Cmfcmf\Module\MediaModule\Form\CollectionTemplate\GalleriaType'; + return GalleriaType::class; } public function getDefaultOptions() diff --git a/CollectionTemplate/LightGalleryTemplate.php b/CollectionTemplate/LightGalleryTemplate.php index 5dbec8dd..88e7ce0b 100644 --- a/CollectionTemplate/LightGalleryTemplate.php +++ b/CollectionTemplate/LightGalleryTemplate.php @@ -11,6 +11,8 @@ namespace Cmfcmf\Module\MediaModule\CollectionTemplate; +use Cmfcmf\Module\MediaModule\Form\CollectionTemplate\LightGalleryType; + /** * Displays a light gallery http://sachinchoolur.github.io/lightGallery/. */ @@ -26,7 +28,7 @@ public function getTitle() public function getSettingsForm() { - return 'Cmfcmf\Module\MediaModule\Form\CollectionTemplate\LightGalleryType'; + return LightGalleryType::class; } public function getDefaultOptions() diff --git a/CollectionTemplate/SelectedTemplateFactory.php b/CollectionTemplate/SelectedTemplateFactory.php index 568af571..c3d78e72 100644 --- a/CollectionTemplate/SelectedTemplateFactory.php +++ b/CollectionTemplate/SelectedTemplateFactory.php @@ -18,13 +18,29 @@ class SelectedTemplateFactory */ private $templateCollection; - public function __construct(TemplateCollection $templateCollection) - { + /** + * @var string + */ + private $defaultTemplate; + + /** + * @param TemplateCollection $templateCollection + * @param string $defaultTemplate + */ + public function __construct( + TemplateCollection $templateCollection, + $defaultTemplate + ) { $this->templateCollection = $templateCollection; + $this->defaultTemplate = $defaultTemplate; } public function fromDB($jsonOrString) { + if (!$jsonOrString) { + $jsonOrString = $this->defaultTemplate; + } + if ($this->isJSON($jsonOrString)) { $json = json_decode($jsonOrString, true); $template = $json['template']; @@ -40,7 +56,7 @@ public function fromDB($jsonOrString) public function fromTemplateName($template, array $options) { $template = $this->templateCollection->getCollectionTemplate($template); - if (count($options) == 0) { + if (0 == count($options)) { $options = $template->getDefaultOptions(); } @@ -49,6 +65,6 @@ public function fromTemplateName($template, array $options) private function isJSON($string) { - return strpos($string, '{') !== false; + return false !== strpos($string, '{'); } } diff --git a/CollectionTemplate/TemplateCollection.php b/CollectionTemplate/TemplateCollection.php index 023eb9b4..88b4401e 100644 --- a/CollectionTemplate/TemplateCollection.php +++ b/CollectionTemplate/TemplateCollection.php @@ -53,15 +53,18 @@ public function getCollectionTemplates() */ public function getCollectionTemplateTitles() { - return array_map(function (TemplateInterface $template) { - return $template->getTitle(); - }, $this->templates); + $choices = []; + foreach ($this->templates as $template) { + $choices[$template->getTitle()] = $template->getName(); + } + + return $choices; } /** * Returns the specified collection template. * - * @param string $template The template name. + * @param string $template the template name * * @return TemplateInterface */ @@ -77,7 +80,7 @@ public function getCollectionTemplate($template) /** * Checks whether or not the specified collection template exists. * - * @param string $template The template name. + * @param string $template the template name * * @return bool */ diff --git a/Container/HookContainer.php b/Container/HookContainer.php deleted file mode 100644 index fc67c8f4..00000000 --- a/Container/HookContainer.php +++ /dev/null @@ -1,96 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Cmfcmf\Module\MediaModule\Container; - -use Zikula\Bundle\HookBundle\AbstractHookContainer; -use Zikula\Bundle\HookBundle\Bundle\SubscriberBundle; -use Zikula\Bundle\HookBundle\Bundle\ProviderBundle; - -class HookContainer extends AbstractHookContainer -{ - /** - * {@inheritdoc} - */ - protected function setupHookBundles() - { - $entities = [ - "collection" => $this->__("Collections"), - "media" => $this->__("Media"), - "license" => $this->__("Licenses"), - ]; - foreach ($entities as $name => $title) { - if ($name != 'license') { - $this->createSubscriberUIHook($name, $title); - $this->createSubscriberFilterHook($name, $title); - } - $this->createProviderUIHook($name, $title); - } - } - - /** - * Creates a subscriber UI hook using the given name and title. - * - * @param string $name - * @param string $title - */ - private function createSubscriberUIHook($name, $title) - { - $bundle = new SubscriberBundle("CmfcmfMediaModule", "subscriber.cmfcmfmediamodule.ui_hooks.$name", "ui_hooks", $this->__f("%s hooks", ['%s' => $title])); - - $bundle->addEvent("display_view", "cmfcmfmediamodule.ui_hooks.$name.display_view"); - $bundle->addEvent("form_edit", "cmfcmfmediamodule.ui_hooks.$name.form_edit"); - $bundle->addEvent("form_delete", "cmfcmfmediamodule.ui_hooks.$name.form_delete"); - //$bundle->addEvent("filter", "cmfcmfmediamodule.filter_hooks.$name.filter"); - $bundle->addEvent("validate_edit", "cmfcmfmediamodule.ui_hooks.$name.validate_edit"); - $bundle->addEvent("validate_delete", "cmfcmfmediamodule.ui_hooks.$name.validate_delete"); - $bundle->addEvent("process_edit", "cmfcmfmediamodule.ui_hooks.$name.process_edit"); - $bundle->addEvent("process_delete", "cmfcmfmediamodule.ui_hooks.$name.process_delete"); - - $this->registerHookSubscriberBundle($bundle); - } - - /** - * Creates a subscriber filter hook using the given name and title. - * - * @param string $name - * @param string $title - */ - private function createSubscriberFilterHook($name, $title) - { - $bundle = new SubscriberBundle("CmfcmfMediaModule", "subscriber.cmfcmfmediamodule.filter_hooks.$name", "filter_hooks", $this->__f("%s display hooks", ['%s' => $title])); - $bundle->addEvent('filter', "cmfcmfmediamodule.filter_hooks.$name.filter"); - - $this->registerHookSubscriberBundle($bundle); - } - - /** - * Creates a provider UI hook using the given name and title. - * - * @param string $name - * @param string $title - */ - private function createProviderUIHook($name, $title) - { - $bundle = new ProviderBundle("CmfcmfMediaModule", "provider.cmfcmfmediamodule.ui_hooks.$name", "ui_hooks", $this->__f("Media Module - %s", ['%s' => $title])); - - $class = "Cmfcmf\\Module\\MediaModule\\HookHandler\\" . ucfirst($name) . "HookHandler"; - $service = "cmfcmf_media_module.hook_handler.$name"; - - $bundle->addServiceHandler("display_view", $class, "uiView", $service); - $bundle->addServiceHandler("form_edit", $class, "uiEdit", $service); - $bundle->addServiceHandler("validate_edit", $class, "validateEdit", $service); - $bundle->addServiceHandler("process_edit", $class, "processEdit", $service); - $bundle->addServiceHandler("process_delete", $class, "processDelete", $service); - - $this->registerHookProviderBundle($bundle); - } -} diff --git a/Container/LinkContainer.php b/Container/LinkContainer.php index 8d1f797a..205100be 100644 --- a/Container/LinkContainer.php +++ b/Container/LinkContainer.php @@ -78,9 +78,13 @@ public function getBundleName() */ public function getLinks($type = self::TYPE_ADMIN) { - if ($type == self::TYPE_ADMIN) { + if (!class_exists('\\Fhaculty\\Graph\\Graph')) { + include_once __DIR__ . '/../bootstrap.php'; + } + if (self::TYPE_ADMIN == $type) { return $this->adminLinks(); - } elseif ($type == self::TYPE_USER) { + } + if (self::TYPE_USER == $type) { return $this->userLinks(); } diff --git a/ContentType/CollectionType.php b/ContentType/CollectionType.php new file mode 100644 index 00000000..ce09df87 --- /dev/null +++ b/ContentType/CollectionType.php @@ -0,0 +1,199 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\ContentType; + +use Cmfcmf\Module\MediaModule\CollectionTemplate\SelectedTemplateFactory; +use Cmfcmf\Module\MediaModule\ContentType\Form\Type\CollectionType as FormType; +use Cmfcmf\Module\MediaModule\Entity\Collection\Repository\CollectionRepository; +use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; +use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Doctrine\ORM\EntityManagerInterface; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Zikula\Common\Content\AbstractContentType; +use Zikula\Common\Content\ContentTypeInterface; + +/** + * Collection content type. + */ +class CollectionType extends AbstractContentType +{ + /** + * @var CollectionRepository + */ + private $collectionRepository; + + /** + * @var SecurityManager + */ + private $securityManager; + + /** + * @var SelectedTemplateFactory + */ + private $selectedTemplateFactory; + + /** + * @var MediaTypeCollection + */ + private $mediaTypeCollection; + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return ContentTypeInterface::CATEGORY_BASIC; + } + + /** + * {@inheritdoc} + */ + public function getIcon() + { + return 'folder-o'; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Media collection', 'cmfcmfmediamodule'); + } + + /** + * {@inheritdoc} + */ + public function getDescription() + { + return $this->translator->__('Display a media collection.', 'cmfcmfmediamodule'); + } + + /** + * {@inheritdoc} + */ + public function getDefaultData() + { + return [ + 'id' => null, + 'template' => '' + ]; + } + + /** + * {@inheritdoc} + */ + public function displayView() + { + $this->customInit(); + + $this->data = $this->getData(); + if (null === $this->data['id'] || empty($this->data['id'])) { + return ''; + } + + $collection = $this->collectionRepository->findOneBy(['id' => $this->data['id']]); + if (!$collection) { + return ''; + } + if (!$this->securityManager->hasPermission($collection, CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW)) { + return ''; + } + + try { + $selectedTemplate = $this->selectedTemplateFactory->fromDB($this->data['template']); + } catch (\DomainException $e) { + throw new NotFoundHttpException(); + } + + $content = $selectedTemplate->getTemplate()->render( + $collection, + $this->mediaTypeCollection, + isset($this->data['showChildCollections']) ? $this->data['showChildCollections'] : false, + $selectedTemplate->getOptions() + ); + + if (isset($this->data['showEditAndDownloadLinks']) && $this->data['showEditAndDownloadLinks']) { + $content = $this->twig->render('@CmfcmfMediaModule/Collection/display.html.twig', [ + 'collection' => $collection, + 'renderRaw' => true, + 'content' => $content, + 'hook' => '' + ]); + } + + return $content; + } + + /** + * {@inheritdoc} + */ + public function displayEditing() + { + if (null === $this->data['id'] || empty($this->data['id'])) { + return $this->translator->__('No collection selected.', 'cmfcmfmediamodule'); + } + + return parent::displayEditing(); + } + + /** + * {@inheritdoc} + */ + public function getEditFormClass() + { + $this->customInit(); + + return FormType::class; + } + + /** + * @param EntityManagerInterface $em + */ + public function setEntityManager(EntityManagerInterface $em) + { + $this->collectionRepository = $em->getRepository('CmfcmfMediaModule:Collection\CollectionEntity'); + } + + /** + * @param SecurityManager $securityManager + */ + public function setSecurityManager(SecurityManager $securityManager) + { + $this->securityManager = $securityManager; + } + + /** + * @param SelectedTemplateFactory $selectedTemplateFactory + */ + public function setSelectedTemplateFactory(SelectedTemplateFactory $selectedTemplateFactory) + { + $this->selectedTemplateFactory = $selectedTemplateFactory; + } + + /** + * @param MediaTypeCollection $mediaTypeCollection + */ + public function setMediaTypeCollection(MediaTypeCollection $mediaTypeCollection) + { + $this->mediaTypeCollection = $mediaTypeCollection; + } + + private function customInit() + { + $this->bundleName = 'CmfcmfMediaModule'; + $this->domain = strtolower($this->bundleName); + + include_once __DIR__ . '/../bootstrap.php'; + } +} diff --git a/ContentType/Form/Type/CollectionType.php b/ContentType/Form/Type/CollectionType.php new file mode 100644 index 00000000..8ebfbbba --- /dev/null +++ b/ContentType/Form/Type/CollectionType.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\ContentType\Form\Type; + +use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; +use Cmfcmf\Module\MediaModule\Entity\Collection\Repository\CollectionRepository; +use Cmfcmf\Module\MediaModule\Form\CollectionTemplate\TemplateType; +use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Translation\TranslatorInterface; +use Zikula\Common\Content\AbstractContentFormType; + +/** + * Collection content type form type. + */ +class CollectionType extends AbstractContentFormType +{ + /** + * @var CollectionRepository + */ + private $collectionRepository; + + /** + * @var SecurityManager + */ + private $securityManager; + + /** + * @param TranslatorInterface $translator + * @param SecurityManager $securityManager + * @param EntityManagerInterface $em + */ + public function __construct( + TranslatorInterface $translator, + SecurityManager $securityManager, + EntityManagerInterface $em + ) { + $this->setTranslator($translator); + $this->securityManager = $securityManager; + $this->collectionRepository = $em->getRepository('CmfcmfMediaModule:Collection\CollectionEntity'); + } + + public function buildForm(FormBuilderInterface $builder, array $options) + { + $securityManager = $this->securityManager; + $collectionRepository = $this->collectionRepository; + + $collectionOptions = [ + 'required' => true, + 'label' => $this->__('Collection', 'cmfcmfmediamodule'), + 'class' => CollectionEntity::class, + 'query_builder' => function (EntityRepository $er) use ($securityManager) { + /** @var CollectionRepository $er */ + $qb = $securityManager->getCollectionsWithAccessQueryBuilder( + CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW + ); + $qb->orderBy('c.root', 'ASC') + ->addOrderBy('c.lft', 'ASC'); + + return $qb; + }, + 'placeholder' => $this->__('Select collection', 'cmfcmfmediamodule'), + 'choice_label' => 'indentedTitle', + 'multiple' => false + ]; + $builder + ->add('id', EntityType::class, $collectionOptions) + ->add('template', TemplateType::class, [ + 'label' => $this->__('Display', 'cmfcmfmediamodule'), + ]) + ->add('showChildCollections', CheckboxType::class, [ + 'label' => $this->__('Show child collections', 'cmfcmfmediamodule'), + 'required' => false + ]) + ->add('showEditAndDownloadLinks', CheckboxType::class, [ + 'label' => $this->__('Show edit and download links', 'cmfcmfmediamodule'), + 'required' => false + ]) + ->addModelTransformer(new CallbackTransformer( + function ($data) use ($collectionRepository) { + $data['id'] = isset($data['id']) ? $collectionRepository->findOneBy(['id' => $data['id']]) : null; + + return $data; + }, + function ($data) { + $data['id'] = isset($data['id']) ? $data['id']->getId() : null; + + return $data; + } + )) + ; + } + + /** + * {@inheritdoc} + */ + public function getBlockPrefix() + { + return 'cmfcmfmediamodule_contenttype_collection'; + } +} diff --git a/ContentType/Form/Type/MediaType.php b/ContentType/Form/Type/MediaType.php new file mode 100644 index 00000000..b4117502 --- /dev/null +++ b/ContentType/Form/Type/MediaType.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\ContentType\Form\Type; + +use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; +use Cmfcmf\Module\MediaModule\Entity\Media\Repository\MediaRepository; +use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Translation\TranslatorInterface; +use Zikula\Common\Content\AbstractContentFormType; + +/** + * Media content type form type. + */ +class MediaType extends AbstractContentFormType +{ + /** + * @var MediaRepository + */ + private $mediaRepository; + + /** + * @var SecurityManager + */ + private $securityManager; + + /** + * @param TranslatorInterface $translator + * @param SecurityManager $securityManager + * @param EntityManagerInterface $em + */ + public function __construct( + TranslatorInterface $translator, + SecurityManager $securityManager, + EntityManagerInterface $em + ) { + $this->setTranslator($translator); + $this->securityManager = $securityManager; + $this->mediaRepository = $em->getRepository('CmfcmfMediaModule:Media\AbstractMediaEntity'); + } + + public function buildForm(FormBuilderInterface $builder, array $options) + { + $securityManager = $this->securityManager; + $mediaRepository = $this->mediaRepository; + + $mediumOptions = [ + 'required' => true, + 'label' => $this->__('Medium', 'cmfcmfmediamodule'), + 'class' => AbstractMediaEntity::class, + 'query_builder' => function (EntityRepository $er) use ($securityManager) { + /** @var MediaRepository $er */ + $qb = $securityManager->getMediaWithAccessQueryBuilder( + CollectionPermissionSecurityTree::PERM_LEVEL_MEDIA_DETAILS + ); + $qb->orderBy('m.title'); + + return $qb; + }, + 'placeholder' => $this->__('Select medium', 'cmfcmfmediamodule'), + 'choice_label' => 'title', + 'multiple' => false + ]; + $builder + ->add('id', EntityType::class, $mediumOptions) + ->addModelTransformer(new CallbackTransformer( + function ($data) use ($mediaRepository) { + $data['id'] = isset($data['id']) ? $mediaRepository->findOneBy(['id' => $data['id']]) : null; + + return $data; + }, + function ($data) { + $data['id'] = isset($data['id']) ? $data['id']->getId() : null; + + return $data; + } + )) + ; + } + + /** + * {@inheritdoc} + */ + public function getBlockPrefix() + { + return 'cmfcmfmediamodule_contenttype_media'; + } +} diff --git a/ContentType/MediaType.php b/ContentType/MediaType.php new file mode 100644 index 00000000..4fce382f --- /dev/null +++ b/ContentType/MediaType.php @@ -0,0 +1,213 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\ContentType; + +use Cmfcmf\Module\MediaModule\ContentType\Form\Type\MediaType as FormType; +use Cmfcmf\Module\MediaModule\Entity\Media\Repository\MediaRepository; +use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; +use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Doctrine\ORM\EntityManagerInterface; +use Zikula\Common\Content\AbstractContentType; +use Zikula\Common\Content\ContentTypeInterface; + +/** + * Media content type. + */ +class MediaType extends AbstractContentType +{ + /** + * @var MediaRepository + */ + private $mediaRepository; + + /** + * @var SecurityManager + */ + private $securityManager; + + /** + * @var MediaTypeCollection + */ + private $mediaTypeCollection; + + /** + * @var boolean + */ + private $enableMediaViewCounter; + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return ContentTypeInterface::CATEGORY_BASIC; + } + + /** + * {@inheritdoc} + */ + public function getIcon() + { + return 'picture-o'; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Media detail', 'cmfcmfmediamodule'); + } + + /** + * {@inheritdoc} + */ + public function getDescription() + { + return $this->translator->__('Display a single medium.', 'cmfcmfmediamodule'); + } + + /** + * {@inheritdoc} + */ + public function getDefaultData() + { + return [ + 'id' => null + ]; + } + + /** + * @inheritDoc + */ + public function getTranslatableDataFields() + { + return ['id']; + } + + /** + * {@inheritdoc} + */ + public function displayView() + { + $this->customInit(); + + $this->data = $this->getData(); + if (null === $this->data['id'] || empty($this->data['id'])) { + return ''; + } + + $medium = $this->mediaRepository->findOneBy(['id' => $this->data['id']]); + if (!$medium) { + return ''; + } + if (!$this->securityManager->hasPermission($medium, CollectionPermissionSecurityTree::PERM_LEVEL_MEDIA_DETAILS)) { + return ''; + } + + return $this->twig->render('@CmfcmfMediaModule/Media/displayRaw.html.twig', [ + 'mediaType' => $this->mediaTypeCollection->getMediaTypeFromEntity($medium), + 'entity' => $medium + ]); + } + + /** + * {@inheritdoc} + */ + public function displayEditing() + { + if (null === $this->data['id'] || empty($this->data['id'])) { + return $this->translator->__('No medium selected.', 'cmfcmfmediamodule'); + } + + return parent::displayEditing(); + } + + /** + * {@inheritdoc} + */ + public function getEditFormClass() + { + $this->customInit(); + + return FormType::class; + } + + /** + * @param EntityManagerInterface $em + */ + public function setEntityManager(EntityManagerInterface $em) + { + $this->mediaRepository = $em->getRepository('CmfcmfMediaModule:Media\AbstractMediaEntity'); + } + + /** + * @param SecurityManager $securityManager + */ + public function setSecurityManager(SecurityManager $securityManager) + { + $this->securityManager = $securityManager; + } + + /** + * @param MediaTypeCollection $mediaTypeCollection + */ + public function setMediaTypeCollection(MediaTypeCollection $mediaTypeCollection) + { + $this->mediaTypeCollection = $mediaTypeCollection; + } + + /** + * @param boolean $enableMediaViewCounter + */ + public function setEnableMediaViewCounter($enableMediaViewCounter) + { + $this->enableMediaViewCounter = $enableMediaViewCounter; + } + + private function customInit() + { + $this->bundleName = 'CmfcmfMediaModule'; + $this->domain = strtolower($this->bundleName); + + include_once __DIR__ . '/../bootstrap.php'; + } + + /** + * @inheritDoc + */ + public function getAssets($context) + { + $assets = parent::getAssets($context); + if (in_array($context, [ContentTypeInterface::CONTEXT_EDIT, ContentTypeInterface::CONTEXT_TRANSLATION])) { + $assets['js'][] = $this->assetHelper->resolve('@CmfcmfMediaModule:js/CmfcmfMediaModule.ContentType.Media.js'); + } + + return $assets; + } + + /** + * @inheritDoc + */ + public function getJsEntrypoint($context) + { + if (ContentTypeInterface::CONTEXT_EDIT == $context) { + return 'contentInitMediaEdit'; + } + if (ContentTypeInterface::CONTEXT_TRANSLATION == $context) { + return 'contentInitMediaTranslation'; + } + + return null; + } +} diff --git a/Controller/AbstractController.php b/Controller/AbstractController.php index 5aac365b..3314df42 100644 --- a/Controller/AbstractController.php +++ b/Controller/AbstractController.php @@ -13,8 +13,14 @@ use Symfony\Component\Form\Form; use Symfony\Component\Form\FormError; +use Zikula\Bundle\HookBundle\Hook\DisplayHook; use Zikula\Bundle\HookBundle\Hook\DisplayHookResponse; +use Zikula\Bundle\HookBundle\FormAwareHook\FormAwareHook; +use Zikula\Bundle\HookBundle\FormAwareHook\FormAwareResponse; use Zikula\Bundle\HookBundle\Hook\Hook; +use Zikula\Bundle\HookBundle\Hook\ProcessHook; +use Zikula\Bundle\HookBundle\Hook\ValidationHook; +use Zikula\Bundle\HookBundle\Hook\ValidationProviders; use Zikula\Core\Controller\AbstractController as BaseAbstractController; use Zikula\Core\UrlInterface; @@ -26,35 +32,35 @@ abstract class AbstractController extends BaseAbstractController /** * Notifies subscribers of the given hook. * - * @param Hook $hook + * @param string $name Hook event name + * @param Hook $hook Hook interface * * @return Hook */ - protected function notifyHooks(Hook $hook) + protected function dispatchHooks($name, Hook $hook) { - return $this->get('hook_dispatcher')->dispatch($hook->getName(), $hook); + return $this->get('hook_dispatcher')->dispatch($name, $hook); } /** * Get the display hook content for the given hook. * * @param string $name - * @param string $event + * @param string $hookType * @param string|null $id * @param UrlInterface|null $url * * @return string */ - protected function getDisplayHookContent($name, $event, $id = null, UrlInterface $url = null) + protected function getDisplayHookContent($name, $hookType, $id = null, UrlInterface $url = null) { - $eventName = "cmfcmfmediamodule.ui_hooks.$name.$event"; - $hook = new \Zikula_DisplayHook($eventName, $id, $url); + $eventName = 'cmfcmfmediamodule.ui_hooks.' . $name . '.' . $hookType; + $hook = new DisplayHook($id, $url); $this->get('hook_dispatcher')->dispatch($eventName, $hook); /** @var DisplayHookResponse[] $responses */ $responses = $hook->getResponses(); - $content = ""; - + $content = ''; foreach ($responses as $result) { $result = $result->__toString(); if (strlen(trim($result)) > 0) { @@ -62,44 +68,72 @@ protected function getDisplayHookContent($name, $event, $id = null, UrlInterface } } - return strlen($content) == 0 ? "" : "
\n$content
"; + return 0 == strlen($content) ? '' : "
\n$content
"; } /** * Applies process hooks. * * @param string $name - * @param string $event + * @param string $hookType * @param string $id * @param UrlInterface|null $url */ - protected function applyProcessHook($name, $event, $id, UrlInterface $url = null) + protected function applyProcessHook($name, $hookType, $id, UrlInterface $url = null) + { + $eventName = 'cmfcmfmediamodule.ui_hooks.' . $name . '.' . $hookType; + $hook = new ProcessHook($id, $url); + $this->dispatchHooks($eventName, $hook); + } + + /** + * Applies form aware display hooks. + * + * @param Form $form + * @param string $name + * @param string $hookType + * @param UrlInterface|null $url + */ + protected function applyFormAwareDisplayHook(Form $form, $name, $hookType, UrlInterface $url = null) { - /* @noinspection PhpParamsInspection */ - $this->notifyHooks(new \Zikula_ProcessHook( - "cmfcmfmediamodule.ui_hooks.$name.$event", - $id, - $url - )); + $eventName = 'cmfcmfmediamodule.form_aware_hook.' . $name . '.' . $hookType; + $hook = new FormAwareHook($form); + $this->dispatchHooks($eventName, $hook); + + return $hook; + } + + /** + * Applies form aware process hooks. + * + * @param Form $form + * @param string $name + * @param string $hookType + * @param object|array|string $formSubject + * @param UrlInterface|null $url + */ + protected function applyFormAwareProcessHook(Form $form, $name, $hookType, $formSubject, UrlInterface $url = null) + { + $formResponse = new FormAwareResponse($form, $formSubject, $url); + $eventName = 'cmfcmfmediamodule.form_aware_hook.' . $name . '.' . $hookType; + + $this->dispatchHooks($eventName, $formResponse); } /** * Checks whether or not the hook validates. * * @param string $name - * @param string $event + * @param string $hookType * * @return bool */ - protected function hookValidates($name, $event) + protected function hookValidates($name, $hookType) { - /* @noinspection PhpParamsInspection */ - $validationHook = new \Zikula_ValidationHook( - "cmfcmfmediamodule.ui_hooks.$name.$event", - new \Zikula_Hook_ValidationProviders() - ); - /** @var \Zikula\Bundle\HookBundle\Hook\ValidationProviders $hookvalidators */ - $hookvalidators = $this->notifyHooks($validationHook)->getValidators(); + $eventName = 'cmfcmfmediamodule.ui_hooks.' . $name . '.' . $hookType; + $validationHook = new ValidationHook(); + /** @var ValidationProviders $hookvalidators */ + $hookvalidators = $this->dispatchHooks($eventName, $validationHook)->getValidators(); return !$hookvalidators->hasErrors(); } @@ -109,7 +143,7 @@ protected function hookValidates($name, $event) * * @param Form $form */ - protected function hookValidationError($form) + protected function hookValidationError(Form $form) { $form->addError(new FormError($this->__('Hook validation failed!'))); } diff --git a/Controller/AdminController.php b/Controller/AdminController.php deleted file mode 100644 index 9865e43b..00000000 --- a/Controller/AdminController.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Cmfcmf\Module\MediaModule\Controller; - -/** - * @todo Remove this. This is just here for legacy reasons so that a link from the extensions - * list is provided. - */ -class AdminController extends \Zikula_AbstractController -{ - public function indexAction() - { - $url = $this->get('router')->generate('cmfcmfmediamodule_settings_index'); - $this->redirect($url); - } -} diff --git a/Controller/CollectionController.php b/Controller/CollectionController.php index 2d664df3..bcfb9f44 100644 --- a/Controller/CollectionController.php +++ b/Controller/CollectionController.php @@ -18,9 +18,6 @@ use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\OptimisticLockException; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\BinaryFileResponse; @@ -28,7 +25,10 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; +use Zikula\Bundle\HookBundle\Category\FormAwareCategory; +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; use Zikula\Core\Response\PlainResponse; use Zikula\Core\RouteUrl; @@ -37,7 +37,6 @@ class CollectionController extends AbstractController /** * @Route("/new/{slug}", requirements={"slug" = ".+"}) * @Template(template="CmfcmfMediaModule:Collection:edit.html.twig") - * @ParamConverter("parent", class="Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity", options={"slug" = "slug"}) * * @param Request $request * @param CollectionEntity $parent @@ -46,7 +45,7 @@ class CollectionController extends AbstractController */ public function newAction(Request $request, CollectionEntity $parent) { - if ($parent == null) { + if (null == $parent) { throw new NotFoundHttpException(); } $securityManager = $this->get('cmfcmf_media_module.security_manager'); @@ -54,15 +53,14 @@ public function newAction(Request $request, CollectionEntity $parent) throw new AccessDeniedException(); } - $templateCollection = $this->get('cmfcmf_media_module.collection_template_collection'); $entity = new CollectionEntity(); - $form = new CollectionType($templateCollection, $parent, $securityManager); - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity); + $form = $this->createForm(CollectionType::class, $entity, [ + 'parent' => $parent + ]); $form->handleRequest($request); if ($form->isValid()) { - if ($this->hookValidates('collection', 'validate_edit')) { + if ($this->hookValidates('collection', UiHooksCategory::TYPE_VALIDATE_EDIT)) { if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission($entity->getParent(), CollectionPermissionSecurityTree::PERM_LEVEL_ADD_SUB_COLLECTIONS)) { throw new AccessDeniedException($this->__('You don\'t have permission to add a sub-collection to the selected parent collection.')); } @@ -70,29 +68,27 @@ public function newAction(Request $request, CollectionEntity $parent) $em->persist($entity); $em->flush(); - $this->applyProcessHook('collection', 'process_edit', $entity->getId(), new RouteUrl( - 'cmfcmfmediamodule_collection_display', - ['slug' => $entity->getSlug()] - )); + $hookUrl = new RouteUrl('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]); + $this->applyFormAwareProcessHook($form, 'collection', FormAwareCategory::TYPE_PROCESS_EDIT, $entity, $hookUrl); + $this->applyProcessHook('collection', UiHooksCategory::TYPE_PROCESS_EDIT, $entity->getId(), $hookUrl); return $this->redirectToRoute('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]); } $this->hookValidationError($form); } + $formHook = $this->applyFormAwareDisplayHook($form, 'collections', FormAwareCategory::TYPE_EDIT); + return [ 'form' => $form->createView(), - 'hook' => $this->getDisplayHookContent( - 'collection', - 'form_edit' - ), + 'hook' => $this->getDisplayHookContent('collections', UiHooksCategory::TYPE_FORM_EDIT), + 'formHookTemplates' => $formHook->getTemplates() ]; } /** * @Route("/edit/{slug}", requirements={"slug" = ".+"}) - * @ParamConverter("entity", class="Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity", options={"slug" = "slug"}) - * @Template() + * @Template(template="CmfcmfMediaModule:Collection:edit.html.twig") * * @param Request $request * @param CollectionEntity $entity @@ -106,17 +102,16 @@ public function editAction(Request $request, CollectionEntity $entity) throw new AccessDeniedException(); } - $templateCollection = $this->get('cmfcmf_media_module.collection_template_collection'); - $form = new CollectionType($templateCollection, $entity->getParent(), $securityManager); - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity); + $form = $this->createForm(CollectionType::class, $entity, [ + 'parent' => $entity->getParent() + ]); $form->handleRequest($request); if (!$form->isValid()) { goto edit_error; } - if (!$this->hookValidates('collection', 'validate_edit')) { + if (!$this->hookValidates('collection', UiHooksCategory::TYPE_VALIDATE_EDIT)) { $this->hookValidationError($form); goto edit_error; } @@ -130,29 +125,26 @@ public function editAction(Request $request, CollectionEntity $entity) goto edit_error; } - $this->applyProcessHook('collection', 'process_edit', $entity->getId(), new RouteUrl( - 'cmfcmfmediamodule_collection_display', - ['slug' => $entity->getSlug()] - )); + $hookUrl = new RouteUrl('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]); + $this->applyFormAwareProcessHook($form, 'collection', FormAwareCategory::TYPE_PROCESS_EDIT, $entity, $hookUrl); + $this->applyProcessHook('collection', UiHooksCategory::TYPE_PROCESS_EDIT, $entity->getId(), $hookUrl); return $this->redirectToRoute('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]); edit_error: + $hookUrl = new RouteUrl('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]); + $formHook = $this->applyFormAwareDisplayHook($form, 'collections', FormAwareCategory::TYPE_EDIT, $hookUrl); + return [ 'form' => $form->createView(), - 'hook' => $this->getDisplayHookContent( - 'collection', - 'form_edit', - $entity->getId(), - new RouteUrl('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]) - ), + 'hook' => $this->getDisplayHookContent('collections', UiHooksCategory::TYPE_FORM_EDIT, $entity->getId(), $hookUrl), + 'formHookTemplates' => $formHook->getTemplates() ]; } /** * @Route("/download/{slug}.zip", requirements={"slug"=".+"}) - * @ParamConverter("entity", class="Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity", options={"slug" = "slug"}) * * @param CollectionEntity $entity * @@ -165,12 +157,19 @@ public function downloadAction(CollectionEntity $entity) } $em = $this->getDoctrine()->getManager(); - \CacheUtil::createLocalDir('CmfcmfMediaModule'); - $dir = \CacheUtil::getLocalDir('CmfcmfMediaModule'); - $path = $dir . '/' . uniqid(time(), true) . '.zip'; + $cacheDirectory = $this->get('service_container')->getParameter('kernel.cache_dir') . '/CmfCmfMediaModule/'; + $filesystem = $this->get('filesystem'); + if (!$filesystem->exists($cacheDirectory)) { + $filesystem->mkdir($cacheDirectory, 0777); + } + if (!$filesystem->exists($cacheDirectory)) { + $cacheDirectory = sys_get_temp_dir(); + } + + $path = $cacheDirectory . '/' . uniqid(time(), true) . '.zip'; $zip = new \ZipArchive(); - if ($zip->open($path, \ZipArchive::CREATE) !== true) { + if (true !== $zip->open($path, \ZipArchive::CREATE)) { throw new ServiceUnavailableHttpException('Could not create zip archive!'); } $mediaTypeCollection = $this->get('cmfcmf_media_module.media_type_collection'); @@ -245,8 +244,7 @@ public function reorderAction(Request $request) } /** - * @Route("") - * @Method("GET") + * @Route("", methods={"GET"}) * * @return RedirectResponse */ @@ -263,10 +261,27 @@ public function displayRootAction() } /** - * @Route("/{slug}", requirements={"slug"=".*[^/]"}, options={"expose" = true}) - * @ParamConverter("entity", class="Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity", options={"slug" = "slug"}) - * @Method("GET") - * @Template() + * @Route("/show-by-id/{id}", options={"expose" = true}) + * + * @param CollectionEntity $entity + * + * @return RedirectResponse + */ + public function displayByIdAction(CollectionEntity $entity) + { + if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission($entity, CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW)) { + throw new AccessDeniedException(); + } + + return $this->redirectToRoute( + 'cmfcmfmediamodule_collection_display', + ['slug' => $entity->getSlug()] + ); + } + + /** + * @Route("/{slug}", methods={"GET"}, requirements={"slug"=".*[^/]"}, options={"expose" = true}) + * @Template(template="CmfcmfMediaModule:Collection:display.html.twig") * * @param Request $request * @param CollectionEntity $entity @@ -279,10 +294,10 @@ public function displayAction(Request $request, CollectionEntity $entity) throw new AccessDeniedException(); } - if ($entity->getDefaultTemplate() != null) { + if (null !== $entity->getDefaultTemplate()) { $defaultTemplate = $entity->getDefaultTemplate(); } else { - $defaultTemplate = \ModUtil::getVar('CmfcmfMediaModule', 'defaultCollectionTemplate'); + $defaultTemplate = $this->getVar('defaultCollectionTemplate'); } $template = $request->query->get('template', $defaultTemplate); @@ -311,12 +326,7 @@ public function displayAction(Request $request, CollectionEntity $entity) ]; $hookUrl = new RouteUrl('cmfcmfmediamodule_collection_display', ['slug' => $entity->getSlug()]); - $templateVars['hook'] = $this->getDisplayHookContent( - 'collection', - 'display_view', - $entity->getId(), - $hookUrl - ); + $templateVars['hook'] = $this->getDisplayHookContent('collections', UiHooksCategory::TYPE_DISPLAY_VIEW, $entity->getId(), $hookUrl); $templateVars['renderRaw'] = $isHook = $request->query->get('isHook', false); $templateVars['content'] = $selectedTemplate->getTemplate()->render( @@ -328,23 +338,4 @@ public function displayAction(Request $request, CollectionEntity $entity) return $this->render('CmfcmfMediaModule:Collection:display.html.twig', $templateVars); } - - /** - * @Route("/show-by-id/{id}", options={"expose" = true}) - * - * @param CollectionEntity $entity - * - * @return RedirectResponse - */ - public function displayByIdAction(CollectionEntity $entity) - { - if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission($entity, CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW)) { - throw new AccessDeniedException(); - } - - return $this->redirectToRoute( - 'cmfcmfmediamodule_collection_display', - ['slug' => $entity->getSlug()] - ); - } } diff --git a/Controller/FinderController.php b/Controller/FinderController.php index ae237253..c3b548b5 100644 --- a/Controller/FinderController.php +++ b/Controller/FinderController.php @@ -14,10 +14,10 @@ use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; /** * @Route("/finder") @@ -26,7 +26,7 @@ class FinderController extends AbstractController { /** * @Route("/choose", options={"expose" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Finder:chooseMethod.html.twig") */ public function chooseMethodAction() { @@ -35,7 +35,7 @@ public function chooseMethodAction() /** * @Route("/popup/choose/collection", options={"expose" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Finder:popupChooseCollections.html.twig") */ public function popupChooseCollectionsAction() { @@ -44,7 +44,7 @@ public function popupChooseCollectionsAction() /** * @Route("/popup/choose/media", options={"expose" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Finder:popupChooseMedia.html.twig") */ public function popupChooseMediaAction() { @@ -91,7 +91,7 @@ public function ajaxFindAction(Request $request) return $entity->toArrayForFinder($mediaTypeCollection); }, $collectionResults); - return new JsonResponse([ + return $this->json([ 'media' => $mediaResults, 'collections' => $collectionResults ]); @@ -110,7 +110,7 @@ public function getCollectionsAction($parentId, $hookedObjectId = null) $securityManager = $this->get('cmfcmf_media_module.security_manager'); $mediaTypeCollection = $this->get('cmfcmf_media_module.media_type_collection'); - if ($hookedObjectId != null) { + if (null != $hookedObjectId) { $em = $this->getDoctrine()->getManager(); $hookedObjectEntity = $em ->find('CmfcmfMediaModule:HookedObject\HookedObjectEntity', $hookedObjectId); @@ -120,7 +120,7 @@ public function getCollectionsAction($parentId, $hookedObjectId = null) $qb = $securityManager ->getCollectionsWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW); - if ($parentId == '#') { + if ('#' == $parentId) { $qb->andWhere($qb->expr()->isNull('c.parent')); } else { $qb->andWhere($qb->expr()->eq('c.parent', ':parentId')) @@ -132,6 +132,6 @@ public function getCollectionsAction($parentId, $hookedObjectId = null) return $collection->toArrayForJsTree($mediaTypeCollection, $hookedObjectEntity); }, $collections); - return new JsonResponse($collections); + return $this->json($collections); } } diff --git a/Controller/ImportController.php b/Controller/ImportController.php index 3ec079d9..9d504adc 100644 --- a/Controller/ImportController.php +++ b/Controller/ImportController.php @@ -13,9 +13,9 @@ use Cmfcmf\Module\MediaModule\Form\ImportType; use Symfony\Component\HttpFoundation\Request; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Zikula\ThemeModule\Engine\Annotation\Theme; @@ -23,7 +23,7 @@ class ImportController extends AbstractController { /** * @Route("/import") - * @Template() + * @Template("CmfcmfMediaModule:Import:select.html.twig") * @Theme("admin") * * @return array @@ -43,7 +43,7 @@ public function selectAction() /** * @Route("/import/{importer}") - * @Template() + * @Template("CmfcmfMediaModule:Import:execute.html.twig") * @Theme("admin") * * @param Request $request @@ -62,18 +62,17 @@ public function executeAction(Request $request, $importer) throw new NotFoundHttpException(); } $importer = $importerCollection->getImporter($importer); - if ($importer->checkRequirements() !== true) { + if (true !== $importer->checkRequirements()) { throw new NotFoundHttpException(); } - $importType = new ImportType($importer->getSettingsForm(), $this->get('translator'), $this->get('cmfcmf_media_module.security_manager')); - $form = $this->createForm($importType); + $form = $this->createForm(ImportType::class, null, ['importerForm' => $importer->getSettingsForm()]); $form->handleRequest($request); if ($form->isValid()) { $success = $importer->import($form->getData(), $this->get('session')->getFlashBag()); - if ($success === true) { + if (true === $success) { $this->addFlash('status', $this->__('Media imported successfully.')); return $this->redirectToRoute('cmfcmfmediamodule_collection_display', ['slug' => $form->getData()['collection']->getSlug()]); diff --git a/Controller/LicenseController.php b/Controller/LicenseController.php index 947dec4b..248ba18b 100644 --- a/Controller/LicenseController.php +++ b/Controller/LicenseController.php @@ -14,13 +14,11 @@ use Cmfcmf\Module\MediaModule\Entity\License\LicenseEntity; use Cmfcmf\Module\MediaModule\Form\License\LicenseType; use Doctrine\ORM\OptimisticLockException; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; /** @@ -29,9 +27,8 @@ class LicenseController extends AbstractController { /** - * @Route("/") - * @Method("GET") - * @Template() + * @Route("/", methods={"GET"}) + * @Template("CmfcmfMediaModule:License:index.html.twig") * * @return array */ @@ -52,7 +49,7 @@ public function indexAction() /** * @Route("/new") - * @Template(template="CmfcmfMediaModule:License:edit.html.twig") + * @Template("CmfcmfMediaModule:License:edit.html.twig") * * @param Request $request * @@ -65,9 +62,7 @@ public function newAction(Request $request) } $entity = new LicenseEntity(null); - $form = new LicenseType(false); - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity); + $form = $this->createForm(LicenseType::class, $entity); $form->handleRequest($request); if ($form->isValid()) { @@ -85,8 +80,7 @@ public function newAction(Request $request) /** * @Route("/edit/{id}") - * @ParamConverter("entity", class="CmfcmfMediaModule:License\LicenseEntity") - * @Template() + * @Template("CmfcmfMediaModule:License:edit.html.twig") * * @param Request $request * @param LicenseEntity $entity @@ -99,9 +93,7 @@ public function editAction(Request $request, LicenseEntity $entity) throw new AccessDeniedException(); } - $form = new LicenseType(true); - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity); + $form = $this->createForm(LicenseType::class, $entity); $form->handleRequest($request); if ($form->isValid()) { @@ -123,8 +115,7 @@ public function editAction(Request $request, LicenseEntity $entity) /** * @Route("/delete/{id}") - * @ParamConverter("entity", class="CmfcmfMediaModule:License\LicenseEntity") - * @Template() + * @Template("CmfcmfMediaModule:License:delete.html.twig") * * @param Request $request * @param LicenseEntity $entity diff --git a/Controller/MediaController.php b/Controller/MediaController.php index cd6b9cf8..e4c67eab 100644 --- a/Controller/MediaController.php +++ b/Controller/MediaController.php @@ -14,7 +14,6 @@ use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractFileEntity; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; -use Cmfcmf\Module\MediaModule\Form\AbstractType; use Cmfcmf\Module\MediaModule\MediaType\MediaTypeInterface; use Cmfcmf\Module\MediaModule\MediaType\PasteMediaTypeInterface; use Cmfcmf\Module\MediaModule\MediaType\UploadableMediaTypeInterface; @@ -24,9 +23,7 @@ use Doctrine\ORM\NoResultException; use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\Tools\Pagination\Paginator; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\BinaryFileResponse; @@ -36,7 +33,10 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\ResponseHeaderBag; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; +use Zikula\Bundle\HookBundle\Category\FormAwareCategory; +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; use Zikula\Core\Response\PlainResponse; use Zikula\Core\RouteUrl; use Zikula\ThemeModule\Engine\Annotation\Theme; @@ -44,9 +44,8 @@ class MediaController extends AbstractController { /** - * @Route("/admin/media-list/{page}", requirements={"page" = "\d+"}) - * @Method("GET") - * @Template() + * @Route("/admin/media-list/{page}", methods={"GET"}, requirements={"page" = "\d+"}) + * @Template("CmfcmfMediaModule:Media:adminlist.html.twig") * @Theme("admin") * * @param int $page @@ -83,7 +82,7 @@ public function adminlistAction($page = 1) /** * @Route("/edit/{collectionSlug}/f/{slug}", requirements={"collectionSlug" = ".+?"}) * @ParamConverter("entity", class="CmfcmfMediaModule:Media\AbstractMediaEntity", options={"repository_method" = "findBySlugs", "map_method_signature" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Media:edit.html.twig") * * @param Request $request * @param AbstractMediaEntity $entity @@ -97,7 +96,7 @@ public function editAction(Request $request, AbstractMediaEntity $entity) $entity, CollectionPermissionSecurityTree::PERM_LEVEL_EDIT_MEDIA ); - $isTemporaryUploadCollection = $entity->getCollection()->getId() == CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID; + $isTemporaryUploadCollection = CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID == $entity->getCollection()->getId(); $justUploadedIds = $request->getSession()->get('cmfcmfmediamodule_just_uploaded', []); if (!$editPermission && !($isTemporaryUploadCollection && in_array($entity->getId(), $justUploadedIds))) { @@ -106,32 +105,30 @@ public function editAction(Request $request, AbstractMediaEntity $entity) $em = $this->getDoctrine()->getManager(); $parent = $request->query->get('parent', null); - if ($parent != null) { + if (null != $parent) { $parent = $em->getRepository('CmfcmfMediaModule:Collection\CollectionEntity')->findOneBy(['slug' => $parent]); } - $variableApi = $this->get('zikula_extensions_module.api.variable'); $mediaType = $this->get('cmfcmf_media_module.media_type_collection')->getMediaTypeFromEntity($entity); $form = $mediaType->getFormTypeClass(); - /** @var AbstractType $form */ - $form = new $form($securityManager, $variableApi, $em, false, $parent); - $form->setTranslator($this->get('translator')); + $formOptions = $mediaType->getFormOptions($entity); + $formOptions['parent'] = $parent; /** @var \Symfony\Component\Form\Form $form */ - $form = $this->createForm($form, $entity, $mediaType->getFormOptions($entity)); + $form = $this->createForm($form, $entity, $formOptions); $form->handleRequest($request); if (!$form->isValid()) { goto edit_error; } - if (!$this->hookValidates('media', 'validate_edit')) { + if (!$this->hookValidates('media', UiHooksCategory::TYPE_VALIDATE_EDIT)) { $this->hookValidationError($form); goto edit_error; } $uploadManager = $this->get('stof_doctrine_extensions.uploadable.manager'); $file = $form->has('file') ? $form->get('file')->getData() : null; - if ($file !== null) { + if (null !== $file) { if (!($mediaType instanceof UploadableMediaTypeInterface)) { // Attempt to upload a file for a non-upload media type. throw new NotFoundHttpException(); @@ -143,11 +140,10 @@ public function editAction(Request $request, AbstractMediaEntity $entity) $uploadManager->markEntityToUpload($entity, $file); - // Cleanup thumbnails - /** @var \SystemPlugin_Imagine_Manager $imagineManager */ - $imagineManager = $this->get('systemplugin.imagine.manager'); - $imagineManager->setModule('CmfcmfMediaModule'); - $imagineManager->removeObjectThumbs($entity->getImagineId()); + // Cleanup existing thumbnails + /** @var Liip\ImagineBundle\Imagine\Cache\CacheManager $imagineCacheManager */ + $imagineCacheManager = $this->get('liip_imagine.cache.manager'); + $imagineCacheManager->remove($entity->getPath(), ['thumbnail', 'cmfcmfmediamodule.custom_image_filter']); } try { @@ -158,13 +154,12 @@ public function editAction(Request $request, AbstractMediaEntity $entity) goto edit_error; } - $this->applyProcessHook('media', 'process_edit', $entity->getId(), new RouteUrl( - 'cmfcmfmediamodule_media_display', - [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ] - )); + $hookUrl = new RouteUrl('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); + $this->applyFormAwareProcessHook($form, 'media', FormAwareCategory::TYPE_PROCESS_EDIT, $entity, $hookUrl); + $this->applyProcessHook('media', UiHooksCategory::TYPE_PROCESS_EDIT, $entity->getId(), $hookUrl); $isPopup = $request->query->get('popup', false); if ($isPopup) { @@ -175,26 +170,25 @@ public function editAction(Request $request, AbstractMediaEntity $entity) edit_error: + $hookUrl = new RouteUrl('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); + $formHook = $this->applyFormAwareDisplayHook($form, 'media', FormAwareCategory::TYPE_EDIT, $hookUrl); + return [ 'form' => $form->createView(), + 'entity' => $entity, 'breadcrumbs' => $entity->getCollection()->getBreadcrumbs($this->get('router')), - 'hook' => $this->getDisplayHookContent( - 'media', - 'form_edit', - $entity->getId(), - new RouteUrl('cmfcmfmediamodule_media_display', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]) - ), - 'entity' => $entity + 'hook' => $this->getDisplayHookContent('media', UiHooksCategory::TYPE_FORM_EDIT, $entity->getId(), $hookUrl), + 'formHookTemplates' => $formHook->getTemplates() ]; } /** * @Route("/delete/{collectionSlug}/f/{slug}", requirements={"collectionSlug" = ".+?"}) - * @ParamConverter("entity", class="CmfcmfMediaModule:Media\AbstractMediaEntity", options={"repository_method"="findBySlugs", "map_method_signature"=true}) - * @Template() + * @ParamConverter("entity", class="CmfcmfMediaModule:Media\AbstractMediaEntity", options={"repository_method" = "findBySlugs", "map_method_signature" = true}) + * @Template("CmfcmfMediaModule:Media:delete.html.twig") * * @param Request $request * @param AbstractMediaEntity $entity @@ -211,7 +205,7 @@ public function deleteAction(Request $request, AbstractMediaEntity $entity) } if ($request->isMethod('POST')) { - if ($this->hookValidates('media', 'validate_delete')) { + if ($this->hookValidates('media', UiHooksCategory::TYPE_VALIDATE_DELETE)) { // Save entity id for use in hook event. It is set to null during the entitymanager flush. $id = $entity->getId(); @@ -221,44 +215,33 @@ public function deleteAction(Request $request, AbstractMediaEntity $entity) // @todo Delete file if appropriate. - $this->applyProcessHook( - 'media', - 'process_delete', - $id, - new RouteUrl('cmfcmfmediamodule_media_display', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]) - ); + $hookUrl = new RouteUrl('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); + $this->applyProcessHook('media', UiHooksCategory::TYPE_PROCESS_DELETE, $id, $hookUrl); return $this->redirectToRoute('cmfcmfmediamodule_collection_display', ['slug' => $entity->getCollection()->getSlug()]); } else { - /** @var \Zikula_Session $session */ - $session = $request->getSession(); - $session->getFlashbag()->add('error', $this->__('Hook validation failed!')); + $request->getSession()->getFlashbag()->add('error', $this->__('Hook validation failed!')); } } - $breadcrumbs = $entity->getCollection()->getBreadcrumbs($this->get('router')); + + $hookUrl = new RouteUrl('cmfcmfmediamodule_media_edit', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); return [ - 'breadcrumbs' => $breadcrumbs, 'entity' => $entity, - 'hook' => $this->getDisplayHookContent( - 'media', - 'form_delete', - $entity->getId(), - new RouteUrl('cmfcmfmediamodule_media_edit', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]) - ) + 'breadcrumbs' => $entity->getCollection()->getBreadcrumbs($this->get('router')), + 'hook' => $this->getDisplayHookContent('media', UiHooksCategory::TYPE_FORM_DELETE, $entity->getId(), $hookUrl) ]; } /** - * @Route("/media/new") - * @Method("GET") - * @Template() + * @Route("/media/new", methods={"GET"}) + * @Template("CmfcmfMediaModule:Media:new.html.twig") * * @param Request $request * @@ -278,7 +261,8 @@ public function newAction(Request $request) CollectionPermissionSecurityTree::PERM_LEVEL_ADD_MEDIA ) ->getQuery() - ->execute(); + ->execute() + ; return [ 'webMediaTypes' => $mediaTypeCollection->getWebMediaTypes(true), @@ -290,7 +274,7 @@ public function newAction(Request $request) /** * @Route("/media/create/{type}/{mediaType}/{collection}", options={"expose"=true}) - * @Template() + * @Template("CmfcmfMediaModule:Media:create.html.twig") * * @param Request $request * @param $type @@ -315,34 +299,26 @@ public function createAction(Request $request, $type, $mediaType, $collection = $entity = $this->getDefaultEntity($request, $type, $mediaType, $init, $collection); $form = $mediaType->getFormTypeClass(); - /** @var AbstractType $form */ - $form = new $form($securityManager, $variableApi, $em, true); - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity, $mediaType->getFormOptions($entity)); + $formOptions = $mediaType->getFormOptions($entity); + $formOptions['isCreation'] = true; /** @var \Symfony\Component\Form\Form $form */ + $form = $this->createForm($form, $entity, $mediaType->getFormOptions($entity)); $form->handleRequest($request); if ($form->isValid()) { - if ($this->hookValidates('media', 'validate_edit')) { - $em = $this->getDoctrine()->getManager(); + if ($this->hookValidates('media', UiHooksCategory::TYPE_VALIDATE_EDIT)) { $em->persist($entity); $em->flush(); - $this->applyProcessHook( - 'media', - 'process_edit', - $entity->getId(), - new RouteUrl('cmfcmfmediamodule_media_display', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]) - ); + $hookUrl = new RouteUrl('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); + $this->applyFormAwareProcessHook($form, 'media', FormAwareCategory::TYPE_PROCESS_EDIT, $entity, $hookUrl); + $this->applyProcessHook('media', UiHooksCategory::TYPE_PROCESS_EDIT, $entity->getId(), $hookUrl); if ($request->query->get('popup', false)) { - return $this->redirectToRoute( - 'cmfcmfmediamodule_media_popupembed', - ['id' => $entity->getId()] - ); + return $this->redirectToRoute('cmfcmfmediamodule_media_popupembed', ['id' => $entity->getId()]); } return $this->redirectToRoute('cmfcmfmediamodule_media_display', [ @@ -355,16 +331,12 @@ public function createAction(Request $request, $type, $mediaType, $collection = return [ 'form' => $form->createView(), - 'hook' => $this->getDisplayHookContent( - 'media', - 'form_edit' - ) + 'hook' => $this->getDisplayHookContent('media', UiHooksCategory::TYPE_FORM_EDIT) ]; } /** - * @Route("/media/ajax/matches-paste", options={"expose" = true}) - * @Method("POST") + * @Route("/media/ajax/matches-paste", methods={"POST"}, options={"expose" = true}) * * @param Request $request * @@ -375,7 +347,7 @@ public function matchesPasteAction(Request $request) $this->checkMediaCreationAllowed(); $pastedText = $request->request->get('pastedText', false); - if ($pastedText === false) { + if (false === $pastedText) { throw new NotFoundHttpException(); } @@ -393,7 +365,7 @@ public function matchesPasteAction(Request $request) return $b['score'] - $a['score']; }); - return new JsonResponse($matches); + return $this->json($matches); } /** @@ -430,8 +402,7 @@ public function reorderAction(Request $request) } /** - * @Route("/media/ajax/creation-results/web/{mediaType}", options={"expose"=true}) - * @Method("POST") + * @Route("/media/ajax/creation-results/web/{mediaType}", methods={"POST"}, options={"expose"=true}) * * @param Request $request * @@ -452,22 +423,21 @@ public function webCreationAjaxResultsAction(Request $request, $mediaType) throw new NotFoundHttpException(); } $q = $request->request->get('q', false); - if ($q === false) { + if (false === $q) { throw new NotFoundHttpException(); } $dropdownValue = $request->request->get('dropdownValue', null); - if ($dropdownValue == "") { + if ('' == $dropdownValue) { $dropdownValue = null; } - $results = $mediaType->getSearchResults($request, $q, $dropdownValue); + $results = $mediaType->getSearchResults($q, $dropdownValue); - return new JsonResponse($results); + return $this->json($results); } /** - * @Route("/media/ajax/get-media-type", options={"expose"=true}) - * @Method("POST") + * @Route("/media/ajax/get-media-type", methods={"POST"}, options={"expose"=true}) * * @param Request $request * @@ -479,7 +449,7 @@ public function getMediaTypeFromFileAction(Request $request) $mediaTypes = $this->get('cmfcmf_media_module.media_type_collection')->getUploadableMediaTypes(); $files = $request->request->get('files', false); - if ($files === false) { + if (false === $files) { throw new NotFoundHttpException(); } $result = []; @@ -496,7 +466,7 @@ public function getMediaTypeFromFileAction(Request $request) $selectedMediaType = $mediaType; } } - if ($selectedMediaType === null) { + if (null === $selectedMediaType) { $result[$c] = null; $notFound++; } else { @@ -509,7 +479,7 @@ public function getMediaTypeFromFileAction(Request $request) } } - return new JsonResponse([ + return $this->json([ 'result' => $result, 'multiple' => $multiple, 'notFound' => $notFound @@ -519,8 +489,7 @@ public function getMediaTypeFromFileAction(Request $request) /** * Endpoint for file uploads. * - * @Route("/media/upload", options={"expose"=true}) - * @Method("POST") + * @Route("/media/upload", methods={"POST"}, options={"expose"=true}) * * @param Request $request * @@ -537,11 +506,11 @@ public function uploadAction(Request $request) $em = $this->getDoctrine()->getManager(); $collection = $request->request->get('collection', null); - if ($collection == null) { + if (null == $collection) { $collection = CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID; } - if ($request->files->count() != 1) { + if (1 != $request->files->count()) { return new Response(null, Response::HTTP_BAD_REQUEST); } @@ -559,21 +528,23 @@ public function uploadAction(Request $request) $selectedMediaType = $mediaType; } } - if ($selectedMediaType === null) { + if (null === $selectedMediaType) { return new Response($this->__('File type not supported!'), Response::HTTP_FORBIDDEN); } + $dataDirectory = $this->get('service_container')->getParameter('datadir'); + /** @var AbstractFileEntity $entity */ $entity = $selectedMediaType->getEntityClass(); - $entity = new $entity(); + $entity = new $entity($this->get('request_stack'), $dataDirectory); - $variableApi = $this->get('zikula_extensions_module.api.variable'); $form = $selectedMediaType->getFormTypeClass(); - /** @var AbstractType $form */ - $form = new $form($securityManager, $variableApi, $em, true, null, true); - $form->setTranslator($this->get('translator')); + $formOptions = $mediaType->getFormOptions($entity); + $formOptions['isCreation'] = true; + $formOptions['allowTemporaryUploadCollection'] = true; + $formOptions['csrf_protection'] = false; /** @var \Symfony\Component\Form\Form $form */ - $form = $this->createForm($form, $entity, ['csrf_protection' => false]); + $form = $this->createForm($form, $entity, $formOptions); $form->remove('file'); $form->submit([ @@ -593,10 +564,10 @@ public function uploadAction(Request $request) $justUploadedIds[] = $entity->getId(); $request->getSession()->set('cmfcmfmediamodule_just_uploaded', $justUploadedIds); - return new JsonResponse([ + return $this->json([ 'msg' => $this->__('File uploaded!'), 'editUrl' => $this->generateUrl('cmfcmfmediamodule_media_edit', ['slug' => $entity->getSlug(), 'collectionSlug' => $entity->getCollection()->getSlug()]), - 'openNewTabAndEdit' => $collection == CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID + 'openNewTabAndEdit' => CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID == $collection ], Response::HTTP_OK); } catch (\Exception $e) { return new Response($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR); @@ -604,15 +575,35 @@ public function uploadAction(Request $request) } /** - * @Route("/media/popup-embed/{id}") - * @Template() - * @Method("GET") + * @Route("/media/popup-embed/{id}", methods={"GET"}) + * @Template("CmfcmfMediaModule:Media:popupEmbed.html.twig") + * + * @param Request $request + * @param AbstractMediaEntity $entity + * + * @return array + */ + public function popupEmbedAction(Request $request, AbstractMediaEntity $entity) + { + if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission( + $entity, + CollectionPermissionSecurityTree::PERM_LEVEL_MEDIA_DETAILS) + ) { + throw new AccessDeniedException(); + } + + return $this->getEmbedDataAction($request, $entity); + } + + /** + * @Route("/media/embed-data/{id}", methods={"GET"}, options={"expose"=true}) * + * @param Request $request * @param AbstractMediaEntity $entity * * @return array */ - public function popupEmbedAction(AbstractMediaEntity $entity) + public function getEmbedDataAction(Request $request, AbstractMediaEntity $entity) { if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission( $entity, @@ -623,27 +614,43 @@ public function popupEmbedAction(AbstractMediaEntity $entity) $mediaTypeCollection = $this->get('cmfcmf_media_module.media_type_collection'); + $class = get_class($entity); + $type = substr($class, strrpos($class, '\\') + 1, -strlen('Entity')); $mediaType = $mediaTypeCollection->getMediaTypeFromEntity($entity); - return [ + $preview = ''; + if ('Image' == $type) { + $preview = $mediaType->renderFullpage($entity); + } + + $result = [ + 'title' => $entity->getTitle(), + 'preview' => $preview, + 'slug' => $entity->getSlug(), 'embedCodes' => [ 'full' => $mediaType->getEmbedCode($entity, 'full'), 'medium' => $mediaType->getEmbedCode($entity, 'medium'), 'small' => $mediaType->getEmbedCode($entity, 'small') - ] + ], + 'collection' => $entity->getCollection() ]; + + if (!$request->isXmlHttpRequest()) { + return $result; + } + + return $this->json($result); } /** - * @Route("/download/{collectionSlug}/f/{slug}", requirements={"collectionSlug" = ".+?"}) - * @Method("GET") + * @Route("/download/{collectionSlug}/f/{slug}", methods={"GET"}, requirements={"collectionSlug" = ".+?"}, options={"expose"=true}) * @ParamConverter("entity", class="CmfcmfMediaModule:Media\AbstractFileEntity", options={"repository_method" = "findBySlugs", "map_method_signature" = true}) * * @param AbstractFileEntity $entity * * @return BinaryFileResponse */ - public function downloadAction(AbstractFileEntity $entity) + public function downloadAction(Request $request, AbstractFileEntity $entity) { if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission( $entity, @@ -667,16 +674,20 @@ public function downloadAction(AbstractFileEntity $entity) $mediaType = $mediaTypeCollection->getMediaTypeFromEntity($entity); $response = new BinaryFileResponse($mediaType->getOriginalWithWatermark($entity, 'path', false)); - $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $entity->getBeautifiedFileName()); + + if ($request->query->has('inline') && $request->query->get('inline', '0') == '1') { + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE, $entity->getBeautifiedFileName()); + } else { + $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $entity->getBeautifiedFileName()); + } return $response; } /** - * @Route("/{collectionSlug}/f/{slug}", requirements={"collectionSlug" = ".+?"}, options={"expose" = true}) - * @Method("GET") + * @Route("/{collectionSlug}/f/{slug}", methods={"GET"}, requirements={"collectionSlug" = ".+?"}, options={"expose" = true}) * @ParamConverter("entity", class="CmfcmfMediaModule:Media\AbstractMediaEntity", options={"repository_method" = "findBySlugs", "map_method_signature" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Media:display.html.twig") * * @param AbstractMediaEntity $entity * @@ -704,21 +715,17 @@ public function displayAction(AbstractMediaEntity $entity) } $mediaTypeCollection = $this->get('cmfcmf_media_module.media_type_collection'); + $hookUrl = new RouteUrl('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); return [ 'mediaType' => $mediaTypeCollection->getMediaTypeFromEntity($entity), 'entity' => $entity, - 'breadcrumbs' => $entity->getCollection()->getBreadcrumbs($this->get('router'), true), + 'breadcrumbs' => $entity->getCollection()->getBreadcrumbs($this->get('router'), true), 'views' => $this->getVar('enableMediaViewCounter', false) ? $entity->getViews() : '-1', - 'hook' => $this->getDisplayHookContent( - 'media', - 'display_view', - $entity->getId(), - new RouteUrl('cmfcmfmediamodule_media_display', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]) - ) + 'hook' => $this->getDisplayHookContent('media', UiHooksCategory::TYPE_DISPLAY_VIEW, $entity->getId(), $hookUrl) ]; } @@ -741,8 +748,9 @@ private function checkMediaCreationAllowed() private function getDefaultEntity(Request $request, $type, MediaTypeInterface $mediaType, $init, $collection) { if (!$init) { + $dataDirectory = $this->get('service_container')->getParameter('datadir'); $entity = $mediaType->getEntityClass(); - $entity = new $entity(); + $entity = new $entity($this->get('request_stack'), $dataDirectory); return $entity; } @@ -750,7 +758,7 @@ private function getDefaultEntity(Request $request, $type, MediaTypeInterface $m case 'web': try { /** @var MediaTypeInterface|WebMediaTypeInterface $mediaType */ - $entity = $mediaType->getEntityFromWeb($request); + $entity = $mediaType->getEntityFromWeb(); } catch (\Exception $e) { throw new NotFoundHttpException(); } @@ -766,7 +774,7 @@ private function getDefaultEntity(Request $request, $type, MediaTypeInterface $m default: throw new \LogicException(); } - if ($collection !== null) { + if (null !== $collection) { $entity->setCollection($this->getDoctrine()->getManager()->find('CmfcmfMediaModule:Collection\CollectionEntity', $collection)); } diff --git a/Controller/MediaTypeController.php b/Controller/MediaTypeController.php index dd34620b..92aa5034 100644 --- a/Controller/MediaTypeController.php +++ b/Controller/MediaTypeController.php @@ -22,12 +22,13 @@ use Google_Service_YouTube_Video; use Google_Service_YouTube_VideoSnippet; use Google_Service_YouTube_VideoStatus; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -38,7 +39,6 @@ class MediaTypeController extends AbstractController { /** * @Route("/youtube/upload/{id}") - * @ParamConverter() * * @param VideoEntity $entity * @param Request $request @@ -66,8 +66,6 @@ public function youtubeUploadAction(VideoEntity $entity, Request $request) ]); } - require_once __DIR__ . '/../vendor/autoload.php'; - $client = new Google_Client(); $client->setClientId($clientID); $client->setClientSecret($clientSecret); @@ -75,8 +73,6 @@ public function youtubeUploadAction(VideoEntity $entity, Request $request) $client->setRedirectUri( filter_var($this->generateUrl('cmfcmfmediamodule_mediatype_youtubeupload', ['id' => $entity->getId()], RouterInterface::ABSOLUTE_URL), FILTER_SANITIZE_URL)); - - // Define an object that will be used to make all API requests. $youtube = new Google_Service_YouTube($client); @@ -107,94 +103,93 @@ public function youtubeUploadAction(VideoEntity $entity, Request $request) END; return new Response($htmlBody); - } else { - $form = $this->buildYouTubeUploadForm($entity); - $form->handleRequest($request); - if (!$form->isValid()) { - return $this->render('CmfcmfMediaModule:MediaType:Video/youtubeUpload.html.twig', [ - 'entity' => $entity, - 'form' => $form->createView() - ]); - } + } - try { - $videoPath = $entity->getPath(); - - // Create a snippet with title, description, tags and category ID - // Create an asset resource and set its snippet metadata and type. - $snippet = $this->createVideoSnippet($entity); - - // Set the video's status to "public". Valid statuses are "public", - // "private" and "unlisted". - $status = new Google_Service_YouTube_VideoStatus(); - $status->privacyStatus = $form->getData()['privacyStatus']; - - // Associate the snippet and status objects with a new video resource. - $video = new Google_Service_YouTube_Video(); - $video->setSnippet($snippet); - $video->setStatus($status); - - // Specify the size of each chunk of data, in bytes. Set a higher value for - // reliable connection as fewer chunks lead to faster uploads. Set a lower - // value for better recovery on less reliable connections. - $chunkSizeBytes = 1 * 1024 * 1024; - - // Setting the defer flag to true tells the client to return a request which can be called - // with ->execute(); instead of making the API call immediately. - $client->setDefer(true); - - // Create a request for the API's videos.insert method to create and upload the video. - $insertRequest = $youtube->videos->insert("status,snippet", $video); - - // Create a MediaFileUpload object for resumable uploads. - $media = new Google_Http_MediaFileUpload( - $client, - $insertRequest, - $entity->getMimeType(), - null, - true, - $chunkSizeBytes - ); - $media->setFileSize(filesize($videoPath)); - - - // Read the media file and upload it chunk by chunk. - $status = false; - $handle = fopen($videoPath, "rb"); - while (!$status && !feof($handle)) { - $chunk = fread($handle, $chunkSizeBytes); - $status = $media->nextChunk($chunk); - } - - fclose($handle); - - // If you want to make other calls after the file upload, set setDefer back to false - $client->setDefer(false); - } catch (Google_Service_Exception $e) { - $this->addFlash('error', $this->get('translator')->trans('A Google service error occurred: %error%', ['%error%' => $e->getMessage()], 'cmfcmfmediamodule')); - - return $this->redirectToRoute('cmfcmfmediamodule_media_display', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]); - } catch (Google_Exception $e) { - $this->addFlash('error', $this->get('translator')->trans('A client error occurred: %error%', ['%error%' => $e->getMessage()], 'cmfcmfmediamodule')); - - return $this->redirectToRoute('cmfcmfmediamodule_media_display', [ - 'slug' => $entity->getSlug(), - 'collectionSlug' => $entity->getCollection()->getSlug() - ]); + $form = $this->buildYouTubeUploadForm($entity); + $form->handleRequest($request); + if (!$form->isValid()) { + return $this->render('CmfcmfMediaModule:MediaType:Video/youtubeUpload.html.twig', [ + 'entity' => $entity, + 'form' => $form->createView() + ]); + } + + try { + $videoPath = $entity->getPath(); + + // Create a snippet with title, description, tags and category ID + // Create an asset resource and set its snippet metadata and type. + $snippet = $this->createVideoSnippet($entity, $request->getLocale()); + + // Set the video's status to "public". Valid statuses are "public", + // "private" and "unlisted". + $status = new Google_Service_YouTube_VideoStatus(); + $status->privacyStatus = $form->getData()['privacyStatus']; + + // Associate the snippet and status objects with a new video resource. + $video = new Google_Service_YouTube_Video(); + $video->setSnippet($snippet); + $video->setStatus($status); + + // Specify the size of each chunk of data, in bytes. Set a higher value for + // reliable connection as fewer chunks lead to faster uploads. Set a lower + // value for better recovery on less reliable connections. + $chunkSizeBytes = 1 * 1024 * 1024; + + // Setting the defer flag to true tells the client to return a request which can be called + // with ->execute(); instead of making the API call immediately. + $client->setDefer(true); + + // Create a request for the API's videos.insert method to create and upload the video. + $insertRequest = $youtube->videos->insert('status,snippet', $video); + + // Create a MediaFileUpload object for resumable uploads. + $media = new Google_Http_MediaFileUpload( + $client, + $insertRequest, + $entity->getMimeType(), + null, + true, + $chunkSizeBytes + ); + $media->setFileSize(filesize($videoPath)); + + // Read the media file and upload it chunk by chunk. + $status = false; + $handle = fopen($videoPath, 'rb'); + while (!$status && !feof($handle)) { + $chunk = fread($handle, $chunkSizeBytes); + $status = $media->nextChunk($chunk); } - $request->getSession()->set('cmfcmfmediamodule_youtube_oauth_token', $client->getAccessToken()); + fclose($handle); - $this->addFlash('status', $this->get('translator')->trans('Your video was successfully uploaded.', [], 'cmfcmfmediamodule')); + // If you want to make other calls after the file upload, set setDefer back to false + $client->setDefer(false); + } catch (Google_Service_Exception $e) { + $this->addFlash('error', $this->get('translator')->trans('A Google service error occurred: %error%', ['%error%' => $e->getMessage()], 'cmfcmfmediamodule')); + + return $this->redirectToRoute('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); + } catch (Google_Exception $e) { + $this->addFlash('error', $this->get('translator')->trans('A client error occurred: %error%', ['%error%' => $e->getMessage()], 'cmfcmfmediamodule')); return $this->redirectToRoute('cmfcmfmediamodule_media_display', [ 'slug' => $entity->getSlug(), 'collectionSlug' => $entity->getCollection()->getSlug() ]); } + + $request->getSession()->set('cmfcmfmediamodule_youtube_oauth_token', $client->getAccessToken()); + + $this->addFlash('status', $this->get('translator')->trans('Your video was successfully uploaded.', [], 'cmfcmfmediamodule')); + + return $this->redirectToRoute('cmfcmfmediamodule_media_display', [ + 'slug' => $entity->getSlug(), + 'collectionSlug' => $entity->getCollection()->getSlug() + ]); } /** @@ -206,14 +201,14 @@ private function buildYouTubeUploadForm(VideoEntity $entity) { $builder = $this->createFormBuilder(); $builder - ->add('privacyStatus', 'choice', [ + ->add('privacyStatus', ChoiceType::class, [ 'choices' => [ - 'public' => $this->get('translator')->trans('Public', [], 'cmfcmfmediamodule'), - 'unlisted' => $this->get('translator')->trans('Unlisted', [], 'cmfcmfmediamodule'), - 'private' => $this->get('translator')->trans('Private', [], 'cmfcmfmediamodule') + $this->get('translator')->trans('Public', [], 'cmfcmfmediamodule') => 'public', + $this->get('translator')->trans('Unlisted', [], 'cmfcmfmediamodule') => 'unlisted', + $this->get('translator')->trans('Private', [], 'cmfcmfmediamodule') => 'private' ] ]) - ->add('submit', 'submit', []) + ->add('submit', SubmitType::class, []) ->setAction($this->generateUrl('cmfcmfmediamodule_mediatype_youtubeupload', ['id' => $entity->getId()])); return $builder->getForm(); @@ -221,22 +216,17 @@ private function buildYouTubeUploadForm(VideoEntity $entity) /** * @param VideoEntity $entity + * @param string $locale * * @return Google_Service_YouTube_VideoSnippet */ - private function createVideoSnippet(VideoEntity $entity) + private function createVideoSnippet(VideoEntity $entity, $locale = 'en') { $snippet = new Google_Service_YouTube_VideoSnippet(); $snippet->setTitle($entity->getTitle()); $snippet->setDescription($entity->getDescription()); - $snippet->setTags($entity->getCategoryAssignments()->map(function (MediaCategoryAssignmentEntity $assignment) { - $lang = \ZLanguage::getLanguageCode(); - $displayNames = $assignment->getCategory()->getDisplay_name(); - if (isset($displayNames[$lang])) { - return $displayNames[$lang]; - } - - return $displayNames['en']; + $snippet->setTags($entity->getCategoryAssignments()->map(function (MediaCategoryAssignmentEntity $assignment) use ($locale) { + return $assignment->getCategory()->getDisplay_name($locale); })); // Numeric video category. See // https://developers.google.com/youtube/v3/docs/videoCategories/list diff --git a/Controller/PermissionController.php b/Controller/PermissionController.php index 0b700f1f..e6a439ec 100644 --- a/Controller/PermissionController.php +++ b/Controller/PermissionController.php @@ -14,13 +14,11 @@ use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\AbstractPermissionEntity; use Cmfcmf\Module\MediaModule\Exception\InvalidPositionException; -use Cmfcmf\Module\MediaModule\Form\AbstractType; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\Query\Expr; use Doctrine\ORM\QueryBuilder; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\JsonResponse; @@ -28,6 +26,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Zikula\Core\Response\PlainResponse; @@ -38,8 +37,7 @@ class PermissionController extends AbstractController { /** * @Route("/show/{slug}", requirements={"slug" = ".+?"}) - * @ParamConverter("collectionEntity", class="Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity", options={"slug" = "slug"}) - * @Template() + * @Template("CmfcmfMediaModule:Permission:view.html.twig") * * @param Request $request * @param CollectionEntity $collectionEntity @@ -65,14 +63,14 @@ public function viewAction(Request $request, CollectionEntity $collectionEntity) 'entities' => $entities, 'collection' => $collectionEntity, 'collectionPermissionTypeContainer' => $collectionPermissionTypeContainer, - 'userId' => \UserUtil::getVar('uid'), + 'userId' => $this->get('zikula_users_module.current_user')->get('uid'), 'highlight' => $request->query->get('highlight', null) ]; } /** * @Route("/new/{type}/{collection}/{afterPermission}", options={"expose"="true"}) - * @Template(template="CmfcmfMediaModule:Permission:edit.html.twig") + * @Template("CmfcmfMediaModule:Permission:edit.html.twig") * * @param Request $request * @param $type @@ -92,25 +90,23 @@ public function newAction(Request $request, $type, CollectionEntity $collection, throw new NotFoundHttpException(); } + $dataDirectory = $this->get('service_container')->getParameter('datadir'); + $entity = $permissionType->getEntityClass(); - $entity = new $entity(); + $entity = new $entity($this->get('request_stack'), $dataDirectory); $form = $permissionType->getFormClass(); - /** @var AbstractType $form */ - $form = new $form( - $collection, - $this->get('cmfcmf_media_module.security_manager'), - $permissionLevel - ); - $form->setTranslator($this->get('translator')); /** @var \Symfony\Component\Form\Form $form */ - $form = $this->createForm($form, $entity); + $form = $this->createForm($form, $entity, [ + 'collection' => $collection, + 'permissionLevel' => $permissionLevel + ]); $form->handleRequest($request); /** @var AbstractPermissionEntity $entity */ $entity->setCollection($collection); $entity->setPosition($afterPermission->getPosition() + 1); - if ($permissionLevel == CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS) { + if (CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS == $permissionLevel) { $entity->setGoOn(true); } @@ -128,13 +124,15 @@ public function newAction(Request $request, $type, CollectionEntity $collection, ]); } - return ['form' => $form->createView(), 'collection' => $collection]; + return [ + 'form' => $form->createView(), + 'collection' => $collection + ]; } /** * @Route("/edit/{id}") - * @ParamConverter("entity", class="CmfcmfMediaModule:Collection\Permission\AbstractPermissionEntity") - * @Template() + * @Template("CmfcmfMediaModule:Permission:edit.html.twig") * * @param Request $request * @param AbstractPermissionEntity $permissionEntity @@ -150,15 +148,11 @@ public function editAction(Request $request, AbstractPermissionEntity $permissio ->getCollectionPermissionFromEntity($permissionEntity) ->getFormClass(); - /** @var AbstractType $form */ - $form = new $form( - $permissionEntity->getCollection(), - $this->get('cmfcmf_media_module.security_manager'), - $permissionLevel - ); - $form->setTranslator($this->get('translator')); /** @var \Symfony\Component\Form\Form $form */ - $form = $this->createForm($form, $permissionEntity); + $form = $this->createForm($form, $permissionEntity, [ + 'collection' => $permissionEntity->getCollection(), + 'permissionLevel' => $permissionLevel + ]); $form->handleRequest($request); if (!$form->isValid()) { @@ -188,8 +182,7 @@ public function editAction(Request $request, AbstractPermissionEntity $permissio /** * @Route("/delete/{id}") - * @ParamConverter("permissionEntity", class="CmfcmfMediaModule:Collection\Permission\AbstractPermissionEntity") - * @Template() + * @Template("CmfcmfMediaModule:Permission:delete.html.twig") * * @param Request $request * @param AbstractPermissionEntity $permissionEntity @@ -244,7 +237,7 @@ public function reorderAction( try { $this->getPermissionLevelOrException($permissionEntity->getCollection(), $permissionEntity); } catch (AccessDeniedException $e) { - return new JsonResponse([], JsonResponse::HTTP_FORBIDDEN); + return $this->json([], JsonResponse::HTTP_FORBIDDEN); } $repository = $this->getDoctrine()->getRepository( @@ -262,16 +255,16 @@ public function reorderAction( try { $repository->save($permissionEntity, false); } catch (OptimisticLockException $e) { - return new JsonResponse(['error' => $this->__( + return $this->json(['error' => $this->__( 'Someone modified a permission rule. Please reload the page and try again!' )], Response::HTTP_FORBIDDEN); } catch (InvalidPositionException $e) { - return new JsonResponse(['error' => $this->__( + return $this->json(['error' => $this->__( 'You cannot move the permission rule to this position!' )], Response::HTTP_FORBIDDEN); } - return new JsonResponse(['newVersion' => $permissionEntity->getVersion()]); + return $this->json(['newVersion' => $permissionEntity->getVersion()]); } /** @@ -317,10 +310,10 @@ private function getPermissionLevelOrException( if ($securityManager->hasPermission($collectionEntity, CollectionPermissionSecurityTree::PERM_LEVEL_CHANGE_PERMISSIONS)) { return CollectionPermissionSecurityTree::PERM_LEVEL_CHANGE_PERMISSIONS; } - if ($permissionEntity == null) { + if (null === $permissionEntity) { throw new AccessDeniedException(); } - if ($permissionEntity->getCreatedUserId() == \UserUtil::getVar('uid')) { + if ($permissionEntity->getCreatedBy()->getUid() == $this->get('zikula_users_module.current_user')->get('uid')) { if ($securityManager->hasPermission($collectionEntity, CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS)) { return CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS; } diff --git a/Controller/SettingsController.php b/Controller/SettingsController.php index 3e61e12c..64bd3701 100644 --- a/Controller/SettingsController.php +++ b/Controller/SettingsController.php @@ -13,12 +13,12 @@ use Cmfcmf\Module\MediaModule\Form\SettingsType; use Cmfcmf\Module\MediaModule\Helper\PHPIniHelper; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser; use Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Zikula\ThemeModule\Engine\Annotation\Theme; @@ -39,7 +39,7 @@ public function indexAction() /** * @Route("/requirements") - * @Template() + * @Template("CmfcmfMediaModule:Settings:requirements.html.twig") * @Theme("admin") */ public function requirementsAction() @@ -74,7 +74,6 @@ public function requirementsAction() ['%size%' => PHPIniHelper::formatFileSize($maxUploadSize)], 'cmfcmfmediamodule'), ]; - $highMemoryRequired = false; try { new \Imagine\Imagick\Imagine(); @@ -180,7 +179,7 @@ public function requirementsAction() /** * @Route("/general", options={"expose" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Settings:general.html.twig") * @Theme("admin") * * @param Request $request @@ -191,23 +190,13 @@ public function generalAction(Request $request) { $this->ensurePermission(); - $collectionTemplateCollection = $this->get( - 'cmfcmf_media_module.collection_template_collection'); - $translator = $this->get('translator'); - $variableApi = $this->get('zikula_extensions_module.api.variable'); - - $form = $this->createForm(new SettingsType( - $translator, - $variableApi, - $collectionTemplateCollection->getCollectionTemplateTitles() - ) - ); + $form = $this->createForm(SettingsType::class); $form->handleRequest($request); if ($form->isValid()) { $data = $form->getData(); foreach ($data as $name => $value) { - \ModUtil::setVar('CmfcmfMediaModule', $name, $value); + $this->setVar($name, $value); } $this->addFlash('status', $this->__('Settings saved!')); } @@ -219,7 +208,7 @@ public function generalAction(Request $request) /** * @Route("/scribite", options={"expose" = true}) - * @Template() + * @Template("CmfcmfMediaModule:Settings:scribite.html.twig") * @Theme("admin") * * @return array @@ -228,26 +217,23 @@ public function scribiteAction() { $this->ensurePermission(); - $scribiteInstalled = \ModUtil::available('Scribite'); + $scribiteInstalled = $this->get('kernel')->isBundle('ZikulaScribiteModule'); $descriptionEscapingStrategyForCollectionOk = true; $descriptionEscapingStrategyForMediaOk = true; if ($scribiteInstalled) { - $mediaBinding = $this->get('hook_dispatcher')->getBindingBetweenAreas( - "subscriber.cmfcmfmediamodule.ui_hooks.media", - "provider.scribite.ui_hooks.editor"); - $collectionBinding = $this->get('hook_dispatcher')->getBindingBetweenAreas( - "subscriber.cmfcmfmediamodule.ui_hooks.collection", - "provider.scribite.ui_hooks.editor"); + $hookDispatcher = $this->get('hook_dispatcher'); + $mediaBinding = $hookDispatcher->getBindingBetweenAreas( + 'subscriber.cmfcmfmediamodule.ui_hooks.media', + 'provider.zikulascribitemodule.ui_hooks.editor'); + $collectionBinding = $hookDispatcher->getBindingBetweenAreas( + 'subscriber.cmfcmfmediamodule.ui_hooks.collections', + 'provider.zikulascribitemodule.ui_hooks.editor'); $descriptionEscapingStrategyForCollectionOk = !is_object($collectionBinding) - || \ModUtil::getVar( - 'CmfcmfMediaModule', - 'descriptionEscapingStrategyForCollection') == 'raw'; + || 'raw' == $this->getVar('descriptionEscapingStrategyForCollection'); $descriptionEscapingStrategyForMediaOk = !is_object($mediaBinding) - || \ModUtil::getVar( - 'CmfcmfMediaModule', - 'descriptionEscapingStrategyForMedia') == 'raw'; + || 'raw' == $this->getVar('descriptionEscapingStrategyForMedia'); } return [ diff --git a/Controller/UpgradeController.php b/Controller/UpgradeController.php index 4207aea5..6d8ec89a 100644 --- a/Controller/UpgradeController.php +++ b/Controller/UpgradeController.php @@ -13,10 +13,10 @@ use Cmfcmf\Module\MediaModule\Exception\UpgradeFailedException; use Cmfcmf\Module\MediaModule\Exception\UpgradeNotRequiredException; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\RedirectResponse; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Zikula\ThemeModule\Engine\Annotation\Theme; @@ -24,7 +24,7 @@ class UpgradeController extends AbstractController { /** * @Route("/settings/upgrade") - * @Template() + * @Template("CmfcmfMediaModule:Upgrade:doUpgrade.html.twig") * @Theme("admin") * * @return array|RedirectResponse @@ -35,7 +35,7 @@ public function doUpgradeAction() throw new AccessDeniedException(); } - $hasPermission = \SecurityUtil::checkPermission('ZikulaExtensionsModule::', '::', ACCESS_ADMIN); + $hasPermission = $this->hasPermission('ZikulaExtensionsModule::', '::', ACCESS_ADMIN); $upgrader = $this->get('cmfcmf_media_module.upgrade.module_upgrader'); return [ @@ -69,7 +69,7 @@ public function ajaxAction($step) $this->resetUpgradeMessage(); } - return new JsonResponse([ + return $this->json([ 'proceed' => true, 'message' => null, 'done' => $upgradeDone @@ -77,19 +77,19 @@ public function ajaxAction($step) } catch (UpgradeNotRequiredException $e) { $this->resetUpgradeMessage(); - return new JsonResponse([ + return $this->json([ 'proceed' => false, 'message' => $e->getMessage(), 'done' => false ]); } catch (UpgradeFailedException $e) { - return new JsonResponse([ + return $this->json([ 'proceed' => false, 'message' => $e->getMessage(), 'done' => false ]); } catch (\Exception $e) { - return new JsonResponse([ + return $this->json([ 'proceed' => false, 'message' => $this->get('translator')->trans( 'Something unexpected happened. Please report this problem and give the following information: %s', @@ -102,7 +102,7 @@ public function ajaxAction($step) private function resetUpgradeMessage() { - \ModUtil::setVar('CmfcmfMediaModule', 'newVersionAvailable', false); - \ModUtil::setVar('CmfcmfMediaModule', 'lastNewVersionCheck', 0); + $this->setVar('newVersionAvailable', false); + $this->setVar('lastNewVersionCheck', 0); } } diff --git a/Controller/WatermarkController.php b/Controller/WatermarkController.php index c364fc54..8966a2a2 100644 --- a/Controller/WatermarkController.php +++ b/Controller/WatermarkController.php @@ -19,15 +19,13 @@ use Cmfcmf\Module\MediaModule\Form\Watermark\TextWatermarkType; use Doctrine\ORM\OptimisticLockException; use Gedmo\Uploadable\Uploadable; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; +use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Exception\AccessDeniedException; /** @@ -36,9 +34,8 @@ class WatermarkController extends AbstractController { /** - * @Route("/") - * @Method("GET") - * @Template() + * @Route("/", methods={"GET"}) + * @Template("CmfcmfMediaModule:Watermark:index.html.twig") */ public function indexAction() { @@ -55,7 +52,7 @@ public function indexAction() /** * @Route("/new/{type}", requirements={"type"="image|text"}) - * @Template(template="CmfcmfMediaModule:Watermark:edit.html.twig") + * @Template("CmfcmfMediaModule:Watermark:edit.html.twig") * * @param Request $request * @param $type @@ -67,18 +64,18 @@ public function newAction(Request $request, $type) if (!$this->get('cmfcmf_media_module.security_manager')->hasPermission('watermark', 'new')) { throw new AccessDeniedException(); } - if ($type == 'image') { - $entity = new ImageWatermarkEntity(); - $form = new ImageWatermarkType(); - } elseif ($type == 'text') { - $entity = new TextWatermarkEntity(); - $form = new TextWatermarkType(); + $dataDirectory = $this->get('service_container')->getParameter('datadir'); + if ('image' == $type) { + $entity = new ImageWatermarkEntity($this->get('request_stack'), $dataDirectory); + $form = ImageWatermarkType::class; + } elseif ('text' == $type) { + $entity = new TextWatermarkEntity($this->get('request_stack'), $dataDirectory); + $form = TextWatermarkType::class; } else { throw new NotFoundHttpException(); } - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity); + $form = $this->createForm($form, $entity, ['entity' => $entity]); $form->handleRequest($request); if ($form->isValid()) { @@ -104,8 +101,7 @@ public function newAction(Request $request, $type) /** * @Route("/edit/{id}") - * @ParamConverter("entity", class="CmfcmfMediaModule:Watermark\AbstractWatermarkEntity") - * @Template() + * @Template("CmfcmfMediaModule:Watermark:edit.html.twig") * * @param Request $request * @param AbstractWatermarkEntity $entity @@ -119,15 +115,14 @@ public function editAction(Request $request, AbstractWatermarkEntity $entity) } if ($entity instanceof ImageWatermarkEntity) { - $form = new ImageWatermarkType($entity); + $form = ImageWatermarkType::class; } elseif ($entity instanceof TextWatermarkEntity) { - $form = new TextWatermarkType(); + $form = TextWatermarkType::class; } else { throw new \LogicException(); } - $form->setTranslator($this->get('translator')); - $form = $this->createForm($form, $entity); + $form = $this->createForm($form, $entity, ['entity' => $entity]); $form->handleRequest($request); if (!$form->isValid()) { @@ -138,7 +133,7 @@ public function editAction(Request $request, AbstractWatermarkEntity $entity) if ($entity instanceof Uploadable) { /** @var UploadedFile $file */ $file = $form->get('file')->getData(); - if ($file !== null && $file->isValid()) { + if (null !== $file && $file->isValid()) { // If the file is invalid, it means that no new file has been selected // to replace the already uploaded file. $manager = $this->get('stof_doctrine_extensions.uploadable.manager'); @@ -154,14 +149,13 @@ public function editAction(Request $request, AbstractWatermarkEntity $entity) goto edit_error; } - // Cleanup existing thumbnails. - /** @var \SystemPlugin_Imagine_Manager $imagineManager */ - $imagineManager = $this->get('systemplugin.imagine.manager'); - $imagineManager->setModule('CmfcmfMediaModule'); + // Cleanup existing thumbnails + /** @var Liip\ImagineBundle\Imagine\Cache\CacheManager $imagineCacheManager */ + $imagineCacheManager = $this->get('liip_imagine.cache.manager'); /** @var WatermarkRepository $repository */ $repository = $em->getRepository('CmfcmfMediaModule:Watermark\AbstractWatermarkEntity'); - $repository->cleanupThumbs($entity, $imagineManager); + $repository->cleanupThumbs($entity, $imagineCacheManager); $this->addFlash('status', $this->__('Watermark updated!')); @@ -174,8 +168,7 @@ public function editAction(Request $request, AbstractWatermarkEntity $entity) /** * @Route("/delete/{id}") - * @ParamConverter("entity", class="CmfcmfMediaModule:Watermark\AbstractWatermarkEntity") - * @Template() + * @Template("CmfcmfMediaModule:Watermark:delete.html.twig") * * @param Request $request * @param AbstractWatermarkEntity $entity @@ -192,14 +185,15 @@ public function deleteAction(Request $request, AbstractWatermarkEntity $entity) return ['entity' => $entity]; } - // Cleanup existing thumbnails. - /** @var \SystemPlugin_Imagine_Manager $imagineManager */ - $imagineManager = $this->get('systemplugin.imagine.manager'); - $imagineManager->setModule('CmfcmfMediaModule'); - $em = $this->getDoctrine()->getManager(); + + // Cleanup existing thumbnails + /** @var Liip\ImagineBundle\Imagine\Cache\CacheManager $imagineCacheManager */ + $imagineCacheManager = $this->get('liip_imagine.cache.manager'); + + /** @var WatermarkRepository $repository */ $repository = $em->getRepository('CmfcmfMediaModule:Watermark\AbstractWatermarkEntity'); - $repository->cleanupThumbs($entity, $imagineManager); + $repository->cleanupThumbs($entity, $imagineCacheManager); $em->remove($entity); $em->flush(); diff --git a/DependencyInjection/CollectionPermissionCompilerPass.php b/DependencyInjection/Compiler/CollectionPermissionCompilerPass.php similarity index 94% rename from DependencyInjection/CollectionPermissionCompilerPass.php rename to DependencyInjection/Compiler/CollectionPermissionCompilerPass.php index 70405a8b..30d7c2c3 100644 --- a/DependencyInjection/CollectionPermissionCompilerPass.php +++ b/DependencyInjection/Compiler/CollectionPermissionCompilerPass.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\DependencyInjection; +namespace Cmfcmf\Module\MediaModule\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/DependencyInjection/CollectionTemplateCompilerPass.php b/DependencyInjection/Compiler/CollectionTemplateCompilerPass.php similarity index 94% rename from DependencyInjection/CollectionTemplateCompilerPass.php rename to DependencyInjection/Compiler/CollectionTemplateCompilerPass.php index 59e3c512..014882ef 100644 --- a/DependencyInjection/CollectionTemplateCompilerPass.php +++ b/DependencyInjection/Compiler/CollectionTemplateCompilerPass.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\DependencyInjection; +namespace Cmfcmf\Module\MediaModule\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/DependencyInjection/FontCompilerPass.php b/DependencyInjection/Compiler/FontCompilerPass.php similarity index 88% rename from DependencyInjection/FontCompilerPass.php rename to DependencyInjection/Compiler/FontCompilerPass.php index 02101a26..bbf46341 100644 --- a/DependencyInjection/FontCompilerPass.php +++ b/DependencyInjection/Compiler/FontCompilerPass.php @@ -9,14 +9,14 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\DependencyInjection; +namespace Cmfcmf\Module\MediaModule\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; /** - * Calls "add_FontLoader" for each font loader on the font collection. + * Calls "addFontLoader" for each font loader on the font collection. */ class FontCompilerPass implements CompilerPassInterface { diff --git a/DependencyInjection/ImporterCompilerPass.php b/DependencyInjection/Compiler/ImporterCompilerPass.php similarity index 87% rename from DependencyInjection/ImporterCompilerPass.php rename to DependencyInjection/Compiler/ImporterCompilerPass.php index 992cf0f0..751b31c1 100644 --- a/DependencyInjection/ImporterCompilerPass.php +++ b/DependencyInjection/Compiler/ImporterCompilerPass.php @@ -9,12 +9,15 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\DependencyInjection; +namespace Cmfcmf\Module\MediaModule\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\Reference; +/** + * Calls "addImporter" for each importer on the importer collection. + */ class ImporterCompilerPass implements CompilerPassInterface { public function process(ContainerBuilder $container) diff --git a/DependencyInjection/MediaTypeCompilerPass.php b/DependencyInjection/Compiler/MediaTypeCompilerPass.php similarity index 94% rename from DependencyInjection/MediaTypeCompilerPass.php rename to DependencyInjection/Compiler/MediaTypeCompilerPass.php index 7fc9c488..4206997f 100644 --- a/DependencyInjection/MediaTypeCompilerPass.php +++ b/DependencyInjection/Compiler/MediaTypeCompilerPass.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\DependencyInjection; +namespace Cmfcmf\Module\MediaModule\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/Entity/Collection/CollectionEntity.php b/Entity/Collection/CollectionEntity.php index 6905316c..503c07a7 100644 --- a/Entity/Collection/CollectionEntity.php +++ b/Entity/Collection/CollectionEntity.php @@ -17,9 +17,9 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Watermark\AbstractWatermarkEntity; use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; +use Cmfcmf\Module\MediaModule\Traits\StandardFieldsTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; -use DoctrineExtensions\StandardFields\Mapping\Annotation as ZK; use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Sluggable\Sluggable; use Gedmo\Tree\Node; @@ -34,6 +34,8 @@ */ class CollectionEntity implements Node, Sluggable { + use StandardFieldsTrait; + const TEMPORARY_UPLOAD_COLLECTION_ID = 1; /** @@ -158,46 +160,6 @@ class CollectionEntity implements Node, Sluggable */ private $categoryAssignments; - /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="create") - * - * No assertions. - * - * @var int - */ - protected $createdUserId; - - /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="update") - * - * No assertions. - * - * @var int - */ - protected $updatedUserId; - - /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="create") - * - * No assertions. - * - * @var \DateTime - */ - protected $createdDate; - - /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="update") - * - * No assertions. - * - * @var \DateTime - */ - protected $updatedDate; - /** * @ORM\Column(type="integer") * @ORM\Version @@ -295,7 +257,7 @@ public function __construct() */ public function isPrimaryMediumInMediaCollection() { - return $this->primaryMedium === null || $this->media->contains($this->primaryMedium); + return null === $this->primaryMedium || $this->media->contains($this->primaryMedium); } /** @@ -313,7 +275,7 @@ public function toArrayForJsTree( $children = true; $isSelected = false; - if ($hookedObjectEntity != null) { + if (null != $hookedObjectEntity) { /** @var HookedObjectCollectionEntity $hookedObjectCollectionEntity */ foreach ($hookedObjectEntity->getHookedObjectCollections() as $hookedObjectCollectionEntity) { if ($this->id == $hookedObjectCollectionEntity->getCollection()->getId()) { @@ -398,7 +360,7 @@ public function setTitle($title) } /** - * @deprecated Use $this->getPrimaryMedium() instead. + * @deprecated use $this->getPrimaryMedium() instead * * @return AbstractMediaEntity|null */ @@ -409,7 +371,7 @@ public function getMediaForThumbnail() /** * @param RouterInterface $router - * @param bool $selfIsClickable Whether or not this collection is clickable. + * @param bool $selfIsClickable whether or not this collection is clickable * * @return array */ @@ -419,7 +381,7 @@ public function getBreadcrumbs(RouterInterface $router, $selfIsClickable = false $breadcrumbs = []; /** @var CollectionEntity $parent */ - while (($parent = $child->getParent()) !== null) { + while (null !== ($parent = $child->getParent())) { $breadcrumbs[] = [ 'url' => $router->generate('cmfcmfmediamodule_collection_display', ['slug' => $parent->getSlug()]), 'title' => $parent->getTitle() @@ -451,7 +413,7 @@ public function getBreadcrumbs(RouterInterface $router, $selfIsClickable = false */ public function isRoot() { - return $this->parent === null; + return null === $this->parent; } /** @@ -533,86 +495,6 @@ public function setDescription($description) return $this; } - /** - * @return int - */ - public function getCreatedUserId() - { - return $this->createdUserId; - } - - /** - * @param int $createdUserId - * - * @return CollectionEntity - */ - public function setCreatedUserId($createdUserId) - { - $this->createdUserId = $createdUserId; - - return $this; - } - - /** - * @return int - */ - public function getUpdatedUserId() - { - return $this->updatedUserId; - } - - /** - * @param int $updatedUserId - * - * @return CollectionEntity - */ - public function setUpdatedUserId($updatedUserId) - { - $this->updatedUserId = $updatedUserId; - - return $this; - } - - /** - * @return \DateTime - */ - public function getCreatedDate() - { - return $this->createdDate; - } - - /** - * @param \DateTime $createdDate - * - * @return CollectionEntity - */ - public function setCreatedDate($createdDate) - { - $this->createdDate = $createdDate; - - return $this; - } - - /** - * @return \DateTime - */ - public function getUpdatedDate() - { - return $this->updatedDate; - } - - /** - * @param \DateTime $updatedDate - * - * @return CollectionEntity - */ - public function setUpdatedDate($updatedDate) - { - $this->updatedDate = $updatedDate; - - return $this; - } - /** * @return AbstractWatermarkEntity|null */ @@ -868,7 +750,7 @@ public function setPrimaryMedium($primaryMedium) */ public function getPrimaryMedium($useFirstIfNoneSpecified = false) { - if ($useFirstIfNoneSpecified && $this->primaryMedium === null && !$this->media->isEmpty()) { + if ($useFirstIfNoneSpecified && null === $this->primaryMedium && !$this->media->isEmpty()) { return $this->media->first(); } diff --git a/Entity/Collection/Permission/AbstractPermissionEntity.php b/Entity/Collection/Permission/AbstractPermissionEntity.php index c798dab9..323ec8f3 100644 --- a/Entity/Collection/Permission/AbstractPermissionEntity.php +++ b/Entity/Collection/Permission/AbstractPermissionEntity.php @@ -13,9 +13,9 @@ use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\Restriction\AbstractPermissionRestrictionEntity; +use Cmfcmf\Module\MediaModule\Traits\StandardFieldsTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; -use DoctrineExtensions\StandardFields\Mapping\Annotation as ZK; use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Sortable\Sortable; use Symfony\Component\Validator\Constraints as Assert; @@ -35,6 +35,8 @@ */ abstract class AbstractPermissionEntity implements Sortable { + use StandardFieldsTrait; + /** * @ORM\Column(type="integer") * @ORM\Id @@ -159,46 +161,6 @@ abstract class AbstractPermissionEntity implements Sortable */ protected $restrictions; - /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="create") - * - * No assertions. - * - * @var int. - */ - protected $createdUserId; - - /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="update") - * - * No assertions. - * - * @var int. - */ - protected $updatedUserId; - - /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="create") - * - * No assertions. - * - * @var \DateTime. - */ - protected $createdDate; - - /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="update") - * - * No assertions. - * - * @var \DateTime. - */ - protected $updatedDate; - public function __construct() { $this->description = ""; @@ -477,84 +439,4 @@ public function setLocked($locked) return $this; } - - /** - * @return int - */ - public function getCreatedUserId() - { - return $this->createdUserId; - } - - /** - * @param int $createdUserId - * - * @return $this - */ - public function setCreatedUserId($createdUserId) - { - $this->createdUserId = $createdUserId; - - return $this; - } - - /** - * @return int - */ - public function getUpdatedUserId() - { - return $this->updatedUserId; - } - - /** - * @param int $updatedUserId - * - * @return $this - */ - public function setUpdatedUserId($updatedUserId) - { - $this->updatedUserId = $updatedUserId; - - return $this; - } - - /** - * @return \DateTime - */ - public function getCreatedDate() - { - return $this->createdDate; - } - - /** - * @param \DateTime $createdDate - * - * @return $this - */ - public function setCreatedDate($createdDate) - { - $this->createdDate = $createdDate; - - return $this; - } - - /** - * @return \DateTime - */ - public function getUpdatedDate() - { - return $this->updatedDate; - } - - /** - * @param \DateTime $updatedDate - * - * @return $this - */ - public function setUpdatedDate($updatedDate) - { - $this->updatedDate = $updatedDate; - - return $this; - } } diff --git a/Entity/Media/AbstractFileEntity.php b/Entity/Media/AbstractFileEntity.php index 390898d9..63ad5e25 100644 --- a/Entity/Media/AbstractFileEntity.php +++ b/Entity/Media/AbstractFileEntity.php @@ -14,6 +14,7 @@ use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Uploadable\Uploadable; +use Symfony\Component\HttpFoundation\RequestStack; /** * @ORM\Entity(repositoryClass="Cmfcmf\Module\MediaModule\Entity\Media\Repository\MediaRepository") @@ -52,9 +53,13 @@ abstract class AbstractFileEntity extends AbstractMediaEntity implements Uploada */ protected $downloadAllowed; - public function __construct() + /** + * @param RequestStack $requestStack + * @param string $dataDirectory + */ + public function __construct(RequestStack $requestStack, $dataDirectory = '') { - parent::__construct(); + parent::__construct($requestStack, $dataDirectory); $this->downloadAllowed = true; } @@ -63,7 +68,7 @@ public function getPathToUploadTo($defaultPath) { unset($defaultPath); - return \FileUtil::getDataDirectory() . '/cmfcmf-media-module/media'; + return $this->dataDirectory . '/cmfcmf-media-module/media'; } public function getPath() @@ -73,7 +78,7 @@ public function getPath() public function getUrl() { - return \System::getBaseUri() . '/' . $this->getPath(); + return $this->getBaseUri() . '/' . $this->getPath(); } public function getBeautifiedFileName() diff --git a/Entity/Media/AbstractMediaEntity.php b/Entity/Media/AbstractMediaEntity.php index 9e552d5b..3d1aa179 100644 --- a/Entity/Media/AbstractMediaEntity.php +++ b/Entity/Media/AbstractMediaEntity.php @@ -16,12 +16,13 @@ use Cmfcmf\Module\MediaModule\Entity\HookedObject\HookedObjectMediaEntity; use Cmfcmf\Module\MediaModule\Entity\License\LicenseEntity; use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; +use Cmfcmf\Module\MediaModule\Traits\StandardFieldsTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; -use DoctrineExtensions\StandardFields\Mapping\Annotation as ZK; use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Sluggable\Sluggable; use Gedmo\Sortable\Sortable; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Validator\Constraints as Assert; /** @@ -51,6 +52,8 @@ */ abstract class AbstractMediaEntity implements Sluggable, Sortable { + use StandardFieldsTrait; + /** * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -181,38 +184,20 @@ abstract class AbstractMediaEntity implements Sluggable, Sortable private $categoryAssignments; /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="create") - * - * @var int. - */ - protected $createdUserId; - - /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="update") - * - * @var int. + * @var RequestStack */ - protected $updatedUserId; + protected $requestStack; /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="create") - * - * @var \DateTime. + * @var string */ - protected $createdDate; + protected $dataDirectory; /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="update") - * - * @var \DateTime. + * @param RequestStack $requestStack + * @param string $dataDirectory */ - protected $updatedDate; - - public function __construct() + public function __construct(RequestStack $requestStack, $dataDirectory = '') { // Position at the end of the album. $this->position = -1; @@ -221,6 +206,10 @@ public function __construct() $this->downloads = 0; $this->hookedObjectMedia = new ArrayCollection(); $this->categoryAssignments = new ArrayCollection(); + + // TODO refactor these dependencies out of the entities + $this->requestStack = $requestStack; + $this->dataDirectory = $dataDirectory; } /** @@ -236,36 +225,35 @@ public function makeNonPrimaryOnDelete() public function getImagineId() { - return "media-{$this->id}"; + return 'media-' . $this->id; } public function getAttribution($format = 'html') { - if ($this->author === null && $this->authorUrl === null) { + if (null === $this->author && null === $this->authorUrl) { return null; } - $dom = \ZLanguage::getModuleDomain('CmfcmfMediaModule'); - if ($format == 'html') { - if ($this->authorUrl === null) { + if ('html' == $format) { + if (null === $this->authorUrl) { $author = htmlentities($this->author); - } elseif ($this->author === null) { + } elseif (null === $this->author) { $author = '' . htmlentities($this->authorUrl) . ''; } else { $author = '' . htmlentities($this->author) . ''; } - } elseif ($format == 'raw') { - $author = ""; - if ($this->author !== null) { - $author .= $this->author . " "; + } elseif ('raw' == $format) { + $author = ''; + if (null !== $this->author) { + $author .= $this->author . ' '; } - if ($this->authorUrl !== null) { - $author .= "(" . $this->authorUrl . ")"; + if (null !== $this->authorUrl) { + $author .= '(' . $this->authorUrl . ')'; } $author = trim($author); } - return __f('By %s', [$author], $dom); + return $author; } /** @@ -390,86 +378,6 @@ public function getLicense() return $this->license; } - /** - * @return int - */ - public function getCreatedUserId() - { - return $this->createdUserId; - } - - /** - * @param int $createdUserId - * - * @return $this - */ - public function setCreatedUserId($createdUserId) - { - $this->createdUserId = $createdUserId; - - return $this; - } - - /** - * @return int - */ - public function getUpdatedUserId() - { - return $this->updatedUserId; - } - - /** - * @param int $updatedUserId - * - * @return $this - */ - public function setUpdatedUserId($updatedUserId) - { - $this->updatedUserId = $updatedUserId; - - return $this; - } - - /** - * @return \DateTime - */ - public function getCreatedDate() - { - return $this->createdDate; - } - - /** - * @param \DateTime $createdDate - * - * @return $this - */ - public function setCreatedDate($createdDate) - { - $this->createdDate = $createdDate; - - return $this; - } - - /** - * @return \DateTime - */ - public function getUpdatedDate() - { - return $this->updatedDate; - } - - /** - * @param \DateTime $updatedDate - * - * @return $this - */ - public function setUpdatedDate($updatedDate) - { - $this->updatedDate = $updatedDate; - - return $this; - } - /** * @return mixed */ @@ -568,13 +476,19 @@ public function toArrayForFinder(MediaTypeCollection $mediaTypeCollection, $incl $type = substr($class, strrpos($class, '\\') + 1, -strlen('Entity')); $mediaType = $mediaTypeCollection->getMediaTypeFromEntity($this); + $preview = ''; + if ('Image' == $type) { + $preview = $mediaType->renderFullpage($this); + } + return [ 'id' => $this->id, 'type' => $type, 'title' => $this->title, + 'preview' => $preview, 'slug' => $this->slug, 'description' => $this->description, - 'license' => $this->getLicense() !== null ? $this->getLicense()->toArray() : null, + 'license' => null !== $this->getLicense() ? $this->getLicense()->toArray() : null, 'embedCodes' => [ 'full' => $mediaType->getEmbedCode($this), 'medium' => $mediaType->getEmbedCode($this, 'medium'), @@ -737,4 +651,33 @@ public function setDownloads($downloads) return $this; } + + protected function getBaseUri() + { + return $this->requestStack->getCurrentRequest()->getBasePath(); + } + + /** + * @param RequestStack $requestStack + * + * @return AbstractWatermarkEntity + */ + public function setRequestStack(RequestStack $requestStack) + { + $this->requestStack = $requestStack; + + return $this; + } + + /** + * @param string $dataDirectory + * + * @return AbstractWatermarkEntity + */ + public function setDataDirectory($dataDirectory) + { + $this->dataDirectory = $dataDirectory; + + return $this; + } } diff --git a/Entity/Media/PlaintextEntity.php b/Entity/Media/PlaintextEntity.php index 542b80c5..24dfe899 100644 --- a/Entity/Media/PlaintextEntity.php +++ b/Entity/Media/PlaintextEntity.php @@ -12,15 +12,20 @@ namespace Cmfcmf\Module\MediaModule\Entity\Media; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\HttpFoundation\RequestStack; /** * @ORM\Entity() */ class PlaintextEntity extends AbstractFileEntity { - public function __construct() + /** + * @param RequestStack $requestStack + * @param string $dataDirectory + */ + public function __construct(RequestStack $requestStack, $dataDirectory = '') { - parent::__construct(); + parent::__construct($requestStack, $dataDirectory); $this->setUseSyntaxHighlighting(true); } diff --git a/Entity/Watermark/AbstractWatermarkEntity.php b/Entity/Watermark/AbstractWatermarkEntity.php index 15185f75..14443738 100644 --- a/Entity/Watermark/AbstractWatermarkEntity.php +++ b/Entity/Watermark/AbstractWatermarkEntity.php @@ -12,11 +12,11 @@ namespace Cmfcmf\Module\MediaModule\Entity\Watermark; use Cmfcmf\Module\MediaModule\Font\FontCollection; +use Cmfcmf\Module\MediaModule\Traits\StandardFieldsTrait; use Doctrine\ORM\Mapping as ORM; -use DoctrineExtensions\StandardFields\Mapping\Annotation as ZK; -use Gedmo\Mapping\Annotation as Gedmo; use Imagine\Image\ImageInterface; use Imagine\Image\ImagineInterface; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Validator\Constraints as Assert; /** @@ -33,6 +33,8 @@ */ abstract class AbstractWatermarkEntity { + use StandardFieldsTrait; + /** * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -110,49 +112,27 @@ abstract class AbstractWatermarkEntity protected $relativeSize; /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="create") - * - * No assertions. - * - * @var int. + * @var RequestStack */ - protected $createdUserId; + protected $requestStack; /** - * @ORM\Column(type="integer") - * @ZK\StandardFields(type="userid", on="update") - * - * No assertions. - * - * @var int. - */ - protected $updatedUserId; - - /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="create") - * - * No assertions. - * - * @var \DateTime. + * @var string */ - protected $createdDate; + protected $dataDirectory; /** - * @ORM\Column(type="datetime") - * @Gedmo\Timestampable(on="update") - * - * No assertions. - * - * @var \DateTime. + * @param RequestStack $requestStack + * @param string $dataDirectory */ - protected $updatedDate; - - public function __construct() + public function __construct(RequestStack $requestStack, $dataDirectory = '') { $this->minSizeX = 200; $this->minSizeY = 80; + + // TODO refactor these dependencies out of the entities + $this->requestStack = $requestStack; + $this->dataDirectory = $dataDirectory; } /** @@ -277,86 +257,6 @@ public function setRelativeSize($relativeSize) return $this; } - /** - * @return int - */ - public function getCreatedUserId() - { - return $this->createdUserId; - } - - /** - * @param int $createdUserId - * - * @return AbstractWatermarkEntity - */ - public function setCreatedUserId($createdUserId) - { - $this->createdUserId = $createdUserId; - - return $this; - } - - /** - * @return int - */ - public function getUpdatedUserId() - { - return $this->updatedUserId; - } - - /** - * @param int $updatedUserId - * - * @return AbstractWatermarkEntity - */ - public function setUpdatedUserId($updatedUserId) - { - $this->updatedUserId = $updatedUserId; - - return $this; - } - - /** - * @return \DateTime - */ - public function getCreatedDate() - { - return $this->createdDate; - } - - /** - * @param \DateTime $createdDate - * - * @return AbstractWatermarkEntity - */ - public function setCreatedDate($createdDate) - { - $this->createdDate = $createdDate; - - return $this; - } - - /** - * @return \DateTime - */ - public function getUpdatedDate() - { - return $this->updatedDate; - } - - /** - * @param \DateTime $updatedDate - * - * @return AbstractWatermarkEntity - */ - public function setUpdatedDate($updatedDate) - { - $this->updatedDate = $updatedDate; - - return $this; - } - /** * Get the value of Min Size. * @@ -424,4 +324,28 @@ public function getVersion() { return $this->version; } + + /** + * @param RequestStack $requestStack + * + * @return AbstractWatermarkEntity + */ + public function setRequestStack(RequestStack $requestStack) + { + $this->requestStack = $requestStack; + + return $this; + } + + /** + * @param string $dataDirectory + * + * @return AbstractWatermarkEntity + */ + public function setDataDirectory($dataDirectory) + { + $this->dataDirectory = $dataDirectory; + + return $this; + } } diff --git a/Entity/Watermark/ImageWatermarkEntity.php b/Entity/Watermark/ImageWatermarkEntity.php index 674de300..f4e5fa7c 100644 --- a/Entity/Watermark/ImageWatermarkEntity.php +++ b/Entity/Watermark/ImageWatermarkEntity.php @@ -15,6 +15,7 @@ use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Uploadable\Uploadable; +use Imagine\Image\Box; use Imagine\Image\ImagineInterface; /** @@ -55,7 +56,7 @@ public function getImagineImage( $height ) { $watermarkImage = $imagine->open($this->getPath()); - if ($this->getRelativeSize() !== null) { + if (null !== $this->getRelativeSize()) { $y = (int) $height * $this->getRelativeSize() / 100; $factor = $y / $watermarkImage->getSize()->getHeight(); $x = $watermarkImage->getSize()->getWidth() * $factor; @@ -65,7 +66,7 @@ public function getImagineImage( $x = $actualWidth; $y *= $factor; } - $watermarkImage->resize(new \Imagine\Image\Box($x, $y)); + $watermarkImage->resize(new Box($x, $y)); } return $watermarkImage; @@ -75,7 +76,7 @@ public function getPathToUploadTo($defaultPath) { unset($defaultPath); - return \FileUtil::getDataDirectory() . '/cmfcmf-media-module/watermarks'; + return $this->dataDirectory . '/cmfcmf-media-module/watermarks'; } public function getPath() @@ -83,9 +84,14 @@ public function getPath() return $this->getPathToUploadTo(null) . '/' . $this->fileName; } + public function getFileName() + { + return $this->fileName; + } + public function getUrl() { - return \System::getBaseUri() . '/' . $this->getPath(); + return $this->requestStack->getCurrentRequest()->getBasePath() . '/' . $this->getPath(); } /** @@ -97,7 +103,7 @@ public function getViewTableContent() $title = htmlentities($this->title); return << +$title EOD; } } diff --git a/Entity/Watermark/Repository/WatermarkRepository.php b/Entity/Watermark/Repository/WatermarkRepository.php index 0ff911ca..594a445f 100644 --- a/Entity/Watermark/Repository/WatermarkRepository.php +++ b/Entity/Watermark/Repository/WatermarkRepository.php @@ -14,21 +14,20 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Watermark\AbstractWatermarkEntity; use Doctrine\ORM\EntityRepository; +use Liip\ImagineBundle\Imagine\Cache\CacheManager; class WatermarkRepository extends EntityRepository { /** * Removes all thumbnails generated for media with the given entity. * - * @param AbstractWatermarkEntity $entity - * @param \SystemPlugin_Imagine_Manager $imagineManager + * @param AbstractWatermarkEntity $entity + * @param CacheManager $imagineCacheManager */ public function cleanupThumbs( AbstractWatermarkEntity $entity, - \SystemPlugin_Imagine_Manager $imagineManager + CacheManager $imagineCacheManager ) { - $imagineManager->setModule('CmfcmfMediaModule'); - $qb = $this->getEntityManager()->createQueryBuilder(); $qb->select('m') ->from('CmfcmfMediaModule:Media\AbstractMediaEntity', 'm') @@ -39,7 +38,7 @@ public function cleanupThumbs( /** @var AbstractMediaEntity[] $media */ $media = $qb->getQuery()->execute(); foreach ($media as $medium) { - $imagineManager->removeObjectThumbs($medium->getImagineId()); + $imagineCacheManager->remove($medium->getPath(), ['thumbnail', 'cmfcmfmediamodule.custom_image_filter']); } } } diff --git a/Entity/Watermark/TextWatermarkEntity.php b/Entity/Watermark/TextWatermarkEntity.php index 9fcbb388..dfda4303 100644 --- a/Entity/Watermark/TextWatermarkEntity.php +++ b/Entity/Watermark/TextWatermarkEntity.php @@ -16,6 +16,7 @@ use Imagine\Image\ImagineInterface; use Imagine\Image\Palette\RGB; use Imagine\Image\Point; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Validator\Constraints as Assert; /** @@ -68,12 +69,16 @@ class TextWatermarkEntity extends AbstractWatermarkEntity */ protected $backgroundColor; - public function __construct() + /** + * @param RequestStack $requestStack + * @param string $dataDirectory + */ + public function __construct(RequestStack $requestStack, $dataDirectory = '') { - parent::__construct(); + parent::__construct($requestStack, $dataDirectory); - $this->fontColor = "#000000FF"; - $this->backgroundColor = "#00000000"; + $this->fontColor = '#000000FF'; + $this->backgroundColor = '#00000000'; } /** @@ -99,9 +104,9 @@ public function setText($text) public function getImagineImage(ImagineInterface $imagine, FontCollection $fontCollection, $width, $height) { $fontPath = $fontCollection->getFontById($this->font)->getPath(); - if ($this->getAbsoluteSize() !== null) { + if (null !== $this->getAbsoluteSize()) { $fontSize = $this->getAbsoluteSize(); - } elseif ($this->getRelativeSize() !== null) { + } elseif (null !== $this->getRelativeSize()) { $fontSize = (int) $this->getRelativeSize() / 100 * $height; } else { throw new \LogicException('Either relative or absolute watermark size must be set!'); @@ -128,8 +133,8 @@ public function getImagineImage(ImagineInterface $imagine, FontCollection $fontC */ public function assertRelativeOrAbsoluteSizeSet() { - $r = $this->relativeSize !== null; - $a = $this->absoluteSize !== null; + $r = null !== $this->relativeSize; + $a = null !== $this->absoluteSize; return $r xor $a; } diff --git a/Font/FontCollection.php b/Font/FontCollection.php index 901e8fce..7933ed25 100644 --- a/Font/FontCollection.php +++ b/Font/FontCollection.php @@ -27,7 +27,7 @@ class FontCollection private $fonts; /** - * @var bool Whether or not the fonts have already been loaded. + * @var bool whether or not the fonts have already been loaded */ private $loaded; @@ -76,15 +76,18 @@ public function getFontsForForm() $this->load(); } - return array_map(function (FontInterface $font) { - return $font->getTitle(); - }, $this->getFonts()); + $choices = []; + foreach ($this->getFonts() as $font) { + $choices[$font->getTitle()] = $font->getId(); + } + + return $choices; } /** * Returns a font by id. * - * @param string $id The font id. + * @param string $id the font id * * @return FontInterface */ @@ -113,7 +116,7 @@ public function getFontUrl() $fontUrl = 'https://fonts.googleapis.com/css?family='; foreach ($this->getFonts() as $font) { - if ($font->getGoogleFontName() !== null) { + if (null !== $font->getGoogleFontName()) { $fontUrl .= str_replace('_', '+', $font->getGoogleFontName()) . '|'; } } diff --git a/Form/AbstractType.php b/Form/AbstractType.php index 1ad4356a..cac3d298 100644 --- a/Form/AbstractType.php +++ b/Form/AbstractType.php @@ -12,6 +12,7 @@ namespace Cmfcmf\Module\MediaModule\Form; use Symfony\Component\Form\AbstractType as BaseAbstractType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\Translation\TranslatorInterface; @@ -35,7 +36,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); - $builder->add('version', 'hidden'); + $builder->add('version', HiddenType::class); } /** @@ -55,7 +56,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) /** * {@inheritdoc} */ - public function getName() + public function getBlockPrefix() { $class = get_class($this); $class = substr($class, strlen('Cmfcmf\\Module\\MediaModule\\Form\\')); diff --git a/Form/Collection/CollectionBlockType.php b/Form/Collection/CollectionBlockType.php index 486746f8..48c28653 100644 --- a/Form/Collection/CollectionBlockType.php +++ b/Form/Collection/CollectionBlockType.php @@ -11,34 +11,61 @@ namespace Cmfcmf\Module\MediaModule\Form\Collection; -use Cmfcmf\Module\MediaModule\CollectionTemplate\TemplateCollection; +use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Repository\CollectionRepository; +use Cmfcmf\Module\MediaModule\Form\CollectionTemplate\TemplateType; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Translation\TranslatorInterface; class CollectionBlockType extends AbstractType { + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @var CollectionRepository + */ + private $collectionRepository; + + /** + * @var SecurityManager + */ + private $securityManager; + + /** + * @param TranslatorInterface $translator + * @param SecurityManager $securityManager + * @param EntityManagerInterface $em + */ + public function __construct( + TranslatorInterface $translator, + SecurityManager $securityManager, + EntityManagerInterface $em + ) { + $this->translator = $translator; + $this->securityManager = $securityManager; + $this->collectionRepository = $em->getRepository('CmfcmfMediaModule:Collection\CollectionEntity'); + } + public function buildForm(FormBuilderInterface $builder, array $options) { - /** @var TranslatorInterface $translator */ - $translator = $options['translator']; - /** @var SecurityManager $securityManager */ - $securityManager = $options['securityManager']; - /** @var TemplateCollection $templateCollection */ - $templateCollection = $options['templateCollection']; - /** @var CollectionRepository $collectionRepository */ - $collectionRepository = $options['collectionRepository']; + $securityManager = $this->securityManager; + $collectionRepository = $this->collectionRepository; $collectionOptions = [ 'required' => true, - 'label' => $translator->trans('Collection', [], 'cmfcmfmediamodule'), - 'class' => 'CmfcmfMediaModule:Collection\CollectionEntity', + 'label' => $this->translator->trans('Collection', [], 'cmfcmfmediamodule'), + 'class' => CollectionEntity::class, 'query_builder' => function (EntityRepository $er) use ($securityManager) { /** @var CollectionRepository $er */ $qb = $securityManager->getCollectionsWithAccessQueryBuilder( @@ -49,29 +76,26 @@ public function buildForm(FormBuilderInterface $builder, array $options) return $qb; }, - 'placeholder' => $translator->trans('Select collection', [], 'cmfcmfmediamodule'), - 'property' => 'indentedTitle', + 'placeholder' => $this->translator->trans('Select collection', [], 'cmfcmfmediamodule'), + 'choice_label' => 'indentedTitle', 'multiple' => false ]; $builder - ->add('id', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', $collectionOptions) - ->add('showHooks', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', [ - 'label' => $translator->trans('Show hooks', [], 'cmfcmfmediamodule'), + ->add('id', EntityType::class, $collectionOptions) + ->add('showHooks', CheckboxType::class, [ + 'label' => $this->translator->trans('Show hooks', [], 'cmfcmfmediamodule'), 'required' => false, 'disabled' => true ]) - ->add('template', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', [ - 'label' => $translator->trans('Template', [], 'cmfcmfmediamodule'), - 'required' => false, - 'placeholder' => $translator->trans('Default', [], 'cmfcmfmediamodule'), - 'choices' => $templateCollection->getCollectionTemplateTitles() + ->add('template', TemplateType::class, [ + 'label' => $this->translator->trans('Display', [], 'cmfcmfmediamodule'), ]) - ->add('showChildCollections', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', [ - 'label' => $translator->trans('Show child collections', [], 'cmfcmfmediamodule'), + ->add('showChildCollections', CheckboxType::class, [ + 'label' => $this->translator->trans('Show child collections', [], 'cmfcmfmediamodule'), 'required' => false ]) - ->add('showEditAndDownloadLinks', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', [ - 'label' => $translator->trans('Show edit and download links', [], 'cmfcmfmediamodule'), + ->add('showEditAndDownloadLinks', CheckboxType::class, [ + 'label' => $this->translator->trans('Show edit and download links', [], 'cmfcmfmediamodule'), 'required' => false ]) ->addModelTransformer(new CallbackTransformer( @@ -89,16 +113,8 @@ function ($data) { ; } - public function getName() + public function getBlockPrefix() { return 'cmfcmfmediamodule_collectionblock'; } - - /** - * @param OptionsResolver $resolver - */ - public function configureOptions(OptionsResolver $resolver) - { - $resolver->setRequired(['translator', 'securityManager', 'templateCollection', 'collectionRepository']); - } } diff --git a/Form/Collection/CollectionType.php b/Form/Collection/CollectionType.php index 7508af54..79ea9f6f 100644 --- a/Form/Collection/CollectionType.php +++ b/Form/Collection/CollectionType.php @@ -12,23 +12,29 @@ namespace Cmfcmf\Module\MediaModule\Form\Collection; use Cmfcmf\Module\MediaModule\CollectionTemplate\TemplateCollection; +use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionCategoryAssignmentEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Repository\CollectionRepository; +use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\Repository\MediaRepository; +use Cmfcmf\Module\MediaModule\Entity\Watermark\AbstractWatermarkEntity; use Cmfcmf\Module\MediaModule\Form\AbstractType; +use Cmfcmf\Module\MediaModule\Form\CollectionTemplate\TemplateType; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Cmfcmf\Module\MediaModule\Security\SecurityManager; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query\Parameter; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Translation\TranslatorInterface; +use Zikula\CategoriesModule\Form\Type\CategoriesType; +use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; class CollectionType extends AbstractType { - /** - * @var CollectionEntity|null - */ - private $parent; - /** * @var TemplateCollection */ @@ -39,14 +45,27 @@ class CollectionType extends AbstractType */ private $securityManager; + /** + * @var VariableApiInterface + */ + private $variableApi; + + /** + * @param TranslatorInterface $translator + * @param TemplateCollection $templateCollection + * @param SecurityManager $securityManager + * @param VariableApiInterface $variableApi + */ public function __construct( + TranslatorInterface $translator, TemplateCollection $templateCollection, - CollectionEntity $parent = null, - SecurityManager $securityManager + SecurityManager $securityManager, + VariableApiInterface $variableApi ) { - $this->parent = $parent; + $this->translator = $translator; $this->templateCollection = $templateCollection; $this->securityManager = $securityManager; + $this->variableApi = $variableApi; } /** @@ -56,9 +75,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); - $escapingStrategy = \ModUtil::getVar( - 'CmfcmfMediaModule', - 'descriptionEscapingStrategyForCollection'); + $escapingStrategy = $this->variableApi->get('CmfcmfMediaModule', 'descriptionEscapingStrategyForCollection'); switch ($escapingStrategy) { case 'raw': $descriptionHelp = $this->translator->trans('You may use HTML.', [], 'cmfcmfmediamodule'); @@ -77,120 +94,119 @@ public function buildForm(FormBuilderInterface $builder, array $options) $theCollection = $options['data']; $securityManager = $this->securityManager; - $builder - ->add( - 'title', - 'text', - [ - 'label' => $this->translator->trans('Title', [], 'cmfcmfmediamodule') - ]); - // If enabled, breaks slug generation of children when the slug is changed. - //if (\ModUtil::getVar('CmfcmfMediaModule', 'slugEditable')) { - // $builder - // ->add('slug', 'text', [ - // 'label' => $this->translator->trans('Slug', [], 'cmfcmfmediamodule'), - // 'required'=> false, - // 'attr' => [ - // 'placeholder' => $this->translator->trans('Leave empty to autogenerate', [], 'cmfcmfmediamodule') - // ] - // ]) - // ; - //} + $builder->add('title', TextType::class, [ + 'label' => $this->translator->trans('Title', [], 'cmfcmfmediamodule') + ]); + /** + If enabled, breaks slug generation of children when the slug is changed. + if ($this->variableApi->get('CmfcmfMediaModule', 'slugEditable')) { + $builder->add('slug', TextType::class, [ + 'label' => $this->translator->trans('Slug', [], 'cmfcmfmediamodule'), + 'required'=> false, + 'attr' => [ + 'placeholder' => $this->translator->trans('Leave empty to autogenerate', [], 'cmfcmfmediamodule') + ] + ]); + }*/ $builder - ->add( - 'description', - 'textarea', - [ - 'label' => $this->translator->trans('Description', [], 'cmfcmfmediamodule'), - 'required' => false, - 'attr' => [ - 'help' => $descriptionHelp - ] - ]) - ->add('categoryAssignments', 'Zikula\CategoriesModule\Form\Type\CategoriesType', [ + ->add('description', TextareaType::class, [ + 'label' => $this->translator->trans('Description', [], 'cmfcmfmediamodule'), + 'required' => false, + 'attr' => [ + 'help' => $descriptionHelp + ] + ]) + ->add('categoryAssignments', CategoriesType::class, [ + 'label' => $this->translator->trans('Categories', [], 'cmfcmfmediamodule'), 'required' => false, 'multiple' => true, 'module' => 'CmfcmfMediaModule', 'entity' => 'CollectionEntity', - 'entityCategoryClass' => 'Cmfcmf\Module\MediaModule\Entity\Collection\CollectionCategoryAssignmentEntity', + 'entityCategoryClass' => CollectionCategoryAssignmentEntity::class, + ]) + ->add('defaultTemplate', TemplateType::class, [ + 'label' => $this->translator->trans('Display', [], 'cmfcmfmediamodule'), ]) - ->add('defaultTemplate', 'cmfcmfmediamodule_collectiontemplate') - ->add( - 'parent', - 'entity', - [ - 'class' => 'Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity', - 'required' => false, - 'label' => $this->translator->trans('Parent', [], 'cmfcmfmediamodule'), - 'placeholder' => $this->translator->trans('No parent', [], 'cmfcmfmediamodule'), - 'query_builder' => function (EntityRepository $er) use ( - $theCollection, - $securityManager - ) { - /** @var CollectionRepository $er */ - $qb = $securityManager->getCollectionsWithAccessQueryBuilder( - CollectionPermissionSecurityTree::PERM_LEVEL_ADD_SUB_COLLECTIONS - ); - $qb->orderBy('c.root', 'ASC') - ->addOrderBy('c.lft', 'ASC'); - if ($theCollection->getId() != null) { - // The collection is currently edited. Make sure it's not placed into - // itself or one of it's children. - $childrenQuery = $er->getChildrenQuery($theCollection); - $qb - ->andWhere( - $qb->expr()->notIn( - 'c.id', - $childrenQuery->getDQL() - ) + ->add('parent', EntityType::class, [ + 'class' => CollectionEntity::class, + 'required' => false, + 'label' => $this->translator->trans('Parent', [], 'cmfcmfmediamodule'), + 'placeholder' => $this->translator->trans('No parent', [], 'cmfcmfmediamodule'), + 'query_builder' => function (EntityRepository $er) use ( + $theCollection, + $securityManager + ) { + /** @var CollectionRepository $er */ + $qb = $securityManager->getCollectionsWithAccessQueryBuilder( + CollectionPermissionSecurityTree::PERM_LEVEL_ADD_SUB_COLLECTIONS + ); + $qb->orderBy('c.root', 'ASC') + ->addOrderBy('c.lft', 'ASC'); + if (null != $theCollection->getId()) { + // The collection is currently edited. Make sure it's not placed into + // itself or one of it's children. + $childrenQuery = $er->getChildrenQuery($theCollection); + $qb + ->andWhere( + $qb->expr()->notIn( + 'c.id', + $childrenQuery->getDQL() ) - ->andWhere($qb->expr()->neq('c.id', ':id')) - ->setParameter('id', $theCollection->getId()) - ; - $childrenQuery->getParameters()->forAll(function ($key, Parameter $parameter) use ($qb) { - $qb->setParameter($parameter->getName(), $parameter->getValue()); - }); - } + ) + ->andWhere($qb->expr()->neq('c.id', ':id')) + ->setParameter('id', $theCollection->getId()) + ; + $childrenQuery->getParameters()->forAll(function ($key, Parameter $parameter) use ($qb) { + $qb->setParameter($parameter->getName(), $parameter->getValue()); + }); + } - return $qb; - }, - 'data' => $this->parent, - 'property' => 'indentedTitle', - ]) - ->add( - 'watermark', - 'entity', - [ - 'class' => 'CmfcmfMediaModule:Watermark\AbstractWatermarkEntity', - 'required' => false, - 'label' => $this->translator->trans('Watermark', [], 'cmfcmfmediamodule'), - 'data' => $theCollection->getId() !== null ? $theCollection->getWatermark() : - (isset($this->parent) ? $this->parent->getWatermark() : null), - 'placeholder' => $this->translator->trans('No watermark', [], 'cmfcmfmediamodule'), - 'property' => 'title', - ]) - ->add( - 'primaryMedium', - 'entity', - [ - 'class' => 'CmfcmfMediaModule:Media\AbstractMediaEntity', - 'required' => false, - 'label' => $this->translator->trans('Primary medium', [], 'cmfcmfmediamodule'), - 'placeholder' => $this->translator->trans('First medium of collection', [], 'cmfcmfmediamodule'), - 'disabled' => $theCollection->getId() == null, - 'property' => 'title', - 'query_builder' => function (EntityRepository $er) use ($theCollection) { - /** @var MediaRepository $er */ - $qb = $er->createQueryBuilder('m'); - $qb->where($qb->expr()->eq('m.collection', ':collection')) - ->setParameter('collection', $theCollection->getId()); + return $qb; + }, + 'data' => $options['parent'], + 'choice_label' => 'indentedTitle', + ]) + ->add('watermark', EntityType::class, [ + 'class' => AbstractWatermarkEntity::class, + 'required' => false, + 'label' => $this->translator->trans('Watermark', [], 'cmfcmfmediamodule'), + 'data' => null !== $theCollection->getId() ? $theCollection->getWatermark() : + (isset($options['parent']) ? $options['parent']->getWatermark() : null), + 'placeholder' => $this->translator->trans('No watermark', [], 'cmfcmfmediamodule'), + 'choice_label' => 'title', + ]) + ->add('primaryMedium', EntityType::class, [ + 'class' => AbstractMediaEntity::class, + 'required' => false, + 'label' => $this->translator->trans('Primary medium', [], 'cmfcmfmediamodule'), + 'placeholder' => $this->translator->trans('First medium of collection', [], 'cmfcmfmediamodule'), + 'disabled' => null === $theCollection->getId(), + 'choice_label' => 'title', + 'query_builder' => function (EntityRepository $er) use ($theCollection) { + /** @var MediaRepository $er */ + $qb = $er->createQueryBuilder('m'); + $qb->where($qb->expr()->eq('m.collection', ':collection')) + ->setParameter('collection', $theCollection->getId()); + + return $qb; + }, + 'attr' => [ + 'help' => $this->translator->trans('The primary medium is used as collection thumbnail. It must be part of the collection.', [], 'cmfcmfmediamodule') + ] + ]) + ; + } - return $qb; - }, - 'attr' => [ - 'help' => $this->translator->trans('The primary medium is used as collection thumbnail. It must be part of the collection.', [], 'cmfcmfmediamodule') - ] - ]); + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'parent' => null + ]) + ; } } diff --git a/Form/Collection/Permission/AbstractPermissionType.php b/Form/Collection/Permission/AbstractPermissionType.php index 7413c2da..8ee36619 100644 --- a/Form/Collection/Permission/AbstractPermissionType.php +++ b/Form/Collection/Permission/AbstractPermissionType.php @@ -11,37 +11,52 @@ namespace Cmfcmf\Module\MediaModule\Form\Collection\Permission; -use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Form\AbstractType; +use Cmfcmf\Module\MediaModule\Form\Type\PermissionLevelType; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\DateTimeType; +use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Translation\TranslatorInterface; +use Zikula\GroupsModule\Entity\RepositoryInterface\GroupRepositoryInterface; +use Zikula\UsersModule\Entity\RepositoryInterface\UserRepositoryInterface; abstract class AbstractPermissionType extends AbstractType { /** * @var SecurityManager */ - private $securityManager; + protected $securityManager; /** - * @var CollectionEntity + * @var GroupRepositoryInterface */ - private $collectionEntity; + protected $groupRepository; /** - * @var + * @var UserRepositoryInterface */ - private $permissionLevel; + protected $userRepository; + /** + * @param TranslatorInterface $translator + * @param SecurityManager $securityManager + * @param GroupRepositoryInterface $groupRepository + * @param UserRepositoryInterface $userRepository + */ public function __construct( - CollectionEntity $collectionEntity, + TranslatorInterface $translator, SecurityManager $securityManager, - $permissionLevel + GroupRepositoryInterface $groupRepository, + UserRepositoryInterface $userRepository ) { + $this->translator = $translator; $this->securityManager = $securityManager; - $this->collectionEntity = $collectionEntity; - $this->permissionLevel = $permissionLevel; + $this->groupRepository = $groupRepository; + $this->userRepository = $userRepository; } /** @@ -51,16 +66,12 @@ public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); - $builder->add( - 'permissionLevels', - 'cmfcmfmediamodule_permission', - [ + $builder + ->add('permissionLevels', PermissionLevelType::class, [ 'label' => $this->translator->trans('Permission level', [], 'cmfcmfmediamodule'), - 'permissionLevel' => $this->permissionLevel - ])->add( - 'description', - 'textarea', - [ + 'permissionLevel' => $options['permissionLevel'] + ]) + ->add('description', TextareaType::class, [ 'label' => $this->translator->trans('Description', [], 'cmfcmfmediamodule'), 'required' => false, 'attr' => [ @@ -69,49 +80,34 @@ public function buildForm(FormBuilderInterface $builder, array $options) [], 'cmfcmfmediamodule') ] - ])->add( - 'appliedToSelf', - 'checkbox', - [ + ]) + ->add('appliedToSelf', CheckboxType::class, [ 'label' => $this->translator->trans('Applies to the collection itself', [], 'cmfcmfmediamodule'), 'required' => false - ])->add( - 'appliedToSubCollections', - 'checkbox', - [ + ]) + ->add('appliedToSubCollections', CheckboxType::class, [ 'label' => $this->translator->trans('Applies to sub-collections', [], 'cmfcmfmediamodule'), 'required' => false - ]); + ]) + ; - if ($this->securityManager->hasPermission( - $this->collectionEntity, - CollectionPermissionSecurityTree::PERM_LEVEL_CHANGE_PERMISSIONS) - ) { - $builder->add( - 'goOn', - 'checkbox', - [ - 'label' => $this->translator->trans('Go on if this permission is not sufficient', [], 'cmfcmfmediamodule'), - 'required' => false - ]); + if ($this->securityManager->hasPermission($options['collection'], CollectionPermissionSecurityTree::PERM_LEVEL_CHANGE_PERMISSIONS)) { + $builder->add('goOn', CheckboxType::class, [ + 'label' => $this->translator->trans('Go on if this permission is not sufficient', [], 'cmfcmfmediamodule'), + 'required' => false + ]); } else { - $builder->add( - 'goOn', - 'checkbox', - [ - 'label' => $this->translator->trans('Go on if this permission is not sufficient', [], 'cmfcmfmediamodule'), - 'required' => true, - 'data' => true, - 'attr' => [ - 'disabled' => true - ], - ]); + $builder->add('goOn', CheckboxType::class, [ + 'label' => $this->translator->trans('Go on if this permission is not sufficient', [], 'cmfcmfmediamodule'), + 'data' => true, + 'attr' => [ + 'disabled' => true + ], + ]); } - $builder->add( - 'validAfter', - 'datetime', - [ + $builder + ->add('validAfter', DateTimeType::class, [ 'label' => $this->translator->trans('Valid after', [], 'cmfcmfmediamodule'), 'widget' => 'choice', 'required' => false, @@ -121,10 +117,8 @@ public function buildForm(FormBuilderInterface $builder, array $options) [], 'cmfcmfmediamodule') ] - ])->add( - 'validUntil', - 'datetime', - [ + ]) + ->add('validUntil', DateTimeType::class, [ 'label' => $this->translator->trans('Valid until', [], 'cmfcmfmediamodule'), 'widget' => 'choice', 'required' => false, @@ -134,6 +128,20 @@ public function buildForm(FormBuilderInterface $builder, array $options) [], 'cmfcmfmediamodule') ] - ]); + ]) + ; + } + + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'collection' => null, + 'permissionLevel' => null + ]) + ; } } diff --git a/Form/Collection/Permission/GroupPermissionType.php b/Form/Collection/Permission/GroupPermissionType.php index 1cf0c1ab..8b323161 100644 --- a/Form/Collection/Permission/GroupPermissionType.php +++ b/Form/Collection/Permission/GroupPermissionType.php @@ -11,8 +11,8 @@ namespace Cmfcmf\Module\MediaModule\Form\Collection\Permission; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; -use Zikula\GroupsModule\Entity\GroupEntity; class GroupPermissionType extends AbstractPermissionType { @@ -21,20 +21,16 @@ class GroupPermissionType extends AbstractPermissionType */ public function buildForm(FormBuilderInterface $builder, array $options) { - /** @var GroupEntity[]|false $groups */ - $groups = \ModUtil::apiFunc('ZikulaGroupsModule', 'user', 'getall'); - if ($groups === false) { - $groups = []; - } + $groupNames = $this->groupRepository->getGroupNamesById(); $choices = []; - $choices[-1] = $this->translator->trans('All groups', [], 'cmfcmfmediamodule'); + $choices[$this->translator->trans('All groups', [], 'cmfcmfmediamodule')] = -1; - foreach ($groups as $group) { - $choices[$group->getGid()] = $group->getName(); + foreach ($groupNames as $groupId => $groupName) { + $choices[$groupName] = $groupId; } - $builder->add('groupIds', 'choice', [ + $builder->add('groupIds', ChoiceType::class, [ 'label' => $this->translator->trans('Groups', [], 'cmfcmfmediamodule'), 'multiple' => true, 'choices' => $choices diff --git a/Form/Collection/Permission/PasswordPermissionType.php b/Form/Collection/Permission/PasswordPermissionType.php index de842be7..f99eba74 100644 --- a/Form/Collection/Permission/PasswordPermissionType.php +++ b/Form/Collection/Permission/PasswordPermissionType.php @@ -11,6 +11,7 @@ namespace Cmfcmf\Module\MediaModule\Form\Collection\Permission; +use Symfony\Component\Form\Extension\Core\Type\PasswordType; use Symfony\Component\Form\FormBuilderInterface; class PasswordPermissionType extends AbstractPermissionType @@ -20,7 +21,7 @@ class PasswordPermissionType extends AbstractPermissionType */ public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('password', 'password', [ + $builder->add('password', PasswordType::class, [ 'label' => $this->translator->trans('Password', [], 'cmfcmfmediamodule'), ]); diff --git a/Form/Collection/Permission/UserPermissionType.php b/Form/Collection/Permission/UserPermissionType.php index a68727c4..46e62cce 100644 --- a/Form/Collection/Permission/UserPermissionType.php +++ b/Form/Collection/Permission/UserPermissionType.php @@ -11,6 +11,7 @@ namespace Cmfcmf\Module\MediaModule\Form\Collection\Permission; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; class UserPermissionType extends AbstractPermissionType @@ -20,12 +21,13 @@ class UserPermissionType extends AbstractPermissionType */ public function buildForm(FormBuilderInterface $builder, array $options) { - $users = \UserUtil::getAll(); - $choices = array_map(function ($user) { - return $user['uname']; - }, $users); + $users = $this->userRepository->findAll(); + $choices = []; + foreach ($users as $user) { + $choices[$user['uname']] = $user['uid']; + } - $builder->add('userIds', 'choice', [ + $builder->add('userIds', ChoiceType::class, [ 'label' => $this->translator->trans('Users', [], 'cmfcmfmediamodule'), 'multiple' => true, 'choices' => $choices diff --git a/Form/CollectionTemplate/GalleriaType.php b/Form/CollectionTemplate/GalleriaType.php index c4cb8611..8e3bc1ab 100644 --- a/Form/CollectionTemplate/GalleriaType.php +++ b/Form/CollectionTemplate/GalleriaType.php @@ -12,15 +12,30 @@ namespace Cmfcmf\Module\MediaModule\Form\CollectionTemplate; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Translation\TranslatorInterface; class GalleriaType extends AbstractType { + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct( + TranslatorInterface $translator + ) { + $this->translator = $translator; + } + public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('height', 'Symfony\Component\Form\Extension\Core\Type\NumberType', [ - 'label' => 'Slider height', - 'required' => true + $builder->add('height', NumberType::class, [ + 'label' => $this->translator->trans('Slider height', [], 'cmfcmfmediamodule') ]); } } diff --git a/Form/CollectionTemplate/LightGalleryType.php b/Form/CollectionTemplate/LightGalleryType.php index 5495d2ca..85153c37 100644 --- a/Form/CollectionTemplate/LightGalleryType.php +++ b/Form/CollectionTemplate/LightGalleryType.php @@ -12,30 +12,49 @@ namespace Cmfcmf\Module\MediaModule\Form\CollectionTemplate; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Translation\TranslatorInterface; class LightGalleryType extends AbstractType { + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct( + TranslatorInterface $translator + ) { + $this->translator = $translator; + } + public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('thumbWidth', 'Symfony\Component\Form\Extension\Core\Type\NumberType', [ - 'label' => 'Thumbnail width', - 'required' => true - ])->add('thumbHeight', 'Symfony\Component\Form\Extension\Core\Type\NumberType', [ - 'label' => 'Thumbnail height', - 'required' => true - ])->add('thumbMode', 'Symfony\Component\Form\Extension\Core\Type\ChoiceType', [ - 'label' => 'Thumbnail mode', - 'required' => true, + $builder->add('thumbWidth', NumberType::class, [ + 'label' => $this->translator->trans('Thumbnail width', [], 'cmfcmfmediamodule') + ]) + ->add('thumbHeight', NumberType::class, [ + 'label' => $this->translator->trans('Thumbnail height', [], 'cmfcmfmediamodule') + ]) + ->add('thumbMode', ChoiceType::class, [ + 'label' => $this->translator->trans('Thumbnail mode', [], 'cmfcmfmediamodule'), 'choices' => [ - 'inset' => 'inset', - 'outbound' => 'outbound' + $this->translator->trans('inset', [], 'cmfcmfmediamodule') => 'inset', + $this->translator->trans('outbound', [], 'cmfcmfmediamodule') => 'outbound' ], - ])->add('showTitleBelowThumbs', 'checkbox', [ - 'label' => 'Show the image titles below thumbnails.', + ]) + ->add('showTitleBelowThumbs', CheckboxType::class, [ + 'label' => $this->translator->trans('Show the image titles below thumbnails.', [], 'cmfcmfmediamodule'), 'required' => false - ])->add('showAttributionBelowThumbs', 'checkbox', [ - 'label' => 'Show the image attributions below thumbnails.', + ]) + ->add('showAttributionBelowThumbs', CheckboxType::class, [ + 'label' => $this->translator->trans('Show the image attributions below thumbnails.', [], 'cmfcmfmediamodule'), 'required' => false ]); } diff --git a/Form/CollectionTemplate/TemplateType.php b/Form/CollectionTemplate/TemplateType.php index bac9e6b4..e8eee3f2 100644 --- a/Form/CollectionTemplate/TemplateType.php +++ b/Form/CollectionTemplate/TemplateType.php @@ -16,6 +16,8 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\FormType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvents; @@ -44,8 +46,16 @@ public static function getSubscribedEvents() */ private $selectedTemplateFactory; - public function __construct(TranslatorInterface $translator, TemplateCollection $templateCollection, SelectedTemplateFactory $selectedTemplateFactory) - { + /** + * @param TranslatorInterface $translator + * @param TemplateCollection $templateCollection + * @param SelectedTemplateFactory $selectedTemplateFactory + */ + public function __construct( + TranslatorInterface $translator, + TemplateCollection $templateCollection, + SelectedTemplateFactory $selectedTemplateFactory + ) { $this->translator = $translator; $this->templateCollection = $templateCollection; $this->selectedTemplateFactory = $selectedTemplateFactory; @@ -55,57 +65,64 @@ public function buildForm(FormBuilderInterface $builder, array $options) { $selectedTemplateFactory = $this->selectedTemplateFactory; - $builder->add('template', 'choice', [ - 'label' => $this->translator->trans('Template', [], 'cmfcmfmediamodule'), - 'required' => !$options['allowDefaultTemplate'], - 'placeholder' => $options['allowDefaultTemplate'] ? $this->translator->trans('Default', [], 'cmfcmfmediamodule') : false, - 'choices' => $this->templateCollection->getCollectionTemplateTitles() - ])->add('options', 'form', [ - 'required' => false - ])->addModelTransformer(new CallbackTransformer(function ($modelData) use ($selectedTemplateFactory) { - if ($modelData === null) { - return [ - 'template' => null, - 'options' => [] - ]; - } - $selectedTemplate = $selectedTemplateFactory->fromDB($modelData); - - return [ - 'template' => $selectedTemplate->getTemplate()->getName(), - 'options' => $selectedTemplate->getOptions() - ]; - }, function ($viewData) use ($selectedTemplateFactory) { - if (null === $viewData['template']) { - return null; - } - - return $selectedTemplateFactory->fromTemplateName($viewData['template'], (array) $viewData['options'])->toDB(); - }))->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { - $form = $event->getForm(); - $data = $event->getData(); - - if (null === $data) { - $form->add('options', 'form', [ - 'required' => false - ]); - - return; - } - - $selectedTemplate = $this->selectedTemplateFactory->fromDB($data); - - $settingsForm = $selectedTemplate->getTemplate()->getSettingsForm(); - if (null !== $settingsForm) { - $form->add('options', $settingsForm); - } - }); + $builder + ->add('template', ChoiceType::class, [ + 'label' => $this->translator->trans('Template', [], 'cmfcmfmediamodule'), + 'required' => !$options['allowDefaultTemplate'], + 'placeholder' => $options['allowDefaultTemplate'] ? $this->translator->trans('Default', [], 'cmfcmfmediamodule') : false, + 'choices' => $this->templateCollection->getCollectionTemplateTitles() + ]) + ->add('options', FormType::class, [ + 'required' => false + ]) + ->addModelTransformer( + new CallbackTransformer(function ($modelData) use ($selectedTemplateFactory) { + if (null === $modelData) { + return [ + 'template' => null, + 'options' => [] + ]; + } + $selectedTemplate = $selectedTemplateFactory->fromDB($modelData); + + return [ + 'template' => $selectedTemplate->getTemplate()->getName(), + 'options' => $selectedTemplate->getOptions() + ]; + }, function ($viewData) use ($selectedTemplateFactory) { + if (null === $viewData['template']) { + return null; + } + + return $selectedTemplateFactory->fromTemplateName($viewData['template'], (array) $viewData['options'])->toDB(); + }) + ) + ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { + $form = $event->getForm(); + $data = $event->getData(); + + if (null === $data) { + $form->add('options', FormType::class, [ + 'required' => false + ]); + + return; + } + + $selectedTemplate = $this->selectedTemplateFactory->fromDB($data); + + $settingsForm = $selectedTemplate->getTemplate()->getSettingsForm(); + if (null !== $settingsForm) { + $form->add('options', $settingsForm); + } + }) + ; $builder->get('template')->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { $form = $event->getForm(); $template = $form->getData(); if (null === $template) { - $form->getParent()->add('options', 'form', [ + $form->getParent()->add('options', FormType::class, [ 'required' => false ]); @@ -116,7 +133,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) if (null !== $settingsForm) { $form->getParent()->add('options', $settingsForm); } else { - $form->getParent()->add('options', 'form', [ + $form->getParent()->add('options', FormType::class, [ 'required' => false ]); } @@ -128,8 +145,8 @@ public function configureOptions(OptionsResolver $resolver) $resolver->setDefault('allowDefaultTemplate', true); } - public function getName() + public function getBlockPrefix() { - return "cmfcmfmediamodule_collectiontemplate"; + return 'cmfcmfmediamodule_collectiontemplate'; } } diff --git a/Form/ImportType.php b/Form/ImportType.php index 41c89956..4d0d1408 100644 --- a/Form/ImportType.php +++ b/Form/ImportType.php @@ -16,18 +16,15 @@ use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Cmfcmf\Module\MediaModule\Security\SecurityManager; use Doctrine\ORM\EntityRepository; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType as SymfonyAbstractType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\Form\FormTypeInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Translation\TranslatorInterface; class ImportType extends SymfonyAbstractType { - /** - * @var FormTypeInterface - */ - private $importerForm; - /** * @var TranslatorInterface */ @@ -38,44 +35,61 @@ class ImportType extends SymfonyAbstractType */ private $securityManager; - public function __construct(FormTypeInterface $importerForm, TranslatorInterface $translator, SecurityManager $securityManager) - { - $this->importerForm = $importerForm; + /** + * @param TranslatorInterface $translator + * @param SecurityManager $securityManager + */ + public function __construct( + TranslatorInterface $translator, + SecurityManager $securityManager + ) { $this->translator = $translator; $this->securityManager = $securityManager; } public function buildForm(FormBuilderInterface $builder, array $options) { - $builder - ->add('collection', 'entity', [ - 'required' => true, - 'class' => 'CmfcmfMediaModule:Collection\CollectionEntity', - 'query_builder' => function (EntityRepository $er) { - /** @var CollectionRepository $qb */ - $qb = $this->securityManager->getCollectionsWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_ADD_SUB_COLLECTIONS); - $qb - ->orderBy('c.root', 'ASC') - ->addOrderBy('c.lft', 'ASC') - ->andWhere($qb->expr()->not($qb->expr()->eq('c.id', ':uploadCollectionId'))) - ->setParameter('uploadCollectionId', CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID); + $builder->add('collection', EntityType::class, [ + 'required' => true, + 'class' => CollectionEntity::class, + 'query_builder' => function (EntityRepository $er) { + /** @var CollectionRepository $qb */ + $qb = $this->securityManager->getCollectionsWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_ADD_SUB_COLLECTIONS); + $qb + ->orderBy('c.root', 'ASC') + ->addOrderBy('c.lft', 'ASC') + ->andWhere($qb->expr()->not($qb->expr()->eq('c.id', ':uploadCollectionId'))) + ->setParameter('uploadCollectionId', CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID); - return $qb; - }, - 'placeholder' => $this->translator->trans('Select collection', [], 'cmfcmfmediamodule'), - 'property' => 'indentedTitle', - ]) - ->add('importSettings', $this->importerForm) - ->add('import', 'submit', [ - 'attr' => [ - 'class' => 'btn-success' - ] - ]) - ; + return $qb; + }, + 'placeholder' => $this->translator->trans('Select collection', [], 'cmfcmfmediamodule'), + 'choice_label' => 'indentedTitle', + ]); + if (null !== $options['importerForm']) { + $builder->add('importSettings', $options['importerForm']); + } + $builder->add('import', SubmitType::class, [ + 'attr' => [ + 'class' => 'btn-success' + ] + ]); + } + + public function getBlockPrefix() + { + return 'cmfcmfmediamodule_importtype'; } - public function getName() + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) { - return 'cmfcmfmediamodule_settingstype'; + $resolver + ->setDefaults([ + 'importerForm' => null + ]) + ; } } diff --git a/Form/Importer/AbstractImporterType.php b/Form/Importer/AbstractImporterType.php index 6312bc8b..e6867ad1 100644 --- a/Form/Importer/AbstractImporterType.php +++ b/Form/Importer/AbstractImporterType.php @@ -29,7 +29,7 @@ public function __construct(TranslatorInterface $translator) $this->translator = $translator; } - public function getName() + public function getBlockPrefix() { $type = get_class($this); $type = substr($type, strrpos($type, '\\') + 1, -strlen('Type')); diff --git a/Form/Importer/ServerDirectoryType.php b/Form/Importer/ServerDirectoryType.php index b8b000e9..445fa58c 100644 --- a/Form/Importer/ServerDirectoryType.php +++ b/Form/Importer/ServerDirectoryType.php @@ -11,6 +11,8 @@ namespace Cmfcmf\Module\MediaModule\Form\Importer; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; class ServerDirectoryType extends AbstractImporterType @@ -18,18 +20,18 @@ class ServerDirectoryType extends AbstractImporterType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('serverDirectory', 'text', [ + ->add('serverDirectory', TextType::class, [ 'required' => true, 'label' => $this->translator->trans('Server directory', [], 'cmfcmfmediamodule'), 'attr' => [ 'help' => $this->translator->trans('Either provide an absolute path or a path relative to the Zikula root directory.', [], 'cmfcmfmediamodule') ] ]) - ->add('includeSubDirectories', 'checkbox', [ + ->add('includeSubDirectories', CheckboxType::class, [ 'required' => false, 'label' => $this->translator->trans('Include sub directories', [], 'cmfcmfmediamodule') ]) - ->add('createSubCollectionsForSubDirectories', 'checkbox', [ + ->add('createSubCollectionsForSubDirectories', CheckboxType::class, [ 'required' => false, 'label' => $this->translator->trans('Create sub collections for sub directories', [], 'cmfcmfmediamodule') ]) diff --git a/Form/License/LicenseType.php b/Form/License/LicenseType.php index 5ba29310..caca62b4 100644 --- a/Form/License/LicenseType.php +++ b/Form/License/LicenseType.php @@ -12,21 +12,22 @@ namespace Cmfcmf\Module\MediaModule\Form\License; use Cmfcmf\Module\MediaModule\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Translation\TranslatorInterface; class LicenseType extends AbstractType { /** - * @var bool + * @param TranslatorInterface $translator */ - private $isEdit; - - /** - * @param bool $isEdit Whether or not the license is currenlty edited. - */ - public function __construct($isEdit) + public function __construct(TranslatorInterface $translator) { - $this->isEdit = $isEdit; + $this->translator = $translator; } /** @@ -37,59 +38,70 @@ public function buildForm(FormBuilderInterface $builder, array $options) parent::buildForm($builder, $options); $builder - ->add('id', 'text', [ - 'required' => true, - 'disabled' => $this->isEdit, + ->add('id', TextType::class, [ + 'disabled' => $options['isEdit'], 'label' => $this->translator->trans('License ID', [], 'cmfcmfmediamodule'), 'attr' => [ 'help' => $this->translator->trans('You won\'t be able to change the ID after creation. It should be something like "gplv3" or similar.', [], 'cmfcmfmediamodule') ] ]) - ->add('title', 'text', [ + ->add('title', TextType::class, [ 'label' => $this->translator->trans('Title', [], 'cmfcmfmediamodule'), - 'required' => true, 'attr' => [ 'help' => $this->translator->trans('The title of the license to use for displaying it.', [], 'cmfcmfmediamodule') ] ]) - ->add('url', 'url', [ + ->add('url', UrlType::class, [ 'label' => $this->translator->trans('Url', [], 'cmfcmfmediamodule'), 'required' => false, 'attr' => [ 'help' => $this->translator->trans('The place where you can look up the license text.', [], 'cmfcmfmediamodule') ] ]) - ->add('imageUrl', 'url', [ + ->add('imageUrl', UrlType::class, [ 'label' => $this->translator->trans('Image Url', [], 'cmfcmfmediamodule'), 'required' => false, 'attr' => [ 'help' => $this->translator->trans('Optional url of a small license icon.', [], 'cmfcmfmediamodule') ] ]) - ->add('outdated', 'checkbox', [ + ->add('outdated', CheckboxType::class, [ 'label' => $this->translator->trans('Outdated', [], 'cmfcmfmediamodule'), 'required' => false, 'attr' => [ 'help' => $this->translator->trans('Marks a license as outdated to give a visual hint while uploading.', [], 'cmfcmfmediamodule') ] ]) - ->add('enabledForUpload', 'checkbox', [ + ->add('enabledForUpload', CheckboxType::class, [ 'label' => $this->translator->trans('Allow to use for uploads', [], 'cmfcmfmediamodule'), 'required' => false, 'attr' => [ 'help' => $this->translator->trans('If you check this box, you will be able to upload media and license it under this license.', [], 'cmfcmfmediamodule') ] ]) - ->add('enabledForWeb', 'checkbox', [ + ->add('enabledForWeb', CheckboxType::class, [ 'label' => $this->translator->trans('Allow to use for web embeds', [], 'cmfcmfmediamodule'), 'required' => false, 'attr' => [ 'help' => $this->translator->trans('If you check this box, you will be able to embed media from the web using this license.', [], 'cmfcmfmediamodule') ] ]) - ->add('submit', 'submit', [ + ->add('submit', SubmitType::class, [ 'label' => $this->translator->trans('Save', [], 'cmfcmfmediamodule') ]) ; } + + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'isEdit' => false + ]) + ->setAllowedTypes('isEdit', 'bool') + ; + } } diff --git a/Form/Media/AbstractFileType.php b/Form/Media/AbstractFileType.php index 12dc7c13..4fdf8c96 100644 --- a/Form/Media/AbstractFileType.php +++ b/Form/Media/AbstractFileType.php @@ -11,6 +11,8 @@ namespace Cmfcmf\Module\MediaModule\Form\Media; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\FormBuilderInterface; class AbstractFileType extends AbstractMediaEntityType @@ -23,12 +25,12 @@ public function buildForm(FormBuilderInterface $builder, array $options) parent::buildForm($builder, $options); $builder - ->add('file', 'file', [ + ->add('file', FileType::class, [ 'label' => $this->translator->trans('Change file', [], 'cmfcmfmediamodule'), 'mapped' => false, 'required' => false ]) - ->add('downloadAllowed', 'checkbox', [ + ->add('downloadAllowed', CheckboxType::class, [ 'required' => false, 'label' => $this->translator->trans('Allow download', [], 'cmfcmfmediamodule') ]) diff --git a/Form/Media/AbstractMediaEntityType.php b/Form/Media/AbstractMediaEntityType.php index 1dd282ce..97a57a10 100644 --- a/Form/Media/AbstractMediaEntityType.php +++ b/Form/Media/AbstractMediaEntityType.php @@ -14,62 +14,58 @@ use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Repository\CollectionRepository; use Cmfcmf\Module\MediaModule\Entity\License\LicenseEntity; +use Cmfcmf\Module\MediaModule\Entity\Media\MediaCategoryAssignmentEntity; use Cmfcmf\Module\MediaModule\Form\AbstractType; use Cmfcmf\Module\MediaModule\Form\DataTransformer\ArrayToJsonTransformer; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; use Cmfcmf\Module\MediaModule\Security\SecurityManager; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; +use Symfony\Component\Form\Extension\Core\Type\TextareaType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; -use Zikula\ExtensionsModule\Api\VariableApi; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Translation\TranslatorInterface; +use Zikula\CategoriesModule\Form\Type\CategoriesType; +use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; /** * Provides some convenience methods for all media form types. */ abstract class AbstractMediaEntityType extends AbstractType { - /** - * @var bool - */ - protected $isCreation; - - /** - * @var CollectionEntity|null - */ - private $parent; - - /** - * @var bool - */ - private $allowTemporaryUploadCollection; - /** * @var SecurityManager */ - private $securityManager; + protected $securityManager; /** - * @var VariableApi + * @var VariableApiInterface */ - private $variableApi; + protected $variableApi; /** * @var EntityManagerInterface */ - private $em; + protected $em; + /** + * @param TranslatorInterface $translator + * @param SecurityManager $securityManager + * @param VariableApiInterface $variableApi + * @param EntityManagerInterface $em + */ public function __construct( + TranslatorInterface $translator, SecurityManager $securityManager, - VariableApi $variableApi, - EntityManagerInterface $em, - $isCreation = false, - CollectionEntity $parent = null, - $allowTemporaryUploadCollection = false + VariableApiInterface $variableApi, + EntityManagerInterface $em ) { + $this->translator = $translator; $this->securityManager = $securityManager; - $this->isCreation = $isCreation; - $this->parent = $parent; - $this->allowTemporaryUploadCollection = $allowTemporaryUploadCollection; $this->variableApi = $variableApi; $this->em = $em; } @@ -112,7 +108,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ]; $securityManager = $this->securityManager; - $allowTemporaryUploadCollection = $this->allowTemporaryUploadCollection; + $allowTemporaryUploadCollection = isset($options['allowTemporaryUploadCollection']) ? $options['allowTemporaryUploadCollection'] : false; $collectionOptions = [ 'required' => true, 'label' => $this->translator->trans('Collection', [], 'cmfcmfmediamodule'), @@ -137,10 +133,10 @@ public function buildForm(FormBuilderInterface $builder, array $options) return $qb; }, 'placeholder' => $this->translator->trans('Select collection', [], 'cmfcmfmediamodule'), - 'property' => 'indentedTitle', + 'choice_label' => 'indentedTitle', ]; - if ($this->parent !== null) { - $collectionOptions['data'] = $this->parent; + if (isset($options['parent']) && null !== $options['parent']) { + $collectionOptions['data'] = $options['parent']; } $defaultLicense = $this->variableApi->get('CmfcmfMediaModule', 'defaultLicense', null); @@ -149,41 +145,41 @@ public function buildForm(FormBuilderInterface $builder, array $options) } $builder - ->add('collection', 'entity', $collectionOptions) - ->add('categoryAssignments', 'Zikula\CategoriesModule\Form\Type\CategoriesType', [ + ->add('collection', EntityType::class, $collectionOptions) + ->add('categoryAssignments', CategoriesType::class, [ + 'label' => $this->translator->trans('Categories', [], 'cmfcmfmediamodule'), 'required' => false, 'multiple' => true, 'module' => 'CmfcmfMediaModule', 'entity' => 'AbstractMediaEntity', - 'entityCategoryClass' => 'Cmfcmf\Module\MediaModule\Entity\Media\MediaCategoryAssignmentEntity', + 'entityCategoryClass' => MediaCategoryAssignmentEntity::class, ]) - ->add( - 'title', + ->add('title', isset($options['hiddenFields']) && in_array( 'title', - $options['hiddenFields']) ? 'hidden' : 'text', + $options['hiddenFields']) ? HiddenType::class : TextType::class, [ 'label' => $this->translator->trans('Title', [], 'cmfcmfmediamodule') - ]) + ] + ) ->add( 'description', isset($options['hiddenFields']) && in_array( 'description', - $options['hiddenFields']) ? 'hidden' : 'textarea', + $options['hiddenFields']) ? HiddenType::class : TextareaType::class, [ 'required' => false, 'label' => $this->translator->trans('Description', [], 'cmfcmfmediamodule'), 'attr' => [ 'help' => $descriptionHelp ] - ]) + ] + ) ->add( - 'license', - 'entity', - [ + 'license', EntityType::class, [ 'required' => false, 'label' => $this->translator->trans('License', [], 'cmfcmfmediamodule'), - 'class' => 'CmfcmfMediaModule:License\LicenseEntity', + 'class' => LicenseEntity::class, 'preferred_choices' => function (LicenseEntity $license) { return !$license->isOutdated(); }, @@ -192,58 +188,70 @@ public function buildForm(FormBuilderInterface $builder, array $options) return $er->createQueryBuilder('l') ->orderBy('l.title', 'ASC') ->where('l.enabledForUpload = 1'); - // @todo Move to the actual uploadable file types. + // @todo Move to the actual uploadable file types. }, 'placeholder' => $this->translator->trans('Unknown', [], 'cmfcmfmediamodule'), - 'property' => 'title', + 'choice_label' => 'title', 'attr' => isset($options['hiddenFields']) && in_array( 'license', $options['hiddenFields']) ? $hiddenAttr : [], 'label_attr' => isset($options['hiddenFields']) && in_array( 'license', $options['hiddenFields']) ? $hiddenAttr : [] - ]) - ->add( - 'author', + ] + ) + ->add('author', isset($options['hiddenFields']) && in_array( 'author', - $options['hiddenFields']) ? 'hidden' : 'text', + $options['hiddenFields']) ? HiddenType::class : TextType::class, [ 'label' => $this->translator->trans('Author', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null - ]) - ->add( - 'authorUrl', + ] + ) + ->add('authorUrl', isset($options['hiddenFields']) && in_array( 'authorUrl', - $options['hiddenFields']) ? 'hidden' : 'url', + $options['hiddenFields']) ? HiddenType::class : UrlType::class, [ 'label' => $this->translator->trans('Author URL', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null - ]) - ->add( - 'authorAvatarUrl', + ] + ) + ->add('authorAvatarUrl', isset($options['hiddenFields']) && in_array( 'authorAvatarUrl', - $options['hiddenFields']) ? 'hidden' : 'url', + $options['hiddenFields']) ? HiddenType::class : UrlType::class, [ - 'label' => $this->translator->trans( - 'Author Avatar URL', - [], - 'cmfcmfmediamodule'), + 'label' => $this->translator->trans('Author Avatar URL', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null - ]) - ->add( - 'mediaType', - 'hidden', - [ - 'mapped' => false - ]) - ->add('extraData', 'hidden'); + ] + ) + ->add('mediaType', HiddenType::class, [ + 'mapped' => false + ]) + ->add('extraData', HiddenType::class) + ; $builder->get('extraData')->addModelTransformer(new ArrayToJsonTransformer()); } + + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'isCreation' => false, + 'parent' => null, + 'allowTemporaryUploadCollection' => false + ]) + ->setAllowedTypes('isCreation', 'bool') + ->setAllowedTypes('allowTemporaryUploadCollection', 'bool') + ; + } } diff --git a/Form/Media/DeezerType.php b/Form/Media/DeezerType.php index 1e002c2b..f9245d8d 100644 --- a/Form/Media/DeezerType.php +++ b/Form/Media/DeezerType.php @@ -11,6 +11,8 @@ namespace Cmfcmf\Module\MediaModule\Form\Media; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; @@ -27,11 +29,11 @@ public function buildForm(FormBuilderInterface $builder, array $options) parent::buildForm($builder, $options); $builder - ->add('musicType', 'hidden') - ->add('musicId', 'hidden') + ->add('musicType', HiddenType::class) + ->add('musicId', HiddenType::class) ; if ($options['showPlaylistCheckbox']) { - $builder->add('showPlaylist', 'checkbox', [ + $builder->add('showPlaylist', CheckboxType::class, [ 'label' => $this->translator->trans('Show playlist', [], 'cmfcmfmediamodule'), 'required' => false ]); diff --git a/Form/Media/FlickrType.php b/Form/Media/FlickrType.php index b86453fc..62d0fbdd 100644 --- a/Form/Media/FlickrType.php +++ b/Form/Media/FlickrType.php @@ -11,6 +11,7 @@ namespace Cmfcmf\Module\MediaModule\Form\Media; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; class FlickrType extends WebType @@ -22,10 +23,10 @@ public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder - ->add('flickrid', 'hidden') - ->add('flickrfarm', 'hidden') - ->add('flickrsecret', 'hidden') - ->add('flickrserver', 'hidden') + ->add('flickrid', HiddenType::class) + ->add('flickrfarm', HiddenType::class) + ->add('flickrsecret', HiddenType::class) + ->add('flickrserver', HiddenType::class) ; } } diff --git a/Form/Media/PlaintextType.php b/Form/Media/PlaintextType.php index fa67ee78..2afbc573 100644 --- a/Form/Media/PlaintextType.php +++ b/Form/Media/PlaintextType.php @@ -11,6 +11,7 @@ namespace Cmfcmf\Module\MediaModule\Form\Media; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\FormBuilderInterface; class PlaintextType extends AbstractFileType @@ -23,7 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) parent::buildForm($builder, $options); $builder - ->add('useSyntaxHighlighting', 'checkbox', [ + ->add('useSyntaxHighlighting', CheckboxType::class, [ 'required' => false, 'label' => $this->translator->trans('Use syntax highlighting', [], 'cmfcmfmediamodule') ]) diff --git a/Form/Media/SoundCloudType.php b/Form/Media/SoundCloudType.php index de1d8dab..deae052f 100644 --- a/Form/Media/SoundCloudType.php +++ b/Form/Media/SoundCloudType.php @@ -11,6 +11,7 @@ namespace Cmfcmf\Module\MediaModule\Form\Media; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\FormBuilderInterface; class SoundCloudType extends WebType @@ -24,9 +25,10 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'url', 'license' ]; parent::buildForm($builder, $options); + $builder - ->add('musicType', 'hidden') - ->add('musicId', 'hidden') + ->add('musicType', HiddenType::class) + ->add('musicId', HiddenType::class) ; } } diff --git a/Form/Media/WebType.php b/Form/Media/WebType.php index 099b3822..0ad2a293 100644 --- a/Form/Media/WebType.php +++ b/Form/Media/WebType.php @@ -11,6 +11,8 @@ namespace Cmfcmf\Module\MediaModule\Form\Media; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; +use Symfony\Component\Form\Extension\Core\Type\UrlType; use Symfony\Component\Form\FormBuilderInterface; class WebType extends AbstractMediaEntityType @@ -21,8 +23,9 @@ class WebType extends AbstractMediaEntityType public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); + $builder - ->add('url', isset($options['hiddenFields']) && in_array('url', $options['hiddenFields']) ? 'hidden' : 'url') + ->add('url', isset($options['hiddenFields']) && in_array('url', $options['hiddenFields']) ? HiddenType::class : UrlType::class) ; } } diff --git a/Form/SettingsType.php b/Form/SettingsType.php index a1e8c13e..35291d45 100644 --- a/Form/SettingsType.php +++ b/Form/SettingsType.php @@ -11,37 +11,60 @@ namespace Cmfcmf\Module\MediaModule\Form; +use Cmfcmf\Module\MediaModule\CollectionTemplate\TemplateCollection; use Cmfcmf\Module\MediaModule\Entity\License\LicenseEntity; +use Cmfcmf\Module\MediaModule\Form\CollectionTemplate\TemplateType; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType as SymfonyAbstractType; use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Translation\TranslatorInterface; -use Zikula\ExtensionsModule\Api\VariableApi; +use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; class SettingsType extends SymfonyAbstractType { - /** - * @var array - */ - private $templates; - /** * @var TranslatorInterface */ private $translator; /** - * @var VariableApi + * @var VariableApiInterface */ private $variableApi; - public function __construct(TranslatorInterface $translator, VariableApi $variableApi, array $templates) - { - $this->templates = $templates; + /** + * @var EntityManagerInterface + */ + private $em; + + /** + * @var array + */ + private $templates; + + /** + * @param TranslatorInterface $translator + * @param VariableApiInterface $variableApi + * @param EntityManagerInterface $em + * @param TemplateCollection $templateCollection + */ + public function __construct( + TranslatorInterface $translator, + VariableApiInterface $variableApi, + EntityManagerInterface $em, + TemplateCollection $templateCollection + ) { $this->translator = $translator; $this->variableApi = $variableApi; + $this->em = $em; + $this->templates = $templateCollection->getCollectionTemplateTitles(); } /** @@ -49,37 +72,32 @@ public function __construct(TranslatorInterface $translator, VariableApi $variab */ public function buildForm(FormBuilderInterface $builder, array $options) { - /** @var EntityManagerInterface $em */ - $em = \ServiceUtil::get('doctrine.orm.entity_manager'); - $builder - ->add('descriptionEscapingStrategyForCollection', 'choice', [ + ->add('descriptionEscapingStrategyForCollection', ChoiceType::class, [ 'label' => $this->translator->trans('Collection description escaping strategy', [], 'cmfcmfmediamodule'), - 'required' => true, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'descriptionEscapingStrategyForCollection'), 'choices' => [ - 'text' => $this->translator->trans('Safe - no HTML permitted, only plain text', [], 'cmfcmfmediamodule'), - 'markdown' => $this->translator->trans('MarkDown', [], 'cmfcmfmediamodule'), - 'raw' => $this->translator->trans('As is - use with editors like Scribite', [], 'cmfcmfmediamodule'), + $this->translator->trans('Safe - no HTML permitted, only plain text', [], 'cmfcmfmediamodule') => 'text', + $this->translator->trans('MarkDown', [], 'cmfcmfmediamodule') => 'markdown', + $this->translator->trans('As is - use with editors like Scribite', [], 'cmfcmfmediamodule') => 'raw' ] ]) - ->add('descriptionEscapingStrategyForMedia', 'choice', [ + ->add('descriptionEscapingStrategyForMedia', ChoiceType::class, [ 'label' => $this->translator->trans('Media description escaping strategy', [], 'cmfcmfmediamodule'), - 'required' => true, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'descriptionEscapingStrategyForMedia'), 'choices' => [ - 'text' => $this->translator->trans('Safe - no HTML permitted, only plain text', [], 'cmfcmfmediamodule'), - 'markdown' => $this->translator->trans('MarkDown', [], 'cmfcmfmediamodule'), - 'raw' => $this->translator->trans('As is - use with editors like Scribite', [], 'cmfcmfmediamodule'), + $this->translator->trans('Safe - no HTML permitted, only plain text', [], 'cmfcmfmediamodule') => 'text', + $this->translator->trans('MarkDown', [], 'cmfcmfmediamodule') => 'markdown', + $this->translator->trans('As is - use with editors like Scribite', [], 'cmfcmfmediamodule') => 'raw' ] ]) - ->add('defaultCollectionTemplate', 'cmfcmfmediamodule_collectiontemplate', [ + ->add('defaultCollectionTemplate', TemplateType::class, [ 'label' => $this->translator->trans('Default collection template', [], 'cmfcmfmediamodule'), 'required' => true, 'allowDefaultTemplate' => false, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'defaultCollectionTemplate'), ]) - ->add('defaultLicense', 'entity', [ + ->add('defaultLicense', EntityType::class, [ 'label' => $this->translator->trans('Default license', [], 'cmfcmfmediamodule'), 'required' => false, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'defaultLicense', null), @@ -93,30 +111,30 @@ public function buildForm(FormBuilderInterface $builder, array $options) }, 'empty_data' => null, 'placeholder' => $this->translator->trans('Unknown', [], 'cmfcmfmediamodule'), - 'property' => 'title', + 'choice_label' => 'title', ]) - // @todo Allow to edit slugs. - //->add('slugEditable', 'checkbox', [ - // 'label' => $this->translator->trans('Make slugs editable', [], 'cmfcmfmediamodule'), - // 'data' => $this->variableApi->get('CmfcmfMediaModule', 'slugEditable') - //]) - ->add('enableMediaViewCounter', 'checkbox', [ + /*@todo Allow to edit slugs. + ->add('slugEditable', CheckboxType::class, [ + 'label' => $this->translator->trans('Make slugs editable', [], 'cmfcmfmediamodule'), + 'data' => $this->variableApi->get('CmfcmfMediaModule', 'slugEditable') + ])*/ + ->add('enableMediaViewCounter', CheckboxType::class, [ 'label' => $this->translator->trans('Enable media view counter', [], 'cmfcmfmediamodule'), 'required' => false, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'enableMediaViewCounter', false), 'attr' => [ - 'help' => $this->translator->trans('Please note that this will cause an additional database update query per page view. Be also aware that the "updated date" and "updated user" fields will be updated every time as well.') + 'help' => $this->translator->trans('Please note that this will cause an additional database update query per page view. Be also aware that the "updated date" and "updated user" fields will be updated every time as well.', [], 'cmfcmfmediamodule') ] ]) - ->add('enableCollectionViewCounter', 'checkbox', [ + ->add('enableCollectionViewCounter', CheckboxType::class, [ 'label' => $this->translator->trans('Enable collection view counter', [], 'cmfcmfmediamodule'), 'required' => false, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'enableCollectionViewCounter', false), 'attr' => [ - 'help' => $this->translator->trans('Please note that this will cause an additional database update query per page view. Be also aware that the "updated date" and "updated user" fields will be updated every time as well.') + 'help' => $this->translator->trans('Please note that this will cause an additional database update query per page view. Be also aware that the "updated date" and "updated user" fields will be updated every time as well.', [], 'cmfcmfmediamodule') ] ]) - ->add('soundCloudApiKey', 'text', [ + ->add('soundCloudApiKey', TextType::class, [ 'label' => $this->translator->trans('SoundCloud "Client ID"', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, @@ -125,17 +143,17 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'help' => $this->translator->trans('Go to http://soundcloud.com/you/apps/new and create a new application. The name doesn\'t matter. In the next screen, enter the url of your Zikula installation at "Website of your App" and leave "Redirect URI for Authentication" empty. Then save and paste the "Client ID" here.', [], 'cmfcmfmediamodule') ] ]) - // @todo Flickr currently disabled. - //->add('flickrApiKey', 'text', [ - // 'label' => $this->translator->trans('Flickr API Client Key', [], 'cmfcmfmediamodule'), - // 'required' => false, - // 'empty_data' => null, - // 'data' => $this->variableApi->get('CmfcmfMediaModule', 'flickrApiKey'), - // 'attr' => [ - // 'help' => $this->translator->trans('Go to https://www.flickr.com/services/apps/create/apply and create a new application. The name doesn\'t matter. Paste the "Key" here (not the "secret key", [], 'cmfcmfmediamodule').') - // ] - //]) - ->add('googleApiKey', 'text', [ + /*@todo Flickr currently disabled. + ->add('flickrApiKey', TextType::class, [ + 'label' => $this->translator->trans('Flickr API Client Key', [], 'cmfcmfmediamodule'), + 'required' => false, + 'empty_data' => null, + 'data' => $this->variableApi->get('CmfcmfMediaModule', 'flickrApiKey'), + 'attr' => [ + 'help' => $this->translator->trans('Go to https://www.flickr.com/services/apps/create/apply and create a new application. The name doesn\'t matter. Paste the "Key" here (not the "secret key", [], 'cmfcmfmediamodule').') + ] + ])*/ + ->add('googleApiKey', TextType::class, [ 'label' => $this->translator->trans('Google API Developer Key', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, @@ -144,7 +162,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'help' => $this->translator->trans('Go to https://console.developers.google.com/project and create a new project. The name and id don\'t matter. Then go to "APIs and Authentication -> APIs" and enable the "YouTube Data API v3". Then go to "APIs and Authentication -> Credentials" and click "Add credentials -> API-Key -> Server-Key". Again, the name does\'t matter. Then paste the API key here.', [], 'cmfcmfmediamodule') ] ]) - ->add('googleApiOAuthClientID', 'text', [ + ->add('googleApiOAuthClientID', TextType::class, [ 'label' => $this->translator->trans('Google API OAuth2 Client ID', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, @@ -153,7 +171,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'help' => $this->translator->trans('Go to https://console.developers.google.com/project and create a new project. The name and id don\'t matter. Then go to "APIs and Authentication -> APIs" and enable the "YouTube Data API v3". Then go to "APIs and Authentication -> Credentials" and click "Add credentials -> OAuth-Client-ID -> Webapplication". Again, the name does\'t matter. Then paste the Client-ID here.', [], 'cmfcmfmediamodule') ] ]) - ->add('googleApiOAuthClientSecret', 'text', [ + ->add('googleApiOAuthClientSecret', TextType::class, [ 'label' => $this->translator->trans('Google API OAuth2 Client Secret', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, @@ -162,7 +180,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'help' => $this->translator->trans('Use the OAuth Client-Secret you got when creating your OAuth Client-ID.', [], 'cmfcmfmediamodule') ] ]) - ->add('twitterApiKey', 'text', [ + ->add('twitterApiKey', TextType::class, [ 'label' => $this->translator->trans('Twitter API Consumer Key', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, @@ -171,31 +189,32 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'help' => $this->translator->trans('Go to https://apps.twitter.com/ and create a new application. The name doesn\'t matter and "Callback URL" should be empty. Then go to "Keys and Access Tokens". At the bottom, click at "Create my access token".', [], 'cmfcmfmediamodule') ] ]) - ->add('twitterApiSecret', 'text', [ + ->add('twitterApiSecret', TextType::class, [ 'label' => $this->translator->trans('Twitter API Secret', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiSecret') ]) - ->add('twitterApiAccessToken', 'text', [ + ->add('twitterApiAccessToken', TextType::class, [ 'label' => $this->translator->trans('Twitter API Access Token', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiAccessToken') ]) - ->add('twitterApiAccessTokenSecret', 'text', [ + ->add('twitterApiAccessTokenSecret', TextType::class, [ 'label' => $this->translator->trans('Twitter API Access Token Secret', [], 'cmfcmfmediamodule'), 'required' => false, 'empty_data' => null, 'data' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiAccessTokenSecret') ]) - ->add('save', 'submit', [ + ->add('save', SubmitType::class, [ 'label' => $this->translator->trans('Save', [], 'cmfcmfmediamodule'), 'attr' => [ 'class' => 'btn-success' ] ]) ; + $em = $this->em; $builder->get('defaultLicense') ->addModelTransformer(new CallbackTransformer(function ($modelData) use ($em) { if (null === $modelData) { @@ -216,7 +235,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) /** * {@inheritdoc} */ - public function getName() + public function getBlockPrefix() { return 'cmfcmfmediamodule_settingstype'; } diff --git a/Form/Type/ColorType.php b/Form/Type/ColorType.php index 18854395..134893d8 100644 --- a/Form/Type/ColorType.php +++ b/Form/Type/ColorType.php @@ -13,10 +13,15 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\CallbackTransformer; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; /** * Displays a color selector. + * + * TODO consider replacing by native color picker + * check http://symfony.com/doc/current/reference/forms/types/color.html + * NOTE this would process RGB instead of RGBA values! */ class ColorType extends AbstractType { @@ -25,10 +30,10 @@ public function buildForm(FormBuilderInterface $builder, array $options) $builder->addViewTransformer(new CallbackTransformer( function ($rgba) { if (empty($rgba)) { - return ""; - } else { - return "#" . substr($rgba, 7, 2) . substr($rgba, 1, 6); + return ''; } + + return "#" . substr($rgba, 7, 2) . substr($rgba, 1, 6); }, function ($argb) { return "#" . substr($argb, 3, 6) . substr($argb, 1, 2); } @@ -40,13 +45,13 @@ function ($rgba) { */ public function getParent() { - return 'text'; + return TextType::class; } /** * {@inheritdoc} */ - public function getName() + public function getBlockPrefix() { return 'cmfcmfmediamodule_color'; } diff --git a/Form/Type/FontType.php b/Form/Type/FontType.php index 087481fd..f80b5d06 100644 --- a/Form/Type/FontType.php +++ b/Form/Type/FontType.php @@ -13,6 +13,7 @@ use Cmfcmf\Module\MediaModule\Font\FontCollection; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -59,13 +60,13 @@ public function buildView(FormView $view, FormInterface $form, array $options) */ public function getParent() { - return 'choice'; + return ChoiceType::class; } /** * {@inheritdoc} */ - public function getName() + public function getBlockPrefix() { return 'cmfcmfmediamodule_font_choice'; } diff --git a/Form/Type/PermissionLevelType.php b/Form/Type/PermissionLevelType.php index 23ab8024..01d7b2d8 100644 --- a/Form/Type/PermissionLevelType.php +++ b/Form/Type/PermissionLevelType.php @@ -17,6 +17,7 @@ use Fhaculty\Graph\Edge\Base; use Fhaculty\Graph\Vertex; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormView; use Symfony\Component\OptionsResolver\Options; @@ -48,7 +49,7 @@ public function __construct(SecurityManager $securityManager) */ public function buildView(FormView $view, FormInterface $form, array $options) { - if ($options['permissionLevel'] == CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS) { + if (CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS == $options['permissionLevel']) { $this->fixSecurityGraph(); } $view->vars['securityGraph'] = $this->securityGraph; @@ -64,13 +65,13 @@ public function configureOptions(OptionsResolver $resolver) 'expanded' => true, 'multiple' => true, 'choices' => function (Options $options) { - if ($options['permissionLevel'] == CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS) { + if (CollectionPermissionSecurityTree::PERM_LEVEL_ENHANCE_PERMISSIONS == $options['permissionLevel']) { $this->fixSecurityGraph(); } - return array_map(function (Vertex $vertex) { + return array_flip(array_map(function (Vertex $vertex) { return $vertex->getAttribute('title'); - }, $this->securityGraph->getVertices()->getMap()); + }, $this->securityGraph->getVertices()->getMap())); } ])->setRequired('permissionLevel'); } @@ -80,13 +81,13 @@ public function configureOptions(OptionsResolver $resolver) */ public function getParent() { - return 'choice'; + return ChoiceType::class; } /** * {@inheritdoc} */ - public function getName() + public function getBlockPrefix() { return 'cmfcmfmediamodule_permission'; } diff --git a/Form/Watermark/AbstractWatermarkType.php b/Form/Watermark/AbstractWatermarkType.php index 188b1365..0a1a6f0d 100644 --- a/Form/Watermark/AbstractWatermarkType.php +++ b/Form/Watermark/AbstractWatermarkType.php @@ -12,13 +12,27 @@ namespace Cmfcmf\Module\MediaModule\Form\Watermark; use Cmfcmf\Module\MediaModule\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\NumberType; +use Symfony\Component\Form\Extension\Core\Type\PercentType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Translation\TranslatorInterface; /** * Form type for a watermark. */ class AbstractWatermarkType extends AbstractType { + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + /** * {@inheritdoc} */ @@ -27,47 +41,63 @@ public function buildForm(FormBuilderInterface $builder, array $options) parent::buildForm($builder, $options); $builder - ->add('title', 'text', [ + ->add('title', TextType::class, [ 'attr' => [ 'help' => $this->translator->trans('A title for you to recognize the watermark.', [], 'cmfcmfmediamodule') ] ]) - ->add('positionX', 'number', [ + ->add('positionX', NumberType::class, [ 'scale' => 0, 'attr' => [ 'help' => $this->translator->trans('The x position of the watermark inside the picture. Negative numbers will position it right aligned.', [], 'cmfcmfmediamodule') ] ]) - ->add('positionY', 'number', [ + ->add('positionY', NumberType::class, [ 'scale' => 0, 'attr' => [ 'help' => $this->translator->trans('The y position of the watermark inside the picture. Negative numbers will position it bottom aligned.', [], 'cmfcmfmediamodule') ] ]) - ->add('minSizeX', 'number', [ + ->add('minSizeX', NumberType::class, [ + 'label' => $this->translator->trans('Minimum size x', [], 'cmfcmfmediamodule'), 'scale' => 0, 'required' => false, 'attr' => [ 'help' => $this->translator->trans('Smaller images will not be watermarked.', [], 'cmfcmfmediamodule') ] ]) - ->add('minSizeY', 'number', [ + ->add('minSizeY', NumberType::class, [ + 'label' => $this->translator->trans('Minimum size y', [], 'cmfcmfmediamodule'), 'scale' => 0, 'required' => false, 'attr' => [ 'help' => $this->translator->trans('Smaller images will not be watermarked.', [], 'cmfcmfmediamodule') ] ]) - ->add('relativeSize', 'number', [ + ->add('relativeSize', PercentType::class, [ + 'label' => $this->translator->trans('Relative size', [], 'cmfcmfmediamodule'), 'scale' => 0, + 'type' => 'integer', 'required' => false, 'attr' => [ 'help' => $this->translator->trans('The size of the watermark in percent. If set, it will resize the watermark accordingly.', [], 'cmfcmfmediamodule') ] ]) - ->add('submit', 'submit', [ + ->add('submit', SubmitType::class, [ 'label' => $this->translator->trans('Save', [], 'cmfcmfmediamodule') ]) ; } + + /** + * {@inheritdoc} + */ + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'entity' => null + ]) + ; + } } diff --git a/Form/Watermark/ImageWatermarkType.php b/Form/Watermark/ImageWatermarkType.php index b230297e..f654decc 100644 --- a/Form/Watermark/ImageWatermarkType.php +++ b/Form/Watermark/ImageWatermarkType.php @@ -11,7 +11,7 @@ namespace Cmfcmf\Module\MediaModule\Form\Watermark; -use Cmfcmf\Module\MediaModule\Entity\Watermark\ImageWatermarkEntity; +use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\Validator\Constraints as Assert; @@ -21,50 +21,35 @@ */ class ImageWatermarkType extends AbstractWatermarkType { - /** - * @var ImageWatermarkEntity - */ - protected $entity; - - /** - * @param ImageWatermarkEntity|null $entity - */ - public function __construct(ImageWatermarkEntity $entity = null) - { - $this->entity = $entity; - } - /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $file = null; - if ($this->entity !== null) { - $file = new File($this->entity->getPath()); + if (isset($options['entity']) && null !== $options['entity'] && $options['entity']->getFileName()) { + $file = new File($options['entity']->getPath()); } - $builder - ->add('file', 'file', [ - 'multiple' => false, - 'mapped' => false, - 'attr' => [ - 'help' => $this->translator->trans('Image to be used as watermark.', [], 'cmfcmfmediamodule') - ], - 'data' => $file, // @todo Still needed?? - 'required' => $this->entity === null, - 'constraints' => [ - new Assert\File([ - // NOTE: If you change the allowed mime types here, make sure to - // also change them in {@link ImageWatermarkEntity} - 'mimeTypes' => [ - 'image/png', - 'image/jpeg', - 'image/gif' - ] - ]) - ] - ]) - ; + $builder->add('file', FileType::class, [ + 'multiple' => false, + 'mapped' => false, + 'attr' => [ + 'help' => $this->translator->trans('Image to be used as watermark.', [], 'cmfcmfmediamodule') + ], + 'data' => $file, // @todo Still needed?? + 'required' => (null === $file), + 'constraints' => [ + new Assert\File([ + // NOTE: If you change the allowed mime types here, make sure to + // also change them in {@link ImageWatermarkEntity} + 'mimeTypes' => [ + 'image/png', + 'image/jpeg', + 'image/gif' + ] + ]) + ] + ]); parent::buildForm($builder, $options); } } diff --git a/Form/Watermark/TextWatermarkType.php b/Form/Watermark/TextWatermarkType.php index 19d01eb4..b33c2695 100644 --- a/Form/Watermark/TextWatermarkType.php +++ b/Form/Watermark/TextWatermarkType.php @@ -11,7 +11,11 @@ namespace Cmfcmf\Module\MediaModule\Form\Watermark; +use Cmfcmf\Module\MediaModule\Form\Type\ColorType; +use Cmfcmf\Module\MediaModule\Form\Type\FontType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\Type\NumberType; +use Symfony\Component\Form\Extension\Core\Type\TextType; /** * Form type for a text watermark. @@ -24,12 +28,12 @@ class TextWatermarkType extends AbstractWatermarkType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('text', 'text', [ + ->add('text', TextType::class, [ 'attr' => [ 'help' => $this->translator->trans('Text to be used as watermark.', [], 'cmfcmfmediamodule') ] ]) - ->add('absoluteSize', 'number', [ + ->add('absoluteSize', NumberType::class, [ 'scale' => 0, 'label' => $this->translator->trans('Font size', [], 'cmfcmfmediamodule'), 'required' => false, @@ -37,14 +41,20 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'help' => $this->translator->trans('The font size to use, reagardless of the image size. Either this or the "Relative size" option must be set.', [], 'cmfcmfmediamodule') ] ]) - ->add('font', 'cmfcmfmediamodule_font_choice', [ + ->add('font', FontType::class, [ 'label' => $this->translator->trans('Font', [], 'cmfcmfmediamodule') ]) - ->add('fontColor', 'cmfcmfmediamodule_color', [ - 'label' => $this->translator->trans('Font color', [], 'cmfcmfmediamodule') + ->add('fontColor', ColorType::class, [ + 'label' => $this->translator->trans('Font color', [], 'cmfcmfmediamodule'), + 'attr' => [ + 'help' => $this->translator->trans('R-G-B-A', [], 'cmfcmfmediamodule') + ] ]) - ->add('backgroundColor', 'cmfcmfmediamodule_color', [ - 'label' => $this->translator->trans('Background color', [], 'cmfcmfmediamodule') + ->add('backgroundColor', ColorType::class, [ + 'label' => $this->translator->trans('Background color', [], 'cmfcmfmediamodule'), + 'attr' => [ + 'help' => $this->translator->trans('R-G-B-A', [], 'cmfcmfmediamodule') + ] ]) ; parent::buildForm($builder, $options); diff --git a/Helper/SearchHelper.php b/Helper/SearchHelper.php index b45d4002..cf35a6eb 100644 --- a/Helper/SearchHelper.php +++ b/Helper/SearchHelper.php @@ -14,41 +14,52 @@ use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Cmfcmf\Module\MediaModule\Security\SecurityManager; +use Doctrine\ORM\QueryBuilder; +use Doctrine\ORM\Query\Expr\Composite; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\HttpFoundation\RequestStack; use Zikula\Core\RouteUrl; -use Zikula\SearchModule\AbstractSearchable; +use Zikula\SearchModule\Entity\SearchResultEntity; +use Zikula\SearchModule\SearchableInterface; -class SearchHelper extends AbstractSearchable +class SearchHelper implements SearchableInterface { /** - * get the UI options for search form. - * - * @param bool $active if the module should be checked as active - * @param array|null $modVars module form vars as previously set - * - * @return string + * @var RequestStack */ - public function getOptions($active, $modVars = null) - { - return $this->getContainer()->get('templating') - ->render('@CmfcmfMediaModule/Search/options.html.twig', ['active' => $active]); - } + private $requestStack; /** - * Get the search results. - * - * @param array $words array of words to search for - * @param string $searchType AND|OR|EXACT - * @param array|null $modVars module form vars passed though - * - * @return array + * @var SecurityManager + */ + private $securityManager; + + /** + * @param RequestStack $requestStack + * @param SecurityManager $securityManager */ + public function __construct( + RequestStack $requestStack, + SecurityManager $securityManager + ) { + $this->requestStack = $requestStack; + $this->securityManager = $securityManager; + + include_once __DIR__ . '/../bootstrap.php'; + } + + public function amendForm(FormBuilderInterface $builder) + { + // nothing + } + public function getResults(array $words, $searchType = 'AND', $modVars = null) { $results = []; - $securityManager = $this->getContainer()->get('cmfcmf_media_module.security_manager'); - $sessionId = $this->container->get('session')->getId(); + $sessionId = $this->requestStack->getCurrentRequest()->getSession()->getId(); - $qb = $securityManager->getCollectionsWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW); + $qb = $this->securityManager->getCollectionsWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_OVERVIEW); $where = $this->formatWhere($qb, $words, ['c.title'], $searchType); $qb->andWhere($where); /** @var CollectionEntity[] $collections */ @@ -65,26 +76,66 @@ public function getResults(array $words, $searchType = 'AND', $modVars = null) ]; } - $qb = $securityManager->getMediaWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_MEDIA_DETAILS); + $qb = $this->securityManager->getMediaWithAccessQueryBuilder(CollectionPermissionSecurityTree::PERM_LEVEL_MEDIA_DETAILS); $where = $this->formatWhere($qb, $words, ['m.title'], $searchType); $qb->andWhere($where); /** @var AbstractMediaEntity[] $media */ $media = $qb->getQuery()->execute(); foreach ($media as $medium) { - $results[] = [ - 'title' => $medium->getTitle(), - 'text' => $medium->getDescription(), - 'module' => 'CmfcmfMediaModule', - 'created' => $medium->getCreatedDate(), - 'sesid' => $sessionId, - 'url' => new RouteUrl('cmfcmfmediamodule_media_display', [ + $result = new SearchResultEntity(); + $result->setTitle($medium->getTitle()) + ->setText($medium->getDescription()) + ->setModule('CmfcmfMediaModule') + ->setCreated($medium->getCreatedDate()) + ->setSesid($sessionId) + ->setUrl(new RouteUrl('cmfcmfmediamodule_media_display', [ 'slug' => $medium->getSlug(), 'collectionSlug' => $medium->getCollection()->getSlug() - ]) - ]; + ])) + ; + $results[] = $result; } return $results; } + + public function getErrors() + { + return []; + } + + /** + * Construct a QueryBuilder Where orX|andX Expr instance. + * + * @param QueryBuilder $qb + * @param string[] $words List of words to query for + * @param string[] $fields List of fields to include into query + * @param string $searchtype AND|OR|EXACT + * + * @return null|Composite + */ + protected function formatWhere(QueryBuilder $qb, array $words = [], array $fields = [], $searchtype = 'AND') + { + if (empty($words) || empty($fields)) { + return null; + } + + $method = ('OR' == $searchtype) ? 'orX' : 'andX'; + /** @var $where Composite */ + $where = $qb->expr()->$method(); + $i = 1; + foreach ($words as $word) { + $subWhere = $qb->expr()->orX(); + foreach ($fields as $field) { + $expr = $qb->expr()->like($field, "?$i"); + $subWhere->add($expr); + $qb->setParameter($i, '%' . $word . '%'); + $i++; + } + $where->add($subWhere); + } + + return $where; + } } diff --git a/HookHandler/AbstractHookHandler.php b/HookProvider/AbstractUiHooksProvider.php similarity index 67% rename from HookHandler/AbstractHookHandler.php rename to HookProvider/AbstractUiHooksProvider.php index df3a0b67..ea261375 100644 --- a/HookHandler/AbstractHookHandler.php +++ b/HookProvider/AbstractUiHooksProvider.php @@ -9,22 +9,30 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\HookHandler; +namespace Cmfcmf\Module\MediaModule\HookProvider; use Cmfcmf\Module\MediaModule\Security\SecurityManager; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Translation\TranslatorInterface; -use Zikula\Bundle\HookBundle\Hook\DisplayHook; -use Zikula\Bundle\HookBundle\Hook\DisplayHookResponse; +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; use Zikula\Bundle\HookBundle\Hook\ProcessHook; +use Zikula\Bundle\HookBundle\HookProviderInterface; +use Zikula\Bundle\HookBundle\ServiceIdTrait; /** * Provides convenience methods for hook handling. */ -abstract class AbstractHookHandler +abstract class AbstractUiHooksProvider implements HookProviderInterface { + use ServiceIdTrait; + + /** + * @var TranslatorInterface + */ + protected $translator; + /** * @var EntityManagerInterface */ @@ -46,33 +54,34 @@ abstract class AbstractHookHandler protected $securityManager; /** - * @var TranslatorInterface + * @param EntityManagerInterface $entityManager + * @param RequestStack $requestStack + * @param EngineInterface $renderEngine + * @param SecurityManager $securityManager + * @param TranslatorInterface $translator */ - protected $translator; - public function __construct( + TranslatorInterface $translator, EntityManagerInterface $entityManager, RequestStack $requestStack, EngineInterface $renderEngine, - SecurityManager $securityManager, - TranslatorInterface $translator + SecurityManager $securityManager ) { + $this->translator = $translator; $this->entityManager = $entityManager; $this->requestStack = $requestStack; $this->renderEngine = $renderEngine; $this->securityManager = $securityManager; - $this->translator = $translator; } - /** - * Generates a Hook response using the given content. - * - * @param DisplayHook $hook - * @param string $content - */ - public function uiResponse(DisplayHook $hook, $content) + public function getOwner() { - $hook->setResponse(new DisplayHookResponse($this->getProvider(), $content)); + return 'CmfcmfMediaModule'; + } + + public function getCategory() + { + return UiHooksCategory::NAME; } /** @@ -89,22 +98,4 @@ public function processDelete(ProcessHook $hook) $this->entityManager->remove($hookedObject); $this->entityManager->flush(); } - - /** - * @return string - */ - public function getType() - { - $class = get_class($this); - - return lcfirst(substr($class, strrpos($class, '\\') + 1, -strlen('HookHandler'))); - } - - /** - * @return string - */ - protected function getProvider() - { - return 'provider.cmfcmfmediamodule.ui_hooks.' . $this->getType(); - } } diff --git a/HookHandler/CollectionHookHandler.php b/HookProvider/CollectionUiHooksProvider.php similarity index 66% rename from HookHandler/CollectionHookHandler.php rename to HookProvider/CollectionUiHooksProvider.php index 0cc373b2..8ad2a1ab 100644 --- a/HookHandler/CollectionHookHandler.php +++ b/HookProvider/CollectionUiHooksProvider.php @@ -9,20 +9,22 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\HookHandler; +namespace Cmfcmf\Module\MediaModule\HookProvider; use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; use Cmfcmf\Module\MediaModule\Entity\HookedObject\HookedObjectCollectionEntity; use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; use Zikula\Bundle\HookBundle\Hook\DisplayHook; +use Zikula\Bundle\HookBundle\Hook\DisplayHookResponse; use Zikula\Bundle\HookBundle\Hook\ProcessHook; use Zikula\Bundle\HookBundle\Hook\ValidationHook; use Zikula\Bundle\HookBundle\Hook\ValidationResponse; /** - * Handles collection hooks. + * Collection ui hooks provider. */ -class CollectionHookHandler extends AbstractHookHandler +class CollectionUiHooksProvider extends AbstractUiHooksProvider { /** * @var CollectionEntity[] @@ -44,6 +46,22 @@ public function setMediaTypeCollection(MediaTypeCollection $mediaTypeCollection) $this->mediaTypeCollection = $mediaTypeCollection; } + public function getTitle() + { + return $this->translator->__('Collection ui hooks provider'); + } + + public function getProviderTypes() + { + return [ + UiHooksCategory::TYPE_DISPLAY_VIEW => 'uiView', + UiHooksCategory::TYPE_FORM_EDIT => 'uiEdit', + UiHooksCategory::TYPE_VALIDATE_EDIT => 'validateEdit', + UiHooksCategory::TYPE_PROCESS_EDIT => 'processEdit', + UiHooksCategory::TYPE_PROCESS_DELETE => 'processDelete' + ]; + } + /** * @param DisplayHook $hook */ @@ -52,12 +70,12 @@ public function uiView(DisplayHook $hook) $repository = $this->entityManager->getRepository('CmfcmfMediaModule:HookedObject\HookedObjectEntity'); $hookedObject = $repository->getByHookOrCreate($hook); - $content = $this->renderEngine->render('CmfcmfMediaModule:Collection:hookView.html.twig', [ + $content = $this->renderEngine->render('@CmfcmfMediaModule/Collection/hookView.html.twig', [ 'hookedObjectCollections' => $hookedObject->getHookedObjectCollections(), 'mediaTypeCollection' => $this->mediaTypeCollection ]); - $this->uiResponse($hook, $content); + $hook->setResponse(new DisplayHookResponse($this->getProviderArea(), $content)); } /** @@ -72,11 +90,12 @@ public function uiEdit(DisplayHook $hook) return $hookedObjectCollectionEntity->getCollection()->getId(); }, $hookedObject->getHookedObjectCollections()->getValues()); - $content = $this->renderEngine->render('CmfcmfMediaModule:Collection:hookEdit.html.twig', [ + $content = $this->renderEngine->render('@CmfcmfMediaModule/Collection/hookEdit.html.twig', [ 'selectedCollections' => $selectedCollections, 'hookedObject' => $hookedObject ]); - $this->uiResponse($hook, $content); + + $hook->setResponse(new DisplayHookResponse($this->getProviderArea(), $content)); } /** @@ -84,9 +103,13 @@ public function uiEdit(DisplayHook $hook) */ public function validateEdit(ValidationHook $hook) { - $request = $this->requestStack->getCurrentRequest()->request; + include_once __DIR__ . '/../bootstrap.php'; - $collectionIds = json_decode($request->get('cmfcmfmediamodule[collections]', "[]", true)); + // TODO migrate this to a FormAware hook provider + $collectionData = $this->requestStack->getCurrentRequest() + ->request->get('cmfcmfmediamodule[collections]', '[]', true); + $collectionData = isset($_POST['cmfcmfmediamodule']['collections']) ? $_POST['cmfcmfmediamodule']['collections'] : []; + $collectionIds = json_decode($collectionData); $this->entities = []; $validationResponse = new ValidationResponse('collections', $collectionIds); @@ -101,7 +124,7 @@ public function validateEdit(ValidationHook $hook) } } - $hook->setValidator($this->getProvider(), $validationResponse); + $hook->setValidator($this->getProviderArea(), $validationResponse); } /** @@ -121,4 +144,12 @@ public function processEdit(ProcessHook $hook) $repository->saveOrDelete($hookedObject); } + + /** + * @return string + */ + private function getProviderArea() + { + return 'provider.cmfcmfmediamodule.ui_hooks.collections'; + } } diff --git a/HookHandler/LicenseHookHandler.php b/HookProvider/LicenseUiHooksProvider.php similarity index 66% rename from HookHandler/LicenseHookHandler.php rename to HookProvider/LicenseUiHooksProvider.php index cc942d0e..642baf99 100644 --- a/HookHandler/LicenseHookHandler.php +++ b/HookProvider/LicenseUiHooksProvider.php @@ -9,24 +9,42 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\HookHandler; +namespace Cmfcmf\Module\MediaModule\HookProvider; use Cmfcmf\Module\MediaModule\Entity\License\LicenseEntity; +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; use Zikula\Bundle\HookBundle\Hook\DisplayHook; +use Zikula\Bundle\HookBundle\Hook\DisplayHookResponse; use Zikula\Bundle\HookBundle\Hook\ProcessHook; use Zikula\Bundle\HookBundle\Hook\ValidationHook; use Zikula\Bundle\HookBundle\Hook\ValidationResponse; /** - * Handles license hooks. + * License ui hooks provider. */ -class LicenseHookHandler extends AbstractHookHandler +class LicenseUiHooksProvider extends AbstractUiHooksProvider { /** * @var LicenseEntity[] */ private $entities; + public function getTitle() + { + return $this->translator->__('License ui hooks provider'); + } + + public function getProviderTypes() + { + return [ + UiHooksCategory::TYPE_DISPLAY_VIEW => 'uiView', + UiHooksCategory::TYPE_FORM_EDIT => 'uiEdit', + UiHooksCategory::TYPE_VALIDATE_EDIT => 'validateEdit', + UiHooksCategory::TYPE_PROCESS_EDIT => 'processEdit', + UiHooksCategory::TYPE_PROCESS_DELETE => 'processDelete' + ]; + } + /** * @param DisplayHook $hook */ @@ -35,10 +53,11 @@ public function uiView(DisplayHook $hook) $repository = $this->entityManager->getRepository('CmfcmfMediaModule:HookedObject\HookedObjectEntity'); $hookedObject = $repository->getByHookOrCreate($hook); - $content = $this->renderEngine->render('CmfcmfMediaModule:License:hookView.html.twig', [ + $content = $this->renderEngine->render('@CmfcmfMediaModule/License/hookView.html.twig', [ 'licenses' => $hookedObject->getLicenses() ]); - $this->uiResponse($hook, $content); + + $hook->setResponse(new DisplayHookResponse($this->getProviderArea(), $content)); } /** @@ -56,12 +75,13 @@ public function uiEdit(DisplayHook $hook) return $licenseEntity->getId(); }, $hookedObject->getLicenses()->getValues()); - $content = $this->renderEngine->render('CmfcmfMediaModule:License:hookEdit.html.twig', [ + $content = $this->renderEngine->render('@CmfcmfMediaModule/License/hookEdit.html.twig', [ 'selectedLicenses' => $selectedIds, 'preferredLicenses' => $preferredLicenses, 'outdatedLicenses' => $outdatedLicenses ]); - $this->uiResponse($hook, $content); + + $hook->setResponse(new DisplayHookResponse($this->getProviderArea(), $content)); } /** @@ -69,8 +89,12 @@ public function uiEdit(DisplayHook $hook) */ public function validateEdit(ValidationHook $hook) { + include_once __DIR__ . '/../bootstrap.php'; + + // TODO migrate this to a FormAware hook provider $licenseIds = $this->requestStack->getCurrentRequest() ->request->get('cmfcmfmediamodule[license]', [], true); + $licenseIds = isset($_POST['cmfcmfmediamodule']['license']) ? $_POST['cmfcmfmediamodule']['license'] : []; $this->entities = []; $validationResponse = new ValidationResponse('license', $licenseIds); @@ -85,7 +109,7 @@ public function validateEdit(ValidationHook $hook) } } - $hook->setValidator($this->getProvider(), $validationResponse); + $hook->setValidator($this->getProviderArea(), $validationResponse); } /** @@ -103,4 +127,12 @@ public function processEdit(ProcessHook $hook) $repository->saveOrDelete($hookedObject); } + + /** + * @return string + */ + private function getProviderArea() + { + return 'provider.cmfcmfmediamodule.ui_hooks.licenses'; + } } diff --git a/HookHandler/MediaHookHandler.php b/HookProvider/MediaUiHooksProvider.php similarity index 71% rename from HookHandler/MediaHookHandler.php rename to HookProvider/MediaUiHooksProvider.php index 33beeb54..e8d0bc79 100644 --- a/HookHandler/MediaHookHandler.php +++ b/HookProvider/MediaUiHooksProvider.php @@ -9,21 +9,23 @@ * file that was distributed with this source code. */ -namespace Cmfcmf\Module\MediaModule\HookHandler; +namespace Cmfcmf\Module\MediaModule\HookProvider; use Cmfcmf\Module\MediaModule\Entity\HookedObject\HookedObjectMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; use Zikula\Bundle\HookBundle\Hook\DisplayHook; +use Zikula\Bundle\HookBundle\Hook\DisplayHookResponse; use Zikula\Bundle\HookBundle\Hook\ProcessHook; use Zikula\Bundle\HookBundle\Hook\ValidationHook; use Zikula\Bundle\HookBundle\Hook\ValidationResponse; /** - * Handles media hooks. + * Media ui hooks provider. */ -class MediaHookHandler extends AbstractHookHandler +class MediaUiHooksProvider extends AbstractUiHooksProvider { /** * @var AbstractMediaEntity[] @@ -45,6 +47,22 @@ public function setMediaTypeCollection(MediaTypeCollection $mediaTypeCollection) $this->mediaTypeCollection = $mediaTypeCollection; } + public function getTitle() + { + return $this->translator->__('Media ui hooks provider'); + } + + public function getProviderTypes() + { + return [ + UiHooksCategory::TYPE_DISPLAY_VIEW => 'uiView', + UiHooksCategory::TYPE_FORM_EDIT => 'uiEdit', + UiHooksCategory::TYPE_VALIDATE_EDIT => 'validateEdit', + UiHooksCategory::TYPE_PROCESS_EDIT => 'processEdit', + UiHooksCategory::TYPE_PROCESS_DELETE => 'processDelete' + ]; + } + /** * @param DisplayHook $hook */ @@ -53,12 +71,12 @@ public function uiView(DisplayHook $hook) $repository = $this->entityManager->getRepository('CmfcmfMediaModule:HookedObject\HookedObjectEntity'); $hookedObject = $repository->getByHookOrCreate($hook); - $content = $this->renderEngine->render('CmfcmfMediaModule:Media:hookView.html.twig', [ + $content = $this->renderEngine->render('@CmfcmfMediaModule/Media/hookView.html.twig', [ 'hookedObjectMedia' => $hookedObject->getHookedObjectMedia(), 'mediaTypeCollection' => $this->mediaTypeCollection ]); - $this->uiResponse($hook, $content); + $hook->setResponse(new DisplayHookResponse($this->getProviderArea(), $content)); } /** @@ -74,11 +92,11 @@ public function uiEdit(DisplayHook $hook) return $hookedObjectMediaEntity->getMedia()->toArrayForFinder($mediaTypeCollection); }, $hookedObject->getHookedObjectMedia()->getValues()); - $content = $this->renderEngine->render('CmfcmfMediaModule:Media:hookEdit.html.twig', [ + $content = $this->renderEngine->render('@CmfcmfMediaModule/Media/hookEdit.html.twig', [ 'selectedMedia' => $selectedMedia, ]); - $this->uiResponse($hook, $content); + $hook->setResponse(new DisplayHookResponse($this->getProviderArea(), $content)); } /** @@ -86,8 +104,12 @@ public function uiEdit(DisplayHook $hook) */ public function validateEdit(ValidationHook $hook) { + include_once __DIR__ . '/../bootstrap.php'; + + // TODO migrate this to a FormAware hook provider $mediaIds = $this->requestStack->getCurrentRequest() ->request->get('cmfcmfmediamodule[media]', [], true); + $mediaIds = isset($_POST['cmfcmfmediamodule']['media']) ? $_POST['cmfcmfmediamodule']['media'] : []; $this->entities = []; $validationResponse = new ValidationResponse('media', $mediaIds); @@ -104,7 +126,7 @@ public function validateEdit(ValidationHook $hook) } } - $hook->setValidator($this->getProvider(), $validationResponse); + $hook->setValidator($this->getProviderArea(), $validationResponse); } /** @@ -122,4 +144,12 @@ public function processEdit(ProcessHook $hook) $repository->saveOrDelete($hookedObject); } + + /** + * @return string + */ + private function getProviderArea() + { + return 'provider.cmfcmfmediamodule.ui_hooks.media'; + } } diff --git a/HookSubscriber/CollectionFilterHooksSubscriber.php b/HookSubscriber/CollectionFilterHooksSubscriber.php new file mode 100644 index 00000000..67f4c3e5 --- /dev/null +++ b/HookSubscriber/CollectionFilterHooksSubscriber.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\HookSubscriber; + +use Zikula\Bundle\HookBundle\Category\FilterHooksCategory; +use Zikula\Bundle\HookBundle\HookSubscriberInterface; +use Zikula\Common\Translator\TranslatorInterface; + +/** + * Collection filter hooks subscriber. + */ +class CollectionFilterHooksSubscriber implements HookSubscriberInterface +{ + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getOwner() + { + return 'CmfcmfMediaModule'; + } + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return FilterHooksCategory::NAME; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Collection filter hooks subscriber'); + } + + /** + * {@inheritdoc} + */ + public function getEvents() + { + return [ + FilterHooksCategory::TYPE_FILTER => 'cmfcmfmediamodule.filter_hooks.collections.filter' + ]; + } +} diff --git a/HookSubscriber/CollectionFormAwareHookSubscriber.php b/HookSubscriber/CollectionFormAwareHookSubscriber.php new file mode 100644 index 00000000..58201dc1 --- /dev/null +++ b/HookSubscriber/CollectionFormAwareHookSubscriber.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\HookSubscriber; + +use Zikula\Bundle\HookBundle\Category\FormAwareCategory; +use Zikula\Bundle\HookBundle\HookSubscriberInterface; +use Zikula\Common\Translator\TranslatorInterface; + +/** + * Collection form aware hook subscriber. + */ +class CollectionFormAwareHookSubscriber implements HookSubscriberInterface +{ + /** + * @var TranslatorInterface + */ + protected $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getOwner() + { + return 'CmfcmfMediaModule'; + } + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return FormAwareCategory::NAME; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Collection form aware subscriber'); + } + + /** + * {@inheritdoc} + */ + public function getEvents() + { + return [ + // Display hook for create/edit forms. + FormAwareCategory::TYPE_EDIT => 'cmfcmfmediamodule.form_aware_hook.collections.edit', + // Process the results of the edit form after the main form is processed. + FormAwareCategory::TYPE_PROCESS_EDIT => 'cmfcmfmediamodule.form_aware_hook.collections.process_edit' + ]; + } +} diff --git a/HookSubscriber/CollectionUiHooksSubscriber.php b/HookSubscriber/CollectionUiHooksSubscriber.php new file mode 100644 index 00000000..bb8ba5ef --- /dev/null +++ b/HookSubscriber/CollectionUiHooksSubscriber.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\HookSubscriber; + +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; +use Zikula\Bundle\HookBundle\HookSubscriberInterface; +use Zikula\Common\Translator\TranslatorInterface; + +/** + * Collection ui hooks subscriber. + */ +class CollectionUiHooksSubscriber implements HookSubscriberInterface +{ + /** + * @var TranslatorInterface + */ + protected $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getOwner() + { + return 'CmfcmfMediaModule'; + } + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return UiHooksCategory::NAME; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Collection ui hooks subscriber'); + } + + /** + * {@inheritdoc} + */ + public function getEvents() + { + return [ + // Display hook for view/display templates. + UiHooksCategory::TYPE_DISPLAY_VIEW => 'cmfcmfmediamodule.ui_hooks.collections.display_view', + // Display hook for create/edit forms. + UiHooksCategory::TYPE_FORM_EDIT => 'cmfcmfmediamodule.ui_hooks.collections.form_edit', + // Validate input from an item to be edited. + UiHooksCategory::TYPE_VALIDATE_EDIT => 'cmfcmfmediamodule.ui_hooks.collections.validate_edit', + // Perform the final update actions for an edited item. + UiHooksCategory::TYPE_PROCESS_EDIT => 'cmfcmfmediamodule.ui_hooks.collections.process_edit', + // Validate input from an item to be deleted. + UiHooksCategory::TYPE_VALIDATE_DELETE => 'cmfcmfmediamodule.ui_hooks.collections.validate_delete', + // Perform the final delete actions for a deleted item. + UiHooksCategory::TYPE_PROCESS_DELETE => 'cmfcmfmediamodule.ui_hooks.collections.process_delete' + ]; + } +} diff --git a/HookSubscriber/MediaFilterHooksSubscriber.php b/HookSubscriber/MediaFilterHooksSubscriber.php new file mode 100644 index 00000000..966bfd2e --- /dev/null +++ b/HookSubscriber/MediaFilterHooksSubscriber.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\HookSubscriber; + +use Zikula\Bundle\HookBundle\Category\FilterHooksCategory; +use Zikula\Bundle\HookBundle\HookSubscriberInterface; +use Zikula\Common\Translator\TranslatorInterface; + +/** + * Media filter hooks subscriber. + */ +class MediaFilterHooksSubscriber implements HookSubscriberInterface +{ + /** + * @var TranslatorInterface + */ + private $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getOwner() + { + return 'CmfcmfMediaModule'; + } + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return FilterHooksCategory::NAME; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Media filter hooks subscriber'); + } + + /** + * {@inheritdoc} + */ + public function getEvents() + { + return [ + FilterHooksCategory::TYPE_FILTER => 'cmfcmfmediamodule.filter_hooks.media.filter' + ]; + } +} diff --git a/HookSubscriber/MediaFormAwareHookSubscriber.php b/HookSubscriber/MediaFormAwareHookSubscriber.php new file mode 100644 index 00000000..1aba193e --- /dev/null +++ b/HookSubscriber/MediaFormAwareHookSubscriber.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\HookSubscriber; + +use Zikula\Bundle\HookBundle\Category\FormAwareCategory; +use Zikula\Bundle\HookBundle\HookSubscriberInterface; +use Zikula\Common\Translator\TranslatorInterface; + +/** + * Media form aware hook subscriber. + */ +class MediaFormAwareHookSubscriber implements HookSubscriberInterface +{ + /** + * @var TranslatorInterface + */ + protected $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getOwner() + { + return 'CmfcmfMediaModule'; + } + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return FormAwareCategory::NAME; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Media form aware subscriber'); + } + + /** + * {@inheritdoc} + */ + public function getEvents() + { + return [ + // Display hook for create/edit forms. + FormAwareCategory::TYPE_EDIT => 'cmfcmfmediamodule.form_aware_hook.media.edit', + // Process the results of the edit form after the main form is processed. + FormAwareCategory::TYPE_PROCESS_EDIT => 'cmfcmfmediamodule.form_aware_hook.media.process_edit' + ]; + } +} diff --git a/HookSubscriber/MediaUiHooksSubscriber.php b/HookSubscriber/MediaUiHooksSubscriber.php new file mode 100644 index 00000000..5eb0936a --- /dev/null +++ b/HookSubscriber/MediaUiHooksSubscriber.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\HookSubscriber; + +use Zikula\Bundle\HookBundle\Category\UiHooksCategory; +use Zikula\Bundle\HookBundle\HookSubscriberInterface; +use Zikula\Common\Translator\TranslatorInterface; + +/** + * Media ui hooks subscriber. + */ +class MediaUiHooksSubscriber implements HookSubscriberInterface +{ + /** + * @var TranslatorInterface + */ + protected $translator; + + /** + * @param TranslatorInterface $translator + */ + public function __construct(TranslatorInterface $translator) + { + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getOwner() + { + return 'CmfcmfMediaModule'; + } + + /** + * {@inheritdoc} + */ + public function getCategory() + { + return UiHooksCategory::NAME; + } + + /** + * {@inheritdoc} + */ + public function getTitle() + { + return $this->translator->__('Media ui hooks subscriber'); + } + + /** + * {@inheritdoc} + */ + public function getEvents() + { + return [ + // Display hook for view/display templates. + UiHooksCategory::TYPE_DISPLAY_VIEW => 'cmfcmfmediamodule.ui_hooks.media.display_view', + // Display hook for create/edit forms. + UiHooksCategory::TYPE_FORM_EDIT => 'cmfcmfmediamodule.ui_hooks.media.form_edit', + // Validate input from an item to be edited. + UiHooksCategory::TYPE_VALIDATE_EDIT => 'cmfcmfmediamodule.ui_hooks.media.validate_edit', + // Perform the final update actions for an edited item. + UiHooksCategory::TYPE_PROCESS_EDIT => 'cmfcmfmediamodule.ui_hooks.media.process_edit', + // Validate input from an item to be deleted. + UiHooksCategory::TYPE_VALIDATE_DELETE => 'cmfcmfmediamodule.ui_hooks.media.validate_delete', + // Perform the final delete actions for a deleted item. + UiHooksCategory::TYPE_PROCESS_DELETE => 'cmfcmfmediamodule.ui_hooks.media.process_delete' + ]; + } +} diff --git a/Imagine/Cache/DummySigner.php b/Imagine/Cache/DummySigner.php new file mode 100644 index 00000000..de356058 --- /dev/null +++ b/Imagine/Cache/DummySigner.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\Imagine\Cache; + +use Liip\ImagineBundle\Imagine\Cache\SignerInterface; + +/** + * Temporary dummy signer until https://github.com/zikula/core/issues/3902 has been resolved. + */ +class DummySigner implements SignerInterface +{ + /** + * @var string + */ + protected $secret; + + /** + * @param string $secret + */ + public function __construct($secret) + { + $this->secret = $secret; + } + + /** + * {@inheritdoc} + */ + public function sign($path, array $runtimeConfig = null) + { + if ($runtimeConfig) { + array_walk_recursive($runtimeConfig, function (&$value) { + $value = (string) $value; + }); + } + + return substr(preg_replace('/[^a-zA-Z0-9-_]/', '', base64_encode(hash_hmac('sha256', ltrim($path, '/').(null === $runtimeConfig ?: serialize($runtimeConfig)), $this->secret, true))), 0, 8); + } + + /** + * {@inheritdoc} + */ + public function check($hash, $path, array $runtimeConfig = null) + { + return true; //$hash === $this->sign($path, $runtimeConfig); + } +} diff --git a/Imagine/Filter/Loader/CustomImageFilter.php b/Imagine/Filter/Loader/CustomImageFilter.php new file mode 100644 index 00000000..b11ce298 --- /dev/null +++ b/Imagine/Filter/Loader/CustomImageFilter.php @@ -0,0 +1,182 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\Imagine\Filter\Loader; + +use Cmfcmf\Module\MediaModule\Font\FontCollection; +use Doctrine\ORM\EntityManagerInterface; +use Imagine\Filter\Basic\Autorotate; +use Imagine\Filter\Basic\Paste; +use Imagine\Filter\Basic\WebOptimization; +use Imagine\Filter\Transformation; +use Imagine\Image\ImageInterface; +use Imagine\Image\ImagineInterface; +use Imagine\Image\Point; +use Liip\ImagineBundle\Imagine\Filter\Loader\LoaderInterface; + +class CustomImageFilter implements LoaderInterface +{ + /** + * @var ImagineInterface + */ + private $imagine; + + /** + * @var EntityManagerInterface + */ + private $em; + + /** + * @var FontCollection + */ + private $fontCollection; + + /** + * @param ImagineInterface $imagine + * @param EntityManagerInterface $em + * @param FontCollection $fontCollection + */ + public function __construct( + ImagineInterface $imagine, + EntityManagerInterface $em, + FontCollection $fontCollection + ) { + $this->imagine = $imagine; + $this->em = $em; + $this->fontCollection = $fontCollection; + } + + /** + * @param ImageInterface $image + * @param array $options + * + * @return ImageInterface + */ + public function load(ImageInterface $image, array $options = []) + { + $transformation = $this->getTransformation(); + + return $transformation->apply($image); + } + + /** + * @param array $options + * + * @return Transformation + */ + protected function getTransformation(array $options = []) + { + $transformation = new Transformation(); + if (isset($options['optimize']) && $options['optimize']) { + // Optimize for web and rotate the images (after thumbnail creation). + $transformation + ->add(new Autorotate(), 101) + ->add(new WebOptimization(), 2) + ; + } + + if (!isset($options['watermark']) || null === $options['watermark'] || !is_array($options['watermark']) || !count($options['watermark'])) { + // The image shall not be watermarked. + return $transformation; + } + $watermark = $this->em->getRepository('CmfcmfMediaModule:Watermark\\AbstractWatermarkEntity')->find($options['watermark']); + if (null === $watermark) { + // watermark not found + return $transformation; + } + + // TODO consider replacing custom watermark processing by existing watermark filter + // check http://symfony.com/doc/current/bundles/LiipImagineBundle/filters/general.html#watermark + + // Generate the watermark image. + // It will already be correctly sized for the thumbnail. + + $wWidth = $wHeight = 0; + if (isset($options['mode']) && ImageInterface::THUMBNAIL_OUTBOUND == $options['mode']) { + $wWidth = $options['width']; + $wHeight = $options['height']; + } elseif (!isset($options['mode']) || ImageInterface::THUMBNAIL_INSET == $options['mode']) { + $imageSize = getimagesize($options['file']); + + $ratios = [ + $options['width'] / $imageSize[0], + $options['height'] / $imageSize[1] + ]; + $wWidth = min($ratios) * $imageSize[0]; + $wHeight = min($ratios) * $imageSize[1]; + } else { + throw new \LogicException(); + } + + // Check whether the image is big enough to be watermarked. + if (null !== $watermark['minSizeX'] && $wWidth < $watermark['minSizeX']) { + return $transformation; + } + if (null !== $watermark['minSizeY'] && $wHeight < $watermark['minSizeY']) { + return $transformation; + } + + $watermarkImage = $watermark->getImagineImage($this->imagine, $this->fontCollection, $wWidth, $wHeight); + $watermarkSize = $watermarkImage->getSize(); + + // Calculate watermark position. If the position is negative, handle + // it as an offset from the bottom / the right side of the image. + $x = $watermark->getPositionX(); + $y = $watermark->getPositionY(); + if ($x < 0) { + $x += $wWidth - $watermarkSize->getWidth(); + } + if ($y < 0) { + $y += $wHeight - $watermarkSize->getHeight(); + } + + // If the watermark still exceeds the image's width or height, resize the watermark. + if ($x < 0 || $y < 0 || $x + $watermarkSize->getWidth() > $wWidth || $y + $watermarkSize->getHeight() > $wHeight) { + $xOffset = 0; + if ($x < 0) { + $xOffset = $x * -1; + } + $yOffset = 0; + if ($y < 0) { + $yOffset = $y * -1; + } + + $ratios = [ + ($watermarkSize->getWidth() - $xOffset) / $watermarkSize->getWidth(), + ($watermarkSize->getHeight() - $yOffset) / $watermarkSize->getHeight() + ]; + $watermarkSize = $watermarkSize->scale(min($ratios)); + $watermarkImage->resize($watermarkSize); + + $x = round($watermark->getPositionX() + $wWidth - $watermarkSize->getWidth()); + $y = round($watermark->getPositionY() + $wHeight - $watermarkSize->getHeight()); + + $xOffset = 0; + if ($x + $watermarkSize->getWidth() > $wWidth) { + $xOffset = $x + $watermarkSize->getWidth() - $wWidth; + } + $yOffset = 0; + if ($y + $watermarkSize->getHeight() > $wHeight) { + $yOffset = $y + $watermarkSize->getHeight() - $wHeight; + } + $ratios = [ + ($watermarkSize->getWidth() - $xOffset) / $watermarkSize->getWidth(), + ($watermarkSize->getHeight() - $yOffset) / $watermarkSize->getHeight() + ]; + $watermarkImage->resize($watermarkSize->scale(min($ratios))); + } + + $point = new Point($x, $y); + $transformation->add(new Paste($watermarkImage, $point), 100); + + return $transformation; + } +} diff --git a/Importer/AbstractImporter.php b/Importer/AbstractImporter.php index e0ffcbea..f557cdeb 100644 --- a/Importer/AbstractImporter.php +++ b/Importer/AbstractImporter.php @@ -13,7 +13,9 @@ use Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection; use Doctrine\ORM\EntityManagerInterface; +use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Form\FormFactory; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Translation\TranslatorInterface; abstract class AbstractImporter implements ImporterInterface @@ -23,6 +25,11 @@ abstract class AbstractImporter implements ImporterInterface */ protected $translator; + /** + * @var Filesystem + */ + protected $filesystem; + /** * @var FormFactory */ @@ -38,12 +45,41 @@ abstract class AbstractImporter implements ImporterInterface */ protected $em; - public function __construct(TranslatorInterface $translator, FormFactory $formFactory, MediaTypeCollection $mediaTypeCollection, EntityManagerInterface $em) - { + /** + * @var RequestStack + */ + protected $requestStack; + + /** + * @var string + */ + protected $dataDirectory; + + /** + * @param TranslatorInterface $translator + * @param Filesystem $filesystem + * @param FormFactory $formFactory + * @param MediaTypeCollection $mediaTypeCollection + * @param EntityManagerInterface $em + * @param RequestStack $requestStack + * @param string $dataDirectory + */ + public function __construct( + TranslatorInterface $translator, + Filesystem $filesystem, + FormFactory $formFactory, + MediaTypeCollection $mediaTypeCollection, + EntityManagerInterface $em, + RequestStack $requestStack, + $dataDirectory + ) { $this->translator = $translator; + $this->filesystem = $filesystem; $this->formFactory = $formFactory; $this->mediaTypeCollection = $mediaTypeCollection; $this->em = $em; + $this->requestStack = $requestStack; + $this->dataDirectory = $dataDirectory; } public function getId() @@ -51,14 +87,12 @@ public function getId() $type = $this->getType(); $type = strtolower($type); - return "cmfcmfmediamodule:$type"; + return 'cmfcmfmediamodule:' . $type; } public function getSettingsForm() { - $form = 'Cmfcmf\\Module\\MediaModule\\Form\\Importer\\' . $this->getType() . 'Type'; - - return new $form($this->translator); + return 'Cmfcmf\\Module\\MediaModule\\Form\\Importer\\' . $this->getType() . 'Type'; } /** diff --git a/Importer/DownloadsModuleImporter.php b/Importer/DownloadsModuleImporter.php index a5f40d79..e5e16690 100644 --- a/Importer/DownloadsModuleImporter.php +++ b/Importer/DownloadsModuleImporter.php @@ -16,7 +16,6 @@ use Cmfcmf\Module\MediaModule\Entity\Media\UrlEntity; use Doctrine\DBAL\Exception\TableNotFoundException; use Stof\DoctrineExtensionsBundle\Uploadable\UploadableManager; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; @@ -27,11 +26,13 @@ class DownloadsModuleImporter extends AbstractImporter FROM downloads_downloads WHERE cid = ? SQL; + const DOWNLOAD_CATEGORY_QUERY = <<<'SQL' SELECT cid, pid, title, description FROM downloads_categories ORDER BY pid ASC SQL; + /** * @var UploadableManager */ @@ -40,7 +41,7 @@ class DownloadsModuleImporter extends AbstractImporter /** * @var string */ - private $fileDirectory; + private $fileDirectory = '/Downloads'; public function getTitle() { @@ -60,11 +61,11 @@ public function checkRequirements() $conn->executeQuery('SELECT 1 FROM downloads_categories LIMIT 1'); $conn->executeQuery('SELECT 1 FROM downloads_downloads LIMIT 1'); } catch (TableNotFoundException $e) { - return $this->translator->trans('Please install the Downloads Module or import it\'s tables into the database.'); + return $this->translator->trans('Please install the Downloads Module or import it\'s tables into the database.', [], 'cmfcmfmediamodule'); } - $fs = new Filesystem(); - if (!$fs->exists($this->fileDirectory)) { - return $this->translator->trans('The uploaded files are missing. Make sure %path% contains the uploaded files.', ['%path%' => $this->fileDirectory], 'cmfcmfmediamodule'); + + if (!$this->filesystem->exists($this->dataDirectory . $this->fileDirectory)) { + return $this->translator->trans('The uploaded files are missing. Make sure %path% contains the uploaded files.', ['%path%' => $this->dataDirectory . $this->fileDirectory], 'cmfcmfmediamodule'); } return true; @@ -75,11 +76,6 @@ public function setUploadManager(UploadableManager $uploadManager) $this->uploadManager = $uploadManager; } - public function setUserDataDirectory($userDataDir) - { - $this->fileDirectory = $userDataDir . '/Downloads'; - } - public function import($formData, FlashBagInterface $flashBag) { /** @var CollectionEntity $collection */ @@ -101,22 +97,22 @@ public function import($formData, FlashBagInterface $flashBag) $downloadResult = $conn->executeQuery(self::DOWNLOADS_QUERY, [$downloadCollection['cid']]); while ($download = $downloadResult->fetch(\PDO::FETCH_ASSOC)) { if (!empty($download['filename'])) { - $file = new File($this->fileDirectory . '/' . $download['filename']); + $file = new File($this->dataDirectory . $this->fileDirectory . '/' . $download['filename']); $mediaType = $this->mediaTypeCollection->getBestUploadableMediaTypeForFile($file); $entityClass = $mediaType->getEntityClass(); /** @var AbstractFileEntity $entity */ - $entity = new $entityClass(); + $entity = new $entityClass($this->requestStack, $this->dataDirectory); $this->uploadManager->markEntityToUpload($entity, ImportedFile::fromFile($file)); } else { - $entity = new UrlEntity(); + $entity = new UrlEntity($this->requestStack, $this->dataDirectory); $entity->setUrl($download['url']); } $entity ->setTitle($download['title']) ->setDescription($download['description']) ->setCollection($collection) - //->setCreatedUserId() - //->setUpdatedUserId() + //->setCreatedBy() + //->setUpdatedBy() ->setCreatedDate(new \DateTime($download['ddate'])) ->setUpdatedDate(new \DateTime($download['uupdate'])) ; diff --git a/Importer/ServerDirectoryImporter.php b/Importer/ServerDirectoryImporter.php index f5a817df..0c0e4773 100644 --- a/Importer/ServerDirectoryImporter.php +++ b/Importer/ServerDirectoryImporter.php @@ -66,27 +66,27 @@ public function import($formData, FlashBagInterface $flashBag) ->depth($formData['importSettings']['includeSubDirectories'] ? '>=0' : '==0') ->files() ; - $collectionMapping = ["" => $rootCollection]; + $collectionMapping = ['' => $rootCollection]; $c = 0; /** @var SplFileInfo $finderFile */ foreach ($finder as $finderFile) { $file = new File($finderFile->getPathname(), false); $selectedMediaType = $this->mediaTypeCollection->getBestUploadableMediaTypeForFile($file); - if ($selectedMediaType === null) { + if (null === $selectedMediaType) { $flashBag->add('warning', $this->translator->trans('Could not import file %file%, because this kind of media isn\'t yet supported by the MediaModule.', ['%file%' => $file->getPathname()], 'cmfcmfmediamodule')); continue; } $entityClass = $selectedMediaType->getEntityClass(); /** @var AbstractFileEntity $entity */ - $entity = new $entityClass(); + $entity = new $entityClass($this->requestStack, $this->dataDirectory); $relativePath = $finderFile->getRelativePath(); - if ($formData['importSettings']['createSubCollectionsForSubDirectories'] && $relativePath != "") { + if ($formData['importSettings']['createSubCollectionsForSubDirectories'] && "" != $relativePath) { if (!isset($collectionMapping[$relativePath])) { $collection = new CollectionEntity(); $lastSeparator = strrpos($relativePath, DIRECTORY_SEPARATOR); $collection->setParent($collectionMapping[substr($relativePath, 0, (int)$lastSeparator)]); - $collection->setTitle(substr($relativePath, $lastSeparator === false ? 0 : $lastSeparator + 1)); + $collection->setTitle(substr($relativePath, false === $lastSeparator ? 0 : $lastSeparator + 1)); $this->em->persist($collection); $collectionMapping[$relativePath] = $collection; } @@ -100,7 +100,7 @@ public function import($formData, FlashBagInterface $flashBag) $this->em->persist($entity); $c++; - if ($c % 50 == 0) { + if (0 == $c % 50) { $this->em->flush(); } } diff --git a/Importer/VerySimpleDownloadsModuleImporter.php b/Importer/VerySimpleDownloadsModuleImporter.php index 796b6d47..36542c2e 100644 --- a/Importer/VerySimpleDownloadsModuleImporter.php +++ b/Importer/VerySimpleDownloadsModuleImporter.php @@ -17,9 +17,9 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\DBAL\Exception\TableNotFoundException; use Stof\DoctrineExtensionsBundle\Uploadable\UploadableManager; -use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpFoundation\File\File; use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; +use Zikula\CategoriesModule\Entity\RepositoryInterface\CategoryRegistryRepositoryInterface; class VerySimpleDownloadsModuleImporter extends AbstractImporter { @@ -28,10 +28,15 @@ class VerySimpleDownloadsModuleImporter extends AbstractImporter */ private $uploadManager; + /** + * @var CategoryRegistryRepositoryInterface + */ + private $categoryRegistryRepository; + /** * @var string */ - private $fileDirectory; + private $fileDirectory = '/VerySimpleDownload/downloads/fileupload'; public function getTitle() { @@ -59,9 +64,8 @@ public function checkRequirements() return $this->translator->trans('Please install the VerySimpleDownloads Module or import it\'s tables into the database.', [], 'cmfcmfmediamodule'); } - $fs = new Filesystem(); - if (!$fs->exists($this->fileDirectory)) { - return $this->translator->trans('The uploaded files are missing. Make sure %path% contains the uploaded files.', ['%path%' => $this->fileDirectory], 'cmfcmfmediamodule'); + if (!$this->filesystem->exists($this->dataDirectory . $this->fileDirectory)) { + return $this->translator->trans('The uploaded files are missing. Make sure %path% contains the uploaded files.', ['%path%' => $this->dataDirectory . $this->fileDirectory], 'cmfcmfmediamodule'); } return true; @@ -72,20 +76,24 @@ public function setUploadManager(UploadableManager $uploadManager) $this->uploadManager = $uploadManager; } - public function setUserDataDirectory($userDataDir) + public function setCategoryRegistryRepository(CategoryRegistryRepositoryInterface $categoryRegistryRepository) { - $this->fileDirectory = $userDataDir . '/VerySimpleDownload/downloads/fileupload'; + $this->categoryRegistryRepository = $categoryRegistryRepository; } public function import($formData, FlashBagInterface $flashBag) { /** @var CollectionEntity $collection */ $collection = $formData['collection']; - $categoryRegistry = \CategoryRegistryUtil::getRegisteredModuleCategory('CmfcmfMediaModule', 'AbstractMediaEntity', 'Main'); + $categoryRegistry = $this->categoryRegistryRepository->findOneBy([ + 'modname' => 'CmfcmfMediaModule', + 'entityname' => 'AbstractMediaEntity', + 'property' => 'Main' + ]); $conn = $this->em->getConnection(); $result = $conn->executeQuery(<<<'SQL' -SELECT d.id, d.downloadTitle, d.downloadDescription, d.fileUpload, d.createdUserId, d.updatedUserId, d.createdDate, d.updatedDate, c.categoryId +SELECT d.id, d.downloadTitle, d.downloadDescription, d.fileUpload, d.createdBy, d.updatedBy, d.createdDate, d.updatedDate, c.categoryId FROM vesido_download d LEFT JOIN vesido_download_category c ON c.entityId = d.id SQL @@ -95,17 +103,17 @@ public function import($formData, FlashBagInterface $flashBag) if ($lastId != $download['id']) { $lastId = $download['id']; - $file = new File($this->fileDirectory . '/' . $download['fileUpload']); + $file = new File($this->dataDirectory . $this->fileDirectory . '/' . $download['fileUpload']); $mediaType = $this->mediaTypeCollection->getBestUploadableMediaTypeForFile($file); $entityClass = $mediaType->getEntityClass(); /** @var AbstractFileEntity $entity */ - $entity = new $entityClass(); + $entity = new $entityClass($this->requestStack, $this->dataDirectory); $entity ->setTitle($download['downloadTitle']) ->setDescription($download['downloadDescription']) ->setCollection($collection) - ->setCreatedUserId($download['createdUserId']) - ->setUpdatedUserId($download['updatedUserId']) + ->setCreatedBy($download['createdBy']) + ->setUpdatedBy($download['updatedBy']) ->setCreatedDate(new \DateTime($download['createdDate'])) ->setUpdatedDate(new \DateTime($download['updatedDate'])) ; diff --git a/Listener/DoctrineListener.php b/Listener/DoctrineListener.php index fc2193a5..bed124b9 100644 --- a/Listener/DoctrineListener.php +++ b/Listener/DoctrineListener.php @@ -33,20 +33,26 @@ public function getSubscribedEvents() public function uploadablePostFileProcess(UploadablePostFileProcessEventArgs $args) { $entity = $args->getEntity(); - if ($entity instanceof AudioEntity) { - /** @var AudioEntity $entity */ - if ($entity->getMimeType() == 'application/octet-stream') { - if (pathinfo($args->getFileInfo()->getName(), PATHINFO_EXTENSION) == 'mp3') { - $om = $args->getEntityManager(); - $uow = $om->getUnitOfWork(); - $meta = $om->getClassMetadata(get_class($entity)); - $config = $args->getListener()->getConfiguration($om, $meta->name); + if (!($entity instanceof AudioEntity)) { + return; + } + + /** @var AudioEntity $entity */ + if ('application/octet-stream' != $entity->getMimeType()) { + return; + } - $this->updateField($entity, $uow, $meta, $config['fileMimeTypeField'], 'audio/mp3'); - $uow->recomputeSingleEntityChangeSet($meta, $entity); - } - } + if ('mp3' != pathinfo($args->getFileInfo()->getName(), PATHINFO_EXTENSION)) { + return; } + + $om = $args->getEntityManager(); + $uow = $om->getUnitOfWork(); + $meta = $om->getClassMetadata(get_class($entity)); + $config = $args->getListener()->getConfiguration($om, $meta->name); + + $this->updateField($entity, $uow, $meta, $config['fileMimeTypeField'], 'audio/mp3'); + $uow->recomputeSingleEntityChangeSet($meta, $entity); } /** diff --git a/Listener/EntityLifecycleListener.php b/Listener/EntityLifecycleListener.php new file mode 100644 index 00000000..1b47ee8a --- /dev/null +++ b/Listener/EntityLifecycleListener.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Cmfcmf\Module\MediaModule\Listener; + +use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; +use Cmfcmf\Module\MediaModule\Entity\Watermark\AbstractWatermarkEntity; +use Doctrine\Common\EventSubscriber; +use Doctrine\Common\Persistence\Event\LifecycleEventArgs; +use Doctrine\ORM\Events; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerAwareTrait; +use Symfony\Component\DependencyInjection\ContainerInterface; + +/** + * Event subscriber class for entity lifecycle events. + */ +class EntityLifecycleListener implements EventSubscriber, ContainerAwareInterface +{ + use ContainerAwareTrait; + + /** + * @param ContainerInterface $container + */ + public function __construct(ContainerInterface $container) + { + $this->setContainer($container); + } + + /** + * Returns list of events to subscribe. + * + * @return string[] List of events + */ + public function getSubscribedEvents() + { + return [ + Events::postLoad + ]; + } + + /** + * @param LifecycleEventArgs $args Event arguments + */ + public function postLoad(LifecycleEventArgs $args) + { + $entity = $args->getObject(); + if (!$this->isEntityManagedByThisBundle($entity)) { + return; + } + + // TODO refactor these dependencies out of the entities + if ($entity instanceof AbstractMediaEntity || $entity instanceof AbstractWatermarkEntity) { + $entity->setRequestStack($this->container->get('request_stack')); + $entity->setDataDirectory($this->container->getParameter('datadir')); + } + } + + /** + * Checks whether this listener is responsible for the given entity or not. + * + * @param EntityAccess $entity The given entity + * + * @return boolean True if entity is managed by this listener, false otherwise + */ + protected function isEntityManagedByThisBundle($entity) + { + $entityClassParts = explode('\\', get_class($entity)); + + return 'Cmfcmf' == $entityClassParts[0] && 'MediaModule' == $entityClassParts[2]; + } +} diff --git a/Listener/ModuleListener.php b/Listener/ModuleListener.php index 32b1b75b..16d86a49 100644 --- a/Listener/ModuleListener.php +++ b/Listener/ModuleListener.php @@ -40,7 +40,7 @@ public function __construct(EntityManagerInterface $em) public static function getSubscribedEvents() { return [ - CoreEvents::MODULE_REMOVE => 'moduleRemoved', + CoreEvents::MODULE_REMOVE => 'moduleRemoved' ]; } diff --git a/Listener/ThirdPartyListener.php b/Listener/ThirdPartyListener.php index 4b8a685a..e4c975da 100644 --- a/Listener/ThirdPartyListener.php +++ b/Listener/ThirdPartyListener.php @@ -13,89 +13,176 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Filesystem\Filesystem; -use Zikula_Event; +use Symfony\Component\HttpFoundation\RequestStack; +use Zikula\Core\Event\GenericEvent; +use Zikula\ScribiteModule\Event\EditorHelperEvent; /** * Listens to Scribite events. */ class ThirdPartyListener implements EventSubscriberInterface { - /** - * @var string - */ - private $zikulaRoot; - /** * @var Filesystem */ - private $fs; + protected $filesystem; /** - * @var string + * @var RequestStack */ - private $resourceRoot; + protected $requestStack; /** - * @param string $kernelRootDir The kernel root directory. + * @param Filesystem $filesystem + * @param RequestStack $requestStack */ - public function __construct($kernelRootDir) + public function __construct(Filesystem $filesystem, RequestStack $requestStack) { - $this->zikulaRoot = realpath($kernelRootDir . '/..'); - $this->resourceRoot = realpath(__DIR__ . '/../Resources'); - $this->fs = new Filesystem(); + $this->filesystem = $filesystem; + $this->requestStack = $requestStack; } /** - * {@inheritdoc} + * Makes our handlers known to the event system. */ public static function getSubscribedEvents() { return [ - 'moduleplugin.ckeditor.externalplugins' => 'getCKEditorPlugins', - 'module.scribite.editorhelpers' => 'getScribiteEditorHelpers' + 'module.scribite.editorhelpers' => ['getEditorHelpers', 5], + 'moduleplugin.ckeditor.externalplugins' => ['getCKEditorPlugins', 5], + 'moduleplugin.quill.externalplugins' => ['getQuillPlugins', 5], + 'moduleplugin.summernote.externalplugins' => ['getSummernotePlugins', 5], + 'moduleplugin.tinymce.externalplugins' => ['getTinyMcePlugins', 5] ]; } /** - * Adds external plugin to CKEditor. + * Listener for the `module.scribite.editorhelpers` event. * - * @param Zikula_Event $event The event instance. - */ - public function getCKEditorPlugins(Zikula_Event $event) - { - $plugins = $event->getSubject(); - $plugins->add([ - 'name' => 'cmfcmfmediamodule', - 'path' => $this->fs->makePathRelative($this->resourceRoot . '/public/js/CKEditorPlugin', $this->zikulaRoot), - 'file' => 'plugin.js', - 'img' => $this->fs->makePathRelative($this->resourceRoot . '/public/images', $this->zikulaRoot) . 'admin.png' - ]); - } - - /** - * Adds extra JS to load on pages using the Scribite editor. + * This occurs when Scribite adds pagevars to the editor page. + * CmfcmfMediaModule will use this to add a javascript helper to add custom items. * - * @param Zikula_Event $event + * You can access general data available in the event. + * + * The event name: + * `echo 'Event: ' . $event->getName();` + * + * @param EditorHelperEvent $event The event instance */ - public function getScribiteEditorHelpers(Zikula_Event $event) + public function getEditorHelpers(EditorHelperEvent $event) { - // intended is using the add() method to add a helper like below - $helpers = $event->getSubject(); + // install assets for Scribite plugins + $targetDir = 'web/modules/cmfcmfmedia'; + if (!$this->filesystem->exists($targetDir)) { + $moduleDirectory = str_replace('Listener', '', __DIR__); + if (is_dir($originDir = $moduleDirectory . 'Resources/public')) { + $this->filesystem->symlink($originDir, $targetDir, true); + } + } + $basePath = $this->requestStack->getCurrentRequest()->getBasePath(); + $helpers = $event->getHelperCollection(); $helpers->add([ 'module' => 'CmfcmfMediaModule', 'type' => 'javascript', - 'path' => $this->fs->makePathRelative($this->resourceRoot . '/public/js/vendor', $this->zikulaRoot) . 'toastr.min.js' + 'path' => $basePath . '/web/modules/cmfcmfmedia/js/vendor/toastr.min.js' ]); $helpers->add([ 'module' => 'CmfcmfMediaModule', 'type' => 'stylesheet', - 'path' => $this->fs->makePathRelative($this->resourceRoot . '/public/css/vendor', $this->zikulaRoot) . 'toastr.min.css' + 'path' => $basePath . '/web/modules/cmfcmfmedia/css/vendor/toastr.min.css' + ]); + $helpers->add([ + 'module' => 'CmfcmfMediaModule', + 'type' => 'javascript', + 'path' => $basePath . '/web/modules/cmfcmfmedia/js/util.js' ]); $helpers->add([ 'module' => 'CmfcmfMediaModule', 'type' => 'javascript', - 'path' => $this->fs->makePathRelative($this->resourceRoot . '/public/js', $this->zikulaRoot) . 'util.js' + 'path' => $basePath . '/web/modules/cmfcmfmedia/js/Finder/opener.js' + ]); + } + + /** + * Listener for the `moduleplugin.ckeditor.externalplugins` event. + * + * Adds external plugin to CKEditor. + * + * You can access general data available in the event. + * + * The event name: + * `echo 'Event: ' . $event->getName();` + * + * @param GenericEvent $event The event instance + */ + public function getCKEditorPlugins(GenericEvent $event) + { + $event->getSubject()->add([ + 'name' => 'cmfcmfmediamodule', + 'path' => $this->requestStack->getCurrentRequest()->getBasePath() . '/web/modules/cmfcmfmedia/scribite/CKEditor/cmfcmfmediamodule/', + 'file' => 'plugin.js', + 'img' => 'ed_cmfcmfmediamodule.gif' + ]); + } + + /** + * Listener for the `moduleplugin.quill.externalplugins` event. + * + * Adds external plugin to Quill. + * + * You can access general data available in the event. + * + * The event name: + * `echo 'Event: ' . $event->getName();` + * + * @param GenericEvent $event The event instance + */ + public function getQuillPlugins(GenericEvent $event) + { + $event->getSubject()->add([ + 'name' => 'cmfcmfmediamodule', + 'path' => $this->requestStack->getCurrentRequest()->getBasePath() . '/web/modules/cmfcmfmedia/scribite/Quill/cmfcmfmediamodule/plugin.js' + ]); + } + + /** + * Listener for the `moduleplugin.summernote.externalplugins` event. + * + * Adds external plugin to Summernote. + * + * You can access general data available in the event. + * + * The event name: + * `echo 'Event: ' . $event->getName();` + * + * @param GenericEvent $event The event instance + */ + public function getSummernotePlugins(GenericEvent $event) + { + $event->getSubject()->add([ + 'name' => 'cmfcmfmediamodule', + 'path' => $this->requestStack->getCurrentRequest()->getBasePath() . '/web/modules/cmfcmfmedia/scribite/Summernote/cmfcmfmediamodule/plugin.js' + ]); + } + + /** + * Listener for the `moduleplugin.tinymce.externalplugins` event. + * + * Adds external plugin to TinyMce. + * + * You can access general data available in the event. + * + * The event name: + * `echo 'Event: ' . $event->getName();` + * + * @param GenericEvent $event The event instance + */ + public function getTinyMcePlugins(GenericEvent $event) + { + $event->getSubject()->add([ + 'name' => 'cmfcmfmediamodule', + 'path' => $this->requestStack->getCurrentRequest()->getBasePath() . '/web/modules/cmfcmfmedia/scribite/TinyMce/cmfcmfmediamodule/plugin.js' ]); } } diff --git a/MediaModuleInstaller.php b/MediaModuleInstaller.php index e4154995..c64e64dd 100644 --- a/MediaModuleInstaller.php +++ b/MediaModuleInstaller.php @@ -12,10 +12,20 @@ namespace Cmfcmf\Module\MediaModule; use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity; +use Cmfcmf\Module\MediaModule\Entity\Collection\CollectionCategoryAssignmentEntity; +use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; +use Cmfcmf\Module\MediaModule\Entity\Media\MediaCategoryAssignmentEntity; +use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\AbstractPermissionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\GroupPermissionEntity; use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\OwnerPermissionEntity; +use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\UserPermissionEntity; +use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\Restriction\PasswordPermissionRestrictionEntity; +use Cmfcmf\Module\MediaModule\Entity\Collection\Permission\Restriction\AbstractPermissionRestrictionEntity; use Cmfcmf\Module\MediaModule\Entity\License\LicenseEntity; +use Cmfcmf\Module\MediaModule\Entity\Watermark\AbstractWatermarkEntity; +use Cmfcmf\Module\MediaModule\Entity\Watermark\TextWatermarkEntity; use Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionSecurityTree; +use Zikula\CategoriesModule\Entity\CategoryRegistryEntity; use Zikula\Core\AbstractExtensionInstaller; class MediaModuleInstaller extends AbstractExtensionInstaller @@ -39,7 +49,7 @@ public function install() // We need to create and flush the upload collection first, because it has to has the ID 1. $this->entityManager->flush(); - if ($temporaryUploadCollection->getId() != CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID) { + if (CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID != $temporaryUploadCollection->getId()) { throw new \Exception($this->__f('The id of the generated "temporary upload collection" must be %s, but has a different value. This should not have happened. Please report this error.', ['%s' => CollectionEntity::TEMPORARY_UPLOAD_COLLECTION_ID])); } @@ -62,9 +72,6 @@ public function install() $this->createPermissions($temporaryUploadCollection, $rootCollection); - $this->hookApi->installSubscriberHooks($this->bundle->getMetaData()); - $this->hookApi->installProviderHooks($this->bundle->getMetaData()); - $this->setVar('descriptionEscapingStrategyForCollection', 'text'); $this->setVar('descriptionEscapingStrategyForMedia', 'text'); $this->setVar('defaultCollectionTemplate', 'cards'); @@ -104,16 +111,16 @@ public function upgrade($oldversion) /** @noinspection PhpMissingBreakStatementInspection */ case '1.0.6': $this->schemaTool->create([ - 'Cmfcmf\Module\MediaModule\Entity\Collection\Permission\AbstractPermissionEntity', - 'Cmfcmf\Module\MediaModule\Entity\Collection\Permission\GroupPermissionEntity', - 'Cmfcmf\Module\MediaModule\Entity\Collection\Permission\UserPermissionEntity', - 'Cmfcmf\Module\MediaModule\Entity\Collection\Permission\OwnerPermissionEntity', + AbstractPermissionEntity::class, + GroupPermissionEntity::class, + OwnerPermissionEntity::class, + UserPermissionEntity::class, - 'Cmfcmf\Module\MediaModule\Entity\Collection\Permission\Restriction\PasswordPermissionRestrictionEntity', - 'Cmfcmf\Module\MediaModule\Entity\Collection\Permission\Restriction\AbstractPermissionRestrictionEntity', + AbstractPermissionRestrictionEntity::class, + PasswordPermissionRestrictionEntity::class ]); $this->schemaTool->update([ - 'Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity' + CollectionEntity::class ]); // Create root collection. @@ -126,10 +133,10 @@ public function upgrade($oldversion) $this->entityManager->persist($rootCollection); $allCollections = $this->entityManager - ->getRepository('Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity') + ->getRepository(CollectionEntity::class) ->findAll(); foreach ($allCollections as $collection) { - if ($collection->getParent() === null && $collection->getId() != null) { + if (null === $collection->getParent() && null != $collection->getId()) { // Collection has no parent and isn't the to-be-created root collection. $collection->setParent($rootCollection); $this->entityManager->merge($collection); @@ -138,28 +145,52 @@ public function upgrade($oldversion) $this->entityManager->flush(); $this->createPermissions( - $this->entityManager->find('Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity', 1), + $this->entityManager->find(CollectionEntity::class, 1), $rootCollection ); case '1.1.0': case '1.1.1': case '1.1.2': $this->schemaTool->update([ - 'Cmfcmf\Module\MediaModule\Entity\Watermark\TextWatermarkEntity', - 'Cmfcmf\Module\MediaModule\Entity\Watermark\AbstractWatermarkEntity' + AbstractWatermarkEntity::class, + TextWatermarkEntity::class ]); - $this->entityManager->getConnection()->executeUpdate("UPDATE `cmfcmfmedia_watermarks` SET `fontColor`='#000000ff',`backgroundColor`='#00000000' WHERE `discr`='text'"); + $this->entityManager->getConnection()->executeUpdate(" + UPDATE `cmfcmfmedia_watermarks` + SET `fontColor`='#000000ff', `backgroundColor`='#00000000' + WHERE `discr`='text' + "); $this->schemaTool->update([ - 'Cmfcmf\Module\MediaModule\Entity\Collection\CollectionEntity', - 'Cmfcmf\Module\MediaModule\Entity\Collection\CollectionCategoryAssignmentEntity', - 'Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity', - 'Cmfcmf\Module\MediaModule\Entity\Media\MediaCategoryAssignmentEntity', + CollectionEntity::class, + CollectionCategoryAssignmentEntity::class, + AbstractMediaEntity::class, + MediaCategoryAssignmentEntity::class ]); $this->createCategoryRegistries(); case '1.2.0': case '1.2.1': + case '1.2.2': + // fields have changed: createdUserId becomes createdBy, updatedUserId becomes updatedBy + $connection = $this->entityManager->getConnection(); + foreach (['collection', 'media', 'watermarks', 'permission'] as $tableName) { + $sql = ' + ALTER TABLE `cmfcmfmedia_' . $tableName . '` + CHANGE `createdUserId` `createdBy` INT(11) DEFAULT NULL + '; + $stmt = $connection->prepare($sql); + $stmt->execute(); + + $sql = ' + ALTER TABLE `cmfcmfmedia_' . $tableName . '` + CHANGE `updatedUserId` `updatedBy` INT(11) DEFAULT NULL + '; + $stmt = $connection->prepare($sql); + $stmt->execute(); + } + case '1.3.0': + case '2.0.0': return true; default: return false; @@ -174,13 +205,14 @@ public function uninstall() // @todo Also delete media files? $this->schemaTool->drop(static::getEntities()); - $this->hookApi->uninstallSubscriberHooks($this->bundle->getMetaData()); - $this->hookApi->uninstallProviderHooks($this->bundle->getMetaData()); - $this->delVars(); - \CategoryRegistryUtil::deleteEntry('CmfcmfMediaModule'); - \CategoryRegistryUtil::deleteEntry('CmfcmfMediaModule'); + // remove category registry entries + $registries = $this->container->get('zikula_categories_module.category_registry_repository')->findBy(['modname' => 'CmfcmfMediaModule']); + foreach ($registries as $registry) { + $this->entityManager->remove($registry); + } + $this->entityManager->flush(); return true; } @@ -269,7 +301,7 @@ private function createLicenses() foreach ($ccVersions as $version) { foreach ($ccNames as $id => $name) { - if ($id == 'CC-BY-NC-ND' && $version == '1.0') { + if ('CC-BY-NC-ND' == $id && '1.0' == $version) { // The license image somehow does not exist. continue; } @@ -281,7 +313,7 @@ private function createLicenses() ->setImageUrl("https://i.creativecommons.org/l/$urlId/$version/80x15.png") ->setEnabledForWeb(true) ->setEnabledForUpload(true) - ->setOutdated($version != '4.0') + ->setOutdated('4.0' != $version) ; $this->entityManager->persist($license); } @@ -294,7 +326,8 @@ private function createLicenses() */ private function createUploadDir() { - $uploadDirectory = \FileUtil::getDataDirectory() . '/cmfcmf-media-module/media'; + $dataDirectory = $this->container->getParameter('datadir'); + $uploadDirectory = $dataDirectory . '/cmfcmf-media-module/media'; if (!is_dir($uploadDirectory)) { mkdir($uploadDirectory, 0777, true); @@ -372,8 +405,21 @@ private function createPermissions(CollectionEntity $temporaryUploadCollection, private function createCategoryRegistries() { - $categoryID = \CategoryUtil::getCategoryByPath('/__SYSTEM__/Modules/Global')['id']; - \CategoryRegistryUtil::insertEntry('CmfcmfMediaModule', 'AbstractMediaEntity', 'Main', $categoryID); - \CategoryRegistryUtil::insertEntry('CmfcmfMediaModule', 'CollectionEntity', 'Main', $categoryID); + $categoryGlobal = $this->container->get('zikula_categories_module.category_repository')->findOneBy(['name' => 'Global']); + if (!$categoryGlobal) { + return; + } + + $entityManager = $this->container->get('doctrine.orm.default_entity_manager'); + foreach (['AbstractMediaEntity', 'CollectionEntity'] as $entityName) { + $registry = new CategoryRegistryEntity(); + $registry->setModname('CmfcmfMediaModule'); + $registry->setEntityname($entityName); + $registry->setProperty('Main'); + $registry->setCategory($categoryGlobal); + + $entityManager->persist($registry); + } + $entityManager->flush(); } } diff --git a/MediaType/AbstractFileMediaType.php b/MediaType/AbstractFileMediaType.php index aca2ad7c..01656b89 100644 --- a/MediaType/AbstractFileMediaType.php +++ b/MediaType/AbstractFileMediaType.php @@ -12,7 +12,8 @@ namespace Cmfcmf\Module\MediaModule\MediaType; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractFileEntity; -use Cmfcmf\Module\MediaModule\Font\FontCollection; +use Imagine\Image\ImageInterface; +use Liip\ImagineBundle\Imagine\Cache\CacheManager; use Symfony\Component\Config\FileLocatorInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -34,27 +35,21 @@ abstract class AbstractFileMediaType extends AbstractMediaType private $zikulaRoot; /** - * @var \SystemPlugin_Imagine_Manager + * @var CacheManager */ - protected $imagineManager; + protected $imagineCacheManager; - /** - * @var FontCollection - */ - private $fontCollection; - - public function injectThings(ContainerInterface $container, FileLocatorInterface $fileLocator, FontCollection $fontCollection, $kernelRootDir) - { + public function injectThings( + ContainerInterface $container, + FileLocatorInterface $fileLocator, + $kernelRootDir + ) { $this->container = $container; $this->fileLocator = $fileLocator; - $this->fontCollection = $fontCollection; $this->zikulaRoot = realpath($kernelRootDir . '/..'); - /** @var \SystemPlugin_Imagine_Manager $imagineManager */ - $imagineManager = $this->container->get('systemplugin.imagine.manager'); - $imagineManager->setModule('CmfcmfMediaModule'); - $this->imagineManager = $imagineManager; + $this->imagineCacheManager = $this->container->get('liip_imagine.cache.manager'); } public function getPathToFile($identifier) @@ -66,173 +61,73 @@ public function getPathToFile($identifier) public function getUrlToFile($identifier) { - return \System::getBaseUri() . '/' . $this->getPathToFile($identifier); + return $this->getBaseUri() . '/' . $this->getPathToFile($identifier); } - protected function getPreset(AbstractFileEntity $entity, $file, $width, $height, $mode, $optimize) + protected function getImagineRuntimeOptions(AbstractFileEntity $entity, $file, $width, $height, $mode, $optimize) { - $watermarkId = ''; - $watermark = $entity->getCollection()->getWatermark(); - if ($watermark !== null) { - $watermarkId = ', w ' . $watermark->getId(); - } - - if ($height == 'original' || $width == 'original') { + if ('original' == $height || 'original' == $width) { $size = getimagesize($entity->getPath()); - if ($width == 'original') { + if ('original' == $width) { $width = $size[0]; } - if ($height == 'original') { + if ('original' == $height) { $height = $size[1]; } } - $preset = new \SystemPlugin_Imagine_Preset("CmfcmfMediaModule " . (string)$optimize . 'x' . substr($mode, 0, 1) . "x{$width}x{$height}x" . $watermarkId, [ - 'mode' => $mode, - 'width' => $width, - 'height' => $height, - '__module' => 'CmfcmfMediaModule', - '__transformation' => $this->getTransformation($entity, $file, $width, $height, $mode, $optimize) - ]); - - return $preset; - } - - protected function getTransformation(AbstractFileEntity $entity, $file, $width, $height, $mode, $optimize) - { - $transformation = new \Imagine\Filter\Transformation(); - if ($optimize) { - // Optimize for web and rotate the images (after thumbnail creation). - $transformation - ->add(new \Imagine\Filter\Basic\Autorotate(), 101) - ->add(new \Imagine\Filter\Basic\WebOptimization(), 2) - ; - } - $watermark = $entity->getCollection()->getWatermark(); - if ($watermark === null) { - // The image shall not be watermarked. - return $transformation; - } - - $imagine = $this->imagineManager->getImagine(); - - // Generate the watermark image. It will already be correctly sized - // for the thumbnail. - if ($mode == 'outbound') { - $wWidth = $width; - $wHeight = $height; - } elseif ($mode == 'inset') { - $imageSize = getimagesize($file); - - $ratios = [ - $width / $imageSize[0], - $height / $imageSize[1] - ]; - $wWidth = min($ratios) * $imageSize[0]; - $wHeight = min($ratios) * $imageSize[1]; - } else { - throw new \LogicException(); - } - - // Check whether the image is big enough to be watermarked. - if ($watermark->getMinSizeX() !== null && $wWidth < $watermark->getMinSizeX()) { - return $transformation; - } - if ($watermark->getMinSizeY() !== null && $wHeight < $watermark->getMinSizeY()) { - return $transformation; - } - - $watermarkImage = $watermark->getImagineImage($imagine, $this->fontCollection, $wWidth, $wHeight); - $watermarkSize = $watermarkImage->getSize(); - - // Calculate watermark position. If the position is negative, handle - // it as an offset from the bottom / the right side of the image. - $x = $watermark->getPositionX(); - $y = $watermark->getPositionY(); - if ($x < 0) { - $x += $wWidth - $watermarkSize->getWidth(); - } - if ($y < 0) { - $y += $wHeight - $watermarkSize->getHeight(); - } - - // If the watermark still exceeds the image's width or height, resize the watermark. - if ($x < 0 || $y < 0 || $x + $watermarkSize->getWidth() > $wWidth || $y + $watermarkSize->getHeight() > $wHeight) { - $xOffset = 0; - if ($x < 0) { - $xOffset = $x * -1; - } - $yOffset = 0; - if ($y < 0) { - $yOffset = $y * -1; - } - - $ratios = [ - ($watermarkSize->getWidth() - $xOffset) / $watermarkSize->getWidth(), - ($watermarkSize->getHeight() - $yOffset) / $watermarkSize->getHeight() - ]; - $watermarkSize = $watermarkSize->scale(min($ratios)); - $watermarkImage->resize($watermarkSize); - - $x = round($watermark->getPositionX() + $wWidth - $watermarkSize->getWidth()); - $y = round($watermark->getPositionY() + $wHeight - $watermarkSize->getHeight()); - - $xOffset = 0; - if ($x + $watermarkSize->getWidth() > $wWidth) { - $xOffset = $x + $watermarkSize->getWidth() - $wWidth; - } - $yOffset = 0; - if ($y + $watermarkSize->getHeight() > $wHeight) { - $yOffset = $y + $watermarkSize->getHeight() - $wHeight; - } - $ratios = [ - ($watermarkSize->getWidth() - $xOffset) / $watermarkSize->getWidth(), - ($watermarkSize->getHeight() - $yOffset) / $watermarkSize->getHeight() - ]; - $watermarkImage->resize($watermarkSize->scale(min($ratios))); - } - - $point = new \Imagine\Image\Point($x, $y); - $transformation - ->add(new \Imagine\Filter\Basic\Paste($watermarkImage, $point), 100) - ; - - return $transformation; + $watermarkId = null !== $watermark ? $watermark->getId() : null; + + $options = [ + 'thumbnail' => [ + 'size' => [$width, $height], + 'mode' => ($mode ? $mode : ImageInterface::THUMBNAIL_OUTBOUND), + 'extension' => null // file extension for thumbnails (jpg, png, gif; null for original file type) + ], + 'cmfcmfmediamodule.custom_image_filter' => [ + 'watermark' => $watermarkId, + 'file' => $file, + 'width' => $width, + 'height' => $height, + 'mode' => $mode, + 'optimize' => $optimize + ] + ]; + + return $options; } - protected function getIconThumbnailByFileExtension(AbstractFileEntity $entity, $width, $height, $format = 'html', $mode = 'outbound', $optimize = true, $forceExtension = false) + protected function getIconThumbnailByFileExtension(AbstractFileEntity $entity, $width, $height, $format = 'html', $mode = ImageInterface::THUMBNAIL_OUTBOUND, $optimize = true, $forceExtension = false) { return false; // @todo Re-enable? - if (!in_array($mode, ['inset', 'outbound'])) { - throw new \InvalidArgumentException('Invalid mode requested.'); + if (!in_array($mode, [ImageInterface::THUMBNAIL_INSET, ImageInterface::THUMBNAIL_OUTBOUND])) { + $mode = ImageInterface::THUMBNAIL_INSET; } - $mode = 'inset'; $availableSizes = [16, 32, 48, 512]; + $chosenSize = 0; foreach ($availableSizes as $size) { if ($width <= $size && $height <= $size) { break; } + $chosenSize = $size; } $extension = $forceExtension ? $forceExtension : pathinfo($entity->getFileName(), PATHINFO_EXTENSION); - $icon = '@CmfcmfMediaModule/Resources/public/images/file-icons/' . $size . 'px/' . $extension . '.png'; + $icon = '@CmfcmfMediaModule/Resources/public/images/file-icons/' . $chosenSize . 'px/' . $extension . '.png'; try { $path = $this->getPathToFile($icon); } catch (\InvalidArgumentException $e) { - $icon = '@CmfcmfMediaModule/Resources/public/images/file-icons/' . $size . 'px/_blank.png'; + $icon = '@CmfcmfMediaModule/Resources/public/images/file-icons/' . $chosenSize . 'px/_blank.png'; $path = $this->getPathToFile($icon); } - $this->imagineManager->setPreset( - $this->getPreset($entity, $path, $width, $height, $mode, $optimize) - ); - - $path = $this->imagineManager->getThumb($path, $entity->getImagineId()); + $imagineOptions = $this->getImagineRuntimeOptions($entity, $path, $width, $height, $mode, $optimize); + $path = $this->imagineCacheManager->getBrowserPath($path, 'zkroot', $imagineOptions); - $url = \System::getBaseUri() . '/' . $path; + $url = $this->getBaseUri() . '/' . $path; switch ($format) { case 'url': return $url; @@ -255,4 +150,9 @@ public function getOriginalWithWatermark(AbstractFileEntity $entity, $mode, $opt throw new \LogicException(); } } + + protected function getBaseUri() + { + return $this->requestStack->getCurrentRequest()->getBasePath(); + } } diff --git a/MediaType/AbstractMediaType.php b/MediaType/AbstractMediaType.php index edc3db92..8865f336 100644 --- a/MediaType/AbstractMediaType.php +++ b/MediaType/AbstractMediaType.php @@ -13,9 +13,9 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; -use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\Translation\TranslatorInterface; -use Zikula\ExtensionsModule\Api\VariableApi; +use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; abstract class AbstractMediaType implements MediaTypeInterface { @@ -30,15 +30,39 @@ abstract class AbstractMediaType implements MediaTypeInterface protected $translator; /** - * @var VariableApi + * @var VariableApiInterface */ - private $variableApi; + protected $variableApi; - public function __construct(EngineInterface $renderEngine, TranslatorInterface $translator, VariableApi $variableApi) - { + /** + * @var RequestStack + */ + protected $requestStack; + + /** + * @var string + */ + protected $dataDirectory; + + /** + * @param EngineInterface $renderEngine + * @param TranslatorInterface $translator + * @param VariableApiInterface $variableApi + * @param RequestStack $requestStack + * @param string $dataDirectory + */ + public function __construct( + EngineInterface $renderEngine, + TranslatorInterface $translator, + VariableApiInterface $variableApi, + RequestStack $requestStack, + $dataDirectory + ) { $this->renderEngine = $renderEngine; $this->translator = $translator; $this->variableApi = $variableApi; + $this->requestStack = $requestStack; + $this->dataDirectory = $dataDirectory; } public function getVar($name, $default) @@ -100,7 +124,12 @@ public function isEmbeddable() public function getEmbedCode(AbstractMediaEntity $entity, $size = 'full') { - return $this->renderFullpage($entity) . $entity->getAttribution(); + $attribution = ''; + if (null !== $entity->getAttribution()) { + $attribution = '

' . $this->__f('By %s', ['%s' => $entity->getAttribution()], 'cmfcmfmediamodule') . '

'; + } + + return $this->renderFullpage($entity) . $attribution; } public function getExtendedMetaInformation(AbstractMediaEntity $entity) @@ -139,12 +168,12 @@ public function doJsonGetRequest($url) return $result; } - public function getEntityFromWeb(Request $request) + public function getEntityFromWeb() { $entity = $this->getEntityClass(); - $entity = new $entity(); + $entity = new $entity($this->requestStack, $this->dataDirectory); - $settings = json_decode($request->request->get('settings'), true); + $settings = json_decode($this->requestStack->getCurrentRequest()->request->get('settings'), true); foreach ($settings as $name => $value) { $setter = 'set' . ucfirst($name); $entity->$setter($value); diff --git a/MediaType/Deezer.php b/MediaType/Deezer.php index a493db91..a45bf2c4 100644 --- a/MediaType/Deezer.php +++ b/MediaType/Deezer.php @@ -13,7 +13,6 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\DeezerEntity; -use Symfony\Component\HttpFoundation\Request; class Deezer extends AbstractMediaType implements WebMediaTypeInterface, PasteMediaTypeInterface { @@ -38,7 +37,7 @@ public function getIcon() */ public function matchesPaste($pastedText) { - return $this->getParametersFromPastedText($pastedText) !== false ? 10 : 0; + return false !== $this->getParametersFromPastedText($pastedText) ? 10 : 0; } /** @@ -47,15 +46,15 @@ public function matchesPaste($pastedText) public function getEntityFromPaste($pastedText) { $parameters = $this->getParametersFromPastedText($pastedText); - if ($parameters === false) { + if (false === $parameters) { throw new \RuntimeException(); } - $entity = new DeezerEntity(); + $entity = new DeezerEntity($this->requestStack, $this->dataDirectory); if (isset($parameters['title'])) { $entity->setTitle($parameters['title']); } - $entity->setUrl('http://www.deezer.com'); + $entity->setUrl('https://www.deezer.com'); $entity->setMusicId($parameters['musicId']); $entity->setMusicType($parameters['musicType']); @@ -70,14 +69,14 @@ private function getParametersFromPastedText($pastedText) $parameters = []; $regex = '#deezer\.com/(.*?)/(\d+)#'; preg_match($regex, $pastedText, $matches); - if (count($matches) == 3) { + if (3 == count($matches)) { $parameters['musicId'] = $matches[2]; $parameters['musicType'] = $matches[1]; $parameters['showPlaylist'] = false; } else { $regex = '#src=(?:"|\')((?:.*?)deezer\.com/plugins/player(?:.*?))(?:"|\')#'; preg_match($regex, $pastedText, $matches); - if (count($matches) != 2) { + if (2 != count($matches)) { return false; } $url = htmlspecialchars_decode($matches[1]); @@ -88,7 +87,7 @@ private function getParametersFromPastedText($pastedText) } $parameters['musicId'] = $queryParams['id']; $parameters['musicType'] = $queryParams['type']; - if ($parameters['musicType'] == 'tracks') { + if ('tracks' == $parameters['musicType']) { $parameters['musicType'] = 'track'; } if (isset($queryParams['title'])) { @@ -117,7 +116,7 @@ public function renderFullpage(AbstractMediaEntity $entity) $title = urldecode($entity->getTitle()); $id = $entity->getMusicId(); $type = $entity->getMusicType(); - if ($type == 'track') { + if ('track' == $type) { $type = 'tracks'; } $url = "http://www.deezer.com/plugins/player?format=classic&autoplay=false&playlist=$playlist&width=700&height=$height&color=$color&layout=dark&size=medium&type=$type&id=$id&title=$title&app_id=1"; @@ -128,10 +127,10 @@ public function renderFullpage(AbstractMediaEntity $entity) ]); } - public function getEntityFromWeb(Request $request) + public function getEntityFromWeb() { /** @var DeezerEntity $entity */ - $entity = parent::getEntityFromWeb($request); + $entity = parent::getEntityFromWeb(); $this->addExtraData($entity); @@ -143,7 +142,7 @@ public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $form /** @var DeezerEntity $entity */ $type = $entity->getMusicType(); $id = $entity->getMusicId(); - if ($type == 'track') { + if ('track' == $type) { $type = 'album'; $id = $entity->getExtraData()['album']['id']; } @@ -151,7 +150,7 @@ public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $form //if ($mode == 'inset') { // $size = max($width, $height); //} else if ($mode == 'outbound') { - $size = min($width, $height); + $size = min($width, $height); //} // @todo Ask Deezer whether it is allowed to crop the images. $url = "http://api.deezer.com/$type/$id/image?size=" . $size; @@ -170,9 +169,9 @@ public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $form */ public function addExtraData(DeezerEntity $entity) { - if ($entity->getMusicType() == 'track' || $entity->getMusicType() == 'album') { + if ('track' == $entity->getMusicType() || 'album' == $entity->getMusicType()) { $track = $this->doJsonGetRequest('http://api.deezer.com/' . $entity->getMusicType() . '/' . $entity->getMusicId()); - if ($entity->getMusicType() == 'track') { + if ('track' == $entity->getMusicType()) { $entity->addExtraData(['album' => $track['album']]); } $entity->addExtraData(['artist' => $track['artist']]); @@ -183,11 +182,11 @@ public function getFormOptions(AbstractMediaEntity $entity) { /** @var DeezerEntity $entity */ return [ - 'showPlaylistCheckbox' => $entity->getMusicType() == 'playlist' + 'showPlaylistCheckbox' => 'playlist' == $entity->getMusicType() ]; } - public function getSearchResults(Request $request, $q, $dropdownValue = null) + public function getSearchResults($q, $dropdownValue = null) { // TODO: Implement getSearchResults() method. } diff --git a/MediaType/Flickr.php b/MediaType/Flickr.php index 632713fd..cab6bc97 100644 --- a/MediaType/Flickr.php +++ b/MediaType/Flickr.php @@ -13,7 +13,6 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\FlickrEntity; -use Symfony\Component\HttpFoundation\Request; class Flickr extends AbstractMediaType implements WebMediaTypeInterface { @@ -27,7 +26,7 @@ public function getDisplayName() public function isEnabled() { - return \ModUtil::getVar('CmfcmfMediaModule', 'flickrApiKey', '') != ""; + return "" != $this->variableApi->get('CmfcmfMediaModule', 'flickrApiKey', ''); } /** @@ -53,7 +52,7 @@ public function renderFullpage(AbstractMediaEntity $entity) protected function getWebCreationTemplateArguments() { return [ - 'flickrId' => \ModUtil::getVar('CmfcmfMediaModule', 'flickrApiKey') + 'flickrId' => $this->variableApi->get('CmfcmfMediaModule', 'flickrApiKey') ]; } @@ -63,7 +62,7 @@ public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $form return false; } - public function getSearchResults(Request $request, $q, $dropdownValue = null) + public function getSearchResults($q, $dropdownValue = null) { // TODO: Implement getSearchResults() method. } diff --git a/MediaType/Image.php b/MediaType/Image.php index 81103a10..0f239c52 100644 --- a/MediaType/Image.php +++ b/MediaType/Image.php @@ -14,6 +14,7 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractFileEntity; use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\ImageEntity; +use Imagine\Image\ImageInterface; use Symfony\Component\HttpFoundation\File\File; class Image extends AbstractFileMediaType implements UploadableMediaTypeInterface @@ -124,7 +125,7 @@ private function didFlashFire($flash) // 32: NoFlashFunction // 64: RedEyeReductionMode - return ($flash & 1) != 0; + return 0 != ($flash & 1); } private function convertMeteringMode($meteringMode) @@ -152,7 +153,7 @@ public function canUpload(File $file) } /** - * @return array A list of supported mime types. + * @return array a list of supported mime types */ private function getSupportedMimeTypes() { @@ -171,20 +172,17 @@ public function mightUpload($mimeType, $size, $name) return in_array($mimeType, $this->getSupportedMimeTypes()) ? 5 : 0; } - public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $format = 'html', $mode = 'outbound', $optimize = true) + public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $format = 'html', $mode = ImageInterface::THUMBNAIL_OUTBOUND, $optimize = true) { - /** @var ImageEntity $entity */ - if (!in_array($mode, ['inset', 'outbound'])) { - throw new \InvalidArgumentException('Invalid mode requested.'); + if (!in_array($mode, [ImageInterface::THUMBNAIL_INSET, ImageInterface::THUMBNAIL_OUTBOUND])) { + $mode = ImageInterface::THUMBNAIL_INSET; } - $this->imagineManager->setPreset( - $this->getPreset($entity, $entity->getPath(), $width, $height, $mode, $optimize) - ); - - $path = $this->imagineManager->getThumb($entity->getPath(), $entity->getImagineId()); + /** @var ImageEntity $entity */ + $path = $entity->getPath(); + $imagineOptions = $this->getImagineRuntimeOptions($entity, $path, $width, $height, $mode, $optimize); + $url = $this->imagineCacheManager->getBrowserPath($path, 'zkroot', $imagineOptions); - $url = \System::getBaseUri() . '/' . $path; switch ($format) { case 'url': return $url; @@ -211,8 +209,8 @@ public function getEmbedCode(AbstractMediaEntity $entity, $size = 'full') $code = $this->getThumbnail($entity, 250, 150, 'html', 'inset'); break; } - if ($entity->getAttribution() != null) { - $code .= '

' . $entity->getAttribution() . '

'; + if (null !== $entity->getAttribution()) { + $code .= '

' . $this->translator->__f('By %s', ['%s' => $entity->getAttribution()], 'cmfcmfmediamodule') . '

'; } return $code; diff --git a/MediaType/Pdf.php b/MediaType/Pdf.php index b354769b..e1952097 100644 --- a/MediaType/Pdf.php +++ b/MediaType/Pdf.php @@ -82,9 +82,4 @@ public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $form //throw new \LogicException(); //} } - - public function isEmbeddable() - { - return false; - } } diff --git a/MediaType/SoundCloud.php b/MediaType/SoundCloud.php index b3b0620c..23f84f84 100644 --- a/MediaType/SoundCloud.php +++ b/MediaType/SoundCloud.php @@ -13,7 +13,6 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\SoundCloudEntity; -use Symfony\Component\HttpFoundation\Request; class SoundCloud extends AbstractMediaType implements WebMediaTypeInterface, PasteMediaTypeInterface { @@ -27,7 +26,7 @@ public function getDisplayName() public function isEnabled() { - return \ModUtil::getVar('CmfcmfMediaModule', 'soundCloudApiKey', '') != ""; + return '' != $this->variableApi->get('CmfcmfMediaModule', 'soundCloudApiKey', ''); } /** @@ -43,7 +42,7 @@ public function getIcon() */ public function matchesPaste($pastedText) { - return $this->getTrackFromPastedText($pastedText) !== false ? 10 : 0; + return false !== $this->getTrackFromPastedText($pastedText) ? 10 : 0; } /** @@ -52,12 +51,12 @@ public function matchesPaste($pastedText) public function getEntityFromPaste($pastedText) { $trackId = $this->getTrackFromPastedText($pastedText); - if ($trackId === false) { + if (false === $trackId) { throw new \RuntimeException(); } - $entity = new SoundCloudEntity(); - $entity->setUrl('http://www.soundcloud.com'); + $entity = new SoundCloudEntity($this->requestStack, $this->dataDirectory); + $entity->setUrl('https://soundcloud.com/'); $entity->setMusicId($trackId); return $entity; @@ -87,7 +86,7 @@ private function getTrackFromPastedText($pastedText) public function getWebCreationTemplateArguments() { return [ - 'clientId' => \ModUtil::getVar('CmfcmfMediaModule', 'soundCloudApiKey') + 'clientId' => $this->variableApi->get('CmfcmfMediaModule', 'soundCloudApiKey') ]; } @@ -114,7 +113,7 @@ public function getThumbnail(AbstractMediaEntity $entity, $width, $height, $form return false; } - public function getSearchResults(Request $request, $q, $dropdownValue = null) + public function getSearchResults($q, $dropdownValue = null) { // TODO: Implement getSearchResults() method. } diff --git a/MediaType/Twitter.php b/MediaType/Twitter.php index fc8dc9a7..c6f4859e 100644 --- a/MediaType/Twitter.php +++ b/MediaType/Twitter.php @@ -13,7 +13,6 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\TwitterEntity; -use Symfony\Component\HttpFoundation\Request; class Twitter extends AbstractMediaType implements WebMediaTypeInterface, PasteMediaTypeInterface { @@ -28,10 +27,10 @@ public function getDisplayName() public function isEnabled() { return - \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiKey') != "" && - \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiSecret') != "" && - \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiAccessToken') != "" && - \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiAccessTokenSecret') != "" + '' != $this->variableApi->get('CmfcmfMediaModule', 'twitterApiKey') && + '' != $this->variableApi->get('CmfcmfMediaModule', 'twitterApiSecret') && + '' != $this->variableApi->get('CmfcmfMediaModule', 'twitterApiAccessToken') && + '' != $this->variableApi->get('CmfcmfMediaModule', 'twitterApiAccessTokenSecret') ; } @@ -48,7 +47,7 @@ public function getIcon() */ public function matchesPaste($pastedText) { - return $this->extractTweetIdFromPaste($pastedText) !== false ? 10 : 0; + return false !== $this->extractTweetIdFromPaste($pastedText) ? 10 : 0; } /** @@ -56,10 +55,10 @@ public function matchesPaste($pastedText) */ public function getEntityFromPaste($pastedText) { - $entity = new TwitterEntity(); + $entity = new TwitterEntity($this->requestStack, $this->dataDirectory); $tweetId = $this->extractTweetIdFromPaste($pastedText); - if ($tweetId === false) { + if (false === $tweetId) { throw new \RuntimeException(); } $tweetInfo = $this->getTweetInfo($tweetId); @@ -79,7 +78,7 @@ public function getEntityFromPaste($pastedText) private function extractTweetIdFromPaste($pastedText) { preg_match('#twitter\.com/[A-z]+/status/(\d+)#', $pastedText, $results); - if (count($results) == 2) { + if (2 == count($results)) { return $results[1]; } else { return false; @@ -117,7 +116,7 @@ public function getEmbedCode(AbstractMediaEntity $entity, $size = 'full') ]) . '

'; } - public function getSearchResults(Request $request, $q, $dropdownValue = null) + public function getSearchResults($q, $dropdownValue = null) { $q = str_replace('&', '', $q); $q = str_replace('?', '', $q); @@ -130,7 +129,7 @@ public function getSearchResults(Request $request, $q, $dropdownValue = null) // 'results' => [], // 'more' => false //]; - if ($dropdownValue === null || $dropdownValue == 'tweets') { + if (null === $dropdownValue || 'tweets' == $dropdownValue) { $tweetResults = $this->getTweetSearchResults($q); } //if ($dropdownValue === null || $dropdownValue == 'users') { @@ -194,13 +193,11 @@ private function getTweetInfo($tweetId) */ private function getTwitterApi() { - require_once __DIR__ . '/../vendor/autoload.php'; - $api = new \TwitterAPIExchange([ - 'oauth_access_token' => \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiAccessToken'), - 'oauth_access_token_secret' => \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiAccessTokenSecret'), - 'consumer_key' => \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiKey'), - 'consumer_secret' => \ModUtil::getVar('CmfcmfMediaModule', 'twitterApiSecret') + 'oauth_access_token' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiAccessToken'), + 'oauth_access_token_secret' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiAccessTokenSecret'), + 'consumer_key' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiKey'), + 'consumer_secret' => $this->variableApi->get('CmfcmfMediaModule', 'twitterApiSecret') ]); return $api; diff --git a/MediaType/Url.php b/MediaType/Url.php index aa389143..ac79cc71 100644 --- a/MediaType/Url.php +++ b/MediaType/Url.php @@ -39,7 +39,7 @@ public function getIcon() */ public function matchesPaste($pastedText) { - return filter_var($pastedText, FILTER_VALIDATE_URL) !== false ? 1 : 0; + return false !== filter_var($pastedText, FILTER_VALIDATE_URL) ? 1 : 0; } /** @@ -47,7 +47,7 @@ public function matchesPaste($pastedText) */ public function getEntityFromPaste($pastedText) { - $entity = new UrlEntity(); + $entity = new UrlEntity($this->requestStack, $this->dataDirectory); $entity->setUrl($pastedText); return $entity; diff --git a/MediaType/Video.php b/MediaType/Video.php index d400e42d..4ccfd954 100644 --- a/MediaType/Video.php +++ b/MediaType/Video.php @@ -35,8 +35,8 @@ public function getIcon() public function renderFullpage(AbstractMediaEntity $entity) { - $clientID = \ModUtil::getVar('CmfcmfMediaModule', 'googleApiOAuthClientID'); - $clientSecret = \ModUtil::getVar('CmfcmfMediaModule', 'googleApiOAuthClientSecret'); + $clientID = $this->variableApi->get('CmfcmfMediaModule', 'googleApiOAuthClientID'); + $clientSecret = $this->variableApi->get('CmfcmfMediaModule', 'googleApiOAuthClientSecret'); return $this->renderEngine->render('CmfcmfMediaModule:MediaType/Video:fullpage.html.twig', [ 'entity' => $entity, @@ -131,7 +131,7 @@ public function canUpload(File $file) if (in_array($mimeType, $this->getSupportedMimeTypes())) { return 5; } - if ($file->getMimeType() == 'application/ogg') { + if ('application/ogg' == $file->getMimeType()) { // This could be a video or audio file. $meta = GenericMetadataReader::readMetadata($file->getPathname()); if (isset($meta['video']['dataformat'])) { @@ -143,7 +143,7 @@ public function canUpload(File $file) } /** - * @return array A list of supported mime types. + * @return array a list of supported mime types */ private function getSupportedMimeTypes() { diff --git a/MediaType/WebMediaTypeInterface.php b/MediaType/WebMediaTypeInterface.php index bc505de6..436edf2b 100644 --- a/MediaType/WebMediaTypeInterface.php +++ b/MediaType/WebMediaTypeInterface.php @@ -11,11 +11,9 @@ namespace Cmfcmf\Module\MediaModule\MediaType; -use Symfony\Component\HttpFoundation\Request; - interface WebMediaTypeInterface { - public function getEntityFromWeb(Request $request); + public function getEntityFromWeb(); - public function getSearchResults(Request $request, $q, $dropdownValue = null); + public function getSearchResults($q, $dropdownValue = null); } diff --git a/MediaType/YouTube.php b/MediaType/YouTube.php index d5e9c91d..aea89448 100644 --- a/MediaType/YouTube.php +++ b/MediaType/YouTube.php @@ -13,7 +13,6 @@ use Cmfcmf\Module\MediaModule\Entity\Media\AbstractMediaEntity; use Cmfcmf\Module\MediaModule\Entity\Media\YouTubeEntity; -use Symfony\Component\HttpFoundation\Request; class YouTube extends AbstractMediaType implements WebMediaTypeInterface, PasteMediaTypeInterface { @@ -27,7 +26,7 @@ public function getDisplayName() public function isEnabled() { - return \ModUtil::getVar('CmfcmfMediaModule', 'googleApiKey') != ""; + return '' != $this->variableApi->get('CmfcmfMediaModule', 'googleApiKey'); } /** @@ -43,7 +42,7 @@ public function getIcon() */ public function matchesPaste($pastedText) { - return $this->extractYouTubeIdAndTypeFromPaste($pastedText) !== false ? 10 : 0; + return false !== $this->extractYouTubeIdAndTypeFromPaste($pastedText) ? 10 : 0; } /** @@ -51,10 +50,10 @@ public function matchesPaste($pastedText) */ public function getEntityFromPaste($pastedText) { - $entity = new YouTubeEntity(); + $entity = new YouTubeEntity($this->requestStack, $this->dataDirectory); list($type, $id) = $this->extractYouTubeIdAndTypeFromPaste($pastedText); - if ($id === false || !in_array($type, ['playlist', 'video', 'channel', true])) { + if (false === $id || !in_array($type, ['playlist', 'video', 'channel', true])) { throw new \RuntimeException(); } @@ -66,17 +65,17 @@ public function getEntityFromPaste($pastedText) private function extractYouTubeIdAndTypeFromPaste($pastedText) { preg_match('#youtube\.com\/channel\/([a-zA-Z0-9_-]+)#', $pastedText, $results); - if (count($results) == 2) { + if (2 == count($results)) { return ['channel', $results[1]]; } preg_match('#youtube(?:-nocookie)?\.com\/[a-zA-Z0-9_\-\/\=\?\&]+list=([a-zA-Z0-9_-]+)#', $pastedText, $results); - if (count($results) == 2) { + if (2 == count($results)) { return ['playlist', $results[1]]; } preg_match('#(?:youtube(?:-nocookie)?\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)([a-zA-Z0-9_-]{6,11})#', $pastedText, $results); - if (count($results) == 2) { + if (2 == count($results)) { return ['video', $results[1]]; } @@ -118,7 +117,7 @@ public function getEmbedCode(AbstractMediaEntity $entity, $size = 'full') ]); } - public function getSearchResults(Request $request, $q, $dropdownValue = null) + public function getSearchResults($q, $dropdownValue = null) { $youtube = $this->getYouTubeApi(); @@ -234,11 +233,9 @@ private function setYouTubeDataByIdAndType(YouTubeEntity &$entity, $type, $id) */ private function getYouTubeApi() { - require_once __DIR__ . '/../vendor/autoload.php'; - $client = new \Google_Client(); $client->setApplicationName('Zikula Media Module by @cmfcmf'); - $client->setDeveloperKey(\ModUtil::getVar('CmfcmfMediaModule', 'googleApiKey')); + $client->setDeveloperKey($this->variableApi->get('CmfcmfMediaModule', 'googleApiKey')); return new \Google_Service_YouTube($client); } diff --git a/Metadata/GenericMetadataReader.php b/Metadata/GenericMetadataReader.php index f928cef0..785c803e 100644 --- a/Metadata/GenericMetadataReader.php +++ b/Metadata/GenericMetadataReader.php @@ -21,11 +21,10 @@ class GenericMetadataReader * * @param string $file * - * @return array The metadata. + * @return array the metadata */ public static function readMetadata($file) { - require_once __DIR__ . '/../vendor/autoload.php'; $getID3 = new \getID3(); $meta = $getID3->analyze($file); \getid3_lib::CopyTagsToComments($meta); diff --git a/README.md b/README.md index fb5b7f6c..aa8debb0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -Zikula 1.4.3+ MediaModule by @cmfcmf -==================================== +Zikula 2.0.11+ MediaModule by @cmfcmf +===================================== [![StyleCI](https://styleci.io/repos/43518681/shield)](https://styleci.io/repos/43518681) [![Build Status](https://travis-ci.org/cmfcmf/MediaModule.svg?branch=master)](https://travis-ci.org/cmfcmf/MediaModule) @@ -16,7 +16,7 @@ If you want to test the current version (potentially unstable!), download it fro **Downloading directly from master would require you to execute `composer install --no-dev`.** ## Information -Read all about the module [at it's website](http://cmfcmf.github.io/MediaModule). +Read all about the module [at it's website](https://cmfcmf.github.io/MediaModule). The module supports many media types natively (images, plaintext, MarkDown, videos, audio, pdf, …) and further types can be added with ease! @@ -44,10 +44,9 @@ If you do so, it's going to break URLs. If you find a bug or have problems, please [create an issue](https://github.com/cmfcmf/MediaModule/issues/new)! ## Extracting translations -Add `require_once __DIR__ . '/../modules/cmfcmf/media-module/vendor/autoload.php;` to `src/app/autoload.php` and then run -``` -php app/console translation:extract --enable-extractor=jms_i18n_routing --dir ./modules/cmfcmf/media-module --exclude-dir vendor --output-dir ./modules/cmfcmf/media-module/Resources/translations --keep --output-format=pot de -``` +Add `require_once __DIR__ . '/../modules/cmfcmf/media-module/vendor/autoload.php';` to `src/app/autoload.php` and then run + +`php -dmemory_limit=2G bin/console translation:extract en --bundle=CmfcmfMediaModule --enable-extractor=jms_i18n_routing --output-format=po --exclude-dir=vendor` ## License and module development diff --git a/Resources/config/collectionpermissions.yml b/Resources/config/collectionpermissions.yml index 3c52d6f2..8cf7db03 100644 --- a/Resources/config/collectionpermissions.yml +++ b/Resources/config/collectionpermissions.yml @@ -1,21 +1,26 @@ services: - cmfcmf_media_module.collection_permission.container: - class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionContainer + cmfcmf_media_module.collection_permission.container: + class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\CollectionPermissionContainer - cmfcmf_media_module.collection_permission.user: - class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\UserCollectionPermission - arguments: [@translator] - tags: - - { name: cmfcmf_media_module.collection_permission } + cmfcmf_media_module.collection_permission.group: + class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\GroupCollectionPermission + arguments: + - '@translator' + - '@zikula_users_module.current_user' + - '@zikula_groups_module.group_repository' + tags: ['cmfcmf_media_module.collection_permission'] - cmfcmf_media_module.collection_permission.group: - class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\GroupCollectionPermission - arguments: [@translator] - tags: - - { name: cmfcmf_media_module.collection_permission } + cmfcmf_media_module.collection_permission.owner: + class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\OwnerCollectionPermission + arguments: + - '@translator' + - '@zikula_users_module.current_user' + tags: ['cmfcmf_media_module.collection_permission'] - cmfcmf_media_module.collection_permission.owner: - class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\OwnerCollectionPermission - arguments: [@translator] - tags: - - { name: cmfcmf_media_module.collection_permission } + cmfcmf_media_module.collection_permission.user: + class: Cmfcmf\Module\MediaModule\Security\CollectionPermission\UserCollectionPermission + arguments: + - '@translator' + - '@zikula_users_module.current_user' + - '@zikula_users_module.user_repository' + tags: ['cmfcmf_media_module.collection_permission'] diff --git a/Resources/config/collectiontemplates.yml b/Resources/config/collectiontemplates.yml index 5f71fa87..afbd474c 100644 --- a/Resources/config/collectiontemplates.yml +++ b/Resources/config/collectiontemplates.yml @@ -1,40 +1,36 @@ services: - cmfcmf_media_module.collection_template.abstract_service: - abstract: true - arguments: [@templating, @translator] + cmfcmf_media_module.collection_template.abstract_service: + abstract: true + arguments: + - '@templating' + - '@translator' - cmfcmf_media_module.collection_template.cards: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\CardsTemplate - parent: cmfcmf_media_module.collection_template.abstract_service - tags: - - { name: cmfcmf_media_module.collection_template } + cmfcmf_media_module.collection_template.cards: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\CardsTemplate + parent: cmfcmf_media_module.collection_template.abstract_service + tags: ['cmfcmf_media_module.collection_template'] - cmfcmf_media_module.collection_template.slider: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\SliderTemplate - parent: cmfcmf_media_module.collection_template.abstract_service - tags: - - { name: cmfcmf_media_module.collection_template } + cmfcmf_media_module.collection_template.slider: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\SliderTemplate + parent: cmfcmf_media_module.collection_template.abstract_service + tags: ['cmfcmf_media_module.collection_template'] - cmfcmf_media_module.collection_template.grid: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\GridTemplate - parent: cmfcmf_media_module.collection_template.abstract_service - tags: - - { name: cmfcmf_media_module.collection_template } + cmfcmf_media_module.collection_template.grid: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\GridTemplate + parent: cmfcmf_media_module.collection_template.abstract_service + tags: ['cmfcmf_media_module.collection_template'] - cmfcmf_media_module.collection_template.table: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\TableTemplate - parent: cmfcmf_media_module.collection_template.abstract_service - tags: - - { name: cmfcmf_media_module.collection_template } + cmfcmf_media_module.collection_template.table: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\TableTemplate + parent: cmfcmf_media_module.collection_template.abstract_service + tags: ['cmfcmf_media_module.collection_template'] - cmfcmf_media_module.collection_template.galleria: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\GalleriaTemplate - parent: cmfcmf_media_module.collection_template.abstract_service - tags: - - { name: cmfcmf_media_module.collection_template } + cmfcmf_media_module.collection_template.galleria: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\GalleriaTemplate + parent: cmfcmf_media_module.collection_template.abstract_service + tags: ['cmfcmf_media_module.collection_template'] - cmfcmf_media_module.collection_template.lightgallery: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\LightGalleryTemplate - parent: cmfcmf_media_module.collection_template.abstract_service - tags: - - { name: cmfcmf_media_module.collection_template } + cmfcmf_media_module.collection_template.lightgallery: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\LightGalleryTemplate + parent: cmfcmf_media_module.collection_template.abstract_service + tags: ['cmfcmf_media_module.collection_template'] diff --git a/Resources/config/contenttypes.yml b/Resources/config/contenttypes.yml new file mode 100644 index 00000000..60a72ca7 --- /dev/null +++ b/Resources/config/contenttypes.yml @@ -0,0 +1,32 @@ +services: + # Content types + Cmfcmf\Module\MediaModule\ContentType\CollectionType: + parent: zikula.content_type.base + shared: false + calls: + - [setEntityManager, ['@doctrine.orm.entity_manager']] + - [setSecurityManager, ['@cmfcmf_media_module.security_manager']] + - [setSelectedTemplateFactory, ['@cmfcmf_media_module.collection_template.selected_factory']] + - [setMediaTypeCollection, ['@cmfcmf_media_module.media_type_collection']] + tags: ['zikula.content_type'] + Cmfcmf\Module\MediaModule\ContentType\Form\Type\CollectionType: + parent: zikula.content_type.form.base + arguments: + - '@cmfcmf_media_module.security_manager' + - '@doctrine.orm.entity_manager' + tags: ['form.type'] + Cmfcmf\Module\MediaModule\ContentType\MediaType: + parent: zikula.content_type.base + shared: false + calls: + - [setEntityManager, ['@doctrine.orm.entity_manager']] + - [setSecurityManager, ['@cmfcmf_media_module.security_manager']] + - [setMediaTypeCollection, ['@cmfcmf_media_module.media_type_collection']] + - [setEnableMediaViewCounter, ["@=service('zikula_extensions_module.api.variable').get('CmfcmfMediaModule', 'enableMediaViewCounter', false)"]] + tags: ['zikula.content_type'] + Cmfcmf\Module\MediaModule\ContentType\Form\Type\MediaType: + parent: zikula.content_type.form.base + arguments: + - '@cmfcmf_media_module.security_manager' + - '@doctrine.orm.entity_manager' + tags: ['form.type'] diff --git a/Resources/config/formtypes.yml b/Resources/config/formtypes.yml new file mode 100644 index 00000000..3a8ff580 --- /dev/null +++ b/Resources/config/formtypes.yml @@ -0,0 +1,196 @@ +services: + cmfcmf_media_module.form.type.color: + class: Cmfcmf\Module\MediaModule\Form\Type\ColorType + tags: ['form.type'] + + cmfcmf_media_module.form.type.font: + class: Cmfcmf\Module\MediaModule\Form\Type\FontType + arguments: + - '@cmfcmf_media_module.font_collection' + tags: ['form.type'] + + cmfcmf_media_module.form.type.permission_level: + class: Cmfcmf\Module\MediaModule\Form\Type\PermissionLevelType + arguments: + - '@cmfcmf_media_module.security_manager' + tags: ['form.type'] + + cmfcmf_media_module.form.type.collection: + class: Cmfcmf\Module\MediaModule\Form\Collection\CollectionType + arguments: + - '@translator' + - '@cmfcmf_media_module.collection_template_collection' + - '@cmfcmf_media_module.security_manager' + - '@zikula_extensions_module.api.variable' + tags: ['form.type'] + + cmfcmf_media_module.form.type.collection_block: + class: Cmfcmf\Module\MediaModule\Form\Collection\CollectionBlockType + arguments: + - '@translator' + - '@cmfcmf_media_module.security_manager' + - '@doctrine.orm.entity_manager' + tags: ['form.type'] + + cmfcmf_media_module.form.type.collection_template: + class: Cmfcmf\Module\MediaModule\Form\CollectionTemplate\TemplateType + arguments: + - '@translator' + - '@cmfcmf_media_module.collection_template_collection' + - '@cmfcmf_media_module.collection_template.selected_factory' + tags: ['form.type'] + + cmfcmf_media_module.form.type.collection_template.galleria: + class: Cmfcmf\Module\MediaModule\Form\CollectionTemplate\GalleriaType + arguments: + - '@translator' + tags: ['form.type'] + + cmfcmf_media_module.form.type.collection_template.light_gallery: + class: Cmfcmf\Module\MediaModule\Form\CollectionTemplate\LightGalleryType + arguments: + - '@translator' + tags: ['form.type'] + + cmfcmf_media_module.form.type.media.base: + abstract: true + arguments: + - '@translator' + - '@cmfcmf_media_module.security_manager' + - '@zikula_extensions_module.api.variable' + - '@doctrine.orm.entity_manager' + cmfcmf_media_module.form.type.media.archive: + class: Cmfcmf\Module\MediaModule\Form\Media\ArchiveType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.audio: + class: Cmfcmf\Module\MediaModule\Form\Media\AudioType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.deezer: + class: Cmfcmf\Module\MediaModule\Form\Media\DeezerType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.flickr: + class: Cmfcmf\Module\MediaModule\Form\Media\FlickrType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.image: + class: Cmfcmf\Module\MediaModule\Form\Media\ImageType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.markdown: + class: Cmfcmf\Module\MediaModule\Form\Media\MarkdownType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.pdf: + class: Cmfcmf\Module\MediaModule\Form\Media\PdfType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.plaintext: + class: Cmfcmf\Module\MediaModule\Form\Media\PlaintextType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.sound_cloud: + class: Cmfcmf\Module\MediaModule\Form\Media\SoundCloudType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.twitter: + class: Cmfcmf\Module\MediaModule\Form\Media\TwitterType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.unknown: + class: Cmfcmf\Module\MediaModule\Form\Media\UnknownType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.url: + class: Cmfcmf\Module\MediaModule\Form\Media\UrlType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.video: + class: Cmfcmf\Module\MediaModule\Form\Media\VideoType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.web: + class: Cmfcmf\Module\MediaModule\Form\Media\WebType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + cmfcmf_media_module.form.type.media.you_tube: + class: Cmfcmf\Module\MediaModule\Form\Media\YouTubeType + parent: cmfcmf_media_module.form.type.media.base + tags: ['form.type'] + + cmfcmf_media_module.form.type.collection.permission.base: + abstract: true + arguments: + - '@translator' + - '@cmfcmf_media_module.security_manager' + - '@zikula_groups_module.group_repository' + - '@zikula_users_module.user_repository' + cmfcmf_media_module.form.type.collection.permission.group: + class: Cmfcmf\Module\MediaModule\Form\Collection\Permission\GroupPermissionType + parent: cmfcmf_media_module.form.type.collection.permission.base + tags: ['form.type'] + cmfcmf_media_module.form.type.collection.permission.owner: + class: Cmfcmf\Module\MediaModule\Form\Collection\Permission\OwnerPermissionType + parent: cmfcmf_media_module.form.type.collection.permission.base + tags: ['form.type'] + cmfcmf_media_module.form.type.collection.permission.password: + class: Cmfcmf\Module\MediaModule\Form\Collection\Permission\PasswordPermissionType + parent: cmfcmf_media_module.form.type.collection.permission.base + tags: ['form.type'] + cmfcmf_media_module.form.type.collection.permission.user: + class: Cmfcmf\Module\MediaModule\Form\Collection\Permission\UserPermissionType + parent: cmfcmf_media_module.form.type.collection.permission.base + tags: ['form.type'] + + cmfcmf_media_module.form.type.import: + class: Cmfcmf\Module\MediaModule\Form\ImportType + arguments: + - '@translator' + - '@cmfcmf_media_module.security_manager' + tags: ['form.type'] + cmfcmf_media_module.form.type.importer.base: + class: Cmfcmf\Module\MediaModule\Form\Importer\AbstractImporterType + abstract: true + arguments: + - '@translator' + cmfcmf_media_module.form.type.importer.downloads: + class: Cmfcmf\Module\MediaModule\Form\Importer\DownloadsModuleType + parent: cmfcmf_media_module.form.type.importer.base + tags: ['form.type'] + cmfcmf_media_module.form.type.importer.server_directory: + class: Cmfcmf\Module\MediaModule\Form\Importer\ServerDirectoryType + parent: cmfcmf_media_module.form.type.importer.base + tags: ['form.type'] + cmfcmf_media_module.form.type.importer.very_simple_downloads: + class: Cmfcmf\Module\MediaModule\Form\Importer\VerySimpleDownloadsModuleType + parent: cmfcmf_media_module.form.type.importer.base + tags: ['form.type'] + + cmfcmf_media_module.form.type.license: + class: Cmfcmf\Module\MediaModule\Form\License\LicenseType + arguments: + - '@translator' + tags: ['form.type'] + + cmfcmf_media_module.form.type.settings: + class: Cmfcmf\Module\MediaModule\Form\SettingsType + arguments: + - '@translator' + - '@zikula_extensions_module.api.variable' + - '@doctrine.orm.entity_manager' + - '@cmfcmf_media_module.collection_template_collection' + tags: ['form.type'] + + cmfcmf_media_module.form.type.watermark.image: + class: Cmfcmf\Module\MediaModule\Form\Watermark\ImageWatermarkType + arguments: + - '@translator' + tags: ['form.type'] + + cmfcmf_media_module.form.type.watermark.text: + class: Cmfcmf\Module\MediaModule\Form\Watermark\TextWatermarkType + arguments: + - '@translator' + tags: ['form.type'] diff --git a/Resources/config/hooks.yml b/Resources/config/hooks.yml new file mode 100644 index 00000000..ccb34bef --- /dev/null +++ b/Resources/config/hooks.yml @@ -0,0 +1,76 @@ +services: + # Subscribers + cmfcmf_media_module.hook_subscriber.filter_hooks.collections: + class: Cmfcmf\Module\MediaModule\HookSubscriber\CollectionFilterHooksSubscriber + arguments: + - '@translator.default' + tags: + - { name: zikula.hook_subscriber, areaName: 'subscriber.cmfcmfmediamodule.filter_hooks.collections' } + + cmfcmf_media_module.hook_subscriber.filter_hooks.media: + class: Cmfcmf\Module\MediaModule\HookSubscriber\MediaFilterHooksSubscriber + arguments: + - '@translator.default' + tags: + - { name: zikula.hook_subscriber, areaName: 'subscriber.cmfcmfmediamodule.filter_hooks.media' } + + cmfcmf_media_module.hook_subscriber.form_aware_hook.collections: + class: Cmfcmf\Module\MediaModule\HookSubscriber\CollectionFormAwareHookSubscriber + arguments: + - "@translator.default" + tags: + - { name: zikula.hook_subscriber, areaName: 'subscriber.cmfcmfmediamodule.form_aware_hook.collections' } + + cmfcmf_media_module.hook_subscriber.form_aware_hook.media: + class: Cmfcmf\Module\MediaModule\HookSubscriber\MediaFormAwareHookSubscriber + arguments: + - "@translator.default" + tags: + - { name: zikula.hook_subscriber, areaName: 'subscriber.cmfcmfmediamodule.form_aware_hook.media' } + + cmfcmf_media_module.hook_subscriber.ui_hooks.collections: + class: Cmfcmf\Module\MediaModule\HookSubscriber\CollectionUiHooksSubscriber + arguments: + - '@translator.default' + tags: + - { name: zikula.hook_subscriber, areaName: 'subscriber.cmfcmfmediamodule.ui_hooks.collections' } + + cmfcmf_media_module.hook_subscriber.ui_hooks.media: + class: Cmfcmf\Module\MediaModule\HookSubscriber\MediaUiHooksSubscriber + arguments: + - '@translator.default' + tags: + - { name: zikula.hook_subscriber, areaName: 'subscriber.cmfcmfmediamodule.ui_hooks.media' } + + + # Providers + cmfcmf_media_module.hook_provider.ui_hooks.base: + abstract: true + arguments: + - '@translator' + - '@doctrine.orm.default_entity_manager' + - '@request_stack' + - '@templating' + - '@cmfcmf_media_module.security_manager' + + cmfcmf_media_module.hook_provider.ui_hooks.collections: + class: Cmfcmf\Module\MediaModule\HookProvider\CollectionUiHooksProvider + parent: cmfcmf_media_module.hook_provider.ui_hooks.base + calls: + - [setMediaTypeCollection, ['@cmfcmf_media_module.media_type_collection']] + tags: + - { name: zikula.hook_provider, areaName: 'provider.cmfcmfmediamodule.ui_hooks.collections' } + + cmfcmf_media_module.hook_provider.ui_hooks.media: + class: Cmfcmf\Module\MediaModule\HookProvider\MediaUiHooksProvider + parent: cmfcmf_media_module.hook_provider.ui_hooks.base + calls: + - [setMediaTypeCollection, ['@cmfcmf_media_module.media_type_collection']] + tags: + - { name: zikula.hook_provider, areaName: 'provider.cmfcmfmediamodule.ui_hooks.media' } + + cmfcmf_media_module.hook_provider.ui_hooks.licenses: + class: Cmfcmf\Module\MediaModule\HookProvider\LicenseUiHooksProvider + parent: cmfcmf_media_module.hook_provider.ui_hooks.base + tags: + - { name: zikula.hook_provider, areaName: 'provider.cmfcmfmediamodule.ui_hooks.licenses' } diff --git a/Resources/config/importers.yml b/Resources/config/importers.yml index 18369264..3d4cb9ff 100644 --- a/Resources/config/importers.yml +++ b/Resources/config/importers.yml @@ -1,33 +1,36 @@ services: - cmfcmf_media_module.importer_collection: - class: Cmfcmf\Module\MediaModule\Importer\ImporterCollection + cmfcmf_media_module.importer_collection: + class: Cmfcmf\Module\MediaModule\Importer\ImporterCollection - cmfcmf_media_module.importer.abstract_service: - abstract: true - arguments: [@translator, @form.factory, @cmfcmf_media_module.media_type_collection, "@doctrine.orm.entity_manager"] + cmfcmf_media_module.importer.abstract_service: + abstract: true + arguments: + - '@translator' + - '@filesystem' + - '@form.factory' + - '@cmfcmf_media_module.media_type_collection' + - '@doctrine.orm.entity_manager' + - '@request_stack' + - '%datadir%' - cmfcmf_media_module.importer.server_directory: - parent: cmfcmf_media_module.importer.abstract_service - class: Cmfcmf\Module\MediaModule\Importer\ServerDirectoryImporter - calls: - - [setUploadManager, [@stof_doctrine_extensions.uploadable.manager]] - tags: - - { name: 'cmfcmf_media_module.importer' } + cmfcmf_media_module.importer.server_directory: + parent: cmfcmf_media_module.importer.abstract_service + class: Cmfcmf\Module\MediaModule\Importer\ServerDirectoryImporter + calls: + - [setUploadManager, ['@stof_doctrine_extensions.uploadable.manager']] + tags: ['cmfcmf_media_module.importer'] - cmfcmf_media_module.importer.downloads_module: - parent: cmfcmf_media_module.importer.abstract_service - class: Cmfcmf\Module\MediaModule\Importer\DownloadsModuleImporter - calls: - - [setUploadManager, ["@stof_doctrine_extensions.uploadable.manager"]] - - [setUserDataDirectory, ["%datadir%"]] - tags: - - { name: 'cmfcmf_media_module.importer' } + cmfcmf_media_module.importer.downloads_module: + parent: cmfcmf_media_module.importer.abstract_service + class: Cmfcmf\Module\MediaModule\Importer\DownloadsModuleImporter + calls: + - [setUploadManager, ['@stof_doctrine_extensions.uploadable.manager']] + tags: ['cmfcmf_media_module.importer'] - cmfcmf_media_module.importer.very_simple_downloads_module: - parent: cmfcmf_media_module.importer.abstract_service - class: Cmfcmf\Module\MediaModule\Importer\VerySimpleDownloadsModuleImporter - calls: - - [setUploadManager, ["@stof_doctrine_extensions.uploadable.manager"]] - - [setUserDataDirectory, ["%datadir%"]] - tags: - - { name: 'cmfcmf_media_module.importer' } + cmfcmf_media_module.importer.very_simple_downloads_module: + parent: cmfcmf_media_module.importer.abstract_service + class: Cmfcmf\Module\MediaModule\Importer\VerySimpleDownloadsModuleImporter + calls: + - [setUploadManager, ['@stof_doctrine_extensions.uploadable.manager']] + - [setCategoryRegistryRepository, ['@zikula_categories_module.category_registry_repository']] + tags: ['cmfcmf_media_module.importer'] diff --git a/Resources/config/mediatypes.yml b/Resources/config/mediatypes.yml index 467a4ddf..d7c8c888 100644 --- a/Resources/config/mediatypes.yml +++ b/Resources/config/mediatypes.yml @@ -1,96 +1,87 @@ services: - cmfcmf_media_module.media_type.abstract_media: - abstract: true - arguments: ["@templating", "@translator", "@zikula_extensions_module.api.variable"] + cmfcmf_media_module.media_type.abstract_media: + abstract: true + arguments: + - '@templating' + - '@translator' + - '@zikula_extensions_module.api.variable' + - '@request_stack' + - '%datadir%' - cmfcmf_media_module.media_type.abstract_file: - parent: cmfcmf_media_module.media_type.abstract_media - abstract: true - calls: - - [injectThings, [@service_container, @file_locator, @cmfcmf_media_module.font_collection, %kernel.root_dir%]] + cmfcmf_media_module.media_type.abstract_file: + parent: cmfcmf_media_module.media_type.abstract_media + abstract: true + calls: + - [injectThings, ['@service_container', '@file_locator', '%kernel.root_dir%']] - cmfcmf_media_module.media_type.url: - class: Cmfcmf\Module\MediaModule\MediaType\Url - parent: cmfcmf_media_module.media_type.abstract_media - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.url: + class: Cmfcmf\Module\MediaModule\MediaType\Url + parent: cmfcmf_media_module.media_type.abstract_media + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.deezer: - class: Cmfcmf\Module\MediaModule\MediaType\Deezer - parent: cmfcmf_media_module.media_type.abstract_media - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.deezer: + class: Cmfcmf\Module\MediaModule\MediaType\Deezer + parent: cmfcmf_media_module.media_type.abstract_media + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.sound_cloud: - class: Cmfcmf\Module\MediaModule\MediaType\SoundCloud - parent: cmfcmf_media_module.media_type.abstract_media - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.sound_cloud: + class: Cmfcmf\Module\MediaModule\MediaType\SoundCloud + parent: cmfcmf_media_module.media_type.abstract_media + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.flickr: - class: Cmfcmf\Module\MediaModule\MediaType\Flickr - parent: cmfcmf_media_module.media_type.abstract_media - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.flickr: + class: Cmfcmf\Module\MediaModule\MediaType\Flickr + parent: cmfcmf_media_module.media_type.abstract_media + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.you_tube: - class: Cmfcmf\Module\MediaModule\MediaType\YouTube - parent: cmfcmf_media_module.media_type.abstract_media - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.you_tube: + class: Cmfcmf\Module\MediaModule\MediaType\YouTube + parent: cmfcmf_media_module.media_type.abstract_media + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.twitter: - class: Cmfcmf\Module\MediaModule\MediaType\Twitter - parent: cmfcmf_media_module.media_type.abstract_media - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.twitter: + class: Cmfcmf\Module\MediaModule\MediaType\Twitter + parent: cmfcmf_media_module.media_type.abstract_media + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.image: - class: Cmfcmf\Module\MediaModule\MediaType\Image - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.image: + class: Cmfcmf\Module\MediaModule\MediaType\Image + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.pdf: - class: Cmfcmf\Module\MediaModule\MediaType\Pdf - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.pdf: + class: Cmfcmf\Module\MediaModule\MediaType\Pdf + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.plaintext: - class: Cmfcmf\Module\MediaModule\MediaType\Plaintext - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.plaintext: + class: Cmfcmf\Module\MediaModule\MediaType\Plaintext + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.audio: - class: Cmfcmf\Module\MediaModule\MediaType\Audio - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.audio: + class: Cmfcmf\Module\MediaModule\MediaType\Audio + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.video: - class: Cmfcmf\Module\MediaModule\MediaType\Video - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.video: + class: Cmfcmf\Module\MediaModule\MediaType\Video + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.markdown: - class: Cmfcmf\Module\MediaModule\MediaType\Markdown - parent: cmfcmf_media_module.media_type.abstract_file - calls: - - [setMarkdownParser, [@markdown_extra_parser]] - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.markdown: + class: Cmfcmf\Module\MediaModule\MediaType\Markdown + parent: cmfcmf_media_module.media_type.abstract_file + calls: + - [setMarkdownParser, ['@zikula_core.common.markdown_extra_parser']] + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.archive: - class: Cmfcmf\Module\MediaModule\MediaType\Archive - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.archive: + class: Cmfcmf\Module\MediaModule\MediaType\Archive + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] - cmfcmf_media_module.media_type.unknown: - class: Cmfcmf\Module\MediaModule\MediaType\Unknown - parent: cmfcmf_media_module.media_type.abstract_file - tags: - - { name: cmfcmf_media_module.media_type } + cmfcmf_media_module.media_type.unknown: + class: Cmfcmf\Module\MediaModule\MediaType\Unknown + parent: cmfcmf_media_module.media_type.abstract_file + tags: ['cmfcmf_media_module.media_type'] diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index ee6426b7..1e6604af 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -1,43 +1,43 @@ # We need to manually add all the controllers, because the media controller must come -# before the collection controller, so that all slugs containing "/f/" will be matched +# before the collection controller, so that all slugs containing '/f/' will be matched # first. cmfcmfmediamodule_controller_finder: - resource: "@CmfcmfMediaModule/Controller/FinderController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/FinderController.php' + type: annotation cmfcmfmediamodule_controller_mediaType: - resource: "@CmfcmfMediaModule/Controller/MediaTypeController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/MediaTypeController.php' + type: annotation cmfcmfmediamodule_controller_license: - resource: "@CmfcmfMediaModule/Controller/LicenseController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/LicenseController.php' + type: annotation cmfcmfmediamodule_controller_settings: - resource: "@CmfcmfMediaModule/Controller/SettingsController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/SettingsController.php' + type: annotation cmfcmfmediamodule_controller_upgrade: - resource: "@CmfcmfMediaModule/Controller/UpgradeController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/UpgradeController.php' + type: annotation cmfcmfmediamodule_controller_import: - resource: "@CmfcmfMediaModule/Controller/ImportController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/ImportController.php' + type: annotation cmfcmfmediamodule_controller_watermark: - resource: "@CmfcmfMediaModule/Controller/WatermarkController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/WatermarkController.php' + type: annotation cmfcmfmediamodule_controller_permission: - resource: "@CmfcmfMediaModule/Controller/PermissionController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/PermissionController.php' + type: annotation cmfcmfmediamodule_controller_media: - resource: "@CmfcmfMediaModule/Controller/MediaController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/MediaController.php' + type: annotation cmfcmfmediamodule_controller_collection: - resource: "@CmfcmfMediaModule/Controller/CollectionController.php" - type: annotation + resource: '@CmfcmfMediaModule/Controller/CollectionController.php' + type: annotation diff --git a/Resources/config/services.yml b/Resources/config/services.yml index fdd69e67..2643b7a2 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -2,134 +2,134 @@ imports: - { resource: 'mediatypes.yml' } - { resource: 'collectiontemplates.yml' } - { resource: 'collectionpermissions.yml' } + - { resource: 'formtypes.yml' } + - { resource: 'hooks.yml' } - { resource: 'importers.yml' } + - { resource: 'contenttypes.yml' } services: - # Security management - cmfcmf_media_module.security_manager: - class: Cmfcmf\Module\MediaModule\Security\SecurityManager - arguments: [@translator, @zikula_permissions_module.api.permission, @doctrine.orm.default_entity_manager, @cmfcmf_media_module.collection_permission.container] - - - # Module upgrader and version checker - cmfcmf_media_module.upgrade.module_upgrader: - class: Cmfcmf\Module\MediaModule\Upgrade\ModuleUpgrader - arguments: [@translator, @zikula.cache_clearer, %kernel.cache_dir%, %kernel.root_dir%] - - cmfcmf_media_module.upgrade.version_checker: - class: Cmfcmf\Module\MediaModule\Upgrade\VersionChecker - arguments: [%kernel.cache_dir%] - - - # Form types - cmfcmf_media_module.form.type.font: - class: Cmfcmf\Module\MediaModule\Form\Type\FontType - arguments: [@cmfcmf_media_module.font_collection] - tags: - - { name: form.type, alias: cmfcmfmediamodule_font_choice } - - cmfcmf_media_module.form.type.color: - class: Cmfcmf\Module\MediaModule\Form\Type\ColorType - tags: - - { name: form.type, alias: cmfcmfmediamodule_color } - - cmfcmf_media_module.form.type.permission_level: - class: Cmfcmf\Module\MediaModule\Form\Type\PermissionLevelType - arguments: - - @cmfcmf_media_module.security_manager - tags: - - { name: form.type, alias: cmfcmfmediamodule_permission } - - cmfcmf_media_module.form.type.collection_template: - class: Cmfcmf\Module\MediaModule\Form\CollectionTemplate\TemplateType - arguments: - - "@translator" - - "@cmfcmf_media_module.collection_template_collection" - - "@cmfcmf_media_module.collection_template.selected_factory" - tags: - - { name: form.type, alias: cmfcmfmediamodule_collectiontemplate } - - - # Listeners - cmfcmf_media_module.listener.module: - class: Cmfcmf\Module\MediaModule\Listener\ModuleListener - arguments: [@doctrine.orm.default_entity_manager] - tags: - - { name: kernel.event_subscriber } - - cmfcmf_media_module.listener.thirdparty: - class: Cmfcmf\Module\MediaModule\Listener\ThirdPartyListener - arguments: [%kernel.root_dir%] - tags: - - { name: kernel.event_subscriber } - - cmfcmf_media_module.listener.doctrine: - class: Cmfcmf\Module\MediaModule\Listener\DoctrineListener - tags: - - { name: doctrine.event_subscriber } - - - # Link container - cmfcmf_media_module.container.links: - class: Cmfcmf\Module\MediaModule\Container\LinkContainer - arguments: [@router, @cmfcmf_media_module.security_manager, @translator, @doctrine.orm.default_entity_manager] - tags: - - { name: zikula.link_container } - - - # Collection of media types - cmfcmf_media_module.media_type_collection: - class: Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection - lazy: true - - - # Collection of "Collection" templates - cmfcmf_media_module.collection_template_collection: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\TemplateCollection - lazy: true - - - # Selected collection template factory - cmfcmf_media_module.collection_template.selected_factory: - class: Cmfcmf\Module\MediaModule\CollectionTemplate\SelectedTemplateFactory - arguments: ["@cmfcmf_media_module.collection_template_collection"] - - # Twig extension - cmfcmf_media_module.twig_extension: - class: Cmfcmf\Module\MediaModule\Twig\TwigExtension - arguments: [@markdown_extra_parser, @hook_dispatcher, @cmfcmf_media_module.security_manager, @cmfcmf_media_module.upgrade.version_checker, @translator] - public: false - tags: - - { name: twig.extension } - - - # Hook handlers - cmfcmf_media_module.hook_handler.base: - abstract: true - arguments: [@doctrine.orm.default_entity_manager, @request_stack, @templating, @cmfcmf_media_module.security_manager, @translator] - - cmfcmf_media_module.hook_handler.license: - class: Cmfcmf\Module\MediaModule\HookHandler\LicenseHookHandler - parent: cmfcmf_media_module.hook_handler.base - - cmfcmf_media_module.hook_handler.media: - class: Cmfcmf\Module\MediaModule\HookHandler\MediaHookHandler - parent: cmfcmf_media_module.hook_handler.base - calls: - - [setMediaTypeCollection, [@cmfcmf_media_module.media_type_collection]] - - cmfcmf_media_module.hook_handler.collection: - class: Cmfcmf\Module\MediaModule\HookHandler\CollectionHookHandler - parent: cmfcmf_media_module.hook_handler.base - calls: - - [setMediaTypeCollection, [@cmfcmf_media_module.media_type_collection]] - - - # Fonts - cmfcmf_media_module.font.font_loader: - class: Cmfcmf\Module\MediaModule\Font\FontLoader - tags: - - { name: cmfcmf_media_module.font } - - cmfcmf_media_module.font_collection: - class: Cmfcmf\Module\MediaModule\Font\FontCollection + # Imagine filter + cmfcmf_media_module.filter.custom_image_filter: + class: Cmfcmf\Module\MediaModule\Imagine\Filter\Loader\CustomImageFilter + arguments: + - '@liip_imagine' + - '@doctrine.orm.default_entity_manager' + - '@cmfcmf_media_module.font_collection' + tags: + - { name: 'liip_imagine.filter.loader', loader: cmfcmfmediamodule.custom_image_filter } + + # Security management + cmfcmf_media_module.security_manager: + class: Cmfcmf\Module\MediaModule\Security\SecurityManager + arguments: + - '@translator' + - '@zikula_permissions_module.api.permission' + - '@doctrine.orm.default_entity_manager' + - '@cmfcmf_media_module.collection_permission.container' + + # Module upgrader and version checker + cmfcmf_media_module.upgrade.module_upgrader: + class: Cmfcmf\Module\MediaModule\Upgrade\ModuleUpgrader + arguments: + - '@translator' + - '@filesystem' + - '@event_dispatcher' + - '@zikula_extensions_module.extension_repository' + - '@zikula_extensions_module.bundle_sync_helper' + - '@zikula_extensions_module.extension_helper' + - '@zikula.cache_clearer' + - '%kernel.cache_dir%' + - '%kernel.root_dir%' + + cmfcmf_media_module.upgrade.version_checker: + class: Cmfcmf\Module\MediaModule\Upgrade\VersionChecker + arguments: + - '%kernel.cache_dir%' + + # Helpers + cmfcmf_media_module.search_helper: + class: Cmfcmf\Module\MediaModule\Helper\SearchHelper + arguments: + - '@request_stack' + - '@cmfcmf_media_module.security_manager' + tags: + - { name: zikula.searchable_module, bundleName: CmfcmfMediaModule } + + # Listeners + cmfcmf_media_module.listener.doctrine: + class: Cmfcmf\Module\MediaModule\Listener\DoctrineListener + tags: ['doctrine.event_subscriber'] + + cmfcmf_media_module.listener.entity_lifecycle: + class: Cmfcmf\Module\MediaModule\Listener\EntityLifecycleListener + arguments: + - '@service_container' + tags: ['doctrine.event_subscriber'] + + cmfcmf_media_module.listener.module: + class: Cmfcmf\Module\MediaModule\Listener\ModuleListener + arguments: + - '@doctrine.orm.default_entity_manager' + tags: ['kernel.event_subscriber'] + + cmfcmf_media_module.listener.thirdparty: + class: Cmfcmf\Module\MediaModule\Listener\ThirdPartyListener + arguments: + - '@filesystem' + - '@request_stack' + tags: ['kernel.event_subscriber'] + + # Link container + cmfcmf_media_module.container.links: + class: Cmfcmf\Module\MediaModule\Container\LinkContainer + arguments: + - '@router' + - '@cmfcmf_media_module.security_manager' + - '@translator' + - '@doctrine.orm.default_entity_manager' + tags: ['zikula.link_container'] + + + # Collection of media types + cmfcmf_media_module.media_type_collection: + class: Cmfcmf\Module\MediaModule\MediaType\MediaTypeCollection + lazy: true + + + # Collection of "Collection" templates + cmfcmf_media_module.collection_template_collection: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\TemplateCollection + lazy: true + + + # Selected collection template factory + cmfcmf_media_module.collection_template.selected_factory: + class: Cmfcmf\Module\MediaModule\CollectionTemplate\SelectedTemplateFactory + arguments: + - '@cmfcmf_media_module.collection_template_collection' + - "@=service('zikula_extensions_module.api.variable').get('CmfcmfMediaModule', 'defaultCollectionTemplate')" + + # Twig extension + cmfcmf_media_module.twig_extension: + class: Cmfcmf\Module\MediaModule\Twig\TwigExtension + arguments: + - '@translator' + - '@zikula_core.common.markdown_extra_parser' + - '@hook_dispatcher' + - '@cmfcmf_media_module.security_manager' + - '@cmfcmf_media_module.upgrade.version_checker' + - '@zikula_extensions_module.extension_repository' + - '@zikula_extensions_module.api.variable' + public: false + tags: ['twig.extension'] + + # Fonts + cmfcmf_media_module.font.font_loader: + class: Cmfcmf\Module\MediaModule\Font\FontLoader + tags: ['cmfcmf_media_module.font'] + + cmfcmf_media_module.font_collection: + class: Cmfcmf\Module\MediaModule\Font\FontCollection + +parameters: + liip_imagine.cache.signer.class: Cmfcmf\Module\MediaModule\Imagine\Cache\DummySigner diff --git a/Resources/public/css/vendor/select2.min.css b/Resources/public/css/vendor/select2.min.css index 1c723442..60d59904 100644 --- a/Resources/public/css/vendor/select2.min.css +++ b/Resources/public/css/vendor/select2.min.css @@ -1 +1 @@ -.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle;}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px;}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none;}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap;}.select2-container .select2-search--inline{float:left;}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051;}.select2-results{display:block;}.select2-results__options{list-style:none;margin:0;padding:0;}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none;}.select2-results__option[aria-selected]{cursor:pointer;}.select2-container--open .select2-dropdown{left:0;}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-search--dropdown{display:block;padding:4px;}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box;}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none;}.select2-search--dropdown.select2-search--hide{display:none;}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0);}.select2-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px;}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px;}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto;}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none;}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%;}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left;}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder{float:right;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0;}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default;}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none;}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0;}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa;}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--default .select2-results__option[role=group]{padding:0;}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999;}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd;}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em;}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em;}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white;}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic .select2-selection--single{background-color:#f6f6f6;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px;}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px;}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999;}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', GradientType=0);}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left;}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto;}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none;}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb;}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none;}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px;}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto;}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto;}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb;}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0;}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0;}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;}.select2-container--classic .select2-dropdown{background-color:white;border:1px solid transparent;}.select2-container--classic .select2-dropdown--above{border-bottom:none;}.select2-container--classic .select2-dropdown--below{border-top:none;}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto;}.select2-container--classic .select2-results__option[role=group]{padding:0;}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey;}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:white;}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb;} \ No newline at end of file +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} diff --git a/Resources/public/css/vendor/toastr.min.css b/Resources/public/css/vendor/toastr.min.css index 64adc420..643135ea 100644 --- a/Resources/public/css/vendor/toastr.min.css +++ b/Resources/public/css/vendor/toastr.min.css @@ -1 +1 @@ -.toast-title{font-weight:700}.toast-message{-ms-word-wrap:break-word;word-wrap:break-word}.toast-message a,.toast-message label{color:#fff}.toast-message a:hover{color:#ccc;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#fff;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8;-ms-filter:alpha(Opacity=80);filter:alpha(opacity=80)}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;-ms-filter:alpha(Opacity=40);filter:alpha(opacity=40)}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{position:fixed;z-index:999999}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container>div{position:relative;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#fff;opacity:.8;-ms-filter:alpha(Opacity=80);filter:alpha(opacity=80)}#toast-container>:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;opacity:1;-ms-filter:alpha(Opacity=100);filter:alpha(opacity=100);cursor:pointer}#toast-container>.toast-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important}#toast-container>.toast-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important}#toast-container>.toast-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important}#toast-container>.toast-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important}#toast-container.toast-bottom-center>div,#toast-container.toast-top-center>div{width:300px;margin:auto}#toast-container.toast-bottom-full-width>div,#toast-container.toast-top-full-width>div{width:96%;margin:auto}.toast{background-color:#030303}.toast-success{background-color:#51a351}.toast-error{background-color:#bd362f}.toast-info{background-color:#2f96b4}.toast-warning{background-color:#f89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4;-ms-filter:alpha(Opacity=40);filter:alpha(opacity=40)}@media all and (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container .toast-close-button{right:-.2em;top:-.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}} +/* * Note that this is toastr v2.1.3, the "latest" version in url has no more maintenance, * please go to https://cdnjs.com/libraries/toastr.js and pick a certain version you want to use, * make sure you copy the url from the website since the url may change between versions. * */ .toast-title{font-weight:700}.toast-message{-ms-word-wrap:break-word;word-wrap:break-word}.toast-message a,.toast-message label{color:#FFF}.toast-message a:hover{color:#CCC;text-decoration:none}.toast-close-button{position:relative;right:-.3em;top:-.3em;float:right;font-size:20px;font-weight:700;color:#FFF;-webkit-text-shadow:0 1px 0 #fff;text-shadow:0 1px 0 #fff;opacity:.8;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80);line-height:1}.toast-close-button:focus,.toast-close-button:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40)}.rtl .toast-close-button{left:-.3em;float:left;right:.3em}button.toast-close-button{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.toast-top-center{top:0;right:0;width:100%}.toast-bottom-center{bottom:0;right:0;width:100%}.toast-top-full-width{top:0;right:0;width:100%}.toast-bottom-full-width{bottom:0;right:0;width:100%}.toast-top-left{top:12px;left:12px}.toast-top-right{top:12px;right:12px}.toast-bottom-right{right:12px;bottom:12px}.toast-bottom-left{bottom:12px;left:12px}#toast-container{position:fixed;z-index:999999;pointer-events:none}#toast-container *{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}#toast-container>div{position:relative;pointer-events:auto;overflow:hidden;margin:0 0 6px;padding:15px 15px 15px 50px;width:300px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-position:15px center;background-repeat:no-repeat;-moz-box-shadow:0 0 12px #999;-webkit-box-shadow:0 0 12px #999;box-shadow:0 0 12px #999;color:#FFF;opacity:.8;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=80);filter:alpha(opacity=80)}#toast-container>div.rtl{direction:rtl;padding:15px 50px 15px 15px;background-position:right 15px center}#toast-container>div:hover{-moz-box-shadow:0 0 12px #000;-webkit-box-shadow:0 0 12px #000;box-shadow:0 0 12px #000;opacity:1;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=100);filter:alpha(opacity=100);cursor:pointer}#toast-container>.toast-info{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=)!important}#toast-container>.toast-error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=)!important}#toast-container>.toast-success{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==)!important}#toast-container>.toast-warning{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=)!important}#toast-container.toast-bottom-center>div,#toast-container.toast-top-center>div{width:300px;margin-left:auto;margin-right:auto}#toast-container.toast-bottom-full-width>div,#toast-container.toast-top-full-width>div{width:96%;margin-left:auto;margin-right:auto}.toast{background-color:#030303}.toast-success{background-color:#51A351}.toast-error{background-color:#BD362F}.toast-info{background-color:#2F96B4}.toast-warning{background-color:#F89406}.toast-progress{position:absolute;left:0;bottom:0;height:4px;background-color:#000;opacity:.4;-ms-filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=40);filter:alpha(opacity=40)}@media all and (max-width:240px){#toast-container>div{padding:8px 8px 8px 50px;width:11em}#toast-container>div.rtl{padding:8px 50px 8px 8px}#toast-container .toast-close-button{right:-.2em;top:-.2em}#toast-container .rtl .toast-close-button{left:-.2em;right:.2em}}@media all and (min-width:241px) and (max-width:480px){#toast-container>div{padding:8px 8px 8px 50px;width:18em}#toast-container>div.rtl{padding:8px 50px 8px 8px}#toast-container .toast-close-button{right:-.2em;top:-.2em}#toast-container .rtl .toast-close-button{left:-.2em;right:.2em}}@media all and (min-width:481px) and (max-width:768px){#toast-container>div{padding:15px 15px 15px 50px;width:25em}#toast-container>div.rtl{padding:15px 50px 15px 15px}} \ No newline at end of file diff --git a/Resources/public/js/CKEditorPlugin/plugin.js b/Resources/public/js/CKEditorPlugin/plugin.js deleted file mode 100644 index 79bdb8ab..00000000 --- a/Resources/public/js/CKEditorPlugin/plugin.js +++ /dev/null @@ -1,26 +0,0 @@ -window.CmfcmfMediaModule = window.CmfcmfMediaModule || {}; -window.CmfcmfMediaModule.currentEditor = window.CmfcmfMediaModule.currentEditor || null; -window.CmfcmfMediaModule.currentEditorInstance = window.CmfcmfMediaModule.currentEditorInstance || null; - -CKEDITOR.plugins.add('cmfcmfmediamodule', { - requires: 'popup', - lang: 'en,de', - init: function (editor) { - editor.addCommand('insertMediaObject', { - exec: function (editor) { - window.CmfcmfMediaModule.currentEditor = 'ckeditor'; - window.CmfcmfMediaModule.currentEditorInstance = editor; - editor.popup( - Routing.generate('cmfcmfmediamodule_finder_choosemethod'), - /*width*/ '80%', /*height*/ '70%', - 'location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes' - ); - } - }); - editor.ui.addButton('cmfcmfmediamodule', { - label: editor.lang.cmfcmfmediamodule.title, - command: 'insertMediaObject', - icon: this.path + '/../../../images/admin.png' - }); - } -}); diff --git a/Resources/public/js/CmfcmfMediaModule.ContentType.Media.js b/Resources/public/js/CmfcmfMediaModule.ContentType.Media.js new file mode 100644 index 00000000..3851e8ed --- /dev/null +++ b/Resources/public/js/CmfcmfMediaModule.ContentType.Media.js @@ -0,0 +1,60 @@ +'use strict'; + +/** + * Loads and displays the preview for a selected medium. + */ +function getMediaPreview(id) { + var result; + + result = ''; + if (!id) { + return result; + } + + jQuery.ajax({ + url: Routing.generate('cmfcmfmediamodule_media_getembeddata', {id: id}), + method: 'GET', + async: false + }).done(function (data) { + result = data.preview; + }); + + return result; +} + +/** + * Initialises the media edit view. + */ +function contentInitMediaEdit() { + var mediaSelector; + + mediaSelector = jQuery('#zikulacontentmodule_contentitem_contentData_id'); + mediaSelector.parent().append('

' + getMediaPreview(mediaSelector.val()) + '

'); + mediaSelector.change(function () { + mediaSelector.parent().find('.help-block').first().html(''); + mediaSelector.parent().find('.help-block').first().html(getMediaPreview(mediaSelector.val())); + }); +} + +/** + * Initialises the media translation view. + */ +function contentInitMediaTranslation() { + jQuery('.source-section .field-id').each(function (index) { + var fieldContainer; + + fieldContainer = jQuery(this).find('.form-control-static'); + zikulacontentmodule_translate_contentData_id + fieldContainer.append('

' + getMediaPreview(fieldContainer.text()) + '

'); + }); + jQuery('#contentTranslateTarget .tab-content').find("select[id$='_id']").each(function (index) { + var mediaSelector; + + mediaSelector = jQuery(this); + mediaSelector.parents('.col-sm-9').first().append('

' + getMediaPreview(mediaSelector.val()) + '

'); + mediaSelector.change(function () { + mediaSelector.parents('.col-sm-9').first().find('.help-block').first().html(''); + mediaSelector.parents('.col-sm-9').first().find('.help-block').first().html(getMediaPreview(mediaSelector.val())); + }); + }); +} diff --git a/Resources/public/js/Collection/Permission/View.js b/Resources/public/js/Collection/Permission/View.js index 0a788163..d87a66f3 100644 --- a/Resources/public/js/Collection/Permission/View.js +++ b/Resources/public/js/Collection/Permission/View.js @@ -20,7 +20,7 @@ }); // Element is before the lowest locked element. if (evt.newIndex < highestLockedIndex) { - window.toastr['error']('You cannot move a permission with goOn = no above a locked permission.', 'Problem detected!'); + window.toastr['error'](Translator.__('You cannot move a permission with goOn = no above a locked permission.'), Translator.__('Problem detected!')); $table.find('tr:nth-child(' + parseInt(evt.oldIndex + 1) + ')').after($item); return; @@ -32,7 +32,7 @@ newIndex: parseInt(evt.newIndex) })).success(function (data) { $item.data('version', data.newVersion); - window.toastr['success']('', 'Saved new position.'); + window.toastr['success']('', Translator.__('Saved new position.')); }).fail(window.CmfcmfMediaModule.Util.Ajax.fail); } }); diff --git a/Resources/public/js/Collection/cards.js b/Resources/public/js/Collection/cards.js index 4d44556f..86e1210e 100644 --- a/Resources/public/js/Collection/cards.js +++ b/Resources/public/js/Collection/cards.js @@ -39,11 +39,11 @@ position: evt.newIndex, 'new-position': evt.newIndex, 'old-position': evt.oldIndex - }).success(function () { - window.toastr['success']('', 'Saved new position.'); + }).done(function () { + window.toastr['success']('', Translator.__('Saved new position.')); }).fail(window.CmfcmfMediaModule.Util.Ajax.fail); } }); } }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/Resources/public/js/Finder/base.js b/Resources/public/js/Finder/base.js index 5af71c31..e96c334f 100644 --- a/Resources/public/js/Finder/base.js +++ b/Resources/public/js/Finder/base.js @@ -23,7 +23,7 @@ return; } - $.getJSON(Routing.generate('cmfcmfmediamodule_finder_ajaxfind'), {q: $searchInput.val()}).success(function (results) { + $.getJSON(Routing.generate('cmfcmfmediamodule_finder_ajaxfind'), {q: $searchInput.val()}, function (results) { $cog.addClass('hidden'); var $table = $('#cmfcmfmedia-finder-table-body'); @@ -36,6 +36,7 @@ tr += '' + window.CmfcmfMediaModule.Util.htmlEncode(results[i].type) + ''; tr += '' + window.CmfcmfMediaModule.Util.htmlEncode(results[i].title) + ''; + tr += '' + results[i].preview + ''; if (results[i].license) { tr += ''; if (results[i].license.url) { @@ -49,7 +50,7 @@ } else { tr += '--'; } - tr += 'view'; + tr += '' + Translator.__('view') + ''; tr += ''; diff --git a/Resources/public/js/Finder/opener.js b/Resources/public/js/Finder/opener.js new file mode 100644 index 00000000..a20d9290 --- /dev/null +++ b/Resources/public/js/Finder/opener.js @@ -0,0 +1,35 @@ +window.CmfcmfMediaModule = window.CmfcmfMediaModule || {}; +window.CmfcmfMediaModule.currentEditor = window.CmfcmfMediaModule.currentEditor || null; +window.CmfcmfMediaModule.currentEditorInstance = window.CmfcmfMediaModule.currentEditorInstance || null; + +/** + * Returns the attributes used for the popup window. + * @return {String} + */ +function getCmfcmfMediaModulePopupAttributes() { + var pWidth, pHeight; + + pWidth = screen.width * 0.75; + pHeight = screen.height * 0.66; + + return 'width=' + pWidth + ',height=' + pHeight + ',location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes'; +} + +/** + * Open a popup window with the finder triggered by an editor button. + */ +function CmfcmfMediaModuleFinderOpenPopup(editor, editorName) { + var popupUrl; + + // Save editor for access in selector window + window.CmfcmfMediaModule.currentEditor = editorName; + window.CmfcmfMediaModule.currentEditorInstance = editor; + + popupUrl = Routing.generate('cmfcmfmediamodule_finder_choosemethod'); + + if (editorName == 'ckeditor') { + editor.popup(popupUrl, /*width*/ '80%', /*height*/ '70%', getCmfcmfMediaModulePopupAttributes()); + } else { + window.open(popupUrl, '_blank', getCmfcmfMediaModulePopupAttributes()); + } +} diff --git a/Resources/public/js/Finder/popup.js b/Resources/public/js/Finder/popup.js index 73b659a4..9c78fe65 100644 --- a/Resources/public/js/Finder/popup.js +++ b/Resources/public/js/Finder/popup.js @@ -3,15 +3,19 @@ $(document).on('cmfcmfmediamodule:media:finder:getbuttons', function (event) { event.tableResult += '' + Translator.__('Full size') + '' ; event.tableResult += '' + Translator.__('Medium size') + '' ; event.tableResult += '' + Translator.__('Small size') + '' + ; + event.tableResult += '' ; }); @@ -21,8 +25,18 @@ case 'ckeditor': window.opener.CmfcmfMediaModule.currentEditorInstance.insertHtml(html); break; + case 'quill': + window.opener.CmfcmfMediaModule.currentEditorInstance.clipboard.dangerouslyPasteHTML(window.opener.CmfcmfMediaModule.currentEditorInstance.getLength(), html); + break; + case 'summernote': + html = jQuery(html).get(0); + window.opener.CmfcmfMediaModule.currentEditorInstance.invoke('insertNode', html); + break; + case 'tinymce': + window.opener.CmfcmfMediaModule.currentEditorInstance.insertContent(html); + break; } - window.opener.toastr['success']('The media object has been successfully inserted.', 'Media object inserted'); + window.opener.toastr['success'](Translator.__('The medium has been successfully inserted.'), Translator.__('Medium inserted')); window.opener.focus(); window.close(); }); diff --git a/Resources/public/js/Media/Display/slider.js b/Resources/public/js/Media/Display/slider.js index 308b2373..e749bcae 100644 --- a/Resources/public/js/Media/Display/slider.js +++ b/Resources/public/js/Media/Display/slider.js @@ -1,9 +1,9 @@ (function ($) { $(function () { - var $slider = $('#cmfcmfmedia-display-slider'); + var $slider = $('.cmfcmfmedia-display-slider'); $slider.slick({ autoplay: true, - dots: $slider.children().size() <= 10, + dots: $slider.children().length <= 10, slidesToShow: 1, centerMode: true, variableWidth: true, diff --git a/Resources/public/js/Media/New/paste.js b/Resources/public/js/Media/New/paste.js index 21129809..0b29ca0b 100644 --- a/Resources/public/js/Media/New/paste.js +++ b/Resources/public/js/Media/New/paste.js @@ -17,10 +17,10 @@ $.ajax({ url: Routing.generate('cmfcmfmediamodule_media_matchespaste'), data: {pastedText: pastedText}, - method: "POST" - }).success(function (mediaTypes) { + method: 'POST' + }).done(function (mediaTypes) { if (mediaTypes.length == 0) { - window.toastr["warning"]( + window.toastr['warning']( "It seems like it isn't supported (yet) or simply an unknown way of embedding. " + "Please consider to open an issue.", "Pasted url or embed code could not be parsed." diff --git a/Resources/public/js/Media/New/upload.js b/Resources/public/js/Media/New/upload.js index eee77911..01748dc9 100644 --- a/Resources/public/js/Media/New/upload.js +++ b/Resources/public/js/Media/New/upload.js @@ -9,7 +9,7 @@ function onOneFileUpload (file) { getMediaTypeFromFiles([fileToArray(file)], function (response) { if (!response.result[0]) { - window.toastr['error']('This media type is currently not supported', "We're sorry!"); + window.toastr['error'](Translator.__('This media type is currently not supported'), Translator.__("We're sorry!")); $('#cmfcmfmedia-tab-content').spin(false); return; } @@ -37,14 +37,14 @@ } if (response.notFound > 0) { if (!canUpload) { - window.toastr['error']('Your files are not supported.', 'Cannot upload files!'); + window.toastr['error'](Translator.__('These files are not supported.'), Translator.__('Cannot upload files!')); return; } - window.toastr['warning']('Some of your files will not be uploaded.', 'Cannot upload everything!'); + window.toastr['warning'](Translator.__('Some of these files will not be uploaded.'), Translator.__('Cannot upload everything!')); } openCollectionSelectModal(function (collection) { - console.log('Selected collection', collection); + //console.log('Selected collection', collection); formDataToAdd.collection = collection; myDropzone.enqueueFiles(files); @@ -115,32 +115,32 @@ previewsContainer: "#cmfcmfmedia-upload-previews", // Define the container to display the previews clickable: "#cmfcmfmedia-upload-fileinput-btn", dragover: function (event) { - console.log('OVER'); - console.log(event); + //console.log('OVER'); + //console.log(event); }, dragleave: function (event) { - console.log('LEAVE'); - console.log(event); + //console.log('LEAVE'); + //console.log(event); } }); // Update the total progress bar - myDropzone.on("totaluploadprogress", function(progress) { - document.querySelector("#cmfcmfmedia-upload-total-progress .progress-bar").style.width = progress + "%"; + myDropzone.on('totaluploadprogress', function(progress) { + document.querySelector("#cmfcmfmedia-upload-total-progress .progress-bar").style.width = progress + '%'; }); // Hide the total progress bar when nothing's uploading anymore - myDropzone.on("queuecomplete", function(progress) { - document.querySelector("#cmfcmfmedia-upload-total-progress").style.opacity = "0"; + myDropzone.on('queuecomplete', function(progress) { + document.querySelector("#cmfcmfmedia-upload-total-progress").style.opacity = '0'; - window.toastr["success"]('', "Files have been uploaded"); + window.toastr["success"]('', Translator.__('Files have been uploaded')); }); - myDropzone.on("sending", function(file, xhr, formData) { + myDropzone.on('sending', function(file, xhr, formData) { // Show the total progress bar when upload starts - document.querySelector("#cmfcmfmedia-upload-total-progress").style.opacity = "1"; + document.querySelector("#cmfcmfmedia-upload-total-progress").style.opacity = '1'; // And disable the start button - file.previewElement.querySelector(".start").setAttribute("disabled", "disabled"); + file.previewElement.querySelector('.start').setAttribute('disabled', 'disabled'); Object.keys(formDataToAdd).forEach(function (key) { if (formDataToAdd[key] != null) { @@ -149,14 +149,14 @@ }); }); - myDropzone.on("addedfile", function(file) { + myDropzone.on('addedfile', function(file) { // Hookup the start button - file.previewElement.querySelector(".start").onclick = function () { + file.previewElement.querySelector('.start').onclick = function () { onOneFileUpload(file); }; }); - myDropzone.on("success", function (file, response) { + myDropzone.on('success', function (file, response) { if (response.openNewTabAndEdit) { var parent = $('#cmfcmfmedia-upload-form-modal-collection-select').data('parent'); var parameters = ''; @@ -182,7 +182,7 @@ // Setup the buttons for all transfers // The "add files" button doesn't need to be setup because the config // `clickable` has already been specified. - $("#cmfcmfmedia-upload-actions").find(".start").click(onAllFilesUpload); + $('#cmfcmfmedia-upload-actions').find('.start').click(onAllFilesUpload); return myDropzone; } diff --git a/Resources/public/js/Media/New/web.js b/Resources/public/js/Media/New/web.js index a908cd7b..02dca3f0 100644 --- a/Resources/public/js/Media/New/web.js +++ b/Resources/public/js/Media/New/web.js @@ -133,7 +133,7 @@ return; } $results.empty(); - $results.append('Searching...'); + $results.append('' + Translator.__('Searching...') + ''); var dropdownValue = $btn.val(); if (typeof onSearch === "function") { @@ -156,7 +156,7 @@ $results.empty(); if (resultSet.results.length == 0) { $results.append( - 'No results found' + '' + Translator.__('No results found.') + '' ); return; } @@ -171,7 +171,7 @@ var settings = window.CmfcmfMediaModule.Util.htmlAttrEncode(JSON.stringify(resultSet.results[i][0])); resultTable += '' + '' + + '-submit-btn" data-settings="' + settings + '">' + Translator.__('Choose') + ' ' + ''; resultTable += ''; } @@ -180,14 +180,13 @@ }; $input.blur(actualCallback); $btn.change(actualCallback); - $(document).on("keypress", $input, function(event) { + $(document).on('keypress', $input, function(event) { if (event.keyCode != 13) { return true; - } else { - $input.blur(); - // Ignore ENTER -> Do not submit form on enter. - return false; } + $input.blur(); + // Ignore ENTER -> Do not submit form on enter. + return false; }); } } diff --git a/Resources/public/js/MediaType/Deezer/WebCreation.js b/Resources/public/js/MediaType/Deezer/WebCreation.js index 7496c8fc..cb7ca362 100644 --- a/Resources/public/js/MediaType/Deezer/WebCreation.js +++ b/Resources/public/js/MediaType/Deezer/WebCreation.js @@ -8,13 +8,13 @@ new window.CmfcmfMediaModule.WebCreation.tableColumns.FirstLineBoldColumn('Result') ], { - everything: 'Everything', - track: 'Tracks', - album: 'Albums', - artist: 'Artists', - playlist: 'Playlists' + everything: Translator.__('Everything'), + track: Translator.__('Tracks'), + album: Translator.__('Albums'), + artist: Translator.__('Artists'), + playlist: Translator.__('Playlists') }, - 'Search for artist, track, playlist or album', + Translator.__('Search for artist, track, playlist or album'), function (searchInput, dropdownValue, onFinished) { var query = '/search'; if (dropdownValue != 'everything') { @@ -39,15 +39,15 @@ title = result.title; results.push([ result.album.cover_small, - 'Track', - title + "\nArtist: " + result.artist.name + "\nAlbum: " + result.album.title + Translator.__('Track'), + title + "\n" + Translator.__('Artist') + ': ' + result.artist.name + "\n" + Translator.__('Album') + ': ' + result.album.title ]); break; case 'album': title = result.title; results.push([ result.cover_small, - 'Album', + Translator.__('Album'), title + "\n" + result.artist.name ]); break; @@ -55,16 +55,16 @@ title = result.name; results.push([ result.picture_small, - 'Artist', - name + "\nFans: " + result.nb_fan + Translator.__('Artist'), + name + "\n" + Translator.__('Fans') + ': ' + result.nb_fan ]); break; case 'playlist': title = result.title; results.push([ result.picture_small, - 'Playlist', - title + "\nCreator: " + result.user.name + "\nTracks: " + result.nb_tracks + Translator.__('Playlist'), + title + "\n" + Translator.__('Creator') + ': ' + result.user.name + "\n" + Translator.__('Tracks') + ': ' + result.nb_tracks ]); break; default: diff --git a/Resources/public/js/MediaType/Flickr/WebCreation.js b/Resources/public/js/MediaType/Flickr/WebCreation.js index 569a7d1d..724c2bb8 100644 --- a/Resources/public/js/MediaType/Flickr/WebCreation.js +++ b/Resources/public/js/MediaType/Flickr/WebCreation.js @@ -37,9 +37,9 @@ new window.CmfcmfMediaModule.WebCreation.tableColumns.UrlColumn('License') ], { - everything: 'Everything' + everything: Translator.__('Everything') }, - 'Search for images', + Translator.__('Search for images'), function (searchInput, dropdownValue, onFinished) { var license = '';//encodeURIComponent(license); diff --git a/Resources/public/js/MediaType/SoundCloud/WebCreation.js b/Resources/public/js/MediaType/SoundCloud/WebCreation.js index c009ed4a..cd3d321e 100644 --- a/Resources/public/js/MediaType/SoundCloud/WebCreation.js +++ b/Resources/public/js/MediaType/SoundCloud/WebCreation.js @@ -8,12 +8,12 @@ new window.CmfcmfMediaModule.WebCreation.tableColumns.FirstLineBoldColumn('Result') ], { - tracks: 'Tracks', - groups: 'Groups', - users: 'Artists', - playlists: 'Playlists' + tracks: Translator.__('Tracks'), + groups: Translator.__('Groups'), + users: Translator.__('Artists'), + playlists: Translator.__('Playlists') }, - 'Search for artist, track, playlist', + Translator.__('Search for artist, track, playlist'), function (searchInput, dropdownValue, onFinished) { var query = '/' + encodeURIComponent(dropdownValue) + '?q=' + encodeURIComponent(searchInput); @@ -35,8 +35,8 @@ title = result.full_name; results.push([ result.avatar_url, - 'User', - title + "\nFollowers: " + result.followers_count + "\nTracks: " + result.track_count + Translator.__('User'), + title + "\n" + Translator.__('Followers') + ': ' + result.followers_count + "\n" + Translator.__('Tracks') + ': ' + result.track_count ]); break; case 'track': @@ -49,25 +49,25 @@ } results.push([ image, - 'Track', - title + "\nLicense: " + result.license + Translator.__('Track'), + title + "\n" + Translator.__('License') + ': ' + result.license ]); break; case 'group': title = result.name; results.push([ result.artwork_url, - 'Group', - title + "\nDescription: " + result.short_description + Translator.__('Group'), + title + "\n" + Translator.__('Description') + ': ' + result.short_description ]); break; case 'playlist': title = result.title; results.push([ result.picture_small, - 'Playlist', - title + "\nDuration: " + (result.duration / 60) + ' min' - + "\nTracks: " + result.tracks.length + Translator.__('Playlist'), + title + "\n" + Translator.__('Duration') + ': ' + (result.duration / 60) + ' ' + Translator.__('min') + + "\n" + Translator.__('Tracks') + ': ' + result.tracks.length ]); break; default: diff --git a/Resources/public/js/MediaType/Twitter/WebCreation.js b/Resources/public/js/MediaType/Twitter/WebCreation.js index dd841626..ff2cafc5 100644 --- a/Resources/public/js/MediaType/Twitter/WebCreation.js +++ b/Resources/public/js/MediaType/Twitter/WebCreation.js @@ -9,11 +9,11 @@ new window.CmfcmfMediaModule.WebCreation.tableColumns.TextColumn('') ], { - /*everything: 'Everything',*/ - tweets: 'Tweets'/*, - users: 'Users'*/ + /*everything: Translator.__('Everything'),*/ + tweets: Translator.__('Tweets')/*, + users: Translator.__('Users')*/ }, - 'Search for tweets and users' + Translator.__('Search for tweets') ); }); })(jQuery); diff --git a/Resources/public/js/MediaType/YouTube/WebCreation.js b/Resources/public/js/MediaType/YouTube/WebCreation.js index 6d16ba22..7c9f70cd 100644 --- a/Resources/public/js/MediaType/YouTube/WebCreation.js +++ b/Resources/public/js/MediaType/YouTube/WebCreation.js @@ -9,12 +9,12 @@ new window.CmfcmfMediaModule.WebCreation.tableColumns.FirstLineBoldColumn('Title') ], { - everything: 'Everything', - video: 'Videos', - channel: 'Channels', - playlist: 'Playlists' + everything: Translator.__('Everything'), + video: Translator.__('Videos'), + channel: Translator.__('Channels'), + playlist: Translator.__('Playlists') }, - 'Search for videos, channels and playlists' + Translator.__('Search for videos, channels and playlists') ); }); })(jQuery); diff --git a/Resources/public/js/Settings/Upgrade.js b/Resources/public/js/Settings/Upgrade.js index ed81f457..5ee044c3 100644 --- a/Resources/public/js/Settings/Upgrade.js +++ b/Resources/public/js/Settings/Upgrade.js @@ -35,7 +35,7 @@ } else { $li.addClass('text-danger'); $upgradeButton.removeClass('btn-primary').addClass('btn-danger'); - $upgradeButton.text('Upgrade failed.'); + $upgradeButton.text(Translator.__('Upgrade failed.')); alert(result.message); } }) diff --git a/Resources/public/js/util.js b/Resources/public/js/util.js index c41db2fa..06c19aa5 100644 --- a/Resources/public/js/util.js +++ b/Resources/public/js/util.js @@ -1,8 +1,10 @@ (function ($) { - window.toastr.options = { - "progressBar": true, - "closeButton": true - }; + if ('undefined' != typeof window.toastr) { + window.toastr.options = { + 'progressBar': true, + 'closeButton': true + }; + } $(function () { window.CmfcmfMediaModule = window.CmfcmfMediaModule || {}; window.CmfcmfMediaModule.Util = { @@ -11,13 +13,17 @@ }, Ajax: { fail: function (data) { - var errorText = "Sorry, the AJAX request could not be finished. Please try again."; + var errorText = Translator.__('Sorry, the AJAX request could not be finished. Please try again.'); if (data.responseJSON && data.responseJSON.error) { errorText = data.responseJSON.error; } else if (data.status == 403) { - errorText = "You do not have permission to execute this action." + errorText = Translator.__('You do not have permission to execute this action.'); + } + if ('undefined' != typeof window.toastr) { + window.toastr['error'](errorText, Translator.__('Something went wrong!')); + } else { + alert(Translator.__('Something went wrong!') + ' ' + errorText); } - window.toastr["error"](errorText, "Something went wrong!"); }, makeExternalRequest: function (url, done, fail, always) { var xmlhttp; @@ -27,7 +33,7 @@ xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } xmlhttp.onreadystatechange = function() { @@ -37,13 +43,13 @@ } else { fail(); } - if (typeof always == "function") { + if (typeof always == 'function') { always(); } } }; - xmlhttp.open("GET", url, true); + xmlhttp.open('GET', url, true); xmlhttp.send(); } }, diff --git a/Resources/public/js/vendor/Sortable.min.js b/Resources/public/js/vendor/Sortable.min.js index 45b1cb8e..573538f0 100644 --- a/Resources/public/js/vendor/Sortable.min.js +++ b/Resources/public/js/vendor/Sortable.min.js @@ -1,2 +1,2 @@ -/*! Sortable 1.3.0-rc2 - MIT | git://github.com/rubaxa/Sortable.git */ -!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():"undefined"!=typeof Package?Sortable=a():window.Sortable=a()}(function(){"use strict";function a(a,b){this.el=a,this.options=b=r({},b),a[L]=this;var c={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1};for(var d in c)!(d in b)&&(b[d]=c[d]);V(b);for(var f in this)"_"===f.charAt(0)&&(this[f]=this[f].bind(this));this.nativeDraggable=b.forceFallback?!1:P,e(a,"mousedown",this._onTapStart),e(a,"touchstart",this._onTapStart),this.nativeDraggable&&(e(a,"dragover",this),e(a,"dragenter",this)),T.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a){v&&v.state!==a&&(h(v,"display",a?"none":""),!a&&v.state&&w.insertBefore(v,s),v.state=a)}function c(a,b,c){if(a){c=c||N,b=b.split(".");var d=b.shift().toUpperCase(),e=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");do if(">*"===d&&a.parentNode===c||(""===d||a.nodeName.toUpperCase()==d)&&(!b.length||((" "+a.className+" ").match(e)||[]).length==b.length))return a;while(a!==c&&(a=a.parentNode))}return null}function d(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function e(a,b,c){a.addEventListener(b,c,!1)}function f(a,b,c){a.removeEventListener(b,c,!1)}function g(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(K," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(K," ")}}function h(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return N.defaultView&&N.defaultView.getComputedStyle?c=N.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function i(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;f>e;e++)c(d[e],e);return d}return[]}function j(a,b,c,d,e,f,g){var h=N.createEvent("Event"),i=(a||b[L]).options,j="on"+c.charAt(0).toUpperCase()+c.substr(1);h.initEvent(c,!0,!0),h.to=b,h.from=e||b,h.item=d||b,h.clone=v,h.oldIndex=f,h.newIndex=g,b.dispatchEvent(h),i[j]&&i[j].call(a,h)}function k(a,b,c,d,e,f){var g,h,i=a[L],j=i.options.onMove;return g=N.createEvent("Event"),g.initEvent("move",!0,!0),g.to=b,g.from=a,g.dragged=c,g.draggedRect=d,g.related=e||b,g.relatedRect=f||b.getBoundingClientRect(),a.dispatchEvent(g),j&&(h=j.call(i,g)),h}function l(a){a.draggable=!1}function m(){R=!1}function n(a,b){var c=a.lastElementChild,d=c.getBoundingClientRect();return(b.clientY-(d.top+d.height)>5||b.clientX-(d.right+d.width)>5)&&c}function o(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function p(a){var b=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"!==a.nodeName.toUpperCase()&&b++;return b}function q(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function r(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}var s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J={},K=/\s+/g,L="Sortable"+(new Date).getTime(),M=window,N=M.document,O=M.parseInt,P=!!("draggable"in N.createElement("div")),Q=function(a){return a=N.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents}(),R=!1,S=Math.abs,T=([].slice,[]),U=q(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h=b.scrollSensitivity,i=b.scrollSpeed,j=a.clientX,k=a.clientY,l=window.innerWidth,m=window.innerHeight;if(z!==c&&(y=b.scroll,z=c,y===!0)){y=c;do if(y.offsetWidth=l-j)-(h>=j),g=(h>=m-k)-(h>=k),(f||g)&&(d=M)),(J.vx!==f||J.vy!==g||J.el!==d)&&(J.el=d,J.vx=f,J.vy=g,clearInterval(J.pid),d&&(J.pid=setInterval(function(){d===M?M.scrollTo(M.pageXOffset+f*i,M.pageYOffset+g*i):(g&&(d.scrollTop+=g*i),f&&(d.scrollLeft+=f*i))},24)))}},30),V=function(a){var b=a.group;b&&"object"==typeof b||(b=a.group={name:b}),["pull","put"].forEach(function(a){a in b||(b[a]=!0)}),a.groups=" "+b.name+(b.put.join?" "+b.put.join(" "):"")+" "};return a.prototype={constructor:a,_onTapStart:function(a){var b=this,d=this.el,e=this.options,f=a.type,g=a.touches&&a.touches[0],h=(g||a).target,i=h,k=e.filter;if(!("mousedown"===f&&0!==a.button||e.disabled)&&(h=c(h,e.draggable,d))){if(D=p(h),"function"==typeof k){if(k.call(this,a,h,this))return j(b,i,"filter",h,d,D),void a.preventDefault()}else if(k&&(k=k.split(",").some(function(a){return a=c(i,a.trim(),d),a?(j(b,a,"filter",h,d,D),!0):void 0})))return void a.preventDefault();(!e.handle||c(i,e.handle,d))&&this._prepareDragStart(a,g,h)}},_prepareDragStart:function(a,b,c){var d,f=this,h=f.el,j=f.options,k=h.ownerDocument;c&&!s&&c.parentNode===h&&(G=a,w=h,s=c,t=s.parentNode,x=s.nextSibling,F=j.group,d=function(){f._disableDelayedDrag(),s.draggable=!0,g(s,f.options.chosenClass,!0),f._triggerDragStart(b)},j.ignore.split(",").forEach(function(a){i(s,a.trim(),l)}),e(k,"mouseup",f._onDrop),e(k,"touchend",f._onDrop),e(k,"touchcancel",f._onDrop),j.delay?(e(k,"mouseup",f._disableDelayedDrag),e(k,"touchend",f._disableDelayedDrag),e(k,"touchcancel",f._disableDelayedDrag),e(k,"mousemove",f._disableDelayedDrag),e(k,"touchmove",f._disableDelayedDrag),f._dragStartTimer=setTimeout(d,j.delay)):d())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),f(a,"mouseup",this._disableDelayedDrag),f(a,"touchend",this._disableDelayedDrag),f(a,"touchcancel",this._disableDelayedDrag),f(a,"mousemove",this._disableDelayedDrag),f(a,"touchmove",this._disableDelayedDrag)},_triggerDragStart:function(a){a?(G={target:s,clientX:a.clientX,clientY:a.clientY},this._onDragStart(G,"touch")):this.nativeDraggable?(e(s,"dragend",this),e(w,"dragstart",this._onDragStart)):this._onDragStart(G,!0);try{N.selection?N.selection.empty():window.getSelection().removeAllRanges()}catch(b){}},_dragStarted:function(){w&&s&&(g(s,this.options.ghostClass,!0),a.active=this,j(this,w,"start",s,w,D))},_emulateDragOver:function(){if(H){if(this._lastX===H.clientX&&this._lastY===H.clientY)return;this._lastX=H.clientX,this._lastY=H.clientY,Q||h(u,"display","none");var a=N.elementFromPoint(H.clientX,H.clientY),b=a,c=" "+this.options.group.name,d=T.length;if(b)do{if(b[L]&&b[L].options.groups.indexOf(c)>-1){for(;d--;)T[d]({clientX:H.clientX,clientY:H.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);Q||h(u,"display","")}},_onTouchMove:function(b){if(G){a.active||this._dragStarted(),this._appendGhost();var c=b.touches?b.touches[0]:b,d=c.clientX-G.clientX,e=c.clientY-G.clientY,f=b.touches?"translate3d("+d+"px,"+e+"px,0)":"translate("+d+"px,"+e+"px)";I=!0,H=c,h(u,"webkitTransform",f),h(u,"mozTransform",f),h(u,"msTransform",f),h(u,"transform",f),b.preventDefault()}},_appendGhost:function(){if(!u){var a,b=s.getBoundingClientRect(),c=h(s);u=s.cloneNode(!0),g(u,this.options.ghostClass,!1),g(u,this.options.fallbackClass,!0),h(u,"top",b.top-O(c.marginTop,10)),h(u,"left",b.left-O(c.marginLeft,10)),h(u,"width",b.width),h(u,"height",b.height),h(u,"opacity","0.8"),h(u,"position","fixed"),h(u,"zIndex","100000"),h(u,"pointerEvents","none"),this.options.fallbackOnBody&&N.body.appendChild(u)||w.appendChild(u),a=u.getBoundingClientRect(),h(u,"width",2*b.width-a.width),h(u,"height",2*b.height-a.height)}},_onDragStart:function(a,b){var c=a.dataTransfer,d=this.options;this._offUpEvents(),"clone"==F.pull&&(v=s.cloneNode(!0),h(v,"display","none"),w.insertBefore(v,s)),b?("touch"===b?(e(N,"touchmove",this._onTouchMove),e(N,"touchend",this._onDrop),e(N,"touchcancel",this._onDrop)):(e(N,"mousemove",this._onTouchMove),e(N,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(c&&(c.effectAllowed="move",d.setData&&d.setData.call(this,c,s)),e(N,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(a){var d,e,f,g=this.el,i=this.options,j=i.group,l=j.put,o=F===j,p=i.sort;if(void 0!==a.preventDefault&&(a.preventDefault(),!i.dragoverBubble&&a.stopPropagation()),I=!0,F&&!i.disabled&&(o?p||(f=!w.contains(s)):F.pull&&l&&(F.name===j.name||l.indexOf&&~l.indexOf(F.name)))&&(void 0===a.rootEl||a.rootEl===this.el)){if(U(a,i,this.el),R)return;if(d=c(a.target,i.draggable,g),e=s.getBoundingClientRect(),f)return b(!0),void(v||x?w.insertBefore(s,v||x):p||w.appendChild(s));if(0===g.children.length||g.children[0]===u||g===a.target&&(d=n(g,a))){if(d){if(d.animated)return;r=d.getBoundingClientRect()}b(o),k(w,g,s,e,d,r)!==!1&&(s.contains(g)||(g.appendChild(s),t=g),this._animate(e,s),d&&this._animate(r,d))}else if(d&&!d.animated&&d!==s&&void 0!==d.parentNode[L]){A!==d&&(A=d,B=h(d),C=h(d.parentNode));var q,r=d.getBoundingClientRect(),y=r.right-r.left,z=r.bottom-r.top,D=/left|right|inline/.test(B.cssFloat+B.display)||"flex"==C.display&&0===C["flex-direction"].indexOf("row"),E=d.offsetWidth>s.offsetWidth,G=d.offsetHeight>s.offsetHeight,H=(D?(a.clientX-r.left)/y:(a.clientY-r.top)/z)>.5,J=d.nextElementSibling,K=k(w,g,s,e,d,r);if(K!==!1){if(R=!0,setTimeout(m,30),b(o),1===K||-1===K)q=1===K;else if(D){var M=s.offsetTop,N=d.offsetTop;q=M===N?d.previousElementSibling===s&&!E||H&&E:N>M}else q=J!==s&&!G||H&&G;s.contains(g)||(q&&!J?g.appendChild(s):d.parentNode.insertBefore(s,q?J:d)),t=s.parentNode,this._animate(e,s),this._animate(r,d)}}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();h(b,"transition","none"),h(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,h(b,"transition","all "+c+"ms"),h(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){h(b,"transition",""),h(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;f(N,"touchmove",this._onTouchMove),f(a,"mouseup",this._onDrop),f(a,"touchend",this._onDrop),f(a,"touchcancel",this._onDrop)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(J.pid),clearTimeout(this._dragStartTimer),f(N,"mousemove",this._onTouchMove),this.nativeDraggable&&(f(N,"drop",this),f(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(I&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),u&&u.parentNode.removeChild(u),s&&(this.nativeDraggable&&f(s,"dragend",this),l(s),g(s,this.options.ghostClass,!1),g(s,this.options.chosenClass,!1),w!==t?(E=p(s),E>=0&&(j(null,t,"sort",s,w,D,E),j(this,w,"sort",s,w,D,E),j(null,t,"add",s,w,D,E),j(this,w,"remove",s,w,D,E))):(v&&v.parentNode.removeChild(v),s.nextSibling!==x&&(E=p(s),E>=0&&(j(this,w,"update",s,w,D,E),j(this,w,"sort",s,w,D,E)))),a.active&&((null===E||-1===E)&&(E=D),j(this,w,"end",s,w,D,E),this.save())),w=s=t=u=x=v=y=z=G=H=I=E=A=B=F=a.active=null)},handleEvent:function(a){var b=a.type;"dragover"===b||"dragenter"===b?s&&(this._onDragOver(a),d(a)):("drop"===b||"dragend"===b)&&this._onDrop(a)},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;f>e;e++)a=d[e],c(a,g.draggable,this.el)&&b.push(a.getAttribute(g.dataIdAttr)||o(a));return b},sort:function(a){var b={},d=this.el;this.toArray().forEach(function(a,e){var f=d.children[e];c(f,this.options.draggable,d)&&(b[a]=f)},this),a.forEach(function(a){b[a]&&(d.removeChild(b[a]),d.appendChild(b[a]))})},save:function(){var a=this.options.store;a&&a.set(this)},closest:function(a,b){return c(a,b||this.options.draggable,this.el)},option:function(a,b){var c=this.options;return void 0===b?c[a]:(c[a]=b,void("group"===a&&V(c)))},destroy:function(){var a=this.el;a[L]=null,f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),this.nativeDraggable&&(f(a,"dragover",this),f(a,"dragenter",this)),Array.prototype.forEach.call(a.querySelectorAll("[draggable]"),function(a){a.removeAttribute("draggable")}),T.splice(T.indexOf(this._onDragOver),1),this._onDrop(),this.el=a=null}},a.utils={on:e,off:f,css:h,find:i,is:function(a,b){return!!c(a,b,a)},extend:r,throttle:q,closest:c,toggleClass:g,index:p},a.create=function(b,c){return new a(b,c)},a.version="1.3.0-rc2",a}); \ No newline at end of file +/*! Sortable 1.6.0 - MIT | git://github.com/rubaxa/Sortable.git */ +!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():window.Sortable=a()}(function(){"use strict";function a(a,b){if(!a||!a.nodeType||1!==a.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(a);this.el=a,this.options=b=t({},b),a[T]=this;var c={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var d in c)!(d in b)&&(b[d]=c[d]);ga(b);for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));this.nativeDraggable=!b.forceFallback&&$,f(a,"mousedown",this._onTapStart),f(a,"touchstart",this._onTapStart),f(a,"pointerdown",this._onTapStart),this.nativeDraggable&&(f(a,"dragover",this),f(a,"dragenter",this)),ea.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a,b){"clone"!==a.lastPullMode&&(b=!0),z&&z.state!==b&&(i(z,"display",b?"none":""),b||z.state&&(a.options.group.revertClone?(A.insertBefore(z,B),a._animate(w,z)):A.insertBefore(z,w)),z.state=b)}function c(a,b,c){if(a){c=c||V;do if(">*"===b&&a.parentNode===c||r(a,b))return a;while(a=d(a))}return null}function d(a){var b=a.host;return b&&b.nodeType?b:a.parentNode}function e(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function f(a,b,c){a.addEventListener(b,c,Z)}function g(a,b,c){a.removeEventListener(b,c,Z)}function h(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(R," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(R," ")}}function i(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return V.defaultView&&V.defaultView.getComputedStyle?c=V.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function j(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;e5||b.clientX-(d.left+d.width)>5}function p(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function q(a,b){var c=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"===a.nodeName.toUpperCase()||">*"!==b&&!r(a,b)||c++;return c}function r(a,b){if(a){b=b.split(".");var c=b.shift().toUpperCase(),d=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");return!(""!==c&&a.nodeName.toUpperCase()!=c||b.length&&((" "+a.className+" ").match(d)||[]).length!=b.length)}return!1}function s(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function t(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function u(a){return X?X(a).clone(!0)[0]:Y&&Y.dom?Y.dom(a).cloneNode(!0):a.cloneNode(!0)}function v(a){for(var b=a.getElementsByTagName("input"),c=b.length;c--;){var d=b[c];d.checked&&da.push(d)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q={},R=/\s+/g,S=/left|right|inline/,T="Sortable"+(new Date).getTime(),U=window,V=U.document,W=U.parseInt,X=U.jQuery||U.Zepto,Y=U.Polymer,Z=!1,$=!!("draggable"in V.createElement("div")),_=function(a){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(a=V.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents)}(),aa=!1,ba=Math.abs,ca=Math.min,da=[],ea=[],fa=s(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h,i,j=c[T],k=b.scrollSensitivity,l=b.scrollSpeed,m=a.clientX,n=a.clientY,o=window.innerWidth,p=window.innerHeight;if(E!==c&&(D=b.scroll,E=c,F=b.scrollFn,D===!0)){D=c;do if(D.offsetWidth-1:e==a)}}var c={},d=a.group;d&&"object"==typeof d||(d={name:d}),c.name=d.name,c.checkPull=b(d.pull,!0),c.checkPut=b(d.put),c.revertClone=d.revertClone,a.group=c};a.prototype={constructor:a,_onTapStart:function(a){var b,d=this,e=this.el,f=this.options,g=f.preventOnFilter,h=a.type,i=a.touches&&a.touches[0],j=(i||a).target,l=a.target.shadowRoot&&a.path[0]||j,m=f.filter;if(v(e),!w&&!("mousedown"===h&&0!==a.button||f.disabled)&&(j=c(j,f.draggable,e),j&&C!==j)){if(b=q(j,f.draggable),"function"==typeof m){if(m.call(this,a,j,this))return k(d,l,"filter",j,e,b),void(g&&a.preventDefault())}else if(m&&(m=m.split(",").some(function(a){if(a=c(l,a.trim(),e))return k(d,a,"filter",j,e,b),!0})))return void(g&&a.preventDefault());f.handle&&!c(l,f.handle,e)||this._prepareDragStart(a,i,j,b)}},_prepareDragStart:function(a,b,c,d){var e,g=this,i=g.el,l=g.options,n=i.ownerDocument;c&&!w&&c.parentNode===i&&(N=a,A=i,w=c,x=w.parentNode,B=w.nextSibling,C=c,L=l.group,J=d,this._lastX=(b||a).clientX,this._lastY=(b||a).clientY,w.style["will-change"]="transform",e=function(){g._disableDelayedDrag(),w.draggable=g.nativeDraggable,h(w,l.chosenClass,!0),g._triggerDragStart(a,b),k(g,A,"choose",w,A,J)},l.ignore.split(",").forEach(function(a){j(w,a.trim(),m)}),f(n,"mouseup",g._onDrop),f(n,"touchend",g._onDrop),f(n,"touchcancel",g._onDrop),f(n,"pointercancel",g._onDrop),f(n,"selectstart",g),l.delay?(f(n,"mouseup",g._disableDelayedDrag),f(n,"touchend",g._disableDelayedDrag),f(n,"touchcancel",g._disableDelayedDrag),f(n,"mousemove",g._disableDelayedDrag),f(n,"touchmove",g._disableDelayedDrag),f(n,"pointermove",g._disableDelayedDrag),g._dragStartTimer=setTimeout(e,l.delay)):e())},_disableDelayedDrag:function(){var a=this.el.ownerDocument;clearTimeout(this._dragStartTimer),g(a,"mouseup",this._disableDelayedDrag),g(a,"touchend",this._disableDelayedDrag),g(a,"touchcancel",this._disableDelayedDrag),g(a,"mousemove",this._disableDelayedDrag),g(a,"touchmove",this._disableDelayedDrag),g(a,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(a,b){b=b||("touch"==a.pointerType?a:null),b?(N={target:w,clientX:b.clientX,clientY:b.clientY},this._onDragStart(N,"touch")):this.nativeDraggable?(f(w,"dragend",this),f(A,"dragstart",this._onDragStart)):this._onDragStart(N,!0);try{V.selection?setTimeout(function(){V.selection.empty()}):window.getSelection().removeAllRanges()}catch(a){}},_dragStarted:function(){if(A&&w){var b=this.options;h(w,b.ghostClass,!0),h(w,b.dragClass,!1),a.active=this,k(this,A,"start",w,A,J)}else this._nulling()},_emulateDragOver:function(){if(O){if(this._lastX===O.clientX&&this._lastY===O.clientY)return;this._lastX=O.clientX,this._lastY=O.clientY,_||i(y,"display","none");var a=V.elementFromPoint(O.clientX,O.clientY),b=a,c=ea.length;if(b)do{if(b[T]){for(;c--;)ea[c]({clientX:O.clientX,clientY:O.clientY,target:a,rootEl:b});break}a=b}while(b=b.parentNode);_||i(y,"display","")}},_onTouchMove:function(b){if(N){var c=this.options,d=c.fallbackTolerance,e=c.fallbackOffset,f=b.touches?b.touches[0]:b,g=f.clientX-N.clientX+e.x,h=f.clientY-N.clientY+e.y,j=b.touches?"translate3d("+g+"px,"+h+"px,0)":"translate("+g+"px,"+h+"px)";if(!a.active){if(d&&ca(ba(f.clientX-this._lastX),ba(f.clientY-this._lastY))w.offsetWidth,D=e.offsetHeight>w.offsetHeight,E=(v?(d.clientX-g.left)/t:(d.clientY-g.top)/u)>.5,F=e.nextElementSibling,J=!1;if(v){var K=w.offsetTop,N=e.offsetTop;J=K===N?e.previousElementSibling===w&&!C||E&&C:e.previousElementSibling===w||w.previousElementSibling===e?(d.clientY-g.top)/u>.5:N>K}else r||(J=F!==w&&!D||E&&D);var O=l(A,j,w,f,e,g,d,J);O!==!1&&(1!==O&&O!==-1||(J=1===O),aa=!0,setTimeout(n,30),b(p,q),w.contains(j)||(J&&!F?j.appendChild(w):e.parentNode.insertBefore(w,J?F:e)),x=w.parentNode,this._animate(f,w),this._animate(g,e))}}},_animate:function(a,b){var c=this.options.animation;if(c){var d=b.getBoundingClientRect();1===a.nodeType&&(a=a.getBoundingClientRect()),i(b,"transition","none"),i(b,"transform","translate3d("+(a.left-d.left)+"px,"+(a.top-d.top)+"px,0)"),b.offsetWidth,i(b,"transition","all "+c+"ms"),i(b,"transform","translate3d(0,0,0)"),clearTimeout(b.animated),b.animated=setTimeout(function(){i(b,"transition",""),i(b,"transform",""),b.animated=!1},c)}},_offUpEvents:function(){var a=this.el.ownerDocument;g(V,"touchmove",this._onTouchMove),g(V,"pointermove",this._onTouchMove),g(a,"mouseup",this._onDrop),g(a,"touchend",this._onDrop),g(a,"pointerup",this._onDrop),g(a,"touchcancel",this._onDrop),g(a,"pointercancel",this._onDrop),g(a,"selectstart",this)},_onDrop:function(b){var c=this.el,d=this.options;clearInterval(this._loopId),clearInterval(Q.pid),clearTimeout(this._dragStartTimer),g(V,"mousemove",this._onTouchMove),this.nativeDraggable&&(g(V,"drop",this),g(c,"dragstart",this._onDragStart)),this._offUpEvents(),b&&(P&&(b.preventDefault(),!d.dropBubble&&b.stopPropagation()),y&&y.parentNode&&y.parentNode.removeChild(y),A!==x&&"clone"===a.active.lastPullMode||z&&z.parentNode&&z.parentNode.removeChild(z),w&&(this.nativeDraggable&&g(w,"dragend",this),m(w),w.style["will-change"]="",h(w,this.options.ghostClass,!1),h(w,this.options.chosenClass,!1),k(this,A,"unchoose",w,A,J),A!==x?(K=q(w,d.draggable),K>=0&&(k(null,x,"add",w,A,J,K),k(this,A,"remove",w,A,J,K),k(null,x,"sort",w,A,J,K),k(this,A,"sort",w,A,J,K))):w.nextSibling!==B&&(K=q(w,d.draggable),K>=0&&(k(this,A,"update",w,A,J,K),k(this,A,"sort",w,A,J,K))),a.active&&(null!=K&&K!==-1||(K=J),k(this,A,"end",w,A,J,K),this.save()))),this._nulling()},_nulling:function(){A=w=x=y=B=z=C=D=E=N=O=P=K=G=H=M=L=a.active=null,da.forEach(function(a){a.checked=!0}),da.length=0},handleEvent:function(a){switch(a.type){case"drop":case"dragend":this._onDrop(a);break;case"dragover":case"dragenter":w&&(this._onDragOver(a),e(a));break;case"selectstart":a.preventDefault()}},toArray:function(){for(var a,b=[],d=this.el.children,e=0,f=d.length,g=this.options;e 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + for (var _iterator = callbacks, _isArray = true, _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var callback = _ref; + callback.apply(this, args); } } - return this; - }; - - Emitter.prototype.removeListener = Emitter.prototype.off; - Emitter.prototype.removeAllListeners = Emitter.prototype.off; + return this; + } - Emitter.prototype.removeEventListener = Emitter.prototype.off; + // Remove event listener for given event. If fn is not provided, all event + // listeners for that event will be removed. If neither is provided, all + // event listeners will be removed. - Emitter.prototype.off = function(event, fn) { - var callback, callbacks, i, _i, _len; + }, { + key: "off", + value: function off(event, fn) { if (!this._callbacks || arguments.length === 0) { this._callbacks = {}; return this; } - callbacks = this._callbacks[event]; + + // specific event + var callbacks = this._callbacks[event]; if (!callbacks) { return this; } + + // remove all handlers if (arguments.length === 1) { delete this._callbacks[event]; return this; } - for (i = _i = 0, _len = callbacks.length; _i < _len; i = ++_i) { - callback = callbacks[i]; + + // remove specific handler + for (var i = 0; i < callbacks.length; i++) { + var callback = callbacks[i]; if (callback === fn) { callbacks.splice(i, 1); break; } } + return this; - }; + } + }]); - return Emitter; + return Emitter; +}(); - })(); +var Dropzone = function (_Emitter) { + _inherits(Dropzone, _Emitter); - Dropzone = (function(_super) { - var extend, resolveOption; + _createClass(Dropzone, null, [{ + key: "initClass", + value: function initClass() { - __extends(Dropzone, _super); + // Exposing the emitter class, mainly for tests + this.prototype.Emitter = Emitter; + + /* + This is a list of all available events you can register on a dropzone object. + You can register an event handler like this: + dropzone.on("dragEnter", function() { }); + */ + this.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"]; + + this.prototype.defaultOptions = { + /** + * Has to be specified on elements other than form (or when the form + * doesn't have an `action` attribute). You can also + * provide a function that will be called with `files` and + * must return the url (since `v3.12.0`) + */ + url: null, + + /** + * Can be changed to `"put"` if necessary. You can also provide a function + * that will be called with `files` and must return the method (since `v3.12.0`). + */ + method: "post", + + /** + * Will be set on the XHRequest. + */ + withCredentials: false, + + /** + * The timeout for the XHR requests in milliseconds (since `v4.4.0`). + */ + timeout: 30000, + + /** + * How many file uploads to process in parallel (See the + * Enqueuing file uploads* documentation section for more info) + */ + parallelUploads: 2, + + /** + * Whether to send multiple files in one request. If + * this it set to true, then the fallback file input element will + * have the `multiple` attribute as well. This option will + * also trigger additional events (like `processingmultiple`). See the events + * documentation section for more information. + */ + uploadMultiple: false, + + /** + * Whether you want files to be uploaded in chunks to your server. This can't be + * used in combination with `uploadMultiple`. + * + * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload. + */ + chunking: false, + + /** + * If `chunking` is enabled, this defines whether **every** file should be chunked, + * even if the file size is below chunkSize. This means, that the additional chunk + * form data will be submitted and the `chunksUploaded` callback will be invoked. + */ + forceChunking: false, + + /** + * If `chunking` is `true`, then this defines the chunk size in bytes. + */ + chunkSize: 2000000, + + /** + * If `true`, the individual chunks of a file are being uploaded simultaneously. + */ + parallelChunkUploads: false, + + /** + * Whether a chunk should be retried if it fails. + */ + retryChunks: false, + + /** + * If `retryChunks` is true, how many times should it be retried. + */ + retryChunksLimit: 3, + + /** + * If not `null` defines how many files this Dropzone handles. If it exceeds, + * the event `maxfilesexceeded` will be called. The dropzone element gets the + * class `dz-max-files-reached` accordingly so you can provide visual feedback. + */ + maxFilesize: 256, + + /** + * The name of the file param that gets transferred. + * **NOTE**: If you have the option `uploadMultiple` set to `true`, then + * Dropzone will append `[]` to the name. + */ + paramName: "file", + + /** + * Whether thumbnails for images should be generated + */ + createImageThumbnails: true, + + /** + * In MB. When the filename exceeds this limit, the thumbnail will not be generated. + */ + maxThumbnailFilesize: 10, + + /** + * If `null`, the ratio of the image will be used to calculate it. + */ + thumbnailWidth: 120, + + /** + * The same as `thumbnailWidth`. If both are null, images will not be resized. + */ + thumbnailHeight: 120, + + /** + * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided. + * Can be either `contain` or `crop`. + */ + thumbnailMethod: 'crop', + + /** + * If set, images will be resized to these dimensions before being **uploaded**. + * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect + * ratio of the file will be preserved. + * + * The `options.transformFile` function uses these options, so if the `transformFile` function + * is overridden, these options don't do anything. + */ + resizeWidth: null, + + /** + * See `resizeWidth`. + */ + resizeHeight: null, + + /** + * The mime type of the resized image (before it gets uploaded to the server). + * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`. + * See `resizeWidth` for more information. + */ + resizeMimeType: null, + + /** + * The quality of the resized images. See `resizeWidth`. + */ + resizeQuality: 0.8, + + /** + * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided. + * Can be either `contain` or `crop`. + */ + resizeMethod: 'contain', + + /** + * The base that is used to calculate the filesize. You can change this to + * 1024 if you would rather display kibibytes, mebibytes, etc... + * 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` not `1 kilobyte`. + * You can change this to `1024` if you don't care about validity. + */ + filesizeBase: 1000, + + /** + * Can be used to limit the maximum number of files that will be handled by this Dropzone + */ + maxFiles: null, + + /** + * An optional object to send additional headers to the server. Eg: + * `{ "My-Awesome-Header": "header value" }` + */ + headers: null, + + /** + * If `true`, the dropzone element itself will be clickable, if `false` + * nothing will be clickable. + * + * You can also pass an HTML element, a CSS selector (for multiple elements) + * or an array of those. In that case, all of those elements will trigger an + * upload when clicked. + */ + clickable: true, + + /** + * Whether hidden files in directories should be ignored. + */ + ignoreHiddenFiles: true, + + /** + * The default implementation of `accept` checks the file's mime type or + * extension against this list. This is a comma separated list of mime + * types or file extensions. + * + * Eg.: `image/*,application/pdf,.psd` + * + * If the Dropzone is `clickable` this option will also be used as + * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept) + * parameter on the hidden file input as well. + */ + acceptedFiles: null, + + /** + * **Deprecated!** + * Use acceptedFiles instead. + */ + acceptedMimeTypes: null, + + /** + * If false, files will be added to the queue but the queue will not be + * processed automatically. + * This can be useful if you need some additional user input before sending + * files (or if you want want all files sent at once). + * If you're ready to send the file simply call `myDropzone.processQueue()`. + * + * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation + * section for more information. + */ + autoProcessQueue: true, + + /** + * If false, files added to the dropzone will not be queued by default. + * You'll have to call `enqueueFile(file)` manually. + */ + autoQueue: true, + + /** + * If `true`, this will add a link to every file preview to remove or cancel (if + * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation` + * and `dictRemoveFile` options are used for the wording. + */ + addRemoveLinks: false, + + /** + * Defines where to display the file previews – if `null` the + * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS + * selector. The element should have the `dropzone-previews` class so + * the previews are displayed properly. + */ + previewsContainer: null, + + /** + * This is the element the hidden input field (which is used when clicking on the + * dropzone to trigger file selection) will be appended to. This might + * be important in case you use frameworks to switch the content of your page. + * + * Can be a selector string, or an element directly. + */ + hiddenInputContainer: "body", + + /** + * If null, no capture type will be specified + * If camera, mobile devices will skip the file selection and choose camera + * If microphone, mobile devices will skip the file selection and choose the microphone + * If camcorder, mobile devices will skip the file selection and choose the camera in video mode + * On apple devices multiple must be set to false. AcceptedFiles may need to + * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*"). + */ + capture: null, + + /** + * **Deprecated**. Use `renameFile` instead. + */ + renameFilename: null, + + /** + * A function that is invoked before the file is uploaded to the server and renames the file. + * This function gets the `File` as argument and can use the `file.name`. The actual name of the + * file that gets used during the upload can be accessed through `file.upload.filename`. + */ + renameFile: null, + + /** + * If `true` the fallback will be forced. This is very useful to test your server + * implementations first and make sure that everything works as + * expected without dropzone if you experience problems, and to test + * how your fallbacks will look. + */ + forceFallback: false, + + /** + * The text used before any files are dropped. + */ + dictDefaultMessage: "Drop files here to upload", + + /** + * The text that replaces the default message text it the browser is not supported. + */ + dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", + + /** + * The text that will be added before the fallback form. + * If you provide a fallback element yourself, or if this option is `null` this will + * be ignored. + */ + dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", + + /** + * If the filesize is too big. + * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values. + */ + dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", + + /** + * If the file doesn't match the file type. + */ + dictInvalidFileType: "You can't upload files of this type.", + + /** + * If the server response was invalid. + * `{{statusCode}}` will be replaced with the servers status code. + */ + dictResponseError: "Server responded with {{statusCode}} code.", + + /** + * If `addRemoveLinks` is true, the text to be used for the cancel upload link. + */ + dictCancelUpload: "Cancel upload", + + /** + * The text that is displayed if an upload was manually canceled + */ + dictUploadCanceled: "Upload canceled.", + + /** + * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload. + */ + dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", + + /** + * If `addRemoveLinks` is true, the text to be used to remove a file. + */ + dictRemoveFile: "Remove file", + + /** + * If this is not null, then the user will be prompted before removing a file. + */ + dictRemoveFileConfirmation: null, + + /** + * Displayed if `maxFiles` is st and exceeded. + * The string `{{maxFiles}}` will be replaced by the configuration value. + */ + dictMaxFilesExceeded: "You can not upload any more files.", + + /** + * Allows you to translate the different units. Starting with `tb` for terabytes and going down to + * `b` for bytes. + */ + dictFileSizeUnits: { tb: "TB", gb: "GB", mb: "MB", kb: "KB", b: "b" }, + /** + * Called when dropzone initialized + * You can add event listeners here + */ + init: function init() {}, + + + /** + * Can be an **object** of additional parameters to transfer to the server, **or** a `Function` + * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case + * of a function, this needs to return a map. + * + * The default implementation does nothing for normal uploads, but adds relevant information for + * chunked uploads. + * + * This is the same as adding hidden input fields in the form element. + */ + params: function params(files, xhr, chunk) { + if (chunk) { + return { + dzuuid: chunk.file.upload.uuid, + dzchunkindex: chunk.index, + dztotalfilesize: chunk.file.size, + dzchunksize: this.options.chunkSize, + dztotalchunkcount: chunk.file.upload.totalChunkCount, + dzchunkbyteoffset: chunk.index * this.options.chunkSize + }; + } + }, + + + /** + * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File) + * and a `done` function as parameters. + * + * If the done function is invoked without arguments, the file is "accepted" and will + * be processed. If you pass an error message, the file is rejected, and the error + * message will be displayed. + * This function will not be called if the file is too big or doesn't match the mime types. + */ + accept: function accept(file, done) { + return done(); + }, + + + /** + * The callback that will be invoked when all chunks have been uploaded for a file. + * It gets the file for which the chunks have been uploaded as the first parameter, + * and the `done` function as second. `done()` needs to be invoked when everything + * needed to finish the upload process is done. + */ + chunksUploaded: function chunksUploaded(file, done) { + done(); + }, + + /** + * Gets called when the browser is not supported. + * The default implementation shows the fallback input field and adds + * a text. + */ + fallback: function fallback() { + // This code should pass in IE7... :( + var messageElement = void 0; + this.element.className = this.element.className + " dz-browser-not-supported"; + + for (var _iterator2 = this.element.getElementsByTagName("div"), _isArray2 = true, _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } - Dropzone.prototype.Emitter = Emitter; + var child = _ref2; + if (/(^| )dz-message($| )/.test(child.className)) { + messageElement = child; + child.className = "dz-message"; // Removes the 'dz-default' class + break; + } + } + if (!messageElement) { + messageElement = Dropzone.createElement("
"); + this.element.appendChild(messageElement); + } - /* - This is a list of all available events you can register on a dropzone object. - - You can register an event handler like this: - - dropzone.on("dragEnter", function() { }); - */ - - Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"]; - - Dropzone.prototype.defaultOptions = { - url: null, - method: "post", - withCredentials: false, - parallelUploads: 2, - uploadMultiple: false, - maxFilesize: 256, - paramName: "file", - createImageThumbnails: true, - maxThumbnailFilesize: 10, - thumbnailWidth: 120, - thumbnailHeight: 120, - filesizeBase: 1000, - maxFiles: null, - filesizeBase: 1000, - params: {}, - clickable: true, - ignoreHiddenFiles: true, - acceptedFiles: null, - acceptedMimeTypes: null, - autoProcessQueue: true, - autoQueue: true, - addRemoveLinks: false, - previewsContainer: null, - capture: null, - dictDefaultMessage: "Drop files here to upload", - dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.", - dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.", - dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.", - dictInvalidFileType: "You can't upload files of this type.", - dictResponseError: "Server responded with {{statusCode}} code.", - dictCancelUpload: "Cancel upload", - dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?", - dictRemoveFile: "Remove file", - dictRemoveFileConfirmation: null, - dictMaxFilesExceeded: "You can not upload any more files.", - accept: function(file, done) { - return done(); - }, - init: function() { - return noop; - }, - forceFallback: false, - fallback: function() { - var child, messageElement, span, _i, _len, _ref; - this.element.className = "" + this.element.className + " dz-browser-not-supported"; - _ref = this.element.getElementsByTagName("div"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - child = _ref[_i]; - if (/(^| )dz-message($| )/.test(child.className)) { - messageElement = child; - child.className = "dz-message"; - continue; + var span = messageElement.getElementsByTagName("span")[0]; + if (span) { + if (span.textContent != null) { + span.textContent = this.options.dictFallbackMessage; + } else if (span.innerText != null) { + span.innerText = this.options.dictFallbackMessage; + } } - } - if (!messageElement) { - messageElement = Dropzone.createElement("
"); - this.element.appendChild(messageElement); - } - span = messageElement.getElementsByTagName("span")[0]; - if (span) { - span.textContent = this.options.dictFallbackMessage; - } - return this.element.appendChild(this.getFallbackForm()); - }, - resize: function(file) { - var info, srcRatio, trgRatio; - info = { - srcX: 0, - srcY: 0, - srcWidth: file.width, - srcHeight: file.height - }; - srcRatio = file.width / file.height; - info.optWidth = this.options.thumbnailWidth; - info.optHeight = this.options.thumbnailHeight; - if ((info.optWidth == null) && (info.optHeight == null)) { - info.optWidth = info.srcWidth; - info.optHeight = info.srcHeight; - } else if (info.optWidth == null) { - info.optWidth = srcRatio * info.optHeight; - } else if (info.optHeight == null) { - info.optHeight = (1 / srcRatio) * info.optWidth; - } - trgRatio = info.optWidth / info.optHeight; - if (file.height < info.optHeight || file.width < info.optWidth) { - info.trgHeight = info.srcHeight; - info.trgWidth = info.srcWidth; - } else { - if (srcRatio > trgRatio) { - info.srcHeight = file.height; - info.srcWidth = info.srcHeight * trgRatio; - } else { - info.srcWidth = file.width; - info.srcHeight = info.srcWidth / trgRatio; + + return this.element.appendChild(this.getFallbackForm()); + }, + + + /** + * Gets called to calculate the thumbnail dimensions. + * + * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing: + * + * - `srcWidth` & `srcHeight` (required) + * - `trgWidth` & `trgHeight` (required) + * - `srcX` & `srcY` (optional, default `0`) + * - `trgX` & `trgY` (optional, default `0`) + * + * Those values are going to be used by `ctx.drawImage()`. + */ + resize: function resize(file, width, height, resizeMethod) { + var info = { + srcX: 0, + srcY: 0, + srcWidth: file.width, + srcHeight: file.height + }; + + var srcRatio = file.width / file.height; + + // Automatically calculate dimensions if not specified + if (width == null && height == null) { + width = info.srcWidth; + height = info.srcHeight; + } else if (width == null) { + width = height * srcRatio; + } else if (height == null) { + height = width / srcRatio; } - } - info.srcX = (file.width - info.srcWidth) / 2; - info.srcY = (file.height - info.srcHeight) / 2; - return info; - }, - /* - Those functions register themselves to the events on init and handle all - the user interface specific stuff. Overwriting them won't break the upload - but can break the way it's displayed. - You can overwrite them if you don't like the default behavior. If you just - want to add an additional event handler, register it on the dropzone object - and don't overwrite those options. - */ - drop: function(e) { - return this.element.classList.remove("dz-drag-hover"); - }, - dragstart: noop, - dragend: function(e) { - return this.element.classList.remove("dz-drag-hover"); - }, - dragenter: function(e) { - return this.element.classList.add("dz-drag-hover"); - }, - dragover: function(e) { - return this.element.classList.add("dz-drag-hover"); - }, - dragleave: function(e) { - return this.element.classList.remove("dz-drag-hover"); - }, - paste: noop, - reset: function() { - return this.element.classList.remove("dz-started"); - }, - addedfile: function(file) { - var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results; - if (this.element === this.previewsContainer) { - this.element.classList.add("dz-started"); - } - if (this.previewsContainer) { - file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim()); - file.previewTemplate = file.previewElement; - this.previewsContainer.appendChild(file.previewElement); - _ref = file.previewElement.querySelectorAll("[data-dz-name]"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - node.textContent = file.name; + // Make sure images aren't upscaled + width = Math.min(width, info.srcWidth); + height = Math.min(height, info.srcHeight); + + var trgRatio = width / height; + + if (info.srcWidth > width || info.srcHeight > height) { + // Image is bigger and needs rescaling + if (resizeMethod === 'crop') { + if (srcRatio > trgRatio) { + info.srcHeight = file.height; + info.srcWidth = info.srcHeight * trgRatio; + } else { + info.srcWidth = file.width; + info.srcHeight = info.srcWidth / trgRatio; + } + } else if (resizeMethod === 'contain') { + // Method 'contain' + if (srcRatio > trgRatio) { + height = width / srcRatio; + } else { + width = height * srcRatio; + } + } else { + throw new Error("Unknown resizeMethod '" + resizeMethod + "'"); + } } - _ref1 = file.previewElement.querySelectorAll("[data-dz-size]"); - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - node = _ref1[_j]; - node.innerHTML = this.filesize(file.size); + + info.srcX = (file.width - info.srcWidth) / 2; + info.srcY = (file.height - info.srcHeight) / 2; + + info.trgWidth = width; + info.trgHeight = height; + + return info; + }, + + + /** + * Can be used to transform the file (for example, resize an image if necessary). + * + * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes + * images according to those dimensions. + * + * Gets the `file` as the first parameter, and a `done()` function as the second, that needs + * to be invoked with the file when the transformation is done. + */ + transformFile: function transformFile(file, done) { + if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) { + return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done); + } else { + return done(file); } - if (this.options.addRemoveLinks) { - file._removeLink = Dropzone.createElement("" + this.options.dictRemoveFile + ""); - file.previewElement.appendChild(file._removeLink); + }, + + + /** + * A string that contains the template used for each dropped + * file. Change it to fulfill your needs but make sure to properly + * provide all elements. + * + * If you want to use an actual HTML element instead of providing a String + * as a config option, you could create a div with the id `tpl`, + * put the template inside it and provide the element like this: + * + * document + * .querySelector('#tpl') + * .innerHTML + * + */ + previewTemplate: "
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
", + + // END OPTIONS + // (Required by the dropzone documentation parser) + + + /* + Those functions register themselves to the events on init and handle all + the user interface specific stuff. Overwriting them won't break the upload + but can break the way it's displayed. + You can overwrite them if you don't like the default behavior. If you just + want to add an additional event handler, register it on the dropzone object + and don't overwrite those options. + */ + + // Those are self explanatory and simply concern the DragnDrop. + drop: function drop(e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragstart: function dragstart(e) {}, + dragend: function dragend(e) { + return this.element.classList.remove("dz-drag-hover"); + }, + dragenter: function dragenter(e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragover: function dragover(e) { + return this.element.classList.add("dz-drag-hover"); + }, + dragleave: function dragleave(e) { + return this.element.classList.remove("dz-drag-hover"); + }, + paste: function paste(e) {}, + + + // Called whenever there are no files left in the dropzone anymore, and the + // dropzone should be displayed as if in the initial state. + reset: function reset() { + return this.element.classList.remove("dz-started"); + }, + + + // Called when a file is added to the queue + // Receives `file` + addedfile: function addedfile(file) { + var _this2 = this; + + if (this.element === this.previewsContainer) { + this.element.classList.add("dz-started"); } - removeFileEvent = (function(_this) { - return function(e) { + + if (this.previewsContainer) { + file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim()); + file.previewTemplate = file.previewElement; // Backwards compatibility + + this.previewsContainer.appendChild(file.previewElement); + for (var _iterator3 = file.previewElement.querySelectorAll("[data-dz-name]"), _isArray3 = true, _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref3; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref3 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref3 = _i3.value; + } + + var node = _ref3; + + node.textContent = file.name; + } + for (var _iterator4 = file.previewElement.querySelectorAll("[data-dz-size]"), _isArray4 = true, _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + node = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + node = _i4.value; + } + + node.innerHTML = this.filesize(file.size); + } + + if (this.options.addRemoveLinks) { + file._removeLink = Dropzone.createElement("" + this.options.dictRemoveFile + ""); + file.previewElement.appendChild(file._removeLink); + } + + var removeFileEvent = function removeFileEvent(e) { e.preventDefault(); e.stopPropagation(); if (file.status === Dropzone.UPLOADING) { - return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function() { - return _this.removeFile(file); + return Dropzone.confirm(_this2.options.dictCancelUploadConfirmation, function () { + return _this2.removeFile(file); }); } else { - if (_this.options.dictRemoveFileConfirmation) { - return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function() { - return _this.removeFile(file); + if (_this2.options.dictRemoveFileConfirmation) { + return Dropzone.confirm(_this2.options.dictRemoveFileConfirmation, function () { + return _this2.removeFile(file); }); } else { - return _this.removeFile(file); + return _this2.removeFile(file); } } }; - })(this); - _ref2 = file.previewElement.querySelectorAll("[data-dz-remove]"); - _results = []; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - removeLink = _ref2[_k]; - _results.push(removeLink.addEventListener("click", removeFileEvent)); - } - return _results; - } - }, - removedfile: function(file) { - var _ref; - if (file.previewElement) { - if ((_ref = file.previewElement) != null) { - _ref.parentNode.removeChild(file.previewElement); + + for (var _iterator5 = file.previewElement.querySelectorAll("[data-dz-remove]"), _isArray5 = true, _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref4; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref4 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref4 = _i5.value; + } + + var removeLink = _ref4; + + removeLink.addEventListener("click", removeFileEvent); + } } - } - return this._updateMaxFilesReachedClass(); - }, - thumbnail: function(file, dataUrl) { - var thumbnailElement, _i, _len, _ref; - if (file.previewElement) { - file.previewElement.classList.remove("dz-file-preview"); - _ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - thumbnailElement = _ref[_i]; - thumbnailElement.alt = file.name; - thumbnailElement.src = dataUrl; + }, + + + // Called whenever a file is removed. + removedfile: function removedfile(file) { + if (file.previewElement != null && file.previewElement.parentNode != null) { + file.previewElement.parentNode.removeChild(file.previewElement); } - return setTimeout(((function(_this) { - return function() { + return this._updateMaxFilesReachedClass(); + }, + + + // Called when a thumbnail has been generated + // Receives `file` and `dataUrl` + thumbnail: function thumbnail(file, dataUrl) { + if (file.previewElement) { + file.previewElement.classList.remove("dz-file-preview"); + for (var _iterator6 = file.previewElement.querySelectorAll("[data-dz-thumbnail]"), _isArray6 = true, _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref5; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref5 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref5 = _i6.value; + } + + var thumbnailElement = _ref5; + + thumbnailElement.alt = file.name; + thumbnailElement.src = dataUrl; + } + + return setTimeout(function () { return file.previewElement.classList.add("dz-image-preview"); - }; - })(this)), 1); - } - }, - error: function(file, message) { - var node, _i, _len, _ref, _results; - if (file.previewElement) { - file.previewElement.classList.add("dz-error"); - if (typeof message !== "String" && message.error) { - message = message.error; + }, 1); } - _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]"); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - _results.push(node.textContent = message); + }, + + + // Called whenever an error occurs + // Receives `file` and `message` + error: function error(file, message) { + if (file.previewElement) { + file.previewElement.classList.add("dz-error"); + if (typeof message !== "String" && message.error) { + message = message.error; + } + for (var _iterator7 = file.previewElement.querySelectorAll("[data-dz-errormessage]"), _isArray7 = true, _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { + var _ref6; + + if (_isArray7) { + if (_i7 >= _iterator7.length) break; + _ref6 = _iterator7[_i7++]; + } else { + _i7 = _iterator7.next(); + if (_i7.done) break; + _ref6 = _i7.value; + } + + var node = _ref6; + + node.textContent = message; + } } - return _results; - } - }, - errormultiple: noop, - processing: function(file) { - if (file.previewElement) { - file.previewElement.classList.add("dz-processing"); - if (file._removeLink) { - return file._removeLink.textContent = this.options.dictCancelUpload; + }, + errormultiple: function errormultiple() {}, + + + // Called when a file gets processed. Since there is a cue, not all added + // files are processed immediately. + // Receives `file` + processing: function processing(file) { + if (file.previewElement) { + file.previewElement.classList.add("dz-processing"); + if (file._removeLink) { + return file._removeLink.innerHTML = this.options.dictCancelUpload; + } } - } - }, - processingmultiple: noop, - uploadprogress: function(file, progress, bytesSent) { - var node, _i, _len, _ref, _results; - if (file.previewElement) { - _ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]"); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - node = _ref[_i]; - if (node.nodeName === 'PROGRESS') { - _results.push(node.value = progress); - } else { - _results.push(node.style.width = "" + progress + "%"); + }, + processingmultiple: function processingmultiple() {}, + + + // Called whenever the upload progress gets updated. + // Receives `file`, `progress` (percentage 0-100) and `bytesSent`. + // To get the total number of bytes of the file, use `file.size` + uploadprogress: function uploadprogress(file, progress, bytesSent) { + if (file.previewElement) { + for (var _iterator8 = file.previewElement.querySelectorAll("[data-dz-uploadprogress]"), _isArray8 = true, _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { + var _ref7; + + if (_isArray8) { + if (_i8 >= _iterator8.length) break; + _ref7 = _iterator8[_i8++]; + } else { + _i8 = _iterator8.next(); + if (_i8.done) break; + _ref7 = _i8.value; + } + + var node = _ref7; + + node.nodeName === 'PROGRESS' ? node.value = progress : node.style.width = progress + "%"; } } - return _results; - } - }, - totaluploadprogress: noop, - sending: noop, - sendingmultiple: noop, - success: function(file) { - if (file.previewElement) { - return file.previewElement.classList.add("dz-success"); - } - }, - successmultiple: noop, - canceled: function(file) { - return this.emit("error", file, "Upload canceled."); - }, - canceledmultiple: noop, - complete: function(file) { - if (file._removeLink) { - file._removeLink.textContent = this.options.dictRemoveFile; - } - if (file.previewElement) { - return file.previewElement.classList.add("dz-complete"); - } - }, - completemultiple: noop, - maxfilesexceeded: noop, - maxfilesreached: noop, - queuecomplete: noop, - previewTemplate: "
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
" - }; + }, - extend = function() { - var key, object, objects, target, val, _i, _len; - target = arguments[0], objects = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - for (_i = 0, _len = objects.length; _i < _len; _i++) { - object = objects[_i]; - for (key in object) { - val = object[key]; - target[key] = val; - } + + // Called whenever the total upload progress gets updated. + // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent + totaluploadprogress: function totaluploadprogress() {}, + + + // Called just before the file is sent. Gets the `xhr` object as second + // parameter, so you can modify it (for example to add a CSRF token) and a + // `formData` object to add additional information. + sending: function sending() {}, + sendingmultiple: function sendingmultiple() {}, + + + // When the complete upload is finished and successful + // Receives `file` + success: function success(file) { + if (file.previewElement) { + return file.previewElement.classList.add("dz-success"); + } + }, + successmultiple: function successmultiple() {}, + + + // When the upload is canceled. + canceled: function canceled(file) { + return this.emit("error", file, this.options.dictUploadCanceled); + }, + canceledmultiple: function canceledmultiple() {}, + + + // When the upload is finished, either with success or an error. + // Receives `file` + complete: function complete(file) { + if (file._removeLink) { + file._removeLink.innerHTML = this.options.dictRemoveFile; + } + if (file.previewElement) { + return file.previewElement.classList.add("dz-complete"); + } + }, + completemultiple: function completemultiple() {}, + maxfilesexceeded: function maxfilesexceeded() {}, + maxfilesreached: function maxfilesreached() {}, + queuecomplete: function queuecomplete() {}, + addedfiles: function addedfiles() {} + }; + + this.prototype._thumbnailQueue = []; + this.prototype._processingThumbnail = false; + } + + // global utility + + }, { + key: "extend", + value: function extend(target) { + for (var _len2 = arguments.length, objects = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + objects[_key2 - 1] = arguments[_key2]; } - return target; - }; - function Dropzone(element, options) { - var elementOptions, fallback, _ref; - this.element = element; - this.version = Dropzone.version; - this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, ""); - this.clickableElements = []; - this.listeners = []; - this.files = []; - if (typeof this.element === "string") { - this.element = document.querySelector(this.element); - } - if (!(this.element && (this.element.nodeType != null))) { - throw new Error("Invalid dropzone element."); - } - if (this.element.dropzone) { - throw new Error("Dropzone already attached."); - } - Dropzone.instances.push(this); - this.element.dropzone = this; - elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {}; - this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {}); - if (this.options.forceFallback || !Dropzone.isBrowserSupported()) { - return this.options.fallback.call(this); - } - if (this.options.url == null) { - this.options.url = this.element.getAttribute("action"); - } - if (!this.options.url) { - throw new Error("No URL provided."); - } - if (this.options.acceptedFiles && this.options.acceptedMimeTypes) { - throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated."); - } - if (this.options.acceptedMimeTypes) { - this.options.acceptedFiles = this.options.acceptedMimeTypes; - delete this.options.acceptedMimeTypes; - } - this.options.method = this.options.method.toUpperCase(); - if ((fallback = this.getExistingFallback()) && fallback.parentNode) { - fallback.parentNode.removeChild(fallback); - } - if (this.options.previewsContainer !== false) { - if (this.options.previewsContainer) { - this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, "previewsContainer"); + for (var _iterator9 = objects, _isArray9 = true, _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref8; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref8 = _iterator9[_i9++]; } else { - this.previewsContainer = this.element; + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref8 = _i9.value; } - } - if (this.options.clickable) { - if (this.options.clickable === true) { - this.clickableElements = [this.element]; - } else { - this.clickableElements = Dropzone.getElements(this.options.clickable, "clickable"); + + var object = _ref8; + + for (var key in object) { + var val = object[key]; + target[key] = val; } } - this.init(); + return target; } + }]); - Dropzone.prototype.getAcceptedFiles = function() { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.accepted) { - _results.push(file); - } - } - return _results; - }; + function Dropzone(el, options) { + _classCallCheck(this, Dropzone); - Dropzone.prototype.getRejectedFiles = function() { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (!file.accepted) { - _results.push(file); - } + var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this)); + + var fallback = void 0, + left = void 0; + _this.element = el; + // For backwards compatibility since the version was in the prototype previously + _this.version = Dropzone.version; + + _this.defaultOptions.previewTemplate = _this.defaultOptions.previewTemplate.replace(/\n*/g, ""); + + _this.clickableElements = []; + _this.listeners = []; + _this.files = []; // All files + + if (typeof _this.element === "string") { + _this.element = document.querySelector(_this.element); + } + + // Not checking if instance of HTMLElement or Element since IE9 is extremely weird. + if (!_this.element || _this.element.nodeType == null) { + throw new Error("Invalid dropzone element."); + } + + if (_this.element.dropzone) { + throw new Error("Dropzone already attached."); + } + + // Now add this dropzone to the instances. + Dropzone.instances.push(_this); + + // Put the dropzone inside the element itself. + _this.element.dropzone = _this; + + var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {}; + + _this.options = Dropzone.extend({}, _this.defaultOptions, elementOptions, options != null ? options : {}); + + // If the browser failed, just call the fallback and leave + if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) { + var _ret; + + return _ret = _this.options.fallback.call(_this), _possibleConstructorReturn(_this, _ret); + } + + // @options.url = @element.getAttribute "action" unless @options.url? + if (_this.options.url == null) { + _this.options.url = _this.element.getAttribute("action"); + } + + if (!_this.options.url) { + throw new Error("No URL provided."); + } + + if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) { + throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated."); + } + + if (_this.options.uploadMultiple && _this.options.chunking) { + throw new Error('You cannot set both: uploadMultiple and chunking.'); + } + + // Backwards compatibility + if (_this.options.acceptedMimeTypes) { + _this.options.acceptedFiles = _this.options.acceptedMimeTypes; + delete _this.options.acceptedMimeTypes; + } + + // Backwards compatibility + if (_this.options.renameFilename != null) { + _this.options.renameFile = function (file) { + return _this.options.renameFilename.call(_this, file.name, file); + }; + } + + _this.options.method = _this.options.method.toUpperCase(); + + if ((fallback = _this.getExistingFallback()) && fallback.parentNode) { + // Remove the fallback + fallback.parentNode.removeChild(fallback); + } + + // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false + if (_this.options.previewsContainer !== false) { + if (_this.options.previewsContainer) { + _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, "previewsContainer"); + } else { + _this.previewsContainer = _this.element; } - return _results; - }; + } - Dropzone.prototype.getFilesWithStatus = function(status) { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.status === status) { - _results.push(file); - } + if (_this.options.clickable) { + if (_this.options.clickable === true) { + _this.clickableElements = [_this.element]; + } else { + _this.clickableElements = Dropzone.getElements(_this.options.clickable, "clickable"); } - return _results; - }; + } - Dropzone.prototype.getQueuedFiles = function() { - return this.getFilesWithStatus(Dropzone.QUEUED); - }; + _this.init(); + return _this; + } + + // Returns all files that have been accepted + + + _createClass(Dropzone, [{ + key: "getAcceptedFiles", + value: function getAcceptedFiles() { + return this.files.filter(function (file) { + return file.accepted; + }).map(function (file) { + return file; + }); + } + + // Returns all files that have been rejected + // Not sure when that's going to be useful, but added for completeness. + + }, { + key: "getRejectedFiles", + value: function getRejectedFiles() { + return this.files.filter(function (file) { + return !file.accepted; + }).map(function (file) { + return file; + }); + } + }, { + key: "getFilesWithStatus", + value: function getFilesWithStatus(status) { + return this.files.filter(function (file) { + return file.status === status; + }).map(function (file) { + return file; + }); + } + + // Returns all files that are in the queue - Dropzone.prototype.getUploadingFiles = function() { + }, { + key: "getQueuedFiles", + value: function getQueuedFiles() { + return this.getFilesWithStatus(Dropzone.QUEUED); + } + }, { + key: "getUploadingFiles", + value: function getUploadingFiles() { return this.getFilesWithStatus(Dropzone.UPLOADING); - }; + } + }, { + key: "getAddedFiles", + value: function getAddedFiles() { + return this.getFilesWithStatus(Dropzone.ADDED); + } - Dropzone.prototype.getActiveFiles = function() { - var file, _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED) { - _results.push(file); - } - } - return _results; - }; + // Files that are either queued or uploading + + }, { + key: "getActiveFiles", + value: function getActiveFiles() { + return this.files.filter(function (file) { + return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED; + }).map(function (file) { + return file; + }); + } + + // The function that gets called when Dropzone is initialized. You + // can (and should) setup event listeners inside this function. - Dropzone.prototype.init = function() { - var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1; + }, { + key: "init", + value: function init() { + var _this3 = this; + + // In case it isn't set already if (this.element.tagName === "form") { this.element.setAttribute("enctype", "multipart/form-data"); } + if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) { this.element.appendChild(Dropzone.createElement("
" + this.options.dictDefaultMessage + "
")); } + if (this.clickableElements.length) { - setupHiddenFileInput = (function(_this) { - return function() { - if (_this.hiddenFileInput) { - document.body.removeChild(_this.hiddenFileInput); - } - _this.hiddenFileInput = document.createElement("input"); - _this.hiddenFileInput.setAttribute("type", "file"); - if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) { - _this.hiddenFileInput.setAttribute("multiple", "multiple"); - } - _this.hiddenFileInput.className = "dz-hidden-input"; - if (_this.options.acceptedFiles != null) { - _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles); - } - if (_this.options.capture != null) { - _this.hiddenFileInput.setAttribute("capture", _this.options.capture); - } - _this.hiddenFileInput.style.visibility = "hidden"; - _this.hiddenFileInput.style.position = "absolute"; - _this.hiddenFileInput.style.top = "0"; - _this.hiddenFileInput.style.left = "0"; - _this.hiddenFileInput.style.height = "0"; - _this.hiddenFileInput.style.width = "0"; - document.body.appendChild(_this.hiddenFileInput); - return _this.hiddenFileInput.addEventListener("change", function() { - var file, files, _i, _len; - files = _this.hiddenFileInput.files; - if (files.length) { - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - _this.addFile(file); + var setupHiddenFileInput = function setupHiddenFileInput() { + if (_this3.hiddenFileInput) { + _this3.hiddenFileInput.parentNode.removeChild(_this3.hiddenFileInput); + } + _this3.hiddenFileInput = document.createElement("input"); + _this3.hiddenFileInput.setAttribute("type", "file"); + if (_this3.options.maxFiles === null || _this3.options.maxFiles > 1) { + _this3.hiddenFileInput.setAttribute("multiple", "multiple"); + } + _this3.hiddenFileInput.className = "dz-hidden-input"; + + if (_this3.options.acceptedFiles !== null) { + _this3.hiddenFileInput.setAttribute("accept", _this3.options.acceptedFiles); + } + if (_this3.options.capture !== null) { + _this3.hiddenFileInput.setAttribute("capture", _this3.options.capture); + } + + // Not setting `display="none"` because some browsers don't accept clicks + // on elements that aren't displayed. + _this3.hiddenFileInput.style.visibility = "hidden"; + _this3.hiddenFileInput.style.position = "absolute"; + _this3.hiddenFileInput.style.top = "0"; + _this3.hiddenFileInput.style.left = "0"; + _this3.hiddenFileInput.style.height = "0"; + _this3.hiddenFileInput.style.width = "0"; + Dropzone.getElement(_this3.options.hiddenInputContainer, 'hiddenInputContainer').appendChild(_this3.hiddenFileInput); + return _this3.hiddenFileInput.addEventListener("change", function () { + var files = _this3.hiddenFileInput.files; + + if (files.length) { + for (var _iterator10 = files, _isArray10 = true, _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref9; + + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref9 = _iterator10[_i10++]; + } else { + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref9 = _i10.value; } + + var file = _ref9; + + _this3.addFile(file); } - return setupHiddenFileInput(); - }); - }; - })(this); + } + _this3.emit("addedfiles", files); + return setupHiddenFileInput(); + }); + }; setupHiddenFileInput(); } - this.URL = (_ref = window.URL) != null ? _ref : window.webkitURL; - _ref1 = this.events; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - eventName = _ref1[_i]; + + this.URL = window.URL !== null ? window.URL : window.webkitURL; + + // Setup all event listeners on the Dropzone object itself. + // They're not in @setupEventListeners() because they shouldn't be removed + // again when the dropzone gets disabled. + for (var _iterator11 = this.events, _isArray11 = true, _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { + var _ref10; + + if (_isArray11) { + if (_i11 >= _iterator11.length) break; + _ref10 = _iterator11[_i11++]; + } else { + _i11 = _iterator11.next(); + if (_i11.done) break; + _ref10 = _i11.value; + } + + var eventName = _ref10; + this.on(eventName, this.options[eventName]); } - this.on("uploadprogress", (function(_this) { - return function() { - return _this.updateTotalUploadProgress(); - }; - })(this)); - this.on("removedfile", (function(_this) { - return function() { - return _this.updateTotalUploadProgress(); - }; - })(this)); - this.on("canceled", (function(_this) { - return function(file) { - return _this.emit("complete", file); - }; - })(this)); - this.on("complete", (function(_this) { - return function(file) { - if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) { - return setTimeout((function() { - return _this.emit("queuecomplete"); - }), 0); - } - }; - })(this)); - noPropagation = function(e) { + + this.on("uploadprogress", function () { + return _this3.updateTotalUploadProgress(); + }); + + this.on("removedfile", function () { + return _this3.updateTotalUploadProgress(); + }); + + this.on("canceled", function (file) { + return _this3.emit("complete", file); + }); + + // Emit a `queuecomplete` event if all files finished uploading. + this.on("complete", function (file) { + if (_this3.getAddedFiles().length === 0 && _this3.getUploadingFiles().length === 0 && _this3.getQueuedFiles().length === 0) { + // This needs to be deferred so that `queuecomplete` really triggers after `complete` + return setTimeout(function () { + return _this3.emit("queuecomplete"); + }, 0); + } + }); + + var noPropagation = function noPropagation(e) { e.stopPropagation(); if (e.preventDefault) { return e.preventDefault(); @@ -607,90 +1305,106 @@ return e.returnValue = false; } }; - this.listeners = [ - { - element: this.element, - events: { - "dragstart": (function(_this) { - return function(e) { - return _this.emit("dragstart", e); - }; - })(this), - "dragenter": (function(_this) { - return function(e) { - noPropagation(e); - return _this.emit("dragenter", e); - }; - })(this), - "dragover": (function(_this) { - return function(e) { - var efct; - try { - efct = e.dataTransfer.effectAllowed; - } catch (_error) {} - e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy'; - noPropagation(e); - return _this.emit("dragover", e); - }; - })(this), - "dragleave": (function(_this) { - return function(e) { - return _this.emit("dragleave", e); - }; - })(this), - "drop": (function(_this) { - return function(e) { - noPropagation(e); - return _this.drop(e); - }; - })(this), - "dragend": (function(_this) { - return function(e) { - return _this.emit("dragend", e); - }; - })(this) + + // Create the listeners + this.listeners = [{ + element: this.element, + events: { + "dragstart": function dragstart(e) { + return _this3.emit("dragstart", e); + }, + "dragenter": function dragenter(e) { + noPropagation(e); + return _this3.emit("dragenter", e); + }, + "dragover": function dragover(e) { + // Makes it possible to drag files from chrome's download bar + // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar + // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception) + var efct = void 0; + try { + efct = e.dataTransfer.effectAllowed; + } catch (error) {} + e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy'; + + noPropagation(e); + return _this3.emit("dragover", e); + }, + "dragleave": function dragleave(e) { + return _this3.emit("dragleave", e); + }, + "drop": function drop(e) { + noPropagation(e); + return _this3.drop(e); + }, + "dragend": function dragend(e) { + return _this3.emit("dragend", e); } - } - ]; - this.clickableElements.forEach((function(_this) { - return function(clickableElement) { - return _this.listeners.push({ - element: clickableElement, - events: { - "click": function(evt) { - if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) { - return _this.hiddenFileInput.click(); - } + + // This is disabled right now, because the browsers don't implement it properly. + // "paste": (e) => + // noPropagation e + // @paste e + } }]; + + this.clickableElements.forEach(function (clickableElement) { + return _this3.listeners.push({ + element: clickableElement, + events: { + "click": function click(evt) { + // Only the actual dropzone or the message element should trigger file selection + if (clickableElement !== _this3.element || evt.target === _this3.element || Dropzone.elementInside(evt.target, _this3.element.querySelector(".dz-message"))) { + _this3.hiddenFileInput.click(); // Forward the click } + return true; } - }); - }; - })(this)); + } + }); + }); + this.enable(); + return this.options.init.call(this); - }; + } + + // Not fully tested yet - Dropzone.prototype.destroy = function() { - var _ref; + }, { + key: "destroy", + value: function destroy() { this.disable(); this.removeAllFiles(true); - if ((_ref = this.hiddenFileInput) != null ? _ref.parentNode : void 0) { + if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) { this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput); this.hiddenFileInput = null; } delete this.element.dropzone; return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1); - }; + } + }, { + key: "updateTotalUploadProgress", + value: function updateTotalUploadProgress() { + var totalUploadProgress = void 0; + var totalBytesSent = 0; + var totalBytes = 0; + + var activeFiles = this.getActiveFiles(); - Dropzone.prototype.updateTotalUploadProgress = function() { - var activeFiles, file, totalBytes, totalBytesSent, totalUploadProgress, _i, _len, _ref; - totalBytesSent = 0; - totalBytes = 0; - activeFiles = this.getActiveFiles(); if (activeFiles.length) { - _ref = this.getActiveFiles(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; + for (var _iterator12 = this.getActiveFiles(), _isArray12 = true, _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { + var _ref11; + + if (_isArray12) { + if (_i12 >= _iterator12.length) break; + _ref11 = _iterator12[_i12++]; + } else { + _i12 = _iterator12.next(); + if (_i12.done) break; + _ref11 = _i12.value; + } + + var file = _ref11; + totalBytesSent += file.upload.bytesSent; totalBytes += file.upload.total; } @@ -698,139 +1412,200 @@ } else { totalUploadProgress = 100; } + return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent); - }; + } + + // @options.paramName can be a function taking one parameter rather than a string. + // A parameter name for a file is obtained simply by calling this with an index number. - Dropzone.prototype._getParamName = function(n) { + }, { + key: "_getParamName", + value: function _getParamName(n) { if (typeof this.options.paramName === "function") { return this.options.paramName(n); } else { return "" + this.options.paramName + (this.options.uploadMultiple ? "[" + n + "]" : ""); } - }; + } + + // If @options.renameFile is a function, + // the function will be used to rename the file.name before appending it to the formData + + }, { + key: "_renameFile", + value: function _renameFile(file) { + if (typeof this.options.renameFile !== "function") { + return file.name; + } + return this.options.renameFile(file); + } - Dropzone.prototype.getFallbackForm = function() { - var existingFallback, fields, fieldsString, form; + // Returns a form that can be used as fallback if the browser does not support DragnDrop + // + // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided. + // This code has to pass in IE7 :( + + }, { + key: "getFallbackForm", + value: function getFallbackForm() { + var existingFallback = void 0, + form = void 0; if (existingFallback = this.getExistingFallback()) { return existingFallback; } - fieldsString = "
"; + + var fieldsString = "
"; if (this.options.dictFallbackText) { fieldsString += "

" + this.options.dictFallbackText + "

"; } - fieldsString += "
"; - fields = Dropzone.createElement(fieldsString); + fieldsString += "
"; + + var fields = Dropzone.createElement(fieldsString); if (this.element.tagName !== "FORM") { form = Dropzone.createElement("
"); form.appendChild(fields); } else { + // Make sure that the enctype and method attributes are set properly this.element.setAttribute("enctype", "multipart/form-data"); this.element.setAttribute("method", this.options.method); } return form != null ? form : fields; - }; + } + + // Returns the fallback elements if they exist already + // + // This code has to pass in IE7 :( + + }, { + key: "getExistingFallback", + value: function getExistingFallback() { + var getFallback = function getFallback(elements) { + for (var _iterator13 = elements, _isArray13 = true, _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { + var _ref12; + + if (_isArray13) { + if (_i13 >= _iterator13.length) break; + _ref12 = _iterator13[_i13++]; + } else { + _i13 = _iterator13.next(); + if (_i13.done) break; + _ref12 = _i13.value; + } + + var el = _ref12; - Dropzone.prototype.getExistingFallback = function() { - var fallback, getFallback, tagName, _i, _len, _ref; - getFallback = function(elements) { - var el, _i, _len; - for (_i = 0, _len = elements.length; _i < _len; _i++) { - el = elements[_i]; if (/(^| )fallback($| )/.test(el.className)) { return el; } } }; - _ref = ["div", "form"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - tagName = _ref[_i]; + + var _arr = ["div", "form"]; + for (var _i14 = 0; _i14 < _arr.length; _i14++) { + var tagName = _arr[_i14]; + var fallback; if (fallback = getFallback(this.element.getElementsByTagName(tagName))) { return fallback; } } - }; + } - Dropzone.prototype.setupEventListeners = function() { - var elementListeners, event, listener, _i, _len, _ref, _results; - _ref = this.listeners; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elementListeners = _ref[_i]; - _results.push((function() { - var _ref1, _results1; - _ref1 = elementListeners.events; - _results1 = []; - for (event in _ref1) { - listener = _ref1[event]; - _results1.push(elementListeners.element.addEventListener(event, listener, false)); + // Activates all listeners stored in @listeners + + }, { + key: "setupEventListeners", + value: function setupEventListeners() { + return this.listeners.map(function (elementListeners) { + return function () { + var result = []; + for (var event in elementListeners.events) { + var listener = elementListeners.events[event]; + result.push(elementListeners.element.addEventListener(event, listener, false)); } - return _results1; - })()); - } - return _results; - }; + return result; + }(); + }); + } - Dropzone.prototype.removeEventListeners = function() { - var elementListeners, event, listener, _i, _len, _ref, _results; - _ref = this.listeners; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - elementListeners = _ref[_i]; - _results.push((function() { - var _ref1, _results1; - _ref1 = elementListeners.events; - _results1 = []; - for (event in _ref1) { - listener = _ref1[event]; - _results1.push(elementListeners.element.removeEventListener(event, listener, false)); + // Deactivates all listeners stored in @listeners + + }, { + key: "removeEventListeners", + value: function removeEventListeners() { + return this.listeners.map(function (elementListeners) { + return function () { + var result = []; + for (var event in elementListeners.events) { + var listener = elementListeners.events[event]; + result.push(elementListeners.element.removeEventListener(event, listener, false)); } - return _results1; - })()); - } - return _results; - }; + return result; + }(); + }); + } - Dropzone.prototype.disable = function() { - var file, _i, _len, _ref, _results; - this.clickableElements.forEach(function(element) { + // Removes all event listeners and cancels all files in the queue or being processed. + + }, { + key: "disable", + value: function disable() { + var _this4 = this; + + this.clickableElements.forEach(function (element) { return element.classList.remove("dz-clickable"); }); this.removeEventListeners(); - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - _results.push(this.cancelUpload(file)); - } - return _results; - }; + this.disabled = true; - Dropzone.prototype.enable = function() { - this.clickableElements.forEach(function(element) { + return this.files.map(function (file) { + return _this4.cancelUpload(file); + }); + } + }, { + key: "enable", + value: function enable() { + delete this.disabled; + this.clickableElements.forEach(function (element) { return element.classList.add("dz-clickable"); }); return this.setupEventListeners(); - }; + } - Dropzone.prototype.filesize = function(size) { - var cutoff, i, selectedSize, selectedUnit, unit, units, _i, _len; - units = ['TB', 'GB', 'MB', 'KB', 'b']; - selectedSize = selectedUnit = null; - for (i = _i = 0, _len = units.length; _i < _len; i = ++_i) { - unit = units[i]; - cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; - if (size >= cutoff) { - selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); - selectedUnit = unit; - break; + // Returns a nicely formatted filesize + + }, { + key: "filesize", + value: function filesize(size) { + var selectedSize = 0; + var selectedUnit = "b"; + + if (size > 0) { + var units = ['tb', 'gb', 'mb', 'kb', 'b']; + + for (var i = 0; i < units.length; i++) { + var unit = units[i]; + var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10; + + if (size >= cutoff) { + selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i); + selectedUnit = unit; + break; + } } + + selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits } - selectedSize = Math.round(10 * selectedSize) / 10; - return "" + selectedSize + " " + selectedUnit; - }; - Dropzone.prototype._updateMaxFilesReachedClass = function() { - if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) { + return "" + selectedSize + " " + this.options.dictFileSizeUnits[selectedUnit]; + } + + // Adds or removes the `dz-max-files-reached` class from the form. + + }, { + key: "_updateMaxFilesReachedClass", + value: function _updateMaxFilesReachedClass() { + if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { if (this.getAcceptedFiles().length === this.options.maxFiles) { this.emit('maxfilesreached', this.files); } @@ -838,519 +1613,1194 @@ } else { return this.element.classList.remove("dz-max-files-reached"); } - }; - - Dropzone.prototype.drop = function(e) { - var files, items; + } + }, { + key: "drop", + value: function drop(e) { if (!e.dataTransfer) { return; } this.emit("drop", e); - files = e.dataTransfer.files; + + // Convert the FileList to an Array + // This is necessary for IE11 + var files = []; + for (var i = 0; i < e.dataTransfer.files.length; i++) { + files[i] = e.dataTransfer.files[i]; + } + + this.emit("addedfiles", files); + + // Even if it's a folder, files.length will contain the folders. if (files.length) { - items = e.dataTransfer.items; - if (items && items.length && (items[0].webkitGetAsEntry != null)) { + var items = e.dataTransfer.items; + + if (items && items.length && items[0].webkitGetAsEntry != null) { + // The browser supports dropping of folders, so handle items instead of files this._addFilesFromItems(items); } else { this.handleFiles(files); } } - }; - - Dropzone.prototype.paste = function(e) { - var items, _ref; - if ((e != null ? (_ref = e.clipboardData) != null ? _ref.items : void 0 : void 0) == null) { + } + }, { + key: "paste", + value: function paste(e) { + if (__guard__(e != null ? e.clipboardData : undefined, function (x) { + return x.items; + }) == null) { return; } + this.emit("paste", e); - items = e.clipboardData.items; + var items = e.clipboardData.items; + + if (items.length) { return this._addFilesFromItems(items); } - }; + } + }, { + key: "handleFiles", + value: function handleFiles(files) { + for (var _iterator14 = files, _isArray14 = true, _i15 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { + var _ref13; + + if (_isArray14) { + if (_i15 >= _iterator14.length) break; + _ref13 = _iterator14[_i15++]; + } else { + _i15 = _iterator14.next(); + if (_i15.done) break; + _ref13 = _i15.value; + } + + var file = _ref13; - Dropzone.prototype.handleFiles = function(files) { - var file, _i, _len, _results; - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - _results.push(this.addFile(file)); + this.addFile(file); } - return _results; - }; + } - Dropzone.prototype._addFilesFromItems = function(items) { - var entry, item, _i, _len, _results; - _results = []; - for (_i = 0, _len = items.length; _i < _len; _i++) { - item = items[_i]; - if ((item.webkitGetAsEntry != null) && (entry = item.webkitGetAsEntry())) { - if (entry.isFile) { - _results.push(this.addFile(item.getAsFile())); - } else if (entry.isDirectory) { - _results.push(this._addFilesFromDirectory(entry, entry.name)); + // When a folder is dropped (or files are pasted), items must be handled + // instead of files. + + }, { + key: "_addFilesFromItems", + value: function _addFilesFromItems(items) { + var _this5 = this; + + return function () { + var result = []; + for (var _iterator15 = items, _isArray15 = true, _i16 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { + var _ref14; + + if (_isArray15) { + if (_i16 >= _iterator15.length) break; + _ref14 = _iterator15[_i16++]; } else { - _results.push(void 0); + _i16 = _iterator15.next(); + if (_i16.done) break; + _ref14 = _i16.value; } - } else if (item.getAsFile != null) { - if ((item.kind == null) || item.kind === "file") { - _results.push(this.addFile(item.getAsFile())); + + var item = _ref14; + + var entry; + if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) { + if (entry.isFile) { + result.push(_this5.addFile(item.getAsFile())); + } else if (entry.isDirectory) { + // Append all files from that directory to files + result.push(_this5._addFilesFromDirectory(entry, entry.name)); + } else { + result.push(undefined); + } + } else if (item.getAsFile != null) { + if (item.kind == null || item.kind === "file") { + result.push(_this5.addFile(item.getAsFile())); + } else { + result.push(undefined); + } } else { - _results.push(void 0); + result.push(undefined); } - } else { - _results.push(void 0); } - } - return _results; - }; + return result; + }(); + } - Dropzone.prototype._addFilesFromDirectory = function(directory, path) { - var dirReader, entriesReader; - dirReader = directory.createReader(); - entriesReader = (function(_this) { - return function(entries) { - var entry, _i, _len; - for (_i = 0, _len = entries.length; _i < _len; _i++) { - entry = entries[_i]; - if (entry.isFile) { - entry.file(function(file) { - if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') { - return; - } - file.fullPath = "" + path + "/" + file.name; - return _this.addFile(file); - }); - } else if (entry.isDirectory) { - _this._addFilesFromDirectory(entry, "" + path + "/" + entry.name); + // Goes through the directory, and adds each file it finds recursively + + }, { + key: "_addFilesFromDirectory", + value: function _addFilesFromDirectory(directory, path) { + var _this6 = this; + + var dirReader = directory.createReader(); + + var errorHandler = function errorHandler(error) { + return __guardMethod__(console, 'log', function (o) { + return o.log(error); + }); + }; + + var readEntries = function readEntries() { + return dirReader.readEntries(function (entries) { + if (entries.length > 0) { + for (var _iterator16 = entries, _isArray16 = true, _i17 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { + var _ref15; + + if (_isArray16) { + if (_i17 >= _iterator16.length) break; + _ref15 = _iterator16[_i17++]; + } else { + _i17 = _iterator16.next(); + if (_i17.done) break; + _ref15 = _i17.value; + } + + var entry = _ref15; + + if (entry.isFile) { + entry.file(function (file) { + if (_this6.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') { + return; + } + file.fullPath = path + "/" + file.name; + return _this6.addFile(file); + }); + } else if (entry.isDirectory) { + _this6._addFilesFromDirectory(entry, path + "/" + entry.name); + } } + + // Recursively call readEntries() again, since browser only handle + // the first 100 entries. + // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries + readEntries(); } - }; - })(this); - return dirReader.readEntries(entriesReader, function(error) { - return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0; - }); - }; + return null; + }, errorHandler); + }; - Dropzone.prototype.accept = function(file, done) { - if (file.size > this.options.maxFilesize * 1024 * 1024) { + return readEntries(); + } + + // If `done()` is called without argument the file is accepted + // If you call it with an error message, the file is rejected + // (This allows for asynchronous validation) + // + // This function checks the filesize, and if the file.type passes the + // `acceptedFiles` check. + + }, { + key: "accept", + value: function accept(file, done) { + if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) { return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize)); } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) { return done(this.options.dictInvalidFileType); - } else if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) { + } else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) { done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles)); return this.emit("maxfilesexceeded", file); } else { return this.options.accept.call(this, file, done); } - }; + } + }, { + key: "addFile", + value: function addFile(file) { + var _this7 = this; - Dropzone.prototype.addFile = function(file) { file.upload = { + uuid: Dropzone.uuidv4(), progress: 0, + // Setting the total upload size to file.size for the beginning + // It's actual different than the size to be transmitted. total: file.size, - bytesSent: 0 + bytesSent: 0, + filename: this._renameFile(file), + chunked: this.options.chunking && (this.options.forceChunking || file.size > this.options.chunkSize), + totalChunkCount: Math.ceil(file.size / this.options.chunkSize) }; this.files.push(file); + file.status = Dropzone.ADDED; + this.emit("addedfile", file); + this._enqueueThumbnail(file); - return this.accept(file, (function(_this) { - return function(error) { - if (error) { - file.accepted = false; - _this._errorProcessing([file], error); - } else { - file.accepted = true; - if (_this.options.autoQueue) { - _this.enqueueFile(file); - } - } - return _this._updateMaxFilesReachedClass(); - }; - })(this)); - }; - Dropzone.prototype.enqueueFiles = function(files) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; + return this.accept(file, function (error) { + if (error) { + file.accepted = false; + _this7._errorProcessing([file], error); // Will set the file.status + } else { + file.accepted = true; + if (_this7.options.autoQueue) { + _this7.enqueueFile(file); + } // Will set .accepted = true + } + return _this7._updateMaxFilesReachedClass(); + }); + } + + // Wrapper for enqueueFile + + }, { + key: "enqueueFiles", + value: function enqueueFiles(files) { + for (var _iterator17 = files, _isArray17 = true, _i18 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator]();;) { + var _ref16; + + if (_isArray17) { + if (_i18 >= _iterator17.length) break; + _ref16 = _iterator17[_i18++]; + } else { + _i18 = _iterator17.next(); + if (_i18.done) break; + _ref16 = _i18.value; + } + + var file = _ref16; + this.enqueueFile(file); } return null; - }; + } + }, { + key: "enqueueFile", + value: function enqueueFile(file) { + var _this8 = this; - Dropzone.prototype.enqueueFile = function(file) { if (file.status === Dropzone.ADDED && file.accepted === true) { file.status = Dropzone.QUEUED; if (this.options.autoProcessQueue) { - return setTimeout(((function(_this) { - return function() { - return _this.processQueue(); - }; - })(this)), 0); + return setTimeout(function () { + return _this8.processQueue(); + }, 0); // Deferring the call } } else { throw new Error("This file can't be queued because it has already been processed or was rejected."); } - }; - - Dropzone.prototype._thumbnailQueue = []; - - Dropzone.prototype._processingThumbnail = false; + } + }, { + key: "_enqueueThumbnail", + value: function _enqueueThumbnail(file) { + var _this9 = this; - Dropzone.prototype._enqueueThumbnail = function(file) { if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) { this._thumbnailQueue.push(file); - return setTimeout(((function(_this) { - return function() { - return _this._processThumbnailQueue(); - }; - })(this)), 0); + return setTimeout(function () { + return _this9._processThumbnailQueue(); + }, 0); // Deferring the call } - }; + } + }, { + key: "_processThumbnailQueue", + value: function _processThumbnailQueue() { + var _this10 = this; - Dropzone.prototype._processThumbnailQueue = function() { if (this._processingThumbnail || this._thumbnailQueue.length === 0) { return; } + this._processingThumbnail = true; - return this.createThumbnail(this._thumbnailQueue.shift(), (function(_this) { - return function() { - _this._processingThumbnail = false; - return _this._processThumbnailQueue(); - }; - })(this)); - }; + var file = this._thumbnailQueue.shift(); + return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function (dataUrl) { + _this10.emit("thumbnail", file, dataUrl); + _this10._processingThumbnail = false; + return _this10._processThumbnailQueue(); + }); + } - Dropzone.prototype.removeFile = function(file) { + // Can be called by the user to remove a file + + }, { + key: "removeFile", + value: function removeFile(file) { if (file.status === Dropzone.UPLOADING) { this.cancelUpload(file); } this.files = without(this.files, file); + this.emit("removedfile", file); if (this.files.length === 0) { return this.emit("reset"); } - }; + } - Dropzone.prototype.removeAllFiles = function(cancelIfNecessary) { - var file, _i, _len, _ref; + // Removes all files that aren't currently processed from the list + + }, { + key: "removeAllFiles", + value: function removeAllFiles(cancelIfNecessary) { + // Create a copy of files since removeFile() changes the @files array. if (cancelIfNecessary == null) { cancelIfNecessary = false; } - _ref = this.files.slice(); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; + for (var _iterator18 = this.files.slice(), _isArray18 = true, _i19 = 0, _iterator18 = _isArray18 ? _iterator18 : _iterator18[Symbol.iterator]();;) { + var _ref17; + + if (_isArray18) { + if (_i19 >= _iterator18.length) break; + _ref17 = _iterator18[_i19++]; + } else { + _i19 = _iterator18.next(); + if (_i19.done) break; + _ref17 = _i19.value; + } + + var file = _ref17; + if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) { this.removeFile(file); } } return null; - }; + } - Dropzone.prototype.createThumbnail = function(file, callback) { - var fileReader; - fileReader = new FileReader; - fileReader.onload = (function(_this) { - return function() { - if (file.type === "image/svg+xml") { - _this.emit("thumbnail", file, fileReader.result); - if (callback != null) { - callback(); - } - return; + // Resizes an image before it gets sent to the server. This function is the default behavior of + // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with + // the resized blob. + + }, { + key: "resizeImage", + value: function resizeImage(file, width, height, resizeMethod, callback) { + var _this11 = this; + + return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) { + if (canvas == null) { + // The image has not been resized + return callback(file); + } else { + var resizeMimeType = _this11.options.resizeMimeType; + + if (resizeMimeType == null) { + resizeMimeType = file.type; } - return _this.createThumbnailFromUrl(file, fileReader.result, callback); - }; - })(this); + var resizedDataURL = canvas.toDataURL(resizeMimeType, _this11.options.resizeQuality); + if (resizeMimeType === 'image/jpeg' || resizeMimeType === 'image/jpg') { + // Now add the original EXIF information + resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL); + } + return callback(Dropzone.dataURItoBlob(resizedDataURL)); + } + }); + } + }, { + key: "createThumbnail", + value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) { + var _this12 = this; + + var fileReader = new FileReader(); + + fileReader.onload = function () { + + file.dataURL = fileReader.result; + + // Don't bother creating a thumbnail for SVG images since they're vector + if (file.type === "image/svg+xml") { + if (callback != null) { + callback(fileReader.result); + } + return; + } + + return _this12.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback); + }; + return fileReader.readAsDataURL(file); - }; + } + }, { + key: "createThumbnailFromUrl", + value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) { + var _this13 = this; + + // Not using `new Image` here because of a bug in latest Chrome versions. + // See https://github.com/enyo/dropzone/pull/226 + var img = document.createElement("img"); + + if (crossOrigin) { + img.crossOrigin = crossOrigin; + } + + img.onload = function () { + var loadExif = function loadExif(callback) { + return callback(1); + }; + if (typeof EXIF !== 'undefined' && EXIF !== null && fixOrientation) { + loadExif = function loadExif(callback) { + return EXIF.getData(img, function () { + return callback(EXIF.getTag(this, 'Orientation')); + }); + }; + } - Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback) { - var img; - img = document.createElement("img"); - img.onload = (function(_this) { - return function() { - var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3; + return loadExif(function (orientation) { file.width = img.width; file.height = img.height; - resizeInfo = _this.options.resize.call(_this, file); - if (resizeInfo.trgWidth == null) { - resizeInfo.trgWidth = resizeInfo.optWidth; - } - if (resizeInfo.trgHeight == null) { - resizeInfo.trgHeight = resizeInfo.optHeight; - } - canvas = document.createElement("canvas"); - ctx = canvas.getContext("2d"); + + var resizeInfo = _this13.options.resize.call(_this13, file, width, height, resizeMethod); + + var canvas = document.createElement("canvas"); + var ctx = canvas.getContext("2d"); + canvas.width = resizeInfo.trgWidth; canvas.height = resizeInfo.trgHeight; - drawImageIOSFix(ctx, img, (_ref = resizeInfo.srcX) != null ? _ref : 0, (_ref1 = resizeInfo.srcY) != null ? _ref1 : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, (_ref2 = resizeInfo.trgX) != null ? _ref2 : 0, (_ref3 = resizeInfo.trgY) != null ? _ref3 : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); - thumbnail = canvas.toDataURL("image/png"); - _this.emit("thumbnail", file, thumbnail); + + if (orientation > 4) { + canvas.width = resizeInfo.trgHeight; + canvas.height = resizeInfo.trgWidth; + } + + switch (orientation) { + case 2: + // horizontal flip + ctx.translate(canvas.width, 0); + ctx.scale(-1, 1); + break; + case 3: + // 180° rotate left + ctx.translate(canvas.width, canvas.height); + ctx.rotate(Math.PI); + break; + case 4: + // vertical flip + ctx.translate(0, canvas.height); + ctx.scale(1, -1); + break; + case 5: + // vertical flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.scale(1, -1); + break; + case 6: + // 90° rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(0, -canvas.width); + break; + case 7: + // horizontal flip + 90 rotate right + ctx.rotate(0.5 * Math.PI); + ctx.translate(canvas.height, -canvas.width); + ctx.scale(-1, 1); + break; + case 8: + // 90° rotate left + ctx.rotate(-0.5 * Math.PI); + ctx.translate(-canvas.height, 0); + break; + } + + // This is a bugfix for iOS' scaling bug. + drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight); + + var thumbnail = canvas.toDataURL("image/png"); + if (callback != null) { - return callback(); + return callback(thumbnail, canvas); } - }; - })(this); + }); + }; + if (callback != null) { img.onerror = callback; } - return img.src = imageUrl; - }; - Dropzone.prototype.processQueue = function() { - var i, parallelUploads, processingLength, queuedFiles; - parallelUploads = this.options.parallelUploads; - processingLength = this.getUploadingFiles().length; - i = processingLength; + return img.src = file.dataURL; + } + + // Goes through the queue and processes files if there aren't too many already. + + }, { + key: "processQueue", + value: function processQueue() { + var parallelUploads = this.options.parallelUploads; + + var processingLength = this.getUploadingFiles().length; + var i = processingLength; + + // There are already at least as many files uploading than should be if (processingLength >= parallelUploads) { return; } - queuedFiles = this.getQueuedFiles(); + + var queuedFiles = this.getQueuedFiles(); + if (!(queuedFiles.length > 0)) { return; } + if (this.options.uploadMultiple) { + // The files should be uploaded in one request return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength)); } else { while (i < parallelUploads) { if (!queuedFiles.length) { return; - } + } // Nothing left to process this.processFile(queuedFiles.shift()); i++; } } - }; + } - Dropzone.prototype.processFile = function(file) { + // Wrapper for `processFiles` + + }, { + key: "processFile", + value: function processFile(file) { return this.processFiles([file]); - }; + } + + // Loads the file, then calls finishedLoading() + + }, { + key: "processFiles", + value: function processFiles(files) { + for (var _iterator19 = files, _isArray19 = true, _i20 = 0, _iterator19 = _isArray19 ? _iterator19 : _iterator19[Symbol.iterator]();;) { + var _ref18; + + if (_isArray19) { + if (_i20 >= _iterator19.length) break; + _ref18 = _iterator19[_i20++]; + } else { + _i20 = _iterator19.next(); + if (_i20.done) break; + _ref18 = _i20.value; + } + + var file = _ref18; + + file.processing = true; // Backwards compatibility + file.status = Dropzone.UPLOADING; - Dropzone.prototype.processFiles = function(files) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - file.processing = true; - file.status = Dropzone.UPLOADING; this.emit("processing", file); } + if (this.options.uploadMultiple) { this.emit("processingmultiple", files); } + return this.uploadFiles(files); - }; + } + }, { + key: "_getFilesWithXhr", + value: function _getFilesWithXhr(xhr) { + var files = void 0; + return files = this.files.filter(function (file) { + return file.xhr === xhr; + }).map(function (file) { + return file; + }); + } - Dropzone.prototype._getFilesWithXhr = function(xhr) { - var file, files; - return files = (function() { - var _i, _len, _ref, _results; - _ref = this.files; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - file = _ref[_i]; - if (file.xhr === xhr) { - _results.push(file); - } - } - return _results; - }).call(this); - }; + // Cancels the file upload and sets the status to CANCELED + // **if** the file is actually being uploaded. + // If it's still in the queue, the file is being removed from it and the status + // set to CANCELED. - Dropzone.prototype.cancelUpload = function(file) { - var groupedFile, groupedFiles, _i, _j, _len, _len1, _ref; + }, { + key: "cancelUpload", + value: function cancelUpload(file) { if (file.status === Dropzone.UPLOADING) { - groupedFiles = this._getFilesWithXhr(file.xhr); - for (_i = 0, _len = groupedFiles.length; _i < _len; _i++) { - groupedFile = groupedFiles[_i]; + var groupedFiles = this._getFilesWithXhr(file.xhr); + for (var _iterator20 = groupedFiles, _isArray20 = true, _i21 = 0, _iterator20 = _isArray20 ? _iterator20 : _iterator20[Symbol.iterator]();;) { + var _ref19; + + if (_isArray20) { + if (_i21 >= _iterator20.length) break; + _ref19 = _iterator20[_i21++]; + } else { + _i21 = _iterator20.next(); + if (_i21.done) break; + _ref19 = _i21.value; + } + + var groupedFile = _ref19; + groupedFile.status = Dropzone.CANCELED; } - file.xhr.abort(); - for (_j = 0, _len1 = groupedFiles.length; _j < _len1; _j++) { - groupedFile = groupedFiles[_j]; - this.emit("canceled", groupedFile); + if (typeof file.xhr !== 'undefined') { + file.xhr.abort(); + } + for (var _iterator21 = groupedFiles, _isArray21 = true, _i22 = 0, _iterator21 = _isArray21 ? _iterator21 : _iterator21[Symbol.iterator]();;) { + var _ref20; + + if (_isArray21) { + if (_i22 >= _iterator21.length) break; + _ref20 = _iterator21[_i22++]; + } else { + _i22 = _iterator21.next(); + if (_i22.done) break; + _ref20 = _i22.value; + } + + var _groupedFile = _ref20; + + this.emit("canceled", _groupedFile); } if (this.options.uploadMultiple) { this.emit("canceledmultiple", groupedFiles); } - } else if ((_ref = file.status) === Dropzone.ADDED || _ref === Dropzone.QUEUED) { + } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) { file.status = Dropzone.CANCELED; this.emit("canceled", file); if (this.options.uploadMultiple) { this.emit("canceledmultiple", [file]); } } + if (this.options.autoProcessQueue) { return this.processQueue(); } - }; - - resolveOption = function() { - var args, option; - option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + } + }, { + key: "resolveOption", + value: function resolveOption(option) { if (typeof option === 'function') { + for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + return option.apply(this, args); } return option; - }; - - Dropzone.prototype.uploadFile = function(file) { + } + }, { + key: "uploadFile", + value: function uploadFile(file) { return this.uploadFiles([file]); - }; + } + }, { + key: "uploadFiles", + value: function uploadFiles(files) { + var _this14 = this; - Dropzone.prototype.uploadFiles = function(files) { - var file, formData, handleError, headerName, headerValue, headers, i, input, inputName, inputType, key, method, option, progressObj, response, updateProgress, url, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - xhr = new XMLHttpRequest(); - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - file.xhr = xhr; - } - method = resolveOption(this.options.method, files); - url = resolveOption(this.options.url, files); - xhr.open(method, url, true); - xhr.withCredentials = !!this.options.withCredentials; - response = null; - handleError = (function(_this) { - return function() { - var _j, _len1, _results; - _results = []; - for (_j = 0, _len1 = files.length; _j < _len1; _j++) { - file = files[_j]; - _results.push(_this._errorProcessing(files, response || _this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr)); - } - return _results; - }; - })(this); - updateProgress = (function(_this) { - return function(e) { - var allFilesFinished, progress, _j, _k, _l, _len1, _len2, _len3, _results; - if (e != null) { - progress = 100 * e.loaded / e.total; - for (_j = 0, _len1 = files.length; _j < _len1; _j++) { - file = files[_j]; - file.upload = { - progress: progress, - total: e.total, - bytesSent: e.loaded - }; + this._transformFiles(files, function (transformedFiles) { + if (files[0].upload.chunked) { + // This file should be sent in chunks! + + // If the chunking option is set, we **know** that there can only be **one** file, since + // uploadMultiple is not allowed with this option. + var file = files[0]; + var transformedFile = transformedFiles[0]; + var startedChunkCount = 0; + + file.upload.chunks = []; + + var handleNextChunk = function handleNextChunk() { + var chunkIndex = 0; + + // Find the next item in file.upload.chunks that is not defined yet. + while (file.upload.chunks[chunkIndex] !== undefined) { + chunkIndex++; } - } else { - allFilesFinished = true; - progress = 100; - for (_k = 0, _len2 = files.length; _k < _len2; _k++) { - file = files[_k]; - if (!(file.upload.progress === 100 && file.upload.bytesSent === file.upload.total)) { - allFilesFinished = false; + + // This means, that all chunks have already been started. + if (chunkIndex >= file.upload.totalChunkCount) return; + + startedChunkCount++; + + var start = chunkIndex * _this14.options.chunkSize; + var end = Math.min(start + _this14.options.chunkSize, file.size); + + var dataBlock = { + name: _this14._getParamName(0), + data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end), + filename: file.upload.filename, + chunkIndex: chunkIndex + }; + + file.upload.chunks[chunkIndex] = { + file: file, + index: chunkIndex, + dataBlock: dataBlock, // In case we want to retry. + status: Dropzone.UPLOADING, + progress: 0, + retries: 0 // The number of times this block has been retried. + }; + + _this14._uploadData(files, [dataBlock]); + }; + + file.upload.finishedChunkUpload = function (chunk) { + var allFinished = true; + chunk.status = Dropzone.SUCCESS; + + // Clear the data from the chunk + chunk.dataBlock = null; + // Leaving this reference to xhr intact here will cause memory leaks in some browsers + chunk.xhr = null; + + for (var i = 0; i < file.upload.totalChunkCount; i++) { + if (file.upload.chunks[i] === undefined) { + return handleNextChunk(); + } + if (file.upload.chunks[i].status !== Dropzone.SUCCESS) { + allFinished = false; } - file.upload.progress = progress; - file.upload.bytesSent = file.upload.total; } - if (allFilesFinished) { - return; + + if (allFinished) { + _this14.options.chunksUploaded(file, function () { + _this14._finished(files, '', null); + }); } - } - _results = []; - for (_l = 0, _len3 = files.length; _l < _len3; _l++) { - file = files[_l]; - _results.push(_this.emit("uploadprogress", file, progress, file.upload.bytesSent)); - } - return _results; - }; - })(this); - xhr.onload = (function(_this) { - return function(e) { - var _ref; - if (files[0].status === Dropzone.CANCELED) { - return; - } - if (xhr.readyState !== 4) { - return; - } - response = xhr.responseText; - if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) { - try { - response = JSON.parse(response); - } catch (_error) { - e = _error; - response = "Invalid JSON response from server."; + }; + + if (_this14.options.parallelChunkUploads) { + for (var i = 0; i < file.upload.totalChunkCount; i++) { + handleNextChunk(); } - } - updateProgress(); - if (!((200 <= (_ref = xhr.status) && _ref < 300))) { - return handleError(); } else { - return _this._finished(files, response, e); + handleNextChunk(); } - }; - })(this); - xhr.onerror = (function(_this) { - return function() { - if (files[0].status === Dropzone.CANCELED) { - return; + } else { + var dataBlocks = []; + for (var _i23 = 0; _i23 < files.length; _i23++) { + dataBlocks[_i23] = { + name: _this14._getParamName(_i23), + data: transformedFiles[_i23], + filename: files[_i23].upload.filename + }; } - return handleError(); - }; - })(this); - progressObj = (_ref = xhr.upload) != null ? _ref : xhr; - progressObj.onprogress = updateProgress; - headers = { + _this14._uploadData(files, dataBlocks); + } + }); + } + + /// Returns the right chunk for given file and xhr + + }, { + key: "_getChunk", + value: function _getChunk(file, xhr) { + for (var i = 0; i < file.upload.totalChunkCount; i++) { + if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) { + return file.upload.chunks[i]; + } + } + } + + // This function actually uploads the file(s) to the server. + // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed + // files, or individual chunks for chunked upload). + + }, { + key: "_uploadData", + value: function _uploadData(files, dataBlocks) { + var _this15 = this; + + var xhr = new XMLHttpRequest(); + + // Put the xhr object in the file objects to be able to reference it later. + for (var _iterator22 = files, _isArray22 = true, _i24 = 0, _iterator22 = _isArray22 ? _iterator22 : _iterator22[Symbol.iterator]();;) { + var _ref21; + + if (_isArray22) { + if (_i24 >= _iterator22.length) break; + _ref21 = _iterator22[_i24++]; + } else { + _i24 = _iterator22.next(); + if (_i24.done) break; + _ref21 = _i24.value; + } + + var file = _ref21; + + file.xhr = xhr; + } + if (files[0].upload.chunked) { + // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk + files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr; + } + + var method = this.resolveOption(this.options.method, files); + var url = this.resolveOption(this.options.url, files); + xhr.open(method, url, true); + + // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8 + xhr.timeout = this.resolveOption(this.options.timeout, files); + + // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179 + xhr.withCredentials = !!this.options.withCredentials; + + xhr.onload = function (e) { + _this15._finishedUploading(files, xhr, e); + }; + + xhr.onerror = function () { + _this15._handleUploadError(files, xhr); + }; + + // Some browsers do not have the .upload property + var progressObj = xhr.upload != null ? xhr.upload : xhr; + progressObj.onprogress = function (e) { + return _this15._updateFilesUploadProgress(files, xhr, e); + }; + + var headers = { "Accept": "application/json", "Cache-Control": "no-cache", "X-Requested-With": "XMLHttpRequest" }; + if (this.options.headers) { - extend(headers, this.options.headers); + Dropzone.extend(headers, this.options.headers); } - for (headerName in headers) { - headerValue = headers[headerName]; - xhr.setRequestHeader(headerName, headerValue); + + for (var headerName in headers) { + var headerValue = headers[headerName]; + if (headerValue) { + xhr.setRequestHeader(headerName, headerValue); + } } - formData = new FormData(); + + var formData = new FormData(); + + // Adding all @options parameters if (this.options.params) { - _ref1 = this.options.params; - for (key in _ref1) { - value = _ref1[key]; + var additionalParams = this.options.params; + if (typeof additionalParams === 'function') { + additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null); + } + + for (var key in additionalParams) { + var value = additionalParams[key]; formData.append(key, value); } } - for (_j = 0, _len1 = files.length; _j < _len1; _j++) { - file = files[_j]; - this.emit("sending", file, xhr, formData); + + // Let the user add additional data if necessary + for (var _iterator23 = files, _isArray23 = true, _i25 = 0, _iterator23 = _isArray23 ? _iterator23 : _iterator23[Symbol.iterator]();;) { + var _ref22; + + if (_isArray23) { + if (_i25 >= _iterator23.length) break; + _ref22 = _iterator23[_i25++]; + } else { + _i25 = _iterator23.next(); + if (_i25.done) break; + _ref22 = _i25.value; + } + + var _file = _ref22; + + this.emit("sending", _file, xhr, formData); } if (this.options.uploadMultiple) { this.emit("sendingmultiple", files, xhr, formData); } + + this._addFormElementData(formData); + + // Finally add the files + // Has to be last because some servers (eg: S3) expect the file to be the last parameter + for (var i = 0; i < dataBlocks.length; i++) { + var dataBlock = dataBlocks[i]; + formData.append(dataBlock.name, dataBlock.data, dataBlock.filename); + } + + this.submitRequest(xhr, formData, files); + } + + // Transforms all files with this.options.transformFile and invokes done with the transformed files when done. + + }, { + key: "_transformFiles", + value: function _transformFiles(files, done) { + var _this16 = this; + + var transformedFiles = []; + // Clumsy way of handling asynchronous calls, until I get to add a proper Future library. + var doneCounter = 0; + + var _loop = function _loop(i) { + _this16.options.transformFile.call(_this16, files[i], function (transformedFile) { + transformedFiles[i] = transformedFile; + if (++doneCounter === files.length) { + done(transformedFiles); + } + }); + }; + + for (var i = 0; i < files.length; i++) { + _loop(i); + } + } + + // Takes care of adding other input elements of the form to the AJAX request + + }, { + key: "_addFormElementData", + value: function _addFormElementData(formData) { + // Take care of other input elements if (this.element.tagName === "FORM") { - _ref2 = this.element.querySelectorAll("input, textarea, select, button"); - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - input = _ref2[_k]; - inputName = input.getAttribute("name"); - inputType = input.getAttribute("type"); + for (var _iterator24 = this.element.querySelectorAll("input, textarea, select, button"), _isArray24 = true, _i26 = 0, _iterator24 = _isArray24 ? _iterator24 : _iterator24[Symbol.iterator]();;) { + var _ref23; + + if (_isArray24) { + if (_i26 >= _iterator24.length) break; + _ref23 = _iterator24[_i26++]; + } else { + _i26 = _iterator24.next(); + if (_i26.done) break; + _ref23 = _i26.value; + } + + var input = _ref23; + + var inputName = input.getAttribute("name"); + var inputType = input.getAttribute("type"); + if (inputType) inputType = inputType.toLowerCase(); + + // If the input doesn't have a name, we can't use it. + if (typeof inputName === 'undefined' || inputName === null) continue; + if (input.tagName === "SELECT" && input.hasAttribute("multiple")) { - _ref3 = input.options; - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - option = _ref3[_l]; + // Possibly multiple values + for (var _iterator25 = input.options, _isArray25 = true, _i27 = 0, _iterator25 = _isArray25 ? _iterator25 : _iterator25[Symbol.iterator]();;) { + var _ref24; + + if (_isArray25) { + if (_i27 >= _iterator25.length) break; + _ref24 = _iterator25[_i27++]; + } else { + _i27 = _iterator25.next(); + if (_i27.done) break; + _ref24 = _i27.value; + } + + var option = _ref24; + if (option.selected) { formData.append(inputName, option.value); } } - } else if (!inputType || ((_ref4 = inputType.toLowerCase()) !== "checkbox" && _ref4 !== "radio") || input.checked) { + } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) { formData.append(inputName, input.value); } } } - for (i = _m = 0, _ref5 = files.length - 1; 0 <= _ref5 ? _m <= _ref5 : _m >= _ref5; i = 0 <= _ref5 ? ++_m : --_m) { - formData.append(this._getParamName(i), files[i], files[i].name); + } + + // Invoked when there is new progress information about given files. + // If e is not provided, it is assumed that the upload is finished. + + }, { + key: "_updateFilesUploadProgress", + value: function _updateFilesUploadProgress(files, xhr, e) { + var progress = void 0; + if (typeof e !== 'undefined') { + progress = 100 * e.loaded / e.total; + + if (files[0].upload.chunked) { + var file = files[0]; + // Since this is a chunked upload, we need to update the appropriate chunk progress. + var chunk = this._getChunk(file, xhr); + chunk.progress = progress; + chunk.total = e.total; + chunk.bytesSent = e.loaded; + var fileProgress = 0, + fileTotal = void 0, + fileBytesSent = void 0; + file.upload.progress = 0; + file.upload.total = 0; + file.upload.bytesSent = 0; + for (var i = 0; i < file.upload.totalChunkCount; i++) { + if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].progress !== undefined) { + file.upload.progress += file.upload.chunks[i].progress; + file.upload.total += file.upload.chunks[i].total; + file.upload.bytesSent += file.upload.chunks[i].bytesSent; + } + } + file.upload.progress = file.upload.progress / file.upload.totalChunkCount; + } else { + for (var _iterator26 = files, _isArray26 = true, _i28 = 0, _iterator26 = _isArray26 ? _iterator26 : _iterator26[Symbol.iterator]();;) { + var _ref25; + + if (_isArray26) { + if (_i28 >= _iterator26.length) break; + _ref25 = _iterator26[_i28++]; + } else { + _i28 = _iterator26.next(); + if (_i28.done) break; + _ref25 = _i28.value; + } + + var _file2 = _ref25; + + _file2.upload.progress = progress; + _file2.upload.total = e.total; + _file2.upload.bytesSent = e.loaded; + } + } + for (var _iterator27 = files, _isArray27 = true, _i29 = 0, _iterator27 = _isArray27 ? _iterator27 : _iterator27[Symbol.iterator]();;) { + var _ref26; + + if (_isArray27) { + if (_i29 >= _iterator27.length) break; + _ref26 = _iterator27[_i29++]; + } else { + _i29 = _iterator27.next(); + if (_i29.done) break; + _ref26 = _i29.value; + } + + var _file3 = _ref26; + + this.emit("uploadprogress", _file3, _file3.upload.progress, _file3.upload.bytesSent); + } + } else { + // Called when the file finished uploading + + var allFilesFinished = true; + + progress = 100; + + for (var _iterator28 = files, _isArray28 = true, _i30 = 0, _iterator28 = _isArray28 ? _iterator28 : _iterator28[Symbol.iterator]();;) { + var _ref27; + + if (_isArray28) { + if (_i30 >= _iterator28.length) break; + _ref27 = _iterator28[_i30++]; + } else { + _i30 = _iterator28.next(); + if (_i30.done) break; + _ref27 = _i30.value; + } + + var _file4 = _ref27; + + if (_file4.upload.progress !== 100 || _file4.upload.bytesSent !== _file4.upload.total) { + allFilesFinished = false; + } + _file4.upload.progress = progress; + _file4.upload.bytesSent = _file4.upload.total; + } + + // Nothing to do, all files already at 100% + if (allFilesFinished) { + return; + } + + for (var _iterator29 = files, _isArray29 = true, _i31 = 0, _iterator29 = _isArray29 ? _iterator29 : _iterator29[Symbol.iterator]();;) { + var _ref28; + + if (_isArray29) { + if (_i31 >= _iterator29.length) break; + _ref28 = _iterator29[_i31++]; + } else { + _i31 = _iterator29.next(); + if (_i31.done) break; + _ref28 = _i31.value; + } + + var _file5 = _ref28; + + this.emit("uploadprogress", _file5, progress, _file5.upload.bytesSent); + } } - return xhr.send(formData); - }; + } + }, { + key: "_finishedUploading", + value: function _finishedUploading(files, xhr, e) { + var response = void 0; + + if (files[0].status === Dropzone.CANCELED) { + return; + } + + if (xhr.readyState !== 4) { + return; + } + + if (xhr.responseType !== 'arraybuffer' && xhr.responseType !== 'blob') { + response = xhr.responseText; + + if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) { + try { + response = JSON.parse(response); + } catch (error) { + e = error; + response = "Invalid JSON response from server."; + } + } + } + + this._updateFilesUploadProgress(files); + + if (!(200 <= xhr.status && xhr.status < 300)) { + this._handleUploadError(files, xhr, response); + } else { + if (files[0].upload.chunked) { + files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr)); + } else { + this._finished(files, response, e); + } + } + } + }, { + key: "_handleUploadError", + value: function _handleUploadError(files, xhr, response) { + if (files[0].status === Dropzone.CANCELED) { + return; + } + + if (files[0].upload.chunked && this.options.retryChunks) { + var chunk = this._getChunk(files[0], xhr); + if (chunk.retries++ < this.options.retryChunksLimit) { + this._uploadData(files, [chunk.dataBlock]); + return; + } else { + console.warn('Retried this chunk too often. Giving up.'); + } + } + + for (var _iterator30 = files, _isArray30 = true, _i32 = 0, _iterator30 = _isArray30 ? _iterator30 : _iterator30[Symbol.iterator]();;) { + var _ref29; + + if (_isArray30) { + if (_i32 >= _iterator30.length) break; + _ref29 = _iterator30[_i32++]; + } else { + _i32 = _iterator30.next(); + if (_i32.done) break; + _ref29 = _i32.value; + } + + var file = _ref29; + + this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr); + } + } + }, { + key: "submitRequest", + value: function submitRequest(xhr, formData, files) { + xhr.send(formData); + } + + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + + }, { + key: "_finished", + value: function _finished(files, responseText, e) { + for (var _iterator31 = files, _isArray31 = true, _i33 = 0, _iterator31 = _isArray31 ? _iterator31 : _iterator31[Symbol.iterator]();;) { + var _ref30; + + if (_isArray31) { + if (_i33 >= _iterator31.length) break; + _ref30 = _iterator31[_i33++]; + } else { + _i33 = _iterator31.next(); + if (_i33.done) break; + _ref30 = _i33.value; + } + + var file = _ref30; - Dropzone.prototype._finished = function(files, responseText, e) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; file.status = Dropzone.SUCCESS; this.emit("success", file, responseText, e); this.emit("complete", file); @@ -1359,15 +2809,32 @@ this.emit("successmultiple", files, responseText, e); this.emit("completemultiple", files); } + if (this.options.autoProcessQueue) { return this.processQueue(); } - }; + } + + // Called internally when processing is finished. + // Individual callbacks have to be called in the appropriate sections. + + }, { + key: "_errorProcessing", + value: function _errorProcessing(files, message, xhr) { + for (var _iterator32 = files, _isArray32 = true, _i34 = 0, _iterator32 = _isArray32 ? _iterator32 : _iterator32[Symbol.iterator]();;) { + var _ref31; + + if (_isArray32) { + if (_i34 >= _iterator32.length) break; + _ref31 = _iterator32[_i34++]; + } else { + _i34 = _iterator32.next(); + if (_i34.done) break; + _ref31 = _i34.value; + } + + var file = _ref31; - Dropzone.prototype._errorProcessing = function(files, message, xhr) { - var file, _i, _len; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; file.status = Dropzone.ERROR; this.emit("error", file, message, xhr); this.emit("complete", file); @@ -1376,353 +2843,688 @@ this.emit("errormultiple", files, message, xhr); this.emit("completemultiple", files); } + if (this.options.autoProcessQueue) { return this.processQueue(); } - }; - - return Dropzone; - - })(Emitter); - - Dropzone.version = "4.0.1"; + } + }], [{ + key: "uuidv4", + value: function uuidv4() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c === 'x' ? r : r & 0x3 | 0x8; + return v.toString(16); + }); + } + }]); + + return Dropzone; +}(Emitter); + +Dropzone.initClass(); + +Dropzone.version = "5.5.0"; + +// This is a map of options for your different dropzones. Add configurations +// to this object for your different dropzone elemens. +// +// Example: +// +// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 }; +// +// To disable autoDiscover for a specific element, you can set `false` as an option: +// +// Dropzone.options.myDisabledElementId = false; +// +// And in html: +// +//
+Dropzone.options = {}; + +// Returns the options for an element or undefined if none available. +Dropzone.optionsForElement = function (element) { + // Get the `Dropzone.options.elementId` for this element if it exists + if (element.getAttribute("id")) { + return Dropzone.options[camelize(element.getAttribute("id"))]; + } else { + return undefined; + } +}; - Dropzone.options = {}; +// Holds a list of all dropzone instances +Dropzone.instances = []; - Dropzone.optionsForElement = function(element) { - if (element.getAttribute("id")) { - return Dropzone.options[camelize(element.getAttribute("id"))]; - } else { - return void 0; - } - }; +// Returns the dropzone for given element if any +Dropzone.forElement = function (element) { + if (typeof element === "string") { + element = document.querySelector(element); + } + if ((element != null ? element.dropzone : undefined) == null) { + throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); + } + return element.dropzone; +}; - Dropzone.instances = []; +// Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements. +Dropzone.autoDiscover = true; - Dropzone.forElement = function(element) { - if (typeof element === "string") { - element = document.querySelector(element); - } - if ((element != null ? element.dropzone : void 0) == null) { - throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone."); - } - return element.dropzone; - }; +// Looks for all .dropzone elements and creates a dropzone for them +Dropzone.discover = function () { + var dropzones = void 0; + if (document.querySelectorAll) { + dropzones = document.querySelectorAll(".dropzone"); + } else { + dropzones = []; + // IE :( + var checkElements = function checkElements(elements) { + return function () { + var result = []; + for (var _iterator33 = elements, _isArray33 = true, _i35 = 0, _iterator33 = _isArray33 ? _iterator33 : _iterator33[Symbol.iterator]();;) { + var _ref32; + + if (_isArray33) { + if (_i35 >= _iterator33.length) break; + _ref32 = _iterator33[_i35++]; + } else { + _i35 = _iterator33.next(); + if (_i35.done) break; + _ref32 = _i35.value; + } - Dropzone.autoDiscover = true; + var el = _ref32; - Dropzone.discover = function() { - var checkElements, dropzone, dropzones, _i, _len, _results; - if (document.querySelectorAll) { - dropzones = document.querySelectorAll(".dropzone"); - } else { - dropzones = []; - checkElements = function(elements) { - var el, _i, _len, _results; - _results = []; - for (_i = 0, _len = elements.length; _i < _len; _i++) { - el = elements[_i]; if (/(^| )dropzone($| )/.test(el.className)) { - _results.push(dropzones.push(el)); + result.push(dropzones.push(el)); } else { - _results.push(void 0); + result.push(undefined); } } - return _results; - }; - checkElements(document.getElementsByTagName("div")); - checkElements(document.getElementsByTagName("form")); - } - _results = []; - for (_i = 0, _len = dropzones.length; _i < _len; _i++) { - dropzone = dropzones[_i]; - if (Dropzone.optionsForElement(dropzone) !== false) { - _results.push(new Dropzone(dropzone)); + return result; + }(); + }; + checkElements(document.getElementsByTagName("div")); + checkElements(document.getElementsByTagName("form")); + } + + return function () { + var result = []; + for (var _iterator34 = dropzones, _isArray34 = true, _i36 = 0, _iterator34 = _isArray34 ? _iterator34 : _iterator34[Symbol.iterator]();;) { + var _ref33; + + if (_isArray34) { + if (_i36 >= _iterator34.length) break; + _ref33 = _iterator34[_i36++]; } else { - _results.push(void 0); + _i36 = _iterator34.next(); + if (_i36.done) break; + _ref33 = _i36.value; } - } - return _results; - }; - Dropzone.blacklistedBrowsers = [/opera.*Macintosh.*version\/12/i]; + var dropzone = _ref33; - Dropzone.isBrowserSupported = function() { - var capableBrowser, regex, _i, _len, _ref; - capableBrowser = true; - if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) { - if (!("classList" in document.createElement("a"))) { - capableBrowser = false; + // Create a dropzone unless auto discover has been disabled for specific element + if (Dropzone.optionsForElement(dropzone) !== false) { + result.push(new Dropzone(dropzone)); } else { - _ref = Dropzone.blacklistedBrowsers; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - regex = _ref[_i]; - if (regex.test(navigator.userAgent)) { - capableBrowser = false; - continue; - } - } + result.push(undefined); } - } else { - capableBrowser = false; } - return capableBrowser; - }; + return result; + }(); +}; + +// Since the whole Drag'n'Drop API is pretty new, some browsers implement it, +// but not correctly. +// So I created a blacklist of userAgents. Yes, yes. Browser sniffing, I know. +// But what to do when browsers *theoretically* support an API, but crash +// when using it. +// +// This is a list of regular expressions tested against navigator.userAgent +// +// ** It should only be used on browser that *do* support the API, but +// incorrectly ** +// +Dropzone.blacklistedBrowsers = [ +// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API. +/opera.*(Macintosh|Windows Phone).*version\/12/i]; + +// Checks if the browser is supported +Dropzone.isBrowserSupported = function () { + var capableBrowser = true; + + if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) { + if (!("classList" in document.createElement("a"))) { + capableBrowser = false; + } else { + // The browser supports the API, but may be blacklisted. + for (var _iterator35 = Dropzone.blacklistedBrowsers, _isArray35 = true, _i37 = 0, _iterator35 = _isArray35 ? _iterator35 : _iterator35[Symbol.iterator]();;) { + var _ref34; + + if (_isArray35) { + if (_i37 >= _iterator35.length) break; + _ref34 = _iterator35[_i37++]; + } else { + _i37 = _iterator35.next(); + if (_i37.done) break; + _ref34 = _i37.value; + } + + var regex = _ref34; - without = function(list, rejectedItem) { - var item, _i, _len, _results; - _results = []; - for (_i = 0, _len = list.length; _i < _len; _i++) { - item = list[_i]; - if (item !== rejectedItem) { - _results.push(item); + if (regex.test(navigator.userAgent)) { + capableBrowser = false; + continue; + } } } - return _results; - }; + } else { + capableBrowser = false; + } - camelize = function(str) { - return str.replace(/[\-_](\w)/g, function(match) { - return match.charAt(1).toUpperCase(); - }); - }; + return capableBrowser; +}; - Dropzone.createElement = function(string) { - var div; - div = document.createElement("div"); - div.innerHTML = string; - return div.childNodes[0]; - }; +Dropzone.dataURItoBlob = function (dataURI) { + // convert base64 to raw binary data held in a string + // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this + var byteString = atob(dataURI.split(',')[1]); + + // separate out the mime component + var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; + + // write the bytes of the string to an ArrayBuffer + var ab = new ArrayBuffer(byteString.length); + var ia = new Uint8Array(ab); + for (var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) { + ia[i] = byteString.charCodeAt(i); + } - Dropzone.elementInside = function(element, container) { + // write the ArrayBuffer to a blob + return new Blob([ab], { type: mimeString }); +}; + +// Returns an array without the rejected item +var without = function without(list, rejectedItem) { + return list.filter(function (item) { + return item !== rejectedItem; + }).map(function (item) { + return item; + }); +}; + +// abc-def_ghi -> abcDefGhi +var camelize = function camelize(str) { + return str.replace(/[\-_](\w)/g, function (match) { + return match.charAt(1).toUpperCase(); + }); +}; + +// Creates an element from string +Dropzone.createElement = function (string) { + var div = document.createElement("div"); + div.innerHTML = string; + return div.childNodes[0]; +}; + +// Tests if given element is inside (or simply is) the container +Dropzone.elementInside = function (element, container) { + if (element === container) { + return true; + } // Coffeescript doesn't support do/while loops + while (element = element.parentNode) { if (element === container) { return true; } - while (element = element.parentNode) { - if (element === container) { - return true; + } + return false; +}; + +Dropzone.getElement = function (el, name) { + var element = void 0; + if (typeof el === "string") { + element = document.querySelector(el); + } else if (el.nodeType != null) { + element = el; + } + if (element == null) { + throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element."); + } + return element; +}; + +Dropzone.getElements = function (els, name) { + var el = void 0, + elements = void 0; + if (els instanceof Array) { + elements = []; + try { + for (var _iterator36 = els, _isArray36 = true, _i38 = 0, _iterator36 = _isArray36 ? _iterator36 : _iterator36[Symbol.iterator]();;) { + if (_isArray36) { + if (_i38 >= _iterator36.length) break; + el = _iterator36[_i38++]; + } else { + _i38 = _iterator36.next(); + if (_i38.done) break; + el = _i38.value; + } + + elements.push(this.getElement(el, name)); } + } catch (e) { + elements = null; } - return false; - }; + } else if (typeof els === "string") { + elements = []; + for (var _iterator37 = document.querySelectorAll(els), _isArray37 = true, _i39 = 0, _iterator37 = _isArray37 ? _iterator37 : _iterator37[Symbol.iterator]();;) { + if (_isArray37) { + if (_i39 >= _iterator37.length) break; + el = _iterator37[_i39++]; + } else { + _i39 = _iterator37.next(); + if (_i39.done) break; + el = _i39.value; + } - Dropzone.getElement = function(el, name) { - var element; - if (typeof el === "string") { - element = document.querySelector(el); - } else if (el.nodeType != null) { - element = el; + elements.push(el); } - if (element == null) { - throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element."); + } else if (els.nodeType != null) { + elements = [els]; + } + + if (elements == null || !elements.length) { + throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those."); + } + + return elements; +}; + +// Asks the user the question and calls accepted or rejected accordingly +// +// The default implementation just uses `window.confirm` and then calls the +// appropriate callback. +Dropzone.confirm = function (question, accepted, rejected) { + if (window.confirm(question)) { + return accepted(); + } else if (rejected != null) { + return rejected(); + } +}; + +// Validates the mime type like this: +// +// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept +Dropzone.isValidFile = function (file, acceptedFiles) { + if (!acceptedFiles) { + return true; + } // If there are no accepted mime types, it's OK + acceptedFiles = acceptedFiles.split(","); + + var mimeType = file.type; + var baseMimeType = mimeType.replace(/\/.*$/, ""); + + for (var _iterator38 = acceptedFiles, _isArray38 = true, _i40 = 0, _iterator38 = _isArray38 ? _iterator38 : _iterator38[Symbol.iterator]();;) { + var _ref35; + + if (_isArray38) { + if (_i40 >= _iterator38.length) break; + _ref35 = _iterator38[_i40++]; + } else { + _i40 = _iterator38.next(); + if (_i40.done) break; + _ref35 = _i40.value; } - return element; - }; - Dropzone.getElements = function(els, name) { - var e, el, elements, _i, _j, _len, _len1, _ref; - if (els instanceof Array) { - elements = []; - try { - for (_i = 0, _len = els.length; _i < _len; _i++) { - el = els[_i]; - elements.push(this.getElement(el, name)); - } - } catch (_error) { - e = _error; - elements = null; + var validType = _ref35; + + validType = validType.trim(); + if (validType.charAt(0) === ".") { + if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) { + return true; } - } else if (typeof els === "string") { - elements = []; - _ref = document.querySelectorAll(els); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - el = _ref[_j]; - elements.push(el); + } else if (/\/\*$/.test(validType)) { + // This is something like a image/* mime type + if (baseMimeType === validType.replace(/\/.*$/, "")) { + return true; + } + } else { + if (mimeType === validType) { + return true; } - } else if (els.nodeType != null) { - elements = [els]; - } - if (!((elements != null) && elements.length)) { - throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those."); } - return elements; - }; + } - Dropzone.confirm = function(question, accepted, rejected) { - if (window.confirm(question)) { - return accepted(); - } else if (rejected != null) { - return rejected(); - } - }; + return false; +}; - Dropzone.isValidFile = function(file, acceptedFiles) { - var baseMimeType, mimeType, validType, _i, _len; - if (!acceptedFiles) { - return true; - } - acceptedFiles = acceptedFiles.split(","); - mimeType = file.type; - baseMimeType = mimeType.replace(/\/.*$/, ""); - for (_i = 0, _len = acceptedFiles.length; _i < _len; _i++) { - validType = acceptedFiles[_i]; - validType = validType.trim(); - if (validType.charAt(0) === ".") { - if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) { - return true; - } - } else if (/\/\*$/.test(validType)) { - if (baseMimeType === validType.replace(/\/.*$/, "")) { - return true; - } - } else { - if (mimeType === validType) { - return true; - } - } - } - return false; +// Augment jQuery +if (typeof jQuery !== 'undefined' && jQuery !== null) { + jQuery.fn.dropzone = function (options) { + return this.each(function () { + return new Dropzone(this, options); + }); }; +} - if (typeof jQuery !== "undefined" && jQuery !== null) { - jQuery.fn.dropzone = function(options) { - return this.each(function() { - return new Dropzone(this, options); - }); - }; - } +if (typeof module !== 'undefined' && module !== null) { + module.exports = Dropzone; +} else { + window.Dropzone = Dropzone; +} - if (typeof module !== "undefined" && module !== null) { - module.exports = Dropzone; - } else { - window.Dropzone = Dropzone; - } +// Dropzone file status codes +Dropzone.ADDED = "added"; - Dropzone.ADDED = "added"; +Dropzone.QUEUED = "queued"; +// For backwards compatibility. Now, if a file is accepted, it's either queued +// or uploading. +Dropzone.ACCEPTED = Dropzone.QUEUED; - Dropzone.QUEUED = "queued"; +Dropzone.UPLOADING = "uploading"; +Dropzone.PROCESSING = Dropzone.UPLOADING; // alias - Dropzone.ACCEPTED = Dropzone.QUEUED; +Dropzone.CANCELED = "canceled"; +Dropzone.ERROR = "error"; +Dropzone.SUCCESS = "success"; - Dropzone.UPLOADING = "uploading"; +/* - Dropzone.PROCESSING = Dropzone.UPLOADING; + Bugfix for iOS 6 and 7 + Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios + based on the work of https://github.com/stomita/ios-imagefile-megapixel - Dropzone.CANCELED = "canceled"; + */ - Dropzone.ERROR = "error"; +// Detecting vertical squash in loaded image. +// Fixes a bug which squash image vertically while drawing into canvas for some images. +// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel +var detectVerticalSquash = function detectVerticalSquash(img) { + var iw = img.naturalWidth; + var ih = img.naturalHeight; + var canvas = document.createElement("canvas"); + canvas.width = 1; + canvas.height = ih; + var ctx = canvas.getContext("2d"); + ctx.drawImage(img, 0, 0); - Dropzone.SUCCESS = "success"; + var _ctx$getImageData = ctx.getImageData(1, 0, 1, ih), + data = _ctx$getImageData.data; + // search image edge pixel position in case it is squashed vertically. - /* - - Bugfix for iOS 6 and 7 - Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios - based on the work of https://github.com/stomita/ios-imagefile-megapixel - */ - detectVerticalSquash = function(img) { - var alpha, canvas, ctx, data, ey, ih, iw, py, ratio, sy; - iw = img.naturalWidth; - ih = img.naturalHeight; - canvas = document.createElement("canvas"); - canvas.width = 1; - canvas.height = ih; - ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - data = ctx.getImageData(0, 0, 1, ih).data; - sy = 0; - ey = ih; - py = ih; - while (py > sy) { - alpha = data[(py - 1) * 4 + 3]; - if (alpha === 0) { - ey = py; - } else { - sy = py; - } - py = (ey + sy) >> 1; - } - ratio = py / ih; - if (ratio === 0) { - return 1; + var sy = 0; + var ey = ih; + var py = ih; + while (py > sy) { + var alpha = data[(py - 1) * 4 + 3]; + + if (alpha === 0) { + ey = py; } else { - return ratio; + sy = py; } - }; - drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { - var vertSquashRatio; - vertSquashRatio = detectVerticalSquash(img); - return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); - }; + py = ey + sy >> 1; + } + var ratio = py / ih; + if (ratio === 0) { + return 1; + } else { + return ratio; + } +}; + +// A replacement for context.drawImage +// (args are for source and destination). +var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) { + var vertSquashRatio = detectVerticalSquash(img); + return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio); +}; + +// Based on MinifyJpeg +// Source: http://www.perry.cz/files/ExifRestorer.js +// http://elicon.blog57.fc2.com/blog-entry-206.html + +var ExifRestore = function () { + function ExifRestore() { + _classCallCheck(this, ExifRestore); + } - /* - * contentloaded.js - * - * Author: Diego Perini (diego.perini at gmail.com) - * Summary: cross-browser wrapper for DOMContentLoaded - * Updated: 20101020 - * License: MIT - * Version: 1.2 - * - * URL: - * http://javascript.nwbox.com/ContentLoaded/ - * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE - */ - - contentLoaded = function(win, fn) { - var add, doc, done, init, poll, pre, rem, root, top; - done = false; - top = true; - doc = win.document; - root = doc.documentElement; - add = (doc.addEventListener ? "addEventListener" : "attachEvent"); - rem = (doc.addEventListener ? "removeEventListener" : "detachEvent"); - pre = (doc.addEventListener ? "" : "on"); - init = function(e) { - if (e.type === "readystatechange" && doc.readyState !== "complete") { - return; + _createClass(ExifRestore, null, [{ + key: "initClass", + value: function initClass() { + this.KEY_STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + } + }, { + key: "encode64", + value: function encode64(input) { + var output = ''; + var chr1 = undefined; + var chr2 = undefined; + var chr3 = ''; + var enc1 = undefined; + var enc2 = undefined; + var enc3 = undefined; + var enc4 = ''; + var i = 0; + while (true) { + chr1 = input[i++]; + chr2 = input[i++]; + chr3 = input[i++]; + enc1 = chr1 >> 2; + enc2 = (chr1 & 3) << 4 | chr2 >> 4; + enc3 = (chr2 & 15) << 2 | chr3 >> 6; + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4); + chr1 = chr2 = chr3 = ''; + enc1 = enc2 = enc3 = enc4 = ''; + if (!(i < input.length)) { + break; + } } - (e.type === "load" ? win : doc)[rem](pre + e.type, init, false); - if (!done && (done = true)) { - return fn.call(win, e.type || e); + return output; + } + }, { + key: "restore", + value: function restore(origFileBase64, resizedFileBase64) { + if (!origFileBase64.match('data:image/jpeg;base64,')) { + return resizedFileBase64; + } + var rawImage = this.decode64(origFileBase64.replace('data:image/jpeg;base64,', '')); + var segments = this.slice2Segments(rawImage); + var image = this.exifManipulation(resizedFileBase64, segments); + return "data:image/jpeg;base64," + this.encode64(image); + } + }, { + key: "exifManipulation", + value: function exifManipulation(resizedFileBase64, segments) { + var exifArray = this.getExifArray(segments); + var newImageArray = this.insertExif(resizedFileBase64, exifArray); + var aBuffer = new Uint8Array(newImageArray); + return aBuffer; + } + }, { + key: "getExifArray", + value: function getExifArray(segments) { + var seg = undefined; + var x = 0; + while (x < segments.length) { + seg = segments[x]; + if (seg[0] === 255 & seg[1] === 225) { + return seg; + } + x++; } - }; - poll = function() { - var e; - try { - root.doScroll("left"); - } catch (_error) { - e = _error; - setTimeout(poll, 50); - return; + return []; + } + }, { + key: "insertExif", + value: function insertExif(resizedFileBase64, exifArray) { + var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', ''); + var buf = this.decode64(imageData); + var separatePoint = buf.indexOf(255, 3); + var mae = buf.slice(0, separatePoint); + var ato = buf.slice(separatePoint); + var array = mae; + array = array.concat(exifArray); + array = array.concat(ato); + return array; + } + }, { + key: "slice2Segments", + value: function slice2Segments(rawImageArray) { + var head = 0; + var segments = []; + while (true) { + var length; + if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) { + break; + } + if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) { + head += 2; + } else { + length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3]; + var endPoint = head + length + 2; + var seg = rawImageArray.slice(head, endPoint); + segments.push(seg); + head = endPoint; + } + if (head > rawImageArray.length) { + break; + } } - return init("poll"); - }; - if (doc.readyState !== "complete") { - if (doc.createEventObject && root.doScroll) { - try { - top = !win.frameElement; - } catch (_error) {} - if (top) { - poll(); + return segments; + } + }, { + key: "decode64", + value: function decode64(input) { + var output = ''; + var chr1 = undefined; + var chr2 = undefined; + var chr3 = ''; + var enc1 = undefined; + var enc2 = undefined; + var enc3 = undefined; + var enc4 = ''; + var i = 0; + var buf = []; + // remove all characters that are not A-Z, a-z, 0-9, +, /, or = + var base64test = /[^A-Za-z0-9\+\/\=]/g; + if (base64test.exec(input)) { + console.warn('There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, \'+\', \'/\',and \'=\'\nExpect errors in decoding.'); + } + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); + while (true) { + enc1 = this.KEY_STR.indexOf(input.charAt(i++)); + enc2 = this.KEY_STR.indexOf(input.charAt(i++)); + enc3 = this.KEY_STR.indexOf(input.charAt(i++)); + enc4 = this.KEY_STR.indexOf(input.charAt(i++)); + chr1 = enc1 << 2 | enc2 >> 4; + chr2 = (enc2 & 15) << 4 | enc3 >> 2; + chr3 = (enc3 & 3) << 6 | enc4; + buf.push(chr1); + if (enc3 !== 64) { + buf.push(chr2); + } + if (enc4 !== 64) { + buf.push(chr3); + } + chr1 = chr2 = chr3 = ''; + enc1 = enc2 = enc3 = enc4 = ''; + if (!(i < input.length)) { + break; } } - doc[add](pre + "DOMContentLoaded", init, false); - doc[add](pre + "readystatechange", init, false); - return win[add](pre + "load", init, false); + return buf; + } + }]); + + return ExifRestore; +}(); + +ExifRestore.initClass(); + +/* + * contentloaded.js + * + * Author: Diego Perini (diego.perini at gmail.com) + * Summary: cross-browser wrapper for DOMContentLoaded + * Updated: 20101020 + * License: MIT + * Version: 1.2 + * + * URL: + * http://javascript.nwbox.com/ContentLoaded/ + * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE + */ + +// @win window reference +// @fn function reference +var contentLoaded = function contentLoaded(win, fn) { + var done = false; + var top = true; + var doc = win.document; + var root = doc.documentElement; + var add = doc.addEventListener ? "addEventListener" : "attachEvent"; + var rem = doc.addEventListener ? "removeEventListener" : "detachEvent"; + var pre = doc.addEventListener ? "" : "on"; + var init = function init(e) { + if (e.type === "readystatechange" && doc.readyState !== "complete") { + return; + } + (e.type === "load" ? win : doc)[rem](pre + e.type, init, false); + if (!done && (done = true)) { + return fn.call(win, e.type || e); } }; - Dropzone._autoDiscoverFunction = function() { - if (Dropzone.autoDiscover) { - return Dropzone.discover(); + var poll = function poll() { + try { + root.doScroll("left"); + } catch (e) { + setTimeout(poll, 50); + return; } + return init("poll"); }; - contentLoaded(window, Dropzone._autoDiscoverFunction); + if (doc.readyState !== "complete") { + if (doc.createEventObject && root.doScroll) { + try { + top = !win.frameElement; + } catch (error) {} + if (top) { + poll(); + } + } + doc[add](pre + "DOMContentLoaded", init, false); + doc[add](pre + "readystatechange", init, false); + return win[add](pre + "load", init, false); + } +}; -}).call(this); +// As a single function to be able to write tests. +Dropzone._autoDiscoverFunction = function () { + if (Dropzone.autoDiscover) { + return Dropzone.discover(); + } +}; +contentLoaded(window, Dropzone._autoDiscoverFunction); + +function __guard__(value, transform) { + return typeof value !== 'undefined' && value !== null ? transform(value) : undefined; +} +function __guardMethod__(obj, methodName, transform) { + if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') { + return transform(obj, methodName); + } else { + return undefined; + } +} diff --git a/Resources/public/js/vendor/galleria/galleria-1.4.5.min.js b/Resources/public/js/vendor/galleria/galleria-1.4.5.min.js deleted file mode 100644 index 3248f8ef..00000000 --- a/Resources/public/js/vendor/galleria/galleria-1.4.5.min.js +++ /dev/null @@ -1,3 +0,0 @@ -(function($,window,Galleria,undef){var doc=window.document,$doc=$(doc),$win=$(window),protoArray=Array.prototype,VERSION=1.45,DEBUG=true,TIMEOUT=3e4,DUMMY=false,NAV=navigator.userAgent.toLowerCase(),HASH=window.location.hash.replace(/#\//,""),PROT=window.location.protocol=="file:"?"http:":window.location.protocol,M=Math,F=function(){},FALSE=function(){return false},IE=function(){var v=3,div=doc.createElement("div"),all=div.getElementsByTagName("i");do{div.innerHTML=""}while(all[0]);return v>4?v:doc.documentMode||undef}(),DOM=function(){return{html:doc.documentElement,body:doc.body,head:doc.getElementsByTagName("head")[0],title:doc.title}},IFRAME=window.parent!==window.self,_eventlist="data ready thumbnail loadstart loadfinish image play pause progress "+"fullscreen_enter fullscreen_exit idle_enter idle_exit rescale "+"lightbox_open lightbox_close lightbox_image",_events=function(){var evs=[];$.each(_eventlist.split(" "),function(i,ev){evs.push(ev);if(/_/.test(ev)){evs.push(ev.replace(/_/g,""))}});return evs}(),_legacyOptions=function(options){var n;if(typeof options!=="object"){return options}$.each(options,function(key,value){if(/^[a-z]+_/.test(key)){n="";$.each(key.split("_"),function(i,k){n+=i>0?k.substr(0,1).toUpperCase()+k.substr(1):k});options[n]=value;delete options[key]}});return options},_patchEvent=function(type){if($.inArray(type,_events)>-1){return Galleria[type.toUpperCase()]}return type},_video={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&(?:amp;)?)*v(?:<[A-Z]+>)?=([0-9a-zA-Z\-\_]+))/i,embed:function(){return PROT+"//www.youtube.com/embed/"+this.id},get_thumb:function(data){return PROT+"//img.youtube.com/vi/"+this.id+"/default.jpg"},get_image:function(data){return PROT+"//img.youtube.com/vi/"+this.id+"/hqdefault.jpg"}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(){return PROT+"//player.vimeo.com/video/"+this.id},getUrl:function(){return PROT+"//vimeo.com/api/v2/video/"+this.id+".json?callback=?"},get_thumb:function(data){return data[0].thumbnail_medium},get_image:function(data){return data[0].thumbnail_large}},dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(){return PROT+"//www.dailymotion.com/embed/video/"+this.id},getUrl:function(){return"https://api.dailymotion.com/video/"+this.id+"?fields=thumbnail_240_url,thumbnail_720_url&callback=?"},get_thumb:function(data){return data.thumbnail_240_url},get_image:function(data){return data.thumbnail_720_url}},_inst:[]},Video=function(type,id){for(var i=0;i<_video._inst.length;i++){if(_video._inst[i].id===id&&_video._inst[i].type==type){return _video._inst[i]}}this.type=type;this.id=id;this.readys=[];_video._inst.push(this);var self=this;$.extend(this,_video[type]);_videoThumbs=function(data){self.data=data;$.each(self.readys,function(i,fn){fn(self.data)});self.readys=[]};if(this.hasOwnProperty("getUrl")){$.getJSON(this.getUrl(),_videoThumbs)}else{window.setTimeout(_videoThumbs,400)}this.getMedia=function(type,callback,fail){fail=fail||F;var self=this;var success=function(data){callback(self["get_"+type](data))};try{if(self.data){success(self.data)}else{self.readys.push(success)}}catch(e){fail()}}},_videoTest=function(url){var match;for(var v in _video){match=url&&_video[v].reg&&url.match(_video[v].reg);if(match&&match.length){return{id:match[2],provider:v}}}return false},_nativeFullscreen={support:function(){var html=DOM().html;return!IFRAME&&(html.requestFullscreen||html.msRequestFullscreen||html.mozRequestFullScreen||html.webkitRequestFullScreen)}(),callback:F,enter:function(instance,callback,elem){this.instance=instance;this.callback=callback||F;elem=elem||DOM().html;if(elem.requestFullscreen){elem.requestFullscreen()}else if(elem.msRequestFullscreen){elem.msRequestFullscreen()}else if(elem.mozRequestFullScreen){elem.mozRequestFullScreen()}else if(elem.webkitRequestFullScreen){elem.webkitRequestFullScreen()}},exit:function(callback){this.callback=callback||F;if(doc.exitFullscreen){doc.exitFullscreen()}else if(doc.msExitFullscreen){doc.msExitFullscreen()}else if(doc.mozCancelFullScreen){doc.mozCancelFullScreen()}else if(doc.webkitCancelFullScreen){doc.webkitCancelFullScreen()}},instance:null,listen:function(){if(!this.support){return}var handler=function(){if(!_nativeFullscreen.instance){return}var fs=_nativeFullscreen.instance._fullscreen;if(doc.fullscreen||doc.mozFullScreen||doc.webkitIsFullScreen||doc.msFullscreenElement&&doc.msFullscreenElement!==null){fs._enter(_nativeFullscreen.callback)}else{fs._exit(_nativeFullscreen.callback)}};doc.addEventListener("fullscreenchange",handler,false);doc.addEventListener("MSFullscreenChange",handler,false);doc.addEventListener("mozfullscreenchange",handler,false);doc.addEventListener("webkitfullscreenchange",handler,false)}},_galleries=[],_instances=[],_hasError=false,_canvas=false,_pool=[],_loadedThemes=[],_themeLoad=function(theme){_loadedThemes.push(theme);$.each(_pool,function(i,instance){if(instance._options.theme==theme.name||!instance._initialized&&!instance._options.theme){instance.theme=theme;instance._init.call(instance)}})},Utils=function(){return{clearTimer:function(id){$.each(Galleria.get(),function(){this.clearTimer(id)})},addTimer:function(id){$.each(Galleria.get(),function(){this.addTimer(id)})},array:function(obj){return protoArray.slice.call(obj,0)},create:function(className,nodeName){nodeName=nodeName||"div";var elem=doc.createElement(nodeName);elem.className=className;return elem},removeFromArray:function(arr,elem){$.each(arr,function(i,el){if(el==elem){arr.splice(i,1);return false}});return arr},getScriptPath:function(src){src=src||$("script:last").attr("src");var slices=src.split("/");if(slices.length==1){return""}slices.pop();return slices.join("/")+"/"},animate:function(){var transition=function(style){var props="transition WebkitTransition MozTransition OTransition".split(" "),i;if(window.opera){return false}for(i=0;props[i];i++){if(typeof style[props[i]]!=="undefined"){return props[i]}}return false}((doc.body||doc.documentElement).style);var endEvent={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[transition];var easings={_default:[.25,.1,.25,1],galleria:[.645,.045,.355,1],galleriaIn:[.55,.085,.68,.53],galleriaOut:[.25,.46,.45,.94],ease:[.25,0,.25,1],linear:[.25,.25,.75,.75],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};var setStyle=function(elem,value,suffix){var css={};suffix=suffix||"transition";$.each("webkit moz ms o".split(" "),function(){css["-"+this+"-"+suffix]=value});elem.css(css)};var clearStyle=function(elem){setStyle(elem,"none","transition");if(Galleria.WEBKIT&&Galleria.TOUCH){setStyle(elem,"translate3d(0,0,0)","transform");if(elem.data("revert")){elem.css(elem.data("revert"));elem.data("revert",null)}}};var change,strings,easing,syntax,revert,form,css;return function(elem,to,options){options=$.extend({duration:400,complete:F,stop:false},options);elem=$(elem);if(!options.duration){elem.css(to);options.complete.call(elem[0]);return}if(!transition){elem.animate(to,options);return}if(options.stop){elem.off(endEvent);clearStyle(elem)}change=false;$.each(to,function(key,val){css=elem.css(key);if(Utils.parseValue(css)!=Utils.parseValue(val)){change=true}elem.css(key,css)});if(!change){window.setTimeout(function(){options.complete.call(elem[0])},options.duration);return}strings=[];easing=options.easing in easings?easings[options.easing]:easings._default;syntax=" "+options.duration+"ms"+" cubic-bezier("+easing.join(",")+")";window.setTimeout(function(elem,endEvent,to,syntax){return function(){elem.one(endEvent,function(elem){return function(){clearStyle(elem);options.complete.call(elem[0])}}(elem));if(Galleria.WEBKIT&&Galleria.TOUCH){revert={};form=[0,0,0];$.each(["left","top"],function(i,m){if(m in to){form[i]=Utils.parseValue(to[m])-Utils.parseValue(elem.css(m))+"px";revert[m]=to[m];delete to[m]}});if(form[0]||form[1]){elem.data("revert",revert);strings.push("-webkit-transform"+syntax);setStyle(elem,"translate3d("+form.join(",")+")","transform")}}$.each(to,function(p,val){strings.push(p+syntax)});setStyle(elem,strings.join(","));elem.css(to)}}(elem,endEvent,to,syntax),2)}}(),removeAlpha:function(elem){if(elem instanceof jQuery){elem=elem[0]}if(IE<9&&elem){var style=elem.style,currentStyle=elem.currentStyle,filter=currentStyle&¤tStyle.filter||style.filter||"";if(/alpha/.test(filter)){style.filter=filter.replace(/alpha\([^)]*\)/i,"")}}},forceStyles:function(elem,styles){elem=$(elem);if(elem.attr("style")){elem.data("styles",elem.attr("style")).removeAttr("style")}elem.css(styles)},revertStyles:function(){$.each(Utils.array(arguments),function(i,elem){elem=$(elem);elem.removeAttr("style");elem.attr("style","");if(elem.data("styles")){elem.attr("style",elem.data("styles")).data("styles",null)}})},moveOut:function(elem){Utils.forceStyles(elem,{position:"absolute",left:-1e4})},moveIn:function(){Utils.revertStyles.apply(Utils,Utils.array(arguments))},hide:function(elem,speed,callback){callback=callback||F;var $elem=$(elem);elem=$elem[0];if(!$elem.data("opacity")){$elem.data("opacity",$elem.css("opacity"))}var style={opacity:0};if(speed){var complete=IE<9&&elem?function(){Utils.removeAlpha(elem);elem.style.visibility="hidden";callback.call(elem)}:callback;Utils.animate(elem,style,{duration:speed,complete:complete,stop:true})}else{if(IE<9&&elem){Utils.removeAlpha(elem);elem.style.visibility="hidden"}else{$elem.css(style)}}},show:function(elem,speed,callback){callback=callback||F;var $elem=$(elem);elem=$elem[0];var saved=parseFloat($elem.data("opacity"))||1,style={opacity:saved};if(speed){if(IE<9){$elem.css("opacity",0);elem.style.visibility="visible"}var complete=IE<9&&elem?function(){if(style.opacity==1){Utils.removeAlpha(elem)}callback.call(elem)}:callback;Utils.animate(elem,style,{duration:speed,complete:complete,stop:true})}else{if(IE<9&&style.opacity==1&&elem){Utils.removeAlpha(elem);elem.style.visibility="visible"}else{$elem.css(style)}}},wait:function(options){Galleria._waiters=Galleria._waiters||[];options=$.extend({until:FALSE,success:F,error:function(){Galleria.raise("Could not complete wait function.")},timeout:3e3},options);var start=Utils.timestamp(),elapsed,now,tid,fn=function(){now=Utils.timestamp();elapsed=now-start;Utils.removeFromArray(Galleria._waiters,tid);if(options.until(elapsed)){options.success();return false}if(typeof options.timeout=="number"&&now>=start+options.timeout){options.error();return false}Galleria._waiters.push(tid=window.setTimeout(fn,10))};Galleria._waiters.push(tid=window.setTimeout(fn,10))},toggleQuality:function(img,force){if(IE!==7&&IE!==8||!img||img.nodeName.toUpperCase()!="IMG"){return}if(typeof force==="undefined"){force=img.style.msInterpolationMode==="nearest-neighbor"}img.style.msInterpolationMode=force?"bicubic":"nearest-neighbor"},insertStyleTag:function(styles,id){if(id&&$("#"+id).length){return}var style=doc.createElement("style");if(id){style.id=id}DOM().head.appendChild(style);if(style.styleSheet){style.styleSheet.cssText=styles}else{var cssText=doc.createTextNode(styles);style.appendChild(cssText)}},loadScript:function(url,callback){var done=false,script=$("").attr({src:url,async:true}).get(0);script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){done=true;script.onload=script.onreadystatechange=null;if(typeof callback==="function"){callback.call(this,this)}}};DOM().head.appendChild(script)},parseValue:function(val){if(typeof val==="number"){return val}else if(typeof val==="string"){var arr=val.match(/\-?\d|\./g);return arr&&arr.constructor===Array?arr.join("")*1:0}else{return 0}},timestamp:function(){return(new Date).getTime()},loadCSS:function(href,id,callback){var link,length;$("link[rel=stylesheet]").each(function(){if(new RegExp(href).test(this.href)){link=this;return false}});if(typeof id==="function"){callback=id;id=undef}callback=callback||F;if(link){callback.call(link,link);return link}length=doc.styleSheets.length;if($("#"+id).length){$("#"+id).attr("href",href);length--}else{link=$("").attr({rel:"stylesheet",href:href,id:id}).get(0);var styles=$('link[rel="stylesheet"], style');if(styles.length){styles.get(0).parentNode.insertBefore(link,styles[0])}else{DOM().head.appendChild(link)}if(IE&&length>=31){Galleria.raise("You have reached the browser stylesheet limit (31)",true);return}}if(typeof callback==="function"){var $loader=$("").attr("id","galleria-loader").hide().appendTo(DOM().body);Utils.wait({until:function(){return $loader.height()==1},success:function(){$loader.remove();callback.call(link,link)},error:function(){$loader.remove();Galleria.raise("Theme CSS could not load after 20 sec. "+(Galleria.QUIRK?"Your browser is in Quirks Mode, please add a correct doctype.":"Please download the latest theme at http://galleria.io/customer/."),true)},timeout:5e3})}return link}}}(),_playIcon=function(container){var css=".galleria-videoicon{width:60px;height:60px;position:absolute;top:50%;left:50%;z-index:1;"+"margin:-30px 0 0 -30px;cursor:pointer;background:#000;background:rgba(0,0,0,.8);border-radius:3px;-webkit-transition:all 150ms}"+".galleria-videoicon i{width:0px;height:0px;border-style:solid;border-width:10px 0 10px 16px;display:block;"+"border-color:transparent transparent transparent #ffffff;margin:20px 0 0 22px}.galleria-image:hover .galleria-videoicon{background:#000}";Utils.insertStyleTag(css,"galleria-videoicon");return $(Utils.create("galleria-videoicon")).html("").appendTo(container).click(function(){$(this).siblings("img").mouseup()})},_transitions=function(){var _slide=function(params,complete,fade,door){var easing=this.getOptions("easing"),distance=this.getStageWidth(),from={left:distance*(params.rewind?-1:1)},to={left:0};if(fade){from.opacity=0;to.opacity=1}else{from.opacity=1}$(params.next).css(from);Utils.animate(params.next,to,{duration:params.speed,complete:function(elems){return function(){complete();elems.css({left:0})}}($(params.next).add(params.prev)),queue:false,easing:easing});if(door){params.rewind=!params.rewind}if(params.prev){from={left:0};to={left:distance*(params.rewind?1:-1)};if(fade){from.opacity=1;to.opacity=0}$(params.prev).css(from);Utils.animate(params.prev,to,{duration:params.speed,queue:false,easing:easing,complete:function(){$(this).css("opacity",0)}})}};return{active:false,init:function(effect,params,complete){if(_transitions.effects.hasOwnProperty(effect)){_transitions.effects[effect].call(this,params,complete)}},effects:{fade:function(params,complete){$(params.next).css({opacity:0,left:0});Utils.animate(params.next,{opacity:1},{duration:params.speed,complete:complete});if(params.prev){$(params.prev).css("opacity",1).show();Utils.animate(params.prev,{opacity:0},{duration:params.speed})}},flash:function(params,complete){$(params.next).css({opacity:0,left:0});if(params.prev){Utils.animate(params.prev,{opacity:0},{duration:params.speed/2,complete:function(){Utils.animate(params.next,{opacity:1},{duration:params.speed,complete:complete})}})}else{Utils.animate(params.next,{opacity:1},{duration:params.speed,complete:complete})}},pulse:function(params,complete){if(params.prev){$(params.prev).hide()}$(params.next).css({opacity:0,left:0}).show();Utils.animate(params.next,{opacity:1},{duration:params.speed,complete:complete})},slide:function(params,complete){_slide.apply(this,Utils.array(arguments))},fadeslide:function(params,complete){_slide.apply(this,Utils.array(arguments).concat([true]))},doorslide:function(params,complete){_slide.apply(this,Utils.array(arguments).concat([false,true]))}}}}();_nativeFullscreen.listen();$.event.special["click:fast"]={propagate:true,add:function(handleObj){var getCoords=function(e){if(e.touches&&e.touches.length){var touch=e.touches[0];return{x:touch.pageX,y:touch.pageY}}};var def={touched:false,touchdown:false,coords:{x:0,y:0},evObj:{}};$(this).data({clickstate:def,timer:0}).on("touchstart.fast",function(e){window.clearTimeout($(this).data("timer"));$(this).data("clickstate",{touched:true,touchdown:true,coords:getCoords(e.originalEvent),evObj:e})}).on("touchmove.fast",function(e){var coords=getCoords(e.originalEvent),state=$(this).data("clickstate"),distance=Math.max(Math.abs(state.coords.x-coords.x),Math.abs(state.coords.y-coords.y));if(distance>6){$(this).data("clickstate",$.extend(state,{touchdown:false}))}}).on("touchend.fast",function(e){var $this=$(this),state=$this.data("clickstate");if(state.touchdown){handleObj.handler.call(this,e)}$this.data("timer",window.setTimeout(function(){$this.data("clickstate",def)},400))}).on("click.fast",function(e){var state=$(this).data("clickstate");if(state.touched){return false}$(this).data("clickstate",def);handleObj.handler.call(this,e)})},remove:function(){$(this).off("touchstart.fast touchmove.fast touchend.fast click.fast")}};$win.on("orientationchange",function(){$(this).resize()});Galleria=function(){var self=this;this._options={};this._playing=false;this._playtime=5e3;this._active=null;this._queue={length:0};this._data=[];this._dom={};this._thumbnails=[];this._layers=[];this._initialized=false;this._firstrun=false;this._stageWidth=0;this._stageHeight=0;this._target=undef;this._binds=[];this._id=parseInt(M.random()*1e4,10);var divs="container stage images image-nav image-nav-left image-nav-right "+"info info-text info-title info-description "+"thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right "+"loader counter tooltip",spans="current total";$.each(divs.split(" "),function(i,elemId){self._dom[elemId]=Utils.create("galleria-"+elemId)});$.each(spans.split(" "),function(i,elemId){self._dom[elemId]=Utils.create("galleria-"+elemId,"span")});var keyboard=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:false,press:function(e){var key=e.keyCode||e.which;if(key in keyboard.map&&typeof keyboard.map[key]==="function"){keyboard.map[key].call(self,e)}},attach:function(map){var key,up;for(key in map){if(map.hasOwnProperty(key)){up=key.toUpperCase();if(up in keyboard.keys){keyboard.map[keyboard.keys[up]]=map[key]}else{keyboard.map[up]=map[key]}}}if(!keyboard.bound){keyboard.bound=true;$doc.on("keydown",keyboard.press)}},detach:function(){keyboard.bound=false;keyboard.map={};$doc.off("keydown",keyboard.press)}};var controls=this._controls={0:undef,1:undef,active:0,swap:function(){controls.active=controls.active?0:1},getActive:function(){return self._options.swipe?controls.slides[self._active]:controls[controls.active]},getNext:function(){return self._options.swipe?controls.slides[self.getNext(self._active)]:controls[1-controls.active]},slides:[],frames:[],layers:[]};var carousel=this._carousel={next:self.$("thumb-nav-right"),prev:self.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var w=0,h=0,hooks=[0];$.each(self._thumbnails,function(i,thumb){if(thumb.ready){w+=thumb.outerWidth||$(thumb.container).outerWidth(true);var containerWidth=$(thumb.container).width();w+=containerWidth-M.floor(containerWidth);hooks[i+1]=w;h=M.max(h,thumb.outerHeight||$(thumb.container).outerHeight(true))}});self.$("thumbnails").css({width:w,height:h});carousel.max=w;carousel.hooks=hooks;carousel.width=self.$("thumbnails-list").width();carousel.setClasses();self.$("thumbnails-container").toggleClass("galleria-carousel",w>carousel.width);carousel.width=self.$("thumbnails-list").width()},bindControls:function(){var i;carousel.next.on("click:fast",function(e){e.preventDefault();if(self._options.carouselSteps==="auto"){for(i=carousel.current;icarousel.width){carousel.set(i-2);break}}}else{carousel.set(carousel.current+self._options.carouselSteps)}});carousel.prev.on("click:fast",function(e){e.preventDefault();if(self._options.carouselSteps==="auto"){for(i=carousel.current;i>=0;i--){if(carousel.hooks[carousel.current]-carousel.hooks[i]>carousel.width){carousel.set(i+2);break}else if(i===0){carousel.set(0);break}}}else{carousel.set(carousel.current-self._options.carouselSteps)}})},set:function(i){i=M.max(i,0);while(carousel.hooks[i-1]+carousel.width>=carousel.max&&i>=0){i--}carousel.current=i;carousel.animate()},getLast:function(i){return(i||carousel.current)-1},follow:function(i){if(i===0||i===carousel.hooks.length-2){carousel.set(i);return}var last=carousel.current;while(carousel.hooks[last]-carousel.hooks[carousel.current]last){carousel.set(i-last+carousel.current+2)}},setClasses:function(){carousel.prev.toggleClass("disabled",!carousel.current);carousel.next.toggleClass("disabled",carousel.hooks[carousel.current]+carousel.width>=carousel.max)},animate:function(to){carousel.setClasses();var num=carousel.hooks[carousel.current]*-1;if(isNaN(num)){return}self.$("thumbnails").css("left",function(){return $(this).css("left")});Utils.animate(self.get("thumbnails"),{left:num},{duration:self._options.carouselSpeed,easing:self._options.easing,queue:false})}};var tooltip=this._tooltip={initialized:false,open:false,timer:"tooltip"+self._id,swapTimer:"swap"+self._id,init:function(){tooltip.initialized=true;var css=".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3;"+"opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}";Utils.insertStyleTag(css,"galleria-tooltip");self.$("tooltip").css({opacity:.8,visibility:"visible",display:"none"})},move:function(e){var mouseX=self.getMousePosition(e).x,mouseY=self.getMousePosition(e).y,$elem=self.$("tooltip"),x=mouseX,y=mouseY,height=$elem.outerHeight(true)+1,width=$elem.outerWidth(true),limitY=height+15;var maxX=self.$("container").width()-width-2,maxY=self.$("container").height()-height-2;if(!isNaN(x)&&!isNaN(y)){x+=10;y-=height+8;x=M.max(0,M.min(maxX,x));y=M.max(0,M.min(maxY,y));if(mouseY7){exs=IE<9?"background:#000;filter:alpha(opacity=0);":"background:rgba(0,0,0,0);"}else{exs="z-index:99999"}cssMap.nextholder+=exs;cssMap.prevholder+=exs;$.each(cssMap,function(key,value){css+=".galleria-"+prefix+key+"{"+value+"}"});css+=".galleria-"+prefix+"box.iframe .galleria-"+prefix+"prevholder,"+".galleria-"+prefix+"box.iframe .galleria-"+prefix+"nextholder{"+"width:100px;height:100px;top:50%;margin-top:-70px}";Utils.insertStyleTag(css,"galleria-lightbox");$.each(elems.split(" "),function(i,elemId){self.addElement("lightbox-"+elemId);el[elemId]=lightbox.elems[elemId]=self.get("lightbox-"+elemId)});lightbox.image=new Galleria.Picture;$.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(key,val){var arr=[];$.each(val.split(" "),function(i,prop){arr.push(prefix+prop)});appends[prefix+key]=arr});self.append(appends);$(el.image).append(lightbox.image.container);$(DOM().body).append(el.overlay,el.box);hover($(el.close).on("click:fast",lightbox.hide).html("×"));$.each(["Prev","Next"],function(i,dir){var $d=$(el[dir.toLowerCase()]).html(/v/.test(dir)?"‹ ":" ›"),$e=$(el[dir.toLowerCase()+"holder"]);$e.on("click:fast",function(){lightbox["show"+dir]()});if(IE<8||Galleria.TOUCH){$d.show();return}$e.hover(function(){$d.show()},function(e){$d.stop().fadeOut(200)})});$(el.overlay).on("click:fast",lightbox.hide);if(Galleria.IPAD){self._options.lightboxTransitionSpeed=0}},rescale:function(event){var width=M.min($win.width()-40,lightbox.width),height=M.min($win.height()-60,lightbox.height),ratio=M.min(width/lightbox.width,height/lightbox.height),destWidth=M.round(lightbox.width*ratio)+40,destHeight=M.round(lightbox.height*ratio)+60,to={width:destWidth,height:destHeight,"margin-top":M.ceil(destHeight/2)*-1,"margin-left":M.ceil(destWidth/2)*-1};if(event){$(lightbox.elems.box).css(to)}else{$(lightbox.elems.box).animate(to,{duration:self._options.lightboxTransitionSpeed,easing:self._options.easing,complete:function(){var image=lightbox.image,speed=self._options.lightboxFadeSpeed;self.trigger({type:Galleria.LIGHTBOX_IMAGE,imageTarget:image.image});$(image.container).show();$(image.image).animate({opacity:1},speed);Utils.show(lightbox.elems.info,speed)}})}},hide:function(){lightbox.image.image=null;$win.off("resize",lightbox.rescale);$(lightbox.elems.box).hide().find("iframe").remove();Utils.hide(lightbox.elems.info);self.detachKeyboard();self.attachKeyboard(lightbox.keymap);lightbox.keymap=false;Utils.hide(lightbox.elems.overlay,200,function(){$(this).hide().css("opacity",self._options.overlayOpacity);self.trigger(Galleria.LIGHTBOX_CLOSE)})},showNext:function(){lightbox.show(self.getNext(lightbox.active))},showPrev:function(){lightbox.show(self.getPrev(lightbox.active))},show:function(index){lightbox.active=index=typeof index==="number"?index:self.getIndex()||0;if(!lightbox.initialized){lightbox.init()}self.trigger(Galleria.LIGHTBOX_OPEN);if(!lightbox.keymap){lightbox.keymap=$.extend({},self._keyboard.map);self.attachKeyboard({escape:lightbox.hide,right:lightbox.showNext,left:lightbox.showPrev})}$win.off("resize",lightbox.rescale);var data=self.getData(index),total=self.getDataLength(),n=self.getNext(index),ndata,p,i;Utils.hide(lightbox.elems.info);try{for(i=self._options.preload;i>0;i--){p=new Galleria.Picture;ndata=self.getData(n);p.preload(ndata.big?ndata.big:ndata.image);n=self.getNext(n)}}catch(e){}lightbox.image.isIframe=data.iframe&&!data.image;$(lightbox.elems.box).toggleClass("iframe",lightbox.image.isIframe);$(lightbox.image.container).find(".galleria-videoicon").remove();lightbox.image.load(data.big||data.image||data.iframe,function(image){if(image.isIframe){var cw=$(window).width(),ch=$(window).height();if(image.video&&self._options.maxVideoSize){var r=M.min(self._options.maxVideoSize/cw,self._options.maxVideoSize/ch);if(r<1){cw*=r;ch*=r}}lightbox.width=cw;lightbox.height=ch}else{lightbox.width=image.original.width;lightbox.height=image.original.height}$(image.image).css({width:image.isIframe?"100%":"100.1%",height:image.isIframe?"100%":"100.1%",top:0,bottom:0,zIndex:99998,opacity:0,visibility:"visible"}).parent().height("100%");lightbox.elems.title.innerHTML=data.title||"";lightbox.elems.counter.innerHTML=index+1+" / "+total;$win.resize(lightbox.rescale);lightbox.rescale();if(data.image&&data.iframe){$(lightbox.elems.box).addClass("iframe");if(data.video){var $icon=_playIcon(image.container).hide();window.setTimeout(function(){$icon.fadeIn(200)},200)}$(image.image).css("cursor","pointer").mouseup(function(data,image){return function(e){$(lightbox.image.container).find(".galleria-videoicon").remove();e.preventDefault();image.isIframe=true;image.load(data.iframe+(data.video?"&autoplay=1":""),{width:"100%",height:IE<8?$(lightbox.image.container).height():"100%"})}}(data,image))}});$(lightbox.elems.overlay).show().css("visibility","visible");$(lightbox.elems.box).show()}};var _timer=this._timer={trunk:{},add:function(id,fn,delay,loop){id=id||(new Date).getTime();loop=loop||false;this.clear(id);if(loop){var old=fn;fn=function(){old();_timer.add(id,fn,delay)}}this.trunk[id]=window.setTimeout(fn,delay)},clear:function(id){var del=function(i){window.clearTimeout(this.trunk[i]);delete this.trunk[i]},i;if(!!id&&id in this.trunk){del.call(this,id)}else if(typeof id==="undefined"){for(i in this.trunk){if(this.trunk.hasOwnProperty(i)){del.call(this,i)}}}}};return this};Galleria.prototype={constructor:Galleria,init:function(target,options){options=_legacyOptions(options);this._original={target:target,options:options,data:null};this._target=this._dom.target=target.nodeName?target:$(target).get(0);this._original.html=this._target.innerHTML;_instances.push(this);if(!this._target){Galleria.raise("Target not found",true);return}this._options={autoplay:false,carousel:true,carouselFollow:true,carouselSpeed:400,carouselSteps:"auto",clicknext:false,dailymotion:{foreground:"%23EEEEEE",highlight:"%235BCEC5",background:"%23222222",logo:0,hideInfos:1},dataConfig:function(elem){return{}},dataSelector:"img",dataSort:false,dataSource:this._target,debug:undef,dummy:undef,easing:"galleria",extend:function(options){},fullscreenCrop:undef,fullscreenDoubleTap:true,fullscreenTransition:undef,height:0,idleMode:true,idleTime:3e3,idleSpeed:200,imageCrop:false,imageMargin:0,imagePan:false,imagePanSmoothness:12,imagePosition:"50%",imageTimeout:undef,initialTransition:undef,keepSource:false,layerFollow:true,lightbox:false,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:true,maxScaleRatio:undef,maxVideoSize:undef,minScaleRatio:undef,overlayOpacity:.85,overlayBackground:"#0b0b0b",pauseOnInteraction:true,popupLinks:false,preload:2,queue:true,responsive:true,show:0,showInfo:true,showCounter:true,showImagenav:true,swipe:"auto",theme:null,thumbCrop:true,thumbEventType:"click:fast",thumbMargin:0,thumbQuality:"auto",thumbDisplayOrder:true,thumbPosition:"50%",thumbnails:true,touchTransition:undef,transition:"fade",transitionInitial:undef,transitionSpeed:400,trueFullscreen:true,useCanvas:false,variation:"",videoPoster:true,vimeo:{title:0,byline:0,portrait:0,color:"aaaaaa"},wait:5e3,width:"auto",youtube:{modestbranding:1,autohide:1,color:"white",hd:1,rel:0,showinfo:0}};this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial;if(options){if(options.debug===false){DEBUG=false}if(typeof options.imageTimeout==="number"){TIMEOUT=options.imageTimeout}if(typeof options.dummy==="string"){DUMMY=options.dummy}if(typeof options.theme=="string"){this._options.theme=options.theme}}$(this._target).children().hide();if(Galleria.QUIRK){Galleria.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype.")}if(_loadedThemes.length){if(this._options.theme){for(var i=0;i<_loadedThemes.length;i++){if(this._options.theme===_loadedThemes[i].name){this.theme=_loadedThemes[i];break}}}else{this.theme=_loadedThemes[0]}}if(typeof this.theme=="object"){this._init()}else{_pool.push(this)}return this},_init:function(){var self=this,options=this._options;if(this._initialized){Galleria.raise("Init failed: Gallery instance already initialized.");return this}this._initialized=true;if(!this.theme){Galleria.raise("Init failed: No theme found.",true);return this}$.extend(true,options,this.theme.defaults,this._original.options,Galleria.configure.options);options.swipe=function(s){if(s=="enforced"){return true}if(s===false||s=="disabled"){return false}return!!Galleria.TOUCH}(options.swipe);if(options.swipe){options.clicknext=false;options.imagePan=false}(function(can){if(!("getContext"in can)){can=null;return}_canvas=_canvas||{elem:can,context:can.getContext("2d"),cache:{},length:0}})(doc.createElement("canvas"));this.bind(Galleria.DATA,function(){if(window.screen&&window.screen.width&&Array.prototype.forEach){this._data.forEach(function(data){var density="devicePixelRatio"in window?window.devicePixelRatio:1,m=M.max(window.screen.width,window.screen.height);if(m*density<1024){data.big=data.image}})}this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var $container=this.$("container");if(self._options.height<2){self._userRatio=self._ratio=self._options.height}var num={width:0,height:0};var testHeight=function(){return self.$("stage").height()};Utils.wait({until:function(){num=self._getWH();$container.width(num.width).height(num.height);return testHeight()&&num.width&&num.height>50},success:function(){self._width=num.width;self._height=num.height;self._ratio=self._ratio||num.height/num.width;if(Galleria.WEBKIT){window.setTimeout(function(){self._run()},1)}else{self._run()}},error:function(){if(testHeight()){Galleria.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+num.width+"px, height: "+num.height+"px.",true)}else{Galleria.raise("Could not extract a stage height from the CSS. Traced height: "+testHeight()+"px.",true)}},timeout:typeof this._options.wait=="number"?this._options.wait:false})});this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]});Utils.hide(this.$("counter").append(this.get("current"),doc.createTextNode(" / "),this.get("total")));this.setCounter("–");Utils.hide(self.get("tooltip"));this.$("container").addClass([Galleria.TOUCH?"touch":"notouch",this._options.variation,"galleria-theme-"+this.theme.name].join(" "));if(!this._options.swipe){$.each(new Array(2),function(i){var image=new Galleria.Picture;$(image.container).css({position:"absolute",top:0,left:0}).prepend(self._layers[i]=$(Utils.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]);self.$("images").append(image.container);self._controls[i]=image;var frame=new Galleria.Picture;frame.isIframe=true;$(frame.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(image.container);self._controls.frames[i]=frame})}this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});if(options.swipe){this.$("images").css({position:"absolute",top:0,left:0,width:0,height:"100%"});this.finger=new Galleria.Finger(this.get("stage"),{onchange:function(page){self.pause().show(page)},oncomplete:function(page){var index=M.max(0,M.min(parseInt(page,10),self.getDataLength()-1)),data=self.getData(index);$(self._thumbnails[index].container).addClass("active").siblings(".active").removeClass("active");if(!data){return}self.$("images").find(".galleria-frame").css("opacity",0).hide().find("iframe").remove();if(self._options.carousel&&self._options.carouselFollow){self._carousel.follow(index)}}});this.bind(Galleria.RESCALE,function(){this.finger.setup()});this.$("stage").on("click",function(e){var data=self.getData();if(!data){return}if(data.iframe){if(self.isPlaying()){self.pause()}var frame=self._controls.frames[self._active],w=self._stageWidth,h=self._stageHeight;if($(frame.container).find("iframe").length){return}$(frame.container).css({width:w,height:h,opacity:0}).show().animate({opacity:1},200);window.setTimeout(function(){frame.load(data.iframe+(data.video?"&autoplay=1":""),{width:w,height:h},function(frame){self.$("container").addClass("videoplay");frame.scale({width:self._stageWidth,height:self._stageHeight,iframelimit:data.video?self._options.maxVideoSize:undef})})},100);return}if(data.link){if(self._options.popupLinks){var win=window.open(data.link,"_blank")}else{window.location.href=data.link}return}});this.bind(Galleria.IMAGE,function(e){self.setCounter(e.index);self.setInfo(e.index);var next=this.getNext(),prev=this.getPrev();var preloads=[prev,next];preloads.push(this.getNext(next),this.getPrev(prev),self._controls.slides.length-1);var filtered=[];$.each(preloads,function(i,val){if($.inArray(val,filtered)==-1){filtered.push(val)}});$.each(filtered,function(i,loadme){var d=self.getData(loadme),img=self._controls.slides[loadme],src=self.isFullscreen()&&d.big?d.big:d.image||d.iframe;if(d.iframe&&!d.image){img.isIframe=true}if(!img.ready){self._controls.slides[loadme].load(src,function(img){if(!img.isIframe){$(img.image).css("visibility","hidden")}self._scaleImage(img,{complete:function(img){if(!img.isIframe){$(img.image).css({opacity:0,visibility:"visible"}).animate({opacity:1},200)}}})})}})})}this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"});this.$("image-nav-right, image-nav-left").on("click:fast",function(e){if(options.pauseOnInteraction){self.pause()}var fn=/right/.test(this.className)?"next":"prev";self[fn]()}).on("click",function(e){e.preventDefault();if(options.clicknext||options.swipe){e.stopPropagation()}});$.each(["info","counter","image-nav"],function(i,el){if(options["show"+el.substr(0,1).toUpperCase()+el.substr(1).replace(/-/,"")]===false){Utils.moveOut(self.get(el.toLowerCase()))}});this.load();if(!options.keepSource&&!IE){this._target.innerHTML=""}if(this.get("errors")){this.appendChild("target","errors")}this.appendChild("target","container");if(options.carousel){var count=0,show=options.show;this.bind(Galleria.THUMBNAIL,function(){this.updateCarousel();if(++count==this.getDataLength()&&typeof show=="number"&&show>0){this._carousel.follow(show)}})}if(options.responsive){$win.on("resize",function(){if(!self.isFullscreen()){self.resize()}})}if(options.fullscreenDoubleTap){this.$("stage").on("touchstart",function(){var last,cx,cy,lx,ly,now,getData=function(e){return e.originalEvent.touches?e.originalEvent.touches[0]:e};self.$("stage").on("touchmove",function(){last=0});return function(e){if(/(-left|-right)/.test(e.target.className)){return}now=Utils.timestamp();cx=getData(e).pageX;cy=getData(e).pageY;if(e.originalEvent.touches.length<2&&now-last<300&&cx-lx<20&&cy-ly<20){self.toggleFullscreen();e.preventDefault();return}last=now;lx=cx;ly=cy}}())}$.each(Galleria.on.binds,function(i,bind){if($.inArray(bind.hash,self._binds)==-1){self.bind(bind.type,bind.callback)}});return this},addTimer:function(){this._timer.add.apply(this._timer,Utils.array(arguments));return this},clearTimer:function(){this._timer.clear.apply(this._timer,Utils.array(arguments));return this},_getWH:function(){var $container=this.$("container"),$target=this.$("target"),self=this,num={},arr;$.each(["width","height"],function(i,m){if(self._options[m]&&typeof self._options[m]==="number"){num[m]=self._options[m]}else{arr=[Utils.parseValue($container.css(m)),Utils.parseValue($target.css(m)),$container[m](),$target[m]()];if(!self["_"+m]){arr.splice(arr.length,Utils.parseValue($container.css("min-"+m)),Utils.parseValue($target.css("min-"+m)))}num[m]=M.max.apply(M,arr)}});if(self._userRatio){num.height=num.width*self._userRatio}return num},_createThumbnails:function(push){this.get("total").innerHTML=this.getDataLength();var src,thumb,data,$container,self=this,o=this._options,i=push?this._data.length-push.length:0,chunk=i,thumbchunk=[],loadindex=0,gif=IE<8?"http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif":"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D",active=function(){var a=self.$("thumbnails").find(".active");if(!a.length){return false}return a.find("img").attr("src")}(),optval=typeof o.thumbnails==="string"?o.thumbnails.toLowerCase():null,getStyle=function(prop){return doc.defaultView&&doc.defaultView.getComputedStyle?doc.defaultView.getComputedStyle(thumb.container,null)[prop]:$container.css(prop)},fake=function(image,index,container){return function(){$(container).append(image);self.trigger({type:Galleria.THUMBNAIL,thumbTarget:image,index:index,galleriaData:self.getData(index)})}},onThumbEvent=function(e){if(o.pauseOnInteraction){self.pause()}var index=$(e.currentTarget).data("index");if(self.getIndex()!==index){self.show(index)}e.preventDefault()},thumbComplete=function(thumb,callback){$(thumb.container).css("visibility","visible");self.trigger({type:Galleria.THUMBNAIL,thumbTarget:thumb.image,index:thumb.data.order,galleriaData:self.getData(thumb.data.order)});if(typeof callback=="function"){callback.call(self,thumb)}},onThumbLoad=function(thumb,callback){thumb.scale({width:thumb.data.width,height:thumb.data.height,crop:o.thumbCrop,margin:o.thumbMargin,canvas:o.useCanvas,position:o.thumbPosition,complete:function(thumb){var top=["left","top"],arr=["Width","Height"],m,css,data=self.getData(thumb.index);$.each(arr,function(i,measure){m=measure.toLowerCase();if(o.thumbCrop!==true||o.thumbCrop===m){css={};css[m]=thumb[m];$(thumb.container).css(css);css={};css[top[i]]=0;$(thumb.image).css(css)}thumb["outer"+measure]=$(thumb.container)["outer"+measure](true)});Utils.toggleQuality(thumb.image,o.thumbQuality===true||o.thumbQuality==="auto"&&thumb.original.widthself._thumbnails.length-1){return}var thumb=self._thumbnails[ind],data=thumb.data,callback=function(){if(++loaded==arr.length&&typeof complete=="function"){complete.call(self)}},thumbload=$(thumb.container).data("thumbload");if(thumb.video){thumbload.call(self,thumb,callback)}else{thumb.load(data.src,function(thumb){thumbload.call(self,thumb,callback)})}});return this},lazyLoadChunks:function(size,delay){var len=this.getDataLength(),i=0,n=0,arr=[],temp=[],self=this;delay=delay||0;for(;i50},success:function(){_galleries.push(self);if(self._options.swipe){var $images=self.$("images").width(self.getDataLength()*self._stageWidth);$.each(new Array(self.getDataLength()),function(i){var image=new Galleria.Picture,data=self.getData(i);$(image.container).css({position:"absolute",top:0,left:self._stageWidth*i}).prepend(self._layers[i]=$(Utils.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]).appendTo($images);if(data.video){_playIcon(image.container)}self._controls.slides.push(image);var frame=new Galleria.Picture;frame.isIframe=true;$(frame.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(image.container);self._controls.frames.push(frame)});self.finger.setup()}Utils.show(self.get("counter"));if(self._options.carousel){self._carousel.bindControls()}if(self._options.autoplay){self.pause();if(typeof self._options.autoplay==="number"){self._playtime=self._options.autoplay}self._playing=true}if(self._firstrun){if(self._options.autoplay){self.trigger(Galleria.PLAY)}if(typeof self._options.show==="number"){self.show(self._options.show)}return}self._firstrun=true;if(Galleria.History){Galleria.History.change(function(value){if(isNaN(value)){window.history.go(-1)}else{self.show(value,undef,true)}})}self.trigger(Galleria.READY);self.theme.init.call(self,self._options);$.each(Galleria.ready.callbacks,function(i,fn){if(typeof fn=="function"){fn.call(self,self._options)}});self._options.extend.call(self,self._options);if(/^[0-9]{1,4}$/.test(HASH)&&Galleria.History){self.show(HASH,undef,true)}else if(self._data[self._options.show]){self.show(self._options.show)}if(self._options.autoplay){self.trigger(Galleria.PLAY)}},error:function(){Galleria.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+self._stageWidth+"px, height: "+self._stageHeight+"px.",true)}})},load:function(source,selector,config){var self=this,o=this._options;this._data=[];this._thumbnails=[];this.$("thumbnails").empty();if(typeof selector==="function"){config=selector;selector=null}source=source||o.dataSource;selector=selector||o.dataSelector;config=config||o.dataConfig;if($.isPlainObject(source)){source=[source]}if($.isArray(source)){if(this.validate(source)){this._data=source}else{Galleria.raise("Load failed: JSON Array not valid.")}}else{selector+=",.video,.iframe";$(source).find(selector).each(function(i,elem){elem=$(elem);var data={},parent=elem.parent(),href=parent.attr("href"),rel=parent.attr("rel");if(href&&(elem[0].nodeName=="IMG"||elem.hasClass("video"))&&_videoTest(href)){data.video=href}else if(href&&elem.hasClass("iframe")){data.iframe=href}else{data.image=data.big=href}if(rel){data.big=rel}$.each("big title description link layer image".split(" "),function(i,val){if(elem.data(val)){data[val]=elem.data(val).toString()}});if(!data.big){data.big=data.image}self._data.push($.extend({title:elem.attr("title")||"",thumb:elem.attr("src"),image:elem.attr("src"),big:elem.attr("src"),description:elem.attr("alt")||"",link:elem.attr("longdesc"),original:elem.get(0)},data,config(elem)))})}if(typeof o.dataSort=="function"){protoArray.sort.call(this._data,o.dataSort)}else if(o.dataSort=="random"){this._data.sort(function(){return M.round(M.random())-.5})}if(this.getDataLength()){this._parseData(function(){this.trigger(Galleria.DATA)})}return this},_parseData:function(callback){var self=this,current,ready=false,onload=function(){var complete=true;$.each(self._data,function(i,data){if(data.loading){complete=false;return false}});if(complete&&!ready){ready=true;callback.call(self)}};$.each(this._data,function(i,data){current=self._data[i];if("thumb"in data===false){current.thumb=data.image}if(!data.big){current.big=data.image}if("video"in data){var result=_videoTest(data.video);if(result){current.iframe=new Video(result.provider,result.id).embed()+function(){if(typeof self._options[result.provider]=="object"){var str="?",arr=[];$.each(self._options[result.provider],function(key,val){arr.push(key+"="+val)});if(result.provider=="youtube"){arr=["wmode=opaque"].concat(arr)}return str+arr.join("&")}return""}();if(!current.thumb||!current.image){$.each(["thumb","image"],function(i,type){if(type=="image"&&!self._options.videoPoster){current.image=undef;return}var video=new Video(result.provider,result.id);if(!current[type]){current.loading=true;video.getMedia(type,function(current,type){return function(src){current[type]=src;if(type=="image"&&!current.big){current.big=current.image}delete current.loading;onload()}}(current,type))}})}}}});onload();return this},destroy:function(){this.$("target").data("galleria",null);this.$("container").off("galleria");this.get("target").innerHTML=this._original.html;this.clearTimer();Utils.removeFromArray(_instances,this);Utils.removeFromArray(_galleries,this);if(Galleria._waiters.length){$.each(Galleria._waiters,function(i,w){if(w)window.clearTimeout(w)})}return this},splice:function(){var self=this,args=Utils.array(arguments);window.setTimeout(function(){protoArray.splice.apply(self._data,args);self._parseData(function(){self._createThumbnails()})},2);return self},push:function(){var self=this,args=Utils.array(arguments);if(args.length==1&&args[0].constructor==Array){args=args[0]}window.setTimeout(function(){protoArray.push.apply(self._data,args);self._parseData(function(){self._createThumbnails(args)})},2);return self},_getActive:function(){return this._controls.getActive()},validate:function(data){return true},bind:function(type,fn){type=_patchEvent(type);this.$("container").on(type,this.proxy(fn));return this},unbind:function(type){type=_patchEvent(type);this.$("container").off(type);return this},trigger:function(type){type=typeof type==="object"?$.extend(type,{scope:this}):{type:_patchEvent(type),scope:this};this.$("container").trigger(type);return this},addIdleState:function(elem,styles,from,hide){this._idle.add.apply(this._idle,Utils.array(arguments));return this},removeIdleState:function(elem){this._idle.remove.apply(this._idle,Utils.array(arguments));return this},enterIdleMode:function(){this._idle.hide();return this},exitIdleMode:function(){this._idle.showAll();return this},enterFullscreen:function(callback){this._fullscreen.enter.apply(this,Utils.array(arguments));return this},exitFullscreen:function(callback){this._fullscreen.exit.apply(this,Utils.array(arguments));return this},toggleFullscreen:function(callback){this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,Utils.array(arguments));return this},bindTooltip:function(elem,value){this._tooltip.bind.apply(this._tooltip,Utils.array(arguments));return this},defineTooltip:function(elem,value){this._tooltip.define.apply(this._tooltip,Utils.array(arguments));return this},refreshTooltip:function(elem){this._tooltip.show.apply(this._tooltip,Utils.array(arguments));return this},openLightbox:function(){this._lightbox.show.apply(this._lightbox,Utils.array(arguments));return this},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,Utils.array(arguments));return this},hasVariation:function(variation){return $.inArray(variation,this._options.variation.split(/\s+/))>-1},getActiveImage:function(){var active=this._getActive();return active?active.image:undef},getActiveThumb:function(){return this._thumbnails[this._active].image||undef},getMousePosition:function(e){return{x:e.pageX-this.$("container").offset().left,y:e.pageY-this.$("container").offset().top}},addPan:function(img){if(this._options.imageCrop===false){return}img=$(img||this.getActiveImage());var self=this,x=img.width()/2,y=img.height()/2,destX=parseInt(img.css("left"),10),destY=parseInt(img.css("top"),10),curX=destX||0,curY=destY||0,distX=0,distY=0,active=false,ts=Utils.timestamp(),cache=0,move=0,position=function(dist,cur,pos){if(dist>0){move=M.round(M.max(dist*-1,M.min(0,cur)));if(cache!==move){cache=move;if(IE===8){img.parent()["scroll"+pos](move*-1)}else{var css={};css[pos.toLowerCase()]=move;img.css(css)}}}},calculate=function(e){if(Utils.timestamp()-ts<50){return}active=true;x=self.getMousePosition(e).x;y=self.getMousePosition(e).y},loop=function(e){if(!active){return}distX=img.width()-self._stageWidth;distY=img.height()-self._stageHeight;destX=x/self._stageWidth*distX*-1;destY=y/self._stageHeight*distY*-1;curX+=(destX-curX)/self._options.imagePanSmoothness;curY+=(destY-curY)/self._options.imagePanSmoothness;position(distY,curY,"Top");position(distX,curX,"Left")};if(IE===8){img.parent().scrollTop(curY*-1).scrollLeft(curX*-1);img.css({top:0,left:0})}this.$("stage").off("mousemove",calculate).on("mousemove",calculate);this.addTimer("pan"+self._id,loop,50,true);return this},proxy:function(fn,scope){if(typeof fn!=="function"){return F}scope=scope||this;return function(){return fn.apply(scope,Utils.array(arguments))}},getThemeName:function(){return this.theme.name},removePan:function(){this.$("stage").off("mousemove");this.clearTimer("pan"+this._id);return this},addElement:function(id){var dom=this._dom;$.each(Utils.array(arguments),function(i,blueprint){dom[blueprint]=Utils.create("galleria-"+blueprint)});return this},attachKeyboard:function(map){this._keyboard.attach.apply(this._keyboard,Utils.array(arguments));return this},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,Utils.array(arguments));return this},appendChild:function(parentID,childID){this.$(parentID).append(this.get(childID)||childID); -return this},prependChild:function(parentID,childID){this.$(parentID).prepend(this.get(childID)||childID);return this},remove:function(elemID){this.$(Utils.array(arguments).join(",")).remove();return this},append:function(data){var i,j;for(i in data){if(data.hasOwnProperty(i)){if(data[i].constructor===Array){for(j=0;data[i][j];j++){this.appendChild(i,data[i][j])}}else{this.appendChild(i,data[i])}}}return this},_scaleImage:function(image,options){image=image||this._controls.getActive();if(!image){return}var complete,scaleLayer=function(img){$(img.container).children(":first").css({top:M.max(0,Utils.parseValue(img.image.style.top)),left:M.max(0,Utils.parseValue(img.image.style.left)),width:Utils.parseValue(img.image.width),height:Utils.parseValue(img.image.height)})};options=$.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition,iframelimit:this._options.maxVideoSize},options);if(this._options.layerFollow&&this._options.imageCrop!==true){if(typeof options.complete=="function"){complete=options.complete;options.complete=function(){complete.call(image,image);scaleLayer(image)}}else{options.complete=scaleLayer}}else{$(image.container).children(":first").css({top:0,left:0})}image.scale(options);return this},updateCarousel:function(){this._carousel.update();return this},resize:function(measures,complete){if(typeof measures=="function"){complete=measures;measures=undef}measures=$.extend({width:0,height:0},measures);var self=this,$container=this.$("container");$.each(measures,function(m,val){if(!val){$container[m]("auto");measures[m]=self._getWH()[m]}});$.each(measures,function(m,val){$container[m](val)});return this.rescale(complete)},rescale:function(width,height,complete){var self=this;if(typeof width==="function"){complete=width;width=undef}var scale=function(){self._stageWidth=width||self.$("stage").width();self._stageHeight=height||self.$("stage").height();if(self._options.swipe){$.each(self._controls.slides,function(i,img){self._scaleImage(img);$(img.container).css("left",self._stageWidth*i)});self.$("images").css("width",self._stageWidth*self.getDataLength())}else{self._scaleImage()}if(self._options.carousel){self.updateCarousel()}var frame=self._controls.frames[self._controls.active];if(frame){self._controls.frames[self._controls.active].scale({width:self._stageWidth,height:self._stageHeight,iframelimit:self._options.maxVideoSize})}self.trigger(Galleria.RESCALE);if(typeof complete==="function"){complete.call(self)}};scale.call(self);return this},refreshImage:function(){this._scaleImage();if(this._options.imagePan){this.addPan()}return this},_preload:function(){if(this._options.preload){var p,i,n=this.getNext(),ndata;try{for(i=this._options.preload;i>0;i--){p=new Galleria.Picture;ndata=this.getData(n);p.preload(this.isFullscreen()&&ndata.big?ndata.big:ndata.image);n=this.getNext(n)}}catch(e){}}},show:function(index,rewind,_history){var swipe=this._options.swipe;if(!swipe&&(this._queue.length>3||index===false||!this._options.queue&&this._queue.stalled)){return}index=M.max(0,M.min(parseInt(index,10),this.getDataLength()-1));rewind=typeof rewind!=="undefined"?!!rewind:index1){return}if(data.iframe){if(self.isPlaying()){self.pause()}var frame=self._controls.frames[self._controls.active],w=self._stageWidth,h=self._stageHeight;$(frame.container).css({width:w,height:h,opacity:0}).show().animate({opacity:1},200);window.setTimeout(function(){frame.load(data.iframe+(data.video?"&autoplay=1":""),{width:w,height:h},function(frame){self.$("container").addClass("videoplay");frame.scale({width:self._stageWidth,height:self._stageHeight,iframelimit:data.video?self._options.maxVideoSize:undef})})},100);return}if(self._options.clicknext&&!Galleria.TOUCH){if(self._options.pauseOnInteraction){self.pause()}self.next();return}if(data.link){if(self._options.popupLinks){win=window.open(data.link,"_blank")}else{window.location.href=data.link}return}if(self._options.lightbox){self.openLightbox()}})}self._playCheck();self.trigger({type:Galleria.IMAGE,index:queue.index,imageTarget:next.image,thumbTarget:thumb.image,galleriaData:data});protoArray.shift.call(self._queue);self._queue.stalled=false;if(self._queue.length){self._show()}}}(data,next,active,queue,thumb);if(this._options.carousel&&this._options.carouselFollow){this._carousel.follow(queue.index)}self._preload();Utils.show(next.container);next.isIframe=data.iframe&&!data.image;$(self._thumbnails[queue.index].container).addClass("active").siblings(".active").removeClass("active");self.trigger({type:Galleria.LOADSTART,cached:cached,index:queue.index,rewind:queue.rewind,imageTarget:next.image,thumbTarget:thumb.image,galleriaData:data});self._queue.stalled=true;next.load(src,function(next){var layer=$(self._layers[1-self._controls.active]).html(data.layer||"").hide();self._scaleImage(next,{complete:function(next){if("image"in active){Utils.toggleQuality(active.image,false)}Utils.toggleQuality(next.image,false);self.removePan();self.setInfo(queue.index);self.setCounter(queue.index);if(data.layer){layer.show();if(data.iframe&&data.image||data.link||self._options.lightbox||self._options.clicknext){layer.css("cursor","pointer").off("mouseup").mouseup(mousetrigger)}}if(data.video&&data.image){_playIcon(next.container)}var transition=self._options.transition;$.each({initial:active.image===null,touch:Galleria.TOUCH,fullscreen:self.isFullscreen()},function(type,arg){if(arg&&self._options[type+"Transition"]!==undef){transition=self._options[type+"Transition"];return false}});if(transition in _transitions.effects===false){complete()}else{var params={prev:active.container,next:next.container,rewind:queue.rewind,speed:self._options.transitionSpeed||400};_transitions.active=true;_transitions.init.call(self,transition,params,complete)}self.trigger({type:Galleria.LOADFINISH,cached:cached,index:queue.index,rewind:queue.rewind,imageTarget:next.image,thumbTarget:self._thumbnails[queue.index].image,galleriaData:self.getData(queue.index)})}})})},getNext:function(base){base=typeof base==="number"?base:this.getIndex();return base===this.getDataLength()-1?0:base+1},getPrev:function(base){base=typeof base==="number"?base:this.getIndex();return base===0?this.getDataLength()-1:base-1},next:function(){if(this.getDataLength()>1){this.show(this.getNext(),false)}return this},prev:function(){if(this.getDataLength()>1){this.show(this.getPrev(),true)}return this},get:function(elemId){return elemId in this._dom?this._dom[elemId]:null},getData:function(index){return index in this._data?this._data[index]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return typeof this._active==="number"?this._active:false},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(key){return typeof key==="undefined"?this._options:this._options[key]},setOptions:function(key,value){if(typeof key==="object"){$.extend(this._options,key)}else{this._options[key]=value}return this},play:function(delay){this._playing=true;this._playtime=delay||this._playtime;this._playCheck();this.trigger(Galleria.PLAY);return this},pause:function(){this._playing=false;this.trigger(Galleria.PAUSE);return this},playToggle:function(delay){return this._playing?this.pause():this.play(delay)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var self=this,played=0,interval=20,now=Utils.timestamp(),timer_id="play"+this._id;if(this._playing){this.clearTimer(timer_id);var fn=function(){played=Utils.timestamp()-now;if(played>=self._playtime&&self._playing){self.clearTimer(timer_id);self.next();return}if(self._playing){self.trigger({type:Galleria.PROGRESS,percent:M.ceil(played/self._playtime*100),seconds:M.floor(played/1e3),milliseconds:played});self.addTimer(timer_id,fn,interval)}};self.addTimer(timer_id,fn,interval)}},setPlaytime:function(delay){this._playtime=delay;return this},setIndex:function(val){this._active=val;return this},setCounter:function(index){if(typeof index==="number"){index++}else if(typeof index==="undefined"){index=this.getIndex()+1}this.get("current").innerHTML=index;if(IE){var count=this.$("counter"),opacity=count.css("opacity");if(parseInt(opacity,10)===1){Utils.removeAlpha(count[0])}else{this.$("counter").css("opacity",opacity)}}return this},setInfo:function(index){var self=this,data=this.getData(index);$.each(["title","description"],function(i,type){var elem=self.$("info-"+type);if(!!data[type]){elem[data[type].length?"show":"hide"]().html(data[type])}else{elem.empty().hide()}});return this},hasInfo:function(index){var check="title description".split(" "),i;for(i=0;check[i];i++){if(!!this.getData(index)[check[i]]){return true}}return false},jQuery:function(str){var self=this,ret=[];$.each(str.split(","),function(i,elemId){elemId=$.trim(elemId);if(self.get(elemId)){ret.push(elemId)}});var jQ=$(self.get(ret.shift()));$.each(ret,function(i,elemId){jQ=jQ.add(self.get(elemId))});return jQ},$:function(str){return this.jQuery.apply(this,Utils.array(arguments))}};$.each(_events,function(i,ev){var type=/_/.test(ev)?ev.replace(/_/g,""):ev;Galleria[ev.toUpperCase()]="galleria."+type});$.extend(Galleria,{IE9:IE===9,IE8:IE===8,IE7:IE===7,IE6:IE===6,IE:IE,WEBKIT:/webkit/.test(NAV),CHROME:/chrome/.test(NAV),SAFARI:/safari/.test(NAV)&&!/chrome/.test(NAV),QUIRK:IE&&doc.compatMode&&doc.compatMode==="BackCompat",MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!window.opera,IPHONE:/iphone/.test(NAV),IPAD:/ipad/.test(NAV),ANDROID:/android/.test(NAV),TOUCH:"ontouchstart"in doc});Galleria.addTheme=function(theme){if(!theme.name){Galleria.raise("No theme name specified")}if(typeof theme.defaults!=="object"){theme.defaults={}}else{theme.defaults=_legacyOptions(theme.defaults)}var css=false,reg;if(typeof theme.css==="string"){$("link").each(function(i,link){reg=new RegExp(theme.css);if(reg.test(link.href)){css=true;_themeLoad(theme);return false}});if(!css){$(function(){var retryCount=0;var tryLoadCss=function(){$("script").each(function(i,script){reg=new RegExp("galleria\\."+theme.name.toLowerCase()+"\\.");if(reg.test(script.src)){css=script.src.replace(/[^\/]*$/,"")+theme.css;window.setTimeout(function(){Utils.loadCSS(css,"galleria-theme-"+theme.name,function(){_themeLoad(theme)})},1)}});if(!css){if(retryCount++>5){Galleria.raise("No theme CSS loaded")}else{window.setTimeout(tryLoadCss,500)}}};tryLoadCss()})}}else{_themeLoad(theme)}return theme};Galleria.loadTheme=function(src,options){if($("script").filter(function(){return $(this).attr("src")==src}).length){return}var loaded=false,err;$(window).load(function(){if(!loaded){err=window.setTimeout(function(){if(!loaded){Galleria.raise("Galleria had problems loading theme at "+src+". Please check theme path or load manually.",true)}},2e4)}});Utils.loadScript(src,function(){loaded=true;window.clearTimeout(err)});return Galleria};Galleria.get=function(index){if(!!_instances[index]){return _instances[index]}else if(typeof index!=="number"){return _instances}else{Galleria.raise("Gallery index "+index+" not found")}};Galleria.configure=function(key,value){var opts={};if(typeof key=="string"&&value){opts[key]=value;key=opts}else{$.extend(opts,key)}Galleria.configure.options=opts;$.each(Galleria.get(),function(i,instance){instance.setOptions(opts)});return Galleria};Galleria.configure.options={};Galleria.on=function(type,callback){if(!type){return}callback=callback||F;var hash=type+callback.toString().replace(/\s/g,"")+Utils.timestamp();$.each(Galleria.get(),function(i,instance){instance._binds.push(hash);instance.bind(type,callback)});Galleria.on.binds.push({type:type,callback:callback,hash:hash});return Galleria};Galleria.on.binds=[];Galleria.run=function(selector,options){if($.isFunction(options)){options={extend:options}}$(selector||"#galleria").galleria(options);return Galleria};Galleria.addTransition=function(name,fn){_transitions.effects[name]=fn;return Galleria};Galleria.utils=Utils;Galleria.log=function(){var args=Utils.array(arguments);if("console"in window&&"log"in window.console){try{return window.console.log.apply(window.console,args)}catch(e){$.each(args,function(){window.console.log(this)})}}else{return window.alert(args.join("
"))}};Galleria.ready=function(fn){if(typeof fn!="function"){return Galleria}$.each(_galleries,function(i,gallery){fn.call(gallery,gallery._options)});Galleria.ready.callbacks.push(fn);return Galleria};Galleria.ready.callbacks=[];Galleria.raise=function(msg,fatal){var type=fatal?"Fatal error":"Error",css={color:"#fff",position:"absolute",top:0,left:0,zIndex:1e5},echo=function(msg){var html='
'+(fatal?""+type+": ":"")+msg+"
";$.each(_instances,function(){var cont=this.$("errors"),target=this.$("target");if(!cont.length){target.css("position","relative");cont=this.addElement("errors").appendChild("target","errors").$("errors").css(css)}cont.append(html)});if(!_instances.length){$("
").css($.extend(css,{position:"fixed"})).append(html).appendTo(DOM().body)}};if(DEBUG){echo(msg);if(fatal){throw new Error(type+": "+msg)}}else if(fatal){if(_hasError){return}_hasError=true;fatal=false;echo("Gallery could not load.")}};Galleria.version=VERSION;Galleria.getLoadedThemes=function(){return $.map(_loadedThemes,function(theme){return theme.name})};Galleria.requires=function(version,msg){msg=msg||"You need to upgrade Galleria to version "+version+" to use one or more components.";if(Galleria.version",{src:src,frameborder:0,id:id,allowfullscreen:true,css:{visibility:"hidden"}})[0];if(size){$(iframe).css(size)}$(this.container).find("iframe,img").remove();this.container.appendChild(this.image);$("#"+id).load(function(self,callback){return function(){window.setTimeout(function(){$(self.image).css("visibility","visible");if(typeof callback=="function"){callback.call(self,self)}},10)}}(this,callback));return this.container}this.image=new Image;if(Galleria.IE8){$(this.image).css("filter","inherit")}if(!Galleria.IE&&!Galleria.CHROME&&!Galleria.SAFARI){$(this.image).css("image-rendering","optimizequality")}var reload=false,resort=false,$container=$(this.container),$image=$(this.image),onerror=function(){if(!reload){reload=true;window.setTimeout(function(image,src){return function(){image.attr("src",src+(src.indexOf("?")>-1?"&":"?")+Utils.timestamp())}}($(this),src),50)}else{if(DUMMY){$(this).attr("src",DUMMY)}else{Galleria.raise("Image not found: "+src)}}},onload=function(self,callback,src){return function(){var complete=function(){$(this).off("load");self.original=size||{height:this.height,width:this.width};if(Galleria.HAS3D){this.style.MozTransform=this.style.webkitTransform="translate3d(0,0,0)"}$container.append(this);self.cache[src]=src;if(typeof callback=="function"){window.setTimeout(function(){callback.call(self,self)},1)}};if(!this.width||!this.height){(function(img){Utils.wait({until:function(){return img.width&&img.height},success:function(){complete.call(img)},error:function(){if(!resort){$(new Image).load(onload).attr("src",img.src);resort=true}else{Galleria.raise("Could not extract width/height from image: "+img.src+". Traced measures: width:"+img.width+"px, height: "+img.height+"px.")}},timeout:100})})(this)}else{complete.call(this)}}}(this,callback,src);$container.find("iframe,img").remove();$image.css("display","block");Utils.hide(this.image);$.each("minWidth minHeight maxWidth maxHeight".split(" "),function(i,prop){$image.css(prop,/min/.test(prop)?"0":"none")});$image.load(onload).on("error",onerror).attr("src",src);return this.container},scale:function(options){var self=this;options=$.extend({width:0,height:0,min:undef,max:undef,margin:0,complete:F,position:"center",crop:false,canvas:false,iframelimit:undef},options);if(this.isIframe){var cw=options.width,ch=options.height,nw,nh;if(options.iframelimit){var r=M.min(options.iframelimit/cw,options.iframelimit/ch);if(r<1){nw=cw*r;nh=ch*r;$(this.image).css({top:ch/2-nh/2,left:cw/2-nw/2,position:"absolute"})}else{$(this.image).css({top:0,left:0})}}$(this.image).width(nw||cw).height(nh||ch).removeAttr("width").removeAttr("height");$(this.container).width(cw).height(ch);options.complete.call(self,self);try{if(this.image.contentWindow){$(this.image.contentWindow).trigger("resize")}}catch(e){}return this.container}if(!this.image){return this.container}var width,height,$container=$(self.container),data;Utils.wait({until:function(){width=options.width||$container.width()||Utils.parseValue($container.css("width"));height=options.height||$container.height()||Utils.parseValue($container.css("height"));return width&&height},success:function(){var newWidth=(width-options.margin*2)/self.original.width,newHeight=(height-options.margin*2)/self.original.height,min=M.min(newWidth,newHeight),max=M.max(newWidth,newHeight),cropMap={true:max,width:newWidth,height:newHeight,false:min,landscape:self.original.width>self.original.height?max:min,portrait:self.original.width0&&has3d!=="none"}();var requestFrame=function(){var r="RequestAnimationFrame";return window.requestAnimationFrame||window["webkit"+r]||window["moz"+r]||window["o"+r]||window["ms"+r]||function(callback){window.setTimeout(callback,1e3/60)}}();var Finger=function(elem,options){this.config={start:0,duration:500,onchange:function(){},oncomplete:function(){},easing:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b}};this.easeout=function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b};if(!elem.children.length){return}var self=this;$.extend(this.config,options);this.elem=elem;this.child=elem.children[0];this.to=this.pos=0;this.touching=false;this.start={};this.index=this.config.start;this.anim=0;this.easing=this.config.easing;if(!has3d){this.child.style.position="absolute";this.elem.style.position="relative"}$.each(["ontouchstart","ontouchmove","ontouchend","setup"],function(i,fn){self[fn]=function(caller){return function(){caller.apply(self,arguments)}}(self[fn])});this.setX=function(){var style=self.child.style;if(!has3d){style.left=self.pos+"px";return}style.MozTransform=style.webkitTransform=style.transform="translate3d("+self.pos+"px,0,0)";return};$(elem).on("touchstart",this.ontouchstart);$(window).on("resize",this.setup);$(window).on("orientationchange",this.setup);this.setup();(function animloop(){requestFrame(animloop);self.loop.call(self)})()};Finger.prototype={constructor:Finger,setup:function(){this.width=$(this.elem).width();this.length=M.ceil($(this.child).width()/this.width);if(this.index!==0){this.index=M.max(0,M.min(this.index,this.length-1));this.pos=this.to=-this.width*this.index}},setPosition:function(pos){this.pos=pos;this.to=pos},ontouchstart:function(e){var touch=e.originalEvent.touches;this.start={pageX:touch[0].pageX,pageY:touch[0].pageY,time:+new Date};this.isScrolling=null;this.touching=true;this.deltaX=0;$doc.on("touchmove",this.ontouchmove);$doc.on("touchend",this.ontouchend)},ontouchmove:function(e){var touch=e.originalEvent.touches;if(touch&&touch.length>1||e.scale&&e.scale!==1){return}this.deltaX=touch[0].pageX-this.start.pageX;if(this.isScrolling===null){this.isScrolling=!!(this.isScrolling||M.abs(this.deltaX)0||this.index==this.length-1&&this.deltaX<0?M.abs(this.deltaX)/this.width+1.8:1;this.to=this.deltaX-this.index*this.width}e.stopPropagation()},ontouchend:function(e){this.touching=false;var isValidSlide=+new Date-this.start.time<250&&M.abs(this.deltaX)>40||M.abs(this.deltaX)>this.width/2,isPastBounds=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0;if(!this.isScrolling){this.show(this.index+(isValidSlide&&!isPastBounds?this.deltaX<0?1:-1:0))}$doc.off("touchmove",this.ontouchmove);$doc.off("touchend",this.ontouchend)},show:function(index){if(index!=this.index){this.config.onchange.call(this,index)}else{this.to=-(index*this.width)}},moveTo:function(index){if(index!=this.index){this.pos=this.to=-(index*this.width);this.index=index}},loop:function(){var distance=this.to-this.pos,factor=1;if(this.width&&distance){factor=M.max(.5,M.min(1.5,M.abs(distance/this.width)))}if(this.touching||M.abs(distance)<=1){this.pos=this.to;distance=0;if(this.anim&&!this.touching){this.config.oncomplete(this.index)}this.anim=0;this.easing=this.config.easing}else{if(!this.anim){this.anim={start:this.pos,time:+new Date,distance:distance,factor:factor,destination:this.to}}var elapsed=+new Date-this.anim.time;var duration=this.config.duration*this.anim.factor;if(elapsed>duration||this.anim.destination!=this.to){this.anim=0;this.easing=this.easeout;return}this.pos=this.easing(null,elapsed,this.anim.start,this.anim.distance,duration)}this.setX()}};return Finger}();$.fn.galleria=function(options){var selector=this.selector;if(!$(this).length){$(function(){if($(selector).length){$(selector).galleria(options)}else{Galleria.utils.wait({until:function(){return $(selector).length},success:function(){$(selector).galleria(options)},error:function(){Galleria.raise('Init failed: Galleria could not find the element "'+selector+'".')},timeout:5e3})}});return this}return this.each(function(){if($.data(this,"galleria")){$.data(this,"galleria").destroy();$(this).find("*").hide()}$.data(this,"galleria",(new Galleria).init(this,options))})};if(typeof module==="object"&&module&&typeof module.exports==="object"){module.exports=Galleria}else{window.Galleria=Galleria;if(typeof define==="function"&&define.amd){define("galleria",["jquery"],function(){return Galleria})}}})(jQuery,this); \ No newline at end of file diff --git a/Resources/public/js/vendor/galleria/galleria-1.4.5.js b/Resources/public/js/vendor/galleria/galleria.js similarity index 99% rename from Resources/public/js/vendor/galleria/galleria-1.4.5.js rename to Resources/public/js/vendor/galleria/galleria.js index 86366a3c..6e3a27f4 100644 --- a/Resources/public/js/vendor/galleria/galleria-1.4.5.js +++ b/Resources/public/js/vendor/galleria/galleria.js @@ -1,7 +1,8 @@ /** - * Galleria v 1.4.5 2016-09-04 + * Galleria v1.5.7 2017-05-10 * http://galleria.io * + * Copyright (c) 2010 - 2016 worse is better UG * Licensed under the MIT license * https://raw.github.com/worseisbetter/galleria/master/LICENSE * @@ -20,7 +21,7 @@ var doc = window.document, protoArray = Array.prototype, // internal constants - VERSION = 1.45, + VERSION = 1.57, DEBUG = true, TIMEOUT = 30000, DUMMY = false, @@ -30,6 +31,10 @@ var doc = window.document, M = Math, F = function(){}, FALSE = function() { return false; }, + MOBILE = !( + ( window.screen.width > 1279 && window.devicePixelRatio == 1 ) || // there are not so many mobile devices with more than 1280px and pixelRatio equal to 1 (i.e. retina displays are equal to 2...) + ( window.screen.width > 1000 && window.innerWidth < (window.screen.width * .9) ) // this checks in the end if a user is using a resized browser window which is not common on mobile devices + ), IE = (function() { var v = 3, @@ -868,7 +873,7 @@ var doc = window.document, Utils.wait({ until: function() { - return $loader.height() == 1; + return $loader.height() > 0; }, success: function() { $loader.remove(); @@ -1087,7 +1092,7 @@ $.event.special['click:fast'] = { }).on('touchstart.fast', function(e) { window.clearTimeout($(this).data('timer')); $(this).data('clickstate', { - touched: true, + touched: true, touchdown: true, coords: getCoords(e.originalEvent), evObj: e @@ -1095,9 +1100,9 @@ $.event.special['click:fast'] = { }).on('touchmove.fast', function(e) { var coords = getCoords(e.originalEvent), state = $(this).data('clickstate'), - distance = Math.max( - Math.abs(state.coords.x - coords.x), - Math.abs(state.coords.y - coords.y) + distance = Math.max( + Math.abs(state.coords.x - coords.x), + Math.abs(state.coords.y - coords.y) ); if ( distance > 6 ) { $(this).data('clickstate', $.extend(state, { @@ -2757,7 +2762,7 @@ Galleria.prototype = { // legacy patch if( s === false || s == 'disabled' ) { return false; } - + return !!Galleria.TOUCH; }( options.swipe )); @@ -3565,12 +3570,14 @@ Galleria.prototype = { } }, thumbload = $( thumb.container ).data( 'thumbload' ); - if ( thumb.video ) { - thumbload.call( self, thumb, callback ); - } else { - thumb.load( data.src , function( thumb ) { - thumbload.call( self, thumb, callback ); - }); + if (thumbload) { + if ( thumb.video ) { + thumbload.call( self, thumb, callback ); + } else { + thumb.load( data.src , function( thumb ) { + thumbload.call( self, thumb, callback ); + }); + } } }); @@ -4022,7 +4029,7 @@ Galleria.prototype = { this.clearTimer(); Utils.removeFromArray( _instances, this ); Utils.removeFromArray( _galleries, this ); - if ( Galleria._waiters.length ) { + if ( Galleria._waiters !== undefined && Galleria._waiters.length ) { $.each( Galleria._waiters, function( i, w ) { if ( w ) window.clearTimeout( w ); }); @@ -5654,7 +5661,7 @@ $.extend( Galleria, { IPHONE: /iphone/.test( NAV ), IPAD: /ipad/.test( NAV ), ANDROID: /android/.test( NAV ), - TOUCH: ('ontouchstart' in doc) + TOUCH: ( 'ontouchstart' in doc ) && MOBILE // rule out false positives on Win10 }); @@ -5682,6 +5689,11 @@ Galleria.addTheme = function( theme ) { Galleria.raise('No theme name specified'); } + // make sure it's compatible + if ( !theme.version || parseInt(Galleria.version*10) > parseInt(theme.version*10) ) { + Galleria.raise('This version of Galleria requires '+theme.name+' theme version '+parseInt(Galleria.version*10)/10+' or later', true); + } + if ( typeof theme.defaults !== 'object' ) { theme.defaults = {}; } else { @@ -5689,7 +5701,7 @@ Galleria.addTheme = function( theme ) { } var css = false, - reg; + reg, reg2; if ( typeof theme.css === 'string' ) { @@ -5723,8 +5735,8 @@ Galleria.addTheme = function( theme ) { $('script').each(function (i, script) { // look for the theme script reg = new RegExp('galleria\\.' + theme.name.toLowerCase() + '\\.'); - if (reg.test(script.src)) { - + reg2 = new RegExp('galleria\\.io\\/theme\\/' + theme.name.toLowerCase() + '\\/(\\d*\\.*)?(\\d*\\.*)?(\\d*\\/)?js'); + if (reg.test(script.src) || reg2.test(script.src)) { // we have a match css = script.src.replace(/[^\/]*$/, '') + theme.css; @@ -5779,7 +5791,7 @@ Galleria.loadTheme = function( src, options ) { err; // start listening for the timeout onload - $( window ).load( function() { + $( window ).on('load', function() { if ( !loaded ) { // give it another 20 seconds err = window.setTimeout(function() { @@ -6156,7 +6168,7 @@ Galleria.Picture.prototype = { */ preload: function( src ) { - $( new Image() ).load((function(src, cache) { + $( new Image() ).on( 'load', (function(src, cache) { return function() { cache[ src ] = src; }; @@ -6200,7 +6212,7 @@ Galleria.Picture.prototype = { this.container.appendChild( this.image ); - $('#'+id).load( (function( self, callback ) { + $('#'+id).on( 'load', (function( self, callback ) { return function() { window.setTimeout(function() { $( self.image ).css( 'visibility', 'visible' ); @@ -6297,7 +6309,7 @@ Galleria.Picture.prototype = { }, error: function() { if ( !resort ) { - $(new Image()).load( onload ).attr( 'src', img.src ); + $(new Image()).on( 'load', onload ).attr( 'src', img.src ); resort = true; } else { Galleria.raise('Could not extract width/height from image: ' + img.src + @@ -6328,7 +6340,7 @@ Galleria.Picture.prototype = { }); // begin load and insert in cache when done - $image.load( onload ).on( 'error', onerror ).attr( 'src', src ); + $image.on( 'load', onload ).on( 'error', onerror ).attr( 'src', src ); // return the container return this.container; diff --git a/Resources/public/js/vendor/galleria/galleria.min.js b/Resources/public/js/vendor/galleria/galleria.min.js new file mode 100644 index 00000000..cfda735c --- /dev/null +++ b/Resources/public/js/vendor/galleria/galleria.min.js @@ -0,0 +1,13 @@ +/** + * Galleria - v1.5.7 2017-05-10 + * https://galleria.io + * + * Copyright (c) 2010 - 2017 worse is better UG + * Licensed under the MIT License. + * https://raw.github.com/worseisbetter/galleria/master/LICENSE + * + */ + +!function(a,b,c,d){var e=b.document,f=a(e),g=a(b),h=Array.prototype,i=1.57,j=!0,k=3e4,l=!1,m=navigator.userAgent.toLowerCase(),n=b.location.hash.replace(/#\//,""),o="file:"==b.location.protocol?"http:":b.location.protocol,p=Math,q=function(){},r=function(){return!1},s=!(b.screen.width>1279&&1==b.devicePixelRatio||b.screen.width>1e3&&b.innerWidth<.9*b.screen.width),t=function(){var a=3,b=e.createElement("div"),c=b.getElementsByTagName("i");do b.innerHTML="";while(c[0]);return a>4?a:e.documentMode||d}(),u=function(){return{html:e.documentElement,body:e.body,head:e.getElementsByTagName("head")[0],title:e.title}},v=b.parent!==b.self,w="data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image",x=function(){var b=[];return a.each(w.split(" "),function(a,c){b.push(c),/_/.test(c)&&b.push(c.replace(/_/g,""))}),b}(),y=function(b){var c;return"object"!=typeof b?b:(a.each(b,function(d,e){/^[a-z]+_/.test(d)&&(c="",a.each(d.split("_"),function(a,b){c+=a>0?b.substr(0,1).toUpperCase()+b.substr(1):b}),b[c]=e,delete b[d])}),b)},z=function(b){return a.inArray(b,x)>-1?c[b.toUpperCase()]:b},A={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&(?:amp;)?)*v(?:<[A-Z]+>)?=([0-9a-zA-Z\-\_]+))/i,embed:function(){return o+"//www.youtube.com/embed/"+this.id},get_thumb:function(a){return o+"//img.youtube.com/vi/"+this.id+"/default.jpg"},get_image:function(a){return o+"//img.youtube.com/vi/"+this.id+"/hqdefault.jpg"}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(){return o+"//player.vimeo.com/video/"+this.id},getUrl:function(){return o+"//vimeo.com/api/v2/video/"+this.id+".json?callback=?"},get_thumb:function(a){return a[0].thumbnail_medium},get_image:function(a){return a[0].thumbnail_large}},dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(){return o+"//www.dailymotion.com/embed/video/"+this.id},getUrl:function(){return"https://api.dailymotion.com/video/"+this.id+"?fields=thumbnail_240_url,thumbnail_720_url&callback=?"},get_thumb:function(a){return a.thumbnail_240_url},get_image:function(a){return a.thumbnail_720_url}},_inst:[]},B=function(c,d){for(var e=0;e=h+d.timeout?(d.error(),!1):void c._waiters.push(g=b.setTimeout(i,10))};c._waiters.push(g=b.setTimeout(i,10))},toggleQuality:function(a,b){7!==t&&8!==t||!a||"IMG"!=a.nodeName.toUpperCase()||("undefined"==typeof b&&(b="nearest-neighbor"===a.style.msInterpolationMode),a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor")},insertStyleTag:function(b,c){if(!c||!a("#"+c).length){var d=e.createElement("style");if(c&&(d.id=c),u().head.appendChild(d),d.styleSheet)d.styleSheet.cssText=b;else{var f=e.createTextNode(b);d.appendChild(f)}}},loadScript:function(b,c){var d=!1,e=a(" - + - + @@ -44,7 +44,7 @@

Galleria Flickr Plugin Demo

- + - + @@ -90,7 +90,7 @@

Galleria History Plugin

- + - + @@ -43,7 +43,7 @@

Galleria Picasa Plugin Demo

+ + + + + + \ No newline at end of file diff --git a/Resources/public/js/vendor/galleria/themes/classic/classic-demo.html b/Resources/public/js/vendor/galleria/themes/classic/classic-demo.html index 220f0c44..a4af9519 100644 --- a/Resources/public/js/vendor/galleria/themes/classic/classic-demo.html +++ b/Resources/public/js/vendor/galleria/themes/classic/classic-demo.html @@ -20,10 +20,11 @@ - + + - + @@ -109,7 +110,7 @@

Galleria Classic Theme

Works for vimeo too. - + Works for youtube too. @@ -120,7 +121,7 @@

Galleria Classic Theme

+ + + + + + diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/fullscreen-demo.html b/Resources/public/js/vendor/galleria/themes/fullscreen/fullscreen-demo.html new file mode 100644 index 00000000..505afc2d --- /dev/null +++ b/Resources/public/js/vendor/galleria/themes/fullscreen/fullscreen-demo.html @@ -0,0 +1,105 @@ + + + + + + Galleria Fullscreen Theme Demo + + + + + + + + + + + + + + + + diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.css b/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.css new file mode 100644 index 00000000..205be229 --- /dev/null +++ b/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.css @@ -0,0 +1,217 @@ +/** + * Galleria Classic Theme 2017-02-27 + * http://galleria.io + * + * Copyright (c) 2010 - 2017 worse is better UG + * Licensed 2017-02-27 under the MIT license + * https://raw.github.com/worseisbetter/galleria/master/LICENSE + * + */ + +#galleria-loader{height:1px!important} + +html, +body { background: #000 } +.galleria-theme-fullscreen { + height: 100%; + overflow: hidden; + position: fixed; + top: 0; + left: 0; + width: 100%; + background: #000; + -webkit-font-smoothing: antialiased; +} +.galleria-theme-fullscreen img { + -moz-user-select: none; + -webkit-user-select: none; + -o-user-select: none; +} +.galleria-theme-fullscreen .galleria-stage { + width: 100%; + height: 100%; + position: absolute; +} +.galleria-theme-fullscreen .galleria-thumbnails-container { + position: absolute; + bottom: 0; + z-index: 2; + padding-top: 16px; + width: 100%; +} +.galleria-theme-fullscreen.videoplay .galleria-thumbnails-container { display:none!important; } +.galleria-theme-fullscreen.videoplay .galleria-image-nav { top:80px; bottom:80px; height:auto; } + +.galleria-theme-fullscreen .galleria-thumbnails-tab { + opacity: .7; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; + filter: alpha(opacity=70); + position: absolute; + left: 50%; + margin-left: -50px; + top: 0; + height: 16px; + width: 100px; + background: #000 url(up.gif) no-repeat 50% 5px; + cursor: pointer; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; +} +.galleria-theme-fullscreen.light .galleria-thumbnails-tab { + background:#fff url(up-neg.gif) no-repeat 50% 50%; + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); +} +.galleria-theme-fullscreen .galleria-thumbnails-tab:hover { + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); +} +.galleria-theme-fullscreen .galleria-thumbnails-tab.open, +.galleria-theme-fullscreen .galleria-thumbnails-tab.open:hover { + background-image: url(down.gif); + opacity: 1; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); +} +.galleria-theme-fullscreen.light .galleria-thumbnails-tab.open, +.galleria-theme-fullscreen.light .galleria-thumbnails-tab.open:hover { + background-image: url(down-neg.gif); +} +.galleria-theme-fullscreen .galleria-thumbnails { + background: #000; + overflow: hidden; +} +.galleria-theme-fullscreen .galleria-thumbnails-list { + background: #000; + padding-top: 5px; + padding-bottom: 5px; + overflow: hidden; +} +.galleria-theme-fullscreen.light .galleria-thumbnails, +.galleria-theme-fullscreen.light .galleria-thumbnails-list { + background:#fff; +} +.galleria-theme-fullscreen .galleria-thumbnails .galleria-image { + width: 80px; + height: 50px; + float: left; + cursor: pointer; + margin-right: 5px; +} +.galleria-theme-fullscreen .galleria-thumbnails .galleria-image img { background: #000 } +.galleria-theme-fullscreen .galleria-thumbnails .active { cursor: default } +.galleria-theme-fullscreen .galleria-carousel .galleria-thumbnails-list { + border-left: 30px solid #000; + border-right: 30px solid #000; +} +.galleria-theme-fullscreen.light .galleria-carousel .galleria-thumbnails-list { + border-color: #fff; +} +.galleria-theme-fullscreen .galleria-image-nav { + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; +} +.galleria-theme-fullscreen .galleria-image-nav-right, +.galleria-theme-fullscreen .galleria-image-nav-left { + width: 100px; + right: 0; + top: 0; + bottom: 0; + background: url(r.gif) no-repeat 50% 50%; + position: absolute; + cursor: pointer; + z-index: 2; + display: none; +} +.galleria-theme-fullscreen.smallarrows .galleria-image-nav-right { + background-image: url(r-neg.png); +} +.galleria-theme-fullscreen .galleria-image-nav-left { + left: 0; + right: auto; + background-image: url(l.gif); +} +.galleria-theme-fullscreen.smallarrows .galleria-image-nav-left { + background-image: url(l-neg.png); +} +.galleria-theme-fullscreen .galleria-loader { + width: 30px; + height: 30px; + background: #fff url(loader.gif) no-repeat 50% 50%; + position: absolute; + top: 50%; + left: 50%; + margin-top: -15px; + margin-left: -15px; + z-index: 3; +} +.galleria-theme-fullscreen .galleria-info { + z-index: 4; + font: 13px/1.4 helvetica,arial,sans-serif; + color: #fff; + position: absolute; + top: 0; + width: 100%; + border-top: 2px solid #000; + display: none; + text-align: center; + padding: 10px 0; + background: rgba(0,0,0,.5); + border-bottom:1px solid rgba(0,0,0,.1); +} +.galleria-theme-fullscreen.light .galleria-info{background:rgba(255,255,255,.5);color:#000;} +.galleria-theme-fullscreen .galleria-info-text { + width: 50%; + margin: 0 auto; +} +.galleria-theme-fullscreen .galleria-info-title { font-weight: bold; display: inline-block; margin-right:10px; } +.galleria-theme-fullscreen .galleria-info-description { display:inline-block; } +.galleria-theme-fullscreen .galleria-thumb-nav-left, +.galleria-theme-fullscreen .galleria-thumb-nav-right { + cursor: pointer; + display: none; + background: url(p.gif) no-repeat 50% 50%; + position: absolute; + left: 5px; + top: 21px; + bottom: 5px; + width: 20px; + z-index: 3; + opacity: .8; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + filter: alpha(opacity=80); +} +.galleria-theme-fullscreen.light .galleria-thumb-nav-left{ + background-image: url(p-neg.png); +} +.galleria-theme-fullscreen .galleria-thumb-nav-right { + background-image: url(n.gif); + left: auto; + right: 5px; +} +.galleria-theme-fullscreen.light .galleria-thumb-nav-right{ + background-image: url(n-neg.png); +} +.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-left, +.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-right { display: block } +.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-left:hover, +.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-right:hover { background-color: #222 } +.galleria-theme-fullscreen .galleria-thumb-nav-left.disabled, +.galleria-theme-fullscreen .galleria-thumb-nav-right.disabled, +.galleria-theme-fullscreen .galleria-thumb-nav-left.disabled:hover, +.galleria-theme-fullscreen .galleria-thumb-nav-right.disabled:hover { + opacity: .2; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"; + filter: alpha(opacity=20); + cursor: default; +} +.galleria-theme-fullscreen.light .galleria-carousel .galleria-thumb-nav-left:hover, +.galleria-theme-fullscreen.light .galleria-carousel .galleria-thumb-nav-right:hover { background-color: #ddd } + diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.js b/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.js new file mode 100644 index 00000000..4bb6608f --- /dev/null +++ b/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.js @@ -0,0 +1,182 @@ +/** + * Galleria Classic Theme 2017-02-27 + * http://galleria.io + * + * Copyright (c) 2010 - 2017 worse is better UG + * Licensed 2017-02-27 under the MIT license + * https://raw.github.com/worseisbetter/galleria/master/LICENSE + * + */ + +(function($) { + +/*global jQuery, Galleria, window */ + +Galleria.addTheme({ + name: 'fullscreen', + version: '1.5.4', + author: 'Galleria', + css: 'galleria.fullscreen.css', + // begin site script + defaults: { + transition: 'none', + imageCrop: true, + thumbCrop: 'height', + easing: 'galleriaOut', + trueFullscreen: false, + + // set this to false if you want to keep the thumbnails: + _hideDock: Galleria.TOUCH ? false : true, + + // set this to true if you want to shrink the carousel when clicking a thumbnail: + _closeOnClick: false + }, + init: function(options) { + + Galleria.requires( 1.5, 'This version of Fullscreen theme requires Galleria version 1.5 or later'); + + this.addElement('thumbnails-tab'); + this.appendChild('thumbnails-container', 'thumbnails-tab'); + + var tab = this.$('thumbnails-tab'), + loader = this.$('loader'), + thumbs = this.$('thumbnails-container'), + list = this.$('thumbnails-list'), + infotext = this.$('info-text'), + info = this.$('info'), + OPEN = !options._hideDock, + POS = 0; + + if (Galleria.IE) { + this.addElement('iefix'); + this.appendChild('container', 'iefix'); + this.$('iefix').css({ + zIndex: 3, + position: 'absolute', + backgroundColor: this.hasVariation('light') ? '#fff' : '#000', + opacity: 0.4, + top: 0 + }); + } + + if ( options.thumbnails === false ) { + thumbs.hide(); + } + + var fixCaption = this.proxy(function(img) { + + var w = img.width || $(img).width(); + + if (!(img || w)) { + return; + } + w = Math.min(w, $(window).width()); + infotext.width(w - 40); + if (Galleria.IE && this.getOptions('showInfo')) { + this.$('iefix').width(info.outerWidth()).height(info.outerHeight()); + } + }); + + this.bind('rescale', function() { + POS = this.getStageHeight() - tab.height() - 2; + thumbs.css('top', OPEN ? POS - list.outerHeight() + 2 : POS); + var img = this.getActiveImage(); + if (img) { + fixCaption(img); + } + }); + + this.bind('loadstart', function(e) { + if (!e.cached) { + loader.show().fadeTo(100, 1); + } + $(e.thumbTarget).css('opacity', 1).parent().siblings().children().css('opacity', 0.6); + }); + + this.bind('loadfinish', function(e) { + loader.fadeOut(300); + this.$('info, iefix').toggle(this.hasInfo()); + }); + + this.bind('image', function(e) { + e.imageTarget && fixCaption(e.imageTarget); + }); + + this.bind('thumbnail', function(e) { + $(e.thumbTarget).parent(':not(.active)').children().css('opacity', 0.6); + $(e.thumbTarget).on('click:fast', function() { + if (OPEN && options._closeOnClick) { + tab.trigger('click:fast'); + } + }); + }); + + this.trigger('rescale'); + + if ( !Galleria.TOUCH ) { + + this.addIdleState(thumbs, { opacity: 0 }); + this.addIdleState(this.get('info'), { opacity: 0 }); + + this.$('image-nav-left, image-nav-right').css('opacity', 0.01).hover(function() { + $(this).animate({opacity: 1}, 100); + }, function() { + $(this).animate({opacity: 0}); + }).show(); + + } + + if (Galleria.IE) { + this.addIdleState(this.get('iefix'), { opacity: 0 }); + } + + if (options._hideDock) { + tab.on('click:fast', this.proxy(function() { + tab.toggleClass('open', !OPEN); + if (!OPEN) { + thumbs.animate({ + top: POS - list.outerHeight() + 2 + }, 400, options.easing); + } else { + thumbs.animate({ + top: POS + }, 400, options.easing); + } + OPEN = !OPEN; + })); + } else { + this.bind('thumbnail', function() { + thumbs.css('top', POS - list.outerHeight() + 2); + }); + tab.css('visibility', 'hidden'); + } + + this.$('thumbnails').children().hover(function() { + $(this).not('.active').children().stop().fadeTo(100, 1); + }, function() { + $(this).not('.active').children().stop().fadeTo(400, 0.6); + }); + + this.enterFullscreen(); + this.attachKeyboard({ + escape: function(e) { + return false; + }, + up: function(e) { + if (!OPEN) { + tab.trigger('click:fast'); + } + e.preventDefault(); + }, + down: function(e) { + if (OPEN) { + tab.trigger('click:fast'); + } + e.preventDefault(); + } + }); + } + // end site script +}); + +}(jQuery)); diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.min.css b/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.min.css new file mode 100644 index 00000000..6e5e1606 --- /dev/null +++ b/Resources/public/js/vendor/galleria/themes/fullscreen/galleria.fullscreen.min.css @@ -0,0 +1 @@ +#galleria-loader{height:1px!important}body,html{background:#000}.galleria-theme-fullscreen{height:100%;overflow:hidden;position:fixed;top:0;left:0;width:100%;background:#000;-webkit-font-smoothing:antialiased}.galleria-theme-fullscreen img{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none}.galleria-theme-fullscreen .galleria-stage{width:100%;height:100%;position:absolute}.galleria-theme-fullscreen .galleria-thumbnails-container{position:absolute;bottom:0;z-index:2;padding-top:16px;width:100%}.galleria-theme-fullscreen.videoplay .galleria-thumbnails-container{display:none!important}.galleria-theme-fullscreen.videoplay .galleria-image-nav{top:80px;bottom:80px;height:auto}.galleria-theme-fullscreen .galleria-thumbnails-tab{opacity:.7;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";filter:alpha(opacity=70);position:absolute;left:50%;margin-left:-50px;top:0;height:16px;width:100px;background:url(up.gif) 50% 5px no-repeat #000;cursor:pointer;-moz-border-radius-topleft:4px;-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-webkit-border-top-left-radius:4px}.galleria-theme-fullscreen.light .galleria-thumbnails-tab{background:url(up-neg.gif) 50% 50% no-repeat #fff;opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100)}.galleria-theme-fullscreen .galleria-thumbnails-tab:hover{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100)}.galleria-theme-fullscreen .galleria-thumbnails-tab.open,.galleria-theme-fullscreen .galleria-thumbnails-tab.open:hover{background-image:url(down.gif);opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100)}.galleria-theme-fullscreen.light .galleria-thumbnails-tab.open,.galleria-theme-fullscreen.light .galleria-thumbnails-tab.open:hover{background-image:url(down-neg.gif)}.galleria-theme-fullscreen .galleria-thumbnails{background:#000;overflow:hidden}.galleria-theme-fullscreen .galleria-thumbnails-list{background:#000;padding-top:5px;padding-bottom:5px;overflow:hidden}.galleria-theme-fullscreen.light .galleria-thumbnails,.galleria-theme-fullscreen.light .galleria-thumbnails-list{background:#fff}.galleria-theme-fullscreen .galleria-thumbnails .galleria-image{width:80px;height:50px;float:left;cursor:pointer;margin-right:5px}.galleria-theme-fullscreen .galleria-thumbnails .galleria-image img{background:#000}.galleria-theme-fullscreen .galleria-thumbnails .active{cursor:default}.galleria-theme-fullscreen .galleria-carousel .galleria-thumbnails-list{border-left:30px solid #000;border-right:30px solid #000}.galleria-theme-fullscreen.light .galleria-carousel .galleria-thumbnails-list{border-color:#fff}.galleria-theme-fullscreen .galleria-image-nav{width:100%;height:100%;position:absolute;top:0;left:0}.galleria-theme-fullscreen .galleria-image-nav-left,.galleria-theme-fullscreen .galleria-image-nav-right{width:100px;right:0;top:0;bottom:0;background:url(r.gif) 50% 50% no-repeat;position:absolute;cursor:pointer;z-index:2;display:none}.galleria-theme-fullscreen.smallarrows .galleria-image-nav-right{background-image:url(r-neg.png)}.galleria-theme-fullscreen .galleria-image-nav-left{left:0;right:auto;background-image:url(l.gif)}.galleria-theme-fullscreen.smallarrows .galleria-image-nav-left{background-image:url(l-neg.png)}.galleria-theme-fullscreen .galleria-loader{width:30px;height:30px;background:url(loader.gif) 50% 50% no-repeat #fff;position:absolute;top:50%;left:50%;margin-top:-15px;margin-left:-15px;z-index:3}.galleria-theme-fullscreen .galleria-info{z-index:4;font:13px/1.4 helvetica,arial,sans-serif;color:#fff;position:absolute;top:0;width:100%;border-top:2px solid #000;display:none;text-align:center;padding:10px 0;background:rgba(0,0,0,.5);border-bottom:1px solid rgba(0,0,0,.1)}.galleria-theme-fullscreen.light .galleria-info{background:rgba(255,255,255,.5);color:#000}.galleria-theme-fullscreen .galleria-info-text{width:50%;margin:0 auto}.galleria-theme-fullscreen .galleria-info-title{font-weight:700;display:inline-block;margin-right:10px}.galleria-theme-fullscreen .galleria-info-description{display:inline-block}.galleria-theme-fullscreen .galleria-thumb-nav-left,.galleria-theme-fullscreen .galleria-thumb-nav-right{cursor:pointer;display:none;background:url(p.gif) 50% 50% no-repeat;position:absolute;left:5px;top:21px;bottom:5px;width:20px;z-index:3;opacity:.8;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";filter:alpha(opacity=80)}.galleria-theme-fullscreen.light .galleria-thumb-nav-left{background-image:url(p-neg.png)}.galleria-theme-fullscreen .galleria-thumb-nav-right{background-image:url(n.gif);left:auto;right:5px}.galleria-theme-fullscreen.light .galleria-thumb-nav-right{background-image:url(n-neg.png)}.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-left,.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-right{display:block}.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-left:hover,.galleria-theme-fullscreen .galleria-carousel .galleria-thumb-nav-right:hover{background-color:#222}.galleria-theme-fullscreen .galleria-thumb-nav-left.disabled,.galleria-theme-fullscreen .galleria-thumb-nav-left.disabled:hover,.galleria-theme-fullscreen .galleria-thumb-nav-right.disabled,.galleria-theme-fullscreen .galleria-thumb-nav-right.disabled:hover{opacity:.2;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";filter:alpha(opacity=20);cursor:default}.galleria-theme-fullscreen.light .galleria-carousel .galleria-thumb-nav-left:hover,.galleria-theme-fullscreen.light .galleria-carousel .galleria-thumb-nav-right:hover{background-color:#ddd} \ No newline at end of file diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/i.png b/Resources/public/js/vendor/galleria/themes/fullscreen/i.png new file mode 100644 index 00000000..2e61d85c Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/i.png differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/index.html b/Resources/public/js/vendor/galleria/themes/fullscreen/index.html new file mode 100644 index 00000000..e69de29b diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/l-neg.png b/Resources/public/js/vendor/galleria/themes/fullscreen/l-neg.png new file mode 100644 index 00000000..9c474903 Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/l-neg.png differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/l.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/l.gif new file mode 100644 index 00000000..36b43faf Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/l.gif differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/loader.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/loader.gif new file mode 100644 index 00000000..e0057080 Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/loader.gif differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/n-neg.png b/Resources/public/js/vendor/galleria/themes/fullscreen/n-neg.png new file mode 100644 index 00000000..61c9b3f9 Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/n-neg.png differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/n.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/n.gif new file mode 100644 index 00000000..df1d4ed9 Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/n.gif differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/p-neg.png b/Resources/public/js/vendor/galleria/themes/fullscreen/p-neg.png new file mode 100644 index 00000000..aeee4121 Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/p-neg.png differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/p.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/p.gif new file mode 100644 index 00000000..9626e4ec Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/p.gif differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/r-neg.png b/Resources/public/js/vendor/galleria/themes/fullscreen/r-neg.png new file mode 100644 index 00000000..dc909aa5 Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/r-neg.png differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/r.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/r.gif new file mode 100644 index 00000000..2d6a6ead Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/r.gif differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/up-neg.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/up-neg.gif new file mode 100644 index 00000000..d9556e7f Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/up-neg.gif differ diff --git a/Resources/public/js/vendor/galleria/themes/fullscreen/up.gif b/Resources/public/js/vendor/galleria/themes/fullscreen/up.gif new file mode 100644 index 00000000..fc00d14f Binary files /dev/null and b/Resources/public/js/vendor/galleria/themes/fullscreen/up.gif differ diff --git a/Resources/public/js/vendor/imagesloaded.pkgd.min.js b/Resources/public/js/vendor/imagesloaded.pkgd.min.js index 37f12839..e443a77d 100644 --- a/Resources/public/js/vendor/imagesloaded.pkgd.min.js +++ b/Resources/public/js/vendor/imagesloaded.pkgd.min.js @@ -1,7 +1,7 @@ /*! - * imagesLoaded PACKAGED v4.1.1 + * imagesLoaded PACKAGED v4.1.4 * JavaScript is all like "You images are done yet or what?" * MIT License */ -!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i@*'+~#";.,=\- \/${}%?`]/g, - root : '#' - }; - /** - * creates a jstree instance - * @name $.jstree.create(el [, options]) - * @param {DOMElement|jQuery|String} el the element to create the instance on, can be jQuery extended or a selector - * @param {Object} options options for this instance (extends `$.jstree.defaults`) - * @return {jsTree} the new instance - */ - $.jstree.create = function (el, options) { - var tmp = new $.jstree.core(++instance_counter), - opt = options; - options = $.extend(true, {}, $.jstree.defaults, options); - if(opt && opt.plugins) { - options.plugins = opt.plugins; - } - $.each(options.plugins, function (i, k) { - if(i !== 'core') { - tmp = tmp.plugin(k, options[k]); - } - }); - $(el).data('jstree', tmp); - tmp.init(el, options); - return tmp; - }; - /** - * remove all traces of jstree from the DOM and destroy all instances - * @name $.jstree.destroy() - */ - $.jstree.destroy = function () { - $('.jstree:jstree').jstree('destroy'); - $(document).off('.jstree'); - }; - /** - * the jstree class constructor, used only internally - * @private - * @name $.jstree.core(id) - * @param {Number} id this instance's index - */ - $.jstree.core = function (id) { - this._id = id; - this._cnt = 0; - this._wrk = null; - this._data = { - core : { - themes : { - name : false, - dots : false, - icons : false - }, - selected : [], - last_error : {}, - working : false, - worker_queue : [], - focused : null - } - }; - }; - /** - * get a reference to an existing instance - * - * __Examples__ - * - * // provided a container with an ID of "tree", and a nested node with an ID of "branch" - * // all of there will return the same instance - * $.jstree.reference('tree'); - * $.jstree.reference('#tree'); - * $.jstree.reference($('#tree')); - * $.jstree.reference(document.getElementByID('tree')); - * $.jstree.reference('branch'); - * $.jstree.reference('#branch'); - * $.jstree.reference($('#branch')); - * $.jstree.reference(document.getElementByID('branch')); - * - * @name $.jstree.reference(needle) - * @param {DOMElement|jQuery|String} needle - * @return {jsTree|null} the instance or `null` if not found - */ - $.jstree.reference = function (needle) { - var tmp = null, - obj = null; - if(needle && needle.id && (!needle.tagName || !needle.nodeType)) { needle = needle.id; } - - if(!obj || !obj.length) { - try { obj = $(needle); } catch (ignore) { } - } - if(!obj || !obj.length) { - try { obj = $('#' + needle.replace($.jstree.idregex,'\\$&')); } catch (ignore) { } - } - if(obj && obj.length && (obj = obj.closest('.jstree')).length && (obj = obj.data('jstree'))) { - tmp = obj; - } - else { - $('.jstree').each(function () { - var inst = $(this).data('jstree'); - if(inst && inst._model.data[needle]) { - tmp = inst; - return false; - } - }); - } - return tmp; - }; - /** - * Create an instance, get an instance or invoke a command on a instance. - * - * If there is no instance associated with the current node a new one is created and `arg` is used to extend `$.jstree.defaults` for this new instance. There would be no return value (chaining is not broken). - * - * If there is an existing instance and `arg` is a string the command specified by `arg` is executed on the instance, with any additional arguments passed to the function. If the function returns a value it will be returned (chaining could break depending on function). - * - * If there is an existing instance and `arg` is not a string the instance itself is returned (similar to `$.jstree.reference`). - * - * In any other case - nothing is returned and chaining is not broken. - * - * __Examples__ - * - * $('#tree1').jstree(); // creates an instance - * $('#tree2').jstree({ plugins : [] }); // create an instance with some options - * $('#tree1').jstree('open_node', '#branch_1'); // call a method on an existing instance, passing additional arguments - * $('#tree2').jstree(); // get an existing instance (or create an instance) - * $('#tree2').jstree(true); // get an existing instance (will not create new instance) - * $('#branch_1').jstree().select_node('#branch_1'); // get an instance (using a nested element and call a method) - * - * @name $().jstree([arg]) - * @param {String|Object} arg - * @return {Mixed} - */ - $.fn.jstree = function (arg) { - // check for string argument - var is_method = (typeof arg === 'string'), - args = Array.prototype.slice.call(arguments, 1), - result = null; - if(arg === true && !this.length) { return false; } - this.each(function () { - // get the instance (if there is one) and method (if it exists) - var instance = $.jstree.reference(this), - method = is_method && instance ? instance[arg] : null; - // if calling a method, and method is available - execute on the instance - result = is_method && method ? - method.apply(instance, args) : - null; - // if there is no instance and no method is being called - create one - if(!instance && !is_method && (arg === undefined || $.isPlainObject(arg))) { - $.jstree.create(this, arg); - } - // if there is an instance and no method is called - return the instance - if( (instance && !is_method) || arg === true ) { - result = instance || false; - } - // if there was a method call which returned a result - break and return the value - if(result !== null && result !== undefined) { - return false; - } - }); - // if there was a method call with a valid return value - return that, otherwise continue the chain - return result !== null && result !== undefined ? - result : this; - }; - /** - * used to find elements containing an instance - * - * __Examples__ - * - * $('div:jstree').each(function () { - * $(this).jstree('destroy'); - * }); - * - * @name $(':jstree') - * @return {jQuery} - */ - $.expr[':'].jstree = $.expr.createPseudo(function(search) { - return function(a) { - return $(a).hasClass('jstree') && - $(a).data('jstree') !== undefined; - }; - }); - - /** - * stores all defaults for the core - * @name $.jstree.defaults.core - */ - $.jstree.defaults.core = { - /** - * data configuration - * - * If left as `false` the HTML inside the jstree container element is used to populate the tree (that should be an unordered list with list items). - * - * You can also pass in a HTML string or a JSON array here. - * - * It is possible to pass in a standard jQuery-like AJAX config and jstree will automatically determine if the response is JSON or HTML and use that to populate the tree. - * In addition to the standard jQuery ajax options here you can suppy functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node is being loaded, the return value of those functions will be used. - * - * The last option is to specify a function, that function will receive the node being loaded as argument and a second param which is a function which should be called with the result. - * - * __Examples__ - * - * // AJAX - * $('#tree').jstree({ - * 'core' : { - * 'data' : { - * 'url' : '/get/children/', - * 'data' : function (node) { - * return { 'id' : node.id }; - * } - * } - * }); - * - * // direct data - * $('#tree').jstree({ - * 'core' : { - * 'data' : [ - * 'Simple root node', - * { - * 'id' : 'node_2', - * 'text' : 'Root node with options', - * 'state' : { 'opened' : true, 'selected' : true }, - * 'children' : [ { 'text' : 'Child 1' }, 'Child 2'] - * } - * ] - * }); - * - * // function - * $('#tree').jstree({ - * 'core' : { - * 'data' : function (obj, callback) { - * callback.call(this, ['Root 1', 'Root 2']); - * } - * }); - * - * @name $.jstree.defaults.core.data - */ - data : false, - /** - * configure the various strings used throughout the tree - * - * You can use an object where the key is the string you need to replace and the value is your replacement. - * Another option is to specify a function which will be called with an argument of the needed string and should return the replacement. - * If left as `false` no replacement is made. - * - * __Examples__ - * - * $('#tree').jstree({ - * 'core' : { - * 'strings' : { - * 'Loading ...' : 'Please wait ...' - * } - * } - * }); - * - * @name $.jstree.defaults.core.strings - */ - strings : false, - /** - * determines what happens when a user tries to modify the structure of the tree - * If left as `false` all operations like create, rename, delete, move or copy are prevented. - * You can set this to `true` to allow all interactions or use a function to have better control. - * - * __Examples__ - * - * $('#tree').jstree({ - * 'core' : { - * 'check_callback' : function (operation, node, node_parent, node_position, more) { - * // operation can be 'create_node', 'rename_node', 'delete_node', 'move_node' or 'copy_node' - * // in case of 'rename_node' node_position is filled with the new node name - * return operation === 'rename_node' ? true : false; - * } - * } - * }); - * - * @name $.jstree.defaults.core.check_callback - */ - check_callback : false, - /** - * a callback called with a single object parameter in the instance's scope when something goes wrong (operation prevented, ajax failed, etc) - * @name $.jstree.defaults.core.error - */ - error : $.noop, - /** - * the open / close animation duration in milliseconds - set this to `false` to disable the animation (default is `200`) - * @name $.jstree.defaults.core.animation - */ - animation : 200, - /** - * a boolean indicating if multiple nodes can be selected - * @name $.jstree.defaults.core.multiple - */ - multiple : true, - /** - * theme configuration object - * @name $.jstree.defaults.core.themes - */ - themes : { - /** - * the name of the theme to use (if left as `false` the default theme is used) - * @name $.jstree.defaults.core.themes.name - */ - name : false, - /** - * the URL of the theme's CSS file, leave this as `false` if you have manually included the theme CSS (recommended). You can set this to `true` too which will try to autoload the theme. - * @name $.jstree.defaults.core.themes.url - */ - url : false, - /** - * the location of all jstree themes - only used if `url` is set to `true` - * @name $.jstree.defaults.core.themes.dir - */ - dir : false, - /** - * a boolean indicating if connecting dots are shown - * @name $.jstree.defaults.core.themes.dots - */ - dots : true, - /** - * a boolean indicating if node icons are shown - * @name $.jstree.defaults.core.themes.icons - */ - icons : true, - /** - * a boolean indicating if the tree background is striped - * @name $.jstree.defaults.core.themes.stripes - */ - stripes : false, - /** - * a string (or boolean `false`) specifying the theme variant to use (if the theme supports variants) - * @name $.jstree.defaults.core.themes.variant - */ - variant : false, - /** - * a boolean specifying if a reponsive version of the theme should kick in on smaller screens (if the theme supports it). Defaults to `false`. - * @name $.jstree.defaults.core.themes.responsive - */ - responsive : false - }, - /** - * if left as `true` all parents of all selected nodes will be opened once the tree loads (so that all selected nodes are visible to the user) - * @name $.jstree.defaults.core.expand_selected_onload - */ - expand_selected_onload : true, - /** - * if left as `true` web workers will be used to parse incoming JSON data where possible, so that the UI will not be blocked by large requests. Workers are however about 30% slower. Defaults to `true` - * @name $.jstree.defaults.core.worker - */ - worker : true, - /** - * Force node text to plain text (and escape HTML). Defaults to `false` - * @name $.jstree.defaults.core.force_text - */ - force_text : false, - /** - * Should the node should be toggled if the text is double clicked . Defaults to `true` - * @name $.jstree.defaults.core.dblclick_toggle - */ - dblclick_toggle : true - }; - $.jstree.core.prototype = { - /** - * used to decorate an instance with a plugin. Used internally. - * @private - * @name plugin(deco [, opts]) - * @param {String} deco the plugin to decorate with - * @param {Object} opts options for the plugin - * @return {jsTree} - */ - plugin : function (deco, opts) { - var Child = $.jstree.plugins[deco]; - if(Child) { - this._data[deco] = {}; - Child.prototype = this; - return new Child(opts, this); - } - return this; - }, - /** - * initialize the instance. Used internally. - * @private - * @name init(el, optons) - * @param {DOMElement|jQuery|String} el the element we are transforming - * @param {Object} options options for this instance - * @trigger init.jstree, loading.jstree, loaded.jstree, ready.jstree, changed.jstree - */ - init : function (el, options) { - this._model = { - data : {}, - changed : [], - force_full_redraw : false, - redraw_timeout : false, - default_state : { - loaded : true, - opened : false, - selected : false, - disabled : false - } - }; - this._model.data[$.jstree.root] = { - id : $.jstree.root, - parent : null, - parents : [], - children : [], - children_d : [], - state : { loaded : false } - }; - - this.element = $(el).addClass('jstree jstree-' + this._id); - this.settings = options; - - this._data.core.ready = false; - this._data.core.loaded = false; - this._data.core.rtl = (this.element.css("direction") === "rtl"); - this.element[this._data.core.rtl ? 'addClass' : 'removeClass']("jstree-rtl"); - this.element.attr('role','tree'); - if(this.settings.core.multiple) { - this.element.attr('aria-multiselectable', true); - } - if(!this.element.attr('tabindex')) { - this.element.attr('tabindex','0'); - } - - this.bind(); - /** - * triggered after all events are bound - * @event - * @name init.jstree - */ - this.trigger("init"); - - this._data.core.original_container_html = this.element.find(" > ul > li").clone(true); - this._data.core.original_container_html - .find("li").addBack() - .contents().filter(function() { - return this.nodeType === 3 && (!this.nodeValue || /^\s+$/.test(this.nodeValue)); - }) - .remove(); - this.element.html("<"+"ul class='jstree-container-ul jstree-children' role='group'><"+"li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><"+"a class='jstree-anchor' href='#'>" + this.get_string("Loading ...") + ""); - this.element.attr('aria-activedescendant','j' + this._id + '_loading'); - this._data.core.li_height = this.get_container_ul().children("li").first().height() || 24; - /** - * triggered after the loading text is shown and before loading starts - * @event - * @name loading.jstree - */ - this.trigger("loading"); - this.load_node($.jstree.root); - }, - /** - * destroy an instance - * @name destroy() - * @param {Boolean} keep_html if not set to `true` the container will be emptied, otherwise the current DOM elements will be kept intact - */ - destroy : function (keep_html) { - if(this._wrk) { - try { - window.URL.revokeObjectURL(this._wrk); - this._wrk = null; - } - catch (ignore) { } - } - if(!keep_html) { this.element.empty(); } - this.teardown(); - }, - /** - * part of the destroying of an instance. Used internally. - * @private - * @name teardown() - */ - teardown : function () { - this.unbind(); - this.element - .removeClass('jstree') - .removeData('jstree') - .find("[class^='jstree']") - .addBack() - .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); - this.element = null; - }, - /** - * bind all events. Used internally. - * @private - * @name bind() - */ - bind : function () { - var word = '', - tout = null, - was_click = 0; - this.element - .on("dblclick.jstree", function (e) { - if(e.target.tagName && e.target.tagName.toLowerCase() === "input") { return true; } - if(document.selection && document.selection.empty) { - document.selection.empty(); - } - else { - if(window.getSelection) { - var sel = window.getSelection(); - try { - sel.removeAllRanges(); - sel.collapse(); - } catch (ignore) { } - } - } - }) - .on("mousedown.jstree", $.proxy(function (e) { - if(e.target === this.element[0]) { - e.preventDefault(); // prevent losing focus when clicking scroll arrows (FF, Chrome) - was_click = +(new Date()); // ie does not allow to prevent losing focus - } - }, this)) - .on("mousedown.jstree", ".jstree-ocl", function (e) { - e.preventDefault(); // prevent any node inside from losing focus when clicking the open/close icon - }) - .on("click.jstree", ".jstree-ocl", $.proxy(function (e) { - this.toggle_node(e.target); - }, this)) - .on("dblclick.jstree", ".jstree-anchor", $.proxy(function (e) { - if(e.target.tagName && e.target.tagName.toLowerCase() === "input") { return true; } - if(this.settings.core.dblclick_toggle) { - this.toggle_node(e.target); - } - }, this)) - .on("click.jstree", ".jstree-anchor", $.proxy(function (e) { - e.preventDefault(); - if(e.currentTarget !== document.activeElement) { $(e.currentTarget).focus(); } - this.activate_node(e.currentTarget, e); - }, this)) - .on('keydown.jstree', '.jstree-anchor', $.proxy(function (e) { - if(e.target.tagName && e.target.tagName.toLowerCase() === "input") { return true; } - if(e.which !== 32 && e.which !== 13 && (e.shiftKey || e.ctrlKey || e.altKey || e.metaKey)) { return true; } - var o = null; - if(this._data.core.rtl) { - if(e.which === 37) { e.which = 39; } - else if(e.which === 39) { e.which = 37; } - } - switch(e.which) { - case 32: // aria defines space only with Ctrl - if(e.ctrlKey) { - e.type = "click"; - $(e.currentTarget).trigger(e); - } - break; - case 13: // enter - e.type = "click"; - $(e.currentTarget).trigger(e); - break; - case 37: // right - e.preventDefault(); - if(this.is_open(e.currentTarget)) { - this.close_node(e.currentTarget); - } - else { - o = this.get_parent(e.currentTarget); - if(o && o.id !== $.jstree.root) { this.get_node(o, true).children('.jstree-anchor').focus(); } - } - break; - case 38: // up - e.preventDefault(); - o = this.get_prev_dom(e.currentTarget); - if(o && o.length) { o.children('.jstree-anchor').focus(); } - break; - case 39: // left - e.preventDefault(); - if(this.is_closed(e.currentTarget)) { - this.open_node(e.currentTarget, function (o) { this.get_node(o, true).children('.jstree-anchor').focus(); }); - } - else if (this.is_open(e.currentTarget)) { - o = this.get_node(e.currentTarget, true).children('.jstree-children')[0]; - if(o) { $(this._firstChild(o)).children('.jstree-anchor').focus(); } - } - break; - case 40: // down - e.preventDefault(); - o = this.get_next_dom(e.currentTarget); - if(o && o.length) { o.children('.jstree-anchor').focus(); } - break; - case 106: // aria defines * on numpad as open_all - not very common - this.open_all(); - break; - case 36: // home - e.preventDefault(); - o = this._firstChild(this.get_container_ul()[0]); - if(o) { $(o).children('.jstree-anchor').filter(':visible').focus(); } - break; - case 35: // end - e.preventDefault(); - this.element.find('.jstree-anchor').filter(':visible').last().focus(); - break; - /*! - // delete - case 46: - e.preventDefault(); - o = this.get_node(e.currentTarget); - if(o && o.id && o.id !== $.jstree.root) { - o = this.is_selected(o) ? this.get_selected() : o; - this.delete_node(o); - } - break; - // f2 - case 113: - e.preventDefault(); - o = this.get_node(e.currentTarget); - if(o && o.id && o.id !== $.jstree.root) { - // this.edit(o); - } - break; - default: - // console.log(e.which); - break; - */ - } - }, this)) - .on("load_node.jstree", $.proxy(function (e, data) { - if(data.status) { - if(data.node.id === $.jstree.root && !this._data.core.loaded) { - this._data.core.loaded = true; - if(this._firstChild(this.get_container_ul()[0])) { - this.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id); - } - /** - * triggered after the root node is loaded for the first time - * @event - * @name loaded.jstree - */ - this.trigger("loaded"); - } - if(!this._data.core.ready) { - setTimeout($.proxy(function() { - if(this.element && !this.get_container_ul().find('.jstree-loading').length) { - this._data.core.ready = true; - if(this._data.core.selected.length) { - if(this.settings.core.expand_selected_onload) { - var tmp = [], i, j; - for(i = 0, j = this._data.core.selected.length; i < j; i++) { - tmp = tmp.concat(this._model.data[this._data.core.selected[i]].parents); - } - tmp = $.vakata.array_unique(tmp); - for(i = 0, j = tmp.length; i < j; i++) { - this.open_node(tmp[i], false, 0); - } - } - this.trigger('changed', { 'action' : 'ready', 'selected' : this._data.core.selected }); - } - /** - * triggered after all nodes are finished loading - * @event - * @name ready.jstree - */ - this.trigger("ready"); - } - }, this), 0); - } - } - }, this)) - // quick searching when the tree is focused - .on('keypress.jstree', $.proxy(function (e) { - if(e.target.tagName && e.target.tagName.toLowerCase() === "input") { return true; } - if(tout) { clearTimeout(tout); } - tout = setTimeout(function () { - word = ''; - }, 500); - - var chr = String.fromCharCode(e.which).toLowerCase(), - col = this.element.find('.jstree-anchor').filter(':visible'), - ind = col.index(document.activeElement) || 0, - end = false; - word += chr; - - // match for whole word from current node down (including the current node) - if(word.length > 1) { - col.slice(ind).each($.proxy(function (i, v) { - if($(v).text().toLowerCase().indexOf(word) === 0) { - $(v).focus(); - end = true; - return false; - } - }, this)); - if(end) { return; } - - // match for whole word from the beginning of the tree - col.slice(0, ind).each($.proxy(function (i, v) { - if($(v).text().toLowerCase().indexOf(word) === 0) { - $(v).focus(); - end = true; - return false; - } - }, this)); - if(end) { return; } - } - // list nodes that start with that letter (only if word consists of a single char) - if(new RegExp('^' + chr.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + '+$').test(word)) { - // search for the next node starting with that letter - col.slice(ind + 1).each($.proxy(function (i, v) { - if($(v).text().toLowerCase().charAt(0) === chr) { - $(v).focus(); - end = true; - return false; - } - }, this)); - if(end) { return; } - - // search from the beginning - col.slice(0, ind + 1).each($.proxy(function (i, v) { - if($(v).text().toLowerCase().charAt(0) === chr) { - $(v).focus(); - end = true; - return false; - } - }, this)); - if(end) { return; } - } - }, this)) - // THEME RELATED - .on("init.jstree", $.proxy(function () { - var s = this.settings.core.themes; - this._data.core.themes.dots = s.dots; - this._data.core.themes.stripes = s.stripes; - this._data.core.themes.icons = s.icons; - this.set_theme(s.name || "default", s.url); - this.set_theme_variant(s.variant); - }, this)) - .on("loading.jstree", $.proxy(function () { - this[ this._data.core.themes.dots ? "show_dots" : "hide_dots" ](); - this[ this._data.core.themes.icons ? "show_icons" : "hide_icons" ](); - this[ this._data.core.themes.stripes ? "show_stripes" : "hide_stripes" ](); - }, this)) - .on('blur.jstree', '.jstree-anchor', $.proxy(function (e) { - this._data.core.focused = null; - $(e.currentTarget).filter('.jstree-hovered').mouseleave(); - this.element.attr('tabindex', '0'); - }, this)) - .on('focus.jstree', '.jstree-anchor', $.proxy(function (e) { - var tmp = this.get_node(e.currentTarget); - if(tmp && tmp.id) { - this._data.core.focused = tmp.id; - } - this.element.find('.jstree-hovered').not(e.currentTarget).mouseleave(); - $(e.currentTarget).mouseenter(); - this.element.attr('tabindex', '-1'); - }, this)) - .on('focus.jstree', $.proxy(function () { - if(+(new Date()) - was_click > 500 && !this._data.core.focused) { - was_click = 0; - var act = this.get_node(this.element.attr('aria-activedescendant'), true); - if(act) { - act.find('> .jstree-anchor').focus(); - } - } - }, this)) - .on('mouseenter.jstree', '.jstree-anchor', $.proxy(function (e) { - this.hover_node(e.currentTarget); - }, this)) - .on('mouseleave.jstree', '.jstree-anchor', $.proxy(function (e) { - this.dehover_node(e.currentTarget); - }, this)); - }, - /** - * part of the destroying of an instance. Used internally. - * @private - * @name unbind() - */ - unbind : function () { - this.element.off('.jstree'); - $(document).off('.jstree-' + this._id); - }, - /** - * trigger an event. Used internally. - * @private - * @name trigger(ev [, data]) - * @param {String} ev the name of the event to trigger - * @param {Object} data additional data to pass with the event - */ - trigger : function (ev, data) { - if(!data) { - data = {}; - } - data.instance = this; - this.element.triggerHandler(ev.replace('.jstree','') + '.jstree', data); - }, - /** - * returns the jQuery extended instance container - * @name get_container() - * @return {jQuery} - */ - get_container : function () { - return this.element; - }, - /** - * returns the jQuery extended main UL node inside the instance container. Used internally. - * @private - * @name get_container_ul() - * @return {jQuery} - */ - get_container_ul : function () { - return this.element.children(".jstree-children").first(); - }, - /** - * gets string replacements (localization). Used internally. - * @private - * @name get_string(key) - * @param {String} key - * @return {String} - */ - get_string : function (key) { - var a = this.settings.core.strings; - if($.isFunction(a)) { return a.call(this, key); } - if(a && a[key]) { return a[key]; } - return key; - }, - /** - * gets the first child of a DOM node. Used internally. - * @private - * @name _firstChild(dom) - * @param {DOMElement} dom - * @return {DOMElement} - */ - _firstChild : function (dom) { - dom = dom ? dom.firstChild : null; - while(dom !== null && dom.nodeType !== 1) { - dom = dom.nextSibling; - } - return dom; - }, - /** - * gets the next sibling of a DOM node. Used internally. - * @private - * @name _nextSibling(dom) - * @param {DOMElement} dom - * @return {DOMElement} - */ - _nextSibling : function (dom) { - dom = dom ? dom.nextSibling : null; - while(dom !== null && dom.nodeType !== 1) { - dom = dom.nextSibling; - } - return dom; - }, - /** - * gets the previous sibling of a DOM node. Used internally. - * @private - * @name _previousSibling(dom) - * @param {DOMElement} dom - * @return {DOMElement} - */ - _previousSibling : function (dom) { - dom = dom ? dom.previousSibling : null; - while(dom !== null && dom.nodeType !== 1) { - dom = dom.previousSibling; - } - return dom; - }, - /** - * get the JSON representation of a node (or the actual jQuery extended DOM node) by using any input (child DOM element, ID string, selector, etc) - * @name get_node(obj [, as_dom]) - * @param {mixed} obj - * @param {Boolean} as_dom - * @return {Object|jQuery} - */ - get_node : function (obj, as_dom) { - if(obj && obj.id) { - obj = obj.id; - } - var dom; - try { - if(this._model.data[obj]) { - obj = this._model.data[obj]; - } - else if(typeof obj === "string" && this._model.data[obj.replace(/^#/, '')]) { - obj = this._model.data[obj.replace(/^#/, '')]; - } - else if(typeof obj === "string" && (dom = $('#' + obj.replace($.jstree.idregex,'\\$&'), this.element)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) { - obj = this._model.data[dom.closest('.jstree-node').attr('id')]; - } - else if((dom = $(obj, this.element)).length && this._model.data[dom.closest('.jstree-node').attr('id')]) { - obj = this._model.data[dom.closest('.jstree-node').attr('id')]; - } - else if((dom = $(obj, this.element)).length && dom.hasClass('jstree')) { - obj = this._model.data[$.jstree.root]; - } - else { - return false; - } - - if(as_dom) { - obj = obj.id === $.jstree.root ? this.element : $('#' + obj.id.replace($.jstree.idregex,'\\$&'), this.element); - } - return obj; - } catch (ex) { return false; } - }, - /** - * get the path to a node, either consisting of node texts, or of node IDs, optionally glued together (otherwise an array) - * @name get_path(obj [, glue, ids]) - * @param {mixed} obj the node - * @param {String} glue if you want the path as a string - pass the glue here (for example '/'), if a falsy value is supplied here, an array is returned - * @param {Boolean} ids if set to true build the path using ID, otherwise node text is used - * @return {mixed} - */ - get_path : function (obj, glue, ids) { - obj = obj.parents ? obj : this.get_node(obj); - if(!obj || obj.id === $.jstree.root || !obj.parents) { - return false; - } - var i, j, p = []; - p.push(ids ? obj.id : obj.text); - for(i = 0, j = obj.parents.length; i < j; i++) { - p.push(ids ? obj.parents[i] : this.get_text(obj.parents[i])); - } - p = p.reverse().slice(1); - return glue ? p.join(glue) : p; - }, - /** - * get the next visible node that is below the `obj` node. If `strict` is set to `true` only sibling nodes are returned. - * @name get_next_dom(obj [, strict]) - * @param {mixed} obj - * @param {Boolean} strict - * @return {jQuery} - */ - get_next_dom : function (obj, strict) { - var tmp; - obj = this.get_node(obj, true); - if(obj[0] === this.element[0]) { - tmp = this._firstChild(this.get_container_ul()[0]); - while (tmp && tmp.offsetHeight === 0) { - tmp = this._nextSibling(tmp); - } - return tmp ? $(tmp) : false; - } - if(!obj || !obj.length) { - return false; - } - if(strict) { - tmp = obj[0]; - do { - tmp = this._nextSibling(tmp); - } while (tmp && tmp.offsetHeight === 0); - return tmp ? $(tmp) : false; - } - if(obj.hasClass("jstree-open")) { - tmp = this._firstChild(obj.children('.jstree-children')[0]); - while (tmp && tmp.offsetHeight === 0) { - tmp = this._nextSibling(tmp); - } - if(tmp !== null) { - return $(tmp); - } - } - tmp = obj[0]; - do { - tmp = this._nextSibling(tmp); - } while (tmp && tmp.offsetHeight === 0); - if(tmp !== null) { - return $(tmp); - } - return obj.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first(); - }, - /** - * get the previous visible node that is above the `obj` node. If `strict` is set to `true` only sibling nodes are returned. - * @name get_prev_dom(obj [, strict]) - * @param {mixed} obj - * @param {Boolean} strict - * @return {jQuery} - */ - get_prev_dom : function (obj, strict) { - var tmp; - obj = this.get_node(obj, true); - if(obj[0] === this.element[0]) { - tmp = this.get_container_ul()[0].lastChild; - while (tmp && tmp.offsetHeight === 0) { - tmp = this._previousSibling(tmp); - } - return tmp ? $(tmp) : false; - } - if(!obj || !obj.length) { - return false; - } - if(strict) { - tmp = obj[0]; - do { - tmp = this._previousSibling(tmp); - } while (tmp && tmp.offsetHeight === 0); - return tmp ? $(tmp) : false; - } - tmp = obj[0]; - do { - tmp = this._previousSibling(tmp); - } while (tmp && tmp.offsetHeight === 0); - if(tmp !== null) { - obj = $(tmp); - while(obj.hasClass("jstree-open")) { - obj = obj.children(".jstree-children").first().children(".jstree-node:visible:last"); - } - return obj; - } - tmp = obj[0].parentNode.parentNode; - return tmp && tmp.className && tmp.className.indexOf('jstree-node') !== -1 ? $(tmp) : false; - }, - /** - * get the parent ID of a node - * @name get_parent(obj) - * @param {mixed} obj - * @return {String} - */ - get_parent : function (obj) { - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - return obj.parent; - }, - /** - * get a jQuery collection of all the children of a node (node must be rendered) - * @name get_children_dom(obj) - * @param {mixed} obj - * @return {jQuery} - */ - get_children_dom : function (obj) { - obj = this.get_node(obj, true); - if(obj[0] === this.element[0]) { - return this.get_container_ul().children(".jstree-node"); - } - if(!obj || !obj.length) { - return false; - } - return obj.children(".jstree-children").children(".jstree-node"); - }, - /** - * checks if a node has children - * @name is_parent(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_parent : function (obj) { - obj = this.get_node(obj); - return obj && (obj.state.loaded === false || obj.children.length > 0); - }, - /** - * checks if a node is loaded (its children are available) - * @name is_loaded(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_loaded : function (obj) { - obj = this.get_node(obj); - return obj && obj.state.loaded; - }, - /** - * check if a node is currently loading (fetching children) - * @name is_loading(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_loading : function (obj) { - obj = this.get_node(obj); - return obj && obj.state && obj.state.loading; - }, - /** - * check if a node is opened - * @name is_open(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_open : function (obj) { - obj = this.get_node(obj); - return obj && obj.state.opened; - }, - /** - * check if a node is in a closed state - * @name is_closed(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_closed : function (obj) { - obj = this.get_node(obj); - return obj && this.is_parent(obj) && !obj.state.opened; - }, - /** - * check if a node has no children - * @name is_leaf(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_leaf : function (obj) { - return !this.is_parent(obj); - }, - /** - * loads a node (fetches its children using the `core.data` setting). Multiple nodes can be passed to by using an array. - * @name load_node(obj [, callback]) - * @param {mixed} obj - * @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives two arguments - the node and a boolean status - * @return {Boolean} - * @trigger load_node.jstree - */ - load_node : function (obj, callback) { - var k, l, i, j, c; - if($.isArray(obj)) { - this._load_nodes(obj.slice(), callback); - return true; - } - obj = this.get_node(obj); - if(!obj) { - if(callback) { callback.call(this, obj, false); } - return false; - } - // if(obj.state.loading) { } // the node is already loading - just wait for it to load and invoke callback? but if called implicitly it should be loaded again? - if(obj.state.loaded) { - obj.state.loaded = false; - for(k = 0, l = obj.children_d.length; k < l; k++) { - for(i = 0, j = obj.parents.length; i < j; i++) { - this._model.data[obj.parents[i]].children_d = $.vakata.array_remove_item(this._model.data[obj.parents[i]].children_d, obj.children_d[k]); - } - if(this._model.data[obj.children_d[k]].state.selected) { - c = true; - this._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, obj.children_d[k]); - } - delete this._model.data[obj.children_d[k]]; - } - obj.children = []; - obj.children_d = []; - if(c) { - this.trigger('changed', { 'action' : 'load_node', 'node' : obj, 'selected' : this._data.core.selected }); - } - } - obj.state.failed = false; - obj.state.loading = true; - this.get_node(obj, true).addClass("jstree-loading").attr('aria-busy',true); - this._load_node(obj, $.proxy(function (status) { - obj = this._model.data[obj.id]; - obj.state.loading = false; - obj.state.loaded = status; - obj.state.failed = !obj.state.loaded; - var dom = this.get_node(obj, true), i = 0, j = 0, m = this._model.data, has_children = false; - for(i = 0, j = obj.children.length; i < j; i++) { - if(m[obj.children[i]] && !m[obj.children[i]].state.hidden) { - has_children = true; - break; - } - } - if(obj.state.loaded && !has_children && dom && dom.length && !dom.hasClass('jstree-leaf')) { - dom.removeClass('jstree-closed jstree-open').addClass('jstree-leaf'); - } - dom.removeClass("jstree-loading").attr('aria-busy',false); - /** - * triggered after a node is loaded - * @event - * @name load_node.jstree - * @param {Object} node the node that was loading - * @param {Boolean} status was the node loaded successfully - */ - this.trigger('load_node', { "node" : obj, "status" : status }); - if(callback) { - callback.call(this, obj, status); - } - }, this)); - return true; - }, - /** - * load an array of nodes (will also load unavailable nodes as soon as the appear in the structure). Used internally. - * @private - * @name _load_nodes(nodes [, callback]) - * @param {array} nodes - * @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - the array passed to _load_nodes - */ - _load_nodes : function (nodes, callback, is_callback) { - var r = true, - c = function () { this._load_nodes(nodes, callback, true); }, - m = this._model.data, i, j, tmp = []; - for(i = 0, j = nodes.length; i < j; i++) { - if(m[nodes[i]] && ( (!m[nodes[i]].state.loaded && !m[nodes[i]].state.failed) || !is_callback)) { - if(!this.is_loading(nodes[i])) { - this.load_node(nodes[i], c); - } - r = false; - } - } - if(r) { - for(i = 0, j = nodes.length; i < j; i++) { - if(m[nodes[i]] && m[nodes[i]].state.loaded) { - tmp.push(nodes[i]); - } - } - if(callback && !callback.done) { - callback.call(this, tmp); - callback.done = true; - } - } - }, - /** - * loads all unloaded nodes - * @name load_all([obj, callback]) - * @param {mixed} obj the node to load recursively, omit to load all nodes in the tree - * @param {function} callback a function to be executed once loading all the nodes is complete, - * @trigger load_all.jstree - */ - load_all : function (obj, callback) { - if(!obj) { obj = $.jstree.root; } - obj = this.get_node(obj); - if(!obj) { return false; } - var to_load = [], - m = this._model.data, - c = m[obj.id].children_d, - i, j; - if(obj.state && !obj.state.loaded) { - to_load.push(obj.id); - } - for(i = 0, j = c.length; i < j; i++) { - if(m[c[i]] && m[c[i]].state && !m[c[i]].state.loaded) { - to_load.push(c[i]); - } - } - if(to_load.length) { - this._load_nodes(to_load, function () { - this.load_all(obj, callback); - }); - } - else { - /** - * triggered after a load_all call completes - * @event - * @name load_all.jstree - * @param {Object} node the recursively loaded node - */ - if(callback) { callback.call(this, obj); } - this.trigger('load_all', { "node" : obj }); - } - }, - /** - * handles the actual loading of a node. Used only internally. - * @private - * @name _load_node(obj [, callback]) - * @param {mixed} obj - * @param {function} callback a function to be executed once loading is complete, the function is executed in the instance's scope and receives one argument - a boolean status - * @return {Boolean} - */ - _load_node : function (obj, callback) { - var s = this.settings.core.data, t; - // use original HTML - if(!s) { - if(obj.id === $.jstree.root) { - return this._append_html_data(obj, this._data.core.original_container_html.clone(true), function (status) { - callback.call(this, status); - }); - } - else { - return callback.call(this, false); - } - // return callback.call(this, obj.id === $.jstree.root ? this._append_html_data(obj, this._data.core.original_container_html.clone(true)) : false); - } - if($.isFunction(s)) { - return s.call(this, obj, $.proxy(function (d) { - if(d === false) { - callback.call(this, false); - } - this[typeof d === 'string' ? '_append_html_data' : '_append_json_data'](obj, typeof d === 'string' ? $($.parseHTML(d)).filter(function () { return this.nodeType !== 3; }) : d, function (status) { - callback.call(this, status); - }); - // return d === false ? callback.call(this, false) : callback.call(this, this[typeof d === 'string' ? '_append_html_data' : '_append_json_data'](obj, typeof d === 'string' ? $(d) : d)); - }, this)); - } - if(typeof s === 'object') { - if(s.url) { - s = $.extend(true, {}, s); - if($.isFunction(s.url)) { - s.url = s.url.call(this, obj); - } - if($.isFunction(s.data)) { - s.data = s.data.call(this, obj); - } - return $.ajax(s) - .done($.proxy(function (d,t,x) { - var type = x.getResponseHeader('Content-Type'); - if((type && type.indexOf('json') !== -1) || typeof d === "object") { - return this._append_json_data(obj, d, function (status) { callback.call(this, status); }); - //return callback.call(this, this._append_json_data(obj, d)); - } - if((type && type.indexOf('html') !== -1) || typeof d === "string") { - return this._append_html_data(obj, $($.parseHTML(d)).filter(function () { return this.nodeType !== 3; }), function (status) { callback.call(this, status); }); - // return callback.call(this, this._append_html_data(obj, $(d))); - } - this._data.core.last_error = { 'error' : 'ajax', 'plugin' : 'core', 'id' : 'core_04', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id, 'xhr' : x }) }; - this.settings.core.error.call(this, this._data.core.last_error); - return callback.call(this, false); - }, this)) - .fail($.proxy(function (f) { - callback.call(this, false); - this._data.core.last_error = { 'error' : 'ajax', 'plugin' : 'core', 'id' : 'core_04', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id, 'xhr' : f }) }; - this.settings.core.error.call(this, this._data.core.last_error); - }, this)); - } - t = ($.isArray(s) || $.isPlainObject(s)) ? JSON.parse(JSON.stringify(s)) : s; - if(obj.id === $.jstree.root) { - return this._append_json_data(obj, t, function (status) { - callback.call(this, status); - }); - } - else { - this._data.core.last_error = { 'error' : 'nodata', 'plugin' : 'core', 'id' : 'core_05', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id }) }; - this.settings.core.error.call(this, this._data.core.last_error); - return callback.call(this, false); - } - //return callback.call(this, (obj.id === $.jstree.root ? this._append_json_data(obj, t) : false) ); - } - if(typeof s === 'string') { - if(obj.id === $.jstree.root) { - return this._append_html_data(obj, $($.parseHTML(s)).filter(function () { return this.nodeType !== 3; }), function (status) { - callback.call(this, status); - }); - } - else { - this._data.core.last_error = { 'error' : 'nodata', 'plugin' : 'core', 'id' : 'core_06', 'reason' : 'Could not load node', 'data' : JSON.stringify({ 'id' : obj.id }) }; - this.settings.core.error.call(this, this._data.core.last_error); - return callback.call(this, false); - } - //return callback.call(this, (obj.id === $.jstree.root ? this._append_html_data(obj, $(s)) : false) ); - } - return callback.call(this, false); - }, - /** - * adds a node to the list of nodes to redraw. Used only internally. - * @private - * @name _node_changed(obj [, callback]) - * @param {mixed} obj - */ - _node_changed : function (obj) { - obj = this.get_node(obj); - if(obj) { - this._model.changed.push(obj.id); - } - }, - /** - * appends HTML content to the tree. Used internally. - * @private - * @name _append_html_data(obj, data) - * @param {mixed} obj the node to append to - * @param {String} data the HTML string to parse and append - * @trigger model.jstree, changed.jstree - */ - _append_html_data : function (dom, data, cb) { - dom = this.get_node(dom); - dom.children = []; - dom.children_d = []; - var dat = data.is('ul') ? data.children() : data, - par = dom.id, - chd = [], - dpc = [], - m = this._model.data, - p = m[par], - s = this._data.core.selected.length, - tmp, i, j; - dat.each($.proxy(function (i, v) { - tmp = this._parse_model_from_html($(v), par, p.parents.concat()); - if(tmp) { - chd.push(tmp); - dpc.push(tmp); - if(m[tmp].children_d.length) { - dpc = dpc.concat(m[tmp].children_d); - } - } - }, this)); - p.children = chd; - p.children_d = dpc; - for(i = 0, j = p.parents.length; i < j; i++) { - m[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc); - } - /** - * triggered when new data is inserted to the tree model - * @event - * @name model.jstree - * @param {Array} nodes an array of node IDs - * @param {String} parent the parent ID of the nodes - */ - this.trigger('model', { "nodes" : dpc, 'parent' : par }); - if(par !== $.jstree.root) { - this._node_changed(par); - this.redraw(); - } - else { - this.get_container_ul().children('.jstree-initial-node').remove(); - this.redraw(true); - } - if(this._data.core.selected.length !== s) { - this.trigger('changed', { 'action' : 'model', 'selected' : this._data.core.selected }); - } - cb.call(this, true); - }, - /** - * appends JSON content to the tree. Used internally. - * @private - * @name _append_json_data(obj, data) - * @param {mixed} obj the node to append to - * @param {String} data the JSON object to parse and append - * @param {Boolean} force_processing internal param - do not set - * @trigger model.jstree, changed.jstree - */ - _append_json_data : function (dom, data, cb, force_processing) { - if(this.element === null) { return; } - dom = this.get_node(dom); - dom.children = []; - dom.children_d = []; - // *%$@!!! - if(data.d) { - data = data.d; - if(typeof data === "string") { - data = JSON.parse(data); - } - } - if(!$.isArray(data)) { data = [data]; } - var w = null, - args = { - 'df' : this._model.default_state, - 'dat' : data, - 'par' : dom.id, - 'm' : this._model.data, - 't_id' : this._id, - 't_cnt' : this._cnt, - 'sel' : this._data.core.selected - }, - func = function (data, undefined) { - if(data.data) { data = data.data; } - var dat = data.dat, - par = data.par, - chd = [], - dpc = [], - add = [], - df = data.df, - t_id = data.t_id, - t_cnt = data.t_cnt, - m = data.m, - p = m[par], - sel = data.sel, - tmp, i, j, rslt, - parse_flat = function (d, p, ps) { - if(!ps) { ps = []; } - else { ps = ps.concat(); } - if(p) { ps.unshift(p); } - var tid = d.id.toString(), - i, j, c, e, - tmp = { - id : tid, - text : d.text || '', - icon : d.icon !== undefined ? d.icon : true, - parent : p, - parents : ps, - children : d.children || [], - children_d : d.children_d || [], - data : d.data, - state : { }, - li_attr : { id : false }, - a_attr : { href : '#' }, - original : false - }; - for(i in df) { - if(df.hasOwnProperty(i)) { - tmp.state[i] = df[i]; - } - } - if(d && d.data && d.data.jstree && d.data.jstree.icon) { - tmp.icon = d.data.jstree.icon; - } - if(tmp.icon === undefined || tmp.icon === null || tmp.icon === "") { - tmp.icon = true; - } - if(d && d.data) { - tmp.data = d.data; - if(d.data.jstree) { - for(i in d.data.jstree) { - if(d.data.jstree.hasOwnProperty(i)) { - tmp.state[i] = d.data.jstree[i]; - } - } - } - } - if(d && typeof d.state === 'object') { - for (i in d.state) { - if(d.state.hasOwnProperty(i)) { - tmp.state[i] = d.state[i]; - } - } - } - if(d && typeof d.li_attr === 'object') { - for (i in d.li_attr) { - if(d.li_attr.hasOwnProperty(i)) { - tmp.li_attr[i] = d.li_attr[i]; - } - } - } - if(!tmp.li_attr.id) { - tmp.li_attr.id = tid; - } - if(d && typeof d.a_attr === 'object') { - for (i in d.a_attr) { - if(d.a_attr.hasOwnProperty(i)) { - tmp.a_attr[i] = d.a_attr[i]; - } - } - } - if(d && d.children && d.children === true) { - tmp.state.loaded = false; - tmp.children = []; - tmp.children_d = []; - } - m[tmp.id] = tmp; - for(i = 0, j = tmp.children.length; i < j; i++) { - c = parse_flat(m[tmp.children[i]], tmp.id, ps); - e = m[c]; - tmp.children_d.push(c); - if(e.children_d.length) { - tmp.children_d = tmp.children_d.concat(e.children_d); - } - } - delete d.data; - delete d.children; - m[tmp.id].original = d; - if(tmp.state.selected) { - add.push(tmp.id); - } - return tmp.id; - }, - parse_nest = function (d, p, ps) { - if(!ps) { ps = []; } - else { ps = ps.concat(); } - if(p) { ps.unshift(p); } - var tid = false, i, j, c, e, tmp; - do { - tid = 'j' + t_id + '_' + (++t_cnt); - } while(m[tid]); - - tmp = { - id : false, - text : typeof d === 'string' ? d : '', - icon : typeof d === 'object' && d.icon !== undefined ? d.icon : true, - parent : p, - parents : ps, - children : [], - children_d : [], - data : null, - state : { }, - li_attr : { id : false }, - a_attr : { href : '#' }, - original : false - }; - for(i in df) { - if(df.hasOwnProperty(i)) { - tmp.state[i] = df[i]; - } - } - if(d && d.id) { tmp.id = d.id.toString(); } - if(d && d.text) { tmp.text = d.text; } - if(d && d.data && d.data.jstree && d.data.jstree.icon) { - tmp.icon = d.data.jstree.icon; - } - if(tmp.icon === undefined || tmp.icon === null || tmp.icon === "") { - tmp.icon = true; - } - if(d && d.data) { - tmp.data = d.data; - if(d.data.jstree) { - for(i in d.data.jstree) { - if(d.data.jstree.hasOwnProperty(i)) { - tmp.state[i] = d.data.jstree[i]; - } - } - } - } - if(d && typeof d.state === 'object') { - for (i in d.state) { - if(d.state.hasOwnProperty(i)) { - tmp.state[i] = d.state[i]; - } - } - } - if(d && typeof d.li_attr === 'object') { - for (i in d.li_attr) { - if(d.li_attr.hasOwnProperty(i)) { - tmp.li_attr[i] = d.li_attr[i]; - } - } - } - if(tmp.li_attr.id && !tmp.id) { - tmp.id = tmp.li_attr.id.toString(); - } - if(!tmp.id) { - tmp.id = tid; - } - if(!tmp.li_attr.id) { - tmp.li_attr.id = tmp.id; - } - if(d && typeof d.a_attr === 'object') { - for (i in d.a_attr) { - if(d.a_attr.hasOwnProperty(i)) { - tmp.a_attr[i] = d.a_attr[i]; - } - } - } - if(d && d.children && d.children.length) { - for(i = 0, j = d.children.length; i < j; i++) { - c = parse_nest(d.children[i], tmp.id, ps); - e = m[c]; - tmp.children.push(c); - if(e.children_d.length) { - tmp.children_d = tmp.children_d.concat(e.children_d); - } - } - tmp.children_d = tmp.children_d.concat(tmp.children); - } - if(d && d.children && d.children === true) { - tmp.state.loaded = false; - tmp.children = []; - tmp.children_d = []; - } - delete d.data; - delete d.children; - tmp.original = d; - m[tmp.id] = tmp; - if(tmp.state.selected) { - add.push(tmp.id); - } - return tmp.id; - }; - - if(dat.length && dat[0].id !== undefined && dat[0].parent !== undefined) { - // Flat JSON support (for easy import from DB): - // 1) convert to object (foreach) - for(i = 0, j = dat.length; i < j; i++) { - if(!dat[i].children) { - dat[i].children = []; - } - m[dat[i].id.toString()] = dat[i]; - } - // 2) populate children (foreach) - for(i = 0, j = dat.length; i < j; i++) { - m[dat[i].parent.toString()].children.push(dat[i].id.toString()); - // populate parent.children_d - p.children_d.push(dat[i].id.toString()); - } - // 3) normalize && populate parents and children_d with recursion - for(i = 0, j = p.children.length; i < j; i++) { - tmp = parse_flat(m[p.children[i]], par, p.parents.concat()); - dpc.push(tmp); - if(m[tmp].children_d.length) { - dpc = dpc.concat(m[tmp].children_d); - } - } - for(i = 0, j = p.parents.length; i < j; i++) { - m[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc); - } - // ?) three_state selection - p.state.selected && t - (if three_state foreach(dat => ch) -> foreach(parents) if(parent.selected) child.selected = true; - rslt = { - 'cnt' : t_cnt, - 'mod' : m, - 'sel' : sel, - 'par' : par, - 'dpc' : dpc, - 'add' : add - }; - } - else { - for(i = 0, j = dat.length; i < j; i++) { - tmp = parse_nest(dat[i], par, p.parents.concat()); - if(tmp) { - chd.push(tmp); - dpc.push(tmp); - if(m[tmp].children_d.length) { - dpc = dpc.concat(m[tmp].children_d); - } - } - } - p.children = chd; - p.children_d = dpc; - for(i = 0, j = p.parents.length; i < j; i++) { - m[p.parents[i]].children_d = m[p.parents[i]].children_d.concat(dpc); - } - rslt = { - 'cnt' : t_cnt, - 'mod' : m, - 'sel' : sel, - 'par' : par, - 'dpc' : dpc, - 'add' : add - }; - } - if(typeof window === 'undefined' || typeof window.document === 'undefined') { - postMessage(rslt); - } - else { - return rslt; - } - }, - rslt = function (rslt, worker) { - if(this.element === null) { return; } - this._cnt = rslt.cnt; - this._model.data = rslt.mod; // breaks the reference in load_node - careful - - if(worker) { - var i, j, a = rslt.add, r = rslt.sel, s = this._data.core.selected.slice(), m = this._model.data; - // if selection was changed while calculating in worker - if(r.length !== s.length || $.vakata.array_unique(r.concat(s)).length !== r.length) { - // deselect nodes that are no longer selected - for(i = 0, j = r.length; i < j; i++) { - if($.inArray(r[i], a) === -1 && $.inArray(r[i], s) === -1) { - m[r[i]].state.selected = false; - } - } - // select nodes that were selected in the mean time - for(i = 0, j = s.length; i < j; i++) { - if($.inArray(s[i], r) === -1) { - m[s[i]].state.selected = true; - } - } - } - } - if(rslt.add.length) { - this._data.core.selected = this._data.core.selected.concat(rslt.add); - } - - this.trigger('model', { "nodes" : rslt.dpc, 'parent' : rslt.par }); - - if(rslt.par !== $.jstree.root) { - this._node_changed(rslt.par); - this.redraw(); - } - else { - // this.get_container_ul().children('.jstree-initial-node').remove(); - this.redraw(true); - } - if(rslt.add.length) { - this.trigger('changed', { 'action' : 'model', 'selected' : this._data.core.selected }); - } - cb.call(this, true); - }; - if(this.settings.core.worker && window.Blob && window.URL && window.Worker) { - try { - if(this._wrk === null) { - this._wrk = window.URL.createObjectURL( - new window.Blob( - ['self.onmessage = ' + func.toString()], - {type:"text/javascript"} - ) - ); - } - if(!this._data.core.working || force_processing) { - this._data.core.working = true; - w = new window.Worker(this._wrk); - w.onmessage = $.proxy(function (e) { - rslt.call(this, e.data, true); - try { w.terminate(); w = null; } catch(ignore) { } - if(this._data.core.worker_queue.length) { - this._append_json_data.apply(this, this._data.core.worker_queue.shift()); - } - else { - this._data.core.working = false; - } - }, this); - if(!args.par) { - if(this._data.core.worker_queue.length) { - this._append_json_data.apply(this, this._data.core.worker_queue.shift()); - } - else { - this._data.core.working = false; - } - } - else { - w.postMessage(args); - } - } - else { - this._data.core.worker_queue.push([dom, data, cb, true]); - } - } - catch(e) { - rslt.call(this, func(args), false); - if(this._data.core.worker_queue.length) { - this._append_json_data.apply(this, this._data.core.worker_queue.shift()); - } - else { - this._data.core.working = false; - } - } - } - else { - rslt.call(this, func(args), false); - } - }, - /** - * parses a node from a jQuery object and appends them to the in memory tree model. Used internally. - * @private - * @name _parse_model_from_html(d [, p, ps]) - * @param {jQuery} d the jQuery object to parse - * @param {String} p the parent ID - * @param {Array} ps list of all parents - * @return {String} the ID of the object added to the model - */ - _parse_model_from_html : function (d, p, ps) { - if(!ps) { ps = []; } - else { ps = [].concat(ps); } - if(p) { ps.unshift(p); } - var c, e, m = this._model.data, - data = { - id : false, - text : false, - icon : true, - parent : p, - parents : ps, - children : [], - children_d : [], - data : null, - state : { }, - li_attr : { id : false }, - a_attr : { href : '#' }, - original : false - }, i, tmp, tid; - for(i in this._model.default_state) { - if(this._model.default_state.hasOwnProperty(i)) { - data.state[i] = this._model.default_state[i]; - } - } - tmp = $.vakata.attributes(d, true); - $.each(tmp, function (i, v) { - v = $.trim(v); - if(!v.length) { return true; } - data.li_attr[i] = v; - if(i === 'id') { - data.id = v.toString(); - } - }); - tmp = d.children('a').first(); - if(tmp.length) { - tmp = $.vakata.attributes(tmp, true); - $.each(tmp, function (i, v) { - v = $.trim(v); - if(v.length) { - data.a_attr[i] = v; - } - }); - } - tmp = d.children("a").first().length ? d.children("a").first().clone() : d.clone(); - tmp.children("ins, i, ul").remove(); - tmp = tmp.html(); - tmp = $('
').html(tmp); - data.text = this.settings.core.force_text ? tmp.text() : tmp.html(); - tmp = d.data(); - data.data = tmp ? $.extend(true, {}, tmp) : null; - data.state.opened = d.hasClass('jstree-open'); - data.state.selected = d.children('a').hasClass('jstree-clicked'); - data.state.disabled = d.children('a').hasClass('jstree-disabled'); - if(data.data && data.data.jstree) { - for(i in data.data.jstree) { - if(data.data.jstree.hasOwnProperty(i)) { - data.state[i] = data.data.jstree[i]; - } - } - } - tmp = d.children("a").children(".jstree-themeicon"); - if(tmp.length) { - data.icon = tmp.hasClass('jstree-themeicon-hidden') ? false : tmp.attr('rel'); - } - if(data.state.icon !== undefined) { - data.icon = data.state.icon; - } - if(data.icon === undefined || data.icon === null || data.icon === "") { - data.icon = true; - } - tmp = d.children("ul").children("li"); - do { - tid = 'j' + this._id + '_' + (++this._cnt); - } while(m[tid]); - data.id = data.li_attr.id ? data.li_attr.id.toString() : tid; - if(tmp.length) { - tmp.each($.proxy(function (i, v) { - c = this._parse_model_from_html($(v), data.id, ps); - e = this._model.data[c]; - data.children.push(c); - if(e.children_d.length) { - data.children_d = data.children_d.concat(e.children_d); - } - }, this)); - data.children_d = data.children_d.concat(data.children); - } - else { - if(d.hasClass('jstree-closed')) { - data.state.loaded = false; - } - } - if(data.li_attr['class']) { - data.li_attr['class'] = data.li_attr['class'].replace('jstree-closed','').replace('jstree-open',''); - } - if(data.a_attr['class']) { - data.a_attr['class'] = data.a_attr['class'].replace('jstree-clicked','').replace('jstree-disabled',''); - } - m[data.id] = data; - if(data.state.selected) { - this._data.core.selected.push(data.id); - } - return data.id; - }, - /** - * parses a node from a JSON object (used when dealing with flat data, which has no nesting of children, but has id and parent properties) and appends it to the in memory tree model. Used internally. - * @private - * @name _parse_model_from_flat_json(d [, p, ps]) - * @param {Object} d the JSON object to parse - * @param {String} p the parent ID - * @param {Array} ps list of all parents - * @return {String} the ID of the object added to the model - */ - _parse_model_from_flat_json : function (d, p, ps) { - if(!ps) { ps = []; } - else { ps = ps.concat(); } - if(p) { ps.unshift(p); } - var tid = d.id.toString(), - m = this._model.data, - df = this._model.default_state, - i, j, c, e, - tmp = { - id : tid, - text : d.text || '', - icon : d.icon !== undefined ? d.icon : true, - parent : p, - parents : ps, - children : d.children || [], - children_d : d.children_d || [], - data : d.data, - state : { }, - li_attr : { id : false }, - a_attr : { href : '#' }, - original : false - }; - for(i in df) { - if(df.hasOwnProperty(i)) { - tmp.state[i] = df[i]; - } - } - if(d && d.data && d.data.jstree && d.data.jstree.icon) { - tmp.icon = d.data.jstree.icon; - } - if(tmp.icon === undefined || tmp.icon === null || tmp.icon === "") { - tmp.icon = true; - } - if(d && d.data) { - tmp.data = d.data; - if(d.data.jstree) { - for(i in d.data.jstree) { - if(d.data.jstree.hasOwnProperty(i)) { - tmp.state[i] = d.data.jstree[i]; - } - } - } - } - if(d && typeof d.state === 'object') { - for (i in d.state) { - if(d.state.hasOwnProperty(i)) { - tmp.state[i] = d.state[i]; - } - } - } - if(d && typeof d.li_attr === 'object') { - for (i in d.li_attr) { - if(d.li_attr.hasOwnProperty(i)) { - tmp.li_attr[i] = d.li_attr[i]; - } - } - } - if(!tmp.li_attr.id) { - tmp.li_attr.id = tid; - } - if(d && typeof d.a_attr === 'object') { - for (i in d.a_attr) { - if(d.a_attr.hasOwnProperty(i)) { - tmp.a_attr[i] = d.a_attr[i]; - } - } - } - if(d && d.children && d.children === true) { - tmp.state.loaded = false; - tmp.children = []; - tmp.children_d = []; - } - m[tmp.id] = tmp; - for(i = 0, j = tmp.children.length; i < j; i++) { - c = this._parse_model_from_flat_json(m[tmp.children[i]], tmp.id, ps); - e = m[c]; - tmp.children_d.push(c); - if(e.children_d.length) { - tmp.children_d = tmp.children_d.concat(e.children_d); - } - } - delete d.data; - delete d.children; - m[tmp.id].original = d; - if(tmp.state.selected) { - this._data.core.selected.push(tmp.id); - } - return tmp.id; - }, - /** - * parses a node from a JSON object and appends it to the in memory tree model. Used internally. - * @private - * @name _parse_model_from_json(d [, p, ps]) - * @param {Object} d the JSON object to parse - * @param {String} p the parent ID - * @param {Array} ps list of all parents - * @return {String} the ID of the object added to the model - */ - _parse_model_from_json : function (d, p, ps) { - if(!ps) { ps = []; } - else { ps = ps.concat(); } - if(p) { ps.unshift(p); } - var tid = false, i, j, c, e, m = this._model.data, df = this._model.default_state, tmp; - do { - tid = 'j' + this._id + '_' + (++this._cnt); - } while(m[tid]); - - tmp = { - id : false, - text : typeof d === 'string' ? d : '', - icon : typeof d === 'object' && d.icon !== undefined ? d.icon : true, - parent : p, - parents : ps, - children : [], - children_d : [], - data : null, - state : { }, - li_attr : { id : false }, - a_attr : { href : '#' }, - original : false - }; - for(i in df) { - if(df.hasOwnProperty(i)) { - tmp.state[i] = df[i]; - } - } - if(d && d.id) { tmp.id = d.id.toString(); } - if(d && d.text) { tmp.text = d.text; } - if(d && d.data && d.data.jstree && d.data.jstree.icon) { - tmp.icon = d.data.jstree.icon; - } - if(tmp.icon === undefined || tmp.icon === null || tmp.icon === "") { - tmp.icon = true; - } - if(d && d.data) { - tmp.data = d.data; - if(d.data.jstree) { - for(i in d.data.jstree) { - if(d.data.jstree.hasOwnProperty(i)) { - tmp.state[i] = d.data.jstree[i]; - } - } - } - } - if(d && typeof d.state === 'object') { - for (i in d.state) { - if(d.state.hasOwnProperty(i)) { - tmp.state[i] = d.state[i]; - } - } - } - if(d && typeof d.li_attr === 'object') { - for (i in d.li_attr) { - if(d.li_attr.hasOwnProperty(i)) { - tmp.li_attr[i] = d.li_attr[i]; - } - } - } - if(tmp.li_attr.id && !tmp.id) { - tmp.id = tmp.li_attr.id.toString(); - } - if(!tmp.id) { - tmp.id = tid; - } - if(!tmp.li_attr.id) { - tmp.li_attr.id = tmp.id; - } - if(d && typeof d.a_attr === 'object') { - for (i in d.a_attr) { - if(d.a_attr.hasOwnProperty(i)) { - tmp.a_attr[i] = d.a_attr[i]; - } - } - } - if(d && d.children && d.children.length) { - for(i = 0, j = d.children.length; i < j; i++) { - c = this._parse_model_from_json(d.children[i], tmp.id, ps); - e = m[c]; - tmp.children.push(c); - if(e.children_d.length) { - tmp.children_d = tmp.children_d.concat(e.children_d); - } - } - tmp.children_d = tmp.children_d.concat(tmp.children); - } - if(d && d.children && d.children === true) { - tmp.state.loaded = false; - tmp.children = []; - tmp.children_d = []; - } - delete d.data; - delete d.children; - tmp.original = d; - m[tmp.id] = tmp; - if(tmp.state.selected) { - this._data.core.selected.push(tmp.id); - } - return tmp.id; - }, - /** - * redraws all nodes that need to be redrawn. Used internally. - * @private - * @name _redraw() - * @trigger redraw.jstree - */ - _redraw : function () { - var nodes = this._model.force_full_redraw ? this._model.data[$.jstree.root].children.concat([]) : this._model.changed.concat([]), - f = document.createElement('UL'), tmp, i, j, fe = this._data.core.focused; - for(i = 0, j = nodes.length; i < j; i++) { - tmp = this.redraw_node(nodes[i], true, this._model.force_full_redraw); - if(tmp && this._model.force_full_redraw) { - f.appendChild(tmp); - } - } - if(this._model.force_full_redraw) { - f.className = this.get_container_ul()[0].className; - f.setAttribute('role','group'); - this.element.empty().append(f); - //this.get_container_ul()[0].appendChild(f); - } - if(fe !== null) { - tmp = this.get_node(fe, true); - if(tmp && tmp.length && tmp.children('.jstree-anchor')[0] !== document.activeElement) { - tmp.children('.jstree-anchor').focus(); - } - else { - this._data.core.focused = null; - } - } - this._model.force_full_redraw = false; - this._model.changed = []; - /** - * triggered after nodes are redrawn - * @event - * @name redraw.jstree - * @param {array} nodes the redrawn nodes - */ - this.trigger('redraw', { "nodes" : nodes }); - }, - /** - * redraws all nodes that need to be redrawn or optionally - the whole tree - * @name redraw([full]) - * @param {Boolean} full if set to `true` all nodes are redrawn. - */ - redraw : function (full) { - if(full) { - this._model.force_full_redraw = true; - } - //if(this._model.redraw_timeout) { - // clearTimeout(this._model.redraw_timeout); - //} - //this._model.redraw_timeout = setTimeout($.proxy(this._redraw, this),0); - this._redraw(); - }, - /** - * redraws a single node's children. Used internally. - * @private - * @name draw_children(node) - * @param {mixed} node the node whose children will be redrawn - */ - draw_children : function (node) { - var obj = this.get_node(node), - i = false, - j = false, - k = false, - d = document; - if(!obj) { return false; } - if(obj.id === $.jstree.root) { return this.redraw(true); } - node = this.get_node(node, true); - if(!node || !node.length) { return false; } // TODO: quick toggle - - node.children('.jstree-children').remove(); - node = node[0]; - if(obj.children.length && obj.state.loaded) { - k = d.createElement('UL'); - k.setAttribute('role', 'group'); - k.className = 'jstree-children'; - for(i = 0, j = obj.children.length; i < j; i++) { - k.appendChild(this.redraw_node(obj.children[i], true, true)); - } - node.appendChild(k); - } - }, - /** - * redraws a single node. Used internally. - * @private - * @name redraw_node(node, deep, is_callback, force_render) - * @param {mixed} node the node to redraw - * @param {Boolean} deep should child nodes be redrawn too - * @param {Boolean} is_callback is this a recursion call - * @param {Boolean} force_render should children of closed parents be drawn anyway - */ - redraw_node : function (node, deep, is_callback, force_render) { - var obj = this.get_node(node), - par = false, - ind = false, - old = false, - i = false, - j = false, - k = false, - c = '', - d = document, - m = this._model.data, - f = false, - s = false, - tmp = null, - t = 0, - l = 0, - has_children = false, - last_sibling = false; - if(!obj) { return false; } - if(obj.id === $.jstree.root) { return this.redraw(true); } - deep = deep || obj.children.length === 0; - node = !document.querySelector ? document.getElementById(obj.id) : this.element[0].querySelector('#' + ("0123456789".indexOf(obj.id[0]) !== -1 ? '\\3' + obj.id[0] + ' ' + obj.id.substr(1).replace($.jstree.idregex,'\\$&') : obj.id.replace($.jstree.idregex,'\\$&')) ); //, this.element); - if(!node) { - deep = true; - //node = d.createElement('LI'); - if(!is_callback) { - par = obj.parent !== $.jstree.root ? $('#' + obj.parent.replace($.jstree.idregex,'\\$&'), this.element)[0] : null; - if(par !== null && (!par || !m[obj.parent].state.opened)) { - return false; - } - ind = $.inArray(obj.id, par === null ? m[$.jstree.root].children : m[obj.parent].children); - } - } - else { - node = $(node); - if(!is_callback) { - par = node.parent().parent()[0]; - if(par === this.element[0]) { - par = null; - } - ind = node.index(); - } - // m[obj.id].data = node.data(); // use only node's data, no need to touch jquery storage - if(!deep && obj.children.length && !node.children('.jstree-children').length) { - deep = true; - } - if(!deep) { - old = node.children('.jstree-children')[0]; - } - f = node.children('.jstree-anchor')[0] === document.activeElement; - node.remove(); - //node = d.createElement('LI'); - //node = node[0]; - } - node = _node.cloneNode(true); - // node is DOM, deep is boolean - - c = 'jstree-node '; - for(i in obj.li_attr) { - if(obj.li_attr.hasOwnProperty(i)) { - if(i === 'id') { continue; } - if(i !== 'class') { - node.setAttribute(i, obj.li_attr[i]); - } - else { - c += obj.li_attr[i]; - } - } - } - if(!obj.a_attr.id) { - obj.a_attr.id = obj.id + '_anchor'; - } - node.setAttribute('aria-selected', !!obj.state.selected); - node.setAttribute('aria-level', obj.parents.length); - node.setAttribute('aria-labelledby', obj.a_attr.id); - if(obj.state.disabled) { - node.setAttribute('aria-disabled', true); - } - - for(i = 0, j = obj.children.length; i < j; i++) { - if(!m[obj.children[i]].state.hidden) { - has_children = true; - break; - } - } - if(obj.parent !== null && m[obj.parent] && !obj.state.hidden) { - i = $.inArray(obj.id, m[obj.parent].children); - last_sibling = obj.id; - if(i !== -1) { - i++; - for(j = m[obj.parent].children.length; i < j; i++) { - if(!m[m[obj.parent].children[i]].state.hidden) { - last_sibling = m[obj.parent].children[i]; - } - if(last_sibling !== obj.id) { - break; - } - } - } - } - - if(obj.state.hidden) { - c += ' jstree-hidden'; - } - if(obj.state.loaded && !has_children) { - c += ' jstree-leaf'; - } - else { - c += obj.state.opened && obj.state.loaded ? ' jstree-open' : ' jstree-closed'; - node.setAttribute('aria-expanded', (obj.state.opened && obj.state.loaded) ); - } - if(last_sibling === obj.id) { - c += ' jstree-last'; - } - node.id = obj.id; - node.className = c; - c = ( obj.state.selected ? ' jstree-clicked' : '') + ( obj.state.disabled ? ' jstree-disabled' : ''); - for(j in obj.a_attr) { - if(obj.a_attr.hasOwnProperty(j)) { - if(j === 'href' && obj.a_attr[j] === '#') { continue; } - if(j !== 'class') { - node.childNodes[1].setAttribute(j, obj.a_attr[j]); - } - else { - c += ' ' + obj.a_attr[j]; - } - } - } - if(c.length) { - node.childNodes[1].className = 'jstree-anchor ' + c; - } - if((obj.icon && obj.icon !== true) || obj.icon === false) { - if(obj.icon === false) { - node.childNodes[1].childNodes[0].className += ' jstree-themeicon-hidden'; - } - else if(obj.icon.indexOf('/') === -1 && obj.icon.indexOf('.') === -1) { - node.childNodes[1].childNodes[0].className += ' ' + obj.icon + ' jstree-themeicon-custom'; - } - else { - node.childNodes[1].childNodes[0].style.backgroundImage = 'url('+obj.icon+')'; - node.childNodes[1].childNodes[0].style.backgroundPosition = 'center center'; - node.childNodes[1].childNodes[0].style.backgroundSize = 'auto'; - node.childNodes[1].childNodes[0].className += ' jstree-themeicon-custom'; - } - } - - if(this.settings.core.force_text) { - node.childNodes[1].appendChild(d.createTextNode(obj.text)); - } - else { - node.childNodes[1].innerHTML += obj.text; - } - - - if(deep && obj.children.length && (obj.state.opened || force_render) && obj.state.loaded) { - k = d.createElement('UL'); - k.setAttribute('role', 'group'); - k.className = 'jstree-children'; - for(i = 0, j = obj.children.length; i < j; i++) { - k.appendChild(this.redraw_node(obj.children[i], deep, true)); - } - node.appendChild(k); - } - if(old) { - node.appendChild(old); - } - if(!is_callback) { - // append back using par / ind - if(!par) { - par = this.element[0]; - } - for(i = 0, j = par.childNodes.length; i < j; i++) { - if(par.childNodes[i] && par.childNodes[i].className && par.childNodes[i].className.indexOf('jstree-children') !== -1) { - tmp = par.childNodes[i]; - break; - } - } - if(!tmp) { - tmp = d.createElement('UL'); - tmp.setAttribute('role', 'group'); - tmp.className = 'jstree-children'; - par.appendChild(tmp); - } - par = tmp; - - if(ind < par.childNodes.length) { - par.insertBefore(node, par.childNodes[ind]); - } - else { - par.appendChild(node); - } - if(f) { - t = this.element[0].scrollTop; - l = this.element[0].scrollLeft; - node.childNodes[1].focus(); - this.element[0].scrollTop = t; - this.element[0].scrollLeft = l; - } - } - if(obj.state.opened && !obj.state.loaded) { - obj.state.opened = false; - setTimeout($.proxy(function () { - this.open_node(obj.id, false, 0); - }, this), 0); - } - return node; - }, - /** - * opens a node, revaling its children. If the node is not loaded it will be loaded and opened once ready. - * @name open_node(obj [, callback, animation]) - * @param {mixed} obj the node to open - * @param {Function} callback a function to execute once the node is opened - * @param {Number} animation the animation duration in milliseconds when opening the node (overrides the `core.animation` setting). Use `false` for no animation. - * @trigger open_node.jstree, after_open.jstree, before_open.jstree - */ - open_node : function (obj, callback, animation) { - var t1, t2, d, t; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.open_node(obj[t1], callback, animation); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - animation = animation === undefined ? this.settings.core.animation : animation; - if(!this.is_closed(obj)) { - if(callback) { - callback.call(this, obj, false); - } - return false; - } - if(!this.is_loaded(obj)) { - if(this.is_loading(obj)) { - return setTimeout($.proxy(function () { - this.open_node(obj, callback, animation); - }, this), 500); - } - this.load_node(obj, function (o, ok) { - return ok ? this.open_node(o, callback, animation) : (callback ? callback.call(this, o, false) : false); - }); - } - else { - d = this.get_node(obj, true); - t = this; - if(d.length) { - if(animation && d.children(".jstree-children").length) { - d.children(".jstree-children").stop(true, true); - } - if(obj.children.length && !this._firstChild(d.children('.jstree-children')[0])) { - this.draw_children(obj); - //d = this.get_node(obj, true); - } - if(!animation) { - this.trigger('before_open', { "node" : obj }); - d[0].className = d[0].className.replace('jstree-closed', 'jstree-open'); - d[0].setAttribute("aria-expanded", true); - } - else { - this.trigger('before_open', { "node" : obj }); - d - .children(".jstree-children").css("display","none").end() - .removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded", true) - .children(".jstree-children").stop(true, true) - .slideDown(animation, function () { - this.style.display = ""; - t.trigger("after_open", { "node" : obj }); - }); - } - } - obj.state.opened = true; - if(callback) { - callback.call(this, obj, true); - } - if(!d.length) { - /** - * triggered when a node is about to be opened (if the node is supposed to be in the DOM, it will be, but it won't be visible yet) - * @event - * @name before_open.jstree - * @param {Object} node the opened node - */ - this.trigger('before_open', { "node" : obj }); - } - /** - * triggered when a node is opened (if there is an animation it will not be completed yet) - * @event - * @name open_node.jstree - * @param {Object} node the opened node - */ - this.trigger('open_node', { "node" : obj }); - if(!animation || !d.length) { - /** - * triggered when a node is opened and the animation is complete - * @event - * @name after_open.jstree - * @param {Object} node the opened node - */ - this.trigger("after_open", { "node" : obj }); - } - return true; - } - }, - /** - * opens every parent of a node (node should be loaded) - * @name _open_to(obj) - * @param {mixed} obj the node to reveal - * @private - */ - _open_to : function (obj) { - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - var i, j, p = obj.parents; - for(i = 0, j = p.length; i < j; i+=1) { - if(i !== $.jstree.root) { - this.open_node(p[i], false, 0); - } - } - return $('#' + obj.id.replace($.jstree.idregex,'\\$&'), this.element); - }, - /** - * closes a node, hiding its children - * @name close_node(obj [, animation]) - * @param {mixed} obj the node to close - * @param {Number} animation the animation duration in milliseconds when closing the node (overrides the `core.animation` setting). Use `false` for no animation. - * @trigger close_node.jstree, after_close.jstree - */ - close_node : function (obj, animation) { - var t1, t2, t, d; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.close_node(obj[t1], animation); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - if(this.is_closed(obj)) { - return false; - } - animation = animation === undefined ? this.settings.core.animation : animation; - t = this; - d = this.get_node(obj, true); - if(d.length) { - if(!animation) { - d[0].className = d[0].className.replace('jstree-open', 'jstree-closed'); - d.attr("aria-expanded", false).children('.jstree-children').remove(); - } - else { - d - .children(".jstree-children").attr("style","display:block !important").end() - .removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded", false) - .children(".jstree-children").stop(true, true).slideUp(animation, function () { - this.style.display = ""; - d.children('.jstree-children').remove(); - t.trigger("after_close", { "node" : obj }); - }); - } - } - obj.state.opened = false; - /** - * triggered when a node is closed (if there is an animation it will not be complete yet) - * @event - * @name close_node.jstree - * @param {Object} node the closed node - */ - this.trigger('close_node',{ "node" : obj }); - if(!animation || !d.length) { - /** - * triggered when a node is closed and the animation is complete - * @event - * @name after_close.jstree - * @param {Object} node the closed node - */ - this.trigger("after_close", { "node" : obj }); - } - }, - /** - * toggles a node - closing it if it is open, opening it if it is closed - * @name toggle_node(obj) - * @param {mixed} obj the node to toggle - */ - toggle_node : function (obj) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.toggle_node(obj[t1]); - } - return true; - } - if(this.is_closed(obj)) { - return this.open_node(obj); - } - if(this.is_open(obj)) { - return this.close_node(obj); - } - }, - /** - * opens all nodes within a node (or the tree), revaling their children. If the node is not loaded it will be loaded and opened once ready. - * @name open_all([obj, animation, original_obj]) - * @param {mixed} obj the node to open recursively, omit to open all nodes in the tree - * @param {Number} animation the animation duration in milliseconds when opening the nodes, the default is no animation - * @param {jQuery} reference to the node that started the process (internal use) - * @trigger open_all.jstree - */ - open_all : function (obj, animation, original_obj) { - if(!obj) { obj = $.jstree.root; } - obj = this.get_node(obj); - if(!obj) { return false; } - var dom = obj.id === $.jstree.root ? this.get_container_ul() : this.get_node(obj, true), i, j, _this; - if(!dom.length) { - for(i = 0, j = obj.children_d.length; i < j; i++) { - if(this.is_closed(this._model.data[obj.children_d[i]])) { - this._model.data[obj.children_d[i]].state.opened = true; - } - } - return this.trigger('open_all', { "node" : obj }); - } - original_obj = original_obj || dom; - _this = this; - dom = this.is_closed(obj) ? dom.find('.jstree-closed').addBack() : dom.find('.jstree-closed'); - dom.each(function () { - _this.open_node( - this, - function(node, status) { if(status && this.is_parent(node)) { this.open_all(node, animation, original_obj); } }, - animation || 0 - ); - }); - if(original_obj.find('.jstree-closed').length === 0) { - /** - * triggered when an `open_all` call completes - * @event - * @name open_all.jstree - * @param {Object} node the opened node - */ - this.trigger('open_all', { "node" : this.get_node(original_obj) }); - } - }, - /** - * closes all nodes within a node (or the tree), revaling their children - * @name close_all([obj, animation]) - * @param {mixed} obj the node to close recursively, omit to close all nodes in the tree - * @param {Number} animation the animation duration in milliseconds when closing the nodes, the default is no animation - * @trigger close_all.jstree - */ - close_all : function (obj, animation) { - if(!obj) { obj = $.jstree.root; } - obj = this.get_node(obj); - if(!obj) { return false; } - var dom = obj.id === $.jstree.root ? this.get_container_ul() : this.get_node(obj, true), - _this = this, i, j; - if(dom.length) { - dom = this.is_open(obj) ? dom.find('.jstree-open').addBack() : dom.find('.jstree-open'); - $(dom.get().reverse()).each(function () { _this.close_node(this, animation || 0); }); - } - for(i = 0, j = obj.children_d.length; i < j; i++) { - this._model.data[obj.children_d[i]].state.opened = false; - } - /** - * triggered when an `close_all` call completes - * @event - * @name close_all.jstree - * @param {Object} node the closed node - */ - this.trigger('close_all', { "node" : obj }); - }, - /** - * checks if a node is disabled (not selectable) - * @name is_disabled(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_disabled : function (obj) { - obj = this.get_node(obj); - return obj && obj.state && obj.state.disabled; - }, - /** - * enables a node - so that it can be selected - * @name enable_node(obj) - * @param {mixed} obj the node to enable - * @trigger enable_node.jstree - */ - enable_node : function (obj) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.enable_node(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - obj.state.disabled = false; - this.get_node(obj,true).children('.jstree-anchor').removeClass('jstree-disabled').attr('aria-disabled', false); - /** - * triggered when an node is enabled - * @event - * @name enable_node.jstree - * @param {Object} node the enabled node - */ - this.trigger('enable_node', { 'node' : obj }); - }, - /** - * disables a node - so that it can not be selected - * @name disable_node(obj) - * @param {mixed} obj the node to disable - * @trigger disable_node.jstree - */ - disable_node : function (obj) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.disable_node(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - obj.state.disabled = true; - this.get_node(obj,true).children('.jstree-anchor').addClass('jstree-disabled').attr('aria-disabled', true); - /** - * triggered when an node is disabled - * @event - * @name disable_node.jstree - * @param {Object} node the disabled node - */ - this.trigger('disable_node', { 'node' : obj }); - }, - /** - * hides a node - it is still in the structure but will not be visible - * @name hide_node(obj) - * @param {mixed} obj the node to hide - * @param {Boolean} redraw internal parameter controlling if redraw is called - * @trigger hide_node.jstree - */ - hide_node : function (obj, skip_redraw) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.hide_node(obj[t1], true); - } - this.redraw(); - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - if(!obj.state.hidden) { - obj.state.hidden = true; - this._node_changed(obj.parent); - if(!skip_redraw) { - this.redraw(); - } - /** - * triggered when an node is hidden - * @event - * @name hide_node.jstree - * @param {Object} node the hidden node - */ - this.trigger('hide_node', { 'node' : obj }); - } - }, - /** - * shows a node - * @name show_node(obj) - * @param {mixed} obj the node to show - * @param {Boolean} skip_redraw internal parameter controlling if redraw is called - * @trigger show_node.jstree - */ - show_node : function (obj, skip_redraw) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.show_node(obj[t1], true); - } - this.redraw(); - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - if(obj.state.hidden) { - obj.state.hidden = false; - this._node_changed(obj.parent); - if(!skip_redraw) { - this.redraw(); - } - /** - * triggered when an node is shown - * @event - * @name show_node.jstree - * @param {Object} node the shown node - */ - this.trigger('show_node', { 'node' : obj }); - } - }, - /** - * hides all nodes - * @name hide_all() - * @trigger hide_all.jstree - */ - hide_all : function (skip_redraw) { - var i, m = this._model.data, ids = []; - for(i in m) { - if(m.hasOwnProperty(i) && i !== $.jstree.root && !m[i].state.hidden) { - m[i].state.hidden = true; - ids.push(i); - } - } - this._model.force_full_redraw = true; - if(!skip_redraw) { - this.redraw(); - } - /** - * triggered when all nodes are hidden - * @event - * @name hide_all.jstree - * @param {Array} nodes the IDs of all hidden nodes - */ - this.trigger('hide_all', { 'nodes' : ids }); - return ids; - }, - /** - * shows all nodes - * @name show_all() - * @trigger show_all.jstree - */ - show_all : function (skip_redraw) { - var i, m = this._model.data, ids = []; - for(i in m) { - if(m.hasOwnProperty(i) && i !== $.jstree.root && m[i].state.hidden) { - m[i].state.hidden = false; - ids.push(i); - } - } - this._model.force_full_redraw = true; - if(!skip_redraw) { - this.redraw(); - } - /** - * triggered when all nodes are shown - * @event - * @name show_all.jstree - * @param {Array} nodes the IDs of all shown nodes - */ - this.trigger('show_all', { 'nodes' : ids }); - return ids; - }, - /** - * called when a node is selected by the user. Used internally. - * @private - * @name activate_node(obj, e) - * @param {mixed} obj the node - * @param {Object} e the related event - * @trigger activate_node.jstree, changed.jstree - */ - activate_node : function (obj, e) { - if(this.is_disabled(obj)) { - return false; - } - if(!e || typeof e !== 'object') { - e = {}; - } - - // ensure last_clicked is still in the DOM, make it fresh (maybe it was moved?) and make sure it is still selected, if not - make last_clicked the last selected node - this._data.core.last_clicked = this._data.core.last_clicked && this._data.core.last_clicked.id !== undefined ? this.get_node(this._data.core.last_clicked.id) : null; - if(this._data.core.last_clicked && !this._data.core.last_clicked.state.selected) { this._data.core.last_clicked = null; } - if(!this._data.core.last_clicked && this._data.core.selected.length) { this._data.core.last_clicked = this.get_node(this._data.core.selected[this._data.core.selected.length - 1]); } - - if(!this.settings.core.multiple || (!e.metaKey && !e.ctrlKey && !e.shiftKey) || (e.shiftKey && (!this._data.core.last_clicked || !this.get_parent(obj) || this.get_parent(obj) !== this._data.core.last_clicked.parent ) )) { - if(!this.settings.core.multiple && (e.metaKey || e.ctrlKey || e.shiftKey) && this.is_selected(obj)) { - this.deselect_node(obj, false, e); - } - else { - this.deselect_all(true); - this.select_node(obj, false, false, e); - this._data.core.last_clicked = this.get_node(obj); - } - } - else { - if(e.shiftKey) { - var o = this.get_node(obj).id, - l = this._data.core.last_clicked.id, - p = this.get_node(this._data.core.last_clicked.parent).children, - c = false, - i, j; - for(i = 0, j = p.length; i < j; i += 1) { - // separate IFs work whem o and l are the same - if(p[i] === o) { - c = !c; - } - if(p[i] === l) { - c = !c; - } - if(!this.is_disabled(p[i]) && (c || p[i] === o || p[i] === l)) { - this.select_node(p[i], true, false, e); - } - else { - this.deselect_node(p[i], true, e); - } - } - this.trigger('changed', { 'action' : 'select_node', 'node' : this.get_node(obj), 'selected' : this._data.core.selected, 'event' : e }); - } - else { - if(!this.is_selected(obj)) { - this.select_node(obj, false, false, e); - } - else { - this.deselect_node(obj, false, e); - } - } - } - /** - * triggered when an node is clicked or intercated with by the user - * @event - * @name activate_node.jstree - * @param {Object} node - * @param {Object} event the ooriginal event (if any) which triggered the call (may be an empty object) - */ - this.trigger('activate_node', { 'node' : this.get_node(obj), 'event' : e }); - }, - /** - * applies the hover state on a node, called when a node is hovered by the user. Used internally. - * @private - * @name hover_node(obj) - * @param {mixed} obj - * @trigger hover_node.jstree - */ - hover_node : function (obj) { - obj = this.get_node(obj, true); - if(!obj || !obj.length || obj.children('.jstree-hovered').length) { - return false; - } - var o = this.element.find('.jstree-hovered'), t = this.element; - if(o && o.length) { this.dehover_node(o); } - - obj.children('.jstree-anchor').addClass('jstree-hovered'); - /** - * triggered when an node is hovered - * @event - * @name hover_node.jstree - * @param {Object} node - */ - this.trigger('hover_node', { 'node' : this.get_node(obj) }); - setTimeout(function () { t.attr('aria-activedescendant', obj[0].id); }, 0); - }, - /** - * removes the hover state from a nodecalled when a node is no longer hovered by the user. Used internally. - * @private - * @name dehover_node(obj) - * @param {mixed} obj - * @trigger dehover_node.jstree - */ - dehover_node : function (obj) { - obj = this.get_node(obj, true); - if(!obj || !obj.length || !obj.children('.jstree-hovered').length) { - return false; - } - obj.children('.jstree-anchor').removeClass('jstree-hovered'); - /** - * triggered when an node is no longer hovered - * @event - * @name dehover_node.jstree - * @param {Object} node - */ - this.trigger('dehover_node', { 'node' : this.get_node(obj) }); - }, - /** - * select a node - * @name select_node(obj [, supress_event, prevent_open]) - * @param {mixed} obj an array can be used to select multiple nodes - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @param {Boolean} prevent_open if set to `true` parents of the selected node won't be opened - * @trigger select_node.jstree, changed.jstree - */ - select_node : function (obj, supress_event, prevent_open, e) { - var dom, t1, t2, th; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.select_node(obj[t1], supress_event, prevent_open, e); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - dom = this.get_node(obj, true); - if(!obj.state.selected) { - obj.state.selected = true; - this._data.core.selected.push(obj.id); - if(!prevent_open) { - dom = this._open_to(obj); - } - if(dom && dom.length) { - dom.attr('aria-selected', true).children('.jstree-anchor').addClass('jstree-clicked'); - } - /** - * triggered when an node is selected - * @event - * @name select_node.jstree - * @param {Object} node - * @param {Array} selected the current selection - * @param {Object} event the event (if any) that triggered this select_node - */ - this.trigger('select_node', { 'node' : obj, 'selected' : this._data.core.selected, 'event' : e }); - if(!supress_event) { - /** - * triggered when selection changes - * @event - * @name changed.jstree - * @param {Object} node - * @param {Object} action the action that caused the selection to change - * @param {Array} selected the current selection - * @param {Object} event the event (if any) that triggered this changed event - */ - this.trigger('changed', { 'action' : 'select_node', 'node' : obj, 'selected' : this._data.core.selected, 'event' : e }); - } - } - }, - /** - * deselect a node - * @name deselect_node(obj [, supress_event]) - * @param {mixed} obj an array can be used to deselect multiple nodes - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @trigger deselect_node.jstree, changed.jstree - */ - deselect_node : function (obj, supress_event, e) { - var t1, t2, dom; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.deselect_node(obj[t1], supress_event, e); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - dom = this.get_node(obj, true); - if(obj.state.selected) { - obj.state.selected = false; - this._data.core.selected = $.vakata.array_remove_item(this._data.core.selected, obj.id); - if(dom.length) { - dom.attr('aria-selected', false).children('.jstree-anchor').removeClass('jstree-clicked'); - } - /** - * triggered when an node is deselected - * @event - * @name deselect_node.jstree - * @param {Object} node - * @param {Array} selected the current selection - * @param {Object} event the event (if any) that triggered this deselect_node - */ - this.trigger('deselect_node', { 'node' : obj, 'selected' : this._data.core.selected, 'event' : e }); - if(!supress_event) { - this.trigger('changed', { 'action' : 'deselect_node', 'node' : obj, 'selected' : this._data.core.selected, 'event' : e }); - } - } - }, - /** - * select all nodes in the tree - * @name select_all([supress_event]) - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @trigger select_all.jstree, changed.jstree - */ - select_all : function (supress_event) { - var tmp = this._data.core.selected.concat([]), i, j; - this._data.core.selected = this._model.data[$.jstree.root].children_d.concat(); - for(i = 0, j = this._data.core.selected.length; i < j; i++) { - if(this._model.data[this._data.core.selected[i]]) { - this._model.data[this._data.core.selected[i]].state.selected = true; - } - } - this.redraw(true); - /** - * triggered when all nodes are selected - * @event - * @name select_all.jstree - * @param {Array} selected the current selection - */ - this.trigger('select_all', { 'selected' : this._data.core.selected }); - if(!supress_event) { - this.trigger('changed', { 'action' : 'select_all', 'selected' : this._data.core.selected, 'old_selection' : tmp }); - } - }, - /** - * deselect all selected nodes - * @name deselect_all([supress_event]) - * @param {Boolean} supress_event if set to `true` the `changed.jstree` event won't be triggered - * @trigger deselect_all.jstree, changed.jstree - */ - deselect_all : function (supress_event) { - var tmp = this._data.core.selected.concat([]), i, j; - for(i = 0, j = this._data.core.selected.length; i < j; i++) { - if(this._model.data[this._data.core.selected[i]]) { - this._model.data[this._data.core.selected[i]].state.selected = false; - } - } - this._data.core.selected = []; - this.element.find('.jstree-clicked').removeClass('jstree-clicked').parent().attr('aria-selected', false); - /** - * triggered when all nodes are deselected - * @event - * @name deselect_all.jstree - * @param {Object} node the previous selection - * @param {Array} selected the current selection - */ - this.trigger('deselect_all', { 'selected' : this._data.core.selected, 'node' : tmp }); - if(!supress_event) { - this.trigger('changed', { 'action' : 'deselect_all', 'selected' : this._data.core.selected, 'old_selection' : tmp }); - } - }, - /** - * checks if a node is selected - * @name is_selected(obj) - * @param {mixed} obj - * @return {Boolean} - */ - is_selected : function (obj) { - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - return obj.state.selected; - }, - /** - * get an array of all selected nodes - * @name get_selected([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} - */ - get_selected : function (full) { - return full ? $.map(this._data.core.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.core.selected.slice(); - }, - /** - * get an array of all top level selected nodes (ignoring children of selected nodes) - * @name get_top_selected([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} - */ - get_top_selected : function (full) { - var tmp = this.get_selected(true), - obj = {}, i, j, k, l; - for(i = 0, j = tmp.length; i < j; i++) { - obj[tmp[i].id] = tmp[i]; - } - for(i = 0, j = tmp.length; i < j; i++) { - for(k = 0, l = tmp[i].children_d.length; k < l; k++) { - if(obj[tmp[i].children_d[k]]) { - delete obj[tmp[i].children_d[k]]; - } - } - } - tmp = []; - for(i in obj) { - if(obj.hasOwnProperty(i)) { - tmp.push(i); - } - } - return full ? $.map(tmp, $.proxy(function (i) { return this.get_node(i); }, this)) : tmp; - }, - /** - * get an array of all bottom level selected nodes (ignoring selected parents) - * @name get_bottom_selected([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} - */ - get_bottom_selected : function (full) { - var tmp = this.get_selected(true), - obj = [], i, j; - for(i = 0, j = tmp.length; i < j; i++) { - if(!tmp[i].children.length) { - obj.push(tmp[i].id); - } - } - return full ? $.map(obj, $.proxy(function (i) { return this.get_node(i); }, this)) : obj; - }, - /** - * gets the current state of the tree so that it can be restored later with `set_state(state)`. Used internally. - * @name get_state() - * @private - * @return {Object} - */ - get_state : function () { - var state = { - 'core' : { - 'open' : [], - 'scroll' : { - 'left' : this.element.scrollLeft(), - 'top' : this.element.scrollTop() - }, - /*! - 'themes' : { - 'name' : this.get_theme(), - 'icons' : this._data.core.themes.icons, - 'dots' : this._data.core.themes.dots - }, - */ - 'selected' : [] - } - }, i; - for(i in this._model.data) { - if(this._model.data.hasOwnProperty(i)) { - if(i !== $.jstree.root) { - if(this._model.data[i].state.opened) { - state.core.open.push(i); - } - if(this._model.data[i].state.selected) { - state.core.selected.push(i); - } - } - } - } - return state; - }, - /** - * sets the state of the tree. Used internally. - * @name set_state(state [, callback]) - * @private - * @param {Object} state the state to restore. Keep in mind this object is passed by reference and jstree will modify it. - * @param {Function} callback an optional function to execute once the state is restored. - * @trigger set_state.jstree - */ - set_state : function (state, callback) { - if(state) { - if(state.core) { - var res, n, t, _this, i; - if(state.core.open) { - if(!$.isArray(state.core.open) || !state.core.open.length) { - delete state.core.open; - this.set_state(state, callback); - } - else { - this._load_nodes(state.core.open, function (nodes) { - this.open_node(nodes, false, 0); - delete state.core.open; - this.set_state(state, callback); - }, true); - } - return false; - } - if(state.core.scroll) { - if(state.core.scroll && state.core.scroll.left !== undefined) { - this.element.scrollLeft(state.core.scroll.left); - } - if(state.core.scroll && state.core.scroll.top !== undefined) { - this.element.scrollTop(state.core.scroll.top); - } - delete state.core.scroll; - this.set_state(state, callback); - return false; - } - if(state.core.selected) { - _this = this; - this.deselect_all(); - $.each(state.core.selected, function (i, v) { - _this.select_node(v, false, true); - }); - delete state.core.selected; - this.set_state(state, callback); - return false; - } - for(i in state) { - if(state.hasOwnProperty(i) && i !== "core" && $.inArray(i, this.settings.plugins) === -1) { - delete state[i]; - } - } - if($.isEmptyObject(state.core)) { - delete state.core; - this.set_state(state, callback); - return false; - } - } - if($.isEmptyObject(state)) { - state = null; - if(callback) { callback.call(this); } - /** - * triggered when a `set_state` call completes - * @event - * @name set_state.jstree - */ - this.trigger('set_state'); - return false; - } - return true; - } - return false; - }, - /** - * refreshes the tree - all nodes are reloaded with calls to `load_node`. - * @name refresh() - * @param {Boolean} skip_loading an option to skip showing the loading indicator - * @param {Mixed} forget_state if set to `true` state will not be reapplied, if set to a function (receiving the current state as argument) the result of that function will be used as state - * @trigger refresh.jstree - */ - refresh : function (skip_loading, forget_state) { - this._data.core.state = forget_state === true ? {} : this.get_state(); - if(forget_state && $.isFunction(forget_state)) { this._data.core.state = forget_state.call(this, this._data.core.state); } - this._cnt = 0; - this._model.data = {}; - this._model.data[$.jstree.root] = { - id : $.jstree.root, - parent : null, - parents : [], - children : [], - children_d : [], - state : { loaded : false } - }; - this._data.core.selected = []; - this._data.core.last_clicked = null; - this._data.core.focused = null; - - var c = this.get_container_ul()[0].className; - if(!skip_loading) { - this.element.html("<"+"ul class='"+c+"' role='group'><"+"li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><"+"a class='jstree-anchor' href='#'>" + this.get_string("Loading ...") + ""); - this.element.attr('aria-activedescendant','j'+this._id+'_loading'); - } - this.load_node($.jstree.root, function (o, s) { - if(s) { - this.get_container_ul()[0].className = c; - if(this._firstChild(this.get_container_ul()[0])) { - this.element.attr('aria-activedescendant',this._firstChild(this.get_container_ul()[0]).id); - } - this.set_state($.extend(true, {}, this._data.core.state), function () { - /** - * triggered when a `refresh` call completes - * @event - * @name refresh.jstree - */ - this.trigger('refresh'); - }); - } - this._data.core.state = null; - }); - }, - /** - * refreshes a node in the tree (reload its children) all opened nodes inside that node are reloaded with calls to `load_node`. - * @name refresh_node(obj) - * @param {mixed} obj the node - * @trigger refresh_node.jstree - */ - refresh_node : function (obj) { - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - var opened = [], to_load = [], s = this._data.core.selected.concat([]); - to_load.push(obj.id); - if(obj.state.opened === true) { opened.push(obj.id); } - this.get_node(obj, true).find('.jstree-open').each(function() { opened.push(this.id); }); - this._load_nodes(to_load, $.proxy(function (nodes) { - this.open_node(opened, false, 0); - this.select_node(this._data.core.selected); - /** - * triggered when a node is refreshed - * @event - * @name refresh_node.jstree - * @param {Object} node - the refreshed node - * @param {Array} nodes - an array of the IDs of the nodes that were reloaded - */ - this.trigger('refresh_node', { 'node' : obj, 'nodes' : nodes }); - }, this)); - }, - /** - * set (change) the ID of a node - * @name set_id(obj, id) - * @param {mixed} obj the node - * @param {String} id the new ID - * @return {Boolean} - */ - set_id : function (obj, id) { - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - var i, j, m = this._model.data; - id = id.toString(); - // update parents (replace current ID with new one in children and children_d) - m[obj.parent].children[$.inArray(obj.id, m[obj.parent].children)] = id; - for(i = 0, j = obj.parents.length; i < j; i++) { - m[obj.parents[i]].children_d[$.inArray(obj.id, m[obj.parents[i]].children_d)] = id; - } - // update children (replace current ID with new one in parent and parents) - for(i = 0, j = obj.children.length; i < j; i++) { - m[obj.children[i]].parent = id; - } - for(i = 0, j = obj.children_d.length; i < j; i++) { - m[obj.children_d[i]].parents[$.inArray(obj.id, m[obj.children_d[i]].parents)] = id; - } - i = $.inArray(obj.id, this._data.core.selected); - if(i !== -1) { this._data.core.selected[i] = id; } - // update model and obj itself (obj.id, this._model.data[KEY]) - i = this.get_node(obj.id, true); - if(i) { - i.attr('id', id).children('.jstree-anchor').attr('id', id + '_anchor').end().attr('aria-labelledby', id + '_anchor'); - if(this.element.attr('aria-activedescendant') === obj.id) { - this.element.attr('aria-activedescendant', id); - } - } - delete m[obj.id]; - obj.id = id; - obj.li_attr.id = id; - m[id] = obj; - return true; - }, - /** - * get the text value of a node - * @name get_text(obj) - * @param {mixed} obj the node - * @return {String} - */ - get_text : function (obj) { - obj = this.get_node(obj); - return (!obj || obj.id === $.jstree.root) ? false : obj.text; - }, - /** - * set the text value of a node. Used internally, please use `rename_node(obj, val)`. - * @private - * @name set_text(obj, val) - * @param {mixed} obj the node, you can pass an array to set the text on multiple nodes - * @param {String} val the new text value - * @return {Boolean} - * @trigger set_text.jstree - */ - set_text : function (obj, val) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.set_text(obj[t1], val); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - obj.text = val; - if(this.get_node(obj, true).length) { - this.redraw_node(obj.id); - } - /** - * triggered when a node text value is changed - * @event - * @name set_text.jstree - * @param {Object} obj - * @param {String} text the new value - */ - this.trigger('set_text',{ "obj" : obj, "text" : val }); - return true; - }, - /** - * gets a JSON representation of a node (or the whole tree) - * @name get_json([obj, options]) - * @param {mixed} obj - * @param {Object} options - * @param {Boolean} options.no_state do not return state information - * @param {Boolean} options.no_id do not return ID - * @param {Boolean} options.no_children do not include children - * @param {Boolean} options.no_data do not include node data - * @param {Boolean} options.flat return flat JSON instead of nested - * @return {Object} - */ - get_json : function (obj, options, flat) { - obj = this.get_node(obj || $.jstree.root); - if(!obj) { return false; } - if(options && options.flat && !flat) { flat = []; } - var tmp = { - 'id' : obj.id, - 'text' : obj.text, - 'icon' : this.get_icon(obj), - 'li_attr' : $.extend(true, {}, obj.li_attr), - 'a_attr' : $.extend(true, {}, obj.a_attr), - 'state' : {}, - 'data' : options && options.no_data ? false : $.extend(true, {}, obj.data) - //( this.get_node(obj, true).length ? this.get_node(obj, true).data() : obj.data ), - }, i, j; - if(options && options.flat) { - tmp.parent = obj.parent; - } - else { - tmp.children = []; - } - if(!options || !options.no_state) { - for(i in obj.state) { - if(obj.state.hasOwnProperty(i)) { - tmp.state[i] = obj.state[i]; - } - } - } - if(options && options.no_id) { - delete tmp.id; - if(tmp.li_attr && tmp.li_attr.id) { - delete tmp.li_attr.id; - } - if(tmp.a_attr && tmp.a_attr.id) { - delete tmp.a_attr.id; - } - } - if(options && options.flat && obj.id !== $.jstree.root) { - flat.push(tmp); - } - if(!options || !options.no_children) { - for(i = 0, j = obj.children.length; i < j; i++) { - if(options && options.flat) { - this.get_json(obj.children[i], options, flat); - } - else { - tmp.children.push(this.get_json(obj.children[i], options)); - } - } - } - return options && options.flat ? flat : (obj.id === $.jstree.root ? tmp.children : tmp); - }, - /** - * create a new node (do not confuse with load_node) - * @name create_node([obj, node, pos, callback, is_loaded]) - * @param {mixed} par the parent node (to create a root node use either "#" (string) or `null`) - * @param {mixed} node the data for the new node (a valid JSON object, or a simple string with the name) - * @param {mixed} pos the index at which to insert the node, "first" and "last" are also supported, default is "last" - * @param {Function} callback a function to be called once the node is created - * @param {Boolean} is_loaded internal argument indicating if the parent node was succesfully loaded - * @return {String} the ID of the newly create node - * @trigger model.jstree, create_node.jstree - */ - create_node : function (par, node, pos, callback, is_loaded) { - if(par === null) { par = $.jstree.root; } - par = this.get_node(par); - if(!par) { return false; } - pos = pos === undefined ? "last" : pos; - if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) { - return this.load_node(par, function () { this.create_node(par, node, pos, callback, true); }); - } - if(!node) { node = { "text" : this.get_string('New node') }; } - if(typeof node === "string") { node = { "text" : node }; } - if(node.text === undefined) { node.text = this.get_string('New node'); } - var tmp, dpc, i, j; - - if(par.id === $.jstree.root) { - if(pos === "before") { pos = "first"; } - if(pos === "after") { pos = "last"; } - } - switch(pos) { - case "before": - tmp = this.get_node(par.parent); - pos = $.inArray(par.id, tmp.children); - par = tmp; - break; - case "after" : - tmp = this.get_node(par.parent); - pos = $.inArray(par.id, tmp.children) + 1; - par = tmp; - break; - case "inside": - case "first": - pos = 0; - break; - case "last": - pos = par.children.length; - break; - default: - if(!pos) { pos = 0; } - break; - } - if(pos > par.children.length) { pos = par.children.length; } - if(!node.id) { node.id = true; } - if(!this.check("create_node", node, par, pos)) { - this.settings.core.error.call(this, this._data.core.last_error); - return false; - } - if(node.id === true) { delete node.id; } - node = this._parse_model_from_json(node, par.id, par.parents.concat()); - if(!node) { return false; } - tmp = this.get_node(node); - dpc = []; - dpc.push(node); - dpc = dpc.concat(tmp.children_d); - this.trigger('model', { "nodes" : dpc, "parent" : par.id }); - - par.children_d = par.children_d.concat(dpc); - for(i = 0, j = par.parents.length; i < j; i++) { - this._model.data[par.parents[i]].children_d = this._model.data[par.parents[i]].children_d.concat(dpc); - } - node = tmp; - tmp = []; - for(i = 0, j = par.children.length; i < j; i++) { - tmp[i >= pos ? i+1 : i] = par.children[i]; - } - tmp[pos] = node.id; - par.children = tmp; - - this.redraw_node(par, true); - if(callback) { callback.call(this, this.get_node(node)); } - /** - * triggered when a node is created - * @event - * @name create_node.jstree - * @param {Object} node - * @param {String} parent the parent's ID - * @param {Number} position the position of the new node among the parent's children - */ - this.trigger('create_node', { "node" : this.get_node(node), "parent" : par.id, "position" : pos }); - return node.id; - }, - /** - * set the text value of a node - * @name rename_node(obj, val) - * @param {mixed} obj the node, you can pass an array to rename multiple nodes to the same name - * @param {String} val the new text value - * @return {Boolean} - * @trigger rename_node.jstree - */ - rename_node : function (obj, val) { - var t1, t2, old; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.rename_node(obj[t1], val); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - old = obj.text; - if(!this.check("rename_node", obj, this.get_parent(obj), val)) { - this.settings.core.error.call(this, this._data.core.last_error); - return false; - } - this.set_text(obj, val); // .apply(this, Array.prototype.slice.call(arguments)) - /** - * triggered when a node is renamed - * @event - * @name rename_node.jstree - * @param {Object} node - * @param {String} text the new value - * @param {String} old the old value - */ - this.trigger('rename_node', { "node" : obj, "text" : val, "old" : old }); - return true; - }, - /** - * remove a node - * @name delete_node(obj) - * @param {mixed} obj the node, you can pass an array to delete multiple nodes - * @return {Boolean} - * @trigger delete_node.jstree, changed.jstree - */ - delete_node : function (obj) { - var t1, t2, par, pos, tmp, i, j, k, l, c, top, lft; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.delete_node(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - par = this.get_node(obj.parent); - pos = $.inArray(obj.id, par.children); - c = false; - if(!this.check("delete_node", obj, par, pos)) { - this.settings.core.error.call(this, this._data.core.last_error); - return false; - } - if(pos !== -1) { - par.children = $.vakata.array_remove(par.children, pos); - } - tmp = obj.children_d.concat([]); - tmp.push(obj.id); - for(k = 0, l = tmp.length; k < l; k++) { - for(i = 0, j = obj.parents.length; i < j; i++) { - pos = $.inArray(tmp[k], this._model.data[obj.parents[i]].children_d); - if(pos !== -1) { - this._model.data[obj.parents[i]].children_d = $.vakata.array_remove(this._model.data[obj.parents[i]].children_d, pos); - } - } - if(this._model.data[tmp[k]].state.selected) { - c = true; - pos = $.inArray(tmp[k], this._data.core.selected); - if(pos !== -1) { - this._data.core.selected = $.vakata.array_remove(this._data.core.selected, pos); - } - } - } - /** - * triggered when a node is deleted - * @event - * @name delete_node.jstree - * @param {Object} node - * @param {String} parent the parent's ID - */ - this.trigger('delete_node', { "node" : obj, "parent" : par.id }); - if(c) { - this.trigger('changed', { 'action' : 'delete_node', 'node' : obj, 'selected' : this._data.core.selected, 'parent' : par.id }); - } - for(k = 0, l = tmp.length; k < l; k++) { - delete this._model.data[tmp[k]]; - } - if($.inArray(this._data.core.focused, tmp) !== -1) { - this._data.core.focused = null; - top = this.element[0].scrollTop; - lft = this.element[0].scrollLeft; - if(par.id === $.jstree.root) { - this.get_node(this._model.data[$.jstree.root].children[0], true).children('.jstree-anchor').focus(); - } - else { - this.get_node(par, true).children('.jstree-anchor').focus(); - } - this.element[0].scrollTop = top; - this.element[0].scrollLeft = lft; - } - this.redraw_node(par, true); - return true; - }, - /** - * check if an operation is premitted on the tree. Used internally. - * @private - * @name check(chk, obj, par, pos) - * @param {String} chk the operation to check, can be "create_node", "rename_node", "delete_node", "copy_node" or "move_node" - * @param {mixed} obj the node - * @param {mixed} par the parent - * @param {mixed} pos the position to insert at, or if "rename_node" - the new name - * @param {mixed} more some various additional information, for example if a "move_node" operations is triggered by DND this will be the hovered node - * @return {Boolean} - */ - check : function (chk, obj, par, pos, more) { - obj = obj && obj.id ? obj : this.get_node(obj); - par = par && par.id ? par : this.get_node(par); - var tmp = chk.match(/^move_node|copy_node|create_node$/i) ? par : obj, - chc = this.settings.core.check_callback; - if(chk === "move_node" || chk === "copy_node") { - if((!more || !more.is_multi) && (obj.id === par.id || $.inArray(obj.id, par.children) === pos || $.inArray(par.id, obj.children_d) !== -1)) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_01', 'reason' : 'Moving parent inside child', 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - return false; - } - } - if(tmp && tmp.data) { tmp = tmp.data; } - if(tmp && tmp.functions && (tmp.functions[chk] === false || tmp.functions[chk] === true)) { - if(tmp.functions[chk] === false) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_02', 'reason' : 'Node data prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - } - return tmp.functions[chk]; - } - if(chc === false || ($.isFunction(chc) && chc.call(this, chk, obj, par, pos, more) === false) || (chc && chc[chk] === false)) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_03', 'reason' : 'User config for core.check_callback prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - return false; - } - return true; - }, - /** - * get the last error - * @name last_error() - * @return {Object} - */ - last_error : function () { - return this._data.core.last_error; - }, - /** - * move a node to a new parent - * @name move_node(obj, par [, pos, callback, is_loaded]) - * @param {mixed} obj the node to move, pass an array to move multiple nodes - * @param {mixed} par the new parent - * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` - * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position - * @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded - * @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn - * @param {Boolean} instance internal parameter indicating if the node comes from another instance - * @trigger move_node.jstree - */ - move_node : function (obj, par, pos, callback, is_loaded, skip_redraw, origin) { - var t1, t2, old_par, old_pos, new_par, old_ins, is_multi, dpc, tmp, i, j, k, l, p; - - par = this.get_node(par); - pos = pos === undefined ? 0 : pos; - if(!par) { return false; } - if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) { - return this.load_node(par, function () { this.move_node(obj, par, pos, callback, true, false, origin); }); - } - - if($.isArray(obj)) { - if(obj.length === 1) { - obj = obj[0]; - } - else { - //obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - if((tmp = this.move_node(obj[t1], par, pos, callback, is_loaded, false, origin))) { - par = tmp; - pos = "after"; - } - } - this.redraw(); - return true; - } - } - obj = obj && obj.id ? obj : this.get_node(obj); - - if(!obj || obj.id === $.jstree.root) { return false; } - - old_par = (obj.parent || $.jstree.root).toString(); - new_par = (!pos.toString().match(/^(before|after)$/) || par.id === $.jstree.root) ? par : this.get_node(par.parent); - old_ins = origin ? origin : (this._model.data[obj.id] ? this : $.jstree.reference(obj.id)); - is_multi = !old_ins || !old_ins._id || (this._id !== old_ins._id); - old_pos = old_ins && old_ins._id && old_par && old_ins._model.data[old_par] && old_ins._model.data[old_par].children ? $.inArray(obj.id, old_ins._model.data[old_par].children) : -1; - if(old_ins && old_ins._id) { - obj = old_ins._model.data[obj.id]; - } - - if(is_multi) { - if((tmp = this.copy_node(obj, par, pos, callback, is_loaded, false, origin))) { - if(old_ins) { old_ins.delete_node(obj); } - return tmp; - } - return false; - } - //var m = this._model.data; - if(par.id === $.jstree.root) { - if(pos === "before") { pos = "first"; } - if(pos === "after") { pos = "last"; } - } - switch(pos) { - case "before": - pos = $.inArray(par.id, new_par.children); - break; - case "after" : - pos = $.inArray(par.id, new_par.children) + 1; - break; - case "inside": - case "first": - pos = 0; - break; - case "last": - pos = new_par.children.length; - break; - default: - if(!pos) { pos = 0; } - break; - } - if(pos > new_par.children.length) { pos = new_par.children.length; } - if(!this.check("move_node", obj, new_par, pos, { 'core' : true, 'origin' : origin, 'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id) })) { - this.settings.core.error.call(this, this._data.core.last_error); - return false; - } - if(obj.parent === new_par.id) { - dpc = new_par.children.concat(); - tmp = $.inArray(obj.id, dpc); - if(tmp !== -1) { - dpc = $.vakata.array_remove(dpc, tmp); - if(pos > tmp) { pos--; } - } - tmp = []; - for(i = 0, j = dpc.length; i < j; i++) { - tmp[i >= pos ? i+1 : i] = dpc[i]; - } - tmp[pos] = obj.id; - new_par.children = tmp; - this._node_changed(new_par.id); - this.redraw(new_par.id === $.jstree.root); - } - else { - // clean old parent and up - tmp = obj.children_d.concat(); - tmp.push(obj.id); - for(i = 0, j = obj.parents.length; i < j; i++) { - dpc = []; - p = old_ins._model.data[obj.parents[i]].children_d; - for(k = 0, l = p.length; k < l; k++) { - if($.inArray(p[k], tmp) === -1) { - dpc.push(p[k]); - } - } - old_ins._model.data[obj.parents[i]].children_d = dpc; - } - old_ins._model.data[old_par].children = $.vakata.array_remove_item(old_ins._model.data[old_par].children, obj.id); - - // insert into new parent and up - for(i = 0, j = new_par.parents.length; i < j; i++) { - this._model.data[new_par.parents[i]].children_d = this._model.data[new_par.parents[i]].children_d.concat(tmp); - } - dpc = []; - for(i = 0, j = new_par.children.length; i < j; i++) { - dpc[i >= pos ? i+1 : i] = new_par.children[i]; - } - dpc[pos] = obj.id; - new_par.children = dpc; - new_par.children_d.push(obj.id); - new_par.children_d = new_par.children_d.concat(obj.children_d); - - // update object - obj.parent = new_par.id; - tmp = new_par.parents.concat(); - tmp.unshift(new_par.id); - p = obj.parents.length; - obj.parents = tmp; - - // update object children - tmp = tmp.concat(); - for(i = 0, j = obj.children_d.length; i < j; i++) { - this._model.data[obj.children_d[i]].parents = this._model.data[obj.children_d[i]].parents.slice(0,p*-1); - Array.prototype.push.apply(this._model.data[obj.children_d[i]].parents, tmp); - } - - if(old_par === $.jstree.root || new_par.id === $.jstree.root) { - this._model.force_full_redraw = true; - } - if(!this._model.force_full_redraw) { - this._node_changed(old_par); - this._node_changed(new_par.id); - } - if(!skip_redraw) { - this.redraw(); - } - } - if(callback) { callback.call(this, obj, new_par, pos); } - /** - * triggered when a node is moved - * @event - * @name move_node.jstree - * @param {Object} node - * @param {String} parent the parent's ID - * @param {Number} position the position of the node among the parent's children - * @param {String} old_parent the old parent of the node - * @param {Number} old_position the old position of the node - * @param {Boolean} is_multi do the node and new parent belong to different instances - * @param {jsTree} old_instance the instance the node came from - * @param {jsTree} new_instance the instance of the new parent - */ - this.trigger('move_node', { "node" : obj, "parent" : new_par.id, "position" : pos, "old_parent" : old_par, "old_position" : old_pos, 'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id), 'old_instance' : old_ins, 'new_instance' : this }); - return obj.id; - }, - /** - * copy a node to a new parent - * @name copy_node(obj, par [, pos, callback, is_loaded]) - * @param {mixed} obj the node to copy, pass an array to copy multiple nodes - * @param {mixed} par the new parent - * @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0` - * @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position - * @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded - * @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn - * @param {Boolean} instance internal parameter indicating if the node comes from another instance - * @trigger model.jstree copy_node.jstree - */ - copy_node : function (obj, par, pos, callback, is_loaded, skip_redraw, origin) { - var t1, t2, dpc, tmp, i, j, node, old_par, new_par, old_ins, is_multi; - - par = this.get_node(par); - pos = pos === undefined ? 0 : pos; - if(!par) { return false; } - if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) { - return this.load_node(par, function () { this.copy_node(obj, par, pos, callback, true, false, origin); }); - } - - if($.isArray(obj)) { - if(obj.length === 1) { - obj = obj[0]; - } - else { - //obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - if((tmp = this.copy_node(obj[t1], par, pos, callback, is_loaded, true, origin))) { - par = tmp; - pos = "after"; - } - } - this.redraw(); - return true; - } - } - obj = obj && obj.id ? obj : this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - - old_par = (obj.parent || $.jstree.root).toString(); - new_par = (!pos.toString().match(/^(before|after)$/) || par.id === $.jstree.root) ? par : this.get_node(par.parent); - old_ins = origin ? origin : (this._model.data[obj.id] ? this : $.jstree.reference(obj.id)); - is_multi = !old_ins || !old_ins._id || (this._id !== old_ins._id); - - if(old_ins && old_ins._id) { - obj = old_ins._model.data[obj.id]; - } - - if(par.id === $.jstree.root) { - if(pos === "before") { pos = "first"; } - if(pos === "after") { pos = "last"; } - } - switch(pos) { - case "before": - pos = $.inArray(par.id, new_par.children); - break; - case "after" : - pos = $.inArray(par.id, new_par.children) + 1; - break; - case "inside": - case "first": - pos = 0; - break; - case "last": - pos = new_par.children.length; - break; - default: - if(!pos) { pos = 0; } - break; - } - if(pos > new_par.children.length) { pos = new_par.children.length; } - if(!this.check("copy_node", obj, new_par, pos, { 'core' : true, 'origin' : origin, 'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id) })) { - this.settings.core.error.call(this, this._data.core.last_error); - return false; - } - node = old_ins ? old_ins.get_json(obj, { no_id : true, no_data : true, no_state : true }) : obj; - if(!node) { return false; } - if(node.id === true) { delete node.id; } - node = this._parse_model_from_json(node, new_par.id, new_par.parents.concat()); - if(!node) { return false; } - tmp = this.get_node(node); - if(obj && obj.state && obj.state.loaded === false) { tmp.state.loaded = false; } - dpc = []; - dpc.push(node); - dpc = dpc.concat(tmp.children_d); - this.trigger('model', { "nodes" : dpc, "parent" : new_par.id }); - - // insert into new parent and up - for(i = 0, j = new_par.parents.length; i < j; i++) { - this._model.data[new_par.parents[i]].children_d = this._model.data[new_par.parents[i]].children_d.concat(dpc); - } - dpc = []; - for(i = 0, j = new_par.children.length; i < j; i++) { - dpc[i >= pos ? i+1 : i] = new_par.children[i]; - } - dpc[pos] = tmp.id; - new_par.children = dpc; - new_par.children_d.push(tmp.id); - new_par.children_d = new_par.children_d.concat(tmp.children_d); - - if(new_par.id === $.jstree.root) { - this._model.force_full_redraw = true; - } - if(!this._model.force_full_redraw) { - this._node_changed(new_par.id); - } - if(!skip_redraw) { - this.redraw(new_par.id === $.jstree.root); - } - if(callback) { callback.call(this, tmp, new_par, pos); } - /** - * triggered when a node is copied - * @event - * @name copy_node.jstree - * @param {Object} node the copied node - * @param {Object} original the original node - * @param {String} parent the parent's ID - * @param {Number} position the position of the node among the parent's children - * @param {String} old_parent the old parent of the node - * @param {Number} old_position the position of the original node - * @param {Boolean} is_multi do the node and new parent belong to different instances - * @param {jsTree} old_instance the instance the node came from - * @param {jsTree} new_instance the instance of the new parent - */ - this.trigger('copy_node', { "node" : tmp, "original" : obj, "parent" : new_par.id, "position" : pos, "old_parent" : old_par, "old_position" : old_ins && old_ins._id && old_par && old_ins._model.data[old_par] && old_ins._model.data[old_par].children ? $.inArray(obj.id, old_ins._model.data[old_par].children) : -1,'is_multi' : (old_ins && old_ins._id && old_ins._id !== this._id), 'is_foreign' : (!old_ins || !old_ins._id), 'old_instance' : old_ins, 'new_instance' : this }); - return tmp.id; - }, - /** - * cut a node (a later call to `paste(obj)` would move the node) - * @name cut(obj) - * @param {mixed} obj multiple objects can be passed using an array - * @trigger cut.jstree - */ - cut : function (obj) { - if(!obj) { obj = this._data.core.selected.concat(); } - if(!$.isArray(obj)) { obj = [obj]; } - if(!obj.length) { return false; } - var tmp = [], o, t1, t2; - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - o = this.get_node(obj[t1]); - if(o && o.id && o.id !== $.jstree.root) { tmp.push(o); } - } - if(!tmp.length) { return false; } - ccp_node = tmp; - ccp_inst = this; - ccp_mode = 'move_node'; - /** - * triggered when nodes are added to the buffer for moving - * @event - * @name cut.jstree - * @param {Array} node - */ - this.trigger('cut', { "node" : obj }); - }, - /** - * copy a node (a later call to `paste(obj)` would copy the node) - * @name copy(obj) - * @param {mixed} obj multiple objects can be passed using an array - * @trigger copy.jstree - */ - copy : function (obj) { - if(!obj) { obj = this._data.core.selected.concat(); } - if(!$.isArray(obj)) { obj = [obj]; } - if(!obj.length) { return false; } - var tmp = [], o, t1, t2; - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - o = this.get_node(obj[t1]); - if(o && o.id && o.id !== $.jstree.root) { tmp.push(o); } - } - if(!tmp.length) { return false; } - ccp_node = tmp; - ccp_inst = this; - ccp_mode = 'copy_node'; - /** - * triggered when nodes are added to the buffer for copying - * @event - * @name copy.jstree - * @param {Array} node - */ - this.trigger('copy', { "node" : obj }); - }, - /** - * get the current buffer (any nodes that are waiting for a paste operation) - * @name get_buffer() - * @return {Object} an object consisting of `mode` ("copy_node" or "move_node"), `node` (an array of objects) and `inst` (the instance) - */ - get_buffer : function () { - return { 'mode' : ccp_mode, 'node' : ccp_node, 'inst' : ccp_inst }; - }, - /** - * check if there is something in the buffer to paste - * @name can_paste() - * @return {Boolean} - */ - can_paste : function () { - return ccp_mode !== false && ccp_node !== false; // && ccp_inst._model.data[ccp_node]; - }, - /** - * copy or move the previously cut or copied nodes to a new parent - * @name paste(obj [, pos]) - * @param {mixed} obj the new parent - * @param {mixed} pos the position to insert at (besides integer, "first" and "last" are supported), defaults to integer `0` - * @trigger paste.jstree - */ - paste : function (obj, pos) { - obj = this.get_node(obj); - if(!obj || !ccp_mode || !ccp_mode.match(/^(copy_node|move_node)$/) || !ccp_node) { return false; } - if(this[ccp_mode](ccp_node, obj, pos, false, false, false, ccp_inst)) { - /** - * triggered when paste is invoked - * @event - * @name paste.jstree - * @param {String} parent the ID of the receiving node - * @param {Array} node the nodes in the buffer - * @param {String} mode the performed operation - "copy_node" or "move_node" - */ - this.trigger('paste', { "parent" : obj.id, "node" : ccp_node, "mode" : ccp_mode }); - } - ccp_node = false; - ccp_mode = false; - ccp_inst = false; - }, - /** - * clear the buffer of previously copied or cut nodes - * @name clear_buffer() - * @trigger clear_buffer.jstree - */ - clear_buffer : function () { - ccp_node = false; - ccp_mode = false; - ccp_inst = false; - /** - * triggered when the copy / cut buffer is cleared - * @event - * @name clear_buffer.jstree - */ - this.trigger('clear_buffer'); - }, - /** - * put a node in edit mode (input field to rename the node) - * @name edit(obj [, default_text, callback]) - * @param {mixed} obj - * @param {String} default_text the text to populate the input with (if omitted or set to a non-string value the node's text value is used) - * @param {Function} callback a function to be called once the text box is blurred, it is called in the instance's scope and receives the node, a status parameter (true if the rename is successful, false otherwise) and a boolean indicating if the user cancelled the edit. You can access the node's title using .text - */ - edit : function (obj, default_text, callback) { - var rtl, w, a, s, t, h1, h2, fn, tmp, cancel = false; - obj = this.get_node(obj); - if(!obj) { return false; } - if(this.settings.core.check_callback === false) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'core', 'id' : 'core_07', 'reason' : 'Could not edit node because of check_callback' }; - this.settings.core.error.call(this, this._data.core.last_error); - return false; - } - tmp = obj; - default_text = typeof default_text === 'string' ? default_text : obj.text; - this.set_text(obj, ""); - obj = this._open_to(obj); - tmp.text = default_text; - - rtl = this._data.core.rtl; - w = this.element.width(); - this._data.core.focused = tmp.id; - a = obj.children('.jstree-anchor').focus(); - s = $(''); - /*! - oi = obj.children("i:visible"), - ai = a.children("i:visible"), - w1 = oi.width() * oi.length, - w2 = ai.width() * ai.length, - */ - t = default_text; - h1 = $("<"+"div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"); - h2 = $("<"+"input />", { - "value" : t, - "class" : "jstree-rename-input", - // "size" : t.length, - "css" : { - "padding" : "0", - "border" : "1px solid silver", - "box-sizing" : "border-box", - "display" : "inline-block", - "height" : (this._data.core.li_height) + "px", - "lineHeight" : (this._data.core.li_height) + "px", - "width" : "150px" // will be set a bit further down - }, - "blur" : $.proxy(function (e) { - e.stopImmediatePropagation(); - e.preventDefault(); - var i = s.children(".jstree-rename-input"), - v = i.val(), - f = this.settings.core.force_text, - nv; - if(v === "") { v = t; } - h1.remove(); - s.replaceWith(a); - s.remove(); - t = f ? t : $('
').append($.parseHTML(t)).html(); - this.set_text(obj, t); - nv = !!this.rename_node(obj, f ? $('
').text(v).text() : $('
').append($.parseHTML(v)).html()); - if(!nv) { - this.set_text(obj, t); // move this up? and fix #483 - } - this._data.core.focused = tmp.id; - setTimeout($.proxy(function () { - var node = this.get_node(tmp.id, true); - if(node.length) { - this._data.core.focused = tmp.id; - node.children('.jstree-anchor').focus(); - } - }, this), 0); - if(callback) { - callback.call(this, tmp, nv, cancel); - } - }, this), - "keydown" : function (e) { - var key = e.which; - if(key === 27) { - cancel = true; - this.value = t; - } - if(key === 27 || key === 13 || key === 37 || key === 38 || key === 39 || key === 40 || key === 32) { - e.stopImmediatePropagation(); - } - if(key === 27 || key === 13) { - e.preventDefault(); - this.blur(); - } - }, - "click" : function (e) { e.stopImmediatePropagation(); }, - "mousedown" : function (e) { e.stopImmediatePropagation(); }, - "keyup" : function (e) { - h2.width(Math.min(h1.text("pW" + this.value).width(),w)); - }, - "keypress" : function(e) { - if(e.which === 13) { return false; } - } - }); - fn = { - fontFamily : a.css('fontFamily') || '', - fontSize : a.css('fontSize') || '', - fontWeight : a.css('fontWeight') || '', - fontStyle : a.css('fontStyle') || '', - fontStretch : a.css('fontStretch') || '', - fontVariant : a.css('fontVariant') || '', - letterSpacing : a.css('letterSpacing') || '', - wordSpacing : a.css('wordSpacing') || '' - }; - s.attr('class', a.attr('class')).append(a.contents().clone()).append(h2); - a.replaceWith(s); - h1.css(fn); - h2.css(fn).width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select(); - }, - - - /** - * changes the theme - * @name set_theme(theme_name [, theme_url]) - * @param {String} theme_name the name of the new theme to apply - * @param {mixed} theme_url the location of the CSS file for this theme. Omit or set to `false` if you manually included the file. Set to `true` to autoload from the `core.themes.dir` directory. - * @trigger set_theme.jstree - */ - set_theme : function (theme_name, theme_url) { - if(!theme_name) { return false; } - if(theme_url === true) { - var dir = this.settings.core.themes.dir; - if(!dir) { dir = $.jstree.path + '/themes'; } - theme_url = dir + '/' + theme_name + '/style.css'; - } - if(theme_url && $.inArray(theme_url, themes_loaded) === -1) { - $('head').append('<'+'link rel="stylesheet" href="' + theme_url + '" type="text/css" />'); - themes_loaded.push(theme_url); - } - if(this._data.core.themes.name) { - this.element.removeClass('jstree-' + this._data.core.themes.name); - } - this._data.core.themes.name = theme_name; - this.element.addClass('jstree-' + theme_name); - this.element[this.settings.core.themes.responsive ? 'addClass' : 'removeClass' ]('jstree-' + theme_name + '-responsive'); - /** - * triggered when a theme is set - * @event - * @name set_theme.jstree - * @param {String} theme the new theme - */ - this.trigger('set_theme', { 'theme' : theme_name }); - }, - /** - * gets the name of the currently applied theme name - * @name get_theme() - * @return {String} - */ - get_theme : function () { return this._data.core.themes.name; }, - /** - * changes the theme variant (if the theme has variants) - * @name set_theme_variant(variant_name) - * @param {String|Boolean} variant_name the variant to apply (if `false` is used the current variant is removed) - */ - set_theme_variant : function (variant_name) { - if(this._data.core.themes.variant) { - this.element.removeClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.variant); - } - this._data.core.themes.variant = variant_name; - if(variant_name) { - this.element.addClass('jstree-' + this._data.core.themes.name + '-' + this._data.core.themes.variant); - } - }, - /** - * gets the name of the currently applied theme variant - * @name get_theme() - * @return {String} - */ - get_theme_variant : function () { return this._data.core.themes.variant; }, - /** - * shows a striped background on the container (if the theme supports it) - * @name show_stripes() - */ - show_stripes : function () { this._data.core.themes.stripes = true; this.get_container_ul().addClass("jstree-striped"); }, - /** - * hides the striped background on the container - * @name hide_stripes() - */ - hide_stripes : function () { this._data.core.themes.stripes = false; this.get_container_ul().removeClass("jstree-striped"); }, - /** - * toggles the striped background on the container - * @name toggle_stripes() - */ - toggle_stripes : function () { if(this._data.core.themes.stripes) { this.hide_stripes(); } else { this.show_stripes(); } }, - /** - * shows the connecting dots (if the theme supports it) - * @name show_dots() - */ - show_dots : function () { this._data.core.themes.dots = true; this.get_container_ul().removeClass("jstree-no-dots"); }, - /** - * hides the connecting dots - * @name hide_dots() - */ - hide_dots : function () { this._data.core.themes.dots = false; this.get_container_ul().addClass("jstree-no-dots"); }, - /** - * toggles the connecting dots - * @name toggle_dots() - */ - toggle_dots : function () { if(this._data.core.themes.dots) { this.hide_dots(); } else { this.show_dots(); } }, - /** - * show the node icons - * @name show_icons() - */ - show_icons : function () { this._data.core.themes.icons = true; this.get_container_ul().removeClass("jstree-no-icons"); }, - /** - * hide the node icons - * @name hide_icons() - */ - hide_icons : function () { this._data.core.themes.icons = false; this.get_container_ul().addClass("jstree-no-icons"); }, - /** - * toggle the node icons - * @name toggle_icons() - */ - toggle_icons : function () { if(this._data.core.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }, - /** - * set the node icon for a node - * @name set_icon(obj, icon) - * @param {mixed} obj - * @param {String} icon the new icon - can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class - */ - set_icon : function (obj, icon) { - var t1, t2, dom, old; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.set_icon(obj[t1], icon); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - old = obj.icon; - obj.icon = icon === true || icon === null || icon === undefined || icon === '' ? true : icon; - dom = this.get_node(obj, true).children(".jstree-anchor").children(".jstree-themeicon"); - if(icon === false) { - this.hide_icon(obj); - } - else if(icon === true || icon === null || icon === undefined || icon === '') { - dom.removeClass('jstree-themeicon-custom ' + old).css("background","").removeAttr("rel"); - if(old === false) { this.show_icon(obj); } - } - else if(icon.indexOf("/") === -1 && icon.indexOf(".") === -1) { - dom.removeClass(old).css("background",""); - dom.addClass(icon + ' jstree-themeicon-custom').attr("rel",icon); - if(old === false) { this.show_icon(obj); } - } - else { - dom.removeClass(old).css("background",""); - dom.addClass('jstree-themeicon-custom').css("background", "url('" + icon + "') center center no-repeat").attr("rel",icon); - if(old === false) { this.show_icon(obj); } - } - return true; - }, - /** - * get the node icon for a node - * @name get_icon(obj) - * @param {mixed} obj - * @return {String} - */ - get_icon : function (obj) { - obj = this.get_node(obj); - return (!obj || obj.id === $.jstree.root) ? false : obj.icon; - }, - /** - * hide the icon on an individual node - * @name hide_icon(obj) - * @param {mixed} obj - */ - hide_icon : function (obj) { - var t1, t2; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.hide_icon(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj === $.jstree.root) { return false; } - obj.icon = false; - this.get_node(obj, true).children(".jstree-anchor").children(".jstree-themeicon").addClass('jstree-themeicon-hidden'); - return true; - }, - /** - * show the icon on an individual node - * @name show_icon(obj) - * @param {mixed} obj - */ - show_icon : function (obj) { - var t1, t2, dom; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.show_icon(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj === $.jstree.root) { return false; } - dom = this.get_node(obj, true); - obj.icon = dom.length ? dom.children(".jstree-anchor").children(".jstree-themeicon").attr('rel') : true; - if(!obj.icon) { obj.icon = true; } - dom.children(".jstree-anchor").children(".jstree-themeicon").removeClass('jstree-themeicon-hidden'); - return true; - } - }; - - // helpers - $.vakata = {}; - // collect attributes - $.vakata.attributes = function(node, with_values) { - node = $(node)[0]; - var attr = with_values ? {} : []; - if(node && node.attributes) { - $.each(node.attributes, function (i, v) { - if($.inArray(v.name.toLowerCase(),['style','contenteditable','hasfocus','tabindex']) !== -1) { return; } - if(v.value !== null && $.trim(v.value) !== '') { - if(with_values) { attr[v.name] = v.value; } - else { attr.push(v.name); } - } - }); - } - return attr; - }; - $.vakata.array_unique = function(array) { - var a = [], i, j, l, o = {}; - for(i = 0, l = array.length; i < l; i++) { - if(o[array[i]] === undefined) { - a.push(array[i]); - o[array[i]] = true; - } - } - return a; - }; - // remove item from array - $.vakata.array_remove = function(array, from, to) { - var rest = array.slice((to || from) + 1 || array.length); - array.length = from < 0 ? array.length + from : from; - array.push.apply(array, rest); - return array; - }; - // remove item from array - $.vakata.array_remove_item = function(array, item) { - var tmp = $.inArray(item, array); - return tmp !== -1 ? $.vakata.array_remove(array, tmp) : array; - }; - - -/** - * ### Changed plugin - * - * This plugin adds more information to the `changed.jstree` event. The new data is contained in the `changed` event data property, and contains a lists of `selected` and `deselected` nodes. - */ - - $.jstree.plugins.changed = function (options, parent) { - var last = []; - this.trigger = function (ev, data) { - var i, j; - if(!data) { - data = {}; - } - if(ev.replace('.jstree','') === 'changed') { - data.changed = { selected : [], deselected : [] }; - var tmp = {}; - for(i = 0, j = last.length; i < j; i++) { - tmp[last[i]] = 1; - } - for(i = 0, j = data.selected.length; i < j; i++) { - if(!tmp[data.selected[i]]) { - data.changed.selected.push(data.selected[i]); - } - else { - tmp[data.selected[i]] = 2; - } - } - for(i = 0, j = last.length; i < j; i++) { - if(tmp[last[i]] === 1) { - data.changed.deselected.push(last[i]); - } - } - last = data.selected.slice(); - } - /** - * triggered when selection changes (the "changed" plugin enhances the original event with more data) - * @event - * @name changed.jstree - * @param {Object} node - * @param {Object} action the action that caused the selection to change - * @param {Array} selected the current selection - * @param {Object} changed an object containing two properties `selected` and `deselected` - both arrays of node IDs, which were selected or deselected since the last changed event - * @param {Object} event the event (if any) that triggered this changed event - * @plugin changed - */ - parent.trigger.call(this, ev, data); - }; - this.refresh = function (skip_loading, forget_state) { - last = []; - return parent.refresh.apply(this, arguments); - }; - }; - -/** - * ### Checkbox plugin - * - * This plugin renders checkbox icons in front of each node, making multiple selection much easier. - * It also supports tri-state behavior, meaning that if a node has a few of its children checked it will be rendered as undetermined, and state will be propagated up. - */ - - var _i = document.createElement('I'); - _i.className = 'jstree-icon jstree-checkbox'; - _i.setAttribute('role', 'presentation'); - /** - * stores all defaults for the checkbox plugin - * @name $.jstree.defaults.checkbox - * @plugin checkbox - */ - $.jstree.defaults.checkbox = { - /** - * a boolean indicating if checkboxes should be visible (can be changed at a later time using `show_checkboxes()` and `hide_checkboxes`). Defaults to `true`. - * @name $.jstree.defaults.checkbox.visible - * @plugin checkbox - */ - visible : true, - /** - * a boolean indicating if checkboxes should cascade down and have an undetermined state. Defaults to `true`. - * @name $.jstree.defaults.checkbox.three_state - * @plugin checkbox - */ - three_state : true, - /** - * a boolean indicating if clicking anywhere on the node should act as clicking on the checkbox. Defaults to `true`. - * @name $.jstree.defaults.checkbox.whole_node - * @plugin checkbox - */ - whole_node : true, - /** - * a boolean indicating if the selected style of a node should be kept, or removed. Defaults to `true`. - * @name $.jstree.defaults.checkbox.keep_selected_style - * @plugin checkbox - */ - keep_selected_style : true, - /** - * This setting controls how cascading and undetermined nodes are applied. - * If 'up' is in the string - cascading up is enabled, if 'down' is in the string - cascading down is enabled, if 'undetermined' is in the string - undetermined nodes will be used. - * If `three_state` is set to `true` this setting is automatically set to 'up+down+undetermined'. Defaults to ''. - * @name $.jstree.defaults.checkbox.cascade - * @plugin checkbox - */ - cascade : '', - /** - * This setting controls if checkbox are bound to the general tree selection or to an internal array maintained by the checkbox plugin. Defaults to `true`, only set to `false` if you know exactly what you are doing. - * @name $.jstree.defaults.checkbox.tie_selection - * @plugin checkbox - */ - tie_selection : true - }; - $.jstree.plugins.checkbox = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - this._data.checkbox.uto = false; - this._data.checkbox.selected = []; - if(this.settings.checkbox.three_state) { - this.settings.checkbox.cascade = 'up+down+undetermined'; - } - this.element - .on("init.jstree", $.proxy(function () { - this._data.checkbox.visible = this.settings.checkbox.visible; - if(!this.settings.checkbox.keep_selected_style) { - this.element.addClass('jstree-checkbox-no-clicked'); - } - if(this.settings.checkbox.tie_selection) { - this.element.addClass('jstree-checkbox-selection'); - } - }, this)) - .on("loading.jstree", $.proxy(function () { - this[ this._data.checkbox.visible ? 'show_checkboxes' : 'hide_checkboxes' ](); - }, this)); - if(this.settings.checkbox.cascade.indexOf('undetermined') !== -1) { - this.element - .on('changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree', $.proxy(function () { - // only if undetermined is in setting - if(this._data.checkbox.uto) { clearTimeout(this._data.checkbox.uto); } - this._data.checkbox.uto = setTimeout($.proxy(this._undetermined, this), 50); - }, this)); - } - if(!this.settings.checkbox.tie_selection) { - this.element - .on('model.jstree', $.proxy(function (e, data) { - var m = this._model.data, - p = m[data.parent], - dpc = data.nodes, - i, j; - for(i = 0, j = dpc.length; i < j; i++) { - m[dpc[i]].state.checked = m[dpc[i]].state.checked || (m[dpc[i]].original && m[dpc[i]].original.state && m[dpc[i]].original.state.checked); - if(m[dpc[i]].state.checked) { - this._data.checkbox.selected.push(dpc[i]); - } - } - }, this)); - } - if(this.settings.checkbox.cascade.indexOf('up') !== -1 || this.settings.checkbox.cascade.indexOf('down') !== -1) { - this.element - .on('model.jstree', $.proxy(function (e, data) { - var m = this._model.data, - p = m[data.parent], - dpc = data.nodes, - chd = [], - c, i, j, k, l, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection; - - if(s.indexOf('down') !== -1) { - // apply down - if(p.state[ t ? 'selected' : 'checked' ]) { - for(i = 0, j = dpc.length; i < j; i++) { - m[dpc[i]].state[ t ? 'selected' : 'checked' ] = true; - } - this._data[ t ? 'core' : 'checkbox' ].selected = this._data[ t ? 'core' : 'checkbox' ].selected.concat(dpc); - } - else { - for(i = 0, j = dpc.length; i < j; i++) { - if(m[dpc[i]].state[ t ? 'selected' : 'checked' ]) { - for(k = 0, l = m[dpc[i]].children_d.length; k < l; k++) { - m[m[dpc[i]].children_d[k]].state[ t ? 'selected' : 'checked' ] = true; - } - this._data[ t ? 'core' : 'checkbox' ].selected = this._data[ t ? 'core' : 'checkbox' ].selected.concat(m[dpc[i]].children_d); - } - } - } - } - - if(s.indexOf('up') !== -1) { - // apply up - for(i = 0, j = p.children_d.length; i < j; i++) { - if(!m[p.children_d[i]].children.length) { - chd.push(m[p.children_d[i]].parent); - } - } - chd = $.vakata.array_unique(chd); - for(k = 0, l = chd.length; k < l; k++) { - p = m[chd[k]]; - while(p && p.id !== $.jstree.root) { - c = 0; - for(i = 0, j = p.children.length; i < j; i++) { - c += m[p.children[i]].state[ t ? 'selected' : 'checked' ]; - } - if(c === j) { - p.state[ t ? 'selected' : 'checked' ] = true; - this._data[ t ? 'core' : 'checkbox' ].selected.push(p.id); - tmp = this.get_node(p, true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', true).children('.jstree-anchor').addClass( t ? 'jstree-clicked' : 'jstree-checked'); - } - } - else { - break; - } - p = this.get_node(p.parent); - } - } - } - - this._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_unique(this._data[ t ? 'core' : 'checkbox' ].selected); - }, this)) - .on(this.settings.checkbox.tie_selection ? 'select_node.jstree' : 'check_node.jstree', $.proxy(function (e, data) { - var obj = data.node, - m = this._model.data, - par = this.get_node(obj.parent), - dom = this.get_node(obj, true), - i, j, c, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection; - - // apply down - if(s.indexOf('down') !== -1) { - this._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_unique(this._data[ t ? 'core' : 'checkbox' ].selected.concat(obj.children_d)); - for(i = 0, j = obj.children_d.length; i < j; i++) { - tmp = m[obj.children_d[i]]; - tmp.state[ t ? 'selected' : 'checked' ] = true; - if(tmp && tmp.original && tmp.original.state && tmp.original.state.undetermined) { - tmp.original.state.undetermined = false; - } - } - } - - // apply up - if(s.indexOf('up') !== -1) { - while(par && par.id !== $.jstree.root) { - c = 0; - for(i = 0, j = par.children.length; i < j; i++) { - c += m[par.children[i]].state[ t ? 'selected' : 'checked' ]; - } - if(c === j) { - par.state[ t ? 'selected' : 'checked' ] = true; - this._data[ t ? 'core' : 'checkbox' ].selected.push(par.id); - tmp = this.get_node(par, true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked'); - } - } - else { - break; - } - par = this.get_node(par.parent); - } - } - - // apply down (process .children separately?) - if(s.indexOf('down') !== -1 && dom.length) { - dom.find('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked').parent().attr('aria-selected', true); - } - }, this)) - .on(this.settings.checkbox.tie_selection ? 'deselect_all.jstree' : 'uncheck_all.jstree', $.proxy(function (e, data) { - var obj = this.get_node($.jstree.root), - m = this._model.data, - i, j, tmp; - for(i = 0, j = obj.children_d.length; i < j; i++) { - tmp = m[obj.children_d[i]]; - if(tmp && tmp.original && tmp.original.state && tmp.original.state.undetermined) { - tmp.original.state.undetermined = false; - } - } - }, this)) - .on(this.settings.checkbox.tie_selection ? 'deselect_node.jstree' : 'uncheck_node.jstree', $.proxy(function (e, data) { - var obj = data.node, - dom = this.get_node(obj, true), - i, j, tmp, s = this.settings.checkbox.cascade, t = this.settings.checkbox.tie_selection; - if(obj && obj.original && obj.original.state && obj.original.state.undetermined) { - obj.original.state.undetermined = false; - } - - // apply down - if(s.indexOf('down') !== -1) { - for(i = 0, j = obj.children_d.length; i < j; i++) { - tmp = this._model.data[obj.children_d[i]]; - tmp.state[ t ? 'selected' : 'checked' ] = false; - if(tmp && tmp.original && tmp.original.state && tmp.original.state.undetermined) { - tmp.original.state.undetermined = false; - } - } - } - - // apply up - if(s.indexOf('up') !== -1) { - for(i = 0, j = obj.parents.length; i < j; i++) { - tmp = this._model.data[obj.parents[i]]; - tmp.state[ t ? 'selected' : 'checked' ] = false; - if(tmp && tmp.original && tmp.original.state && tmp.original.state.undetermined) { - tmp.original.state.undetermined = false; - } - tmp = this.get_node(obj.parents[i], true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked'); - } - } - } - tmp = []; - for(i = 0, j = this._data[ t ? 'core' : 'checkbox' ].selected.length; i < j; i++) { - // apply down + apply up - if( - (s.indexOf('down') === -1 || $.inArray(this._data[ t ? 'core' : 'checkbox' ].selected[i], obj.children_d) === -1) && - (s.indexOf('up') === -1 || $.inArray(this._data[ t ? 'core' : 'checkbox' ].selected[i], obj.parents) === -1) - ) { - tmp.push(this._data[ t ? 'core' : 'checkbox' ].selected[i]); - } - } - this._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_unique(tmp); - - // apply down (process .children separately?) - if(s.indexOf('down') !== -1 && dom.length) { - dom.find('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked').parent().attr('aria-selected', false); - } - }, this)); - } - if(this.settings.checkbox.cascade.indexOf('up') !== -1) { - this.element - .on('delete_node.jstree', $.proxy(function (e, data) { - // apply up (whole handler) - var p = this.get_node(data.parent), - m = this._model.data, - i, j, c, tmp, t = this.settings.checkbox.tie_selection; - while(p && p.id !== $.jstree.root && !p.state[ t ? 'selected' : 'checked' ]) { - c = 0; - for(i = 0, j = p.children.length; i < j; i++) { - c += m[p.children[i]].state[ t ? 'selected' : 'checked' ]; - } - if(j > 0 && c === j) { - p.state[ t ? 'selected' : 'checked' ] = true; - this._data[ t ? 'core' : 'checkbox' ].selected.push(p.id); - tmp = this.get_node(p, true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked'); - } - } - else { - break; - } - p = this.get_node(p.parent); - } - }, this)) - .on('move_node.jstree', $.proxy(function (e, data) { - // apply up (whole handler) - var is_multi = data.is_multi, - old_par = data.old_parent, - new_par = this.get_node(data.parent), - m = this._model.data, - p, c, i, j, tmp, t = this.settings.checkbox.tie_selection; - if(!is_multi) { - p = this.get_node(old_par); - while(p && p.id !== $.jstree.root && !p.state[ t ? 'selected' : 'checked' ]) { - c = 0; - for(i = 0, j = p.children.length; i < j; i++) { - c += m[p.children[i]].state[ t ? 'selected' : 'checked' ]; - } - if(j > 0 && c === j) { - p.state[ t ? 'selected' : 'checked' ] = true; - this._data[ t ? 'core' : 'checkbox' ].selected.push(p.id); - tmp = this.get_node(p, true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked'); - } - } - else { - break; - } - p = this.get_node(p.parent); - } - } - p = new_par; - while(p && p.id !== $.jstree.root) { - c = 0; - for(i = 0, j = p.children.length; i < j; i++) { - c += m[p.children[i]].state[ t ? 'selected' : 'checked' ]; - } - if(c === j) { - if(!p.state[ t ? 'selected' : 'checked' ]) { - p.state[ t ? 'selected' : 'checked' ] = true; - this._data[ t ? 'core' : 'checkbox' ].selected.push(p.id); - tmp = this.get_node(p, true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', true).children('.jstree-anchor').addClass(t ? 'jstree-clicked' : 'jstree-checked'); - } - } - } - else { - if(p.state[ t ? 'selected' : 'checked' ]) { - p.state[ t ? 'selected' : 'checked' ] = false; - this._data[ t ? 'core' : 'checkbox' ].selected = $.vakata.array_remove_item(this._data[ t ? 'core' : 'checkbox' ].selected, p.id); - tmp = this.get_node(p, true); - if(tmp && tmp.length) { - tmp.attr('aria-selected', false).children('.jstree-anchor').removeClass(t ? 'jstree-clicked' : 'jstree-checked'); - } - } - else { - break; - } - } - p = this.get_node(p.parent); - } - }, this)); - } - }; - /** - * set the undetermined state where and if necessary. Used internally. - * @private - * @name _undetermined() - * @plugin checkbox - */ - this._undetermined = function () { - if(this.element === null) { return; } - var i, j, k, l, o = {}, m = this._model.data, t = this.settings.checkbox.tie_selection, s = this._data[ t ? 'core' : 'checkbox' ].selected, p = [], tt = this; - for(i = 0, j = s.length; i < j; i++) { - if(m[s[i]] && m[s[i]].parents) { - for(k = 0, l = m[s[i]].parents.length; k < l; k++) { - if(o[m[s[i]].parents[k]] === undefined && m[s[i]].parents[k] !== $.jstree.root) { - o[m[s[i]].parents[k]] = true; - p.push(m[s[i]].parents[k]); - } - } - } - } - // attempt for server side undetermined state - this.element.find('.jstree-closed').not(':has(.jstree-children)') - .each(function () { - var tmp = tt.get_node(this), tmp2; - if(!tmp.state.loaded) { - if(tmp.original && tmp.original.state && tmp.original.state.undetermined && tmp.original.state.undetermined === true) { - if(o[tmp.id] === undefined && tmp.id !== $.jstree.root) { - o[tmp.id] = true; - p.push(tmp.id); - } - for(k = 0, l = tmp.parents.length; k < l; k++) { - if(o[tmp.parents[k]] === undefined && tmp.parents[k] !== $.jstree.root) { - o[tmp.parents[k]] = true; - p.push(tmp.parents[k]); - } - } - } - } - else { - for(i = 0, j = tmp.children_d.length; i < j; i++) { - tmp2 = m[tmp.children_d[i]]; - if(!tmp2.state.loaded && tmp2.original && tmp2.original.state && tmp2.original.state.undetermined && tmp2.original.state.undetermined === true) { - if(o[tmp2.id] === undefined && tmp2.id !== $.jstree.root) { - o[tmp2.id] = true; - p.push(tmp2.id); - } - for(k = 0, l = tmp2.parents.length; k < l; k++) { - if(o[tmp2.parents[k]] === undefined && tmp2.parents[k] !== $.jstree.root) { - o[tmp2.parents[k]] = true; - p.push(tmp2.parents[k]); - } - } - } - } - } - }); - - this.element.find('.jstree-undetermined').removeClass('jstree-undetermined'); - for(i = 0, j = p.length; i < j; i++) { - if(!m[p[i]].state[ t ? 'selected' : 'checked' ]) { - s = this.get_node(p[i], true); - if(s && s.length) { - s.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-undetermined'); - } - } - } - }; - this.redraw_node = function(obj, deep, is_callback, force_render) { - obj = parent.redraw_node.apply(this, arguments); - if(obj) { - var i, j, tmp = null, icon = null; - for(i = 0, j = obj.childNodes.length; i < j; i++) { - if(obj.childNodes[i] && obj.childNodes[i].className && obj.childNodes[i].className.indexOf("jstree-anchor") !== -1) { - tmp = obj.childNodes[i]; - break; - } - } - if(tmp) { - if(!this.settings.checkbox.tie_selection && this._model.data[obj.id].state.checked) { tmp.className += ' jstree-checked'; } - icon = _i.cloneNode(false); - if(this._model.data[obj.id].state.checkbox_disabled) { icon.className += ' jstree-checkbox-disabled'; } - tmp.insertBefore(icon, tmp.childNodes[0]); - } - } - if(!is_callback && this.settings.checkbox.cascade.indexOf('undetermined') !== -1) { - if(this._data.checkbox.uto) { clearTimeout(this._data.checkbox.uto); } - this._data.checkbox.uto = setTimeout($.proxy(this._undetermined, this), 50); - } - return obj; - }; - /** - * show the node checkbox icons - * @name show_checkboxes() - * @plugin checkbox - */ - this.show_checkboxes = function () { this._data.core.themes.checkboxes = true; this.get_container_ul().removeClass("jstree-no-checkboxes"); }; - /** - * hide the node checkbox icons - * @name hide_checkboxes() - * @plugin checkbox - */ - this.hide_checkboxes = function () { this._data.core.themes.checkboxes = false; this.get_container_ul().addClass("jstree-no-checkboxes"); }; - /** - * toggle the node icons - * @name toggle_checkboxes() - * @plugin checkbox - */ - this.toggle_checkboxes = function () { if(this._data.core.themes.checkboxes) { this.hide_checkboxes(); } else { this.show_checkboxes(); } }; - /** - * checks if a node is in an undetermined state - * @name is_undetermined(obj) - * @param {mixed} obj - * @return {Boolean} - */ - this.is_undetermined = function (obj) { - obj = this.get_node(obj); - var s = this.settings.checkbox.cascade, i, j, t = this.settings.checkbox.tie_selection, d = this._data[ t ? 'core' : 'checkbox' ].selected, m = this._model.data; - if(!obj || obj.state[ t ? 'selected' : 'checked' ] === true || s.indexOf('undetermined') === -1 || (s.indexOf('down') === -1 && s.indexOf('up') === -1)) { - return false; - } - if(!obj.state.loaded && obj.original.state.undetermined === true) { - return true; - } - for(i = 0, j = obj.children_d.length; i < j; i++) { - if($.inArray(obj.children_d[i], d) !== -1 || (!m[obj.children_d[i]].state.loaded && m[obj.children_d[i]].original.state.undetermined)) { - return true; - } - } - return false; - }; - /** - * disable a node's checkbox - * @name disable_checkbox(obj) - * @param {mixed} obj an array can be used too - * @trigger disable_checkbox.jstree - * @plugin checkbox - */ - this.disable_checkbox = function (obj) { - var t1, t2, dom; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.disable_checkbox(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - dom = this.get_node(obj, true); - if(!obj.state.checkbox_disabled) { - obj.state.checkbox_disabled = true; - if(dom && dom.length) { - dom.children('.jstree-anchor').children('.jstree-checkbox').addClass('jstree-checkbox-disabled'); - } - /** - * triggered when an node's checkbox is disabled - * @event - * @name disable_checkbox.jstree - * @param {Object} node - * @plugin checkbox - */ - this.trigger('disable_checkbox', { 'node' : obj }); - } - }; - /** - * enable a node's checkbox - * @name disable_checkbox(obj) - * @param {mixed} obj an array can be used too - * @trigger enable_checkbox.jstree - * @plugin checkbox - */ - this.enable_checkbox = function (obj) { - var t1, t2, dom; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.enable_checkbox(obj[t1]); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - dom = this.get_node(obj, true); - if(obj.state.checkbox_disabled) { - obj.state.checkbox_disabled = false; - if(dom && dom.length) { - dom.children('.jstree-anchor').children('.jstree-checkbox').removeClass('jstree-checkbox-disabled'); - } - /** - * triggered when an node's checkbox is enabled - * @event - * @name enable_checkbox.jstree - * @param {Object} node - * @plugin checkbox - */ - this.trigger('enable_checkbox', { 'node' : obj }); - } - }; - - this.activate_node = function (obj, e) { - if($(e.target).hasClass('jstree-checkbox-disabled')) { - return false; - } - if(this.settings.checkbox.tie_selection && (this.settings.checkbox.whole_node || $(e.target).hasClass('jstree-checkbox'))) { - e.ctrlKey = true; - } - if(this.settings.checkbox.tie_selection || (!this.settings.checkbox.whole_node && !$(e.target).hasClass('jstree-checkbox'))) { - return parent.activate_node.call(this, obj, e); - } - if(this.is_disabled(obj)) { - return false; - } - if(this.is_checked(obj)) { - this.uncheck_node(obj, e); - } - else { - this.check_node(obj, e); - } - this.trigger('activate_node', { 'node' : this.get_node(obj) }); - }; - - /** - * check a node (only if tie_selection in checkbox settings is false, otherwise select_node will be called internally) - * @name check_node(obj) - * @param {mixed} obj an array can be used to check multiple nodes - * @trigger check_node.jstree - * @plugin checkbox - */ - this.check_node = function (obj, e) { - if(this.settings.checkbox.tie_selection) { return this.select_node(obj, false, true, e); } - var dom, t1, t2, th; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.check_node(obj[t1], e); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - dom = this.get_node(obj, true); - if(!obj.state.checked) { - obj.state.checked = true; - this._data.checkbox.selected.push(obj.id); - if(dom && dom.length) { - dom.children('.jstree-anchor').addClass('jstree-checked'); - } - /** - * triggered when an node is checked (only if tie_selection in checkbox settings is false) - * @event - * @name check_node.jstree - * @param {Object} node - * @param {Array} selected the current selection - * @param {Object} event the event (if any) that triggered this check_node - * @plugin checkbox - */ - this.trigger('check_node', { 'node' : obj, 'selected' : this._data.checkbox.selected, 'event' : e }); - } - }; - /** - * uncheck a node (only if tie_selection in checkbox settings is false, otherwise deselect_node will be called internally) - * @name uncheck_node(obj) - * @param {mixed} obj an array can be used to uncheck multiple nodes - * @trigger uncheck_node.jstree - * @plugin checkbox - */ - this.uncheck_node = function (obj, e) { - if(this.settings.checkbox.tie_selection) { return this.deselect_node(obj, false, e); } - var t1, t2, dom; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.uncheck_node(obj[t1], e); - } - return true; - } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { - return false; - } - dom = this.get_node(obj, true); - if(obj.state.checked) { - obj.state.checked = false; - this._data.checkbox.selected = $.vakata.array_remove_item(this._data.checkbox.selected, obj.id); - if(dom.length) { - dom.children('.jstree-anchor').removeClass('jstree-checked'); - } - /** - * triggered when an node is unchecked (only if tie_selection in checkbox settings is false) - * @event - * @name uncheck_node.jstree - * @param {Object} node - * @param {Array} selected the current selection - * @param {Object} event the event (if any) that triggered this uncheck_node - * @plugin checkbox - */ - this.trigger('uncheck_node', { 'node' : obj, 'selected' : this._data.checkbox.selected, 'event' : e }); - } - }; - /** - * checks all nodes in the tree (only if tie_selection in checkbox settings is false, otherwise select_all will be called internally) - * @name check_all() - * @trigger check_all.jstree, changed.jstree - * @plugin checkbox - */ - this.check_all = function () { - if(this.settings.checkbox.tie_selection) { return this.select_all(); } - var tmp = this._data.checkbox.selected.concat([]), i, j; - this._data.checkbox.selected = this._model.data[$.jstree.root].children_d.concat(); - for(i = 0, j = this._data.checkbox.selected.length; i < j; i++) { - if(this._model.data[this._data.checkbox.selected[i]]) { - this._model.data[this._data.checkbox.selected[i]].state.checked = true; - } - } - this.redraw(true); - /** - * triggered when all nodes are checked (only if tie_selection in checkbox settings is false) - * @event - * @name check_all.jstree - * @param {Array} selected the current selection - * @plugin checkbox - */ - this.trigger('check_all', { 'selected' : this._data.checkbox.selected }); - }; - /** - * uncheck all checked nodes (only if tie_selection in checkbox settings is false, otherwise deselect_all will be called internally) - * @name uncheck_all() - * @trigger uncheck_all.jstree - * @plugin checkbox - */ - this.uncheck_all = function () { - if(this.settings.checkbox.tie_selection) { return this.deselect_all(); } - var tmp = this._data.checkbox.selected.concat([]), i, j; - for(i = 0, j = this._data.checkbox.selected.length; i < j; i++) { - if(this._model.data[this._data.checkbox.selected[i]]) { - this._model.data[this._data.checkbox.selected[i]].state.checked = false; - } - } - this._data.checkbox.selected = []; - this.element.find('.jstree-checked').removeClass('jstree-checked'); - /** - * triggered when all nodes are unchecked (only if tie_selection in checkbox settings is false) - * @event - * @name uncheck_all.jstree - * @param {Object} node the previous selection - * @param {Array} selected the current selection - * @plugin checkbox - */ - this.trigger('uncheck_all', { 'selected' : this._data.checkbox.selected, 'node' : tmp }); - }; - /** - * checks if a node is checked (if tie_selection is on in the settings this function will return the same as is_selected) - * @name is_checked(obj) - * @param {mixed} obj - * @return {Boolean} - * @plugin checkbox - */ - this.is_checked = function (obj) { - if(this.settings.checkbox.tie_selection) { return this.is_selected(obj); } - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - return obj.state.checked; - }; - /** - * get an array of all checked nodes (if tie_selection is on in the settings this function will return the same as get_selected) - * @name get_checked([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} - * @plugin checkbox - */ - this.get_checked = function (full) { - if(this.settings.checkbox.tie_selection) { return this.get_selected(full); } - return full ? $.map(this._data.checkbox.selected, $.proxy(function (i) { return this.get_node(i); }, this)) : this._data.checkbox.selected; - }; - /** - * get an array of all top level checked nodes (ignoring children of checked nodes) (if tie_selection is on in the settings this function will return the same as get_top_selected) - * @name get_top_checked([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} - * @plugin checkbox - */ - this.get_top_checked = function (full) { - if(this.settings.checkbox.tie_selection) { return this.get_top_selected(full); } - var tmp = this.get_checked(true), - obj = {}, i, j, k, l; - for(i = 0, j = tmp.length; i < j; i++) { - obj[tmp[i].id] = tmp[i]; - } - for(i = 0, j = tmp.length; i < j; i++) { - for(k = 0, l = tmp[i].children_d.length; k < l; k++) { - if(obj[tmp[i].children_d[k]]) { - delete obj[tmp[i].children_d[k]]; - } - } - } - tmp = []; - for(i in obj) { - if(obj.hasOwnProperty(i)) { - tmp.push(i); - } - } - return full ? $.map(tmp, $.proxy(function (i) { return this.get_node(i); }, this)) : tmp; - }; - /** - * get an array of all bottom level checked nodes (ignoring selected parents) (if tie_selection is on in the settings this function will return the same as get_bottom_selected) - * @name get_bottom_checked([full]) - * @param {mixed} full if set to `true` the returned array will consist of the full node objects, otherwise - only IDs will be returned - * @return {Array} - * @plugin checkbox - */ - this.get_bottom_checked = function (full) { - if(this.settings.checkbox.tie_selection) { return this.get_bottom_selected(full); } - var tmp = this.get_checked(true), - obj = [], i, j; - for(i = 0, j = tmp.length; i < j; i++) { - if(!tmp[i].children.length) { - obj.push(tmp[i].id); - } - } - return full ? $.map(obj, $.proxy(function (i) { return this.get_node(i); }, this)) : obj; - }; - this.load_node = function (obj, callback) { - var k, l, i, j, c, tmp; - if(!$.isArray(obj) && !this.settings.checkbox.tie_selection) { - tmp = this.get_node(obj); - if(tmp && tmp.state.loaded) { - for(k = 0, l = tmp.children_d.length; k < l; k++) { - if(this._model.data[tmp.children_d[k]].state.checked) { - c = true; - this._data.checkbox.selected = $.vakata.array_remove_item(this._data.checkbox.selected, tmp.children_d[k]); - } - } - } - } - return parent.load_node.apply(this, arguments); - }; - this.get_state = function () { - var state = parent.get_state.apply(this, arguments); - if(this.settings.checkbox.tie_selection) { return state; } - state.checkbox = this._data.checkbox.selected.slice(); - return state; - }; - this.set_state = function (state, callback) { - var res = parent.set_state.apply(this, arguments); - if(res && state.checkbox) { - if(!this.settings.checkbox.tie_selection) { - this.uncheck_all(); - var _this = this; - $.each(state.checkbox, function (i, v) { - _this.check_node(v); - }); - } - delete state.checkbox; - this.set_state(state, callback); - return false; - } - return res; - }; - this.refresh = function (skip_loading, forget_state) { - if(!this.settings.checkbox.tie_selection) { - this._data.checkbox.selected = []; - } - return parent.refresh.apply(this, arguments); - }; - }; - - // include the checkbox plugin by default - // $.jstree.defaults.plugins.push("checkbox"); - -/** - * ### Conditionalselect plugin - * - * This plugin allows defining a callback to allow or deny node selection by user input (activate node method). - */ - - /** - * a callback (function) which is invoked in the instance's scope and receives two arguments - the node and the event that triggered the `activate_node` call. Returning false prevents working with the node, returning true allows invoking activate_node. Defaults to returning `true`. - * @name $.jstree.defaults.checkbox.visible - * @plugin checkbox - */ - $.jstree.defaults.conditionalselect = function () { return true; }; - $.jstree.plugins.conditionalselect = function (options, parent) { - // own function - this.activate_node = function (obj, e) { - if(this.settings.conditionalselect.call(this, this.get_node(obj), e)) { - parent.activate_node.call(this, obj, e); - } - }; - }; - - -/** - * ### Contextmenu plugin - * - * Shows a context menu when a node is right-clicked. - */ - - /** - * stores all defaults for the contextmenu plugin - * @name $.jstree.defaults.contextmenu - * @plugin contextmenu - */ - $.jstree.defaults.contextmenu = { - /** - * a boolean indicating if the node should be selected when the context menu is invoked on it. Defaults to `true`. - * @name $.jstree.defaults.contextmenu.select_node - * @plugin contextmenu - */ - select_node : true, - /** - * a boolean indicating if the menu should be shown aligned with the node. Defaults to `true`, otherwise the mouse coordinates are used. - * @name $.jstree.defaults.contextmenu.show_at_node - * @plugin contextmenu - */ - show_at_node : true, - /** - * an object of actions, or a function that accepts a node and a callback function and calls the callback function with an object of actions available for that node (you can also return the items too). - * - * Each action consists of a key (a unique name) and a value which is an object with the following properties (only label and action are required): - * - * * `separator_before` - a boolean indicating if there should be a separator before this item - * * `separator_after` - a boolean indicating if there should be a separator after this item - * * `_disabled` - a boolean indicating if this action should be disabled - * * `label` - a string - the name of the action (could be a function returning a string) - * * `action` - a function to be executed if this item is chosen - * * `icon` - a string, can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class - * * `shortcut` - keyCode which will trigger the action if the menu is open (for example `113` for rename, which equals F2) - * * `shortcut_label` - shortcut label (like for example `F2` for rename) - * - * @name $.jstree.defaults.contextmenu.items - * @plugin contextmenu - */ - items : function (o, cb) { // Could be an object directly - return { - "create" : { - "separator_before" : false, - "separator_after" : true, - "_disabled" : false, //(this.check("create_node", data.reference, {}, "last")), - "label" : "Create", - "action" : function (data) { - var inst = $.jstree.reference(data.reference), - obj = inst.get_node(data.reference); - inst.create_node(obj, {}, "last", function (new_node) { - setTimeout(function () { inst.edit(new_node); },0); - }); - } - }, - "rename" : { - "separator_before" : false, - "separator_after" : false, - "_disabled" : false, //(this.check("rename_node", data.reference, this.get_parent(data.reference), "")), - "label" : "Rename", - /*! - "shortcut" : 113, - "shortcut_label" : 'F2', - "icon" : "glyphicon glyphicon-leaf", - */ - "action" : function (data) { - var inst = $.jstree.reference(data.reference), - obj = inst.get_node(data.reference); - inst.edit(obj); - } - }, - "remove" : { - "separator_before" : false, - "icon" : false, - "separator_after" : false, - "_disabled" : false, //(this.check("delete_node", data.reference, this.get_parent(data.reference), "")), - "label" : "Delete", - "action" : function (data) { - var inst = $.jstree.reference(data.reference), - obj = inst.get_node(data.reference); - if(inst.is_selected(obj)) { - inst.delete_node(inst.get_selected()); - } - else { - inst.delete_node(obj); - } - } - }, - "ccp" : { - "separator_before" : true, - "icon" : false, - "separator_after" : false, - "label" : "Edit", - "action" : false, - "submenu" : { - "cut" : { - "separator_before" : false, - "separator_after" : false, - "label" : "Cut", - "action" : function (data) { - var inst = $.jstree.reference(data.reference), - obj = inst.get_node(data.reference); - if(inst.is_selected(obj)) { - inst.cut(inst.get_top_selected()); - } - else { - inst.cut(obj); - } - } - }, - "copy" : { - "separator_before" : false, - "icon" : false, - "separator_after" : false, - "label" : "Copy", - "action" : function (data) { - var inst = $.jstree.reference(data.reference), - obj = inst.get_node(data.reference); - if(inst.is_selected(obj)) { - inst.copy(inst.get_top_selected()); - } - else { - inst.copy(obj); - } - } - }, - "paste" : { - "separator_before" : false, - "icon" : false, - "_disabled" : function (data) { - return !$.jstree.reference(data.reference).can_paste(); - }, - "separator_after" : false, - "label" : "Paste", - "action" : function (data) { - var inst = $.jstree.reference(data.reference), - obj = inst.get_node(data.reference); - inst.paste(obj); - } - } - } - } - }; - } - }; - - $.jstree.plugins.contextmenu = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - - var last_ts = 0, cto = null, ex, ey; - this.element - .on("contextmenu.jstree", ".jstree-anchor", $.proxy(function (e, data) { - e.preventDefault(); - last_ts = e.ctrlKey ? +new Date() : 0; - if(data || cto) { - last_ts = (+new Date()) + 10000; - } - if(cto) { - clearTimeout(cto); - } - if(!this.is_loading(e.currentTarget)) { - this.show_contextmenu(e.currentTarget, e.pageX, e.pageY, e); - } - }, this)) - .on("click.jstree", ".jstree-anchor", $.proxy(function (e) { - if(this._data.contextmenu.visible && (!last_ts || (+new Date()) - last_ts > 250)) { // work around safari & macOS ctrl+click - $.vakata.context.hide(); - } - last_ts = 0; - }, this)) - .on("touchstart.jstree", ".jstree-anchor", function (e) { - if(!e.originalEvent || !e.originalEvent.changedTouches || !e.originalEvent.changedTouches[0]) { - return; - } - ex = e.pageX; - ey = e.pageY; - cto = setTimeout(function () { - $(e.currentTarget).trigger('contextmenu', true); - }, 750); - }) - .on('touchmove.vakata.jstree', function (e) { - if(cto && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0] && (Math.abs(ex - e.pageX) > 50 || Math.abs(ey - e.pageY) > 50)) { - clearTimeout(cto); - } - }) - .on('touchend.vakata.jstree', function (e) { - if(cto) { - clearTimeout(cto); - } - }); - - /*! - if(!('oncontextmenu' in document.body) && ('ontouchstart' in document.body)) { - var el = null, tm = null; - this.element - .on("touchstart", ".jstree-anchor", function (e) { - el = e.currentTarget; - tm = +new Date(); - $(document).one("touchend", function (e) { - e.target = document.elementFromPoint(e.originalEvent.targetTouches[0].pageX - window.pageXOffset, e.originalEvent.targetTouches[0].pageY - window.pageYOffset); - e.currentTarget = e.target; - tm = ((+(new Date())) - tm); - if(e.target === el && tm > 600 && tm < 1000) { - e.preventDefault(); - $(el).trigger('contextmenu', e); - } - el = null; - tm = null; - }); - }); - } - */ - $(document).on("context_hide.vakata.jstree", $.proxy(function () { this._data.contextmenu.visible = false; }, this)); - }; - this.teardown = function () { - if(this._data.contextmenu.visible) { - $.vakata.context.hide(); - } - parent.teardown.call(this); - }; - - /** - * prepare and show the context menu for a node - * @name show_contextmenu(obj [, x, y]) - * @param {mixed} obj the node - * @param {Number} x the x-coordinate relative to the document to show the menu at - * @param {Number} y the y-coordinate relative to the document to show the menu at - * @param {Object} e the event if available that triggered the contextmenu - * @plugin contextmenu - * @trigger show_contextmenu.jstree - */ - this.show_contextmenu = function (obj, x, y, e) { - obj = this.get_node(obj); - if(!obj || obj.id === $.jstree.root) { return false; } - var s = this.settings.contextmenu, - d = this.get_node(obj, true), - a = d.children(".jstree-anchor"), - o = false, - i = false; - if(s.show_at_node || x === undefined || y === undefined) { - o = a.offset(); - x = o.left; - y = o.top + this._data.core.li_height; - } - if(this.settings.contextmenu.select_node && !this.is_selected(obj)) { - this.activate_node(obj, e); - } - - i = s.items; - if($.isFunction(i)) { - i = i.call(this, obj, $.proxy(function (i) { - this._show_contextmenu(obj, x, y, i); - }, this)); - } - if($.isPlainObject(i)) { - this._show_contextmenu(obj, x, y, i); - } - }; - /** - * show the prepared context menu for a node - * @name _show_contextmenu(obj, x, y, i) - * @param {mixed} obj the node - * @param {Number} x the x-coordinate relative to the document to show the menu at - * @param {Number} y the y-coordinate relative to the document to show the menu at - * @param {Number} i the object of items to show - * @plugin contextmenu - * @trigger show_contextmenu.jstree - * @private - */ - this._show_contextmenu = function (obj, x, y, i) { - var d = this.get_node(obj, true), - a = d.children(".jstree-anchor"); - $(document).one("context_show.vakata.jstree", $.proxy(function (e, data) { - var cls = 'jstree-contextmenu jstree-' + this.get_theme() + '-contextmenu'; - $(data.element).addClass(cls); - }, this)); - this._data.contextmenu.visible = true; - $.vakata.context.show(a, { 'x' : x, 'y' : y }, i); - /** - * triggered when the contextmenu is shown for a node - * @event - * @name show_contextmenu.jstree - * @param {Object} node the node - * @param {Number} x the x-coordinate of the menu relative to the document - * @param {Number} y the y-coordinate of the menu relative to the document - * @plugin contextmenu - */ - this.trigger('show_contextmenu', { "node" : obj, "x" : x, "y" : y }); - }; - }; - - // contextmenu helper - (function ($) { - var right_to_left = false, - vakata_context = { - element : false, - reference : false, - position_x : 0, - position_y : 0, - items : [], - html : "", - is_visible : false - }; - - $.vakata.context = { - settings : { - hide_onmouseleave : 0, - icons : true - }, - _trigger : function (event_name) { - $(document).triggerHandler("context_" + event_name + ".vakata", { - "reference" : vakata_context.reference, - "element" : vakata_context.element, - "position" : { - "x" : vakata_context.position_x, - "y" : vakata_context.position_y - } - }); - }, - _execute : function (i) { - i = vakata_context.items[i]; - return i && (!i._disabled || ($.isFunction(i._disabled) && !i._disabled({ "item" : i, "reference" : vakata_context.reference, "element" : vakata_context.element }))) && i.action ? i.action.call(null, { - "item" : i, - "reference" : vakata_context.reference, - "element" : vakata_context.element, - "position" : { - "x" : vakata_context.position_x, - "y" : vakata_context.position_y - } - }) : false; - }, - _parse : function (o, is_callback) { - if(!o) { return false; } - if(!is_callback) { - vakata_context.html = ""; - vakata_context.items = []; - } - var str = "", - sep = false, - tmp; - - if(is_callback) { str += "<"+"ul>"; } - $.each(o, function (i, val) { - if(!val) { return true; } - vakata_context.items.push(val); - if(!sep && val.separator_before) { - str += "<"+"li class='vakata-context-separator'><"+"a href='#' " + ($.vakata.context.settings.icons ? '' : 'style="margin-left:0px;"') + "> <"+"/a><"+"/li>"; - } - sep = false; - str += "<"+"li class='" + (val._class || "") + (val._disabled === true || ($.isFunction(val._disabled) && val._disabled({ "item" : val, "reference" : vakata_context.reference, "element" : vakata_context.element })) ? " vakata-contextmenu-disabled " : "") + "' "+(val.shortcut?" data-shortcut='"+val.shortcut+"' ":'')+">"; - str += "<"+"a href='#' rel='" + (vakata_context.items.length - 1) + "'>"; - if($.vakata.context.settings.icons) { - str += "<"+"i "; - if(val.icon) { - if(val.icon.indexOf("/") !== -1 || val.icon.indexOf(".") !== -1) { str += " style='background:url(\"" + val.icon + "\") center center no-repeat' "; } - else { str += " class='" + val.icon + "' "; } - } - str += "><"+"/i><"+"span class='vakata-contextmenu-sep'> <"+"/span>"; - } - str += ($.isFunction(val.label) ? val.label({ "item" : i, "reference" : vakata_context.reference, "element" : vakata_context.element }) : val.label) + (val.shortcut?' '+ (val.shortcut_label || '') +'':'') + "<"+"/a>"; - if(val.submenu) { - tmp = $.vakata.context._parse(val.submenu, true); - if(tmp) { str += tmp; } - } - str += "<"+"/li>"; - if(val.separator_after) { - str += "<"+"li class='vakata-context-separator'><"+"a href='#' " + ($.vakata.context.settings.icons ? '' : 'style="margin-left:0px;"') + "> <"+"/a><"+"/li>"; - sep = true; - } - }); - str = str.replace(/
  • <\/li\>$/,""); - if(is_callback) { str += ""; } - /** - * triggered on the document when the contextmenu is parsed (HTML is built) - * @event - * @plugin contextmenu - * @name context_parse.vakata - * @param {jQuery} reference the element that was right clicked - * @param {jQuery} element the DOM element of the menu itself - * @param {Object} position the x & y coordinates of the menu - */ - if(!is_callback) { vakata_context.html = str; $.vakata.context._trigger("parse"); } - return str.length > 10 ? str : false; - }, - _show_submenu : function (o) { - o = $(o); - if(!o.length || !o.children("ul").length) { return; } - var e = o.children("ul"), - x = o.offset().left + o.outerWidth(), - y = o.offset().top, - w = e.width(), - h = e.height(), - dw = $(window).width() + $(window).scrollLeft(), - dh = $(window).height() + $(window).scrollTop(); - // може да се спести е една проверка - дали няма някой от класовете вече нагоре - if(right_to_left) { - o[x - (w + 10 + o.outerWidth()) < 0 ? "addClass" : "removeClass"]("vakata-context-left"); - } - else { - o[x + w + 10 > dw ? "addClass" : "removeClass"]("vakata-context-right"); - } - if(y + h + 10 > dh) { - e.css("bottom","-1px"); - } - e.show(); - }, - show : function (reference, position, data) { - var o, e, x, y, w, h, dw, dh, cond = true; - if(vakata_context.element && vakata_context.element.length) { - vakata_context.element.width(''); - } - switch(cond) { - case (!position && !reference): - return false; - case (!!position && !!reference): - vakata_context.reference = reference; - vakata_context.position_x = position.x; - vakata_context.position_y = position.y; - break; - case (!position && !!reference): - vakata_context.reference = reference; - o = reference.offset(); - vakata_context.position_x = o.left + reference.outerHeight(); - vakata_context.position_y = o.top; - break; - case (!!position && !reference): - vakata_context.position_x = position.x; - vakata_context.position_y = position.y; - break; - } - if(!!reference && !data && $(reference).data('vakata_contextmenu')) { - data = $(reference).data('vakata_contextmenu'); - } - if($.vakata.context._parse(data)) { - vakata_context.element.html(vakata_context.html); - } - if(vakata_context.items.length) { - vakata_context.element.appendTo("body"); - e = vakata_context.element; - x = vakata_context.position_x; - y = vakata_context.position_y; - w = e.width(); - h = e.height(); - dw = $(window).width() + $(window).scrollLeft(); - dh = $(window).height() + $(window).scrollTop(); - if(right_to_left) { - x -= (e.outerWidth() - $(reference).outerWidth()); - if(x < $(window).scrollLeft() + 20) { - x = $(window).scrollLeft() + 20; - } - } - if(x + w + 20 > dw) { - x = dw - (w + 20); - } - if(y + h + 20 > dh) { - y = dh - (h + 20); - } - - vakata_context.element - .css({ "left" : x, "top" : y }) - .show() - .find('a').first().focus().parent().addClass("vakata-context-hover"); - vakata_context.is_visible = true; - /** - * triggered on the document when the contextmenu is shown - * @event - * @plugin contextmenu - * @name context_show.vakata - * @param {jQuery} reference the element that was right clicked - * @param {jQuery} element the DOM element of the menu itself - * @param {Object} position the x & y coordinates of the menu - */ - $.vakata.context._trigger("show"); - } - }, - hide : function () { - if(vakata_context.is_visible) { - vakata_context.element.hide().find("ul").hide().end().find(':focus').blur().end().detach(); - vakata_context.is_visible = false; - /** - * triggered on the document when the contextmenu is hidden - * @event - * @plugin contextmenu - * @name context_hide.vakata - * @param {jQuery} reference the element that was right clicked - * @param {jQuery} element the DOM element of the menu itself - * @param {Object} position the x & y coordinates of the menu - */ - $.vakata.context._trigger("hide"); - } - } - }; - $(function () { - right_to_left = $("body").css("direction") === "rtl"; - var to = false; - - vakata_context.element = $("
      "); - vakata_context.element - .on("mouseenter", "li", function (e) { - e.stopImmediatePropagation(); - - if($.contains(this, e.relatedTarget)) { - // премахнато заради delegate mouseleave по-долу - // $(this).find(".vakata-context-hover").removeClass("vakata-context-hover"); - return; - } - - if(to) { clearTimeout(to); } - vakata_context.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(); - - $(this) - .siblings().find("ul").hide().end().end() - .parentsUntil(".vakata-context", "li").addBack().addClass("vakata-context-hover"); - $.vakata.context._show_submenu(this); - }) - // тестово - дали не натоварва? - .on("mouseleave", "li", function (e) { - if($.contains(this, e.relatedTarget)) { return; } - $(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover"); - }) - .on("mouseleave", function (e) { - $(this).find(".vakata-context-hover").removeClass("vakata-context-hover"); - if($.vakata.context.settings.hide_onmouseleave) { - to = setTimeout( - (function (t) { - return function () { $.vakata.context.hide(); }; - }(this)), $.vakata.context.settings.hide_onmouseleave); - } - }) - .on("click", "a", function (e) { - e.preventDefault(); - //}) - //.on("mouseup", "a", function (e) { - if(!$(this).blur().parent().hasClass("vakata-context-disabled") && $.vakata.context._execute($(this).attr("rel")) !== false) { - $.vakata.context.hide(); - } - }) - .on('keydown', 'a', function (e) { - var o = null; - switch(e.which) { - case 13: - case 32: - e.type = "mouseup"; - e.preventDefault(); - $(e.currentTarget).trigger(e); - break; - case 37: - if(vakata_context.is_visible) { - vakata_context.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children('a').focus(); - e.stopImmediatePropagation(); - e.preventDefault(); - } - break; - case 38: - if(vakata_context.is_visible) { - o = vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(); - if(!o.length) { o = vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last(); } - o.addClass("vakata-context-hover").children('a').focus(); - e.stopImmediatePropagation(); - e.preventDefault(); - } - break; - case 39: - if(vakata_context.is_visible) { - vakata_context.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children('a').focus(); - e.stopImmediatePropagation(); - e.preventDefault(); - } - break; - case 40: - if(vakata_context.is_visible) { - o = vakata_context.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(); - if(!o.length) { o = vakata_context.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first(); } - o.addClass("vakata-context-hover").children('a').focus(); - e.stopImmediatePropagation(); - e.preventDefault(); - } - break; - case 27: - $.vakata.context.hide(); - e.preventDefault(); - break; - default: - //console.log(e.which); - break; - } - }) - .on('keydown', function (e) { - e.preventDefault(); - var a = vakata_context.element.find('.vakata-contextmenu-shortcut-' + e.which).parent(); - if(a.parent().not('.vakata-context-disabled')) { - a.click(); - } - }); - - $(document) - .on("mousedown.vakata.jstree", function (e) { - if(vakata_context.is_visible && !$.contains(vakata_context.element[0], e.target)) { - $.vakata.context.hide(); - } - }) - .on("context_show.vakata.jstree", function (e, data) { - vakata_context.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"); - if(right_to_left) { - vakata_context.element.addClass("vakata-context-rtl").css("direction", "rtl"); - } - // also apply a RTL class? - vakata_context.element.find("ul").hide().end(); - }); - }); - }($)); - // $.jstree.defaults.plugins.push("contextmenu"); - -/** - * ### Drag'n'drop plugin - * - * Enables dragging and dropping of nodes in the tree, resulting in a move or copy operations. - */ - - /** - * stores all defaults for the drag'n'drop plugin - * @name $.jstree.defaults.dnd - * @plugin dnd - */ - $.jstree.defaults.dnd = { - /** - * a boolean indicating if a copy should be possible while dragging (by pressint the meta key or Ctrl). Defaults to `true`. - * @name $.jstree.defaults.dnd.copy - * @plugin dnd - */ - copy : true, - /** - * a number indicating how long a node should remain hovered while dragging to be opened. Defaults to `500`. - * @name $.jstree.defaults.dnd.open_timeout - * @plugin dnd - */ - open_timeout : 500, - /** - * a function invoked each time a node is about to be dragged, invoked in the tree's scope and receives the nodes about to be dragged as an argument (array) and the event that started the drag - return `false` to prevent dragging - * @name $.jstree.defaults.dnd.is_draggable - * @plugin dnd - */ - is_draggable : true, - /** - * a boolean indicating if checks should constantly be made while the user is dragging the node (as opposed to checking only on drop), default is `true` - * @name $.jstree.defaults.dnd.check_while_dragging - * @plugin dnd - */ - check_while_dragging : true, - /** - * a boolean indicating if nodes from this tree should only be copied with dnd (as opposed to moved), default is `false` - * @name $.jstree.defaults.dnd.always_copy - * @plugin dnd - */ - always_copy : false, - /** - * when dropping a node "inside", this setting indicates the position the node should go to - it can be an integer or a string: "first" (same as 0) or "last", default is `0` - * @name $.jstree.defaults.dnd.inside_pos - * @plugin dnd - */ - inside_pos : 0, - /** - * when starting the drag on a node that is selected this setting controls if all selected nodes are dragged or only the single node, default is `true`, which means all selected nodes are dragged when the drag is started on a selected node - * @name $.jstree.defaults.dnd.drag_selection - * @plugin dnd - */ - drag_selection : true, - /** - * controls whether dnd works on touch devices. If left as boolean true dnd will work the same as in desktop browsers, which in some cases may impair scrolling. If set to boolean false dnd will not work on touch devices. There is a special third option - string "selected" which means only selected nodes can be dragged on touch devices. - * @name $.jstree.defaults.dnd.touch - * @plugin dnd - */ - touch : true, - /** - * controls whether items can be dropped anywhere on the node, not just on the anchor, by default only the node anchor is a valid drop target. Works best with the wholerow plugin. If enabled on mobile depending on the interface it might be hard for the user to cancel the drop, since the whole tree container will be a valid drop target. - * @name $.jstree.defaults.dnd.large_drop_target - * @plugin dnd - */ - large_drop_target : false, - /** - * controls whether a drag can be initiated from any part of the node and not just the text/icon part, works best with the wholerow plugin. Keep in mind it can cause problems with tree scrolling on mobile depending on the interface - in that case set the touch option to "selected". - * @name $.jstree.defaults.dnd.large_drag_target - * @plugin dnd - */ - large_drag_target : false - }; - // TODO: now check works by checking for each node individually, how about max_children, unique, etc? - $.jstree.plugins.dnd = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - - this.element - .on('mousedown.jstree touchstart.jstree', this.settings.dnd.large_drag_target ? '.jstree-node' : '.jstree-anchor', $.proxy(function (e) { - if(this.settings.dnd.large_drag_target && $(e.target).closest('.jstree-node')[0] !== e.currentTarget) { - return true; - } - if(e.type === "touchstart" && (!this.settings.dnd.touch || (this.settings.dnd.touch === 'selected' && !$(e.currentTarget).closest('.jstree-node').children('.jstree-anchor').hasClass('jstree-clicked')))) { - return true; - } - var obj = this.get_node(e.target), - mlt = this.is_selected(obj) && this.settings.dnd.drag_selection ? this.get_top_selected().length : 1, - txt = (mlt > 1 ? mlt + ' ' + this.get_string('nodes') : this.get_text(e.currentTarget)); - if(this.settings.core.force_text) { - txt = $.vakata.html.escape(txt); - } - if(obj && obj.id && obj.id !== $.jstree.root && (e.which === 1 || e.type === "touchstart") && - (this.settings.dnd.is_draggable === true || ($.isFunction(this.settings.dnd.is_draggable) && this.settings.dnd.is_draggable.call(this, (mlt > 1 ? this.get_top_selected(true) : [obj]), e))) - ) { - this.element.trigger('mousedown.jstree'); - return $.vakata.dnd.start(e, { 'jstree' : true, 'origin' : this, 'obj' : this.get_node(obj,true), 'nodes' : mlt > 1 ? this.get_top_selected() : [obj.id] }, '
      ' + txt + '
      '); - } - }, this)); - }; - }; - - $(function() { - // bind only once for all instances - var lastmv = false, - laster = false, - lastev = false, - opento = false, - marker = $('
       
      ').hide(); //.appendTo('body'); - - $(document) - .on('dnd_start.vakata.jstree', function (e, data) { - lastmv = false; - lastev = false; - if(!data || !data.data || !data.data.jstree) { return; } - marker.appendTo('body'); //.show(); - }) - .on('dnd_move.vakata.jstree', function (e, data) { - if(opento) { clearTimeout(opento); } - if(!data || !data.data || !data.data.jstree) { return; } - - // if we are hovering the marker image do nothing (can happen on "inside" drags) - if(data.event.target.id && data.event.target.id === 'jstree-marker') { - return; - } - lastev = data.event; - - var ins = $.jstree.reference(data.event.target), - ref = false, - off = false, - rel = false, - tmp, l, t, h, p, i, o, ok, t1, t2, op, ps, pr, ip, tm; - // if we are over an instance - if(ins && ins._data && ins._data.dnd) { - marker.attr('class', 'jstree-' + ins.get_theme() + ( ins.settings.core.themes.responsive ? ' jstree-dnd-responsive' : '' )); - data.helper - .children().attr('class', 'jstree-' + ins.get_theme() + ' jstree-' + ins.get_theme() + '-' + ins.get_theme_variant() + ' ' + ( ins.settings.core.themes.responsive ? ' jstree-dnd-responsive' : '' )) - .find('.jstree-copy').first()[ data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey))) ? 'show' : 'hide' ](); - - - // if are hovering the container itself add a new root node - if( (data.event.target === ins.element[0] || data.event.target === ins.get_container_ul()[0]) && ins.get_container_ul().children().length === 0) { - ok = true; - for(t1 = 0, t2 = data.data.nodes.length; t1 < t2; t1++) { - ok = ok && ins.check( (data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey)) ) ? "copy_node" : "move_node"), (data.data.origin && data.data.origin !== ins ? data.data.origin.get_node(data.data.nodes[t1]) : data.data.nodes[t1]), $.jstree.root, 'last', { 'dnd' : true, 'ref' : ins.get_node($.jstree.root), 'pos' : 'i', 'origin' : data.data.origin, 'is_multi' : (data.data.origin && data.data.origin !== ins), 'is_foreign' : (!data.data.origin) }); - if(!ok) { break; } - } - if(ok) { - lastmv = { 'ins' : ins, 'par' : $.jstree.root, 'pos' : 'last' }; - marker.hide(); - data.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok'); - return; - } - } - else { - // if we are hovering a tree node - ref = ins.settings.dnd.large_drop_target ? $(data.event.target).closest('.jstree-node').children('.jstree-anchor') : $(data.event.target).closest('.jstree-anchor'); - if(ref && ref.length && ref.parent().is('.jstree-closed, .jstree-open, .jstree-leaf')) { - off = ref.offset(); - rel = data.event.pageY - off.top; - h = ref.outerHeight(); - if(rel < h / 3) { - o = ['b', 'i', 'a']; - } - else if(rel > h - h / 3) { - o = ['a', 'i', 'b']; - } - else { - o = rel > h / 2 ? ['i', 'a', 'b'] : ['i', 'b', 'a']; - } - $.each(o, function (j, v) { - switch(v) { - case 'b': - l = off.left - 6; - t = off.top; - p = ins.get_parent(ref); - i = ref.parent().index(); - break; - case 'i': - ip = ins.settings.dnd.inside_pos; - tm = ins.get_node(ref.parent()); - l = off.left - 2; - t = off.top + h / 2 + 1; - p = tm.id; - i = ip === 'first' ? 0 : (ip === 'last' ? tm.children.length : Math.min(ip, tm.children.length)); - break; - case 'a': - l = off.left - 6; - t = off.top + h; - p = ins.get_parent(ref); - i = ref.parent().index() + 1; - break; - } - ok = true; - for(t1 = 0, t2 = data.data.nodes.length; t1 < t2; t1++) { - op = data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey))) ? "copy_node" : "move_node"; - ps = i; - if(op === "move_node" && v === 'a' && (data.data.origin && data.data.origin === ins) && p === ins.get_parent(data.data.nodes[t1])) { - pr = ins.get_node(p); - if(ps > $.inArray(data.data.nodes[t1], pr.children)) { - ps -= 1; - } - } - ok = ok && ( (ins && ins.settings && ins.settings.dnd && ins.settings.dnd.check_while_dragging === false) || ins.check(op, (data.data.origin && data.data.origin !== ins ? data.data.origin.get_node(data.data.nodes[t1]) : data.data.nodes[t1]), p, ps, { 'dnd' : true, 'ref' : ins.get_node(ref.parent()), 'pos' : v, 'origin' : data.data.origin, 'is_multi' : (data.data.origin && data.data.origin !== ins), 'is_foreign' : (!data.data.origin) }) ); - if(!ok) { - if(ins && ins.last_error) { laster = ins.last_error(); } - break; - } - } - if(v === 'i' && ref.parent().is('.jstree-closed') && ins.settings.dnd.open_timeout) { - opento = setTimeout((function (x, z) { return function () { x.open_node(z); }; }(ins, ref)), ins.settings.dnd.open_timeout); - } - if(ok) { - lastmv = { 'ins' : ins, 'par' : p, 'pos' : v === 'i' && ip === 'last' && i === 0 && !ins.is_loaded(tm) ? 'last' : i }; - marker.css({ 'left' : l + 'px', 'top' : t + 'px' }).show(); - data.helper.find('.jstree-icon').first().removeClass('jstree-er').addClass('jstree-ok'); - laster = {}; - o = true; - return false; - } - }); - if(o === true) { return; } - } - } - } - lastmv = false; - data.helper.find('.jstree-icon').removeClass('jstree-ok').addClass('jstree-er'); - marker.hide(); - }) - .on('dnd_scroll.vakata.jstree', function (e, data) { - if(!data || !data.data || !data.data.jstree) { return; } - marker.hide(); - lastmv = false; - lastev = false; - data.helper.find('.jstree-icon').first().removeClass('jstree-ok').addClass('jstree-er'); - }) - .on('dnd_stop.vakata.jstree', function (e, data) { - if(opento) { clearTimeout(opento); } - if(!data || !data.data || !data.data.jstree) { return; } - marker.hide().detach(); - var i, j, nodes = []; - if(lastmv) { - for(i = 0, j = data.data.nodes.length; i < j; i++) { - nodes[i] = data.data.origin ? data.data.origin.get_node(data.data.nodes[i]) : data.data.nodes[i]; - } - lastmv.ins[ data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (data.event.metaKey || data.event.ctrlKey))) ? 'copy_node' : 'move_node' ](nodes, lastmv.par, lastmv.pos, false, false, false, data.data.origin); - } - else { - i = $(data.event.target).closest('.jstree'); - if(i.length && laster && laster.error && laster.error === 'check') { - i = i.jstree(true); - if(i) { - i.settings.core.error.call(this, laster); - } - } - } - lastev = false; - lastmv = false; - }) - .on('keyup.jstree keydown.jstree', function (e, data) { - data = $.vakata.dnd._get(); - if(data && data.data && data.data.jstree) { - data.helper.find('.jstree-copy').first()[ data.data.origin && (data.data.origin.settings.dnd.always_copy || (data.data.origin.settings.dnd.copy && (e.metaKey || e.ctrlKey))) ? 'show' : 'hide' ](); - if(lastev) { - lastev.metaKey = e.metaKey; - lastev.ctrlKey = e.ctrlKey; - $.vakata.dnd._trigger('move', lastev); - } - } - }); - }); - - // helpers - (function ($) { - $.vakata.html = { - div : $('
      '), - escape : function (str) { - return $.vakata.html.div.text(str).html(); - }, - strip : function (str) { - return $.vakata.html.div.empty().append($.parseHTML(str)).text(); - } - }; - // private variable - var vakata_dnd = { - element : false, - target : false, - is_down : false, - is_drag : false, - helper : false, - helper_w: 0, - data : false, - init_x : 0, - init_y : 0, - scroll_l: 0, - scroll_t: 0, - scroll_e: false, - scroll_i: false, - is_touch: false - }; - $.vakata.dnd = { - settings : { - scroll_speed : 10, - scroll_proximity : 20, - helper_left : 5, - helper_top : 10, - threshold : 5, - threshold_touch : 50 - }, - _trigger : function (event_name, e) { - var data = $.vakata.dnd._get(); - data.event = e; - $(document).triggerHandler("dnd_" + event_name + ".vakata", data); - }, - _get : function () { - return { - "data" : vakata_dnd.data, - "element" : vakata_dnd.element, - "helper" : vakata_dnd.helper - }; - }, - _clean : function () { - if(vakata_dnd.helper) { vakata_dnd.helper.remove(); } - if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; } - vakata_dnd = { - element : false, - target : false, - is_down : false, - is_drag : false, - helper : false, - helper_w: 0, - data : false, - init_x : 0, - init_y : 0, - scroll_l: 0, - scroll_t: 0, - scroll_e: false, - scroll_i: false, - is_touch: false - }; - $(document).off("mousemove.vakata.jstree touchmove.vakata.jstree", $.vakata.dnd.drag); - $(document).off("mouseup.vakata.jstree touchend.vakata.jstree", $.vakata.dnd.stop); - }, - _scroll : function (init_only) { - if(!vakata_dnd.scroll_e || (!vakata_dnd.scroll_l && !vakata_dnd.scroll_t)) { - if(vakata_dnd.scroll_i) { clearInterval(vakata_dnd.scroll_i); vakata_dnd.scroll_i = false; } - return false; - } - if(!vakata_dnd.scroll_i) { - vakata_dnd.scroll_i = setInterval($.vakata.dnd._scroll, 100); - return false; - } - if(init_only === true) { return false; } - - var i = vakata_dnd.scroll_e.scrollTop(), - j = vakata_dnd.scroll_e.scrollLeft(); - vakata_dnd.scroll_e.scrollTop(i + vakata_dnd.scroll_t * $.vakata.dnd.settings.scroll_speed); - vakata_dnd.scroll_e.scrollLeft(j + vakata_dnd.scroll_l * $.vakata.dnd.settings.scroll_speed); - if(i !== vakata_dnd.scroll_e.scrollTop() || j !== vakata_dnd.scroll_e.scrollLeft()) { - /** - * triggered on the document when a drag causes an element to scroll - * @event - * @plugin dnd - * @name dnd_scroll.vakata - * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start - * @param {DOM} element the DOM element being dragged - * @param {jQuery} helper the helper shown next to the mouse - * @param {jQuery} event the element that is scrolling - */ - $.vakata.dnd._trigger("scroll", vakata_dnd.scroll_e); - } - }, - start : function (e, data, html) { - if(e.type === "touchstart" && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0]) { - e.pageX = e.originalEvent.changedTouches[0].pageX; - e.pageY = e.originalEvent.changedTouches[0].pageY; - e.target = document.elementFromPoint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[0].pageY - window.pageYOffset); - } - if(vakata_dnd.is_drag) { $.vakata.dnd.stop({}); } - try { - e.currentTarget.unselectable = "on"; - e.currentTarget.onselectstart = function() { return false; }; - if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; } - } catch(ignore) { } - vakata_dnd.init_x = e.pageX; - vakata_dnd.init_y = e.pageY; - vakata_dnd.data = data; - vakata_dnd.is_down = true; - vakata_dnd.element = e.currentTarget; - vakata_dnd.target = e.target; - vakata_dnd.is_touch = e.type === "touchstart"; - if(html !== false) { - vakata_dnd.helper = $("
      ").html(html).css({ - "display" : "block", - "margin" : "0", - "padding" : "0", - "position" : "absolute", - "top" : "-2000px", - "lineHeight" : "16px", - "zIndex" : "10000" - }); - } - $(document).on("mousemove.vakata.jstree touchmove.vakata.jstree", $.vakata.dnd.drag); - $(document).on("mouseup.vakata.jstree touchend.vakata.jstree", $.vakata.dnd.stop); - return false; - }, - drag : function (e) { - if(e.type === "touchmove" && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0]) { - e.pageX = e.originalEvent.changedTouches[0].pageX; - e.pageY = e.originalEvent.changedTouches[0].pageY; - e.target = document.elementFromPoint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[0].pageY - window.pageYOffset); - } - if(!vakata_dnd.is_down) { return; } - if(!vakata_dnd.is_drag) { - if( - Math.abs(e.pageX - vakata_dnd.init_x) > (vakata_dnd.is_touch ? $.vakata.dnd.settings.threshold_touch : $.vakata.dnd.settings.threshold) || - Math.abs(e.pageY - vakata_dnd.init_y) > (vakata_dnd.is_touch ? $.vakata.dnd.settings.threshold_touch : $.vakata.dnd.settings.threshold) - ) { - if(vakata_dnd.helper) { - vakata_dnd.helper.appendTo("body"); - vakata_dnd.helper_w = vakata_dnd.helper.outerWidth(); - } - vakata_dnd.is_drag = true; - /** - * triggered on the document when a drag starts - * @event - * @plugin dnd - * @name dnd_start.vakata - * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start - * @param {DOM} element the DOM element being dragged - * @param {jQuery} helper the helper shown next to the mouse - * @param {Object} event the event that caused the start (probably mousemove) - */ - $.vakata.dnd._trigger("start", e); - } - else { return; } - } - - var d = false, w = false, - dh = false, wh = false, - dw = false, ww = false, - dt = false, dl = false, - ht = false, hl = false; - - vakata_dnd.scroll_t = 0; - vakata_dnd.scroll_l = 0; - vakata_dnd.scroll_e = false; - $($(e.target).parentsUntil("body").addBack().get().reverse()) - .filter(function () { - return (/^auto|scroll$/).test($(this).css("overflow")) && - (this.scrollHeight > this.offsetHeight || this.scrollWidth > this.offsetWidth); - }) - .each(function () { - var t = $(this), o = t.offset(); - if(this.scrollHeight > this.offsetHeight) { - if(o.top + t.height() - e.pageY < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; } - if(e.pageY - o.top < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; } - } - if(this.scrollWidth > this.offsetWidth) { - if(o.left + t.width() - e.pageX < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; } - if(e.pageX - o.left < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; } - } - if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) { - vakata_dnd.scroll_e = $(this); - return false; - } - }); - - if(!vakata_dnd.scroll_e) { - d = $(document); w = $(window); - dh = d.height(); wh = w.height(); - dw = d.width(); ww = w.width(); - dt = d.scrollTop(); dl = d.scrollLeft(); - if(dh > wh && e.pageY - dt < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = -1; } - if(dh > wh && wh - (e.pageY - dt) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_t = 1; } - if(dw > ww && e.pageX - dl < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = -1; } - if(dw > ww && ww - (e.pageX - dl) < $.vakata.dnd.settings.scroll_proximity) { vakata_dnd.scroll_l = 1; } - if(vakata_dnd.scroll_t || vakata_dnd.scroll_l) { - vakata_dnd.scroll_e = d; - } - } - if(vakata_dnd.scroll_e) { $.vakata.dnd._scroll(true); } - - if(vakata_dnd.helper) { - ht = parseInt(e.pageY + $.vakata.dnd.settings.helper_top, 10); - hl = parseInt(e.pageX + $.vakata.dnd.settings.helper_left, 10); - if(dh && ht + 25 > dh) { ht = dh - 50; } - if(dw && hl + vakata_dnd.helper_w > dw) { hl = dw - (vakata_dnd.helper_w + 2); } - vakata_dnd.helper.css({ - left : hl + "px", - top : ht + "px" - }); - } - /** - * triggered on the document when a drag is in progress - * @event - * @plugin dnd - * @name dnd_move.vakata - * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start - * @param {DOM} element the DOM element being dragged - * @param {jQuery} helper the helper shown next to the mouse - * @param {Object} event the event that caused this to trigger (most likely mousemove) - */ - $.vakata.dnd._trigger("move", e); - return false; - }, - stop : function (e) { - if(e.type === "touchend" && e.originalEvent && e.originalEvent.changedTouches && e.originalEvent.changedTouches[0]) { - e.pageX = e.originalEvent.changedTouches[0].pageX; - e.pageY = e.originalEvent.changedTouches[0].pageY; - e.target = document.elementFromPoint(e.originalEvent.changedTouches[0].pageX - window.pageXOffset, e.originalEvent.changedTouches[0].pageY - window.pageYOffset); - } - if(vakata_dnd.is_drag) { - /** - * triggered on the document when a drag stops (the dragged element is dropped) - * @event - * @plugin dnd - * @name dnd_stop.vakata - * @param {Mixed} data any data supplied with the call to $.vakata.dnd.start - * @param {DOM} element the DOM element being dragged - * @param {jQuery} helper the helper shown next to the mouse - * @param {Object} event the event that caused the stop - */ - $.vakata.dnd._trigger("stop", e); - } - else { - if(e.type === "touchend" && e.target === vakata_dnd.target) { - var to = setTimeout(function () { $(e.target).click(); }, 100); - $(e.target).one('click', function() { if(to) { clearTimeout(to); } }); - } - } - $.vakata.dnd._clean(); - return false; - } - }; - }($)); - - // include the dnd plugin by default - // $.jstree.defaults.plugins.push("dnd"); - - -/** - * ### Massload plugin - * - * Adds massload functionality to jsTree, so that multiple nodes can be loaded in a single request (only useful with lazy loading). - */ - - /** - * massload configuration - * - * It is possible to set this to a standard jQuery-like AJAX config. - * In addition to the standard jQuery ajax options here you can supply functions for `data` and `url`, the functions will be run in the current instance's scope and a param will be passed indicating which node IDs need to be loaded, the return value of those functions will be used. - * - * You can also set this to a function, that function will receive the node IDs being loaded as argument and a second param which is a function (callback) which should be called with the result. - * - * Both the AJAX and the function approach rely on the same return value - an object where the keys are the node IDs, and the value is the children of that node as an array. - * - * { - * "id1" : [{ "text" : "Child of ID1", "id" : "c1" }, { "text" : "Another child of ID1", "id" : "c2" }], - * "id2" : [{ "text" : "Child of ID2", "id" : "c3" }] - * } - * - * @name $.jstree.defaults.massload - * @plugin massload - */ - $.jstree.defaults.massload = null; - $.jstree.plugins.massload = function (options, parent) { - this.init = function (el, options) { - parent.init.call(this, el, options); - this._data.massload = {}; - }; - this._load_nodes = function (nodes, callback, is_callback) { - var s = this.settings.massload; - if(is_callback && !$.isEmptyObject(this._data.massload)) { - return parent._load_nodes.call(this, nodes, callback, is_callback); - } - if($.isFunction(s)) { - return s.call(this, nodes, $.proxy(function (data) { - if(data) { - for(var i in data) { - if(data.hasOwnProperty(i)) { - this._data.massload[i] = data[i]; - } - } - } - parent._load_nodes.call(this, nodes, callback, is_callback); - }, this)); - } - if(typeof s === 'object' && s && s.url) { - s = $.extend(true, {}, s); - if($.isFunction(s.url)) { - s.url = s.url.call(this, nodes); - } - if($.isFunction(s.data)) { - s.data = s.data.call(this, nodes); - } - return $.ajax(s) - .done($.proxy(function (data,t,x) { - if(data) { - for(var i in data) { - if(data.hasOwnProperty(i)) { - this._data.massload[i] = data[i]; - } - } - } - parent._load_nodes.call(this, nodes, callback, is_callback); - }, this)) - .fail($.proxy(function (f) { - parent._load_nodes.call(this, nodes, callback, is_callback); - }, this)); - } - return parent._load_nodes.call(this, nodes, callback, is_callback); - }; - this._load_node = function (obj, callback) { - var d = this._data.massload[obj.id]; - if(d) { - return this[typeof d === 'string' ? '_append_html_data' : '_append_json_data'](obj, typeof d === 'string' ? $($.parseHTML(d)).filter(function () { return this.nodeType !== 3; }) : d, function (status) { - callback.call(this, status); - delete this._data.massload[obj.id]; - }); - } - return parent._load_node.call(this, obj, callback); - }; - }; - -/** - * ### Search plugin - * - * Adds search functionality to jsTree. - */ - - /** - * stores all defaults for the search plugin - * @name $.jstree.defaults.search - * @plugin search - */ - $.jstree.defaults.search = { - /** - * a jQuery-like AJAX config, which jstree uses if a server should be queried for results. - * - * A `str` (which is the search string) parameter will be added with the request, an optional `inside` parameter will be added if the search is limited to a node id. The expected result is a JSON array with nodes that need to be opened so that matching nodes will be revealed. - * Leave this setting as `false` to not query the server. You can also set this to a function, which will be invoked in the instance's scope and receive 3 parameters - the search string, the callback to call with the array of nodes to load, and the optional node ID to limit the search to - * @name $.jstree.defaults.search.ajax - * @plugin search - */ - ajax : false, - /** - * Indicates if the search should be fuzzy or not (should `chnd3` match `child node 3`). Default is `false`. - * @name $.jstree.defaults.search.fuzzy - * @plugin search - */ - fuzzy : false, - /** - * Indicates if the search should be case sensitive. Default is `false`. - * @name $.jstree.defaults.search.case_sensitive - * @plugin search - */ - case_sensitive : false, - /** - * Indicates if the tree should be filtered (by default) to show only matching nodes (keep in mind this can be a heavy on large trees in old browsers). - * This setting can be changed at runtime when calling the search method. Default is `false`. - * @name $.jstree.defaults.search.show_only_matches - * @plugin search - */ - show_only_matches : false, - /** - * Indicates if the children of matched element are shown (when show_only_matches is true) - * This setting can be changed at runtime when calling the search method. Default is `false`. - * @name $.jstree.defaults.search.show_only_matches_children - * @plugin search - */ - show_only_matches_children : false, - /** - * Indicates if all nodes opened to reveal the search result, should be closed when the search is cleared or a new search is performed. Default is `true`. - * @name $.jstree.defaults.search.close_opened_onclear - * @plugin search - */ - close_opened_onclear : true, - /** - * Indicates if only leaf nodes should be included in search results. Default is `false`. - * @name $.jstree.defaults.search.search_leaves_only - * @plugin search - */ - search_leaves_only : false, - /** - * If set to a function it wil be called in the instance's scope with two arguments - search string and node (where node will be every node in the structure, so use with caution). - * If the function returns a truthy value the node will be considered a match (it might not be displayed if search_only_leaves is set to true and the node is not a leaf). Default is `false`. - * @name $.jstree.defaults.search.search_callback - * @plugin search - */ - search_callback : false - }; - - $.jstree.plugins.search = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - - this._data.search.str = ""; - this._data.search.dom = $(); - this._data.search.res = []; - this._data.search.opn = []; - this._data.search.som = false; - this._data.search.smc = false; - this._data.search.hdn = []; - - this.element - .on("search.jstree", $.proxy(function (e, data) { - if(this._data.search.som && data.res.length) { - var m = this._model.data, i, j, p = []; - for(i = 0, j = data.res.length; i < j; i++) { - if(m[data.res[i]] && !m[data.res[i]].state.hidden) { - p.push(data.res[i]); - p = p.concat(m[data.res[i]].parents); - if(this._data.search.smc) { - p = p.concat(m[data.res[i]].children_d); - } - } - } - p = $.vakata.array_remove_item($.vakata.array_unique(p), $.jstree.root); - this._data.search.hdn = this.hide_all(true); - this.show_node(p); - } - }, this)) - .on("clear_search.jstree", $.proxy(function (e, data) { - if(this._data.search.som && data.res.length) { - this.show_node(this._data.search.hdn); - } - }, this)); - }; - /** - * used to search the tree nodes for a given string - * @name search(str [, skip_async]) - * @param {String} str the search string - * @param {Boolean} skip_async if set to true server will not be queried even if configured - * @param {Boolean} show_only_matches if set to true only matching nodes will be shown (keep in mind this can be very slow on large trees or old browsers) - * @param {mixed} inside an optional node to whose children to limit the search - * @param {Boolean} append if set to true the results of this search are appended to the previous search - * @plugin search - * @trigger search.jstree - */ - this.search = function (str, skip_async, show_only_matches, inside, append, show_only_matches_children) { - if(str === false || $.trim(str.toString()) === "") { - return this.clear_search(); - } - inside = this.get_node(inside); - inside = inside && inside.id ? inside.id : null; - str = str.toString(); - var s = this.settings.search, - a = s.ajax ? s.ajax : false, - m = this._model.data, - f = null, - r = [], - p = [], i, j; - if(this._data.search.res.length && !append) { - this.clear_search(); - } - if(show_only_matches === undefined) { - show_only_matches = s.show_only_matches; - } - if(show_only_matches_children === undefined) { - show_only_matches_children = s.show_only_matches_children; - } - if(!skip_async && a !== false) { - if($.isFunction(a)) { - return a.call(this, str, $.proxy(function (d) { - if(d && d.d) { d = d.d; } - this._load_nodes(!$.isArray(d) ? [] : $.vakata.array_unique(d), function () { - this.search(str, true, show_only_matches, inside, append); - }, true); - }, this), inside); - } - else { - a = $.extend({}, a); - if(!a.data) { a.data = {}; } - a.data.str = str; - if(inside) { - a.data.inside = inside; - } - return $.ajax(a) - .fail($.proxy(function () { - this._data.core.last_error = { 'error' : 'ajax', 'plugin' : 'search', 'id' : 'search_01', 'reason' : 'Could not load search parents', 'data' : JSON.stringify(a) }; - this.settings.core.error.call(this, this._data.core.last_error); - }, this)) - .done($.proxy(function (d) { - if(d && d.d) { d = d.d; } - this._load_nodes(!$.isArray(d) ? [] : $.vakata.array_unique(d), function () { - this.search(str, true, show_only_matches, inside, append); - }, true); - }, this)); - } - } - if(!append) { - this._data.search.str = str; - this._data.search.dom = $(); - this._data.search.res = []; - this._data.search.opn = []; - this._data.search.som = show_only_matches; - this._data.search.smc = show_only_matches_children; - } - - f = new $.vakata.search(str, true, { caseSensitive : s.case_sensitive, fuzzy : s.fuzzy }); - $.each(m[inside ? inside : $.jstree.root].children_d, function (ii, i) { - var v = m[i]; - if(v.text && (!s.search_leaves_only || (v.state.loaded && v.children.length === 0)) && ( (s.search_callback && s.search_callback.call(this, str, v)) || (!s.search_callback && f.search(v.text).isMatch) ) ) { - r.push(i); - p = p.concat(v.parents); - } - }); - if(r.length) { - p = $.vakata.array_unique(p); - for(i = 0, j = p.length; i < j; i++) { - if(p[i] !== $.jstree.root && m[p[i]] && this.open_node(p[i], null, 0) === true) { - this._data.search.opn.push(p[i]); - } - } - if(!append) { - this._data.search.dom = $(this.element[0].querySelectorAll('#' + $.map(r, function (v) { return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' ' + v.substr(1).replace($.jstree.idregex,'\\$&') : v.replace($.jstree.idregex,'\\$&'); }).join(', #'))); - this._data.search.res = r; - } - else { - this._data.search.dom = this._data.search.dom.add($(this.element[0].querySelectorAll('#' + $.map(r, function (v) { return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' ' + v.substr(1).replace($.jstree.idregex,'\\$&') : v.replace($.jstree.idregex,'\\$&'); }).join(', #')))); - this._data.search.res = $.vakata.array_unique(this._data.search.res.concat(r)); - } - this._data.search.dom.children(".jstree-anchor").addClass('jstree-search'); - } - /** - * triggered after search is complete - * @event - * @name search.jstree - * @param {jQuery} nodes a jQuery collection of matching nodes - * @param {String} str the search string - * @param {Array} res a collection of objects represeing the matching nodes - * @plugin search - */ - this.trigger('search', { nodes : this._data.search.dom, str : str, res : this._data.search.res, show_only_matches : show_only_matches }); - }; - /** - * used to clear the last search (removes classes and shows all nodes if filtering is on) - * @name clear_search() - * @plugin search - * @trigger clear_search.jstree - */ - this.clear_search = function () { - if(this.settings.search.close_opened_onclear) { - this.close_node(this._data.search.opn, 0); - } - /** - * triggered after search is complete - * @event - * @name clear_search.jstree - * @param {jQuery} nodes a jQuery collection of matching nodes (the result from the last search) - * @param {String} str the search string (the last search string) - * @param {Array} res a collection of objects represeing the matching nodes (the result from the last search) - * @plugin search - */ - this.trigger('clear_search', { 'nodes' : this._data.search.dom, str : this._data.search.str, res : this._data.search.res }); - if(this._data.search.res.length) { - this._data.search.dom = $(this.element[0].querySelectorAll('#' + $.map(this._data.search.res, function (v) { - return "0123456789".indexOf(v[0]) !== -1 ? '\\3' + v[0] + ' ' + v.substr(1).replace($.jstree.idregex,'\\$&') : v.replace($.jstree.idregex,'\\$&'); - }).join(', #'))); - this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"); - } - this._data.search.str = ""; - this._data.search.res = []; - this._data.search.opn = []; - this._data.search.dom = $(); - }; - - this.redraw_node = function(obj, deep, callback, force_render) { - obj = parent.redraw_node.apply(this, arguments); - if(obj) { - if($.inArray(obj.id, this._data.search.res) !== -1) { - var i, j, tmp = null; - for(i = 0, j = obj.childNodes.length; i < j; i++) { - if(obj.childNodes[i] && obj.childNodes[i].className && obj.childNodes[i].className.indexOf("jstree-anchor") !== -1) { - tmp = obj.childNodes[i]; - break; - } - } - if(tmp) { - tmp.className += ' jstree-search'; - } - } - } - return obj; - }; - }; - - // helpers - (function ($) { - // from http://kiro.me/projects/fuse.html - $.vakata.search = function(pattern, txt, options) { - options = options || {}; - options = $.extend({}, $.vakata.search.defaults, options); - if(options.fuzzy !== false) { - options.fuzzy = true; - } - pattern = options.caseSensitive ? pattern : pattern.toLowerCase(); - var MATCH_LOCATION = options.location, - MATCH_DISTANCE = options.distance, - MATCH_THRESHOLD = options.threshold, - patternLen = pattern.length, - matchmask, pattern_alphabet, match_bitapScore, search; - if(patternLen > 32) { - options.fuzzy = false; - } - if(options.fuzzy) { - matchmask = 1 << (patternLen - 1); - pattern_alphabet = (function () { - var mask = {}, - i = 0; - for (i = 0; i < patternLen; i++) { - mask[pattern.charAt(i)] = 0; - } - for (i = 0; i < patternLen; i++) { - mask[pattern.charAt(i)] |= 1 << (patternLen - i - 1); - } - return mask; - }()); - match_bitapScore = function (e, x) { - var accuracy = e / patternLen, - proximity = Math.abs(MATCH_LOCATION - x); - if(!MATCH_DISTANCE) { - return proximity ? 1.0 : accuracy; - } - return accuracy + (proximity / MATCH_DISTANCE); - }; - } - search = function (text) { - text = options.caseSensitive ? text : text.toLowerCase(); - if(pattern === text || text.indexOf(pattern) !== -1) { - return { - isMatch: true, - score: 0 - }; - } - if(!options.fuzzy) { - return { - isMatch: false, - score: 1 - }; - } - var i, j, - textLen = text.length, - scoreThreshold = MATCH_THRESHOLD, - bestLoc = text.indexOf(pattern, MATCH_LOCATION), - binMin, binMid, - binMax = patternLen + textLen, - lastRd, start, finish, rd, charMatch, - score = 1, - locations = []; - if (bestLoc !== -1) { - scoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold); - bestLoc = text.lastIndexOf(pattern, MATCH_LOCATION + patternLen); - if (bestLoc !== -1) { - scoreThreshold = Math.min(match_bitapScore(0, bestLoc), scoreThreshold); - } - } - bestLoc = -1; - for (i = 0; i < patternLen; i++) { - binMin = 0; - binMid = binMax; - while (binMin < binMid) { - if (match_bitapScore(i, MATCH_LOCATION + binMid) <= scoreThreshold) { - binMin = binMid; - } else { - binMax = binMid; - } - binMid = Math.floor((binMax - binMin) / 2 + binMin); - } - binMax = binMid; - start = Math.max(1, MATCH_LOCATION - binMid + 1); - finish = Math.min(MATCH_LOCATION + binMid, textLen) + patternLen; - rd = new Array(finish + 2); - rd[finish + 1] = (1 << i) - 1; - for (j = finish; j >= start; j--) { - charMatch = pattern_alphabet[text.charAt(j - 1)]; - if (i === 0) { - rd[j] = ((rd[j + 1] << 1) | 1) & charMatch; - } else { - rd[j] = ((rd[j + 1] << 1) | 1) & charMatch | (((lastRd[j + 1] | lastRd[j]) << 1) | 1) | lastRd[j + 1]; - } - if (rd[j] & matchmask) { - score = match_bitapScore(i, j - 1); - if (score <= scoreThreshold) { - scoreThreshold = score; - bestLoc = j - 1; - locations.push(bestLoc); - if (bestLoc > MATCH_LOCATION) { - start = Math.max(1, 2 * MATCH_LOCATION - bestLoc); - } else { - break; - } - } - } - } - if (match_bitapScore(i + 1, MATCH_LOCATION) > scoreThreshold) { - break; - } - lastRd = rd; - } - return { - isMatch: bestLoc >= 0, - score: score - }; - }; - return txt === true ? { 'search' : search } : search(txt); - }; - $.vakata.search.defaults = { - location : 0, - distance : 100, - threshold : 0.6, - fuzzy : false, - caseSensitive : false - }; - }($)); - - // include the search plugin by default - // $.jstree.defaults.plugins.push("search"); - - -/** - * ### Sort plugin - * - * Automatically sorts all siblings in the tree according to a sorting function. - */ - - /** - * the settings function used to sort the nodes. - * It is executed in the tree's context, accepts two nodes as arguments and should return `1` or `-1`. - * @name $.jstree.defaults.sort - * @plugin sort - */ - $.jstree.defaults.sort = function (a, b) { - //return this.get_type(a) === this.get_type(b) ? (this.get_text(a) > this.get_text(b) ? 1 : -1) : this.get_type(a) >= this.get_type(b); - return this.get_text(a) > this.get_text(b) ? 1 : -1; - }; - $.jstree.plugins.sort = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - this.element - .on("model.jstree", $.proxy(function (e, data) { - this.sort(data.parent, true); - }, this)) - .on("rename_node.jstree create_node.jstree", $.proxy(function (e, data) { - this.sort(data.parent || data.node.parent, false); - this.redraw_node(data.parent || data.node.parent, true); - }, this)) - .on("move_node.jstree copy_node.jstree", $.proxy(function (e, data) { - this.sort(data.parent, false); - this.redraw_node(data.parent, true); - }, this)); - }; - /** - * used to sort a node's children - * @private - * @name sort(obj [, deep]) - * @param {mixed} obj the node - * @param {Boolean} deep if set to `true` nodes are sorted recursively. - * @plugin sort - * @trigger search.jstree - */ - this.sort = function (obj, deep) { - var i, j; - obj = this.get_node(obj); - if(obj && obj.children && obj.children.length) { - obj.children.sort($.proxy(this.settings.sort, this)); - if(deep) { - for(i = 0, j = obj.children_d.length; i < j; i++) { - this.sort(obj.children_d[i], false); - } - } - } - }; - }; - - // include the sort plugin by default - // $.jstree.defaults.plugins.push("sort"); - -/** - * ### State plugin - * - * Saves the state of the tree (selected nodes, opened nodes) on the user's computer using available options (localStorage, cookies, etc) - */ - - var to = false; - /** - * stores all defaults for the state plugin - * @name $.jstree.defaults.state - * @plugin state - */ - $.jstree.defaults.state = { - /** - * A string for the key to use when saving the current tree (change if using multiple trees in your project). Defaults to `jstree`. - * @name $.jstree.defaults.state.key - * @plugin state - */ - key : 'jstree', - /** - * A space separated list of events that trigger a state save. Defaults to `changed.jstree open_node.jstree close_node.jstree`. - * @name $.jstree.defaults.state.events - * @plugin state - */ - events : 'changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree', - /** - * Time in milliseconds after which the state will expire. Defaults to 'false' meaning - no expire. - * @name $.jstree.defaults.state.ttl - * @plugin state - */ - ttl : false, - /** - * A function that will be executed prior to restoring state with one argument - the state object. Can be used to clear unwanted parts of the state. - * @name $.jstree.defaults.state.filter - * @plugin state - */ - filter : false - }; - $.jstree.plugins.state = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - var bind = $.proxy(function () { - this.element.on(this.settings.state.events, $.proxy(function () { - if(to) { clearTimeout(to); } - to = setTimeout($.proxy(function () { this.save_state(); }, this), 100); - }, this)); - /** - * triggered when the state plugin is finished restoring the state (and immediately after ready if there is no state to restore). - * @event - * @name state_ready.jstree - * @plugin state - */ - this.trigger('state_ready'); - }, this); - this.element - .on("ready.jstree", $.proxy(function (e, data) { - this.element.one("restore_state.jstree", bind); - if(!this.restore_state()) { bind(); } - }, this)); - }; - /** - * save the state - * @name save_state() - * @plugin state - */ - this.save_state = function () { - var st = { 'state' : this.get_state(), 'ttl' : this.settings.state.ttl, 'sec' : +(new Date()) }; - $.vakata.storage.set(this.settings.state.key, JSON.stringify(st)); - }; - /** - * restore the state from the user's computer - * @name restore_state() - * @plugin state - */ - this.restore_state = function () { - var k = $.vakata.storage.get(this.settings.state.key); - if(!!k) { try { k = JSON.parse(k); } catch(ex) { return false; } } - if(!!k && k.ttl && k.sec && +(new Date()) - k.sec > k.ttl) { return false; } - if(!!k && k.state) { k = k.state; } - if(!!k && $.isFunction(this.settings.state.filter)) { k = this.settings.state.filter.call(this, k); } - if(!!k) { - this.element.one("set_state.jstree", function (e, data) { data.instance.trigger('restore_state', { 'state' : $.extend(true, {}, k) }); }); - this.set_state(k); - return true; - } - return false; - }; - /** - * clear the state on the user's computer - * @name clear_state() - * @plugin state - */ - this.clear_state = function () { - return $.vakata.storage.del(this.settings.state.key); - }; - }; - - (function ($, undefined) { - $.vakata.storage = { - // simply specifying the functions in FF throws an error - set : function (key, val) { return window.localStorage.setItem(key, val); }, - get : function (key) { return window.localStorage.getItem(key); }, - del : function (key) { return window.localStorage.removeItem(key); } - }; - }($)); - - // include the state plugin by default - // $.jstree.defaults.plugins.push("state"); - -/** - * ### Types plugin - * - * Makes it possible to add predefined types for groups of nodes, which make it possible to easily control nesting rules and icon for each group. - */ - - /** - * An object storing all types as key value pairs, where the key is the type name and the value is an object that could contain following keys (all optional). - * - * * `max_children` the maximum number of immediate children this node type can have. Do not specify or set to `-1` for unlimited. - * * `max_depth` the maximum number of nesting this node type can have. A value of `1` would mean that the node can have children, but no grandchildren. Do not specify or set to `-1` for unlimited. - * * `valid_children` an array of node type strings, that nodes of this type can have as children. Do not specify or set to `-1` for no limits. - * * `icon` a string - can be a path to an icon or a className, if using an image that is in the current directory use a `./` prefix, otherwise it will be detected as a class. Omit to use the default icon from your theme. - * - * There are two predefined types: - * - * * `#` represents the root of the tree, for example `max_children` would control the maximum number of root nodes. - * * `default` represents the default node - any settings here will be applied to all nodes that do not have a type specified. - * - * @name $.jstree.defaults.types - * @plugin types - */ - $.jstree.defaults.types = { - 'default' : {} - }; - $.jstree.defaults.types[$.jstree.root] = {}; - - $.jstree.plugins.types = function (options, parent) { - this.init = function (el, options) { - var i, j; - if(options && options.types && options.types['default']) { - for(i in options.types) { - if(i !== "default" && i !== $.jstree.root && options.types.hasOwnProperty(i)) { - for(j in options.types['default']) { - if(options.types['default'].hasOwnProperty(j) && options.types[i][j] === undefined) { - options.types[i][j] = options.types['default'][j]; - } - } - } - } - } - parent.init.call(this, el, options); - this._model.data[$.jstree.root].type = $.jstree.root; - }; - this.refresh = function (skip_loading, forget_state) { - parent.refresh.call(this, skip_loading, forget_state); - this._model.data[$.jstree.root].type = $.jstree.root; - }; - this.bind = function () { - this.element - .on('model.jstree', $.proxy(function (e, data) { - var m = this._model.data, - dpc = data.nodes, - t = this.settings.types, - i, j, c = 'default'; - for(i = 0, j = dpc.length; i < j; i++) { - c = 'default'; - if(m[dpc[i]].original && m[dpc[i]].original.type && t[m[dpc[i]].original.type]) { - c = m[dpc[i]].original.type; - } - if(m[dpc[i]].data && m[dpc[i]].data.jstree && m[dpc[i]].data.jstree.type && t[m[dpc[i]].data.jstree.type]) { - c = m[dpc[i]].data.jstree.type; - } - m[dpc[i]].type = c; - if(m[dpc[i]].icon === true && t[c].icon !== undefined) { - m[dpc[i]].icon = t[c].icon; - } - } - m[$.jstree.root].type = $.jstree.root; - }, this)); - parent.bind.call(this); - }; - this.get_json = function (obj, options, flat) { - var i, j, - m = this._model.data, - opt = options ? $.extend(true, {}, options, {no_id:false}) : {}, - tmp = parent.get_json.call(this, obj, opt, flat); - if(tmp === false) { return false; } - if($.isArray(tmp)) { - for(i = 0, j = tmp.length; i < j; i++) { - tmp[i].type = tmp[i].id && m[tmp[i].id] && m[tmp[i].id].type ? m[tmp[i].id].type : "default"; - if(options && options.no_id) { - delete tmp[i].id; - if(tmp[i].li_attr && tmp[i].li_attr.id) { - delete tmp[i].li_attr.id; - } - if(tmp[i].a_attr && tmp[i].a_attr.id) { - delete tmp[i].a_attr.id; - } - } - } - } - else { - tmp.type = tmp.id && m[tmp.id] && m[tmp.id].type ? m[tmp.id].type : "default"; - if(options && options.no_id) { - tmp = this._delete_ids(tmp); - } - } - return tmp; - }; - this._delete_ids = function (tmp) { - if($.isArray(tmp)) { - for(var i = 0, j = tmp.length; i < j; i++) { - tmp[i] = this._delete_ids(tmp[i]); - } - return tmp; - } - delete tmp.id; - if(tmp.li_attr && tmp.li_attr.id) { - delete tmp.li_attr.id; - } - if(tmp.a_attr && tmp.a_attr.id) { - delete tmp.a_attr.id; - } - if(tmp.children && $.isArray(tmp.children)) { - tmp.children = this._delete_ids(tmp.children); - } - return tmp; - }; - this.check = function (chk, obj, par, pos, more) { - if(parent.check.call(this, chk, obj, par, pos, more) === false) { return false; } - obj = obj && obj.id ? obj : this.get_node(obj); - par = par && par.id ? par : this.get_node(par); - var m = obj && obj.id ? (more && more.origin ? more.origin : $.jstree.reference(obj.id)) : null, tmp, d, i, j; - m = m && m._model && m._model.data ? m._model.data : null; - switch(chk) { - case "create_node": - case "move_node": - case "copy_node": - if(chk !== 'move_node' || $.inArray(obj.id, par.children) === -1) { - tmp = this.get_rules(par); - if(tmp.max_children !== undefined && tmp.max_children !== -1 && tmp.max_children === par.children.length) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'types', 'id' : 'types_01', 'reason' : 'max_children prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - return false; - } - if(tmp.valid_children !== undefined && tmp.valid_children !== -1 && $.inArray((obj.type || 'default'), tmp.valid_children) === -1) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'types', 'id' : 'types_02', 'reason' : 'valid_children prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - return false; - } - if(m && obj.children_d && obj.parents) { - d = 0; - for(i = 0, j = obj.children_d.length; i < j; i++) { - d = Math.max(d, m[obj.children_d[i]].parents.length); - } - d = d - obj.parents.length + 1; - } - if(d <= 0 || d === undefined) { d = 1; } - do { - if(tmp.max_depth !== undefined && tmp.max_depth !== -1 && tmp.max_depth < d) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'types', 'id' : 'types_03', 'reason' : 'max_depth prevents function: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - return false; - } - par = this.get_node(par.parent); - tmp = this.get_rules(par); - d++; - } while(par); - } - break; - } - return true; - }; - /** - * used to retrieve the type settings object for a node - * @name get_rules(obj) - * @param {mixed} obj the node to find the rules for - * @return {Object} - * @plugin types - */ - this.get_rules = function (obj) { - obj = this.get_node(obj); - if(!obj) { return false; } - var tmp = this.get_type(obj, true); - if(tmp.max_depth === undefined) { tmp.max_depth = -1; } - if(tmp.max_children === undefined) { tmp.max_children = -1; } - if(tmp.valid_children === undefined) { tmp.valid_children = -1; } - return tmp; - }; - /** - * used to retrieve the type string or settings object for a node - * @name get_type(obj [, rules]) - * @param {mixed} obj the node to find the rules for - * @param {Boolean} rules if set to `true` instead of a string the settings object will be returned - * @return {String|Object} - * @plugin types - */ - this.get_type = function (obj, rules) { - obj = this.get_node(obj); - return (!obj) ? false : ( rules ? $.extend({ 'type' : obj.type }, this.settings.types[obj.type]) : obj.type); - }; - /** - * used to change a node's type - * @name set_type(obj, type) - * @param {mixed} obj the node to change - * @param {String} type the new type - * @plugin types - */ - this.set_type = function (obj, type) { - var t, t1, t2, old_type, old_icon; - if($.isArray(obj)) { - obj = obj.slice(); - for(t1 = 0, t2 = obj.length; t1 < t2; t1++) { - this.set_type(obj[t1], type); - } - return true; - } - t = this.settings.types; - obj = this.get_node(obj); - if(!t[type] || !obj) { return false; } - old_type = obj.type; - old_icon = this.get_icon(obj); - obj.type = type; - if(old_icon === true || (t[old_type] && t[old_type].icon !== undefined && old_icon === t[old_type].icon)) { - this.set_icon(obj, t[type].icon !== undefined ? t[type].icon : true); - } - return true; - }; - }; - // include the types plugin by default - // $.jstree.defaults.plugins.push("types"); - -/** - * ### Unique plugin - * - * Enforces that no nodes with the same name can coexist as siblings. - */ - - /** - * stores all defaults for the unique plugin - * @name $.jstree.defaults.unique - * @plugin unique - */ - $.jstree.defaults.unique = { - /** - * Indicates if the comparison should be case sensitive. Default is `false`. - * @name $.jstree.defaults.unique.case_sensitive - * @plugin unique - */ - case_sensitive : false, - /** - * A callback executed in the instance's scope when a new node is created and the name is already taken, the two arguments are the conflicting name and the counter. The default will produce results like `New node (2)`. - * @name $.jstree.defaults.unique.duplicate - * @plugin unique - */ - duplicate : function (name, counter) { - return name + ' (' + counter + ')'; - } - }; - - $.jstree.plugins.unique = function (options, parent) { - this.check = function (chk, obj, par, pos, more) { - if(parent.check.call(this, chk, obj, par, pos, more) === false) { return false; } - obj = obj && obj.id ? obj : this.get_node(obj); - par = par && par.id ? par : this.get_node(par); - if(!par || !par.children) { return true; } - var n = chk === "rename_node" ? pos : obj.text, - c = [], - s = this.settings.unique.case_sensitive, - m = this._model.data, i, j; - for(i = 0, j = par.children.length; i < j; i++) { - c.push(s ? m[par.children[i]].text : m[par.children[i]].text.toLowerCase()); - } - if(!s) { n = n.toLowerCase(); } - switch(chk) { - case "delete_node": - return true; - case "rename_node": - i = ($.inArray(n, c) === -1 || (obj.text && obj.text[ s ? 'toString' : 'toLowerCase']() === n)); - if(!i) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_01', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - } - return i; - case "create_node": - i = ($.inArray(n, c) === -1); - if(!i) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_04', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - } - return i; - case "copy_node": - i = ($.inArray(n, c) === -1); - if(!i) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_02', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - } - return i; - case "move_node": - i = ( (obj.parent === par.id && (!more || !more.is_multi)) || $.inArray(n, c) === -1); - if(!i) { - this._data.core.last_error = { 'error' : 'check', 'plugin' : 'unique', 'id' : 'unique_03', 'reason' : 'Child with name ' + n + ' already exists. Preventing: ' + chk, 'data' : JSON.stringify({ 'chk' : chk, 'pos' : pos, 'obj' : obj && obj.id ? obj.id : false, 'par' : par && par.id ? par.id : false }) }; - } - return i; - } - return true; - }; - this.create_node = function (par, node, pos, callback, is_loaded) { - if(!node || node.text === undefined) { - if(par === null) { - par = $.jstree.root; - } - par = this.get_node(par); - if(!par) { - return parent.create_node.call(this, par, node, pos, callback, is_loaded); - } - pos = pos === undefined ? "last" : pos; - if(!pos.toString().match(/^(before|after)$/) && !is_loaded && !this.is_loaded(par)) { - return parent.create_node.call(this, par, node, pos, callback, is_loaded); - } - if(!node) { node = {}; } - var tmp, n, dpc, i, j, m = this._model.data, s = this.settings.unique.case_sensitive, cb = this.settings.unique.duplicate; - n = tmp = this.get_string('New node'); - dpc = []; - for(i = 0, j = par.children.length; i < j; i++) { - dpc.push(s ? m[par.children[i]].text : m[par.children[i]].text.toLowerCase()); - } - i = 1; - while($.inArray(s ? n : n.toLowerCase(), dpc) !== -1) { - n = cb.call(this, tmp, (++i)).toString(); - } - node.text = n; - } - return parent.create_node.call(this, par, node, pos, callback, is_loaded); - }; - }; - - // include the unique plugin by default - // $.jstree.defaults.plugins.push("unique"); - - -/** - * ### Wholerow plugin - * - * Makes each node appear block level. Making selection easier. May cause slow down for large trees in old browsers. - */ - - var div = document.createElement('DIV'); - div.setAttribute('unselectable','on'); - div.setAttribute('role','presentation'); - div.className = 'jstree-wholerow'; - div.innerHTML = ' '; - $.jstree.plugins.wholerow = function (options, parent) { - this.bind = function () { - parent.bind.call(this); - - this.element - .on('ready.jstree set_state.jstree', $.proxy(function () { - this.hide_dots(); - }, this)) - .on("init.jstree loading.jstree ready.jstree", $.proxy(function () { - //div.style.height = this._data.core.li_height + 'px'; - this.get_container_ul().addClass('jstree-wholerow-ul'); - }, this)) - .on("deselect_all.jstree", $.proxy(function (e, data) { - this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked'); - }, this)) - .on("changed.jstree", $.proxy(function (e, data) { - this.element.find('.jstree-wholerow-clicked').removeClass('jstree-wholerow-clicked'); - var tmp = false, i, j; - for(i = 0, j = data.selected.length; i < j; i++) { - tmp = this.get_node(data.selected[i], true); - if(tmp && tmp.length) { - tmp.children('.jstree-wholerow').addClass('jstree-wholerow-clicked'); - } - } - }, this)) - .on("open_node.jstree", $.proxy(function (e, data) { - this.get_node(data.node, true).find('.jstree-clicked').parent().children('.jstree-wholerow').addClass('jstree-wholerow-clicked'); - }, this)) - .on("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) { - if(e.type === "hover_node" && this.is_disabled(data.node)) { return; } - this.get_node(data.node, true).children('.jstree-wholerow')[e.type === "hover_node"?"addClass":"removeClass"]('jstree-wholerow-hovered'); - }, this)) - .on("contextmenu.jstree", ".jstree-wholerow", $.proxy(function (e) { - e.preventDefault(); - var tmp = $.Event('contextmenu', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey, pageX : e.pageX, pageY : e.pageY }); - $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp); - }, this)) - /*! - .on("mousedown.jstree touchstart.jstree", ".jstree-wholerow", function (e) { - if(e.target === e.currentTarget) { - var a = $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor"); - e.target = a[0]; - a.trigger(e); - } - }) - */ - .on("click.jstree", ".jstree-wholerow", function (e) { - e.stopImmediatePropagation(); - var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }); - $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus(); - }) - .on("click.jstree", ".jstree-leaf > .jstree-ocl", $.proxy(function (e) { - e.stopImmediatePropagation(); - var tmp = $.Event('click', { metaKey : e.metaKey, ctrlKey : e.ctrlKey, altKey : e.altKey, shiftKey : e.shiftKey }); - $(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(tmp).focus(); - }, this)) - .on("mouseover.jstree", ".jstree-wholerow, .jstree-icon", $.proxy(function (e) { - e.stopImmediatePropagation(); - if(!this.is_disabled(e.currentTarget)) { - this.hover_node(e.currentTarget); - } - return false; - }, this)) - .on("mouseleave.jstree", ".jstree-node", $.proxy(function (e) { - this.dehover_node(e.currentTarget); - }, this)); - }; - this.teardown = function () { - if(this.settings.wholerow) { - this.element.find(".jstree-wholerow").remove(); - } - parent.teardown.call(this); - }; - this.redraw_node = function(obj, deep, callback, force_render) { - obj = parent.redraw_node.apply(this, arguments); - if(obj) { - var tmp = div.cloneNode(true); - //tmp.style.height = this._data.core.li_height + 'px'; - if($.inArray(obj.id, this._data.core.selected) !== -1) { tmp.className += ' jstree-wholerow-clicked'; } - if(this._data.core.focused && this._data.core.focused === obj.id) { tmp.className += ' jstree-wholerow-hovered'; } - obj.insertBefore(tmp, obj.childNodes[0]); - } - return obj; - }; - }; - // include the wholerow plugin by default - // $.jstree.defaults.plugins.push("wholerow"); - if(document.registerElement && Object && Object.create) { - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - var c = { core : {}, plugins : [] }, i; - for(i in $.jstree.plugins) { - if($.jstree.plugins.hasOwnProperty(i) && this.attributes[i]) { - c.plugins.push(i); - if(this.getAttribute(i) && JSON.parse(this.getAttribute(i))) { - c[i] = JSON.parse(this.getAttribute(i)); - } - } - } - for(i in $.jstree.defaults.core) { - if($.jstree.defaults.core.hasOwnProperty(i) && this.attributes[i]) { - c.core[i] = JSON.parse(this.getAttribute(i)) || this.getAttribute(i); - } - } - $(this).jstree(c); - }; - // proto.attributeChangedCallback = function (name, previous, value) { }; - try { - document.registerElement("vakata-jstree", { prototype: proto }); - } catch(ignore) { } - } - -})); \ No newline at end of file diff --git a/Resources/public/js/vendor/jstree/jstree.min.js b/Resources/public/js/vendor/jstree/jstree.min.js deleted file mode 100644 index 30b73e79..00000000 --- a/Resources/public/js/vendor/jstree/jstree.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! jsTree - v3.2.1 - 2015-08-24 - (MIT) */ -!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):"undefined"!=typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a,b){"use strict";if(!a.jstree){var c=0,d=!1,e=!1,f=!1,g=[],h=a("script:last").attr("src"),i=window.document,j=i.createElement("LI"),k,l;j.setAttribute("role","treeitem"),k=i.createElement("I"),k.className="jstree-icon jstree-ocl",k.setAttribute("role","presentation"),j.appendChild(k),k=i.createElement("A"),k.className="jstree-anchor",k.setAttribute("href","#"),k.setAttribute("tabindex","-1"),l=i.createElement("I"),l.className="jstree-icon jstree-themeicon",l.setAttribute("role","presentation"),k.appendChild(l),j.appendChild(k),k=l=null,a.jstree={version:"3.2.1",defaults:{plugins:[]},plugins:{},path:h&&-1!==h.indexOf("/")?h.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g,root:"#"},a.jstree.create=function(b,d){var e=new a.jstree.core(++c),f=d;return d=a.extend(!0,{},a.jstree.defaults,d),f&&f.plugins&&(d.plugins=f.plugins),a.each(d.plugins,function(a,b){"core"!==a&&(e=e.plugin(b,d[b]))}),a(b).data("jstree",e),e.init(b,d),e},a.jstree.destroy=function(){a(".jstree:jstree").jstree("destroy"),a(i).off(".jstree")},a.jstree.core=function(a){this._id=a,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},a.jstree.reference=function(b){var c=null,d=null;if(!b||!b.id||b.tagName&&b.nodeType||(b=b.id),!d||!d.length)try{d=a(b)}catch(e){}if(!d||!d.length)try{d=a("#"+b.replace(a.jstree.idregex,"\\$&"))}catch(e){}return d&&d.length&&(d=d.closest(".jstree")).length&&(d=d.data("jstree"))?c=d:a(".jstree").each(function(){var d=a(this).data("jstree");return d&&d._model.data[b]?(c=d,!1):void 0}),c},a.fn.jstree=function(c){var d="string"==typeof c,e=Array.prototype.slice.call(arguments,1),f=null;return c!==!0||this.length?(this.each(function(){var g=a.jstree.reference(this),h=d&&g?g[c]:null;return f=d&&h?h.apply(g,e):null,g||d||c!==b&&!a.isPlainObject(c)||a.jstree.create(this,c),(g&&!d||c===!0)&&(f=g||!1),null!==f&&f!==b?!1:void 0}),null!==f&&f!==b?f:this):!1},a.expr[":"].jstree=a.expr.createPseudo(function(c){return function(c){return a(c).hasClass("jstree")&&a(c).data("jstree")!==b}}),a.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:a.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},a.jstree.core.prototype={plugin:function(b,c){var d=a.jstree.plugins[b];return d?(this._data[b]={},d.prototype=this,new d(c,this)):this},init:function(b,c){this._model={data:{},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this._model.data[a.jstree.root]={id:a.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this.element=a(b).addClass("jstree jstree-"+this._id),this.settings=c,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().height()||24,this.trigger("loading"),this.load_node(a.jstree.root)},destroy:function(a){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(b){}a||this.element.empty(),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var b="",c=null,d=0;this.element.on("dblclick.jstree",function(a){if(a.target.tagName&&"input"===a.target.tagName.toLowerCase())return!0;if(i.selection&&i.selection.empty)i.selection.empty();else if(window.getSelection){var b=window.getSelection();try{b.removeAllRanges(),b.collapse()}catch(c){}}}).on("mousedown.jstree",a.proxy(function(a){a.target===this.element[0]&&(a.preventDefault(),d=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(a){a.preventDefault()}).on("click.jstree",".jstree-ocl",a.proxy(function(a){this.toggle_node(a.target)},this)).on("dblclick.jstree",".jstree-anchor",a.proxy(function(a){return a.target.tagName&&"input"===a.target.tagName.toLowerCase()?!0:void(this.settings.core.dblclick_toggle&&this.toggle_node(a.target))},this)).on("click.jstree",".jstree-anchor",a.proxy(function(b){b.preventDefault(),b.currentTarget!==i.activeElement&&a(b.currentTarget).focus(),this.activate_node(b.currentTarget,b)},this)).on("keydown.jstree",".jstree-anchor",a.proxy(function(b){if(b.target.tagName&&"input"===b.target.tagName.toLowerCase())return!0;if(32!==b.which&&13!==b.which&&(b.shiftKey||b.ctrlKey||b.altKey||b.metaKey))return!0;var c=null;switch(this._data.core.rtl&&(37===b.which?b.which=39:39===b.which&&(b.which=37)),b.which){case 32:b.ctrlKey&&(b.type="click",a(b.currentTarget).trigger(b));break;case 13:b.type="click",a(b.currentTarget).trigger(b);break;case 37:b.preventDefault(),this.is_open(b.currentTarget)?this.close_node(b.currentTarget):(c=this.get_parent(b.currentTarget),c&&c.id!==a.jstree.root&&this.get_node(c,!0).children(".jstree-anchor").focus());break;case 38:b.preventDefault(),c=this.get_prev_dom(b.currentTarget),c&&c.length&&c.children(".jstree-anchor").focus();break;case 39:b.preventDefault(),this.is_closed(b.currentTarget)?this.open_node(b.currentTarget,function(a){this.get_node(a,!0).children(".jstree-anchor").focus()}):this.is_open(b.currentTarget)&&(c=this.get_node(b.currentTarget,!0).children(".jstree-children")[0],c&&a(this._firstChild(c)).children(".jstree-anchor").focus());break;case 40:b.preventDefault(),c=this.get_next_dom(b.currentTarget),c&&c.length&&c.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:b.preventDefault(),c=this._firstChild(this.get_container_ul()[0]),c&&a(c).children(".jstree-anchor").filter(":visible").focus();break;case 35:b.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()}},this)).on("load_node.jstree",a.proxy(function(b,c){c.status&&(c.node.id!==a.jstree.root||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(a.proxy(function(){if(this.element&&!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var b=[],c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)b=b.concat(this._model.data[this._data.core.selected[c]].parents);for(b=a.vakata.array_unique(b),c=0,d=b.length;d>c;c++)this.open_node(b[c],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",a.proxy(function(d){if(d.target.tagName&&"input"===d.target.tagName.toLowerCase())return!0;c&&clearTimeout(c),c=setTimeout(function(){b=""},500);var e=String.fromCharCode(d.which).toLowerCase(),f=this.element.find(".jstree-anchor").filter(":visible"),g=f.index(i.activeElement)||0,h=!1;if(b+=e,b.length>1){if(f.slice(g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g).each(a.proxy(function(c,d){return 0===a(d).text().toLowerCase().indexOf(b)?(a(d).focus(),h=!0,!1):void 0},this)),h)return}if(new RegExp("^"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+"+$").test(b)){if(f.slice(g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return;if(f.slice(0,g+1).each(a.proxy(function(b,c){return a(c).text().toLowerCase().charAt(0)===e?(a(c).focus(),h=!0,!1):void 0},this)),h)return}},this)).on("init.jstree",a.proxy(function(){var a=this.settings.core.themes;this._data.core.themes.dots=a.dots,this._data.core.themes.stripes=a.stripes,this._data.core.themes.icons=a.icons,this.set_theme(a.name||"default",a.url),this.set_theme_variant(a.variant)},this)).on("loading.jstree",a.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("blur.jstree",".jstree-anchor",a.proxy(function(b){this._data.core.focused=null,a(b.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",a.proxy(function(b){var c=this.get_node(b.currentTarget);c&&c.id&&(this._data.core.focused=c.id),this.element.find(".jstree-hovered").not(b.currentTarget).mouseleave(),a(b.currentTarget).mouseenter(),this.element.attr("tabindex","-1")},this)).on("focus.jstree",a.proxy(function(){if(+new Date-d>500&&!this._data.core.focused){d=0;var a=this.get_node(this.element.attr("aria-activedescendant"),!0);a&&a.find("> .jstree-anchor").focus()}},this)).on("mouseenter.jstree",".jstree-anchor",a.proxy(function(a){this.hover_node(a.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),a(i).off(".jstree-"+this._id)},trigger:function(a,b){b||(b={}),b.instance=this,this.element.triggerHandler(a.replace(".jstree","")+".jstree",b)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(b){var c=this.settings.core.strings;return a.isFunction(c)?c.call(this,b):c&&c[b]?c[b]:b},_firstChild:function(a){a=a?a.firstChild:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_nextSibling:function(a){a=a?a.nextSibling:null;while(null!==a&&1!==a.nodeType)a=a.nextSibling;return a},_previousSibling:function(a){a=a?a.previousSibling:null;while(null!==a&&1!==a.nodeType)a=a.previousSibling;return a},get_node:function(b,c){b&&b.id&&(b=b.id);var d;try{if(this._model.data[b])b=this._model.data[b];else if("string"==typeof b&&this._model.data[b.replace(/^#/,"")])b=this._model.data[b.replace(/^#/,"")];else if("string"==typeof b&&(d=a("#"+b.replace(a.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else if((d=a(b,this.element)).length&&this._model.data[d.closest(".jstree-node").attr("id")])b=this._model.data[d.closest(".jstree-node").attr("id")];else{if(!(d=a(b,this.element)).length||!d.hasClass("jstree"))return!1;b=this._model.data[a.jstree.root]}return c&&(b=b.id===a.jstree.root?this.element:a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)),b}catch(e){return!1}},get_path:function(b,c,d){if(b=b.parents?b:this.get_node(b),!b||b.id===a.jstree.root||!b.parents)return!1;var e,f,g=[];for(g.push(d?b.id:b.text),e=0,f=b.parents.length;f>e;e++)g.push(d?b.parents[e]:this.get_text(b.parents[e]));return g=g.reverse().slice(1),c?g.join(c):g},get_next_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this._firstChild(this.get_container_ul()[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}if(b.hasClass("jstree-open")){d=this._firstChild(b.children(".jstree-children")[0]);while(d&&0===d.offsetHeight)d=this._nextSibling(d);if(null!==d)return a(d)}d=b[0];do d=this._nextSibling(d);while(d&&0===d.offsetHeight);return null!==d?a(d):b.parentsUntil(".jstree",".jstree-node").nextAll(".jstree-node:visible").first()},get_prev_dom:function(b,c){var d;if(b=this.get_node(b,!0),b[0]===this.element[0]){d=this.get_container_ul()[0].lastChild;while(d&&0===d.offsetHeight)d=this._previousSibling(d);return d?a(d):!1}if(!b||!b.length)return!1;if(c){d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);return d?a(d):!1}d=b[0];do d=this._previousSibling(d);while(d&&0===d.offsetHeight);if(null!==d){b=a(d);while(b.hasClass("jstree-open"))b=b.children(".jstree-children").first().children(".jstree-node:visible:last");return b}return d=b[0].parentNode.parentNode,d&&d.className&&-1!==d.className.indexOf("jstree-node")?a(d):!1},get_parent:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.parent:!1},get_children_dom:function(a){return a=this.get_node(a,!0),a[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):a&&a.length?a.children(".jstree-children").children(".jstree-node"):!1},is_parent:function(a){return a=this.get_node(a),a&&(a.state.loaded===!1||a.children.length>0)},is_loaded:function(a){return a=this.get_node(a),a&&a.state.loaded},is_loading:function(a){return a=this.get_node(a),a&&a.state&&a.state.loading},is_open:function(a){return a=this.get_node(a),a&&a.state.opened},is_closed:function(a){return a=this.get_node(a),a&&this.is_parent(a)&&!a.state.opened},is_leaf:function(a){return!this.is_parent(a)},load_node:function(b,c){var d,e,f,g,h;if(a.isArray(b))return this._load_nodes(b.slice(),c),!0;if(b=this.get_node(b),!b)return c&&c.call(this,b,!1),!1;if(b.state.loaded){for(b.state.loaded=!1,d=0,e=b.children_d.length;e>d;d++){for(f=0,g=b.parents.length;g>f;f++)this._model.data[b.parents[f]].children_d=a.vakata.array_remove_item(this._model.data[b.parents[f]].children_d,b.children_d[d]);this._model.data[b.children_d[d]].state.selected&&(h=!0,this._data.core.selected=a.vakata.array_remove_item(this._data.core.selected,b.children_d[d])),delete this._model.data[b.children_d[d]]}b.children=[],b.children_d=[],h&&this.trigger("changed",{action:"load_node",node:b,selected:this._data.core.selected})}return b.state.failed=!1,b.state.loading=!0,this.get_node(b,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(b,a.proxy(function(a){b=this._model.data[b.id],b.state.loading=!1,b.state.loaded=a,b.state.failed=!b.state.loaded;var d=this.get_node(b,!0),e=0,f=0,g=this._model.data,h=!1;for(e=0,f=b.children.length;f>e;e++)if(g[b.children[e]]&&!g[b.children[e]].state.hidden){h=!0;break}b.state.loaded&&!h&&d&&d.length&&!d.hasClass("jstree-leaf")&&d.removeClass("jstree-closed jstree-open").addClass("jstree-leaf"),d.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:b,status:a}),c&&c.call(this,b,a)},this)),!0},_load_nodes:function(a,b,c){var d=!0,e=function(){this._load_nodes(a,b,!0)},f=this._model.data,g,h,i=[];for(g=0,h=a.length;h>g;g++)!f[a[g]]||(f[a[g]].state.loaded||f[a[g]].state.failed)&&c||(this.is_loading(a[g])||this.load_node(a[g],e),d=!1);if(d){for(g=0,h=a.length;h>g;g++)f[a[g]]&&f[a[g]].state.loaded&&i.push(a[g]);b&&!b.done&&(b.call(this,i),b.done=!0)}},load_all:function(b,c){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var d=[],e=this._model.data,f=e[b.id].children_d,g,h;for(b.state&&!b.state.loaded&&d.push(b.id),g=0,h=f.length;h>g;g++)e[f[g]]&&e[f[g]].state&&!e[f[g]].state.loaded&&d.push(f[g]);d.length?this._load_nodes(d,function(){this.load_all(b,c)}):(c&&c.call(this,b),this.trigger("load_all",{node:b}))},_load_node:function(b,c){var d=this.settings.core.data,e;return d?a.isFunction(d)?d.call(this,b,a.proxy(function(d){d===!1&&c.call(this,!1),this["string"==typeof d?"_append_html_data":"_append_json_data"](b,"string"==typeof d?a(a.parseHTML(d)).filter(function(){return 3!==this.nodeType}):d,function(a){c.call(this,a)})},this)):"object"==typeof d?d.url?(d=a.extend(!0,{},d),a.isFunction(d.url)&&(d.url=d.url.call(this,b)),a.isFunction(d.data)&&(d.data=d.data.call(this,b)),a.ajax(d).done(a.proxy(function(d,e,f){var g=f.getResponseHeader("Content-Type");return g&&-1!==g.indexOf("json")||"object"==typeof d?this._append_json_data(b,d,function(a){c.call(this,a)}):g&&-1!==g.indexOf("html")||"string"==typeof d?this._append_html_data(b,a(a.parseHTML(d)).filter(function(){return 3!==this.nodeType}),function(a){c.call(this,a)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:f})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))},this)).fail(a.proxy(function(a){c.call(this,!1),this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:b.id,xhr:a})},this.settings.core.error.call(this,this._data.core.last_error)},this))):(e=a.isArray(d)||a.isPlainObject(d)?JSON.parse(JSON.stringify(d)):d,b.id===a.jstree.root?this._append_json_data(b,e,function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1))):"string"==typeof d?b.id===a.jstree.root?this._append_html_data(b,a(a.parseHTML(d)).filter(function(){return 3!==this.nodeType}),function(a){c.call(this,a)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:b.id})},this.settings.core.error.call(this,this._data.core.last_error),c.call(this,!1)):c.call(this,!1):b.id===a.jstree.root?this._append_html_data(b,this._data.core.original_container_html.clone(!0),function(a){c.call(this,a)}):c.call(this,!1)},_node_changed:function(a){a=this.get_node(a),a&&this._model.changed.push(a.id)},_append_html_data:function(b,c,d){b=this.get_node(b),b.children=[],b.children_d=[];var e=c.is("ul")?c.children():c,f=b.id,g=[],h=[],i=this._model.data,j=i[f],k=this._data.core.selected.length,l,m,n;for(e.each(a.proxy(function(b,c){l=this._parse_model_from_html(a(c),f,j.parents.concat()),l&&(g.push(l),h.push(l),i[l].children_d.length&&(h=h.concat(i[l].children_d)))},this)),j.children=g,j.children_d=h,m=0,n=j.parents.length;n>m;m++)i[j.parents[m]].children_d=i[j.parents[m]].children_d.concat(h);this.trigger("model",{nodes:h,parent:f}),f!==a.jstree.root?(this._node_changed(f),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==k&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)},_append_json_data:function(b,c,d,e){if(null!==this.element){b=this.get_node(b),b.children=[],b.children_d=[],c.d&&(c=c.d,"string"==typeof c&&(c=JSON.parse(c))),a.isArray(c)||(c=[c]);var f=null,g={df:this._model.default_state,dat:c,par:b.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},h=function(a,b){a.data&&(a=a.data);var c=a.dat,d=a.par,e=[],f=[],g=[],h=a.df,i=a.t_id,j=a.t_cnt,k=a.m,l=k[d],m=a.sel,n,o,p,q,r=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f,i,j,l,m={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in h)h.hasOwnProperty(f)&&(m.state[f]=h[f]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(m.icon=a.data.jstree.icon),(m.icon===b||null===m.icon||""===m.icon)&&(m.icon=!0),a&&a.data&&(m.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(m.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(m.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(m.li_attr[f]=a.li_attr[f]);if(m.li_attr.id||(m.li_attr.id=e),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(m.a_attr[f]=a.a_attr[f]);for(a&&a.children&&a.children===!0&&(m.state.loaded=!1,m.children=[],m.children_d=[]),k[m.id]=m,f=0,i=m.children.length;i>f;f++)j=r(k[m.children[f]],m.id,d),l=k[j],m.children_d.push(j),l.children_d.length&&(m.children_d=m.children_d.concat(l.children_d));return delete a.data,delete a.children,k[m.id].original=a,m.state.selected&&g.push(m.id),m.id},s=function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,l,m,n,o;do e="j"+i+"_"+ ++j;while(k[e]);o={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in h)h.hasOwnProperty(f)&&(o.state[f]=h[f]);if(a&&a.id&&(o.id=a.id.toString()),a&&a.text&&(o.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(o.icon=a.data.jstree.icon),(o.icon===b||null===o.icon||""===o.icon)&&(o.icon=!0),a&&a.data&&(o.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(o.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(o.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(o.li_attr[f]=a.li_attr[f]);if(o.li_attr.id&&!o.id&&(o.id=o.li_attr.id.toString()),o.id||(o.id=e),o.li_attr.id||(o.li_attr.id=o.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(o.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,l=a.children.length;l>f;f++)m=s(a.children[f],o.id,d),n=k[m],o.children.push(m),n.children_d.length&&(o.children_d=o.children_d.concat(n.children_d));o.children_d=o.children_d.concat(o.children)}return a&&a.children&&a.children===!0&&(o.state.loaded=!1,o.children=[],o.children_d=[]),delete a.data,delete a.children,o.original=a,k[o.id]=o,o.state.selected&&g.push(o.id),o.id};if(c.length&&c[0].id!==b&&c[0].parent!==b){for(o=0,p=c.length;p>o;o++)c[o].children||(c[o].children=[]),k[c[o].id.toString()]=c[o];for(o=0,p=c.length;p>o;o++)k[c[o].parent.toString()].children.push(c[o].id.toString()),l.children_d.push(c[o].id.toString());for(o=0,p=l.children.length;p>o;o++)n=r(k[l.children[o]],d,l.parents.concat()),f.push(n),k[n].children_d.length&&(f=f.concat(k[n].children_d));for(o=0,p=l.parents.length;p>o;o++)k[l.parents[o]].children_d=k[l.parents[o]].children_d.concat(f);q={cnt:j,mod:k,sel:m,par:d,dpc:f,add:g}}else{for(o=0,p=c.length;p>o;o++)n=s(c[o],d,l.parents.concat()),n&&(e.push(n),f.push(n),k[n].children_d.length&&(f=f.concat(k[n].children_d)));for(l.children=e,l.children_d=f,o=0,p=l.parents.length;p>o;o++)k[l.parents[o]].children_d=k[l.parents[o]].children_d.concat(f);q={cnt:j,mod:k,sel:m,par:d,dpc:f,add:g}}return"undefined"!=typeof window&&"undefined"!=typeof window.document?q:void postMessage(q)},i=function(b,c){if(null!==this.element){if(this._cnt=b.cnt,this._model.data=b.mod,c){var e,f,g=b.add,h=b.sel,i=this._data.core.selected.slice(),j=this._model.data;if(h.length!==i.length||a.vakata.array_unique(h.concat(i)).length!==h.length){for(e=0,f=h.length;f>e;e++)-1===a.inArray(h[e],g)&&-1===a.inArray(h[e],i)&&(j[h[e]].state.selected=!1);for(e=0,f=i.length;f>e;e++)-1===a.inArray(i[e],h)&&(j[i[e]].state.selected=!0)}}b.add.length&&(this._data.core.selected=this._data.core.selected.concat(b.add)),this.trigger("model",{nodes:b.dpc,parent:b.par}),b.par!==a.jstree.root?(this._node_changed(b.par),this.redraw()):this.redraw(!0),b.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),d.call(this,!0)}};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+h.toString()],{type:"text/javascript"}))),!this._data.core.working||e?(this._data.core.working=!0,f=new window.Worker(this._wrk),f.onmessage=a.proxy(function(a){i.call(this,a.data,!0);try{f.terminate(),f=null}catch(b){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),g.par?f.postMessage(g):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([b,c,d,!0])}catch(j){i.call(this,h(g),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else i.call(this,h(g),!1)}},_parse_model_from_html:function(c,d,e){e=e?[].concat(e):[],d&&e.unshift(d);var f,g,h=this._model.data,i={id:!1,text:!1,icon:!0,parent:d,parents:e,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},j,k,l;for(j in this._model.default_state)this._model.default_state.hasOwnProperty(j)&&(i.state[j]=this._model.default_state[j]);if(k=a.vakata.attributes(c,!0),a.each(k,function(b,c){return c=a.trim(c),c.length?(i.li_attr[b]=c,void("id"===b&&(i.id=c.toString()))):!0}),k=c.children("a").first(),k.length&&(k=a.vakata.attributes(k,!0),a.each(k,function(b,c){c=a.trim(c),c.length&&(i.a_attr[b]=c)})),k=c.children("a").first().length?c.children("a").first().clone():c.clone(),k.children("ins, i, ul").remove(),k=k.html(),k=a("
      ").html(k),i.text=this.settings.core.force_text?k.text():k.html(),k=c.data(),i.data=k?a.extend(!0,{},k):null,i.state.opened=c.hasClass("jstree-open"),i.state.selected=c.children("a").hasClass("jstree-clicked"),i.state.disabled=c.children("a").hasClass("jstree-disabled"),i.data&&i.data.jstree)for(j in i.data.jstree)i.data.jstree.hasOwnProperty(j)&&(i.state[j]=i.data.jstree[j]);k=c.children("a").children(".jstree-themeicon"),k.length&&(i.icon=k.hasClass("jstree-themeicon-hidden")?!1:k.attr("rel")),i.state.icon!==b&&(i.icon=i.state.icon),(i.icon===b||null===i.icon||""===i.icon)&&(i.icon=!0),k=c.children("ul").children("li");do l="j"+this._id+"_"+ ++this._cnt;while(h[l]);return i.id=i.li_attr.id?i.li_attr.id.toString():l,k.length?(k.each(a.proxy(function(b,c){f=this._parse_model_from_html(a(c),i.id,e),g=this._model.data[f],i.children.push(f),g.children_d.length&&(i.children_d=i.children_d.concat(g.children_d))},this)),i.children_d=i.children_d.concat(i.children)):c.hasClass("jstree-closed")&&(i.state.loaded=!1),i.li_attr["class"]&&(i.li_attr["class"]=i.li_attr["class"].replace("jstree-closed","").replace("jstree-open","")),i.a_attr["class"]&&(i.a_attr["class"]=i.a_attr["class"].replace("jstree-clicked","").replace("jstree-disabled","")),h[i.id]=i,i.state.selected&&this._data.core.selected.push(i.id),i.id},_parse_model_from_flat_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=a.id.toString(),f=this._model.data,g=this._model.default_state,h,i,j,k,l={id:e,text:a.text||"",icon:a.icon!==b?a.icon:!0,parent:c,parents:d,children:a.children||[],children_d:a.children_d||[],data:a.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(h in g)g.hasOwnProperty(h)&&(l.state[h]=g[h]);if(a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(h in a.data.jstree)a.data.jstree.hasOwnProperty(h)&&(l.state[h]=a.data.jstree[h]);if(a&&"object"==typeof a.state)for(h in a.state)a.state.hasOwnProperty(h)&&(l.state[h]=a.state[h]);if(a&&"object"==typeof a.li_attr)for(h in a.li_attr)a.li_attr.hasOwnProperty(h)&&(l.li_attr[h]=a.li_attr[h]);if(l.li_attr.id||(l.li_attr.id=e),a&&"object"==typeof a.a_attr)for(h in a.a_attr)a.a_attr.hasOwnProperty(h)&&(l.a_attr[h]=a.a_attr[h]);for(a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),f[l.id]=l,h=0,i=l.children.length;i>h;h++)j=this._parse_model_from_flat_json(f[l.children[h]],l.id,d),k=f[j],l.children_d.push(j),k.children_d.length&&(l.children_d=l.children_d.concat(k.children_d));return delete a.data,delete a.children,f[l.id].original=a,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_json:function(a,c,d){d=d?d.concat():[],c&&d.unshift(c);var e=!1,f,g,h,i,j=this._model.data,k=this._model.default_state,l;do e="j"+this._id+"_"+ ++this._cnt;while(j[e]);l={id:!1,text:"string"==typeof a?a:"",icon:"object"==typeof a&&a.icon!==b?a.icon:!0,parent:c,parents:d,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(f in k)k.hasOwnProperty(f)&&(l.state[f]=k[f]);if(a&&a.id&&(l.id=a.id.toString()),a&&a.text&&(l.text=a.text),a&&a.data&&a.data.jstree&&a.data.jstree.icon&&(l.icon=a.data.jstree.icon),(l.icon===b||null===l.icon||""===l.icon)&&(l.icon=!0),a&&a.data&&(l.data=a.data,a.data.jstree))for(f in a.data.jstree)a.data.jstree.hasOwnProperty(f)&&(l.state[f]=a.data.jstree[f]);if(a&&"object"==typeof a.state)for(f in a.state)a.state.hasOwnProperty(f)&&(l.state[f]=a.state[f]);if(a&&"object"==typeof a.li_attr)for(f in a.li_attr)a.li_attr.hasOwnProperty(f)&&(l.li_attr[f]=a.li_attr[f]);if(l.li_attr.id&&!l.id&&(l.id=l.li_attr.id.toString()),l.id||(l.id=e),l.li_attr.id||(l.li_attr.id=l.id),a&&"object"==typeof a.a_attr)for(f in a.a_attr)a.a_attr.hasOwnProperty(f)&&(l.a_attr[f]=a.a_attr[f]);if(a&&a.children&&a.children.length){for(f=0,g=a.children.length;g>f;f++)h=this._parse_model_from_json(a.children[f],l.id,d),i=j[h],l.children.push(h),i.children_d.length&&(l.children_d=l.children_d.concat(i.children_d));l.children_d=l.children_d.concat(l.children)}return a&&a.children&&a.children===!0&&(l.state.loaded=!1,l.children=[],l.children_d=[]),delete a.data,delete a.children,l.original=a,j[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_redraw:function(){var b=this._model.force_full_redraw?this._model.data[a.jstree.root].children.concat([]):this._model.changed.concat([]),c=i.createElement("UL"),d,e,f,g=this._data.core.focused;for(e=0,f=b.length;f>e;e++)d=this.redraw_node(b[e],!0,this._model.force_full_redraw),d&&this._model.force_full_redraw&&c.appendChild(d);this._model.force_full_redraw&&(c.className=this.get_container_ul()[0].className,c.setAttribute("role","group"),this.element.empty().append(c)),null!==g&&(d=this.get_node(g,!0),d&&d.length&&d.children(".jstree-anchor")[0]!==i.activeElement?d.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:b})},redraw:function(a){a&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(b){var c=this.get_node(b),d=!1,e=!1,f=!1,g=i;if(!c)return!1;if(c.id===a.jstree.root)return this.redraw(!0);if(b=this.get_node(b,!0),!b||!b.length)return!1;if(b.children(".jstree-children").remove(),b=b[0],c.children.length&&c.state.loaded){for(f=g.createElement("UL"),f.setAttribute("role","group"),f.className="jstree-children",d=0,e=c.children.length;e>d;d++)f.appendChild(this.redraw_node(c.children[d],!0,!0));b.appendChild(f)}},redraw_node:function(b,c,d,e){var f=this.get_node(b),g=!1,h=!1,k=!1,l=!1,m=!1,n=!1,o="",p=i,q=this._model.data,r=!1,s=!1,t=null,u=0,v=0,w=!1,x=!1;if(!f)return!1;if(f.id===a.jstree.root)return this.redraw(!0);if(c=c||0===f.children.length,b=i.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(f.id[0])?"\\3"+f.id[0]+" "+f.id.substr(1).replace(a.jstree.idregex,"\\$&"):f.id.replace(a.jstree.idregex,"\\$&"))):i.getElementById(f.id))b=a(b),d||(g=b.parent().parent()[0],g===this.element[0]&&(g=null),h=b.index()),c||!f.children.length||b.children(".jstree-children").length||(c=!0), -c||(k=b.children(".jstree-children")[0]),r=b.children(".jstree-anchor")[0]===i.activeElement,b.remove();else if(c=!0,!d){if(g=f.parent!==a.jstree.root?a("#"+f.parent.replace(a.jstree.idregex,"\\$&"),this.element)[0]:null,!(null===g||g&&q[f.parent].state.opened))return!1;h=a.inArray(f.id,null===g?q[a.jstree.root].children:q[f.parent].children)}b=j.cloneNode(!0),o="jstree-node ";for(l in f.li_attr)if(f.li_attr.hasOwnProperty(l)){if("id"===l)continue;"class"!==l?b.setAttribute(l,f.li_attr[l]):o+=f.li_attr[l]}for(f.a_attr.id||(f.a_attr.id=f.id+"_anchor"),b.setAttribute("aria-selected",!!f.state.selected),b.setAttribute("aria-level",f.parents.length),b.setAttribute("aria-labelledby",f.a_attr.id),f.state.disabled&&b.setAttribute("aria-disabled",!0),l=0,m=f.children.length;m>l;l++)if(!q[f.children[l]].state.hidden){w=!0;break}if(null!==f.parent&&q[f.parent]&&!f.state.hidden&&(l=a.inArray(f.id,q[f.parent].children),x=f.id,-1!==l))for(l++,m=q[f.parent].children.length;m>l;l++)if(q[q[f.parent].children[l]].state.hidden||(x=q[f.parent].children[l]),x!==f.id)break;f.state.hidden&&(o+=" jstree-hidden"),f.state.loaded&&!w?o+=" jstree-leaf":(o+=f.state.opened&&f.state.loaded?" jstree-open":" jstree-closed",b.setAttribute("aria-expanded",f.state.opened&&f.state.loaded)),x===f.id&&(o+=" jstree-last"),b.id=f.id,b.className=o,o=(f.state.selected?" jstree-clicked":"")+(f.state.disabled?" jstree-disabled":"");for(m in f.a_attr)if(f.a_attr.hasOwnProperty(m)){if("href"===m&&"#"===f.a_attr[m])continue;"class"!==m?b.childNodes[1].setAttribute(m,f.a_attr[m]):o+=" "+f.a_attr[m]}if(o.length&&(b.childNodes[1].className="jstree-anchor "+o),(f.icon&&f.icon!==!0||f.icon===!1)&&(f.icon===!1?b.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===f.icon.indexOf("/")&&-1===f.icon.indexOf(".")?b.childNodes[1].childNodes[0].className+=" "+f.icon+" jstree-themeicon-custom":(b.childNodes[1].childNodes[0].style.backgroundImage="url("+f.icon+")",b.childNodes[1].childNodes[0].style.backgroundPosition="center center",b.childNodes[1].childNodes[0].style.backgroundSize="auto",b.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?b.childNodes[1].appendChild(p.createTextNode(f.text)):b.childNodes[1].innerHTML+=f.text,c&&f.children.length&&(f.state.opened||e)&&f.state.loaded){for(n=p.createElement("UL"),n.setAttribute("role","group"),n.className="jstree-children",l=0,m=f.children.length;m>l;l++)n.appendChild(this.redraw_node(f.children[l],c,!0));b.appendChild(n)}if(k&&b.appendChild(k),!d){for(g||(g=this.element[0]),l=0,m=g.childNodes.length;m>l;l++)if(g.childNodes[l]&&g.childNodes[l].className&&-1!==g.childNodes[l].className.indexOf("jstree-children")){t=g.childNodes[l];break}t||(t=p.createElement("UL"),t.setAttribute("role","group"),t.className="jstree-children",g.appendChild(t)),g=t,hf;f++)this.open_node(c[f],d,e);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?(e=e===b?this.settings.core.animation:e,this.is_closed(c)?this.is_loaded(c)?(h=this.get_node(c,!0),i=this,h.length&&(e&&h.children(".jstree-children").length&&h.children(".jstree-children").stop(!0,!0),c.children.length&&!this._firstChild(h.children(".jstree-children")[0])&&this.draw_children(c),e?(this.trigger("before_open",{node:c}),h.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(e,function(){this.style.display="",i.trigger("after_open",{node:c})})):(this.trigger("before_open",{node:c}),h[0].className=h[0].className.replace("jstree-closed","jstree-open"),h[0].setAttribute("aria-expanded",!0))),c.state.opened=!0,d&&d.call(this,c,!0),h.length||this.trigger("before_open",{node:c}),this.trigger("open_node",{node:c}),e&&h.length||this.trigger("after_open",{node:c}),!0):this.is_loading(c)?setTimeout(a.proxy(function(){this.open_node(c,d,e)},this),500):void this.load_node(c,function(a,b){return b?this.open_node(a,d,e):d?d.call(this,a,!1):!1}):(d&&d.call(this,c,!1),!1)):!1},_open_to:function(b){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var c,d,e=b.parents;for(c=0,d=e.length;d>c;c+=1)c!==a.jstree.root&&this.open_node(e[c],!1,0);return a("#"+b.id.replace(a.jstree.idregex,"\\$&"),this.element)},close_node:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.close_node(c[e],d);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?this.is_closed(c)?!1:(d=d===b?this.settings.core.animation:d,g=this,h=this.get_node(c,!0),h.length&&(d?h.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(d,function(){this.style.display="",h.children(".jstree-children").remove(),g.trigger("after_close",{node:c})}):(h[0].className=h[0].className.replace("jstree-open","jstree-closed"),h.attr("aria-expanded",!1).children(".jstree-children").remove())),c.state.opened=!1,this.trigger("close_node",{node:c}),void(d&&h.length||this.trigger("after_close",{node:c}))):!1},toggle_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.toggle_node(b[c]);return!0}return this.is_closed(b)?this.open_node(b):this.is_open(b)?this.close_node(b):void 0},open_all:function(b,c,d){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var e=b.id===a.jstree.root?this.get_container_ul():this.get_node(b,!0),f,g,h;if(!e.length){for(f=0,g=b.children_d.length;g>f;f++)this.is_closed(this._model.data[b.children_d[f]])&&(this._model.data[b.children_d[f]].state.opened=!0);return this.trigger("open_all",{node:b})}d=d||e,h=this,e=this.is_closed(b)?e.find(".jstree-closed").addBack():e.find(".jstree-closed"),e.each(function(){h.open_node(this,function(a,b){b&&this.is_parent(a)&&this.open_all(a,c,d)},c||0)}),0===d.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(d)})},close_all:function(b,c){if(b||(b=a.jstree.root),b=this.get_node(b),!b)return!1;var d=b.id===a.jstree.root?this.get_container_ul():this.get_node(b,!0),e=this,f,g;for(d.length&&(d=this.is_open(b)?d.find(".jstree-open").addBack():d.find(".jstree-open"),a(d.get().reverse()).each(function(){e.close_node(this,c||0)})),f=0,g=b.children_d.length;g>f;f++)this._model.data[b.children_d[f]].state.opened=!1;this.trigger("close_all",{node:b})},is_disabled:function(a){return a=this.get_node(a),a&&a.state&&a.state.disabled},enable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_node(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.state.disabled=!1,this.get_node(b,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:b})):!1},disable_node:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_node(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.state.disabled=!0,this.get_node(b,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:b})):!1},hide_node:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.hide_node(b[d],!0);return this.redraw(),!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?void(b.state.hidden||(b.state.hidden=!0,this._node_changed(b.parent),c||this.redraw(),this.trigger("hide_node",{node:b}))):!1},show_node:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.show_node(b[d],!0);return this.redraw(),!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?void(b.state.hidden&&(b.state.hidden=!1,this._node_changed(b.parent),c||this.redraw(),this.trigger("show_node",{node:b}))):!1},hide_all:function(b){var c,d=this._model.data,e=[];for(c in d)d.hasOwnProperty(c)&&c!==a.jstree.root&&!d[c].state.hidden&&(d[c].state.hidden=!0,e.push(c));return this._model.force_full_redraw=!0,b||this.redraw(),this.trigger("hide_all",{nodes:e}),e},show_all:function(b){var c,d=this._model.data,e=[];for(c in d)d.hasOwnProperty(c)&&c!==a.jstree.root&&d[c].state.hidden&&(d[c].state.hidden=!1,e.push(c));return this._model.force_full_redraw=!0,b||this.redraw(),this.trigger("show_all",{nodes:e}),e},activate_node:function(a,c){if(this.is_disabled(a))return!1;if(c&&"object"==typeof c||(c={}),this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==b?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&(!c.shiftKey||this._data.core.last_clicked&&this.get_parent(a)&&this.get_parent(a)===this._data.core.last_clicked.parent))if(c.shiftKey){var d=this.get_node(a).id,e=this._data.core.last_clicked.id,f=this.get_node(this._data.core.last_clicked.parent).children,g=!1,h,i;for(h=0,i=f.length;i>h;h+=1)f[h]===d&&(g=!g),f[h]===e&&(g=!g),this.is_disabled(f[h])||!g&&f[h]!==d&&f[h]!==e?this.deselect_node(f[h],!0,c):this.select_node(f[h],!0,!1,c);this.trigger("changed",{action:"select_node",node:this.get_node(a),selected:this._data.core.selected,event:c})}else this.is_selected(a)?this.deselect_node(a,!1,c):this.select_node(a,!1,!1,c);else!this.settings.core.multiple&&(c.metaKey||c.ctrlKey||c.shiftKey)&&this.is_selected(a)?this.deselect_node(a,!1,c):(this.deselect_all(!0),this.select_node(a,!1,!1,c),this._data.core.last_clicked=this.get_node(a));this.trigger("activate_node",{node:this.get_node(a),event:c})},hover_node:function(a){if(a=this.get_node(a,!0),!a||!a.length||a.children(".jstree-hovered").length)return!1;var b=this.element.find(".jstree-hovered"),c=this.element;b&&b.length&&this.dehover_node(b),a.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(a)}),setTimeout(function(){c.attr("aria-activedescendant",a[0].id)},0)},dehover_node:function(a){return a=this.get_node(a,!0),a&&a.length&&a.children(".jstree-hovered").length?(a.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(a)})):!1},select_node:function(b,c,d,e){var f,g,h,i;if(a.isArray(b)){for(b=b.slice(),g=0,h=b.length;h>g;g++)this.select_node(b[g],c,d,e);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=this.get_node(b,!0),void(b.state.selected||(b.state.selected=!0,this._data.core.selected.push(b.id),d||(f=this._open_to(b)),f&&f.length&&f.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:b,selected:this._data.core.selected,event:e}),c||this.trigger("changed",{action:"select_node",node:b,selected:this._data.core.selected,event:e})))):!1},deselect_node:function(b,c,d){var e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.deselect_node(b[e],c,d);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(g=this.get_node(b,!0),void(b.state.selected&&(b.state.selected=!1,this._data.core.selected=a.vakata.array_remove_item(this._data.core.selected,b.id),g.length&&g.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:b,selected:this._data.core.selected,event:d}),c||this.trigger("changed",{action:"deselect_node",node:b,selected:this._data.core.selected,event:d})))):!1},select_all:function(b){var c=this._data.core.selected.concat([]),d,e;for(this._data.core.selected=this._model.data[a.jstree.root].children_d.concat(),d=0,e=this._data.core.selected.length;e>d;d++)this._model.data[this._data.core.selected[d]]&&(this._model.data[this._data.core.selected[d]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),b||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:c})},deselect_all:function(a){var b=this._data.core.selected.concat([]),c,d;for(c=0,d=this._data.core.selected.length;d>c;c++)this._model.data[this._data.core.selected[c]]&&(this._model.data[this._data.core.selected[c]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:b}),a||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:b})},is_selected:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.state.selected:!1},get_selected:function(b){return b?a.map(this._data.core.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.core.selected.slice()},get_top_selected:function(b){var c=this.get_selected(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},get_bottom_selected:function(b){var c=this.get_selected(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},get_state:function(){var b={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}},c;for(c in this._model.data)this._model.data.hasOwnProperty(c)&&c!==a.jstree.root&&(this._model.data[c].state.opened&&b.core.open.push(c),this._model.data[c].state.selected&&b.core.selected.push(c));return b},set_state:function(c,d){if(c){if(c.core){var e,f,g,h,i;if(c.core.open)return a.isArray(c.core.open)&&c.core.open.length?this._load_nodes(c.core.open,function(a){this.open_node(a,!1,0),delete c.core.open,this.set_state(c,d)},!0):(delete c.core.open,this.set_state(c,d)),!1;if(c.core.scroll)return c.core.scroll&&c.core.scroll.left!==b&&this.element.scrollLeft(c.core.scroll.left),c.core.scroll&&c.core.scroll.top!==b&&this.element.scrollTop(c.core.scroll.top),delete c.core.scroll,this.set_state(c,d),!1;if(c.core.selected)return h=this,this.deselect_all(),a.each(c.core.selected,function(a,b){h.select_node(b,!1,!0)}),delete c.core.selected,this.set_state(c,d),!1;for(i in c)c.hasOwnProperty(i)&&"core"!==i&&-1===a.inArray(i,this.settings.plugins)&&delete c[i];if(a.isEmptyObject(c.core))return delete c.core,this.set_state(c,d),!1}return a.isEmptyObject(c)?(c=null,d&&d.call(this),this.trigger("set_state"),!1):!0}return!1},refresh:function(b,c){this._data.core.state=c===!0?{}:this.get_state(),c&&a.isFunction(c)&&(this._data.core.state=c.call(this,this._data.core.state)),this._cnt=0,this._model.data={},this._model.data[a.jstree.root]={id:a.jstree.root,parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}},this._data.core.selected=[],this._data.core.last_clicked=null,this._data.core.focused=null;var d=this.get_container_ul()[0].className;b||(this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node(a.jstree.root,function(b,c){c&&(this.get_container_ul()[0].className=d,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(a.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(b){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var c=[],d=[],e=this._data.core.selected.concat([]);d.push(b.id),b.state.opened===!0&&c.push(b.id),this.get_node(b,!0).find(".jstree-open").each(function(){c.push(this.id)}),this._load_nodes(d,a.proxy(function(a){this.open_node(c,!1,0),this.select_node(this._data.core.selected),this.trigger("refresh_node",{node:b,nodes:a})},this))},set_id:function(b,c){if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;var d,e,f=this._model.data;for(c=c.toString(),f[b.parent].children[a.inArray(b.id,f[b.parent].children)]=c,d=0,e=b.parents.length;e>d;d++)f[b.parents[d]].children_d[a.inArray(b.id,f[b.parents[d]].children_d)]=c;for(d=0,e=b.children.length;e>d;d++)f[b.children[d]].parent=c;for(d=0,e=b.children_d.length;e>d;d++)f[b.children_d[d]].parents[a.inArray(b.id,f[b.children_d[d]].parents)]=c;return d=a.inArray(b.id,this._data.core.selected),-1!==d&&(this._data.core.selected[d]=c),d=this.get_node(b.id,!0),d&&(d.attr("id",c).children(".jstree-anchor").attr("id",c+"_anchor").end().attr("aria-labelledby",c+"_anchor"),this.element.attr("aria-activedescendant")===b.id&&this.element.attr("aria-activedescendant",c)),delete f[b.id],b.id=c,b.li_attr.id=c,f[c]=b,!0},get_text:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.text:!1},set_text:function(b,c){var d,e;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.set_text(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(b.text=c,this.get_node(b,!0).length&&this.redraw_node(b.id),this.trigger("set_text",{obj:b,text:c}),!0):!1},get_json:function(b,c,d){if(b=this.get_node(b||a.jstree.root),!b)return!1;c&&c.flat&&!d&&(d=[]);var e={id:b.id,text:b.text,icon:this.get_icon(b),li_attr:a.extend(!0,{},b.li_attr),a_attr:a.extend(!0,{},b.a_attr),state:{},data:c&&c.no_data?!1:a.extend(!0,{},b.data)},f,g;if(c&&c.flat?e.parent=b.parent:e.children=[],!c||!c.no_state)for(f in b.state)b.state.hasOwnProperty(f)&&(e.state[f]=b.state[f]);if(c&&c.no_id&&(delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id),c&&c.flat&&b.id!==a.jstree.root&&d.push(e),!c||!c.no_children)for(f=0,g=b.children.length;g>f;f++)c&&c.flat?this.get_json(b.children[f],c,d):e.children.push(this.get_json(b.children[f],c));return c&&c.flat?d:b.id===a.jstree.root?e.children:e},create_node:function(c,d,e,f,g){if(null===c&&(c=a.jstree.root),c=this.get_node(c),!c)return!1;if(e=e===b?"last":e,!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(c))return this.load_node(c,function(){this.create_node(c,d,e,f,!0)});d||(d={text:this.get_string("New node")}),"string"==typeof d&&(d={text:d}),d.text===b&&(d.text=this.get_string("New node"));var h,i,j,k;switch(c.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":h=this.get_node(c.parent),e=a.inArray(c.id,h.children),c=h;break;case"after":h=this.get_node(c.parent),e=a.inArray(c.id,h.children)+1,c=h;break;case"inside":case"first":e=0;break;case"last":e=c.children.length;break;default:e||(e=0)}if(e>c.children.length&&(e=c.children.length),d.id||(d.id=!0),!this.check("create_node",d,c,e))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(d.id===!0&&delete d.id,d=this._parse_model_from_json(d,c.id,c.parents.concat()),!d)return!1;for(h=this.get_node(d),i=[],i.push(d),i=i.concat(h.children_d),this.trigger("model",{nodes:i,parent:c.id}),c.children_d=c.children_d.concat(i),j=0,k=c.parents.length;k>j;j++)this._model.data[c.parents[j]].children_d=this._model.data[c.parents[j]].children_d.concat(i);for(d=h,h=[],j=0,k=c.children.length;k>j;j++)h[j>=e?j+1:j]=c.children[j];return h[e]=d.id,c.children=h,this.redraw_node(c,!0),f&&f.call(this,this.get_node(d)),this.trigger("create_node",{node:this.get_node(d),parent:c.id,position:e}),d.id},rename_node:function(b,c){var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.rename_node(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=b.text,this.check("rename_node",b,this.get_parent(b),c)?(this.set_text(b,c),this.trigger("rename_node",{node:b,text:c,old:f}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1)):!1},delete_node:function(b){var c,d,e,f,g,h,i,j,k,l,m,n;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.delete_node(b[c]);return!0}if(b=this.get_node(b),!b||b.id===a.jstree.root)return!1;if(e=this.get_node(b.parent),f=a.inArray(b.id,e.children),l=!1,!this.check("delete_node",b,e,f))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==f&&(e.children=a.vakata.array_remove(e.children,f)),g=b.children_d.concat([]),g.push(b.id),j=0,k=g.length;k>j;j++){for(h=0,i=b.parents.length;i>h;h++)f=a.inArray(g[j],this._model.data[b.parents[h]].children_d),-1!==f&&(this._model.data[b.parents[h]].children_d=a.vakata.array_remove(this._model.data[b.parents[h]].children_d,f));this._model.data[g[j]].state.selected&&(l=!0,f=a.inArray(g[j],this._data.core.selected),-1!==f&&(this._data.core.selected=a.vakata.array_remove(this._data.core.selected,f)))}for(this.trigger("delete_node",{node:b,parent:e.id}),l&&this.trigger("changed",{action:"delete_node",node:b,selected:this._data.core.selected,parent:e.id}),j=0,k=g.length;k>j;j++)delete this._model.data[g[j]];return-1!==a.inArray(this._data.core.focused,g)&&(this._data.core.focused=null,m=this.element[0].scrollTop,n=this.element[0].scrollLeft,e.id===a.jstree.root?this.get_node(this._model.data[a.jstree.root].children[0],!0).children(".jstree-anchor").focus():this.get_node(e,!0).children(".jstree-anchor").focus(),this.element[0].scrollTop=m,this.element[0].scrollLeft=n),this.redraw_node(e,!0),!0},check:function(b,c,d,e,f){c=c&&c.id?c:this.get_node(c),d=d&&d.id?d:this.get_node(d);var g=b.match(/^move_node|copy_node|create_node$/i)?d:c,h=this.settings.core.check_callback;return"move_node"!==b&&"copy_node"!==b||f&&f.is_multi||c.id!==d.id&&a.inArray(c.id,d.children)!==e&&-1===a.inArray(d.id,c.children_d)?(g&&g.data&&(g=g.data),g&&g.functions&&(g.functions[b]===!1||g.functions[b]===!0)?(g.functions[b]===!1&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})}),g.functions[b]):h===!1||a.isFunction(h)&&h.call(this,b,c,d,e,f)===!1||h&&h[b]===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+b,data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1):!0):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:b,pos:e,obj:c&&c.id?c.id:!1,par:d&&d.id?d.id:!1})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t,u,v,w;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.move_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(r=this.move_node(c[j],d,e,f,g,!1,i))&&(d=r,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||c.id===a.jstree.root)return!1;if(l=(c.parent||a.jstree.root).toString(),n=e.toString().match(/^(before|after)$/)&&d.id!==a.jstree.root?this.get_node(d.parent):d,o=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),p=!o||!o._id||this._id!==o._id,m=o&&o._id&&l&&o._model.data[l]&&o._model.data[l].children?a.inArray(c.id,o._model.data[l].children):-1,o&&o._id&&(c=o._model.data[c.id]),p)return(r=this.copy_node(c,d,e,f,g,!1,i))?(o&&o.delete_node(c),r):!1;switch(d.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,n.children);break;case"after":e=a.inArray(d.id,n.children)+1;break;case"inside":case"first":e=0;break;case"last":e=n.children.length;break;default:e||(e=0)}if(e>n.children.length&&(e=n.children.length),!this.check("move_node",c,n,e,{core:!0,origin:i,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(c.parent===n.id){for(q=n.children.concat(),r=a.inArray(c.id,q),-1!==r&&(q=a.vakata.array_remove(q,r),e>r&&e--),r=[],s=0,t=q.length;t>s;s++)r[s>=e?s+1:s]=q[s];r[e]=c.id,n.children=r,this._node_changed(n.id),this.redraw(n.id===a.jstree.root)}else{for(r=c.children_d.concat(),r.push(c.id),s=0,t=c.parents.length;t>s;s++){for(q=[],w=o._model.data[c.parents[s]].children_d,u=0,v=w.length;v>u;u++)-1===a.inArray(w[u],r)&&q.push(w[u]);o._model.data[c.parents[s]].children_d=q}for(o._model.data[l].children=a.vakata.array_remove_item(o._model.data[l].children,c.id),s=0,t=n.parents.length;t>s;s++)this._model.data[n.parents[s]].children_d=this._model.data[n.parents[s]].children_d.concat(r);for(q=[],s=0,t=n.children.length;t>s;s++)q[s>=e?s+1:s]=n.children[s];for(q[e]=c.id,n.children=q,n.children_d.push(c.id),n.children_d=n.children_d.concat(c.children_d),c.parent=n.id,r=n.parents.concat(),r.unshift(n.id),w=c.parents.length,c.parents=r,r=r.concat(),s=0,t=c.children_d.length;t>s;s++)this._model.data[c.children_d[s]].parents=this._model.data[c.children_d[s]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[c.children_d[s]].parents,r);(l===a.jstree.root||n.id===a.jstree.root)&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(l),this._node_changed(n.id)),h||this.redraw()}return f&&f.call(this,c,n,e),this.trigger("move_node",{node:c,parent:n.id,position:e,old_parent:l,old_position:m,is_multi:o&&o._id&&o._id!==this._id,is_foreign:!o||!o._id,old_instance:o,new_instance:this}),c.id},copy_node:function(c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t;if(d=this.get_node(d),e=e===b?0:e,!d)return!1;if(!e.toString().match(/^(before|after)$/)&&!g&&!this.is_loaded(d))return this.load_node(d,function(){this.copy_node(c,d,e,f,!0,!1,i)});if(a.isArray(c)){if(1!==c.length){for(j=0,k=c.length;k>j;j++)(m=this.copy_node(c[j],d,e,f,g,!0,i))&&(d=m,e="after");return this.redraw(),!0}c=c[0]}if(c=c&&c.id?c:this.get_node(c),!c||c.id===a.jstree.root)return!1;switch(q=(c.parent||a.jstree.root).toString(),r=e.toString().match(/^(before|after)$/)&&d.id!==a.jstree.root?this.get_node(d.parent):d,s=i?i:this._model.data[c.id]?this:a.jstree.reference(c.id),t=!s||!s._id||this._id!==s._id,s&&s._id&&(c=s._model.data[c.id]),d.id===a.jstree.root&&("before"===e&&(e="first"),"after"===e&&(e="last")),e){case"before":e=a.inArray(d.id,r.children);break;case"after":e=a.inArray(d.id,r.children)+1;break;case"inside":case"first":e=0;break;case"last":e=r.children.length;break;default:e||(e=0)}if(e>r.children.length&&(e=r.children.length),!this.check("copy_node",c,r,e,{core:!0,origin:i,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(p=s?s.get_json(c,{no_id:!0,no_data:!0,no_state:!0}):c,!p)return!1;if(p.id===!0&&delete p.id,p=this._parse_model_from_json(p,r.id,r.parents.concat()),!p)return!1;for(m=this.get_node(p),c&&c.state&&c.state.loaded===!1&&(m.state.loaded=!1),l=[],l.push(p),l=l.concat(m.children_d),this.trigger("model",{nodes:l,parent:r.id}),n=0,o=r.parents.length;o>n;n++)this._model.data[r.parents[n]].children_d=this._model.data[r.parents[n]].children_d.concat(l);for(l=[],n=0,o=r.children.length;o>n;n++)l[n>=e?n+1:n]=r.children[n];return l[e]=m.id,r.children=l,r.children_d.push(m.id),r.children_d=r.children_d.concat(m.children_d),r.id===a.jstree.root&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(r.id),h||this.redraw(r.id===a.jstree.root),f&&f.call(this,m,r,e),this.trigger("copy_node",{node:m,original:c,parent:r.id,position:e,old_parent:q,old_position:s&&s._id&&q&&s._model.data[q]&&s._model.data[q].children?a.inArray(c.id,s._model.data[q].children):-1,is_multi:s&&s._id&&s._id!==this._id,is_foreign:!s||!s._id,old_instance:s,new_instance:this}),m.id},cut:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&g.id!==a.jstree.root&&c.push(g);return c.length?(d=c,f=this,e="move_node",void this.trigger("cut",{node:b})):!1},copy:function(b){if(b||(b=this._data.core.selected.concat()),a.isArray(b)||(b=[b]),!b.length)return!1;var c=[],g,h,i;for(h=0,i=b.length;i>h;h++)g=this.get_node(b[h]),g&&g.id&&g.id!==a.jstree.root&&c.push(g);return c.length?(d=c,f=this,e="copy_node",void this.trigger("copy",{node:b})):!1},get_buffer:function(){return{mode:e,node:d,inst:f}},can_paste:function(){return e!==!1&&d!==!1},paste:function(a,b){return a=this.get_node(a),a&&e&&e.match(/^(copy_node|move_node)$/)&&d?(this[e](d,a,b,!1,!1,!1,f)&&this.trigger("paste",{parent:a.id,node:d,mode:e}),d=!1,e=!1,void(f=!1)):!1},clear_buffer:function(){d=!1,e=!1,f=!1,this.trigger("clear_buffer")},edit:function(b,c,d){var e,f,g,h,i,j,k,l,m,n=!1;return(b=this.get_node(b))?this.settings.core.check_callback===!1?(this._data.core.last_error={error:"check",plugin:"core",id:"core_07",reason:"Could not edit node because of check_callback"},this.settings.core.error.call(this,this._data.core.last_error),!1):(m=b,c="string"==typeof c?c:b.text,this.set_text(b,""),b=this._open_to(b),m.text=c,e=this._data.core.rtl,f=this.element.width(),this._data.core.focused=m.id,g=b.children(".jstree-anchor").focus(),h=a(""),i=c,j=a("
      ",{css:{position:"absolute",top:"-200px",left:e?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),k=a("",{value:i,"class":"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:a.proxy(function(c){c.stopImmediatePropagation(),c.preventDefault();var e=h.children(".jstree-rename-input"),f=e.val(),k=this.settings.core.force_text,l;""===f&&(f=i),j.remove(),h.replaceWith(g),h.remove(),i=k?i:a("
      ").append(a.parseHTML(i)).html(),this.set_text(b,i),l=!!this.rename_node(b,k?a("
      ").text(f).text():a("
      ").append(a.parseHTML(f)).html()),l||this.set_text(b,i),this._data.core.focused=m.id,setTimeout(a.proxy(function(){var a=this.get_node(m.id,!0);a.length&&(this._data.core.focused=m.id,a.children(".jstree-anchor").focus())},this),0),d&&d.call(this,m,l,n)},this),keydown:function(a){var b=a.which;27===b&&(n=!0,this.value=i),(27===b||13===b||37===b||38===b||39===b||40===b||32===b)&&a.stopImmediatePropagation(),(27===b||13===b)&&(a.preventDefault(),this.blur())},click:function(a){a.stopImmediatePropagation()},mousedown:function(a){a.stopImmediatePropagation()},keyup:function(a){k.width(Math.min(j.text("pW"+this.value).width(),f))},keypress:function(a){return 13===a.which?!1:void 0}}),l={fontFamily:g.css("fontFamily")||"",fontSize:g.css("fontSize")||"",fontWeight:g.css("fontWeight")||"",fontStyle:g.css("fontStyle")||"",fontStretch:g.css("fontStretch")||"",fontVariant:g.css("fontVariant")||"",letterSpacing:g.css("letterSpacing")||"",wordSpacing:g.css("wordSpacing")||""},h.attr("class",g.attr("class")).append(g.contents().clone()).append(k),g.replaceWith(h),j.css(l),void k.css(l).width(Math.min(j.text("pW"+k[0].value).width(),f))[0].select()):!1},set_theme:function(b,c){if(!b)return!1;if(c===!0){var d=this.settings.core.themes.dir;d||(d=a.jstree.path+"/themes"),c=d+"/"+b+"/style.css"}c&&-1===a.inArray(c,g)&&(a("head").append(''),g.push(c)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name), -this._data.core.themes.name=b,this.element.addClass("jstree-"+b),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+b+"-responsive"),this.trigger("set_theme",{theme:b})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(a){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=a,a&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(c,d){var e,f,g,h;if(a.isArray(c)){for(c=c.slice(),e=0,f=c.length;f>e;e++)this.set_icon(c[e],d);return!0}return c=this.get_node(c),c&&c.id!==a.jstree.root?(h=c.icon,c.icon=d===!0||null===d||d===b||""===d?!0:d,g=this.get_node(c,!0).children(".jstree-anchor").children(".jstree-themeicon"),d===!1?this.hide_icon(c):d===!0||null===d||d===b||""===d?(g.removeClass("jstree-themeicon-custom "+h).css("background","").removeAttr("rel"),h===!1&&this.show_icon(c)):-1===d.indexOf("/")&&-1===d.indexOf(".")?(g.removeClass(h).css("background",""),g.addClass(d+" jstree-themeicon-custom").attr("rel",d),h===!1&&this.show_icon(c)):(g.removeClass(h).css("background",""),g.addClass("jstree-themeicon-custom").css("background","url('"+d+"') center center no-repeat").attr("rel",d),h===!1&&this.show_icon(c)),!0):!1},get_icon:function(b){return b=this.get_node(b),b&&b.id!==a.jstree.root?b.icon:!1},hide_icon:function(b){var c,d;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.hide_icon(b[c]);return!0}return b=this.get_node(b),b&&b!==a.jstree.root?(b.icon=!1,this.get_node(b,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0):!1},show_icon:function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.show_icon(b[c]);return!0}return b=this.get_node(b),b&&b!==a.jstree.root?(e=this.get_node(b,!0),b.icon=e.length?e.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"):!0,b.icon||(b.icon=!0),e.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0):!1}},a.vakata={},a.vakata.attributes=function(b,c){b=a(b)[0];var d=c?{}:[];return b&&b.attributes&&a.each(b.attributes,function(b,e){-1===a.inArray(e.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==e.value&&""!==a.trim(e.value)&&(c?d[e.name]=e.value:d.push(e.name))}),d},a.vakata.array_unique=function(a){var c=[],d,e,f,g={};for(d=0,f=a.length;f>d;d++)g[a[d]]===b&&(c.push(a[d]),g[a[d]]=!0);return c},a.vakata.array_remove=function(a,b,c){var d=a.slice((c||b)+1||a.length);return a.length=0>b?a.length+b:b,a.push.apply(a,d),a},a.vakata.array_remove_item=function(b,c){var d=a.inArray(c,b);return-1!==d?a.vakata.array_remove(b,d):b},a.jstree.plugins.changed=function(a,b){var c=[];this.trigger=function(a,d){var e,f;if(d||(d={}),"changed"===a.replace(".jstree","")){d.changed={selected:[],deselected:[]};var g={};for(e=0,f=c.length;f>e;e++)g[c[e]]=1;for(e=0,f=d.selected.length;f>e;e++)g[d.selected[e]]?g[d.selected[e]]=2:d.changed.selected.push(d.selected[e]);for(e=0,f=c.length;f>e;e++)1===g[c[e]]&&d.changed.deselected.push(c[e]);c=d.selected.slice()}b.trigger.call(this,a,d)},this.refresh=function(a,d){return c=[],b.refresh.apply(this,arguments)}};var m=i.createElement("I");m.className="jstree-icon jstree-checkbox",m.setAttribute("role","presentation"),a.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0},a.jstree.plugins.checkbox=function(c,d){this.bind=function(){d.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",a.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",a.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",a.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",a.proxy(function(a,b){var c=this._model.data,d=c[b.parent],e=b.nodes,f,g;for(f=0,g=e.length;g>f;f++)c[e[f]].state.checked=c[e[f]].state.checked||c[e[f]].original&&c[e[f]].original.state&&c[e[f]].original.state.checked,c[e[f]].state.checked&&this._data.checkbox.selected.push(e[f])},this)),(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",a.proxy(function(b,c){var d=this._model.data,e=d[c.parent],f=c.nodes,g=[],h,i,j,k,l,m,n=this.settings.checkbox.cascade,o=this.settings.checkbox.tie_selection;if(-1!==n.indexOf("down"))if(e.state[o?"selected":"checked"]){for(i=0,j=f.length;j>i;i++)d[f[i]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(f)}else for(i=0,j=f.length;j>i;i++)if(d[f[i]].state[o?"selected":"checked"]){for(k=0,l=d[f[i]].children_d.length;l>k;k++)d[d[f[i]].children_d[k]].state[o?"selected":"checked"]=!0;this._data[o?"core":"checkbox"].selected=this._data[o?"core":"checkbox"].selected.concat(d[f[i]].children_d)}if(-1!==n.indexOf("up")){for(i=0,j=e.children_d.length;j>i;i++)d[e.children_d[i]].children.length||g.push(d[e.children_d[i]].parent);for(g=a.vakata.array_unique(g),k=0,l=g.length;l>k;k++){e=d[g[k]];while(e&&e.id!==a.jstree.root){for(h=0,i=0,j=e.children.length;j>i;i++)h+=d[e.children[i]].state[o?"selected":"checked"];if(h!==j)break;e.state[o?"selected":"checked"]=!0,this._data[o?"core":"checkbox"].selected.push(e.id),m=this.get_node(e,!0),m&&m.length&&m.attr("aria-selected",!0).children(".jstree-anchor").addClass(o?"jstree-clicked":"jstree-checked"),e=this.get_node(e.parent)}}}this._data[o?"core":"checkbox"].selected=a.vakata.array_unique(this._data[o?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",a.proxy(function(b,c){var d=c.node,e=this._model.data,f=this.get_node(d.parent),g=this.get_node(d,!0),h,i,j,k,l=this.settings.checkbox.cascade,m=this.settings.checkbox.tie_selection;if(-1!==l.indexOf("down"))for(this._data[m?"core":"checkbox"].selected=a.vakata.array_unique(this._data[m?"core":"checkbox"].selected.concat(d.children_d)),h=0,i=d.children_d.length;i>h;h++)k=e[d.children_d[h]],k.state[m?"selected":"checked"]=!0,k&&k.original&&k.original.state&&k.original.state.undetermined&&(k.original.state.undetermined=!1);if(-1!==l.indexOf("up"))while(f&&f.id!==a.jstree.root){for(j=0,h=0,i=f.children.length;i>h;h++)j+=e[f.children[h]].state[m?"selected":"checked"];if(j!==i)break;f.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(f.id),k=this.get_node(f,!0),k&&k.length&&k.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),f=this.get_node(f.parent)}-1!==l.indexOf("down")&&g.length&&g.find(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!0)},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",a.proxy(function(b,c){var d=this.get_node(a.jstree.root),e=this._model.data,f,g,h;for(f=0,g=d.children_d.length;g>f;f++)h=e[d.children_d[f]],h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",a.proxy(function(b,c){var d=c.node,e=this.get_node(d,!0),f,g,h,i=this.settings.checkbox.cascade,j=this.settings.checkbox.tie_selection;if(d&&d.original&&d.original.state&&d.original.state.undetermined&&(d.original.state.undetermined=!1),-1!==i.indexOf("down"))for(f=0,g=d.children_d.length;g>f;f++)h=this._model.data[d.children_d[f]],h.state[j?"selected":"checked"]=!1,h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1);if(-1!==i.indexOf("up"))for(f=0,g=d.parents.length;g>f;f++)h=this._model.data[d.parents[f]],h.state[j?"selected":"checked"]=!1,h&&h.original&&h.original.state&&h.original.state.undetermined&&(h.original.state.undetermined=!1),h=this.get_node(d.parents[f],!0),h&&h.length&&h.attr("aria-selected",!1).children(".jstree-anchor").removeClass(j?"jstree-clicked":"jstree-checked");for(h=[],f=0,g=this._data[j?"core":"checkbox"].selected.length;g>f;f++)-1!==i.indexOf("down")&&-1!==a.inArray(this._data[j?"core":"checkbox"].selected[f],d.children_d)||-1!==i.indexOf("up")&&-1!==a.inArray(this._data[j?"core":"checkbox"].selected[f],d.parents)||h.push(this._data[j?"core":"checkbox"].selected[f]);this._data[j?"core":"checkbox"].selected=a.vakata.array_unique(h),-1!==i.indexOf("down")&&e.length&&e.find(".jstree-anchor").removeClass(j?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!1)},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",a.proxy(function(b,c){var d=this.get_node(c.parent),e=this._model.data,f,g,h,i,j=this.settings.checkbox.tie_selection;while(d&&d.id!==a.jstree.root&&!d.state[j?"selected":"checked"]){for(h=0,f=0,g=d.children.length;g>f;f++)h+=e[d.children[f]].state[j?"selected":"checked"];if(!(g>0&&h===g))break;d.state[j?"selected":"checked"]=!0,this._data[j?"core":"checkbox"].selected.push(d.id),i=this.get_node(d,!0),i&&i.length&&i.attr("aria-selected",!0).children(".jstree-anchor").addClass(j?"jstree-clicked":"jstree-checked"),d=this.get_node(d.parent)}},this)).on("move_node.jstree",a.proxy(function(b,c){var d=c.is_multi,e=c.old_parent,f=this.get_node(c.parent),g=this._model.data,h,i,j,k,l,m=this.settings.checkbox.tie_selection;if(!d){h=this.get_node(e);while(h&&h.id!==a.jstree.root&&!h.state[m?"selected":"checked"]){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(!(k>0&&i===k))break;h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"),h=this.get_node(h.parent)}}h=f;while(h&&h.id!==a.jstree.root){for(i=0,j=0,k=h.children.length;k>j;j++)i+=g[h.children[j]].state[m?"selected":"checked"];if(i===k)h.state[m?"selected":"checked"]||(h.state[m?"selected":"checked"]=!0,this._data[m?"core":"checkbox"].selected.push(h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!0).children(".jstree-anchor").addClass(m?"jstree-clicked":"jstree-checked"));else{if(!h.state[m?"selected":"checked"])break;h.state[m?"selected":"checked"]=!1,this._data[m?"core":"checkbox"].selected=a.vakata.array_remove_item(this._data[m?"core":"checkbox"].selected,h.id),l=this.get_node(h,!0),l&&l.length&&l.attr("aria-selected",!1).children(".jstree-anchor").removeClass(m?"jstree-clicked":"jstree-checked")}h=this.get_node(h.parent)}},this))},this._undetermined=function(){if(null!==this.element){var c,d,e,f,g={},h=this._model.data,i=this.settings.checkbox.tie_selection,j=this._data[i?"core":"checkbox"].selected,k=[],l=this;for(c=0,d=j.length;d>c;c++)if(h[j[c]]&&h[j[c]].parents)for(e=0,f=h[j[c]].parents.length;f>e;e++)g[h[j[c]].parents[e]]===b&&h[j[c]].parents[e]!==a.jstree.root&&(g[h[j[c]].parents[e]]=!0,k.push(h[j[c]].parents[e]));for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var i=l.get_node(this),j;if(i.state.loaded){for(c=0,d=i.children_d.length;d>c;c++)if(j=h[i.children_d[c]],!j.state.loaded&&j.original&&j.original.state&&j.original.state.undetermined&&j.original.state.undetermined===!0)for(g[j.id]===b&&j.id!==a.jstree.root&&(g[j.id]=!0,k.push(j.id)),e=0,f=j.parents.length;f>e;e++)g[j.parents[e]]===b&&j.parents[e]!==a.jstree.root&&(g[j.parents[e]]=!0,k.push(j.parents[e]))}else if(i.original&&i.original.state&&i.original.state.undetermined&&i.original.state.undetermined===!0)for(g[i.id]===b&&i.id!==a.jstree.root&&(g[i.id]=!0,k.push(i.id)),e=0,f=i.parents.length;f>e;e++)g[i.parents[e]]===b&&i.parents[e]!==a.jstree.root&&(g[i.parents[e]]=!0,k.push(i.parents[e]))}),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),c=0,d=k.length;d>c;c++)h[k[c]].state[i?"selected":"checked"]||(j=this.get_node(k[c],!0),j&&j.length&&j.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined"))}},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments)){var g,h,i=null,j=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(!this.settings.checkbox.tie_selection&&this._model.data[b.id].state.checked&&(i.className+=" jstree-checked"),j=m.cloneNode(!1),this._model.data[b.id].state.checkbox_disabled&&(j.className+=" jstree-checkbox-disabled"),i.insertBefore(j,i.childNodes[0]))}return e||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(a.proxy(this._undetermined,this),50)),b},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(b){b=this.get_node(b);var c=this.settings.checkbox.cascade,d,e,f=this.settings.checkbox.tie_selection,g=this._data[f?"core":"checkbox"].selected,h=this._model.data;if(!b||b.state[f?"selected":"checked"]===!0||-1===c.indexOf("undetermined")||-1===c.indexOf("down")&&-1===c.indexOf("up"))return!1;if(!b.state.loaded&&b.original.state.undetermined===!0)return!0;for(d=0,e=b.children_d.length;e>d;d++)if(-1!==a.inArray(b.children_d[d],g)||!h[b.children_d[d]].state.loaded&&h[b.children_d[d]].original.state.undetermined)return!0;return!1},this.disable_checkbox=function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.disable_checkbox(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(e=this.get_node(b,!0),void(b.state.checkbox_disabled||(b.state.checkbox_disabled=!0,e&&e.length&&e.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-checkbox-disabled"),this.trigger("disable_checkbox",{node:b})))):!1},this.enable_checkbox=function(b){var c,d,e;if(a.isArray(b)){for(b=b.slice(),c=0,d=b.length;d>c;c++)this.enable_checkbox(b[c]);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(e=this.get_node(b,!0),void(b.state.checkbox_disabled&&(b.state.checkbox_disabled=!1,e&&e.length&&e.children(".jstree-anchor").children(".jstree-checkbox").removeClass("jstree-checkbox-disabled"),this.trigger("enable_checkbox",{node:b})))):!1},this.activate_node=function(b,c){return a(c.target).hasClass("jstree-checkbox-disabled")?!1:(this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||a(c.target).hasClass("jstree-checkbox"))&&(c.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!a(c.target).hasClass("jstree-checkbox")?d.activate_node.call(this,b,c):this.is_disabled(b)?!1:(this.is_checked(b)?this.uncheck_node(b,c):this.check_node(b,c),void this.trigger("activate_node",{node:this.get_node(b)})))},this.check_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.select_node(b,!1,!0,c);var d,e,f,g;if(a.isArray(b)){for(b=b.slice(),e=0,f=b.length;f>e;e++)this.check_node(b[e],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(d=this.get_node(b,!0),void(b.state.checked||(b.state.checked=!0,this._data.checkbox.selected.push(b.id),d&&d.length&&d.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.uncheck_node=function(b,c){if(this.settings.checkbox.tie_selection)return this.deselect_node(b,!1,c);var d,e,f;if(a.isArray(b)){for(b=b.slice(),d=0,e=b.length;e>d;d++)this.uncheck_node(b[d],c);return!0}return b=this.get_node(b),b&&b.id!==a.jstree.root?(f=this.get_node(b,!0),void(b.state.checked&&(b.state.checked=!1,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,b.id),f.length&&f.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:b,selected:this._data.checkbox.selected,event:c})))):!1},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var b=this._data.checkbox.selected.concat([]),c,d;for(this._data.checkbox.selected=this._model.data[a.jstree.root].children_d.concat(),c=0,d=this._data.checkbox.selected.length;d>c;c++)this._model.data[this._data.checkbox.selected[c]]&&(this._model.data[this._data.checkbox.selected[c]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();var a=this._data.checkbox.selected.concat([]),b,c;for(b=0,c=this._data.checkbox.selected.length;c>b;b++)this._model.data[this._data.checkbox.selected[b]]&&(this._model.data[this._data.checkbox.selected[b]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:a})},this.is_checked=function(b){return this.settings.checkbox.tie_selection?this.is_selected(b):(b=this.get_node(b),b&&b.id!==a.jstree.root?b.state.checked:!1)},this.get_checked=function(b){return this.settings.checkbox.tie_selection?this.get_selected(b):b?a.map(this._data.checkbox.selected,a.proxy(function(a){return this.get_node(a)},this)):this._data.checkbox.selected},this.get_top_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_top_selected(b);var c=this.get_checked(!0),d={},e,f,g,h;for(e=0,f=c.length;f>e;e++)d[c[e].id]=c[e];for(e=0,f=c.length;f>e;e++)for(g=0,h=c[e].children_d.length;h>g;g++)d[c[e].children_d[g]]&&delete d[c[e].children_d[g]];c=[];for(e in d)d.hasOwnProperty(e)&&c.push(e);return b?a.map(c,a.proxy(function(a){return this.get_node(a)},this)):c},this.get_bottom_checked=function(b){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(b);var c=this.get_checked(!0),d=[],e,f;for(e=0,f=c.length;f>e;e++)c[e].children.length||d.push(c[e].id);return b?a.map(d,a.proxy(function(a){return this.get_node(a)},this)):d},this.load_node=function(b,c){var e,f,g,h,i,j;if(!a.isArray(b)&&!this.settings.checkbox.tie_selection&&(j=this.get_node(b),j&&j.state.loaded))for(e=0,f=j.children_d.length;f>e;e++)this._model.data[j.children_d[e]].state.checked&&(i=!0,this._data.checkbox.selected=a.vakata.array_remove_item(this._data.checkbox.selected,j.children_d[e]));return d.load_node.apply(this,arguments)},this.get_state=function(){var a=d.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?a:(a.checkbox=this._data.checkbox.selected.slice(),a)},this.set_state=function(b,c){var e=d.set_state.apply(this,arguments);if(e&&b.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var f=this;a.each(b.checkbox,function(a,b){f.check_node(b)})}return delete b.checkbox,this.set_state(b,c),!1}return e},this.refresh=function(a,b){return this.settings.checkbox.tie_selection||(this._data.checkbox.selected=[]),d.refresh.apply(this,arguments)}},a.jstree.defaults.conditionalselect=function(){return!0},a.jstree.plugins.conditionalselect=function(a,b){this.activate_node=function(a,c){this.settings.conditionalselect.call(this,this.get_node(a),c)&&b.activate_node.call(this,a,c)}},a.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(b,c){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.create_node(d,{},"last",function(a){setTimeout(function(){c.edit(a)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.edit(d)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.delete_node(c.get_selected()):c.delete_node(d)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.cut(c.get_top_selected()):c.cut(d)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.is_selected(d)?c.copy(c.get_top_selected()):c.copy(d)}},paste:{separator_before:!1,icon:!1,_disabled:function(b){return!a.jstree.reference(b.reference).can_paste()},separator_after:!1,label:"Paste",action:function(b){var c=a.jstree.reference(b.reference),d=c.get_node(b.reference);c.paste(d)}}}}}}},a.jstree.plugins.contextmenu=function(c,d){this.bind=function(){d.bind.call(this);var b=0,c=null,e,f;this.element.on("contextmenu.jstree",".jstree-anchor",a.proxy(function(a,d){a.preventDefault(),b=a.ctrlKey?+new Date:0,(d||c)&&(b=+new Date+1e4),c&&clearTimeout(c),this.is_loading(a.currentTarget)||this.show_contextmenu(a.currentTarget,a.pageX,a.pageY,a)},this)).on("click.jstree",".jstree-anchor",a.proxy(function(c){this._data.contextmenu.visible&&(!b||+new Date-b>250)&&a.vakata.context.hide(),b=0},this)).on("touchstart.jstree",".jstree-anchor",function(b){b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches[0]&&(e=b.pageX,f=b.pageY,c=setTimeout(function(){a(b.currentTarget).trigger("contextmenu",!0)},750))}).on("touchmove.vakata.jstree",function(a){c&&a.originalEvent&&a.originalEvent.changedTouches&&a.originalEvent.changedTouches[0]&&(Math.abs(e-a.pageX)>50||Math.abs(f-a.pageY)>50)&&clearTimeout(c)}).on("touchend.vakata.jstree",function(a){c&&clearTimeout(c)}),a(i).on("context_hide.vakata.jstree",a.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&a.vakata.context.hide(),d.teardown.call(this)},this.show_contextmenu=function(c,d,e,f){if(c=this.get_node(c),!c||c.id===a.jstree.root)return!1;var g=this.settings.contextmenu,h=this.get_node(c,!0),i=h.children(".jstree-anchor"),j=!1,k=!1;(g.show_at_node||d===b||e===b)&&(j=i.offset(),d=j.left,e=j.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(c)&&this.activate_node(c,f),k=g.items,a.isFunction(k)&&(k=k.call(this,c,a.proxy(function(a){this._show_contextmenu(c,d,e,a)},this))),a.isPlainObject(k)&&this._show_contextmenu(c,d,e,k)},this._show_contextmenu=function(b,c,d,e){var f=this.get_node(b,!0),g=f.children(".jstree-anchor");a(i).one("context_show.vakata.jstree",a.proxy(function(b,c){var d="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";a(c.element).addClass(d)},this)),this._data.contextmenu.visible=!0,a.vakata.context.show(g,{x:c,y:d},e),this.trigger("show_contextmenu",{node:b,x:c,y:d})}},function(a){var b=!1,c={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};a.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(b){a(i).triggerHandler("context_"+b+".vakata",{reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}})},_execute:function(b){return b=c.items[b],b&&(!b._disabled||a.isFunction(b._disabled)&&!b._disabled({item:b,reference:c.reference,element:c.element}))&&b.action?b.action.call(null,{item:b,reference:c.reference,element:c.element,position:{x:c.position_x,y:c.position_y}}):!1},_parse:function(b,d){if(!b)return!1;d||(c.html="",c.items=[]);var e="",f=!1,g;return d&&(e+=""),d||(c.html=e,a.vakata.context._trigger("parse")),e.length>10?e:!1},_show_submenu:function(c){if(c=a(c),c.length&&c.children("ul").length){var d=c.children("ul"),e=c.offset().left+c.outerWidth(),f=c.offset().top,g=d.width(),h=d.height(),i=a(window).width()+a(window).scrollLeft(),j=a(window).height()+a(window).scrollTop();b?c[e-(g+10+c.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):c[e+g+10>i?"addClass":"removeClass"]("vakata-context-right"),f+h+10>j&&d.css("bottom","-1px"),d.show()}},show:function(d,e,f){var g,h,i,j,k,l,m,n,o=!0;switch(c.element&&c.element.length&&c.element.width(""),o){case!e&&!d:return!1;case!!e&&!!d:c.reference=d,c.position_x=e.x,c.position_y=e.y;break;case!e&&!!d:c.reference=d,g=d.offset(),c.position_x=g.left+d.outerHeight(),c.position_y=g.top;break;case!!e&&!d:c.position_x=e.x,c.position_y=e.y}d&&!f&&a(d).data("vakata_contextmenu")&&(f=a(d).data("vakata_contextmenu")),a.vakata.context._parse(f)&&c.element.html(c.html),c.items.length&&(c.element.appendTo("body"),h=c.element,i=c.position_x,j=c.position_y,k=h.width(),l=h.height(),m=a(window).width()+a(window).scrollLeft(),n=a(window).height()+a(window).scrollTop(),b&&(i-=h.outerWidth()-a(d).outerWidth(),im&&(i=m-(k+20)),j+l+20>n&&(j=n-(l+20)),c.element.css({left:i,top:j}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),c.is_visible=!0,a.vakata.context._trigger("show"))},hide:function(){c.is_visible&&(c.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),c.is_visible=!1,a.vakata.context._trigger("hide"))}},a(function(){b="rtl"===a("body").css("direction");var d=!1;c.element=a("
        "),c.element.on("mouseenter","li",function(b){b.stopImmediatePropagation(),a.contains(this,b.relatedTarget)||(d&&clearTimeout(d),c.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),a(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),a.vakata.context._show_submenu(this))}).on("mouseleave","li",function(b){a.contains(this,b.relatedTarget)||a(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(b){a(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),a.vakata.context.settings.hide_onmouseleave&&(d=setTimeout(function(b){return function(){a.vakata.context.hide()}}(this),a.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(b){b.preventDefault(),a(this).blur().parent().hasClass("vakata-context-disabled")||a.vakata.context._execute(a(this).attr("rel"))===!1||a.vakata.context.hide()}).on("keydown","a",function(b){var d=null;switch(b.which){case 13:case 32:b.type="mouseup",b.preventDefault(),a(b.currentTarget).trigger(b);break;case 37:c.is_visible&&(c.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 38:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 39:c.is_visible&&(c.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 40:c.is_visible&&(d=c.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),d.length||(d=c.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),d.addClass("vakata-context-hover").children("a").focus(),b.stopImmediatePropagation(),b.preventDefault());break;case 27:a.vakata.context.hide(),b.preventDefault()}}).on("keydown",function(a){a.preventDefault();var b=c.element.find(".vakata-contextmenu-shortcut-"+a.which).parent();b.parent().not(".vakata-context-disabled")&&b.click()}),a(i).on("mousedown.vakata.jstree",function(b){c.is_visible&&!a.contains(c.element[0],b.target)&&a.vakata.context.hide()}).on("context_show.vakata.jstree",function(a,d){c.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),b&&c.element.addClass("vakata-context-rtl").css("direction","rtl"),c.element.find("ul").hide().end()})})}(a),a.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1},a.jstree.plugins.dnd=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",a.proxy(function(b){ -if(this.settings.dnd.large_drag_target&&a(b.target).closest(".jstree-node")[0]!==b.currentTarget)return!0;if("touchstart"===b.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var c=this.get_node(b.target),d=this.is_selected(c)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,e=d>1?d+" "+this.get_string("nodes"):this.get_text(b.currentTarget);return this.settings.core.force_text&&(e=a.vakata.html.escape(e)),c&&c.id&&c.id!==a.jstree.root&&(1===b.which||"touchstart"===b.type)&&(this.settings.dnd.is_draggable===!0||a.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,d>1?this.get_top_selected(!0):[c],b))?(this.element.trigger("mousedown.jstree"),a.vakata.dnd.start(b,{jstree:!0,origin:this,obj:this.get_node(c,!0),nodes:d>1?this.get_top_selected():[c.id]},'
        '+e+'
        ')):void 0},this))}},a(function(){var b=!1,c=!1,d=!1,e=!1,f=a('
         
        ').hide();a(i).on("dnd_start.vakata.jstree",function(a,c){b=!1,d=!1,c&&c.data&&c.data.jstree&&f.appendTo("body")}).on("dnd_move.vakata.jstree",function(g,h){if(e&&clearTimeout(e),h&&h.data&&h.data.jstree&&(!h.event.target.id||"jstree-marker"!==h.event.target.id)){d=h.event;var i=a.jstree.reference(h.event.target),j=!1,k=!1,l=!1,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;if(i&&i._data&&i._data.dnd)if(f.attr("class","jstree-"+i.get_theme()+(i.settings.core.themes.responsive?" jstree-dnd-responsive":"")),h.helper.children().attr("class","jstree-"+i.get_theme()+" jstree-"+i.get_theme()+"-"+i.get_theme_variant()+" "+(i.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(h.event.metaKey||h.event.ctrlKey))?"show":"hide"](),h.event.target!==i.element[0]&&h.event.target!==i.get_container_ul()[0]||0!==i.get_container_ul().children().length){if(j=i.settings.dnd.large_drop_target?a(h.event.target).closest(".jstree-node").children(".jstree-anchor"):a(h.event.target).closest(".jstree-anchor"),j&&j.length&&j.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(k=j.offset(),l=h.event.pageY-k.top,p=j.outerHeight(),s=p/3>l?["b","i","a"]:l>p-p/3?["a","i","b"]:l>p/2?["i","a","b"]:["i","b","a"],a.each(s,function(d,g){switch(g){case"b":n=k.left-6,o=k.top,q=i.get_parent(j),r=j.parent().index();break;case"i":z=i.settings.dnd.inside_pos,A=i.get_node(j.parent()),n=k.left-2,o=k.top+p/2+1,q=A.id,r="first"===z?0:"last"===z?A.children.length:Math.min(z,A.children.length);break;case"a":n=k.left-6,o=k.top+p,q=i.get_parent(j),r=j.parent().index()+1}for(t=!0,u=0,v=h.data.nodes.length;v>u;u++)if(w=h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(h.event.metaKey||h.event.ctrlKey))?"copy_node":"move_node",x=r,"move_node"===w&&"a"===g&&h.data.origin&&h.data.origin===i&&q===i.get_parent(h.data.nodes[u])&&(y=i.get_node(q),x>a.inArray(h.data.nodes[u],y.children)&&(x-=1)),t=t&&(i&&i.settings&&i.settings.dnd&&i.settings.dnd.check_while_dragging===!1||i.check(w,h.data.origin&&h.data.origin!==i?h.data.origin.get_node(h.data.nodes[u]):h.data.nodes[u],q,x,{dnd:!0,ref:i.get_node(j.parent()),pos:g,origin:h.data.origin,is_multi:h.data.origin&&h.data.origin!==i,is_foreign:!h.data.origin})),!t){i&&i.last_error&&(c=i.last_error());break}return"i"===g&&j.parent().is(".jstree-closed")&&i.settings.dnd.open_timeout&&(e=setTimeout(function(a,b){return function(){a.open_node(b)}}(i,j),i.settings.dnd.open_timeout)),t?(b={ins:i,par:q,pos:"i"!==g||"last"!==z||0!==r||i.is_loaded(A)?r:"last"},f.css({left:n+"px",top:o+"px"}).show(),h.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),c={},s=!0,!1):void 0}),s===!0))return}else{for(t=!0,u=0,v=h.data.nodes.length;v>u;u++)if(t=t&&i.check(h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(h.event.metaKey||h.event.ctrlKey))?"copy_node":"move_node",h.data.origin&&h.data.origin!==i?h.data.origin.get_node(h.data.nodes[u]):h.data.nodes[u],a.jstree.root,"last",{dnd:!0,ref:i.get_node(a.jstree.root),pos:"i",origin:h.data.origin,is_multi:h.data.origin&&h.data.origin!==i,is_foreign:!h.data.origin}),!t)break;if(t)return b={ins:i,par:a.jstree.root,pos:"last"},f.hide(),void h.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok")}b=!1,h.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),f.hide()}}).on("dnd_scroll.vakata.jstree",function(a,c){c&&c.data&&c.data.jstree&&(f.hide(),b=!1,d=!1,c.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(g,h){if(e&&clearTimeout(e),h&&h.data&&h.data.jstree){f.hide().detach();var i,j,k=[];if(b){for(i=0,j=h.data.nodes.length;j>i;i++)k[i]=h.data.origin?h.data.origin.get_node(h.data.nodes[i]):h.data.nodes[i];b.ins[h.data.origin&&(h.data.origin.settings.dnd.always_copy||h.data.origin.settings.dnd.copy&&(h.event.metaKey||h.event.ctrlKey))?"copy_node":"move_node"](k,b.par,b.pos,!1,!1,!1,h.data.origin)}else i=a(h.event.target).closest(".jstree"),i.length&&c&&c.error&&"check"===c.error&&(i=i.jstree(!0),i&&i.settings.core.error.call(this,c));d=!1,b=!1}}).on("keyup.jstree keydown.jstree",function(b,c){c=a.vakata.dnd._get(),c&&c.data&&c.data.jstree&&(c.helper.find(".jstree-copy").first()[c.data.origin&&(c.data.origin.settings.dnd.always_copy||c.data.origin.settings.dnd.copy&&(b.metaKey||b.ctrlKey))?"show":"hide"](),d&&(d.metaKey=b.metaKey,d.ctrlKey=b.ctrlKey,a.vakata.dnd._trigger("move",d)))})}),function(a){a.vakata.html={div:a("
        "),escape:function(b){return a.vakata.html.div.text(b).html()},strip:function(b){return a.vakata.html.div.empty().append(a.parseHTML(b)).text()}};var b={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};a.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(b,c){var d=a.vakata.dnd._get();d.event=c,a(i).triggerHandler("dnd_"+b+".vakata",d)},_get:function(){return{data:b.data,element:b.element,helper:b.helper}},_clean:function(){b.helper&&b.helper.remove(),b.scroll_i&&(clearInterval(b.scroll_i),b.scroll_i=!1),b={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},a(i).off("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).off("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop)},_scroll:function(c){if(!b.scroll_e||!b.scroll_l&&!b.scroll_t)return b.scroll_i&&(clearInterval(b.scroll_i),b.scroll_i=!1),!1;if(!b.scroll_i)return b.scroll_i=setInterval(a.vakata.dnd._scroll,100),!1;if(c===!0)return!1;var d=b.scroll_e.scrollTop(),e=b.scroll_e.scrollLeft();b.scroll_e.scrollTop(d+b.scroll_t*a.vakata.dnd.settings.scroll_speed),b.scroll_e.scrollLeft(e+b.scroll_l*a.vakata.dnd.settings.scroll_speed),(d!==b.scroll_e.scrollTop()||e!==b.scroll_e.scrollLeft())&&a.vakata.dnd._trigger("scroll",b.scroll_e)},start:function(c,d,e){"touchstart"===c.type&&c.originalEvent&&c.originalEvent.changedTouches&&c.originalEvent.changedTouches[0]&&(c.pageX=c.originalEvent.changedTouches[0].pageX,c.pageY=c.originalEvent.changedTouches[0].pageY,c.target=i.elementFromPoint(c.originalEvent.changedTouches[0].pageX-window.pageXOffset,c.originalEvent.changedTouches[0].pageY-window.pageYOffset)),b.is_drag&&a.vakata.dnd.stop({});try{c.currentTarget.unselectable="on",c.currentTarget.onselectstart=function(){return!1},c.currentTarget.style&&(c.currentTarget.style.MozUserSelect="none")}catch(f){}return b.init_x=c.pageX,b.init_y=c.pageY,b.data=d,b.is_down=!0,b.element=c.currentTarget,b.target=c.target,b.is_touch="touchstart"===c.type,e!==!1&&(b.helper=a("
        ").html(e).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),a(i).on("mousemove.vakata.jstree touchmove.vakata.jstree",a.vakata.dnd.drag),a(i).on("mouseup.vakata.jstree touchend.vakata.jstree",a.vakata.dnd.stop),!1},drag:function(c){if("touchmove"===c.type&&c.originalEvent&&c.originalEvent.changedTouches&&c.originalEvent.changedTouches[0]&&(c.pageX=c.originalEvent.changedTouches[0].pageX,c.pageY=c.originalEvent.changedTouches[0].pageY,c.target=i.elementFromPoint(c.originalEvent.changedTouches[0].pageX-window.pageXOffset,c.originalEvent.changedTouches[0].pageY-window.pageYOffset)),b.is_down){if(!b.is_drag){if(!(Math.abs(c.pageX-b.init_x)>(b.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)||Math.abs(c.pageY-b.init_y)>(b.is_touch?a.vakata.dnd.settings.threshold_touch:a.vakata.dnd.settings.threshold)))return;b.helper&&(b.helper.appendTo("body"),b.helper_w=b.helper.outerWidth()),b.is_drag=!0,a.vakata.dnd._trigger("start",c)}var d=!1,e=!1,f=!1,g=!1,h=!1,j=!1,k=!1,l=!1,m=!1,n=!1;return b.scroll_t=0,b.scroll_l=0,b.scroll_e=!1,a(a(c.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(a(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var d=a(this),e=d.offset();return this.scrollHeight>this.offsetHeight&&(e.top+d.height()-c.pageYthis.offsetWidth&&(e.left+d.width()-c.pageXg&&c.pageY-kg&&g-(c.pageY-k)j&&c.pageX-lj&&j-(c.pageX-l)f&&(m=f-50),h&&n+b.helper_w>h&&(n=h-(b.helper_w+2)),b.helper.css({left:n+"px",top:m+"px"})),a.vakata.dnd._trigger("move",c),!1}},stop:function(c){if("touchend"===c.type&&c.originalEvent&&c.originalEvent.changedTouches&&c.originalEvent.changedTouches[0]&&(c.pageX=c.originalEvent.changedTouches[0].pageX,c.pageY=c.originalEvent.changedTouches[0].pageY,c.target=i.elementFromPoint(c.originalEvent.changedTouches[0].pageX-window.pageXOffset,c.originalEvent.changedTouches[0].pageY-window.pageYOffset)),b.is_drag)a.vakata.dnd._trigger("stop",c);else if("touchend"===c.type&&c.target===b.target){var d=setTimeout(function(){a(c.target).click()},100);a(c.target).one("click",function(){d&&clearTimeout(d)})}return a.vakata.dnd._clean(),!1}}}(a),a.jstree.defaults.massload=null,a.jstree.plugins.massload=function(b,c){this.init=function(a,b){c.init.call(this,a,b),this._data.massload={}},this._load_nodes=function(b,d,e){var f=this.settings.massload;return e&&!a.isEmptyObject(this._data.massload)?c._load_nodes.call(this,b,d,e):a.isFunction(f)?f.call(this,b,a.proxy(function(a){if(a)for(var f in a)a.hasOwnProperty(f)&&(this._data.massload[f]=a[f]);c._load_nodes.call(this,b,d,e)},this)):"object"==typeof f&&f&&f.url?(f=a.extend(!0,{},f),a.isFunction(f.url)&&(f.url=f.url.call(this,b)),a.isFunction(f.data)&&(f.data=f.data.call(this,b)),a.ajax(f).done(a.proxy(function(a,f,g){if(a)for(var h in a)a.hasOwnProperty(h)&&(this._data.massload[h]=a[h]);c._load_nodes.call(this,b,d,e)},this)).fail(a.proxy(function(a){c._load_nodes.call(this,b,d,e)},this))):c._load_nodes.call(this,b,d,e)},this._load_node=function(b,d){var e=this._data.massload[b.id];return e?this["string"==typeof e?"_append_html_data":"_append_json_data"](b,"string"==typeof e?a(a.parseHTML(e)).filter(function(){return 3!==this.nodeType}):e,function(a){d.call(this,a),delete this._data.massload[b.id]}):c._load_node.call(this,b,d)}},a.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,show_only_matches_children:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},a.jstree.plugins.search=function(c,d){this.bind=function(){d.bind.call(this),this._data.search.str="",this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this._data.search.smc=!1,this._data.search.hdn=[],this.element.on("search.jstree",a.proxy(function(b,c){if(this._data.search.som&&c.res.length){var d=this._model.data,e,f,g=[];for(e=0,f=c.res.length;f>e;e++)d[c.res[e]]&&!d[c.res[e]].state.hidden&&(g.push(c.res[e]),g=g.concat(d[c.res[e]].parents),this._data.search.smc&&(g=g.concat(d[c.res[e]].children_d)));g=a.vakata.array_remove_item(a.vakata.array_unique(g),a.jstree.root),this._data.search.hdn=this.hide_all(!0),this.show_node(g)}},this)).on("clear_search.jstree",a.proxy(function(a,b){this._data.search.som&&b.res.length&&this.show_node(this._data.search.hdn)},this))},this.search=function(c,d,e,f,g,h){if(c===!1||""===a.trim(c.toString()))return this.clear_search();f=this.get_node(f),f=f&&f.id?f.id:null,c=c.toString();var i=this.settings.search,j=i.ajax?i.ajax:!1,k=this._model.data,l=null,m=[],n=[],o,p;if(this._data.search.res.length&&!g&&this.clear_search(),e===b&&(e=i.show_only_matches),h===b&&(h=i.show_only_matches_children),!d&&j!==!1)return a.isFunction(j)?j.call(this,c,a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g)},!0)},this),f):(j=a.extend({},j),j.data||(j.data={}),j.data.str=c,f&&(j.data.inside=f),a.ajax(j).fail(a.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(j)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(a.proxy(function(b){b&&b.d&&(b=b.d),this._load_nodes(a.isArray(b)?a.vakata.array_unique(b):[],function(){this.search(c,!0,e,f,g)},!0)},this)));if(g||(this._data.search.str=c,this._data.search.dom=a(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=e,this._data.search.smc=h),l=new a.vakata.search(c,!0,{caseSensitive:i.case_sensitive,fuzzy:i.fuzzy}),a.each(k[f?f:a.jstree.root].children_d,function(a,b){var d=k[b];d.text&&(!i.search_leaves_only||d.state.loaded&&0===d.children.length)&&(i.search_callback&&i.search_callback.call(this,c,d)||!i.search_callback&&l.search(d.text).isMatch)&&(m.push(b),n=n.concat(d.parents))}),m.length){for(n=a.vakata.array_unique(n),o=0,p=n.length;p>o;o++)n[o]!==a.jstree.root&&k[n[o]]&&this.open_node(n[o],null,0)===!0&&this._data.search.opn.push(n[o]);g?(this._data.search.dom=this._data.search.dom.add(a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #")))),this._data.search.res=a.vakata.array_unique(this._data.search.res.concat(m))):(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(m,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=m),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")}this.trigger("search",{nodes:this._data.search.dom,str:c,res:this._data.search.res,show_only_matches:e})},this.clear_search=function(){this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.res.length&&(this._data.search.dom=a(this.element[0].querySelectorAll("#"+a.map(this._data.search.res,function(b){return-1!=="0123456789".indexOf(b[0])?"\\3"+b[0]+" "+b.substr(1).replace(a.jstree.idregex,"\\$&"):b.replace(a.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search")),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=a()},this.redraw_node=function(b,c,e,f){if(b=d.redraw_node.apply(this,arguments),b&&-1!==a.inArray(b.id,this._data.search.res)){var g,h,i=null;for(g=0,h=b.childNodes.length;h>g;g++)if(b.childNodes[g]&&b.childNodes[g].className&&-1!==b.childNodes[g].className.indexOf("jstree-anchor")){i=b.childNodes[g];break}i&&(i.className+=" jstree-search")}return b}},function(a){a.vakata.search=function(b,c,d){d=d||{},d=a.extend({},a.vakata.search.defaults,d),d.fuzzy!==!1&&(d.fuzzy=!0),b=d.caseSensitive?b:b.toLowerCase();var e=d.location,f=d.distance,g=d.threshold,h=b.length,i,j,k,l;return h>32&&(d.fuzzy=!1),d.fuzzy&&(i=1<c;c++)a[b.charAt(c)]=0;for(c=0;h>c;c++)a[b.charAt(c)]|=1<c;c++){o=0,p=q;while(p>o)k(c,e+p)<=m?o=p:q=p,p=Math.floor((q-o)/2+o);for(q=p,s=Math.max(1,e-p+1),t=Math.min(e+p,l)+h,u=new Array(t+2),u[t+1]=(1<=s;f--)if(v=j[a.charAt(f-1)],0===c?u[f]=(u[f+1]<<1|1)&v:u[f]=(u[f+1]<<1|1)&v|((r[f+1]|r[f])<<1|1)|r[f+1],u[f]&i&&(w=k(c,f-1),m>=w)){if(m=w,n=f-1,x.push(n),!(n>e))break;s=Math.max(1,2*e-n)}if(k(c+1,e)>m)break;r=u}return{isMatch:n>=0,score:w}},c===!0?{search:l}:l(c)},a.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1}}(a),a.jstree.defaults.sort=function(a,b){return this.get_text(a)>this.get_text(b)?1:-1},a.jstree.plugins.sort=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("model.jstree",a.proxy(function(a,b){this.sort(b.parent,!0)},this)).on("rename_node.jstree create_node.jstree",a.proxy(function(a,b){this.sort(b.parent||b.node.parent,!1),this.redraw_node(b.parent||b.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",a.proxy(function(a,b){this.sort(b.parent,!1),this.redraw_node(b.parent,!0)},this))},this.sort=function(b,c){var d,e;if(b=this.get_node(b),b&&b.children&&b.children.length&&(b.children.sort(a.proxy(this.settings.sort,this)),c))for(d=0,e=b.children_d.length;e>d;d++)this.sort(b.children_d[d],!1)}};var n=!1;a.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1},a.jstree.plugins.state=function(b,c){this.bind=function(){c.bind.call(this);var b=a.proxy(function(){this.element.on(this.settings.state.events,a.proxy(function(){n&&clearTimeout(n),n=setTimeout(a.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",a.proxy(function(a,c){this.element.one("restore_state.jstree",b),this.restore_state()||b()},this))},this.save_state=function(){var b={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};a.vakata.storage.set(this.settings.state.key,JSON.stringify(b))},this.restore_state=function(){var b=a.vakata.storage.get(this.settings.state.key);if(b)try{b=JSON.parse(b)}catch(c){return!1}return b&&b.ttl&&b.sec&&+new Date-b.sec>b.ttl?!1:(b&&b.state&&(b=b.state),b&&a.isFunction(this.settings.state.filter)&&(b=this.settings.state.filter.call(this,b)),b?(this.element.one("set_state.jstree",function(c,d){d.instance.trigger("restore_state",{state:a.extend(!0,{},b)})}),this.set_state(b),!0):!1)},this.clear_state=function(){return a.vakata.storage.del(this.settings.state.key)}},function(a,b){a.vakata.storage={set:function(a,b){return window.localStorage.setItem(a,b)},get:function(a){return window.localStorage.getItem(a)},del:function(a){return window.localStorage.removeItem(a)}}}(a),a.jstree.defaults.types={"default":{}},a.jstree.defaults.types[a.jstree.root]={},a.jstree.plugins.types=function(c,d){this.init=function(c,e){var f,g;if(e&&e.types&&e.types["default"])for(f in e.types)if("default"!==f&&f!==a.jstree.root&&e.types.hasOwnProperty(f))for(g in e.types["default"])e.types["default"].hasOwnProperty(g)&&e.types[f][g]===b&&(e.types[f][g]=e.types["default"][g]);d.init.call(this,c,e),this._model.data[a.jstree.root].type=a.jstree.root},this.refresh=function(b,c){d.refresh.call(this,b,c),this._model.data[a.jstree.root].type=a.jstree.root},this.bind=function(){this.element.on("model.jstree",a.proxy(function(c,d){var e=this._model.data,f=d.nodes,g=this.settings.types,h,i,j="default";for(h=0,i=f.length;i>h;h++)j="default",e[f[h]].original&&e[f[h]].original.type&&g[e[f[h]].original.type]&&(j=e[f[h]].original.type),e[f[h]].data&&e[f[h]].data.jstree&&e[f[h]].data.jstree.type&&g[e[f[h]].data.jstree.type]&&(j=e[f[h]].data.jstree.type),e[f[h]].type=j,e[f[h]].icon===!0&&g[j].icon!==b&&(e[f[h]].icon=g[j].icon);e[a.jstree.root].type=a.jstree.root},this)),d.bind.call(this)},this.get_json=function(b,c,e){var f,g,h=this._model.data,i=c?a.extend(!0,{},c,{no_id:!1}):{},j=d.get_json.call(this,b,i,e);if(j===!1)return!1;if(a.isArray(j))for(f=0,g=j.length;g>f;f++)j[f].type=j[f].id&&h[j[f].id]&&h[j[f].id].type?h[j[f].id].type:"default",c&&c.no_id&&(delete j[f].id,j[f].li_attr&&j[f].li_attr.id&&delete j[f].li_attr.id,j[f].a_attr&&j[f].a_attr.id&&delete j[f].a_attr.id);else j.type=j.id&&h[j.id]&&h[j.id].type?h[j.id].type:"default",c&&c.no_id&&(j=this._delete_ids(j));return j},this._delete_ids=function(b){if(a.isArray(b)){for(var c=0,d=b.length;d>c;c++)b[c]=this._delete_ids(b[c]);return b}return delete b.id,b.li_attr&&b.li_attr.id&&delete b.li_attr.id,b.a_attr&&b.a_attr.id&&delete b.a_attr.id,b.children&&a.isArray(b.children)&&(b.children=this._delete_ids(b.children)),b},this.check=function(c,e,f,g,h){if(d.check.call(this,c,e,f,g,h)===!1)return!1;e=e&&e.id?e:this.get_node(e),f=f&&f.id?f:this.get_node(f);var i=e&&e.id?h&&h.origin?h.origin:a.jstree.reference(e.id):null,j,k,l,m;switch(i=i&&i._model&&i._model.data?i._model.data:null,c){case"create_node":case"move_node":case"copy_node":if("move_node"!==c||-1===a.inArray(e.id,f.children)){if(j=this.get_rules(f),j.max_children!==b&&-1!==j.max_children&&j.max_children===f.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(j.valid_children!==b&&-1!==j.valid_children&&-1===a.inArray(e.type||"default",j.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+c,data:JSON.stringify({chk:c,pos:g,obj:e&&e.id?e.id:!1,par:f&&f.id?f.id:!1})},!1;if(i&&e.children_d&&e.parents){for(k=0,l=0,m=e.children_d.length;m>l;l++)k=Math.max(k,i[e.children_d[l]].parents.length);k=k-e.parents.length+1}(0>=k||k===b)&&(k=1);do{if(j.max_depth!==b&&-1!==j.max_depth&&j.max_depthf;f++)this.set_type(c[f],d);return!0}return e=this.settings.types,c=this.get_node(c),e[d]&&c?(h=c.type,i=this.get_icon(c),c.type=d,(i===!0||e[h]&&e[h].icon!==b&&i===e[h].icon)&&this.set_icon(c,e[d].icon!==b?e[d].icon:!0),!0):!1}},a.jstree.defaults.unique={case_sensitive:!1,duplicate:function(a,b){return a+" ("+b+")"}},a.jstree.plugins.unique=function(c,d){this.check=function(b,c,e,f,g){if(d.check.call(this,b,c,e,f,g)===!1)return!1;if(c=c&&c.id?c:this.get_node(c),e=e&&e.id?e:this.get_node(e),!e||!e.children)return!0;var h="rename_node"===b?f:c.text,i=[],j=this.settings.unique.case_sensitive,k=this._model.data,l,m;for(l=0,m=e.children.length;m>l;l++)i.push(j?k[e.children[l]].text:k[e.children[l]].text.toLowerCase());switch(j||(h=h.toLowerCase()),b){case"delete_node":return!0;case"rename_node":return l=-1===a.inArray(h,i)||c.text&&c.text[j?"toString":"toLowerCase"]()===h,l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l;case"create_node":return l=-1===a.inArray(h,i),l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l;case"copy_node":return l=-1===a.inArray(h,i),l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l;case"move_node":return l=c.parent===e.id&&(!g||!g.is_multi)||-1===a.inArray(h,i),l||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+h+" already exists. Preventing: "+b,data:JSON.stringify({chk:b,pos:f,obj:c&&c.id?c.id:!1,par:e&&e.id?e.id:!1})}),l}return!0},this.create_node=function(c,e,f,g,h){if(!e||e.text===b){if(null===c&&(c=a.jstree.root),c=this.get_node(c),!c)return d.create_node.call(this,c,e,f,g,h);if(f=f===b?"last":f,!f.toString().match(/^(before|after)$/)&&!h&&!this.is_loaded(c))return d.create_node.call(this,c,e,f,g,h);e||(e={});var i,j,k,l,m,n=this._model.data,o=this.settings.unique.case_sensitive,p=this.settings.unique.duplicate;for(j=i=this.get_string("New node"),k=[],l=0,m=c.children.length;m>l;l++)k.push(o?n[c.children[l]].text:n[c.children[l]].text.toLowerCase());l=1;while(-1!==a.inArray(o?j:j.toLowerCase(),k))j=p.call(this,i,++l).toString();e.text=j}return d.create_node.call(this,c,e,f,g,h)}};var o=i.createElement("DIV");if(o.setAttribute("unselectable","on"),o.setAttribute("role","presentation"),o.className="jstree-wholerow",o.innerHTML=" ",a.jstree.plugins.wholerow=function(b,c){this.bind=function(){c.bind.call(this),this.element.on("ready.jstree set_state.jstree",a.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",a.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",a.proxy(function(a,b){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var c=!1,d,e;for(d=0,e=b.selected.length;e>d;d++)c=this.get_node(b.selected[d],!0),c&&c.length&&c.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",a.proxy(function(a,b){this.get_node(b.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",a.proxy(function(a,b){"hover_node"===a.type&&this.is_disabled(b.node)||this.get_node(b.node,!0).children(".jstree-wholerow")["hover_node"===a.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",a.proxy(function(b){b.preventDefault();var c=a.Event("contextmenu",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey,pageX:b.pageX,pageY:b.pageY});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c)},this)).on("click.jstree",".jstree-wholerow",function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",a.proxy(function(b){b.stopImmediatePropagation();var c=a.Event("click",{metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey,shiftKey:b.shiftKey});a(b.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(c).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",a.proxy(function(a){return a.stopImmediatePropagation(),this.is_disabled(a.currentTarget)||this.hover_node(a.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",a.proxy(function(a){this.dehover_node(a.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),c.teardown.call(this)},this.redraw_node=function(b,d,e,f){if(b=c.redraw_node.apply(this,arguments)){var g=o.cloneNode(!0);-1!==a.inArray(b.id,this._data.core.selected)&&(g.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===b.id&&(g.className+=" jstree-wholerow-hovered"),b.insertBefore(g,b.childNodes[0])}return b}},i.registerElement&&Object&&Object.create){var p=Object.create(HTMLElement.prototype);p.createdCallback=function(){var b={core:{},plugins:[]},c;for(c in a.jstree.plugins)a.jstree.plugins.hasOwnProperty(c)&&this.attributes[c]&&(b.plugins.push(c),this.getAttribute(c)&&JSON.parse(this.getAttribute(c))&&(b[c]=JSON.parse(this.getAttribute(c))));for(c in a.jstree.defaults.core)a.jstree.defaults.core.hasOwnProperty(c)&&this.attributes[c]&&(b.core[c]=JSON.parse(this.getAttribute(c))||this.getAttribute(c));a(this).jstree(b)};try{i.registerElement("vakata-jstree",{prototype:p})}catch(q){}}}}); \ No newline at end of file diff --git a/Resources/public/js/vendor/jstree/themes/default-dark/32px.png b/Resources/public/js/vendor/jstree/themes/default-dark/32px.png deleted file mode 100644 index d6fd7211..00000000 Binary files a/Resources/public/js/vendor/jstree/themes/default-dark/32px.png and /dev/null differ diff --git a/Resources/public/js/vendor/jstree/themes/default-dark/40px.png b/Resources/public/js/vendor/jstree/themes/default-dark/40px.png deleted file mode 100644 index 4fc88e41..00000000 Binary files a/Resources/public/js/vendor/jstree/themes/default-dark/40px.png and /dev/null differ diff --git a/Resources/public/js/vendor/jstree/themes/default-dark/style.css b/Resources/public/js/vendor/jstree/themes/default-dark/style.css deleted file mode 100644 index 36224a01..00000000 --- a/Resources/public/js/vendor/jstree/themes/default-dark/style.css +++ /dev/null @@ -1,1105 +0,0 @@ -/* jsTree default dark theme */ -.jstree-node, -.jstree-children, -.jstree-container-ul { - display: block; - margin: 0; - padding: 0; - list-style-type: none; - list-style-image: none; -} -.jstree-node { - white-space: nowrap; -} -.jstree-anchor { - display: inline-block; - color: black; - white-space: nowrap; - padding: 0 4px 0 1px; - margin: 0; - vertical-align: top; -} -.jstree-anchor:focus { - outline: 0; -} -.jstree-anchor, -.jstree-anchor:link, -.jstree-anchor:visited, -.jstree-anchor:hover, -.jstree-anchor:active { - text-decoration: none; - color: inherit; -} -.jstree-icon { - display: inline-block; - text-decoration: none; - margin: 0; - padding: 0; - vertical-align: top; - text-align: center; -} -.jstree-icon:empty { - display: inline-block; - text-decoration: none; - margin: 0; - padding: 0; - vertical-align: top; - text-align: center; -} -.jstree-ocl { - cursor: pointer; -} -.jstree-leaf > .jstree-ocl { - cursor: default; -} -.jstree .jstree-open > .jstree-children { - display: block; -} -.jstree .jstree-closed > .jstree-children, -.jstree .jstree-leaf > .jstree-children { - display: none; -} -.jstree-anchor > .jstree-themeicon { - margin-right: 2px; -} -.jstree-no-icons .jstree-themeicon, -.jstree-anchor > .jstree-themeicon-hidden { - display: none; -} -.jstree-hidden { - display: none; -} -.jstree-rtl .jstree-anchor { - padding: 0 1px 0 4px; -} -.jstree-rtl .jstree-anchor > .jstree-themeicon { - margin-left: 2px; - margin-right: 0; -} -.jstree-rtl .jstree-node { - margin-left: 0; -} -.jstree-rtl .jstree-container-ul > .jstree-node { - margin-right: 0; -} -.jstree-wholerow-ul { - position: relative; - display: inline-block; - min-width: 100%; -} -.jstree-wholerow-ul .jstree-leaf > .jstree-ocl { - cursor: pointer; -} -.jstree-wholerow-ul .jstree-anchor, -.jstree-wholerow-ul .jstree-icon { - position: relative; -} -.jstree-wholerow-ul .jstree-wholerow { - width: 100%; - cursor: pointer; - position: absolute; - left: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.vakata-context { - display: none; -} -.vakata-context, -.vakata-context ul { - margin: 0; - padding: 2px; - position: absolute; - background: #f5f5f5; - border: 1px solid #979797; - box-shadow: 2px 2px 2px #999999; -} -.vakata-context ul { - list-style: none; - left: 100%; - margin-top: -2.7em; - margin-left: -4px; -} -.vakata-context .vakata-context-right ul { - left: auto; - right: 100%; - margin-left: auto; - margin-right: -4px; -} -.vakata-context li { - list-style: none; - display: inline; -} -.vakata-context li > a { - display: block; - padding: 0 2em 0 2em; - text-decoration: none; - width: auto; - color: black; - white-space: nowrap; - line-height: 2.4em; - text-shadow: 1px 1px 0 white; - border-radius: 1px; -} -.vakata-context li > a:hover { - position: relative; - background-color: #e8eff7; - box-shadow: 0 0 2px #0a6aa1; -} -.vakata-context li > a.vakata-context-parent { - background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); - background-position: right center; - background-repeat: no-repeat; -} -.vakata-context li > a:focus { - outline: 0; -} -.vakata-context .vakata-context-hover > a { - position: relative; - background-color: #e8eff7; - box-shadow: 0 0 2px #0a6aa1; -} -.vakata-context .vakata-context-separator > a, -.vakata-context .vakata-context-separator > a:hover { - background: white; - border: 0; - border-top: 1px solid #e2e3e3; - height: 1px; - min-height: 1px; - max-height: 1px; - padding: 0; - margin: 0 0 0 2.4em; - border-left: 1px solid #e0e0e0; - text-shadow: 0 0 0 transparent; - box-shadow: 0 0 0 transparent; - border-radius: 0; -} -.vakata-context .vakata-contextmenu-disabled a, -.vakata-context .vakata-contextmenu-disabled a:hover { - color: silver; - background-color: transparent; - border: 0; - box-shadow: 0 0 0; -} -.vakata-context li > a > i { - text-decoration: none; - display: inline-block; - width: 2.4em; - height: 2.4em; - background: transparent; - margin: 0 0 0 -2em; - vertical-align: top; - text-align: center; - line-height: 2.4em; -} -.vakata-context li > a > i:empty { - width: 2.4em; - line-height: 2.4em; -} -.vakata-context li > a .vakata-contextmenu-sep { - display: inline-block; - width: 1px; - height: 2.4em; - background: white; - margin: 0 0.5em 0 0; - border-left: 1px solid #e2e3e3; -} -.vakata-context .vakata-contextmenu-shortcut { - font-size: 0.8em; - color: silver; - opacity: 0.5; - display: none; -} -.vakata-context-rtl ul { - left: auto; - right: 100%; - margin-left: auto; - margin-right: -4px; -} -.vakata-context-rtl li > a.vakata-context-parent { - background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); - background-position: left center; - background-repeat: no-repeat; -} -.vakata-context-rtl .vakata-context-separator > a { - margin: 0 2.4em 0 0; - border-left: 0; - border-right: 1px solid #e2e3e3; -} -.vakata-context-rtl .vakata-context-left ul { - right: auto; - left: 100%; - margin-left: -4px; - margin-right: auto; -} -.vakata-context-rtl li > a > i { - margin: 0 -2em 0 0; -} -.vakata-context-rtl li > a .vakata-contextmenu-sep { - margin: 0 0 0 0.5em; - border-left-color: white; - background: #e2e3e3; -} -#jstree-marker { - position: absolute; - top: 0; - left: 0; - margin: -5px 0 0 0; - padding: 0; - border-right: 0; - border-top: 5px solid transparent; - border-bottom: 5px solid transparent; - border-left: 5px solid; - width: 0; - height: 0; - font-size: 0; - line-height: 0; -} -#jstree-dnd { - line-height: 16px; - margin: 0; - padding: 4px; -} -#jstree-dnd .jstree-icon, -#jstree-dnd .jstree-copy { - display: inline-block; - text-decoration: none; - margin: 0 2px 0 0; - padding: 0; - width: 16px; - height: 16px; -} -#jstree-dnd .jstree-ok { - background: green; -} -#jstree-dnd .jstree-er { - background: red; -} -#jstree-dnd .jstree-copy { - margin: 0 2px 0 2px; -} -.jstree-default-dark .jstree-node, -.jstree-default-dark .jstree-icon { - background-repeat: no-repeat; - background-color: transparent; -} -.jstree-default-dark .jstree-anchor, -.jstree-default-dark .jstree-wholerow { - transition: background-color 0.15s, box-shadow 0.15s; -} -.jstree-default-dark .jstree-hovered { - background: #555555; - border-radius: 2px; - box-shadow: inset 0 0 1px #555555; -} -.jstree-default-dark .jstree-clicked { - background: #5fa2db; - border-radius: 2px; - box-shadow: inset 0 0 1px #666666; -} -.jstree-default-dark .jstree-no-icons .jstree-anchor > .jstree-themeicon { - display: none; -} -.jstree-default-dark .jstree-disabled { - background: transparent; - color: #666666; -} -.jstree-default-dark .jstree-disabled.jstree-hovered { - background: transparent; - box-shadow: none; -} -.jstree-default-dark .jstree-disabled.jstree-clicked { - background: #333333; -} -.jstree-default-dark .jstree-disabled > .jstree-icon { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default-dark .jstree-search { - font-style: italic; - color: #ffffff; - font-weight: bold; -} -.jstree-default-dark .jstree-no-checkboxes .jstree-checkbox { - display: none !important; -} -.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked { - background: transparent; - box-shadow: none; -} -.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { - background: #555555; -} -.jstree-default-dark.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { - background: transparent; -} -.jstree-default-dark.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { - background: #555555; -} -.jstree-default-dark > .jstree-striped { - min-width: 100%; - display: inline-block; - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; -} -.jstree-default-dark > .jstree-wholerow-ul .jstree-hovered, -.jstree-default-dark > .jstree-wholerow-ul .jstree-clicked { - background: transparent; - box-shadow: none; - border-radius: 0; -} -.jstree-default-dark .jstree-wholerow { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.jstree-default-dark .jstree-wholerow-hovered { - background: #555555; -} -.jstree-default-dark .jstree-wholerow-clicked { - background: #5fa2db; - background: -webkit-linear-gradient(top, #5fa2db 0%, #5fa2db 100%); - background: linear-gradient(to bottom, #5fa2db 0%, #5fa2db 100%); -} -.jstree-default-dark .jstree-node { - min-height: 24px; - line-height: 24px; - margin-left: 24px; - min-width: 24px; -} -.jstree-default-dark .jstree-anchor { - line-height: 24px; - height: 24px; -} -.jstree-default-dark .jstree-icon { - width: 24px; - height: 24px; - line-height: 24px; -} -.jstree-default-dark .jstree-icon:empty { - width: 24px; - height: 24px; - line-height: 24px; -} -.jstree-default-dark.jstree-rtl .jstree-node { - margin-right: 24px; -} -.jstree-default-dark .jstree-wholerow { - height: 24px; -} -.jstree-default-dark .jstree-node, -.jstree-default-dark .jstree-icon { - background-image: url("32px.png"); -} -.jstree-default-dark .jstree-node { - background-position: -292px -4px; - background-repeat: repeat-y; -} -.jstree-default-dark .jstree-last { - background: transparent; -} -.jstree-default-dark .jstree-open > .jstree-ocl { - background-position: -132px -4px; -} -.jstree-default-dark .jstree-closed > .jstree-ocl { - background-position: -100px -4px; -} -.jstree-default-dark .jstree-leaf > .jstree-ocl { - background-position: -68px -4px; -} -.jstree-default-dark .jstree-themeicon { - background-position: -260px -4px; -} -.jstree-default-dark > .jstree-no-dots .jstree-node, -.jstree-default-dark > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-dark > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -36px -4px; -} -.jstree-default-dark > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -4px -4px; -} -.jstree-default-dark .jstree-disabled { - background: transparent; -} -.jstree-default-dark .jstree-disabled.jstree-hovered { - background: transparent; -} -.jstree-default-dark .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default-dark .jstree-checkbox { - background-position: -164px -4px; -} -.jstree-default-dark .jstree-checkbox:hover { - background-position: -164px -36px; -} -.jstree-default-dark.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, -.jstree-default-dark .jstree-checked > .jstree-checkbox { - background-position: -228px -4px; -} -.jstree-default-dark.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, -.jstree-default-dark .jstree-checked > .jstree-checkbox:hover { - background-position: -228px -36px; -} -.jstree-default-dark .jstree-anchor > .jstree-undetermined { - background-position: -196px -4px; -} -.jstree-default-dark .jstree-anchor > .jstree-undetermined:hover { - background-position: -196px -36px; -} -.jstree-default-dark .jstree-checkbox-disabled { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default-dark > .jstree-striped { - background-size: auto 48px; -} -.jstree-default-dark.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); - background-position: 100% 1px; - background-repeat: repeat-y; -} -.jstree-default-dark.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark.jstree-rtl .jstree-open > .jstree-ocl { - background-position: -132px -36px; -} -.jstree-default-dark.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -100px -36px; -} -.jstree-default-dark.jstree-rtl .jstree-leaf > .jstree-ocl { - background-position: -68px -36px; -} -.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-node, -.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -36px -36px; -} -.jstree-default-dark.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -4px -36px; -} -.jstree-default-dark .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; -} -.jstree-default-dark > .jstree-container-ul .jstree-loading > .jstree-ocl { - background: url("throbber.gif") center center no-repeat; -} -.jstree-default-dark .jstree-file { - background: url("32px.png") -100px -68px no-repeat; -} -.jstree-default-dark .jstree-folder { - background: url("32px.png") -260px -4px no-repeat; -} -.jstree-default-dark > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; -} -#jstree-dnd.jstree-default-dark { - line-height: 24px; - padding: 0 4px; -} -#jstree-dnd.jstree-default-dark .jstree-ok, -#jstree-dnd.jstree-default-dark .jstree-er { - background-image: url("32px.png"); - background-repeat: no-repeat; - background-color: transparent; -} -#jstree-dnd.jstree-default-dark i { - background: transparent; - width: 24px; - height: 24px; - line-height: 24px; -} -#jstree-dnd.jstree-default-dark .jstree-ok { - background-position: -4px -68px; -} -#jstree-dnd.jstree-default-dark .jstree-er { - background-position: -36px -68px; -} -.jstree-default-dark.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); -} -.jstree-default-dark.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark-small .jstree-node { - min-height: 18px; - line-height: 18px; - margin-left: 18px; - min-width: 18px; -} -.jstree-default-dark-small .jstree-anchor { - line-height: 18px; - height: 18px; -} -.jstree-default-dark-small .jstree-icon { - width: 18px; - height: 18px; - line-height: 18px; -} -.jstree-default-dark-small .jstree-icon:empty { - width: 18px; - height: 18px; - line-height: 18px; -} -.jstree-default-dark-small.jstree-rtl .jstree-node { - margin-right: 18px; -} -.jstree-default-dark-small .jstree-wholerow { - height: 18px; -} -.jstree-default-dark-small .jstree-node, -.jstree-default-dark-small .jstree-icon { - background-image: url("32px.png"); -} -.jstree-default-dark-small .jstree-node { - background-position: -295px -7px; - background-repeat: repeat-y; -} -.jstree-default-dark-small .jstree-last { - background: transparent; -} -.jstree-default-dark-small .jstree-open > .jstree-ocl { - background-position: -135px -7px; -} -.jstree-default-dark-small .jstree-closed > .jstree-ocl { - background-position: -103px -7px; -} -.jstree-default-dark-small .jstree-leaf > .jstree-ocl { - background-position: -71px -7px; -} -.jstree-default-dark-small .jstree-themeicon { - background-position: -263px -7px; -} -.jstree-default-dark-small > .jstree-no-dots .jstree-node, -.jstree-default-dark-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-dark-small > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -39px -7px; -} -.jstree-default-dark-small > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -7px -7px; -} -.jstree-default-dark-small .jstree-disabled { - background: transparent; -} -.jstree-default-dark-small .jstree-disabled.jstree-hovered { - background: transparent; -} -.jstree-default-dark-small .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default-dark-small .jstree-checkbox { - background-position: -167px -7px; -} -.jstree-default-dark-small .jstree-checkbox:hover { - background-position: -167px -39px; -} -.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, -.jstree-default-dark-small .jstree-checked > .jstree-checkbox { - background-position: -231px -7px; -} -.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, -.jstree-default-dark-small .jstree-checked > .jstree-checkbox:hover { - background-position: -231px -39px; -} -.jstree-default-dark-small .jstree-anchor > .jstree-undetermined { - background-position: -199px -7px; -} -.jstree-default-dark-small .jstree-anchor > .jstree-undetermined:hover { - background-position: -199px -39px; -} -.jstree-default-dark-small .jstree-checkbox-disabled { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default-dark-small > .jstree-striped { - background-size: auto 36px; -} -.jstree-default-dark-small.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); - background-position: 100% 1px; - background-repeat: repeat-y; -} -.jstree-default-dark-small.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark-small.jstree-rtl .jstree-open > .jstree-ocl { - background-position: -135px -39px; -} -.jstree-default-dark-small.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -103px -39px; -} -.jstree-default-dark-small.jstree-rtl .jstree-leaf > .jstree-ocl { - background-position: -71px -39px; -} -.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-node, -.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -39px -39px; -} -.jstree-default-dark-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -7px -39px; -} -.jstree-default-dark-small .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; -} -.jstree-default-dark-small > .jstree-container-ul .jstree-loading > .jstree-ocl { - background: url("throbber.gif") center center no-repeat; -} -.jstree-default-dark-small .jstree-file { - background: url("32px.png") -103px -71px no-repeat; -} -.jstree-default-dark-small .jstree-folder { - background: url("32px.png") -263px -7px no-repeat; -} -.jstree-default-dark-small > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; -} -#jstree-dnd.jstree-default-dark-small { - line-height: 18px; - padding: 0 4px; -} -#jstree-dnd.jstree-default-dark-small .jstree-ok, -#jstree-dnd.jstree-default-dark-small .jstree-er { - background-image: url("32px.png"); - background-repeat: no-repeat; - background-color: transparent; -} -#jstree-dnd.jstree-default-dark-small i { - background: transparent; - width: 18px; - height: 18px; - line-height: 18px; -} -#jstree-dnd.jstree-default-dark-small .jstree-ok { - background-position: -7px -71px; -} -#jstree-dnd.jstree-default-dark-small .jstree-er { - background-position: -39px -71px; -} -.jstree-default-dark-small.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); -} -.jstree-default-dark-small.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark-large .jstree-node { - min-height: 32px; - line-height: 32px; - margin-left: 32px; - min-width: 32px; -} -.jstree-default-dark-large .jstree-anchor { - line-height: 32px; - height: 32px; -} -.jstree-default-dark-large .jstree-icon { - width: 32px; - height: 32px; - line-height: 32px; -} -.jstree-default-dark-large .jstree-icon:empty { - width: 32px; - height: 32px; - line-height: 32px; -} -.jstree-default-dark-large.jstree-rtl .jstree-node { - margin-right: 32px; -} -.jstree-default-dark-large .jstree-wholerow { - height: 32px; -} -.jstree-default-dark-large .jstree-node, -.jstree-default-dark-large .jstree-icon { - background-image: url("32px.png"); -} -.jstree-default-dark-large .jstree-node { - background-position: -288px 0px; - background-repeat: repeat-y; -} -.jstree-default-dark-large .jstree-last { - background: transparent; -} -.jstree-default-dark-large .jstree-open > .jstree-ocl { - background-position: -128px 0px; -} -.jstree-default-dark-large .jstree-closed > .jstree-ocl { - background-position: -96px 0px; -} -.jstree-default-dark-large .jstree-leaf > .jstree-ocl { - background-position: -64px 0px; -} -.jstree-default-dark-large .jstree-themeicon { - background-position: -256px 0px; -} -.jstree-default-dark-large > .jstree-no-dots .jstree-node, -.jstree-default-dark-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-dark-large > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -32px 0px; -} -.jstree-default-dark-large > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: 0px 0px; -} -.jstree-default-dark-large .jstree-disabled { - background: transparent; -} -.jstree-default-dark-large .jstree-disabled.jstree-hovered { - background: transparent; -} -.jstree-default-dark-large .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default-dark-large .jstree-checkbox { - background-position: -160px 0px; -} -.jstree-default-dark-large .jstree-checkbox:hover { - background-position: -160px -32px; -} -.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, -.jstree-default-dark-large .jstree-checked > .jstree-checkbox { - background-position: -224px 0px; -} -.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, -.jstree-default-dark-large .jstree-checked > .jstree-checkbox:hover { - background-position: -224px -32px; -} -.jstree-default-dark-large .jstree-anchor > .jstree-undetermined { - background-position: -192px 0px; -} -.jstree-default-dark-large .jstree-anchor > .jstree-undetermined:hover { - background-position: -192px -32px; -} -.jstree-default-dark-large .jstree-checkbox-disabled { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default-dark-large > .jstree-striped { - background-size: auto 64px; -} -.jstree-default-dark-large.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); - background-position: 100% 1px; - background-repeat: repeat-y; -} -.jstree-default-dark-large.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark-large.jstree-rtl .jstree-open > .jstree-ocl { - background-position: -128px -32px; -} -.jstree-default-dark-large.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -96px -32px; -} -.jstree-default-dark-large.jstree-rtl .jstree-leaf > .jstree-ocl { - background-position: -64px -32px; -} -.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-node, -.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -32px -32px; -} -.jstree-default-dark-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: 0px -32px; -} -.jstree-default-dark-large .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; -} -.jstree-default-dark-large > .jstree-container-ul .jstree-loading > .jstree-ocl { - background: url("throbber.gif") center center no-repeat; -} -.jstree-default-dark-large .jstree-file { - background: url("32px.png") -96px -64px no-repeat; -} -.jstree-default-dark-large .jstree-folder { - background: url("32px.png") -256px 0px no-repeat; -} -.jstree-default-dark-large > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; -} -#jstree-dnd.jstree-default-dark-large { - line-height: 32px; - padding: 0 4px; -} -#jstree-dnd.jstree-default-dark-large .jstree-ok, -#jstree-dnd.jstree-default-dark-large .jstree-er { - background-image: url("32px.png"); - background-repeat: no-repeat; - background-color: transparent; -} -#jstree-dnd.jstree-default-dark-large i { - background: transparent; - width: 32px; - height: 32px; - line-height: 32px; -} -#jstree-dnd.jstree-default-dark-large .jstree-ok { - background-position: 0px -64px; -} -#jstree-dnd.jstree-default-dark-large .jstree-er { - background-position: -32px -64px; -} -.jstree-default-dark-large.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); -} -.jstree-default-dark-large.jstree-rtl .jstree-last { - background: transparent; -} -@media (max-width: 768px) { - #jstree-dnd.jstree-dnd-responsive { - line-height: 40px; - font-weight: bold; - font-size: 1.1em; - text-shadow: 1px 1px white; - } - #jstree-dnd.jstree-dnd-responsive > i { - background: transparent; - width: 40px; - height: 40px; - } - #jstree-dnd.jstree-dnd-responsive > .jstree-ok { - background-image: url("40px.png"); - background-position: 0 -200px; - background-size: 120px 240px; - } - #jstree-dnd.jstree-dnd-responsive > .jstree-er { - background-image: url("40px.png"); - background-position: -40px -200px; - background-size: 120px 240px; - } - #jstree-marker.jstree-dnd-responsive { - border-left-width: 10px; - border-top-width: 10px; - border-bottom-width: 10px; - margin-top: -10px; - } -} -@media (max-width: 768px) { - .jstree-default-dark-responsive { - /* - .jstree-open > .jstree-ocl, - .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; } - */ - } - .jstree-default-dark-responsive .jstree-icon { - background-image: url("40px.png"); - } - .jstree-default-dark-responsive .jstree-node, - .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { - background: transparent; - } - .jstree-default-dark-responsive .jstree-node { - min-height: 40px; - line-height: 40px; - margin-left: 40px; - min-width: 40px; - white-space: nowrap; - } - .jstree-default-dark-responsive .jstree-anchor { - line-height: 40px; - height: 40px; - } - .jstree-default-dark-responsive .jstree-icon, - .jstree-default-dark-responsive .jstree-icon:empty { - width: 40px; - height: 40px; - line-height: 40px; - } - .jstree-default-dark-responsive > .jstree-container-ul > .jstree-node { - margin-left: 0; - } - .jstree-default-dark-responsive.jstree-rtl .jstree-node { - margin-left: 0; - margin-right: 40px; - } - .jstree-default-dark-responsive.jstree-rtl .jstree-container-ul > .jstree-node { - margin-right: 0; - } - .jstree-default-dark-responsive .jstree-ocl, - .jstree-default-dark-responsive .jstree-themeicon, - .jstree-default-dark-responsive .jstree-checkbox { - background-size: 120px 240px; - } - .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { - background: transparent; - } - .jstree-default-dark-responsive .jstree-open > .jstree-ocl { - background-position: 0 0px !important; - } - .jstree-default-dark-responsive .jstree-closed > .jstree-ocl { - background-position: 0 -40px !important; - } - .jstree-default-dark-responsive.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -40px 0px !important; - } - .jstree-default-dark-responsive .jstree-themeicon { - background-position: -40px -40px; - } - .jstree-default-dark-responsive .jstree-checkbox, - .jstree-default-dark-responsive .jstree-checkbox:hover { - background-position: -40px -80px; - } - .jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, - .jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, - .jstree-default-dark-responsive .jstree-checked > .jstree-checkbox, - .jstree-default-dark-responsive .jstree-checked > .jstree-checkbox:hover { - background-position: 0 -80px; - } - .jstree-default-dark-responsive .jstree-anchor > .jstree-undetermined, - .jstree-default-dark-responsive .jstree-anchor > .jstree-undetermined:hover { - background-position: 0 -120px; - } - .jstree-default-dark-responsive .jstree-anchor { - font-weight: bold; - font-size: 1.1em; - text-shadow: 1px 1px white; - } - .jstree-default-dark-responsive > .jstree-striped { - background: transparent; - } - .jstree-default-dark-responsive .jstree-wholerow { - border-top: 1px solid #666666; - border-bottom: 1px solid #000000; - background: #333333; - height: 40px; - } - .jstree-default-dark-responsive .jstree-wholerow-hovered { - background: #555555; - } - .jstree-default-dark-responsive .jstree-wholerow-clicked { - background: #5fa2db; - } - .jstree-default-dark-responsive .jstree-children .jstree-last > .jstree-wholerow { - box-shadow: inset 0 -6px 3px -5px #111111; - } - .jstree-default-dark-responsive .jstree-children .jstree-open > .jstree-wholerow { - box-shadow: inset 0 6px 3px -5px #111111; - border-top: 0; - } - .jstree-default-dark-responsive .jstree-children .jstree-open + .jstree-open { - box-shadow: none; - } - .jstree-default-dark-responsive .jstree-node, - .jstree-default-dark-responsive .jstree-icon, - .jstree-default-dark-responsive .jstree-node > .jstree-ocl, - .jstree-default-dark-responsive .jstree-themeicon, - .jstree-default-dark-responsive .jstree-checkbox { - background-image: url("40px.png"); - background-size: 120px 240px; - } - .jstree-default-dark-responsive .jstree-node { - background-position: -80px 0; - background-repeat: repeat-y; - } - .jstree-default-dark-responsive .jstree-last { - background: transparent; - } - .jstree-default-dark-responsive .jstree-leaf > .jstree-ocl { - background-position: -40px -120px; - } - .jstree-default-dark-responsive .jstree-last > .jstree-ocl { - background-position: -40px -160px; - } - .jstree-default-dark-responsive .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; - } - .jstree-default-dark-responsive .jstree-file { - background: url("40px.png") 0 -160px no-repeat; - background-size: 120px 240px; - } - .jstree-default-dark-responsive .jstree-folder { - background: url("40px.png") -40px -40px no-repeat; - background-size: 120px 240px; - } - .jstree-default-dark-responsive > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; - } -} -.jstree-default-dark { - background: #333; -} -.jstree-default-dark .jstree-anchor { - color: #999; - text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); -} -.jstree-default-dark .jstree-clicked, -.jstree-default-dark .jstree-checked { - color: white; -} -.jstree-default-dark .jstree-hovered { - color: white; -} -#jstree-marker.jstree-default-dark { - border-left-color: #999; - background: transparent; -} -.jstree-default-dark .jstree-anchor > .jstree-icon { - opacity: 0.75; -} -.jstree-default-dark .jstree-clicked > .jstree-icon, -.jstree-default-dark .jstree-hovered > .jstree-icon, -.jstree-default-dark .jstree-checked > .jstree-icon { - opacity: 1; -} -.jstree-default-dark.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); -} -.jstree-default-dark.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark-small.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); -} -.jstree-default-dark-small.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-dark-large.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); -} -.jstree-default-dark-large.jstree-rtl .jstree-last { - background: transparent; -} diff --git a/Resources/public/js/vendor/jstree/themes/default-dark/style.min.css b/Resources/public/js/vendor/jstree/themes/default-dark/style.min.css deleted file mode 100644 index eea330ac..00000000 --- a/Resources/public/js/vendor/jstree/themes/default-dark/style.min.css +++ /dev/null @@ -1 +0,0 @@ -.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;text-shadow:1px 1px 0 #fff;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;text-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-default-dark .jstree-node,.jstree-default-dark .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-default-dark .jstree-anchor,.jstree-default-dark .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default-dark .jstree-hovered{background:#555;border-radius:2px;box-shadow:inset 0 0 1px #555}.jstree-default-dark .jstree-clicked{background:#5fa2db;border-radius:2px;box-shadow:inset 0 0 1px #666}.jstree-default-dark .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default-dark .jstree-disabled{background:0 0;color:#666}.jstree-default-dark .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default-dark .jstree-disabled.jstree-clicked{background:#333}.jstree-default-dark .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-dark .jstree-search{font-style:italic;color:#fff;font-weight:700}.jstree-default-dark .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default-dark.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#555}.jstree-default-dark.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default-dark.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#555}.jstree-default-dark>.jstree-striped{min-width:100%;display:inline-block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default-dark>.jstree-wholerow-ul .jstree-hovered,.jstree-default-dark>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-default-dark .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default-dark .jstree-wholerow-hovered{background:#555}.jstree-default-dark .jstree-wholerow-clicked{background:#5fa2db;background:-webkit-linear-gradient(top,#5fa2db 0,#5fa2db 100%);background:linear-gradient(to bottom,#5fa2db 0,#5fa2db 100%)}.jstree-default-dark .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default-dark .jstree-anchor{line-height:24px;height:24px}.jstree-default-dark .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default-dark .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default-dark.jstree-rtl .jstree-node{margin-right:24px}.jstree-default-dark .jstree-wholerow{height:24px}.jstree-default-dark .jstree-node,.jstree-default-dark .jstree-icon{background-image:url(32px.png)}.jstree-default-dark .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default-dark .jstree-last{background:0 0}.jstree-default-dark .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default-dark .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default-dark .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default-dark .jstree-themeicon{background-position:-260px -4px}.jstree-default-dark>.jstree-no-dots .jstree-node,.jstree-default-dark>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default-dark>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default-dark .jstree-disabled{background:0 0}.jstree-default-dark .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-dark .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-dark .jstree-checkbox{background-position:-164px -4px}.jstree-default-dark .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default-dark.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark .jstree-checked>.jstree-checkbox{background-position:-228px -4px}.jstree-default-dark.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark .jstree-checked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default-dark .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default-dark .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default-dark .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-dark>.jstree-striped{background-size:auto 48px}.jstree-default-dark.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-dark.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default-dark.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default-dark.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default-dark.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default-dark .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-dark .jstree-file{background:url(32px.png) -100px -68px no-repeat}.jstree-default-dark .jstree-folder{background:url(32px.png) -260px -4px no-repeat}.jstree-default-dark>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-dark{line-height:24px;padding:0 4px}#jstree-dnd.jstree-default-dark .jstree-ok,#jstree-dnd.jstree-default-dark .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-dark i{background:0 0;width:24px;height:24px;line-height:24px}#jstree-dnd.jstree-default-dark .jstree-ok{background-position:-4px -68px}#jstree-dnd.jstree-default-dark .jstree-er{background-position:-36px -68px}.jstree-default-dark.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default-dark.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-dark-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-dark-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-dark-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-dark-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-dark-small .jstree-wholerow{height:18px}.jstree-default-dark-small .jstree-node,.jstree-default-dark-small .jstree-icon{background-image:url(32px.png)}.jstree-default-dark-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-dark-small .jstree-last{background:0 0}.jstree-default-dark-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-dark-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-dark-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-dark-small .jstree-themeicon{background-position:-263px -7px}.jstree-default-dark-small>.jstree-no-dots .jstree-node,.jstree-default-dark-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-dark-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-dark-small .jstree-disabled{background:0 0}.jstree-default-dark-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-dark-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-dark-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-dark-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-dark-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-dark-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-dark-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-dark-small .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-dark-small>.jstree-striped{background-size:auto 36px}.jstree-default-dark-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-dark-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-dark-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-dark-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-dark-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-dark-small .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-dark-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-default-dark-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-default-dark-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-dark-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-default-dark-small .jstree-ok,#jstree-dnd.jstree-default-dark-small .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-dark-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-default-dark-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-default-dark-small .jstree-er{background-position:-39px -71px}.jstree-default-dark-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-dark-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-dark-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-dark-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-dark-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-dark-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-dark-large .jstree-wholerow{height:32px}.jstree-default-dark-large .jstree-node,.jstree-default-dark-large .jstree-icon{background-image:url(32px.png)}.jstree-default-dark-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-dark-large .jstree-last{background:0 0}.jstree-default-dark-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-dark-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-dark-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-dark-large .jstree-themeicon{background-position:-256px 0}.jstree-default-dark-large>.jstree-no-dots .jstree-node,.jstree-default-dark-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-dark-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-dark-large .jstree-disabled{background:0 0}.jstree-default-dark-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-dark-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-dark-large .jstree-checkbox{background-position:-160px 0}.jstree-default-dark-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-default-dark-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-dark-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-dark-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-dark-large .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-dark-large>.jstree-striped{background-size:auto 64px}.jstree-default-dark-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-dark-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-dark-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-dark-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-dark-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-dark-large .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-dark-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-default-dark-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-default-dark-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-dark-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-default-dark-large .jstree-ok,#jstree-dnd.jstree-default-dark-large .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-dark-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-default-dark-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-default-dark-large .jstree-er{background-position:-32px -64px}.jstree-default-dark-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-dark-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:40px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:40px;height:40px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(40px.png);background-position:0 -200px;background-size:120px 240px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(40px.png);background-position:-40px -200px;background-size:120px 240px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-default-dark-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-dark-responsive .jstree-node,.jstree-default-dark-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-dark-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-dark-responsive .jstree-icon,.jstree-default-dark-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-dark-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-dark-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px}.jstree-default-dark-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-dark-responsive .jstree-ocl,.jstree-default-dark-responsive .jstree-themeicon,.jstree-default-dark-responsive .jstree-checkbox{background-size:120px 240px}.jstree-default-dark-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-dark-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-dark-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-dark-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-dark-responsive .jstree-themeicon{background-position:-40px -40px}.jstree-default-dark-responsive .jstree-checkbox,.jstree-default-dark-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-dark-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-dark-responsive .jstree-checked>.jstree-checkbox,.jstree-default-dark-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-dark-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-dark-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-dark-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-dark-responsive>.jstree-striped{background:0 0}.jstree-default-dark-responsive .jstree-wholerow{border-top:1px solid #666;border-bottom:1px solid #000;background:#333;height:40px}.jstree-default-dark-responsive .jstree-wholerow-hovered{background:#555}.jstree-default-dark-responsive .jstree-wholerow-clicked{background:#5fa2db}.jstree-default-dark-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #111}.jstree-default-dark-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #111;border-top:0}.jstree-default-dark-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-dark-responsive .jstree-node,.jstree-default-dark-responsive .jstree-icon,.jstree-default-dark-responsive .jstree-node>.jstree-ocl,.jstree-default-dark-responsive .jstree-themeicon,.jstree-default-dark-responsive .jstree-checkbox{background-image:url(40px.png);background-size:120px 240px}.jstree-default-dark-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-dark-responsive .jstree-last{background:0 0}.jstree-default-dark-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-dark-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-dark-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-dark-responsive .jstree-file{background:url(40px.png) 0 -160px no-repeat;background-size:120px 240px}.jstree-default-dark-responsive .jstree-folder{background:url(40px.png) -40px -40px no-repeat;background-size:120px 240px}.jstree-default-dark-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}}.jstree-default-dark{background:#333}.jstree-default-dark .jstree-anchor{color:#999;text-shadow:1px 1px 0 rgba(0,0,0,.5)}.jstree-default-dark .jstree-clicked,.jstree-default-dark .jstree-checked{color:#fff}.jstree-default-dark .jstree-hovered{color:#fff}#jstree-marker.jstree-default-dark{border-left-color:#999;background:0 0}.jstree-default-dark .jstree-anchor>.jstree-icon{opacity:.75}.jstree-default-dark .jstree-clicked>.jstree-icon,.jstree-default-dark .jstree-hovered>.jstree-icon,.jstree-default-dark .jstree-checked>.jstree-icon{opacity:1}.jstree-default-dark.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default-dark.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-dark-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-dark-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAACZmZl+9SADAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-dark-large.jstree-rtl .jstree-last{background:0 0} \ No newline at end of file diff --git a/Resources/public/js/vendor/jstree/themes/default-dark/throbber.gif b/Resources/public/js/vendor/jstree/themes/default-dark/throbber.gif deleted file mode 100644 index cd75035c..00000000 Binary files a/Resources/public/js/vendor/jstree/themes/default-dark/throbber.gif and /dev/null differ diff --git a/Resources/public/js/vendor/jstree/themes/default/32px.png b/Resources/public/js/vendor/jstree/themes/default/32px.png deleted file mode 100644 index 15327152..00000000 Binary files a/Resources/public/js/vendor/jstree/themes/default/32px.png and /dev/null differ diff --git a/Resources/public/js/vendor/jstree/themes/default/40px.png b/Resources/public/js/vendor/jstree/themes/default/40px.png deleted file mode 100644 index 1959347a..00000000 Binary files a/Resources/public/js/vendor/jstree/themes/default/40px.png and /dev/null differ diff --git a/Resources/public/js/vendor/jstree/themes/default/style.css b/Resources/public/js/vendor/jstree/themes/default/style.css deleted file mode 100644 index 85bd0d8d..00000000 --- a/Resources/public/js/vendor/jstree/themes/default/style.css +++ /dev/null @@ -1,1061 +0,0 @@ -/* jsTree default theme */ -.jstree-node, -.jstree-children, -.jstree-container-ul { - display: block; - margin: 0; - padding: 0; - list-style-type: none; - list-style-image: none; -} -.jstree-node { - white-space: nowrap; -} -.jstree-anchor { - display: inline-block; - color: black; - white-space: nowrap; - padding: 0 4px 0 1px; - margin: 0; - vertical-align: top; -} -.jstree-anchor:focus { - outline: 0; -} -.jstree-anchor, -.jstree-anchor:link, -.jstree-anchor:visited, -.jstree-anchor:hover, -.jstree-anchor:active { - text-decoration: none; - color: inherit; -} -.jstree-icon { - display: inline-block; - text-decoration: none; - margin: 0; - padding: 0; - vertical-align: top; - text-align: center; -} -.jstree-icon:empty { - display: inline-block; - text-decoration: none; - margin: 0; - padding: 0; - vertical-align: top; - text-align: center; -} -.jstree-ocl { - cursor: pointer; -} -.jstree-leaf > .jstree-ocl { - cursor: default; -} -.jstree .jstree-open > .jstree-children { - display: block; -} -.jstree .jstree-closed > .jstree-children, -.jstree .jstree-leaf > .jstree-children { - display: none; -} -.jstree-anchor > .jstree-themeicon { - margin-right: 2px; -} -.jstree-no-icons .jstree-themeicon, -.jstree-anchor > .jstree-themeicon-hidden { - display: none; -} -.jstree-hidden { - display: none; -} -.jstree-rtl .jstree-anchor { - padding: 0 1px 0 4px; -} -.jstree-rtl .jstree-anchor > .jstree-themeicon { - margin-left: 2px; - margin-right: 0; -} -.jstree-rtl .jstree-node { - margin-left: 0; -} -.jstree-rtl .jstree-container-ul > .jstree-node { - margin-right: 0; -} -.jstree-wholerow-ul { - position: relative; - display: inline-block; - min-width: 100%; -} -.jstree-wholerow-ul .jstree-leaf > .jstree-ocl { - cursor: pointer; -} -.jstree-wholerow-ul .jstree-anchor, -.jstree-wholerow-ul .jstree-icon { - position: relative; -} -.jstree-wholerow-ul .jstree-wholerow { - width: 100%; - cursor: pointer; - position: absolute; - left: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.vakata-context { - display: none; -} -.vakata-context, -.vakata-context ul { - margin: 0; - padding: 2px; - position: absolute; - background: #f5f5f5; - border: 1px solid #979797; - box-shadow: 2px 2px 2px #999999; -} -.vakata-context ul { - list-style: none; - left: 100%; - margin-top: -2.7em; - margin-left: -4px; -} -.vakata-context .vakata-context-right ul { - left: auto; - right: 100%; - margin-left: auto; - margin-right: -4px; -} -.vakata-context li { - list-style: none; - display: inline; -} -.vakata-context li > a { - display: block; - padding: 0 2em 0 2em; - text-decoration: none; - width: auto; - color: black; - white-space: nowrap; - line-height: 2.4em; - text-shadow: 1px 1px 0 white; - border-radius: 1px; -} -.vakata-context li > a:hover { - position: relative; - background-color: #e8eff7; - box-shadow: 0 0 2px #0a6aa1; -} -.vakata-context li > a.vakata-context-parent { - background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw=="); - background-position: right center; - background-repeat: no-repeat; -} -.vakata-context li > a:focus { - outline: 0; -} -.vakata-context .vakata-context-hover > a { - position: relative; - background-color: #e8eff7; - box-shadow: 0 0 2px #0a6aa1; -} -.vakata-context .vakata-context-separator > a, -.vakata-context .vakata-context-separator > a:hover { - background: white; - border: 0; - border-top: 1px solid #e2e3e3; - height: 1px; - min-height: 1px; - max-height: 1px; - padding: 0; - margin: 0 0 0 2.4em; - border-left: 1px solid #e0e0e0; - text-shadow: 0 0 0 transparent; - box-shadow: 0 0 0 transparent; - border-radius: 0; -} -.vakata-context .vakata-contextmenu-disabled a, -.vakata-context .vakata-contextmenu-disabled a:hover { - color: silver; - background-color: transparent; - border: 0; - box-shadow: 0 0 0; -} -.vakata-context li > a > i { - text-decoration: none; - display: inline-block; - width: 2.4em; - height: 2.4em; - background: transparent; - margin: 0 0 0 -2em; - vertical-align: top; - text-align: center; - line-height: 2.4em; -} -.vakata-context li > a > i:empty { - width: 2.4em; - line-height: 2.4em; -} -.vakata-context li > a .vakata-contextmenu-sep { - display: inline-block; - width: 1px; - height: 2.4em; - background: white; - margin: 0 0.5em 0 0; - border-left: 1px solid #e2e3e3; -} -.vakata-context .vakata-contextmenu-shortcut { - font-size: 0.8em; - color: silver; - opacity: 0.5; - display: none; -} -.vakata-context-rtl ul { - left: auto; - right: 100%; - margin-left: auto; - margin-right: -4px; -} -.vakata-context-rtl li > a.vakata-context-parent { - background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7"); - background-position: left center; - background-repeat: no-repeat; -} -.vakata-context-rtl .vakata-context-separator > a { - margin: 0 2.4em 0 0; - border-left: 0; - border-right: 1px solid #e2e3e3; -} -.vakata-context-rtl .vakata-context-left ul { - right: auto; - left: 100%; - margin-left: -4px; - margin-right: auto; -} -.vakata-context-rtl li > a > i { - margin: 0 -2em 0 0; -} -.vakata-context-rtl li > a .vakata-contextmenu-sep { - margin: 0 0 0 0.5em; - border-left-color: white; - background: #e2e3e3; -} -#jstree-marker { - position: absolute; - top: 0; - left: 0; - margin: -5px 0 0 0; - padding: 0; - border-right: 0; - border-top: 5px solid transparent; - border-bottom: 5px solid transparent; - border-left: 5px solid; - width: 0; - height: 0; - font-size: 0; - line-height: 0; -} -#jstree-dnd { - line-height: 16px; - margin: 0; - padding: 4px; -} -#jstree-dnd .jstree-icon, -#jstree-dnd .jstree-copy { - display: inline-block; - text-decoration: none; - margin: 0 2px 0 0; - padding: 0; - width: 16px; - height: 16px; -} -#jstree-dnd .jstree-ok { - background: green; -} -#jstree-dnd .jstree-er { - background: red; -} -#jstree-dnd .jstree-copy { - margin: 0 2px 0 2px; -} -.jstree-default .jstree-node, -.jstree-default .jstree-icon { - background-repeat: no-repeat; - background-color: transparent; -} -.jstree-default .jstree-anchor, -.jstree-default .jstree-wholerow { - transition: background-color 0.15s, box-shadow 0.15s; -} -.jstree-default .jstree-hovered { - background: #e7f4f9; - border-radius: 2px; - box-shadow: inset 0 0 1px #cccccc; -} -.jstree-default .jstree-clicked { - background: #beebff; - border-radius: 2px; - box-shadow: inset 0 0 1px #999999; -} -.jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon { - display: none; -} -.jstree-default .jstree-disabled { - background: transparent; - color: #666666; -} -.jstree-default .jstree-disabled.jstree-hovered { - background: transparent; - box-shadow: none; -} -.jstree-default .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default .jstree-disabled > .jstree-icon { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default .jstree-search { - font-style: italic; - color: #8b0000; - font-weight: bold; -} -.jstree-default .jstree-no-checkboxes .jstree-checkbox { - display: none !important; -} -.jstree-default.jstree-checkbox-no-clicked .jstree-clicked { - background: transparent; - box-shadow: none; -} -.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered { - background: #e7f4f9; -} -.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked { - background: transparent; -} -.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered { - background: #e7f4f9; -} -.jstree-default > .jstree-striped { - min-width: 100%; - display: inline-block; - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat; -} -.jstree-default > .jstree-wholerow-ul .jstree-hovered, -.jstree-default > .jstree-wholerow-ul .jstree-clicked { - background: transparent; - box-shadow: none; - border-radius: 0; -} -.jstree-default .jstree-wholerow { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.jstree-default .jstree-wholerow-hovered { - background: #e7f4f9; -} -.jstree-default .jstree-wholerow-clicked { - background: #beebff; - background: -webkit-linear-gradient(top, #beebff 0%, #a8e4ff 100%); - background: linear-gradient(to bottom, #beebff 0%, #a8e4ff 100%); -} -.jstree-default .jstree-node { - min-height: 24px; - line-height: 24px; - margin-left: 24px; - min-width: 24px; -} -.jstree-default .jstree-anchor { - line-height: 24px; - height: 24px; -} -.jstree-default .jstree-icon { - width: 24px; - height: 24px; - line-height: 24px; -} -.jstree-default .jstree-icon:empty { - width: 24px; - height: 24px; - line-height: 24px; -} -.jstree-default.jstree-rtl .jstree-node { - margin-right: 24px; -} -.jstree-default .jstree-wholerow { - height: 24px; -} -.jstree-default .jstree-node, -.jstree-default .jstree-icon { - background-image: url("32px.png"); -} -.jstree-default .jstree-node { - background-position: -292px -4px; - background-repeat: repeat-y; -} -.jstree-default .jstree-last { - background: transparent; -} -.jstree-default .jstree-open > .jstree-ocl { - background-position: -132px -4px; -} -.jstree-default .jstree-closed > .jstree-ocl { - background-position: -100px -4px; -} -.jstree-default .jstree-leaf > .jstree-ocl { - background-position: -68px -4px; -} -.jstree-default .jstree-themeicon { - background-position: -260px -4px; -} -.jstree-default > .jstree-no-dots .jstree-node, -.jstree-default > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -36px -4px; -} -.jstree-default > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -4px -4px; -} -.jstree-default .jstree-disabled { - background: transparent; -} -.jstree-default .jstree-disabled.jstree-hovered { - background: transparent; -} -.jstree-default .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default .jstree-checkbox { - background-position: -164px -4px; -} -.jstree-default .jstree-checkbox:hover { - background-position: -164px -36px; -} -.jstree-default.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, -.jstree-default .jstree-checked > .jstree-checkbox { - background-position: -228px -4px; -} -.jstree-default.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, -.jstree-default .jstree-checked > .jstree-checkbox:hover { - background-position: -228px -36px; -} -.jstree-default .jstree-anchor > .jstree-undetermined { - background-position: -196px -4px; -} -.jstree-default .jstree-anchor > .jstree-undetermined:hover { - background-position: -196px -36px; -} -.jstree-default .jstree-checkbox-disabled { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default > .jstree-striped { - background-size: auto 48px; -} -.jstree-default.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); - background-position: 100% 1px; - background-repeat: repeat-y; -} -.jstree-default.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default.jstree-rtl .jstree-open > .jstree-ocl { - background-position: -132px -36px; -} -.jstree-default.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -100px -36px; -} -.jstree-default.jstree-rtl .jstree-leaf > .jstree-ocl { - background-position: -68px -36px; -} -.jstree-default.jstree-rtl > .jstree-no-dots .jstree-node, -.jstree-default.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -36px -36px; -} -.jstree-default.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -4px -36px; -} -.jstree-default .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; -} -.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl { - background: url("throbber.gif") center center no-repeat; -} -.jstree-default .jstree-file { - background: url("32px.png") -100px -68px no-repeat; -} -.jstree-default .jstree-folder { - background: url("32px.png") -260px -4px no-repeat; -} -.jstree-default > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; -} -#jstree-dnd.jstree-default { - line-height: 24px; - padding: 0 4px; -} -#jstree-dnd.jstree-default .jstree-ok, -#jstree-dnd.jstree-default .jstree-er { - background-image: url("32px.png"); - background-repeat: no-repeat; - background-color: transparent; -} -#jstree-dnd.jstree-default i { - background: transparent; - width: 24px; - height: 24px; - line-height: 24px; -} -#jstree-dnd.jstree-default .jstree-ok { - background-position: -4px -68px; -} -#jstree-dnd.jstree-default .jstree-er { - background-position: -36px -68px; -} -.jstree-default.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); -} -.jstree-default.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-small .jstree-node { - min-height: 18px; - line-height: 18px; - margin-left: 18px; - min-width: 18px; -} -.jstree-default-small .jstree-anchor { - line-height: 18px; - height: 18px; -} -.jstree-default-small .jstree-icon { - width: 18px; - height: 18px; - line-height: 18px; -} -.jstree-default-small .jstree-icon:empty { - width: 18px; - height: 18px; - line-height: 18px; -} -.jstree-default-small.jstree-rtl .jstree-node { - margin-right: 18px; -} -.jstree-default-small .jstree-wholerow { - height: 18px; -} -.jstree-default-small .jstree-node, -.jstree-default-small .jstree-icon { - background-image: url("32px.png"); -} -.jstree-default-small .jstree-node { - background-position: -295px -7px; - background-repeat: repeat-y; -} -.jstree-default-small .jstree-last { - background: transparent; -} -.jstree-default-small .jstree-open > .jstree-ocl { - background-position: -135px -7px; -} -.jstree-default-small .jstree-closed > .jstree-ocl { - background-position: -103px -7px; -} -.jstree-default-small .jstree-leaf > .jstree-ocl { - background-position: -71px -7px; -} -.jstree-default-small .jstree-themeicon { - background-position: -263px -7px; -} -.jstree-default-small > .jstree-no-dots .jstree-node, -.jstree-default-small > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-small > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -39px -7px; -} -.jstree-default-small > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -7px -7px; -} -.jstree-default-small .jstree-disabled { - background: transparent; -} -.jstree-default-small .jstree-disabled.jstree-hovered { - background: transparent; -} -.jstree-default-small .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default-small .jstree-checkbox { - background-position: -167px -7px; -} -.jstree-default-small .jstree-checkbox:hover { - background-position: -167px -39px; -} -.jstree-default-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, -.jstree-default-small .jstree-checked > .jstree-checkbox { - background-position: -231px -7px; -} -.jstree-default-small.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, -.jstree-default-small .jstree-checked > .jstree-checkbox:hover { - background-position: -231px -39px; -} -.jstree-default-small .jstree-anchor > .jstree-undetermined { - background-position: -199px -7px; -} -.jstree-default-small .jstree-anchor > .jstree-undetermined:hover { - background-position: -199px -39px; -} -.jstree-default-small .jstree-checkbox-disabled { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default-small > .jstree-striped { - background-size: auto 36px; -} -.jstree-default-small.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); - background-position: 100% 1px; - background-repeat: repeat-y; -} -.jstree-default-small.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-small.jstree-rtl .jstree-open > .jstree-ocl { - background-position: -135px -39px; -} -.jstree-default-small.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -103px -39px; -} -.jstree-default-small.jstree-rtl .jstree-leaf > .jstree-ocl { - background-position: -71px -39px; -} -.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-node, -.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -39px -39px; -} -.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: -7px -39px; -} -.jstree-default-small .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; -} -.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl { - background: url("throbber.gif") center center no-repeat; -} -.jstree-default-small .jstree-file { - background: url("32px.png") -103px -71px no-repeat; -} -.jstree-default-small .jstree-folder { - background: url("32px.png") -263px -7px no-repeat; -} -.jstree-default-small > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; -} -#jstree-dnd.jstree-default-small { - line-height: 18px; - padding: 0 4px; -} -#jstree-dnd.jstree-default-small .jstree-ok, -#jstree-dnd.jstree-default-small .jstree-er { - background-image: url("32px.png"); - background-repeat: no-repeat; - background-color: transparent; -} -#jstree-dnd.jstree-default-small i { - background: transparent; - width: 18px; - height: 18px; - line-height: 18px; -} -#jstree-dnd.jstree-default-small .jstree-ok { - background-position: -7px -71px; -} -#jstree-dnd.jstree-default-small .jstree-er { - background-position: -39px -71px; -} -.jstree-default-small.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg=="); -} -.jstree-default-small.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-large .jstree-node { - min-height: 32px; - line-height: 32px; - margin-left: 32px; - min-width: 32px; -} -.jstree-default-large .jstree-anchor { - line-height: 32px; - height: 32px; -} -.jstree-default-large .jstree-icon { - width: 32px; - height: 32px; - line-height: 32px; -} -.jstree-default-large .jstree-icon:empty { - width: 32px; - height: 32px; - line-height: 32px; -} -.jstree-default-large.jstree-rtl .jstree-node { - margin-right: 32px; -} -.jstree-default-large .jstree-wholerow { - height: 32px; -} -.jstree-default-large .jstree-node, -.jstree-default-large .jstree-icon { - background-image: url("32px.png"); -} -.jstree-default-large .jstree-node { - background-position: -288px 0px; - background-repeat: repeat-y; -} -.jstree-default-large .jstree-last { - background: transparent; -} -.jstree-default-large .jstree-open > .jstree-ocl { - background-position: -128px 0px; -} -.jstree-default-large .jstree-closed > .jstree-ocl { - background-position: -96px 0px; -} -.jstree-default-large .jstree-leaf > .jstree-ocl { - background-position: -64px 0px; -} -.jstree-default-large .jstree-themeicon { - background-position: -256px 0px; -} -.jstree-default-large > .jstree-no-dots .jstree-node, -.jstree-default-large > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-large > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -32px 0px; -} -.jstree-default-large > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: 0px 0px; -} -.jstree-default-large .jstree-disabled { - background: transparent; -} -.jstree-default-large .jstree-disabled.jstree-hovered { - background: transparent; -} -.jstree-default-large .jstree-disabled.jstree-clicked { - background: #efefef; -} -.jstree-default-large .jstree-checkbox { - background-position: -160px 0px; -} -.jstree-default-large .jstree-checkbox:hover { - background-position: -160px -32px; -} -.jstree-default-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, -.jstree-default-large .jstree-checked > .jstree-checkbox { - background-position: -224px 0px; -} -.jstree-default-large.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, -.jstree-default-large .jstree-checked > .jstree-checkbox:hover { - background-position: -224px -32px; -} -.jstree-default-large .jstree-anchor > .jstree-undetermined { - background-position: -192px 0px; -} -.jstree-default-large .jstree-anchor > .jstree-undetermined:hover { - background-position: -192px -32px; -} -.jstree-default-large .jstree-checkbox-disabled { - opacity: 0.8; - filter: url("data:image/svg+xml;utf8,#jstree-grayscale"); - /* Firefox 10+ */ - filter: gray; - /* IE6-9 */ - -webkit-filter: grayscale(100%); - /* Chrome 19+ & Safari 6+ */ -} -.jstree-default-large > .jstree-striped { - background-size: auto 64px; -} -.jstree-default-large.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg=="); - background-position: 100% 1px; - background-repeat: repeat-y; -} -.jstree-default-large.jstree-rtl .jstree-last { - background: transparent; -} -.jstree-default-large.jstree-rtl .jstree-open > .jstree-ocl { - background-position: -128px -32px; -} -.jstree-default-large.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -96px -32px; -} -.jstree-default-large.jstree-rtl .jstree-leaf > .jstree-ocl { - background-position: -64px -32px; -} -.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-node, -.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl { - background: transparent; -} -.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl { - background-position: -32px -32px; -} -.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl { - background-position: 0px -32px; -} -.jstree-default-large .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; -} -.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl { - background: url("throbber.gif") center center no-repeat; -} -.jstree-default-large .jstree-file { - background: url("32px.png") -96px -64px no-repeat; -} -.jstree-default-large .jstree-folder { - background: url("32px.png") -256px 0px no-repeat; -} -.jstree-default-large > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; -} -#jstree-dnd.jstree-default-large { - line-height: 32px; - padding: 0 4px; -} -#jstree-dnd.jstree-default-large .jstree-ok, -#jstree-dnd.jstree-default-large .jstree-er { - background-image: url("32px.png"); - background-repeat: no-repeat; - background-color: transparent; -} -#jstree-dnd.jstree-default-large i { - background: transparent; - width: 32px; - height: 32px; - line-height: 32px; -} -#jstree-dnd.jstree-default-large .jstree-ok { - background-position: 0px -64px; -} -#jstree-dnd.jstree-default-large .jstree-er { - background-position: -32px -64px; -} -.jstree-default-large.jstree-rtl .jstree-node { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg=="); -} -.jstree-default-large.jstree-rtl .jstree-last { - background: transparent; -} -@media (max-width: 768px) { - #jstree-dnd.jstree-dnd-responsive { - line-height: 40px; - font-weight: bold; - font-size: 1.1em; - text-shadow: 1px 1px white; - } - #jstree-dnd.jstree-dnd-responsive > i { - background: transparent; - width: 40px; - height: 40px; - } - #jstree-dnd.jstree-dnd-responsive > .jstree-ok { - background-image: url("40px.png"); - background-position: 0 -200px; - background-size: 120px 240px; - } - #jstree-dnd.jstree-dnd-responsive > .jstree-er { - background-image: url("40px.png"); - background-position: -40px -200px; - background-size: 120px 240px; - } - #jstree-marker.jstree-dnd-responsive { - border-left-width: 10px; - border-top-width: 10px; - border-bottom-width: 10px; - margin-top: -10px; - } -} -@media (max-width: 768px) { - .jstree-default-responsive { - /* - .jstree-open > .jstree-ocl, - .jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; } - */ - } - .jstree-default-responsive .jstree-icon { - background-image: url("40px.png"); - } - .jstree-default-responsive .jstree-node, - .jstree-default-responsive .jstree-leaf > .jstree-ocl { - background: transparent; - } - .jstree-default-responsive .jstree-node { - min-height: 40px; - line-height: 40px; - margin-left: 40px; - min-width: 40px; - white-space: nowrap; - } - .jstree-default-responsive .jstree-anchor { - line-height: 40px; - height: 40px; - } - .jstree-default-responsive .jstree-icon, - .jstree-default-responsive .jstree-icon:empty { - width: 40px; - height: 40px; - line-height: 40px; - } - .jstree-default-responsive > .jstree-container-ul > .jstree-node { - margin-left: 0; - } - .jstree-default-responsive.jstree-rtl .jstree-node { - margin-left: 0; - margin-right: 40px; - } - .jstree-default-responsive.jstree-rtl .jstree-container-ul > .jstree-node { - margin-right: 0; - } - .jstree-default-responsive .jstree-ocl, - .jstree-default-responsive .jstree-themeicon, - .jstree-default-responsive .jstree-checkbox { - background-size: 120px 240px; - } - .jstree-default-responsive .jstree-leaf > .jstree-ocl { - background: transparent; - } - .jstree-default-responsive .jstree-open > .jstree-ocl { - background-position: 0 0px !important; - } - .jstree-default-responsive .jstree-closed > .jstree-ocl { - background-position: 0 -40px !important; - } - .jstree-default-responsive.jstree-rtl .jstree-closed > .jstree-ocl { - background-position: -40px 0px !important; - } - .jstree-default-responsive .jstree-themeicon { - background-position: -40px -40px; - } - .jstree-default-responsive .jstree-checkbox, - .jstree-default-responsive .jstree-checkbox:hover { - background-position: -40px -80px; - } - .jstree-default-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox, - .jstree-default-responsive.jstree-checkbox-selection .jstree-clicked > .jstree-checkbox:hover, - .jstree-default-responsive .jstree-checked > .jstree-checkbox, - .jstree-default-responsive .jstree-checked > .jstree-checkbox:hover { - background-position: 0 -80px; - } - .jstree-default-responsive .jstree-anchor > .jstree-undetermined, - .jstree-default-responsive .jstree-anchor > .jstree-undetermined:hover { - background-position: 0 -120px; - } - .jstree-default-responsive .jstree-anchor { - font-weight: bold; - font-size: 1.1em; - text-shadow: 1px 1px white; - } - .jstree-default-responsive > .jstree-striped { - background: transparent; - } - .jstree-default-responsive .jstree-wholerow { - border-top: 1px solid rgba(255, 255, 255, 0.7); - border-bottom: 1px solid rgba(64, 64, 64, 0.2); - background: #ebebeb; - height: 40px; - } - .jstree-default-responsive .jstree-wholerow-hovered { - background: #e7f4f9; - } - .jstree-default-responsive .jstree-wholerow-clicked { - background: #beebff; - } - .jstree-default-responsive .jstree-children .jstree-last > .jstree-wholerow { - box-shadow: inset 0 -6px 3px -5px #666666; - } - .jstree-default-responsive .jstree-children .jstree-open > .jstree-wholerow { - box-shadow: inset 0 6px 3px -5px #666666; - border-top: 0; - } - .jstree-default-responsive .jstree-children .jstree-open + .jstree-open { - box-shadow: none; - } - .jstree-default-responsive .jstree-node, - .jstree-default-responsive .jstree-icon, - .jstree-default-responsive .jstree-node > .jstree-ocl, - .jstree-default-responsive .jstree-themeicon, - .jstree-default-responsive .jstree-checkbox { - background-image: url("40px.png"); - background-size: 120px 240px; - } - .jstree-default-responsive .jstree-node { - background-position: -80px 0; - background-repeat: repeat-y; - } - .jstree-default-responsive .jstree-last { - background: transparent; - } - .jstree-default-responsive .jstree-leaf > .jstree-ocl { - background-position: -40px -120px; - } - .jstree-default-responsive .jstree-last > .jstree-ocl { - background-position: -40px -160px; - } - .jstree-default-responsive .jstree-themeicon-custom { - background-color: transparent; - background-image: none; - background-position: 0 0; - } - .jstree-default-responsive .jstree-file { - background: url("40px.png") 0 -160px no-repeat; - background-size: 120px 240px; - } - .jstree-default-responsive .jstree-folder { - background: url("40px.png") -40px -40px no-repeat; - background-size: 120px 240px; - } - .jstree-default-responsive > .jstree-container-ul > .jstree-node { - margin-left: 0; - margin-right: 0; - } -} diff --git a/Resources/public/js/vendor/jstree/themes/default/style.min.css b/Resources/public/js/vendor/jstree/themes/default/style.min.css deleted file mode 100644 index a24ff301..00000000 --- a/Resources/public/js/vendor/jstree/themes/default/style.min.css +++ /dev/null @@ -1 +0,0 @@ -.jstree-node,.jstree-children,.jstree-container-ul{display:block;margin:0;padding:0;list-style-type:none;list-style-image:none}.jstree-node{white-space:nowrap}.jstree-anchor{display:inline-block;color:#000;white-space:nowrap;padding:0 4px 0 1px;margin:0;vertical-align:top}.jstree-anchor:focus{outline:0}.jstree-anchor,.jstree-anchor:link,.jstree-anchor:visited,.jstree-anchor:hover,.jstree-anchor:active{text-decoration:none;color:inherit}.jstree-icon{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-icon:empty{display:inline-block;text-decoration:none;margin:0;padding:0;vertical-align:top;text-align:center}.jstree-ocl{cursor:pointer}.jstree-leaf>.jstree-ocl{cursor:default}.jstree .jstree-open>.jstree-children{display:block}.jstree .jstree-closed>.jstree-children,.jstree .jstree-leaf>.jstree-children{display:none}.jstree-anchor>.jstree-themeicon{margin-right:2px}.jstree-no-icons .jstree-themeicon,.jstree-anchor>.jstree-themeicon-hidden{display:none}.jstree-hidden{display:none}.jstree-rtl .jstree-anchor{padding:0 1px 0 4px}.jstree-rtl .jstree-anchor>.jstree-themeicon{margin-left:2px;margin-right:0}.jstree-rtl .jstree-node{margin-left:0}.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-wholerow-ul{position:relative;display:inline-block;min-width:100%}.jstree-wholerow-ul .jstree-leaf>.jstree-ocl{cursor:pointer}.jstree-wholerow-ul .jstree-anchor,.jstree-wholerow-ul .jstree-icon{position:relative}.jstree-wholerow-ul .jstree-wholerow{width:100%;cursor:pointer;position:absolute;left:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vakata-context{display:none}.vakata-context,.vakata-context ul{margin:0;padding:2px;position:absolute;background:#f5f5f5;border:1px solid #979797;box-shadow:2px 2px 2px #999}.vakata-context ul{list-style:none;left:100%;margin-top:-2.7em;margin-left:-4px}.vakata-context .vakata-context-right ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context li{list-style:none;display:inline}.vakata-context li>a{display:block;padding:0 2em;text-decoration:none;width:auto;color:#000;white-space:nowrap;line-height:2.4em;text-shadow:1px 1px 0 #fff;border-radius:1px}.vakata-context li>a:hover{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==);background-position:right center;background-repeat:no-repeat}.vakata-context li>a:focus{outline:0}.vakata-context .vakata-context-hover>a{position:relative;background-color:#e8eff7;box-shadow:0 0 2px #0a6aa1}.vakata-context .vakata-context-separator>a,.vakata-context .vakata-context-separator>a:hover{background:#fff;border:0;border-top:1px solid #e2e3e3;height:1px;min-height:1px;max-height:1px;padding:0;margin:0 0 0 2.4em;border-left:1px solid #e0e0e0;text-shadow:0 0 0 transparent;box-shadow:0 0 0 transparent;border-radius:0}.vakata-context .vakata-contextmenu-disabled a,.vakata-context .vakata-contextmenu-disabled a:hover{color:silver;background-color:transparent;border:0;box-shadow:0 0 0}.vakata-context li>a>i{text-decoration:none;display:inline-block;width:2.4em;height:2.4em;background:0 0;margin:0 0 0 -2em;vertical-align:top;text-align:center;line-height:2.4em}.vakata-context li>a>i:empty{width:2.4em;line-height:2.4em}.vakata-context li>a .vakata-contextmenu-sep{display:inline-block;width:1px;height:2.4em;background:#fff;margin:0 .5em 0 0;border-left:1px solid #e2e3e3}.vakata-context .vakata-contextmenu-shortcut{font-size:.8em;color:silver;opacity:.5;display:none}.vakata-context-rtl ul{left:auto;right:100%;margin-left:auto;margin-right:-4px}.vakata-context-rtl li>a.vakata-context-parent{background-image:url(data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7);background-position:left center;background-repeat:no-repeat}.vakata-context-rtl .vakata-context-separator>a{margin:0 2.4em 0 0;border-left:0;border-right:1px solid #e2e3e3}.vakata-context-rtl .vakata-context-left ul{right:auto;left:100%;margin-left:-4px;margin-right:auto}.vakata-context-rtl li>a>i{margin:0 -2em 0 0}.vakata-context-rtl li>a .vakata-contextmenu-sep{margin:0 0 0 .5em;border-left-color:#fff;background:#e2e3e3}#jstree-marker{position:absolute;top:0;left:0;margin:-5px 0 0 0;padding:0;border-right:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid;width:0;height:0;font-size:0;line-height:0}#jstree-dnd{line-height:16px;margin:0;padding:4px}#jstree-dnd .jstree-icon,#jstree-dnd .jstree-copy{display:inline-block;text-decoration:none;margin:0 2px 0 0;padding:0;width:16px;height:16px}#jstree-dnd .jstree-ok{background:green}#jstree-dnd .jstree-er{background:red}#jstree-dnd .jstree-copy{margin:0 2px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-repeat:no-repeat;background-color:transparent}.jstree-default .jstree-anchor,.jstree-default .jstree-wholerow{transition:background-color .15s,box-shadow .15s}.jstree-default .jstree-hovered{background:#e7f4f9;border-radius:2px;box-shadow:inset 0 0 1px #ccc}.jstree-default .jstree-clicked{background:#beebff;border-radius:2px;box-shadow:inset 0 0 1px #999}.jstree-default .jstree-no-icons .jstree-anchor>.jstree-themeicon{display:none}.jstree-default .jstree-disabled{background:0 0;color:#666}.jstree-default .jstree-disabled.jstree-hovered{background:0 0;box-shadow:none}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-disabled>.jstree-icon{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default .jstree-search{font-style:italic;color:#8b0000;font-weight:700}.jstree-default .jstree-no-checkboxes .jstree-checkbox{display:none!important}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked{background:0 0;box-shadow:none}.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered{background:#e7f4f9}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked{background:0 0}.jstree-default.jstree-checkbox-no-clicked>.jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered{background:#e7f4f9}.jstree-default>.jstree-striped{min-width:100%;display:inline-block;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==) left top repeat}.jstree-default>.jstree-wholerow-ul .jstree-hovered,.jstree-default>.jstree-wholerow-ul .jstree-clicked{background:0 0;box-shadow:none;border-radius:0}.jstree-default .jstree-wholerow{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.jstree-default .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default .jstree-wholerow-clicked{background:#beebff;background:-webkit-linear-gradient(top,#beebff 0,#a8e4ff 100%);background:linear-gradient(to bottom,#beebff 0,#a8e4ff 100%)}.jstree-default .jstree-node{min-height:24px;line-height:24px;margin-left:24px;min-width:24px}.jstree-default .jstree-anchor{line-height:24px;height:24px}.jstree-default .jstree-icon{width:24px;height:24px;line-height:24px}.jstree-default .jstree-icon:empty{width:24px;height:24px;line-height:24px}.jstree-default.jstree-rtl .jstree-node{margin-right:24px}.jstree-default .jstree-wholerow{height:24px}.jstree-default .jstree-node,.jstree-default .jstree-icon{background-image:url(32px.png)}.jstree-default .jstree-node{background-position:-292px -4px;background-repeat:repeat-y}.jstree-default .jstree-last{background:0 0}.jstree-default .jstree-open>.jstree-ocl{background-position:-132px -4px}.jstree-default .jstree-closed>.jstree-ocl{background-position:-100px -4px}.jstree-default .jstree-leaf>.jstree-ocl{background-position:-68px -4px}.jstree-default .jstree-themeicon{background-position:-260px -4px}.jstree-default>.jstree-no-dots .jstree-node,.jstree-default>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -4px}.jstree-default>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -4px}.jstree-default .jstree-disabled{background:0 0}.jstree-default .jstree-disabled.jstree-hovered{background:0 0}.jstree-default .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default .jstree-checkbox{background-position:-164px -4px}.jstree-default .jstree-checkbox:hover{background-position:-164px -36px}.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default .jstree-checked>.jstree-checkbox{background-position:-228px -4px}.jstree-default.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default .jstree-checked>.jstree-checkbox:hover{background-position:-228px -36px}.jstree-default .jstree-anchor>.jstree-undetermined{background-position:-196px -4px}.jstree-default .jstree-anchor>.jstree-undetermined:hover{background-position:-196px -36px}.jstree-default .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default>.jstree-striped{background-size:auto 48px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default.jstree-rtl .jstree-open>.jstree-ocl{background-position:-132px -36px}.jstree-default.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-100px -36px}.jstree-default.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-68px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-36px -36px}.jstree-default.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-4px -36px}.jstree-default .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default .jstree-file{background:url(32px.png) -100px -68px no-repeat}.jstree-default .jstree-folder{background:url(32px.png) -260px -4px no-repeat}.jstree-default>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default{line-height:24px;padding:0 4px}#jstree-dnd.jstree-default .jstree-ok,#jstree-dnd.jstree-default .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default i{background:0 0;width:24px;height:24px;line-height:24px}#jstree-dnd.jstree-default .jstree-ok{background-position:-4px -68px}#jstree-dnd.jstree-default .jstree-er{background-position:-36px -68px}.jstree-default.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==)}.jstree-default.jstree-rtl .jstree-last{background:0 0}.jstree-default-small .jstree-node{min-height:18px;line-height:18px;margin-left:18px;min-width:18px}.jstree-default-small .jstree-anchor{line-height:18px;height:18px}.jstree-default-small .jstree-icon{width:18px;height:18px;line-height:18px}.jstree-default-small .jstree-icon:empty{width:18px;height:18px;line-height:18px}.jstree-default-small.jstree-rtl .jstree-node{margin-right:18px}.jstree-default-small .jstree-wholerow{height:18px}.jstree-default-small .jstree-node,.jstree-default-small .jstree-icon{background-image:url(32px.png)}.jstree-default-small .jstree-node{background-position:-295px -7px;background-repeat:repeat-y}.jstree-default-small .jstree-last{background:0 0}.jstree-default-small .jstree-open>.jstree-ocl{background-position:-135px -7px}.jstree-default-small .jstree-closed>.jstree-ocl{background-position:-103px -7px}.jstree-default-small .jstree-leaf>.jstree-ocl{background-position:-71px -7px}.jstree-default-small .jstree-themeicon{background-position:-263px -7px}.jstree-default-small>.jstree-no-dots .jstree-node,.jstree-default-small>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -7px}.jstree-default-small>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -7px}.jstree-default-small .jstree-disabled{background:0 0}.jstree-default-small .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-small .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-small .jstree-checkbox{background-position:-167px -7px}.jstree-default-small .jstree-checkbox:hover{background-position:-167px -39px}.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-small .jstree-checked>.jstree-checkbox{background-position:-231px -7px}.jstree-default-small.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-small .jstree-checked>.jstree-checkbox:hover{background-position:-231px -39px}.jstree-default-small .jstree-anchor>.jstree-undetermined{background-position:-199px -7px}.jstree-default-small .jstree-anchor>.jstree-undetermined:hover{background-position:-199px -39px}.jstree-default-small .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-small>.jstree-striped{background-size:auto 36px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-small.jstree-rtl .jstree-open>.jstree-ocl{background-position:-135px -39px}.jstree-default-small.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-103px -39px}.jstree-default-small.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-71px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-39px -39px}.jstree-default-small.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:-7px -39px}.jstree-default-small .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-small>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-small .jstree-file{background:url(32px.png) -103px -71px no-repeat}.jstree-default-small .jstree-folder{background:url(32px.png) -263px -7px no-repeat}.jstree-default-small>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-small{line-height:18px;padding:0 4px}#jstree-dnd.jstree-default-small .jstree-ok,#jstree-dnd.jstree-default-small .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-small i{background:0 0;width:18px;height:18px;line-height:18px}#jstree-dnd.jstree-default-small .jstree-ok{background-position:-7px -71px}#jstree-dnd.jstree-default-small .jstree-er{background-position:-39px -71px}.jstree-default-small.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==)}.jstree-default-small.jstree-rtl .jstree-last{background:0 0}.jstree-default-large .jstree-node{min-height:32px;line-height:32px;margin-left:32px;min-width:32px}.jstree-default-large .jstree-anchor{line-height:32px;height:32px}.jstree-default-large .jstree-icon{width:32px;height:32px;line-height:32px}.jstree-default-large .jstree-icon:empty{width:32px;height:32px;line-height:32px}.jstree-default-large.jstree-rtl .jstree-node{margin-right:32px}.jstree-default-large .jstree-wholerow{height:32px}.jstree-default-large .jstree-node,.jstree-default-large .jstree-icon{background-image:url(32px.png)}.jstree-default-large .jstree-node{background-position:-288px 0;background-repeat:repeat-y}.jstree-default-large .jstree-last{background:0 0}.jstree-default-large .jstree-open>.jstree-ocl{background-position:-128px 0}.jstree-default-large .jstree-closed>.jstree-ocl{background-position:-96px 0}.jstree-default-large .jstree-leaf>.jstree-ocl{background-position:-64px 0}.jstree-default-large .jstree-themeicon{background-position:-256px 0}.jstree-default-large>.jstree-no-dots .jstree-node,.jstree-default-large>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px 0}.jstree-default-large>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 0}.jstree-default-large .jstree-disabled{background:0 0}.jstree-default-large .jstree-disabled.jstree-hovered{background:0 0}.jstree-default-large .jstree-disabled.jstree-clicked{background:#efefef}.jstree-default-large .jstree-checkbox{background-position:-160px 0}.jstree-default-large .jstree-checkbox:hover{background-position:-160px -32px}.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-large .jstree-checked>.jstree-checkbox{background-position:-224px 0}.jstree-default-large.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-large .jstree-checked>.jstree-checkbox:hover{background-position:-224px -32px}.jstree-default-large .jstree-anchor>.jstree-undetermined{background-position:-192px 0}.jstree-default-large .jstree-anchor>.jstree-undetermined:hover{background-position:-192px -32px}.jstree-default-large .jstree-checkbox-disabled{opacity:.8;filter:url("data:image/svg+xml;utf8,#jstree-grayscale");filter:gray;-webkit-filter:grayscale(100%)}.jstree-default-large>.jstree-striped{background-size:auto 64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==);background-position:100% 1px;background-repeat:repeat-y}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}.jstree-default-large.jstree-rtl .jstree-open>.jstree-ocl{background-position:-128px -32px}.jstree-default-large.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-96px -32px}.jstree-default-large.jstree-rtl .jstree-leaf>.jstree-ocl{background-position:-64px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-node,.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-open>.jstree-ocl{background-position:-32px -32px}.jstree-default-large.jstree-rtl>.jstree-no-dots .jstree-closed>.jstree-ocl{background-position:0 -32px}.jstree-default-large .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-large>.jstree-container-ul .jstree-loading>.jstree-ocl{background:url(throbber.gif) center center no-repeat}.jstree-default-large .jstree-file{background:url(32px.png) -96px -64px no-repeat}.jstree-default-large .jstree-folder{background:url(32px.png) -256px 0 no-repeat}.jstree-default-large>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}#jstree-dnd.jstree-default-large{line-height:32px;padding:0 4px}#jstree-dnd.jstree-default-large .jstree-ok,#jstree-dnd.jstree-default-large .jstree-er{background-image:url(32px.png);background-repeat:no-repeat;background-color:transparent}#jstree-dnd.jstree-default-large i{background:0 0;width:32px;height:32px;line-height:32px}#jstree-dnd.jstree-default-large .jstree-ok{background-position:0 -64px}#jstree-dnd.jstree-default-large .jstree-er{background-position:-32px -64px}.jstree-default-large.jstree-rtl .jstree-node{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==)}.jstree-default-large.jstree-rtl .jstree-last{background:0 0}@media (max-width:768px){#jstree-dnd.jstree-dnd-responsive{line-height:40px;font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}#jstree-dnd.jstree-dnd-responsive>i{background:0 0;width:40px;height:40px}#jstree-dnd.jstree-dnd-responsive>.jstree-ok{background-image:url(40px.png);background-position:0 -200px;background-size:120px 240px}#jstree-dnd.jstree-dnd-responsive>.jstree-er{background-image:url(40px.png);background-position:-40px -200px;background-size:120px 240px}#jstree-marker.jstree-dnd-responsive{border-left-width:10px;border-top-width:10px;border-bottom-width:10px;margin-top:-10px}}@media (max-width:768px){.jstree-default-responsive .jstree-icon{background-image:url(40px.png)}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-node{min-height:40px;line-height:40px;margin-left:40px;min-width:40px;white-space:nowrap}.jstree-default-responsive .jstree-anchor{line-height:40px;height:40px}.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-icon:empty{width:40px;height:40px;line-height:40px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0}.jstree-default-responsive.jstree-rtl .jstree-node{margin-left:0;margin-right:40px}.jstree-default-responsive.jstree-rtl .jstree-container-ul>.jstree-node{margin-right:0}.jstree-default-responsive .jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-size:120px 240px}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background:0 0}.jstree-default-responsive .jstree-open>.jstree-ocl{background-position:0 0!important}.jstree-default-responsive .jstree-closed>.jstree-ocl{background-position:0 -40px!important}.jstree-default-responsive.jstree-rtl .jstree-closed>.jstree-ocl{background-position:-40px 0!important}.jstree-default-responsive .jstree-themeicon{background-position:-40px -40px}.jstree-default-responsive .jstree-checkbox,.jstree-default-responsive .jstree-checkbox:hover{background-position:-40px -80px}.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox,.jstree-default-responsive.jstree-checkbox-selection .jstree-clicked>.jstree-checkbox:hover,.jstree-default-responsive .jstree-checked>.jstree-checkbox,.jstree-default-responsive .jstree-checked>.jstree-checkbox:hover{background-position:0 -80px}.jstree-default-responsive .jstree-anchor>.jstree-undetermined,.jstree-default-responsive .jstree-anchor>.jstree-undetermined:hover{background-position:0 -120px}.jstree-default-responsive .jstree-anchor{font-weight:700;font-size:1.1em;text-shadow:1px 1px #fff}.jstree-default-responsive>.jstree-striped{background:0 0}.jstree-default-responsive .jstree-wholerow{border-top:1px solid rgba(255,255,255,.7);border-bottom:1px solid rgba(64,64,64,.2);background:#ebebeb;height:40px}.jstree-default-responsive .jstree-wholerow-hovered{background:#e7f4f9}.jstree-default-responsive .jstree-wholerow-clicked{background:#beebff}.jstree-default-responsive .jstree-children .jstree-last>.jstree-wholerow{box-shadow:inset 0 -6px 3px -5px #666}.jstree-default-responsive .jstree-children .jstree-open>.jstree-wholerow{box-shadow:inset 0 6px 3px -5px #666;border-top:0}.jstree-default-responsive .jstree-children .jstree-open+.jstree-open{box-shadow:none}.jstree-default-responsive .jstree-node,.jstree-default-responsive .jstree-icon,.jstree-default-responsive .jstree-node>.jstree-ocl,.jstree-default-responsive .jstree-themeicon,.jstree-default-responsive .jstree-checkbox{background-image:url(40px.png);background-size:120px 240px}.jstree-default-responsive .jstree-node{background-position:-80px 0;background-repeat:repeat-y}.jstree-default-responsive .jstree-last{background:0 0}.jstree-default-responsive .jstree-leaf>.jstree-ocl{background-position:-40px -120px}.jstree-default-responsive .jstree-last>.jstree-ocl{background-position:-40px -160px}.jstree-default-responsive .jstree-themeicon-custom{background-color:transparent;background-image:none;background-position:0 0}.jstree-default-responsive .jstree-file{background:url(40px.png) 0 -160px no-repeat;background-size:120px 240px}.jstree-default-responsive .jstree-folder{background:url(40px.png) -40px -40px no-repeat;background-size:120px 240px}.jstree-default-responsive>.jstree-container-ul>.jstree-node{margin-left:0;margin-right:0}} \ No newline at end of file diff --git a/Resources/public/js/vendor/jstree/themes/default/throbber.gif b/Resources/public/js/vendor/jstree/themes/default/throbber.gif deleted file mode 100644 index 1b5b2fde..00000000 Binary files a/Resources/public/js/vendor/jstree/themes/default/throbber.gif and /dev/null differ diff --git a/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.css b/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.css index 81b61539..f8fd857d 100644 --- a/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.css +++ b/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.css @@ -1,8 +1,10 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -.lg-outer.fb-comments .lg-img-wrap { - padding-right: 400px !important; } +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ +.lg-outer.fb-comments .lg-img-wrap, .lg-outer.fb-comments .lg-video-cont { + padding-right: 400px !important; +} + .lg-outer.fb-comments .fb-comments { height: 100%; overflow-y: auto; @@ -11,24 +13,45 @@ top: 0; width: 420px; z-index: 99999; - background: #fff url("../img/loading.gif") no-repeat scroll center center; } - .lg-outer.fb-comments .fb-comments.fb_iframe_widget { - background-image: none; } - .lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader { - background: #fff url("../img/loading.gif") no-repeat scroll center center; } + background: #fff url("../img/loading.gif") no-repeat scroll center center; +} + +.lg-outer.fb-comments .fb-comments.fb_iframe_widget { + background-image: none; +} + +.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader { + background: #fff url("../img/loading.gif") no-repeat scroll center center; +} + .lg-outer.fb-comments .lg-toolbar { right: 420px; - width: auto; } + width: auto; +} + .lg-outer.fb-comments .lg-actions .lg-next { - right: 420px; } + right: 420px; +} + .lg-outer.fb-comments .lg-item { - background-image: none; } - .lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap { - background-image: none; } -.lg-outer.fb-comments .lg-img-wrap { - background: url(../img/loading.gif) no-repeat scroll center center transparent; } + background-image: none; +} + +.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap, .lg-outer.fb-comments .lg-item.lg-complete .lg-video-cont { + background-image: none; +} + +.lg-outer.fb-comments .lg-img-wrap, .lg-outer.fb-comments .lg-video-cont { + background: url("../img/loading.gif") no-repeat scroll transparent; + background-position: center center; + background-position: calc((100% - 400px) / 2) center; +} + .lg-outer.fb-comments .lg-sub-html { padding: 0; - position: static; } + position: static; +} -/*# sourceMappingURL=lg-fb-comment-box.css.map */ +.lg-outer.fb-comments .lg-video-cont { + max-width: 1250px !important; +} diff --git a/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.min.css b/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.min.css index a3e11312..8d0f9ac2 100644 --- a/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.min.css +++ b/Resources/public/js/vendor/lightGallery/css/lg-fb-comment-box.min.css @@ -1 +1 @@ -.lg-outer.fb-comments .fb-comments{height:100%;overflow-y:auto;position:absolute;right:0;top:0;width:420px;z-index:99999;background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .fb-comments.fb_iframe_widget{background-image:none}.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader{background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .lg-toolbar{right:420px;width:auto}.lg-outer.fb-comments .lg-actions .lg-next{right:420px}.lg-outer.fb-comments .lg-item,.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap{background-image:none}.lg-outer.fb-comments .lg-img-wrap{padding-right:400px!important;background:url(../img/loading.gif) center center no-repeat}.lg-outer.fb-comments .lg-sub-html{padding:0;position:static} \ No newline at end of file +.lg-outer.fb-comments .fb-comments{height:100%;overflow-y:auto;position:absolute;right:0;top:0;width:420px;z-index:99999;background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .fb-comments.fb_iframe_widget{background-image:none}.lg-outer.fb-comments .fb-comments.fb_iframe_widget.fb_iframe_widget_loader{background:url(../img/loading.gif) center center no-repeat #fff}.lg-outer.fb-comments .lg-toolbar{right:420px;width:auto}.lg-outer.fb-comments .lg-actions .lg-next{right:420px}.lg-outer.fb-comments .lg-item,.lg-outer.fb-comments .lg-item.lg-complete .lg-img-wrap,.lg-outer.fb-comments .lg-item.lg-complete .lg-video-cont{background-image:none}.lg-outer.fb-comments .lg-img-wrap,.lg-outer.fb-comments .lg-video-cont{padding-right:400px!important;background:url(../img/loading.gif) center center no-repeat;background-position:calc((100% - 400px)/ 2) center}.lg-outer.fb-comments .lg-sub-html{padding:0;position:static}.lg-outer.fb-comments .lg-video-cont{max-width:1250px!important} \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/css/lg-transitions.css b/Resources/public/js/vendor/lightGallery/css/lg-transitions.css index 2b28bc14..1fe002ac 100644 --- a/Resources/public/js/vendor/lightGallery/css/lg-transitions.css +++ b/Resources/public/js/vendor/lightGallery/css/lg-transitions.css @@ -1,6 +1,6 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ .lg-css3.lg-zoom-in .lg-item { opacity: 0; } .lg-css3.lg-zoom-in .lg-item.lg-prev-slide { diff --git a/Resources/public/js/vendor/lightGallery/css/lightgallery.css b/Resources/public/js/vendor/lightGallery/css/lightgallery.css index 15360438..232279c9 100644 --- a/Resources/public/js/vendor/lightGallery/css/lightgallery.css +++ b/Resources/public/js/vendor/lightGallery/css/lightgallery.css @@ -1,6 +1,6 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ @font-face { font-family: 'lg'; src: url("../fonts/lg.eot?n1z373"); @@ -33,6 +33,8 @@ position: absolute; top: 50%; z-index: 1080; + border: none; + outline: none; } .lg-actions .lg-next.disabled, .lg-actions .lg-prev.disabled { pointer-events: none; @@ -400,6 +402,10 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object z-index: 1080; cursor: pointer; } +.lg-outer .lg-has-iframe .lg-video { + -webkit-overflow-scrolling: touch; + overflow: auto; +} .lg-outer .lg-has-vimeo .lg-video-play { background: url("../img/vimeo-play.png") no-repeat scroll 0 0 transparent; } @@ -477,11 +483,19 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object -webkit-transition-duration: 0s; transition-duration: 0s; } -.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap { +.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap { + -webkit-transition: -webkit-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; + -moz-transition: -moz-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; + -o-transition: -o-transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; + transition: transform 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; +} +.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap { -webkit-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; -moz-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; -o-transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; transition: left 0.3s cubic-bezier(0, 0, 0.25, 1) 0s, top 0.3s cubic-bezier(0, 0, 0.25, 1) 0s; +} +.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); -webkit-backface-visibility: hidden; @@ -614,17 +628,138 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object content: "\e20d"; } -.group { - *zoom: 1; +.lg-outer #lg-dropdown-overlay { + background-color: rgba(0, 0, 0, 0.25); + bottom: 0; + cursor: default; + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: 1081; + opacity: 0; + visibility: hidden; + -webkit-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s; + -o-transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s; + transition: visibility 0s linear 0.18s, opacity 0.18s linear 0s; +} +.lg-outer.lg-dropdown-active .lg-dropdown, .lg-outer.lg-dropdown-active #lg-dropdown-overlay { + -webkit-transition-delay: 0s; + transition-delay: 0s; + -moz-transform: translate3d(0, 0px, 0); + -o-transform: translate3d(0, 0px, 0); + -ms-transform: translate3d(0, 0px, 0); + -webkit-transform: translate3d(0, 0px, 0); + transform: translate3d(0, 0px, 0); + opacity: 1; + visibility: visible; } - -.group:before, .group:after { - display: table; +.lg-outer.lg-dropdown-active #lg-share { + color: #FFF; +} +.lg-outer .lg-dropdown { + background-color: #fff; + border-radius: 2px; + font-size: 14px; + list-style-type: none; + margin: 0; + padding: 10px 0; + position: absolute; + right: 0; + text-align: left; + top: 50px; + opacity: 0; + visibility: hidden; + -moz-transform: translate3d(0, 5px, 0); + -o-transform: translate3d(0, 5px, 0); + -ms-transform: translate3d(0, 5px, 0); + -webkit-transform: translate3d(0, 5px, 0); + transform: translate3d(0, 5px, 0); + -webkit-transition: -webkit-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s; + -moz-transition: -moz-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s; + -o-transition: -o-transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s; + transition: transform 0.18s linear 0s, visibility 0s linear 0.5s, opacity 0.18s linear 0s; +} +.lg-outer .lg-dropdown:after { content: ""; - line-height: 0; + display: block; + height: 0; + width: 0; + position: absolute; + border: 8px solid transparent; + border-bottom-color: #FFF; + right: 16px; + top: -16px; +} +.lg-outer .lg-dropdown > li:last-child { + margin-bottom: 0px; +} +.lg-outer .lg-dropdown > li:hover a, .lg-outer .lg-dropdown > li:hover .lg-icon { + color: #333; +} +.lg-outer .lg-dropdown a { + color: #333; + display: block; + white-space: pre; + padding: 4px 12px; + font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 12px; +} +.lg-outer .lg-dropdown a:hover { + background-color: rgba(0, 0, 0, 0.07); +} +.lg-outer .lg-dropdown .lg-dropdown-text { + display: inline-block; + line-height: 1; + margin-top: -3px; + vertical-align: middle; +} +.lg-outer .lg-dropdown .lg-icon { + color: #333; + display: inline-block; + float: none; + font-size: 20px; + height: auto; + line-height: 1; + margin-right: 8px; + padding: 0; + vertical-align: middle; + width: auto; +} +.lg-outer #lg-share { + position: relative; +} +.lg-outer #lg-share:after { + content: "\e80d"; +} +.lg-outer #lg-share-facebook .lg-icon { + color: #3b5998; +} +.lg-outer #lg-share-facebook .lg-icon:after { + content: "\e901"; +} +.lg-outer #lg-share-twitter .lg-icon { + color: #00aced; +} +.lg-outer #lg-share-twitter .lg-icon:after { + content: "\e904"; +} +.lg-outer #lg-share-googleplus .lg-icon { + color: #dd4b39; +} +.lg-outer #lg-share-googleplus .lg-icon:after { + content: "\e902"; +} +.lg-outer #lg-share-pinterest .lg-icon { + color: #cb2027; +} +.lg-outer #lg-share-pinterest .lg-icon:after { + content: "\e903"; } -.group:after { +.lg-group:after { + content: ""; + display: table; clear: both; } @@ -635,6 +770,7 @@ body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object top: 0; left: 0; z-index: 1050; + text-align: left; opacity: 0; -webkit-transition: opacity 0.15s ease 0s; -o-transition: opacity 0.15s ease 0s; diff --git a/Resources/public/js/vendor/lightGallery/css/lightgallery.min.css b/Resources/public/js/vendor/lightGallery/css/lightgallery.min.css index b6359e80..20c20c68 100644 --- a/Resources/public/js/vendor/lightGallery/css/lightgallery.min.css +++ b/Resources/public/js/vendor/lightGallery/css/lightgallery.min.css @@ -1 +1 @@ -.lg-sub-html,.lg-toolbar{background-color:rgba(0,0,0,.45)}#lg-counter,.lg-outer .lg-video-cont{vertical-align:middle;display:inline-block}@font-face{font-family:lg;src:url(../fonts/lg.eot?n1z373);src:url(../fonts/lg.eot?#iefixn1z373) format("embedded-opentype"),url(../fonts/lg.woff?n1z373) format("woff"),url(../fonts/lg.ttf?n1z373) format("truetype"),url(../fonts/lg.svg?n1z373#lg) format("svg");font-weight:400;font-style:normal}.lg-icon{font-family:lg;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-actions .lg-next,.lg-actions .lg-prev{background-color:rgba(0,0,0,.45);border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1080}.lg-actions .lg-next.disabled,.lg-actions .lg-prev.disabled{pointer-events:none;opacity:.5}.lg-actions .lg-next:hover,.lg-actions .lg-prev:hover{color:#FFF}.lg-actions .lg-next{right:20px}.lg-actions .lg-next:before{content:"\e095"}.lg-actions .lg-prev{left:20px}.lg-actions .lg-prev:after{content:"\e094"}@-webkit-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-moz-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-ms-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-webkit-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@-moz-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@-ms-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:0;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.lg-toolbar .lg-icon:hover{color:#FFF}.lg-toolbar .lg-close:after{content:"\e070"}.lg-toolbar .lg-download:after{content:"\e0f2"}.lg-sub-html{bottom:0;color:#EEE;font-size:16px;left:0;padding:10px 40px;position:fixed;right:0;text-align:center;z-index:1080}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}#lg-counter{color:#999;font-size:16px;padding-left:20px;padding-top:12px}.lg-next,.lg-prev,.lg-toolbar{opacity:1;-webkit-transition:-webkit-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;-moz-transition:-moz-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;-o-transition:-o-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;transition:transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear}.lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object{-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);opacity:0;-webkit-transition:-webkit-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;transition:transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);opacity:1}.lg-outer .lg-thumb-outer{background-color:#0D0A0A;bottom:0;position:absolute;width:100%;z-index:1080;max-height:350px;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer.lg-thumb-open .lg-thumb-outer{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-thumb{padding:10px 0;height:100%;margin-bottom:-5px}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border:2px solid #FFF;border-radius:4px;margin-bottom:5px}@media (min-width:1025px){.lg-outer .lg-thumb-item{-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover}.lg-outer.lg-has-thumb .lg-item{padding-bottom:120px}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer.lg-pull-caption-up .lg-sub-html{-webkit-transition:bottom .25s ease;-o-transition:bottom .25s ease;transition:bottom .25s ease}.lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html{bottom:100px}.lg-outer .lg-toogle-thumb{background-color:#0D0A0A;border-radius:2px 2px 0 0;color:#999;cursor:pointer;font-size:24px;height:39px;line-height:27px;padding:5px 0;position:absolute;right:20px;text-align:center;top:-39px;width:50px}.lg-outer .lg-toogle-thumb:after{content:"\e1ff"}.lg-outer .lg-toogle-thumb:hover{color:#FFF}.lg-outer .lg-video-cont{max-width:1140px;max-height:100%;width:100%;padding:0 5px}.lg-outer .lg-video{width:100%;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}.lg-outer .lg-video .lg-object{display:inline-block;position:absolute;top:0;left:0;width:100%!important;height:100%!important}.lg-outer .lg-video .lg-video-play{width:84px;height:59px;position:absolute;left:50%;top:50%;margin-left:-42px;margin-top:-30px;z-index:1080;cursor:pointer}.lg-outer .lg-has-vimeo .lg-video-play{background:url(../img/vimeo-play.png) no-repeat}.lg-outer .lg-has-vimeo:hover .lg-video-play{background:url(../img/vimeo-play.png) 0 -58px no-repeat}.lg-outer .lg-has-html5 .lg-video-play{background:url(../img/video-play.png) no-repeat;height:64px;margin-left:-32px;margin-top:-32px;width:64px;opacity:.8}.lg-outer .lg-has-html5:hover .lg-video-play{opacity:1}.lg-outer .lg-has-youtube .lg-video-play{background:url(../img/youtube-play.png) no-repeat}.lg-outer .lg-has-youtube:hover .lg-video-play{background:url(../img/youtube-play.png) 0 -60px no-repeat}.lg-outer .lg-video-object{width:100%!important;height:100%!important;position:absolute;top:0;left:0}.lg-outer .lg-has-video .lg-video-object{visibility:hidden}.lg-outer .lg-has-video.lg-video-playing .lg-object,.lg-outer .lg-has-video.lg-video-playing .lg-video-play{display:none}.lg-outer .lg-has-video.lg-video-playing .lg-video-object{visibility:visible}.lg-progress-bar{background-color:#333;height:5px;left:0;position:absolute;top:0;width:100%;z-index:1083;opacity:0;-webkit-transition:opacity 80ms ease 0s;-moz-transition:opacity 80ms ease 0s;-o-transition:opacity 80ms ease 0s;transition:opacity 80ms ease 0s}.lg-progress-bar .lg-progress{background-color:#a90707;height:5px;width:0}.lg-progress-bar.lg-start .lg-progress{width:100%}.lg-show-autoplay .lg-progress-bar{opacity:1}.lg-autoplay-button:after{content:"\e01d"}.lg-show-autoplay .lg-autoplay-button:after{content:"\e01a"}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition-duration:0s;transition-duration:0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-moz-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-o-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);-webkit-transition:-webkit-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-moz-transition:-moz-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-o-transition:-o-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;transition:transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}#lg-zoom-in:after{content:"\e311"}#lg-actual-size{font-size:20px}#lg-actual-size:after{content:"\e033"}#lg-zoom-out{opacity:.5;pointer-events:none}#lg-zoom-out:after{content:"\e312"}.lg-zoomed #lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer .lg-pager-outer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1080;height:10px}.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont{overflow:visible}.lg-outer .lg-pager-cont{cursor:pointer;display:inline-block;overflow:hidden;position:relative;vertical-align:top;margin:0 5px}.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-pager-cont.lg-pager-active .lg-pager{box-shadow:0 0 0 2px #fff inset}.lg-outer .lg-pager-thumb-cont{background-color:#fff;color:#FFF;bottom:100%;height:83px;left:0;margin-bottom:20px;margin-left:-60px;opacity:0;padding:5px;position:absolute;width:120px;border-radius:3px;-webkit-transition:opacity .15s ease 0s,-webkit-transform .15s ease 0s;-moz-transition:opacity .15s ease 0s,-moz-transform .15s ease 0s;-o-transition:opacity .15s ease 0s,-o-transform .15s ease 0s;transition:opacity .15s ease 0s,transform .15s ease 0s;-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}.lg-outer .lg-pager-thumb-cont img{width:100%;height:100%}.lg-outer .lg-pager{background-color:rgba(255,255,255,.5);border-radius:50%;box-shadow:0 0 0 8px rgba(255,255,255,.7) inset;display:block;height:12px;-webkit-transition:box-shadow .3s ease 0s;-o-transition:box-shadow .3s ease 0s;transition:box-shadow .3s ease 0s;width:12px}.lg-outer .lg-pager:focus,.lg-outer .lg-pager:hover{box-shadow:0 0 0 8px #fff inset}.lg-outer .lg-caret{border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px dashed;bottom:-10px;display:inline-block;height:0;left:50%;margin-left:-5px;position:absolute;vertical-align:middle;width:0}.lg-outer,.lg-outer .lg,.lg-outer .lg-inner{width:100%;height:100%}.lg-fullscreen:after{content:"\e20c"}.lg-fullscreen-on .lg-fullscreen:after{content:"\e20d"}.group:after,.group:before{display:table;content:"";line-height:0}.group:after{clear:both}.lg-outer{position:fixed;top:0;left:0;z-index:1050;opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item.lg-current,.lg-outer.lg-css3 .lg-item.lg-next-slide,.lg-outer.lg-css3 .lg-item.lg-prev-slide{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-current,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg{position:relative;overflow:hidden;margin-left:auto;margin-right:auto;max-width:100%;max-height:100%}.lg-outer .lg-inner{position:absolute;left:0;top:0;white-space:nowrap}.lg-outer .lg-item{background:url(../img/loading.gif) center center no-repeat;display:none!important}.lg-outer.lg-css .lg-current,.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css3 .lg-prev-slide{display:inline-block!important}.lg-outer .lg-img-wrap,.lg-outer .lg-item{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-img-wrap:before,.lg-outer .lg-item:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}.lg-outer .lg-img-wrap{position:absolute;padding:0 5px;left:0;right:0;top:0;bottom:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-image{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto!important;height:auto!important}.lg-outer.lg-show-after-load .lg-item .lg-object,.lg-outer.lg-show-after-load .lg-item .lg-video-play{opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object,.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play{opacity:1}.lg-outer .lg-empty-html,.lg-outer.lg-hide-download #lg-download{display:none}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-current,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-prev-slide{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item,.lg-css3.lg-use-left .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-current,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-prev-slide{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-css3.lg-slide.lg-use-left .lg-item{opacity:0;position:absolute;left:0}.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide{left:-100%}.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide{left:100%}.lg-css3.lg-slide.lg-use-left .lg-item.lg-current{left:0;opacity:1}.lg-css3.lg-slide.lg-use-left .lg-item.lg-current,.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide{-webkit-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s} \ No newline at end of file +.lg-sub-html,.lg-toolbar{background-color:rgba(0,0,0,.45)}@font-face{font-family:lg;src:url(../fonts/lg.eot?n1z373);src:url(../fonts/lg.eot?#iefixn1z373) format("embedded-opentype"),url(../fonts/lg.woff?n1z373) format("woff"),url(../fonts/lg.ttf?n1z373) format("truetype"),url(../fonts/lg.svg?n1z373#lg) format("svg");font-weight:400;font-style:normal}.lg-icon{font-family:lg;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lg-actions .lg-next,.lg-actions .lg-prev{background-color:rgba(0,0,0,.45);border-radius:2px;color:#999;cursor:pointer;display:block;font-size:22px;margin-top:-10px;padding:8px 10px 9px;position:absolute;top:50%;z-index:1080;border:none;outline:0}.lg-actions .lg-next.disabled,.lg-actions .lg-prev.disabled{pointer-events:none;opacity:.5}.lg-actions .lg-next:hover,.lg-actions .lg-prev:hover{color:#FFF}.lg-actions .lg-next{right:20px}.lg-actions .lg-next:before{content:"\e095"}.lg-actions .lg-prev{left:20px}.lg-actions .lg-prev:after{content:"\e094"}@-webkit-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-moz-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-ms-keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@keyframes lg-right-end{0%,100%{left:0}50%{left:-30px}}@-webkit-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@-moz-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@-ms-keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}@keyframes lg-left-end{0%,100%{left:0}50%{left:30px}}.lg-outer.lg-right-end .lg-object{-webkit-animation:lg-right-end .3s;-o-animation:lg-right-end .3s;animation:lg-right-end .3s;position:relative}.lg-outer.lg-left-end .lg-object{-webkit-animation:lg-left-end .3s;-o-animation:lg-left-end .3s;animation:lg-left-end .3s;position:relative}.lg-toolbar{z-index:1082;left:0;position:absolute;top:0;width:100%}.lg-toolbar .lg-icon{color:#999;cursor:pointer;float:right;font-size:24px;height:47px;line-height:27px;padding:10px 0;text-align:center;width:50px;text-decoration:none!important;outline:0;-webkit-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.lg-toolbar .lg-icon:hover{color:#FFF}.lg-toolbar .lg-close:after{content:"\e070"}.lg-toolbar .lg-download:after{content:"\e0f2"}.lg-sub-html{bottom:0;color:#EEE;font-size:16px;left:0;padding:10px 40px;position:fixed;right:0;text-align:center;z-index:1080}.lg-sub-html h4{margin:0;font-size:13px;font-weight:700}.lg-sub-html p{font-size:12px;margin:5px 0 0}#lg-counter{color:#999;display:inline-block;font-size:16px;padding-left:20px;padding-top:12px;vertical-align:middle}.lg-next,.lg-prev,.lg-toolbar{opacity:1;-webkit-transition:-webkit-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;-moz-transition:-moz-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;-o-transition:-o-transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear;transition:transform .35s cubic-bezier(0,0,.25,1) 0s,opacity .35s cubic-bezier(0,0,.25,1) 0s,color .2s linear}.lg-hide-items .lg-prev{opacity:0;-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}.lg-hide-items .lg-next{opacity:0;-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}.lg-hide-items .lg-toolbar{opacity:0;-webkit-transform:translate3d(0,-10px,0);transform:translate3d(0,-10px,0)}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-object{-webkit-transform:scale3d(.5,.5,.5);transform:scale3d(.5,.5,.5);opacity:0;-webkit-transition:-webkit-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-moz-transition:-moz-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-o-transition:-o-transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;transition:transform 250ms cubic-bezier(0,0,.25,1) 0s,opacity 250ms cubic-bezier(0,0,.25,1)!important;-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%}body:not(.lg-from-hash) .lg-outer.lg-start-zoom .lg-item.lg-complete .lg-object{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);opacity:1}.lg-outer .lg-thumb-outer{background-color:#0D0A0A;bottom:0;position:absolute;width:100%;z-index:1080;max-height:350px;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .25s cubic-bezier(0,0,.25,1) 0s;transition:transform .25s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-thumb-outer.lg-grab .lg-thumb-item{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer .lg-thumb-outer.lg-grabbing .lg-thumb-item{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg-thumb-outer.lg-dragging .lg-thumb{-webkit-transition-duration:0s!important;transition-duration:0s!important}.lg-outer.lg-thumb-open .lg-thumb-outer{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-thumb{padding:10px 0;height:100%;margin-bottom:-5px}.lg-outer .lg-thumb-item{cursor:pointer;float:left;overflow:hidden;height:100%;border:2px solid #FFF;border-radius:4px;margin-bottom:5px}@media (min-width:1025px){.lg-outer .lg-thumb-item{-webkit-transition:border-color .25s ease;-o-transition:border-color .25s ease;transition:border-color .25s ease}}.lg-outer .lg-thumb-item.active,.lg-outer .lg-thumb-item:hover{border-color:#a90707}.lg-outer .lg-thumb-item img{width:100%;height:100%;object-fit:cover}.lg-outer.lg-has-thumb .lg-item{padding-bottom:120px}.lg-outer.lg-can-toggle .lg-item{padding-bottom:0}.lg-outer.lg-pull-caption-up .lg-sub-html{-webkit-transition:bottom .25s ease;-o-transition:bottom .25s ease;transition:bottom .25s ease}.lg-outer.lg-pull-caption-up.lg-thumb-open .lg-sub-html{bottom:100px}.lg-outer .lg-toogle-thumb{background-color:#0D0A0A;border-radius:2px 2px 0 0;color:#999;cursor:pointer;font-size:24px;height:39px;line-height:27px;padding:5px 0;position:absolute;right:20px;text-align:center;top:-39px;width:50px}.lg-outer .lg-toogle-thumb:hover,.lg-outer.lg-dropdown-active #lg-share{color:#FFF}.lg-outer .lg-toogle-thumb:after{content:"\e1ff"}.lg-outer .lg-video-cont{display:inline-block;vertical-align:middle;max-width:1140px;max-height:100%;width:100%;padding:0 5px}.lg-outer .lg-video{width:100%;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}.lg-outer .lg-video .lg-object{display:inline-block;position:absolute;top:0;left:0;width:100%!important;height:100%!important}.lg-outer .lg-video .lg-video-play{width:84px;height:59px;position:absolute;left:50%;top:50%;margin-left:-42px;margin-top:-30px;z-index:1080;cursor:pointer}.lg-outer .lg-has-iframe .lg-video{-webkit-overflow-scrolling:touch;overflow:auto}.lg-outer .lg-has-vimeo .lg-video-play{background:url(../img/vimeo-play.png) no-repeat}.lg-outer .lg-has-vimeo:hover .lg-video-play{background:url(../img/vimeo-play.png) 0 -58px no-repeat}.lg-outer .lg-has-html5 .lg-video-play{background:url(../img/video-play.png) no-repeat;height:64px;margin-left:-32px;margin-top:-32px;width:64px;opacity:.8}.lg-outer .lg-has-html5:hover .lg-video-play{opacity:1}.lg-outer .lg-has-youtube .lg-video-play{background:url(../img/youtube-play.png) no-repeat}.lg-outer .lg-has-youtube:hover .lg-video-play{background:url(../img/youtube-play.png) 0 -60px no-repeat}.lg-outer .lg-video-object{width:100%!important;height:100%!important;position:absolute;top:0;left:0}.lg-outer .lg-has-video .lg-video-object{visibility:hidden}.lg-outer .lg-has-video.lg-video-playing .lg-object,.lg-outer .lg-has-video.lg-video-playing .lg-video-play{display:none}.lg-outer .lg-has-video.lg-video-playing .lg-video-object{visibility:visible}.lg-progress-bar{background-color:#333;height:5px;left:0;position:absolute;top:0;width:100%;z-index:1083;opacity:0;-webkit-transition:opacity 80ms ease 0s;-moz-transition:opacity 80ms ease 0s;-o-transition:opacity 80ms ease 0s;transition:opacity 80ms ease 0s}.lg-progress-bar .lg-progress{background-color:#a90707;height:5px;width:0}.lg-progress-bar.lg-start .lg-progress{width:100%}.lg-show-autoplay .lg-progress-bar{opacity:1}.lg-autoplay-button:after{content:"\e01d"}.lg-show-autoplay .lg-autoplay-button:after{content:"\e01a"}.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-image,.lg-outer.lg-css3.lg-zoom-dragging .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition-duration:0s;transition-duration:0s}.lg-outer.lg-use-transition-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition:-webkit-transform .3s cubic-bezier(0,0,.25,1) 0s;-moz-transition:-moz-transform .3s cubic-bezier(0,0,.25,1) 0s;-o-transition:-o-transform .3s cubic-bezier(0,0,.25,1) 0s;transition:transform .3s cubic-bezier(0,0,.25,1) 0s}.lg-outer.lg-use-left-for-zoom .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-moz-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;-o-transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s;transition:left .3s cubic-bezier(0,0,.25,1) 0s,top .3s cubic-bezier(0,0,.25,1) 0s}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-img-wrap{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-outer .lg-item.lg-complete.lg-zoomable .lg-image{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1);-webkit-transition:-webkit-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-moz-transition:-moz-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-o-transition:-o-transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;transition:transform .3s cubic-bezier(0,0,.25,1) 0s,opacity .15s!important;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}#lg-zoom-in:after{content:"\e311"}#lg-actual-size{font-size:20px}#lg-actual-size:after{content:"\e033"}#lg-zoom-out{opacity:.5;pointer-events:none}#lg-zoom-out:after{content:"\e312"}.lg-zoomed #lg-zoom-out{opacity:1;pointer-events:auto}.lg-outer .lg-pager-outer{bottom:60px;left:0;position:absolute;right:0;text-align:center;z-index:1080;height:10px}.lg-outer .lg-pager-outer.lg-pager-hover .lg-pager-cont{overflow:visible}.lg-outer .lg-pager-cont{cursor:pointer;display:inline-block;overflow:hidden;position:relative;vertical-align:top;margin:0 5px}.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.lg-outer .lg-pager-cont.lg-pager-active .lg-pager{box-shadow:0 0 0 2px #fff inset}.lg-outer .lg-pager-thumb-cont{background-color:#fff;color:#FFF;bottom:100%;height:83px;left:0;margin-bottom:20px;margin-left:-60px;opacity:0;padding:5px;position:absolute;width:120px;border-radius:3px;-webkit-transition:opacity .15s ease 0s,-webkit-transform .15s ease 0s;-moz-transition:opacity .15s ease 0s,-moz-transform .15s ease 0s;-o-transition:opacity .15s ease 0s,-o-transform .15s ease 0s;transition:opacity .15s ease 0s,transform .15s ease 0s;-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0)}.lg-outer .lg-pager-thumb-cont img{width:100%;height:100%}.lg-outer .lg-pager{background-color:rgba(255,255,255,.5);border-radius:50%;box-shadow:0 0 0 8px rgba(255,255,255,.7) inset;display:block;height:12px;-webkit-transition:box-shadow .3s ease 0s;-o-transition:box-shadow .3s ease 0s;transition:box-shadow .3s ease 0s;width:12px}.lg-outer .lg-pager:focus,.lg-outer .lg-pager:hover{box-shadow:0 0 0 8px #fff inset}.lg-outer .lg-caret{border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px dashed;bottom:-10px;display:inline-block;height:0;left:50%;margin-left:-5px;position:absolute;vertical-align:middle;width:0}.lg-fullscreen:after{content:"\e20c"}.lg-fullscreen-on .lg-fullscreen:after{content:"\e20d"}.lg-outer #lg-dropdown-overlay{background-color:rgba(0,0,0,.25);bottom:0;cursor:default;left:0;position:fixed;right:0;top:0;z-index:1081;opacity:0;visibility:hidden;-webkit-transition:visibility 0s linear .18s,opacity .18s linear 0s;-o-transition:visibility 0s linear .18s,opacity .18s linear 0s;transition:visibility 0s linear .18s,opacity .18s linear 0s}.lg-outer.lg-dropdown-active #lg-dropdown-overlay,.lg-outer.lg-dropdown-active .lg-dropdown{-webkit-transition-delay:0s;transition-delay:0s;-moz-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1;visibility:visible}.lg-outer .lg-dropdown{background-color:#fff;border-radius:2px;font-size:14px;list-style-type:none;margin:0;padding:10px 0;position:absolute;right:0;text-align:left;top:50px;opacity:0;visibility:hidden;-moz-transform:translate3d(0,5px,0);-o-transform:translate3d(0,5px,0);-ms-transform:translate3d(0,5px,0);-webkit-transform:translate3d(0,5px,0);transform:translate3d(0,5px,0);-webkit-transition:-webkit-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-moz-transition:-moz-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;-o-transition:-o-transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s;transition:transform .18s linear 0s,visibility 0s linear .5s,opacity .18s linear 0s}.lg-outer .lg-dropdown:after{content:"";display:block;height:0;width:0;position:absolute;border:8px solid transparent;border-bottom-color:#FFF;right:16px;top:-16px}.lg-outer .lg-dropdown>li:last-child{margin-bottom:0}.lg-outer .lg-dropdown>li:hover .lg-icon,.lg-outer .lg-dropdown>li:hover a{color:#333}.lg-outer .lg-dropdown a{color:#333;display:block;white-space:pre;padding:4px 12px;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px}.lg-outer .lg-dropdown a:hover{background-color:rgba(0,0,0,.07)}.lg-outer .lg-dropdown .lg-dropdown-text{display:inline-block;line-height:1;margin-top:-3px;vertical-align:middle}.lg-outer .lg-dropdown .lg-icon{color:#333;display:inline-block;float:none;font-size:20px;height:auto;line-height:1;margin-right:8px;padding:0;vertical-align:middle;width:auto}.lg-outer,.lg-outer .lg,.lg-outer .lg-inner{width:100%;height:100%}.lg-outer #lg-share{position:relative}.lg-outer #lg-share:after{content:"\e80d"}.lg-outer #lg-share-facebook .lg-icon{color:#3b5998}.lg-outer #lg-share-facebook .lg-icon:after{content:"\e901"}.lg-outer #lg-share-twitter .lg-icon{color:#00aced}.lg-outer #lg-share-twitter .lg-icon:after{content:"\e904"}.lg-outer #lg-share-googleplus .lg-icon{color:#dd4b39}.lg-outer #lg-share-googleplus .lg-icon:after{content:"\e902"}.lg-outer #lg-share-pinterest .lg-icon{color:#cb2027}.lg-outer #lg-share-pinterest .lg-icon:after{content:"\e903"}.lg-group:after{content:"";display:table;clear:both}.lg-outer{position:fixed;top:0;left:0;z-index:1050;text-align:left;opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lg-outer.lg-visible{opacity:1}.lg-outer.lg-css3 .lg-item.lg-current,.lg-outer.lg-css3 .lg-item.lg-next-slide,.lg-outer.lg-css3 .lg-item.lg-prev-slide{-webkit-transition-duration:inherit!important;transition-duration:inherit!important;-webkit-transition-timing-function:inherit!important;transition-timing-function:inherit!important}.lg-outer.lg-css3.lg-dragging .lg-item.lg-current,.lg-outer.lg-css3.lg-dragging .lg-item.lg-next-slide,.lg-outer.lg-css3.lg-dragging .lg-item.lg-prev-slide{-webkit-transition-duration:0s!important;transition-duration:0s!important;opacity:1}.lg-outer.lg-grab img.lg-object{cursor:-webkit-grab;cursor:-moz-grab;cursor:-o-grab;cursor:-ms-grab;cursor:grab}.lg-outer.lg-grabbing img.lg-object{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:-o-grabbing;cursor:-ms-grabbing;cursor:grabbing}.lg-outer .lg{position:relative;overflow:hidden;margin-left:auto;margin-right:auto;max-width:100%;max-height:100%}.lg-outer .lg-inner{position:absolute;left:0;top:0;white-space:nowrap}.lg-outer .lg-item{background:url(../img/loading.gif) center center no-repeat;display:none!important}.lg-outer.lg-css .lg-current,.lg-outer.lg-css3 .lg-current,.lg-outer.lg-css3 .lg-next-slide,.lg-outer.lg-css3 .lg-prev-slide{display:inline-block!important}.lg-outer .lg-img-wrap,.lg-outer .lg-item{display:inline-block;text-align:center;position:absolute;width:100%;height:100%}.lg-outer .lg-img-wrap:before,.lg-outer .lg-item:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}.lg-outer .lg-img-wrap{position:absolute;padding:0 5px;left:0;right:0;top:0;bottom:0}.lg-outer .lg-item.lg-complete{background-image:none}.lg-outer .lg-item.lg-current{z-index:1060}.lg-outer .lg-image{display:inline-block;vertical-align:middle;max-width:100%;max-height:100%;width:auto!important;height:auto!important}.lg-outer.lg-show-after-load .lg-item .lg-object,.lg-outer.lg-show-after-load .lg-item .lg-video-play{opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-object,.lg-outer.lg-show-after-load .lg-item.lg-complete .lg-video-play{opacity:1}.lg-outer .lg-empty-html,.lg-outer.lg-hide-download #lg-download{display:none}.lg-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1040;background-color:#000;opacity:0;-webkit-transition:opacity .15s ease 0s;-o-transition:opacity .15s ease 0s;transition:opacity .15s ease 0s}.lg-backdrop.in{opacity:1}.lg-css3.lg-no-trans .lg-current,.lg-css3.lg-no-trans .lg-next-slide,.lg-css3.lg-no-trans .lg-prev-slide{-webkit-transition:none 0s ease 0s!important;-moz-transition:none 0s ease 0s!important;-o-transition:none 0s ease 0s!important;transition:none 0s ease 0s!important}.lg-css3.lg-use-css3 .lg-item,.lg-css3.lg-use-left .lg-item{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden}.lg-css3.lg-fade .lg-item{opacity:0}.lg-css3.lg-fade .lg-item.lg-current{opacity:1}.lg-css3.lg-fade .lg-item.lg-current,.lg-css3.lg-fade .lg-item.lg-next-slide,.lg-css3.lg-fade .lg-item.lg-prev-slide{-webkit-transition:opacity .1s ease 0s;-moz-transition:opacity .1s ease 0s;-o-transition:opacity .1s ease 0s;transition:opacity .1s ease 0s}.lg-css3.lg-slide.lg-use-css3 .lg-item{opacity:0}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-current,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-css3 .lg-item.lg-prev-slide{-webkit-transition:-webkit-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:-moz-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:-o-transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:transform 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s}.lg-css3.lg-slide.lg-use-left .lg-item{opacity:0;position:absolute;left:0}.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide{left:-100%}.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide{left:100%}.lg-css3.lg-slide.lg-use-left .lg-item.lg-current{left:0;opacity:1}.lg-css3.lg-slide.lg-use-left .lg-item.lg-current,.lg-css3.lg-slide.lg-use-left .lg-item.lg-next-slide,.lg-css3.lg-slide.lg-use-left .lg-item.lg-prev-slide{-webkit-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-moz-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;-o-transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s;transition:left 1s cubic-bezier(0,0,.25,1) 0s,opacity .1s ease 0s} \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/fonts/lg.eot b/Resources/public/js/vendor/lightGallery/fonts/lg.eot index 1eb39169..51264c4f 100644 Binary files a/Resources/public/js/vendor/lightGallery/fonts/lg.eot and b/Resources/public/js/vendor/lightGallery/fonts/lg.eot differ diff --git a/Resources/public/js/vendor/lightGallery/fonts/lg.svg b/Resources/public/js/vendor/lightGallery/fonts/lg.svg index 80ae4100..22b1a1ff 100644 --- a/Resources/public/js/vendor/lightGallery/fonts/lg.svg +++ b/Resources/public/js/vendor/lightGallery/fonts/lg.svg @@ -39,4 +39,9 @@ + + + + + \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/fonts/lg.ttf b/Resources/public/js/vendor/lightGallery/fonts/lg.ttf index d33b8e5e..8ad81996 100644 Binary files a/Resources/public/js/vendor/lightGallery/fonts/lg.ttf and b/Resources/public/js/vendor/lightGallery/fonts/lg.ttf differ diff --git a/Resources/public/js/vendor/lightGallery/fonts/lg.woff b/Resources/public/js/vendor/lightGallery/fonts/lg.woff index bd370be8..d98ff605 100644 Binary files a/Resources/public/js/vendor/lightGallery/fonts/lg.woff and b/Resources/public/js/vendor/lightGallery/fonts/lg.woff differ diff --git a/Resources/public/js/vendor/lightGallery/js/lg-autoplay.js b/Resources/public/js/vendor/lightGallery/js/lg-autoplay.js deleted file mode 100644 index bf7874b6..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-autoplay.js +++ /dev/null @@ -1,190 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -/** - * Autoplay Plugin - * @version 1.2.0 - * @author Sachin N - @sachinchoolur - * @license MIT License (MIT) - */ - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - autoplay: false, - pause: 5000, - progressBar: true, - fourceAutoplay: false, - autoplayControls: true, - appendAutoplayControlsTo: '.lg-toolbar' - }; - - /** - * Creates the autoplay plugin. - * @param {object} element - lightGallery element - */ - var Autoplay = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - - // Execute only if items are above 1 - if (this.core.$items.length < 2) { - return false; - } - - this.core.s = $.extend({}, defaults, this.core.s); - this.interval = false; - - // Identify if slide happened from autoplay - this.fromAuto = true; - - // Identify if autoplay canceled from touch/drag - this.canceledOnTouch = false; - - // save fourceautoplay value - this.fourceAutoplayTemp = this.core.s.fourceAutoplay; - - // do not allow progress bar if browser does not support css3 transitions - if (!this.core.doCss()) { - this.core.s.progressBar = false; - } - - this.init(); - - return this; - }; - - Autoplay.prototype.init = function() { - var _this = this; - - // append autoplay controls - if (_this.core.s.autoplayControls) { - _this.controls(); - } - - // Create progress bar - if (_this.core.s.progressBar) { - _this.core.$outer.find('.lg').append('
        '); - } - - // set progress - _this.progress(); - - // Start autoplay - if (_this.core.s.autoplay) { - _this.startlAuto(); - } - - // cancel interval on touchstart and dragstart - _this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() { - if (_this.interval) { - _this.cancelAuto(); - _this.canceledOnTouch = true; - } - }); - - // restore autoplay if autoplay canceled from touchstart / dragstart - _this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() { - if (!_this.interval && _this.canceledOnTouch) { - _this.startlAuto(); - _this.canceledOnTouch = false; - } - }); - - }; - - Autoplay.prototype.progress = function() { - - var _this = this; - var _$progressBar; - var _$progress; - - _this.$el.on('onBeforeSlide.lg.tm', function() { - - // start progress bar animation - if (_this.core.s.progressBar && _this.fromAuto) { - _$progressBar = _this.core.$outer.find('.lg-progress-bar'); - _$progress = _this.core.$outer.find('.lg-progress'); - if (_this.interval) { - _$progress.removeAttr('style'); - _$progressBar.removeClass('lg-start'); - setTimeout(function() { - _$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s'); - _$progressBar.addClass('lg-start'); - }, 20); - } - } - - // Remove setinterval if slide is triggered manually and fourceautoplay is false - if (!_this.fromAuto && !_this.core.s.fourceAutoplay) { - _this.cancelAuto(); - } - - _this.fromAuto = false; - - }); - }; - - // Manage autoplay via play/stop buttons - Autoplay.prototype.controls = function() { - var _this = this; - var _html = ''; - - // Append autoplay controls - $(this.core.s.appendAutoplayControlsTo).append(_html); - - _this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() { - if ($(_this.core.$outer).hasClass('lg-show-autoplay')) { - _this.cancelAuto(); - _this.core.s.fourceAutoplay = false; - } else { - if (!_this.interval) { - _this.startlAuto(); - _this.core.s.fourceAutoplay = _this.fourceAutoplayTemp; - } - } - }); - }; - - // Autostart gallery - Autoplay.prototype.startlAuto = function() { - var _this = this; - - _this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s'); - _this.core.$outer.addClass('lg-show-autoplay'); - _this.core.$outer.find('.lg-progress-bar').addClass('lg-start'); - - _this.interval = setInterval(function() { - if (_this.core.index + 1 < _this.core.$items.length) { - _this.core.index++; - } else { - _this.core.index = 0; - } - - _this.fromAuto = true; - _this.core.slide(_this.core.index, false, false); - }, _this.core.s.speed + _this.core.s.pause); - }; - - // cancel Autostart - Autoplay.prototype.cancelAuto = function() { - clearInterval(this.interval); - this.interval = false; - this.core.$outer.find('.lg-progress').removeAttr('style'); - this.core.$outer.removeClass('lg-show-autoplay'); - this.core.$outer.find('.lg-progress-bar').removeClass('lg-start'); - }; - - Autoplay.prototype.destroy = function() { - - this.cancelAuto(); - this.core.$outer.find('.lg-progress-bar').remove(); - }; - - $.fn.lightGallery.modules.autoplay = Autoplay; - -})(jQuery, window, document); diff --git a/Resources/public/js/vendor/lightGallery/js/lg-autoplay.min.js b/Resources/public/js/vendor/lightGallery/js/lg-autoplay.min.js deleted file mode 100644 index 398b1e7d..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-autoplay.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),!(this.core.$items.length<2)&&(this.core.s=a.extend({},e,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};f.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('
        '),a.progress(),a.core.s.autoplay&&a.startlAuto(),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},f.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},f.prototype.controls=function(){var b=this,c='';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},f.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+1-1?d.core.slide(a,!1,!1):d.core.lGalleryOn&&d.core.destroy()})},f.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?b.location.hash=this.oldHash:history.pushState?history.pushState("",c.title,b.location.pathname+b.location.search):b.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=f}(jQuery,window,document); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lg-pager.js b/Resources/public/js/vendor/lightGallery/js/lg-pager.js deleted file mode 100644 index c9ded0c2..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-pager.js +++ /dev/null @@ -1,85 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - pager: false - }; - - var Pager = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - this.core.s = $.extend({}, defaults, this.core.s); - if (this.core.s.pager && this.core.$items.length > 1) { - this.init(); - } - - return this; - }; - - Pager.prototype.init = function() { - var _this = this; - var pagerList = ''; - var $pagerCont; - var $pagerOuter; - var timeout; - - _this.core.$outer.find('.lg').append('
        '); - - if (_this.core.s.dynamic) { - for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { - pagerList += '
        '; - } - } else { - _this.core.$items.each(function() { - - if (!_this.core.s.exThumbImage) { - pagerList += '
        '; - } else { - pagerList += '
        '; - } - - }); - } - - $pagerOuter = _this.core.$outer.find('.lg-pager-outer'); - - $pagerOuter.html(pagerList); - - $pagerCont = _this.core.$outer.find('.lg-pager-cont'); - $pagerCont.on('click.lg touchend.lg', function() { - var _$this = $(this); - _this.core.index = _$this.index(); - _this.core.slide(_this.core.index, false, false); - }); - - $pagerOuter.on('mouseover.lg', function() { - clearTimeout(timeout); - $pagerOuter.addClass('lg-pager-hover'); - }); - - $pagerOuter.on('mouseout.lg', function() { - timeout = setTimeout(function() { - $pagerOuter.removeClass('lg-pager-hover'); - }); - }); - - _this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) { - $pagerCont.removeClass('lg-pager-active'); - $pagerCont.eq(index).addClass('lg-pager-active'); - }); - - }; - - Pager.prototype.destroy = function() { - - }; - - $.fn.lightGallery.modules.pager = Pager; - -})(jQuery, window, document); diff --git a/Resources/public/js/vendor/lightGallery/js/lg-pager.min.js b/Resources/public/js/vendor/lightGallery/js/lg-pager.min.js deleted file mode 100644 index c0121bc0..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-pager.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={pager:!1},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.core.s.pager&&this.core.$items.length>1&&this.init(),this};f.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('
        '),e.core.s.dynamic)for(var g=0;g
        ';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'
        ':'
        '});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},f.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=f}(jQuery,window,document); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lg-thumbnail.js b/Resources/public/js/vendor/lightGallery/js/lg-thumbnail.js deleted file mode 100644 index 488bc068..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-thumbnail.js +++ /dev/null @@ -1,454 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - thumbnail: true, - - animateThumb: true, - currentPagerPosition: 'middle', - - thumbWidth: 100, - thumbContHeight: 100, - thumbMargin: 5, - - exThumbImage: false, - showThumbByDefault: true, - toogleThumb: true, - pullCaptionUp: true, - - enableThumbDrag: true, - enableThumbSwipe: true, - swipeThreshold: 50, - - loadYoutubeThumbnail: true, - youtubeThumbSize: 1, - - loadVimeoThumbnail: true, - vimeoThumbSize: 'thumbnail_small', - - loadDailymotionThumbnail: true - }; - - var Thumbnail = function(element) { - - // get lightGallery core plugin data - this.core = $(element).data('lightGallery'); - - // extend module default settings with lightGallery core settings - this.core.s = $.extend({}, defaults, this.core.s); - - this.$el = $(element); - this.$thumbOuter = null; - this.thumbOuterWidth = 0; - this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin)); - this.thumbIndex = this.core.index; - - // Thumbnail animation value - this.left = 0; - - this.init(); - - return this; - }; - - Thumbnail.prototype.init = function() { - var _this = this; - if (this.core.s.thumbnail && this.core.$items.length > 1) { - if (this.core.s.showThumbByDefault) { - setTimeout(function(){ - _this.core.$outer.addClass('lg-thumb-open'); - }, 700); - } - - if (this.core.s.pullCaptionUp) { - this.core.$outer.addClass('lg-pull-caption-up'); - } - - this.build(); - if (this.core.s.animateThumb) { - if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) { - this.enableThumbDrag(); - } - - if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) { - this.enableThumbSwipe(); - } - - this.thumbClickable = false; - } else { - this.thumbClickable = true; - } - - this.toogle(); - this.thumbkeyPress(); - } - }; - - Thumbnail.prototype.build = function() { - var _this = this; - var thumbList = ''; - var vimeoErrorThumbSize = ''; - var $thumb; - var html = '
        ' + - '
        ' + - '
        ' + - '
        '; - - switch (this.core.s.vimeoThumbSize) { - case 'thumbnail_large': - vimeoErrorThumbSize = '640'; - break; - case 'thumbnail_medium': - vimeoErrorThumbSize = '200x150'; - break; - case 'thumbnail_small': - vimeoErrorThumbSize = '100x75'; - } - - _this.core.$outer.addClass('lg-has-thumb'); - - _this.core.$outer.find('.lg').append(html); - - _this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer'); - _this.thumbOuterWidth = _this.$thumbOuter.width(); - - if (_this.core.s.animateThumb) { - _this.core.$outer.find('.lg-thumb').css({ - width: _this.thumbTotalWidth + 'px', - position: 'relative' - }); - } - - if (this.core.s.animateThumb) { - _this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px'); - } - - function getThumb(src, thumb, index) { - var isVideo = _this.core.isVideo(src, index) || {}; - var thumbImg; - var vimeoId = ''; - - if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) { - if (isVideo.youtube) { - if (_this.core.s.loadYoutubeThumbnail) { - thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg'; - } else { - thumbImg = thumb; - } - } else if (isVideo.vimeo) { - if (_this.core.s.loadVimeoThumbnail) { - thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg'; - vimeoId = isVideo.vimeo[1]; - } else { - thumbImg = thumb; - } - } else if (isVideo.dailymotion) { - if (_this.core.s.loadDailymotionThumbnail) { - thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1]; - } else { - thumbImg = thumb; - } - } - } else { - thumbImg = thumb; - } - - thumbList += '
        '; - vimeoId = ''; - } - - if (_this.core.s.dynamic) { - for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { - getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i); - } - } else { - _this.core.$items.each(function(i) { - - if (!_this.core.s.exThumbImage) { - getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i); - } else { - getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i); - } - - }); - } - - _this.core.$outer.find('.lg-thumb').html(thumbList); - - $thumb = _this.core.$outer.find('.lg-thumb-item'); - - // Load vimeo thumbnails - $thumb.each(function() { - var $this = $(this); - var vimeoVideoId = $this.attr('data-vimeo-id'); - - if (vimeoVideoId) { - $.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', { - format: 'json' - }, function(data) { - $this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]); - }); - } - }); - - // manage active class for thumbnail - $thumb.eq(_this.core.index).addClass('active'); - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - $thumb.removeClass('active'); - $thumb.eq(_this.core.index).addClass('active'); - }); - - $thumb.on('click.lg touchend.lg', function() { - var _$this = $(this); - setTimeout(function() { - - // In IE9 and bellow touch does not support - // Go to slide if browser does not support css transitions - if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) { - _this.core.index = _$this.index(); - _this.core.slide(_this.core.index, false, true); - } - }, 50); - }); - - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - _this.animateThumb(_this.core.index); - }); - - $(window).on('resize.lg.thumb orientationchange.lg.thumb', function() { - setTimeout(function() { - _this.animateThumb(_this.core.index); - _this.thumbOuterWidth = _this.$thumbOuter.width(); - }, 200); - }); - - }; - - Thumbnail.prototype.setTranslate = function(value) { - // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 - this.core.$outer.find('.lg-thumb').css({ - transform: 'translate3d(-' + (value) + 'px, 0px, 0px)' - }); - }; - - Thumbnail.prototype.animateThumb = function(index) { - var $thumb = this.core.$outer.find('.lg-thumb'); - if (this.core.s.animateThumb) { - var position; - switch (this.core.s.currentPagerPosition) { - case 'left': - position = 0; - break; - case 'middle': - position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2); - break; - case 'right': - position = this.thumbOuterWidth - this.core.s.thumbWidth; - } - this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position; - if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) { - this.left = this.thumbTotalWidth - this.thumbOuterWidth; - } - - if (this.left < 0) { - this.left = 0; - } - - if (this.core.lGalleryOn) { - if (!$thumb.hasClass('on')) { - this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms'); - } - - if (!this.core.doCss()) { - $thumb.animate({ - left: -this.left + 'px' - }, this.core.s.speed); - } - } else { - if (!this.core.doCss()) { - $thumb.css('left', -this.left + 'px'); - } - } - - this.setTranslate(this.left); - - } - }; - - // Enable thumbnail dragging and swiping - Thumbnail.prototype.enableThumbDrag = function() { - - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isDraging = false; - var isMoved = false; - var tempLeft = 0; - - _this.$thumbOuter.addClass('lg-grab'); - - _this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - // execute only on .lg-object - e.preventDefault(); - startCoords = e.pageX; - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.$outer.scrollLeft += 1; - _this.core.$outer.scrollLeft -= 1; - - // * - _this.thumbClickable = false; - _this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing'); - } - }); - - $(window).on('mousemove.lg.thumb', function(e) { - if (isDraging) { - tempLeft = _this.left; - isMoved = true; - endCoords = e.pageX; - - _this.$thumbOuter.addClass('lg-dragging'); - - tempLeft = tempLeft - (endCoords - startCoords); - - if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { - tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; - } - - if (tempLeft < 0) { - tempLeft = 0; - } - - // move current slide - _this.setTranslate(tempLeft); - - } - }); - - $(window).on('mouseup.lg.thumb', function() { - if (isMoved) { - isMoved = false; - _this.$thumbOuter.removeClass('lg-dragging'); - - _this.left = tempLeft; - - if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { - _this.thumbClickable = true; - } - - } else { - _this.thumbClickable = true; - } - - if (isDraging) { - isDraging = false; - _this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab'); - } - }); - - }; - - Thumbnail.prototype.enableThumbSwipe = function() { - var _this = this; - var startCoords = 0; - var endCoords = 0; - var isMoved = false; - var tempLeft = 0; - - _this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - e.preventDefault(); - startCoords = e.originalEvent.targetTouches[0].pageX; - _this.thumbClickable = false; - } - }); - - _this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - e.preventDefault(); - endCoords = e.originalEvent.targetTouches[0].pageX; - isMoved = true; - - _this.$thumbOuter.addClass('lg-dragging'); - - tempLeft = _this.left; - - tempLeft = tempLeft - (endCoords - startCoords); - - if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { - tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; - } - - if (tempLeft < 0) { - tempLeft = 0; - } - - // move current slide - _this.setTranslate(tempLeft); - - } - }); - - _this.core.$outer.find('.lg-thumb').on('touchend.lg', function() { - if (_this.thumbTotalWidth > _this.thumbOuterWidth) { - - if (isMoved) { - isMoved = false; - _this.$thumbOuter.removeClass('lg-dragging'); - if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { - _this.thumbClickable = true; - } - - _this.left = tempLeft; - } else { - _this.thumbClickable = true; - } - } else { - _this.thumbClickable = true; - } - }); - - }; - - Thumbnail.prototype.toogle = function() { - var _this = this; - if (_this.core.s.toogleThumb) { - _this.core.$outer.addClass('lg-can-toggle'); - _this.$thumbOuter.append(''); - _this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() { - _this.core.$outer.toggleClass('lg-thumb-open'); - }); - } - }; - - Thumbnail.prototype.thumbkeyPress = function() { - var _this = this; - $(window).on('keydown.lg.thumb', function(e) { - if (e.keyCode === 38) { - e.preventDefault(); - _this.core.$outer.addClass('lg-thumb-open'); - } else if (e.keyCode === 40) { - e.preventDefault(); - _this.core.$outer.removeClass('lg-thumb-open'); - } - }); - }; - - Thumbnail.prototype.destroy = function() { - if (this.core.s.thumbnail && this.core.$items.length > 1) { - $(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb'); - this.$thumbOuter.remove(); - this.core.$outer.removeClass('lg-has-thumb'); - } - }; - - $.fn.lightGallery.modules.Thumbnail = Thumbnail; - -})(jQuery, window, document); diff --git a/Resources/public/js/vendor/lightGallery/js/lg-thumbnail.min.js b/Resources/public/js/vendor/lightGallery/js/lg-thumbnail.min.js deleted file mode 100644 index 7d9a9df9..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-thumbnail.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.$el=a(b),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.left=0,this.init(),this};f.prototype.init=function(){var a=this;this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&setTimeout(function(){a.core.$outer.addClass("lg-thumb-open")},700),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb?(this.core.s.enableThumbDrag&&!this.core.isTouch&&this.core.doCss()&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.core.isTouch&&this.core.doCss()&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},f.prototype.build=function(){function c(a,b,c){var d,h=e.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?d=e.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+e.core.s.youtubeThumbSize+".jpg":b:h.vimeo?e.core.s.loadVimeoThumbnail?(d="//i.vimeocdn.com/video/error_"+g+".jpg",i=h.vimeo[1]):d=b:h.dailymotion&&(d=e.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):d=b,f+='
        ',i=""}var d,e=this,f="",g="",h='
        ';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":g="640";break;case"thumbnail_medium":g="200x150";break;case"thumbnail_small":g="100x75"}if(e.core.$outer.addClass("lg-has-thumb"),e.core.$outer.find(".lg").append(h),e.$thumbOuter=e.core.$outer.find(".lg-thumb-outer"),e.thumbOuterWidth=e.$thumbOuter.width(),e.core.s.animateThumb&&e.core.$outer.find(".lg-thumb").css({width:e.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&e.$thumbOuter.css("height",e.core.s.thumbContHeight+"px"),e.core.s.dynamic)for(var i=0;ithis.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},f.prototype.enableThumbDrag=function(){var c=this,d=0,e=0,f=!1,g=!1,h=0;c.$thumbOuter.addClass("lg-grab"),c.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){c.thumbTotalWidth>c.thumbOuterWidth&&(a.preventDefault(),d=a.pageX,f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.thumbClickable=!1,c.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.thumb",function(a){f&&(h=c.left,g=!0,e=a.pageX,c.$thumbOuter.addClass("lg-dragging"),h-=e-d,h>c.thumbTotalWidth-c.thumbOuterWidth&&(h=c.thumbTotalWidth-c.thumbOuterWidth),h<0&&(h=0),c.setTranslate(h))}),a(b).on("mouseup.lg.thumb",function(){g?(g=!1,c.$thumbOuter.removeClass("lg-dragging"),c.left=h,Math.abs(e-d)a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),e<0&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},f.prototype.thumbkeyPress=function(){var c=this;a(b).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),c.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),c.core.$outer.removeClass("lg-thumb-open"))})},f.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(b).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=f}(jQuery,window,document); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lg-video.js b/Resources/public/js/vendor/lightGallery/js/lg-video.js deleted file mode 100644 index 79fe23c1..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-video.js +++ /dev/null @@ -1,292 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - videoMaxWidth: '855px', - youtubePlayerParams: false, - vimeoPlayerParams: false, - dailymotionPlayerParams: false, - vkPlayerParams: false, - videojs: false, - videojsOptions: {} - }; - - var Video = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - this.core.s = $.extend({}, defaults, this.core.s); - this.videoLoaded = false; - - this.init(); - - return this; - }; - - Video.prototype.init = function() { - var _this = this; - - // Event triggered when video url found without poster - _this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) { - _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html)); - if (html) { - if (_this.core.s.videojs) { - try { - videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() { - if (!_this.videoLoaded) { - this.play(); - } - }); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - _this.core.$slide.eq(index).find('.lg-html5').get(0).play(); - } - } - }); - - // Set max width for video - _this.core.$el.on('onAferAppendSlide.lg.tm', function(event, index) { - _this.core.$slide.eq(index).find('.lg-video-cont').css('max-width', _this.core.s.videoMaxWidth); - _this.videoLoaded = true; - }); - - var loadOnClick = function($el) { - // check slide has poster - if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) { - - // check already video element present - if (!$el.hasClass('lg-has-video')) { - - $el.addClass('lg-video-playing lg-has-video'); - - var _src; - var _html; - var _loadVideo = function(_src, _html) { - - $el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html)); - - if (_html) { - if (_this.core.s.videojs) { - try { - videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() { - this.play(); - }); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - _this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play(); - } - } - - }; - - if (_this.core.s.dynamic) { - - _src = _this.core.s.dynamicEl[_this.core.index].src; - _html = _this.core.s.dynamicEl[_this.core.index].html; - - _loadVideo(_src, _html); - - } else { - - _src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src'); - _html = _this.core.$items.eq(_this.core.index).attr('data-html'); - - _loadVideo(_src, _html); - - } - - var $tempImg = $el.find('.lg-object'); - $el.find('.lg-video').append($tempImg); - - // @todo loading icon for html5 videos also - // for showing the loading indicator while loading video - if (!$el.find('.lg-video-object').hasClass('lg-html5')) { - $el.removeClass('lg-complete'); - $el.find('.lg-video-object').on('load.lg error.lg', function() { - $el.addClass('lg-complete'); - }); - } - - } else { - - var youtubePlayer = $el.find('.lg-youtube').get(0); - var vimeoPlayer = $el.find('.lg-vimeo').get(0); - var dailymotionPlayer = $el.find('.lg-dailymotion').get(0); - var html5Player = $el.find('.lg-html5').get(0); - if (youtubePlayer) { - youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); - } else if (vimeoPlayer) { - try { - $f(vimeoPlayer).api('play'); - } catch (e) { - console.error('Make sure you have included froogaloop2 js'); - } - } else if (dailymotionPlayer) { - dailymotionPlayer.contentWindow.postMessage('play', '*'); - - } else if (html5Player) { - if (_this.core.s.videojs) { - try { - videojs(html5Player).play(); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - html5Player.play(); - } - } - - $el.addClass('lg-video-playing'); - - } - } - }; - - if (_this.core.doCss() && _this.core.$items.length > 1 && ((_this.core.s.enableSwipe && _this.core.isTouch) || (_this.core.s.enableDrag && !_this.core.isTouch))) { - _this.core.$el.on('onSlideClick.lg.tm', function() { - var $el = _this.core.$slide.eq(_this.core.index); - loadOnClick($el); - }); - } else { - - // For IE 9 and bellow - _this.core.$slide.on('click.lg', function() { - loadOnClick($(this)); - }); - } - - _this.core.$el.on('onBeforeSlide.lg.tm', function(event, prevIndex, index) { - - var $videoSlide = _this.core.$slide.eq(prevIndex); - var youtubePlayer = $videoSlide.find('.lg-youtube').get(0); - var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0); - var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0); - var vkPlayer = $videoSlide.find('.lg-vk').get(0); - var html5Player = $videoSlide.find('.lg-html5').get(0); - if (youtubePlayer) { - youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); - } else if (vimeoPlayer) { - try { - $f(vimeoPlayer).api('pause'); - } catch (e) { - console.error('Make sure you have included froogaloop2 js'); - } - } else if (dailymotionPlayer) { - dailymotionPlayer.contentWindow.postMessage('pause', '*'); - - } else if (html5Player) { - if (_this.core.s.videojs) { - try { - videojs(html5Player).pause(); - } catch (e) { - console.error('Make sure you have included videojs'); - } - } else { - html5Player.pause(); - } - } if (vkPlayer) { - $(vkPlayer).attr('src', $(vkPlayer).attr('src').replace('&autoplay', '&noplay')); - } - - var _src; - if (_this.core.s.dynamic) { - _src = _this.core.s.dynamicEl[index].src; - } else { - _src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src'); - - } - - var _isVideo = _this.core.isVideo(_src, index) || {}; - if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion || _isVideo.vk) { - _this.core.$outer.addClass('lg-hide-download'); - } - - //$videoSlide.addClass('lg-complete'); - - }); - - _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) { - _this.core.$slide.eq(prevIndex).removeClass('lg-video-playing'); - }); - }; - - Video.prototype.loadVideo = function(src, addClass, noposter, index, html) { - var video = ''; - var autoplay = 1; - var a = ''; - var isVideo = this.core.isVideo(src, index) || {}; - - // Enable autoplay for first video if poster doesn't exist - if (noposter) { - if (this.videoLoaded) { - autoplay = 0; - } else { - autoplay = 1; - } - } - - if (isVideo.youtube) { - - a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1'; - if (this.core.s.youtubePlayerParams) { - a = a + '&' + $.param(this.core.s.youtubePlayerParams); - } - - video = ''; - - } else if (isVideo.vimeo) { - - a = '?autoplay=' + autoplay + '&api=1'; - if (this.core.s.vimeoPlayerParams) { - a = a + '&' + $.param(this.core.s.vimeoPlayerParams); - } - - video = ''; - - } else if (isVideo.dailymotion) { - - a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage'; - if (this.core.s.dailymotionPlayerParams) { - a = a + '&' + $.param(this.core.s.dailymotionPlayerParams); - } - - video = ''; - - } else if (isVideo.html5) { - var fL = html.substring(0, 1); - if (fL === '.' || fL === '#') { - html = $(html).html(); - } - - video = html; - - } else if (isVideo.vk) { - - a = '&autoplay=' + autoplay; - if (this.core.s.vkPlayerParams) { - a = a + '&' + $.param(this.core.s.vkPlayerParams); - } - - video = ''; - - } - - return video; - }; - - Video.prototype.destroy = function() { - this.videoLoaded = false; - }; - - $.fn.lightGallery.modules.video = Video; - -})(jQuery, window, document); diff --git a/Resources/public/js/vendor/lightGallery/js/lg-video.min.js b/Resources/public/js/vendor/lightGallery/js/lg-video.min.js deleted file mode 100644 index bb60be05..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-video.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={videoMaxWidth:"855px",youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoLoaded=!1,this.init(),this};f.prototype.init=function(){var b=this;b.core.$el.on("hasVideo.lg.tm",function(a,c,d,e){if(b.core.$slide.eq(c).find(".lg-video").append(b.loadVideo(d,"lg-object",!0,c,e)),e)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(c).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){b.videoLoaded||this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(c).find(".lg-html5").get(0).play()}),b.core.$el.on("onAferAppendSlide.lg.tm",function(a,c){b.core.$slide.eq(c).find(".lg-video-cont").css("max-width",b.core.s.videoMaxWidth),b.videoLoaded=!0});var c=function(a){if(a.find(".lg-object").hasClass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(e)e.contentWindow.postMessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("Make sure you have included videojs")}else f.play();a.addClass("lg-video-playing")}else{a.addClass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}};b.core.doCss()&&b.core.$items.length>1&&(b.core.s.enableSwipe&&b.core.isTouch||b.core.s.enableDrag&&!b.core.isTouch)?b.core.$el.on("onSlideClick.lg.tm",function(){var a=b.core.$slide.eq(b.core.index);c(a)}):b.core.$slide.on("click.lg",function(){c(a(this))}),b.core.$el.on("onBeforeSlide.lg.tm",function(c,d,e){var f=b.core.$slide.eq(d),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(i)i.contentWindow.postMessage("pause","*");else if(k)if(b.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("Make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=b.core.s.dynamic?b.core.s.dynamicEl[e].src:b.core.$items.eq(e).attr("href")||b.core.$items.eq(e).attr("data-src");var m=b.core.isVideo(l,e)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&b.core.$outer.addClass("lg-hide-download")}),b.core.$el.on("onAfterSlide.lg.tm",function(a,c){b.core.$slide.eq(c).removeClass("lg-video-playing")})},f.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:1),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(i=i+"&"+a.param(this.core.s.dailymotionPlayerParams)),g='';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkPlayerParams&&(i=i+"&"+a.param(this.core.s.vkPlayerParams)),g='');return g},f.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=f}(jQuery,window,document); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lg-zoom.js b/Resources/public/js/vendor/lightGallery/js/lg-zoom.js deleted file mode 100644 index aaa86328..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-zoom.js +++ /dev/null @@ -1,477 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - scale: 1, - zoom: true, - actualSize: true, - enableZoomAfter: 300 - }; - - var Zoom = function(element) { - - this.core = $(element).data('lightGallery'); - - this.core.s = $.extend({}, defaults, this.core.s); - - if (this.core.s.zoom && this.core.doCss()) { - this.init(); - - // Store the zoomable timeout value just to clear it while closing - this.zoomabletimeout = false; - - // Set the initial value center - this.pageX = $(window).width() / 2; - this.pageY = ($(window).height() / 2) + $(window).scrollTop(); - } - - return this; - }; - - Zoom.prototype.init = function() { - - var _this = this; - var zoomIcons = ''; - - if (_this.core.s.actualSize) { - zoomIcons += ''; - } - - this.core.$outer.find('.lg-toolbar').append(zoomIcons); - - // Add zoomable class - _this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) { - - // delay will be 0 except first time - var _speed = _this.core.s.enableZoomAfter + delay; - - // set _speed value 0 if gallery opened from direct url and if it is first slide - if ($('body').hasClass('lg-from-hash') && delay) { - - // will execute only once - _speed = 0; - } else { - - // Remove lg-from-hash to enable starting animation. - $('body').removeClass('lg-from-hash'); - } - - _this.zoomabletimeout = setTimeout(function() { - _this.core.$slide.eq(index).addClass('lg-zoomable'); - }, _speed + 30); - }); - - var scale = 1; - /** - * @desc Image zoom - * Translate the wrap and scale the image to get better user experience - * - * @param {String} scaleVal - Zoom decrement/increment value - */ - var zoom = function(scaleVal) { - - var $image = _this.core.$outer.find('.lg-current .lg-image'); - var _x; - var _y; - - // Find offset manually to avoid issue after zoom - var offsetX = ($(window).width() - $image.width()) / 2; - var offsetY = (($(window).height() - $image.height()) / 2) + $(window).scrollTop(); - - _x = _this.pageX - offsetX; - _y = _this.pageY - offsetY; - - var x = (scaleVal - 1) * (_x); - var y = (scaleVal - 1) * (_y); - - $image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal); - - $image.parent().css({ - left: -x + 'px', - top: -y + 'px' - }).attr('data-x', x).attr('data-y', y); - }; - - var callScale = function() { - if (scale > 1) { - _this.core.$outer.addClass('lg-zoomed'); - } else { - _this.resetZoom(); - } - - if (scale < 1) { - scale = 1; - } - - zoom(scale); - }; - - var actualSize = function(event, $image, index, fromIcon) { - var w = $image.width(); - var nw; - if (_this.core.s.dynamic) { - nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w; - } else { - nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w; - } - - var _scale; - - if (_this.core.$outer.hasClass('lg-zoomed')) { - scale = 1; - } else { - if (nw > w) { - _scale = nw / w; - scale = _scale || 2; - } - } - - if (fromIcon) { - _this.pageX = $(window).width() / 2; - _this.pageY = ($(window).height() / 2) + $(window).scrollTop(); - } else { - _this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX; - _this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY; - } - - callScale(); - setTimeout(function() { - _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - }, 10); - }; - - var tapped = false; - - // event triggered after appending slide content - _this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) { - - // Get the current element - var $image = _this.core.$slide.eq(index).find('.lg-image'); - - $image.on('dblclick', function(event) { - actualSize(event, $image, index); - }); - - $image.on('touchstart', function(event) { - if (!tapped) { - tapped = setTimeout(function() { - tapped = null; - }, 300); - } else { - clearTimeout(tapped); - tapped = null; - actualSize(event, $image, index); - } - - event.preventDefault(); - }); - - }); - - // Update zoom on resize and orientationchange - $(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() { - _this.pageX = $(window).width() / 2; - _this.pageY = ($(window).height() / 2) + $(window).scrollTop(); - zoom(scale); - }); - - $('#lg-zoom-out').on('click.lg', function() { - if (_this.core.$outer.find('.lg-current .lg-image').length) { - scale -= _this.core.s.scale; - callScale(); - } - }); - - $('#lg-zoom-in').on('click.lg', function() { - if (_this.core.$outer.find('.lg-current .lg-image').length) { - scale += _this.core.s.scale; - callScale(); - } - }); - - $('#lg-actual-size').on('click.lg', function(event) { - actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true); - }); - - // Reset zoom on slide change - _this.core.$el.on('onBeforeSlide.lg.tm', function() { - scale = 1; - _this.resetZoom(); - }); - - // Drag option after zoom - if (!_this.core.isTouch) { - _this.zoomDrag(); - } - - if (_this.core.isTouch) { - _this.zoomSwipe(); - } - - }; - - // Reset zoom effect - Zoom.prototype.resetZoom = function() { - this.core.$outer.removeClass('lg-zoomed'); - this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y'); - this.core.$slide.find('.lg-image').removeAttr('style data-scale'); - - // Reset pagx pagy values to center - this.pageX = $(window).width() / 2; - this.pageY = ($(window).height() / 2) + $(window).scrollTop(); - }; - - Zoom.prototype.zoomSwipe = function() { - var _this = this; - var startCoords = {}; - var endCoords = {}; - var isMoved = false; - - // Allow x direction drag - var allowX = false; - - // Allow Y direction drag - var allowY = false; - - _this.core.$slide.on('touchstart.lg', function(e) { - - if (_this.core.$outer.hasClass('lg-zoomed')) { - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); - if ((allowX || allowY)) { - e.preventDefault(); - startCoords = { - x: e.originalEvent.targetTouches[0].pageX, - y: e.originalEvent.targetTouches[0].pageY - }; - } - } - - }); - - _this.core.$slide.on('touchmove.lg', function(e) { - - if (_this.core.$outer.hasClass('lg-zoomed')) { - - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var distanceX; - var distanceY; - - e.preventDefault(); - isMoved = true; - - endCoords = { - x: e.originalEvent.targetTouches[0].pageX, - y: e.originalEvent.targetTouches[0].pageY - }; - - // reset opacity and transition duration - _this.core.$outer.addClass('lg-zoom-dragging'); - - if (allowY) { - distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) { - _$el.css({ - left: distanceX + 'px', - top: distanceY + 'px' - }); - } - - } - - }); - - _this.core.$slide.on('touchend.lg', function() { - if (_this.core.$outer.hasClass('lg-zoomed')) { - if (isMoved) { - isMoved = false; - _this.core.$outer.removeClass('lg-zoom-dragging'); - _this.touchendZoom(startCoords, endCoords, allowX, allowY); - - } - } - }); - - }; - - Zoom.prototype.zoomDrag = function() { - - var _this = this; - var startCoords = {}; - var endCoords = {}; - var isDraging = false; - var isMoved = false; - - // Allow x direction drag - var allowX = false; - - // Allow Y direction drag - var allowY = false; - - _this.core.$slide.on('mousedown.lg.zoom', function(e) { - - // execute only on .lg-object - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); - - if (_this.core.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') && (allowX || allowY)) { - e.preventDefault(); - startCoords = { - x: e.pageX, - y: e.pageY - }; - - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.core.$outer.scrollLeft += 1; - _this.core.$outer.scrollLeft -= 1; - - _this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - } - } - }); - - $(window).on('mousemove.lg.zoom', function(e) { - if (isDraging) { - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var distanceX; - var distanceY; - - isMoved = true; - endCoords = { - x: e.pageX, - y: e.pageY - }; - - // reset opacity and transition duration - _this.core.$outer.addClass('lg-zoom-dragging'); - - if (allowY) { - distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css({ - left: distanceX + 'px', - top: distanceY + 'px' - }); - } - }); - - $(window).on('mouseup.lg.zoom', function(e) { - - if (isDraging) { - isDraging = false; - _this.core.$outer.removeClass('lg-zoom-dragging'); - - // Fix for chrome mouse move on click - if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) { - endCoords = { - x: e.pageX, - y: e.pageY - }; - _this.touchendZoom(startCoords, endCoords, allowX, allowY); - - } - - isMoved = false; - } - - _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); - - }); - }; - - Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) { - - var _this = this; - var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); - var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); - var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - var minY = (_this.core.$outer.find('.lg').height() - $image.outerHeight()) / 2; - var maxY = Math.abs(($image.outerHeight() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY); - var minX = (_this.core.$outer.find('.lg').width() - $image.outerWidth()) / 2; - var maxX = Math.abs(($image.outerWidth() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX); - - if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) { - if (allowY) { - if (distanceY <= -maxY) { - distanceY = -maxY; - } else if (distanceY >= -minY) { - distanceY = -minY; - } - } - - if (allowX) { - if (distanceX <= -maxX) { - distanceX = -maxX; - } else if (distanceX >= -minX) { - distanceX = -minX; - } - } - - if (allowY) { - _$el.attr('data-y', Math.abs(distanceY)); - } else { - distanceY = -Math.abs(_$el.attr('data-y')); - } - - if (allowX) { - _$el.attr('data-x', Math.abs(distanceX)); - } else { - distanceX = -Math.abs(_$el.attr('data-x')); - } - - _$el.css({ - left: distanceX + 'px', - top: distanceY + 'px' - }); - - } - }; - - Zoom.prototype.destroy = function() { - - var _this = this; - - // Unbind all events added by lightGallery zoom plugin - _this.core.$el.off('.lg.zoom'); - $(window).off('.lg.zoom'); - _this.core.$slide.off('.lg.zoom'); - _this.core.$el.off('.lg.tm.zoom'); - _this.resetZoom(); - clearTimeout(_this.zoomabletimeout); - _this.zoomabletimeout = false; - }; - - $.fn.lightGallery.modules.zoom = Zoom; - -})(jQuery, window, document); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lg-zoom.min.js b/Resources/public/js/vendor/lightGallery/js/lg-zoom.min.js deleted file mode 100644 index d6e6188b..00000000 --- a/Resources/public/js/vendor/lightGallery/js/lg-zoom.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 -* http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";var e={scale:1,zoom:!0,actualSize:!0,enableZoomAfter:300},f=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1,this.pageX=a(b).width()/2,this.pageY=a(b).height()/2+a(b).scrollTop()),this};f.prototype.init=function(){var c=this,d='';c.core.s.actualSize&&(d+=''),this.core.$outer.find(".lg-toolbar").append(d),c.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(b,d,e){var f=c.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),c.zoomabletimeout=setTimeout(function(){c.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var e=1,f=function(d){var e,f,g=c.core.$outer.find(".lg-current .lg-image"),h=(a(b).width()-g.width())/2,i=(a(b).height()-g.height())/2+a(b).scrollTop();e=c.pageX-h,f=c.pageY-i;var j=(d-1)*e,k=(d-1)*f;g.css("transform","scale3d("+d+", "+d+", 1)").attr("data-scale",d),g.parent().css({left:-j+"px",top:-k+"px"}).attr("data-x",j).attr("data-y",k)},g=function(){e>1?c.core.$outer.addClass("lg-zoomed"):c.resetZoom(),e<1&&(e=1),f(e)},h=function(d,f,h,i){var j,k=f.width();j=c.core.s.dynamic?c.core.s.dynamicEl[h].width||f[0].naturalWidth||k:c.core.$items.eq(h).attr("data-width")||f[0].naturalWidth||k;var l;c.core.$outer.hasClass("lg-zoomed")?e=1:j>k&&(l=j/k,e=l||2),i?(c.pageX=a(b).width()/2,c.pageY=a(b).height()/2+a(b).scrollTop()):(c.pageX=d.pageX||d.originalEvent.targetTouches[0].pageX,c.pageY=d.pageY||d.originalEvent.targetTouches[0].pageY),g(),setTimeout(function(){c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},i=!1;c.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,b){var d=c.core.$slide.eq(b).find(".lg-image");d.on("dblclick",function(a){h(a,d,b)}),d.on("touchstart",function(a){i?(clearTimeout(i),i=null,h(a,d,b)):i=setTimeout(function(){i=null},300),a.preventDefault()})}),a(b).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){c.pageX=a(b).width()/2,c.pageY=a(b).height()/2+a(b).scrollTop(),f(e)}),a("#lg-zoom-out").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e-=c.core.s.scale,g())}),a("#lg-zoom-in").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e+=c.core.s.scale,g())}),a("#lg-actual-size").on("click.lg",function(a){h(a,c.core.$slide.eq(c.core.index).find(".lg-image"),c.core.index,!0)}),c.core.$el.on("onBeforeSlide.lg.tm",function(){e=1,c.resetZoom()}),c.core.isTouch||c.zoomDrag(),c.core.isTouch&&c.zoomSwipe()},f.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale"),this.pageX=a(b).width()/2,this.pageY=a(b).height()/2+a(b).scrollTop()},f.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.outerHeight()*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.outerWidth()*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),(Math.abs(c.x-b.x)>15||Math.abs(c.y-b.y)>15)&&j.css({left:h+"px",top:i+"px"})}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},f.prototype.zoomDrag=function(){var c=this,d={},e={},f=!1,g=!1,h=!1,i=!1;c.core.$slide.on("mousedown.lg.zoom",function(b){var e=c.core.$slide.eq(c.core.index).find(".lg-object");i=e.outerHeight()*e.attr("data-scale")>c.core.$outer.find(".lg").height(),h=e.outerWidth()*e.attr("data-scale")>c.core.$outer.find(".lg").width(),c.core.$outer.hasClass("lg-zoomed")&&a(b.target).hasClass("lg-object")&&(h||i)&&(b.preventDefault(),d={x:b.pageX,y:b.pageY},f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.zoom",function(a){if(f){var b,j,k=c.core.$slide.eq(c.core.index).find(".lg-img-wrap");g=!0,e={x:a.pageX,y:a.pageY},c.core.$outer.addClass("lg-zoom-dragging"),j=i?-Math.abs(k.attr("data-y"))+(e.y-d.y):-Math.abs(k.attr("data-y")),b=h?-Math.abs(k.attr("data-x"))+(e.x-d.x):-Math.abs(k.attr("data-x")),k.css({left:b+"px",top:j+"px"})}}),a(b).on("mouseup.lg.zoom",function(a){f&&(f=!1,c.core.$outer.removeClass("lg-zoom-dragging"),!g||d.x===e.x&&d.y===e.y||(e={x:a.pageX,y:a.pageY},c.touchendZoom(d,e,h,i)),g=!1),c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},f.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.outerHeight())/2,k=Math.abs(g.outerHeight()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.outerWidth())/2,m=Math.abs(g.outerWidth()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(Math.abs(b.x-a.x)>15||Math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),f.css({left:h+"px",top:i+"px"}))},f.prototype.destroy=function(){var c=this;c.core.$el.off(".lg.zoom"),a(b).off(".lg.zoom"),c.core.$slide.off(".lg.zoom"),c.core.$el.off(".lg.tm.zoom"),c.resetZoom(),clearTimeout(c.zoomabletimeout),c.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=f}(jQuery,window,document); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lightgallery-all.js b/Resources/public/js/vendor/lightGallery/js/lightgallery-all.js index c23bbc8f..f23e8b10 100644 --- a/Resources/public/js/vendor/lightGallery/js/lightgallery-all.js +++ b/Resources/public/js/vendor/lightGallery/js/lightgallery-all.js @@ -1,8 +1,26 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ +/*! lightgallery - v1.6.11 - 2018-05-22 +* http://sachinchoolur.github.io/lightGallery/ +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(root["jQuery"]); + } +}(this, function ($) { + +(function() { 'use strict'; var defaults = { @@ -157,6 +175,7 @@ setTimeout(function() { _this.build(_this.index); }); + $('body').addClass('lg-on'); } } @@ -213,7 +232,7 @@ }); // initiate slide function - _this.slide(index, false, false); + _this.slide(index, false, false, false); if (_this.s.keyPress) { _this.keyPress(); @@ -231,6 +250,10 @@ if (_this.s.mousewheel) { _this.mousewheel(); } + } else { + _this.$slide.on('click.lg', function() { + _this.$el.trigger('onSlideClick.lg'); + }); } _this.counter(); @@ -253,6 +276,8 @@ }); + _this.$outer.trigger('mousemove.lg'); + }; Plugin.prototype.structure = function() { @@ -274,8 +299,8 @@ // Create controlls if (this.s.controls && this.$items.length > 1) { controls = '
        ' + - '
        ' + this.s.prevHtml + '
        ' + - '
        ' + this.s.nextHtml + '
        ' + + '' + + '' + '
        '; } @@ -286,7 +311,7 @@ template = '
        ' + '
        ' + '
        ' + list + '
        ' + - '
        ' + + '
        ' + '' + '
        ' + controls + @@ -344,7 +369,9 @@ $inner.css('transition-duration', this.s.speed + 'ms'); } - $('.lg-backdrop').addClass('in'); + setTimeout(function() { + $('.lg-backdrop').addClass('in'); + }); setTimeout(function() { _this.$outer.addClass('lg-visible'); @@ -409,13 +436,18 @@ html = this.$items.eq(index).attr('data-html'); } - if (!src && html) { - return { - html5: true - }; + if (!src) { + if(html) { + return { + html5: true + }; + } else { + console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html'); + return false; + } } - var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); + var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); @@ -640,7 +672,7 @@ var _isVideo = _this.isVideo(_src, index); if (!_this.$slide.eq(index).hasClass('lg-loaded')) { if (iframe) { - _this.$slide.eq(index).prepend('
        '); + _this.$slide.eq(index).prepend('
        '); } else if (_hasPoster) { var videoClass = ''; if (_isVideo && _isVideo.youtube) { @@ -674,7 +706,7 @@ elements: [_$img[0]] }); } catch (e) { - console.error('Make sure you have included Picturefill version 2'); + console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.'); } } @@ -740,8 +772,9 @@ * @param {Number} index - index of the slide * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag * @param {Boolean} fromThumb - true if slide function called via thumbnail click + * @param {String} direction - Direction of the slide(next/prev) */ - Plugin.prototype.slide = function(index, fromTouch, fromThumb) { + Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) { var _prevIndex = this.$outer.find('.lg-current').index(); var _this = this; @@ -754,8 +787,6 @@ var _length = this.$slide.length; var _time = _this.lGalleryOn ? this.s.speed : 0; - var _next = false; - var _prev = false; if (!_this.lgBusy) { @@ -793,6 +824,14 @@ this.arrowDisable(index); + if (!direction) { + if (index < _prevIndex) { + direction = 'prev'; + } else if (index > _prevIndex) { + direction = 'next'; + } + } + if (!fromTouch) { // remove all transitions @@ -800,26 +839,12 @@ this.$slide.removeClass('lg-prev-slide lg-next-slide'); - if (index < _prevIndex) { - _prev = true; - if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) { - _prev = false; - _next = true; - } - } else if (index > _prevIndex) { - _next = true; - if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) { - _prev = true; - _next = false; - } - } - - if (_prev) { + if (direction === 'prev') { //prevslide this.$slide.eq(index).addClass('lg-prev-slide'); this.$slide.eq(_prevIndex).addClass('lg-next-slide'); - } else if (_next) { + } else { // next slide this.$slide.eq(index).addClass('lg-next-slide'); @@ -838,24 +863,36 @@ }, 50); } else { - var touchPrev = index - 1; - var touchNext = index + 1; - - if ((index === 0) && (_prevIndex === _length - 1)) { + this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); + var touchPrev; + var touchNext; + if (_length > 2) { + touchPrev = index - 1; + touchNext = index + 1; + + if ((index === 0) && (_prevIndex === _length - 1)) { + + // next slide + touchNext = 0; + touchPrev = _length - 1; + } else if ((index === _length - 1) && (_prevIndex === 0)) { + + // prev slide + touchNext = 0; + touchPrev = _length - 1; + } - // next slide - touchNext = 0; - touchPrev = _length - 1; - } else if ((index === _length - 1) && (_prevIndex === 0)) { + } else { + touchPrev = 0; + touchNext = 1; + } - // prev slide - touchNext = 0; - touchPrev = _length - 1; + if (direction === 'prev') { + _this.$slide.eq(touchNext).addClass('lg-next-slide'); + } else { + _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); } - this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); - _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); - _this.$slide.eq(touchNext).addClass('lg-next-slide'); _this.$slide.eq(index).addClass('lg-current'); } @@ -883,6 +920,7 @@ } } + _this.index = index; }; @@ -892,17 +930,22 @@ */ Plugin.prototype.goToNextSlide = function(fromTouch) { var _this = this; + var _loop = _this.s.loop; + if (fromTouch && _this.$slide.length < 3) { + _loop = false; + } + if (!_this.lgBusy) { if ((_this.index + 1) < _this.$slide.length) { _this.index++; _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); + _this.slide(_this.index, fromTouch, false, 'next'); } else { - if (_this.s.loop) { + if (_loop) { _this.index = 0; _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { + _this.slide(_this.index, fromTouch, false, 'next'); + } else if (_this.s.slideEndAnimatoin && !fromTouch) { _this.$outer.addClass('lg-right-end'); setTimeout(function() { _this.$outer.removeClass('lg-right-end'); @@ -918,17 +961,22 @@ */ Plugin.prototype.goToPrevSlide = function(fromTouch) { var _this = this; + var _loop = _this.s.loop; + if (fromTouch && _this.$slide.length < 3) { + _loop = false; + } + if (!_this.lgBusy) { if (_this.index > 0) { _this.index--; _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); + _this.slide(_this.index, fromTouch, false, 'prev'); } else { - if (_this.s.loop) { + if (_loop) { _this.index = _this.$items.length - 1; _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { + _this.slide(_this.index, fromTouch, false, 'prev'); + } else if (_this.s.slideEndAnimatoin && !fromTouch) { _this.$outer.addClass('lg-left-end'); setTimeout(function() { _this.$outer.removeClass('lg-left-end'); @@ -1066,7 +1114,7 @@ var endCoords = 0; var isMoved = false; - if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) { + if (_this.s.enableSwipe && _this.doCss()) { _this.$slide.on('touchstart.lg', function(e) { if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { @@ -1105,30 +1153,23 @@ var endCoords = 0; var isDraging = false; var isMoved = false; - if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) { + if (_this.s.enableDrag && _this.doCss()) { _this.$slide.on('mousedown.lg', function(e) { - // execute only on .lg-object - if (!_this.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { - e.preventDefault(); - - if (!_this.lgBusy) { - _this.manageSwipeClass(); - startCoords = e.pageX; - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.$outer.scrollLeft += 1; - _this.$outer.scrollLeft -= 1; + if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy && !$(e.target).text().trim()) { + e.preventDefault(); + _this.manageSwipeClass(); + startCoords = e.pageX; + isDraging = true; - // * + // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 + _this.$outer.scrollLeft += 1; + _this.$outer.scrollLeft -= 1; - _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); + // * - _this.$el.trigger('onDragstart.lg'); - } + _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - } + _this.$el.trigger('onDragstart.lg'); } }); @@ -1161,23 +1202,22 @@ }; Plugin.prototype.manageSwipeClass = function() { - var touchNext = this.index + 1; - var touchPrev = this.index - 1; - var length = this.$slide.length; - if (this.s.loop) { + var _touchNext = this.index + 1; + var _touchPrev = this.index - 1; + if (this.s.loop && this.$slide.length > 2) { if (this.index === 0) { - touchPrev = length - 1; - } else if (this.index === length - 1) { - touchNext = 0; + _touchPrev = this.$slide.length - 1; + } else if (this.index === this.$slide.length - 1) { + _touchNext = 0; } } this.$slide.removeClass('lg-next-slide lg-prev-slide'); - if (touchPrev > -1) { - this.$slide.eq(touchPrev).addClass('lg-prev-slide'); + if (_touchPrev > -1) { + this.$slide.eq(_touchPrev).addClass('lg-prev-slide'); } - this.$slide.eq(touchNext).addClass('lg-next-slide'); + this.$slide.eq(_touchNext).addClass('lg-next-slide'); }; Plugin.prototype.mousewheel = function() { @@ -1220,6 +1260,10 @@ } }); + + _this.$outer.on('mousemove.lg', function() { + mousedown = false; + }); _this.$outer.on('mouseup.lg', function(e) { @@ -1241,9 +1285,9 @@ if (!d) { _this.$el.trigger('onBeforeClose.lg'); + $(window).scrollTop(_this.prevScrollTop); } - $(window).scrollTop(_this.prevScrollTop); /** * if d is false or undefined destroy will only close the gallery @@ -1314,16 +1358,33 @@ $.fn.lightGallery.modules = {}; -})(jQuery, window, document); +})(); -/** - * Autoplay Plugin - * @version 1.2.0 - * @author Sachin N - @sachinchoolur - * @license MIT License (MIT) - */ -(function($, window, document, undefined) { +})); + +/*! lg-autoplay - v1.0.4 - 2017-03-28 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { + + +(function() { 'use strict'; @@ -1391,7 +1452,9 @@ // Start autoplay if (_this.core.s.autoplay) { - _this.startlAuto(); + _this.$el.one('onSlideItemLoad.lg.tm', function() { + _this.startlAuto(); + }); } // cancel interval on touchstart and dragstart @@ -1481,7 +1544,7 @@ } _this.fromAuto = true; - _this.core.slide(_this.core.index, false, false); + _this.core.slide(_this.core.index, false, false, 'next'); }, _this.core.s.speed + _this.core.s.pause); }; @@ -1502,9 +1565,32 @@ $.fn.lightGallery.modules.autoplay = Autoplay; -})(jQuery, window, document); +})(); + + +})); -(function($, window, document, undefined) { +/*! lg-fullscreen - v1.0.1 - 2016-09-30 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { + +(function() { 'use strict'; @@ -1597,9 +1683,31 @@ $.fn.lightGallery.modules.fullscreen = Fullscreen; -})(jQuery, window, document); +})(); + +})); + +/*! lg-pager - v1.0.2 - 2017-01-22 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ -(function($, window, document, undefined) { +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { + +(function() { 'use strict'; @@ -1653,7 +1761,7 @@ $pagerCont.on('click.lg touchend.lg', function() { var _$this = $(this); _this.core.index = _$this.index(); - _this.core.slide(_this.core.index, false, false); + _this.core.slide(_this.core.index, false, true, false); }); $pagerOuter.on('mouseover.lg', function() { @@ -1680,9 +1788,32 @@ $.fn.lightGallery.modules.pager = Pager; -})(jQuery, window, document); +})(); + + +})); + +/*! lg-thumbnail - v1.1.0 - 2017-08-08 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ -(function($, window, document, undefined) { +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { + +(function() { 'use strict'; @@ -1693,6 +1824,7 @@ currentPagerPosition: 'middle', thumbWidth: 100, + thumbHeight: '80px', thumbContHeight: 100, thumbMargin: 5, @@ -1728,6 +1860,10 @@ this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin)); this.thumbIndex = this.core.index; + if (this.core.s.animateThumb) { + this.core.s.thumbHeight = '100%'; + } + // Thumbnail animation value this.left = 0; @@ -1750,12 +1886,12 @@ } this.build(); - if (this.core.s.animateThumb) { - if (this.core.s.enableThumbDrag && !this.core.isTouch && this.core.doCss()) { + if (this.core.s.animateThumb && this.core.doCss()) { + if (this.core.s.enableThumbDrag) { this.enableThumbDrag(); } - if (this.core.s.enableThumbSwipe && this.core.isTouch && this.core.doCss()) { + if (this.core.s.enableThumbSwipe) { this.enableThumbSwipe(); } @@ -1775,7 +1911,7 @@ var vimeoErrorThumbSize = ''; var $thumb; var html = '
        ' + - '
        ' + + '
        ' + '
        ' + '
        '; @@ -1838,7 +1974,7 @@ thumbImg = thumb; } - thumbList += '
        '; + thumbList += '
        '; vimeoId = ''; } @@ -1891,7 +2027,7 @@ // Go to slide if browser does not support css transitions if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) { _this.core.index = _$this.index(); - _this.core.slide(_this.core.index, false, true); + _this.core.slide(_this.core.index, false, true, false); } }, 50); }); @@ -2132,65 +2268,168 @@ $.fn.lightGallery.modules.Thumbnail = Thumbnail; -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - - var defaults = { - videoMaxWidth: '855px', - youtubePlayerParams: false, - vimeoPlayerParams: false, - dailymotionPlayerParams: false, - vkPlayerParams: false, - videojs: false, - videojsOptions: {} - }; - - var Video = function(element) { - - this.core = $(element).data('lightGallery'); - - this.$el = $(element); - this.core.s = $.extend({}, defaults, this.core.s); - this.videoLoaded = false; - - this.init(); - - return this; - }; - - Video.prototype.init = function() { - var _this = this; - - // Event triggered when video url found without poster - _this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) { - _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html)); - if (html) { - if (_this.core.s.videojs) { - try { - videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() { - if (!_this.videoLoaded) { - this.play(); - } - }); - } catch (e) { - console.error('Make sure you have included videojs'); +})(); + +})); + +/*! lg-video - v1.2.2 - 2018-05-01 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(root["jQuery"]); + } +}(this, function ($) { + +(function() { + + 'use strict'; + + var defaults = { + videoMaxWidth: '855px', + + autoplayFirstVideo: true, + + youtubePlayerParams: false, + vimeoPlayerParams: false, + dailymotionPlayerParams: false, + vkPlayerParams: false, + + videojs: false, + videojsOptions: {} + }; + + var Video = function(element) { + + this.core = $(element).data('lightGallery'); + + this.$el = $(element); + this.core.s = $.extend({}, defaults, this.core.s); + this.videoLoaded = false; + + this.init(); + + return this; + }; + + Video.prototype.init = function() { + var _this = this; + + // Event triggered when video url found without poster + _this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this)); + + // Set max width for video + _this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this)); + + if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) { + _this.core.$el.on('onSlideClick.lg.tm', function() { + var $el = _this.core.$slide.eq(_this.core.index); + _this.loadVideoOnclick($el); + }); + } else { + + // For IE 9 and bellow + _this.core.$slide.on('click.lg', function() { + _this.loadVideoOnclick($(this)); + }); + } + + _this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this)); + + _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) { + _this.core.$slide.eq(prevIndex).removeClass('lg-video-playing'); + }); + + if (_this.core.s.autoplayFirstVideo) { + _this.core.$el.on('onAferAppendSlide.lg.tm', function (e, index) { + if (!_this.core.lGalleryOn) { + var $el = _this.core.$slide.eq(index); + setTimeout(function () { + _this.loadVideoOnclick($el); + }, 100); } + }); + } + }; + + Video.prototype.loadVideo = function(src, addClass, noPoster, index, html) { + var video = ''; + var autoplay = 1; + var a = ''; + var isVideo = this.core.isVideo(src, index) || {}; + + // Enable autoplay based on setting for first video if poster doesn't exist + if (noPoster) { + if (this.videoLoaded) { + autoplay = 0; } else { - _this.core.$slide.eq(index).find('.lg-html5').get(0).play(); + autoplay = this.core.s.autoplayFirstVideo ? 1 : 0; } } - }); + + if (isVideo.youtube) { + + a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1'; + if (this.core.s.youtubePlayerParams) { + a = a + '&' + $.param(this.core.s.youtubePlayerParams); + } + + video = ''; + + } else if (isVideo.vimeo) { + + a = '?autoplay=' + autoplay + '&api=1'; + if (this.core.s.vimeoPlayerParams) { + a = a + '&' + $.param(this.core.s.vimeoPlayerParams); + } + + video = ''; + + } else if (isVideo.dailymotion) { + + a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage'; + if (this.core.s.dailymotionPlayerParams) { + a = a + '&' + $.param(this.core.s.dailymotionPlayerParams); + } + + video = ''; + + } else if (isVideo.html5) { + var fL = html.substring(0, 1); + if (fL === '.' || fL === '#') { + html = $(html).html(); + } + + video = html; + + } else if (isVideo.vk) { + + a = '&autoplay=' + autoplay; + if (this.core.s.vkPlayerParams) { + a = a + '&' + $.param(this.core.s.vkPlayerParams); + } + + video = ''; + + } + + return video; + }; - // Set max width for video - _this.core.$el.on('onAferAppendSlide.lg.tm', function(event, index) { - _this.core.$slide.eq(index).find('.lg-video-cont').css('max-width', _this.core.s.videoMaxWidth); - _this.videoLoaded = true; - }); + Video.prototype.loadVideoOnclick = function($el){ - var loadOnClick = function($el) { + var _this = this; // check slide has poster if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) { @@ -2283,21 +2522,46 @@ } } }; + + Video.prototype.destroy = function() { + this.videoLoaded = false; + }; - if (_this.core.doCss() && _this.core.$items.length > 1 && ((_this.core.s.enableSwipe && _this.core.isTouch) || (_this.core.s.enableDrag && !_this.core.isTouch))) { - _this.core.$el.on('onSlideClick.lg.tm', function() { - var $el = _this.core.$slide.eq(_this.core.index); - loadOnClick($el); - }); - } else { + function onHasVideo(event, index, src, html) { + /*jshint validthis:true */ + var _this = this; + _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html)); + if (html) { + if (_this.core.s.videojs) { + try { + videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() { + if (!_this.videoLoaded && _this.core.s.autoplayFirstVideo) { + this.play(); + } + }); + } catch (e) { + console.error('Make sure you have included videojs'); + } + } else { + if(!_this.videoLoaded && _this.core.s.autoplayFirstVideo) { + _this.core.$slide.eq(index).find('.lg-html5').get(0).play(); + } + } + } + } - // For IE 9 and bellow - _this.core.$slide.on('click.lg', function() { - loadOnClick($(this)); - }); + function onAferAppendSlide(event, index) { + /*jshint validthis:true */ + var $videoCont = this.core.$slide.eq(index).find('.lg-video-cont'); + if (!$videoCont.hasClass('lg-has-iframe')) { + $videoCont.css('max-width', this.core.s.videoMaxWidth); + this.videoLoaded = true; + } } - _this.core.$el.on('onBeforeSlide.lg.tm', function(event, prevIndex, index) { + function onBeforeSlide(event, prevIndex, index) { + /*jshint validthis:true */ + var _this = this; var $videoSlide = _this.core.$slide.eq(prevIndex); var youtubePlayer = $videoSlide.find('.lg-youtube').get(0); @@ -2343,96 +2607,54 @@ _this.core.$outer.addClass('lg-hide-download'); } - //$videoSlide.addClass('lg-complete'); - - }); - - _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) { - _this.core.$slide.eq(prevIndex).removeClass('lg-video-playing'); - }); - }; - - Video.prototype.loadVideo = function(src, addClass, noposter, index, html) { - var video = ''; - var autoplay = 1; - var a = ''; - var isVideo = this.core.isVideo(src, index) || {}; - - // Enable autoplay for first video if poster doesn't exist - if (noposter) { - if (this.videoLoaded) { - autoplay = 0; - } else { - autoplay = 1; - } } + + $.fn.lightGallery.modules.video = Video; + + })(); - if (isVideo.youtube) { - - a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1'; - if (this.core.s.youtubePlayerParams) { - a = a + '&' + $.param(this.core.s.youtubePlayerParams); - } - - video = ''; - - } else if (isVideo.vimeo) { - - a = '?autoplay=' + autoplay + '&api=1'; - if (this.core.s.vimeoPlayerParams) { - a = a + '&' + $.param(this.core.s.vimeoPlayerParams); - } - - video = ''; - - } else if (isVideo.dailymotion) { - - a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage'; - if (this.core.s.dailymotionPlayerParams) { - a = a + '&' + $.param(this.core.s.dailymotionPlayerParams); - } - - video = ''; - - } else if (isVideo.html5) { - var fL = html.substring(0, 1); - if (fL === '.' || fL === '#') { - html = $(html).html(); - } +})); - video = html; +/*! lg-zoom - v1.1.0 - 2017-08-08 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ - } else if (isVideo.vk) { +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { - a = '&autoplay=' + autoplay; - if (this.core.s.vkPlayerParams) { - a = a + '&' + $.param(this.core.s.vkPlayerParams); - } +(function() { - video = ''; + 'use strict'; + var getUseLeft = function() { + var useLeft = false; + var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); + if (isChrome && parseInt(isChrome[2], 10) < 54) { + useLeft = true; } - return video; - }; - - Video.prototype.destroy = function() { - this.videoLoaded = false; + return useLeft; }; - $.fn.lightGallery.modules.video = Video; - -})(jQuery, window, document); - -(function($, window, document, undefined) { - - 'use strict'; - var defaults = { scale: 1, zoom: true, actualSize: true, - enableZoomAfter: 300 + enableZoomAfter: 300, + useLeftForZoom: getUseLeft() }; var Zoom = function(element) { @@ -2464,6 +2686,12 @@ zoomIcons += ''; } + if (_this.core.s.useLeftForZoom) { + _this.core.$outer.addClass('lg-use-left-for-zoom'); + } else { + _this.core.$outer.addClass('lg-use-transition-for-zoom'); + } + this.core.$outer.find('.lg-toolbar').append(zoomIcons); // Add zoomable class @@ -2502,8 +2730,8 @@ var _y; // Find offset manually to avoid issue after zoom - var offsetX = ($(window).width() - $image.width()) / 2; - var offsetY = (($(window).height() - $image.height()) / 2) + $(window).scrollTop(); + var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2; + var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop(); _x = _this.pageX - offsetX; _y = _this.pageY - offsetY; @@ -2513,10 +2741,14 @@ $image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal); - $image.parent().css({ - left: -x + 'px', - top: -y + 'px' - }).attr('data-x', x).attr('data-y', y); + if (_this.core.s.useLeftForZoom) { + $image.parent().css({ + left: -x + 'px', + top: -y + 'px' + }).attr('data-x', x).attr('data-y', y); + } else { + $image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y); + } }; var callScale = function() { @@ -2534,7 +2766,7 @@ }; var actualSize = function(event, $image, index, fromIcon) { - var w = $image.width(); + var w = $image.prop('offsetWidth'); var nw; if (_this.core.s.dynamic) { nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w; @@ -2627,13 +2859,9 @@ }); // Drag option after zoom - if (!_this.core.isTouch) { - _this.zoomDrag(); - } + _this.zoomDrag(); - if (_this.core.isTouch) { - _this.zoomSwipe(); - } + _this.zoomSwipe(); }; @@ -2665,8 +2893,8 @@ if (_this.core.$outer.hasClass('lg-zoomed')) { var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); + allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); + allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); if ((allowX || allowY)) { e.preventDefault(); startCoords = { @@ -2710,10 +2938,15 @@ } if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) { - _$el.css({ - left: distanceX + 'px', - top: distanceY + 'px' - }); + + if (_this.core.s.useLeftForZoom) { + _$el.css({ + left: distanceX + 'px', + top: distanceY + 'px' + }); + } else { + _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); + } } } @@ -2752,8 +2985,8 @@ // execute only on .lg-object var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); - allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); - allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); + allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); + allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); if (_this.core.$outer.hasClass('lg-zoomed')) { if ($(e.target).hasClass('lg-object') && (allowX || allowY)) { @@ -2801,10 +3034,14 @@ distanceX = -Math.abs(_$el.attr('data-x')); } - _$el.css({ - left: distanceX + 'px', - top: distanceY + 'px' - }); + if (_this.core.s.useLeftForZoom) { + _$el.css({ + left: distanceX + 'px', + top: distanceY + 'px' + }); + } else { + _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); + } } }); @@ -2839,10 +3076,10 @@ var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); - var minY = (_this.core.$outer.find('.lg').height() - $image.outerHeight()) / 2; - var maxY = Math.abs(($image.outerHeight() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY); - var minX = (_this.core.$outer.find('.lg').width() - $image.outerWidth()) / 2; - var maxX = Math.abs(($image.outerWidth() * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX); + var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2; + var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY); + var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2; + var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX); if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) { if (allowY) { @@ -2873,10 +3110,14 @@ distanceX = -Math.abs(_$el.attr('data-x')); } - _$el.css({ - left: distanceX + 'px', - top: distanceY + 'px' - }); + if (_this.core.s.useLeftForZoom) { + _$el.css({ + left: distanceX + 'px', + top: distanceY + 'px' + }); + } else { + _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); + } } }; @@ -2897,8 +3138,32 @@ $.fn.lightGallery.modules.zoom = Zoom; -})(jQuery, window, document); -(function($, window, document, undefined) { +})(); + + +})); + +/*! lg-hash - v1.0.4 - 2017-12-20 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { + +(function() { 'use strict'; @@ -2926,7 +3191,11 @@ // Change hash value on after each slide transition _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { - window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; + if (history.replaceState) { + history.replaceState(null, null, window.location.pathname + window.location.search + '#lg=' + _this.core.s.galleryId + '&slide=' + index); + } else { + window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; + } }); // Listen hash change and change the slide according to slide value @@ -2952,10 +3221,14 @@ // Reset to old hash value if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) { - window.location.hash = this.oldHash; + if (history.replaceState) { + history.replaceState(null, null, this.oldHash); + } else { + window.location.hash = this.oldHash; + } } else { - if (history.pushState) { - history.pushState('', document.title, window.location.pathname + window.location.search); + if (history.replaceState) { + history.replaceState(null, document.title, window.location.pathname + window.location.search); } else { window.location.hash = ''; } @@ -2967,4 +3240,115 @@ $.fn.lightGallery.modules.hash = Hash; -})(jQuery, window, document); \ No newline at end of file +})(); + + +})); + +/*! lg-share - v1.1.0 - 2017-10-03 +* http://sachinchoolur.github.io/lightGallery +* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ + +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(this, function ($) { + +(function() { + + 'use strict'; + + var defaults = { + share: true, + facebook: true, + facebookDropdownText: 'Facebook', + twitter: true, + twitterDropdownText: 'Twitter', + googlePlus: true, + googlePlusDropdownText: 'GooglePlus', + pinterest: true, + pinterestDropdownText: 'Pinterest' + }; + + var Share = function(element) { + + this.core = $(element).data('lightGallery'); + + this.core.s = $.extend({}, defaults, this.core.s); + if (this.core.s.share) { + this.init(); + } + + return this; + }; + + Share.prototype.init = function() { + var _this = this; + var shareHtml = '' + + ''; + + this.core.$outer.find('.lg-toolbar').append(shareHtml); + this.core.$outer.find('.lg').append('
        '); + $('#lg-share').on('click.lg', function(){ + _this.core.$outer.toggleClass('lg-dropdown-active'); + }); + + $('#lg-dropdown-overlay').on('click.lg', function(){ + _this.core.$outer.removeClass('lg-dropdown-active'); + }); + + _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { + + setTimeout(function() { + + $('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.getSahreProps(index, 'facebookShareUrl') || window.location.href))); + + $('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.getSahreProps(index, 'tweetText') + '&url=' + (encodeURIComponent(_this.getSahreProps(index, 'twitterShareUrl') || window.location.href))); + + $('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.getSahreProps(index, 'googleplusShareUrl') || window.location.href))); + + $('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.getSahreProps(index, 'pinterestShareUrl') || window.location.href)) + '&media=' + encodeURIComponent(_this.getSahreProps(index, 'src')) + '&description=' + _this.getSahreProps(index, 'pinterestText')); + + }, 100); + }); + }; + + Share.prototype.getSahreProps = function(index, prop){ + var shareProp = ''; + if(this.core.s.dynamic) { + shareProp = this.core.s.dynamicEl[index][prop]; + } else { + var _href = this.core.$items.eq(index).attr('href'); + var _prop = this.core.$items.eq(index).data(prop); + shareProp = prop === 'src' ? _href || _prop : _prop; + } + return shareProp; + }; + + Share.prototype.destroy = function() { + + }; + + $.fn.lightGallery.modules.share = Share; + +})(); + + + +})); diff --git a/Resources/public/js/vendor/lightGallery/js/lightgallery-all.min.js b/Resources/public/js/vendor/lightGallery/js/lightgallery-all.min.js index 440ba928..91b9f9dd 100644 --- a/Resources/public/js/vendor/lightGallery/js/lightgallery-all.min.js +++ b/Resources/public/js/vendor/lightGallery/js/lightgallery-all.min.js @@ -1,5 +1,5 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";function e(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},f,d),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in c.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=a(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var f={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};e.prototype.init=function(){var c=this;c.s.preload>c.$items.length&&(c.s.preload=c.$items.length);var d=b.location.hash;d.indexOf("lg="+this.s.galleryId)>0&&(c.index=parseInt(d.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||(setTimeout(function(){c.build(c.index)}),a("body").addClass("lg-on"))),c.s.dynamic?(c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})):c.$items.on("click.lgcustom",function(b){try{b.preventDefault(),b.preventDefault()}catch(a){b.returnValue=!1}c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||c.$items.index(this),a("body").hasClass("lg-on")||(c.build(c.index),a("body").addClass("lg-on"))})},e.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1&&(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)})},e.prototype.structure=function(){var c,d="",e="",f=0,g="",h=this;for(a("body").append('
        '),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),f=0;f
        ';if(this.s.controls&&this.$items.length>1&&(e='
        '+this.s.prevHtml+'
        '+this.s.nextHtml+"
        "),".lg-sub-html"===this.s.appendSubHtmlTo&&(g='
        '),c='
        '+d+'
        '+e+g+"
        ",a("body").append(c),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),h.setTop(),a(b).on("resize.lg orientationchange.lg",function(){setTimeout(function(){h.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var i=this.$outer.find(".lg-inner");i.css("transition-timing-function",this.s.cssEasing),i.css("transition-duration",this.s.speed+"ms")}a(".lg-backdrop").addClass("in"),setTimeout(function(){h.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevScrollTop=a(b).scrollTop()},e.prototype.setTop=function(){if("100%"!==this.s.height){var c=a(b).height(),d=(c-parseInt(this.s.height,10))/2,e=this.$outer.find(".lg");c>=parseInt(this.s.height,10)?e.css("top",d+"px"):e.css("top","0px")}},e.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=c.documentElement,d=0;for(d=0;d'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"
        ")},e.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if("undefined"!=typeof e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),"undefined"!=typeof e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},e.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},e.prototype.loadContent=function(c,d,e){var f,g,h,i,j,k,l=this,m=!1,n=function(c){for(var d=[],e=[],f=0;fi){g=e[j];break}};if(l.s.dynamic){if(l.s.dynamicEl[c].poster&&(m=!0,h=l.s.dynamicEl[c].poster),k=l.s.dynamicEl[c].html,g=l.s.dynamicEl[c].src,l.s.dynamicEl[c].responsive){var o=l.s.dynamicEl[c].responsive.split(",");n(o)}i=l.s.dynamicEl[c].srcset,j=l.s.dynamicEl[c].sizes}else{if(l.$items.eq(c).attr("data-poster")&&(m=!0,h=l.$items.eq(c).attr("data-poster")),k=l.$items.eq(c).attr("data-html"),g=l.$items.eq(c).attr("href")||l.$items.eq(c).attr("data-src"),l.$items.eq(c).attr("data-responsive")){var p=l.$items.eq(c).attr("data-responsive").split(",");n(p)}i=l.$items.eq(c).attr("data-srcset"),j=l.$items.eq(c).attr("data-sizes")}var q=!1;l.s.dynamic?l.s.dynamicEl[c].iframe&&(q=!0):"true"===l.$items.eq(c).attr("data-iframe")&&(q=!0);var r=l.isVideo(g,c);if(!l.$slide.eq(c).hasClass("lg-loaded")){if(q)l.$slide.eq(c).prepend('
        ');else if(m){var s="";s=r&&r.youtube?"lg-has-youtube":r&&r.vimeo?"lg-has-vimeo":"lg-has-html5",l.$slide.eq(c).prepend('
        ')}else r?(l.$slide.eq(c).prepend('
        '),l.$el.trigger("hasVideo.lg",[c,g,k])):l.$slide.eq(c).prepend('
        ');if(l.$el.trigger("onAferAppendSlide.lg",[c]),f=l.$slide.eq(c).find(".lg-object"),j&&f.attr("sizes",j),i){f.attr("srcset",i);try{picturefill({elements:[f[0]]})}catch(a){console.error("Make sure you have included Picturefill version 2")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&l.addHtml(c),l.$slide.eq(c).addClass("lg-loaded")}l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){var b=0;e&&!a("body").hasClass("lg-from-hash")&&(b=e),setTimeout(function(){l.$slide.eq(c).addClass("lg-complete"),l.$el.trigger("onSlideItemLoad.lg",[c,e||0])},b)}),r&&r.html5&&!m&&l.$slide.eq(c).addClass("lg-complete"),d===!0&&(l.$slide.eq(c).hasClass("lg-complete")?l.preload(c):l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){l.preload(c)}))},e.prototype.slide=function(b,c,d){var e=this.$outer.find(".lg-current").index(),f=this;if(!f.lGalleryOn||e!==b){var g=this.$slide.length,h=f.lGalleryOn?this.s.speed:0,i=!1,j=!1;if(!f.lgBusy){if(this.s.download){var k;k=f.s.dynamic?f.s.dynamicEl[b].downloadUrl!==!1&&(f.s.dynamicEl[b].downloadUrl||f.s.dynamicEl[b].src):"false"!==f.$items.eq(b).attr("data-download-url")&&(f.$items.eq(b).attr("data-download-url")||f.$items.eq(b).attr("href")||f.$items.eq(b).attr("data-src")),k?(a("#lg-download").attr("href",k),f.$outer.removeClass("lg-hide-download")):f.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[e,b,c,d]),f.lgBusy=!0,clearTimeout(f.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){f.addHtml(b)},h),this.arrowDisable(b),c){var l=b-1,m=b+1;0===b&&e===g-1?(m=0,l=g-1):b===g-1&&0===e&&(m=0,l=g-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),f.$slide.eq(l).addClass("lg-prev-slide"),f.$slide.eq(m).addClass("lg-next-slide"),f.$slide.eq(b).addClass("lg-current")}else f.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),be&&(i=!0,b!==g-1||0!==e||d||(j=!0,i=!1)),j?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")):i&&(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(e).addClass("lg-prev-slide")),setTimeout(function(){f.$slide.removeClass("lg-current"),f.$slide.eq(b).addClass("lg-current"),f.$outer.removeClass("lg-no-trans")},50);f.lGalleryOn?(setTimeout(function(){f.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])},this.s.speed)):(f.loadContent(b,!0,f.s.backdropDuration),f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])),f.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}}},e.prototype.goToNextSlide=function(a){var b=this;b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.loop?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},e.prototype.keyPress=function(){var c=this;this.$items.length>1&&a(b).on("keyup.lg",function(a){c.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),c.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),c.goToNextSlide()))}),a(b).on("keydown.lg",function(a){c.s.escKey===!0&&27===a.keyCode&&(a.preventDefault(),c.$outer.hasClass("lg-thumb-open")?c.$outer.removeClass("lg-thumb-open"):c.destroy())})},e.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},e.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},e.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},e.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},e.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},e.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.isTouch&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},e.prototype.enableDrag=function(){var c=this,d=0,e=0,f=!1,g=!1;c.s.enableDrag&&!c.isTouch&&c.doCss()&&(c.$slide.on("mousedown.lg",function(b){c.$outer.hasClass("lg-zoomed")||(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&(b.preventDefault(),c.lgBusy||(c.manageSwipeClass(),d=b.pageX,f=!0,c.$outer.scrollLeft+=1,c.$outer.scrollLeft-=1,c.$outer.removeClass("lg-grab").addClass("lg-grabbing"),c.$el.trigger("onDragstart.lg")))}),a(b).on("mousemove.lg",function(a){f&&(g=!0,e=a.pageX,c.touchMove(d,e),c.$el.trigger("onDragmove.lg"))}),a(b).on("mouseup.lg",function(b){g?(g=!1,c.touchEnd(e-d),c.$el.trigger("onDragend.lg")):(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&c.$el.trigger("onSlideClick.lg"),f&&(f=!1,c.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},e.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1,c=this.$slide.length;this.s.loop&&(0===this.index?b=c-1:this.index===c-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},e.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},e.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},e.prototype.destroy=function(c){var d=this;c||d.$el.trigger("onBeforeClose.lg"),a(b).scrollTop(d.prevScrollTop),c&&(d.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(d.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){d.modules[a]&&d.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(d.hideBartimeout),this.hideBartimeout=!1,a(b).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),d.$outer&&d.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){d.$outer&&d.$outer.remove(),a(".lg-backdrop").remove(),c||d.$el.trigger("onCloseAfter.lg")},d.s.backdropDuration+50)},a.fn.lightGallery=function(b){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new e(this,b))})},a.fn.lightGallery.modules={}}(jQuery,window,document),function(a,b,c,d){"use strict";var e={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),!(this.core.$items.length<2)&&(this.core.s=a.extend({},e,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};f.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('
        '),a.progress(),a.core.s.autoplay&&a.startlAuto(),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},f.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},f.prototype.controls=function(){var b=this,c='';a(this.core.s.appendAutoplayControlsTo).append(c),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},f.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+11&&this.init(),this};f.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('
        '),e.core.s.dynamic)for(var g=0;g
        ';else e.core.$items.each(function(){f+=e.core.s.exThumbImage?'
        ':'
        '});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},f.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},f=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.$el=a(b),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.left=0,this.init(),this};f.prototype.init=function(){var a=this;this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&setTimeout(function(){a.core.$outer.addClass("lg-thumb-open")},700),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb?(this.core.s.enableThumbDrag&&!this.core.isTouch&&this.core.doCss()&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.core.isTouch&&this.core.doCss()&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},f.prototype.build=function(){function c(a,b,c){var d,h=e.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?d=e.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+e.core.s.youtubeThumbSize+".jpg":b:h.vimeo?e.core.s.loadVimeoThumbnail?(d="//i.vimeocdn.com/video/error_"+g+".jpg",i=h.vimeo[1]):d=b:h.dailymotion&&(d=e.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):d=b,f+='
        ',i=""}var d,e=this,f="",g="",h='
        ';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":g="640";break;case"thumbnail_medium":g="200x150";break;case"thumbnail_small":g="100x75"}if(e.core.$outer.addClass("lg-has-thumb"),e.core.$outer.find(".lg").append(h),e.$thumbOuter=e.core.$outer.find(".lg-thumb-outer"),e.thumbOuterWidth=e.$thumbOuter.width(),e.core.s.animateThumb&&e.core.$outer.find(".lg-thumb").css({width:e.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&e.$thumbOuter.css("height",e.core.s.thumbContHeight+"px"),e.core.s.dynamic)for(var i=0;ithis.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},f.prototype.enableThumbDrag=function(){var c=this,d=0,e=0,f=!1,g=!1,h=0;c.$thumbOuter.addClass("lg-grab"),c.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){c.thumbTotalWidth>c.thumbOuterWidth&&(a.preventDefault(),d=a.pageX,f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.thumbClickable=!1,c.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.thumb",function(a){f&&(h=c.left,g=!0,e=a.pageX,c.$thumbOuter.addClass("lg-dragging"),h-=e-d,h>c.thumbTotalWidth-c.thumbOuterWidth&&(h=c.thumbTotalWidth-c.thumbOuterWidth),h<0&&(h=0),c.setTranslate(h))}),a(b).on("mouseup.lg.thumb",function(){g?(g=!1,c.$thumbOuter.removeClass("lg-dragging"),c.left=h,Math.abs(e-d)a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),e<0&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},f.prototype.thumbkeyPress=function(){var c=this;a(b).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),c.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),c.core.$outer.removeClass("lg-thumb-open"))})},f.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(b).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"),this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={videoMaxWidth:"855px",youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoLoaded=!1,this.init(),this};f.prototype.init=function(){var b=this;b.core.$el.on("hasVideo.lg.tm",function(a,c,d,e){if(b.core.$slide.eq(c).find(".lg-video").append(b.loadVideo(d,"lg-object",!0,c,e)),e)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(c).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){b.videoLoaded||this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(c).find(".lg-html5").get(0).play()}),b.core.$el.on("onAferAppendSlide.lg.tm",function(a,c){b.core.$slide.eq(c).find(".lg-video-cont").css("max-width",b.core.s.videoMaxWidth),b.videoLoaded=!0});var c=function(a){if(a.find(".lg-object").hasClass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(e)e.contentWindow.postMessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("Make sure you have included videojs")}else f.play();a.addClass("lg-video-playing"); -}else{a.addClass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}};b.core.doCss()&&b.core.$items.length>1&&(b.core.s.enableSwipe&&b.core.isTouch||b.core.s.enableDrag&&!b.core.isTouch)?b.core.$el.on("onSlideClick.lg.tm",function(){var a=b.core.$slide.eq(b.core.index);c(a)}):b.core.$slide.on("click.lg",function(){c(a(this))}),b.core.$el.on("onBeforeSlide.lg.tm",function(c,d,e){var f=b.core.$slide.eq(d),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(i)i.contentWindow.postMessage("pause","*");else if(k)if(b.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("Make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=b.core.s.dynamic?b.core.s.dynamicEl[e].src:b.core.$items.eq(e).attr("href")||b.core.$items.eq(e).attr("data-src");var m=b.core.isVideo(l,e)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&b.core.$outer.addClass("lg-hide-download")}),b.core.$el.on("onAfterSlide.lg.tm",function(a,c){b.core.$slide.eq(c).removeClass("lg-video-playing")})},f.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:1),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(i=i+"&"+a.param(this.core.s.dailymotionPlayerParams)),g='';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkPlayerParams&&(i=i+"&"+a.param(this.core.s.vkPlayerParams)),g='');return g},f.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={scale:1,zoom:!0,actualSize:!0,enableZoomAfter:300},f=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1,this.pageX=a(b).width()/2,this.pageY=a(b).height()/2+a(b).scrollTop()),this};f.prototype.init=function(){var c=this,d='';c.core.s.actualSize&&(d+=''),this.core.$outer.find(".lg-toolbar").append(d),c.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(b,d,e){var f=c.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),c.zoomabletimeout=setTimeout(function(){c.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var e=1,f=function(d){var e,f,g=c.core.$outer.find(".lg-current .lg-image"),h=(a(b).width()-g.width())/2,i=(a(b).height()-g.height())/2+a(b).scrollTop();e=c.pageX-h,f=c.pageY-i;var j=(d-1)*e,k=(d-1)*f;g.css("transform","scale3d("+d+", "+d+", 1)").attr("data-scale",d),g.parent().css({left:-j+"px",top:-k+"px"}).attr("data-x",j).attr("data-y",k)},g=function(){e>1?c.core.$outer.addClass("lg-zoomed"):c.resetZoom(),e<1&&(e=1),f(e)},h=function(d,f,h,i){var j,k=f.width();j=c.core.s.dynamic?c.core.s.dynamicEl[h].width||f[0].naturalWidth||k:c.core.$items.eq(h).attr("data-width")||f[0].naturalWidth||k;var l;c.core.$outer.hasClass("lg-zoomed")?e=1:j>k&&(l=j/k,e=l||2),i?(c.pageX=a(b).width()/2,c.pageY=a(b).height()/2+a(b).scrollTop()):(c.pageX=d.pageX||d.originalEvent.targetTouches[0].pageX,c.pageY=d.pageY||d.originalEvent.targetTouches[0].pageY),g(),setTimeout(function(){c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},i=!1;c.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,b){var d=c.core.$slide.eq(b).find(".lg-image");d.on("dblclick",function(a){h(a,d,b)}),d.on("touchstart",function(a){i?(clearTimeout(i),i=null,h(a,d,b)):i=setTimeout(function(){i=null},300),a.preventDefault()})}),a(b).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){c.pageX=a(b).width()/2,c.pageY=a(b).height()/2+a(b).scrollTop(),f(e)}),a("#lg-zoom-out").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e-=c.core.s.scale,g())}),a("#lg-zoom-in").on("click.lg",function(){c.core.$outer.find(".lg-current .lg-image").length&&(e+=c.core.s.scale,g())}),a("#lg-actual-size").on("click.lg",function(a){h(a,c.core.$slide.eq(c.core.index).find(".lg-image"),c.core.index,!0)}),c.core.$el.on("onBeforeSlide.lg.tm",function(){e=1,c.resetZoom()}),c.core.isTouch||c.zoomDrag(),c.core.isTouch&&c.zoomSwipe()},f.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale"),this.pageX=a(b).width()/2,this.pageY=a(b).height()/2+a(b).scrollTop()},f.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.outerHeight()*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.outerWidth()*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),(Math.abs(c.x-b.x)>15||Math.abs(c.y-b.y)>15)&&j.css({left:h+"px",top:i+"px"})}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},f.prototype.zoomDrag=function(){var c=this,d={},e={},f=!1,g=!1,h=!1,i=!1;c.core.$slide.on("mousedown.lg.zoom",function(b){var e=c.core.$slide.eq(c.core.index).find(".lg-object");i=e.outerHeight()*e.attr("data-scale")>c.core.$outer.find(".lg").height(),h=e.outerWidth()*e.attr("data-scale")>c.core.$outer.find(".lg").width(),c.core.$outer.hasClass("lg-zoomed")&&a(b.target).hasClass("lg-object")&&(h||i)&&(b.preventDefault(),d={x:b.pageX,y:b.pageY},f=!0,c.core.$outer.scrollLeft+=1,c.core.$outer.scrollLeft-=1,c.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(b).on("mousemove.lg.zoom",function(a){if(f){var b,j,k=c.core.$slide.eq(c.core.index).find(".lg-img-wrap");g=!0,e={x:a.pageX,y:a.pageY},c.core.$outer.addClass("lg-zoom-dragging"),j=i?-Math.abs(k.attr("data-y"))+(e.y-d.y):-Math.abs(k.attr("data-y")),b=h?-Math.abs(k.attr("data-x"))+(e.x-d.x):-Math.abs(k.attr("data-x")),k.css({left:b+"px",top:j+"px"})}}),a(b).on("mouseup.lg.zoom",function(a){f&&(f=!1,c.core.$outer.removeClass("lg-zoom-dragging"),!g||d.x===e.x&&d.y===e.y||(e={x:a.pageX,y:a.pageY},c.touchendZoom(d,e,h,i)),g=!1),c.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},f.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.outerHeight())/2,k=Math.abs(g.outerHeight()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.outerWidth())/2,m=Math.abs(g.outerWidth()*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(Math.abs(b.x-a.x)>15||Math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),f.css({left:h+"px",top:i+"px"}))},f.prototype.destroy=function(){var c=this;c.core.$el.off(".lg.zoom"),a(b).off(".lg.zoom"),c.core.$slide.off(".lg.zoom"),c.core.$el.off(".lg.tm.zoom"),c.resetZoom(),clearTimeout(c.zoomabletimeout),c.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=f}(jQuery,window,document),function(a,b,c,d){"use strict";var e={hash:!0},f=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},e,this.core.s),this.core.s.hash&&(this.oldHash=b.location.hash,this.init()),this};f.prototype.init=function(){var c,d=this;d.core.$el.on("onAfterSlide.lg.tm",function(a,c,e){b.location.hash="lg="+d.core.s.galleryId+"&slide="+e}),a(b).on("hashchange.lg.hash",function(){c=b.location.hash;var a=parseInt(c.split("&slide=")[1],10);c.indexOf("lg="+d.core.s.galleryId)>-1?d.core.slide(a,!1,!1):d.core.lGalleryOn&&d.core.destroy()})},f.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?b.location.hash=this.oldHash:history.pushState?history.pushState("",c.title,b.location.pathname+b.location.search):b.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=f}(jQuery,window,document); \ No newline at end of file +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},c,d),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=a(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var c={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};b.prototype.init=function(){var b=this;b.s.preload>b.$items.length&&(b.s.preload=b.$items.length);var c=window.location.hash;c.indexOf("lg="+this.s.galleryId)>0&&(b.index=parseInt(c.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||(setTimeout(function(){b.build(b.index)}),a("body").addClass("lg-on"))),b.s.dynamic?(b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){b.build(b.index),a("body").addClass("lg-on")})):b.$items.on("click.lgcustom",function(c){try{c.preventDefault(),c.preventDefault()}catch(a){c.returnValue=!1}b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||b.$items.index(this),a("body").hasClass("lg-on")||(b.build(b.index),a("body").addClass("lg-on"))})},b.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1?(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()):c.$slide.on("click.lg",function(){c.$el.trigger("onSlideClick.lg")}),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)}),c.$outer.trigger("mousemove.lg")},b.prototype.structure=function(){var b,c="",d="",e=0,f="",g=this;for(a("body").append('
        '),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),e=0;e
        ';if(this.s.controls&&this.$items.length>1&&(d='
        "),".lg-sub-html"===this.s.appendSubHtmlTo&&(f='
        '),b='
        '+c+'
        '+d+f+"
        ",a("body").append(b),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),g.setTop(),a(window).on("resize.lg orientationchange.lg",function(){setTimeout(function(){g.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.cssEasing),h.css("transition-duration",this.s.speed+"ms")}setTimeout(function(){a(".lg-backdrop").addClass("in")}),setTimeout(function(){g.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevScrollTop=a(window).scrollTop()},b.prototype.setTop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseInt(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseInt(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.doCss=function(){return!!function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=document.documentElement,c=0;for(c=0;c'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"
        ")},b.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if(void 0!==e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),void 0!==e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},b.prototype.loadContent=function(b,c,d){var e,f,g,h,i,j,k=this,l=!1,m=function(b){for(var c=[],d=[],e=0;eh){f=d[i];break}};if(k.s.dynamic){if(k.s.dynamicEl[b].poster&&(l=!0,g=k.s.dynamicEl[b].poster),j=k.s.dynamicEl[b].html,f=k.s.dynamicEl[b].src,k.s.dynamicEl[b].responsive){m(k.s.dynamicEl[b].responsive.split(","))}h=k.s.dynamicEl[b].srcset,i=k.s.dynamicEl[b].sizes}else{if(k.$items.eq(b).attr("data-poster")&&(l=!0,g=k.$items.eq(b).attr("data-poster")),j=k.$items.eq(b).attr("data-html"),f=k.$items.eq(b).attr("href")||k.$items.eq(b).attr("data-src"),k.$items.eq(b).attr("data-responsive")){m(k.$items.eq(b).attr("data-responsive").split(","))}h=k.$items.eq(b).attr("data-srcset"),i=k.$items.eq(b).attr("data-sizes")}var n=!1;k.s.dynamic?k.s.dynamicEl[b].iframe&&(n=!0):"true"===k.$items.eq(b).attr("data-iframe")&&(n=!0);var o=k.isVideo(f,b);if(!k.$slide.eq(b).hasClass("lg-loaded")){if(n)k.$slide.eq(b).prepend('
        ');else if(l){var p="";p=o&&o.youtube?"lg-has-youtube":o&&o.vimeo?"lg-has-vimeo":"lg-has-html5",k.$slide.eq(b).prepend('
        ')}else o?(k.$slide.eq(b).prepend('
        '),k.$el.trigger("hasVideo.lg",[b,f,j])):k.$slide.eq(b).prepend('
        ');if(k.$el.trigger("onAferAppendSlide.lg",[b]),e=k.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.warn("lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&k.addHtml(b),k.$slide.eq(b).addClass("lg-loaded")}k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasClass("lg-from-hash")&&(c=d),setTimeout(function(){k.$slide.eq(b).addClass("lg-complete"),k.$el.trigger("onSlideItemLoad.lg",[b,d||0])},c)}),o&&o.html5&&!l&&k.$slide.eq(b).addClass("lg-complete"),!0===c&&(k.$slide.eq(b).hasClass("lg-complete")?k.preload(b):k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){k.preload(b)}))},b.prototype.slide=function(b,c,d,e){var f=this.$outer.find(".lg-current").index(),g=this;if(!g.lGalleryOn||f!==b){var h=this.$slide.length,i=g.lGalleryOn?this.s.speed:0;if(!g.lgBusy){if(this.s.download){var j;j=g.s.dynamic?!1!==g.s.dynamicEl[b].downloadUrl&&(g.s.dynamicEl[b].downloadUrl||g.s.dynamicEl[b].src):"false"!==g.$items.eq(b).attr("data-download-url")&&(g.$items.eq(b).attr("data-download-url")||g.$items.eq(b).attr("href")||g.$items.eq(b).attr("data-src")),j?(a("#lg-download").attr("href",j),g.$outer.removeClass("lg-hide-download")):g.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[f,b,c,d]),g.lgBusy=!0,clearTimeout(g.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){g.addHtml(b)},i),this.arrowDisable(b),e||(bf&&(e="next")),c){this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide");var k,l;h>2?(k=b-1,l=b+1,0===b&&f===h-1?(l=0,k=h-1):b===h-1&&0===f&&(l=0,k=h-1)):(k=0,l=1),"prev"===e?g.$slide.eq(l).addClass("lg-next-slide"):g.$slide.eq(k).addClass("lg-prev-slide"),g.$slide.eq(b).addClass("lg-current")}else g.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),"prev"===e?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(f).addClass("lg-next-slide")):(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(f).addClass("lg-prev-slide")),setTimeout(function(){g.$slide.removeClass("lg-current"),g.$slide.eq(b).addClass("lg-current"),g.$outer.removeClass("lg-no-trans")},50);g.lGalleryOn?(setTimeout(function(){g.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])},this.s.speed)):(g.loadContent(b,!0,g.s.backdropDuration),g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])),g.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}g.index=b}},b.prototype.goToNextSlide=function(a){var b=this,c=b.s.loop;a&&b.$slide.length<3&&(c=!1),b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):c?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):b.s.slideEndAnimatoin&&!a&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},b.prototype.keyPress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),b.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),b.goToNextSlide()))}),a(window).on("keydown.lg",function(a){!0===b.s.escKey&&27===a.keyCode&&(a.preventDefault(),b.$outer.hasClass("lg-thumb-open")?b.$outer.removeClass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},b.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},b.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},b.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},b.prototype.enableDrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enableDrag&&b.doCss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasClass("lg-zoomed")||b.lgBusy||a(d.target).text().trim()||(d.preventDefault(),b.manageSwipeClass(),c=d.pageX,e=!0,b.$outer.scrollLeft+=1,b.$outer.scrollLeft-=1,b.$outer.removeClass("lg-grab").addClass("lg-grabbing"),b.$el.trigger("onDragstart.lg"))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pageX,b.touchMove(c,d),b.$el.trigger("onDragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchEnd(d-c),b.$el.trigger("onDragend.lg")):(a(g.target).hasClass("lg-object")||a(g.target).hasClass("lg-video-play"))&&b.$el.trigger("onSlideClick.lg"),e&&(e=!1,b.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},b.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1;this.s.loop&&this.$slide.length>2&&(0===this.index?b=this.$slide.length-1:this.index===this.$slide.length-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},b.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mousemove.lg",function(){c=!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||(c.$el.trigger("onBeforeClose.lg"),a(window).scrollTop(c.prevScrollTop)),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(c.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(c.hideBartimeout),this.hideBartimeout=!1,a(window).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("onCloseAfter.lg")},c.s.backdropDuration+50)},a.fn.lightGallery=function(c){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new b(this,c))})},a.fn.lightGallery.modules={}}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(0,function(a){!function(){"use strict";var b={autoplay:!1,pause:5e3,progressBar:!0,fourceAutoplay:!1,autoplayControls:!0,appendAutoplayControlsTo:".lg-toolbar"},c=function(c){return this.core=a(c).data("lightGallery"),this.$el=a(c),!(this.core.$items.length<2)&&(this.core.s=a.extend({},b,this.core.s),this.interval=!1,this.fromAuto=!0,this.canceledOnTouch=!1,this.fourceAutoplayTemp=this.core.s.fourceAutoplay,this.core.doCss()||(this.core.s.progressBar=!1),this.init(),this)};c.prototype.init=function(){var a=this;a.core.s.autoplayControls&&a.controls(),a.core.s.progressBar&&a.core.$outer.find(".lg").append('
        '),a.progress(),a.core.s.autoplay&&a.$el.one("onSlideItemLoad.lg.tm",function(){a.startlAuto()}),a.$el.on("onDragstart.lg.tm touchstart.lg.tm",function(){a.interval&&(a.cancelAuto(),a.canceledOnTouch=!0)}),a.$el.on("onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm",function(){!a.interval&&a.canceledOnTouch&&(a.startlAuto(),a.canceledOnTouch=!1)})},c.prototype.progress=function(){var a,b,c=this;c.$el.on("onBeforeSlide.lg.tm",function(){c.core.s.progressBar&&c.fromAuto&&(a=c.core.$outer.find(".lg-progress-bar"),b=c.core.$outer.find(".lg-progress"),c.interval&&(b.removeAttr("style"),a.removeClass("lg-start"),setTimeout(function(){b.css("transition","width "+(c.core.s.speed+c.core.s.pause)+"ms ease 0s"),a.addClass("lg-start")},20))),c.fromAuto||c.core.s.fourceAutoplay||c.cancelAuto(),c.fromAuto=!1})},c.prototype.controls=function(){var b=this;a(this.core.s.appendAutoplayControlsTo).append(''),b.core.$outer.find(".lg-autoplay-button").on("click.lg",function(){a(b.core.$outer).hasClass("lg-show-autoplay")?(b.cancelAuto(),b.core.s.fourceAutoplay=!1):b.interval||(b.startlAuto(),b.core.s.fourceAutoplay=b.fourceAutoplayTemp)})},c.prototype.startlAuto=function(){var a=this;a.core.$outer.find(".lg-progress").css("transition","width "+(a.core.s.speed+a.core.s.pause)+"ms ease 0s"),a.core.$outer.addClass("lg-show-autoplay"),a.core.$outer.find(".lg-progress-bar").addClass("lg-start"),a.interval=setInterval(function(){a.core.index+11&&this.init(),this};c.prototype.init=function(){var b,c,d,e=this,f="";if(e.core.$outer.find(".lg").append('
        '),e.core.s.dynamic)for(var g=0;g
        ';else e.core.$items.each(function(){e.core.s.exThumbImage?f+='
        ':f+='
        '});c=e.core.$outer.find(".lg-pager-outer"),c.html(f),b=e.core.$outer.find(".lg-pager-cont"),b.on("click.lg touchend.lg",function(){var b=a(this);e.core.index=b.index(),e.core.slide(e.core.index,!1,!0,!1)}),c.on("mouseover.lg",function(){clearTimeout(d),c.addClass("lg-pager-hover")}),c.on("mouseout.lg",function(){d=setTimeout(function(){c.removeClass("lg-pager-hover")})}),e.core.$el.on("onBeforeSlide.lg.tm",function(a,c,d){b.removeClass("lg-pager-active"),b.eq(d).addClass("lg-pager-active")})},c.prototype.destroy=function(){},a.fn.lightGallery.modules.pager=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(0,function(a){!function(){"use strict";var b={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",thumbWidth:100,thumbHeight:"80px",thumbContHeight:100,thumbMargin:5,exThumbImage:!1,showThumbByDefault:!0,toogleThumb:!0,pullCaptionUp:!0,enableThumbDrag:!0,enableThumbSwipe:!0,swipeThreshold:50,loadYoutubeThumbnail:!0,youtubeThumbSize:1,loadVimeoThumbnail:!0,vimeoThumbSize:"thumbnail_small",loadDailymotionThumbnail:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.$el=a(c),this.$thumbOuter=null,this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.$items.length*(this.core.s.thumbWidth+this.core.s.thumbMargin),this.thumbIndex=this.core.index,this.core.s.animateThumb&&(this.core.s.thumbHeight="100%"),this.left=0,this.init(),this};c.prototype.init=function(){var a=this;this.core.s.thumbnail&&this.core.$items.length>1&&(this.core.s.showThumbByDefault&&setTimeout(function(){a.core.$outer.addClass("lg-thumb-open")},700),this.core.s.pullCaptionUp&&this.core.$outer.addClass("lg-pull-caption-up"),this.build(),this.core.s.animateThumb&&this.core.doCss()?(this.core.s.enableThumbDrag&&this.enableThumbDrag(),this.core.s.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toogle(),this.thumbkeyPress())},c.prototype.build=function(){function b(a,b,c){var g,h=d.core.isVideo(a,c)||{},i="";h.youtube||h.vimeo||h.dailymotion?h.youtube?g=d.core.s.loadYoutubeThumbnail?"//img.youtube.com/vi/"+h.youtube[1]+"/"+d.core.s.youtubeThumbSize+".jpg":b:h.vimeo?d.core.s.loadVimeoThumbnail?(g="//i.vimeocdn.com/video/error_"+f+".jpg",i=h.vimeo[1]):g=b:h.dailymotion&&(g=d.core.s.loadDailymotionThumbnail?"//www.dailymotion.com/thumbnail/video/"+h.dailymotion[1]:b):g=b,e+='
        ',i=""}var c,d=this,e="",f="",g='
        ';switch(this.core.s.vimeoThumbSize){case"thumbnail_large":f="640";break;case"thumbnail_medium":f="200x150";break;case"thumbnail_small":f="100x75"}if(d.core.$outer.addClass("lg-has-thumb"),d.core.$outer.find(".lg").append(g),d.$thumbOuter=d.core.$outer.find(".lg-thumb-outer"),d.thumbOuterWidth=d.$thumbOuter.width(),d.core.s.animateThumb&&d.core.$outer.find(".lg-thumb").css({width:d.thumbTotalWidth+"px",position:"relative"}),this.core.s.animateThumb&&d.$thumbOuter.css("height",d.core.s.thumbContHeight+"px"),d.core.s.dynamic)for(var h=0;hthis.thumbTotalWidth-this.thumbOuterWidth&&(this.left=this.thumbTotalWidth-this.thumbOuterWidth),this.left<0&&(this.left=0),this.core.lGalleryOn?(b.hasClass("on")||this.core.$outer.find(".lg-thumb").css("transition-duration",this.core.s.speed+"ms"),this.core.doCss()||b.animate({left:-this.left+"px"},this.core.s.speed)):this.core.doCss()||b.css("left",-this.left+"px"),this.setTranslate(this.left)}},c.prototype.enableThumbDrag=function(){var b=this,c=0,d=0,e=!1,f=!1,g=0;b.$thumbOuter.addClass("lg-grab"),b.core.$outer.find(".lg-thumb").on("mousedown.lg.thumb",function(a){b.thumbTotalWidth>b.thumbOuterWidth&&(a.preventDefault(),c=a.pageX,e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.thumbClickable=!1,b.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.thumb",function(a){e&&(g=b.left,f=!0,d=a.pageX,b.$thumbOuter.addClass("lg-dragging"),g-=d-c,g>b.thumbTotalWidth-b.thumbOuterWidth&&(g=b.thumbTotalWidth-b.thumbOuterWidth),g<0&&(g=0),b.setTranslate(g))}),a(window).on("mouseup.lg.thumb",function(){f?(f=!1,b.$thumbOuter.removeClass("lg-dragging"),b.left=g,Math.abs(d-c)a.thumbOuterWidth&&(c.preventDefault(),b=c.originalEvent.targetTouches[0].pageX,a.thumbClickable=!1)}),a.core.$outer.find(".lg-thumb").on("touchmove.lg",function(f){a.thumbTotalWidth>a.thumbOuterWidth&&(f.preventDefault(),c=f.originalEvent.targetTouches[0].pageX,d=!0,a.$thumbOuter.addClass("lg-dragging"),e=a.left,e-=c-b,e>a.thumbTotalWidth-a.thumbOuterWidth&&(e=a.thumbTotalWidth-a.thumbOuterWidth),e<0&&(e=0),a.setTranslate(e))}),a.core.$outer.find(".lg-thumb").on("touchend.lg",function(){a.thumbTotalWidth>a.thumbOuterWidth&&d?(d=!1,a.$thumbOuter.removeClass("lg-dragging"),Math.abs(c-b)'),a.core.$outer.find(".lg-toogle-thumb").on("click.lg",function(){a.core.$outer.toggleClass("lg-thumb-open")}))},c.prototype.thumbkeyPress=function(){var b=this;a(window).on("keydown.lg.thumb",function(a){38===a.keyCode?(a.preventDefault(),b.core.$outer.addClass("lg-thumb-open")):40===a.keyCode&&(a.preventDefault(),b.core.$outer.removeClass("lg-thumb-open"))})},c.prototype.destroy=function(){this.core.s.thumbnail&&this.core.$items.length>1&&(a(window).off("resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb"), +this.$thumbOuter.remove(),this.core.$outer.removeClass("lg-has-thumb"))},a.fn.lightGallery.modules.Thumbnail=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(a,b,c,d){var e=this;if(e.core.$slide.eq(b).find(".lg-video").append(e.loadVideo(c,"lg-object",!0,b,d)),d)if(e.core.s.videojs)try{videojs(e.core.$slide.eq(b).find(".lg-html5").get(0),e.core.s.videojsOptions,function(){!e.videoLoaded&&e.core.s.autoplayFirstVideo&&this.play()})}catch(a){console.error("Make sure you have included videojs")}else!e.videoLoaded&&e.core.s.autoplayFirstVideo&&e.core.$slide.eq(b).find(".lg-html5").get(0).play()}function c(a,b){var c=this.core.$slide.eq(b).find(".lg-video-cont");c.hasClass("lg-has-iframe")||(c.css("max-width",this.core.s.videoMaxWidth),this.videoLoaded=!0)}function d(b,c,d){var e=this,f=e.core.$slide.eq(c),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(i)i.contentWindow.postMessage("pause","*");else if(k)if(e.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("Make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=e.core.s.dynamic?e.core.s.dynamicEl[d].src:e.core.$items.eq(d).attr("href")||e.core.$items.eq(d).attr("data-src");var m=e.core.isVideo(l,d)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&e.core.$outer.addClass("lg-hide-download")}var e={videoMaxWidth:"855px",autoplayFirstVideo:!0,youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoLoaded=!1,this.init(),this};f.prototype.init=function(){var e=this;e.core.$el.on("hasVideo.lg.tm",b.bind(this)),e.core.$el.on("onAferAppendSlide.lg.tm",c.bind(this)),e.core.doCss()&&e.core.$items.length>1&&(e.core.s.enableSwipe||e.core.s.enableDrag)?e.core.$el.on("onSlideClick.lg.tm",function(){var a=e.core.$slide.eq(e.core.index);e.loadVideoOnclick(a)}):e.core.$slide.on("click.lg",function(){e.loadVideoOnclick(a(this))}),e.core.$el.on("onBeforeSlide.lg.tm",d.bind(this)),e.core.$el.on("onAfterSlide.lg.tm",function(a,b){e.core.$slide.eq(b).removeClass("lg-video-playing")}),e.core.s.autoplayFirstVideo&&e.core.$el.on("onAferAppendSlide.lg.tm",function(a,b){if(!e.core.lGalleryOn){var c=e.core.$slide.eq(b);setTimeout(function(){e.loadVideoOnclick(c)},100)}})},f.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:this.core.s.autoplayFirstVideo?1:0),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(i=i+"&"+a.param(this.core.s.dailymotionPlayerParams)),g='';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkPlayerParams&&(i=i+"&"+a.param(this.core.s.vkPlayerParams)),g='');return g},f.prototype.loadVideoOnclick=function(a){var b=this;if(a.find(".lg-object").hasClass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(e)e.contentWindow.postMessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("Make sure you have included videojs")}else f.play();a.addClass("lg-video-playing")}else{a.addClass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}},f.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=f}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(0,function(a){!function(){"use strict";var b=function(){var a=!1,b=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return b&&parseInt(b[2],10)<54&&(a=!0),a},c={scale:1,zoom:!0,actualSize:!0,enableZoomAfter:300,useLeftForZoom:b()},d=function(b){return this.core=a(b).data("lightGallery"),this.core.s=a.extend({},c,this.core.s),this.core.s.zoom&&this.core.doCss()&&(this.init(),this.zoomabletimeout=!1,this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()),this};d.prototype.init=function(){var b=this,c='';b.core.s.actualSize&&(c+=''),b.core.s.useLeftForZoom?b.core.$outer.addClass("lg-use-left-for-zoom"):b.core.$outer.addClass("lg-use-transition-for-zoom"),this.core.$outer.find(".lg-toolbar").append(c),b.core.$el.on("onSlideItemLoad.lg.tm.zoom",function(c,d,e){var f=b.core.s.enableZoomAfter+e;a("body").hasClass("lg-from-hash")&&e?f=0:a("body").removeClass("lg-from-hash"),b.zoomabletimeout=setTimeout(function(){b.core.$slide.eq(d).addClass("lg-zoomable")},f+30)});var d=1,e=function(c){var d,e,f=b.core.$outer.find(".lg-current .lg-image"),g=(a(window).width()-f.prop("offsetWidth"))/2,h=(a(window).height()-f.prop("offsetHeight"))/2+a(window).scrollTop();d=b.pageX-g,e=b.pageY-h;var i=(c-1)*d,j=(c-1)*e;f.css("transform","scale3d("+c+", "+c+", 1)").attr("data-scale",c),b.core.s.useLeftForZoom?f.parent().css({left:-i+"px",top:-j+"px"}).attr("data-x",i).attr("data-y",j):f.parent().css("transform","translate3d(-"+i+"px, -"+j+"px, 0)").attr("data-x",i).attr("data-y",j)},f=function(){d>1?b.core.$outer.addClass("lg-zoomed"):b.resetZoom(),d<1&&(d=1),e(d)},g=function(c,e,g,h){var i,j=e.prop("offsetWidth");i=b.core.s.dynamic?b.core.s.dynamicEl[g].width||e[0].naturalWidth||j:b.core.$items.eq(g).attr("data-width")||e[0].naturalWidth||j;var k;b.core.$outer.hasClass("lg-zoomed")?d=1:i>j&&(k=i/j,d=k||2),h?(b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop()):(b.pageX=c.pageX||c.originalEvent.targetTouches[0].pageX,b.pageY=c.pageY||c.originalEvent.targetTouches[0].pageY),f(),setTimeout(function(){b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},h=!1;b.core.$el.on("onAferAppendSlide.lg.tm.zoom",function(a,c){var d=b.core.$slide.eq(c).find(".lg-image");d.on("dblclick",function(a){g(a,d,c)}),d.on("touchstart",function(a){h?(clearTimeout(h),h=null,g(a,d,c)):h=setTimeout(function(){h=null},300),a.preventDefault()})}),a(window).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){b.pageX=a(window).width()/2,b.pageY=a(window).height()/2+a(window).scrollTop(),e(d)}),a("#lg-zoom-out").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d-=b.core.s.scale,f())}),a("#lg-zoom-in").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d+=b.core.s.scale,f())}),a("#lg-actual-size").on("click.lg",function(a){g(a,b.core.$slide.eq(b.core.index).find(".lg-image"),b.core.index,!0)}),b.core.$el.on("onBeforeSlide.lg.tm",function(){d=1,b.resetZoom()}),b.zoomDrag(),b.zoomSwipe()},d.prototype.resetZoom=function(){this.core.$outer.removeClass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeAttr("style data-x data-y"),this.core.$slide.find(".lg-image").removeAttr("style data-scale"),this.pageX=a(window).width()/2,this.pageY=a(window).height()/2+a(window).scrollTop()},d.prototype.zoomSwipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasClass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.prop("offsetHeight")*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.prop("offsetWidth")*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventDefault(),b={x:c.originalEvent.targetTouches[0].pageX,y:c.originalEvent.targetTouches[0].pageY})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasClass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventDefault(),d=!0,c={x:g.originalEvent.targetTouches[0].pageX,y:g.originalEvent.targetTouches[0].pageY},a.core.$outer.addClass("lg-zoom-dragging"),i=f?-Math.abs(j.attr("data-y"))+(c.y-b.y):-Math.abs(j.attr("data-y")),h=e?-Math.abs(j.attr("data-x"))+(c.x-b.x):-Math.abs(j.attr("data-x")),(Math.abs(c.x-b.x)>15||Math.abs(c.y-b.y)>15)&&(a.core.s.useLeftForZoom?j.css({left:h+"px",top:i+"px"}):j.css("transform","translate3d("+h+"px, "+i+"px, 0)"))}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasClass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeClass("lg-zoom-dragging"),a.touchendZoom(b,c,e,f))})},d.prototype.zoomDrag=function(){var b=this,c={},d={},e=!1,f=!1,g=!1,h=!1;b.core.$slide.on("mousedown.lg.zoom",function(d){var f=b.core.$slide.eq(b.core.index).find(".lg-object");h=f.prop("offsetHeight")*f.attr("data-scale")>b.core.$outer.find(".lg").height(),g=f.prop("offsetWidth")*f.attr("data-scale")>b.core.$outer.find(".lg").width(),b.core.$outer.hasClass("lg-zoomed")&&a(d.target).hasClass("lg-object")&&(g||h)&&(d.preventDefault(),c={x:d.pageX,y:d.pageY},e=!0,b.core.$outer.scrollLeft+=1,b.core.$outer.scrollLeft-=1,b.core.$outer.removeClass("lg-grab").addClass("lg-grabbing"))}),a(window).on("mousemove.lg.zoom",function(a){if(e){var i,j,k=b.core.$slide.eq(b.core.index).find(".lg-img-wrap");f=!0,d={x:a.pageX,y:a.pageY},b.core.$outer.addClass("lg-zoom-dragging"),j=h?-Math.abs(k.attr("data-y"))+(d.y-c.y):-Math.abs(k.attr("data-y")),i=g?-Math.abs(k.attr("data-x"))+(d.x-c.x):-Math.abs(k.attr("data-x")),b.core.s.useLeftForZoom?k.css({left:i+"px",top:j+"px"}):k.css("transform","translate3d("+i+"px, "+j+"px, 0)")}}),a(window).on("mouseup.lg.zoom",function(a){e&&(e=!1,b.core.$outer.removeClass("lg-zoom-dragging"),!f||c.x===d.x&&c.y===d.y||(d={x:a.pageX,y:a.pageY},b.touchendZoom(c,d,g,h)),f=!1),b.core.$outer.removeClass("lg-grabbing").addClass("lg-grab")})},d.prototype.touchendZoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-Math.abs(f.attr("data-x"))+(b.x-a.x),i=-Math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.prop("offsetHeight"))/2,k=Math.abs(g.prop("offsetHeight")*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.prop("offsetWidth"))/2,m=Math.abs(g.prop("offsetWidth")*Math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(Math.abs(b.x-a.x)>15||Math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",Math.abs(i)):i=-Math.abs(f.attr("data-y")),c?f.attr("data-x",Math.abs(h)):h=-Math.abs(f.attr("data-x")),e.core.s.useLeftForZoom?f.css({left:h+"px",top:i+"px"}):f.css("transform","translate3d("+h+"px, "+i+"px, 0)"))},d.prototype.destroy=function(){var b=this;b.core.$el.off(".lg.zoom"),a(window).off(".lg.zoom"),b.core.$slide.off(".lg.zoom"),b.core.$el.off(".lg.tm.zoom"),b.resetZoom(),clearTimeout(b.zoomabletimeout),b.zoomabletimeout=!1},a.fn.lightGallery.modules.zoom=d}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(0,function(a){!function(){"use strict";var b={hash:!0},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.hash&&(this.oldHash=window.location.hash,this.init()),this};c.prototype.init=function(){var b,c=this;c.core.$el.on("onAfterSlide.lg.tm",function(a,b,d){history.replaceState?history.replaceState(null,null,window.location.pathname+window.location.search+"#lg="+c.core.s.galleryId+"&slide="+d):window.location.hash="lg="+c.core.s.galleryId+"&slide="+d}),a(window).on("hashchange.lg.hash",function(){b=window.location.hash;var a=parseInt(b.split("&slide=")[1],10);b.indexOf("lg="+c.core.s.galleryId)>-1?c.core.slide(a,!1,!1):c.core.lGalleryOn&&c.core.destroy()})},c.prototype.destroy=function(){this.core.s.hash&&(this.oldHash&&this.oldHash.indexOf("lg="+this.core.s.galleryId)<0?history.replaceState?history.replaceState(null,null,this.oldHash):window.location.hash=this.oldHash:history.replaceState?history.replaceState(null,document.title,window.location.pathname+window.location.search):window.location.hash="",this.core.$el.off(".lg.hash"))},a.fn.lightGallery.modules.hash=c}()}),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jQuery)}(0,function(a){!function(){"use strict";var b={share:!0,facebook:!0,facebookDropdownText:"Facebook",twitter:!0,twitterDropdownText:"Twitter",googlePlus:!0,googlePlusDropdownText:"GooglePlus",pinterest:!0,pinterestDropdownText:"Pinterest"},c=function(c){return this.core=a(c).data("lightGallery"),this.core.s=a.extend({},b,this.core.s),this.core.s.share&&this.init(),this};c.prototype.init=function(){var b=this,c='",this.core.$outer.find(".lg-toolbar").append(c),this.core.$outer.find(".lg").append('
        '),a("#lg-share").on("click.lg",function(){b.core.$outer.toggleClass("lg-dropdown-active")}),a("#lg-dropdown-overlay").on("click.lg",function(){b.core.$outer.removeClass("lg-dropdown-active")}),b.core.$el.on("onAfterSlide.lg.tm",function(c,d,e){setTimeout(function(){a("#lg-share-facebook").attr("href","https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(b.getSahreProps(e,"facebookShareUrl")||window.location.href)),a("#lg-share-twitter").attr("href","https://twitter.com/intent/tweet?text="+b.getSahreProps(e,"tweetText")+"&url="+encodeURIComponent(b.getSahreProps(e,"twitterShareUrl")||window.location.href)),a("#lg-share-googleplus").attr("href","https://plus.google.com/share?url="+encodeURIComponent(b.getSahreProps(e,"googleplusShareUrl")||window.location.href)),a("#lg-share-pinterest").attr("href","http://www.pinterest.com/pin/create/button/?url="+encodeURIComponent(b.getSahreProps(e,"pinterestShareUrl")||window.location.href)+"&media="+encodeURIComponent(b.getSahreProps(e,"src"))+"&description="+b.getSahreProps(e,"pinterestText"))},100)})},c.prototype.getSahreProps=function(a,b){var c="";if(this.core.s.dynamic)c=this.core.s.dynamicEl[a][b];else{var d=this.core.$items.eq(a).attr("href"),e=this.core.$items.eq(a).data(b);c="src"===b?d||e:e}return c},c.prototype.destroy=function(){},a.fn.lightGallery.modules.share=c}()}); \ No newline at end of file diff --git a/Resources/public/js/vendor/lightGallery/js/lightgallery.js b/Resources/public/js/vendor/lightGallery/js/lightgallery.js index 95538404..443d5274 100644 --- a/Resources/public/js/vendor/lightGallery/js/lightgallery.js +++ b/Resources/public/js/vendor/lightGallery/js/lightgallery.js @@ -1,8 +1,23 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -(function($, window, document, undefined) { - +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module unless amdModuleId is set + define(['jquery'], function (a0) { + return (factory(a0)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(require('jquery')); + } else { + factory(root["jQuery"]); + } +}(this, function ($) { + +(function() { 'use strict'; var defaults = { @@ -157,6 +172,7 @@ setTimeout(function() { _this.build(_this.index); }); + $('body').addClass('lg-on'); } } @@ -213,7 +229,7 @@ }); // initiate slide function - _this.slide(index, false, false); + _this.slide(index, false, false, false); if (_this.s.keyPress) { _this.keyPress(); @@ -231,6 +247,10 @@ if (_this.s.mousewheel) { _this.mousewheel(); } + } else { + _this.$slide.on('click.lg', function() { + _this.$el.trigger('onSlideClick.lg'); + }); } _this.counter(); @@ -253,6 +273,8 @@ }); + _this.$outer.trigger('mousemove.lg'); + }; Plugin.prototype.structure = function() { @@ -274,8 +296,8 @@ // Create controlls if (this.s.controls && this.$items.length > 1) { controls = '
        ' + - '
        ' + this.s.prevHtml + '
        ' + - '
        ' + this.s.nextHtml + '
        ' + + '' + + '' + '
        '; } @@ -286,7 +308,7 @@ template = '
        ' + '
        ' + '
        ' + list + '
        ' + - '
        ' + + '
        ' + '' + '
        ' + controls + @@ -344,7 +366,9 @@ $inner.css('transition-duration', this.s.speed + 'ms'); } - $('.lg-backdrop').addClass('in'); + setTimeout(function() { + $('.lg-backdrop').addClass('in'); + }); setTimeout(function() { _this.$outer.addClass('lg-visible'); @@ -409,13 +433,18 @@ html = this.$items.eq(index).attr('data-html'); } - if (!src && html) { - return { - html5: true - }; + if (!src) { + if(html) { + return { + html5: true + }; + } else { + console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html'); + return false; + } } - var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); + var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com|be-nocookie\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); @@ -640,7 +669,7 @@ var _isVideo = _this.isVideo(_src, index); if (!_this.$slide.eq(index).hasClass('lg-loaded')) { if (iframe) { - _this.$slide.eq(index).prepend('
        '); + _this.$slide.eq(index).prepend('
        '); } else if (_hasPoster) { var videoClass = ''; if (_isVideo && _isVideo.youtube) { @@ -674,7 +703,7 @@ elements: [_$img[0]] }); } catch (e) { - console.error('Make sure you have included Picturefill version 2'); + console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.'); } } @@ -740,8 +769,9 @@ * @param {Number} index - index of the slide * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag * @param {Boolean} fromThumb - true if slide function called via thumbnail click + * @param {String} direction - Direction of the slide(next/prev) */ - Plugin.prototype.slide = function(index, fromTouch, fromThumb) { + Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) { var _prevIndex = this.$outer.find('.lg-current').index(); var _this = this; @@ -754,8 +784,6 @@ var _length = this.$slide.length; var _time = _this.lGalleryOn ? this.s.speed : 0; - var _next = false; - var _prev = false; if (!_this.lgBusy) { @@ -793,6 +821,14 @@ this.arrowDisable(index); + if (!direction) { + if (index < _prevIndex) { + direction = 'prev'; + } else if (index > _prevIndex) { + direction = 'next'; + } + } + if (!fromTouch) { // remove all transitions @@ -800,26 +836,12 @@ this.$slide.removeClass('lg-prev-slide lg-next-slide'); - if (index < _prevIndex) { - _prev = true; - if ((index === 0) && (_prevIndex === _length - 1) && !fromThumb) { - _prev = false; - _next = true; - } - } else if (index > _prevIndex) { - _next = true; - if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) { - _prev = true; - _next = false; - } - } - - if (_prev) { + if (direction === 'prev') { //prevslide this.$slide.eq(index).addClass('lg-prev-slide'); this.$slide.eq(_prevIndex).addClass('lg-next-slide'); - } else if (_next) { + } else { // next slide this.$slide.eq(index).addClass('lg-next-slide'); @@ -838,24 +860,36 @@ }, 50); } else { - var touchPrev = index - 1; - var touchNext = index + 1; - - if ((index === 0) && (_prevIndex === _length - 1)) { + this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); + var touchPrev; + var touchNext; + if (_length > 2) { + touchPrev = index - 1; + touchNext = index + 1; + + if ((index === 0) && (_prevIndex === _length - 1)) { + + // next slide + touchNext = 0; + touchPrev = _length - 1; + } else if ((index === _length - 1) && (_prevIndex === 0)) { + + // prev slide + touchNext = 0; + touchPrev = _length - 1; + } - // next slide - touchNext = 0; - touchPrev = _length - 1; - } else if ((index === _length - 1) && (_prevIndex === 0)) { + } else { + touchPrev = 0; + touchNext = 1; + } - // prev slide - touchNext = 0; - touchPrev = _length - 1; + if (direction === 'prev') { + _this.$slide.eq(touchNext).addClass('lg-next-slide'); + } else { + _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); } - this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); - _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); - _this.$slide.eq(touchNext).addClass('lg-next-slide'); _this.$slide.eq(index).addClass('lg-current'); } @@ -883,6 +917,7 @@ } } + _this.index = index; }; @@ -892,17 +927,22 @@ */ Plugin.prototype.goToNextSlide = function(fromTouch) { var _this = this; + var _loop = _this.s.loop; + if (fromTouch && _this.$slide.length < 3) { + _loop = false; + } + if (!_this.lgBusy) { if ((_this.index + 1) < _this.$slide.length) { _this.index++; _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); + _this.slide(_this.index, fromTouch, false, 'next'); } else { - if (_this.s.loop) { + if (_loop) { _this.index = 0; _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { + _this.slide(_this.index, fromTouch, false, 'next'); + } else if (_this.s.slideEndAnimatoin && !fromTouch) { _this.$outer.addClass('lg-right-end'); setTimeout(function() { _this.$outer.removeClass('lg-right-end'); @@ -918,17 +958,22 @@ */ Plugin.prototype.goToPrevSlide = function(fromTouch) { var _this = this; + var _loop = _this.s.loop; + if (fromTouch && _this.$slide.length < 3) { + _loop = false; + } + if (!_this.lgBusy) { if (_this.index > 0) { _this.index--; _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); + _this.slide(_this.index, fromTouch, false, 'prev'); } else { - if (_this.s.loop) { + if (_loop) { _this.index = _this.$items.length - 1; _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); - _this.slide(_this.index, fromTouch, false); - } else if (_this.s.slideEndAnimatoin) { + _this.slide(_this.index, fromTouch, false, 'prev'); + } else if (_this.s.slideEndAnimatoin && !fromTouch) { _this.$outer.addClass('lg-left-end'); setTimeout(function() { _this.$outer.removeClass('lg-left-end'); @@ -1066,7 +1111,7 @@ var endCoords = 0; var isMoved = false; - if (_this.s.enableSwipe && _this.isTouch && _this.doCss()) { + if (_this.s.enableSwipe && _this.doCss()) { _this.$slide.on('touchstart.lg', function(e) { if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { @@ -1105,30 +1150,23 @@ var endCoords = 0; var isDraging = false; var isMoved = false; - if (_this.s.enableDrag && !_this.isTouch && _this.doCss()) { + if (_this.s.enableDrag && _this.doCss()) { _this.$slide.on('mousedown.lg', function(e) { - // execute only on .lg-object - if (!_this.$outer.hasClass('lg-zoomed')) { - if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { - e.preventDefault(); - - if (!_this.lgBusy) { - _this.manageSwipeClass(); - startCoords = e.pageX; - isDraging = true; - - // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 - _this.$outer.scrollLeft += 1; - _this.$outer.scrollLeft -= 1; + if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy && !$(e.target).text().trim()) { + e.preventDefault(); + _this.manageSwipeClass(); + startCoords = e.pageX; + isDraging = true; - // * + // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 + _this.$outer.scrollLeft += 1; + _this.$outer.scrollLeft -= 1; - _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); + // * - _this.$el.trigger('onDragstart.lg'); - } + _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); - } + _this.$el.trigger('onDragstart.lg'); } }); @@ -1161,23 +1199,22 @@ }; Plugin.prototype.manageSwipeClass = function() { - var touchNext = this.index + 1; - var touchPrev = this.index - 1; - var length = this.$slide.length; - if (this.s.loop) { + var _touchNext = this.index + 1; + var _touchPrev = this.index - 1; + if (this.s.loop && this.$slide.length > 2) { if (this.index === 0) { - touchPrev = length - 1; - } else if (this.index === length - 1) { - touchNext = 0; + _touchPrev = this.$slide.length - 1; + } else if (this.index === this.$slide.length - 1) { + _touchNext = 0; } } this.$slide.removeClass('lg-next-slide lg-prev-slide'); - if (touchPrev > -1) { - this.$slide.eq(touchPrev).addClass('lg-prev-slide'); + if (_touchPrev > -1) { + this.$slide.eq(_touchPrev).addClass('lg-prev-slide'); } - this.$slide.eq(touchNext).addClass('lg-next-slide'); + this.$slide.eq(_touchNext).addClass('lg-next-slide'); }; Plugin.prototype.mousewheel = function() { @@ -1220,6 +1257,10 @@ } }); + + _this.$outer.on('mousemove.lg', function() { + mousedown = false; + }); _this.$outer.on('mouseup.lg', function(e) { @@ -1241,9 +1282,9 @@ if (!d) { _this.$el.trigger('onBeforeClose.lg'); + $(window).scrollTop(_this.prevScrollTop); } - $(window).scrollTop(_this.prevScrollTop); /** * if d is false or undefined destroy will only close the gallery @@ -1314,4 +1355,7 @@ $.fn.lightGallery.modules = {}; -})(jQuery, window, document); +})(); + + +})); diff --git a/Resources/public/js/vendor/lightGallery/js/lightgallery.min.js b/Resources/public/js/vendor/lightGallery/js/lightgallery.min.js index b99f28b5..d158e936 100644 --- a/Resources/public/js/vendor/lightGallery/js/lightgallery.min.js +++ b/Resources/public/js/vendor/lightGallery/js/lightgallery.min.js @@ -1,4 +1,4 @@ -/*! lightgallery - v1.2.22 - 2016-07-20 +/*! lightgallery - v1.6.11 - 2018-05-22 * http://sachinchoolur.github.io/lightGallery/ -* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */ -!function(a,b,c,d){"use strict";function e(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},f,d),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in c.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=a(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var f={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};e.prototype.init=function(){var c=this;c.s.preload>c.$items.length&&(c.s.preload=c.$items.length);var d=b.location.hash;d.indexOf("lg="+this.s.galleryId)>0&&(c.index=parseInt(d.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||(setTimeout(function(){c.build(c.index)}),a("body").addClass("lg-on"))),c.s.dynamic?(c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){c.build(c.index),a("body").addClass("lg-on")})):c.$items.on("click.lgcustom",function(b){try{b.preventDefault(),b.preventDefault()}catch(a){b.returnValue=!1}c.$el.trigger("onBeforeOpen.lg"),c.index=c.s.index||c.$items.index(this),a("body").hasClass("lg-on")||(c.build(c.index),a("body").addClass("lg-on"))})},e.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1&&(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)})},e.prototype.structure=function(){var c,d="",e="",f=0,g="",h=this;for(a("body").append('
        '),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),f=0;f
        ';if(this.s.controls&&this.$items.length>1&&(e='
        '+this.s.prevHtml+'
        '+this.s.nextHtml+"
        "),".lg-sub-html"===this.s.appendSubHtmlTo&&(g='
        '),c='
        '+d+'
        '+e+g+"
        ",a("body").append(c),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),h.setTop(),a(b).on("resize.lg orientationchange.lg",function(){setTimeout(function(){h.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var i=this.$outer.find(".lg-inner");i.css("transition-timing-function",this.s.cssEasing),i.css("transition-duration",this.s.speed+"ms")}a(".lg-backdrop").addClass("in"),setTimeout(function(){h.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevScrollTop=a(b).scrollTop()},e.prototype.setTop=function(){if("100%"!==this.s.height){var c=a(b).height(),d=(c-parseInt(this.s.height,10))/2,e=this.$outer.find(".lg");c>=parseInt(this.s.height,10)?e.css("top",d+"px"):e.css("top","0px")}},e.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=c.documentElement,d=0;for(d=0;d'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"
        ")},e.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if("undefined"!=typeof e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),"undefined"!=typeof e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},e.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},e.prototype.loadContent=function(c,d,e){var f,g,h,i,j,k,l=this,m=!1,n=function(c){for(var d=[],e=[],f=0;fi){g=e[j];break}};if(l.s.dynamic){if(l.s.dynamicEl[c].poster&&(m=!0,h=l.s.dynamicEl[c].poster),k=l.s.dynamicEl[c].html,g=l.s.dynamicEl[c].src,l.s.dynamicEl[c].responsive){var o=l.s.dynamicEl[c].responsive.split(",");n(o)}i=l.s.dynamicEl[c].srcset,j=l.s.dynamicEl[c].sizes}else{if(l.$items.eq(c).attr("data-poster")&&(m=!0,h=l.$items.eq(c).attr("data-poster")),k=l.$items.eq(c).attr("data-html"),g=l.$items.eq(c).attr("href")||l.$items.eq(c).attr("data-src"),l.$items.eq(c).attr("data-responsive")){var p=l.$items.eq(c).attr("data-responsive").split(",");n(p)}i=l.$items.eq(c).attr("data-srcset"),j=l.$items.eq(c).attr("data-sizes")}var q=!1;l.s.dynamic?l.s.dynamicEl[c].iframe&&(q=!0):"true"===l.$items.eq(c).attr("data-iframe")&&(q=!0);var r=l.isVideo(g,c);if(!l.$slide.eq(c).hasClass("lg-loaded")){if(q)l.$slide.eq(c).prepend('
        ');else if(m){var s="";s=r&&r.youtube?"lg-has-youtube":r&&r.vimeo?"lg-has-vimeo":"lg-has-html5",l.$slide.eq(c).prepend('
        ')}else r?(l.$slide.eq(c).prepend('
        '),l.$el.trigger("hasVideo.lg",[c,g,k])):l.$slide.eq(c).prepend('
        ');if(l.$el.trigger("onAferAppendSlide.lg",[c]),f=l.$slide.eq(c).find(".lg-object"),j&&f.attr("sizes",j),i){f.attr("srcset",i);try{picturefill({elements:[f[0]]})}catch(a){console.error("Make sure you have included Picturefill version 2")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&l.addHtml(c),l.$slide.eq(c).addClass("lg-loaded")}l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){var b=0;e&&!a("body").hasClass("lg-from-hash")&&(b=e),setTimeout(function(){l.$slide.eq(c).addClass("lg-complete"),l.$el.trigger("onSlideItemLoad.lg",[c,e||0])},b)}),r&&r.html5&&!m&&l.$slide.eq(c).addClass("lg-complete"),d===!0&&(l.$slide.eq(c).hasClass("lg-complete")?l.preload(c):l.$slide.eq(c).find(".lg-object").on("load.lg error.lg",function(){l.preload(c)}))},e.prototype.slide=function(b,c,d){var e=this.$outer.find(".lg-current").index(),f=this;if(!f.lGalleryOn||e!==b){var g=this.$slide.length,h=f.lGalleryOn?this.s.speed:0,i=!1,j=!1;if(!f.lgBusy){if(this.s.download){var k;k=f.s.dynamic?f.s.dynamicEl[b].downloadUrl!==!1&&(f.s.dynamicEl[b].downloadUrl||f.s.dynamicEl[b].src):"false"!==f.$items.eq(b).attr("data-download-url")&&(f.$items.eq(b).attr("data-download-url")||f.$items.eq(b).attr("href")||f.$items.eq(b).attr("data-src")),k?(a("#lg-download").attr("href",k),f.$outer.removeClass("lg-hide-download")):f.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[e,b,c,d]),f.lgBusy=!0,clearTimeout(f.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){f.addHtml(b)},h),this.arrowDisable(b),c){var l=b-1,m=b+1;0===b&&e===g-1?(m=0,l=g-1):b===g-1&&0===e&&(m=0,l=g-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),f.$slide.eq(l).addClass("lg-prev-slide"),f.$slide.eq(m).addClass("lg-next-slide"),f.$slide.eq(b).addClass("lg-current")}else f.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),be&&(i=!0,b!==g-1||0!==e||d||(j=!0,i=!1)),j?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")):i&&(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(e).addClass("lg-prev-slide")),setTimeout(function(){f.$slide.removeClass("lg-current"),f.$slide.eq(b).addClass("lg-current"),f.$outer.removeClass("lg-no-trans")},50);f.lGalleryOn?(setTimeout(function(){f.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])},this.s.speed)):(f.loadContent(b,!0,f.s.backdropDuration),f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])),f.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}}},e.prototype.goToNextSlide=function(a){var b=this;b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.loop?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},e.prototype.keyPress=function(){var c=this;this.$items.length>1&&a(b).on("keyup.lg",function(a){c.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),c.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),c.goToNextSlide()))}),a(b).on("keydown.lg",function(a){c.s.escKey===!0&&27===a.keyCode&&(a.preventDefault(),c.$outer.hasClass("lg-thumb-open")?c.$outer.removeClass("lg-thumb-open"):c.destroy())})},e.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},e.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},e.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},e.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},e.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},e.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.isTouch&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},e.prototype.enableDrag=function(){var c=this,d=0,e=0,f=!1,g=!1;c.s.enableDrag&&!c.isTouch&&c.doCss()&&(c.$slide.on("mousedown.lg",function(b){c.$outer.hasClass("lg-zoomed")||(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&(b.preventDefault(),c.lgBusy||(c.manageSwipeClass(),d=b.pageX,f=!0,c.$outer.scrollLeft+=1,c.$outer.scrollLeft-=1,c.$outer.removeClass("lg-grab").addClass("lg-grabbing"),c.$el.trigger("onDragstart.lg")))}),a(b).on("mousemove.lg",function(a){f&&(g=!0,e=a.pageX,c.touchMove(d,e),c.$el.trigger("onDragmove.lg"))}),a(b).on("mouseup.lg",function(b){g?(g=!1,c.touchEnd(e-d),c.$el.trigger("onDragend.lg")):(a(b.target).hasClass("lg-object")||a(b.target).hasClass("lg-video-play"))&&c.$el.trigger("onSlideClick.lg"),f&&(f=!1,c.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},e.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1,c=this.$slide.length;this.s.loop&&(0===this.index?b=c-1:this.index===c-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},e.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},e.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},e.prototype.destroy=function(c){var d=this;c||d.$el.trigger("onBeforeClose.lg"),a(b).scrollTop(d.prevScrollTop),c&&(d.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(d.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){d.modules[a]&&d.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(d.hideBartimeout),this.hideBartimeout=!1,a(b).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),d.$outer&&d.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){d.$outer&&d.$outer.remove(),a(".lg-backdrop").remove(),c||d.$el.trigger("onCloseAfter.lg")},d.s.backdropDuration+50)},a.fn.lightGallery=function(b){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new e(this,b))})},a.fn.lightGallery.modules={}}(jQuery,window,document); \ No newline at end of file +* Copyright (c) 2018 Sachin N; Licensed GPLv3 */ +!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},c,d),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=a(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var c={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};b.prototype.init=function(){var b=this;b.s.preload>b.$items.length&&(b.s.preload=b.$items.length);var c=window.location.hash;c.indexOf("lg="+this.s.galleryId)>0&&(b.index=parseInt(c.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||(setTimeout(function(){b.build(b.index)}),a("body").addClass("lg-on"))),b.s.dynamic?(b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){b.build(b.index),a("body").addClass("lg-on")})):b.$items.on("click.lgcustom",function(c){try{c.preventDefault(),c.preventDefault()}catch(a){c.returnValue=!1}b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||b.$items.index(this),a("body").hasClass("lg-on")||(b.build(b.index),a("body").addClass("lg-on"))})},b.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1?(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()):c.$slide.on("click.lg",function(){c.$el.trigger("onSlideClick.lg")}),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)}),c.$outer.trigger("mousemove.lg")},b.prototype.structure=function(){var b,c="",d="",e=0,f="",g=this;for(a("body").append('
        '),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),e=0;e
        ';if(this.s.controls&&this.$items.length>1&&(d='
        "),".lg-sub-html"===this.s.appendSubHtmlTo&&(f='
        '),b='
        '+c+'
        '+d+f+"
        ",a("body").append(b),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),g.setTop(),a(window).on("resize.lg orientationchange.lg",function(){setTimeout(function(){g.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.cssEasing),h.css("transition-duration",this.s.speed+"ms")}setTimeout(function(){a(".lg-backdrop").addClass("in")}),setTimeout(function(){g.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevScrollTop=a(window).scrollTop()},b.prototype.setTop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseInt(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseInt(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.doCss=function(){return!!function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=document.documentElement,c=0;for(c=0;c'+(parseInt(this.index,10)+1)+' / '+this.$items.length+"
        ")},b.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if(void 0!==e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),void 0!==e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},b.prototype.loadContent=function(b,c,d){var e,f,g,h,i,j,k=this,l=!1,m=function(b){for(var c=[],d=[],e=0;eh){f=d[i];break}};if(k.s.dynamic){if(k.s.dynamicEl[b].poster&&(l=!0,g=k.s.dynamicEl[b].poster),j=k.s.dynamicEl[b].html,f=k.s.dynamicEl[b].src,k.s.dynamicEl[b].responsive){m(k.s.dynamicEl[b].responsive.split(","))}h=k.s.dynamicEl[b].srcset,i=k.s.dynamicEl[b].sizes}else{if(k.$items.eq(b).attr("data-poster")&&(l=!0,g=k.$items.eq(b).attr("data-poster")),j=k.$items.eq(b).attr("data-html"),f=k.$items.eq(b).attr("href")||k.$items.eq(b).attr("data-src"),k.$items.eq(b).attr("data-responsive")){m(k.$items.eq(b).attr("data-responsive").split(","))}h=k.$items.eq(b).attr("data-srcset"),i=k.$items.eq(b).attr("data-sizes")}var n=!1;k.s.dynamic?k.s.dynamicEl[b].iframe&&(n=!0):"true"===k.$items.eq(b).attr("data-iframe")&&(n=!0);var o=k.isVideo(f,b);if(!k.$slide.eq(b).hasClass("lg-loaded")){if(n)k.$slide.eq(b).prepend('
        ');else if(l){var p="";p=o&&o.youtube?"lg-has-youtube":o&&o.vimeo?"lg-has-vimeo":"lg-has-html5",k.$slide.eq(b).prepend('
        ')}else o?(k.$slide.eq(b).prepend('
        '),k.$el.trigger("hasVideo.lg",[b,f,j])):k.$slide.eq(b).prepend('
        ');if(k.$el.trigger("onAferAppendSlide.lg",[b]),e=k.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.warn("lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&k.addHtml(b),k.$slide.eq(b).addClass("lg-loaded")}k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasClass("lg-from-hash")&&(c=d),setTimeout(function(){k.$slide.eq(b).addClass("lg-complete"),k.$el.trigger("onSlideItemLoad.lg",[b,d||0])},c)}),o&&o.html5&&!l&&k.$slide.eq(b).addClass("lg-complete"),!0===c&&(k.$slide.eq(b).hasClass("lg-complete")?k.preload(b):k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){k.preload(b)}))},b.prototype.slide=function(b,c,d,e){var f=this.$outer.find(".lg-current").index(),g=this;if(!g.lGalleryOn||f!==b){var h=this.$slide.length,i=g.lGalleryOn?this.s.speed:0;if(!g.lgBusy){if(this.s.download){var j;j=g.s.dynamic?!1!==g.s.dynamicEl[b].downloadUrl&&(g.s.dynamicEl[b].downloadUrl||g.s.dynamicEl[b].src):"false"!==g.$items.eq(b).attr("data-download-url")&&(g.$items.eq(b).attr("data-download-url")||g.$items.eq(b).attr("href")||g.$items.eq(b).attr("data-src")),j?(a("#lg-download").attr("href",j),g.$outer.removeClass("lg-hide-download")):g.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[f,b,c,d]),g.lgBusy=!0,clearTimeout(g.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){g.addHtml(b)},i),this.arrowDisable(b),e||(bf&&(e="next")),c){this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide");var k,l;h>2?(k=b-1,l=b+1,0===b&&f===h-1?(l=0,k=h-1):b===h-1&&0===f&&(l=0,k=h-1)):(k=0,l=1),"prev"===e?g.$slide.eq(l).addClass("lg-next-slide"):g.$slide.eq(k).addClass("lg-prev-slide"),g.$slide.eq(b).addClass("lg-current")}else g.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),"prev"===e?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(f).addClass("lg-next-slide")):(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(f).addClass("lg-prev-slide")),setTimeout(function(){g.$slide.removeClass("lg-current"),g.$slide.eq(b).addClass("lg-current"),g.$outer.removeClass("lg-no-trans")},50);g.lGalleryOn?(setTimeout(function(){g.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])},this.s.speed)):(g.loadContent(b,!0,g.s.backdropDuration),g.lgBusy=!1,g.$el.trigger("onAfterSlide.lg",[f,b,c,d])),g.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}g.index=b}},b.prototype.goToNextSlide=function(a){var b=this,c=b.s.loop;a&&b.$slide.length<3&&(c=!1),b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):c?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):b.s.slideEndAnimatoin&&!a&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},b.prototype.keyPress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),b.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),b.goToNextSlide()))}),a(window).on("keydown.lg",function(a){!0===b.s.escKey&&27===a.keyCode&&(a.preventDefault(),b.$outer.hasClass("lg-thumb-open")?b.$outer.removeClass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},b.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},b.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},b.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},b.prototype.enableDrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enableDrag&&b.doCss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasClass("lg-zoomed")||b.lgBusy||a(d.target).text().trim()||(d.preventDefault(),b.manageSwipeClass(),c=d.pageX,e=!0,b.$outer.scrollLeft+=1,b.$outer.scrollLeft-=1,b.$outer.removeClass("lg-grab").addClass("lg-grabbing"),b.$el.trigger("onDragstart.lg"))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pageX,b.touchMove(c,d),b.$el.trigger("onDragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchEnd(d-c),b.$el.trigger("onDragend.lg")):(a(g.target).hasClass("lg-object")||a(g.target).hasClass("lg-video-play"))&&b.$el.trigger("onSlideClick.lg"),e&&(e=!1,b.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},b.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1;this.s.loop&&this.$slide.length>2&&(0===this.index?b=this.$slide.length-1:this.index===this.$slide.length-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},b.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mousemove.lg",function(){c=!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||(c.$el.trigger("onBeforeClose.lg"),a(window).scrollTop(c.prevScrollTop)),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(c.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(c.hideBartimeout),this.hideBartimeout=!1,a(window).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("onCloseAfter.lg")},c.s.backdropDuration+50)},a.fn.lightGallery=function(c){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new b(this,c))})},a.fn.lightGallery.modules={}}()}); \ No newline at end of file diff --git a/Resources/public/js/vendor/masonry.pkgd.min.js b/Resources/public/js/vendor/masonry.pkgd.min.js index 3410a360..53386ae6 100644 --- a/Resources/public/js/vendor/masonry.pkgd.min.js +++ b/Resources/public/js/vendor/masonry.pkgd.min.js @@ -1,9 +1,9 @@ /*! - * Masonry PACKAGED v4.1.1 + * Masonry PACKAGED v4.2.2 * Cascading grid layout library - * http://masonry.desandro.com + * https://masonry.desandro.com * MIT License * by David DeSandro */ -!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);r.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,E=a.borderTopWidth+a.borderBottomWidth,z=d&&s,b=t(r.width);b!==!1&&(a.width=b+(z?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(z?0:g+E)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+E),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;is?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},i.prototype.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},i.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this._getColGroup(n),r=Math.min.apply(Math,o),s=o.indexOf(r),a={x:this.columnWidth*s,y:r},h=r+t.size.outerHeight,u=this.cols+1-o.length,d=0;u>d;d++)this.colYs[s+d]=h;return a},i.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++){var o=this.colYs.slice(n,n+t);e[n]=Math.max.apply(Math,o)}return e},i.prototype._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},i.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},i.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},i.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}); \ No newline at end of file +!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;oe;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;is?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}); \ No newline at end of file diff --git a/Resources/public/js/vendor/select2.min.js b/Resources/public/js/vendor/select2.min.js index 49a988c7..e5052902 100644 --- a/Resources/public/js/vendor/select2.min.js +++ b/Resources/public/js/vendor/select2.min.js @@ -1,2 +1 @@ -/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){return n.apply(b,v.call(arguments,0).concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
          ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
        • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),this.$results.append(d)},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";{a(h)}this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b){var c=this,d=b.id+"-results";this.$results.attr("id",d),b.on("results:all",function(a){c.clear(),c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("results:append",function(a){c.append(a.data),b.isOpen()&&c.setClasses()}),b.on("query",function(a){c.showLoading(a)}),b.on("select",function(){b.isOpen()&&c.setClasses()}),b.on("unselect",function(){b.isOpen()&&c.setClasses()}),b.on("open",function(){c.$results.attr("aria-expanded","true"),c.$results.attr("aria-hidden","false"),c.setClasses(),c.ensureHighlightVisible()}),b.on("close",function(){c.$results.attr("aria-expanded","false"),c.$results.attr("aria-hidden","true"),c.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=c.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=c.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?c.trigger("close"):c.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a);if(0!==d){var e=d-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top,h=f.offset().top,i=c.$results.scrollTop()+(h-g);0===e?c.$results.scrollTop(0):0>h-g&&c.$results.scrollTop(i)}}),b.on("results:next",function(){var a=c.getHighlightedResults(),b=c.$results.find("[aria-selected]"),d=b.index(a),e=d+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=c.$results.offset().top+c.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=c.$results.scrollTop()+h-g;0===e?c.$results.scrollTop(0):h>g&&c.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){c.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=c.$results.scrollTop(),d=c.$results.get(0).scrollHeight-c.$results.scrollTop()+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&d<=c.$results.height();e?(c.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(c.$results.scrollTop(c.$results.get(0).scrollHeight-c.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var d=a(this),e=d.data("data");return"true"===d.attr("aria-selected")?void(c.options.get("multiple")?c.trigger("unselect",{originalEvent:b,data:e}):c.trigger("close")):void c.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var b=a(this).data("data");c.getHighlightedResults().removeClass("select2-results__option--highlighted"),c.trigger("results:focus",{data:b,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a){var b=this,d=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){b.trigger("focus",a)}),this.$selection.on("blur",function(a){b.trigger("blur",a)}),this.$selection.on("keydown",function(a){b.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){b.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){b.update(a.data)}),a.on("open",function(){b.$selection.attr("aria-expanded","true"),b.$selection.attr("aria-owns",d),b._attachCloseHandler(a)}),a.on("close",function(){b.$selection.attr("aria-expanded","false"),b.$selection.removeAttr("aria-activedescendant"),b.$selection.removeAttr("aria-owns"),b.$selection.focus(),b._detachCloseHandler(a)}),a.on("enable",function(){b.$selection.attr("tabindex",b._tabindex)}),a.on("disable",function(){b.$selection.attr("tabindex","-1")})},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},d.prototype.bind=function(a){var b=this;d.__super__.bind.apply(this,arguments);var c=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",c),this.$selection.attr("aria-labelledby",c),this.$selection.on("mousedown",function(a){1===a.which&&b.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(){}),this.$selection.on("blur",function(){}),a.on("selection:update",function(a){b.update(a.data)})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){return a("")},d.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.display(b),d=this.$selection.find(".select2-selection__rendered");d.empty().append(c),d.prop("title",b.title||b.text)},d}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
            '),a},d.prototype.bind=function(){var b=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){b.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(c){var d=a(this),e=d.parent(),f=e.data("data");b.trigger("unselect",{originalEvent:c,data:f})})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a){var b=this.options.get("templateSelection"),c=this.options.get("escapeMarkup");return c(b(a))},d.prototype.selectionContainer=function(){var b=a('
          • ×
          • ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},a}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('×');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus()}),b.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.focus()}),b.on("enable",function(){e.$search.prop("disabled",!1)}),b.on("disable",function(){e.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e.trigger("blur",a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(){e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(a){e.handleSearch(a)})},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.trigger("open"),this.$search.val(b.text+" ")},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=(c.extend(!0,{},l,j),this.option(l));k.replaceWith(m)}else{var n=this.option(j);if(j.children){var o=this.convertToOptions(j.children);b.appendMany(n,o)}h.push(n)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(b,c){this.ajaxOptions=this._applyDefaults(c.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),a.__super__.constructor.call(this,b,c)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return{q:a.term}},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url(a)),"function"==typeof f.data&&(f.data=f.data(a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");if(void 0!==f&&(this.createTag=f),b.call(this,c,d),a.isArray(e))for(var g=0;g0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.position=function(){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},b.prototype.handleSearch=function(){if(!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},b.prototype.showSearch=function(){return!0},b}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
          • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(a,b,c){this.$dropdownParent=c.get("dropdownParent")||document.body,a.call(this,b,c)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c){var d=this,e="scroll.select2."+c.id,f="resize.select2."+c.id,g="orientationchange.select2."+c.id,h=this.$container.parents().filter(b.hasScroll);h.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),h.on(e,function(){var b=a(this).data("select2-scroll-position");a(this).scrollTop(b.y)}),a(window).on(e+" "+f+" "+g,function(){d._positionDropdown(),d._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c){var d="scroll.select2."+c.id,e="resize.select2."+c.id,f="orientationchange.select2."+c.id,g=this.$container.parents().filter(b.hasScroll);g.off(d),a(window).off(d+" "+e+" "+f)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=(this.$container.position(),this.$container.offset());f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom};c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.selectionAdapter=l.multiple?e:d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(this.options.dir=a.prop("dir")?a.prop("dir"):a.closest("[dir]").prop("dir")?a.closest("[dir]").prop("dir"):"ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("focus",function(){a.$container.addClass("select2-container--focus")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open"),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ENTER?(a.trigger("results:select"),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle"),b.preventDefault()):c===d.UP?(a.trigger("results:previous"),b.preventDefault()):c===d.DOWN?(a.trigger("results:next"),b.preventDefault()):(c===d.ESC||c===d.TAB)&&(a.close(),b.preventDefault()):(c===d.ENTER||c===d.SPACE||(c===d.DOWN||c===d.UP)&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||(this.trigger("query",{}),this.trigger("open"))},e.prototype.close=function(){this.isOpen()&&this.trigger("close")},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(a,b,c,d){if(b("jquery.mousewheel"),null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){{var d=a.extend({},b,!0);new c(a(this),d)}}),this;if("string"==typeof b){var d=this.data("select2");null==d&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var f=Array.prototype.slice.call(arguments,1),g=d[b](f);return a.inArray(b,e)>-1?this:g}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),b.define("jquery.mousewheel",["jquery"],function(a){return a}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); \ No newline at end of file +/*! Select2 4.0.6-rc.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.__cache={};var e=0;return c.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null==b&&(a.id?(b=a.id,a.setAttribute("data-select2-id",b)):(a.setAttribute("data-select2-id",++e),b=e.toString())),b},c.StoreData=function(a,b,d){var e=c.GetUniqueElementId(a);c.__cache[e]||(c.__cache[e]={}),c.__cache[e][b]=d},c.GetData=function(b,d){var e=c.GetUniqueElementId(b);return d?c.__cache[e]&&null!=c.__cache[e][d]?c.__cache[e][d]:a(b).data(d):c.__cache[e]},c.RemoveData=function(a){var b=c.GetUniqueElementId(a);null!=c.__cache[b]&&delete c.__cache[b]},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('
              ');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('
            • '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(d){var e=a.map(d,function(a){return a.id.toString()});c.$results.find(".select2-results__option[aria-selected]").each(function(){var c=a(this),d=b.GetData(this,"data"),f=""+d.id;null!=d.element&&d.element.selected||null==d.element&&a.inArray(f,e)>-1?c.attr("aria-selected","true"):c.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var d=document.createElement("li");d.className="select2-results__option";var e={role:"treeitem","aria-selected":"false"};c.disabled&&(delete e["aria-selected"],e["aria-disabled"]="true"),null==c.id&&delete e["aria-selected"],null!=c._resultId&&(d.id=c._resultId),c.title&&(d.title=c.title),c.children&&(e.role="group",e["aria-label"]=c.text,delete e["aria-selected"]);for(var f in e){var g=e[f];d.setAttribute(f,g)}if(c.children){var h=a(d),i=document.createElement("strong");i.className="select2-results__group";a(i);this.template(c,i);for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested"});n.append(j),h.append(i),h.append(n)}else this.template(c,d);return b.StoreData(d,"data",c),d},c.prototype.bind=function(c,d){var e=this,f=c.id+"-results";this.$results.attr("id",f),c.on("results:all",function(a){e.clear(),e.append(a.data),c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("results:append",function(a){e.append(a.data),c.isOpen()&&e.setClasses()}),c.on("query",function(a){e.hideMessages(),e.showLoading(a)}),c.on("select",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("unselect",function(){c.isOpen()&&(e.setClasses(),e.highlightFirstItem())}),c.on("open",function(){e.$results.attr("aria-expanded","true"),e.$results.attr("aria-hidden","false"),e.setClasses(),e.ensureHighlightVisible()}),c.on("close",function(){e.$results.attr("aria-expanded","false"),e.$results.attr("aria-hidden","true"),e.$results.removeAttr("aria-activedescendant")}),c.on("results:toggle",function(){var a=e.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),c.on("results:select",function(){var a=e.getHighlightedResults();if(0!==a.length){var c=b.GetData(a[0],"data");"true"==a.attr("aria-selected")?e.trigger("close",{}):e.trigger("select",{data:c})}}),c.on("results:previous",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a);if(!(c<=0)){var d=c-1;0===a.length&&(d=0);var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top,h=f.offset().top,i=e.$results.scrollTop()+(h-g);0===d?e.$results.scrollTop(0):h-g<0&&e.$results.scrollTop(i)}}),c.on("results:next",function(){var a=e.getHighlightedResults(),b=e.$results.find("[aria-selected]"),c=b.index(a),d=c+1;if(!(d>=b.length)){var f=b.eq(d);f.trigger("mouseenter");var g=e.$results.offset().top+e.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=e.$results.scrollTop()+h-g;0===d?e.$results.scrollTop(0):h>g&&e.$results.scrollTop(i)}}),c.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),c.on("results:message",function(a){e.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=e.$results.scrollTop(),c=e.$results.get(0).scrollHeight-b+a.deltaY,d=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=e.$results.height();d?(e.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(e.$results.scrollTop(e.$results.get(0).scrollHeight-e.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(c){var d=a(this),f=b.GetData(this,"data");if("true"===d.attr("aria-selected"))return void(e.options.get("multiple")?e.trigger("unselect",{originalEvent:c,data:f}):e.trigger("close",{}));e.trigger("select",{originalEvent:c,data:f})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(c){var d=b.GetData(this,"data");e.getHighlightedResults().removeClass("select2-results__option--highlighted"),e.trigger("results:focus",{data:d,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),this.$selection=c,c},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),window.setTimeout(function(){d.$selection.focus()},0),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var d=a(c.target),e=d.closest(".select2");a(".select2.select2-container--open").each(function(){a(this),this!=e[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(''),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()})},e.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.attr("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('
                '),a},d.prototype.bind=function(b,e){var f=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){f.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!f.options.get("disabled")){var d=a(this),e=d.parent(),g=c.GetData(e[0],"data");f.trigger("unselect",{originalEvent:b,data:g})}})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty(),a.removeAttr("title")},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('
              • ×
              • ')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var d=this.$selection.find(".select2-selection__clear");if(0!==d.length){b.stopPropagation();var e=c.GetData(d[0],"data"),f=this.$element.val();this.$element.val(this.placeholder.id);var g={data:e};if(this.trigger("clear",g),g.prevented)return void this.$element.val(f);for(var h=0;h0||0===d.length)){var e=a('×');c.StoreData(e[0],"data",d),this.$selection.find(".select2-selection__rendered").prepend(e)}},d}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,d,e){var f=this;a.call(this,d,e),d.on("open",function(){f.$search.trigger("focus")}),d.on("close",function(){f.$search.val(""),f.$search.removeAttr("aria-activedescendant"),f.$search.trigger("focus")}),d.on("enable",function(){f.$search.prop("disabled",!1),f._transferTabIndex()}),d.on("disable",function(){f.$search.prop("disabled",!0)}),d.on("focus",function(a){f.$search.trigger("focus")}),d.on("results:focus",function(a){f.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){f.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){f._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),f.trigger("keypress",a),f._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===f.$search.val()){var d=f.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var e=b.GetData(d[0],"data");f.searchRemoveChoice(e),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void f.$selection.off("input.search input.searchcheck");f.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void f.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&f.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;if(this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c){this.$element.find("[data-select2-tag]").length?this.$element.focus():this.$search.focus()}},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],g=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){"status"in d&&(0===d.status||"0"===d.status)||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val(""),e.$search.blur()}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('
              • '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(""),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(c){var d=b.GetData(this,"select2-scroll-position");a(this).scrollTop(d.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(!0,this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),d.GetData(a[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),d.StoreData(a[0],"data",d.GetData(a[0],"select2Tags")),d.StoreData(a[0],"tags",!0)),d.GetData(a[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",d.GetData(a[0],"ajaxUrl")),d.StoreData(a[0],"ajax-Url",d.GetData(a[0],"ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,d.GetData(a[0])):d.GetData(a[0]);var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy(),this.$element=a,this.id=this._generateId(a),d=d||{},this.options=new b(d,a),e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f),a.attr("tabindex","-1");var g=this.options.get("dataAdapter");this.dataAdapter=new g(a,this.options);var h=this.render();this._placeContainer(h);var i=this.options.get("selectionAdapter");this.selection=new i(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,h);var j=this.options.get("dropdownAdapter");this.dropdown=new j(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,h);var k=this.options.get("resultsAdapter");this.results=new k(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){l.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),c.StoreData(a[0],"select2",this),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),c.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(a,b,c,d,e){if(null==a.fn.select2){var f=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,g=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=a[b].apply(a,g)}),a.inArray(b,f)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}); \ No newline at end of file diff --git a/Resources/public/js/vendor/slick/slick-theme.css b/Resources/public/js/vendor/slick/slick-theme.css index a53cd691..1232fcab 100644 --- a/Resources/public/js/vendor/slick/slick-theme.css +++ b/Resources/public/js/vendor/slick/slick-theme.css @@ -29,8 +29,10 @@ width: 20px; height: 20px; - margin-top: -10px; padding: 0; + -webkit-transform: translate(0, -50%); + -ms-transform: translate(0, -50%); + transform: translate(0, -50%); cursor: pointer; @@ -112,7 +114,7 @@ } /* Dots */ -.slick-slider +.slick-dotted.slick-slider { margin-bottom: 30px; } @@ -120,12 +122,13 @@ .slick-dots { position: absolute; - bottom: -45px; + bottom: -25px; display: block; width: 100%; padding: 0; + margin: 0; list-style: none; diff --git a/Resources/public/js/vendor/slick/slick-theme.less b/Resources/public/js/vendor/slick/slick-theme.less new file mode 100644 index 00000000..e06fc183 --- /dev/null +++ b/Resources/public/js/vendor/slick/slick-theme.less @@ -0,0 +1,168 @@ +@charset "UTF-8"; + +// Default Variables + +@slick-font-path: "./fonts/"; +@slick-font-family: "slick"; +@slick-loader-path: "./"; +@slick-arrow-color: white; +@slick-dot-color: black; +@slick-dot-color-active: @slick-dot-color; +@slick-prev-character: "←"; +@slick-next-character: "→"; +@slick-dot-character: "•"; +@slick-dot-size: 6px; +@slick-opacity-default: 0.75; +@slick-opacity-on-hover: 1; +@slick-opacity-not-active: 0.25; + +/* Slider */ +.slick-loading .slick-list{ + background: #fff url('@{slick-loader-path}ajax-loader.gif') center center no-repeat; +} + +/* Arrows */ +.slick-prev, +.slick-next { + position: absolute; + display: block; + height: 20px; + width: 20px; + line-height: 0px; + font-size: 0px; + cursor: pointer; + background: transparent; + color: transparent; + top: 50%; + -webkit-transform: translate(0, -50%); + -ms-transform: translate(0, -50%); + transform: translate(0, -50%); + padding: 0; + border: none; + outline: none; + &:hover, &:focus { + outline: none; + background: transparent; + color: transparent; + &:before { + opacity: @slick-opacity-on-hover; + } + } + &.slick-disabled:before { + opacity: @slick-opacity-not-active; + } +} + +.slick-prev:before, .slick-next:before { + font-family: @slick-font-family; + font-size: 20px; + line-height: 1; + color: @slick-arrow-color; + opacity: @slick-opacity-default; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + & when ( @slick-font-family = 'slick' ) { + /* Icons */ + @font-face { + font-family: 'slick'; + font-weight: normal; + font-style: normal; + src: url('@{slick-font-path}slick.eot'); + src: url('@{slick-font-path}slick.eot?#iefix') format('embedded-opentype'), url('@{slick-font-path}slick.woff') format('woff'), url('@{slick-font-path}slick.ttf') format('truetype'), url('@{slick-font-path}slick.svg#slick') format('svg'); + } + } +} + +.slick-prev { + left: -25px; + [dir="rtl"] & { + left: auto; + right: -25px; + } + &:before { + content: @slick-prev-character; + [dir="rtl"] & { + content: @slick-next-character; + } + } +} + +.slick-next { + right: -25px; + [dir="rtl"] & { + left: -25px; + right: auto; + } + &:before { + content: @slick-next-character; + [dir="rtl"] & { + content: @slick-prev-character; + } + } +} + +/* Dots */ + +.slick-dotted .slick-slider { + margin-bottom: 30px; +} + +.slick-dots { + position: absolute; + bottom: -25px; + list-style: none; + display: block; + text-align: center; + padding: 0; + margin: 0; + width: 100%; + li { + position: relative; + display: inline-block; + height: 20px; + width: 20px; + margin: 0 5px; + padding: 0; + cursor: pointer; + button { + border: 0; + background: transparent; + display: block; + height: 20px; + width: 20px; + outline: none; + line-height: 0px; + font-size: 0px; + color: transparent; + padding: 5px; + cursor: pointer; + &:hover, &:focus { + outline: none; + &:before { + opacity: @slick-opacity-on-hover; + } + } + &:before { + position: absolute; + top: 0; + left: 0; + content: @slick-dot-character; + width: 20px; + height: 20px; + font-family: @slick-font-family; + font-size: @slick-dot-size; + line-height: 20px; + text-align: center; + color: @slick-dot-color; + opacity: @slick-opacity-not-active; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + } + &.slick-active button:before { + color: @slick-dot-color-active; + opacity: @slick-opacity-default; + } + } +} diff --git a/Resources/public/js/vendor/slick/slick-theme.scss b/Resources/public/js/vendor/slick/slick-theme.scss index e00802b3..7fe63e10 100644 --- a/Resources/public/js/vendor/slick/slick-theme.scss +++ b/Resources/public/js/vendor/slick/slick-theme.scss @@ -2,15 +2,20 @@ // Default Variables +// Slick icon entity codes outputs the following +// "\2190" outputs ascii character "←" +// "\2192" outputs ascii character "→" +// "\2022" outputs ascii character "•" + $slick-font-path: "./fonts/" !default; $slick-font-family: "slick" !default; $slick-loader-path: "./" !default; $slick-arrow-color: white !default; $slick-dot-color: black !default; $slick-dot-color-active: $slick-dot-color !default; -$slick-prev-character: "←" !default; -$slick-next-character: "→" !default; -$slick-dot-character: "•" !default; +$slick-prev-character: "\2190" !default; +$slick-next-character: "\2192" !default; +$slick-dot-character: "\2022" !default; $slick-dot-size: 6px !default; $slick-opacity-default: 0.75 !default; $slick-opacity-on-hover: 1 !default; @@ -67,7 +72,9 @@ $slick-opacity-not-active: 0.25 !default; background: transparent; color: transparent; top: 50%; - margin-top: -10px; + -webkit-transform: translate(0, -50%); + -ms-transform: translate(0, -50%); + transform: translate(0, -50%); padding: 0; border: none; outline: none; @@ -82,16 +89,15 @@ $slick-opacity-not-active: 0.25 !default; &.slick-disabled:before { opacity: $slick-opacity-not-active; } -} - -.slick-prev:before, .slick-next:before { - font-family: $slick-font-family; - font-size: 20px; - line-height: 1; - color: $slick-arrow-color; - opacity: $slick-opacity-default; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + &:before { + font-family: $slick-font-family; + font-size: 20px; + line-height: 1; + color: $slick-arrow-color; + opacity: $slick-opacity-default; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } } .slick-prev { @@ -124,17 +130,18 @@ $slick-opacity-not-active: 0.25 !default; /* Dots */ -.slick-slider { +.slick-dotted.slick-slider { margin-bottom: 30px; } .slick-dots { position: absolute; - bottom: -45px; + bottom: -25px; list-style: none; display: block; text-align: center; padding: 0; + margin: 0; width: 100%; li { position: relative; @@ -184,4 +191,4 @@ $slick-opacity-not-active: 0.25 !default; opacity: $slick-opacity-default; } } -} \ No newline at end of file +} diff --git a/Resources/public/js/vendor/slick/slick.css b/Resources/public/js/vendor/slick/slick.css index e7f56074..57477e84 100644 --- a/Resources/public/js/vendor/slick/slick.css +++ b/Resources/public/js/vendor/slick/slick.css @@ -4,9 +4,7 @@ position: relative; display: block; - - -moz-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; -webkit-user-select: none; -moz-user-select: none; @@ -57,6 +55,8 @@ left: 0; display: block; + margin-left: auto; + margin-right: auto; } .slick-track:before, .slick-track:after @@ -116,4 +116,4 @@ } .slick-arrow.slick-hidden { display: none; -} \ No newline at end of file +} diff --git a/Resources/public/js/vendor/slick/slick.js b/Resources/public/js/vendor/slick/slick.js index bb79b57b..6a2a0995 100644 --- a/Resources/public/js/vendor/slick/slick.js +++ b/Resources/public/js/vendor/slick/slick.js @@ -6,7 +6,7 @@ |___/_|_|\___|_|\_(_)/ |___/ |__/ - Version: 1.5.7 + Version: 1.8.0 Author: Ken Wheeler Website: http://kenwheeler.github.io Docs: http://kenwheeler.github.io/slick @@ -15,7 +15,7 @@ */ /* global window, document, define, jQuery, setInterval, clearInterval */ -(function(factory) { +;(function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['jquery'], factory); @@ -44,15 +44,15 @@ appendDots: $(element), arrows: true, asNavFor: null, - prevArrow: '', - nextArrow: '', + prevArrow: '', + nextArrow: '', autoplay: false, autoplaySpeed: 3000, centerMode: false, centerPadding: '50px', cssEase: 'ease', customPaging: function(slider, i) { - return ''; + return $('',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(a,b){return'"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},e.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},a.extend(e,e.initials),e.activeBreakpoint=null,e.animType=null,e.animProp=null,e.breakpoints=[],e.breakpointSettings=[],e.cssTransitions=!1,e.hidden="hidden",e.paused=!1,e.positionProp=null,e.respondTo=null,e.rowCount=1,e.shouldClick=!0,e.$slider=a(c),e.$slidesCache=null,e.transformType=null,e.transitionType=null,e.visibilityChange="visibilitychange",e.windowWidth=0,e.windowTimer=null,f=a(c).data("slick")||{},e.options=a.extend({},e.defaults,f,d),e.currentSlide=e.options.initialSlide,e.originalSettings=e.options,"undefined"!=typeof document.mozHidden?(e.hidden="mozHidden",e.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e.autoPlay=a.proxy(e.autoPlay,e),e.autoPlayClear=a.proxy(e.autoPlayClear,e),e.changeSlide=a.proxy(e.changeSlide,e),e.clickHandler=a.proxy(e.clickHandler,e),e.selectHandler=a.proxy(e.selectHandler,e),e.setPosition=a.proxy(e.setPosition,e),e.swipeHandler=a.proxy(e.swipeHandler,e),e.dragHandler=a.proxy(e.dragHandler,e),e.keyHandler=a.proxy(e.keyHandler,e),e.autoPlayIterator=a.proxy(e.autoPlayIterator,e),e.instanceUid=b++,e.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,e.registerBreakpoints(),e.init(!0),e.checkResponsive(!0)}var b=0;return c}(),b.prototype.addSlide=b.prototype.slickAdd=function(b,c,d){var e=this;if("boolean"==typeof c)d=c,c=null;else if(0>c||c>=e.slideCount)return!1;e.unload(),"number"==typeof c?0===c&&0===e.$slides.length?a(b).appendTo(e.$slideTrack):d?a(b).insertBefore(e.$slides.eq(c)):a(b).insertAfter(e.$slides.eq(c)):d===!0?a(b).prependTo(e.$slideTrack):a(b).appendTo(e.$slideTrack),e.$slides=e.$slideTrack.children(this.options.slide),e.$slideTrack.children(this.options.slide).detach(),e.$slideTrack.append(e.$slides),e.$slides.each(function(b,c){a(c).attr("data-slick-index",b)}),e.$slidesCache=e.$slides,e.reinit()},b.prototype.animateHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.animate({height:b},a.options.speed)}},b.prototype.animateSlide=function(b,c){var d={},e=this;e.animateHeight(),e.options.rtl===!0&&e.options.vertical===!1&&(b=-b),e.transformsEnabled===!1?e.options.vertical===!1?e.$slideTrack.animate({left:b},e.options.speed,e.options.easing,c):e.$slideTrack.animate({top:b},e.options.speed,e.options.easing,c):e.cssTransitions===!1?(e.options.rtl===!0&&(e.currentLeft=-e.currentLeft),a({animStart:e.currentLeft}).animate({animStart:b},{duration:e.options.speed,easing:e.options.easing,step:function(a){a=Math.ceil(a),e.options.vertical===!1?(d[e.animType]="translate("+a+"px, 0px)",e.$slideTrack.css(d)):(d[e.animType]="translate(0px,"+a+"px)",e.$slideTrack.css(d))},complete:function(){c&&c.call()}})):(e.applyTransition(),b=Math.ceil(b),d[e.animType]=e.options.vertical===!1?"translate3d("+b+"px, 0px, 0px)":"translate3d(0px,"+b+"px, 0px)",e.$slideTrack.css(d),c&&setTimeout(function(){e.disableTransition(),c.call()},e.options.speed))},b.prototype.asNavFor=function(b){var c=this,d=c.options.asNavFor;d&&null!==d&&(d=a(d).not(c.$slider)),null!==d&&"object"==typeof d&&d.each(function(){var c=a(this).slick("getSlick");c.unslicked||c.slideHandler(b,!0)})},b.prototype.applyTransition=function(a){var b=this,c={};c[b.transitionType]=b.options.fade===!1?b.transformType+" "+b.options.speed+"ms "+b.options.cssEase:"opacity "+b.options.speed+"ms "+b.options.cssEase,b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.autoPlay=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer),a.slideCount>a.options.slidesToShow&&a.paused!==!0&&(a.autoPlayTimer=setInterval(a.autoPlayIterator,a.options.autoplaySpeed))},b.prototype.autoPlayClear=function(){var a=this;a.autoPlayTimer&&clearInterval(a.autoPlayTimer)},b.prototype.autoPlayIterator=function(){var a=this;a.options.infinite===!1?1===a.direction?(a.currentSlide+1===a.slideCount-1&&(a.direction=0),a.slideHandler(a.currentSlide+a.options.slidesToScroll)):(0===a.currentSlide-1&&(a.direction=1),a.slideHandler(a.currentSlide-a.options.slidesToScroll)):a.slideHandler(a.currentSlide+a.options.slidesToScroll)},b.prototype.buildArrows=function(){var b=this;b.options.arrows===!0&&(b.$prevArrow=a(b.options.prevArrow).addClass("slick-arrow"),b.$nextArrow=a(b.options.nextArrow).addClass("slick-arrow"),b.slideCount>b.options.slidesToShow?(b.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.prependTo(b.options.appendArrows),b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.appendTo(b.options.appendArrows),b.options.infinite!==!0&&b.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):b.$prevArrow.add(b.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},b.prototype.buildDots=function(){var c,d,b=this;if(b.options.dots===!0&&b.slideCount>b.options.slidesToShow){for(d='
                  ',c=0;c<=b.getDotCount();c+=1)d+="
                • "+b.options.customPaging.call(this,b,c)+"
                • ";d+="
                ",b.$dots=a(d).appendTo(b.options.appendDots),b.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}},b.prototype.buildOut=function(){var b=this;b.$slides=b.$slider.children(b.options.slide+":not(.slick-cloned)").addClass("slick-slide"),b.slideCount=b.$slides.length,b.$slides.each(function(b,c){a(c).attr("data-slick-index",b).data("originalStyling",a(c).attr("style")||"")}),b.$slidesCache=b.$slides,b.$slider.addClass("slick-slider"),b.$slideTrack=0===b.slideCount?a('
                ').appendTo(b.$slider):b.$slides.wrapAll('
                ').parent(),b.$list=b.$slideTrack.wrap('
                ').parent(),b.$slideTrack.css("opacity",0),(b.options.centerMode===!0||b.options.swipeToSlide===!0)&&(b.options.slidesToScroll=1),a("img[data-lazy]",b.$slider).not("[src]").addClass("slick-loading"),b.setupInfinite(),b.buildArrows(),b.buildDots(),b.updateDots(),b.setSlideClasses("number"==typeof b.currentSlide?b.currentSlide:0),b.options.draggable===!0&&b.$list.addClass("draggable")},b.prototype.buildRows=function(){var b,c,d,e,f,g,h,a=this;if(e=document.createDocumentFragment(),g=a.$slider.children(),a.options.rows>1){for(h=a.options.slidesPerRow*a.options.rows,f=Math.ceil(g.length/h),b=0;f>b;b++){var i=document.createElement("div");for(c=0;cd.breakpoints[e]&&(f=d.breakpoints[e]));null!==f?null!==d.activeBreakpoint?(f!==d.activeBreakpoint||c)&&(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):(d.activeBreakpoint=f,"unslick"===d.breakpointSettings[f]?d.unslick(f):(d.options=a.extend({},d.originalSettings,d.breakpointSettings[f]),b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b)),h=f):null!==d.activeBreakpoint&&(d.activeBreakpoint=null,d.options=d.originalSettings,b===!0&&(d.currentSlide=d.options.initialSlide),d.refresh(b),h=f),b||h===!1||d.$slider.trigger("breakpoint",[d,h])}},b.prototype.changeSlide=function(b,c){var f,g,h,d=this,e=a(b.target);switch(e.is("a")&&b.preventDefault(),e.is("li")||(e=e.closest("li")),h=0!==d.slideCount%d.options.slidesToScroll,f=h?0:(d.slideCount-d.currentSlide)%d.options.slidesToScroll,b.data.message){case"previous":g=0===f?d.options.slidesToScroll:d.options.slidesToShow-f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide-g,!1,c);break;case"next":g=0===f?d.options.slidesToScroll:f,d.slideCount>d.options.slidesToShow&&d.slideHandler(d.currentSlide+g,!1,c);break;case"index":var i=0===b.data.index?0:b.data.index||e.index()*d.options.slidesToScroll;d.slideHandler(d.checkNavigable(i),!1,c),e.children().trigger("focus");break;default:return}},b.prototype.checkNavigable=function(a){var c,d,b=this;if(c=b.getNavigableIndexes(),d=0,a>c[c.length-1])a=c[c.length-1];else for(var e in c){if(ab.options.slidesToShow&&(b.$prevArrow&&b.$prevArrow.off("click.slick",b.changeSlide),b.$nextArrow&&b.$nextArrow.off("click.slick",b.changeSlide)),b.$list.off("touchstart.slick mousedown.slick",b.swipeHandler),b.$list.off("touchmove.slick mousemove.slick",b.swipeHandler),b.$list.off("touchend.slick mouseup.slick",b.swipeHandler),b.$list.off("touchcancel.slick mouseleave.slick",b.swipeHandler),b.$list.off("click.slick",b.clickHandler),a(document).off(b.visibilityChange,b.visibility),b.$list.off("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.off("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.off("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().off("click.slick",b.selectHandler),a(window).off("orientationchange.slick.slick-"+b.instanceUid,b.orientationChange),a(window).off("resize.slick.slick-"+b.instanceUid,b.resize),a("[draggable!=true]",b.$slideTrack).off("dragstart",b.preventDefault),a(window).off("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).off("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.cleanUpRows=function(){var b,a=this;a.options.rows>1&&(b=a.$slides.children().children(),b.removeAttr("style"),a.$slider.html(b))},b.prototype.clickHandler=function(a){var b=this;b.shouldClick===!1&&(a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault())},b.prototype.destroy=function(b){var c=this;c.autoPlayClear(),c.touchObject={},c.cleanUpEvents(),a(".slick-cloned",c.$slider).detach(),c.$dots&&c.$dots.remove(),c.options.arrows===!0&&(c.$prevArrow&&c.$prevArrow.length&&(c.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.prevArrow)&&c.$prevArrow.remove()),c.$nextArrow&&c.$nextArrow.length&&(c.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),c.htmlExpr.test(c.options.nextArrow)&&c.$nextArrow.remove())),c.$slides&&(c.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){a(this).attr("style",a(this).data("originalStyling"))}),c.$slideTrack.children(this.options.slide).detach(),c.$slideTrack.detach(),c.$list.detach(),c.$slider.append(c.$slides)),c.cleanUpRows(),c.$slider.removeClass("slick-slider"),c.$slider.removeClass("slick-initialized"),c.unslicked=!0,b||c.$slider.trigger("destroy",[c])},b.prototype.disableTransition=function(a){var b=this,c={};c[b.transitionType]="",b.options.fade===!1?b.$slideTrack.css(c):b.$slides.eq(a).css(c)},b.prototype.fadeSlide=function(a,b){var c=this;c.cssTransitions===!1?(c.$slides.eq(a).css({zIndex:c.options.zIndex}),c.$slides.eq(a).animate({opacity:1},c.options.speed,c.options.easing,b)):(c.applyTransition(a),c.$slides.eq(a).css({opacity:1,zIndex:c.options.zIndex}),b&&setTimeout(function(){c.disableTransition(a),b.call()},c.options.speed))},b.prototype.fadeSlideOut=function(a){var b=this;b.cssTransitions===!1?b.$slides.eq(a).animate({opacity:0,zIndex:b.options.zIndex-2},b.options.speed,b.options.easing):(b.applyTransition(a),b.$slides.eq(a).css({opacity:0,zIndex:b.options.zIndex-2}))},b.prototype.filterSlides=b.prototype.slickFilter=function(a){var b=this;null!==a&&(b.unload(),b.$slideTrack.children(this.options.slide).detach(),b.$slidesCache.filter(a).appendTo(b.$slideTrack),b.reinit())},b.prototype.getCurrent=b.prototype.slickCurrentSlide=function(){var a=this;return a.currentSlide},b.prototype.getDotCount=function(){var a=this,b=0,c=0,d=0;if(a.options.infinite===!0)for(;bb.options.slidesToShow&&(b.slideOffset=-1*b.slideWidth*b.options.slidesToShow,e=-1*d*b.options.slidesToShow),0!==b.slideCount%b.options.slidesToScroll&&a+b.options.slidesToScroll>b.slideCount&&b.slideCount>b.options.slidesToShow&&(a>b.slideCount?(b.slideOffset=-1*(b.options.slidesToShow-(a-b.slideCount))*b.slideWidth,e=-1*(b.options.slidesToShow-(a-b.slideCount))*d):(b.slideOffset=-1*b.slideCount%b.options.slidesToScroll*b.slideWidth,e=-1*b.slideCount%b.options.slidesToScroll*d))):a+b.options.slidesToShow>b.slideCount&&(b.slideOffset=(a+b.options.slidesToShow-b.slideCount)*b.slideWidth,e=(a+b.options.slidesToShow-b.slideCount)*d),b.slideCount<=b.options.slidesToShow&&(b.slideOffset=0,e=0),b.options.centerMode===!0&&b.options.infinite===!0?b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)-b.slideWidth:b.options.centerMode===!0&&(b.slideOffset=0,b.slideOffset+=b.slideWidth*Math.floor(b.options.slidesToShow/2)),c=b.options.vertical===!1?-1*a*b.slideWidth+b.slideOffset:-1*a*d+e,b.options.variableWidth===!0&&(f=b.slideCount<=b.options.slidesToShow||b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow),c=f[0]?-1*f[0].offsetLeft:0,b.options.centerMode===!0&&(f=b.options.infinite===!1?b.$slideTrack.children(".slick-slide").eq(a):b.$slideTrack.children(".slick-slide").eq(a+b.options.slidesToShow+1),c=f[0]?-1*f[0].offsetLeft:0,c+=(b.$list.width()-f.outerWidth())/2)),c},b.prototype.getOption=b.prototype.slickGetOption=function(a){var b=this;return b.options[a]},b.prototype.getNavigableIndexes=function(){var e,a=this,b=0,c=0,d=[];for(a.options.infinite===!1?e=a.slideCount:(b=-1*a.options.slidesToScroll,c=-1*a.options.slidesToScroll,e=2*a.slideCount);e>b;)d.push(b),b=c+a.options.slidesToScroll,c+=a.options.slidesToScroll<=a.options.slidesToShow?a.options.slidesToScroll:a.options.slidesToShow;return d},b.prototype.getSlick=function(){return this},b.prototype.getSlideCount=function(){var c,d,e,b=this;return e=b.options.centerMode===!0?b.slideWidth*Math.floor(b.options.slidesToShow/2):0,b.options.swipeToSlide===!0?(b.$slideTrack.find(".slick-slide").each(function(c,f){return f.offsetLeft-e+a(f).outerWidth()/2>-1*b.swipeLeft?(d=f,!1):void 0}),c=Math.abs(a(d).attr("data-slick-index")-b.currentSlide)||1):b.options.slidesToScroll},b.prototype.goTo=b.prototype.slickGoTo=function(a,b){var c=this;c.changeSlide({data:{message:"index",index:parseInt(a)}},b)},b.prototype.init=function(b){var c=this;a(c.$slider).hasClass("slick-initialized")||(a(c.$slider).addClass("slick-initialized"),c.buildRows(),c.buildOut(),c.setProps(),c.startLoad(),c.loadSlider(),c.initializeEvents(),c.updateArrows(),c.updateDots()),b&&c.$slider.trigger("init",[c]),c.options.accessibility===!0&&c.initADA()},b.prototype.initArrowEvents=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.on("click.slick",{message:"previous"},a.changeSlide),a.$nextArrow.on("click.slick",{message:"next"},a.changeSlide))},b.prototype.initDotEvents=function(){var b=this;b.options.dots===!0&&b.slideCount>b.options.slidesToShow&&a("li",b.$dots).on("click.slick",{message:"index"},b.changeSlide),b.options.dots===!0&&b.options.pauseOnDotsHover===!0&&b.options.autoplay===!0&&a("li",b.$dots).on("mouseenter.slick",a.proxy(b.setPaused,b,!0)).on("mouseleave.slick",a.proxy(b.setPaused,b,!1))},b.prototype.initializeEvents=function(){var b=this;b.initArrowEvents(),b.initDotEvents(),b.$list.on("touchstart.slick mousedown.slick",{action:"start"},b.swipeHandler),b.$list.on("touchmove.slick mousemove.slick",{action:"move"},b.swipeHandler),b.$list.on("touchend.slick mouseup.slick",{action:"end"},b.swipeHandler),b.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},b.swipeHandler),b.$list.on("click.slick",b.clickHandler),a(document).on(b.visibilityChange,a.proxy(b.visibility,b)),b.$list.on("mouseenter.slick",a.proxy(b.setPaused,b,!0)),b.$list.on("mouseleave.slick",a.proxy(b.setPaused,b,!1)),b.options.accessibility===!0&&b.$list.on("keydown.slick",b.keyHandler),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),a(window).on("orientationchange.slick.slick-"+b.instanceUid,a.proxy(b.orientationChange,b)),a(window).on("resize.slick.slick-"+b.instanceUid,a.proxy(b.resize,b)),a("[draggable!=true]",b.$slideTrack).on("dragstart",b.preventDefault),a(window).on("load.slick.slick-"+b.instanceUid,b.setPosition),a(document).on("ready.slick.slick-"+b.instanceUid,b.setPosition)},b.prototype.initUI=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.show(),a.$nextArrow.show()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.show(),a.options.autoplay===!0&&a.autoPlay()},b.prototype.keyHandler=function(a){var b=this;a.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===a.keyCode&&b.options.accessibility===!0?b.changeSlide({data:{message:"previous"}}):39===a.keyCode&&b.options.accessibility===!0&&b.changeSlide({data:{message:"next"}}))},b.prototype.lazyLoad=function(){function g(b){a("img[data-lazy]",b).each(function(){var b=a(this),c=a(this).attr("data-lazy"),d=document.createElement("img");d.onload=function(){b.animate({opacity:0},100,function(){b.attr("src",c).animate({opacity:1},200,function(){b.removeAttr("data-lazy").removeClass("slick-loading")})})},d.src=c})}var c,d,e,f,b=this;b.options.centerMode===!0?b.options.infinite===!0?(e=b.currentSlide+(b.options.slidesToShow/2+1),f=e+b.options.slidesToShow+2):(e=Math.max(0,b.currentSlide-(b.options.slidesToShow/2+1)),f=2+(b.options.slidesToShow/2+1)+b.currentSlide):(e=b.options.infinite?b.options.slidesToShow+b.currentSlide:b.currentSlide,f=e+b.options.slidesToShow,b.options.fade===!0&&(e>0&&e--,f<=b.slideCount&&f++)),c=b.$slider.find(".slick-slide").slice(e,f),g(c),b.slideCount<=b.options.slidesToShow?(d=b.$slider.find(".slick-slide"),g(d)):b.currentSlide>=b.slideCount-b.options.slidesToShow?(d=b.$slider.find(".slick-cloned").slice(0,b.options.slidesToShow),g(d)):0===b.currentSlide&&(d=b.$slider.find(".slick-cloned").slice(-1*b.options.slidesToShow),g(d))},b.prototype.loadSlider=function(){var a=this;a.setPosition(),a.$slideTrack.css({opacity:1}),a.$slider.removeClass("slick-loading"),a.initUI(),"progressive"===a.options.lazyLoad&&a.progressiveLazyLoad()},b.prototype.next=b.prototype.slickNext=function(){var a=this;a.changeSlide({data:{message:"next"}})},b.prototype.orientationChange=function(){var a=this;a.checkResponsive(),a.setPosition()},b.prototype.pause=b.prototype.slickPause=function(){var a=this;a.autoPlayClear(),a.paused=!0},b.prototype.play=b.prototype.slickPlay=function(){var a=this;a.paused=!1,a.autoPlay()},b.prototype.postSlide=function(a){var b=this;b.$slider.trigger("afterChange",[b,a]),b.animating=!1,b.setPosition(),b.swipeLeft=null,b.options.autoplay===!0&&b.paused===!1&&b.autoPlay(),b.options.accessibility===!0&&b.initADA()},b.prototype.prev=b.prototype.slickPrev=function(){var a=this;a.changeSlide({data:{message:"previous"}})},b.prototype.preventDefault=function(a){a.preventDefault()},b.prototype.progressiveLazyLoad=function(){var c,d,b=this;c=a("img[data-lazy]",b.$slider).length,c>0&&(d=a("img[data-lazy]",b.$slider).first(),d.attr("src",d.attr("data-lazy")).removeClass("slick-loading").load(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad(),b.options.adaptiveHeight===!0&&b.setPosition()}).error(function(){d.removeAttr("data-lazy"),b.progressiveLazyLoad()}))},b.prototype.refresh=function(b){var c=this,d=c.currentSlide;c.destroy(!0),a.extend(c,c.initials,{currentSlide:d}),c.init(),b||c.changeSlide({data:{message:"index",index:d}},!1)},b.prototype.registerBreakpoints=function(){var c,d,e,b=this,f=b.options.responsive||null;if("array"===a.type(f)&&f.length){b.respondTo=b.options.respondTo||"window";for(c in f)if(e=b.breakpoints.length-1,d=f[c].breakpoint,f.hasOwnProperty(c)){for(;e>=0;)b.breakpoints[e]&&b.breakpoints[e]===d&&b.breakpoints.splice(e,1),e--;b.breakpoints.push(d),b.breakpointSettings[d]=f[c].settings}b.breakpoints.sort(function(a,c){return b.options.mobileFirst?a-c:c-a})}},b.prototype.reinit=function(){var b=this;b.$slides=b.$slideTrack.children(b.options.slide).addClass("slick-slide"),b.slideCount=b.$slides.length,b.currentSlide>=b.slideCount&&0!==b.currentSlide&&(b.currentSlide=b.currentSlide-b.options.slidesToScroll),b.slideCount<=b.options.slidesToShow&&(b.currentSlide=0),b.registerBreakpoints(),b.setProps(),b.setupInfinite(),b.buildArrows(),b.updateArrows(),b.initArrowEvents(),b.buildDots(),b.updateDots(),b.initDotEvents(),b.checkResponsive(!1,!0),b.options.focusOnSelect===!0&&a(b.$slideTrack).children().on("click.slick",b.selectHandler),b.setSlideClasses(0),b.setPosition(),b.$slider.trigger("reInit",[b]),b.options.autoplay===!0&&b.focusHandler()},b.prototype.resize=function(){var b=this;a(window).width()!==b.windowWidth&&(clearTimeout(b.windowDelay),b.windowDelay=window.setTimeout(function(){b.windowWidth=a(window).width(),b.checkResponsive(),b.unslicked||b.setPosition()},50))},b.prototype.removeSlide=b.prototype.slickRemove=function(a,b,c){var d=this;return"boolean"==typeof a?(b=a,a=b===!0?0:d.slideCount-1):a=b===!0?--a:a,d.slideCount<1||0>a||a>d.slideCount-1?!1:(d.unload(),c===!0?d.$slideTrack.children().remove():d.$slideTrack.children(this.options.slide).eq(a).remove(),d.$slides=d.$slideTrack.children(this.options.slide),d.$slideTrack.children(this.options.slide).detach(),d.$slideTrack.append(d.$slides),d.$slidesCache=d.$slides,d.reinit(),void 0)},b.prototype.setCSS=function(a){var d,e,b=this,c={};b.options.rtl===!0&&(a=-a),d="left"==b.positionProp?Math.ceil(a)+"px":"0px",e="top"==b.positionProp?Math.ceil(a)+"px":"0px",c[b.positionProp]=a,b.transformsEnabled===!1?b.$slideTrack.css(c):(c={},b.cssTransitions===!1?(c[b.animType]="translate("+d+", "+e+")",b.$slideTrack.css(c)):(c[b.animType]="translate3d("+d+", "+e+", 0px)",b.$slideTrack.css(c)))},b.prototype.setDimensions=function(){var a=this;a.options.vertical===!1?a.options.centerMode===!0&&a.$list.css({padding:"0px "+a.options.centerPadding}):(a.$list.height(a.$slides.first().outerHeight(!0)*a.options.slidesToShow),a.options.centerMode===!0&&a.$list.css({padding:a.options.centerPadding+" 0px"})),a.listWidth=a.$list.width(),a.listHeight=a.$list.height(),a.options.vertical===!1&&a.options.variableWidth===!1?(a.slideWidth=Math.ceil(a.listWidth/a.options.slidesToShow),a.$slideTrack.width(Math.ceil(a.slideWidth*a.$slideTrack.children(".slick-slide").length))):a.options.variableWidth===!0?a.$slideTrack.width(5e3*a.slideCount):(a.slideWidth=Math.ceil(a.listWidth),a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0)*a.$slideTrack.children(".slick-slide").length)));var b=a.$slides.first().outerWidth(!0)-a.$slides.first().width();a.options.variableWidth===!1&&a.$slideTrack.children(".slick-slide").width(a.slideWidth-b)},b.prototype.setFade=function(){var c,b=this;b.$slides.each(function(d,e){c=-1*b.slideWidth*d,b.options.rtl===!0?a(e).css({position:"relative",right:c,top:0,zIndex:b.options.zIndex-2,opacity:0}):a(e).css({position:"relative",left:c,top:0,zIndex:b.options.zIndex-2,opacity:0})}),b.$slides.eq(b.currentSlide).css({zIndex:b.options.zIndex-1,opacity:1})},b.prototype.setHeight=function(){var a=this;if(1===a.options.slidesToShow&&a.options.adaptiveHeight===!0&&a.options.vertical===!1){var b=a.$slides.eq(a.currentSlide).outerHeight(!0);a.$list.css("height",b)}},b.prototype.setOption=b.prototype.slickSetOption=function(b,c,d){var f,g,e=this;if("responsive"===b&&"array"===a.type(c))for(g in c)if("array"!==a.type(e.options.responsive))e.options.responsive=[c[g]];else{for(f=e.options.responsive.length-1;f>=0;)e.options.responsive[f].breakpoint===c[g].breakpoint&&e.options.responsive.splice(f,1),f--;e.options.responsive.push(c[g])}else e.options[b]=c;d===!0&&(e.unload(),e.reinit())},b.prototype.setPosition=function(){var a=this;a.setDimensions(),a.setHeight(),a.options.fade===!1?a.setCSS(a.getLeft(a.currentSlide)):a.setFade(),a.$slider.trigger("setPosition",[a])},b.prototype.setProps=function(){var a=this,b=document.body.style;a.positionProp=a.options.vertical===!0?"top":"left","top"===a.positionProp?a.$slider.addClass("slick-vertical"):a.$slider.removeClass("slick-vertical"),(void 0!==b.WebkitTransition||void 0!==b.MozTransition||void 0!==b.msTransition)&&a.options.useCSS===!0&&(a.cssTransitions=!0),a.options.fade&&("number"==typeof a.options.zIndex?a.options.zIndex<3&&(a.options.zIndex=3):a.options.zIndex=a.defaults.zIndex),void 0!==b.OTransform&&(a.animType="OTransform",a.transformType="-o-transform",a.transitionType="OTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.MozTransform&&(a.animType="MozTransform",a.transformType="-moz-transform",a.transitionType="MozTransition",void 0===b.perspectiveProperty&&void 0===b.MozPerspective&&(a.animType=!1)),void 0!==b.webkitTransform&&(a.animType="webkitTransform",a.transformType="-webkit-transform",a.transitionType="webkitTransition",void 0===b.perspectiveProperty&&void 0===b.webkitPerspective&&(a.animType=!1)),void 0!==b.msTransform&&(a.animType="msTransform",a.transformType="-ms-transform",a.transitionType="msTransition",void 0===b.msTransform&&(a.animType=!1)),void 0!==b.transform&&a.animType!==!1&&(a.animType="transform",a.transformType="transform",a.transitionType="transition"),a.transformsEnabled=null!==a.animType&&a.animType!==!1},b.prototype.setSlideClasses=function(a){var c,d,e,f,b=this;d=b.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),b.$slides.eq(a).addClass("slick-current"),b.options.centerMode===!0?(c=Math.floor(b.options.slidesToShow/2),b.options.infinite===!0&&(a>=c&&a<=b.slideCount-1-c?b.$slides.slice(a-c,a+c+1).addClass("slick-active").attr("aria-hidden","false"):(e=b.options.slidesToShow+a,d.slice(e-c+1,e+c+2).addClass("slick-active").attr("aria-hidden","false")),0===a?d.eq(d.length-1-b.options.slidesToShow).addClass("slick-center"):a===b.slideCount-1&&d.eq(b.options.slidesToShow).addClass("slick-center")),b.$slides.eq(a).addClass("slick-center")):a>=0&&a<=b.slideCount-b.options.slidesToShow?b.$slides.slice(a,a+b.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):d.length<=b.options.slidesToShow?d.addClass("slick-active").attr("aria-hidden","false"):(f=b.slideCount%b.options.slidesToShow,e=b.options.infinite===!0?b.options.slidesToShow+a:a,b.options.slidesToShow==b.options.slidesToScroll&&b.slideCount-ab.options.slidesToShow)){for(e=b.options.centerMode===!0?b.options.slidesToShow+1:b.options.slidesToShow,c=b.slideCount;c>b.slideCount-e;c-=1)d=c-1,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d-b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned");for(c=0;e>c;c+=1)d=c,a(b.$slides[d]).clone(!0).attr("id","").attr("data-slick-index",d+b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned");b.$slideTrack.find(".slick-cloned").find("[id]").each(function(){a(this).attr("id","")})}},b.prototype.setPaused=function(a){var b=this;b.options.autoplay===!0&&b.options.pauseOnHover===!0&&(b.paused=a,a?b.autoPlayClear():b.autoPlay())},b.prototype.selectHandler=function(b){var c=this,d=a(b.target).is(".slick-slide")?a(b.target):a(b.target).parents(".slick-slide"),e=parseInt(d.attr("data-slick-index"));return e||(e=0),c.slideCount<=c.options.slidesToShow?(c.setSlideClasses(e),c.asNavFor(e),void 0):(c.slideHandler(e),void 0)},b.prototype.slideHandler=function(a,b,c){var d,e,f,g,h=null,i=this;return b=b||!1,i.animating===!0&&i.options.waitForAnimate===!0||i.options.fade===!0&&i.currentSlide===a||i.slideCount<=i.options.slidesToShow?void 0:(b===!1&&i.asNavFor(a),d=a,h=i.getLeft(d),g=i.getLeft(i.currentSlide),i.currentLeft=null===i.swipeLeft?g:i.swipeLeft,i.options.infinite===!1&&i.options.centerMode===!1&&(0>a||a>i.getDotCount()*i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):i.options.infinite===!1&&i.options.centerMode===!0&&(0>a||a>i.slideCount-i.options.slidesToScroll)?(i.options.fade===!1&&(d=i.currentSlide,c!==!0?i.animateSlide(g,function(){i.postSlide(d)}):i.postSlide(d)),void 0):(i.options.autoplay===!0&&clearInterval(i.autoPlayTimer),e=0>d?0!==i.slideCount%i.options.slidesToScroll?i.slideCount-i.slideCount%i.options.slidesToScroll:i.slideCount+d:d>=i.slideCount?0!==i.slideCount%i.options.slidesToScroll?0:d-i.slideCount:d,i.animating=!0,i.$slider.trigger("beforeChange",[i,i.currentSlide,e]),f=i.currentSlide,i.currentSlide=e,i.setSlideClasses(i.currentSlide),i.updateDots(),i.updateArrows(),i.options.fade===!0?(c!==!0?(i.fadeSlideOut(f),i.fadeSlide(e,function(){i.postSlide(e) -})):i.postSlide(e),i.animateHeight(),void 0):(c!==!0?i.animateSlide(h,function(){i.postSlide(e)}):i.postSlide(e),void 0)))},b.prototype.startLoad=function(){var a=this;a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&(a.$prevArrow.hide(),a.$nextArrow.hide()),a.options.dots===!0&&a.slideCount>a.options.slidesToShow&&a.$dots.hide(),a.$slider.addClass("slick-loading")},b.prototype.swipeDirection=function(){var a,b,c,d,e=this;return a=e.touchObject.startX-e.touchObject.curX,b=e.touchObject.startY-e.touchObject.curY,c=Math.atan2(b,a),d=Math.round(180*c/Math.PI),0>d&&(d=360-Math.abs(d)),45>=d&&d>=0?e.options.rtl===!1?"left":"right":360>=d&&d>=315?e.options.rtl===!1?"left":"right":d>=135&&225>=d?e.options.rtl===!1?"right":"left":e.options.verticalSwiping===!0?d>=35&&135>=d?"left":"right":"vertical"},b.prototype.swipeEnd=function(){var c,b=this;if(b.dragging=!1,b.shouldClick=b.touchObject.swipeLength>10?!1:!0,void 0===b.touchObject.curX)return!1;if(b.touchObject.edgeHit===!0&&b.$slider.trigger("edge",[b,b.swipeDirection()]),b.touchObject.swipeLength>=b.touchObject.minSwipe)switch(b.swipeDirection()){case"left":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide+b.getSlideCount()):b.currentSlide+b.getSlideCount(),b.slideHandler(c),b.currentDirection=0,b.touchObject={},b.$slider.trigger("swipe",[b,"left"]);break;case"right":c=b.options.swipeToSlide?b.checkNavigable(b.currentSlide-b.getSlideCount()):b.currentSlide-b.getSlideCount(),b.slideHandler(c),b.currentDirection=1,b.touchObject={},b.$slider.trigger("swipe",[b,"right"])}else b.touchObject.startX!==b.touchObject.curX&&(b.slideHandler(b.currentSlide),b.touchObject={})},b.prototype.swipeHandler=function(a){var b=this;if(!(b.options.swipe===!1||"ontouchend"in document&&b.options.swipe===!1||b.options.draggable===!1&&-1!==a.type.indexOf("mouse")))switch(b.touchObject.fingerCount=a.originalEvent&&void 0!==a.originalEvent.touches?a.originalEvent.touches.length:1,b.touchObject.minSwipe=b.listWidth/b.options.touchThreshold,b.options.verticalSwiping===!0&&(b.touchObject.minSwipe=b.listHeight/b.options.touchThreshold),a.data.action){case"start":b.swipeStart(a);break;case"move":b.swipeMove(a);break;case"end":b.swipeEnd(a)}},b.prototype.swipeMove=function(a){var d,e,f,g,h,b=this;return h=void 0!==a.originalEvent?a.originalEvent.touches:null,!b.dragging||h&&1!==h.length?!1:(d=b.getLeft(b.currentSlide),b.touchObject.curX=void 0!==h?h[0].pageX:a.clientX,b.touchObject.curY=void 0!==h?h[0].pageY:a.clientY,b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curX-b.touchObject.startX,2))),b.options.verticalSwiping===!0&&(b.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(b.touchObject.curY-b.touchObject.startY,2)))),e=b.swipeDirection(),"vertical"!==e?(void 0!==a.originalEvent&&b.touchObject.swipeLength>4&&a.preventDefault(),g=(b.options.rtl===!1?1:-1)*(b.touchObject.curX>b.touchObject.startX?1:-1),b.options.verticalSwiping===!0&&(g=b.touchObject.curY>b.touchObject.startY?1:-1),f=b.touchObject.swipeLength,b.touchObject.edgeHit=!1,b.options.infinite===!1&&(0===b.currentSlide&&"right"===e||b.currentSlide>=b.getDotCount()&&"left"===e)&&(f=b.touchObject.swipeLength*b.options.edgeFriction,b.touchObject.edgeHit=!0),b.swipeLeft=b.options.vertical===!1?d+f*g:d+f*(b.$list.height()/b.listWidth)*g,b.options.verticalSwiping===!0&&(b.swipeLeft=d+f*g),b.options.fade===!0||b.options.touchMove===!1?!1:b.animating===!0?(b.swipeLeft=null,!1):(b.setCSS(b.swipeLeft),void 0)):void 0)},b.prototype.swipeStart=function(a){var c,b=this;return 1!==b.touchObject.fingerCount||b.slideCount<=b.options.slidesToShow?(b.touchObject={},!1):(void 0!==a.originalEvent&&void 0!==a.originalEvent.touches&&(c=a.originalEvent.touches[0]),b.touchObject.startX=b.touchObject.curX=void 0!==c?c.pageX:a.clientX,b.touchObject.startY=b.touchObject.curY=void 0!==c?c.pageY:a.clientY,b.dragging=!0,void 0)},b.prototype.unfilterSlides=b.prototype.slickUnfilter=function(){var a=this;null!==a.$slidesCache&&(a.unload(),a.$slideTrack.children(this.options.slide).detach(),a.$slidesCache.appendTo(a.$slideTrack),a.reinit())},b.prototype.unload=function(){var b=this;a(".slick-cloned",b.$slider).remove(),b.$dots&&b.$dots.remove(),b.$prevArrow&&b.htmlExpr.test(b.options.prevArrow)&&b.$prevArrow.remove(),b.$nextArrow&&b.htmlExpr.test(b.options.nextArrow)&&b.$nextArrow.remove(),b.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},b.prototype.unslick=function(a){var b=this;b.$slider.trigger("unslick",[b,a]),b.destroy()},b.prototype.updateArrows=function(){var b,a=this;b=Math.floor(a.options.slidesToShow/2),a.options.arrows===!0&&a.slideCount>a.options.slidesToShow&&!a.options.infinite&&(a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===a.currentSlide?(a.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-a.options.slidesToShow&&a.options.centerMode===!1?(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):a.currentSlide>=a.slideCount-1&&a.options.centerMode===!0&&(a.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),a.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},b.prototype.updateDots=function(){var a=this;null!==a.$dots&&(a.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),a.$dots.find("li").eq(Math.floor(a.currentSlide/a.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))},b.prototype.visibility=function(){var a=this;document[a.hidden]?(a.paused=!0,a.autoPlayClear()):a.options.autoplay===!0&&(a.paused=!1,a.autoPlay())},b.prototype.initADA=function(){var b=this;b.$slides.add(b.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),b.$slideTrack.attr("role","listbox"),b.$slides.not(b.$slideTrack.find(".slick-cloned")).each(function(c){a(this).attr({role:"option","aria-describedby":"slick-slide"+b.instanceUid+c})}),null!==b.$dots&&b.$dots.attr("role","tablist").find("li").each(function(c){a(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+b.instanceUid+c,id:"slick-slide"+b.instanceUid+c})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar"),b.activateADA()},b.prototype.activateADA=function(){var a=this,b=a.$slider.find("*").is(":focus");a.$slideTrack.find(".slick-active").attr({"aria-hidden":"false",tabindex:"0"}).find("a, input, button, select").attr({tabindex:"0"}),b&&a.$slideTrack.find(".slick-active").focus()},b.prototype.focusHandler=function(){var b=this;b.$slider.on("focus.slick blur.slick","*",function(c){c.stopImmediatePropagation();var d=a(this);setTimeout(function(){b.isPlay&&(d.is(":focus")?(b.autoPlayClear(),b.paused=!0):(b.paused=!1,b.autoPlay()))},0)})},a.fn.slick=function(){var g,a=this,c=arguments[0],d=Array.prototype.slice.call(arguments,1),e=a.length,f=0;for(f;e>f;f++)if("object"==typeof c||"undefined"==typeof c?a[f].slick=new b(a[f],c):g=a[f].slick[c].apply(a[f].slick,d),"undefined"!=typeof g)return g;return a}}); \ No newline at end of file +!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('',\n newestOnTop: true,\n preventDuplicates: false,\n progressBar: false\n };\n }\n\n function publish(args) {\n if (!listener) { return; }\n listener(args);\n }\n\n function notify(map) {\n var options = getOptions();\n var iconClass = map.iconClass || options.iconClass;\n\n if (typeof (map.optionsOverride) !== 'undefined') {\n options = $.extend(options, map.optionsOverride);\n iconClass = map.optionsOverride.iconClass || iconClass;\n }\n\n if (shouldExit(options, map)) { return; }\n\n toastId++;\n\n $container = getContainer(options, true);\n\n var intervalId = null;\n var $toastElement = $('
                ');\n var $titleElement = $('
                ');\n var $messageElement = $('
                ');\n var $progressElement = $('
                ');\n var $closeElement = $(options.closeHtml);\n var progressBar = {\n intervalId: null,\n hideEta: null,\n maxHideTime: null\n };\n var response = {\n toastId: toastId,\n state: 'visible',\n startTime: new Date(),\n options: options,\n map: map\n };\n\n personalizeToast();\n\n displayToast();\n\n handleEvents();\n\n publish(response);\n\n if (options.debug && console) {\n console.log(response);\n }\n\n return $toastElement;\n\n function personalizeToast() {\n setIcon();\n setTitle();\n setMessage();\n setCloseButton();\n setProgressBar();\n setSequence();\n }\n\n function handleEvents() {\n $toastElement.hover(stickAround, delayedHideToast);\n if (!options.onclick && options.tapToDismiss) {\n $toastElement.click(hideToast);\n }\n\n if (options.closeButton && $closeElement) {\n $closeElement.click(function (event) {\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {\n event.cancelBubble = true;\n }\n hideToast(true);\n });\n }\n\n if (options.onclick) {\n $toastElement.click(function () {\n options.onclick();\n hideToast();\n });\n }\n }\n\n function displayToast() {\n $toastElement.hide();\n\n $toastElement[options.showMethod](\n {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}\n );\n\n if (options.timeOut > 0) {\n intervalId = setTimeout(hideToast, options.timeOut);\n progressBar.maxHideTime = parseFloat(options.timeOut);\n progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n if (options.progressBar) {\n progressBar.intervalId = setInterval(updateProgress, 10);\n }\n }\n }\n\n function setIcon() {\n if (map.iconClass) {\n $toastElement.addClass(options.toastClass).addClass(iconClass);\n }\n }\n\n function setSequence() {\n if (options.newestOnTop) {\n $container.prepend($toastElement);\n } else {\n $container.append($toastElement);\n }\n }\n\n function setTitle() {\n if (map.title) {\n $titleElement.append(map.title).addClass(options.titleClass);\n $toastElement.append($titleElement);\n }\n }\n\n function setMessage() {\n if (map.message) {\n $messageElement.append(map.message).addClass(options.messageClass);\n $toastElement.append($messageElement);\n }\n }\n\n function setCloseButton() {\n if (options.closeButton) {\n $closeElement.addClass('toast-close-button').attr('role', 'button');\n $toastElement.prepend($closeElement);\n }\n }\n\n function setProgressBar() {\n if (options.progressBar) {\n $progressElement.addClass('toast-progress');\n $toastElement.prepend($progressElement);\n }\n }\n\n function shouldExit(options, map) {\n if (options.preventDuplicates) {\n if (map.message === previousToast) {\n return true;\n } else {\n previousToast = map.message;\n }\n }\n return false;\n }\n\n function hideToast(override) {\n if ($(':focus', $toastElement).length && !override) {\n return;\n }\n clearTimeout(progressBar.intervalId);\n return $toastElement[options.hideMethod]({\n duration: options.hideDuration,\n easing: options.hideEasing,\n complete: function () {\n removeToast($toastElement);\n if (options.onHidden && response.state !== 'hidden') {\n options.onHidden();\n }\n response.state = 'hidden';\n response.endTime = new Date();\n publish(response);\n }\n });\n }\n\n function delayedHideToast() {\n if (options.timeOut > 0 || options.extendedTimeOut > 0) {\n intervalId = setTimeout(hideToast, options.extendedTimeOut);\n progressBar.maxHideTime = parseFloat(options.extendedTimeOut);\n progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n }\n }\n\n function stickAround() {\n clearTimeout(intervalId);\n progressBar.hideEta = 0;\n $toastElement.stop(true, true)[options.showMethod](\n {duration: options.showDuration, easing: options.showEasing}\n );\n }\n\n function updateProgress() {\n var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;\n $progressElement.width(percentage + '%');\n }\n }\n\n function getOptions() {\n return $.extend({}, getDefaults(), toastr.options);\n }\n\n function removeToast($toastElement) {\n if (!$container) { $container = getContainer(); }\n if ($toastElement.is(':visible')) {\n return;\n }\n $toastElement.remove();\n $toastElement = null;\n if ($container.children().length === 0) {\n $container.remove();\n previousToast = undefined;\n }\n }\n\n })();\n });\n}(typeof define === 'function' && define.amd ? define : function (deps, factory) {\n if (typeof module !== 'undefined' && module.exports) { //Node\n module.exports = factory(require('jquery'));\n } else {\n window['toastr'] = factory(window['jQuery']);\n }\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["toastr.js"],"names":["define","$","error","message","title","optionsOverride","notify","type","toastType","iconClass","getOptions","iconClasses","getContainer","options","create","$container","containerId","length","createContainer","info","subscribe","callback","listener","success","warning","clear","$toastElement","clearOptions","clearToast","clearContainer","remove","removeToast","children","toastsToClear","i","force","hideMethod","duration","hideDuration","easing","hideEasing","complete","attr","addClass","positionClass","appendTo","target","getDefaults","tapToDismiss","toastClass","debug","showMethod","showDuration","showEasing","onShown","undefined","onHidden","closeMethod","closeDuration","closeEasing","closeOnHover","extendedTimeOut","timeOut","titleClass","messageClass","escapeHtml","closeHtml","closeClass","newestOnTop","preventDuplicates","progressBar","progressClass","rtl","publish","args","map","source","replace","personalizeToast","setIcon","setTitle","setMessage","setCloseButton","setProgressBar","setRTL","setSequence","setAria","ariaValue","handleEvents","hover","stickAround","delayedHideToast","onclick","click","hideToast","closeButton","$closeElement","event","stopPropagation","cancelBubble","onCloseClick","displayToast","hide","intervalId","setTimeout","maxHideTime","parseFloat","hideEta","Date","getTime","setInterval","updateProgress","prepend","append","suffix","$titleElement","$messageElement","$progressElement","shouldExit","previousToast","override","method","clearTimeout","response","state","endTime","stop","percentage","width","extend","toastId","startTime","console","log","toastr","is","version","amd","deps","factory","module","exports","require","window","jQuery"],"mappings":"CAaC,SAAUA,GACPA,GAAQ,UAAW,SAAUC,GACzB,MAAO,YA8BH,QAASC,GAAMC,EAASC,EAAOC,GAC3B,MAAOC,IACHC,KAAMC,EAAUN,MAChBO,UAAWC,IAAaC,YAAYT,MACpCC,QAASA,EACTE,gBAAiBA,EACjBD,MAAOA,IAIf,QAASQ,GAAaC,EAASC,GAG3B,MAFKD,KAAWA,EAAUH,KAC1BK,EAAad,EAAE,IAAMY,EAAQG,aACzBD,EAAWE,OACJF,GAEPD,IACAC,EAAaG,EAAgBL,IAE1BE,GAGX,QAASI,GAAKhB,EAASC,EAAOC,GAC1B,MAAOC,IACHC,KAAMC,EAAUW,KAChBV,UAAWC,IAAaC,YAAYQ,KACpChB,QAASA,EACTE,gBAAiBA,EACjBD,MAAOA,IAIf,QAASgB,GAAUC,GACfC,EAAWD,EAGf,QAASE,GAAQpB,EAASC,EAAOC,GAC7B,MAAOC,IACHC,KAAMC,EAAUe,QAChBd,UAAWC,IAAaC,YAAYY,QACpCpB,QAASA,EACTE,gBAAiBA,EACjBD,MAAOA,IAIf,QAASoB,GAAQrB,EAASC,EAAOC,GAC7B,MAAOC,IACHC,KAAMC,EAAUgB,QAChBf,UAAWC,IAAaC,YAAYa,QACpCrB,QAASA,EACTE,gBAAiBA,EACjBD,MAAOA,IAIf,QAASqB,GAAMC,EAAeC,GAC1B,GAAId,GAAUH,GACTK,IAAcH,EAAaC,GAC3Be,EAAWF,EAAeb,EAASc,IACpCE,EAAehB,GAIvB,QAASiB,GAAOJ,GACZ,GAAIb,GAAUH,GAEd,OADKK,IAAcH,EAAaC,GAC5Ba,GAAuD,IAAtCzB,EAAE,SAAUyB,GAAeT,WAC5Cc,GAAYL,QAGZX,EAAWiB,WAAWf,QACtBF,EAAWe,UAMnB,QAASD,GAAgBhB,GAErB,IAAK,GADDoB,GAAgBlB,EAAWiB,WACtBE,EAAID,EAAchB,OAAS,EAAGiB,GAAK,EAAGA,IAC3CN,EAAW3B,EAAEgC,EAAcC,IAAKrB,GAIxC,QAASe,GAAYF,EAAeb,EAASc,GACzC,GAAIQ,MAAQR,IAAgBA,EAAaQ,QAAQR,EAAaQ,KAC9D,UAAIT,IAAkBS,GAA+C,IAAtClC,EAAE,SAAUyB,GAAeT,UACtDS,EAAcb,EAAQuB,aAClBC,SAAUxB,EAAQyB,aAClBC,OAAQ1B,EAAQ2B,WAChBC,SAAU,WAAcV,EAAYL,OAEjC,GAKf,QAASR,GAAgBL,GAMrB,MALAE,GAAad,EAAE,UACVyC,KAAK,KAAM7B,EAAQG,aACnB2B,SAAS9B,EAAQ+B,eAEtB7B,EAAW8B,SAAS5C,EAAEY,EAAQiC,SACvB/B,EAGX,QAASgC,KACL,OACIC,cAAc,EACdC,WAAY,QACZjC,YAAa,kBACbkC,OAAO,EAEPC,WAAY,SACZC,aAAc,IACdC,WAAY,QACZC,QAASC,OACTnB,WAAY,UACZE,aAAc,IACdE,WAAY,QACZgB,SAAUD,OACVE,aAAa,EACbC,eAAe,EACfC,aAAa,EACbC,cAAc,EAEdC,gBAAiB,IACjBlD,aACIT,MAAO,cACPiB,KAAM,aACNI,QAAS,gBACTC,QAAS,iBAEbf,UAAW,aACXmC,cAAe,kBACfkB,QAAS,IACTC,WAAY,cACZC,aAAc,gBACdC,YAAY,EACZnB,OAAQ,OACRoB,UAAW,yCACXC,WAAY,qBACZC,aAAa,EACbC,mBAAmB,EACnBC,aAAa,EACbC,cAAe,iBACfC,KAAK,GAIb,QAASC,GAAQC,GACRpD,GACLA,EAASoD,GAGb,QAASpE,GAAOqE,GAgDZ,QAASV,GAAWW,GAKhB,MAJc,OAAVA,IACAA,EAAS,IAGNA,EACFC,QAAQ,KAAM,SACdA,QAAQ,KAAM,UACdA,QAAQ,KAAM,SACdA,QAAQ,KAAM,QACdA,QAAQ,KAAM,QAGvB,QAASC,KACLC,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IACAC,IAGJ,QAASA,KACL,GAAIC,GAAY,EAChB,QAAQZ,EAAIlE,WACR,IAAK,gBACL,IAAK,aACD8E,EAAa,QACb,MACJ,SACIA,EAAY,YAEpB7D,EAAcgB,KAAK,YAAa6C,GAGpC,QAASC,KACD3E,EAAQ+C,cACRlC,EAAc+D,MAAMC,EAAaC,IAGhC9E,EAAQ+E,SAAW/E,EAAQmC,cAC5BtB,EAAcmE,MAAMC,GAGpBjF,EAAQkF,aAAeC,GACvBA,EAAcH,MAAM,SAAUI,GACtBA,EAAMC,gBACND,EAAMC,kBACwB3C,SAAvB0C,EAAME,cAA8BF,EAAME,gBAAiB,IAClEF,EAAME,cAAe,GAGrBtF,EAAQuF,cACRvF,EAAQuF,aAAaH,GAGzBH,GAAU,KAIdjF,EAAQ+E,SACRlE,EAAcmE,MAAM,SAAUI,GAC1BpF,EAAQ+E,QAAQK,GAChBH,MAKZ,QAASO,KACL3E,EAAc4E,OAEd5E,EAAcb,EAAQsC,aACjBd,SAAUxB,EAAQuC,aAAcb,OAAQ1B,EAAQwC,WAAYZ,SAAU5B,EAAQyC,UAG/EzC,EAAQiD,QAAU,IAClByC,EAAaC,WAAWV,EAAWjF,EAAQiD,SAC3CQ,EAAYmC,YAAcC,WAAW7F,EAAQiD,SAC7CQ,EAAYqC,SAAU,GAAIC,OAAOC,UAAYvC,EAAYmC,YACrD5F,EAAQyD,cACRA,EAAYiC,WAAaO,YAAYC,EAAgB,MAKjE,QAAShC,KACDJ,EAAIlE,WACJiB,EAAciB,SAAS9B,EAAQoC,YAAYN,SAASlC,GAI5D,QAAS4E,KACDxE,EAAQuD,YACRrD,EAAWiG,QAAQtF,GAEnBX,EAAWkG,OAAOvF,GAI1B,QAASsD,KACL,GAAIL,EAAIvE,MAAO,CACX,GAAI8G,GAASvC,EAAIvE,KACbS,GAAQoD,aACRiD,EAASjD,EAAWU,EAAIvE,QAE5B+G,EAAcF,OAAOC,GAAQvE,SAAS9B,EAAQkD,YAC9CrC,EAAcuF,OAAOE,IAI7B,QAASlC,KACL,GAAIN,EAAIxE,QAAS,CACb,GAAI+G,GAASvC,EAAIxE,OACbU,GAAQoD,aACRiD,EAASjD,EAAWU,EAAIxE,UAE5BiH,EAAgBH,OAAOC,GAAQvE,SAAS9B,EAAQmD,cAChDtC,EAAcuF,OAAOG,IAI7B,QAASlC,KACDrE,EAAQkF,cACRC,EAAcrD,SAAS9B,EAAQsD,YAAYzB,KAAK,OAAQ,UACxDhB,EAAcsF,QAAQhB,IAI9B,QAASb,KACDtE,EAAQyD,cACR+C,EAAiB1E,SAAS9B,EAAQ0D,eAClC7C,EAAcsF,QAAQK,IAI9B,QAASjC,KACDvE,EAAQ2D,KACR9C,EAAciB,SAAS,OAI/B,QAAS2E,GAAWzG,EAAS8D,GACzB,GAAI9D,EAAQwD,kBAAmB,CAC3B,GAAIM,EAAIxE,UAAYoH,EAChB,OAAO,CAEPA,GAAgB5C,EAAIxE,QAG5B,OAAO,EAGX,QAAS2F,GAAU0B,GACf,GAAIC,GAASD,GAAY3G,EAAQ4C,eAAgB,EAAQ5C,EAAQ4C,YAAc5C,EAAQuB,WACnFC,EAAWmF,GAAY3G,EAAQ6C,iBAAkB,EACjD7C,EAAQ6C,cAAgB7C,EAAQyB,aAChCC,EAASiF,GAAY3G,EAAQ8C,eAAgB,EAAQ9C,EAAQ8C,YAAc9C,EAAQ2B,UACvF,KAAIvC,EAAE,SAAUyB,GAAeT,QAAWuG,EAI1C,MADAE,cAAapD,EAAYiC,YAClB7E,EAAc+F,IACjBpF,SAAUA,EACVE,OAAQA,EACRE,SAAU,WACNV,EAAYL,GACZgG,aAAanB,GACT1F,EAAQ2C,UAA+B,WAAnBmE,EAASC,OAC7B/G,EAAQ2C,WAEZmE,EAASC,MAAQ,SACjBD,EAASE,QAAU,GAAIjB,MACvBnC,EAAQkD,MAKpB,QAAShC,MACD9E,EAAQiD,QAAU,GAAKjD,EAAQgD,gBAAkB,KACjD0C,EAAaC,WAAWV,EAAWjF,EAAQgD,iBAC3CS,EAAYmC,YAAcC,WAAW7F,EAAQgD,iBAC7CS,EAAYqC,SAAU,GAAIC,OAAOC,UAAYvC,EAAYmC,aAIjE,QAASf,KACLgC,aAAanB,GACbjC,EAAYqC,QAAU,EACtBjF,EAAcoG,MAAK,GAAM,GAAMjH,EAAQsC,aAClCd,SAAUxB,EAAQuC,aAAcb,OAAQ1B,EAAQwC,aAIzD,QAAS0D,KACL,GAAIgB,IAAezD,EAAYqC,SAAW,GAAIC,OAAOC,WAAcvC,EAAYmC,YAAe,GAC9FY,GAAiBW,MAAMD,EAAa,KApPxC,GAAIlH,GAAUH,IACVD,EAAYkE,EAAIlE,WAAaI,EAAQJ,SAOzC,IALqC,mBAAzBkE,GAAmB,kBAC3B9D,EAAUZ,EAAEgI,OAAOpH,EAAS8D,EAAItE,iBAChCI,EAAYkE,EAAItE,gBAAgBI,WAAaA,IAG7C6G,EAAWzG,EAAS8D,GAAxB,CAEAuD,IAEAnH,EAAaH,EAAaC,GAAS,EAEnC,IAAI0F,GAAa,KACb7E,EAAgBzB,EAAE,UAClBkH,EAAgBlH,EAAE,UAClBmH,EAAkBnH,EAAE,UACpBoH,EAAmBpH,EAAE,UACrB+F,EAAgB/F,EAAEY,EAAQqD,WAC1BI,GACAiC,WAAY,KACZI,QAAS,KACTF,YAAa,MAEbkB,GACAO,QAASA,EACTN,MAAO,UACPO,UAAW,GAAIvB,MACf/F,QAASA,EACT8D,IAAKA,EAeT,OAZAG,KAEAuB,IAEAb,IAEAf,EAAQkD,GAEJ9G,EAAQqC,OAASkF,SACjBA,QAAQC,IAAIV,GAGTjG,GA2MX,QAAShB,KACL,MAAOT,GAAEgI,UAAWlF,IAAeuF,EAAOzH,SAG9C,QAASkB,GAAYL,GACZX,IAAcA,EAAaH,KAC5Bc,EAAc6G,GAAG,cAGrB7G,EAAcI,SACdJ,EAAgB,KACqB,IAAjCX,EAAWiB,WAAWf,SACtBF,EAAWe,SACXyF,EAAgBhE,SA/bxB,GAAIxC,GACAO,EAsBAiG,EArBAW,EAAU,EACV1H,GACAN,MAAO,QACPiB,KAAM,OACNI,QAAS,UACTC,QAAS,WAGT8G,GACA7G,MAAOA,EACPK,OAAQA,EACR5B,MAAOA,EACPU,aAAcA,EACdO,KAAMA,EACNN,WACAO,UAAWA,EACXG,QAASA,EACTiH,QAAS,QACThH,QAASA,EAKb,OAAO8G,SA4aC,kBAAXtI,SAAyBA,OAAOyI,IAAMzI,OAAS,SAAU0I,EAAMC,GAC9C,mBAAXC,SAA0BA,OAAOC,QACxCD,OAAOC,QAAUF,EAAQG,QAAQ,WAEjCC,OAAOT,OAASK,EAAQI,OAAOC","file":"toastr.js","sourcesContent":["/*\n * Toastr\n * Copyright 2012-2015\n * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.\n * All Rights Reserved.\n * Use, reproduction, distribution, and modification of this code is subject to the terms and\n * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php\n *\n * ARIA Support: Greta Krafsig\n *\n * Project: https://github.com/CodeSeven/toastr\n */\n/* global define */\n(function (define) {\n define(['jquery'], function ($) {\n return (function () {\n var $container;\n var listener;\n var toastId = 0;\n var toastType = {\n error: 'error',\n info: 'info',\n success: 'success',\n warning: 'warning'\n };\n\n var toastr = {\n clear: clear,\n remove: remove,\n error: error,\n getContainer: getContainer,\n info: info,\n options: {},\n subscribe: subscribe,\n success: success,\n version: '2.1.3',\n warning: warning\n };\n\n var previousToast;\n\n return toastr;\n\n ////////////////\n\n function error(message, title, optionsOverride) {\n return notify({\n type: toastType.error,\n iconClass: getOptions().iconClasses.error,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function getContainer(options, create) {\n if (!options) { options = getOptions(); }\n $container = $('#' + options.containerId);\n if ($container.length) {\n return $container;\n }\n if (create) {\n $container = createContainer(options);\n }\n return $container;\n }\n\n function info(message, title, optionsOverride) {\n return notify({\n type: toastType.info,\n iconClass: getOptions().iconClasses.info,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function subscribe(callback) {\n listener = callback;\n }\n\n function success(message, title, optionsOverride) {\n return notify({\n type: toastType.success,\n iconClass: getOptions().iconClasses.success,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function warning(message, title, optionsOverride) {\n return notify({\n type: toastType.warning,\n iconClass: getOptions().iconClasses.warning,\n message: message,\n optionsOverride: optionsOverride,\n title: title\n });\n }\n\n function clear($toastElement, clearOptions) {\n var options = getOptions();\n if (!$container) { getContainer(options); }\n if (!clearToast($toastElement, options, clearOptions)) {\n clearContainer(options);\n }\n }\n\n function remove($toastElement) {\n var options = getOptions();\n if (!$container) { getContainer(options); }\n if ($toastElement && $(':focus', $toastElement).length === 0) {\n removeToast($toastElement);\n return;\n }\n if ($container.children().length) {\n $container.remove();\n }\n }\n\n // internal functions\n\n function clearContainer (options) {\n var toastsToClear = $container.children();\n for (var i = toastsToClear.length - 1; i >= 0; i--) {\n clearToast($(toastsToClear[i]), options);\n }\n }\n\n function clearToast ($toastElement, options, clearOptions) {\n var force = clearOptions && clearOptions.force ? clearOptions.force : false;\n if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {\n $toastElement[options.hideMethod]({\n duration: options.hideDuration,\n easing: options.hideEasing,\n complete: function () { removeToast($toastElement); }\n });\n return true;\n }\n return false;\n }\n\n function createContainer(options) {\n $container = $('
                ')\n .attr('id', options.containerId)\n .addClass(options.positionClass);\n\n $container.appendTo($(options.target));\n return $container;\n }\n\n function getDefaults() {\n return {\n tapToDismiss: true,\n toastClass: 'toast',\n containerId: 'toast-container',\n debug: false,\n\n showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery\n showDuration: 300,\n showEasing: 'swing', //swing and linear are built into jQuery\n onShown: undefined,\n hideMethod: 'fadeOut',\n hideDuration: 1000,\n hideEasing: 'swing',\n onHidden: undefined,\n closeMethod: false,\n closeDuration: false,\n closeEasing: false,\n closeOnHover: true,\n\n extendedTimeOut: 1000,\n iconClasses: {\n error: 'toast-error',\n info: 'toast-info',\n success: 'toast-success',\n warning: 'toast-warning'\n },\n iconClass: 'toast-info',\n positionClass: 'toast-top-right',\n timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky\n titleClass: 'toast-title',\n messageClass: 'toast-message',\n escapeHtml: false,\n target: 'body',\n closeHtml: '',\n closeClass: 'toast-close-button',\n newestOnTop: true,\n preventDuplicates: false,\n progressBar: false,\n progressClass: 'toast-progress',\n rtl: false\n };\n }\n\n function publish(args) {\n if (!listener) { return; }\n listener(args);\n }\n\n function notify(map) {\n var options = getOptions();\n var iconClass = map.iconClass || options.iconClass;\n\n if (typeof (map.optionsOverride) !== 'undefined') {\n options = $.extend(options, map.optionsOverride);\n iconClass = map.optionsOverride.iconClass || iconClass;\n }\n\n if (shouldExit(options, map)) { return; }\n\n toastId++;\n\n $container = getContainer(options, true);\n\n var intervalId = null;\n var $toastElement = $('
                ');\n var $titleElement = $('
                ');\n var $messageElement = $('
                ');\n var $progressElement = $('
                ');\n var $closeElement = $(options.closeHtml);\n var progressBar = {\n intervalId: null,\n hideEta: null,\n maxHideTime: null\n };\n var response = {\n toastId: toastId,\n state: 'visible',\n startTime: new Date(),\n options: options,\n map: map\n };\n\n personalizeToast();\n\n displayToast();\n\n handleEvents();\n\n publish(response);\n\n if (options.debug && console) {\n console.log(response);\n }\n\n return $toastElement;\n\n function escapeHtml(source) {\n if (source == null) {\n source = '';\n }\n\n return source\n .replace(/&/g, '&')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n .replace(//g, '>');\n }\n\n function personalizeToast() {\n setIcon();\n setTitle();\n setMessage();\n setCloseButton();\n setProgressBar();\n setRTL();\n setSequence();\n setAria();\n }\n\n function setAria() {\n var ariaValue = '';\n switch (map.iconClass) {\n case 'toast-success':\n case 'toast-info':\n ariaValue = 'polite';\n break;\n default:\n ariaValue = 'assertive';\n }\n $toastElement.attr('aria-live', ariaValue);\n }\n\n function handleEvents() {\n if (options.closeOnHover) {\n $toastElement.hover(stickAround, delayedHideToast);\n }\n\n if (!options.onclick && options.tapToDismiss) {\n $toastElement.click(hideToast);\n }\n\n if (options.closeButton && $closeElement) {\n $closeElement.click(function (event) {\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {\n event.cancelBubble = true;\n }\n\n if (options.onCloseClick) {\n options.onCloseClick(event);\n }\n\n hideToast(true);\n });\n }\n\n if (options.onclick) {\n $toastElement.click(function (event) {\n options.onclick(event);\n hideToast();\n });\n }\n }\n\n function displayToast() {\n $toastElement.hide();\n\n $toastElement[options.showMethod](\n {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}\n );\n\n if (options.timeOut > 0) {\n intervalId = setTimeout(hideToast, options.timeOut);\n progressBar.maxHideTime = parseFloat(options.timeOut);\n progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n if (options.progressBar) {\n progressBar.intervalId = setInterval(updateProgress, 10);\n }\n }\n }\n\n function setIcon() {\n if (map.iconClass) {\n $toastElement.addClass(options.toastClass).addClass(iconClass);\n }\n }\n\n function setSequence() {\n if (options.newestOnTop) {\n $container.prepend($toastElement);\n } else {\n $container.append($toastElement);\n }\n }\n\n function setTitle() {\n if (map.title) {\n var suffix = map.title;\n if (options.escapeHtml) {\n suffix = escapeHtml(map.title);\n }\n $titleElement.append(suffix).addClass(options.titleClass);\n $toastElement.append($titleElement);\n }\n }\n\n function setMessage() {\n if (map.message) {\n var suffix = map.message;\n if (options.escapeHtml) {\n suffix = escapeHtml(map.message);\n }\n $messageElement.append(suffix).addClass(options.messageClass);\n $toastElement.append($messageElement);\n }\n }\n\n function setCloseButton() {\n if (options.closeButton) {\n $closeElement.addClass(options.closeClass).attr('role', 'button');\n $toastElement.prepend($closeElement);\n }\n }\n\n function setProgressBar() {\n if (options.progressBar) {\n $progressElement.addClass(options.progressClass);\n $toastElement.prepend($progressElement);\n }\n }\n\n function setRTL() {\n if (options.rtl) {\n $toastElement.addClass('rtl');\n }\n }\n\n function shouldExit(options, map) {\n if (options.preventDuplicates) {\n if (map.message === previousToast) {\n return true;\n } else {\n previousToast = map.message;\n }\n }\n return false;\n }\n\n function hideToast(override) {\n var method = override && options.closeMethod !== false ? options.closeMethod : options.hideMethod;\n var duration = override && options.closeDuration !== false ?\n options.closeDuration : options.hideDuration;\n var easing = override && options.closeEasing !== false ? options.closeEasing : options.hideEasing;\n if ($(':focus', $toastElement).length && !override) {\n return;\n }\n clearTimeout(progressBar.intervalId);\n return $toastElement[method]({\n duration: duration,\n easing: easing,\n complete: function () {\n removeToast($toastElement);\n clearTimeout(intervalId);\n if (options.onHidden && response.state !== 'hidden') {\n options.onHidden();\n }\n response.state = 'hidden';\n response.endTime = new Date();\n publish(response);\n }\n });\n }\n\n function delayedHideToast() {\n if (options.timeOut > 0 || options.extendedTimeOut > 0) {\n intervalId = setTimeout(hideToast, options.extendedTimeOut);\n progressBar.maxHideTime = parseFloat(options.extendedTimeOut);\n progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;\n }\n }\n\n function stickAround() {\n clearTimeout(intervalId);\n progressBar.hideEta = 0;\n $toastElement.stop(true, true)[options.showMethod](\n {duration: options.showDuration, easing: options.showEasing}\n );\n }\n\n function updateProgress() {\n var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;\n $progressElement.width(percentage + '%');\n }\n }\n\n function getOptions() {\n return $.extend({}, getDefaults(), toastr.options);\n }\n\n function removeToast($toastElement) {\n if (!$container) { $container = getContainer(); }\n if ($toastElement.is(':visible')) {\n return;\n }\n $toastElement.remove();\n $toastElement = null;\n if ($container.children().length === 0) {\n $container.remove();\n previousToast = undefined;\n }\n }\n\n })();\n });\n}(typeof define === 'function' && define.amd ? define : function (deps, factory) {\n if (typeof module !== 'undefined' && module.exports) { //Node\n module.exports = factory(require('jquery'));\n } else {\n window.toastr = factory(window.jQuery);\n }\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/Resources/public/js/vendor/toastr.min.js b/Resources/public/js/vendor/toastr.min.js index ab9c66c1..4b5f34a0 100644 --- a/Resources/public/js/vendor/toastr.min.js +++ b/Resources/public/js/vendor/toastr.min.js @@ -1,2 +1,7 @@ -!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return f({type:O.error,iconClass:g().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=g()),v=e("#"+t.containerId),v.length?v:(n&&(v=c(t)),v)}function i(e,t,n){return f({type:O.info,iconClass:g().iconClasses.info,message:e,optionsOverride:n,title:t})}function o(e){w=e}function s(e,t,n){return f({type:O.success,iconClass:g().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return f({type:O.warning,iconClass:g().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e){var t=g();v||n(t),l(e,t)||u(t)}function d(t){var i=g();return v||n(i),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function u(t){for(var n=v.children(),i=n.length-1;i>=0;i--)l(e(n[i]),t)}function l(t,n){return t&&0===e(":focus",t).length?(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0):!1}function c(t){return v=e("
                ").attr("id",t.containerId).addClass(t.positionClass).attr("aria-live","polite").attr("role","alert"),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",target:"body",closeHtml:'',newestOnTop:!0,preventDuplicates:!1,progressBar:!1}}function m(e){w&&w(e)}function f(t){function i(t){return!e(":focus",l).length||t?(clearTimeout(O.intervalId),l[r.hideMethod]({duration:r.hideDuration,easing:r.hideEasing,complete:function(){h(l),r.onHidden&&"hidden"!==b.state&&r.onHidden(),b.state="hidden",b.endTime=new Date,m(b)}})):void 0}function o(){(r.timeOut>0||r.extendedTimeOut>0)&&(u=setTimeout(i,r.extendedTimeOut),O.maxHideTime=parseFloat(r.extendedTimeOut),O.hideEta=(new Date).getTime()+O.maxHideTime)}function s(){clearTimeout(u),O.hideEta=0,l.stop(!0,!0)[r.showMethod]({duration:r.showDuration,easing:r.showEasing})}function a(){var e=(O.hideEta-(new Date).getTime())/O.maxHideTime*100;f.width(e+"%")}var r=g(),d=t.iconClass||r.iconClass;if("undefined"!=typeof t.optionsOverride&&(r=e.extend(r,t.optionsOverride),d=t.optionsOverride.iconClass||d),r.preventDuplicates){if(t.message===C)return;C=t.message}T++,v=n(r,!0);var u=null,l=e("
                "),c=e("
                "),p=e("
                "),f=e("
                "),w=e(r.closeHtml),O={intervalId:null,hideEta:null,maxHideTime:null},b={toastId:T,state:"visible",startTime:new Date,options:r,map:t};return t.iconClass&&l.addClass(r.toastClass).addClass(d),t.title&&(c.append(t.title).addClass(r.titleClass),l.append(c)),t.message&&(p.append(t.message).addClass(r.messageClass),l.append(p)),r.closeButton&&(w.addClass("toast-close-button").attr("role","button"),l.prepend(w)),r.progressBar&&(f.addClass("toast-progress"),l.prepend(f)),l.hide(),r.newestOnTop?v.prepend(l):v.append(l),l[r.showMethod]({duration:r.showDuration,easing:r.showEasing,complete:r.onShown}),r.timeOut>0&&(u=setTimeout(i,r.timeOut),O.maxHideTime=parseFloat(r.timeOut),O.hideEta=(new Date).getTime()+O.maxHideTime,r.progressBar&&(O.intervalId=setInterval(a,10))),l.hover(s,o),!r.onclick&&r.tapToDismiss&&l.click(i),r.closeButton&&w&&w.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),i(!0)}),r.onclick&&l.click(function(){r.onclick(),i()}),m(b),r.debug&&console&&console.log(b),l}function g(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),C=void 0))}var v,w,C,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:d,error:t,getContainer:n,info:i,options:{},subscribe:o,success:s,version:"2.1.0",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}); +/* + * Note that this is toastr v2.1.3, the "latest" version in url has no more maintenance, + * please go to https://cdnjs.com/libraries/toastr.js and pick a certain version you want to use, + * make sure you copy the url from the website since the url may change between versions. + * */ +!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o),u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("
                ").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("
                "),M=e("
                "),B=e("
                "),q=e("
                "),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.3",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)}); //# sourceMappingURL=toastr.js.map diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ar.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ar.vtt new file mode 100644 index 00000000..a68a4426 --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ar.vtt @@ -0,0 +1,330 @@ +WEBVTT + +1 +00:00:15.042 --> 00:00:18.625 +...إلى... إلى الشمال يمكن أن نرى +...يمكن أن نرى الـ + +2 +00:00:18.750 --> 00:00:20.958 +...إلى اليمين يمكن أن نرى الـ + +3 +00:00:21.000 --> 00:00:23.125 +طاحنات الرؤوس... + +4 +00:00:23.208 --> 00:00:25.208 +كل شيئ آمن +آمن كلية + +5 +00:00:26.333 --> 00:00:28.333 +إيمو ؟ + +6 +00:00:28.875 --> 00:00:30.958 +! حذاري + +7 +00:00:47.125 --> 00:00:49.167 +هل أصبت ؟ + +8 +00:00:52.125 --> 00:00:54.833 +...لا أظن ذلك +وأنت ؟ + +9 +00:00:55.625 --> 00:00:57.625 +أنا بخير + +10 +00:00:57.667 --> 00:01:01.667 +،قم يا إيمو +المكان هنا غير آمن + +11 +00:01:02.208 --> 00:01:04.083 +لنذهب + +12 +00:01:04.167 --> 00:01:06.167 +وماذا بعد ؟ + +13 +00:01:06.167 --> 00:01:08.583 +...سترى... سترى + +14 +00:01:16.167 --> 00:01:18.375 +إيمو، من هنا + +15 +00:01:34.958 --> 00:01:37.000 +! إتبعني + +16 +00:02:11.125 --> 00:02:13.625 +! أسرع يا إيمو + +17 +00:02:48.375 --> 00:02:50.375 +! لست منتبها + +18 +00:02:50.750 --> 00:02:54.500 +...أريد فقط أن أجيب الـ +الهاتف... + +19 +00:02:55.000 --> 00:02:58.500 +،إيمو، أنظر +أقصد أنصت + +20 +00:02:59.750 --> 00:03:03.292 +عليك أن تتعلم الإصغاء + +21 +00:03:03.625 --> 00:03:05.917 +هذا ليس ضربا من اللهو + +22 +00:03:06.083 --> 00:03:09.958 +...إنك +أقصد إننا قد نموت بسهولة في هذا المكان + +23 +00:03:10.208 --> 00:03:14.125 +...أنصت +أنصت إلى أصوات الآلة + +24 +00:03:18.333 --> 00:03:20.417 +أنصت إلى نَفَسِك + +25 +00:04:27.208 --> 00:04:29.250 +ألا تمل أبدا من هذا ؟ + +26 +00:04:29.583 --> 00:04:31.583 +أمل ؟!؟ +نعم - + +27 +00:04:31.750 --> 00:04:34.667 +إيمو؛ الآلة في دقتها... مثل الساعة + +28 +00:04:35.500 --> 00:04:37.708 +...حركة ناشزة واحدة قد + +29 +00:04:37.833 --> 00:04:39.875 +تطرحك معجونا + +30 +00:04:41.042 --> 00:04:43.083 +...أو ليست + +31 +00:04:43.125 --> 00:04:46.542 +! عجينة يا إيمو +أ هذا ما تريد ؟ أن تصبح عجينة ؟ + +32 +00:04:48.083 --> 00:04:50.083 +أيمو، أ هذا هدفك في الحياة ؟ + +33 +00:04:50.583 --> 00:04:52.667 +أن تصير عجينة ؟ + +34 +00:05:41.833 --> 00:05:43.875 +إيمو، أغمض عينيك + +35 +00:05:44.917 --> 00:05:47.000 +لماذا ؟ +! الآن - + +36 +00:05:53.750 --> 00:05:56.042 +حسن + +37 +00:05:59.542 --> 00:06:02.792 +ماذا ترى إلى شمالك يا إيمو ؟ + +38 +00:06:04.417 --> 00:06:06.500 +لا شيئ +حقا ؟ - + +39 +00:06:06.542 --> 00:06:08.625 +لا، لا شيئ البتة + +40 +00:06:08.625 --> 00:06:12.417 +وماذا ترى إلى جهتك اليمنى يا إيمو ؟ + +41 +00:06:13.667 --> 00:06:17.833 +،نفس الشيئ يا بروغ +! نفس الشيئ بالضبط؛ لا شيئ + +42 +00:06:17.875 --> 00:06:19.917 +عظيم + +43 +00:06:40.625 --> 00:06:42.958 +أنصت يا بروغ ! هل تسمع ذلك ؟ + +44 +00:06:43.625 --> 00:06:45.625 +هل نستطيع الذهاب إلى هناك ؟ + +45 +00:06:45.708 --> 00:06:47.792 +هناك ؟ +نعم - + +46 +00:06:47.833 --> 00:06:49.833 +إنه غير آمن يا إيمو + +47 +00:06:49.917 --> 00:06:52.500 +صدقني، إنه غير آمن + +48 +00:06:53.292 --> 00:06:55.375 +...لكن لعلي أستطيع + +49 +00:06:55.417 --> 00:06:57.417 +...لكن +! لا - + +50 +00:06:57.667 --> 00:06:59.667 +! لا + +51 +00:07:00.875 --> 00:07:03.750 +هل من أسئلة أخرى يا إيمو ؟ + +52 +00:07:04.250 --> 00:07:06.333 +لا + +53 +00:07:09.458 --> 00:07:11.542 +...إيمو +نعم - + +54 +00:07:11.875 --> 00:07:13.958 +...لماذا يا إيمو... لماذا + +55 +00:07:15.292 --> 00:07:18.792 +لماذا لا تستطيع أن ترى حُسْن هذا المكان + +56 +00:07:18.833 --> 00:07:20.833 +...والطريقة التي يعمل بها + +57 +00:07:20.875 --> 00:07:24.000 +وكيف... وكيف أنه غاية في الكمال + +58 +00:07:24.083 --> 00:07:27.417 +! لا يا بروغ، لا أرى ذلك + +59 +00:07:27.542 --> 00:07:30.333 +لا أرى ذلك لأنه لا يوجد شيئ هناك + +60 +00:07:31.500 --> 00:07:35.333 +ثم لماذا يجب علي أن أسلم حياتي +لشيئ لا وجود له ؟ + +61 +00:07:35.583 --> 00:07:37.625 +هل يمكنك أن تخبرني ؟ + +62 +00:07:37.708 --> 00:07:39.750 +! أجبني + +63 +00:07:43.208 --> 00:07:47.333 +...بروغ +! أنت معتوه يا هذا + +64 +00:07:47.375 --> 00:07:49.417 +! إبعد عني + +65 +00:07:52.583 --> 00:07:55.083 +! لا يا إيمو ! إنه فخ + +66 +00:07:55.833 --> 00:07:57.875 +...إنه فخ + +67 +00:07:57.917 --> 00:08:01.750 +إلى جنبك الأيسر يمكنك أن ترى +حدائق بابل المعلقة + +68 +00:08:02.250 --> 00:08:04.292 +هل تعجبك كفخ ؟ + +69 +00:08:05.458 --> 00:08:07.542 +لا يا أيمو + +70 +00:08:09.417 --> 00:08:12.792 +...إلى جنبك الأيمن يمكنك رؤية +حزر ماذا ؟ + +71 +00:08:13.000 --> 00:08:15.042 +! عملاق رودس + +72 +00:08:15.125 --> 00:08:16.417 +! لا + +73 +00:08:16.458 --> 00:08:20.500 +،عملاق رودس +وهو هنا خصيصا من أجلك يا بروغ + +74 +00:08:20.583 --> 00:08:22.583 +فقط من أجلك + +75 +00:08:51.333 --> 00:08:53.375 +إنه هناك + +76 +00:08:53.417 --> 00:08:55.500 +أنا أؤكد لك... إيمو + +77 +00:08:57.333 --> 00:09:00.000 +...إنه diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.en.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.en.vtt new file mode 100644 index 00000000..8b83d28c --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.en.vtt @@ -0,0 +1,334 @@ +WEBVTT + +1 +00:00:15.000 --> 00:00:17.951 +At the left we can see... + +2 +00:00:18.166 --> 00:00:20.083 +At the right we can see the... + +3 +00:00:20.119 --> 00:00:21.962 +...the head-snarlers + +4 +00:00:21.999 --> 00:00:24.368 +Everything is safe. +Perfectly safe. + +5 +00:00:24.582 --> 00:00:27.035 +Emo? + +6 +00:00:28.206 --> 00:00:29.996 +Watch out! + +7 +00:00:47.037 --> 00:00:48.494 +Are you hurt? + +8 +00:00:51.994 --> 00:00:53.949 +I don't think so. +You? + +9 +00:00:55.160 --> 00:00:56.985 +I'm Ok. + +10 +00:00:57.118 --> 00:01:01.111 +Get up. +Emo. it's not safe here. + +11 +00:01:02.034 --> 00:01:03.573 +Let's go. + +12 +00:01:03.610 --> 00:01:05.114 +What's next? + +13 +00:01:05.200 --> 00:01:09.146 +You'll see! + +14 +00:01:16.032 --> 00:01:18.022 +Emo. +This way. + +15 +00:01:34.237 --> 00:01:35.481 +Follow me! + +16 +00:02:11.106 --> 00:02:12.480 +Hurry Emo! + +17 +00:02:48.059 --> 00:02:49.930 +You're not paying attention! + +18 +00:02:50.142 --> 00:02:54.052 +I just want to answer the... +...phone. + +19 +00:02:54.974 --> 00:02:57.972 +Emo. look. +I mean listen. + +20 +00:02:59.140 --> 00:03:02.008 +You have to learn to listen. + +21 +00:03:03.140 --> 00:03:04.965 +This is not some game. + +22 +00:03:05.056 --> 00:03:09.345 +You. I mean we. +we could easily die out here. + +23 +00:03:10.014 --> 00:03:13.959 +Listen. +listen to the sounds of the machine. + +24 +00:03:18.054 --> 00:03:20.009 +Listen to your breathing. + +25 +00:04:27.001 --> 00:04:28.956 +Well. don't you ever get tired of this? + +26 +00:04:29.084 --> 00:04:30.909 +Tired?!? + +27 +00:04:31.126 --> 00:04:34.491 +Emo. the machine is like clockwork. + +28 +00:04:35.083 --> 00:04:37.074 +One move out of place... + +29 +00:04:37.166 --> 00:04:39.121 +...and you're ground to a pulp. + +30 +00:04:40.958 --> 00:04:42.004 +But isn't it - + +31 +00:04:42.041 --> 00:04:46.034 +Pulp. Emo! +Is that what you want. pulp? + +32 +00:04:47.040 --> 00:04:48.995 +Emo. your goal in life... + +33 +00:04:50.081 --> 00:04:51.953 +...pulp? + +34 +00:05:41.156 --> 00:05:43.028 +Emo. close your eyes. + +35 +00:05:44.156 --> 00:05:46.027 +Why? +- Now! + +36 +00:05:51.155 --> 00:05:52.102 +Ok. + +37 +00:05:53.113 --> 00:05:54.688 +Good. + +38 +00:05:59.070 --> 00:06:02.103 +What do you see at your left side. Emo? + +39 +00:06:04.028 --> 00:06:05.899 +Nothing. +- Really? + +40 +00:06:06.027 --> 00:06:07.105 +No. nothing at all. + +41 +00:06:07.944 --> 00:06:11.984 +And at your right. +what do you see at your right side. Emo? + +42 +00:06:13.151 --> 00:06:16.102 +The same Proog. exactly the same... + +43 +00:06:16.942 --> 00:06:19.098 +...nothing! +- Great. + +44 +00:06:40.105 --> 00:06:42.724 +Listen Proog! Do you hear that! + +45 +00:06:43.105 --> 00:06:44.894 +Can we go here? + +46 +00:06:44.979 --> 00:06:47.894 +There? +It isn't safe. Emo. + +47 +00:06:49.145 --> 00:06:52.013 +But... +- Trust me. it's not. + +48 +00:06:53.020 --> 00:06:54.145 +Maybe I could... + +49 +00:06:54.181 --> 00:06:55.969 +No. + +50 +00:06:57.102 --> 00:06:59.934 +NO! + +51 +00:07:00.144 --> 00:07:03.058 +Any further questions. Emo? + +52 +00:07:03.976 --> 00:07:05.090 +No. + +53 +00:07:09.059 --> 00:07:10.089 +Emo? + +54 +00:07:11.142 --> 00:07:13.058 +Emo. why... + +55 +00:07:13.095 --> 00:07:14.022 +Emo... + +56 +00:07:14.058 --> 00:07:18.003 +...why can't you see +the beauty of this place? + +57 +00:07:18.141 --> 00:07:20.048 +The way it works. + +58 +00:07:20.140 --> 00:07:23.895 +How perfect it is. + +59 +00:07:23.932 --> 00:07:26.964 +No. Proog. I don't see. + +60 +00:07:27.056 --> 00:07:29.970 +I don't see because there's nothing there. + +61 +00:07:31.055 --> 00:07:34.965 +And why should I trust my +life to something that isn't there? + +62 +00:07:35.055 --> 00:07:36.926 +Well can you tell me that? + +63 +00:07:37.054 --> 00:07:38.926 +Answer me! + +64 +00:07:42.970 --> 00:07:44.000 +Proog... + +65 +00:07:45.053 --> 00:07:46.985 +...you're a sick man! + +66 +00:07:47.022 --> 00:07:48.918 +Stay away from me! + +67 +00:07:52.052 --> 00:07:54.884 +No! Emo! It's a trap! + +68 +00:07:55.135 --> 00:07:56.931 +Hah. it's a trap. + +69 +00:07:56.968 --> 00:08:01.043 +At the left side you can see +the hanging gardens of Babylon! + +70 +00:08:01.967 --> 00:08:03.957 +How's that for a trap? + +71 +00:08:05.050 --> 00:08:06.922 +No. Emo. + +72 +00:08:09.008 --> 00:08:12.088 +At the right side you can see... +...well guess what... + +73 +00:08:12.924 --> 00:08:14.665 +...the colossus of Rhodes! + +74 +00:08:15.132 --> 00:08:16.053 +No! + +75 +00:08:16.090 --> 00:08:21.919 +The colossus of Rhodes +and it is here just for you Proog. + +76 +00:08:51.001 --> 00:08:52.923 +It is there... + +77 +00:08:52.959 --> 00:08:56.040 +I'm telling you. +Emo... + +78 +00:08:57.000 --> 00:08:59.867 +...it is. \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ja.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ja.vtt new file mode 100644 index 00000000..4058648e --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ja.vtt @@ -0,0 +1,326 @@ +WEBVTT + +1 +00:00:15.042 --> 00:00:18.042 +左に見えるのは… + +2 +00:00:18.750 --> 00:00:20.333 +右に見えるのは… + +3 +00:00:20.417 --> 00:00:21.917 +…首刈り機 + +4 +00:00:22.000 --> 00:00:24.625 +すべて安全 +完璧に安全だ + +5 +00:00:26.333 --> 00:00:27.333 +イーモ? + +6 +00:00:28.875 --> 00:00:30.250 +危ない! + +7 +00:00:47.125 --> 00:00:48.250 +ケガはないか? + +8 +00:00:51.917 --> 00:00:53.917 +ええ、多分… +あなたは? + +9 +00:00:55.625 --> 00:00:57.125 +わしは平気だ + +10 +00:00:57.583 --> 00:01:01.667 +起きてくれイーモ +ここは危ない + +11 +00:01:02.208 --> 00:01:03.667 +行こう + +12 +00:01:03.750 --> 00:01:04.917 +どこに? + +13 +00:01:05.875 --> 00:01:07.875 +すぐにわかるさ! + +14 +00:01:16.167 --> 00:01:18.375 +イーモ、こっちだ + +15 +00:01:34.958 --> 00:01:36.958 +ついて来るんだ! + +16 +00:02:11.583 --> 00:02:12.792 +イーモ、早く! + +17 +00:02:48.375 --> 00:02:50.083 +むやみにさわるな! + +18 +00:02:50.750 --> 00:02:54.500 +僕はただ、電話に +…出ようと + +19 +00:02:55.000 --> 00:02:58.208 +イーモ、見るんだ… +いや、聞いてくれ + +20 +00:02:59.750 --> 00:03:02.292 +君は「聞き方」を知る必要がある + +21 +00:03:03.625 --> 00:03:05.125 +これは遊びじゃない + +22 +00:03:06.167 --> 00:03:10.417 +我々はここでは +たやすく死ぬ + +23 +00:03:11.208 --> 00:03:14.125 +機械の声を聞くんだ + +24 +00:03:18.333 --> 00:03:22.417 +君の息づかいを聞くんだ + +25 +00:04:27.208 --> 00:04:29.250 +そんなことして疲れない? + +26 +00:04:29.583 --> 00:04:31.083 +疲れる?! + +27 +00:04:31.750 --> 00:04:34.667 +この機械は非常に正確で + +28 +00:04:35.500 --> 00:04:37.708 +一つ間違えば… + +29 +00:04:37.833 --> 00:04:40.792 +…地面に落ちてバラバラだ + +30 +00:04:41.042 --> 00:04:42.375 +え、でも― + +31 +00:04:42.417 --> 00:04:46.542 +バラバラだぞ、イーモ! +それでいいのか? + +32 +00:04:48.083 --> 00:04:50.000 +バラバラで死ぬんだぞ? + +33 +00:04:50.583 --> 00:04:52.250 +バラバラだ! + +34 +00:05:41.833 --> 00:05:43.458 +イーモ、目を閉じるんだ + +35 +00:05:44.917 --> 00:05:46.583 +なぜ? +―早く! + +36 +00:05:53.750 --> 00:05:56.042 +それでいい + +37 +00:05:59.542 --> 00:06:03.792 +左に見えるものは何だ、イーモ? + +38 +00:06:04.417 --> 00:06:06.000 +え…何も +―本当か? + +39 +00:06:06.333 --> 00:06:07.917 +全く何も + +40 +00:06:08.042 --> 00:06:12.833 +では右は +何か見えるか、イーモ? + +41 +00:06:13.875 --> 00:06:16.917 +同じだよプルーグ、全く同じ… + +42 +00:06:17.083 --> 00:06:18.583 +何もない! + +43 +00:06:40.625 --> 00:06:43.208 +プルーグ!何か聞こえない? + +44 +00:06:43.625 --> 00:06:45.042 +あそこに行かないか? + +45 +00:06:45.208 --> 00:06:48.042 +あそこ? +…安全じゃない + +46 +00:06:49.917 --> 00:06:52.500 +でも… +―本当に危ないぞ + +47 +00:06:53.292 --> 00:06:54.792 +大丈夫だよ… + +48 +00:06:54.833 --> 00:06:56.333 +だめだ + +49 +00:06:57.667 --> 00:07:00.167 +だめだ! + +50 +00:07:00.875 --> 00:07:03.750 +まだ続ける気か、イーモ? + +51 +00:07:04.250 --> 00:07:05.917 +いいえ… + +52 +00:07:09.458 --> 00:07:10.833 +イーモ? + +53 +00:07:11.875 --> 00:07:13.542 +イーモ、なぜ… + +54 +00:07:13.583 --> 00:07:14.458 +イーモ… + +55 +00:07:14.500 --> 00:07:18.500 +…なぜここの美しさが +見えない? + +56 +00:07:18.833 --> 00:07:20.750 +仕組みがこんなに… + +57 +00:07:20.875 --> 00:07:24.000 +こんなに完全なのに + +58 +00:07:24.083 --> 00:07:27.417 +もういいよ!プルーグ! + +59 +00:07:27.542 --> 00:07:30.333 +そこには何もないんだから + +60 +00:07:31.500 --> 00:07:35.333 +なぜ命を「ない」物に +ゆだねなきゃ? + +61 +00:07:35.583 --> 00:07:37.125 +教えてくれないか? + +62 +00:07:37.500 --> 00:07:39.167 +さあ! + +63 +00:07:43.208 --> 00:07:44.583 +プルーグ… + +64 +00:07:45.500 --> 00:07:47.333 +あなたは病気なんだ + +65 +00:07:47.375 --> 00:07:49.208 +僕から離れてくれ + +66 +00:07:52.583 --> 00:07:55.083 +いかん!イーモ!ワナだ! + +67 +00:07:55.833 --> 00:07:57.167 +ワナだ? ふーん + +68 +00:07:57.208 --> 00:08:01.750 +左に何が見える? +バビロンの空中庭園! + +69 +00:08:02.250 --> 00:08:04.292 +これがワナとでも? + +70 +00:08:05.458 --> 00:08:07.125 +だめだ、イーモ + +71 +00:08:09.417 --> 00:08:12.792 +右にあるのは… +…すごい!… + +72 +00:08:13.000 --> 00:08:14.750 +…ロードス島の巨像だ! + +73 +00:08:15.833 --> 00:08:16.708 +やめろ! + +74 +00:08:16.750 --> 00:08:22.167 +この巨像はあなたの物 +プルーグ、あなたのだよ + +75 +00:08:51.333 --> 00:08:53.167 +いってるじゃないか… + +76 +00:08:53.208 --> 00:08:55.500 +そこにあるって、イーモ… + +77 +00:08:57.333 --> 00:09:00.000 +…あるって \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ru.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ru.vtt new file mode 100644 index 00000000..aee7e49f --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.ru.vtt @@ -0,0 +1,356 @@ +WEBVTT + +1 +00:00:14.958 --> 00:00:17.833 +Слева мы видим... + +2 +00:00:18.458 --> 00:00:20.208 +справа мы видим... + +3 +00:00:20.333 --> 00:00:21.875 +...голово-клацов. + +4 +00:00:22.000 --> 00:00:24.583 +всё в порядке. +в полном порядке. + +5 +00:00:26.333 --> 00:00:27.333 +Имо? + +6 +00:00:28.833 --> 00:00:30.250 +Осторожно! + +7 +00:00:47.125 --> 00:00:48.250 +Ты не ранен? + +8 +00:00:51.875 --> 00:00:53.875 +Вроде нет... +а ты? + +9 +00:00:55.583 --> 00:00:57.125 +Я в порядке. + +10 +00:00:57.542 --> 00:01:01.625 +Вставай. +Имо. здесь не безопасно. + +11 +00:01:02.208 --> 00:01:03.625 +Пойдём. + +12 +00:01:03.708 --> 00:01:05.708 +Что дальше? + +13 +00:01:05.833 --> 00:01:07.833 +Ты увидишь! + +14 +00:01:08.000 --> 00:01:08.833 +Ты увидишь... + +15 +00:01:16.167 --> 00:01:18.375 +Имо. сюда. + +16 +00:01:34.917 --> 00:01:35.750 +За мной! + +17 +00:02:11.542 --> 00:02:12.750 +Имо. быстрее! + +18 +00:02:48.375 --> 00:02:50.083 +Ты не обращаешь внимания! + +19 +00:02:50.708 --> 00:02:54.500 +Я только хотел ответить на ... +...звонок. + +20 +00:02:55.000 --> 00:02:58.208 +Имо. смотри. +то есть слушай... + +21 +00:02:59.708 --> 00:03:02.292 +Ты должен учиться слушать. + +22 +00:03:03.250 --> 00:03:05.333 +Это не какая-нибудь игра. + +23 +00:03:06.000 --> 00:03:08.833 +Ты. вернее мы. легко можем погибнуть здесь. + +24 +00:03:10.000 --> 00:03:11.167 +Слушай... + +25 +00:03:11.667 --> 00:03:14.125 +слушай звуки машины. + +26 +00:03:18.333 --> 00:03:20.417 +Слушай своё дыхание. + +27 +00:04:27.208 --> 00:04:29.250 +И не надоест тебе это? + +28 +00:04:29.542 --> 00:04:31.083 +Надоест?!? + +29 +00:04:31.708 --> 00:04:34.625 +Имо! Машина - +она как часовой механизм. + +30 +00:04:35.500 --> 00:04:37.667 +Одно движение не туда... + +31 +00:04:37.792 --> 00:04:39.750 +...и тебя размелют в месиво! + +32 +00:04:41.042 --> 00:04:42.375 +А разве это не - + +33 +00:04:42.417 --> 00:04:46.500 +Месиво. Имо! +ты этого хочешь? месиво? + +34 +00:04:48.083 --> 00:04:50.000 +Имо. твоя цель в жизни? + +35 +00:04:50.542 --> 00:04:52.250 +Месиво! + +36 +00:05:41.792 --> 00:05:43.458 +Имо. закрой глаза. + +37 +00:05:44.875 --> 00:05:46.542 +Зачем? +- Ну же! + +38 +00:05:51.500 --> 00:05:52.333 +Ладно. + +39 +00:05:53.708 --> 00:05:56.042 +Хорошо. + +40 +00:05:59.500 --> 00:06:02.750 +Что ты видишь слева от себя. Имо? + +41 +00:06:04.417 --> 00:06:06.000 +Ничего. +- Точно? + +42 +00:06:06.333 --> 00:06:07.875 +да. совсем ничего. + +43 +00:06:08.042 --> 00:06:12.708 +А справа от себя. +что ты видишь справа от себя. Имо? + +44 +00:06:13.833 --> 00:06:16.875 +Да то же Пруг. в точности то же... + +45 +00:06:17.042 --> 00:06:18.500 +Ничего! + +46 +00:06:18.667 --> 00:06:19.500 +Прекрасно... + +47 +00:06:40.583 --> 00:06:42.917 +Прислушайся. Пруг! Ты слышишь это? + +48 +00:06:43.583 --> 00:06:45.042 +Может. мы пойдём туда? + +49 +00:06:45.208 --> 00:06:48.042 +Туда? +Это не безопасно. Имо. + +50 +00:06:49.875 --> 00:06:52.500 +Но... +- Поверь мне. это так. + +51 +00:06:53.292 --> 00:06:54.750 +Может я бы ... + +52 +00:06:54.792 --> 00:06:56.333 +Нет. + +53 +00:06:57.625 --> 00:06:59.583 +- Но... +- НЕТ! + +54 +00:06:59.708 --> 00:07:00.833 +Нет! + +55 +00:07:00.833 --> 00:07:03.708 +Ещё вопросы. Имо? + +56 +00:07:04.250 --> 00:07:05.875 +Нет. + +57 +00:07:09.458 --> 00:07:10.792 +Имо? + +58 +00:07:11.833 --> 00:07:13.500 +Имо. почему... + +59 +00:07:13.542 --> 00:07:14.458 +Имо... + +60 +00:07:14.500 --> 00:07:18.500 +...почему? почему ты не видишь +красоты этого места? + +61 +00:07:18.792 --> 00:07:20.708 +То как оно работает. + +62 +00:07:20.833 --> 00:07:24.000 +Как совершенно оно. + +63 +00:07:24.083 --> 00:07:27.417 +Нет. Пруг. я не вижу. + +64 +00:07:27.500 --> 00:07:30.333 +Я не вижу. потому что здесь ничего нет. + +65 +00:07:31.375 --> 00:07:35.333 +И почему я должен доверять свою жизнь +чему-то. чего здесь нет? + +66 +00:07:35.542 --> 00:07:37.125 +это ты мне можешь сказать? + +67 +00:07:37.500 --> 00:07:39.167 +Ответь мне! + +68 +00:07:43.208 --> 00:07:44.542 +Пруг... + +69 +00:07:45.500 --> 00:07:47.333 +Ты просто больной! + +70 +00:07:47.375 --> 00:07:48.500 +Отстань от меня. + +71 +00:07:48.625 --> 00:07:49.917 +Имо... + +72 +00:07:52.542 --> 00:07:55.083 +Нет! Имо! Это ловушка! + +73 +00:07:55.792 --> 00:07:57.167 +Это ловушка! + +74 +00:07:57.208 --> 00:08:01.708 +Слева от себя вы можете увидеть +Висящие сады Семирамиды! + +75 +00:08:02.250 --> 00:08:04.292 +Сойдёт за ловушку? + +76 +00:08:05.458 --> 00:08:07.125 +Нет. Имо. + +77 +00:08:09.417 --> 00:08:12.750 +Справа от себя вы можете увидеть... +...угадай кого... + +78 +00:08:13.000 --> 00:08:14.708 +...Колосса Родосского! + +79 +00:08:15.500 --> 00:08:16.625 +Нет! + +80 +00:08:16.667 --> 00:08:21.125 +Колосс Родосский! +И он здесь специально для тебя. Пруг. + +81 +00:08:21.167 --> 00:08:22.208 +Специально для тебя... + +82 +00:08:51.333 --> 00:08:53.167 +Она здесь есть! + +83 +00:08:53.208 --> 00:08:55.500 +Говорю тебе. +Имо... + +84 +00:08:57.333 --> 00:09:00.000 +...она есть... есть... \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.sv.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.sv.vtt new file mode 100644 index 00000000..6666eedf --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/captions.sv.vtt @@ -0,0 +1,349 @@ +WEBVTT + +1 +00:00:15.042 --> 00:00:18.250 +Till vänster kan vi se... +Ser vi... + +2 +00:00:18.708 --> 00:00:20.333 +Till höger ser vi... + +3 +00:00:20.417 --> 00:00:21.958 +...huvudkaparna. + +4 +00:00:22.000 --> 00:00:24.792 +Allt är säkert. +alldeles ofarligt. + +5 +00:00:24.917 --> 00:00:26.833 +Emo? + +6 +00:00:28.750 --> 00:00:30.167 +Se upp! + +7 +00:00:46.708 --> 00:00:48.750 +Är du skadad? + +8 +00:00:51.875 --> 00:00:54.458 +Jag tror inte det... +Är du? + +9 +00:00:55.292 --> 00:00:57.333 +Jag är ok. + +10 +00:00:57.542 --> 00:01:01.625 +Res dig upp Emo. +Det är inte säkert här. + +11 +00:01:02.208 --> 00:01:03.625 +Kom så går vi. + +12 +00:01:03.708 --> 00:01:05.708 +Vad nu då? + +13 +00:01:05.833 --> 00:01:07.833 +Du får se... + +14 +00:01:08.042 --> 00:01:10.417 +Du får se. + +15 +00:01:15.958 --> 00:01:18.375 +Emo. den här vägen. + +16 +00:01:34.417 --> 00:01:36.750 +Följ efter mig! + +17 +00:02:11.250 --> 00:02:13.250 +Skynda dig. Emo! + +18 +00:02:48.375 --> 00:02:50.583 +Du är inte uppmärksam! + +19 +00:02:50.708 --> 00:02:54.500 +Jag vill bara svara... +... i telefonen. + +20 +00:02:54.500 --> 00:02:58.208 +Emo. se här... +Lyssna menar jag. + +21 +00:02:59.708 --> 00:03:02.292 +Du måste lära dig att lyssna. + +22 +00:03:03.292 --> 00:03:05.208 +Det här är ingen lek. + +23 +00:03:05.250 --> 00:03:08.917 +Du... Jag menar vi. +vi skulle kunna dö här ute. + +24 +00:03:09.917 --> 00:03:11.417 +Lyssna... + +25 +00:03:11.708 --> 00:03:14.833 +Lyssna på ljuden från maskinen. + +26 +00:03:18.125 --> 00:03:21.417 +Lyssna på dina andetag. + +27 +00:04:26.625 --> 00:04:29.250 +Tröttnar du aldrig på det här? + +28 +00:04:29.542 --> 00:04:31.083 +Tröttnar!? + +29 +00:04:31.208 --> 00:04:33.458 +Emo. maskinen är som... + +30 +00:04:33.458 --> 00:04:35.333 +Som ett urverk. + +31 +00:04:35.417 --> 00:04:37.167 +Ett felsteg... + +32 +00:04:37.208 --> 00:04:39.750 +...och du blir krossad. + +33 +00:04:41.042 --> 00:04:42.292 +Men är det inte - + +34 +00:04:42.292 --> 00:04:47.000 +Krossad. Emo! +Är det vad du vill bli? Krossad till mos? + +35 +00:04:47.500 --> 00:04:50.542 +Emo. är det ditt mål i livet? + +36 +00:04:50.667 --> 00:04:53.250 +Att bli mos!? + +37 +00:05:41.375 --> 00:05:43.458 +Emo. blunda. + +38 +00:05:44.375 --> 00:05:46.542 +Varför då? +- Blunda! + +39 +00:05:51.292 --> 00:05:55.042 +Ok. +- Bra. + +40 +00:05:59.500 --> 00:06:02.750 +Vad ser du till vänster om dig Emo? + +41 +00:06:04.125 --> 00:06:06.292 +Ingenting. +- Säker? + +42 +00:06:06.333 --> 00:06:07.958 +Ingenting alls. + +43 +00:06:08.042 --> 00:06:12.625 +Jaså. och till höger om dig... +Vad ser du där. Emo? + +44 +00:06:13.750 --> 00:06:15.583 +Samma där Proog... + +45 +00:06:15.583 --> 00:06:18.083 +Exakt samma där. ingenting! + +46 +00:06:18.083 --> 00:06:19.667 +Perfekt. + +47 +00:06:40.500 --> 00:06:42.917 +Lyssna Proog! Hör du? + +48 +00:06:43.500 --> 00:06:45.125 +Kan vi gå dit? + +49 +00:06:45.208 --> 00:06:48.125 +Gå dit? +Det är inte tryggt. + +50 +00:06:49.583 --> 00:06:52.583 +Men. men... +- Tro mig. det inte säkert. + +51 +00:06:53.000 --> 00:06:54.292 +Men kanske om jag - + +52 +00:06:54.292 --> 00:06:56.333 +Nej. + +53 +00:06:57.208 --> 00:07:00.167 +Men - +- Nej. NEJ! + +54 +00:07:00.917 --> 00:07:03.792 +Några fler frågor Emo? + +55 +00:07:04.250 --> 00:07:05.875 +Nej. + +56 +00:07:09.542 --> 00:07:11.375 +Emo? +- Ja? + +57 +00:07:11.542 --> 00:07:15.667 +Emo. varför... + +58 +00:07:15.792 --> 00:07:18.583 +Varför kan du inte se skönheten i det här? + +59 +00:07:18.792 --> 00:07:21.708 +Hur det fungerar. + +60 +00:07:21.833 --> 00:07:24.000 +Hur perfekt det är. + +61 +00:07:24.083 --> 00:07:27.333 +Nej Proog. jag kan inte se det. + +62 +00:07:27.333 --> 00:07:30.333 +Jag ser det inte. för det finns inget där. + +63 +00:07:31.292 --> 00:07:35.333 +Och varför skulle jag lägga mitt liv +i händerna på något som inte finns? + +64 +00:07:35.333 --> 00:07:37.083 +Kan du berätta det för mig? +- Emo... + +65 +00:07:37.083 --> 00:07:39.167 +Svara mig! + +66 +00:07:43.500 --> 00:07:45.208 +Proog... + +67 +00:07:45.208 --> 00:07:47.083 +Du är inte frisk! + +68 +00:07:47.167 --> 00:07:49.292 +Håll dig borta från mig! + +69 +00:07:52.292 --> 00:07:55.083 +Nej! Emo! +Det är en fälla! + +70 +00:07:55.375 --> 00:07:57.208 +Heh. det är en fälla. + +71 +00:07:57.208 --> 00:08:01.708 +På vänster sida ser vi... +Babylons hängande trädgårdar! + +72 +00:08:01.958 --> 00:08:04.000 +Vad sägs om den fällan? + +73 +00:08:05.458 --> 00:08:07.333 +Nej. Emo. + +74 +00:08:08.917 --> 00:08:12.667 +Till höger ser vi... +Gissa! + +75 +00:08:12.750 --> 00:08:15.125 +Rhodos koloss! + +76 +00:08:15.375 --> 00:08:16.500 +Nej! + +77 +00:08:16.500 --> 00:08:20.250 +Kolossen på Rhodos! +Och den är här för din skull. Proog... + +78 +00:08:20.250 --> 00:08:23.250 +Bara för din skull. + +79 +00:08:50.917 --> 00:08:53.250 +Den är där... + +80 +00:08:53.625 --> 00:08:56.417 +Tro mig. +Emo... + +81 +00:08:57.000 --> 00:09:00.000 +Det är den. +Det är den... \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/chapters.en.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/chapters.en.vtt new file mode 100644 index 00000000..9740a413 --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/chapters.en.vtt @@ -0,0 +1,44 @@ +WEBVTT + +NOTE Created by Owen Edwards 2015. http://creativecommons.org/licenses/by/2.5/ +NOTE Based on 'finalbreakdown.rtf', part of the prepoduction notes, which are: +NOTE (c) Copyright 2006, Blender Foundation / +NOTE Netherlands Media Art Institute / +NOTE www.elephantsdream.org + +1 +00:00:00.000 --> 00:00:27.500 +Prologue + +2 +00:00:27.500 --> 00:01:10.000 +Switchboard trap + +3 +00:01:10.000 --> 00:03:25.000 +Telephone/Lecture + +4 +00:03:25.000 --> 00:04:52.000 +Typewriter + +5 +00:04:52.000 --> 00:06:19.500 +Proog shows Emo stuff + +6 +00:06:19.500 --> 00:07:09.000 +Which way + +7 +00:07:09.000 --> 00:07:45.000 +Emo flips out + +8 +00:07:45.000 --> 00:09:25.000 +Emo creates + +9 +00:09:25.000 --> 00:10:53.000 +Closing credits + diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/descriptions.en.vtt b/Resources/public/js/vendor/video-js/examples/elephantsdream/descriptions.en.vtt new file mode 100644 index 00000000..d55a2f09 --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/descriptions.en.vtt @@ -0,0 +1,280 @@ +WEBVTT +License: CC BY 4.0 http://creativecommons.org/licenses/by/4.0/ +Author: Silvia Pfeiffer + +1 +00:00:00.000 --> 00:00:05.000 +The orange open movie project presents + +2 +00:00:05.010 --> 00:00:12.000 +Introductory titles are showing on the background of a water pool with fishes swimming and mechanical objects lying on a stone floor. + +3 +00:00:12.010 --> 00:00:14.800 +elephants dream + +4 +00:00:26.100 --> 00:00:28.206 +Two people stand on a small bridge. + +5 +00:00:30.010 --> 00:00:40.000 +The old man, Proog, shoves the younger and less experienced Emo on the ground to save him from being mowed down by a barrage of jack plugs that whir back and forth between the two massive switch-board-like walls. + +6 +00:00:40.000 --> 00:00:47.000 +The plugs are oblivious of the two, endlessly channeling streams of bizarre sounds and data. + +7 +00:00:48.494 --> 00:00:51.994 +Emo sits on the bridge and checks his limbs. + +8 +00:01:09.150 --> 00:01:16.030 +After the squealing plugs move on, Proog makes sure that Emo is unharmed and urges him onwards through a crack in one of the plug-walls. + +9 +00:01:18.050 --> 00:01:24.000 +They walk through the narrow hall into a massive room that fades away into blackness on all sides. + +10 +00:01:24.050 --> 00:01:34.200 +Only one path is visible, suspended in mid-air that runs between thousands of dangling electric cables on which sit crowds of robin-like robotic birds. + +11 +00:01:36.000 --> 00:01:40.000 +As Proog and Emo enter the room, the birds begin to wake up and notice them. + +12 +00:01:42.000 --> 00:01:50.000 +Realizing the danger, Proog grabs Emo by the arm. + +13 +00:01:50.050 --> 00:02:00.000 +They run along the increasingly bizarre path as the birds begin to swarm. + +14 +00:02:00.050 --> 00:02:11.000 +All sound is blocked out by the birds which are making the same noises as the jack-plugs, garbled screaming and obscure sentences and static. + +15 +00:02:12.600 --> 00:02:17.000 +The path dead-ends, stopping in the middle of no-where above the infinite drop. + +16 +00:02:17.600 --> 00:02:22.000 +Proog turns around as the birds reach them and begin to dive-bomb at them. + +17 +00:02:22.600 --> 00:02:28.000 +At the last moment, Proog takes out an old candlestick phone and the birds dive into the speaker piece. + +18 +00:02:28.600 --> 00:02:31.000 +The screen cuts to black. + +19 +00:02:31.600 --> 00:02:38.000 +In the next scene, Proog stands at one end of a room, suspiciously watching what is probably the same candlestick phone, which is ringing. + +20 +00:02:38.500 --> 00:02:41.000 +Emo watches from the other side of the room. + +21 +00:02:41.500 --> 00:02:43.000 +The phone continues to ring. + +22 +00:02:43.500 --> 00:02:48.000 +After a while Emo approaches it to answer it, but Proog slaps his hand away. + +23 +00:02:57.972 --> 00:02:59.100 +Proog takes the ear-piece off the hook. + +24 +00:03:13.500 --> 00:03:18.054 +The phone speaker revealed a mass of clawed, fleshy polyps which scream and gibber obscenely. + +25 +00:03:25.000 --> 00:03:33.000 +There is a solemn silence as Emo looks around the room and the technical objects therein. + +26 +00:03:38.000 --> 00:03:44.000 +Emo laughs disbelievingly and Proog walks away. + +27 +00:03:46.000 --> 00:03:54.000 +In the next scene, the two enter another massive black room. + +28 +00:03:54.500 --> 00:04:04.000 +There is no path, the entry platform is the only structure that seems to be there except for another exit, lit distantly at the far side. + +29 +00:04:04.500 --> 00:04:14.000 +Proog takes a step forward into the void, and his feet are suddenly caught by giant typewriter arms that rocket up out of the blackness to catch his feet as he dances across mid-air. + +30 +00:04:14.500 --> 00:04:22.000 +Emo follows Proog with somewhat less enthusiasm as the older man leads the way. + +31 +00:04:52.000 --> 00:04:58.000 +They reach the end of the room and go through a hall into a small compartment. + +32 +00:05:02.000 --> 00:05:06.000 +Proog presses a button, and the door shuts. + +33 +00:05:06.500 --> 00:05:09.000 +It is an elevator. + +34 +00:05:09.500 --> 00:05:24.000 +The elevator lurches suddenly as it is grabbed by a giant mechanical arm and thrown upwards, rushing up through an ever-widening tunnel. + +35 +00:05:26.500 --> 00:05:32.000 +When it begins to slow down, another arm grabs the capsule and throws it even further up. + +36 +00:05:32.500 --> 00:05:40.000 +As it moves up, the walls unlock and fall away, leaving only the floor with the two on it, rushing higher and higher. + +37 +00:05:54.500 --> 00:05:59.000 +They exit the tunnel into a black sky and the platform reaches the peak of its arc. + +38 +00:06:19.500 --> 00:06:26.000 +The elevator begins to drop down another shaft, coming to rest as it slams into the floor of another room and bringing the two to a level stop. + +39 +00:06:26.500 --> 00:06:28.000 +A camera flashes. + +40 +00:06:28.010 --> 00:06:34.000 +They are in a large, dingy room filled with strange, generator-like devices and dotted with boxy holographic projectors. + +41 +00:06:34.500 --> 00:06:38.000 +One of them is projecting a portion of wall with a door in it right beside them. + +42 +00:06:38.500 --> 00:06:40.000 +The door seems harmless enough. + +43 +00:06:42.800 --> 00:06:45.100 +From behind the door comes light music. + +44 +00:06:56.000 --> 00:07:00.100 +Proog presses a button on his cane, which changes the holograph to another wall. + +45 +00:07:05.100 --> 00:07:11.000 +Proog finishes the wall, and boxes them into a Safe Room, out of the view of anything outside. + +46 +00:07:39.000 --> 00:07:42.500 +Proog slaps him, trying to bring him to his senses. + +47 +00:07:45.000 --> 00:07:52.000 +Emo storms away down the length of the room towards a wall he apparently cannot see and the wall begins to move, extending the length of the room. + +48 +00:08:00.000 --> 00:08:07.000 +The walls begin to discolour and mechanical roots start tearing through the walls to his left. + +49 +00:08:07.010 --> 00:08:09.000 +The roots move forwards toward Proog. + +50 +00:08:22.000 --> 00:08:31.000 +The rest of the safety wall crumples away as a pair of massive hands heave out of the ground and begin to attack. + +51 +00:08:31.010 --> 00:08:37.000 +Proog is knocked down by the shockwave, while Emo turns and begins to walk away, waving his finger around his temple in the 'crazy' sign. + +52 +00:08:37.010 --> 00:08:44.000 +In a last effort, Proog extricates himself from the tentacle roots, and cracks Emo over the back of the head with his cane. + +53 +00:08:44.500 --> 00:08:51.000 +As Emo collapses, everything falls away, and Proog and Emo are left in one tiny patch of light in the middle of blackness. + +54 +00:09:00.000 --> 00:09:20.000 +The scene fades to black while panning over a pile of tentacle roots lying on the ground. + +55 +00:09:26.000 --> 00:09:28.000 +Credits begin: + +56 +00:09:28.500 --> 00:09:35.000 +Orange Open Movie Team +Director: Bassum Kurdali +Art Director: Andreas Goralczyk + +57 +00:09:35.500 --> 00:09:39.000 +Music and Sound Design: Jan Morgenstern + +58 +00:09:39.500 --> 00:09:44.000 +Emo: Cas Jansen +Proog: Tygo Gernandt + +59 +00:09:44.500 --> 00:09:50.000 +Screenplay: Pepijn Zwanenberg +Original Concept & Scenario: Andreas Goralczyk, Bassam Kurdali, Ton Roosendaal + +60 +00:09:50.500 --> 00:10:24.000 +More people for +Additional Artwork and Animation +Texture Photography +Software Development +3D Modelling, Animation, Rendering, Compiling Software +Special Thanks to Open Source Projects +Rendering Services Provided +Hardware Sponsored +Casting +Sound FX, Foley, Dialogue Editing, Audio Mix and Post +Voice Recording +HDCam conversion +Netherlands Media Art Institute Staff +Blender Foundation Staff + +61 +00:10:24.500 --> 00:10:30.000 +Many Thanks to our Donation and DVD sponsors + +62 +00:10:30.500 --> 00:10:47.000 +Elephants Dream has been realised with financial support from +The Netherlands Film Fund +Mondriaan Foundation +VSBfonds +Uni-Verse / EU Sixth Framework Programme + +63 +00:10:47.500 --> 00:10:53.000 +Produced By +Ton Roosendaal +Copyright 2006 +Netherlands Media Art Institute / Montevideo +Blender Foundation diff --git a/Resources/public/js/vendor/video-js/examples/elephantsdream/index.html b/Resources/public/js/vendor/video-js/examples/elephantsdream/index.html new file mode 100644 index 00000000..b1b02dff --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/elephantsdream/index.html @@ -0,0 +1,41 @@ + + + + + + Video.js Text Descriptions, Chapters & Captions Example + + + + + + + + + + + + + diff --git a/Resources/public/js/vendor/video-js/examples/index.html b/Resources/public/js/vendor/video-js/examples/index.html new file mode 100644 index 00000000..84c0bda2 --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/index.html @@ -0,0 +1,18 @@ + + + + + + Index of video.js examples + + + +

                Index of video.js examples

                + + + + + diff --git a/Resources/public/js/vendor/video-js/examples/shared/example-captions.vtt b/Resources/public/js/vendor/video-js/examples/shared/example-captions.vtt new file mode 100644 index 00000000..e598be19 --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/shared/example-captions.vtt @@ -0,0 +1,41 @@ +WEBVTT + +00:00.700 --> 00:04.110 +Captions describe all relevant audio for the hearing impaired. +[ Heroic music playing for a seagull ] + +00:04.500 --> 00:05.000 +[ Splash!!! ] + +00:05.100 --> 00:06.000 +[ Sploosh!!! ] + +00:08.000 --> 00:09.225 +[ Splash...splash...splash splash splash ] + +00:10.525 --> 00:11.255 +[ Splash, Sploosh again ] + +00:13.500 --> 00:14.984 +Dolphin: eeeEEEEEeeee! + +00:14.984 --> 00:16.984 +Dolphin: Squawk! eeeEEE? + +00:25.000 --> 00:28.284 +[ A whole ton of splashes ] + +00:29.500 --> 00:31.000 +Mine. Mine. Mine. + +00:34.300 --> 00:36.000 +Shark: Chomp + +00:36.800 --> 00:37.900 +Shark: CHOMP!!! + +00:37.861 --> 00:41.193 +EEEEEEOOOOOOOOOOWHALENOISE + +00:42.593 --> 00:45.611 +[ BIG SPLASH ] \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/examples/simple-embed/index.html b/Resources/public/js/vendor/video-js/examples/simple-embed/index.html new file mode 100644 index 00000000..96471f91 --- /dev/null +++ b/Resources/public/js/vendor/video-js/examples/simple-embed/index.html @@ -0,0 +1,23 @@ + + + + + Video.js | HTML5 Video Player + + + + + + + + + + + diff --git a/Resources/public/js/vendor/video-js/font/VideoJS.svg b/Resources/public/js/vendor/video-js/font/VideoJS.svg new file mode 100755 index 00000000..ac263cd8 --- /dev/null +++ b/Resources/public/js/vendor/video-js/font/VideoJS.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/public/js/vendor/video-js/font/VideoJS.ttf b/Resources/public/js/vendor/video-js/font/VideoJS.ttf new file mode 100755 index 00000000..9bb77419 Binary files /dev/null and b/Resources/public/js/vendor/video-js/font/VideoJS.ttf differ diff --git a/Resources/public/js/vendor/video-js/font/VideoJS.woff b/Resources/public/js/vendor/video-js/font/VideoJS.woff new file mode 100755 index 00000000..0ac4fa83 Binary files /dev/null and b/Resources/public/js/vendor/video-js/font/VideoJS.woff differ diff --git a/Resources/public/js/vendor/video-js/lang/ar.js b/Resources/public/js/vendor/video-js/lang/ar.js new file mode 100644 index 00000000..506047ef --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ar.js @@ -0,0 +1,34 @@ +videojs.addLanguage('ar', { + "Play": "تشغيل", + "Pause": "إيقاف", + "Current Time": "الوقت الحالي", + "Duration": "مدة", + "Remaining Time": "الوقت المتبقي", + "Stream Type": "نوع التيار", + "LIVE": "مباشر", + "Loaded": "تم التحميل", + "Progress": "التقدم", + "Fullscreen": "ملء الشاشة", + "Non-Fullscreen": "تعطيل ملء الشاشة", + "Mute": "صامت", + "Unmute": "غير الصامت", + "Playback Rate": "معدل التشغيل", + "Subtitles": "الترجمة", + "subtitles off": "إيقاف الترجمة", + "Captions": "التعليقات", + "captions off": "إيقاف التعليقات", + "Chapters": "فصول", + "You aborted the media playback": "لقد ألغيت تشغيل الفيديو", + "A network error caused the media download to fail part-way.": "تسبب خطأ في الشبكة بفشل تحميل الفيديو بالكامل.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "لا يمكن تحميل الفيديو بسبب فشل في الخادوم أو الشبكة ، أو فشل بسبب عدم إمكانية قراءة تنسيق الفيديو.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "تم إيقاف تشغيل الفيديو بسبب مشكلة فساد أو لأن الفيديو المستخدم يستخدم ميزات غير مدعومة من متصفحك.", + "No compatible source was found for this media.": "فشل العثور على أي مصدر متوافق مع هذا الفيديو.", + "Play Video": "تشغيل الفيديو", + "Close": "أغلق", + "Modal Window": "نافذة مشروطة", + "This is a modal window": "هذه نافذة مشروطة", + "This modal can be closed by pressing the Escape key or activating the close button.": "يمكن غلق هذه النافذة المشروطة عن طريق الضغط على زر الخروج أو تفعيل زر الإغلاق", + ", opens captions settings dialog": ", تفتح نافذة خيارات التعليقات", + ", opens subtitles settings dialog": ", تفتح نافذة خيارات الترجمة", + ", selected": ", مختار" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ar.json b/Resources/public/js/vendor/video-js/lang/ar.json new file mode 100644 index 00000000..99fff444 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ar.json @@ -0,0 +1,34 @@ +{ + "Play": "تشغيل", + "Pause": "إيقاف", + "Current Time": "الوقت الحالي", + "Duration": "مدة", + "Remaining Time": "الوقت المتبقي", + "Stream Type": "نوع التيار", + "LIVE": "مباشر", + "Loaded": "تم التحميل", + "Progress": "التقدم", + "Fullscreen": "ملء الشاشة", + "Non-Fullscreen": "تعطيل ملء الشاشة", + "Mute": "صامت", + "Unmute": "غير الصامت", + "Playback Rate": "معدل التشغيل", + "Subtitles": "الترجمة", + "subtitles off": "إيقاف الترجمة", + "Captions": "التعليقات", + "captions off": "إيقاف التعليقات", + "Chapters": "فصول", + "You aborted the media playback": "لقد ألغيت تشغيل الفيديو", + "A network error caused the media download to fail part-way.": "تسبب خطأ في الشبكة بفشل تحميل الفيديو بالكامل.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "لا يمكن تحميل الفيديو بسبب فشل في الخادوم أو الشبكة ، أو فشل بسبب عدم إمكانية قراءة تنسيق الفيديو.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "تم إيقاف تشغيل الفيديو بسبب مشكلة فساد أو لأن الفيديو المستخدم يستخدم ميزات غير مدعومة من متصفحك.", + "No compatible source was found for this media.": "فشل العثور على أي مصدر متوافق مع هذا الفيديو.", + "Play Video": "تشغيل الفيديو", + "Close": "أغلق", + "Modal Window": "نافذة مشروطة", + "This is a modal window": "هذه نافذة مشروطة", + "This modal can be closed by pressing the Escape key or activating the close button.": "يمكن غلق هذه النافذة المشروطة عن طريق الضغط على زر الخروج أو تفعيل زر الإغلاق", + ", opens captions settings dialog": ", تفتح نافذة خيارات التعليقات", + ", opens subtitles settings dialog": ", تفتح نافذة خيارات الترجمة", + ", selected": ", مختار" +} diff --git a/Resources/public/js/vendor/video-js/lang/ba.js b/Resources/public/js/vendor/video-js/lang/ba.js new file mode 100644 index 00000000..0705eb40 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ba.js @@ -0,0 +1,26 @@ +videojs.addLanguage('ba', { + "Play": "Pusti", + "Pause": "Pauza", + "Current Time": "Trenutno vrijeme", + "Duration": "Vrijeme trajanja", + "Remaining Time": "Preostalo vrijeme", + "Stream Type": "Način strimovanja", + "LIVE": "UŽIVO", + "Loaded": "Učitan", + "Progress": "Progres", + "Fullscreen": "Puni ekran", + "Non-Fullscreen": "Mali ekran", + "Mute": "Prigušen", + "Unmute": "Ne-prigušen", + "Playback Rate": "Stopa reprodukcije", + "Subtitles": "Podnaslov", + "subtitles off": "Podnaslov deaktiviran", + "Captions": "Titlovi", + "captions off": "Titlovi deaktivirani", + "Chapters": "Poglavlja", + "You aborted the media playback": "Isključili ste reprodukciju videa.", + "A network error caused the media download to fail part-way.": "Video se prestao preuzimati zbog greške na mreži.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video se ne može reproducirati zbog servera, greške u mreži ili je format ne podržan.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Reprodukcija videa je zaustavljenja zbog greške u formatu ili zbog verzije vašeg pretraživača.", + "No compatible source was found for this media.": "Nije nađen nijedan kompatibilan izvor ovog videa." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ba.json b/Resources/public/js/vendor/video-js/lang/ba.json new file mode 100644 index 00000000..32e1763f --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ba.json @@ -0,0 +1,26 @@ +{ + "Play": "Pusti", + "Pause": "Pauza", + "Current Time": "Trenutno vrijeme", + "Duration": "Vrijeme trajanja", + "Remaining Time": "Preostalo vrijeme", + "Stream Type": "Način strimovanja", + "LIVE": "UŽIVO", + "Loaded": "Učitan", + "Progress": "Progres", + "Fullscreen": "Puni ekran", + "Non-Fullscreen": "Mali ekran", + "Mute": "Prigušen", + "Unmute": "Ne-prigušen", + "Playback Rate": "Stopa reprodukcije", + "Subtitles": "Podnaslov", + "subtitles off": "Podnaslov deaktiviran", + "Captions": "Titlovi", + "captions off": "Titlovi deaktivirani", + "Chapters": "Poglavlja", + "You aborted the media playback": "Isključili ste reprodukciju videa.", + "A network error caused the media download to fail part-way.": "Video se prestao preuzimati zbog greške na mreži.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video se ne može reproducirati zbog servera, greške u mreži ili je format ne podržan.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Reprodukcija videa je zaustavljenja zbog greške u formatu ili zbog verzije vašeg pretraživača.", + "No compatible source was found for this media.": "Nije nađen nijedan kompatibilan izvor ovog videa." +} diff --git a/Resources/public/js/vendor/video-js/lang/bg.js b/Resources/public/js/vendor/video-js/lang/bg.js new file mode 100644 index 00000000..6285df20 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/bg.js @@ -0,0 +1,26 @@ +videojs.addLanguage('bg', { + "Play": "Възпроизвеждане", + "Pause": "Пауза", + "Current Time": "Текущо време", + "Duration": "Продължителност", + "Remaining Time": "Оставащо време", + "Stream Type": "Тип на потока", + "LIVE": "НА ЖИВО", + "Loaded": "Заредено", + "Progress": "Прогрес", + "Fullscreen": "Цял екран", + "Non-Fullscreen": "Спиране на цял екран", + "Mute": "Без звук", + "Unmute": "Със звук", + "Playback Rate": "Скорост на възпроизвеждане", + "Subtitles": "Субтитри", + "subtitles off": "Спряни субтитри", + "Captions": "Аудио надписи", + "captions off": "Спряни аудио надписи", + "Chapters": "Глави", + "You aborted the media playback": "Спряхте възпроизвеждането на видеото", + "A network error caused the media download to fail part-way.": "Грешка в мрежата провали изтеглянето на видеото.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Видеото не може да бъде заредено заради проблем със сървъра или мрежата или защото този формат не е поддържан.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Възпроизвеждането на видеото беше прекъснато заради проблем с файла или защото видеото използва опции които браузърът Ви не поддържа.", + "No compatible source was found for this media.": "Не беше намерен съвместим източник за това видео." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/bg.json b/Resources/public/js/vendor/video-js/lang/bg.json new file mode 100644 index 00000000..372e8293 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/bg.json @@ -0,0 +1,26 @@ +{ + "Play": "Възпроизвеждане", + "Pause": "Пауза", + "Current Time": "Текущо време", + "Duration": "Продължителност", + "Remaining Time": "Оставащо време", + "Stream Type": "Тип на потока", + "LIVE": "НА ЖИВО", + "Loaded": "Заредено", + "Progress": "Прогрес", + "Fullscreen": "Цял екран", + "Non-Fullscreen": "Спиране на цял екран", + "Mute": "Без звук", + "Unmute": "Със звук", + "Playback Rate": "Скорост на възпроизвеждане", + "Subtitles": "Субтитри", + "subtitles off": "Спряни субтитри", + "Captions": "Аудио надписи", + "captions off": "Спряни аудио надписи", + "Chapters": "Глави", + "You aborted the media playback": "Спряхте възпроизвеждането на видеото", + "A network error caused the media download to fail part-way.": "Грешка в мрежата провали изтеглянето на видеото.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Видеото не може да бъде заредено заради проблем със сървъра или мрежата или защото този формат не е поддържан.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Възпроизвеждането на видеото беше прекъснато заради проблем с файла или защото видеото използва опции които браузърът Ви не поддържа.", + "No compatible source was found for this media.": "Не беше намерен съвместим източник за това видео." +} diff --git a/Resources/public/js/vendor/video-js/lang/ca.js b/Resources/public/js/vendor/video-js/lang/ca.js new file mode 100644 index 00000000..1fcdab84 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ca.js @@ -0,0 +1,26 @@ +videojs.addLanguage('ca', { + "Play": "Reproducció", + "Pause": "Pausa", + "Current Time": "Temps reproduït", + "Duration": "Durada total", + "Remaining Time": "Temps restant", + "Stream Type": "Tipus de seqüència", + "LIVE": "EN DIRECTE", + "Loaded": "Carregat", + "Progress": "Progrés", + "Fullscreen": "Pantalla completa", + "Non-Fullscreen": "Pantalla no completa", + "Mute": "Silencia", + "Unmute": "Amb so", + "Playback Rate": "Velocitat de reproducció", + "Subtitles": "Subtítols", + "subtitles off": "Subtítols desactivats", + "Captions": "Llegendes", + "captions off": "Llegendes desactivades", + "Chapters": "Capítols", + "You aborted the media playback": "Heu interromput la reproducció del vídeo.", + "A network error caused the media download to fail part-way.": "Un error de la xarxa ha interromput la baixada del vídeo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "No s'ha pogut carregar el vídeo perquè el servidor o la xarxa han fallat, o bé perquè el seu format no és compatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La reproducció de vídeo s'ha interrumput per un problema de corrupció de dades o bé perquè el vídeo demanava funcions que el vostre navegador no ofereix.", + "No compatible source was found for this media.": "No s'ha trobat cap font compatible amb el vídeo." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ca.json b/Resources/public/js/vendor/video-js/lang/ca.json new file mode 100644 index 00000000..8ef0c040 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ca.json @@ -0,0 +1,26 @@ +{ + "Play": "Reproducció", + "Pause": "Pausa", + "Current Time": "Temps reproduït", + "Duration": "Durada total", + "Remaining Time": "Temps restant", + "Stream Type": "Tipus de seqüència", + "LIVE": "EN DIRECTE", + "Loaded": "Carregat", + "Progress": "Progrés", + "Fullscreen": "Pantalla completa", + "Non-Fullscreen": "Pantalla no completa", + "Mute": "Silencia", + "Unmute": "Amb so", + "Playback Rate": "Velocitat de reproducció", + "Subtitles": "Subtítols", + "subtitles off": "Subtítols desactivats", + "Captions": "Llegendes", + "captions off": "Llegendes desactivades", + "Chapters": "Capítols", + "You aborted the media playback": "Heu interromput la reproducció del vídeo.", + "A network error caused the media download to fail part-way.": "Un error de la xarxa ha interromput la baixada del vídeo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "No s'ha pogut carregar el vídeo perquè el servidor o la xarxa han fallat, o bé perquè el seu format no és compatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La reproducció de vídeo s'ha interrumput per un problema de corrupció de dades o bé perquè el vídeo demanava funcions que el vostre navegador no ofereix.", + "No compatible source was found for this media.": "No s'ha trobat cap font compatible amb el vídeo." +} diff --git a/Resources/public/js/vendor/video-js/lang/cs.js b/Resources/public/js/vendor/video-js/lang/cs.js new file mode 100644 index 00000000..7164e086 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/cs.js @@ -0,0 +1,85 @@ +videojs.addLanguage('cs', { + "Audio Player": "Audio Přehravač", + "Video Player": "Video Přehravač", + "Play": "Přehrát", + "Pause": "Pauza", + "Replay": "Spustit znovu", + "Current Time": "Aktuální čas", + "Duration": "Doba trvání", + "Remaining Time": "Zbývající čas", + "Stream Type": "Typ streamu", + "LIVE": "ŽIVĚ", + "Loaded": "Načteno", + "Progress": "Stav", + "Progress Bar": "Ukazatel průběhu", + "progress bar timing: currentTime={1} duration={2}": "{1} z {2}", + "Fullscreen": "Celá obrazovka", + "Non-Fullscreen": "Běžné zobrazení", + "Mute": "Ztlumit zvuk", + "Unmute": "Zapnout zvuk", + "Playback Rate": "Rychlost přehrávání", + "Subtitles": "Titulky", + "subtitles off": "Bez titulků", + "Captions": "Popisky", + "captions off": "Popisky vypnuty", + "Chapters": "Kapitoly", + "Descriptions": "Popisy", + "descriptions off": "Bez popisů", + "Audio Track": "Zvuková stopa", + "Volume Level": "Hlasitost", + "You aborted the media playback": "Přehrávání videa bylo přerušeno.", + "A network error caused the media download to fail part-way.": "Video nemohlo být načteno kvůli chybě v síti.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video nemohlo být načteno, buď kvůli chybě serveru, sítě nebo proto, že daný formát není podporován.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Váš prohlížeč nepodporuje tento formát videa.", + "No compatible source was found for this media.": "Nevalidní zadaný zdroj videa.", + "The media is encrypted and we do not have the keys to decrypt it.": "Chyba při dešifrování videa.", + "Play Video": "Přehrát video", + "Close": "Zavřit", + "Close Modal Dialog": "Zavřít okno", + "Modal Window": "Modální okno", + "This is a modal window": "Toto je modální okno", + "This modal can be closed by pressing the Escape key or activating the close button.": "Toto okno se dá zavřít křížkem nebo klávesou Esc.", + ", opens captions settings dialog": ", otevřít okno pro nastavení popisků", + ", opens subtitles settings dialog": ", otevřít okno pro nastavení titulků", + ", opens descriptions settings dialog": ", otevře okno pro nastavení popisků pro nevidomé", + ", selected": ", vybráno", + "captions settings": "nastavení popisků", + "subtitles settings": "nastavení titulků", + "descriptions settings": "nastavení popisků pro nevidomé", + "Text": "Titulky", + "White": "Bílé", + "Black": "Černé", + "Red": "Červené", + "Green": "Zelené", + "Blue": "Modré", + "Yellow": "Žluté", + "Magenta": "Fialové", + "Cyan": "Azurové", + "Background": "Pozadí titulků", + "Window": "Okno", + "Transparent": "Průhledné", + "Semi-Transparent": "Poloprůhledné", + "Opaque": "Neprůhledné", + "Font Size": "Velikost písma", + "Text Edge Style": "Okraje písma", + "None": "Bez okraje", + "Raised": "Zvýšený", + "Depressed": "Propadlý", + "Uniform": "Rovnoměrný", + "Dropshadow": "Stínovaný", + "Font Family": "Rodina písma", + "Proportional Sans-Serif": "Proporcionální bezpatkové", + "Monospace Sans-Serif": "Monospace bezpatkové", + "Proportional Serif": "Proporcionální patkové", + "Monospace Serif": "Monospace patkové", + "Casual": "Hravé", + "Script": "Ručně psané", + "Small Caps": "Malé kapitálky", + "Reset": "Obnovit", + "restore all settings to the default values": "Vrátit nastavení do výchozího stavu", + "Done": "Hotovo", + "Caption Settings Dialog": "Okno s nastavením titulků", + "Beginning of dialog window. Escape will cancel and close the window.": "Začátek dialogového okna. Klávesa Esc okno zavře.", + "End of dialog window.": "Konec dialogového okna.", + "{1} is loading.": "{1} se načítá." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/cs.json b/Resources/public/js/vendor/video-js/lang/cs.json new file mode 100644 index 00000000..02d30cdf --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/cs.json @@ -0,0 +1,85 @@ +{ + "Audio Player": "Audio Přehravač", + "Video Player": "Video Přehravač", + "Play": "Přehrát", + "Pause": "Pauza", + "Replay": "Spustit znovu", + "Current Time": "Aktuální čas", + "Duration": "Doba trvání", + "Remaining Time": "Zbývající čas", + "Stream Type": "Typ streamu", + "LIVE": "ŽIVĚ", + "Loaded": "Načteno", + "Progress": "Stav", + "Progress Bar": "Ukazatel průběhu", + "progress bar timing: currentTime={1} duration={2}": "{1} z {2}", + "Fullscreen": "Celá obrazovka", + "Non-Fullscreen": "Běžné zobrazení", + "Mute": "Ztlumit zvuk", + "Unmute": "Zapnout zvuk", + "Playback Rate": "Rychlost přehrávání", + "Subtitles": "Titulky", + "subtitles off": "Bez titulků", + "Captions": "Popisky", + "captions off": "Popisky vypnuty", + "Chapters": "Kapitoly", + "Descriptions": "Popisy", + "descriptions off": "Bez popisů", + "Audio Track": "Zvuková stopa", + "Volume Level": "Hlasitost", + "You aborted the media playback": "Přehrávání videa bylo přerušeno.", + "A network error caused the media download to fail part-way.": "Video nemohlo být načteno kvůli chybě v síti.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video nemohlo být načteno, buď kvůli chybě serveru, sítě nebo proto, že daný formát není podporován.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Váš prohlížeč nepodporuje tento formát videa.", + "No compatible source was found for this media.": "Nevalidní zadaný zdroj videa.", + "The media is encrypted and we do not have the keys to decrypt it.": "Chyba při dešifrování videa.", + "Play Video": "Přehrát video", + "Close": "Zavřit", + "Close Modal Dialog": "Zavřít okno", + "Modal Window": "Modální okno", + "This is a modal window": "Toto je modální okno", + "This modal can be closed by pressing the Escape key or activating the close button.": "Toto okno se dá zavřít křížkem nebo klávesou Esc.", + ", opens captions settings dialog": ", otevřít okno pro nastavení popisků", + ", opens subtitles settings dialog": ", otevřít okno pro nastavení titulků", + ", opens descriptions settings dialog": ", otevře okno pro nastavení popisků pro nevidomé", + ", selected": ", vybráno", + "captions settings": "nastavení popisků", + "subtitles settings": "nastavení titulků", + "descriptions settings": "nastavení popisků pro nevidomé", + "Text": "Titulky", + "White": "Bílé", + "Black": "Černé", + "Red": "Červené", + "Green": "Zelené", + "Blue": "Modré", + "Yellow": "Žluté", + "Magenta": "Fialové", + "Cyan": "Azurové", + "Background": "Pozadí titulků", + "Window": "Okno", + "Transparent": "Průhledné", + "Semi-Transparent": "Poloprůhledné", + "Opaque": "Neprůhledné", + "Font Size": "Velikost písma", + "Text Edge Style": "Okraje písma", + "None": "Bez okraje", + "Raised": "Zvýšený", + "Depressed": "Propadlý", + "Uniform": "Rovnoměrný", + "Dropshadow": "Stínovaný", + "Font Family": "Rodina písma", + "Proportional Sans-Serif": "Proporcionální bezpatkové", + "Monospace Sans-Serif": "Monospace bezpatkové", + "Proportional Serif": "Proporcionální patkové", + "Monospace Serif": "Monospace patkové", + "Casual": "Hravé", + "Script": "Ručně psané", + "Small Caps": "Malé kapitálky", + "Reset": "Obnovit", + "restore all settings to the default values": "Vrátit nastavení do výchozího stavu", + "Done": "Hotovo", + "Caption Settings Dialog": "Okno s nastavením titulků", + "Beginning of dialog window. Escape will cancel and close the window.": "Začátek dialogového okna. Klávesa Esc okno zavře.", + "End of dialog window.": "Konec dialogového okna.", + "{1} is loading.": "{1} se načítá." +} diff --git a/Resources/public/js/vendor/video-js/lang/cy.js b/Resources/public/js/vendor/video-js/lang/cy.js new file mode 100644 index 00000000..c33ca577 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/cy.js @@ -0,0 +1,85 @@ +videojs.addLanguage('cy', { + "Audio Player": "Chwaraewr sain", + "Video Player": "Chwaraewr fideo", + "Play": "Chwarae", + "Pause": "Oedi", + "Replay": "Ailchwarae", + "Current Time": "Amser Cyfredol", + "Duration": "Parhad", + "Remaining Time": "Amser ar ôl", + "Stream Type": "Math o Ffrwd", + "LIVE": "YN FYW", + "Loaded": "Llwythwyd", + "Progress": "Cynnydd", + "Progress Bar": "Bar Cynnydd", + "progress bar timing: currentTime={1} duration={2}": "{1} o {2}", + "Fullscreen": "Sgrîn Lawn", + "Non-Fullscreen": "Ffenestr", + "Mute": "Pylu", + "Unmute": "Dad-bylu", + "Playback Rate": "Cyfradd Chwarae", + "Subtitles": "Isdeitlau", + "subtitles off": "Isdeitlau i ffwrdd", + "Captions": "Capsiynau", + "captions off": "Capsiynau i ffwrdd", + "Chapters": "Penodau", + "Descriptions": "Disgrifiadau", + "descriptions off": "disgrifiadau i ffwrdd", + "Audio Track": "Trac Sain", + "Volume Level": "Lefel Sain", + "You aborted the media playback": "Atalwyd y fideo gennych", + "A network error caused the media download to fail part-way.": "Mae gwall rhwydwaith wedi achosi methiant lawrlwytho.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Ni lwythodd y fideo, oherwydd methiant gweinydd neu rwydwaith, neu achos nid yw'r system yn cefnogi'r fformat.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Atalwyd y fideo oherwydd problem llygredd data neu oherwydd nid yw'ch porwr yn cefnogi nodweddion penodol o'r fideo.", + "No compatible source was found for this media.": "Nid oedd modd canfod ffynhonnell cytûn am y fideo hwn.", + "The media is encrypted and we do not have the keys to decrypt it.": "Mae'r fideo wedi ei amgryptio ac nid oes allweddion gennym.", + "Play Video": "Chwarae Fideo", + "Close": "Cau", + "Close Modal Dialog": "Cau Blwch Deialog Moddol", + "Modal Window": "Ffenestr Foddol", + "This is a modal window": "Mae hon yn ffenestr foddol", + "This modal can be closed by pressing the Escape key or activating the close button.": "Gallech chi gau'r ffenestr foddol hon trwy wasgu Escape neu glicio'r botwm cau.", + ", opens captions settings dialog": ", yn agor gosodiadau capsiynau", + ", opens subtitles settings dialog": ", yn agor gosodiadau isdeitlau", + ", opens descriptions settings dialog": ", yn agor gosodiadau disgrifiadau", + ", selected": ", detholwyd", + "captions settings": "gosodiadau capsiynau", + "subtitles settings": "gosodiadau isdeitlau", + "descriptions settings": "gosodiadau disgrifiadau", + "Text": "Testun", + "White": "Gwyn", + "Black": "Du", + "Red": "Coch", + "Green": "Gwyrdd", + "Blue": "Glas", + "Yellow": "Melyn", + "Magenta": "Piws", + "Cyan": "Cyan", + "Background": "Cefndir", + "Window": "Ffenestr", + "Transparent": "Tryloyw", + "Semi-Transparent": "Hanner-dryloyw", + "Opaque": "Di-draidd", + "Font Size": "Maint y Ffont", + "Text Edge Style": "Arddull Ymylon Testun", + "None": "Dim", + "Raised": "Uwch", + "Depressed": "Is", + "Uniform": "Unffurf", + "Dropshadow": "Cysgod cefn", + "Font Family": "Teulu y Ffont", + "Proportional Sans-Serif": "Heb-Seriff Cyfraneddol", + "Monospace Sans-Serif": "Heb-Seriff Unlled", + "Proportional Serif": "Seriff Gyfraneddol", + "Monospace Serif": "Seriff Unlled", + "Casual": "Llawysgrif", + "Script": "Sgript", + "Small Caps": "Prif Lythyrennau Bychain", + "Reset": "Ailosod", + "restore all settings to the default values": "Adfer yr holl osodiadau diofyn", + "Done": "Gorffenwyd", + "Caption Settings Dialog": "Blwch Gosodiadau Capsiynau", + "Beginning of dialog window. Escape will cancel and close the window.": "Dechrau ffenestr deialog. Bydd Escape yn canslo a chau'r ffenestr.", + "End of dialog window.": "Diwedd ffenestr deialog.", + "{1} is loading.": "{1} yn llwytho." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/cy.json b/Resources/public/js/vendor/video-js/lang/cy.json new file mode 100644 index 00000000..f1e00a07 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/cy.json @@ -0,0 +1,85 @@ +{ + "Audio Player":"Chwaraewr sain", + "Video Player":"Chwaraewr fideo", + "Play":"Chwarae", + "Pause":"Oedi", + "Replay":"Ailchwarae", + "Current Time":"Amser Cyfredol", + "Duration":"Parhad", + "Remaining Time":"Amser ar ôl", + "Stream Type":"Math o Ffrwd", + "LIVE":"YN FYW", + "Loaded":"Llwythwyd", + "Progress":"Cynnydd", + "Progress Bar":"Bar Cynnydd", + "progress bar timing: currentTime={1} duration={2}":"{1} o {2}", + "Fullscreen":"Sgrîn Lawn", + "Non-Fullscreen":"Ffenestr", + "Mute":"Pylu", + "Unmute":"Dad-bylu", + "Playback Rate":"Cyfradd Chwarae", + "Subtitles":"Isdeitlau", + "subtitles off":"Isdeitlau i ffwrdd", + "Captions":"Capsiynau", + "captions off":"Capsiynau i ffwrdd", + "Chapters":"Penodau", + "Descriptions":"Disgrifiadau", + "descriptions off":"disgrifiadau i ffwrdd", + "Audio Track":"Trac Sain", + "Volume Level":"Lefel Sain", + "You aborted the media playback":"Atalwyd y fideo gennych", + "A network error caused the media download to fail part-way.":"Mae gwall rhwydwaith wedi achosi methiant lawrlwytho.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.":"Ni lwythodd y fideo, oherwydd methiant gweinydd neu rwydwaith, neu achos nid yw'r system yn cefnogi'r fformat.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Atalwyd y fideo oherwydd problem llygredd data neu oherwydd nid yw'ch porwr yn cefnogi nodweddion penodol o'r fideo.", + "No compatible source was found for this media.":"Nid oedd modd canfod ffynhonnell cytûn am y fideo hwn.", + "The media is encrypted and we do not have the keys to decrypt it.":"Mae'r fideo wedi ei amgryptio ac nid oes allweddion gennym.", + "Play Video":"Chwarae Fideo", + "Close":"Cau", + "Close Modal Dialog":"Cau Blwch Deialog Moddol", + "Modal Window":"Ffenestr Foddol", + "This is a modal window":"Mae hon yn ffenestr foddol", + "This modal can be closed by pressing the Escape key or activating the close button.":"Gallech chi gau'r ffenestr foddol hon trwy wasgu Escape neu glicio'r botwm cau.", + ", opens captions settings dialog":", yn agor gosodiadau capsiynau", + ", opens subtitles settings dialog":", yn agor gosodiadau isdeitlau", + ", opens descriptions settings dialog":", yn agor gosodiadau disgrifiadau", + ", selected":", detholwyd", + "captions settings":"gosodiadau capsiynau", + "subtitles settings":"gosodiadau isdeitlau", + "descriptions settings":"gosodiadau disgrifiadau", + "Text":"Testun", + "White":"Gwyn", + "Black":"Du", + "Red":"Coch", + "Green":"Gwyrdd", + "Blue":"Glas", + "Yellow":"Melyn", + "Magenta":"Piws", + "Cyan":"Cyan", + "Background":"Cefndir", + "Window":"Ffenestr", + "Transparent":"Tryloyw", + "Semi-Transparent":"Hanner-dryloyw", + "Opaque":"Di-draidd", + "Font Size":"Maint y Ffont", + "Text Edge Style":"Arddull Ymylon Testun", + "None":"Dim", + "Raised":"Uwch", + "Depressed":"Is", + "Uniform":"Unffurf", + "Dropshadow":"Cysgod cefn", + "Font Family":"Teulu y Ffont", + "Proportional Sans-Serif":"Heb-Seriff Cyfraneddol", + "Monospace Sans-Serif":"Heb-Seriff Unlled", + "Proportional Serif":"Seriff Gyfraneddol", + "Monospace Serif":"Seriff Unlled", + "Casual":"Llawysgrif", + "Script":"Sgript", + "Small Caps":"Prif Lythyrennau Bychain", + "Reset":"Ailosod", + "restore all settings to the default values":"Adfer yr holl osodiadau diofyn", + "Done":"Gorffenwyd", + "Caption Settings Dialog":"Blwch Gosodiadau Capsiynau", + "Beginning of dialog window. Escape will cancel and close the window.":"Dechrau ffenestr deialog. Bydd Escape yn canslo a chau'r ffenestr.", + "End of dialog window.":"Diwedd ffenestr deialog.", + "{1} is loading.": "{1} yn llwytho." +} diff --git a/Resources/public/js/vendor/video-js/lang/da.js b/Resources/public/js/vendor/video-js/lang/da.js new file mode 100644 index 00000000..9be95a95 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/da.js @@ -0,0 +1,26 @@ +videojs.addLanguage('da', { + "Play": "Afspil", + "Pause": "Pause", + "Current Time": "Aktuel tid", + "Duration": "Varighed", + "Remaining Time": "Resterende tid", + "Stream Type": "Stream-type", + "LIVE": "LIVE", + "Loaded": "Indlæst", + "Progress": "Status", + "Fullscreen": "Fuldskærm", + "Non-Fullscreen": "Luk fuldskærm", + "Mute": "Uden lyd", + "Unmute": "Med lyd", + "Playback Rate": "Afspilningsrate", + "Subtitles": "Undertekster", + "subtitles off": "Uden undertekster", + "Captions": "Undertekster for hørehæmmede", + "captions off": "Uden undertekster for hørehæmmede", + "Chapters": "Kapitler", + "You aborted the media playback": "Du afbrød videoafspilningen.", + "A network error caused the media download to fail part-way.": "En netværksfejl fik download af videoen til at fejle.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videoen kunne ikke indlæses, enten fordi serveren eller netværket fejlede, eller fordi formatet ikke er understøttet.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videoafspilningen blev afbrudt på grund af ødelagte data eller fordi videoen benyttede faciliteter som din browser ikke understøtter.", + "No compatible source was found for this media.": "Fandt ikke en kompatibel kilde for denne media." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/da.json b/Resources/public/js/vendor/video-js/lang/da.json new file mode 100644 index 00000000..eeb298d6 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/da.json @@ -0,0 +1,26 @@ +{ + "Play": "Afspil", + "Pause": "Pause", + "Current Time": "Aktuel tid", + "Duration": "Varighed", + "Remaining Time": "Resterende tid", + "Stream Type": "Stream-type", + "LIVE": "LIVE", + "Loaded": "Indlæst", + "Progress": "Status", + "Fullscreen": "Fuldskærm", + "Non-Fullscreen": "Luk fuldskærm", + "Mute": "Uden lyd", + "Unmute": "Med lyd", + "Playback Rate": "Afspilningsrate", + "Subtitles": "Undertekster", + "subtitles off": "Uden undertekster", + "Captions": "Undertekster for hørehæmmede", + "captions off": "Uden undertekster for hørehæmmede", + "Chapters": "Kapitler", + "You aborted the media playback": "Du afbrød videoafspilningen.", + "A network error caused the media download to fail part-way.": "En netværksfejl fik download af videoen til at fejle.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videoen kunne ikke indlæses, enten fordi serveren eller netværket fejlede, eller fordi formatet ikke er understøttet.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videoafspilningen blev afbrudt på grund af ødelagte data eller fordi videoen benyttede faciliteter som din browser ikke understøtter.", + "No compatible source was found for this media.": "Fandt ikke en kompatibel kilde for denne media." +} diff --git a/Resources/public/js/vendor/video-js/lang/de.js b/Resources/public/js/vendor/video-js/lang/de.js new file mode 100644 index 00000000..7458474f --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/de.js @@ -0,0 +1,84 @@ +videojs.addLanguage('de', { + "Play": "Wiedergabe", + "Pause": "Pause", + "Replay": "Erneut abspielen", + "Current Time": "Aktueller Zeitpunkt", + "Duration": "Dauer", + "Remaining Time": "Verbleibende Zeit", + "Stream Type": "Streamtyp", + "LIVE": "LIVE", + "Loaded": "Geladen", + "Progress": "Status", + "Fullscreen": "Vollbild", + "Non-Fullscreen": "Kein Vollbild", + "Mute": "Ton aus", + "Unmute": "Ton ein", + "Playback Rate": "Wiedergabegeschwindigkeit", + "Subtitles": "Untertitel", + "subtitles off": "Untertitel aus", + "Captions": "Untertitel", + "captions off": "Untertitel aus", + "Chapters": "Kapitel", + "You aborted the media playback": "Sie haben die Videowiedergabe abgebrochen.", + "A network error caused the media download to fail part-way.": "Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.", + "No compatible source was found for this media.": "Für dieses Video wurde keine kompatible Quelle gefunden.", + "Play Video": "Video abspielen", + "Close": "Schließen", + "Modal Window": "Modales Fenster", + "This is a modal window": "Dies ist ein modales Fenster", + "This modal can be closed by pressing the Escape key or activating the close button.": "Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche \"Schließen\" wird dieses modale Fenster geschlossen.", + ", opens captions settings dialog": ", öffnet Einstellungen für Untertitel", + ", opens subtitles settings dialog": ", öffnet Einstellungen für Untertitel", + ", selected": ", ausgewählt", + "captions settings": "Untertiteleinstellungen", + "subtitles settings": "Untertiteleinstellungen", + "descriptions settings": "Einstellungen für Beschreibungen", + "Close Modal Dialog": "Modales Fenster schließen", + "Descriptions": "Beschreibungen", + "descriptions off": "Beschreibungen aus", + "The media is encrypted and we do not have the keys to decrypt it.": "Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.", + ", opens descriptions settings dialog": ", öffnet Einstellungen für Beschreibungen", + "Audio Track": "Tonspur", + "Text": "Schrift", + "White": "Weiß", + "Black": "Schwarz", + "Red": "Rot", + "Green": "Grün", + "Blue": "Blau", + "Yellow": "Gelb", + "Magenta": "Magenta", + "Cyan": "Türkis", + "Background": "Hintergrund", + "Window": "Fenster", + "Transparent": "Durchsichtig", + "Semi-Transparent": "Halbdurchsichtig", + "Opaque": "Undurchsictig", + "Font Size": "Schriftgröße", + "Text Edge Style": "Textkantenstil", + "None": "Kein", + "Raised": "Erhoben", + "Depressed": "Gedrückt", + "Uniform": "Uniform", + "Dropshadow": "Schlagschatten", + "Font Family": "Schristfamilie", + "Proportional Sans-Serif": "Proportionale Sans-Serif", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Proportionale Serif", + "Monospace Serif": "Monospace Serif", + "Casual": "Zwanglos", + "Script": "Schreibeschrift", + "Small Caps": "Small-Caps", + "Reset": "Zurücksetzen", + "restore all settings to the default values": "Alle Einstellungen auf die Standardwerte zurücksetzen", + "Done": "Fertig", + "Caption Settings Dialog": "Einstellungsdialog für Untertitel", + "Beginning of dialog window. Escape will cancel and close the window.": "Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.", + "End of dialog window.": "Ende des Dialogfensters.", + "Audio Player": "Audio-Player", + "Video Player": "Video-Player", + "Progress Bar": "Forschrittsbalken", + "progress bar timing: currentTime={1} duration={2}": "{1} von {2}", + "Volume Level": "Lautstärkestufe" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/de.json b/Resources/public/js/vendor/video-js/lang/de.json new file mode 100644 index 00000000..329fb477 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/de.json @@ -0,0 +1,84 @@ +{ + "Play": "Wiedergabe", + "Pause": "Pause", + "Replay": "Erneut abspielen", + "Current Time": "Aktueller Zeitpunkt", + "Duration": "Dauer", + "Remaining Time": "Verbleibende Zeit", + "Stream Type": "Streamtyp", + "LIVE": "LIVE", + "Loaded": "Geladen", + "Progress": "Status", + "Fullscreen": "Vollbild", + "Non-Fullscreen": "Kein Vollbild", + "Mute": "Ton aus", + "Unmute": "Ton ein", + "Playback Rate": "Wiedergabegeschwindigkeit", + "Subtitles": "Untertitel", + "subtitles off": "Untertitel aus", + "Captions": "Untertitel", + "captions off": "Untertitel aus", + "Chapters": "Kapitel", + "You aborted the media playback": "Sie haben die Videowiedergabe abgebrochen.", + "A network error caused the media download to fail part-way.": "Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.", + "No compatible source was found for this media.": "Für dieses Video wurde keine kompatible Quelle gefunden.", + "Play Video": "Video abspielen", + "Close": "Schließen", + "Modal Window": "Modales Fenster", + "This is a modal window": "Dies ist ein modales Fenster", + "This modal can be closed by pressing the Escape key or activating the close button.": "Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche \"Schließen\" wird dieses modale Fenster geschlossen.", + ", opens captions settings dialog": ", öffnet Einstellungen für Untertitel", + ", opens subtitles settings dialog": ", öffnet Einstellungen für Untertitel", + ", selected": ", ausgewählt", + "captions settings": "Untertiteleinstellungen", + "subtitles settings": "Untertiteleinstellungen", + "descriptions settings": "Einstellungen für Beschreibungen", + "Close Modal Dialog": "Modales Fenster schließen", + "Descriptions": "Beschreibungen", + "descriptions off": "Beschreibungen aus", + "The media is encrypted and we do not have the keys to decrypt it.": "Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.", + ", opens descriptions settings dialog": ", öffnet Einstellungen für Beschreibungen", + "Audio Track": "Tonspur", + "Text": "Schrift", + "White": "Weiß", + "Black": "Schwarz", + "Red": "Rot", + "Green": "Grün", + "Blue": "Blau", + "Yellow": "Gelb", + "Magenta": "Magenta", + "Cyan": "Türkis", + "Background": "Hintergrund", + "Window": "Fenster", + "Transparent": "Durchsichtig", + "Semi-Transparent": "Halbdurchsichtig", + "Opaque": "Undurchsictig", + "Font Size": "Schriftgröße", + "Text Edge Style": "Textkantenstil", + "None": "Kein", + "Raised": "Erhoben", + "Depressed": "Gedrückt", + "Uniform": "Uniform", + "Dropshadow": "Schlagschatten", + "Font Family": "Schristfamilie", + "Proportional Sans-Serif": "Proportionale Sans-Serif", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Proportionale Serif", + "Monospace Serif": "Monospace Serif", + "Casual": "Zwanglos", + "Script": "Schreibeschrift", + "Small Caps": "Small-Caps", + "Reset": "Zurücksetzen", + "restore all settings to the default values": "Alle Einstellungen auf die Standardwerte zurücksetzen", + "Done": "Fertig", + "Caption Settings Dialog": "Einstellungsdialog für Untertitel", + "Beginning of dialog window. Escape will cancel and close the window.": "Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.", + "End of dialog window.": "Ende des Dialogfensters.", + "Audio Player": "Audio-Player", + "Video Player": "Video-Player", + "Progress Bar": "Forschrittsbalken", + "progress bar timing: currentTime={1} duration={2}": "{1} von {2}", + "Volume Level": "Lautstärkestufe" +} diff --git a/Resources/public/js/vendor/video-js/lang/el.js b/Resources/public/js/vendor/video-js/lang/el.js new file mode 100644 index 00000000..795b430d --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/el.js @@ -0,0 +1,40 @@ +videojs.addLanguage('el', { + "Play": "Aναπαραγωγή", + "Pause": "Παύση", + "Current Time": "Τρέχων χρόνος", + "Duration": "Συνολικός χρόνος", + "Remaining Time": "Υπολοιπόμενος χρόνος", + "Stream Type": "Τύπος ροής", + "LIVE": "ΖΩΝΤΑΝΑ", + "Loaded": "Φόρτωση επιτυχής", + "Progress": "Πρόοδος", + "Fullscreen": "Πλήρης οθόνη", + "Non-Fullscreen": "Έξοδος από πλήρη οθόνη", + "Mute": "Σίγαση", + "Unmute": "Kατάργηση σίγασης", + "Playback Rate": "Ρυθμός αναπαραγωγής", + "Subtitles": "Υπότιτλοι", + "subtitles off": "απόκρυψη υπότιτλων", + "Captions": "Λεζάντες", + "captions off": "απόκρυψη λεζάντων", + "Chapters": "Κεφάλαια", + "Close Modal Dialog": "Κλείσιμο παραθύρου", + "Descriptions": "Περιγραφές", + "descriptions off": "απόκρυψη περιγραφών", + "Audio Track": "Ροή ήχου", + "You aborted the media playback": "Ακυρώσατε την αναπαραγωγή", + "A network error caused the media download to fail part-way.": "Ένα σφάλμα δικτύου προκάλεσε την αποτυχία μεταφόρτωσης του αρχείου προς αναπαραγωγή.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Το αρχείο προς αναπαραγωγή δεν ήταν δυνατό να φορτωθεί είτε γιατί υπήρξε σφάλμα στον διακομιστή ή το δίκτυο, είτε γιατί ο τύπος του αρχείου δεν υποστηρίζεται.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Η αναπαραγωγή ακυρώθηκε είτε λόγω κατεστραμμένου αρχείου, είτε γιατί το αρχείο απαιτεί λειτουργίες που δεν υποστηρίζονται από το πρόγραμμα περιήγησης που χρησιμοποιείτε.", + "No compatible source was found for this media.": "Δεν βρέθηκε συμβατή πηγή αναπαραγωγής για το συγκεκριμένο αρχείο.", + "The media is encrypted and we do not have the keys to decrypt it.": "Το αρχείο προς αναπαραγωγή είναι κρυπτογραφημένo και δεν υπάρχουν τα απαραίτητα κλειδιά αποκρυπτογράφησης.", + "Play Video": "Αναπαραγωγή βίντεο", + "Close": "Κλείσιμο", + "Modal Window": "Aναδυόμενο παράθυρο", + "This is a modal window": "Το παρών είναι ένα αναδυόμενο παράθυρο", + "This modal can be closed by pressing the Escape key or activating the close button.": "Αυτό το παράθυρο μπορεί να εξαφανιστεί πατώντας το πλήκτρο Escape ή πατώντας το κουμπί κλεισίματος.", + ", opens captions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις λεζάντες", + ", opens subtitles settings dialog": ", εμφανίζει τις ρυθμίσεις για τους υπότιτλους", + ", opens descriptions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις περιγραφές", + ", selected": ", επιλεγμένο" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/el.json b/Resources/public/js/vendor/video-js/lang/el.json new file mode 100644 index 00000000..16b48b83 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/el.json @@ -0,0 +1,40 @@ +{ + "Play": "Aναπαραγωγή", + "Pause": "Παύση", + "Current Time": "Τρέχων χρόνος", + "Duration": "Συνολικός χρόνος", + "Remaining Time": "Υπολοιπόμενος χρόνος", + "Stream Type": "Τύπος ροής", + "LIVE": "ΖΩΝΤΑΝΑ", + "Loaded": "Φόρτωση επιτυχής", + "Progress": "Πρόοδος", + "Fullscreen": "Πλήρης οθόνη", + "Non-Fullscreen": "Έξοδος από πλήρη οθόνη", + "Mute": "Σίγαση", + "Unmute": "Kατάργηση σίγασης", + "Playback Rate": "Ρυθμός αναπαραγωγής", + "Subtitles": "Υπότιτλοι", + "subtitles off": "απόκρυψη υπότιτλων", + "Captions": "Λεζάντες", + "captions off": "απόκρυψη λεζάντων", + "Chapters": "Κεφάλαια", + "Close Modal Dialog": "Κλείσιμο παραθύρου", + "Descriptions": "Περιγραφές", + "descriptions off": "απόκρυψη περιγραφών", + "Audio Track": "Ροή ήχου", + "You aborted the media playback": "Ακυρώσατε την αναπαραγωγή", + "A network error caused the media download to fail part-way.": "Ένα σφάλμα δικτύου προκάλεσε την αποτυχία μεταφόρτωσης του αρχείου προς αναπαραγωγή.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Το αρχείο προς αναπαραγωγή δεν ήταν δυνατό να φορτωθεί είτε γιατί υπήρξε σφάλμα στον διακομιστή ή το δίκτυο, είτε γιατί ο τύπος του αρχείου δεν υποστηρίζεται.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Η αναπαραγωγή ακυρώθηκε είτε λόγω κατεστραμμένου αρχείου, είτε γιατί το αρχείο απαιτεί λειτουργίες που δεν υποστηρίζονται από το πρόγραμμα περιήγησης που χρησιμοποιείτε.", + "No compatible source was found for this media.": "Δεν βρέθηκε συμβατή πηγή αναπαραγωγής για το συγκεκριμένο αρχείο.", + "The media is encrypted and we do not have the keys to decrypt it.": "Το αρχείο προς αναπαραγωγή είναι κρυπτογραφημένo και δεν υπάρχουν τα απαραίτητα κλειδιά αποκρυπτογράφησης.", + "Play Video": "Αναπαραγωγή βίντεο", + "Close": "Κλείσιμο", + "Modal Window": "Aναδυόμενο παράθυρο", + "This is a modal window": "Το παρών είναι ένα αναδυόμενο παράθυρο", + "This modal can be closed by pressing the Escape key or activating the close button.": "Αυτό το παράθυρο μπορεί να εξαφανιστεί πατώντας το πλήκτρο Escape ή πατώντας το κουμπί κλεισίματος.", + ", opens captions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις λεζάντες", + ", opens subtitles settings dialog": ", εμφανίζει τις ρυθμίσεις για τους υπότιτλους", + ", opens descriptions settings dialog": ", εμφανίζει τις ρυθμίσεις για τις περιγραφές", + ", selected": ", επιλεγμένο" +} diff --git a/Resources/public/js/vendor/video-js/lang/en.js b/Resources/public/js/vendor/video-js/lang/en.js new file mode 100644 index 00000000..b076e60c --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/en.js @@ -0,0 +1,87 @@ +videojs.addLanguage('en', { + "Audio Player": "Audio Player", + "Video Player": "Video Player", + "Play": "Play", + "Pause": "Pause", + "Replay": "Replay", + "Current Time": "Current Time", + "Duration": "Duration", + "Remaining Time": "Remaining Time", + "Stream Type": "Stream Type", + "LIVE": "LIVE", + "Seek to live, currently behind live": "Seek to live, currently behind live", + "Seek to live, currently playing live": "Seek to live, currently playing live", + "Loaded": "Loaded", + "Progress": "Progress", + "Progress Bar": "Progress Bar", + "progress bar timing: currentTime={1} duration={2}": "{1} of {2}", + "Fullscreen": "Fullscreen", + "Non-Fullscreen": "Non-Fullscreen", + "Mute": "Mute", + "Unmute": "Unmute", + "Playback Rate": "Playback Rate", + "Subtitles": "Subtitles", + "subtitles off": "subtitles off", + "Captions": "Captions", + "captions off": "captions off", + "Chapters": "Chapters", + "Descriptions": "Descriptions", + "descriptions off": "descriptions off", + "Audio Track": "Audio Track", + "Volume Level": "Volume Level", + "You aborted the media playback": "You aborted the media playback", + "A network error caused the media download to fail part-way.": "A network error caused the media download to fail part-way.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "The media could not be loaded, either because the server or network failed or because the format is not supported.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.", + "No compatible source was found for this media.": "No compatible source was found for this media.", + "The media is encrypted and we do not have the keys to decrypt it.": "The media is encrypted and we do not have the keys to decrypt it.", + "Play Video": "Play Video", + "Close": "Close", + "Close Modal Dialog": "Close Modal Dialog", + "Modal Window": "Modal Window", + "This is a modal window": "This is a modal window", + "This modal can be closed by pressing the Escape key or activating the close button.": "This modal can be closed by pressing the Escape key or activating the close button.", + ", opens captions settings dialog": ", opens captions settings dialog", + ", opens subtitles settings dialog": ", opens subtitles settings dialog", + ", opens descriptions settings dialog": ", opens descriptions settings dialog", + ", selected": ", selected", + "captions settings": "captions settings", + "subtitles settings": "subititles settings", + "descriptions settings": "descriptions settings", + "Text": "Text", + "White": "White", + "Black": "Black", + "Red": "Red", + "Green": "Green", + "Blue": "Blue", + "Yellow": "Yellow", + "Magenta": "Magenta", + "Cyan": "Cyan", + "Background": "Background", + "Window": "Window", + "Transparent": "Transparent", + "Semi-Transparent": "Semi-Transparent", + "Opaque": "Opaque", + "Font Size": "Font Size", + "Text Edge Style": "Text Edge Style", + "None": "None", + "Raised": "Raised", + "Depressed": "Depressed", + "Uniform": "Uniform", + "Dropshadow": "Dropshadow", + "Font Family": "Font Family", + "Proportional Sans-Serif": "Proportional Sans-Serif", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Proportional Serif", + "Monospace Serif": "Monospace Serif", + "Casual": "Casual", + "Script": "Script", + "Small Caps": "Small Caps", + "Reset": "Reset", + "restore all settings to the default values": "restore all settings to the default values", + "Done": "Done", + "Caption Settings Dialog": "Caption Settings Dialog", + "Beginning of dialog window. Escape will cancel and close the window.": "Beginning of dialog window. Escape will cancel and close the window.", + "End of dialog window.": "End of dialog window.", + "{1} is loading.": "{1} is loading." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/en.json b/Resources/public/js/vendor/video-js/lang/en.json new file mode 100644 index 00000000..3724b524 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/en.json @@ -0,0 +1,87 @@ +{ + "Audio Player": "Audio Player", + "Video Player": "Video Player", + "Play": "Play", + "Pause": "Pause", + "Replay": "Replay", + "Current Time": "Current Time", + "Duration": "Duration", + "Remaining Time": "Remaining Time", + "Stream Type": "Stream Type", + "LIVE": "LIVE", + "Seek to live, currently behind live": "Seek to live, currently behind live", + "Seek to live, currently playing live": "Seek to live, currently playing live", + "Loaded": "Loaded", + "Progress": "Progress", + "Progress Bar": "Progress Bar", + "progress bar timing: currentTime={1} duration={2}": "{1} of {2}", + "Fullscreen": "Fullscreen", + "Non-Fullscreen": "Non-Fullscreen", + "Mute": "Mute", + "Unmute": "Unmute", + "Playback Rate": "Playback Rate", + "Subtitles": "Subtitles", + "subtitles off": "subtitles off", + "Captions": "Captions", + "captions off": "captions off", + "Chapters": "Chapters", + "Descriptions": "Descriptions", + "descriptions off": "descriptions off", + "Audio Track": "Audio Track", + "Volume Level": "Volume Level", + "You aborted the media playback": "You aborted the media playback", + "A network error caused the media download to fail part-way.": "A network error caused the media download to fail part-way.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "The media could not be loaded, either because the server or network failed or because the format is not supported.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.", + "No compatible source was found for this media.": "No compatible source was found for this media.", + "The media is encrypted and we do not have the keys to decrypt it.": "The media is encrypted and we do not have the keys to decrypt it.", + "Play Video": "Play Video", + "Close": "Close", + "Close Modal Dialog": "Close Modal Dialog", + "Modal Window": "Modal Window", + "This is a modal window": "This is a modal window", + "This modal can be closed by pressing the Escape key or activating the close button.": "This modal can be closed by pressing the Escape key or activating the close button.", + ", opens captions settings dialog": ", opens captions settings dialog", + ", opens subtitles settings dialog": ", opens subtitles settings dialog", + ", opens descriptions settings dialog": ", opens descriptions settings dialog", + ", selected": ", selected", + "captions settings": "captions settings", + "subtitles settings": "subititles settings", + "descriptions settings": "descriptions settings", + "Text": "Text", + "White": "White", + "Black": "Black", + "Red": "Red", + "Green": "Green", + "Blue": "Blue", + "Yellow": "Yellow", + "Magenta": "Magenta", + "Cyan": "Cyan", + "Background": "Background", + "Window": "Window", + "Transparent": "Transparent", + "Semi-Transparent": "Semi-Transparent", + "Opaque": "Opaque", + "Font Size": "Font Size", + "Text Edge Style": "Text Edge Style", + "None": "None", + "Raised": "Raised", + "Depressed": "Depressed", + "Uniform": "Uniform", + "Dropshadow": "Dropshadow", + "Font Family": "Font Family", + "Proportional Sans-Serif": "Proportional Sans-Serif", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Proportional Serif", + "Monospace Serif": "Monospace Serif", + "Casual": "Casual", + "Script": "Script", + "Small Caps": "Small Caps", + "Reset": "Reset", + "restore all settings to the default values": "restore all settings to the default values", + "Done": "Done", + "Caption Settings Dialog": "Caption Settings Dialog", + "Beginning of dialog window. Escape will cancel and close the window.": "Beginning of dialog window. Escape will cancel and close the window.", + "End of dialog window.": "End of dialog window.", + "{1} is loading.": "{1} is loading." +} diff --git a/Resources/public/js/vendor/video-js/lang/es.js b/Resources/public/js/vendor/video-js/lang/es.js new file mode 100644 index 00000000..9e2af6de --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/es.js @@ -0,0 +1,27 @@ +videojs.addLanguage('es', { + "Play": "Reproducción", + "Play Video": "Reproducción Vídeo", + "Pause": "Pausa", + "Current Time": "Tiempo reproducido", + "Duration": "Duración total", + "Remaining Time": "Tiempo restante", + "Stream Type": "Tipo de secuencia", + "LIVE": "DIRECTO", + "Loaded": "Cargado", + "Progress": "Progreso", + "Fullscreen": "Pantalla completa", + "Non-Fullscreen": "Pantalla no completa", + "Mute": "Silenciar", + "Unmute": "No silenciado", + "Playback Rate": "Velocidad de reproducción", + "Subtitles": "Subtítulos", + "subtitles off": "Subtítulos desactivados", + "Captions": "Subtítulos especiales", + "captions off": "Subtítulos especiales desactivados", + "Chapters": "Capítulos", + "You aborted the media playback": "Ha interrumpido la reproducción del vídeo.", + "A network error caused the media download to fail part-way.": "Un error de red ha interrumpido la descarga del vídeo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "No se ha podido cargar el vídeo debido a un fallo de red o del servidor o porque el formato es incompatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La reproducción de vídeo se ha interrumpido por un problema de corrupción de datos o porque el vídeo precisa funciones que su navegador no ofrece.", + "No compatible source was found for this media.": "No se ha encontrado ninguna fuente compatible con este vídeo." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/es.json b/Resources/public/js/vendor/video-js/lang/es.json new file mode 100644 index 00000000..86457cf7 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/es.json @@ -0,0 +1,27 @@ +{ + "Play": "Reproducción", + "Play Video": "Reproducción Vídeo", + "Pause": "Pausa", + "Current Time": "Tiempo reproducido", + "Duration": "Duración total", + "Remaining Time": "Tiempo restante", + "Stream Type": "Tipo de secuencia", + "LIVE": "DIRECTO", + "Loaded": "Cargado", + "Progress": "Progreso", + "Fullscreen": "Pantalla completa", + "Non-Fullscreen": "Pantalla no completa", + "Mute": "Silenciar", + "Unmute": "No silenciado", + "Playback Rate": "Velocidad de reproducción", + "Subtitles": "Subtítulos", + "subtitles off": "Subtítulos desactivados", + "Captions": "Subtítulos especiales", + "captions off": "Subtítulos especiales desactivados", + "Chapters": "Capítulos", + "You aborted the media playback": "Ha interrumpido la reproducción del vídeo.", + "A network error caused the media download to fail part-way.": "Un error de red ha interrumpido la descarga del vídeo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "No se ha podido cargar el vídeo debido a un fallo de red o del servidor o porque el formato es incompatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La reproducción de vídeo se ha interrumpido por un problema de corrupción de datos o porque el vídeo precisa funciones que su navegador no ofrece.", + "No compatible source was found for this media.": "No se ha encontrado ninguna fuente compatible con este vídeo." +} diff --git a/Resources/public/js/vendor/video-js/lang/fa.js b/Resources/public/js/vendor/video-js/lang/fa.js new file mode 100644 index 00000000..9e666f4c --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/fa.js @@ -0,0 +1,84 @@ +videojs.addLanguage('fa', { + "Audio Player": "پخش کننده صوتی", + "Video Player": "پخش کننده ویدیو", + "Play": "پخش", + "Pause": "مکث", + "Replay": "بازپخش", + "Current Time": "زمان کنونی", + "Duration": "مدت زمان", + "Remaining Time": "زمان باقیمانده", + "Stream Type": "نوع استریم", + "LIVE": "زنده", + "Loaded": "بارگیری شده", + "Progress": "پیشرفت", + "Progress Bar": "نوار پیشرفت", + "progress bar timing: currentTime={1} duration={2}": "{1} از {2}", + "Fullscreen": "تمام‌صفحه", + "Non-Fullscreen": "غیر تمام‌صفحه", + "Mute": "بی صدا", + "Unmute": "صدا دار", + "Playback Rate": "سرعت پخش", + "Subtitles": "زیرنویس", + "subtitles off": "بدون زیرنویس", + "Captions": "زیرتوضیح", + "captions off": "بدون زیرتوضیح", + "Chapters": "قسمت‌ها", + "Descriptions": "توصیف", + "descriptions off": "بدون توصیف", + "Audio Track": "صوت", + "Volume Level": "میزان صدا", + "You aborted the media playback": "شما پخش را قطع کردید.", + "A network error caused the media download to fail part-way.": "خطای شبکه باعث عدم بارگیری بخشی از رسانه شد.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": ".رسانه قابل بارگیری نیست. علت آن ممکن است خطا در اتصال یا عدم پشتیبانی از فرمت باشد", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "پخش رسانه به علت اشکال در آن یا عدم پشتیبانی مرورگر شما قطع شد.", + "No compatible source was found for this media.": "هیچ منبع سازگاری، برای این رسانه پیدا نشد.", + "The media is encrypted and we do not have the keys to decrypt it.": "این رسانه رمزنگاری شده است و ما کلید رمزگشایی آن را نداریم.", + "Play Video": "پخش ویدیو", + "Close": "بستن", + "Close Modal Dialog": "بستن پنجره مودال", + "Modal Window": "پنجره مودال", + "This is a modal window": "این پنجره مودال", + "This modal can be closed by pressing the Escape key or activating the close button.": "این پنجره با دکمه اسکیپ با دکمه بستن قابل بسته شدن میباشد.", + ", opens captions settings dialog": ", تنظیمات زیرتوضیح را باز میکند", + ", opens subtitles settings dialog": ", تنظیمات زیرنویس را باز میکند", + ", opens descriptions settings dialog": ", تنظیمات توصیفات را باز میکند", + ", selected": ", انتخاب شده", + "captions settings": "تنظیمات زیرتوضیح", + "subtitles settings": "تنظیمات زیرنویس", + "descriptions settings": "تنظیمات توصیفات", + "Text": "متن", + "White": "سفید", + "Black": "سیاه", + "Red": "قرمز", + "Green": "سبز", + "Blue": "آبی", + "Yellow": "زرد", + "Magenta": "ارغوانی", + "Cyan": "سبزآبی", + "Background": "زمینه", + "Window": "پنجره", + "Transparent": "شفاف", + "Semi-Transparent": "نیمه شفاف", + "Opaque": "مات", + "Font Size": "اندازه فونت", + "Text Edge Style": "سبک لبه متن", + "None": "هیچ", + "Raised": "برآمده", + "Depressed": "فرورفته", + "Uniform": "یکنواخت", + "Dropshadow": "سایه دار", + "Font Family": "نوع فونت", + "Proportional Sans-Serif": "سنس-سریف متناسب", + "Monospace Sans-Serif": "سنس-سریف هم اندازه", + "Proportional Serif": "سریف متناسب", + "Monospace Serif": "سریف هم اندازه", + "Casual": "فانتزی", + "Script": "دست خط", + "Small Caps": "حروف کوچک به بزرگ", + "Reset": "باز نشاندن", + "restore all settings to the default values": "بازیابی همه تنظیمات به حالت اولیه", + "Done": "تکمیل", + "Caption Settings Dialog": "پنجره تنظیمات عناوین", + "Beginning of dialog window. Escape will cancel and close the window.": "ابتدای پنجره محاوره‌ای. دکمه اسکیپ پنجره را لغو میکند و میبندد.", + "End of dialog window.": "انتهای پنجره محاوره‌ای." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/fa.json b/Resources/public/js/vendor/video-js/lang/fa.json new file mode 100644 index 00000000..e2c366b6 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/fa.json @@ -0,0 +1,84 @@ +{ + "Audio Player": "پخش کننده صوتی", + "Video Player": "پخش کننده ویدیو", + "Play": "پخش", + "Pause": "مکث", + "Replay": "بازپخش", + "Current Time": "زمان کنونی", + "Duration": "مدت زمان", + "Remaining Time": "زمان باقیمانده", + "Stream Type": "نوع استریم", + "LIVE": "زنده", + "Loaded": "بارگیری شده", + "Progress": "پیشرفت", + "Progress Bar": "نوار پیشرفت", + "progress bar timing: currentTime={1} duration={2}": "{1} از {2}", + "Fullscreen": "تمام‌صفحه", + "Non-Fullscreen": "غیر تمام‌صفحه", + "Mute": "بی صدا", + "Unmute": "صدا دار", + "Playback Rate": "سرعت پخش", + "Subtitles": "زیرنویس", + "subtitles off": "بدون زیرنویس", + "Captions": "زیرتوضیح", + "captions off": "بدون زیرتوضیح", + "Chapters": "قسمت‌ها", + "Descriptions": "توصیف", + "descriptions off": "بدون توصیف", + "Audio Track": "صوت", + "Volume Level": "میزان صدا", + "You aborted the media playback": "شما پخش را قطع کردید.", + "A network error caused the media download to fail part-way.": "خطای شبکه باعث عدم بارگیری بخشی از رسانه شد.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": ".رسانه قابل بارگیری نیست. علت آن ممکن است خطا در اتصال یا عدم پشتیبانی از فرمت باشد", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "پخش رسانه به علت اشکال در آن یا عدم پشتیبانی مرورگر شما قطع شد.", + "No compatible source was found for this media.": "هیچ منبع سازگاری، برای این رسانه پیدا نشد.", + "The media is encrypted and we do not have the keys to decrypt it.": "این رسانه رمزنگاری شده است و ما کلید رمزگشایی آن را نداریم.", + "Play Video": "پخش ویدیو", + "Close": "بستن", + "Close Modal Dialog": "بستن پنجره مودال", + "Modal Window": "پنجره مودال", + "This is a modal window": "این پنجره مودال", + "This modal can be closed by pressing the Escape key or activating the close button.": "این پنجره با دکمه اسکیپ با دکمه بستن قابل بسته شدن میباشد.", + ", opens captions settings dialog": ", تنظیمات زیرتوضیح را باز میکند", + ", opens subtitles settings dialog": ", تنظیمات زیرنویس را باز میکند", + ", opens descriptions settings dialog": ", تنظیمات توصیفات را باز میکند", + ", selected": ", انتخاب شده", + "captions settings": "تنظیمات زیرتوضیح", + "subtitles settings": "تنظیمات زیرنویس", + "descriptions settings": "تنظیمات توصیفات", + "Text": "متن", + "White": "سفید", + "Black": "سیاه", + "Red": "قرمز", + "Green": "سبز", + "Blue": "آبی", + "Yellow": "زرد", + "Magenta": "ارغوانی", + "Cyan": "سبزآبی", + "Background": "زمینه", + "Window": "پنجره", + "Transparent": "شفاف", + "Semi-Transparent": "نیمه شفاف", + "Opaque": "مات", + "Font Size": "اندازه فونت", + "Text Edge Style": "سبک لبه متن", + "None": "هیچ", + "Raised": "برآمده", + "Depressed": "فرورفته", + "Uniform": "یکنواخت", + "Dropshadow": "سایه دار", + "Font Family": "نوع فونت", + "Proportional Sans-Serif": "سنس-سریف متناسب", + "Monospace Sans-Serif": "سنس-سریف هم اندازه", + "Proportional Serif": "سریف متناسب", + "Monospace Serif": "سریف هم اندازه", + "Casual": "فانتزی", + "Script": "دست خط", + "Small Caps": "حروف کوچک به بزرگ", + "Reset": "باز نشاندن", + "restore all settings to the default values": "بازیابی همه تنظیمات به حالت اولیه", + "Done": "تکمیل", + "Caption Settings Dialog": "پنجره تنظیمات عناوین", + "Beginning of dialog window. Escape will cancel and close the window.": "ابتدای پنجره محاوره‌ای. دکمه اسکیپ پنجره را لغو میکند و میبندد.", + "End of dialog window.": "انتهای پنجره محاوره‌ای." +} diff --git a/Resources/public/js/vendor/video-js/lang/fi.js b/Resources/public/js/vendor/video-js/lang/fi.js new file mode 100644 index 00000000..e14fb8c9 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/fi.js @@ -0,0 +1,26 @@ +videojs.addLanguage('fi', { + "Play": "Toisto", + "Pause": "Tauko", + "Current Time": "Tämänhetkinen aika", + "Duration": "Kokonaisaika", + "Remaining Time": "Jäljellä oleva aika", + "Stream Type": "Lähetystyyppi", + "LIVE": "LIVE", + "Loaded": "Ladattu", + "Progress": "Edistyminen", + "Fullscreen": "Koko näyttö", + "Non-Fullscreen": "Koko näyttö pois", + "Mute": "Ääni pois", + "Unmute": "Ääni päällä", + "Playback Rate": "Toistonopeus", + "Subtitles": "Tekstitys", + "subtitles off": "Tekstitys pois", + "Captions": "Tekstitys", + "captions off": "Tekstitys pois", + "Chapters": "Kappaleet", + "You aborted the media playback": "Olet keskeyttänyt videotoiston.", + "A network error caused the media download to fail part-way.": "Verkkovirhe keskeytti videon latauksen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videon lataus ei onnistunut joko palvelin- tai verkkovirheestä tai väärästä formaatista johtuen.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videon toisto keskeytyi, koska media on vaurioitunut tai käyttää käyttää toimintoja, joita selaimesi ei tue.", + "No compatible source was found for this media.": "Tälle videolle ei löytynyt yhteensopivaa lähdettä." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/fi.json b/Resources/public/js/vendor/video-js/lang/fi.json new file mode 100644 index 00000000..9cd419b0 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/fi.json @@ -0,0 +1,26 @@ +{ + "Play": "Toisto", + "Pause": "Tauko", + "Current Time": "Tämänhetkinen aika", + "Duration": "Kokonaisaika", + "Remaining Time": "Jäljellä oleva aika", + "Stream Type": "Lähetystyyppi", + "LIVE": "LIVE", + "Loaded": "Ladattu", + "Progress": "Edistyminen", + "Fullscreen": "Koko näyttö", + "Non-Fullscreen": "Koko näyttö pois", + "Mute": "Ääni pois", + "Unmute": "Ääni päällä", + "Playback Rate": "Toistonopeus", + "Subtitles": "Tekstitys", + "subtitles off": "Tekstitys pois", + "Captions": "Tekstitys", + "captions off": "Tekstitys pois", + "Chapters": "Kappaleet", + "You aborted the media playback": "Olet keskeyttänyt videotoiston.", + "A network error caused the media download to fail part-way.": "Verkkovirhe keskeytti videon latauksen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videon lataus ei onnistunut joko palvelin- tai verkkovirheestä tai väärästä formaatista johtuen.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videon toisto keskeytyi, koska media on vaurioitunut tai käyttää käyttää toimintoja, joita selaimesi ei tue.", + "No compatible source was found for this media.": "Tälle videolle ei löytynyt yhteensopivaa lähdettä." +} diff --git a/Resources/public/js/vendor/video-js/lang/fr.js b/Resources/public/js/vendor/video-js/lang/fr.js new file mode 100644 index 00000000..cf5b57ce --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/fr.js @@ -0,0 +1,84 @@ +videojs.addLanguage('fr', { + "Audio Player": "Lecteur audio", + "Video Player": "Lecteur vidéo", + "Play": "Lecture", + "Pause": "Pause", + "Replay": "Revoir", + "Current Time": "Temps actuel", + "Duration": "Durée", + "Remaining Time": "Temps restant", + "Stream Type": "Type de flux", + "LIVE": "EN DIRECT", + "Loaded": "Chargé", + "Progress": "Progression", + "Progress Bar": "Barre de progression", + "progress bar timing: currentTime={1} duration={2}": "{1} de {2}", + "Fullscreen": "Plein écran", + "Non-Fullscreen": "Fenêtré", + "Mute": "Sourdine", + "Unmute": "Son activé", + "Playback Rate": "Vitesse de lecture", + "Subtitles": "Sous-titres", + "subtitles off": "Sous-titres désactivés", + "Captions": "Sous-titres transcrits", + "captions off": "Sous-titres transcrits désactivés", + "Chapters": "Chapitres", + "Descriptions": "Descriptions", + "descriptions off": "descriptions désactivées", + "Audio Track": "Piste audio", + "Volume Level": "Niveau de volume", + "You aborted the media playback": "Vous avez interrompu la lecture de la vidéo.", + "A network error caused the media download to fail part-way.": "Une erreur de réseau a interrompu le téléchargement de la vidéo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.", + "No compatible source was found for this media.": "Aucune source compatible n'a été trouvée pour cette vidéo.", + "The media is encrypted and we do not have the keys to decrypt it.": "Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.", + "Play Video": "Lire la vidéo", + "Close": "Fermer", + "Close Modal Dialog": "Fermer la boîte de dialogue modale", + "Modal Window": "Fenêtre modale", + "This is a modal window": "Ceci est une fenêtre modale", + "This modal can be closed by pressing the Escape key or activating the close button.": "Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.", + ", opens captions settings dialog": ", ouvrir les paramètres des sous-titres transcrits", + ", opens subtitles settings dialog": ", ouvrir les paramètres des sous-titres", + ", opens descriptions settings dialog": ", ouvrir les paramètres des descriptions", + ", selected": ", sélectionné", + "captions settings": "Paramètres des sous-titres transcrits", + "subtitles settings": "Paramètres des sous-titres", + "descriptions settings": "Paramètres des descriptions", + "Text": "Texte", + "White": "Blanc", + "Black": "Noir", + "Red": "Rouge", + "Green": "Vert", + "Blue": "Bleu", + "Yellow": "Jaune", + "Magenta": "Magenta", + "Cyan": "Cyan", + "Background": "Arrière-plan", + "Window": "Fenêtre", + "Transparent": "Transparent", + "Semi-Transparent": "Semi-transparent", + "Opaque": "Opaque", + "Font Size": "Taille des caractères", + "Text Edge Style": "Style des contours du texte", + "None": "Aucun", + "Raised": "Élevé", + "Depressed": "Enfoncé", + "Uniform": "Uniforme", + "Dropshadow": "Ombre portée", + "Font Family": "Famille de polices", + "Proportional Sans-Serif": "Polices à chasse variable sans empattement (Proportional Sans-Serif)", + "Monospace Sans-Serif": "Polices à chasse fixe sans empattement (Monospace Sans-Serif)", + "Proportional Serif": "Polices à chasse variable avec empattement (Proportional Serif)", + "Monospace Serif": "Polices à chasse fixe avec empattement (Monospace Serif)", + "Casual": "Manuscrite", + "Script": "Scripte", + "Small Caps": "Petites capitales", + "Reset": "Réinitialiser", + "restore all settings to the default values": "Restaurer tous les paramètres aux valeurs par défaut", + "Done": "Terminé", + "Caption Settings Dialog": "Boîte de dialogue des paramètres des sous-titres transcrits", + "Beginning of dialog window. Escape will cancel and close the window.": "Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.", + "End of dialog window.": "Fin de la fenêtre de dialogue." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/fr.json b/Resources/public/js/vendor/video-js/lang/fr.json new file mode 100644 index 00000000..8bfeafde --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/fr.json @@ -0,0 +1,84 @@ +{ + "Audio Player": "Lecteur audio", + "Video Player": "Lecteur vidéo", + "Play": "Lecture", + "Pause": "Pause", + "Replay": "Revoir", + "Current Time": "Temps actuel", + "Duration": "Durée", + "Remaining Time": "Temps restant", + "Stream Type": "Type de flux", + "LIVE": "EN DIRECT", + "Loaded": "Chargé", + "Progress": "Progression", + "Progress Bar": "Barre de progression", + "progress bar timing: currentTime={1} duration={2}": "{1} de {2}", + "Fullscreen": "Plein écran", + "Non-Fullscreen": "Fenêtré", + "Mute": "Sourdine", + "Unmute": "Son activé", + "Playback Rate": "Vitesse de lecture", + "Subtitles": "Sous-titres", + "subtitles off": "Sous-titres désactivés", + "Captions": "Sous-titres transcrits", + "captions off": "Sous-titres transcrits désactivés", + "Chapters": "Chapitres", + "Descriptions": "Descriptions", + "descriptions off": "descriptions désactivées", + "Audio Track": "Piste audio", + "Volume Level": "Niveau de volume", + "You aborted the media playback": "Vous avez interrompu la lecture de la vidéo.", + "A network error caused the media download to fail part-way.": "Une erreur de réseau a interrompu le téléchargement de la vidéo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.", + "No compatible source was found for this media.": "Aucune source compatible n'a été trouvée pour cette vidéo.", + "The media is encrypted and we do not have the keys to decrypt it.": "Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.", + "Play Video": "Lire la vidéo", + "Close": "Fermer", + "Close Modal Dialog": "Fermer la boîte de dialogue modale", + "Modal Window": "Fenêtre modale", + "This is a modal window": "Ceci est une fenêtre modale", + "This modal can be closed by pressing the Escape key or activating the close button.": "Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.", + ", opens captions settings dialog": ", ouvrir les paramètres des sous-titres transcrits", + ", opens subtitles settings dialog": ", ouvrir les paramètres des sous-titres", + ", opens descriptions settings dialog": ", ouvrir les paramètres des descriptions", + ", selected": ", sélectionné", + "captions settings": "Paramètres des sous-titres transcrits", + "subtitles settings": "Paramètres des sous-titres", + "descriptions settings": "Paramètres des descriptions", + "Text": "Texte", + "White": "Blanc", + "Black": "Noir", + "Red": "Rouge", + "Green": "Vert", + "Blue": "Bleu", + "Yellow": "Jaune", + "Magenta": "Magenta", + "Cyan": "Cyan", + "Background": "Arrière-plan", + "Window": "Fenêtre", + "Transparent": "Transparent", + "Semi-Transparent": "Semi-transparent", + "Opaque": "Opaque", + "Font Size": "Taille des caractères", + "Text Edge Style": "Style des contours du texte", + "None": "Aucun", + "Raised": "Élevé", + "Depressed": "Enfoncé", + "Uniform": "Uniforme", + "Dropshadow": "Ombre portée", + "Font Family": "Famille de polices", + "Proportional Sans-Serif": "Polices à chasse variable sans empattement (Proportional Sans-Serif)", + "Monospace Sans-Serif": "Polices à chasse fixe sans empattement (Monospace Sans-Serif)", + "Proportional Serif": "Polices à chasse variable avec empattement (Proportional Serif)", + "Monospace Serif": "Polices à chasse fixe avec empattement (Monospace Serif)", + "Casual": "Manuscrite", + "Script": "Scripte", + "Small Caps": "Petites capitales", + "Reset": "Réinitialiser", + "restore all settings to the default values": "Restaurer tous les paramètres aux valeurs par défaut", + "Done": "Terminé", + "Caption Settings Dialog": "Boîte de dialogue des paramètres des sous-titres transcrits", + "Beginning of dialog window. Escape will cancel and close the window.": "Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.", + "End of dialog window.": "Fin de la fenêtre de dialogue." +} diff --git a/Resources/public/js/vendor/video-js/lang/gl.js b/Resources/public/js/vendor/video-js/lang/gl.js new file mode 100644 index 00000000..a1dd5e8e --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/gl.js @@ -0,0 +1,27 @@ +videojs.addLanguage('gl', { + "Play": "Reprodución", + "Play Video": "Reprodución Vídeo", + "Pause": "Pausa", + "Current Time": "Tempo reproducido", + "Duration": "Duración total", + "Remaining Time": "Tempo restante", + "Stream Type": "Tipo de secuencia", + "LIVE": "DIRECTO", + "Loaded": "Cargado", + "Progress": "Progreso", + "Fullscreen": "Pantalla completa", + "Non-Fullscreen": "Pantalla non completa", + "Mute": "Silenciar", + "Unmute": "Non silenciado", + "Playback Rate": "Velocidade de reprodución", + "Subtitles": "Subtítulos", + "subtitles off": "Subtítulos desactivados", + "Captions": "Subtítulos con lenda", + "captions off": "Subtítulos con lenda desactivados", + "Chapters": "Capítulos", + "You aborted the media playback": "Interrompeches a reprodución do vídeo.", + "A network error caused the media download to fail part-way.": "Un erro de rede interrompeu a descarga do vídeo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Non se puido cargar o vídeo debido a un fallo de rede ou do servidor ou porque o formato é incompatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reproducción de vídeo interrompeuse por un problema de corrupción de datos ou porque o vídeo precisa funcións que o teu navegador non ofrece.", + "No compatible source was found for this media.": "Non se atopou ningunha fonte compatible con este vídeo." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/gl.json b/Resources/public/js/vendor/video-js/lang/gl.json new file mode 100644 index 00000000..1a4b8d80 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/gl.json @@ -0,0 +1,27 @@ +{ + "Play": "Reprodución", + "Play Video": "Reprodución Vídeo", + "Pause": "Pausa", + "Current Time": "Tempo reproducido", + "Duration": "Duración total", + "Remaining Time": "Tempo restante", + "Stream Type": "Tipo de secuencia", + "LIVE": "DIRECTO", + "Loaded": "Cargado", + "Progress": "Progreso", + "Fullscreen": "Pantalla completa", + "Non-Fullscreen": "Pantalla non completa", + "Mute": "Silenciar", + "Unmute": "Non silenciado", + "Playback Rate": "Velocidade de reprodución", + "Subtitles": "Subtítulos", + "subtitles off": "Subtítulos desactivados", + "Captions": "Subtítulos con lenda", + "captions off": "Subtítulos con lenda desactivados", + "Chapters": "Capítulos", + "You aborted the media playback": "Interrompeches a reprodución do vídeo.", + "A network error caused the media download to fail part-way.": "Un erro de rede interrompeu a descarga do vídeo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Non se puido cargar o vídeo debido a un fallo de rede ou do servidor ou porque o formato é incompatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reproducción de vídeo interrompeuse por un problema de corrupción de datos ou porque o vídeo precisa funcións que o teu navegador non ofrece.", + "No compatible source was found for this media.": "Non se atopou ningunha fonte compatible con este vídeo." +} diff --git a/Resources/public/js/vendor/video-js/lang/he.js b/Resources/public/js/vendor/video-js/lang/he.js new file mode 100644 index 00000000..bc246895 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/he.js @@ -0,0 +1,84 @@ +videojs.addLanguage('he', { + "Audio Player": "נַגָּן שמע", + "Video Player": "נַגָּן וידאו", + "Play": "נַגֵּן", + "Pause": "השהה", + "Replay": "נַגֵּן שוב", + "Current Time": "זמן נוכחי", + "Duration": "זמן כולל", + "Remaining Time": "זמן נותר", + "Stream Type": "סוג Stream", + "LIVE": "שידור חי", + "Loaded": "נטען", + "Progress": "התקדמות", + "Progress Bar": "סרגל התקדמות", + "progress bar timing: currentTime={1} duration={2}": "{1} מתוך {2}", + "Fullscreen": "מסך מלא", + "Non-Fullscreen": "מסך לא מלא", + "Mute": "השתק", + "Unmute": "בטל השתקה", + "Playback Rate": "קצב ניגון", + "Subtitles": "כתוביות", + "subtitles off": "כתוביות כבויות", + "Captions": "כיתובים", + "captions off": "כיתובים כבויים", + "Chapters": "פרקים", + "Descriptions": "תיאורים", + "descriptions off": "תיאורים כבויים", + "Audio Track": "רצועת שמע", + "Volume Level": "רמת ווליום", + "You aborted the media playback": "ביטלת את השמעת המדיה", + "A network error caused the media download to fail part-way.": "שגיאת רשת גרמה להורדת המדיה להיכשל באמצע.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "לא ניתן לטעון את המדיה, או מכיוון שהרשת או השרת כשלו או מכיוון שהפורמט אינו נתמך.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "השמעת המדיה בוטלה בשל בעית השחטת מידע או מכיוון שהמדיה עשתה שימוש בתכונות שהדפדפן שלך לא תמך בהן.", + "No compatible source was found for this media.": "לא נמצא מקור תואם עבור מדיה זו.", + "The media is encrypted and we do not have the keys to decrypt it.": "המדיה מוצפנת ואין בידינו את המפתח כדי לפענח אותה.", + "Play Video": "נַגֵּן וידאו", + "Close": "סְגוֹר", + "Close Modal Dialog": "סְגוֹר דו-שיח מודאלי", + "Modal Window": "חלון מודאלי", + "This is a modal window": "זהו חלון מודאלי", + "This modal can be closed by pressing the Escape key or activating the close button.": "ניתן לסגור חלון מודאלי זה ע\"י לחיצה על כפתור ה-Escape או הפעלת כפתור הסגירה.", + ", opens captions settings dialog": ", פותח חלון הגדרות כיתובים", + ", opens subtitles settings dialog": ", פותח חלון הגדרות כתוביות", + ", opens descriptions settings dialog": ", פותח חלון הגדרות תיאורים", + ", selected": ", נבחר/ו", + "captions settings": "הגדרות כיתובים", + "subtitles settings": "הגדרות כתוביות", + "descriptions settings": "הגדרות תיאורים", + "Text": "טקסט", + "White": "לבן", + "Black": "שחור", + "Red": "אדום", + "Green": "ירוק", + "Blue": "כחול", + "Yellow": "צהוב", + "Magenta": "מַגֶ'נטָה", + "Cyan": "טורקיז", + "Background": "רקע", + "Window": "חלון", + "Transparent": "שקוף", + "Semi-Transparent": "שקוף למחצה", + "Opaque": "אָטוּם", + "Font Size": "גודל גופן", + "Text Edge Style": "סגנון קצוות טקסט", + "None": "ללא", + "Raised": "מורם", + "Depressed": "מורד", + "Uniform": "אחיד", + "Dropshadow": "הטלת צל", + "Font Family": "משפחת גופן", + "Proportional Sans-Serif": "פרופורציוני וללא תגיות (Proportional Sans-Serif)", + "Monospace Sans-Serif": "ברוחב אחיד וללא תגיות (Monospace Sans-Serif)", + "Proportional Serif": "פרופורציוני ועם תגיות (Proportional Serif)", + "Monospace Serif": "ברוחב אחיד ועם תגיות (Monospace Serif)", + "Casual": "אַגָבִי", + "Script": "תסריט", + "Small Caps": "אותיות קטנות", + "Reset": "אִפּוּס", + "restore all settings to the default values": "שחזר את כל ההגדרות לערכי ברירת המחדל", + "Done": "בוצע", + "Caption Settings Dialog": "דו-שיח הגדרות כיתובים", + "Beginning of dialog window. Escape will cancel and close the window.": "תחילת חלון דו-שיח. Escape יבטל ויסגור את החלון", + "End of dialog window.": "סוף חלון דו-שיח." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/he.json b/Resources/public/js/vendor/video-js/lang/he.json new file mode 100644 index 00000000..7bfb0d56 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/he.json @@ -0,0 +1,84 @@ +{ + "Audio Player": "נַגָּן שמע", + "Video Player": "נַגָּן וידאו", + "Play": "נַגֵּן", + "Pause": "השהה", + "Replay": "נַגֵּן שוב", + "Current Time": "זמן נוכחי", + "Duration": "זמן כולל", + "Remaining Time": "זמן נותר", + "Stream Type": "סוג Stream", + "LIVE": "שידור חי", + "Loaded": "נטען", + "Progress": "התקדמות", + "Progress Bar": "סרגל התקדמות", + "progress bar timing: currentTime={1} duration={2}": "{1} מתוך {2}", + "Fullscreen": "מסך מלא", + "Non-Fullscreen": "מסך לא מלא", + "Mute": "השתק", + "Unmute": "בטל השתקה", + "Playback Rate": "קצב ניגון", + "Subtitles": "כתוביות", + "subtitles off": "כתוביות כבויות", + "Captions": "כיתובים", + "captions off": "כיתובים כבויים", + "Chapters": "פרקים", + "Descriptions": "תיאורים", + "descriptions off": "תיאורים כבויים", + "Audio Track": "רצועת שמע", + "Volume Level": "רמת ווליום", + "You aborted the media playback": "ביטלת את השמעת המדיה", + "A network error caused the media download to fail part-way.": "שגיאת רשת גרמה להורדת המדיה להיכשל באמצע.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "לא ניתן לטעון את המדיה, או מכיוון שהרשת או השרת כשלו או מכיוון שהפורמט אינו נתמך.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "השמעת המדיה בוטלה בשל בעית השחטת מידע או מכיוון שהמדיה עשתה שימוש בתכונות שהדפדפן שלך לא תמך בהן.", + "No compatible source was found for this media.": "לא נמצא מקור תואם עבור מדיה זו.", + "The media is encrypted and we do not have the keys to decrypt it.": "המדיה מוצפנת ואין בידינו את המפתח כדי לפענח אותה.", + "Play Video": "נַגֵּן וידאו", + "Close": "סְגוֹר", + "Close Modal Dialog": "סְגוֹר דו-שיח מודאלי", + "Modal Window": "חלון מודאלי", + "This is a modal window": "זהו חלון מודאלי", + "This modal can be closed by pressing the Escape key or activating the close button.": "ניתן לסגור חלון מודאלי זה ע\"י לחיצה על כפתור ה-Escape או הפעלת כפתור הסגירה.", + ", opens captions settings dialog": ", פותח חלון הגדרות כיתובים", + ", opens subtitles settings dialog": ", פותח חלון הגדרות כתוביות", + ", opens descriptions settings dialog": ", פותח חלון הגדרות תיאורים", + ", selected": ", נבחר/ו", + "captions settings": "הגדרות כיתובים", + "subtitles settings": "הגדרות כתוביות", + "descriptions settings": "הגדרות תיאורים", + "Text": "טקסט", + "White": "לבן", + "Black": "שחור", + "Red": "אדום", + "Green": "ירוק", + "Blue": "כחול", + "Yellow": "צהוב", + "Magenta": "מַגֶ'נטָה", + "Cyan": "טורקיז", + "Background": "רקע", + "Window": "חלון", + "Transparent": "שקוף", + "Semi-Transparent": "שקוף למחצה", + "Opaque": "אָטוּם", + "Font Size": "גודל גופן", + "Text Edge Style": "סגנון קצוות טקסט", + "None": "ללא", + "Raised": "מורם", + "Depressed": "מורד", + "Uniform": "אחיד", + "Dropshadow": "הטלת צל", + "Font Family": "משפחת גופן", + "Proportional Sans-Serif": "פרופורציוני וללא תגיות (Proportional Sans-Serif)", + "Monospace Sans-Serif": "ברוחב אחיד וללא תגיות (Monospace Sans-Serif)", + "Proportional Serif": "פרופורציוני ועם תגיות (Proportional Serif)", + "Monospace Serif": "ברוחב אחיד ועם תגיות (Monospace Serif)", + "Casual": "אַגָבִי", + "Script": "תסריט", + "Small Caps": "אותיות קטנות", + "Reset": "אִפּוּס", + "restore all settings to the default values": "שחזר את כל ההגדרות לערכי ברירת המחדל", + "Done": "בוצע", + "Caption Settings Dialog": "דו-שיח הגדרות כיתובים", + "Beginning of dialog window. Escape will cancel and close the window.": "תחילת חלון דו-שיח. Escape יבטל ויסגור את החלון", + "End of dialog window.": "סוף חלון דו-שיח." +} diff --git a/Resources/public/js/vendor/video-js/lang/hr.js b/Resources/public/js/vendor/video-js/lang/hr.js new file mode 100644 index 00000000..2606362a --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/hr.js @@ -0,0 +1,26 @@ +videojs.addLanguage('hr', { + "Play": "Pusti", + "Pause": "Pauza", + "Current Time": "Trenutno vrijeme", + "Duration": "Vrijeme trajanja", + "Remaining Time": "Preostalo vrijeme", + "Stream Type": "Način strimovanja", + "LIVE": "UŽIVO", + "Loaded": "Učitan", + "Progress": "Progres", + "Fullscreen": "Puni ekran", + "Non-Fullscreen": "Mali ekran", + "Mute": "Prigušen", + "Unmute": "Ne-prigušen", + "Playback Rate": "Stopa reprodukcije", + "Subtitles": "Podnaslov", + "subtitles off": "Podnaslov deaktiviran", + "Captions": "Titlovi", + "captions off": "Titlovi deaktivirani", + "Chapters": "Poglavlja", + "You aborted the media playback": "Isključili ste reprodukciju videa.", + "A network error caused the media download to fail part-way.": "Video se prestao preuzimati zbog greške na mreži.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video se ne može reproducirati zbog servera, greške u mreži ili je format ne podržan.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Reprodukcija videa je zaustavljenja zbog greške u formatu ili zbog verzije vašeg pretraživača.", + "No compatible source was found for this media.": "Nije nađen nijedan kompatibilan izvor ovog videa." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/hr.json b/Resources/public/js/vendor/video-js/lang/hr.json new file mode 100644 index 00000000..32e1763f --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/hr.json @@ -0,0 +1,26 @@ +{ + "Play": "Pusti", + "Pause": "Pauza", + "Current Time": "Trenutno vrijeme", + "Duration": "Vrijeme trajanja", + "Remaining Time": "Preostalo vrijeme", + "Stream Type": "Način strimovanja", + "LIVE": "UŽIVO", + "Loaded": "Učitan", + "Progress": "Progres", + "Fullscreen": "Puni ekran", + "Non-Fullscreen": "Mali ekran", + "Mute": "Prigušen", + "Unmute": "Ne-prigušen", + "Playback Rate": "Stopa reprodukcije", + "Subtitles": "Podnaslov", + "subtitles off": "Podnaslov deaktiviran", + "Captions": "Titlovi", + "captions off": "Titlovi deaktivirani", + "Chapters": "Poglavlja", + "You aborted the media playback": "Isključili ste reprodukciju videa.", + "A network error caused the media download to fail part-way.": "Video se prestao preuzimati zbog greške na mreži.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video se ne može reproducirati zbog servera, greške u mreži ili je format ne podržan.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Reprodukcija videa je zaustavljenja zbog greške u formatu ili zbog verzije vašeg pretraživača.", + "No compatible source was found for this media.": "Nije nađen nijedan kompatibilan izvor ovog videa." +} diff --git a/Resources/public/js/vendor/video-js/lang/hu.js b/Resources/public/js/vendor/video-js/lang/hu.js new file mode 100644 index 00000000..69afdee5 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/hu.js @@ -0,0 +1,26 @@ +videojs.addLanguage('hu', { + "Play": "Lejátszás", + "Pause": "Szünet", + "Current Time": "Aktuális időpont", + "Duration": "Hossz", + "Remaining Time": "Hátralévő idő", + "Stream Type": "Adatfolyam típusa", + "LIVE": "ÉLŐ", + "Loaded": "Betöltve", + "Progress": "Állapot", + "Fullscreen": "Teljes képernyő", + "Non-Fullscreen": "Normál méret", + "Mute": "Némítás", + "Unmute": "Némítás kikapcsolva", + "Playback Rate": "Lejátszási sebesség", + "Subtitles": "Feliratok", + "subtitles off": "Feliratok kikapcsolva", + "Captions": "Magyarázó szöveg", + "captions off": "Magyarázó szöveg kikapcsolva", + "Chapters": "Fejezetek", + "You aborted the media playback": "Leállította a lejátszást", + "A network error caused the media download to fail part-way.": "Hálózati hiba miatt a videó részlegesen töltődött le.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "A videó nem tölthető be hálózati vagy kiszolgálói hiba miatt, vagy a formátuma nem támogatott.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A lejátszás adatsérülés miatt leállt, vagy a videó egyes tulajdonságait a böngészője nem támogatja.", + "No compatible source was found for this media.": "Nincs kompatibilis forrás ehhez a videóhoz." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/hu.json b/Resources/public/js/vendor/video-js/lang/hu.json new file mode 100644 index 00000000..c7aabbeb --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/hu.json @@ -0,0 +1,26 @@ +{ + "Play": "Lejátszás", + "Pause": "Szünet", + "Current Time": "Aktuális időpont", + "Duration": "Hossz", + "Remaining Time": "Hátralévő idő", + "Stream Type": "Adatfolyam típusa", + "LIVE": "ÉLŐ", + "Loaded": "Betöltve", + "Progress": "Állapot", + "Fullscreen": "Teljes képernyő", + "Non-Fullscreen": "Normál méret", + "Mute": "Némítás", + "Unmute": "Némítás kikapcsolva", + "Playback Rate": "Lejátszási sebesség", + "Subtitles": "Feliratok", + "subtitles off": "Feliratok kikapcsolva", + "Captions": "Magyarázó szöveg", + "captions off": "Magyarázó szöveg kikapcsolva", + "Chapters": "Fejezetek", + "You aborted the media playback": "Leállította a lejátszást", + "A network error caused the media download to fail part-way.": "Hálózati hiba miatt a videó részlegesen töltődött le.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "A videó nem tölthető be hálózati vagy kiszolgálói hiba miatt, vagy a formátuma nem támogatott.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A lejátszás adatsérülés miatt leállt, vagy a videó egyes tulajdonságait a böngészője nem támogatja.", + "No compatible source was found for this media.": "Nincs kompatibilis forrás ehhez a videóhoz." +} diff --git a/Resources/public/js/vendor/video-js/lang/it.js b/Resources/public/js/vendor/video-js/lang/it.js new file mode 100644 index 00000000..18a1c4c1 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/it.js @@ -0,0 +1,26 @@ +videojs.addLanguage('it', { + "Play": "Play", + "Pause": "Pausa", + "Current Time": "Orario attuale", + "Duration": "Durata", + "Remaining Time": "Tempo rimanente", + "Stream Type": "Tipo del Streaming", + "LIVE": "LIVE", + "Loaded": "Caricato", + "Progress": "Stato", + "Fullscreen": "Schermo intero", + "Non-Fullscreen": "Chiudi schermo intero", + "Mute": "Muto", + "Unmute": "Audio", + "Playback Rate": "Tasso di riproduzione", + "Subtitles": "Sottotitoli", + "subtitles off": "Senza sottotitoli", + "Captions": "Sottotitoli non udenti", + "captions off": "Senza sottotitoli non udenti", + "Chapters": "Capitolo", + "You aborted the media playback": "La riproduzione del filmato è stata interrotta.", + "A network error caused the media download to fail part-way.": "Il download del filmato è stato interrotto a causa di un problema rete.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Il filmato non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La riproduzione del filmato è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.", + "No compatible source was found for this media.": "Non ci sono fonti compatibili per questo filmato." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/it.json b/Resources/public/js/vendor/video-js/lang/it.json new file mode 100644 index 00000000..19f5a785 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/it.json @@ -0,0 +1,26 @@ +{ + "Play": "Play", + "Pause": "Pausa", + "Current Time": "Orario attuale", + "Duration": "Durata", + "Remaining Time": "Tempo rimanente", + "Stream Type": "Tipo del Streaming", + "LIVE": "LIVE", + "Loaded": "Caricato", + "Progress": "Stato", + "Fullscreen": "Schermo intero", + "Non-Fullscreen": "Chiudi schermo intero", + "Mute": "Muto", + "Unmute": "Audio", + "Playback Rate": "Tasso di riproduzione", + "Subtitles": "Sottotitoli", + "subtitles off": "Senza sottotitoli", + "Captions": "Sottotitoli non udenti", + "captions off": "Senza sottotitoli non udenti", + "Chapters": "Capitolo", + "You aborted the media playback": "La riproduzione del filmato è stata interrotta.", + "A network error caused the media download to fail part-way.": "Il download del filmato è stato interrotto a causa di un problema rete.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Il filmato non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La riproduzione del filmato è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.", + "No compatible source was found for this media.": "Non ci sono fonti compatibili per questo filmato." +} diff --git a/Resources/public/js/vendor/video-js/lang/ja.js b/Resources/public/js/vendor/video-js/lang/ja.js new file mode 100644 index 00000000..7d71cd10 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ja.js @@ -0,0 +1,26 @@ +videojs.addLanguage('ja', { + "Play": "再生", + "Pause": "一時停止", + "Current Time": "現在の時間", + "Duration": "長さ", + "Remaining Time": "残りの時間", + "Stream Type": "ストリームの種類", + "LIVE": "ライブ", + "Loaded": "ロード済み", + "Progress": "進行状況", + "Fullscreen": "フルスクリーン", + "Non-Fullscreen": "フルスクリーン以外", + "Mute": "ミュート", + "Unmute": "ミュート解除", + "Playback Rate": "再生レート", + "Subtitles": "サブタイトル", + "subtitles off": "サブタイトル オフ", + "Captions": "キャプション", + "captions off": "キャプション オフ", + "Chapters": "チャプター", + "You aborted the media playback": "動画再生を中止しました", + "A network error caused the media download to fail part-way.": "ネットワーク エラーにより動画のダウンロードが途中で失敗しました", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "サーバーまたはネットワークのエラー、またはフォーマットがサポートされていないため、動画をロードできませんでした", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "破損の問題、またはお使いのブラウザがサポートしていない機能が動画に使用されていたため、動画の再生が中止されました", + "No compatible source was found for this media.": "この動画に対して互換性のあるソースが見つかりませんでした" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ja.json b/Resources/public/js/vendor/video-js/lang/ja.json new file mode 100644 index 00000000..df5b6cf0 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ja.json @@ -0,0 +1,26 @@ +{ + "Play": "再生", + "Pause": "一時停止", + "Current Time": "現在の時間", + "Duration": "長さ", + "Remaining Time": "残りの時間", + "Stream Type": "ストリームの種類", + "LIVE": "ライブ", + "Loaded": "ロード済み", + "Progress": "進行状況", + "Fullscreen": "フルスクリーン", + "Non-Fullscreen": "フルスクリーン以外", + "Mute": "ミュート", + "Unmute": "ミュート解除", + "Playback Rate": "再生レート", + "Subtitles": "サブタイトル", + "subtitles off": "サブタイトル オフ", + "Captions": "キャプション", + "captions off": "キャプション オフ", + "Chapters": "チャプター", + "You aborted the media playback": "動画再生を中止しました", + "A network error caused the media download to fail part-way.": "ネットワーク エラーにより動画のダウンロードが途中で失敗しました", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "サーバーまたはネットワークのエラー、またはフォーマットがサポートされていないため、動画をロードできませんでした", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "破損の問題、またはお使いのブラウザがサポートしていない機能が動画に使用されていたため、動画の再生が中止されました", + "No compatible source was found for this media.": "この動画に対して互換性のあるソースが見つかりませんでした" +} diff --git a/Resources/public/js/vendor/video-js/lang/ko.js b/Resources/public/js/vendor/video-js/lang/ko.js new file mode 100644 index 00000000..74048c9b --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ko.js @@ -0,0 +1,26 @@ +videojs.addLanguage('ko', { + "Play": "재생", + "Pause": "일시중지", + "Current Time": "현재 시간", + "Duration": "지정 기간", + "Remaining Time": "남은 시간", + "Stream Type": "스트리밍 유형", + "LIVE": "라이브", + "Loaded": "로드됨", + "Progress": "진행", + "Fullscreen": "전체 화면", + "Non-Fullscreen": "전체 화면 해제", + "Mute": "음소거", + "Unmute": "음소거 해제", + "Playback Rate": "재생 비율", + "Subtitles": "서브타이틀", + "subtitles off": "서브타이틀 끄기", + "Captions": "자막", + "captions off": "자막 끄기", + "Chapters": "챕터", + "You aborted the media playback": "비디오 재생을 취소했습니다.", + "A network error caused the media download to fail part-way.": "네트워크 오류로 인하여 비디오 일부를 다운로드하지 못 했습니다.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "비디오를 로드할 수 없습니다. 서버 혹은 네트워크 오류 때문이거나 지원되지 않는 형식 때문일 수 있습니다.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "비디오 재생이 취소됐습니다. 비디오가 손상되었거나 비디오가 사용하는 기능을 브라우저에서 지원하지 않는 것 같습니다.", + "No compatible source was found for this media.": "비디오에 호환되지 않는 소스가 있습니다." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ko.json b/Resources/public/js/vendor/video-js/lang/ko.json new file mode 100644 index 00000000..879edaff --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ko.json @@ -0,0 +1,26 @@ +{ + "Play": "재생", + "Pause": "일시중지", + "Current Time": "현재 시간", + "Duration": "지정 기간", + "Remaining Time": "남은 시간", + "Stream Type": "스트리밍 유형", + "LIVE": "라이브", + "Loaded": "로드됨", + "Progress": "진행", + "Fullscreen": "전체 화면", + "Non-Fullscreen": "전체 화면 해제", + "Mute": "음소거", + "Unmute": "음소거 해제", + "Playback Rate": "재생 비율", + "Subtitles": "서브타이틀", + "subtitles off": "서브타이틀 끄기", + "Captions": "자막", + "captions off": "자막 끄기", + "Chapters": "챕터", + "You aborted the media playback": "비디오 재생을 취소했습니다.", + "A network error caused the media download to fail part-way.": "네트워크 오류로 인하여 비디오 일부를 다운로드하지 못 했습니다.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "비디오를 로드할 수 없습니다. 서버 혹은 네트워크 오류 때문이거나 지원되지 않는 형식 때문일 수 있습니다.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "비디오 재생이 취소됐습니다. 비디오가 손상되었거나 비디오가 사용하는 기능을 브라우저에서 지원하지 않는 것 같습니다.", + "No compatible source was found for this media.": "비디오에 호환되지 않는 소스가 있습니다." +} diff --git a/Resources/public/js/vendor/video-js/lang/nb.js b/Resources/public/js/vendor/video-js/lang/nb.js new file mode 100644 index 00000000..244abbc1 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/nb.js @@ -0,0 +1,26 @@ +videojs.addLanguage('nb', { + "Play": "Spill", + "Pause": "Pause", + "Current Time": "Aktuell tid", + "Duration": "Varighet", + "Remaining Time": "Gjenstående tid", + "Stream Type": "Type strøm", + "LIVE": "DIREKTE", + "Loaded": "Lastet inn", + "Progress": "Status", + "Fullscreen": "Fullskjerm", + "Non-Fullscreen": "Lukk fullskjerm", + "Mute": "Lyd av", + "Unmute": "Lyd på", + "Playback Rate": "Avspillingsrate", + "Subtitles": "Undertekst på", + "subtitles off": "Undertekst av", + "Captions": "Undertekst for hørselshemmede på", + "captions off": "Undertekst for hørselshemmede av", + "Chapters": "Kapitler", + "You aborted the media playback": "Du avbrøt avspillingen.", + "A network error caused the media download to fail part-way.": "En nettverksfeil avbrøt nedlasting av videoen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videoen kunne ikke lastes ned, på grunn av nettverksfeil eller serverfeil, eller fordi formatet ikke er støttet.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videoavspillingen ble avbrudt på grunn av ødelagte data eller fordi videoen ville gjøre noe som nettleseren din ikke har støtte for.", + "No compatible source was found for this media.": "Fant ikke en kompatibel kilde for dette mediainnholdet." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/nb.json b/Resources/public/js/vendor/video-js/lang/nb.json new file mode 100644 index 00000000..c92c572d --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/nb.json @@ -0,0 +1,26 @@ +{ + "Play": "Spill", + "Pause": "Pause", + "Current Time": "Aktuell tid", + "Duration": "Varighet", + "Remaining Time": "Gjenstående tid", + "Stream Type": "Type strøm", + "LIVE": "DIREKTE", + "Loaded": "Lastet inn", + "Progress": "Status", + "Fullscreen": "Fullskjerm", + "Non-Fullscreen": "Lukk fullskjerm", + "Mute": "Lyd av", + "Unmute": "Lyd på", + "Playback Rate": "Avspillingsrate", + "Subtitles": "Undertekst på", + "subtitles off": "Undertekst av", + "Captions": "Undertekst for hørselshemmede på", + "captions off": "Undertekst for hørselshemmede av", + "Chapters": "Kapitler", + "You aborted the media playback": "Du avbrøt avspillingen.", + "A network error caused the media download to fail part-way.": "En nettverksfeil avbrøt nedlasting av videoen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videoen kunne ikke lastes ned, på grunn av nettverksfeil eller serverfeil, eller fordi formatet ikke er støttet.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videoavspillingen ble avbrudt på grunn av ødelagte data eller fordi videoen ville gjøre noe som nettleseren din ikke har støtte for.", + "No compatible source was found for this media.": "Fant ikke en kompatibel kilde for dette mediainnholdet." +} diff --git a/Resources/public/js/vendor/video-js/lang/nl.js b/Resources/public/js/vendor/video-js/lang/nl.js new file mode 100644 index 00000000..0d043e92 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/nl.js @@ -0,0 +1,84 @@ +videojs.addLanguage('nl', { + "Audio Player": "Audiospeler", + "Video Player": "Videospeler", + "Play": "Afspelen", + "Pause": "Pauzeren", + "Replay": "Opnieuw afspelen", + "Current Time": "Huidige tijd", + "Duration": "Tijdsduur", + "Remaining Time": "Resterende tijd", + "Stream Type": "Streamtype", + "LIVE": "LIVE", + "Loaded": "Geladen", + "Progress": "Voortgang", + "Progress Bar": "Voortgangsbalk", + "progress bar timing: currentTime={1} duration={2}": "{1} van {2}", + "Fullscreen": "Volledig scherm", + "Non-Fullscreen": "Geen volledig scherm", + "Mute": "Dempen", + "Unmute": "Niet dempen", + "Playback Rate": "Afspeelsnelheid", + "Subtitles": "Ondertiteling", + "subtitles off": "ondertiteling uit", + "Captions": "Bijschriften", + "captions off": "bijschriften uit", + "Chapters": "Hoofdstukken", + "Descriptions": "Beschrijvingen", + "descriptions off": "beschrijvingen uit", + "Audio Track": "Audiospoor", + "Volume Level": "Geluidsniveau", + "You aborted the media playback": "U heeft het afspelen van de media afgebroken", + "A network error caused the media download to fail part-way.": "Een netwerkfout heeft ervoor gezorgd dat het downloaden van de media halverwege is mislukt.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "De media kon niet worden geladen, dit komt doordat of de server of het netwerk mislukt of doordat het formaat niet wordt ondersteund.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Het afspelen van de media is afgebroken door een probleem met beschadeigde gegevens of doordat de media functies gebruikt die uw browser niet ondersteund.", + "No compatible source was found for this media.": "Er is geen geschikte bron voor deze media gevonden.", + "The media is encrypted and we do not have the keys to decrypt it.": "De media is versleuteld en we hebben de sleutels niet om deze te ontsleutelen.", + "Play Video": "Video afspelen", + "Close": "Sluiten", + "Close Modal Dialog": "Extra venster sluiten", + "Modal Window": "Extra venster", + "This is a modal window": "Dit is een extra venster", + "This modal can be closed by pressing the Escape key or activating the close button.": "Dit venster kan worden gesloten door op de Escape-toets te drukken of door de sluiten-knop te activeren.", + ", opens captions settings dialog": ", opent instellingen-venster voor bijschriften", + ", opens subtitles settings dialog": ", opent instellingen-venster voor ondertitelingen", + ", opens descriptions settings dialog": ", opent instellingen-venster voor beschrijvingen", + ", selected": ", geselecteerd", + "captions settings": "bijschriften-instellingen", + "subtitles settings": "ondertiteling-instellingen", + "descriptions settings": "beschrijvingen-instellingen", + "Text": "Tekst", + "White": "Wit", + "Black": "Zwart", + "Red": "Rood", + "Green": "Groen", + "Blue": "Blauw", + "Yellow": "Geel", + "Magenta": "Magenta", + "Cyan": "Cyaan", + "Background": "Achtergrond", + "Window": "Venster", + "Transparent": "Transparant", + "Semi-Transparent": "Semi-transparant", + "Opaque": "Ondoorzichtig", + "Font Size": "Lettergrootte", + "Text Edge Style": "Stijl tekstrand", + "None": "Geen", + "Raised": "Verhoogd", + "Depressed": "Ingedrukt", + "Uniform": "Uniform", + "Dropshadow": "Schaduw", + "Font Family": "Lettertype", + "Proportional Sans-Serif": "Proportioneel sans-serif", + "Monospace Sans-Serif": "Monospace sans-serif", + "Proportional Serif": "Proportioneel serif", + "Monospace Serif": "Monospace serif", + "Casual": "Luchtig", + "Script": "Script", + "Small Caps": "Kleine hoofdletters", + "Reset": "Herstellen", + "restore all settings to the default values": "alle instellingen naar de standaardwaarden herstellen", + "Done": "Klaar", + "Caption Settings Dialog": "Venster voor bijschriften-instellingen", + "Beginning of dialog window. Escape will cancel and close the window.": "Begin van dialoogvenster. Escape zal annuleren en het venster sluiten.", + "End of dialog window.": "Einde van dialoogvenster." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/nl.json b/Resources/public/js/vendor/video-js/lang/nl.json new file mode 100644 index 00000000..c7d0b731 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/nl.json @@ -0,0 +1,84 @@ +{ + "Audio Player": "Audiospeler", + "Video Player": "Videospeler", + "Play": "Afspelen", + "Pause": "Pauzeren", + "Replay": "Opnieuw afspelen", + "Current Time": "Huidige tijd", + "Duration": "Tijdsduur", + "Remaining Time": "Resterende tijd", + "Stream Type": "Streamtype", + "LIVE": "LIVE", + "Loaded": "Geladen", + "Progress": "Voortgang", + "Progress Bar": "Voortgangsbalk", + "progress bar timing: currentTime={1} duration={2}": "{1} van {2}", + "Fullscreen": "Volledig scherm", + "Non-Fullscreen": "Geen volledig scherm", + "Mute": "Dempen", + "Unmute": "Niet dempen", + "Playback Rate": "Afspeelsnelheid", + "Subtitles": "Ondertiteling", + "subtitles off": "ondertiteling uit", + "Captions": "Bijschriften", + "captions off": "bijschriften uit", + "Chapters": "Hoofdstukken", + "Descriptions": "Beschrijvingen", + "descriptions off": "beschrijvingen uit", + "Audio Track": "Audiospoor", + "Volume Level": "Geluidsniveau", + "You aborted the media playback": "U heeft het afspelen van de media afgebroken", + "A network error caused the media download to fail part-way.": "Een netwerkfout heeft ervoor gezorgd dat het downloaden van de media halverwege is mislukt.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "De media kon niet worden geladen, dit komt doordat of de server of het netwerk mislukt of doordat het formaat niet wordt ondersteund.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Het afspelen van de media is afgebroken door een probleem met beschadeigde gegevens of doordat de media functies gebruikt die uw browser niet ondersteund.", + "No compatible source was found for this media.": "Er is geen geschikte bron voor deze media gevonden.", + "The media is encrypted and we do not have the keys to decrypt it.": "De media is versleuteld en we hebben de sleutels niet om deze te ontsleutelen.", + "Play Video": "Video afspelen", + "Close": "Sluiten", + "Close Modal Dialog": "Extra venster sluiten", + "Modal Window": "Extra venster", + "This is a modal window": "Dit is een extra venster", + "This modal can be closed by pressing the Escape key or activating the close button.": "Dit venster kan worden gesloten door op de Escape-toets te drukken of door de sluiten-knop te activeren.", + ", opens captions settings dialog": ", opent instellingen-venster voor bijschriften", + ", opens subtitles settings dialog": ", opent instellingen-venster voor ondertitelingen", + ", opens descriptions settings dialog": ", opent instellingen-venster voor beschrijvingen", + ", selected": ", geselecteerd", + "captions settings": "bijschriften-instellingen", + "subtitles settings": "ondertiteling-instellingen", + "descriptions settings": "beschrijvingen-instellingen", + "Text": "Tekst", + "White": "Wit", + "Black": "Zwart", + "Red": "Rood", + "Green": "Groen", + "Blue": "Blauw", + "Yellow": "Geel", + "Magenta": "Magenta", + "Cyan": "Cyaan", + "Background": "Achtergrond", + "Window": "Venster", + "Transparent": "Transparant", + "Semi-Transparent": "Semi-transparant", + "Opaque": "Ondoorzichtig", + "Font Size": "Lettergrootte", + "Text Edge Style": "Stijl tekstrand", + "None": "Geen", + "Raised": "Verhoogd", + "Depressed": "Ingedrukt", + "Uniform": "Uniform", + "Dropshadow": "Schaduw", + "Font Family": "Lettertype", + "Proportional Sans-Serif": "Proportioneel sans-serif", + "Monospace Sans-Serif": "Monospace sans-serif", + "Proportional Serif": "Proportioneel serif", + "Monospace Serif": "Monospace serif", + "Casual": "Luchtig", + "Script": "Script", + "Small Caps": "Kleine hoofdletters", + "Reset": "Herstellen", + "restore all settings to the default values": "alle instellingen naar de standaardwaarden herstellen", + "Done": "Klaar", + "Caption Settings Dialog": "Venster voor bijschriften-instellingen", + "Beginning of dialog window. Escape will cancel and close the window.": "Begin van dialoogvenster. Escape zal annuleren en het venster sluiten.", + "End of dialog window.": "Einde van dialoogvenster." +} \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/nn.js b/Resources/public/js/vendor/video-js/lang/nn.js new file mode 100644 index 00000000..77da1c4e --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/nn.js @@ -0,0 +1,26 @@ +videojs.addLanguage('nn', { + "Play": "Spel", + "Pause": "Pause", + "Current Time": "Aktuell tid", + "Duration": "Varigheit", + "Remaining Time": "Tid attende", + "Stream Type": "Type straum", + "LIVE": "DIREKTE", + "Loaded": "Lasta inn", + "Progress": "Status", + "Fullscreen": "Fullskjerm", + "Non-Fullscreen": "Stenga fullskjerm", + "Mute": "Ljod av", + "Unmute": "Ljod på", + "Playback Rate": "Avspelingsrate", + "Subtitles": "Teksting på", + "subtitles off": "Teksting av", + "Captions": "Teksting for høyrselshemma på", + "captions off": "Teksting for høyrselshemma av", + "Chapters": "Kapitel", + "You aborted the media playback": "Du avbraut avspelinga.", + "A network error caused the media download to fail part-way.": "Ein nettverksfeil avbraut nedlasting av videoen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videoen kunne ikkje lastas ned, på grunn av ein nettverksfeil eller serverfeil, eller av di formatet ikkje er stoda.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videoavspelinga blei broten på grunn av øydelagde data eller av di videoen ville gjera noe som nettlesaren din ikkje stodar.", + "No compatible source was found for this media.": "Fant ikke en kompatibel kilde for dette mediainnholdet." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/nn.json b/Resources/public/js/vendor/video-js/lang/nn.json new file mode 100644 index 00000000..19b6e729 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/nn.json @@ -0,0 +1,26 @@ +{ + "Play": "Spel", + "Pause": "Pause", + "Current Time": "Aktuell tid", + "Duration": "Varigheit", + "Remaining Time": "Tid attende", + "Stream Type": "Type straum", + "LIVE": "DIREKTE", + "Loaded": "Lasta inn", + "Progress": "Status", + "Fullscreen": "Fullskjerm", + "Non-Fullscreen": "Stenga fullskjerm", + "Mute": "Ljod av", + "Unmute": "Ljod på", + "Playback Rate": "Avspelingsrate", + "Subtitles": "Teksting på", + "subtitles off": "Teksting av", + "Captions": "Teksting for høyrselshemma på", + "captions off": "Teksting for høyrselshemma av", + "Chapters": "Kapitel", + "You aborted the media playback": "Du avbraut avspelinga.", + "A network error caused the media download to fail part-way.": "Ein nettverksfeil avbraut nedlasting av videoen.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Videoen kunne ikkje lastas ned, på grunn av ein nettverksfeil eller serverfeil, eller av di formatet ikkje er stoda.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Videoavspelinga blei broten på grunn av øydelagde data eller av di videoen ville gjera noe som nettlesaren din ikkje stodar.", + "No compatible source was found for this media.": "Fant ikke en kompatibel kilde for dette mediainnholdet." +} diff --git a/Resources/public/js/vendor/video-js/lang/oc.js b/Resources/public/js/vendor/video-js/lang/oc.js new file mode 100644 index 00000000..82c51572 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/oc.js @@ -0,0 +1,84 @@ +videojs.addLanguage('oc', { + "Audio Player": "Lector àudio", + "Video Player": "Lector vidèo", + "Play": "Lectura", + "Pause": "Pausa", + "Replay": "Tornar legir", + "Current Time": "Durada passada", + "Duration": "Durada", + "Remaining Time": "Temps restant", + "Stream Type": "Tipe de difusion", + "LIVE": "DIRÈCTE", + "Loaded": "Cargat", + "Progress": "Progression", + "Progress Bar": "Barra de progression", + "progress bar timing: currentTime={1} duration={2}": "{1} sus {2}", + "Fullscreen": "Ecran complèt", + "Non-Fullscreen": "Pas en ecran complèt", + "Mute": "Copar lo son", + "Unmute": "Restablir lo son", + "Playback Rate": "Velocitat de lectura", + "Subtitles": "Sostítols", + "subtitles off": "Sostítols desactivats", + "Captions": "Legendas", + "captions off": "Legendas desactivadas", + "Chapters": "Capítols", + "Descriptions": "Descripcions", + "descriptions off": "descripcions desactivadas", + "Audio Track": "Pista àudio", + "Volume Level": "Nivèl del volum", + "You aborted the media playback": "Avètz copat la lectura del mèdia.", + "A network error caused the media download to fail part-way.": "Una error de ret a provocat un fracàs del telecargament.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Lo mèdia a pas pogut èsser cargat, siá perque lo servidor o lo ret a fracassat siá perque lo format es pas compatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La lectura del mèdia es copada a causa d’un problèma de corrupcion o perque lo mèdia utiliza de foncionalitats pas suportadas pel navigador.", + "No compatible source was found for this media.": "Cap de font compatiblas pas trobada per aqueste mèdia.", + "The media is encrypted and we do not have the keys to decrypt it.": "Lo mèdia es chifrat e avèm pas las claus per lo deschifrar.", + "Play Video": "Legir la vidèo", + "Close": "Tampar", + "Close Modal Dialog": "Tampar la fenèstra", + "Modal Window": "Fenèstra", + "This is a modal window": "Aquò es una fenèstra", + "This modal can be closed by pressing the Escape key or activating the close button.": "Aquesta fenèstra pòt èsser tampada en quichar Escapar sul clavièr o en activar lo boton de tampadura.", + ", opens captions settings dialog": ", dobrís la fenèstra de paramètres de legendas", + ", opens subtitles settings dialog": ", dobrís la fenèstra de paramètres de sostítols", + ", opens descriptions settings dialog": ", dobrís la fenèstra de paramètres de descripcions", + ", selected": ", seleccionat", + "captions settings": "paramètres de legendas", + "subtitles settings": "paramètres de sostítols", + "descriptions settings": "paramètres de descripcions", + "Text": "Tèxte", + "White": "Blanc", + "Black": "Negre", + "Red": "Roge", + "Green": "Verd", + "Blue": "Blau", + "Yellow": "Jaune", + "Magenta": "Magenta", + "Cyan": "Cian", + "Background": "Rèireplan", + "Window": "Fenèstra", + "Transparent": "Transparent", + "Semi-Transparent": "Semitransparent", + "Opaque": "Opac", + "Font Size": "Talha de la polissa", + "Text Edge Style": "Estil dels contorn del tèxte", + "None": "Cap", + "Raised": "Naut", + "Depressed": "Enfonsat", + "Uniform": "Unifòrme", + "Dropshadow": "Ombrat", + "Font Family": "Familha de polissa", + "Proportional Sans-Serif": "Sans-Serif proporcionala", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Serif proporcionala", + "Monospace Serif": "Serif proporcionala", + "Casual": "Manuscrita", + "Script": "Script", + "Small Caps": "Pichonas majusculas", + "Reset": "Reïnicializar", + "restore all settings to the default values": "O restablir tot a las valors per defaut", + "Done": "Acabat", + "Caption Settings Dialog": "Fenèstra de paramètres de legenda", + "Beginning of dialog window. Escape will cancel and close the window.": "Debuta de la fenèstra. Escapar anullarà e tamparà la fenèstra", + "End of dialog window.": "Fin de la fenèstra." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/oc.json b/Resources/public/js/vendor/video-js/lang/oc.json new file mode 100644 index 00000000..c7a2c371 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/oc.json @@ -0,0 +1,84 @@ +{ + "Audio Player": "Lector àudio", + "Video Player": "Lector vidèo", + "Play": "Lectura", + "Pause": "Pausa", + "Replay": "Tornar legir", + "Current Time": "Durada passada", + "Duration": "Durada", + "Remaining Time": "Temps restant", + "Stream Type": "Tipe de difusion", + "LIVE": "DIRÈCTE", + "Loaded": "Cargat", + "Progress": "Progression", + "Progress Bar": "Barra de progression", + "progress bar timing: currentTime={1} duration={2}": "{1} sus {2}", + "Fullscreen": "Ecran complèt", + "Non-Fullscreen": "Pas en ecran complèt", + "Mute": "Copar lo son", + "Unmute": "Restablir lo son", + "Playback Rate": "Velocitat de lectura", + "Subtitles": "Sostítols", + "subtitles off": "Sostítols desactivats", + "Captions": "Legendas", + "captions off": "Legendas desactivadas", + "Chapters": "Capítols", + "Descriptions": "Descripcions", + "descriptions off": "descripcions desactivadas", + "Audio Track": "Pista àudio", + "Volume Level": "Nivèl del volum", + "You aborted the media playback": "Avètz copat la lectura del mèdia.", + "A network error caused the media download to fail part-way.": "Una error de ret a provocat un fracàs del telecargament.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Lo mèdia a pas pogut èsser cargat, siá perque lo servidor o lo ret a fracassat siá perque lo format es pas compatible.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "La lectura del mèdia es copada a causa d’un problèma de corrupcion o perque lo mèdia utiliza de foncionalitats pas suportadas pel navigador.", + "No compatible source was found for this media.": "Cap de font compatiblas pas trobada per aqueste mèdia.", + "The media is encrypted and we do not have the keys to decrypt it.": "Lo mèdia es chifrat e avèm pas las claus per lo deschifrar.", + "Play Video": "Legir la vidèo", + "Close": "Tampar", + "Close Modal Dialog": "Tampar la fenèstra", + "Modal Window": "Fenèstra", + "This is a modal window": "Aquò es una fenèstra", + "This modal can be closed by pressing the Escape key or activating the close button.": "Aquesta fenèstra pòt èsser tampada en quichar Escapar sul clavièr o en activar lo boton de tampadura.", + ", opens captions settings dialog": ", dobrís la fenèstra de paramètres de legendas", + ", opens subtitles settings dialog": ", dobrís la fenèstra de paramètres de sostítols", + ", opens descriptions settings dialog": ", dobrís la fenèstra de paramètres de descripcions", + ", selected": ", seleccionat", + "captions settings": "paramètres de legendas", + "subtitles settings": "paramètres de sostítols", + "descriptions settings": "paramètres de descripcions", + "Text": "Tèxte", + "White": "Blanc", + "Black": "Negre", + "Red": "Roge", + "Green": "Verd", + "Blue": "Blau", + "Yellow": "Jaune", + "Magenta": "Magenta", + "Cyan": "Cian", + "Background": "Rèireplan", + "Window": "Fenèstra", + "Transparent": "Transparent", + "Semi-Transparent": "Semitransparent", + "Opaque": "Opac", + "Font Size": "Talha de la polissa", + "Text Edge Style": "Estil dels contorn del tèxte", + "None": "Cap", + "Raised": "Naut", + "Depressed": "Enfonsat", + "Uniform": "Unifòrme", + "Dropshadow": "Ombrat", + "Font Family": "Familha de polissa", + "Proportional Sans-Serif": "Sans-Serif proporcionala", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Serif proporcionala", + "Monospace Serif": "Serif proporcionala", + "Casual": "Manuscrita", + "Script": "Script", + "Small Caps": "Pichonas majusculas", + "Reset": "Reïnicializar", + "restore all settings to the default values": "O restablir tot a las valors per defaut", + "Done": "Acabat", + "Caption Settings Dialog": "Fenèstra de paramètres de legenda", + "Beginning of dialog window. Escape will cancel and close the window.": "Debuta de la fenèstra. Escapar anullarà e tamparà la fenèstra", + "End of dialog window.": "Fin de la fenèstra." +} diff --git a/Resources/public/js/vendor/video-js/lang/pl.js b/Resources/public/js/vendor/video-js/lang/pl.js new file mode 100644 index 00000000..789f3ab5 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/pl.js @@ -0,0 +1,34 @@ +videojs.addLanguage('pl', { + "Play": "Odtwarzaj", + "Pause": "Pauza", + "Current Time": "Aktualny czas", + "Duration": "Czas trwania", + "Remaining Time": "Pozostały czas", + "Stream Type": "Typ strumienia", + "LIVE": "NA ŻYWO", + "Loaded": "Załadowany", + "Progress": "Status", + "Fullscreen": "Pełny ekran", + "Non-Fullscreen": "Pełny ekran niedostępny", + "Mute": "Wyłącz dźwięk", + "Unmute": "Włącz dźwięk", + "Playback Rate": "Szybkość odtwarzania", + "Subtitles": "Napisy", + "subtitles off": "Napisy wyłączone", + "Captions": "Transkrypcja", + "captions off": "Transkrypcja wyłączona", + "Chapters": "Rozdziały", + "You aborted the media playback": "Odtwarzanie zostało przerwane", + "A network error caused the media download to fail part-way.": "Problemy z siecią spowodowały błąd przy pobieraniu materiału wideo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Materiał wideo nie może być załadowany, ponieważ wystąpił problem z siecią lub format nie jest obsługiwany", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Odtwarzanie materiału wideo zostało przerwane z powodu uszkodzonego pliku wideo lub z powodu błędu funkcji, które nie są wspierane przez przeglądarkę.", + "No compatible source was found for this media.": "Dla tego materiału wideo nie znaleziono kompatybilnego źródła.", + "Play Video": "Odtwarzaj wideo", + "Close": "Zamknij", + "Modal Window": "Okno Modala", + "This is a modal window": "To jest okno modala", + "This modal can be closed by pressing the Escape key or activating the close button.": "Ten modal możesz zamknąć naciskając przycisk Escape albo wybierając przycisk Zamknij.", + ", opens captions settings dialog": ", otwiera okno dialogowe ustawień transkrypcji", + ", opens subtitles settings dialog": ", otwiera okno dialogowe napisów", + ", selected": ", zaznaczone" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/pl.json b/Resources/public/js/vendor/video-js/lang/pl.json new file mode 100644 index 00000000..e22c36c0 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/pl.json @@ -0,0 +1,34 @@ +{ + "Play": "Odtwarzaj", + "Pause": "Pauza", + "Current Time": "Aktualny czas", + "Duration": "Czas trwania", + "Remaining Time": "Pozostały czas", + "Stream Type": "Typ strumienia", + "LIVE": "NA ŻYWO", + "Loaded": "Załadowany", + "Progress": "Status", + "Fullscreen": "Pełny ekran", + "Non-Fullscreen": "Pełny ekran niedostępny", + "Mute": "Wyłącz dźwięk", + "Unmute": "Włącz dźwięk", + "Playback Rate": "Szybkość odtwarzania", + "Subtitles": "Napisy", + "subtitles off": "Napisy wyłączone", + "Captions": "Transkrypcja", + "captions off": "Transkrypcja wyłączona", + "Chapters": "Rozdziały", + "You aborted the media playback": "Odtwarzanie zostało przerwane", + "A network error caused the media download to fail part-way.": "Problemy z siecią spowodowały błąd przy pobieraniu materiału wideo.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Materiał wideo nie może być załadowany, ponieważ wystąpił problem z siecią lub format nie jest obsługiwany", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Odtwarzanie materiału wideo zostało przerwane z powodu uszkodzonego pliku wideo lub z powodu błędu funkcji, które nie są wspierane przez przeglądarkę.", + "No compatible source was found for this media.": "Dla tego materiału wideo nie znaleziono kompatybilnego źródła.", + "Play Video": "Odtwarzaj wideo", + "Close": "Zamknij", + "Modal Window": "Okno Modala", + "This is a modal window": "To jest okno modala", + "This modal can be closed by pressing the Escape key or activating the close button.": "Ten modal możesz zamknąć naciskając przycisk Escape albo wybierając przycisk Zamknij.", + ", opens captions settings dialog": ", otwiera okno dialogowe ustawień transkrypcji", + ", opens subtitles settings dialog": ", otwiera okno dialogowe napisów", + ", selected": ", zaznaczone" +} diff --git a/Resources/public/js/vendor/video-js/lang/pt-BR.js b/Resources/public/js/vendor/video-js/lang/pt-BR.js new file mode 100644 index 00000000..202d5abe --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/pt-BR.js @@ -0,0 +1,85 @@ +videojs.addLanguage('pt-BR', { + "Audio Player": "Reprodutor de áudio", + "Video Player": "Reprodutor de vídeo", + "Play": "Tocar", + "Pause": "Pausar", + "Replay": "Tocar novamente", + "Current Time": "Tempo", + "Duration": "Duração", + "Remaining Time": "Tempo Restante", + "Stream Type": "Tipo de Stream", + "LIVE": "AO VIVO", + "Loaded": "Carregado", + "Progress": "Progresso", + "Progress Bar": "Barra de progresso", + "progress bar timing: currentTime={1} duration={2}": "{1} de {2}", + "Fullscreen": "Tela Cheia", + "Non-Fullscreen": "Tela Normal", + "Mute": "Mudo", + "Unmute": "Habilitar Som", + "Playback Rate": "Velocidade", + "Subtitles": "Legendas", + "subtitles off": "Sem Legendas", + "Captions": "Anotações", + "captions off": "Sem Anotações", + "Chapters": "Capítulos", + "Descriptions": "Descrições", + "descriptions off": "sem descrições", + "Audio Track": "Faixa de áudio", + "Volume Level": "Nível de volume", + "You aborted the media playback": "Você parou a execução do vídeo.", + "A network error caused the media download to fail part-way.": "Um erro na rede causou falha durante o download da mídia.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "A mídia não pode ser carregada, por uma falha de rede ou servidor ou o formato não é suportado.", + "No compatible source was found for this media.": "Nenhuma fonte foi encontrada para esta mídia.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reprodução foi interrompida devido à um problema de mídia corrompida ou porque a mídia utiliza funções que seu navegador não suporta.", + "The media is encrypted and we do not have the keys to decrypt it.": "A mídia está criptografada e não temos as chaves para descriptografar.", + "Play Video": "Tocar Vídeo", + "Close": "Fechar", + "Close Modal Dialog": "Fechar Diálogo Modal", + "Modal Window": "Janela Modal", + "This is a modal window": "Isso é uma janela-modal", + "This modal can be closed by pressing the Escape key or activating the close button.": "Esta janela pode ser fechada pressionando a tecla de Escape.", + ", opens captions settings dialog": ", abre as configurações de legendas de comentários", + ", opens subtitles settings dialog": ", abre as configurações de legendas", + ", opens descriptions settings dialog": ", abre as configurações", + ", selected": ", selecionada", + "captions settings": "configurações de legendas de comentários", + "subtitles settings": "configurações de legendas", + "descriptions settings": "configurações das descrições", + "Text": "Texto", + "White": "Branco", + "Black": "Preto", + "Red": "Vermelho", + "Green": "Verde", + "Blue": "Azul", + "Yellow": "Amarelo", + "Magenta": "Magenta", + "Cyan": "Ciano", + "Background": "Plano-de-Fundo", + "Window": "Janela", + "Transparent": "Transparente", + "Semi-Transparent": "Semi-Transparente", + "Opaque": "Opaco", + "Font Size": "Tamanho da Fonte", + "Text Edge Style": "Estilo da Borda", + "None": "Nenhum", + "Raised": "Elevado", + "Depressed": "Acachapado", + "Uniform": "Uniforme", + "Dropshadow": "Sombra de projeção", + "Font Family": "Família da Fonte", + "Proportional Sans-Serif": "Sans-Serif(Sem serifa) Proporcional", + "Monospace Sans-Serif": "Sans-Serif(Sem serifa) Monoespaçada", + "Proportional Serif": "Serifa Proporcional", + "Monospace Serif": "Serifa Monoespaçada", + "Casual": "Casual", + "Script": "Script", + "Small Caps": "Maiúsculas Pequenas", + "Reset": "Redefinir", + "restore all settings to the default values": "restaurar todas as configurações aos valores padrão", + "Done": "Salvar", + "Caption Settings Dialog": "Caíxa-de-Diálogo das configurações de Legendas", + "Beginning of dialog window. Escape will cancel and close the window.": "Iniciando a Janela-de-Diálogo. Pressionar Escape irá cancelar e fechar a janela.", + "End of dialog window.": "Fim da Janela-de-Diálogo", + "{1} is loading.": "{1} está carregando." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/pt-BR.json b/Resources/public/js/vendor/video-js/lang/pt-BR.json new file mode 100644 index 00000000..47235fac --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/pt-BR.json @@ -0,0 +1,86 @@ +{ + "Audio Player": "Reprodutor de áudio", + "Video Player": "Reprodutor de vídeo", + "Play": "Tocar", + "Pause": "Pausar", + "Replay": "Tocar novamente", + "Current Time": "Tempo", + "Duration": "Duração", + "Remaining Time": "Tempo Restante", + "Stream Type": "Tipo de Stream", + "LIVE": "AO VIVO", + "Loaded": "Carregado", + "Progress": "Progresso", + "Progress Bar": "Barra de progresso", + "progress bar timing: currentTime={1} duration={2}": "{1} de {2}", + "Fullscreen": "Tela Cheia", + "Non-Fullscreen": "Tela Normal", + "Mute": "Mudo", + "Unmute": "Habilitar Som", + "Playback Rate": "Velocidade", + "Subtitles": "Legendas", + "subtitles off": "Sem Legendas", + "Captions": "Anotações", + "captions off": "Sem Anotações", + "Chapters": "Capítulos", + "Descriptions": "Descrições", + "descriptions off": "sem descrições", + "Audio Track": "Faixa de áudio", + "Volume Level": "Nível de volume", + "You aborted the media playback": "Você parou a execução do vídeo.", + "A network error caused the media download to fail part-way.": "Um erro na rede causou falha durante o download da mídia.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "A mídia não pode ser carregada, por uma falha de rede ou servidor ou o formato não é suportado.", + "No compatible source was found for this media.": "Não foi encontrada fonte de mídia compatível.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reprodução foi interrompida devido à um problema de mídia corrompida ou porque a mídia utiliza funções que seu navegador não suporta.", + "No compatible source was found for this media.": "Nenhuma fonte foi encontrada para esta mídia.", + "The media is encrypted and we do not have the keys to decrypt it.": "A mídia está criptografada e não temos as chaves para descriptografar.", + "Play Video": "Tocar Vídeo", + "Close": "Fechar", + "Close Modal Dialog": "Fechar Diálogo Modal", + "Modal Window": "Janela Modal", + "This is a modal window": "Isso é uma janela-modal", + "This modal can be closed by pressing the Escape key or activating the close button.": "Esta janela pode ser fechada pressionando a tecla de Escape.", + ", opens captions settings dialog": ", abre as configurações de legendas de comentários", + ", opens subtitles settings dialog": ", abre as configurações de legendas", + ", opens descriptions settings dialog": ", abre as configurações", + ", selected": ", selecionada", + "captions settings": "configurações de legendas de comentários", + "subtitles settings": "configurações de legendas", + "descriptions settings": "configurações das descrições", + "Text": "Texto", + "White": "Branco", + "Black": "Preto", + "Red": "Vermelho", + "Green": "Verde", + "Blue": "Azul", + "Yellow": "Amarelo", + "Magenta": "Magenta", + "Cyan": "Ciano", + "Background": "Plano-de-Fundo", + "Window": "Janela", + "Transparent": "Transparente", + "Semi-Transparent": "Semi-Transparente", + "Opaque": "Opaco", + "Font Size": "Tamanho da Fonte", + "Text Edge Style": "Estilo da Borda", + "None": "Nenhum", + "Raised": "Elevado", + "Depressed": "Acachapado", + "Uniform": "Uniforme", + "Dropshadow": "Sombra de projeção", + "Font Family": "Família da Fonte", + "Proportional Sans-Serif": "Sans-Serif(Sem serifa) Proporcional", + "Monospace Sans-Serif": "Sans-Serif(Sem serifa) Monoespaçada", + "Proportional Serif": "Serifa Proporcional", + "Monospace Serif": "Serifa Monoespaçada", + "Casual": "Casual", + "Script": "Script", + "Small Caps": "Maiúsculas Pequenas", + "Reset": "Redefinir", + "restore all settings to the default values": "restaurar todas as configurações aos valores padrão", + "Done": "Salvar", + "Caption Settings Dialog": "Caíxa-de-Diálogo das configurações de Legendas", + "Beginning of dialog window. Escape will cancel and close the window.": "Iniciando a Janela-de-Diálogo. Pressionar Escape irá cancelar e fechar a janela.", + "End of dialog window.": "Fim da Janela-de-Diálogo", + "{1} is loading.": "{1} está carregando." +} diff --git a/Resources/public/js/vendor/video-js/lang/pt-PT.js b/Resources/public/js/vendor/video-js/lang/pt-PT.js new file mode 100644 index 00000000..ed85f68e --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/pt-PT.js @@ -0,0 +1,41 @@ +videojs.addLanguage('pt-PT', { + "Play": "Reproduzir", + "Pause": "Parar", + "Replay": "Reiniciar", + "Current Time": "Tempo Atual", + "Duration": "Duração", + "Remaining Time": "Tempo Restante", + "Stream Type": "Tipo de Stream", + "LIVE": "EM DIRETO", + "Loaded": "Carregado", + "Progress": "Progresso", + "Fullscreen": "Ecrã inteiro", + "Non-Fullscreen": "Ecrã normal", + "Mute": "Desativar som", + "Unmute": "Ativar som", + "Playback Rate": "Velocidade de reprodução", + "Subtitles": "Legendas", + "subtitles off": "desativar legendas", + "Captions": "Anotações", + "captions off": "desativar anotações", + "Chapters": "Capítulos", + "Close Modal Dialog": "Fechar Janela Modal", + "Descriptions": "Descrições", + "descriptions off": "desativar descrições", + "Audio Track": "Faixa Áudio", + "You aborted the media playback": "Parou a reprodução do vídeo.", + "A network error caused the media download to fail part-way.": "Um erro na rede fez o vídeo falhar parcialmente.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "O vídeo não pode ser carregado, ou porque houve um problema na rede ou no servidor, ou porque formato do vídeo não é compatível.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reprodução foi interrompida por um problema com o vídeo ou porque o formato não é compatível com o seu navegador.", + "No compatible source was found for this media.": "Não foi encontrada uma fonte de vídeo compatível.", + "The media is encrypted and we do not have the keys to decrypt it.": "O vídeo está encriptado e não há uma chave para o desencriptar.", + "Play Video": "Reproduzir Vídeo", + "Close": "Fechar", + "Modal Window": "Janela Modal", + "This is a modal window": "Isto é uma janela modal", + "This modal can be closed by pressing the Escape key or activating the close button.": "Esta modal pode ser fechada pressionando a tecla ESC ou ativando o botão de fechar.", + ", opens captions settings dialog": ", abre janela com definições de legendas", + ", opens subtitles settings dialog": ", abre janela com definições de legendas", + ", opens descriptions settings dialog": ", abre janela com definições de descrições", + ", selected": ", seleccionado" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/pt-PT.json b/Resources/public/js/vendor/video-js/lang/pt-PT.json new file mode 100644 index 00000000..39d8c664 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/pt-PT.json @@ -0,0 +1,41 @@ +{ + "Play": "Reproduzir", + "Pause": "Parar", + "Replay": "Reiniciar", + "Current Time": "Tempo Atual", + "Duration": "Duração", + "Remaining Time": "Tempo Restante", + "Stream Type": "Tipo de Stream", + "LIVE": "EM DIRETO", + "Loaded": "Carregado", + "Progress": "Progresso", + "Fullscreen": "Ecrã inteiro", + "Non-Fullscreen": "Ecrã normal", + "Mute": "Desativar som", + "Unmute": "Ativar som", + "Playback Rate": "Velocidade de reprodução", + "Subtitles": "Legendas", + "subtitles off": "desativar legendas", + "Captions": "Anotações", + "captions off": "desativar anotações", + "Chapters": "Capítulos", + "Close Modal Dialog": "Fechar Janela Modal", + "Descriptions": "Descrições", + "descriptions off": "desativar descrições", + "Audio Track": "Faixa Áudio", + "You aborted the media playback": "Parou a reprodução do vídeo.", + "A network error caused the media download to fail part-way.": "Um erro na rede fez o vídeo falhar parcialmente.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "O vídeo não pode ser carregado, ou porque houve um problema na rede ou no servidor, ou porque formato do vídeo não é compatível.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "A reprodução foi interrompida por um problema com o vídeo ou porque o formato não é compatível com o seu navegador.", + "No compatible source was found for this media.": "Não foi encontrada uma fonte de vídeo compatível.", + "The media is encrypted and we do not have the keys to decrypt it.": "O vídeo está encriptado e não há uma chave para o desencriptar.", + "Play Video": "Reproduzir Vídeo", + "Close": "Fechar", + "Modal Window": "Janela Modal", + "This is a modal window": "Isto é uma janela modal", + "This modal can be closed by pressing the Escape key or activating the close button.": "Esta modal pode ser fechada pressionando a tecla ESC ou ativando o botão de fechar.", + ", opens captions settings dialog": ", abre janela com definições de legendas", + ", opens subtitles settings dialog": ", abre janela com definições de legendas", + ", opens descriptions settings dialog": ", abre janela com definições de descrições", + ", selected": ", seleccionado" +} \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ru.js b/Resources/public/js/vendor/video-js/lang/ru.js new file mode 100644 index 00000000..973daf3f --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ru.js @@ -0,0 +1,85 @@ +videojs.addLanguage('ru', { + "Audio Player": "Аудио проигрыватель", + "Video Player": "Видео проигрыватель", + "Play": "Воспроизвести", + "Pause": "Приостановить", + "Replay": "Воспроизвести снова", + "Current Time": "Текущее время", + "Duration": "Продолжительность", + "Remaining Time": "Оставшееся время", + "Stream Type": "Тип потока", + "LIVE": "ОНЛАЙН", + "Loaded": "Загрузка", + "Progress": "Прогресс", + "Progress Bar": "Индикатор загрузки", + "progress bar timing: currentTime={1} duration={2}": "{1} из {2}", + "Fullscreen": "Полноэкранный режим", + "Non-Fullscreen": "Неполноэкранный режим", + "Mute": "Без звука", + "Unmute": "Со звуком", + "Playback Rate": "Скорость воспроизведения", + "Subtitles": "Субтитры", + "subtitles off": "Субтитры выкл.", + "Captions": "Подписи", + "captions off": "Подписи выкл.", + "Chapters": "Главы", + "Descriptions": "Описания", + "descriptions off": "Отключить описания", + "Audio Track": "Звуковая дорожка", + "Volume Level": "Уровень громкости", + "You aborted the media playback": "Вы прервали воспроизведение видео", + "A network error caused the media download to fail part-way.": "Ошибка сети вызвала сбой во время загрузки видео.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Невозможно загрузить видео из-за сетевого или серверного сбоя либо формат не поддерживается.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Воспроизведение видео было приостановлено из-за повреждения либо в связи с тем, что видео использует функции, неподдерживаемые вашим браузером.", + "No compatible source was found for this media.": "Совместимые источники для этого видео отсутствуют.", + "The media is encrypted and we do not have the keys to decrypt it.": "Видео в зашифрованном виде, и у нас нет ключей для расшифровки.", + "Play Video": "Воспроизвести видео", + "Close": "Закрыть", + "Close Modal Dialog": "Закрыть модальное окно", + "Modal Window": "Модальное окно", + "This is a modal window": "Это модальное окно", + "This modal can be closed by pressing the Escape key or activating the close button.": "Модальное окно можно закрыть нажав Esc или кнопку закрытия окна.", + ", opens captions settings dialog": ", откроется диалог настройки подписей", + ", opens subtitles settings dialog": ", откроется диалог настройки субтитров", + ", opens descriptions settings dialog": ", откроется диалог настройки описаний", + ", selected": ", выбрано", + "captions settings": "настройки подписей", + "subtitles settings": "настройки субтитров", + "descriptions settings": "настройки описаний", + "Text": "Текст", + "White": "Белый", + "Black": "Черный", + "Red": "Красный", + "Green": "Зеленый", + "Blue": "Синий", + "Yellow": "Желтый", + "Magenta": "Пурпурный", + "Cyan": "Голубой", + "Background": "Фон", + "Window": "Окно", + "Transparent": "Прозрачный", + "Semi-Transparent": "Полупрозрачный", + "Opaque": "Прозрачность", + "Font Size": "Размер шрифта", + "Text Edge Style": "Стиль края текста", + "None": "Ничего", + "Raised": "Поднятый", + "Depressed": "Пониженный", + "Uniform": "Одинаковый", + "Dropshadow": "Тень", + "Font Family": "Шрифт", + "Proportional Sans-Serif": "Пропорциональный без засечек", + "Monospace Sans-Serif": "Моноширинный без засечек", + "Proportional Serif": "Пропорциональный с засечками", + "Monospace Serif": "Моноширинный с засечками", + "Casual": "Случайный", + "Script": "Письменный", + "Small Caps": "Малые прописные", + "Reset": "Сбросить", + "restore all settings to the default values": "сбросить все найстройки по умолчанию", + "Done": "Готово", + "Caption Settings Dialog": "Диалог настроек подписи", + "Beginning of dialog window. Escape will cancel and close the window.": "Начало диалоговго окна. Кнопка Escape закроет или отменит окно", + "End of dialog window.": "Конец диалогового окна.", + "{1} is loading.": "{1} загружается." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/ru.json b/Resources/public/js/vendor/video-js/lang/ru.json new file mode 100644 index 00000000..eb6b33f8 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/ru.json @@ -0,0 +1,85 @@ +{ + "Audio Player": "Аудио проигрыватель", + "Video Player": "Видео проигрыватель", + "Play": "Воспроизвести", + "Pause": "Приостановить", + "Replay": "Воспроизвести снова", + "Current Time": "Текущее время", + "Duration": "Продолжительность", + "Remaining Time": "Оставшееся время", + "Stream Type": "Тип потока", + "LIVE": "ОНЛАЙН", + "Loaded": "Загрузка", + "Progress": "Прогресс", + "Progress Bar": "Индикатор загрузки", + "progress bar timing: currentTime={1} duration={2}": "{1} из {2}", + "Fullscreen": "Полноэкранный режим", + "Non-Fullscreen": "Неполноэкранный режим", + "Mute": "Без звука", + "Unmute": "Со звуком", + "Playback Rate": "Скорость воспроизведения", + "Subtitles": "Субтитры", + "subtitles off": "Субтитры выкл.", + "Captions": "Подписи", + "captions off": "Подписи выкл.", + "Chapters": "Главы", + "Descriptions": "Описания", + "descriptions off": "Отключить описания", + "Audio Track": "Звуковая дорожка", + "Volume Level": "Уровень громкости", + "You aborted the media playback": "Вы прервали воспроизведение видео", + "A network error caused the media download to fail part-way.": "Ошибка сети вызвала сбой во время загрузки видео.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Невозможно загрузить видео из-за сетевого или серверного сбоя либо формат не поддерживается.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Воспроизведение видео было приостановлено из-за повреждения либо в связи с тем, что видео использует функции, неподдерживаемые вашим браузером.", + "No compatible source was found for this media.": "Совместимые источники для этого видео отсутствуют.", + "The media is encrypted and we do not have the keys to decrypt it.": "Видео в зашифрованном виде, и у нас нет ключей для расшифровки.", + "Play Video": "Воспроизвести видео", + "Close": "Закрыть", + "Close Modal Dialog": "Закрыть модальное окно", + "Modal Window": "Модальное окно", + "This is a modal window": "Это модальное окно", + "This modal can be closed by pressing the Escape key or activating the close button.": "Модальное окно можно закрыть нажав Esc или кнопку закрытия окна.", + ", opens captions settings dialog": ", откроется диалог настройки подписей", + ", opens subtitles settings dialog": ", откроется диалог настройки субтитров", + ", opens descriptions settings dialog": ", откроется диалог настройки описаний", + ", selected": ", выбрано", + "captions settings": "настройки подписей", + "subtitles settings": "настройки субтитров", + "descriptions settings": "настройки описаний", + "Text": "Текст", + "White": "Белый", + "Black": "Черный", + "Red": "Красный", + "Green": "Зеленый", + "Blue": "Синий", + "Yellow": "Желтый", + "Magenta": "Пурпурный", + "Cyan": "Голубой", + "Background": "Фон", + "Window": "Окно", + "Transparent": "Прозрачный", + "Semi-Transparent": "Полупрозрачный", + "Opaque": "Прозрачность", + "Font Size": "Размер шрифта", + "Text Edge Style": "Стиль края текста", + "None": "Ничего", + "Raised": "Поднятый", + "Depressed": "Пониженный", + "Uniform": "Одинаковый", + "Dropshadow": "Тень", + "Font Family": "Шрифт", + "Proportional Sans-Serif": "Пропорциональный без засечек", + "Monospace Sans-Serif": "Моноширинный без засечек", + "Proportional Serif": "Пропорциональный с засечками", + "Monospace Serif": "Моноширинный с засечками", + "Casual": "Случайный", + "Script": "Письменный", + "Small Caps": "Малые прописные", + "Reset": "Сбросить", + "restore all settings to the default values": "сбросить все найстройки по умолчанию", + "Done": "Готово", + "Caption Settings Dialog": "Диалог настроек подписи", + "Beginning of dialog window. Escape will cancel and close the window.": "Начало диалоговго окна. Кнопка Escape закроет или отменит окно", + "End of dialog window.": "Конец диалогового окна.", + "{1} is loading.": "{1} загружается." +} diff --git a/Resources/public/js/vendor/video-js/lang/sk.js b/Resources/public/js/vendor/video-js/lang/sk.js new file mode 100644 index 00000000..e3f9d800 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/sk.js @@ -0,0 +1,85 @@ +videojs.addLanguage('sk', { + "Audio Player": "Zvukový prehrávač", + "Video Player": "Video prehrávač", + "Play": "Prehrať", + "Pause": "Pozastaviť", + "Replay": "Prehrať znova", + "Current Time": "Aktuálny čas", + "Duration": "Čas trvania", + "Remaining Time": "Zostávajúci čas", + "Stream Type": "Typ stopy", + "LIVE": "NAŽIVO", + "Loaded": "Načítané", + "Progress": "Priebeh", + "Progress Bar": "Ukazovateľ priebehu", + "progress bar timing: currentTime={1} duration={2}": "časovanie ukazovateľa priebehu: currentTime={1} duration={2}", + "Fullscreen": "Režim celej obrazovky", + "Non-Fullscreen": "Režim normálnej obrazovky", + "Mute": "Stlmiť", + "Unmute": "Zrušiť stlmenie", + "Playback Rate": "Rýchlosť prehrávania", + "Subtitles": "Titulky", + "subtitles off": "titulky vypnuté", + "Captions": "Popisky", + "captions off": "popisky vypnuté", + "Chapters": "Kapitoly", + "Descriptions": "Opisy", + "descriptions off": "opisy vypnuté", + "Audio Track": "Zvuková stopa", + "Volume Level": "Úroveň hlasitosti", + "You aborted the media playback": "Prerušili ste prehrávanie", + "A network error caused the media download to fail part-way.": "Sťahovanie súboru bolo zrušené pre chybu na sieti.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Súbor sa nepodarilo načítať pre chybu servera, sieťového pripojenia, alebo je formát súboru nepodporovaný.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Prehrávanie súboru bolo prerušené pre poškodené dáta, alebo súbor používa vlastnosti, ktoré váš prehliadač nepodporuje.", + "No compatible source was found for this media.": "Nebol nájdený žiaden kompatibilný zdroj pre tento súbor.", + "The media is encrypted and we do not have the keys to decrypt it.": "Súbor je zašifrovaný a nie je k dispozícii kľúč na rozšifrovanie.", + "Play Video": "Prehrať video", + "Close": "Zatvoriť", + "Close Modal Dialog": "Zatvoriť modálne okno", + "Modal Window": "Modálne okno", + "This is a modal window": "Toto je modálne okno", + "This modal can be closed by pressing the Escape key or activating the close button.": "Toto modálne okno je možné zatvoriť stlačením klávesy Escape, alebo aktivovaním tlačidla na zatvorenie.", + ", opens captions settings dialog": ", otvorí okno nastavení popiskov", + ", opens subtitles settings dialog": ", otvorí okno nastavení titulkov", + ", opens descriptions settings dialog": ", otvorí okno nastavení opisov", + ", selected": ", označené", + "captions settings": "nastavenia popiskov", + "subtitles settings": "nastavenia titulkov", + "descriptions settings": "nastavenia opisov", + "Text": "Text", + "White": "Biela", + "Black": "Čierna", + "Red": "Červená", + "Green": "Zelená", + "Blue": "Modrá", + "Yellow": "Žltá", + "Magenta": "Ružová", + "Cyan": "Tyrkysová", + "Background": "Pozadie", + "Window": "Okno", + "Transparent": "Priesvitné", + "Semi-Transparent": "Polopriesvitné", + "Opaque": "Plné", + "Font Size": "Veľkosť písma", + "Text Edge Style": "Typ okrajov písma", + "None": "Žiadne", + "Raised": "Zvýšené", + "Depressed": "Znížené", + "Uniform": "Pravidelné", + "Dropshadow": "S tieňom", + "Font Family": "Typ písma", + "Proportional Sans-Serif": "Proporčné bezpätkové", + "Monospace Sans-Serif": "Pravidelné, bezpätkové", + "Proportional Serif": "Proporčné pätkové", + "Monospace Serif": "Pravidelné pätkové", + "Casual": "Bežné", + "Script": "Písané", + "Small Caps": "Malé kapitálky", + "Reset": "Resetovať", + "restore all settings to the default values": "všetky nastavenia na základné hodnoty", + "Done": "Hotovo", + "Caption Settings Dialog": "Okno nastavení popiskov", + "Beginning of dialog window. Escape will cancel and close the window.": "Začiatok okna. Klávesa Escape zruší a zavrie okno.", + "End of dialog window.": "Koniec okna.", + "{1} is loading.": "{1} sa načíta." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/sk.json b/Resources/public/js/vendor/video-js/lang/sk.json new file mode 100644 index 00000000..9c3f560a --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/sk.json @@ -0,0 +1,85 @@ +{ + "Audio Player": "Zvukový prehrávač", + "Video Player": "Video prehrávač", + "Play": "Prehrať", + "Pause": "Pozastaviť", + "Replay": "Prehrať znova", + "Current Time": "Aktuálny čas", + "Duration": "Čas trvania", + "Remaining Time": "Zostávajúci čas", + "Stream Type": "Typ stopy", + "LIVE": "NAŽIVO", + "Loaded": "Načítané", + "Progress": "Priebeh", + "Progress Bar": "Ukazovateľ priebehu", + "progress bar timing: currentTime={1} duration={2}": "časovanie ukazovateľa priebehu: currentTime={1} duration={2}", + "Fullscreen": "Režim celej obrazovky", + "Non-Fullscreen": "Režim normálnej obrazovky", + "Mute": "Stlmiť", + "Unmute": "Zrušiť stlmenie", + "Playback Rate": "Rýchlosť prehrávania", + "Subtitles": "Titulky", + "subtitles off": "titulky vypnuté", + "Captions": "Popisky", + "captions off": "popisky vypnuté", + "Chapters": "Kapitoly", + "Descriptions": "Opisy", + "descriptions off": "opisy vypnuté", + "Audio Track": "Zvuková stopa", + "Volume Level": "Úroveň hlasitosti", + "You aborted the media playback": "Prerušili ste prehrávanie", + "A network error caused the media download to fail part-way.": "Sťahovanie súboru bolo zrušené pre chybu na sieti.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Súbor sa nepodarilo načítať pre chybu servera, sieťového pripojenia, alebo je formát súboru nepodporovaný.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Prehrávanie súboru bolo prerušené pre poškodené dáta, alebo súbor používa vlastnosti, ktoré váš prehliadač nepodporuje.", + "No compatible source was found for this media.": "Nebol nájdený žiaden kompatibilný zdroj pre tento súbor.", + "The media is encrypted and we do not have the keys to decrypt it.": "Súbor je zašifrovaný a nie je k dispozícii kľúč na rozšifrovanie.", + "Play Video": "Prehrať video", + "Close": "Zatvoriť", + "Close Modal Dialog": "Zatvoriť modálne okno", + "Modal Window": "Modálne okno", + "This is a modal window": "Toto je modálne okno", + "This modal can be closed by pressing the Escape key or activating the close button.": "Toto modálne okno je možné zatvoriť stlačením klávesy Escape, alebo aktivovaním tlačidla na zatvorenie.", + ", opens captions settings dialog": ", otvorí okno nastavení popiskov", + ", opens subtitles settings dialog": ", otvorí okno nastavení titulkov", + ", opens descriptions settings dialog": ", otvorí okno nastavení opisov", + ", selected": ", označené", + "captions settings": "nastavenia popiskov", + "subtitles settings": "nastavenia titulkov", + "descriptions settings": "nastavenia opisov", + "Text": "Text", + "White": "Biela", + "Black": "Čierna", + "Red": "Červená", + "Green": "Zelená", + "Blue": "Modrá", + "Yellow": "Žltá", + "Magenta": "Ružová", + "Cyan": "Tyrkysová", + "Background": "Pozadie", + "Window": "Okno", + "Transparent": "Priesvitné", + "Semi-Transparent": "Polopriesvitné", + "Opaque": "Plné", + "Font Size": "Veľkosť písma", + "Text Edge Style": "Typ okrajov písma", + "None": "Žiadne", + "Raised": "Zvýšené", + "Depressed": "Znížené", + "Uniform": "Pravidelné", + "Dropshadow": "S tieňom", + "Font Family": "Typ písma", + "Proportional Sans-Serif": "Proporčné bezpätkové", + "Monospace Sans-Serif": "Pravidelné, bezpätkové", + "Proportional Serif": "Proporčné pätkové", + "Monospace Serif": "Pravidelné pätkové", + "Casual": "Bežné", + "Script": "Písané", + "Small Caps": "Malé kapitálky", + "Reset": "Resetovať", + "restore all settings to the default values": "všetky nastavenia na základné hodnoty", + "Done": "Hotovo", + "Caption Settings Dialog": "Okno nastavení popiskov", + "Beginning of dialog window. Escape will cancel and close the window.": "Začiatok okna. Klávesa Escape zruší a zavrie okno.", + "End of dialog window.": "Koniec okna.", + "{1} is loading.": "{1} sa načíta." +} diff --git a/Resources/public/js/vendor/video-js/lang/sr.js b/Resources/public/js/vendor/video-js/lang/sr.js new file mode 100644 index 00000000..ba81d4dd --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/sr.js @@ -0,0 +1,26 @@ +videojs.addLanguage('sr', { + "Play": "Pusti", + "Pause": "Pauza", + "Current Time": "Trenutno vreme", + "Duration": "Vreme trajanja", + "Remaining Time": "Preostalo vreme", + "Stream Type": "Način strimovanja", + "LIVE": "UŽIVO", + "Loaded": "Učitan", + "Progress": "Progres", + "Fullscreen": "Pun ekran", + "Non-Fullscreen": "Mali ekran", + "Mute": "Prigušen", + "Unmute": "Ne-prigušen", + "Playback Rate": "Stopa reprodukcije", + "Subtitles": "Podnaslov", + "subtitles off": "Podnaslov deaktiviran", + "Captions": "Titlovi", + "captions off": "Titlovi deaktivirani", + "Chapters": "Poglavlja", + "You aborted the media playback": "Isključili ste reprodukciju videa.", + "A network error caused the media download to fail part-way.": "Video se prestao preuzimati zbog greške na mreži.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video se ne može reproducirati zbog servera, greške u mreži ili format nije podržan.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Reprodukcija videa je zaustavljenja zbog greške u formatu ili zbog verzije vašeg pretraživača.", + "No compatible source was found for this media.": "Nije nađen nijedan kompatibilan izvor ovog videa." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/sr.json b/Resources/public/js/vendor/video-js/lang/sr.json new file mode 100644 index 00000000..512466c8 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/sr.json @@ -0,0 +1,26 @@ +{ + "Play": "Pusti", + "Pause": "Pauza", + "Current Time": "Trenutno vreme", + "Duration": "Vreme trajanja", + "Remaining Time": "Preostalo vreme", + "Stream Type": "Način strimovanja", + "LIVE": "UŽIVO", + "Loaded": "Učitan", + "Progress": "Progres", + "Fullscreen": "Pun ekran", + "Non-Fullscreen": "Mali ekran", + "Mute": "Prigušen", + "Unmute": "Ne-prigušen", + "Playback Rate": "Stopa reprodukcije", + "Subtitles": "Podnaslov", + "subtitles off": "Podnaslov deaktiviran", + "Captions": "Titlovi", + "captions off": "Titlovi deaktivirani", + "Chapters": "Poglavlja", + "You aborted the media playback": "Isključili ste reprodukciju videa.", + "A network error caused the media download to fail part-way.": "Video se prestao preuzimati zbog greške na mreži.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video se ne može reproducirati zbog servera, greške u mreži ili format nije podržan.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Reprodukcija videa je zaustavljenja zbog greške u formatu ili zbog verzije vašeg pretraživača.", + "No compatible source was found for this media.": "Nije nađen nijedan kompatibilan izvor ovog videa." +} diff --git a/Resources/public/js/vendor/video-js/lang/sv.js b/Resources/public/js/vendor/video-js/lang/sv.js new file mode 100644 index 00000000..71422ef0 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/sv.js @@ -0,0 +1,87 @@ +videojs.addLanguage('sv', { + ", opens captions settings dialog": ", öppnar dialogruta för textning", + ", opens descriptions settings dialog": ", öppnar dialogruta för inställningar", + ", opens subtitles settings dialog": ", öppnar dialogruta för undertexter", + ", selected": ", vald", + "A network error caused the media download to fail part-way.": "Ett nätverksfel gjorde att nedladdningen av videon avbröts.", + "Audio Player": "Ljudspelare", + "Audio Track": "Ljudspår", + "Background": "Bakgrund", + "Beginning of dialog window. Escape will cancel and close the window.": "Början av dialogfönster. Escape avbryter och stänger fönstret.", + "Black": "Svart", + "Blue": "Blå", + "Caption Settings Dialog": "Dialogruta för textningsinställningar", + "Captions": "Text på", + "Casual": "Casual", + "Chapters": "Kapitel", + "Close": "Stäng", + "Close Modal Dialog": "Stäng dialogruta", + "Current Time": "Aktuell tid", + "Cyan": "Cyan", + "Depressed": "Deprimerad", + "Descriptions": "Beskrivningar", + "Done": "Klar", + "Dropshadow": "DropSkugga", + "Duration": "Total tid", + "End of dialog window.": "Slutet av dialogfönster.", + "Font Family": "Typsnittsfamilj", + "Font Size": "Textstorlek", + "Fullscreen": "Fullskärm", + "Green": "Grön", + "LIVE": "LIVE", + "Loaded": "Laddad", + "Magenta": "Magenta", + "Modal Window": "dialogruta", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Monospace Serif": "Monospace Serif", + "Mute": "Ljud av", + "No compatible source was found for this media.": "Det gick inte att hitta någon kompatibel källa för den här videon.", + "Non-Fullscreen": "Ej fullskärm", + "None": "Ingen", + "Opaque": "Opak", + "Pause": "Pausa", + "Play": "Spela", + "Play Video": "Spela upp video", + "Playback Rate": "Uppspelningshastighet", + "Progress": "Förlopp", + "Progress Bar": "förloppsmätare", + "Proportional Sans-Serif": "Proportionell Sans-Serif", + "Proportional Serif": "Proportionell Serif", + "Raised": "Raised", + "Red": "Röd", + "Remaining Time": "Återstående tid", + "Replay": "Spela upp igen", + "Reset": "Återställ", + "Script": "Manus", + "Seek to live, currently behind live": "Återgå till live, uppspelningen är inte live", + "Seek to live, currently playing live": "Återgå till live, uppspelningen är live", + "Semi-Transparent": "Semi-transparent", + "Small Caps": "Small-Caps", + "Stream Type": "Strömningstyp", + "Subtitles": "Text på", + "Text": "Text", + "Text Edge Style": "Textkantstil", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Det gick inte att ladda videon, antingen på grund av ett server- eller nätverksfel, eller för att formatet inte stöds.", + "The media is encrypted and we do not have the keys to decrypt it.": "Mediat är krypterat och vi har inte nycklarna för att dekryptera det.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Uppspelningen avbröts på grund av att videon är skadad, eller också för att videon använder funktioner som din webbläsare inte stöder.", + "This is a modal window": "Det här är ett dialogruta", + "This modal can be closed by pressing the Escape key or activating the close button.": "Den här dialogrutan kan stängas genom att trycka på Escape-tangenten eller stäng knappen.", + "Transparent": "Transparent", + "Uniform": "Uniform", + "Unmute": "Ljud på", + "Video Player": "Videospelare", + "Volume Level": "Volymnivå", + "White": "Vit", + "Window": "Fönster", + "Yellow": "Gul", + "You aborted the media playback": "Du har avbrutit videouppspelningen.", + "captions off": "Text av", + "captions settings": "textningsinställningar", + "descriptions off": "beskrivningar av", + "descriptions settings": "beskrivningsinställningar", + "progress bar timing: currentTime={1} duration={2}": "{1} av {2}", + "restore all settings to the default values": "återställ alla inställningar till standardvärden", + "subtitles off": "Text av", + "subtitles settings": "undertextsinställningar", + "{1} is loading.": "{1} laddar." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/sv.json b/Resources/public/js/vendor/video-js/lang/sv.json new file mode 100644 index 00000000..dc020f2f --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/sv.json @@ -0,0 +1,87 @@ +{ + ", opens captions settings dialog": ", öppnar dialogruta för textning", + ", opens descriptions settings dialog": ", öppnar dialogruta för inställningar", + ", opens subtitles settings dialog": ", öppnar dialogruta för undertexter", + ", selected": ", vald", + "A network error caused the media download to fail part-way.": "Ett nätverksfel gjorde att nedladdningen av videon avbröts.", + "Audio Player": "Ljudspelare", + "Audio Track": "Ljudspår", + "Background": "Bakgrund", + "Beginning of dialog window. Escape will cancel and close the window.": "Början av dialogfönster. Escape avbryter och stänger fönstret.", + "Black": "Svart", + "Blue": "Blå", + "Caption Settings Dialog": "Dialogruta för textningsinställningar", + "Captions": "Text på", + "Casual": "Casual", + "Chapters": "Kapitel", + "Close": "Stäng", + "Close Modal Dialog": "Stäng dialogruta", + "Current Time": "Aktuell tid", + "Cyan": "Cyan", + "Depressed": "Deprimerad", + "Descriptions": "Beskrivningar", + "Done": "Klar", + "Dropshadow": "DropSkugga", + "Duration": "Total tid", + "End of dialog window.": "Slutet av dialogfönster.", + "Font Family": "Typsnittsfamilj", + "Font Size": "Textstorlek", + "Fullscreen": "Fullskärm", + "Green": "Grön", + "LIVE": "LIVE", + "Loaded": "Laddad", + "Magenta": "Magenta", + "Modal Window": "dialogruta", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Monospace Serif": "Monospace Serif", + "Mute": "Ljud av", + "No compatible source was found for this media.": "Det gick inte att hitta någon kompatibel källa för den här videon.", + "Non-Fullscreen": "Ej fullskärm", + "None": "Ingen", + "Opaque": "Opak", + "Pause": "Pausa", + "Play": "Spela", + "Play Video": "Spela upp video", + "Playback Rate": "Uppspelningshastighet", + "Progress": "Förlopp", + "Progress Bar": "förloppsmätare", + "Proportional Sans-Serif": "Proportionell Sans-Serif", + "Proportional Serif": "Proportionell Serif", + "Raised": "Raised", + "Red": "Röd", + "Remaining Time": "Återstående tid", + "Replay": "Spela upp igen", + "Reset": "Återställ", + "Script": "Manus", + "Seek to live, currently behind live": "Återgå till live, uppspelningen är inte live", + "Seek to live, currently playing live": "Återgå till live, uppspelningen är live", + "Semi-Transparent": "Semi-transparent", + "Small Caps": "Small-Caps", + "Stream Type": "Strömningstyp", + "Subtitles": "Text på", + "Text": "Text", + "Text Edge Style": "Textkantstil", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Det gick inte att ladda videon, antingen på grund av ett server- eller nätverksfel, eller för att formatet inte stöds.", + "The media is encrypted and we do not have the keys to decrypt it.": "Mediat är krypterat och vi har inte nycklarna för att dekryptera det.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Uppspelningen avbröts på grund av att videon är skadad, eller också för att videon använder funktioner som din webbläsare inte stöder.", + "This is a modal window": "Det här är ett dialogruta", + "This modal can be closed by pressing the Escape key or activating the close button.": "Den här dialogrutan kan stängas genom att trycka på Escape-tangenten eller stäng knappen.", + "Transparent": "Transparent", + "Uniform": "Uniform", + "Unmute": "Ljud på", + "Video Player": "Videospelare", + "Volume Level": "Volymnivå", + "White": "Vit", + "Window": "Fönster", + "Yellow": "Gul", + "You aborted the media playback": "Du har avbrutit videouppspelningen.", + "captions off": "Text av", + "captions settings": "textningsinställningar", + "descriptions off": "beskrivningar av", + "descriptions settings": "beskrivningsinställningar", + "progress bar timing: currentTime={1} duration={2}": "{1} av {2}", + "restore all settings to the default values": "återställ alla inställningar till standardvärden", + "subtitles off": "Text av", + "subtitles settings": "undertextsinställningar", + "{1} is loading.": "{1} laddar." +} diff --git a/Resources/public/js/vendor/video-js/lang/tr.js b/Resources/public/js/vendor/video-js/lang/tr.js new file mode 100644 index 00000000..f9edfeb7 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/tr.js @@ -0,0 +1,76 @@ +videojs.addLanguage('tr', { + "Play": "Oynat", + "Pause": "Duraklat", + "Replay": "Yeniden Oynat", + "Current Time": "Süre", + "Duration": "Toplam Süre", + "Remaining Time": "Kalan Süre", + "Stream Type": "Yayın Tipi", + "LIVE": "CANLI", + "Loaded": "Yüklendi", + "Progress": "Yükleniyor", + "Fullscreen": "Tam Ekran", + "Non-Fullscreen": "Küçük Ekran", + "Mute": "Ses Kapa", + "Unmute": "Ses Aç", + "Playback Rate": "Oynatma Hızı", + "Subtitles": "Altyazı", + "subtitles off": "Altyazı Kapalı", + "Captions": "Altyazı", + "captions off": "Altyazı Kapalı", + "Chapters": "Bölümler", + "Close Modal Dialog": "Dialogu Kapat", + "Descriptions": "Açıklamalar", + "descriptions off": "Açıklamalar kapalı", + "Audio Track": "Ses Dosyası", + "You aborted the media playback": "Video oynatmayı iptal ettiniz", + "A network error caused the media download to fail part-way.": "Video indirilirken bağlantı sorunu oluştu.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video oynatılamadı, ağ ya da sunucu hatası veya belirtilen format desteklenmiyor.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Tarayıcınız desteklemediği için videoda hata oluştu.", + "No compatible source was found for this media.": "Video için kaynak bulunamadı.", + "The media is encrypted and we do not have the keys to decrypt it.": "Video, şifrelenmiş bir kaynaktan geliyor ve oynatmak için gerekli anahtar bulunamadı.", + "Play Video": "Videoyu Oynat", + "Close": "Kapat", + "Modal Window": "Modal Penceresi", + "This is a modal window": "Bu bir modal penceresidir", + "This modal can be closed by pressing the Escape key or activating the close button.": "Bu modal ESC tuşuna basarak ya da kapata tıklanarak kapatılabilir.", + ", opens captions settings dialog": ", altyazı ayarları menüsünü açar", + ", opens subtitles settings dialog": ", altyazı ayarları menüsünü açar", + ", opens descriptions settings dialog": ", açıklama ayarları menüsünü açar", + ", selected": ", seçildi", + "captions settings": "altyazı ayarları", + "subtitles settings": "altyazı ayarları", + "descriptions settings": "açıklama ayarları", + "Text": "Yazı", + "White": "Beyaz", + "Black": "Siyah", + "Red": "Kırmızı", + "Green": "Yeşil", + "Blue": "Mavi", + "Yellow": "Sarı", + "Magenta": "Macenta", + "Cyan": "Açık Mavi (Camgöbeği)", + "Background": "Arka plan", + "Window": "Pencere", + "Transparent": "Saydam", + "Semi-Transparent": "Yarı-Saydam", + "Opaque": "Mat", + "Font Size": "Yazı Boyutu", + "Text Edge Style": "Yazı Kenarlıkları", + "None": "Hiçbiri", + "Raised": "Kabartılmış", + "Depressed": "Yassı", + "Uniform": "Düz", + "Dropshadow": "Gölgeli", + "Font Family": "Yazı Tipi", + "Proportional Sans-Serif": "Orantılı Sans-Serif", + "Monospace Sans-Serif": "Eşaralıklı Sans-Serif", + "Proportional Serif": "Orantılı Serif", + "Monospace Serif": "Eşaralıklı Serif", + "Casual": "Gündelik", + "Script": "El Yazısı", + "Small Caps": "Küçük Boyutlu Büyük Harfli", + "Done": "Tamam", + "Caption Settings Dialog": "Altyazı Ayarları Menüsü", + "Beginning of dialog window. Escape will cancel and close the window.": "Diyalog penceresinin başlangıcı. ESC tuşu işlemi iptal edip pencereyi kapatacaktır." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/tr.json b/Resources/public/js/vendor/video-js/lang/tr.json new file mode 100644 index 00000000..07e18370 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/tr.json @@ -0,0 +1,76 @@ +{ + "Play": "Oynat", + "Pause": "Duraklat", + "Replay": "Yeniden Oynat", + "Current Time": "Süre", + "Duration": "Toplam Süre", + "Remaining Time": "Kalan Süre", + "Stream Type": "Yayın Tipi", + "LIVE": "CANLI", + "Loaded": "Yüklendi", + "Progress": "Yükleniyor", + "Fullscreen": "Tam Ekran", + "Non-Fullscreen": "Küçük Ekran", + "Mute": "Ses Kapa", + "Unmute": "Ses Aç", + "Playback Rate": "Oynatma Hızı", + "Subtitles": "Altyazı", + "subtitles off": "Altyazı Kapalı", + "Captions": "Altyazı", + "captions off": "Altyazı Kapalı", + "Chapters": "Bölümler", + "Close Modal Dialog": "Dialogu Kapat", + "Descriptions": "Açıklamalar", + "descriptions off": "Açıklamalar kapalı", + "Audio Track": "Ses Dosyası", + "You aborted the media playback": "Video oynatmayı iptal ettiniz", + "A network error caused the media download to fail part-way.": "Video indirilirken bağlantı sorunu oluştu.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video oynatılamadı, ağ ya da sunucu hatası veya belirtilen format desteklenmiyor.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Tarayıcınız desteklemediği için videoda hata oluştu.", + "No compatible source was found for this media.": "Video için kaynak bulunamadı.", + "The media is encrypted and we do not have the keys to decrypt it.": "Video, şifrelenmiş bir kaynaktan geliyor ve oynatmak için gerekli anahtar bulunamadı.", + "Play Video": "Videoyu Oynat", + "Close": "Kapat", + "Modal Window": "Modal Penceresi", + "This is a modal window": "Bu bir modal penceresidir", + "This modal can be closed by pressing the Escape key or activating the close button.": "Bu modal ESC tuşuna basarak ya da kapata tıklanarak kapatılabilir.", + ", opens captions settings dialog": ", altyazı ayarları menüsünü açar", + ", opens subtitles settings dialog": ", altyazı ayarları menüsünü açar", + ", opens descriptions settings dialog": ", açıklama ayarları menüsünü açar", + ", selected": ", seçildi", + "captions settings": "altyazı ayarları", + "subtitles settings": "altyazı ayarları", + "descriptions settings": "açıklama ayarları", + "Text": "Yazı", + "White": "Beyaz", + "Black": "Siyah", + "Red": "Kırmızı", + "Green": "Yeşil", + "Blue": "Mavi", + "Yellow": "Sarı", + "Magenta": "Macenta", + "Cyan": "Açık Mavi (Camgöbeği)", + "Background": "Arka plan", + "Window": "Pencere", + "Transparent": "Saydam", + "Semi-Transparent": "Yarı-Saydam", + "Opaque": "Mat", + "Font Size": "Yazı Boyutu", + "Text Edge Style": "Yazı Kenarlıkları", + "None": "Hiçbiri", + "Raised": "Kabartılmış", + "Depressed": "Yassı", + "Uniform": "Düz", + "Dropshadow": "Gölgeli", + "Font Family": "Yazı Tipi", + "Proportional Sans-Serif": "Orantılı Sans-Serif", + "Monospace Sans-Serif": "Eşaralıklı Sans-Serif", + "Proportional Serif": "Orantılı Serif", + "Monospace Serif": "Eşaralıklı Serif", + "Casual": "Gündelik", + "Script": "El Yazısı", + "Small Caps": "Küçük Boyutlu Büyük Harfli", + "Done": "Tamam", + "Caption Settings Dialog": "Altyazı Ayarları Menüsü", + "Beginning of dialog window. Escape will cancel and close the window.": "Diyalog penceresinin başlangıcı. ESC tuşu işlemi iptal edip pencereyi kapatacaktır." +} diff --git a/Resources/public/js/vendor/video-js/lang/uk.js b/Resources/public/js/vendor/video-js/lang/uk.js new file mode 100644 index 00000000..2d801feb --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/uk.js @@ -0,0 +1,85 @@ +videojs.addLanguage('uk', { + "Audio Player": "Аудіопрогравач", + "Video Player": "Відеопрогравач", + "Play": "Відтворити", + "Pause": "Призупинити", + "Replay": "Відтворити знову", + "Current Time": "Поточний час", + "Duration": "Тривалість", + "Remaining Time": "Час, що залишився", + "Stream Type": "Тип потоку", + "LIVE": "НАЖИВО", + "Loaded": "Завантаження", + "Progress": "Прогрес", + "Progress Bar": "Індикатор завантаження", + "progress bar timing: currentTime={1} duration={2}": "{1} з {2}", + "Fullscreen": "Повноекранний режим", + "Non-Fullscreen": "Неповноекранний режим", + "Mute": "Без звуку", + "Unmute": "Зі звуком", + "Playback Rate": "Швидкість відтворення", + "Subtitles": "Субтитри", + "subtitles off": "Без субтитрів", + "Captions": "Підписи", + "captions off": "Без підписів", + "Chapters": "Розділи", + "Close Modal Dialog": "Закрити модальний діалог", + "Descriptions": "Описи", + "descriptions off": "Без описів", + "Audio Track": "Аудіодоріжка", + "Volume Level": "Рівень гучності", + "You aborted the media playback": "Ви припинили відтворення відео", + "A network error caused the media download to fail part-way.": "Помилка мережі викликала збій під час завантаження відео.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Неможливо завантажити відео через мережевий чи серверний збій або формат не підтримується.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Відтворення відео було припинено через пошкодження або у зв'язку з тим, що відео використовує функції, які не підтримуються вашим браузером.", + "No compatible source was found for this media.": "Сумісні джерела для цього відео відсутні.", + "The media is encrypted and we do not have the keys to decrypt it.": "Відео в зашифрованому вигляді, і ми не маємо ключі для розшифровки.", + "Play Video": "Відтворити відео", + "Close": "Закрити", + "Modal Window": "Модальне вікно", + "This is a modal window": "Це модальне вікно.", + "This modal can be closed by pressing the Escape key or activating the close button.": "Модальне вікно можна закрити, натиснувши клавішу Esc або кнопку закриття вікна.", + ", opens captions settings dialog": ", відкриється діалогове вікно налаштування підписів", + ", opens subtitles settings dialog": ", відкриється діалогове вікно налаштування субтитрів", + ", opens descriptions settings dialog": ", відкриється діалогове вікно налаштування описів", + ", selected": ", обраний", + "captions settings": "налаштування підписів", + "subtitles settings": "налаштування субтитрів", + "descriptions settings": "налаштування описів", + "Text": "Текст", + "White": "Білий", + "Black": "Чорний", + "Red": "Червоний", + "Green": "Зелений", + "Blue": "Синій", + "Yellow": "Жовтий", + "Magenta": "Пурпурний", + "Cyan": "Блакитний", + "Background": "Фон", + "Window": "Вікно", + "Transparent": "Прозорий", + "Semi-Transparent": "Напівпрозорий", + "Opaque": "Прозорість", + "Font Size": "Розмір шрифту", + "Text Edge Style": "Стиль краю тексту", + "None": "Нічого", + "Raised": "Піднятий", + "Depressed": "Знижений", + "Uniform": "Однаковий", + "Dropshadow": "Тінь", + "Font Family": "Шрифт", + "Proportional Sans-Serif": "Пропорційний без засічок", + "Monospace Sans-Serif": "Моноширинний без засічок", + "Proportional Serif": "Пропорційний із засічками", + "Monospace Serif": "Моноширинний із засічками", + "Casual": "Випадковий", + "Script": "Писемний", + "Small Caps": "Малі прописні", + "Reset": "Скинути", + "restore all settings to the default values": "скинути всі налаштування за замовчуванням", + "Done": "Готово", + "Caption Settings Dialog": "Діалог налаштувань підпису", + "Beginning of dialog window. Escape will cancel and close the window.": "Початок діалоговго вікна. Кнопка Escape закриє або скасує вікно", + "End of dialog window.": "Кінець діалогового вікна.", + "{1} is loading.": "{1} завантажується." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/uk.json b/Resources/public/js/vendor/video-js/lang/uk.json new file mode 100644 index 00000000..17a840d8 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/uk.json @@ -0,0 +1,85 @@ +{ + "Audio Player": "Аудіопрогравач", + "Video Player": "Відеопрогравач", + "Play": "Відтворити", + "Pause": "Призупинити", + "Replay": "Відтворити знову", + "Current Time": "Поточний час", + "Duration": "Тривалість", + "Remaining Time": "Час, що залишився", + "Stream Type": "Тип потоку", + "LIVE": "НАЖИВО", + "Loaded": "Завантаження", + "Progress": "Прогрес", + "Progress Bar": "Індикатор завантаження", + "progress bar timing: currentTime={1} duration={2}": "{1} з {2}", + "Fullscreen": "Повноекранний режим", + "Non-Fullscreen": "Неповноекранний режим", + "Mute": "Без звуку", + "Unmute": "Зі звуком", + "Playback Rate": "Швидкість відтворення", + "Subtitles": "Субтитри", + "subtitles off": "Без субтитрів", + "Captions": "Підписи", + "captions off": "Без підписів", + "Chapters": "Розділи", + "Close Modal Dialog": "Закрити модальний діалог", + "Descriptions": "Описи", + "descriptions off": "Без описів", + "Audio Track": "Аудіодоріжка", + "Volume Level": "Рівень гучності", + "You aborted the media playback": "Ви припинили відтворення відео", + "A network error caused the media download to fail part-way.": "Помилка мережі викликала збій під час завантаження відео.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Неможливо завантажити відео через мережевий чи серверний збій або формат не підтримується.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Відтворення відео було припинено через пошкодження або у зв'язку з тим, що відео використовує функції, які не підтримуються вашим браузером.", + "No compatible source was found for this media.": "Сумісні джерела для цього відео відсутні.", + "The media is encrypted and we do not have the keys to decrypt it.": "Відео в зашифрованому вигляді, і ми не маємо ключі для розшифровки.", + "Play Video": "Відтворити відео", + "Close": "Закрити", + "Modal Window": "Модальне вікно", + "This is a modal window": "Це модальне вікно.", + "This modal can be closed by pressing the Escape key or activating the close button.": "Модальне вікно можна закрити, натиснувши клавішу Esc або кнопку закриття вікна.", + ", opens captions settings dialog": ", відкриється діалогове вікно налаштування підписів", + ", opens subtitles settings dialog": ", відкриється діалогове вікно налаштування субтитрів", + ", opens descriptions settings dialog": ", відкриється діалогове вікно налаштування описів", + ", selected": ", обраний", + "captions settings": "налаштування підписів", + "subtitles settings": "налаштування субтитрів", + "descriptions settings": "налаштування описів", + "Text": "Текст", + "White": "Білий", + "Black": "Чорний", + "Red": "Червоний", + "Green": "Зелений", + "Blue": "Синій", + "Yellow": "Жовтий", + "Magenta": "Пурпурний", + "Cyan": "Блакитний", + "Background": "Фон", + "Window": "Вікно", + "Transparent": "Прозорий", + "Semi-Transparent": "Напівпрозорий", + "Opaque": "Прозорість", + "Font Size": "Розмір шрифту", + "Text Edge Style": "Стиль краю тексту", + "None": "Нічого", + "Raised": "Піднятий", + "Depressed": "Знижений", + "Uniform": "Однаковий", + "Dropshadow": "Тінь", + "Font Family": "Шрифт", + "Proportional Sans-Serif": "Пропорційний без засічок", + "Monospace Sans-Serif": "Моноширинний без засічок", + "Proportional Serif": "Пропорційний із засічками", + "Monospace Serif": "Моноширинний із засічками", + "Casual": "Випадковий", + "Script": "Писемний", + "Small Caps": "Малі прописні", + "Reset": "Скинути", + "restore all settings to the default values": "скинути всі налаштування за замовчуванням", + "Done": "Готово", + "Caption Settings Dialog": "Діалог налаштувань підпису", + "Beginning of dialog window. Escape will cancel and close the window.": "Початок діалоговго вікна. Кнопка Escape закриє або скасує вікно", + "End of dialog window.": "Кінець діалогового вікна.", + "{1} is loading.": "{1} завантажується." +} diff --git a/Resources/public/js/vendor/video-js/lang/vi.js b/Resources/public/js/vendor/video-js/lang/vi.js new file mode 100644 index 00000000..be0772e0 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/vi.js @@ -0,0 +1,84 @@ +videojs.addLanguage('vi', { + "Audio Player": "Trình phát Audio", + "Video Player": "Trình phát Video", + "Play": "Phát", + "Pause": "Tạm dừng", + "Replay": "Phát lại", + "Current Time": "Thời gian hiện tại", + "Duration": "Độ dài", + "Remaining Time": "Thời gian còn lại", + "Stream Type": "Kiểu Stream", + "LIVE": "TRỰC TIẾP", + "Loaded": "Đã tải", + "Progress": "Tiến trình", + "Progress Bar": "Thanh tiến trình", + "progress bar timing: currentTime={1} duration={2}": "{1} của {2}", + "Fullscreen": "Toàn màn hình", + "Non-Fullscreen": "Thoát toàn màn hình", + "Mute": "Tắt tiếng", + "Unmute": "Bật âm thanh", + "Playback Rate": "Tỉ lệ phát lại", + "Subtitles": "Phụ đề", + "subtitles off": "tắt phụ đề", + "Captions": "Chú thích", + "captions off": "tắt chú thích", + "Chapters": "Chương", + "Descriptions": "Mô tả", + "descriptions off": "tắt mô tả", + "Audio Track": "Track âm thanh", + "Volume Level": "Mức âm lượng", + "You aborted the media playback": "Bạn đã hủy việc phát lại media.", + "A network error caused the media download to fail part-way.": "Một lỗi mạng dẫn đến việc tải media bị lỗi.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video không tải được, mạng hay server có lỗi hoặc định dạng không được hỗ trợ.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Phát media đã bị hủy do một sai lỗi hoặc media sử dụng những tính năng trình duyệt không hỗ trợ.", + "No compatible source was found for this media.": "Không có nguồn tương thích cho media này.", + "The media is encrypted and we do not have the keys to decrypt it.": "Media đã được mã hóa và chúng tôi không có để giải mã nó.", + "Play Video": "Phát Video", + "Close": "Đóng", + "Close Modal Dialog": "Đóng cửa sổ", + "Modal Window": "Cửa sổ", + "This is a modal window": "Đây là một cửa sổ", + "This modal can be closed by pressing the Escape key or activating the close button.": "Cửa sổ này có thể thoát bằng việc nhấn phím Esc hoặc kích hoạt nút đóng.", + ", opens captions settings dialog": ", mở hộp thoại cài đặt chú thích", + ", opens subtitles settings dialog": ", mở hộp thoại cài đặt phụ đề", + ", opens descriptions settings dialog": ", mở hộp thoại cài đặt mô tả", + ", selected": ", đã chọn", + "captions settings": "cài đặt chú thích", + "subtitles settings": "cài đặt phụ đề", + "descriptions settings": "cài đặt mô tả", + "Text": "Văn bản", + "White": "Trắng", + "Black": "Đen", + "Red": "Đỏ", + "Green": "Xanh lá cây", + "Blue": "Xanh da trời", + "Yellow": "Vàng", + "Magenta": "Đỏ tươi", + "Cyan": "Lam", + "Background": "Nền", + "Window": "Cửa sổ", + "Transparent": "Trong suốt", + "Semi-Transparent": "Bán trong suốt", + "Opaque": "Mờ", + "Font Size": "Kích cỡ phông chữ", + "Text Edge Style": "Dạng viền văn bản", + "None": "None", + "Raised": "Raised", + "Depressed": "Depressed", + "Uniform": "Uniform", + "Dropshadow": "Dropshadow", + "Font Family": "Phông chữ", + "Proportional Sans-Serif": "Proportional Sans-Serif", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Proportional Serif", + "Monospace Serif": "Monospace Serif", + "Casual": "Casual", + "Script": "Script", + "Small Caps": "Small Caps", + "Reset": "Đặt lại", + "restore all settings to the default values": "khôi phục lại tất cả các cài đặt về giá trị mặc định", + "Done": "Xong", + "Caption Settings Dialog": "Hộp thoại cài đặt chú thích", + "Beginning of dialog window. Escape will cancel and close the window.": "Bắt đầu cửa sổ hộp thoại. Esc sẽ thoát và đóng cửa sổ.", + "End of dialog window.": "Kết thúc cửa sổ hộp thoại." +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/vi.json b/Resources/public/js/vendor/video-js/lang/vi.json new file mode 100644 index 00000000..5e95b533 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/vi.json @@ -0,0 +1,84 @@ +{ + "Audio Player": "Trình phát Audio", + "Video Player": "Trình phát Video", + "Play": "Phát", + "Pause": "Tạm dừng", + "Replay": "Phát lại", + "Current Time": "Thời gian hiện tại", + "Duration": "Độ dài", + "Remaining Time": "Thời gian còn lại", + "Stream Type": "Kiểu Stream", + "LIVE": "TRỰC TIẾP", + "Loaded": "Đã tải", + "Progress": "Tiến trình", + "Progress Bar": "Thanh tiến trình", + "progress bar timing: currentTime={1} duration={2}": "{1} của {2}", + "Fullscreen": "Toàn màn hình", + "Non-Fullscreen": "Thoát toàn màn hình", + "Mute": "Tắt tiếng", + "Unmute": "Bật âm thanh", + "Playback Rate": "Tỉ lệ phát lại", + "Subtitles": "Phụ đề", + "subtitles off": "tắt phụ đề", + "Captions": "Chú thích", + "captions off": "tắt chú thích", + "Chapters": "Chương", + "Descriptions": "Mô tả", + "descriptions off": "tắt mô tả", + "Audio Track": "Track âm thanh", + "Volume Level": "Mức âm lượng", + "You aborted the media playback": "Bạn đã hủy việc phát lại media.", + "A network error caused the media download to fail part-way.": "Một lỗi mạng dẫn đến việc tải media bị lỗi.", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "Video không tải được, mạng hay server có lỗi hoặc định dạng không được hỗ trợ.", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "Phát media đã bị hủy do một sai lỗi hoặc media sử dụng những tính năng trình duyệt không hỗ trợ.", + "No compatible source was found for this media.": "Không có nguồn tương thích cho media này.", + "The media is encrypted and we do not have the keys to decrypt it.": "Media đã được mã hóa và chúng tôi không có để giải mã nó.", + "Play Video": "Phát Video", + "Close": "Đóng", + "Close Modal Dialog": "Đóng cửa sổ", + "Modal Window": "Cửa sổ", + "This is a modal window": "Đây là một cửa sổ", + "This modal can be closed by pressing the Escape key or activating the close button.": "Cửa sổ này có thể thoát bằng việc nhấn phím Esc hoặc kích hoạt nút đóng.", + ", opens captions settings dialog": ", mở hộp thoại cài đặt chú thích", + ", opens subtitles settings dialog": ", mở hộp thoại cài đặt phụ đề", + ", opens descriptions settings dialog": ", mở hộp thoại cài đặt mô tả", + ", selected": ", đã chọn", + "captions settings": "cài đặt chú thích", + "subtitles settings": "cài đặt phụ đề", + "descriptions settings": "cài đặt mô tả", + "Text": "Văn bản", + "White": "Trắng", + "Black": "Đen", + "Red": "Đỏ", + "Green": "Xanh lá cây", + "Blue": "Xanh da trời", + "Yellow": "Vàng", + "Magenta": "Đỏ tươi", + "Cyan": "Lam", + "Background": "Nền", + "Window": "Cửa sổ", + "Transparent": "Trong suốt", + "Semi-Transparent": "Bán trong suốt", + "Opaque": "Mờ", + "Font Size": "Kích cỡ phông chữ", + "Text Edge Style": "Dạng viền văn bản", + "None": "None", + "Raised": "Raised", + "Depressed": "Depressed", + "Uniform": "Uniform", + "Dropshadow": "Dropshadow", + "Font Family": "Phông chữ", + "Proportional Sans-Serif": "Proportional Sans-Serif", + "Monospace Sans-Serif": "Monospace Sans-Serif", + "Proportional Serif": "Proportional Serif", + "Monospace Serif": "Monospace Serif", + "Casual": "Casual", + "Script": "Script", + "Small Caps": "Small Caps", + "Reset": "Đặt lại", + "restore all settings to the default values": "khôi phục lại tất cả các cài đặt về giá trị mặc định", + "Done": "Xong", + "Caption Settings Dialog": "Hộp thoại cài đặt chú thích", + "Beginning of dialog window. Escape will cancel and close the window.": "Bắt đầu cửa sổ hộp thoại. Esc sẽ thoát và đóng cửa sổ.", + "End of dialog window.": "Kết thúc cửa sổ hộp thoại." +} diff --git a/Resources/public/js/vendor/video-js/lang/zh-CN.js b/Resources/public/js/vendor/video-js/lang/zh-CN.js new file mode 100644 index 00000000..81df7739 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/zh-CN.js @@ -0,0 +1,83 @@ +videojs.addLanguage('zh-CN', { + "Play": "播放", + "Pause": "暂停", + "Current Time": "当前时间", + "Duration": "时长", + "Remaining Time": "剩余时间", + "Stream Type": "媒体流类型", + "LIVE": "直播", + "Loaded": "加载完毕", + "Progress": "进度", + "Fullscreen": "全屏", + "Non-Fullscreen": "退出全屏", + "Mute": "静音", + "Unmute": "取消静音", + "Playback Rate": "播放速度", + "Subtitles": "字幕", + "subtitles off": "关闭字幕", + "Captions": "内嵌字幕", + "captions off": "关闭内嵌字幕", + "Chapters": "节目段落", + "Close Modal Dialog": "关闭弹窗", + "Descriptions": "描述", + "descriptions off": "关闭描述", + "Audio Track": "音轨", + "You aborted the media playback": "视频播放被终止", + "A network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。", + "No compatible source was found for this media.": "无法找到此视频兼容的源。", + "The media is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。", + "Play Video": "播放视频", + "Close": "关闭", + "Modal Window": "弹窗", + "This is a modal window": "这是一个弹窗", + "This modal can be closed by pressing the Escape key or activating the close button.": "可以按ESC按键或启用关闭按钮来关闭此弹窗。", + ", opens captions settings dialog": ", 开启标题设置弹窗", + ", opens subtitles settings dialog": ", 开启字幕设置弹窗", + ", opens descriptions settings dialog": ", 开启描述设置弹窗", + ", selected": ", 选择", + "captions settings": "字幕设定", + "Audio Player": "音频播放器", + "Video Player": "视频播放器", + "Replay": "重播", + "Progress Bar": "进度小节", + "Volume Level": "音量", + "subtitles settings": "字幕设定", + "descriptions settings": "描述设定", + "Text": "文字", + "White": "白", + "Black": "黑", + "Red": "红", + "Green": "绿", + "Blue": "蓝", + "Yellow": "黄", + "Magenta": "紫红", + "Cyan": "青", + "Background": "背景", + "Window": "视窗", + "Transparent": "透明", + "Semi-Transparent": "半透明", + "Opaque": "不透明", + "Font Size": "字体尺寸", + "Text Edge Style": "字体边缘样式", + "None": "无", + "Raised": "浮雕", + "Depressed": "压低", + "Uniform": "均匀", + "Dropshadow": "下阴影", + "Font Family": "字体库", + "Proportional Sans-Serif": "比例无细体", + "Monospace Sans-Serif": "单间隔无细体", + "Proportional Serif": "比例细体", + "Monospace Serif": "单间隔细体", + "Casual": "舒适", + "Script": "手写体", + "Small Caps": "小型大写字体", + "Reset": "重启", + "restore all settings to the default values": "恢复全部设定至预设值", + "Done": "完成", + "Caption Settings Dialog": "字幕设定视窗", + "Beginning of dialog window. Escape will cancel and close the window.": "开始对话视窗。离开会取消及关闭视窗", + "End of dialog window.": "结束对话视窗" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/zh-CN.json b/Resources/public/js/vendor/video-js/lang/zh-CN.json new file mode 100644 index 00000000..895bf240 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/zh-CN.json @@ -0,0 +1,84 @@ +{ + "Play": "播放", + "Pause": "暂停", + "Current Time": "当前时间", + "Duration": "时长", + "Remaining Time": "剩余时间", + "Stream Type": "媒体流类型", + "LIVE": "直播", + "Loaded": "加载完毕", + "Progress": "进度", + "Fullscreen": "全屏", + "Non-Fullscreen": "退出全屏", + "Mute": "静音", + "Unmute": "取消静音", + "Playback Rate": "播放速度", + "Subtitles": "字幕", + "subtitles off": "关闭字幕", + "Captions": "内嵌字幕", + "captions off": "关闭内嵌字幕", + "Chapters": "节目段落", + "Close Modal Dialog": "关闭弹窗", + "Descriptions": "描述", + "descriptions off": "关闭描述", + "Audio Track": "音轨", + "You aborted the media playback": "视频播放被终止", + "A network error caused the media download to fail part-way.": "网络错误导致视频下载中途失败。", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "视频因格式不支持或者服务器或网络的问题无法加载。", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由于视频文件损坏或是该视频使用了你的浏览器不支持的功能,播放终止。", + "No compatible source was found for this media.": "无法找到此视频兼容的源。", + "The media is encrypted and we do not have the keys to decrypt it.": "视频已加密,无法解密。", + "Play Video": "播放视频", + "Close": "关闭", + "Modal Window": "弹窗", + "This is a modal window": "这是一个弹窗", + "This modal can be closed by pressing the Escape key or activating the close button.": "可以按ESC按键或启用关闭按钮来关闭此弹窗。", + ", opens captions settings dialog": ", 开启标题设置弹窗", + ", opens subtitles settings dialog": ", 开启字幕设置弹窗", + ", opens descriptions settings dialog": ", 开启描述设置弹窗", + ", selected": ", 选择", + "captions settings": "字幕设定", + "Audio Player": "音频播放器", + "Video Player": "视频播放器", + "Replay": "重播", + "Progress Bar": "进度小节", + "Volume Level": "音量", + "Close Modal Dialog": "关闭弹窗", + "subtitles settings": "字幕设定", + "descriptions settings": "描述设定", + "Text": "文字", + "White": "白", + "Black": "黑", + "Red": "红", + "Green": "绿", + "Blue": "蓝", + "Yellow": "黄", + "Magenta": "紫红", + "Cyan": "青", + "Background": "背景", + "Window": "视窗", + "Transparent": "透明", + "Semi-Transparent": "半透明", + "Opaque": "不透明", + "Font Size": "字体尺寸", + "Text Edge Style": "字体边缘样式", + "None": "无", + "Raised": "浮雕", + "Depressed": "压低", + "Uniform": "均匀", + "Dropshadow": "下阴影", + "Font Family": "字体库", + "Proportional Sans-Serif": "比例无细体", + "Monospace Sans-Serif": "单间隔无细体", + "Proportional Serif": "比例细体", + "Monospace Serif": "单间隔细体", + "Casual": "舒适", + "Script": "手写体", + "Small Caps": "小型大写字体", + "Reset": "重启", + "restore all settings to the default values": "恢复全部设定至预设值", + "Done": "完成", + "Caption Settings Dialog": "字幕设定视窗", + "Beginning of dialog window. Escape will cancel and close the window.": "开始对话视窗。离开会取消及关闭视窗", + "End of dialog window.": "结束对话视窗" +} diff --git a/Resources/public/js/vendor/video-js/lang/zh-TW.js b/Resources/public/js/vendor/video-js/lang/zh-TW.js new file mode 100644 index 00000000..19b56959 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/zh-TW.js @@ -0,0 +1,83 @@ +videojs.addLanguage('zh-TW', { + "Play": "播放", + "Pause": "暫停", + "Current Time": "目前時間", + "Duration": "總共時間", + "Remaining Time": "剩餘時間", + "Stream Type": "串流類型", + "LIVE": "直播", + "Loaded": "載入完畢", + "Progress": "進度", + "Fullscreen": "全螢幕", + "Non-Fullscreen": "退出全螢幕", + "Mute": "靜音", + "Unmute": "取消靜音", + "Playback Rate": " 播放速率", + "Subtitles": "字幕", + "subtitles off": "關閉字幕", + "Captions": "內嵌字幕", + "captions off": "關閉內嵌字幕", + "Chapters": "章節", + "Close Modal Dialog": "關閉彈窗", + "Descriptions": "描述", + "descriptions off": "關閉描述", + "Audio Track": "音軌", + "You aborted the media playback": "影片播放已終止", + "A network error caused the media download to fail part-way.": "網路錯誤導致影片下載失敗。", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "影片因格式不支援或者伺服器或網路的問題無法載入。", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由於影片檔案損毀或是該影片使用了您的瀏覽器不支援的功能,播放終止。", + "No compatible source was found for this media.": "無法找到相容此影片的來源。", + "The media is encrypted and we do not have the keys to decrypt it.": "影片已加密,無法解密。", + "Play Video": "播放影片", + "Close": "關閉", + "Modal Window": "對話框", + "This is a modal window": "這是一個對話框", + "This modal can be closed by pressing the Escape key or activating the close button.": "可以按ESC按鍵或啟用關閉按鈕來關閉此對話框。", + ", opens captions settings dialog": ", 開啟標題設定對話框", + ", opens subtitles settings dialog": ", 開啟字幕設定對話框", + ", opens descriptions settings dialog": ", 開啟描述設定對話框", + ", selected": ", 選擇", + "captions settings": "字幕設定", + "Audio Player": "音頻播放器", + "Video Player": "視頻播放器", + "Replay": "重播", + "Progress Bar": "進度小節", + "Volume Level": "音量", + "subtitles settings": "字幕設定", + "descriptions settings": "描述設定", + "Text": "文字", + "White": "白", + "Black": "黑", + "Red": "紅", + "Green": "綠", + "Blue": "藍", + "Yellow": "黃", + "Magenta": "紫紅", + "Cyan": "青", + "Background": "背景", + "Window": "視窗", + "Transparent": "透明", + "Semi-Transparent": "半透明", + "Opaque": "不透明", + "Font Size": "字型尺寸", + "Text Edge Style": "字型邊緣樣式", + "None": "無", + "Raised": "浮雕", + "Depressed": "壓低", + "Uniform": "均勻", + "Dropshadow": "下陰影", + "Font Family": "字型庫", + "Proportional Sans-Serif": "比例無細體", + "Monospace Sans-Serif": "單間隔無細體", + "Proportional Serif": "比例細體", + "Monospace Serif": "單間隔細體", + "Casual": "輕便的", + "Script": "手寫體", + "Small Caps": "小型大寫字體", + "Reset": "重置", + "restore all settings to the default values": "恢復全部設定至預設值", + "Done": "完成", + "Caption Settings Dialog": "字幕設定視窗", + "Beginning of dialog window. Escape will cancel and close the window.": "開始對話視窗。離開會取消及關閉視窗", + "End of dialog window.": "結束對話視窗" +}); \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/lang/zh-TW.json b/Resources/public/js/vendor/video-js/lang/zh-TW.json new file mode 100644 index 00000000..709cfb10 --- /dev/null +++ b/Resources/public/js/vendor/video-js/lang/zh-TW.json @@ -0,0 +1,84 @@ +{ + "Play": "播放", + "Pause": "暫停", + "Current Time": "目前時間", + "Duration": "總共時間", + "Remaining Time": "剩餘時間", + "Stream Type": "串流類型", + "LIVE": "直播", + "Loaded": "載入完畢", + "Progress": "進度", + "Fullscreen": "全螢幕", + "Non-Fullscreen": "退出全螢幕", + "Mute": "靜音", + "Unmute": "取消靜音", + "Playback Rate": " 播放速率", + "Subtitles": "字幕", + "subtitles off": "關閉字幕", + "Captions": "內嵌字幕", + "captions off": "關閉內嵌字幕", + "Chapters": "章節", + "Close Modal Dialog": "關閉對話框", + "Descriptions": "描述", + "descriptions off": "關閉描述", + "Audio Track": "音軌", + "You aborted the media playback": "影片播放已終止", + "A network error caused the media download to fail part-way.": "網路錯誤導致影片下載失敗。", + "The media could not be loaded, either because the server or network failed or because the format is not supported.": "影片因格式不支援或者伺服器或網路的問題無法載入。", + "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.": "由於影片檔案損毀或是該影片使用了您的瀏覽器不支援的功能,播放終止。", + "No compatible source was found for this media.": "無法找到相容此影片的來源。", + "The media is encrypted and we do not have the keys to decrypt it.": "影片已加密,無法解密。", + "Play Video": "播放影片", + "Close": "關閉", + "Modal Window": "對話框", + "This is a modal window": "這是一個對話框", + "This modal can be closed by pressing the Escape key or activating the close button.": "可以按ESC按鍵或啟用關閉按鈕來關閉此對話框。", + ", opens captions settings dialog": ", 開啟標題設定對話框", + ", opens subtitles settings dialog": ", 開啟字幕設定對話框", + ", opens descriptions settings dialog": ", 開啟描述設定對話框", + ", selected": ", 選擇", + "captions settings": "字幕設定", + "Audio Player": "音頻播放器", + "Video Player": "視頻播放器", + "Replay": "重播", + "Progress Bar": "進度小節", + "Volume Level": "音量", + "Close Modal Dialog": "關閉彈窗", + "subtitles settings": "字幕設定", + "descriptions settings": "描述設定", + "Text": "文字", + "White": "白", + "Black": "黑", + "Red": "紅", + "Green": "綠", + "Blue": "藍", + "Yellow": "黃", + "Magenta": "紫紅", + "Cyan": "青", + "Background": "背景", + "Window": "視窗", + "Transparent": "透明", + "Semi-Transparent": "半透明", + "Opaque": "不透明", + "Font Size": "字型尺寸", + "Text Edge Style": "字型邊緣樣式", + "None": "無", + "Raised": "浮雕", + "Depressed": "壓低", + "Uniform": "均勻", + "Dropshadow": "下陰影", + "Font Family": "字型庫", + "Proportional Sans-Serif": "比例無細體", + "Monospace Sans-Serif": "單間隔無細體", + "Proportional Serif": "比例細體", + "Monospace Serif": "單間隔細體", + "Casual": "輕便的", + "Script": "手寫體", + "Small Caps": "小型大寫字體", + "Reset": "重置", + "restore all settings to the default values": "恢復全部設定至預設值", + "Done": "完成", + "Caption Settings Dialog": "字幕設定視窗", + "Beginning of dialog window. Escape will cancel and close the window.": "開始對話視窗。離開會取消及關閉視窗", + "End of dialog window.": "結束對話視窗" +} diff --git a/Resources/public/js/vendor/video-js/video-js.css b/Resources/public/js/vendor/video-js/video-js.css new file mode 100644 index 00000000..d1f15f39 --- /dev/null +++ b/Resources/public/js/vendor/video-js/video-js.css @@ -0,0 +1,1343 @@ +.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before, .video-js .vjs-modal-dialog, .vjs-modal-dialog .vjs-modal-dialog-content { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + +.video-js .vjs-big-play-button .vjs-icon-placeholder:before, .vjs-button > .vjs-icon-placeholder:before { + text-align: center; } + +@font-face { + font-family: VideoJS; + src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABBIAAsAAAAAGoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3RY21hcAAAAYQAAADQAAADIjn098ZnbHlmAAACVAAACv4AABEIAwnSw2hlYWQAAA1UAAAAKwAAADYV1OgpaGhlYQAADYAAAAAbAAAAJA4DByFobXR4AAANnAAAAA8AAACE4AAAAGxvY2EAAA2sAAAARAAAAEQ9NEHGbWF4cAAADfAAAAAfAAAAIAEyAIFuYW1lAAAOEAAAASUAAAIK1cf1oHBvc3QAAA84AAABDwAAAZ5AAl/0eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGQ7xTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGBHcRdyA4RZgQRAC4HCwEAAHic7dFprsIgAEXhg8U61XmeWcBb1FuQP4w7ZQXK5boMm3yclFDSANAHmuKviBBeBPQ8ymyo8w3jOh/5r2ui5nN6v8sYNJb3WMdeWRvLji0DhozKdxM6psyYs2DJijUbtuzYc+DIiTMXrty4k8oGLb+n0xCe37ekM7Z66j1DbUy3l6PpHnLfdLO5NdSBoQ4NdWSoY9ON54mhdqa/y1NDnRnq3FAXhro01JWhrg11Y6hbQ90Z6t5QD4Z6NNSToZ4N9WKoV0O9GerdUJORPqkhTd54nJ1YDXBU1RV+576/JBs2bPYPkrDZt5vsJrv53V/I5mclhGDCTwgGBQQSTEji4hCkYIAGd4TGIWFAhV0RQTpWmQp1xv6hA4OTOlNr2zFANbHUYbq2OtNCpViRqsk+e+7bTQAhzti8vPfuPffcc88959zznbcMMPjHD/KDDGEY0ABpYX384NhlomIYlo4JISGEY9mMh2FSidYiqkEUphtNYDSY/dXg9023l4DdxlqUl0chuZRhncJKrsCQHIwcGuwfnhMIzBnuH4Sym+1D2zaGjheXlhYfD238z80mKYMmvJ5XeOTzd8z9eujbMxJNhu4C9xPE/bCMiDuSNIWgkTQwBE55hLSAE7ZwhrHLnAHZOGV/kmBGTiNjZxzI77Hb7Hqjz68TjT6vh+5JT/cCIkqS0D6CqPf5jX4Qjdx5j6vlDfZM4aZFdbVXIxtOlJaP/WottMnH6CJQ3bTiue3PrY23HjnChtuamxwvvzFjxkPrNj3z0tG9T561HDYf6OgmRWvlY3JQHoQb8ltV2Yet7YfWctEjR1AtxS/cSX6U4alf6NJEBQ7YKg9wrXQKd0IeZCb2ux75Uhh1Un+Nz+9LTOE7PK777nN5xqdTneTBhCbx446mZrhnUkrCz2YhA9dSMxaG0SYmT8hi9ZPu1E94PJYQSH6LRmhxec7Q7ZeXntgQuVpbh+a4qWNsckVyTdn0P7o7DpgPW84+uRcq0BITflBikGdUjAZ9wYBVI3mtrNvr9kpg1UsaK6t3690aoorC1lg0GpMH2HAMtkZjsSi5Ig9ESVosOh7GQfLjKNLvKpMKkLSKNFAka710GdgSi8oDMSoNhqjkKBXTgn3swtaxyzGkUzIzae9RtLdWkSlZ1KDX6EzgllzV4NV4SoDFSOGD4+HCeQUF8wrZ5Hs8zIb5EaVxy8DYFTbMCJPnLIWZxugZE2NlivC0gc1qEQUR8jEKgZcAXeH18BiCgl5nlHh0CrjB4Hb5fX4gb0J7c9PuHVsfgkx2n/vTY/JV8kn8PGxf7faOZ8qX8JVByuIf4whk9sqXli2hvPJV9hrp0hY7l8r2x37ydaVsb4xvXv/47v2NjfCl8m5oRDJclFMoE1yk0Uh1Te4/m8lFXe9qBZD0EkheicebXvzI2PLCuoKCukLuhPIeKwaHPEouxw3kMqaIUXDQ1p0mip+MyCORSCQaoUsnY1VZ38nUTrG21WvVo4f1OsEJFhvSfAFwGfT8VHRMeAVUpwLOoLzjT/REIj3O3FhuURE+nERF+0pTId5Fyxv5sfwGyg4O+my4vZv0sZm7oeQlFZORiB+tG0MweVNraeitl7yxiPIHTk4/diVxs94o5lEYishB2iAtkchEnsActoEpx44Fo8XnsQMaA22BlqC20RmhBKzYojZyYaxg+JggMc4HHY2m+L9EkWSYljirOisrO7d3VorxzyZ6Vc4lJqITAu1b2wOBdrLElAP+bFc2eGaZFVbkmJktv5uT6Jlz5D/MnBFor6ig/JPnRViBsV3LNKGGqB1ChJ0tgQywlVLFJIuQgTFttwkiKxhyQdAZMdMYtSaoAewqfvXVYPAbDT6/1mez85YS8FSDywQ6NfAnef6FNEGMilnppyvn5rB6tTyq1pOceRWnp2WJEZFXHeX5oyoem1nTTgdqc4heDY7bOeKz63vnz+/dRx+s31Ht2JGanQ5seirfWJL9tjozU/12TnEjn5oux9OzU3ckGbBzBwNOyk69JykKH0n/0LM9A72tuwM3zQpIRu4AxiToseEpgPOmbROyFe9/X2yeUvoUsCyEvjcgs7fpWP3/aKlFN0+6HFUe6D9HFz/XPwBlN9tTqNyZjFJ8UO2RUT5/h4CptCctEyeisnOyXjALEp7dXKaQKf6O7IMnGjNNACRMLxqdYJX8eMLvmmd68D+ayBLyKKYZwYxDt/GNhzETDJ05Qxlyi3pi3/Z93ndYVSumgj0V/KkIFlO6+1K3fF2+3g0q+YtuSIf0bvmLqV09nnobI6hwcjIP8aPCKayjsF5JBY3LaKAeRLSyYB1h81oTwe9SlPMkXB7G0mfL9q71gaqqwPqu67QRKS1+ObTx+sbQy9QV2OQHEScGkdFBeT7v7qisqqrs6N52i78/R+6S0qQONVj26agOVoswCyQWIV5D86vH53bxNUeXV0K+XZaHv/nm/KsHhOvylwsWnJX/HE8l/4WCv5x+l5n08z6UU8bUMa3MBpSmM7F63AxntdC9eBCKEZW9Hr+ABNqtxgAQrSbMtmrW7lKQuoSgBhSrTazWVU2QAKWY8wiiuhqFmQgWJBgoXiuWIm42N7hqZbBsgXz52O5P5uSvaNgFGnOuvsRw8I8Laha91wMvDuxqWFheN7/8GVtTltdS83DQsXRmqc5ZtcJXEVrlV2doTWk5+Yunm71dG5f55m/qY0MjI93vv9/NfpxXV9sUXrxy2fbNy1or65cOlDRnOoKFeeXcbw42H/bNDT5Qs3flgs31gWC1lD1nfUV/X7NdCnSUdHY2e8afzfKsqZ5ZljfDqjLOmk3UebNXB+aHArPYDRs+/HDDxeT5DiP+sFg7OpRaVQMGBV89PpeBdj22hCE0Uub0UqwLrNWsG0cuyadgLXTeR5rbO4+3c/vl15cur2nRq+TXCQDcS3SO+s6ak+e5/eMS+1dw3btu3YG2tvFL8XdIZvdjdW6TO/4B7IdrZWVPmctm5/59AgsPItTSbCiIBr2OqIGzmu20SMKAS7yqwGBUfGfgjDYlLLDeF0SfcLB2LSx8flT+08/kzz6yOj96rft4rpTjdPQcmLd47uKibbDq7ZSz/XtbH2nN717Nd62rU+c8Icevvv7I09wA6WvjVcafb+FsbNG+ZQ80Rn6ZZsvrP7teP2dzTdoETvNhjCmsr8FID2sJ69VYvdUcxk4AzYRlKcaE38eXNRlfW9H1as9i6acLHp1XpuNB5K7DIvkX08y1ZYvh3KfWaiCzH+ztrSDmD7LuX73x/mJelB8Yj39t8nhNQJJ2CAthpoFGLsGgtSOCJooCGoaJAMTjSWHVZ08YAa1Fg9lPI5U6DOsGVjDasJeZZ+YyhfCwfOzCxlBA69M9XLXtza7H/rav+9Tjq5xNi0wpKQIRNO4Lrzz7yp5QVYM6Jd/oc1Uvn/mQhhuWh6ENXoS2YTZ8QT42bF5d/559zp5r0Uff2VnR2tdf2/WCOd2cO0Mw6qpWPnvxpV0nrt5fZd2yItc199GWe8vlNfNDq+CH/7yAAnB9hn7T4QO4c1g9ScxsZgmzntnE/IDGndtHMw69lFwoCnYsMGx+rBp8JSBqdLzBr9QRPq/PbhWMWFtQZp1xguy/haw3TEHm3TWAnxFWQQWgt7M5OV0lCz1VRYucpWliy7z6Zd4urwPIyeZQqli2Lgg7szJV09PysATbOQtYIrB2YzbkJYkGgJ0m4AjPUap1pvYu1K9qr97z0Yl3p332b2LYB78ncYIlRkau/8GObSsOlZancACE5d5ily+c2+7h5Yj4lqhVmXXB+iXLfvdqSgqfKtQvfHDV0OnvQR1qhw42XS/vkvsh/hXcrDFP0a+SJNIomEfD1nsrYGO+1bgTOJhM8Hv6ek+7vVglxuSRwoKn17S937bm6YJCeSSG0Op1n+7tE37tcZ/p7dsTv4EUrGpDbWueKigsLHhqTVsoEj+JU0kaSjnj9tz8/gryQWwJ9BcJXBC/7smO+I/IFURJetFPrdt5WcoL6DbEJaygI8CTHfQTjf40ofD+DwalTqIAAHicY2BkYGAA4gDud4bx/DZfGbjZGUDg+q1z05BpdkawOAcDE4gCAB45CXEAeJxjYGRgYGcAARD5/z87IwMjAypQBAAtgwI4AHicY2BgYGAfYAwAOkQA4QAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhHicY2BkYGBQZChlYGcAASYg5gJCBob/YD4DABfTAbQAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2PyXLCMBBE3YCNDWEL2ffk7o8S8oCnkCVHC5C/jzBQlUP6IHVPzYyekl5y0iL5X5/ooY8BUmQYIkeBEca4wgRTzDDHAtdY4ga3uMM9HvCIJzzjBa94wzs+8ImvZNAq8TM+HqVkKxWlrQiOxjujQkNlEzyNzl6Z/cU2XF06at7U83VQyklLpEvSnuzsb+HAPnPfQVgaupa1Jlu4sPLsFblcitaz0dHU0ZF1qatjZ1+aTXYCmp6u0gSvWNPyHLtFZ+ZeXWVSaEkqs3T8S74WklbGbNNNq4LL4+CWKtZDv2cfX8l8aFbKFhEnJnJ+IULFpqwoQnNHlHaVQtPBl+ypmbSWdmyC61KS/AKZC3Y+AA==) format("woff"); + font-weight: normal; + font-style: normal; } + +.vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before { + content: "\f101"; } + +.vjs-icon-play-circle { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-play-circle:before { + content: "\f102"; } + +.vjs-icon-pause, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-pause:before, .video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before { + content: "\f103"; } + +.vjs-icon-volume-mute, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-mute:before, .video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before { + content: "\f104"; } + +.vjs-icon-volume-low, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-low:before, .video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before { + content: "\f105"; } + +.vjs-icon-volume-mid, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-mid:before, .video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before { + content: "\f106"; } + +.vjs-icon-volume-high, .video-js .vjs-mute-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before { + content: "\f107"; } + +.vjs-icon-fullscreen-enter, .video-js .vjs-fullscreen-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before { + content: "\f108"; } + +.vjs-icon-fullscreen-exit, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-fullscreen-exit:before, .video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before { + content: "\f109"; } + +.vjs-icon-square { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-square:before { + content: "\f10a"; } + +.vjs-icon-spinner { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-spinner:before { + content: "\f10b"; } + +.vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before { + content: "\f10c"; } + +.vjs-icon-captions, .video-js .vjs-captions-button .vjs-icon-placeholder, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder, +.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-captions:before, .video-js .vjs-captions-button .vjs-icon-placeholder:before, .video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before, + .video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before { + content: "\f10d"; } + +.vjs-icon-chapters, .video-js .vjs-chapters-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-chapters:before, .video-js .vjs-chapters-button .vjs-icon-placeholder:before { + content: "\f10e"; } + +.vjs-icon-share { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-share:before { + content: "\f10f"; } + +.vjs-icon-cog { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-cog:before { + content: "\f110"; } + +.vjs-icon-circle, .video-js .vjs-play-progress, .video-js .vjs-volume-level, .vjs-seek-to-live-control .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-circle:before, .video-js .vjs-play-progress:before, .video-js .vjs-volume-level:before, .vjs-seek-to-live-control .vjs-icon-placeholder:before { + content: "\f111"; } + +.vjs-icon-circle-outline { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-circle-outline:before { + content: "\f112"; } + +.vjs-icon-circle-inner-circle { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-circle-inner-circle:before { + content: "\f113"; } + +.vjs-icon-hd { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-hd:before { + content: "\f114"; } + +.vjs-icon-cancel, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-cancel:before, .video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before { + content: "\f115"; } + +.vjs-icon-replay, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-replay:before, .video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before { + content: "\f116"; } + +.vjs-icon-facebook { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-facebook:before { + content: "\f117"; } + +.vjs-icon-gplus { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-gplus:before { + content: "\f118"; } + +.vjs-icon-linkedin { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-linkedin:before { + content: "\f119"; } + +.vjs-icon-twitter { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-twitter:before { + content: "\f11a"; } + +.vjs-icon-tumblr { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-tumblr:before { + content: "\f11b"; } + +.vjs-icon-pinterest { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-pinterest:before { + content: "\f11c"; } + +.vjs-icon-audio-description, .video-js .vjs-descriptions-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-audio-description:before, .video-js .vjs-descriptions-button .vjs-icon-placeholder:before { + content: "\f11d"; } + +.vjs-icon-audio, .video-js .vjs-audio-button .vjs-icon-placeholder { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-audio:before, .video-js .vjs-audio-button .vjs-icon-placeholder:before { + content: "\f11e"; } + +.vjs-icon-next-item { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-next-item:before { + content: "\f11f"; } + +.vjs-icon-previous-item { + font-family: VideoJS; + font-weight: normal; + font-style: normal; } + .vjs-icon-previous-item:before { + content: "\f120"; } + +.video-js { + display: block; + vertical-align: top; + box-sizing: border-box; + color: #fff; + background-color: #000; + position: relative; + padding: 0; + font-size: 10px; + line-height: 1; + font-weight: normal; + font-style: normal; + font-family: Arial, Helvetica, sans-serif; + word-break: initial; } + .video-js:-moz-full-screen { + position: absolute; } + .video-js:-webkit-full-screen { + width: 100% !important; + height: 100% !important; } + +.video-js[tabindex="-1"] { + outline: none; } + +.video-js *, +.video-js *:before, +.video-js *:after { + box-sizing: inherit; } + +.video-js ul { + font-family: inherit; + font-size: inherit; + line-height: inherit; + list-style-position: outside; + margin-left: 0; + margin-right: 0; + margin-top: 0; + margin-bottom: 0; } + +.video-js.vjs-fluid, +.video-js.vjs-16-9, +.video-js.vjs-4-3 { + width: 100%; + max-width: 100%; + height: 0; } + +.video-js.vjs-16-9 { + padding-top: 56.25%; } + +.video-js.vjs-4-3 { + padding-top: 75%; } + +.video-js.vjs-fill { + width: 100%; + height: 100%; } + +.video-js .vjs-tech { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + +body.vjs-full-window { + padding: 0; + margin: 0; + height: 100%; } + +.vjs-full-window .video-js.vjs-fullscreen { + position: fixed; + overflow: hidden; + z-index: 1000; + left: 0; + top: 0; + bottom: 0; + right: 0; } + +.video-js.vjs-fullscreen { + width: 100% !important; + height: 100% !important; + padding-top: 0 !important; } + +.video-js.vjs-fullscreen.vjs-user-inactive { + cursor: none; } + +.vjs-hidden { + display: none !important; } + +.vjs-disabled { + opacity: 0.5; + cursor: default; } + +.video-js .vjs-offscreen { + height: 1px; + left: -9999px; + position: absolute; + top: 0; + width: 1px; } + +.vjs-lock-showing { + display: block !important; + opacity: 1; + visibility: visible; } + +.vjs-no-js { + padding: 20px; + color: #fff; + background-color: #000; + font-size: 18px; + font-family: Arial, Helvetica, sans-serif; + text-align: center; + width: 300px; + height: 150px; + margin: 0px auto; } + +.vjs-no-js a, +.vjs-no-js a:visited { + color: #66A8CC; } + +.video-js .vjs-big-play-button { + font-size: 3em; + line-height: 1.5em; + height: 1.5em; + width: 3em; + display: block; + position: absolute; + top: 10px; + left: 10px; + padding: 0; + cursor: pointer; + opacity: 1; + border: 0.06666em solid #fff; + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); + border-radius: 0.3em; + transition: all 0.4s; } + +.vjs-big-play-centered .vjs-big-play-button { + top: 50%; + left: 50%; + margin-top: -0.75em; + margin-left: -1.5em; } + +.video-js:hover .vjs-big-play-button, +.video-js .vjs-big-play-button:focus { + border-color: #fff; + background-color: #73859f; + background-color: rgba(115, 133, 159, 0.5); + transition: all 0s; } + +.vjs-controls-disabled .vjs-big-play-button, +.vjs-has-started .vjs-big-play-button, +.vjs-using-native-controls .vjs-big-play-button, +.vjs-error .vjs-big-play-button { + display: none; } + +.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button { + display: block; } + +.video-js button { + background: none; + border: none; + color: inherit; + display: inline-block; + font-size: inherit; + line-height: inherit; + text-transform: none; + text-decoration: none; + transition: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } + +.vjs-control .vjs-button { + width: 100%; + height: 100%; } + +.video-js .vjs-control.vjs-close-button { + cursor: pointer; + height: 3em; + position: absolute; + right: 0; + top: 0.5em; + z-index: 2; } + +.video-js .vjs-modal-dialog { + background: rgba(0, 0, 0, 0.8); + background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(255, 255, 255, 0)); + overflow: auto; } + +.video-js .vjs-modal-dialog > * { + box-sizing: border-box; } + +.vjs-modal-dialog .vjs-modal-dialog-content { + font-size: 1.2em; + line-height: 1.5; + padding: 20px 24px; + z-index: 1; } + +.vjs-menu-button { + cursor: pointer; } + +.vjs-menu-button.vjs-disabled { + cursor: default; } + +.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu { + display: none; } + +.vjs-menu .vjs-menu-content { + display: block; + padding: 0; + margin: 0; + font-family: Arial, Helvetica, sans-serif; + overflow: auto; } + +.vjs-menu .vjs-menu-content > * { + box-sizing: border-box; } + +.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu { + display: none; } + +.vjs-menu li { + list-style: none; + margin: 0; + padding: 0.2em 0; + line-height: 1.4em; + font-size: 1.2em; + text-align: center; + text-transform: lowercase; } + +.vjs-menu li.vjs-menu-item:focus, +.vjs-menu li.vjs-menu-item:hover, +.js-focus-visible .vjs-menu li.vjs-menu-item:hover { + background-color: #73859f; + background-color: rgba(115, 133, 159, 0.5); } + +.vjs-menu li.vjs-selected, +.vjs-menu li.vjs-selected:focus, +.vjs-menu li.vjs-selected:hover, +.js-focus-visible .vjs-menu li.vjs-selected:hover { + background-color: #fff; + color: #2B333F; } + +.vjs-menu li.vjs-menu-title { + text-align: center; + text-transform: uppercase; + font-size: 1em; + line-height: 2em; + padding: 0; + margin: 0 0 0.3em 0; + font-weight: bold; + cursor: default; } + +.vjs-menu-button-popup .vjs-menu { + display: none; + position: absolute; + bottom: 0; + width: 10em; + left: -3em; + height: 0em; + margin-bottom: 1.5em; + border-top-color: rgba(43, 51, 63, 0.7); } + +.vjs-menu-button-popup .vjs-menu .vjs-menu-content { + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); + position: absolute; + width: 100%; + bottom: 1.5em; + max-height: 15em; } + +.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu, +.vjs-menu-button-popup .vjs-menu.vjs-lock-showing { + display: block; } + +.video-js .vjs-menu-button-inline { + transition: all 0.4s; + overflow: hidden; } + +.video-js .vjs-menu-button-inline:before { + width: 2.222222222em; } + +.video-js .vjs-menu-button-inline:hover, +.video-js .vjs-menu-button-inline:focus, +.video-js .vjs-menu-button-inline.vjs-slider-active, +.video-js.vjs-no-flex .vjs-menu-button-inline { + width: 12em; } + +.vjs-menu-button-inline .vjs-menu { + opacity: 0; + height: 100%; + width: auto; + position: absolute; + left: 4em; + top: 0; + padding: 0; + margin: 0; + transition: all 0.4s; } + +.vjs-menu-button-inline:hover .vjs-menu, +.vjs-menu-button-inline:focus .vjs-menu, +.vjs-menu-button-inline.vjs-slider-active .vjs-menu { + display: block; + opacity: 1; } + +.vjs-no-flex .vjs-menu-button-inline .vjs-menu { + display: block; + opacity: 1; + position: relative; + width: auto; } + +.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu, +.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu, +.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu { + width: auto; } + +.vjs-menu-button-inline .vjs-menu-content { + width: auto; + height: 100%; + margin: 0; + overflow: hidden; } + +.video-js .vjs-control-bar { + display: none; + width: 100%; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 3.0em; + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); } + +.vjs-has-started .vjs-control-bar { + display: flex; + visibility: visible; + opacity: 1; + transition: visibility 0.1s, opacity 0.1s; } + +.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { + visibility: visible; + opacity: 0; + transition: visibility 1s, opacity 1s; } + +.vjs-controls-disabled .vjs-control-bar, +.vjs-using-native-controls .vjs-control-bar, +.vjs-error .vjs-control-bar { + display: none !important; } + +.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar { + opacity: 1; + visibility: visible; } + +.vjs-has-started.vjs-no-flex .vjs-control-bar { + display: table; } + +.video-js .vjs-control { + position: relative; + text-align: center; + margin: 0; + padding: 0; + height: 100%; + width: 4em; + flex: none; } + +.vjs-button > .vjs-icon-placeholder:before { + font-size: 1.8em; + line-height: 1.67; } + +.video-js .vjs-control:focus:before, +.video-js .vjs-control:hover:before, +.video-js .vjs-control:focus { + text-shadow: 0em 0em 1em white; } + +.video-js .vjs-control-text { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; } + +.vjs-no-flex .vjs-control { + display: table-cell; + vertical-align: middle; } + +.video-js .vjs-custom-control-spacer { + display: none; } + +.video-js .vjs-progress-control { + cursor: pointer; + flex: auto; + display: flex; + align-items: center; + min-width: 4em; + touch-action: none; } + +.video-js .vjs-progress-control.disabled { + cursor: default; } + +.vjs-live .vjs-progress-control { + display: none; } + +.vjs-liveui .vjs-progress-control { + display: flex; + align-items: center; } + +.vjs-no-flex .vjs-progress-control { + width: auto; } + +.video-js .vjs-progress-holder { + flex: auto; + transition: all 0.2s; + height: 0.3em; } + +.video-js .vjs-progress-control .vjs-progress-holder { + margin: 0 10px; } + +.video-js .vjs-progress-control:hover .vjs-progress-holder { + font-size: 1.666666666666666666em; } + +.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled { + font-size: 1em; } + +.video-js .vjs-progress-holder .vjs-play-progress, +.video-js .vjs-progress-holder .vjs-load-progress, +.video-js .vjs-progress-holder .vjs-load-progress div { + position: absolute; + display: block; + height: 100%; + margin: 0; + padding: 0; + width: 0; } + +.video-js .vjs-play-progress { + background-color: #fff; } + .video-js .vjs-play-progress:before { + font-size: 0.9em; + position: absolute; + right: -0.5em; + top: -0.333333333333333em; + z-index: 1; } + +.video-js .vjs-load-progress { + background: rgba(115, 133, 159, 0.5); } + +.video-js .vjs-load-progress div { + background: rgba(115, 133, 159, 0.75); } + +.video-js .vjs-time-tooltip { + background-color: #fff; + background-color: rgba(255, 255, 255, 0.8); + border-radius: 0.3em; + color: #000; + float: right; + font-family: Arial, Helvetica, sans-serif; + font-size: 1em; + padding: 6px 8px 8px 8px; + pointer-events: none; + position: absolute; + top: -3.4em; + visibility: hidden; + z-index: 1; } + +.video-js .vjs-progress-holder:focus .vjs-time-tooltip { + display: none; } + +.video-js .vjs-progress-control:hover .vjs-time-tooltip, +.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip { + display: block; + font-size: 0.6em; + visibility: visible; } + +.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip { + font-size: 1em; } + +.video-js .vjs-progress-control .vjs-mouse-display { + display: none; + position: absolute; + width: 1px; + height: 100%; + background-color: #000; + z-index: 1; } + +.vjs-no-flex .vjs-progress-control .vjs-mouse-display { + z-index: 0; } + +.video-js .vjs-progress-control:hover .vjs-mouse-display { + display: block; } + +.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display { + visibility: hidden; + opacity: 0; + transition: visibility 1s, opacity 1s; } + +.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display { + display: none; } + +.vjs-mouse-display .vjs-time-tooltip { + color: #fff; + background-color: #000; + background-color: rgba(0, 0, 0, 0.8); } + +.video-js .vjs-slider { + position: relative; + cursor: pointer; + padding: 0; + margin: 0 0.45em 0 0.45em; + /* iOS Safari */ + -webkit-touch-callout: none; + /* Safari */ + -webkit-user-select: none; + /* Konqueror HTML */ + /* Firefox */ + -moz-user-select: none; + /* Internet Explorer/Edge */ + -ms-user-select: none; + /* Non-prefixed version, currently supported by Chrome and Opera */ + user-select: none; + background-color: #73859f; + background-color: rgba(115, 133, 159, 0.5); } + +.video-js .vjs-slider.disabled { + cursor: default; } + +.video-js .vjs-slider:focus { + text-shadow: 0em 0em 1em white; + box-shadow: 0 0 1em #fff; } + +.video-js .vjs-mute-control { + cursor: pointer; + flex: none; } + +.video-js .vjs-volume-control { + cursor: pointer; + margin-right: 1em; + display: flex; } + +.video-js .vjs-volume-control.vjs-volume-horizontal { + width: 5em; } + +.video-js .vjs-volume-panel .vjs-volume-control { + visibility: visible; + opacity: 0; + width: 1px; + height: 1px; + margin-left: -1px; } + +.video-js .vjs-volume-panel { + transition: width 1s; } + .video-js .vjs-volume-panel:hover .vjs-volume-control, + .video-js .vjs-volume-panel:active .vjs-volume-control, + .video-js .vjs-volume-panel:focus .vjs-volume-control, + .video-js .vjs-volume-panel .vjs-volume-control:hover, + .video-js .vjs-volume-panel .vjs-volume-control:active, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active { + visibility: visible; + opacity: 1; + position: relative; + transition: visibility 0.1s, opacity 0.1s, height 0.1s, width 0.1s, left 0s, top 0s; } + .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal { + width: 5em; + height: 3em; } + .video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-vertical, + .video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical { + left: -3.5em; } + .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active, .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active { + width: 9em; + transition: width 0.1s; } + .video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only { + width: 4em; } + +.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical { + height: 8em; + width: 3em; + left: -3000em; + transition: visibility 1s, opacity 1s, height 1s 1s, width 1s 1s, left 1s 1s, top 1s 1s; } + +.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { + transition: visibility 1s, opacity 1s, height 1s 1s, width 1s, left 1s 1s, top 1s 1s; } + +.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal { + width: 5em; + height: 3em; + visibility: visible; + opacity: 1; + position: relative; + transition: none; } + +.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical, +.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical { + position: absolute; + bottom: 3em; + left: 0.5em; } + +.video-js .vjs-volume-panel { + display: flex; } + +.video-js .vjs-volume-bar { + margin: 1.35em 0.45em; } + +.vjs-volume-bar.vjs-slider-horizontal { + width: 5em; + height: 0.3em; } + +.vjs-volume-bar.vjs-slider-vertical { + width: 0.3em; + height: 5em; + margin: 1.35em auto; } + +.video-js .vjs-volume-level { + position: absolute; + bottom: 0; + left: 0; + background-color: #fff; } + .video-js .vjs-volume-level:before { + position: absolute; + font-size: 0.9em; } + +.vjs-slider-vertical .vjs-volume-level { + width: 0.3em; } + .vjs-slider-vertical .vjs-volume-level:before { + top: -0.5em; + left: -0.3em; } + +.vjs-slider-horizontal .vjs-volume-level { + height: 0.3em; } + .vjs-slider-horizontal .vjs-volume-level:before { + top: -0.3em; + right: -0.5em; } + +.video-js .vjs-volume-panel.vjs-volume-panel-vertical { + width: 4em; } + +.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level { + height: 100%; } + +.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level { + width: 100%; } + +.video-js .vjs-volume-vertical { + width: 3em; + height: 8em; + bottom: 8em; + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.7); } + +.video-js .vjs-volume-horizontal .vjs-menu { + left: -2em; } + +.vjs-poster { + display: inline-block; + vertical-align: middle; + background-repeat: no-repeat; + background-position: 50% 50%; + background-size: contain; + background-color: #000000; + cursor: pointer; + margin: 0; + padding: 0; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + height: 100%; } + +.vjs-has-started .vjs-poster { + display: none; } + +.vjs-audio.vjs-has-started .vjs-poster { + display: block; } + +.vjs-using-native-controls .vjs-poster { + display: none; } + +.video-js .vjs-live-control { + display: flex; + align-items: flex-start; + flex: auto; + font-size: 1em; + line-height: 3em; } + +.vjs-no-flex .vjs-live-control { + display: table-cell; + width: auto; + text-align: left; } + +.video-js:not(.vjs-live) .vjs-live-control, +.video-js.vjs-liveui .vjs-live-control { + display: none; } + +.video-js .vjs-seek-to-live-control { + cursor: pointer; + flex: none; + display: inline-flex; + height: 100%; + padding-left: 0.5em; + padding-right: 0.5em; + font-size: 1em; + line-height: 3em; + width: auto; + min-width: 4em; } + +.vjs-no-flex .vjs-seek-to-live-control { + display: table-cell; + width: auto; + text-align: left; } + +.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control, +.video-js:not(.vjs-live) .vjs-seek-to-live-control { + display: none; } + +.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge { + cursor: auto; } + +.vjs-seek-to-live-control .vjs-icon-placeholder { + margin-right: 0.5em; + color: #888; } + +.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder { + color: red; } + +.video-js .vjs-time-control { + flex: none; + font-size: 1em; + line-height: 3em; + min-width: 2em; + width: auto; + padding-left: 1em; + padding-right: 1em; } + +.vjs-live .vjs-time-control { + display: none; } + +.video-js .vjs-current-time, +.vjs-no-flex .vjs-current-time { + display: none; } + +.video-js .vjs-duration, +.vjs-no-flex .vjs-duration { + display: none; } + +.vjs-time-divider { + display: none; + line-height: 3em; } + +.vjs-live .vjs-time-divider { + display: none; } + +.video-js .vjs-play-control { + cursor: pointer; } + +.video-js .vjs-play-control .vjs-icon-placeholder { + flex: none; } + +.vjs-text-track-display { + position: absolute; + bottom: 3em; + left: 0; + right: 0; + top: 0; + pointer-events: none; } + +.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display { + bottom: 1em; } + +.video-js .vjs-text-track { + font-size: 1.4em; + text-align: center; + margin-bottom: 0.1em; } + +.vjs-subtitles { + color: #fff; } + +.vjs-captions { + color: #fc6; } + +.vjs-tt-cue { + display: block; } + +video::-webkit-media-text-track-display { + -webkit-transform: translateY(-3em); + transform: translateY(-3em); } + +.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display { + -webkit-transform: translateY(-1.5em); + transform: translateY(-1.5em); } + +.video-js .vjs-fullscreen-control { + cursor: pointer; + flex: none; } + +.vjs-playback-rate > .vjs-menu-button, +.vjs-playback-rate .vjs-playback-rate-value { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; } + +.vjs-playback-rate .vjs-playback-rate-value { + pointer-events: none; + font-size: 1.5em; + line-height: 2; + text-align: center; } + +.vjs-playback-rate .vjs-menu { + width: 4em; + left: 0em; } + +.vjs-error .vjs-error-display .vjs-modal-dialog-content { + font-size: 1.4em; + text-align: center; } + +.vjs-error .vjs-error-display:before { + color: #fff; + content: 'X'; + font-family: Arial, Helvetica, sans-serif; + font-size: 4em; + left: 0; + line-height: 1; + margin-top: -0.5em; + position: absolute; + text-shadow: 0.05em 0.05em 0.1em #000; + text-align: center; + top: 50%; + vertical-align: middle; + width: 100%; } + +.vjs-loading-spinner { + display: none; + position: absolute; + top: 50%; + left: 50%; + margin: -25px 0 0 -25px; + opacity: 0.85; + text-align: left; + border: 6px solid rgba(43, 51, 63, 0.7); + box-sizing: border-box; + background-clip: padding-box; + width: 50px; + height: 50px; + border-radius: 25px; + visibility: hidden; } + +.vjs-seeking .vjs-loading-spinner, +.vjs-waiting .vjs-loading-spinner { + display: block; + -webkit-animation: vjs-spinner-show 0s linear 0.3s forwards; + animation: vjs-spinner-show 0s linear 0.3s forwards; } + +.vjs-loading-spinner:before, +.vjs-loading-spinner:after { + content: ""; + position: absolute; + margin: -6px; + box-sizing: inherit; + width: inherit; + height: inherit; + border-radius: inherit; + opacity: 1; + border: inherit; + border-color: transparent; + border-top-color: white; } + +.vjs-seeking .vjs-loading-spinner:before, +.vjs-seeking .vjs-loading-spinner:after, +.vjs-waiting .vjs-loading-spinner:before, +.vjs-waiting .vjs-loading-spinner:after { + -webkit-animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; + animation: vjs-spinner-spin 1.1s cubic-bezier(0.6, 0.2, 0, 0.8) infinite, vjs-spinner-fade 1.1s linear infinite; } + +.vjs-seeking .vjs-loading-spinner:before, +.vjs-waiting .vjs-loading-spinner:before { + border-top-color: white; } + +.vjs-seeking .vjs-loading-spinner:after, +.vjs-waiting .vjs-loading-spinner:after { + border-top-color: white; + -webkit-animation-delay: 0.44s; + animation-delay: 0.44s; } + +@keyframes vjs-spinner-show { + to { + visibility: visible; } } + +@-webkit-keyframes vjs-spinner-show { + to { + visibility: visible; } } + +@keyframes vjs-spinner-spin { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); } } + +@-webkit-keyframes vjs-spinner-spin { + 100% { + -webkit-transform: rotate(360deg); } } + +@keyframes vjs-spinner-fade { + 0% { + border-top-color: #73859f; } + 20% { + border-top-color: #73859f; } + 35% { + border-top-color: white; } + 60% { + border-top-color: #73859f; } + 100% { + border-top-color: #73859f; } } + +@-webkit-keyframes vjs-spinner-fade { + 0% { + border-top-color: #73859f; } + 20% { + border-top-color: #73859f; } + 35% { + border-top-color: white; } + 60% { + border-top-color: #73859f; } + 100% { + border-top-color: #73859f; } } + +.vjs-chapters-button .vjs-menu ul { + width: 24em; } + +.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder { + vertical-align: middle; + display: inline-block; + margin-bottom: -0.1em; } + +.video-js .vjs-subs-caps-button + .vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before { + font-family: VideoJS; + content: "\f10d"; + font-size: 1.5em; + line-height: inherit; } + +.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder { + vertical-align: middle; + display: inline-block; + margin-bottom: -0.1em; } + +.video-js .vjs-audio-button + .vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before { + font-family: VideoJS; + content: " \f11d"; + font-size: 1.5em; + line-height: inherit; } + +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer { + flex: auto; + display: block; } + +.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer { + width: auto; } + +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-panel, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button, +.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button { + display: none; } + +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-panel, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button, +.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subs-caps-button, .video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button { + display: none; } + +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-panel, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button, +.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button, .video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-audio-button { + display: none; } + +.vjs-modal-dialog.vjs-text-track-settings { + background-color: #2B333F; + background-color: rgba(43, 51, 63, 0.75); + color: #fff; + height: 70%; } + +.vjs-text-track-settings .vjs-modal-dialog-content { + display: table; } + +.vjs-text-track-settings .vjs-track-settings-colors, +.vjs-text-track-settings .vjs-track-settings-font, +.vjs-text-track-settings .vjs-track-settings-controls { + display: table-cell; } + +.vjs-text-track-settings .vjs-track-settings-controls { + text-align: right; + vertical-align: bottom; } + +@supports (display: grid) { + .vjs-text-track-settings .vjs-modal-dialog-content { + display: grid; + grid-template-columns: 1fr 1fr; + grid-template-rows: 1fr; + padding: 20px 24px 0px 24px; } + .vjs-track-settings-controls .vjs-default-button { + margin-bottom: 20px; } + .vjs-text-track-settings .vjs-track-settings-controls { + grid-column: 1 / -1; } + .vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content, + .vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content, + .vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content { + grid-template-columns: 1fr; } } + +.vjs-track-setting > select { + margin-right: 1em; + margin-bottom: 0.5em; } + +.vjs-text-track-settings fieldset { + margin: 5px; + padding: 3px; + border: none; } + +.vjs-text-track-settings fieldset span { + display: inline-block; } + +.vjs-text-track-settings fieldset span > select { + max-width: 7.3em; } + +.vjs-text-track-settings legend { + color: #fff; + margin: 0 0 5px 0; } + +.vjs-text-track-settings .vjs-label { + position: absolute; + clip: rect(1px 1px 1px 1px); + clip: rect(1px, 1px, 1px, 1px); + display: block; + margin: 0 0 5px 0; + padding: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; } + +.vjs-track-settings-controls button:focus, +.vjs-track-settings-controls button:active { + outline-style: solid; + outline-width: medium; + background-image: linear-gradient(0deg, #fff 88%, #73859f 100%); } + +.vjs-track-settings-controls button:hover { + color: rgba(43, 51, 63, 0.75); } + +.vjs-track-settings-controls button { + background-color: #fff; + background-image: linear-gradient(-180deg, #fff 88%, #73859f 100%); + color: #2B333F; + cursor: pointer; + border-radius: 2px; } + +.vjs-track-settings-controls .vjs-default-button { + margin-right: 1em; } + +@media print { + .video-js > *:not(.vjs-tech):not(.vjs-poster) { + visibility: hidden; } } + +.vjs-resize-manager { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: none; + z-index: -1000; } + +.js-focus-visible .video-js *:focus:not(.focus-visible) { + outline: none; + background: none; } + +.video-js *:focus:not(:focus-visible), +.video-js .vjs-menu *:focus:not(:focus-visible) { + outline: none; + background: none; } diff --git a/Resources/public/js/vendor/video-js/video-js.min.css b/Resources/public/js/vendor/video-js/video-js.min.css new file mode 100644 index 00000000..4bb8fd87 --- /dev/null +++ b/Resources/public/js/vendor/video-js/video-js.min.css @@ -0,0 +1 @@ +.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.vjs-modal-dialog .vjs-modal-dialog-content{position:absolute;top:0;left:0;width:100%;height:100%}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.vjs-button>.vjs-icon-placeholder:before{text-align:center}@font-face{font-family:VideoJS;src:url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABBIAAsAAAAAGoQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV3RY21hcAAAAYQAAADQAAADIjn098ZnbHlmAAACVAAACv4AABEIAwnSw2hlYWQAAA1UAAAAKwAAADYV1OgpaGhlYQAADYAAAAAbAAAAJA4DByFobXR4AAANnAAAAA8AAACE4AAAAGxvY2EAAA2sAAAARAAAAEQ9NEHGbWF4cAAADfAAAAAfAAAAIAEyAIFuYW1lAAAOEAAAASUAAAIK1cf1oHBvc3QAAA84AAABDwAAAZ5AAl/0eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGQ7xTiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGBHcRdyA4RZgQRAC4HCwEAAHic7dFprsIgAEXhg8U61XmeWcBb1FuQP4w7ZQXK5boMm3yclFDSANAHmuKviBBeBPQ8ymyo8w3jOh/5r2ui5nN6v8sYNJb3WMdeWRvLji0DhozKdxM6psyYs2DJijUbtuzYc+DIiTMXrty4k8oGLb+n0xCe37ekM7Z66j1DbUy3l6PpHnLfdLO5NdSBoQ4NdWSoY9ON54mhdqa/y1NDnRnq3FAXhro01JWhrg11Y6hbQ90Z6t5QD4Z6NNSToZ4N9WKoV0O9GerdUJORPqkhTd54nJ1YDXBU1RV+576/JBs2bPYPkrDZt5vsJrv53V/I5mclhGDCTwgGBQQSTEji4hCkYIAGd4TGIWFAhV0RQTpWmQp1xv6hA4OTOlNr2zFANbHUYbq2OtNCpViRqsk+e+7bTQAhzti8vPfuPffcc88959zznbcMMPjHD/KDDGEY0ABpYX384NhlomIYlo4JISGEY9mMh2FSidYiqkEUphtNYDSY/dXg9023l4DdxlqUl0chuZRhncJKrsCQHIwcGuwfnhMIzBnuH4Sym+1D2zaGjheXlhYfD238z80mKYMmvJ5XeOTzd8z9eujbMxJNhu4C9xPE/bCMiDuSNIWgkTQwBE55hLSAE7ZwhrHLnAHZOGV/kmBGTiNjZxzI77Hb7Hqjz68TjT6vh+5JT/cCIkqS0D6CqPf5jX4Qjdx5j6vlDfZM4aZFdbVXIxtOlJaP/WottMnH6CJQ3bTiue3PrY23HjnChtuamxwvvzFjxkPrNj3z0tG9T561HDYf6OgmRWvlY3JQHoQb8ltV2Yet7YfWctEjR1AtxS/cSX6U4alf6NJEBQ7YKg9wrXQKd0IeZCb2ux75Uhh1Un+Nz+9LTOE7PK777nN5xqdTneTBhCbx446mZrhnUkrCz2YhA9dSMxaG0SYmT8hi9ZPu1E94PJYQSH6LRmhxec7Q7ZeXntgQuVpbh+a4qWNsckVyTdn0P7o7DpgPW84+uRcq0BITflBikGdUjAZ9wYBVI3mtrNvr9kpg1UsaK6t3690aoorC1lg0GpMH2HAMtkZjsSi5Ig9ESVosOh7GQfLjKNLvKpMKkLSKNFAka710GdgSi8oDMSoNhqjkKBXTgn3swtaxyzGkUzIzae9RtLdWkSlZ1KDX6EzgllzV4NV4SoDFSOGD4+HCeQUF8wrZ5Hs8zIb5EaVxy8DYFTbMCJPnLIWZxugZE2NlivC0gc1qEQUR8jEKgZcAXeH18BiCgl5nlHh0CrjB4Hb5fX4gb0J7c9PuHVsfgkx2n/vTY/JV8kn8PGxf7faOZ8qX8JVByuIf4whk9sqXli2hvPJV9hrp0hY7l8r2x37ydaVsb4xvXv/47v2NjfCl8m5oRDJclFMoE1yk0Uh1Te4/m8lFXe9qBZD0EkheicebXvzI2PLCuoKCukLuhPIeKwaHPEouxw3kMqaIUXDQ1p0mip+MyCORSCQaoUsnY1VZ38nUTrG21WvVo4f1OsEJFhvSfAFwGfT8VHRMeAVUpwLOoLzjT/REIj3O3FhuURE+nERF+0pTId5Fyxv5sfwGyg4O+my4vZv0sZm7oeQlFZORiB+tG0MweVNraeitl7yxiPIHTk4/diVxs94o5lEYishB2iAtkchEnsActoEpx44Fo8XnsQMaA22BlqC20RmhBKzYojZyYaxg+JggMc4HHY2m+L9EkWSYljirOisrO7d3VorxzyZ6Vc4lJqITAu1b2wOBdrLElAP+bFc2eGaZFVbkmJktv5uT6Jlz5D/MnBFor6ig/JPnRViBsV3LNKGGqB1ChJ0tgQywlVLFJIuQgTFttwkiKxhyQdAZMdMYtSaoAewqfvXVYPAbDT6/1mez85YS8FSDywQ6NfAnef6FNEGMilnppyvn5rB6tTyq1pOceRWnp2WJEZFXHeX5oyoem1nTTgdqc4heDY7bOeKz63vnz+/dRx+s31Ht2JGanQ5seirfWJL9tjozU/12TnEjn5oux9OzU3ckGbBzBwNOyk69JykKH0n/0LM9A72tuwM3zQpIRu4AxiToseEpgPOmbROyFe9/X2yeUvoUsCyEvjcgs7fpWP3/aKlFN0+6HFUe6D9HFz/XPwBlN9tTqNyZjFJ8UO2RUT5/h4CptCctEyeisnOyXjALEp7dXKaQKf6O7IMnGjNNACRMLxqdYJX8eMLvmmd68D+ayBLyKKYZwYxDt/GNhzETDJ05Qxlyi3pi3/Z93ndYVSumgj0V/KkIFlO6+1K3fF2+3g0q+YtuSIf0bvmLqV09nnobI6hwcjIP8aPCKayjsF5JBY3LaKAeRLSyYB1h81oTwe9SlPMkXB7G0mfL9q71gaqqwPqu67QRKS1+ObTx+sbQy9QV2OQHEScGkdFBeT7v7qisqqrs6N52i78/R+6S0qQONVj26agOVoswCyQWIV5D86vH53bxNUeXV0K+XZaHv/nm/KsHhOvylwsWnJX/HE8l/4WCv5x+l5n08z6UU8bUMa3MBpSmM7F63AxntdC9eBCKEZW9Hr+ABNqtxgAQrSbMtmrW7lKQuoSgBhSrTazWVU2QAKWY8wiiuhqFmQgWJBgoXiuWIm42N7hqZbBsgXz52O5P5uSvaNgFGnOuvsRw8I8Laha91wMvDuxqWFheN7/8GVtTltdS83DQsXRmqc5ZtcJXEVrlV2doTWk5+Yunm71dG5f55m/qY0MjI93vv9/NfpxXV9sUXrxy2fbNy1or65cOlDRnOoKFeeXcbw42H/bNDT5Qs3flgs31gWC1lD1nfUV/X7NdCnSUdHY2e8afzfKsqZ5ZljfDqjLOmk3UebNXB+aHArPYDRs+/HDDxeT5DiP+sFg7OpRaVQMGBV89PpeBdj22hCE0Uub0UqwLrNWsG0cuyadgLXTeR5rbO4+3c/vl15cur2nRq+TXCQDcS3SO+s6ak+e5/eMS+1dw3btu3YG2tvFL8XdIZvdjdW6TO/4B7IdrZWVPmctm5/59AgsPItTSbCiIBr2OqIGzmu20SMKAS7yqwGBUfGfgjDYlLLDeF0SfcLB2LSx8flT+08/kzz6yOj96rft4rpTjdPQcmLd47uKibbDq7ZSz/XtbH2nN717Nd62rU+c8Icevvv7I09wA6WvjVcafb+FsbNG+ZQ80Rn6ZZsvrP7teP2dzTdoETvNhjCmsr8FID2sJ69VYvdUcxk4AzYRlKcaE38eXNRlfW9H1as9i6acLHp1XpuNB5K7DIvkX08y1ZYvh3KfWaiCzH+ztrSDmD7LuX73x/mJelB8Yj39t8nhNQJJ2CAthpoFGLsGgtSOCJooCGoaJAMTjSWHVZ08YAa1Fg9lPI5U6DOsGVjDasJeZZ+YyhfCwfOzCxlBA69M9XLXtza7H/rav+9Tjq5xNi0wpKQIRNO4Lrzz7yp5QVYM6Jd/oc1Uvn/mQhhuWh6ENXoS2YTZ8QT42bF5d/559zp5r0Uff2VnR2tdf2/WCOd2cO0Mw6qpWPnvxpV0nrt5fZd2yItc199GWe8vlNfNDq+CH/7yAAnB9hn7T4QO4c1g9ScxsZgmzntnE/IDGndtHMw69lFwoCnYsMGx+rBp8JSBqdLzBr9QRPq/PbhWMWFtQZp1xguy/haw3TEHm3TWAnxFWQQWgt7M5OV0lCz1VRYucpWliy7z6Zd4urwPIyeZQqli2Lgg7szJV09PysATbOQtYIrB2YzbkJYkGgJ0m4AjPUap1pvYu1K9qr97z0Yl3p332b2LYB78ncYIlRkau/8GObSsOlZancACE5d5ily+c2+7h5Yj4lqhVmXXB+iXLfvdqSgqfKtQvfHDV0OnvQR1qhw42XS/vkvsh/hXcrDFP0a+SJNIomEfD1nsrYGO+1bgTOJhM8Hv6ek+7vVglxuSRwoKn17S937bm6YJCeSSG0Op1n+7tE37tcZ/p7dsTv4EUrGpDbWueKigsLHhqTVsoEj+JU0kaSjnj9tz8/gryQWwJ9BcJXBC/7smO+I/IFURJetFPrdt5WcoL6DbEJaygI8CTHfQTjf40ofD+DwalTqIAAHicY2BkYGAA4gDud4bx/DZfGbjZGUDg+q1z05BpdkawOAcDE4gCAB45CXEAeJxjYGRgYGcAARD5/z87IwMjAypQBAAtgwI4AHicY2BgYGAfYAwAOkQA4QAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAcICGAJYArQC4AMwA7AD3gQwBJYE3AUkBWYFigYgBmYGtAbqB1gIEghYCG4IhHicY2BkYGBQZChlYGcAASYg5gJCBob/YD4DABfTAbQAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2PyXLCMBBE3YCNDWEL2ffk7o8S8oCnkCVHC5C/jzBQlUP6IHVPzYyekl5y0iL5X5/ooY8BUmQYIkeBEca4wgRTzDDHAtdY4ga3uMM9HvCIJzzjBa94wzs+8ImvZNAq8TM+HqVkKxWlrQiOxjujQkNlEzyNzl6Z/cU2XF06at7U83VQyklLpEvSnuzsb+HAPnPfQVgaupa1Jlu4sPLsFblcitaz0dHU0ZF1qatjZ1+aTXYCmp6u0gSvWNPyHLtFZ+ZeXWVSaEkqs3T8S74WklbGbNNNq4LL4+CWKtZDv2cfX8l8aFbKFhEnJnJ+IULFpqwoQnNHlHaVQtPBl+ypmbSWdmyC61KS/AKZC3Y+AA==) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\f109"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\f10a"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\f10b"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\f10c"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\f10e"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\f10f"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\f110"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\f111"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\f112"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\f113"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\f114"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\f115"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\f116"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\f117"}.vjs-icon-gplus{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-gplus:before{content:"\f118"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\f119"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\f11a"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\f11b"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\f11c"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\f11d"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\f11e"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\f11f"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\f120"}.video-js{display:block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-fluid{width:100%;max-width:100%;height:0}.video-js.vjs-16-9{padding-top:56.25%}.video-js.vjs-4-3{padding-top:75%}.video-js.vjs-fill{width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}body.vjs-full-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen{width:100%!important;height:100%!important;padding-top:0!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.5em;width:3em;display:block;position:absolute;top:10px;left:10px;padding:0;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-centered .vjs-big-play-button{top:50%;left:50%;margin-top:-.75em;margin-left:-1.5em}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .vjs-big-play-button{display:block}.video-js button{background:0 0;border:none;color:inherit;display:inline-block;font-size:inherit;line-height:inherit;text-transform:none;text-decoration:none;transition:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup:hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover,.video-js.vjs-no-flex .vjs-menu-button-inline{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-no-flex .vjs-menu-button-inline .vjs-menu{display:block;opacity:1;position:relative;width:auto}.vjs-no-flex .vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:focus .vjs-menu,.vjs-no-flex .vjs-menu-button-inline:hover .vjs-menu{width:auto}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible}.vjs-has-started.vjs-no-flex .vjs-control-bar{display:table}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-no-flex .vjs-control{display:table-cell;vertical-align:middle}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.vjs-no-flex .vjs-progress-control{width:auto}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.666666666666666666em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;top:-.333333333333333em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.vjs-no-flex .vjs-progress-control .vjs-mouse-display{z-index:0}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.video-js.vjs-user-inactive.vjs-no-flex .vjs-progress-control .vjs-mouse-display{display:none}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel .vjs-mute-control:hover~.vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active,.video-js .vjs-volume-panel .vjs-volume-control:active,.video-js .vjs-volume-panel .vjs-volume-control:hover,.video-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel:hover .vjs-volume-control{visibility:visible;opacity:1;position:relative;transition:visibility .1s,opacity .1s,height .1s,width .1s,left 0s,top 0s}.video-js .vjs-volume-panel .vjs-mute-control:hover~.vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em}.video-js .vjs-volume-panel .vjs-mute-control:hover~.vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:hover.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-vertical{left:-3.5em}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover{width:9em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only{width:4em}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{height:8em;width:3em;left:-3000em;transition:visibility 1s,opacity 1s,height 1s 1s,width 1s 1s,left 1s 1s,top 1s 1s}.video-js .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{transition:visibility 1s,opacity 1s,height 1s 1s,width 1s,left 1s 1s,top 1s 1s}.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-horizontal{width:5em;height:3em;visibility:visible;opacity:1;position:relative;transition:none}.video-js.vjs-no-flex .vjs-volume-control.vjs-volume-vertical,.video-js.vjs-no-flex .vjs-volume-panel .vjs-volume-control.vjs-volume-vertical{position:absolute;bottom:3em;left:.5em}.video-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar{margin:1.35em .45em}.vjs-volume-bar.vjs-slider-horizontal{width:5em;height:.3em}.vjs-volume-bar.vjs-slider-vertical{width:.3em;height:5em;margin:1.35em auto}.video-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before{position:absolute;font-size:.9em}.vjs-slider-vertical .vjs-volume-level{width:.3em}.vjs-slider-vertical .vjs-volume-level:before{top:-.5em;left:-.3em}.vjs-slider-horizontal .vjs-volume-level{height:.3em}.vjs-slider-horizontal .vjs-volume-level:before{top:-.3em;right:-.5em}.video-js .vjs-volume-panel.vjs-volume-panel-vertical{width:4em}.vjs-volume-bar.vjs-slider-vertical .vjs-volume-level{height:100%}.vjs-volume-bar.vjs-slider-horizontal .vjs-volume-level{width:100%}.video-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.video-js .vjs-volume-horizontal .vjs-menu{left:-2em}.vjs-poster{display:inline-block;vertical-align:middle;background-repeat:no-repeat;background-position:50% 50%;background-size:contain;background-color:#000;cursor:pointer;margin:0;padding:0;position:absolute;top:0;right:0;bottom:0;left:0;height:100%}.vjs-has-started .vjs-poster{display:none}.vjs-audio.vjs-has-started .vjs-poster{display:block}.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.vjs-no-flex .vjs-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.vjs-no-flex .vjs-seek-to-live-control{display:table-cell;width:auto;text-align:left}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control{display:none}.video-js .vjs-current-time,.vjs-no-flex .vjs-current-time{display:none}.video-js .vjs-duration,.vjs-no-flex .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.vjs-live .vjs-time-divider{display:none}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{-webkit-transform:translateY(-3em);transform:translateY(-3em)}.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{-webkit-transform:translateY(-1.5em);transform:translateY(-1.5em)}.video-js .vjs-fullscreen-control{cursor:pointer;flex:none}.vjs-playback-rate .vjs-playback-rate-value,.vjs-playback-rate>.vjs-menu-button{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-error .vjs-error-display:before{color:#fff;content:'X';font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;margin:-25px 0 0 -25px;opacity:.85;text-align:left;border:6px solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:50px;height:50px;border-radius:25px;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:block;-webkit-animation:vjs-spinner-show 0s linear .3s forwards;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-loading-spinner:after,.vjs-loading-spinner:before{content:"";position:absolute;margin:-6px;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@-webkit-keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes vjs-spinner-spin{100%{-webkit-transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}@-webkit-keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\f10d";font-size:1.5em;line-height:inherit}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" \f11d";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-custom-control-spacer{flex:auto;display:block}.video-js.vjs-layout-tiny:not(.vjs-fullscreen).vjs-no-flex .vjs-custom-control-spacer{width:auto}.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-audio-button,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-captions-button,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-chapters-button,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-current-time,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-descriptions-button,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-duration,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-mute-control,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-playback-rate,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-progress-control,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-remaining-time,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subs-caps-button,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-subtitles-button,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-time-divider,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-control,.video-js.vjs-layout-tiny:not(.vjs-fullscreen) .vjs-volume-panel{display:none}.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-audio-button,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-captions-button,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-chapters-button,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-current-time,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-descriptions-button,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-duration,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-mute-control,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-playback-rate,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-remaining-time,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subs-caps-button,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-subtitles-button,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-time-divider,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-control,.video-js.vjs-layout-x-small:not(.vjs-fullscreen) .vjs-volume-panel{display:none}.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-audio-button,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-captions-button,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-chapters-button,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-current-time,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-descriptions-button,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-duration,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-mute-control,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-playback-rate,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-remaining-time,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-subtitles-button,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-time-divider,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-control,.video-js.vjs-layout-small:not(.vjs-fullscreen) .vjs-volume-panel{display:none}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:rgba(43,51,63,.75);color:#fff;height:70%}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:5px;padding:3px;border:none}.vjs-text-track-settings fieldset span{display:inline-block}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;margin:0 0 5px 0}.vjs-text-track-settings .vjs-label{position:absolute;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);display:block;margin:0 0 5px 0;padding:0;border:0;height:1px;width:1px;overflow:hidden}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}@media print{.video-js>:not(.vjs-tech):not(.vjs-poster){visibility:hidden}}.vjs-resize-manager{position:absolute;top:0;left:0;width:100%;height:100%;border:none;z-index:-1000}.js-focus-visible .video-js :focus:not(.focus-visible){outline:0;background:0 0}.video-js .vjs-menu :focus:not(:focus-visible),.video-js :focus:not(:focus-visible){outline:0;background:0 0} \ No newline at end of file diff --git a/Resources/public/js/vendor/video-js/video.cjs.js b/Resources/public/js/vendor/video-js/video.cjs.js new file mode 100644 index 00000000..b1dcd24e --- /dev/null +++ b/Resources/public/js/vendor/video-js/video.cjs.js @@ -0,0 +1,44036 @@ +/** + * @license + * Video.js 7.4.2 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */ + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var window$1 = _interopDefault(require('global/window')); +var document = _interopDefault(require('global/document')); +var tsml = _interopDefault(require('tsml')); +var safeParseTuple = _interopDefault(require('safe-json-parse/tuple')); +var xhr = _interopDefault(require('xhr')); +var vtt = _interopDefault(require('videojs-vtt.js')); +var URLToolkit = _interopDefault(require('url-toolkit')); +var m3u8Parser = require('m3u8-parser'); +var mpdParser = require('mpd-parser'); +var mp4probe = _interopDefault(require('mux.js/lib/mp4/probe')); +var mp4 = require('mux.js/lib/mp4'); +var tsInspector = _interopDefault(require('mux.js/lib/tools/ts-inspector.js')); +var aesDecrypter = require('aes-decrypter'); + +var version = "7.4.2"; + +function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; +} + +function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); +} + +function isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } +} + +function _construct(Parent, args, Class) { + if (isNativeReflectConstruct()) { + _construct = Reflect.construct; + } else { + _construct = function _construct(Parent, args, Class) { + var a = [null]; + a.push.apply(a, args); + var Constructor = Function.bind.apply(Parent, a); + var instance = new Constructor(); + if (Class) _setPrototypeOf(instance, Class.prototype); + return instance; + }; + } + + return _construct.apply(null, arguments); +} + +function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; +} + +function _taggedTemplateLiteralLoose(strings, raw) { + if (!raw) { + raw = strings.slice(0); + } + + strings.raw = raw; + return strings; +} + +/** + * @file create-logger.js + * @module create-logger + */ + +var history = []; +/** + * Log messages to the console and history based on the type of message + * + * @private + * @param {string} type + * The name of the console method to use. + * + * @param {Array} args + * The arguments to be passed to the matching console method. + */ + +var LogByTypeFactory = function LogByTypeFactory(name, log) { + return function (type, level, args) { + var lvl = log.levels[level]; + var lvlRegExp = new RegExp("^(" + lvl + ")$"); + + if (type !== 'log') { + // Add the type to the front of the message when it's not "log". + args.unshift(type.toUpperCase() + ':'); + } // Add console prefix after adding to history. + + + args.unshift(name + ':'); // Add a clone of the args at this point to history. + + if (history) { + history.push([].concat(args)); + } // If there's no console then don't try to output messages, but they will + // still be stored in history. + + + if (!window$1.console) { + return; + } // Was setting these once outside of this function, but containing them + // in the function makes it easier to test cases where console doesn't exist + // when the module is executed. + + + var fn = window$1.console[type]; + + if (!fn && type === 'debug') { + // Certain browsers don't have support for console.debug. For those, we + // should default to the closest comparable log. + fn = window$1.console.info || window$1.console.log; + } // Bail out if there's no console or if this type is not allowed by the + // current logging level. + + + if (!fn || !lvl || !lvlRegExp.test(type)) { + return; + } + + fn[Array.isArray(args) ? 'apply' : 'call'](window$1.console, args); + }; +}; + +function createLogger(name) { + // This is the private tracking variable for logging level. + var level = 'info'; // the curried logByType bound to the specific log and history + + var logByType; + /** + * Logs plain debug messages. Similar to `console.log`. + * + * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149) + * of our JSDoc template, we cannot properly document this as both a function + * and a namespace, so its function signature is documented here. + * + * #### Arguments + * ##### *args + * Mixed[] + * + * Any combination of values that could be passed to `console.log()`. + * + * #### Return Value + * + * `undefined` + * + * @namespace + * @param {Mixed[]} args + * One or more messages or objects that should be logged. + */ + + var log = function log() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + logByType('log', level, args); + }; // This is the logByType helper that the logging methods below use + + + logByType = LogByTypeFactory(name, log); + /** + * Create a new sublogger which chains the old name to the new name. + * + * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following: + * ```js + * mylogger('foo'); + * // > VIDEOJS: player: foo + * ``` + * + * @param {string} name + * The name to add call the new logger + * @return {Object} + */ + + log.createLogger = function (subname) { + return createLogger(name + ': ' + subname); + }; + /** + * Enumeration of available logging levels, where the keys are the level names + * and the values are `|`-separated strings containing logging methods allowed + * in that logging level. These strings are used to create a regular expression + * matching the function name being called. + * + * Levels provided by Video.js are: + * + * - `off`: Matches no calls. Any value that can be cast to `false` will have + * this effect. The most restrictive. + * - `all`: Matches only Video.js-provided functions (`debug`, `log`, + * `log.warn`, and `log.error`). + * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls. + * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls. + * - `warn`: Matches `log.warn` and `log.error` calls. + * - `error`: Matches only `log.error` calls. + * + * @type {Object} + */ + + + log.levels = { + all: 'debug|log|warn|error', + off: '', + debug: 'debug|log|warn|error', + info: 'log|warn|error', + warn: 'warn|error', + error: 'error', + DEFAULT: level + }; + /** + * Get or set the current logging level. + * + * If a string matching a key from {@link module:log.levels} is provided, acts + * as a setter. + * + * @param {string} [lvl] + * Pass a valid level to set a new logging level. + * + * @return {string} + * The current logging level. + */ + + log.level = function (lvl) { + if (typeof lvl === 'string') { + if (!log.levels.hasOwnProperty(lvl)) { + throw new Error("\"" + lvl + "\" in not a valid log level"); + } + + level = lvl; + } + + return level; + }; + /** + * Returns an array containing everything that has been logged to the history. + * + * This array is a shallow clone of the internal history record. However, its + * contents are _not_ cloned; so, mutating objects inside this array will + * mutate them in history. + * + * @return {Array} + */ + + + log.history = function () { + return history ? [].concat(history) : []; + }; + /** + * Allows you to filter the history by the given logger name + * + * @param {string} fname + * The name to filter by + * + * @return {Array} + * The filtered list to return + */ + + + log.history.filter = function (fname) { + return (history || []).filter(function (historyItem) { + // if the first item in each historyItem includes `fname`, then it's a match + return new RegExp(".*" + fname + ".*").test(historyItem[0]); + }); + }; + /** + * Clears the internal history tracking, but does not prevent further history + * tracking. + */ + + + log.history.clear = function () { + if (history) { + history.length = 0; + } + }; + /** + * Disable history tracking if it is currently enabled. + */ + + + log.history.disable = function () { + if (history !== null) { + history.length = 0; + history = null; + } + }; + /** + * Enable history tracking if it is currently disabled. + */ + + + log.history.enable = function () { + if (history === null) { + history = []; + } + }; + /** + * Logs error messages. Similar to `console.error`. + * + * @param {Mixed[]} args + * One or more messages or objects that should be logged as an error + */ + + + log.error = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return logByType('error', level, args); + }; + /** + * Logs warning messages. Similar to `console.warn`. + * + * @param {Mixed[]} args + * One or more messages or objects that should be logged as a warning. + */ + + + log.warn = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return logByType('warn', level, args); + }; + /** + * Logs debug messages. Similar to `console.debug`, but may also act as a comparable + * log if `console.debug` is not available + * + * @param {Mixed[]} args + * One or more messages or objects that should be logged as debug. + */ + + + log.debug = function () { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + return logByType('debug', level, args); + }; + + return log; +} + +/** + * @file log.js + * @module log + */ +var log = createLogger('VIDEOJS'); +var createLogger$1 = log.createLogger; + +/** + * @file obj.js + * @module obj + */ + +/** + * @callback obj:EachCallback + * + * @param {Mixed} value + * The current key for the object that is being iterated over. + * + * @param {string} key + * The current key-value for object that is being iterated over + */ + +/** + * @callback obj:ReduceCallback + * + * @param {Mixed} accum + * The value that is accumulating over the reduce loop. + * + * @param {Mixed} value + * The current key for the object that is being iterated over. + * + * @param {string} key + * The current key-value for object that is being iterated over + * + * @return {Mixed} + * The new accumulated value. + */ +var toString = Object.prototype.toString; +/** + * Get the keys of an Object + * + * @param {Object} + * The Object to get the keys from + * + * @return {string[]} + * An array of the keys from the object. Returns an empty array if the + * object passed in was invalid or had no keys. + * + * @private + */ + +var keys = function keys(object) { + return isObject(object) ? Object.keys(object) : []; +}; +/** + * Array-like iteration for objects. + * + * @param {Object} object + * The object to iterate over + * + * @param {obj:EachCallback} fn + * The callback function which is called for each key in the object. + */ + + +function each(object, fn) { + keys(object).forEach(function (key) { + return fn(object[key], key); + }); +} +/** + * Array-like reduce for objects. + * + * @param {Object} object + * The Object that you want to reduce. + * + * @param {Function} fn + * A callback function which is called for each key in the object. It + * receives the accumulated value and the per-iteration value and key + * as arguments. + * + * @param {Mixed} [initial = 0] + * Starting value + * + * @return {Mixed} + * The final accumulated value. + */ + +function reduce(object, fn, initial) { + if (initial === void 0) { + initial = 0; + } + + return keys(object).reduce(function (accum, key) { + return fn(accum, object[key], key); + }, initial); +} +/** + * Object.assign-style object shallow merge/extend. + * + * @param {Object} target + * @param {Object} ...sources + * @return {Object} + */ + +function assign(target) { + for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + sources[_key - 1] = arguments[_key]; + } + + if (Object.assign) { + return Object.assign.apply(Object, [target].concat(sources)); + } + + sources.forEach(function (source) { + if (!source) { + return; + } + + each(source, function (value, key) { + target[key] = value; + }); + }); + return target; +} +/** + * Returns whether a value is an object of any kind - including DOM nodes, + * arrays, regular expressions, etc. Not functions, though. + * + * This avoids the gotcha where using `typeof` on a `null` value + * results in `'object'`. + * + * @param {Object} value + * @return {boolean} + */ + +function isObject(value) { + return !!value && typeof value === 'object'; +} +/** + * Returns whether an object appears to be a "plain" object - that is, a + * direct instance of `Object`. + * + * @param {Object} value + * @return {boolean} + */ + +function isPlain(value) { + return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object; +} + +/** + * @file computed-style.js + * @module computed-style + */ +/** + * A safe getComputedStyle. + * + * This is needed because in Firefox, if the player is loaded in an iframe with + * `display:none`, then `getComputedStyle` returns `null`, so, we do a + * null-check to make sure that the player doesn't break in these cases. + * + * @function + * @param {Element} el + * The element you want the computed style of + * + * @param {string} prop + * The property name you want + * + * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397 + */ + +function computedStyle(el, prop) { + if (!el || !prop) { + return ''; + } + + if (typeof window$1.getComputedStyle === 'function') { + var cs = window$1.getComputedStyle(el); + return cs ? cs[prop] : ''; + } + + return ''; +} + +function _templateObject() { + var data = _taggedTemplateLiteralLoose(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set ", " to ", "."]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} +/** + * Detect if a value is a string with any non-whitespace characters. + * + * @private + * @param {string} str + * The string to check + * + * @return {boolean} + * Will be `true` if the string is non-blank, `false` otherwise. + * + */ + +function isNonBlankString(str) { + return typeof str === 'string' && /\S/.test(str); +} +/** + * Throws an error if the passed string has whitespace. This is used by + * class methods to be relatively consistent with the classList API. + * + * @private + * @param {string} str + * The string to check for whitespace. + * + * @throws {Error} + * Throws an error if there is whitespace in the string. + */ + + +function throwIfWhitespace(str) { + if (/\s/.test(str)) { + throw new Error('class has illegal whitespace characters'); + } +} +/** + * Produce a regular expression for matching a className within an elements className. + * + * @private + * @param {string} className + * The className to generate the RegExp for. + * + * @return {RegExp} + * The RegExp that will check for a specific `className` in an elements + * className. + */ + + +function classRegExp(className) { + return new RegExp('(^|\\s)' + className + '($|\\s)'); +} +/** + * Whether the current DOM interface appears to be real (i.e. not simulated). + * + * @return {boolean} + * Will be `true` if the DOM appears to be real, `false` otherwise. + */ + + +function isReal() { + // Both document and window will never be undefined thanks to `global`. + return document === window$1.document; +} +/** + * Determines, via duck typing, whether or not a value is a DOM element. + * + * @param {Mixed} value + * The value to check. + * + * @return {boolean} + * Will be `true` if the value is a DOM element, `false` otherwise. + */ + +function isEl(value) { + return isObject(value) && value.nodeType === 1; +} +/** + * Determines if the current DOM is embedded in an iframe. + * + * @return {boolean} + * Will be `true` if the DOM is embedded in an iframe, `false` + * otherwise. + */ + +function isInFrame() { + // We need a try/catch here because Safari will throw errors when attempting + // to get either `parent` or `self` + try { + return window$1.parent !== window$1.self; + } catch (x) { + return true; + } +} +/** + * Creates functions to query the DOM using a given method. + * + * @private + * @param {string} method + * The method to create the query with. + * + * @return {Function} + * The query method + */ + +function createQuerier(method) { + return function (selector, context) { + if (!isNonBlankString(selector)) { + return document[method](null); + } + + if (isNonBlankString(context)) { + context = document.querySelector(context); + } + + var ctx = isEl(context) ? context : document; + return ctx[method] && ctx[method](selector); + }; +} +/** + * Creates an element and applies properties, attributes, and inserts content. + * + * @param {string} [tagName='div'] + * Name of tag to be created. + * + * @param {Object} [properties={}] + * Element properties to be applied. + * + * @param {Object} [attributes={}] + * Element attributes to be applied. + * + * @param {module:dom~ContentDescriptor} content + * A content descriptor object. + * + * @return {Element} + * The element that was created. + */ + + +function createEl(tagName, properties, attributes, content) { + if (tagName === void 0) { + tagName = 'div'; + } + + if (properties === void 0) { + properties = {}; + } + + if (attributes === void 0) { + attributes = {}; + } + + var el = document.createElement(tagName); + Object.getOwnPropertyNames(properties).forEach(function (propName) { + var val = properties[propName]; // See #2176 + // We originally were accepting both properties and attributes in the + // same object, but that doesn't work so well. + + if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') { + log.warn(tsml(_templateObject(), propName, val)); + el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a + // method for it. + } else if (propName === 'textContent') { + textContent(el, val); + } else { + el[propName] = val; + } + }); + Object.getOwnPropertyNames(attributes).forEach(function (attrName) { + el.setAttribute(attrName, attributes[attrName]); + }); + + if (content) { + appendContent(el, content); + } + + return el; +} +/** + * Injects text into an element, replacing any existing contents entirely. + * + * @param {Element} el + * The element to add text content into + * + * @param {string} text + * The text content to add. + * + * @return {Element} + * The element with added text content. + */ + +function textContent(el, text) { + if (typeof el.textContent === 'undefined') { + el.innerText = text; + } else { + el.textContent = text; + } + + return el; +} +/** + * Insert an element as the first child node of another + * + * @param {Element} child + * Element to insert + * + * @param {Element} parent + * Element to insert child into + */ + +function prependTo(child, parent) { + if (parent.firstChild) { + parent.insertBefore(child, parent.firstChild); + } else { + parent.appendChild(child); + } +} +/** + * Check if an element has a class name. + * + * @param {Element} element + * Element to check + * + * @param {string} classToCheck + * Class name to check for + * + * @return {boolean} + * Will be `true` if the element has a class, `false` otherwise. + * + * @throws {Error} + * Throws an error if `classToCheck` has white space. + */ + +function hasClass(element, classToCheck) { + throwIfWhitespace(classToCheck); + + if (element.classList) { + return element.classList.contains(classToCheck); + } + + return classRegExp(classToCheck).test(element.className); +} +/** + * Add a class name to an element. + * + * @param {Element} element + * Element to add class name to. + * + * @param {string} classToAdd + * Class name to add. + * + * @return {Element} + * The DOM element with the added class name. + */ + +function addClass(element, classToAdd) { + if (element.classList) { + element.classList.add(classToAdd); // Don't need to `throwIfWhitespace` here because `hasElClass` will do it + // in the case of classList not being supported. + } else if (!hasClass(element, classToAdd)) { + element.className = (element.className + ' ' + classToAdd).trim(); + } + + return element; +} +/** + * Remove a class name from an element. + * + * @param {Element} element + * Element to remove a class name from. + * + * @param {string} classToRemove + * Class name to remove + * + * @return {Element} + * The DOM element with class name removed. + */ + +function removeClass(element, classToRemove) { + if (element.classList) { + element.classList.remove(classToRemove); + } else { + throwIfWhitespace(classToRemove); + element.className = element.className.split(/\s+/).filter(function (c) { + return c !== classToRemove; + }).join(' '); + } + + return element; +} +/** + * The callback definition for toggleClass. + * + * @callback module:dom~PredicateCallback + * @param {Element} element + * The DOM element of the Component. + * + * @param {string} classToToggle + * The `className` that wants to be toggled + * + * @return {boolean|undefined} + * If `true` is returned, the `classToToggle` will be added to the + * `element`. If `false`, the `classToToggle` will be removed from + * the `element`. If `undefined`, the callback will be ignored. + */ + +/** + * Adds or removes a class name to/from an element depending on an optional + * condition or the presence/absence of the class name. + * + * @param {Element} element + * The element to toggle a class name on. + * + * @param {string} classToToggle + * The class that should be toggled. + * + * @param {boolean|module:dom~PredicateCallback} [predicate] + * See the return value for {@link module:dom~PredicateCallback} + * + * @return {Element} + * The element with a class that has been toggled. + */ + +function toggleClass(element, classToToggle, predicate) { + // This CANNOT use `classList` internally because IE11 does not support the + // second parameter to the `classList.toggle()` method! Which is fine because + // `classList` will be used by the add/remove functions. + var has = hasClass(element, classToToggle); + + if (typeof predicate === 'function') { + predicate = predicate(element, classToToggle); + } + + if (typeof predicate !== 'boolean') { + predicate = !has; + } // If the necessary class operation matches the current state of the + // element, no action is required. + + + if (predicate === has) { + return; + } + + if (predicate) { + addClass(element, classToToggle); + } else { + removeClass(element, classToToggle); + } + + return element; +} +/** + * Apply attributes to an HTML element. + * + * @param {Element} el + * Element to add attributes to. + * + * @param {Object} [attributes] + * Attributes to be applied. + */ + +function setAttributes(el, attributes) { + Object.getOwnPropertyNames(attributes).forEach(function (attrName) { + var attrValue = attributes[attrName]; + + if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) { + el.removeAttribute(attrName); + } else { + el.setAttribute(attrName, attrValue === true ? '' : attrValue); + } + }); +} +/** + * Get an element's attribute values, as defined on the HTML tag. + * + * Attributes are not the same as properties. They're defined on the tag + * or with setAttribute. + * + * @param {Element} tag + * Element from which to get tag attributes. + * + * @return {Object} + * All attributes of the element. Boolean attributes will be `true` or + * `false`, others will be strings. + */ + +function getAttributes(tag) { + var obj = {}; // known boolean attributes + // we can check for matching boolean properties, but not all browsers + // and not all tags know about these attributes, so, we still want to check them manually + + var knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default,defaultMuted' + ','; + + if (tag && tag.attributes && tag.attributes.length > 0) { + var attrs = tag.attributes; + + for (var i = attrs.length - 1; i >= 0; i--) { + var attrName = attrs[i].name; + var attrVal = attrs[i].value; // check for known booleans + // the matching element property will return a value for typeof + + if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) { + // the value of an included boolean attribute is typically an empty + // string ('') which would equal false if we just check for a false value. + // we also don't want support bad code like autoplay='false' + attrVal = attrVal !== null ? true : false; + } + + obj[attrName] = attrVal; + } + } + + return obj; +} +/** + * Get the value of an element's attribute. + * + * @param {Element} el + * A DOM element. + * + * @param {string} attribute + * Attribute to get the value of. + * + * @return {string} + * The value of the attribute. + */ + +function getAttribute(el, attribute) { + return el.getAttribute(attribute); +} +/** + * Set the value of an element's attribute. + * + * @param {Element} el + * A DOM element. + * + * @param {string} attribute + * Attribute to set. + * + * @param {string} value + * Value to set the attribute to. + */ + +function setAttribute(el, attribute, value) { + el.setAttribute(attribute, value); +} +/** + * Remove an element's attribute. + * + * @param {Element} el + * A DOM element. + * + * @param {string} attribute + * Attribute to remove. + */ + +function removeAttribute(el, attribute) { + el.removeAttribute(attribute); +} +/** + * Attempt to block the ability to select text. + */ + +function blockTextSelection() { + document.body.focus(); + + document.onselectstart = function () { + return false; + }; +} +/** + * Turn off text selection blocking. + */ + +function unblockTextSelection() { + document.onselectstart = function () { + return true; + }; +} +/** + * Identical to the native `getBoundingClientRect` function, but ensures that + * the method is supported at all (it is in all browsers we claim to support) + * and that the element is in the DOM before continuing. + * + * This wrapper function also shims properties which are not provided by some + * older browsers (namely, IE8). + * + * Additionally, some browsers do not support adding properties to a + * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard + * properties (except `x` and `y` which are not widely supported). This helps + * avoid implementations where keys are non-enumerable. + * + * @param {Element} el + * Element whose `ClientRect` we want to calculate. + * + * @return {Object|undefined} + * Always returns a plain object - or `undefined` if it cannot. + */ + +function getBoundingClientRect(el) { + if (el && el.getBoundingClientRect && el.parentNode) { + var rect = el.getBoundingClientRect(); + var result = {}; + ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (k) { + if (rect[k] !== undefined) { + result[k] = rect[k]; + } + }); + + if (!result.height) { + result.height = parseFloat(computedStyle(el, 'height')); + } + + if (!result.width) { + result.width = parseFloat(computedStyle(el, 'width')); + } + + return result; + } +} +/** + * Represents the position of a DOM element on the page. + * + * @typedef {Object} module:dom~Position + * + * @property {number} left + * Pixels to the left. + * + * @property {number} top + * Pixels from the top. + */ + +/** + * Get the position of an element in the DOM. + * + * Uses `getBoundingClientRect` technique from John Resig. + * + * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/ + * + * @param {Element} el + * Element from which to get offset. + * + * @return {module:dom~Position} + * The position of the element that was passed in. + */ + +function findPosition(el) { + var box; + + if (el.getBoundingClientRect && el.parentNode) { + box = el.getBoundingClientRect(); + } + + if (!box) { + return { + left: 0, + top: 0 + }; + } + + var docEl = document.documentElement; + var body = document.body; + var clientLeft = docEl.clientLeft || body.clientLeft || 0; + var scrollLeft = window$1.pageXOffset || body.scrollLeft; + var left = box.left + scrollLeft - clientLeft; + var clientTop = docEl.clientTop || body.clientTop || 0; + var scrollTop = window$1.pageYOffset || body.scrollTop; + var top = box.top + scrollTop - clientTop; // Android sometimes returns slightly off decimal values, so need to round + + return { + left: Math.round(left), + top: Math.round(top) + }; +} +/** + * Represents x and y coordinates for a DOM element or mouse pointer. + * + * @typedef {Object} module:dom~Coordinates + * + * @property {number} x + * x coordinate in pixels + * + * @property {number} y + * y coordinate in pixels + */ + +/** + * Get the pointer position within an element. + * + * The base on the coordinates are the bottom left of the element. + * + * @param {Element} el + * Element on which to get the pointer position on. + * + * @param {EventTarget~Event} event + * Event object. + * + * @return {module:dom~Coordinates} + * A coordinates object corresponding to the mouse position. + * + */ + +function getPointerPosition(el, event) { + var position = {}; + var box = findPosition(el); + var boxW = el.offsetWidth; + var boxH = el.offsetHeight; + var boxY = box.top; + var boxX = box.left; + var pageY = event.pageY; + var pageX = event.pageX; + + if (event.changedTouches) { + pageX = event.changedTouches[0].pageX; + pageY = event.changedTouches[0].pageY; + } + + position.y = Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH)); + position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW)); + return position; +} +/** + * Determines, via duck typing, whether or not a value is a text node. + * + * @param {Mixed} value + * Check if this value is a text node. + * + * @return {boolean} + * Will be `true` if the value is a text node, `false` otherwise. + */ + +function isTextNode(value) { + return isObject(value) && value.nodeType === 3; +} +/** + * Empties the contents of an element. + * + * @param {Element} el + * The element to empty children from + * + * @return {Element} + * The element with no children + */ + +function emptyEl(el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + + return el; +} +/** + * This is a mixed value that describes content to be injected into the DOM + * via some method. It can be of the following types: + * + * Type | Description + * -----------|------------- + * `string` | The value will be normalized into a text node. + * `Element` | The value will be accepted as-is. + * `TextNode` | The value will be accepted as-is. + * `Array` | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored). + * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes. + * + * @typedef {string|Element|TextNode|Array|Function} module:dom~ContentDescriptor + */ + +/** + * Normalizes content for eventual insertion into the DOM. + * + * This allows a wide range of content definition methods, but helps protect + * from falling into the trap of simply writing to `innerHTML`, which could + * be an XSS concern. + * + * The content for an element can be passed in multiple types and + * combinations, whose behavior is as follows: + * + * @param {module:dom~ContentDescriptor} content + * A content descriptor value. + * + * @return {Array} + * All of the content that was passed in, normalized to an array of + * elements or text nodes. + */ + +function normalizeContent(content) { + // First, invoke content if it is a function. If it produces an array, + // that needs to happen before normalization. + if (typeof content === 'function') { + content = content(); + } // Next up, normalize to an array, so one or many items can be normalized, + // filtered, and returned. + + + return (Array.isArray(content) ? content : [content]).map(function (value) { + // First, invoke value if it is a function to produce a new value, + // which will be subsequently normalized to a Node of some kind. + if (typeof value === 'function') { + value = value(); + } + + if (isEl(value) || isTextNode(value)) { + return value; + } + + if (typeof value === 'string' && /\S/.test(value)) { + return document.createTextNode(value); + } + }).filter(function (value) { + return value; + }); +} +/** + * Normalizes and appends content to an element. + * + * @param {Element} el + * Element to append normalized content to. + * + * @param {module:dom~ContentDescriptor} content + * A content descriptor value. + * + * @return {Element} + * The element with appended normalized content. + */ + +function appendContent(el, content) { + normalizeContent(content).forEach(function (node) { + return el.appendChild(node); + }); + return el; +} +/** + * Normalizes and inserts content into an element; this is identical to + * `appendContent()`, except it empties the element first. + * + * @param {Element} el + * Element to insert normalized content into. + * + * @param {module:dom~ContentDescriptor} content + * A content descriptor value. + * + * @return {Element} + * The element with inserted normalized content. + */ + +function insertContent(el, content) { + return appendContent(emptyEl(el), content); +} +/** + * Check if an event was a single left click. + * + * @param {EventTarget~Event} event + * Event object. + * + * @return {boolean} + * Will be `true` if a single left click, `false` otherwise. + */ + +function isSingleLeftClick(event) { + // Note: if you create something draggable, be sure to + // call it on both `mousedown` and `mousemove` event, + // otherwise `mousedown` should be enough for a button + if (event.button === undefined && event.buttons === undefined) { + // Why do we need `buttons` ? + // Because, middle mouse sometimes have this: + // e.button === 0 and e.buttons === 4 + // Furthermore, we want to prevent combination click, something like + // HOLD middlemouse then left click, that would be + // e.button === 0, e.buttons === 5 + // just `button` is not gonna work + // Alright, then what this block does ? + // this is for chrome `simulate mobile devices` + // I want to support this as well + return true; + } + + if (event.button === 0 && event.buttons === undefined) { + // Touch screen, sometimes on some specific device, `buttons` + // doesn't have anything (safari on ios, blackberry...) + return true; + } + + if (event.button !== 0 || event.buttons !== 1) { + // This is the reason we have those if else block above + // if any special case we can catch and let it slide + // we do it above, when get to here, this definitely + // is-not-left-click + return false; + } + + return true; +} +/** + * Finds a single DOM element matching `selector` within the optional + * `context` of another DOM element (defaulting to `document`). + * + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelector`. + * + * @param {Element|String} [context=document] + * A DOM element within which to query. Can also be a selector + * string in which case the first matching element will be used + * as context. If missing (or no element matches selector), falls + * back to `document`. + * + * @return {Element|null} + * The element that was found or null. + */ + +var $ = createQuerier('querySelector'); +/** + * Finds a all DOM elements matching `selector` within the optional + * `context` of another DOM element (defaulting to `document`). + * + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelectorAll`. + * + * @param {Element|String} [context=document] + * A DOM element within which to query. Can also be a selector + * string in which case the first matching element will be used + * as context. If missing (or no element matches selector), falls + * back to `document`. + * + * @return {NodeList} + * A element list of elements that were found. Will be empty if none + * were found. + * + */ + +var $$ = createQuerier('querySelectorAll'); + +var Dom = /*#__PURE__*/Object.freeze({ + isReal: isReal, + isEl: isEl, + isInFrame: isInFrame, + createEl: createEl, + textContent: textContent, + prependTo: prependTo, + hasClass: hasClass, + addClass: addClass, + removeClass: removeClass, + toggleClass: toggleClass, + setAttributes: setAttributes, + getAttributes: getAttributes, + getAttribute: getAttribute, + setAttribute: setAttribute, + removeAttribute: removeAttribute, + blockTextSelection: blockTextSelection, + unblockTextSelection: unblockTextSelection, + getBoundingClientRect: getBoundingClientRect, + findPosition: findPosition, + getPointerPosition: getPointerPosition, + isTextNode: isTextNode, + emptyEl: emptyEl, + normalizeContent: normalizeContent, + appendContent: appendContent, + insertContent: insertContent, + isSingleLeftClick: isSingleLeftClick, + $: $, + $$: $$ +}); + +/** + * @file guid.js + * @module guid + */ + +/** + * Unique ID for an element or function + * @type {Number} + */ +var _guid = 1; +/** + * Get a unique auto-incrementing ID by number that has not been returned before. + * + * @return {number} + * A new unique ID. + */ + +function newGUID() { + return _guid++; +} + +/** + * @file dom-data.js + * @module dom-data + */ +/** + * Element Data Store. + * + * Allows for binding data to an element without putting it directly on the + * element. Ex. Event listeners are stored here. + * (also from jsninja.com, slightly modified and updated for closure compiler) + * + * @type {Object} + * @private + */ + +var elData = {}; +/* + * Unique attribute name to store an element's guid in + * + * @type {String} + * @constant + * @private + */ + +var elIdAttr = 'vdata' + new Date().getTime(); +/** + * Returns the cache object where data for an element is stored + * + * @param {Element} el + * Element to store data for. + * + * @return {Object} + * The cache object for that el that was passed in. + */ + +function getData(el) { + var id = el[elIdAttr]; + + if (!id) { + id = el[elIdAttr] = newGUID(); + } + + if (!elData[id]) { + elData[id] = {}; + } + + return elData[id]; +} +/** + * Returns whether or not an element has cached data + * + * @param {Element} el + * Check if this element has cached data. + * + * @return {boolean} + * - True if the DOM element has cached data. + * - False otherwise. + */ + +function hasData(el) { + var id = el[elIdAttr]; + + if (!id) { + return false; + } + + return !!Object.getOwnPropertyNames(elData[id]).length; +} +/** + * Delete data for the element from the cache and the guid attr from getElementById + * + * @param {Element} el + * Remove cached data for this element. + */ + +function removeData(el) { + var id = el[elIdAttr]; + + if (!id) { + return; + } // Remove all stored data + + + delete elData[id]; // Remove the elIdAttr property from the DOM node + + try { + delete el[elIdAttr]; + } catch (e) { + if (el.removeAttribute) { + el.removeAttribute(elIdAttr); + } else { + // IE doesn't appear to support removeAttribute on the document element + el[elIdAttr] = null; + } + } +} + +/** + * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/) + * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible) + * This should work very similarly to jQuery's events, however it's based off the book version which isn't as + * robust as jquery's, so there's probably some differences. + * + * @file events.js + * @module events + */ +/** + * Clean up the listener cache and dispatchers + * + * @param {Element|Object} elem + * Element to clean up + * + * @param {string} type + * Type of event to clean up + */ + +function _cleanUpEvents(elem, type) { + var data = getData(elem); // Remove the events of a particular type if there are none left + + if (data.handlers[type].length === 0) { + delete data.handlers[type]; // data.handlers[type] = null; + // Setting to null was causing an error with data.handlers + // Remove the meta-handler from the element + + if (elem.removeEventListener) { + elem.removeEventListener(type, data.dispatcher, false); + } else if (elem.detachEvent) { + elem.detachEvent('on' + type, data.dispatcher); + } + } // Remove the events object if there are no types left + + + if (Object.getOwnPropertyNames(data.handlers).length <= 0) { + delete data.handlers; + delete data.dispatcher; + delete data.disabled; + } // Finally remove the element data if there is no data left + + + if (Object.getOwnPropertyNames(data).length === 0) { + removeData(elem); + } +} +/** + * Loops through an array of event types and calls the requested method for each type. + * + * @param {Function} fn + * The event method we want to use. + * + * @param {Element|Object} elem + * Element or object to bind listeners to + * + * @param {string} type + * Type of event to bind to. + * + * @param {EventTarget~EventListener} callback + * Event listener. + */ + + +function _handleMultipleEvents(fn, elem, types, callback) { + types.forEach(function (type) { + // Call the event method for each one of the types + fn(elem, type, callback); + }); +} +/** + * Fix a native event to have standard property values + * + * @param {Object} event + * Event object to fix. + * + * @return {Object} + * Fixed event object. + */ + + +function fixEvent(event) { + function returnTrue() { + return true; + } + + function returnFalse() { + return false; + } // Test if fixing up is needed + // Used to check if !event.stopPropagation instead of isPropagationStopped + // But native events return true for stopPropagation, but don't have + // other expected methods like isPropagationStopped. Seems to be a problem + // with the Javascript Ninja code. So we're just overriding all events now. + + + if (!event || !event.isPropagationStopped) { + var old = event || window$1.event; + event = {}; // Clone the old object so that we can modify the values event = {}; + // IE8 Doesn't like when you mess with native event properties + // Firefox returns false for event.hasOwnProperty('type') and other props + // which makes copying more difficult. + // TODO: Probably best to create a whitelist of event props + + for (var key in old) { + // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y + // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation + // and webkitMovementX/Y + if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY') { + // Chrome 32+ warns if you try to copy deprecated returnValue, but + // we still want to if preventDefault isn't supported (IE8). + if (!(key === 'returnValue' && old.preventDefault)) { + event[key] = old[key]; + } + } + } // The event occurred on this element + + + if (!event.target) { + event.target = event.srcElement || document; + } // Handle which other element the event is related to + + + if (!event.relatedTarget) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } // Stop the default browser action + + + event.preventDefault = function () { + if (old.preventDefault) { + old.preventDefault(); + } + + event.returnValue = false; + old.returnValue = false; + event.defaultPrevented = true; + }; + + event.defaultPrevented = false; // Stop the event from bubbling + + event.stopPropagation = function () { + if (old.stopPropagation) { + old.stopPropagation(); + } + + event.cancelBubble = true; + old.cancelBubble = true; + event.isPropagationStopped = returnTrue; + }; + + event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers + + event.stopImmediatePropagation = function () { + if (old.stopImmediatePropagation) { + old.stopImmediatePropagation(); + } + + event.isImmediatePropagationStopped = returnTrue; + event.stopPropagation(); + }; + + event.isImmediatePropagationStopped = returnFalse; // Handle mouse position + + if (event.clientX !== null && event.clientX !== undefined) { + var doc = document.documentElement; + var body = document.body; + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } // Handle key presses + + + event.which = event.charCode || event.keyCode; // Fix button for mouse clicks: + // 0 == left; 1 == middle; 2 == right + + if (event.button !== null && event.button !== undefined) { + // The following is disabled because it does not pass videojs-standard + // and... yikes. + + /* eslint-disable */ + event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0; + /* eslint-enable */ + } + } // Returns fixed-up instance + + + return event; +} +/** + * Whether passive event listeners are supported + */ + +var _supportsPassive = false; + +(function () { + try { + var opts = Object.defineProperty({}, 'passive', { + get: function get() { + _supportsPassive = true; + } + }); + window$1.addEventListener('test', null, opts); + window$1.removeEventListener('test', null, opts); + } catch (e) {// disregard + } +})(); +/** + * Touch events Chrome expects to be passive + */ + + +var passiveEvents = ['touchstart', 'touchmove']; +/** + * Add an event listener to element + * It stores the handler function in a separate cache object + * and adds a generic handler to the element's event, + * along with a unique id (guid) to the element. + * + * @param {Element|Object} elem + * Element or object to bind listeners to + * + * @param {string|string[]} type + * Type of event to bind to. + * + * @param {EventTarget~EventListener} fn + * Event listener. + */ + +function on(elem, type, fn) { + if (Array.isArray(type)) { + return _handleMultipleEvents(on, elem, type, fn); + } + + var data = getData(elem); // We need a place to store all our handler data + + if (!data.handlers) { + data.handlers = {}; + } + + if (!data.handlers[type]) { + data.handlers[type] = []; + } + + if (!fn.guid) { + fn.guid = newGUID(); + } + + data.handlers[type].push(fn); + + if (!data.dispatcher) { + data.disabled = false; + + data.dispatcher = function (event, hash) { + if (data.disabled) { + return; + } + + event = fixEvent(event); + var handlers = data.handlers[event.type]; + + if (handlers) { + // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off. + var handlersCopy = handlers.slice(0); + + for (var m = 0, n = handlersCopy.length; m < n; m++) { + if (event.isImmediatePropagationStopped()) { + break; + } else { + try { + handlersCopy[m].call(elem, event, hash); + } catch (e) { + log.error(e); + } + } + } + } + }; + } + + if (data.handlers[type].length === 1) { + if (elem.addEventListener) { + var options = false; + + if (_supportsPassive && passiveEvents.indexOf(type) > -1) { + options = { + passive: true + }; + } + + elem.addEventListener(type, data.dispatcher, options); + } else if (elem.attachEvent) { + elem.attachEvent('on' + type, data.dispatcher); + } + } +} +/** + * Removes event listeners from an element + * + * @param {Element|Object} elem + * Object to remove listeners from. + * + * @param {string|string[]} [type] + * Type of listener to remove. Don't include to remove all events from element. + * + * @param {EventTarget~EventListener} [fn] + * Specific listener to remove. Don't include to remove listeners for an event + * type. + */ + +function off(elem, type, fn) { + // Don't want to add a cache object through getElData if not needed + if (!hasData(elem)) { + return; + } + + var data = getData(elem); // If no events exist, nothing to unbind + + if (!data.handlers) { + return; + } + + if (Array.isArray(type)) { + return _handleMultipleEvents(off, elem, type, fn); + } // Utility function + + + var removeType = function removeType(el, t) { + data.handlers[t] = []; + + _cleanUpEvents(el, t); + }; // Are we removing all bound events? + + + if (type === undefined) { + for (var t in data.handlers) { + if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) { + removeType(elem, t); + } + } + + return; + } + + var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind + + if (!handlers) { + return; + } // If no listener was provided, remove all listeners for type + + + if (!fn) { + removeType(elem, type); + return; + } // We're only removing a single handler + + + if (fn.guid) { + for (var n = 0; n < handlers.length; n++) { + if (handlers[n].guid === fn.guid) { + handlers.splice(n--, 1); + } + } + } + + _cleanUpEvents(elem, type); +} +/** + * Trigger an event for an element + * + * @param {Element|Object} elem + * Element to trigger an event on + * + * @param {EventTarget~Event|string} event + * A string (the type) or an event object with a type attribute + * + * @param {Object} [hash] + * data hash to pass along with the event + * + * @return {boolean|undefined} + * Returns the opposite of `defaultPrevented` if default was + * prevented. Otherwise, returns `undefined` + */ + +function trigger(elem, event, hash) { + // Fetches element data and a reference to the parent (for bubbling). + // Don't want to add a data object to cache for every parent, + // so checking hasElData first. + var elemData = hasData(elem) ? getData(elem) : {}; + var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event, + // handler; + // If an event name was passed as a string, creates an event out of it + + if (typeof event === 'string') { + event = { + type: event, + target: elem + }; + } else if (!event.target) { + event.target = elem; + } // Normalizes the event properties. + + + event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers. + + if (elemData.dispatcher) { + elemData.dispatcher.call(elem, event, hash); + } // Unless explicitly stopped or the event does not bubble (e.g. media events) + // recursively calls this function to bubble the event up the DOM. + + + if (parent && !event.isPropagationStopped() && event.bubbles === true) { + trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled. + } else if (!parent && !event.defaultPrevented) { + var targetData = getData(event.target); // Checks if the target has a default action for this event. + + if (event.target[event.type]) { + // Temporarily disables event dispatching on the target as we have already executed the handler. + targetData.disabled = true; // Executes the default action. + + if (typeof event.target[event.type] === 'function') { + event.target[event.type](); + } // Re-enables event dispatching. + + + targetData.disabled = false; + } + } // Inform the triggerer if the default was prevented by returning false + + + return !event.defaultPrevented; +} +/** + * Trigger a listener only once for an event. + * + * @param {Element|Object} elem + * Element or object to bind to. + * + * @param {string|string[]} type + * Name/type of event + * + * @param {Event~EventListener} fn + * Event listener function + */ + +function one(elem, type, fn) { + if (Array.isArray(type)) { + return _handleMultipleEvents(one, elem, type, fn); + } + + var func = function func() { + off(elem, type, func); + fn.apply(this, arguments); + }; // copy the guid to the new function so it can removed using the original function's ID + + + func.guid = fn.guid = fn.guid || newGUID(); + on(elem, type, func); +} + +var Events = /*#__PURE__*/Object.freeze({ + fixEvent: fixEvent, + on: on, + off: off, + trigger: trigger, + one: one +}); + +/** + * @file setup.js - Functions for setting up a player without + * user interaction based on the data-setup `attribute` of the video tag. + * + * @module setup + */ +var _windowLoaded = false; +var videojs; +/** + * Set up any tags that have a data-setup `attribute` when the player is started. + */ + +var autoSetup = function autoSetup() { + // Protect against breakage in non-browser environments and check global autoSetup option. + if (!isReal() || videojs.options.autoSetup === false) { + return; + } + + var vids = Array.prototype.slice.call(document.getElementsByTagName('video')); + var audios = Array.prototype.slice.call(document.getElementsByTagName('audio')); + var divs = Array.prototype.slice.call(document.getElementsByTagName('video-js')); + var mediaEls = vids.concat(audios, divs); // Check if any media elements exist + + if (mediaEls && mediaEls.length > 0) { + for (var i = 0, e = mediaEls.length; i < e; i++) { + var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func. + + if (mediaEl && mediaEl.getAttribute) { + // Make sure this player hasn't already been set up. + if (mediaEl.player === undefined) { + var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists. + // We only auto-setup if they've added the data-setup attr. + + if (options !== null) { + // Create new video.js instance. + videojs(mediaEl); + } + } // If getAttribute isn't defined, we need to wait for the DOM. + + } else { + autoSetupTimeout(1); + break; + } + } // No videos were found, so keep looping unless page is finished loading. + + } else if (!_windowLoaded) { + autoSetupTimeout(1); + } +}; +/** + * Wait until the page is loaded before running autoSetup. This will be called in + * autoSetup if `hasLoaded` returns false. + * + * @param {number} wait + * How long to wait in ms + * + * @param {module:videojs} [vjs] + * The videojs library function + */ + + +function autoSetupTimeout(wait, vjs) { + if (vjs) { + videojs = vjs; + } + + window$1.setTimeout(autoSetup, wait); +} + +if (isReal() && document.readyState === 'complete') { + _windowLoaded = true; +} else { + /** + * Listen for the load event on window, and set _windowLoaded to true. + * + * @listens load + */ + one(window$1, 'load', function () { + _windowLoaded = true; + }); +} + +/** + * @file stylesheet.js + * @module stylesheet + */ +/** + * Create a DOM syle element given a className for it. + * + * @param {string} className + * The className to add to the created style element. + * + * @return {Element} + * The element that was created. + */ + +var createStyleElement = function createStyleElement(className) { + var style = document.createElement('style'); + style.className = className; + return style; +}; +/** + * Add text to a DOM element. + * + * @param {Element} el + * The Element to add text content to. + * + * @param {string} content + * The text to add to the element. + */ + +var setTextContent = function setTextContent(el, content) { + if (el.styleSheet) { + el.styleSheet.cssText = content; + } else { + el.textContent = content; + } +}; + +/** + * @file fn.js + * @module fn + */ +/** + * Bind (a.k.a proxy or context). A simple method for changing the context of + * a function. + * + * It also stores a unique id on the function so it can be easily removed from + * events. + * + * @function + * @param {Mixed} context + * The object to bind as scope. + * + * @param {Function} fn + * The function to be bound to a scope. + * + * @param {number} [uid] + * An optional unique ID for the function to be set + * + * @return {Function} + * The new function that will be bound into the context given + */ + +var bind = function bind(context, fn, uid) { + // Make sure the function has a unique ID + if (!fn.guid) { + fn.guid = newGUID(); + } // Create the new function that changes the context + + + var bound = function bound() { + return fn.apply(context, arguments); + }; // Allow for the ability to individualize this function + // Needed in the case where multiple objects might share the same prototype + // IF both items add an event listener with the same function, then you try to remove just one + // it will remove both because they both have the same guid. + // when using this, you need to use the bind method when you remove the listener as well. + // currently used in text tracks + + + bound.guid = uid ? uid + '_' + fn.guid : fn.guid; + return bound; +}; +/** + * Wraps the given function, `fn`, with a new function that only invokes `fn` + * at most once per every `wait` milliseconds. + * + * @function + * @param {Function} fn + * The function to be throttled. + * + * @param {number} wait + * The number of milliseconds by which to throttle. + * + * @return {Function} + */ + +var throttle = function throttle(fn, wait) { + var last = Date.now(); + + var throttled = function throttled() { + var now = Date.now(); + + if (now - last >= wait) { + fn.apply(void 0, arguments); + last = now; + } + }; + + return throttled; +}; +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. + * + * Inspired by lodash and underscore implementations. + * + * @function + * @param {Function} func + * The function to wrap with debounce behavior. + * + * @param {number} wait + * The number of milliseconds to wait after the last invocation. + * + * @param {boolean} [immediate] + * Whether or not to invoke the function immediately upon creation. + * + * @param {Object} [context=window] + * The "context" in which the debounced function should debounce. For + * example, if this function should be tied to a Video.js player, + * the player can be passed here. Alternatively, defaults to the + * global `window` object. + * + * @return {Function} + * A debounced function. + */ + +var debounce = function debounce(func, wait, immediate, context) { + if (context === void 0) { + context = window$1; + } + + var timeout; + + var cancel = function cancel() { + context.clearTimeout(timeout); + timeout = null; + }; + /* eslint-disable consistent-this */ + + + var debounced = function debounced() { + var self = this; + var args = arguments; + + var _later = function later() { + timeout = null; + _later = null; + + if (!immediate) { + func.apply(self, args); + } + }; + + if (!timeout && immediate) { + func.apply(self, args); + } + + context.clearTimeout(timeout); + timeout = context.setTimeout(_later, wait); + }; + /* eslint-enable consistent-this */ + + + debounced.cancel = cancel; + return debounced; +}; + +/** + * @file src/js/event-target.js + */ +/** + * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It + * adds shorthand functions that wrap around lengthy functions. For example: + * the `on` function is a wrapper around `addEventListener`. + * + * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget} + * @class EventTarget + */ + +var EventTarget = function EventTarget() {}; +/** + * A Custom DOM event. + * + * @typedef {Object} EventTarget~Event + * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent} + */ + +/** + * All event listeners should follow the following format. + * + * @callback EventTarget~EventListener + * @this {EventTarget} + * + * @param {EventTarget~Event} event + * the event that triggered this function + * + * @param {Object} [hash] + * hash of data sent during the event + */ + +/** + * An object containing event names as keys and booleans as values. + * + * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger} + * will have extra functionality. See that function for more information. + * + * @property EventTarget.prototype.allowedEvents_ + * @private + */ + + +EventTarget.prototype.allowedEvents_ = {}; +/** + * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a + * function that will get called when an event with a certain name gets triggered. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to call with `EventTarget`s + */ + +EventTarget.prototype.on = function (type, fn) { + // Remove the addEventListener alias before calling Events.on + // so we don't get into an infinite type loop + var ael = this.addEventListener; + + this.addEventListener = function () {}; + + on(this, type, fn); + this.addEventListener = ael; +}; +/** + * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#on} + */ + + +EventTarget.prototype.addEventListener = EventTarget.prototype.on; +/** + * Removes an `event listener` for a specific event from an instance of `EventTarget`. + * This makes it so that the `event listener` will no longer get called when the + * named event happens. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to remove. + */ + +EventTarget.prototype.off = function (type, fn) { + off(this, type, fn); +}; +/** + * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#off} + */ + + +EventTarget.prototype.removeEventListener = EventTarget.prototype.off; +/** + * This function will add an `event listener` that gets triggered only once. After the + * first trigger it will get removed. This is like adding an `event listener` + * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself. + * + * @param {string|string[]} type + * An event name or an array of event names. + * + * @param {EventTarget~EventListener} fn + * The function to be called once for each event name. + */ + +EventTarget.prototype.one = function (type, fn) { + // Remove the addEventListener alialing Events.on + // so we don't get into an infinite type loop + var ael = this.addEventListener; + + this.addEventListener = function () {}; + + one(this, type, fn); + this.addEventListener = ael; +}; +/** + * This function causes an event to happen. This will then cause any `event listeners` + * that are waiting for that event, to get called. If there are no `event listeners` + * for an event then nothing will happen. + * + * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`. + * Trigger will also call the `on` + `uppercaseEventName` function. + * + * Example: + * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call + * `onClick` if it exists. + * + * @param {string|EventTarget~Event|Object} event + * The name of the event, an `Event`, or an object with a key of type set to + * an event name. + */ + + +EventTarget.prototype.trigger = function (event) { + var type = event.type || event; + + if (typeof event === 'string') { + event = { + type: type + }; + } + + event = fixEvent(event); + + if (this.allowedEvents_[type] && this['on' + type]) { + this['on' + type](event); + } + + trigger(this, event); +}; +/** + * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic + * the standard DOM API. + * + * @function + * @see {@link EventTarget#trigger} + */ + + +EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger; +var EVENT_MAP; + +EventTarget.prototype.queueTrigger = function (event) { + var _this = this; + + // only set up EVENT_MAP if it'll be used + if (!EVENT_MAP) { + EVENT_MAP = new Map(); + } + + var type = event.type || event; + var map = EVENT_MAP.get(this); + + if (!map) { + map = new Map(); + EVENT_MAP.set(this, map); + } + + var oldTimeout = map.get(type); + map.delete(type); + window$1.clearTimeout(oldTimeout); + var timeout = window$1.setTimeout(function () { + // if we cleared out all timeouts for the current target, delete its map + if (map.size === 0) { + map = null; + EVENT_MAP.delete(_this); + } + + _this.trigger(event); + }, 0); + map.set(type, timeout); +}; + +/** + * @file mixins/evented.js + * @module evented + */ +/** + * Returns whether or not an object has had the evented mixin applied. + * + * @param {Object} object + * An object to test. + * + * @return {boolean} + * Whether or not the object appears to be evented. + */ + +var isEvented = function isEvented(object) { + return object instanceof EventTarget || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) { + return typeof object[k] === 'function'; + }); +}; +/** + * Adds a callback to run after the evented mixin applied. + * + * @param {Object} object + * An object to Add + * @param {Function} callback + * The callback to run. + */ + + +var addEventedCallback = function addEventedCallback(target, callback) { + if (isEvented(target)) { + callback(); + } else { + if (!target.eventedCallbacks) { + target.eventedCallbacks = []; + } + + target.eventedCallbacks.push(callback); + } +}; +/** + * Whether a value is a valid event type - non-empty string or array. + * + * @private + * @param {string|Array} type + * The type value to test. + * + * @return {boolean} + * Whether or not the type is a valid event type. + */ + + +var isValidEventType = function isValidEventType(type) { + return (// The regex here verifies that the `type` contains at least one non- + // whitespace character. + typeof type === 'string' && /\S/.test(type) || Array.isArray(type) && !!type.length + ); +}; +/** + * Validates a value to determine if it is a valid event target. Throws if not. + * + * @private + * @throws {Error} + * If the target does not appear to be a valid event target. + * + * @param {Object} target + * The object to test. + */ + + +var validateTarget = function validateTarget(target) { + if (!target.nodeName && !isEvented(target)) { + throw new Error('Invalid target; must be a DOM node or evented object.'); + } +}; +/** + * Validates a value to determine if it is a valid event target. Throws if not. + * + * @private + * @throws {Error} + * If the type does not appear to be a valid event type. + * + * @param {string|Array} type + * The type to test. + */ + + +var validateEventType = function validateEventType(type) { + if (!isValidEventType(type)) { + throw new Error('Invalid event type; must be a non-empty string or array.'); + } +}; +/** + * Validates a value to determine if it is a valid listener. Throws if not. + * + * @private + * @throws {Error} + * If the listener is not a function. + * + * @param {Function} listener + * The listener to test. + */ + + +var validateListener = function validateListener(listener) { + if (typeof listener !== 'function') { + throw new Error('Invalid listener; must be a function.'); + } +}; +/** + * Takes an array of arguments given to `on()` or `one()`, validates them, and + * normalizes them into an object. + * + * @private + * @param {Object} self + * The evented object on which `on()` or `one()` was called. This + * object will be bound as the `this` value for the listener. + * + * @param {Array} args + * An array of arguments passed to `on()` or `one()`. + * + * @return {Object} + * An object containing useful values for `on()` or `one()` calls. + */ + + +var normalizeListenArgs = function normalizeListenArgs(self, args) { + // If the number of arguments is less than 3, the target is always the + // evented object itself. + var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_; + var target; + var type; + var listener; + + if (isTargetingSelf) { + target = self.eventBusEl_; // Deal with cases where we got 3 arguments, but we are still listening to + // the evented object itself. + + if (args.length >= 3) { + args.shift(); + } + + type = args[0]; + listener = args[1]; + } else { + target = args[0]; + type = args[1]; + listener = args[2]; + } + + validateTarget(target); + validateEventType(type); + validateListener(listener); + listener = bind(self, listener); + return { + isTargetingSelf: isTargetingSelf, + target: target, + type: type, + listener: listener + }; +}; +/** + * Adds the listener to the event type(s) on the target, normalizing for + * the type of target. + * + * @private + * @param {Element|Object} target + * A DOM node or evented object. + * + * @param {string} method + * The event binding method to use ("on" or "one"). + * + * @param {string|Array} type + * One or more event type(s). + * + * @param {Function} listener + * A listener function. + */ + + +var listen = function listen(target, method, type, listener) { + validateTarget(target); + + if (target.nodeName) { + Events[method](target, type, listener); + } else { + target[method](type, listener); + } +}; +/** + * Contains methods that provide event capabilities to an object which is passed + * to {@link module:evented|evented}. + * + * @mixin EventedMixin + */ + + +var EventedMixin = { + /** + * Add a listener to an event (or events) on this object or another evented + * object. + * + * @param {string|Array|Element|Object} targetOrType + * If this is a string or array, it represents the event type(s) + * that will trigger the listener. + * + * Another evented object can be passed here instead, which will + * cause the listener to listen for events on _that_ object. + * + * In either case, the listener's `this` value will be bound to + * this object. + * + * @param {string|Array|Function} typeOrListener + * If the first argument was a string or array, this should be the + * listener function. Otherwise, this is a string or array of event + * type(s). + * + * @param {Function} [listener] + * If the first argument was another evented object, this will be + * the listener function. + */ + on: function on$$1() { + var _this = this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var _normalizeListenArgs = normalizeListenArgs(this, args), + isTargetingSelf = _normalizeListenArgs.isTargetingSelf, + target = _normalizeListenArgs.target, + type = _normalizeListenArgs.type, + listener = _normalizeListenArgs.listener; + + listen(target, 'on', type, listener); // If this object is listening to another evented object. + + if (!isTargetingSelf) { + // If this object is disposed, remove the listener. + var removeListenerOnDispose = function removeListenerOnDispose() { + return _this.off(target, type, listener); + }; // Use the same function ID as the listener so we can remove it later it + // using the ID of the original listener. + + + removeListenerOnDispose.guid = listener.guid; // Add a listener to the target's dispose event as well. This ensures + // that if the target is disposed BEFORE this object, we remove the + // removal listener that was just added. Otherwise, we create a memory leak. + + var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() { + return _this.off('dispose', removeListenerOnDispose); + }; // Use the same function ID as the listener so we can remove it later + // it using the ID of the original listener. + + + removeRemoverOnTargetDispose.guid = listener.guid; + listen(this, 'on', 'dispose', removeListenerOnDispose); + listen(target, 'on', 'dispose', removeRemoverOnTargetDispose); + } + }, + + /** + * Add a listener to an event (or events) on this object or another evented + * object. The listener will only be called once and then removed. + * + * @param {string|Array|Element|Object} targetOrType + * If this is a string or array, it represents the event type(s) + * that will trigger the listener. + * + * Another evented object can be passed here instead, which will + * cause the listener to listen for events on _that_ object. + * + * In either case, the listener's `this` value will be bound to + * this object. + * + * @param {string|Array|Function} typeOrListener + * If the first argument was a string or array, this should be the + * listener function. Otherwise, this is a string or array of event + * type(s). + * + * @param {Function} [listener] + * If the first argument was another evented object, this will be + * the listener function. + */ + one: function one$$1() { + var _this2 = this; + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var _normalizeListenArgs2 = normalizeListenArgs(this, args), + isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, + target = _normalizeListenArgs2.target, + type = _normalizeListenArgs2.type, + listener = _normalizeListenArgs2.listener; // Targeting this evented object. + + + if (isTargetingSelf) { + listen(target, 'one', type, listener); // Targeting another evented object. + } else { + var wrapper = function wrapper() { + _this2.off(target, type, wrapper); + + for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + largs[_key3] = arguments[_key3]; + } + + listener.apply(null, largs); + }; // Use the same function ID as the listener so we can remove it later + // it using the ID of the original listener. + + + wrapper.guid = listener.guid; + listen(target, 'one', type, wrapper); + } + }, + + /** + * Removes listener(s) from event(s) on an evented object. + * + * @param {string|Array|Element|Object} [targetOrType] + * If this is a string or array, it represents the event type(s). + * + * Another evented object can be passed here instead, in which case + * ALL 3 arguments are _required_. + * + * @param {string|Array|Function} [typeOrListener] + * If the first argument was a string or array, this may be the + * listener function. Otherwise, this is a string or array of event + * type(s). + * + * @param {Function} [listener] + * If the first argument was another evented object, this will be + * the listener function; otherwise, _all_ listeners bound to the + * event type(s) will be removed. + */ + off: function off$$1(targetOrType, typeOrListener, listener) { + // Targeting this evented object. + if (!targetOrType || isValidEventType(targetOrType)) { + off(this.eventBusEl_, targetOrType, typeOrListener); // Targeting another evented object. + } else { + var target = targetOrType; + var type = typeOrListener; // Fail fast and in a meaningful way! + + validateTarget(target); + validateEventType(type); + validateListener(listener); // Ensure there's at least a guid, even if the function hasn't been used + + listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given + // the same guid as the event listener in on(). + + this.off('dispose', listener); + + if (target.nodeName) { + off(target, type, listener); + off(target, 'dispose', listener); + } else if (isEvented(target)) { + target.off(type, listener); + target.off('dispose', listener); + } + } + }, + + /** + * Fire an event on this evented object, causing its listeners to be called. + * + * @param {string|Object} event + * An event type or an object with a type property. + * + * @param {Object} [hash] + * An additional object to pass along to listeners. + * + * @return {boolean} + * Whether or not the default behavior was prevented. + */ + trigger: function trigger$$1(event, hash) { + return trigger(this.eventBusEl_, event, hash); + } +}; +/** + * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object. + * + * @param {Object} target + * The object to which to add event methods. + * + * @param {Object} [options={}] + * Options for customizing the mixin behavior. + * + * @param {string} [options.eventBusKey] + * By default, adds a `eventBusEl_` DOM element to the target object, + * which is used as an event bus. If the target object already has a + * DOM element that should be used, pass its key here. + * + * @return {Object} + * The target object. + */ + +function evented(target, options) { + if (options === void 0) { + options = {}; + } + + var _options = options, + eventBusKey = _options.eventBusKey; // Set or create the eventBusEl_. + + if (eventBusKey) { + if (!target[eventBusKey].nodeName) { + throw new Error("The eventBusKey \"" + eventBusKey + "\" does not refer to an element."); + } + + target.eventBusEl_ = target[eventBusKey]; + } else { + target.eventBusEl_ = createEl('span', { + className: 'vjs-event-bus' + }); + } + + assign(target, EventedMixin); + + if (target.eventedCallbacks) { + target.eventedCallbacks.forEach(function (callback) { + callback(); + }); + } // When any evented object is disposed, it removes all its listeners. + + + target.on('dispose', function () { + target.off(); + window$1.setTimeout(function () { + target.eventBusEl_ = null; + }, 0); + }); + return target; +} + +/** + * @file mixins/stateful.js + * @module stateful + */ +/** + * Contains methods that provide statefulness to an object which is passed + * to {@link module:stateful}. + * + * @mixin StatefulMixin + */ + +var StatefulMixin = { + /** + * A hash containing arbitrary keys and values representing the state of + * the object. + * + * @type {Object} + */ + state: {}, + + /** + * Set the state of an object by mutating its + * {@link module:stateful~StatefulMixin.state|state} object in place. + * + * @fires module:stateful~StatefulMixin#statechanged + * @param {Object|Function} stateUpdates + * A new set of properties to shallow-merge into the plugin state. + * Can be a plain object or a function returning a plain object. + * + * @return {Object|undefined} + * An object containing changes that occurred. If no changes + * occurred, returns `undefined`. + */ + setState: function setState(stateUpdates) { + var _this = this; + + // Support providing the `stateUpdates` state as a function. + if (typeof stateUpdates === 'function') { + stateUpdates = stateUpdates(); + } + + var changes; + each(stateUpdates, function (value, key) { + // Record the change if the value is different from what's in the + // current state. + if (_this.state[key] !== value) { + changes = changes || {}; + changes[key] = { + from: _this.state[key], + to: value + }; + } + + _this.state[key] = value; + }); // Only trigger "statechange" if there were changes AND we have a trigger + // function. This allows us to not require that the target object be an + // evented object. + + if (changes && isEvented(this)) { + /** + * An event triggered on an object that is both + * {@link module:stateful|stateful} and {@link module:evented|evented} + * indicating that its state has changed. + * + * @event module:stateful~StatefulMixin#statechanged + * @type {Object} + * @property {Object} changes + * A hash containing the properties that were changed and + * the values they were changed `from` and `to`. + */ + this.trigger({ + changes: changes, + type: 'statechanged' + }); + } + + return changes; + } +}; +/** + * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target + * object. + * + * If the target object is {@link module:evented|evented} and has a + * `handleStateChanged` method, that method will be automatically bound to the + * `statechanged` event on itself. + * + * @param {Object} target + * The object to be made stateful. + * + * @param {Object} [defaultState] + * A default set of properties to populate the newly-stateful object's + * `state` property. + * + * @return {Object} + * Returns the `target`. + */ + +function stateful(target, defaultState) { + assign(target, StatefulMixin); // This happens after the mixing-in because we need to replace the `state` + // added in that step. + + target.state = assign({}, target.state, defaultState); // Auto-bind the `handleStateChanged` method of the target object if it exists. + + if (typeof target.handleStateChanged === 'function' && isEvented(target)) { + target.on('statechanged', target.handleStateChanged); + } + + return target; +} + +/** + * @file to-title-case.js + * @module to-title-case + */ + +/** + * Uppercase the first letter of a string. + * + * @param {string} string + * String to be uppercased + * + * @return {string} + * The string with an uppercased first letter + */ +function toTitleCase(string) { + if (typeof string !== 'string') { + return string; + } + + return string.charAt(0).toUpperCase() + string.slice(1); +} +/** + * Compares the TitleCase versions of the two strings for equality. + * + * @param {string} str1 + * The first string to compare + * + * @param {string} str2 + * The second string to compare + * + * @return {boolean} + * Whether the TitleCase versions of the strings are equal + */ + +function titleCaseEquals(str1, str2) { + return toTitleCase(str1) === toTitleCase(str2); +} + +/** + * @file merge-options.js + * @module merge-options + */ +/** + * Merge two objects recursively. + * + * Performs a deep merge like + * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges + * plain objects (not arrays, elements, or anything else). + * + * Non-plain object values will be copied directly from the right-most + * argument. + * + * @static + * @param {Object[]} sources + * One or more objects to merge into a new object. + * + * @return {Object} + * A new object that is the merged result of all sources. + */ + +function mergeOptions() { + var result = {}; + + for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) { + sources[_key] = arguments[_key]; + } + + sources.forEach(function (source) { + if (!source) { + return; + } + + each(source, function (value, key) { + if (!isPlain(value)) { + result[key] = value; + return; + } + + if (!isPlain(result[key])) { + result[key] = {}; + } + + result[key] = mergeOptions(result[key], value); + }); + }); + return result; +} + +/** + * Player Component - Base class for all UI objects + * + * @file component.js + */ +/** + * Base class for all UI Components. + * Components are UI objects which represent both a javascript object and an element + * in the DOM. They can be children of other components, and can have + * children themselves. + * + * Components can also use methods from {@link EventTarget} + */ + +var Component = +/*#__PURE__*/ +function () { + /** + * A callback that is called when a component is ready. Does not have any + * paramters and any callback value will be ignored. + * + * @callback Component~ReadyCallback + * @this Component + */ + + /** + * Creates an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Object[]} [options.children] + * An array of children objects to intialize this component with. Children objects have + * a name property that will be used if more than one component of the same type needs to be + * added. + * + * @param {Component~ReadyCallback} [ready] + * Function that gets called when the `Component` is ready. + */ + function Component(player, options, ready) { + // The component might be the player itself and we can't pass `this` to super + if (!player && this.play) { + this.player_ = player = this; // eslint-disable-line + } else { + this.player_ = player; + } // Hold the reference to the parent component via `addChild` method + + + this.parentComponent_ = null; // Make a copy of prototype.options_ to protect against overriding defaults + + this.options_ = mergeOptions({}, this.options_); // Updated options with supplied options + + options = this.options_ = mergeOptions(this.options_, options); // Get ID from options or options element if one is supplied + + this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one + + if (!this.id_) { + // Don't require the player ID function in the case of mock players + var id = player && player.id && player.id() || 'no_player'; + this.id_ = id + "_component_" + newGUID(); + } + + this.name_ = options.name || null; // Create element if one wasn't provided in options + + if (options.el) { + this.el_ = options.el; + } else if (options.createEl !== false) { + this.el_ = this.createEl(); + } // if evented is anything except false, we want to mixin in evented + + + if (options.evented !== false) { + // Make this an evented object and use `el_`, if available, as its event bus + evented(this, { + eventBusKey: this.el_ ? 'el_' : null + }); + } + + stateful(this, this.constructor.defaultState); + this.children_ = []; + this.childIndex_ = {}; + this.childNameIndex_ = {}; // Add any child components in options + + if (options.initChildren !== false) { + this.initChildren(); + } + + this.ready(ready); // Don't want to trigger ready here or it will before init is actually + // finished for all children that run this constructor + + if (options.reportTouchActivity !== false) { + this.enableTouchActivity(); + } + } + /** + * Dispose of the `Component` and all child components. + * + * @fires Component#dispose + */ + + + var _proto = Component.prototype; + + _proto.dispose = function dispose() { + /** + * Triggered when a `Component` is disposed. + * + * @event Component#dispose + * @type {EventTarget~Event} + * + * @property {boolean} [bubbles=false] + * set to false so that the close event does not + * bubble up + */ + this.trigger({ + type: 'dispose', + bubbles: false + }); // Dispose all children. + + if (this.children_) { + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i].dispose) { + this.children_[i].dispose(); + } + } + } // Delete child references + + + this.children_ = null; + this.childIndex_ = null; + this.childNameIndex_ = null; + this.parentComponent_ = null; + + if (this.el_) { + // Remove element from DOM + if (this.el_.parentNode) { + this.el_.parentNode.removeChild(this.el_); + } + + removeData(this.el_); + this.el_ = null; + } // remove reference to the player after disposing of the element + + + this.player_ = null; + }; + /** + * Return the {@link Player} that the `Component` has attached to. + * + * @return {Player} + * The player that this `Component` has attached to. + */ + + + _proto.player = function player() { + return this.player_; + }; + /** + * Deep merge of options objects with new options. + * > Note: When both `obj` and `options` contain properties whose values are objects. + * The two properties get merged using {@link module:mergeOptions} + * + * @param {Object} obj + * The object that contains new options. + * + * @return {Object} + * A new object of `this.options_` and `obj` merged together. + * + * @deprecated since version 5 + */ + + + _proto.options = function options(obj) { + log.warn('this.options() has been deprecated and will be moved to the constructor in 6.0'); + + if (!obj) { + return this.options_; + } + + this.options_ = mergeOptions(this.options_, obj); + return this.options_; + }; + /** + * Get the `Component`s DOM element + * + * @return {Element} + * The DOM element for this `Component`. + */ + + + _proto.el = function el() { + return this.el_; + }; + /** + * Create the `Component`s DOM element. + * + * @param {string} [tagName] + * Element's DOM node type. e.g. 'div' + * + * @param {Object} [properties] + * An object of properties that should be set. + * + * @param {Object} [attributes] + * An object of attributes that should be set. + * + * @return {Element} + * The element that gets created. + */ + + + _proto.createEl = function createEl$$1(tagName, properties, attributes) { + return createEl(tagName, properties, attributes); + }; + /** + * Localize a string given the string in english. + * + * If tokens are provided, it'll try and run a simple token replacement on the provided string. + * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array. + * + * If a `defaultValue` is provided, it'll use that over `string`, + * if a value isn't found in provided language files. + * This is useful if you want to have a descriptive key for token replacement + * but have a succinct localized string and not require `en.json` to be included. + * + * Currently, it is used for the progress bar timing. + * ```js + * { + * "progress bar timing: currentTime={1} duration={2}": "{1} of {2}" + * } + * ``` + * It is then used like so: + * ```js + * this.localize('progress bar timing: currentTime={1} duration{2}', + * [this.player_.currentTime(), this.player_.duration()], + * '{1} of {2}'); + * ``` + * + * Which outputs something like: `01:23 of 24:56`. + * + * + * @param {string} string + * The string to localize and the key to lookup in the language files. + * @param {string[]} [tokens] + * If the current item has token replacements, provide the tokens here. + * @param {string} [defaultValue] + * Defaults to `string`. Can be a default value to use for token replacement + * if the lookup key is needed to be separate. + * + * @return {string} + * The localized string or if no localization exists the english string. + */ + + + _proto.localize = function localize(string, tokens, defaultValue) { + if (defaultValue === void 0) { + defaultValue = string; + } + + var code = this.player_.language && this.player_.language(); + var languages = this.player_.languages && this.player_.languages(); + var language = languages && languages[code]; + var primaryCode = code && code.split('-')[0]; + var primaryLang = languages && languages[primaryCode]; + var localizedString = defaultValue; + + if (language && language[string]) { + localizedString = language[string]; + } else if (primaryLang && primaryLang[string]) { + localizedString = primaryLang[string]; + } + + if (tokens) { + localizedString = localizedString.replace(/\{(\d+)\}/g, function (match, index) { + var value = tokens[index - 1]; + var ret = value; + + if (typeof value === 'undefined') { + ret = match; + } + + return ret; + }); + } + + return localizedString; + }; + /** + * Return the `Component`s DOM element. This is where children get inserted. + * This will usually be the the same as the element returned in {@link Component#el}. + * + * @return {Element} + * The content element for this `Component`. + */ + + + _proto.contentEl = function contentEl() { + return this.contentEl_ || this.el_; + }; + /** + * Get this `Component`s ID + * + * @return {string} + * The id of this `Component` + */ + + + _proto.id = function id() { + return this.id_; + }; + /** + * Get the `Component`s name. The name gets used to reference the `Component` + * and is set during registration. + * + * @return {string} + * The name of this `Component`. + */ + + + _proto.name = function name() { + return this.name_; + }; + /** + * Get an array of all child components + * + * @return {Array} + * The children + */ + + + _proto.children = function children() { + return this.children_; + }; + /** + * Returns the child `Component` with the given `id`. + * + * @param {string} id + * The id of the child `Component` to get. + * + * @return {Component|undefined} + * The child `Component` with the given `id` or undefined. + */ + + + _proto.getChildById = function getChildById(id) { + return this.childIndex_[id]; + }; + /** + * Returns the child `Component` with the given `name`. + * + * @param {string} name + * The name of the child `Component` to get. + * + * @return {Component|undefined} + * The child `Component` with the given `name` or undefined. + */ + + + _proto.getChild = function getChild(name) { + if (!name) { + return; + } + + name = toTitleCase(name); + return this.childNameIndex_[name]; + }; + /** + * Add a child `Component` inside the current `Component`. + * + * + * @param {string|Component} child + * The name or instance of a child to add. + * + * @param {Object} [options={}] + * The key/value store of options that will get passed to children of + * the child. + * + * @param {number} [index=this.children_.length] + * The index to attempt to add a child into. + * + * @return {Component} + * The `Component` that gets added as a child. When using a string the + * `Component` will get created by this process. + */ + + + _proto.addChild = function addChild(child, options, index) { + if (options === void 0) { + options = {}; + } + + if (index === void 0) { + index = this.children_.length; + } + + var component; + var componentName; // If child is a string, create component with options + + if (typeof child === 'string') { + componentName = toTitleCase(child); + var componentClassName = options.componentClass || componentName; // Set name through options + + options.name = componentName; // Create a new object & element for this controls set + // If there's no .player_, this is a player + + var ComponentClass = Component.getComponent(componentClassName); + + if (!ComponentClass) { + throw new Error("Component " + componentClassName + " does not exist"); + } // data stored directly on the videojs object may be + // misidentified as a component to retain + // backwards-compatibility with 4.x. check to make sure the + // component class can be instantiated. + + + if (typeof ComponentClass !== 'function') { + return null; + } + + component = new ComponentClass(this.player_ || this, options); // child is a component instance + } else { + component = child; + } + + if (component.parentComponent_) { + component.parentComponent_.removeChild(component); + } + + this.children_.splice(index, 0, component); + component.parentComponent_ = this; + + if (typeof component.id === 'function') { + this.childIndex_[component.id()] = component; + } // If a name wasn't used to create the component, check if we can use the + // name function of the component + + + componentName = componentName || component.name && toTitleCase(component.name()); + + if (componentName) { + this.childNameIndex_[componentName] = component; + } // Add the UI object's element to the container div (box) + // Having an element is not required + + + if (typeof component.el === 'function' && component.el()) { + var childNodes = this.contentEl().children; + var refNode = childNodes[index] || null; + this.contentEl().insertBefore(component.el(), refNode); + } // Return so it can stored on parent object if desired. + + + return component; + }; + /** + * Remove a child `Component` from this `Component`s list of children. Also removes + * the child `Component`s element from this `Component`s element. + * + * @param {Component} component + * The child `Component` to remove. + */ + + + _proto.removeChild = function removeChild(component) { + if (typeof component === 'string') { + component = this.getChild(component); + } + + if (!component || !this.children_) { + return; + } + + var childFound = false; + + for (var i = this.children_.length - 1; i >= 0; i--) { + if (this.children_[i] === component) { + childFound = true; + this.children_.splice(i, 1); + break; + } + } + + if (!childFound) { + return; + } + + component.parentComponent_ = null; + this.childIndex_[component.id()] = null; + this.childNameIndex_[component.name()] = null; + var compEl = component.el(); + + if (compEl && compEl.parentNode === this.contentEl()) { + this.contentEl().removeChild(component.el()); + } + }; + /** + * Add and initialize default child `Component`s based upon options. + */ + + + _proto.initChildren = function initChildren() { + var _this = this; + + var children = this.options_.children; + + if (children) { + // `this` is `parent` + var parentOptions = this.options_; + + var handleAdd = function handleAdd(child) { + var name = child.name; + var opts = child.opts; // Allow options for children to be set at the parent options + // e.g. videojs(id, { controlBar: false }); + // instead of videojs(id, { children: { controlBar: false }); + + if (parentOptions[name] !== undefined) { + opts = parentOptions[name]; + } // Allow for disabling default components + // e.g. options['children']['posterImage'] = false + + + if (opts === false) { + return; + } // Allow options to be passed as a simple boolean if no configuration + // is necessary. + + + if (opts === true) { + opts = {}; + } // We also want to pass the original player options + // to each component as well so they don't need to + // reach back into the player for options later. + + + opts.playerOptions = _this.options_.playerOptions; // Create and add the child component. + // Add a direct reference to the child by name on the parent instance. + // If two of the same component are used, different names should be supplied + // for each + + var newChild = _this.addChild(name, opts); + + if (newChild) { + _this[name] = newChild; + } + }; // Allow for an array of children details to passed in the options + + + var workingChildren; + var Tech = Component.getComponent('Tech'); + + if (Array.isArray(children)) { + workingChildren = children; + } else { + workingChildren = Object.keys(children); + } + + workingChildren // children that are in this.options_ but also in workingChildren would + // give us extra children we do not want. So, we want to filter them out. + .concat(Object.keys(this.options_).filter(function (child) { + return !workingChildren.some(function (wchild) { + if (typeof wchild === 'string') { + return child === wchild; + } + + return child === wchild.name; + }); + })).map(function (child) { + var name; + var opts; + + if (typeof child === 'string') { + name = child; + opts = children[name] || _this.options_[name] || {}; + } else { + name = child.name; + opts = child; + } + + return { + name: name, + opts: opts + }; + }).filter(function (child) { + // we have to make sure that child.name isn't in the techOrder since + // techs are registerd as Components but can't aren't compatible + // See https://github.com/videojs/video.js/issues/2772 + var c = Component.getComponent(child.opts.componentClass || toTitleCase(child.name)); + return c && !Tech.isTech(c); + }).forEach(handleAdd); + } + }; + /** + * Builds the default DOM class name. Should be overriden by sub-components. + * + * @return {string} + * The DOM class name for this object. + * + * @abstract + */ + + + _proto.buildCSSClass = function buildCSSClass() { + // Child classes can include a function that does: + // return 'CLASS NAME' + this._super(); + return ''; + }; + /** + * Bind a listener to the component's ready state. + * Different from event listeners in that if the ready event has already happened + * it will trigger the function immediately. + * + * @return {Component} + * Returns itself; method can be chained. + */ + + + _proto.ready = function ready(fn, sync) { + if (sync === void 0) { + sync = false; + } + + if (!fn) { + return; + } + + if (!this.isReady_) { + this.readyQueue_ = this.readyQueue_ || []; + this.readyQueue_.push(fn); + return; + } + + if (sync) { + fn.call(this); + } else { + // Call the function asynchronously by default for consistency + this.setTimeout(fn, 1); + } + }; + /** + * Trigger all the ready listeners for this `Component`. + * + * @fires Component#ready + */ + + + _proto.triggerReady = function triggerReady() { + this.isReady_ = true; // Ensure ready is triggered asynchronously + + this.setTimeout(function () { + var readyQueue = this.readyQueue_; // Reset Ready Queue + + this.readyQueue_ = []; + + if (readyQueue && readyQueue.length > 0) { + readyQueue.forEach(function (fn) { + fn.call(this); + }, this); + } // Allow for using event listeners also + + /** + * Triggered when a `Component` is ready. + * + * @event Component#ready + * @type {EventTarget~Event} + */ + + + this.trigger('ready'); + }, 1); + }; + /** + * Find a single DOM element matching a `selector`. This can be within the `Component`s + * `contentEl()` or another custom context. + * + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelector`. + * + * @param {Element|string} [context=this.contentEl()] + * A DOM element within which to query. Can also be a selector string in + * which case the first matching element will get used as context. If + * missing `this.contentEl()` gets used. If `this.contentEl()` returns + * nothing it falls back to `document`. + * + * @return {Element|null} + * the dom element that was found, or null + * + * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) + */ + + + _proto.$ = function $$$1(selector, context) { + return $(selector, context || this.contentEl()); + }; + /** + * Finds all DOM element matching a `selector`. This can be within the `Component`s + * `contentEl()` or another custom context. + * + * @param {string} selector + * A valid CSS selector, which will be passed to `querySelectorAll`. + * + * @param {Element|string} [context=this.contentEl()] + * A DOM element within which to query. Can also be a selector string in + * which case the first matching element will get used as context. If + * missing `this.contentEl()` gets used. If `this.contentEl()` returns + * nothing it falls back to `document`. + * + * @return {NodeList} + * a list of dom elements that were found + * + * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors) + */ + + + _proto.$$ = function $$$$1(selector, context) { + return $$(selector, context || this.contentEl()); + }; + /** + * Check if a component's element has a CSS class name. + * + * @param {string} classToCheck + * CSS class name to check. + * + * @return {boolean} + * - True if the `Component` has the class. + * - False if the `Component` does not have the class` + */ + + + _proto.hasClass = function hasClass$$1(classToCheck) { + return hasClass(this.el_, classToCheck); + }; + /** + * Add a CSS class name to the `Component`s element. + * + * @param {string} classToAdd + * CSS class name to add + */ + + + _proto.addClass = function addClass$$1(classToAdd) { + addClass(this.el_, classToAdd); + }; + /** + * Remove a CSS class name from the `Component`s element. + * + * @param {string} classToRemove + * CSS class name to remove + */ + + + _proto.removeClass = function removeClass$$1(classToRemove) { + removeClass(this.el_, classToRemove); + }; + /** + * Add or remove a CSS class name from the component's element. + * - `classToToggle` gets added when {@link Component#hasClass} would return false. + * - `classToToggle` gets removed when {@link Component#hasClass} would return true. + * + * @param {string} classToToggle + * The class to add or remove based on (@link Component#hasClass} + * + * @param {boolean|Dom~predicate} [predicate] + * An {@link Dom~predicate} function or a boolean + */ + + + _proto.toggleClass = function toggleClass$$1(classToToggle, predicate) { + toggleClass(this.el_, classToToggle, predicate); + }; + /** + * Show the `Component`s element if it is hidden by removing the + * 'vjs-hidden' class name from it. + */ + + + _proto.show = function show() { + this.removeClass('vjs-hidden'); + }; + /** + * Hide the `Component`s element if it is currently showing by adding the + * 'vjs-hidden` class name to it. + */ + + + _proto.hide = function hide() { + this.addClass('vjs-hidden'); + }; + /** + * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing' + * class name to it. Used during fadeIn/fadeOut. + * + * @private + */ + + + _proto.lockShowing = function lockShowing() { + this.addClass('vjs-lock-showing'); + }; + /** + * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing' + * class name from it. Used during fadeIn/fadeOut. + * + * @private + */ + + + _proto.unlockShowing = function unlockShowing() { + this.removeClass('vjs-lock-showing'); + }; + /** + * Get the value of an attribute on the `Component`s element. + * + * @param {string} attribute + * Name of the attribute to get the value from. + * + * @return {string|null} + * - The value of the attribute that was asked for. + * - Can be an empty string on some browsers if the attribute does not exist + * or has no value + * - Most browsers will return null if the attibute does not exist or has + * no value. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute} + */ + + + _proto.getAttribute = function getAttribute$$1(attribute) { + return getAttribute(this.el_, attribute); + }; + /** + * Set the value of an attribute on the `Component`'s element + * + * @param {string} attribute + * Name of the attribute to set. + * + * @param {string} value + * Value to set the attribute to. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute} + */ + + + _proto.setAttribute = function setAttribute$$1(attribute, value) { + setAttribute(this.el_, attribute, value); + }; + /** + * Remove an attribute from the `Component`s element. + * + * @param {string} attribute + * Name of the attribute to remove. + * + * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute} + */ + + + _proto.removeAttribute = function removeAttribute$$1(attribute) { + removeAttribute(this.el_, attribute); + }; + /** + * Get or set the width of the component based upon the CSS styles. + * See {@link Component#dimension} for more detailed information. + * + * @param {number|string} [num] + * The width that you want to set postfixed with '%', 'px' or nothing. + * + * @param {boolean} [skipListeners] + * Skip the componentresize event trigger + * + * @return {number|string} + * The width when getting, zero if there is no width. Can be a string + * postpixed with '%' or 'px'. + */ + + + _proto.width = function width(num, skipListeners) { + return this.dimension('width', num, skipListeners); + }; + /** + * Get or set the height of the component based upon the CSS styles. + * See {@link Component#dimension} for more detailed information. + * + * @param {number|string} [num] + * The height that you want to set postfixed with '%', 'px' or nothing. + * + * @param {boolean} [skipListeners] + * Skip the componentresize event trigger + * + * @return {number|string} + * The width when getting, zero if there is no width. Can be a string + * postpixed with '%' or 'px'. + */ + + + _proto.height = function height(num, skipListeners) { + return this.dimension('height', num, skipListeners); + }; + /** + * Set both the width and height of the `Component` element at the same time. + * + * @param {number|string} width + * Width to set the `Component`s element to. + * + * @param {number|string} height + * Height to set the `Component`s element to. + */ + + + _proto.dimensions = function dimensions(width, height) { + // Skip componentresize listeners on width for optimization + this.width(width, true); + this.height(height); + }; + /** + * Get or set width or height of the `Component` element. This is the shared code + * for the {@link Component#width} and {@link Component#height}. + * + * Things to know: + * - If the width or height in an number this will return the number postfixed with 'px'. + * - If the width/height is a percent this will return the percent postfixed with '%' + * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function + * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`. + * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/} + * for more information + * - If you want the computed style of the component, use {@link Component#currentWidth} + * and {@link {Component#currentHeight} + * + * @fires Component#componentresize + * + * @param {string} widthOrHeight + 8 'width' or 'height' + * + * @param {number|string} [num] + 8 New dimension + * + * @param {boolean} [skipListeners] + * Skip componentresize event trigger + * + * @return {number} + * The dimension when getting or 0 if unset + */ + + + _proto.dimension = function dimension(widthOrHeight, num, skipListeners) { + if (num !== undefined) { + // Set to zero if null or literally NaN (NaN !== NaN) + if (num === null || num !== num) { + num = 0; + } // Check if using css width/height (% or px) and adjust + + + if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) { + this.el_.style[widthOrHeight] = num; + } else if (num === 'auto') { + this.el_.style[widthOrHeight] = ''; + } else { + this.el_.style[widthOrHeight] = num + 'px'; + } // skipListeners allows us to avoid triggering the resize event when setting both width and height + + + if (!skipListeners) { + /** + * Triggered when a component is resized. + * + * @event Component#componentresize + * @type {EventTarget~Event} + */ + this.trigger('componentresize'); + } + + return; + } // Not setting a value, so getting it + // Make sure element exists + + + if (!this.el_) { + return 0; + } // Get dimension value from style + + + var val = this.el_.style[widthOrHeight]; + var pxIndex = val.indexOf('px'); + + if (pxIndex !== -1) { + // Return the pixel value with no 'px' + return parseInt(val.slice(0, pxIndex), 10); + } // No px so using % or no style was set, so falling back to offsetWidth/height + // If component has display:none, offset will return 0 + // TODO: handle display:none and no dimension style using px + + + return parseInt(this.el_['offset' + toTitleCase(widthOrHeight)], 10); + }; + /** + * Get the computed width or the height of the component's element. + * + * Uses `window.getComputedStyle`. + * + * @param {string} widthOrHeight + * A string containing 'width' or 'height'. Whichever one you want to get. + * + * @return {number} + * The dimension that gets asked for or 0 if nothing was set + * for that dimension. + */ + + + _proto.currentDimension = function currentDimension(widthOrHeight) { + var computedWidthOrHeight = 0; + + if (widthOrHeight !== 'width' && widthOrHeight !== 'height') { + throw new Error('currentDimension only accepts width or height value'); + } + + if (typeof window$1.getComputedStyle === 'function') { + var computedStyle = window$1.getComputedStyle(this.el_); + computedWidthOrHeight = computedStyle.getPropertyValue(widthOrHeight) || computedStyle[widthOrHeight]; + } // remove 'px' from variable and parse as integer + + + computedWidthOrHeight = parseFloat(computedWidthOrHeight); // if the computed value is still 0, it's possible that the browser is lying + // and we want to check the offset values. + // This code also runs wherever getComputedStyle doesn't exist. + + if (computedWidthOrHeight === 0) { + var rule = "offset" + toTitleCase(widthOrHeight); + computedWidthOrHeight = this.el_[rule]; + } + + return computedWidthOrHeight; + }; + /** + * An object that contains width and height values of the `Component`s + * computed style. Uses `window.getComputedStyle`. + * + * @typedef {Object} Component~DimensionObject + * + * @property {number} width + * The width of the `Component`s computed style. + * + * @property {number} height + * The height of the `Component`s computed style. + */ + + /** + * Get an object that contains computed width and height values of the + * component's element. + * + * Uses `window.getComputedStyle`. + * + * @return {Component~DimensionObject} + * The computed dimensions of the component's element. + */ + + + _proto.currentDimensions = function currentDimensions() { + return { + width: this.currentDimension('width'), + height: this.currentDimension('height') + }; + }; + /** + * Get the computed width of the component's element. + * + * Uses `window.getComputedStyle`. + * + * @return {number} + * The computed width of the component's element. + */ + + + _proto.currentWidth = function currentWidth() { + return this.currentDimension('width'); + }; + /** + * Get the computed height of the component's element. + * + * Uses `window.getComputedStyle`. + * + * @return {number} + * The computed height of the component's element. + */ + + + _proto.currentHeight = function currentHeight() { + return this.currentDimension('height'); + }; + /** + * Set the focus to this component + */ + + + _proto.focus = function focus() { + this.el_.focus(); + }; + /** + * Remove the focus from this component + */ + + + _proto.blur = function blur() { + this.el_.blur(); + }; + /** + * Emit a 'tap' events when touch event support gets detected. This gets used to + * support toggling the controls through a tap on the video. They get enabled + * because every sub-component would have extra overhead otherwise. + * + * @private + * @fires Component#tap + * @listens Component#touchstart + * @listens Component#touchmove + * @listens Component#touchleave + * @listens Component#touchcancel + * @listens Component#touchend + */ + + + _proto.emitTapEvents = function emitTapEvents() { + // Track the start time so we can determine how long the touch lasted + var touchStart = 0; + var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap + // Other popular libs use anywhere from 2 (hammer.js) to 15, + // so 10 seems like a nice, round number. + + var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap + + var touchTimeThreshold = 200; + var couldBeTap; + this.on('touchstart', function (event) { + // If more than one finger, don't consider treating this as a click + if (event.touches.length === 1) { + // Copy pageX/pageY from the object + firstTouch = { + pageX: event.touches[0].pageX, + pageY: event.touches[0].pageY + }; // Record start time so we can detect a tap vs. "touch and hold" + + touchStart = new Date().getTime(); // Reset couldBeTap tracking + + couldBeTap = true; + } + }); + this.on('touchmove', function (event) { + // If more than one finger, don't consider treating this as a click + if (event.touches.length > 1) { + couldBeTap = false; + } else if (firstTouch) { + // Some devices will throw touchmoves for all but the slightest of taps. + // So, if we moved only a small distance, this could still be a tap + var xdiff = event.touches[0].pageX - firstTouch.pageX; + var ydiff = event.touches[0].pageY - firstTouch.pageY; + var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff); + + if (touchDistance > tapMovementThreshold) { + couldBeTap = false; + } + } + }); + + var noTap = function noTap() { + couldBeTap = false; + }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s + + + this.on('touchleave', noTap); + this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate + // event + + this.on('touchend', function (event) { + firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen + + if (couldBeTap === true) { + // Measure how long the touch lasted + var touchTime = new Date().getTime() - touchStart; // Make sure the touch was less than the threshold to be considered a tap + + if (touchTime < touchTimeThreshold) { + // Don't let browser turn this into a click + event.preventDefault(); + /** + * Triggered when a `Component` is tapped. + * + * @event Component#tap + * @type {EventTarget~Event} + */ + + this.trigger('tap'); // It may be good to copy the touchend event object and change the + // type to tap, if the other event properties aren't exact after + // Events.fixEvent runs (e.g. event.target) + } + } + }); + }; + /** + * This function reports user activity whenever touch events happen. This can get + * turned off by any sub-components that wants touch events to act another way. + * + * Report user touch activity when touch events occur. User activity gets used to + * determine when controls should show/hide. It is simple when it comes to mouse + * events, because any mouse event should show the controls. So we capture mouse + * events that bubble up to the player and report activity when that happens. + * With touch events it isn't as easy as `touchstart` and `touchend` toggle player + * controls. So touch events can't help us at the player level either. + * + * User activity gets checked asynchronously. So what could happen is a tap event + * on the video turns the controls off. Then the `touchend` event bubbles up to + * the player. Which, if it reported user activity, would turn the controls right + * back on. We also don't want to completely block touch events from bubbling up. + * Furthermore a `touchmove` event and anything other than a tap, should not turn + * controls back on. + * + * @listens Component#touchstart + * @listens Component#touchmove + * @listens Component#touchend + * @listens Component#touchcancel + */ + + + _proto.enableTouchActivity = function enableTouchActivity() { + // Don't continue if the root player doesn't support reporting user activity + if (!this.player() || !this.player().reportUserActivity) { + return; + } // listener for reporting that the user is active + + + var report = bind(this.player(), this.player().reportUserActivity); + var touchHolding; + this.on('touchstart', function () { + report(); // For as long as the they are touching the device or have their mouse down, + // we consider them active even if they're not moving their finger or mouse. + // So we want to continue to update that they are active + + this.clearInterval(touchHolding); // report at the same interval as activityCheck + + touchHolding = this.setInterval(report, 250); + }); + + var touchEnd = function touchEnd(event) { + report(); // stop the interval that maintains activity if the touch is holding + + this.clearInterval(touchHolding); + }; + + this.on('touchmove', report); + this.on('touchend', touchEnd); + this.on('touchcancel', touchEnd); + }; + /** + * A callback that has no parameters and is bound into `Component`s context. + * + * @callback Component~GenericCallback + * @this Component + */ + + /** + * Creates a function that runs after an `x` millisecond timeout. This function is a + * wrapper around `window.setTimeout`. There are a few reasons to use this one + * instead though: + * 1. It gets cleared via {@link Component#clearTimeout} when + * {@link Component#dispose} gets called. + * 2. The function callback will gets turned into a {@link Component~GenericCallback} + * + * > Note: You can't use `window.clearTimeout` on the id returned by this function. This + * will cause its dispose listener not to get cleaned up! Please use + * {@link Component#clearTimeout} or {@link Component#dispose} instead. + * + * @param {Component~GenericCallback} fn + * The function that will be run after `timeout`. + * + * @param {number} timeout + * Timeout in milliseconds to delay before executing the specified function. + * + * @return {number} + * Returns a timeout ID that gets used to identify the timeout. It can also + * get used in {@link Component#clearTimeout} to clear the timeout that + * was set. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout} + */ + + + _proto.setTimeout = function setTimeout(fn, timeout) { + var _this2 = this; + + // declare as variables so they are properly available in timeout function + // eslint-disable-next-line + var timeoutId, disposeFn; + fn = bind(this, fn); + timeoutId = window$1.setTimeout(function () { + _this2.off('dispose', disposeFn); + + fn(); + }, timeout); + + disposeFn = function disposeFn() { + return _this2.clearTimeout(timeoutId); + }; + + disposeFn.guid = "vjs-timeout-" + timeoutId; + this.on('dispose', disposeFn); + return timeoutId; + }; + /** + * Clears a timeout that gets created via `window.setTimeout` or + * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout} + * use this function instead of `window.clearTimout`. If you don't your dispose + * listener will not get cleaned up until {@link Component#dispose}! + * + * @param {number} timeoutId + * The id of the timeout to clear. The return value of + * {@link Component#setTimeout} or `window.setTimeout`. + * + * @return {number} + * Returns the timeout id that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout} + */ + + + _proto.clearTimeout = function clearTimeout(timeoutId) { + window$1.clearTimeout(timeoutId); + + var disposeFn = function disposeFn() {}; + + disposeFn.guid = "vjs-timeout-" + timeoutId; + this.off('dispose', disposeFn); + return timeoutId; + }; + /** + * Creates a function that gets run every `x` milliseconds. This function is a wrapper + * around `window.setInterval`. There are a few reasons to use this one instead though. + * 1. It gets cleared via {@link Component#clearInterval} when + * {@link Component#dispose} gets called. + * 2. The function callback will be a {@link Component~GenericCallback} + * + * @param {Component~GenericCallback} fn + * The function to run every `x` seconds. + * + * @param {number} interval + * Execute the specified function every `x` milliseconds. + * + * @return {number} + * Returns an id that can be used to identify the interval. It can also be be used in + * {@link Component#clearInterval} to clear the interval. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval} + */ + + + _proto.setInterval = function setInterval(fn, interval) { + var _this3 = this; + + fn = bind(this, fn); + var intervalId = window$1.setInterval(fn, interval); + + var disposeFn = function disposeFn() { + return _this3.clearInterval(intervalId); + }; + + disposeFn.guid = "vjs-interval-" + intervalId; + this.on('dispose', disposeFn); + return intervalId; + }; + /** + * Clears an interval that gets created via `window.setInterval` or + * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval} + * use this function instead of `window.clearInterval`. If you don't your dispose + * listener will not get cleaned up until {@link Component#dispose}! + * + * @param {number} intervalId + * The id of the interval to clear. The return value of + * {@link Component#setInterval} or `window.setInterval`. + * + * @return {number} + * Returns the interval id that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval} + */ + + + _proto.clearInterval = function clearInterval(intervalId) { + window$1.clearInterval(intervalId); + + var disposeFn = function disposeFn() {}; + + disposeFn.guid = "vjs-interval-" + intervalId; + this.off('dispose', disposeFn); + return intervalId; + }; + /** + * Queues up a callback to be passed to requestAnimationFrame (rAF), but + * with a few extra bonuses: + * + * - Supports browsers that do not support rAF by falling back to + * {@link Component#setTimeout}. + * + * - The callback is turned into a {@link Component~GenericCallback} (i.e. + * bound to the component). + * + * - Automatic cancellation of the rAF callback is handled if the component + * is disposed before it is called. + * + * @param {Component~GenericCallback} fn + * A function that will be bound to this component and executed just + * before the browser's next repaint. + * + * @return {number} + * Returns an rAF ID that gets used to identify the timeout. It can + * also be used in {@link Component#cancelAnimationFrame} to cancel + * the animation frame callback. + * + * @listens Component#dispose + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame} + */ + + + _proto.requestAnimationFrame = function requestAnimationFrame(fn) { + var _this4 = this; + + // declare as variables so they are properly available in rAF function + // eslint-disable-next-line + var id, disposeFn; + + if (this.supportsRaf_) { + fn = bind(this, fn); + id = window$1.requestAnimationFrame(function () { + _this4.off('dispose', disposeFn); + + fn(); + }); + + disposeFn = function disposeFn() { + return _this4.cancelAnimationFrame(id); + }; + + disposeFn.guid = "vjs-raf-" + id; + this.on('dispose', disposeFn); + return id; + } // Fall back to using a timer. + + + return this.setTimeout(fn, 1000 / 60); + }; + /** + * Cancels a queued callback passed to {@link Component#requestAnimationFrame} + * (rAF). + * + * If you queue an rAF callback via {@link Component#requestAnimationFrame}, + * use this function instead of `window.cancelAnimationFrame`. If you don't, + * your dispose listener will not get cleaned up until {@link Component#dispose}! + * + * @param {number} id + * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}. + * + * @return {number} + * Returns the rAF ID that was cleared. + * + * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame} + */ + + + _proto.cancelAnimationFrame = function cancelAnimationFrame(id) { + if (this.supportsRaf_) { + window$1.cancelAnimationFrame(id); + + var disposeFn = function disposeFn() {}; + + disposeFn.guid = "vjs-raf-" + id; + this.off('dispose', disposeFn); + return id; + } // Fall back to using a timer. + + + return this.clearTimeout(id); + }; + /** + * Register a `Component` with `videojs` given the name and the component. + * + * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s + * should be registered using {@link Tech.registerTech} or + * {@link videojs:videojs.registerTech}. + * + * > NOTE: This function can also be seen on videojs as + * {@link videojs:videojs.registerComponent}. + * + * @param {string} name + * The name of the `Component` to register. + * + * @param {Component} ComponentToRegister + * The `Component` class to register. + * + * @return {Component} + * The `Component` that was registered. + */ + + + Component.registerComponent = function registerComponent(name, ComponentToRegister) { + if (typeof name !== 'string' || !name) { + throw new Error("Illegal component name, \"" + name + "\"; must be a non-empty string."); + } + + var Tech = Component.getComponent('Tech'); // We need to make sure this check is only done if Tech has been registered. + + var isTech = Tech && Tech.isTech(ComponentToRegister); + var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype); + + if (isTech || !isComp) { + var reason; + + if (isTech) { + reason = 'techs must be registered using Tech.registerTech()'; + } else { + reason = 'must be a Component subclass'; + } + + throw new Error("Illegal component, \"" + name + "\"; " + reason + "."); + } + + name = toTitleCase(name); + + if (!Component.components_) { + Component.components_ = {}; + } + + var Player = Component.getComponent('Player'); + + if (name === 'Player' && Player && Player.players) { + var players = Player.players; + var playerNames = Object.keys(players); // If we have players that were disposed, then their name will still be + // in Players.players. So, we must loop through and verify that the value + // for each item is not null. This allows registration of the Player component + // after all players have been disposed or before any were created. + + if (players && playerNames.length > 0 && playerNames.map(function (pname) { + return players[pname]; + }).every(Boolean)) { + throw new Error('Can not register Player component after player has been created.'); + } + } + + Component.components_[name] = ComponentToRegister; + return ComponentToRegister; + }; + /** + * Get a `Component` based on the name it was registered with. + * + * @param {string} name + * The Name of the component to get. + * + * @return {Component} + * The `Component` that got registered under the given name. + * + * @deprecated In `videojs` 6 this will not return `Component`s that were not + * registered using {@link Component.registerComponent}. Currently we + * check the global `videojs` object for a `Component` name and + * return that if it exists. + */ + + + Component.getComponent = function getComponent(name) { + if (!name) { + return; + } + + name = toTitleCase(name); + + if (Component.components_ && Component.components_[name]) { + return Component.components_[name]; + } + }; + + return Component; +}(); +/** + * Whether or not this component supports `requestAnimationFrame`. + * + * This is exposed primarily for testing purposes. + * + * @private + * @type {Boolean} + */ + + +Component.prototype.supportsRaf_ = typeof window$1.requestAnimationFrame === 'function' && typeof window$1.cancelAnimationFrame === 'function'; +Component.registerComponent('Component', Component); + +/** + * @file browser.js + * @module browser + */ +var USER_AGENT = window$1.navigator && window$1.navigator.userAgent || ''; +var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT); +var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null; +/** + * Whether or not this device is an iPad. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_IPAD = /iPad/i.test(USER_AGENT); +/** + * Whether or not this device is an iPhone. + * + * @static + * @const + * @type {Boolean} + */ +// The Facebook app's UIWebView identifies as both an iPhone and iPad, so +// to identify iPhones, we need to exclude iPads. +// http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/ + +var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD; +/** + * Whether or not this device is an iPod. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_IPOD = /iPod/i.test(USER_AGENT); +/** + * Whether or not this is an iOS device. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD; +/** + * The detected iOS version - or `null`. + * + * @static + * @const + * @type {string|null} + */ + +var IOS_VERSION = function () { + var match = USER_AGENT.match(/OS (\d+)_/i); + + if (match && match[1]) { + return match[1]; + } + + return null; +}(); +/** + * Whether or not this is an Android device. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_ANDROID = /Android/i.test(USER_AGENT); +/** + * The detected Android version - or `null`. + * + * @static + * @const + * @type {number|string|null} + */ + +var ANDROID_VERSION = function () { + // This matches Android Major.Minor.Patch versions + // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned + var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i); + + if (!match) { + return null; + } + + var major = match[1] && parseFloat(match[1]); + var minor = match[2] && parseFloat(match[2]); + + if (major && minor) { + return parseFloat(match[1] + '.' + match[2]); + } else if (major) { + return major; + } + + return null; +}(); +/** + * Whether or not this is a native Android browser. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537; +/** + * Whether or not this is Mozilla Firefox. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_FIREFOX = /Firefox/i.test(USER_AGENT); +/** + * Whether or not this is Microsoft Edge. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_EDGE = /Edge/i.test(USER_AGENT); +/** + * Whether or not this is Google Chrome. + * + * This will also be `true` for Chrome on iOS, which will have different support + * as it is actually Safari under the hood. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT)); +/** + * The detected Google Chrome version - or `null`. + * + * @static + * @const + * @type {number|null} + */ + +var CHROME_VERSION = function () { + var match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/); + + if (match && match[2]) { + return parseFloat(match[2]); + } + + return null; +}(); +/** + * The detected Internet Explorer version - or `null`. + * + * @static + * @const + * @type {number|null} + */ + +var IE_VERSION = function () { + var result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT); + var version = result && parseFloat(result[1]); + + if (!version && /Trident\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) { + // IE 11 has a different user agent string than other IE versions + version = 11.0; + } + + return version; +}(); +/** + * Whether or not this is desktop Safari. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE; +/** + * Whether or not this is any flavor of Safari - including iOS. + * + * @static + * @const + * @type {Boolean} + */ + +var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME; +/** + * Whether or not this device is touch-enabled. + * + * @static + * @const + * @type {Boolean} + */ + +var TOUCH_ENABLED = isReal() && ('ontouchstart' in window$1 || window$1.navigator.maxTouchPoints || window$1.DocumentTouch && window$1.document instanceof window$1.DocumentTouch); + +var browser = /*#__PURE__*/Object.freeze({ + IS_IPAD: IS_IPAD, + IS_IPHONE: IS_IPHONE, + IS_IPOD: IS_IPOD, + IS_IOS: IS_IOS, + IOS_VERSION: IOS_VERSION, + IS_ANDROID: IS_ANDROID, + ANDROID_VERSION: ANDROID_VERSION, + IS_NATIVE_ANDROID: IS_NATIVE_ANDROID, + IS_FIREFOX: IS_FIREFOX, + IS_EDGE: IS_EDGE, + IS_CHROME: IS_CHROME, + CHROME_VERSION: CHROME_VERSION, + IE_VERSION: IE_VERSION, + IS_SAFARI: IS_SAFARI, + IS_ANY_SAFARI: IS_ANY_SAFARI, + TOUCH_ENABLED: TOUCH_ENABLED +}); + +/** + * @file time-ranges.js + * @module time-ranges + */ + +/** + * Returns the time for the specified index at the start or end + * of a TimeRange object. + * + * @typedef {Function} TimeRangeIndex + * + * @param {number} [index=0] + * The range number to return the time for. + * + * @return {number} + * The time offset at the specified index. + * + * @deprecated The index argument must be provided. + * In the future, leaving it out will throw an error. + */ + +/** + * An object that contains ranges of time. + * + * @typedef {Object} TimeRange + * + * @property {number} length + * The number of time ranges represented by this object. + * + * @property {module:time-ranges~TimeRangeIndex} start + * Returns the time offset at which a specified time range begins. + * + * @property {module:time-ranges~TimeRangeIndex} end + * Returns the time offset at which a specified time range ends. + * + * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges + */ + +/** + * Check if any of the time ranges are over the maximum index. + * + * @private + * @param {string} fnName + * The function name to use for logging + * + * @param {number} index + * The index to check + * + * @param {number} maxIndex + * The maximum possible index + * + * @throws {Error} if the timeRanges provided are over the maxIndex + */ +function rangeCheck(fnName, index, maxIndex) { + if (typeof index !== 'number' || index < 0 || index > maxIndex) { + throw new Error("Failed to execute '" + fnName + "' on 'TimeRanges': The index provided (" + index + ") is non-numeric or out of bounds (0-" + maxIndex + ")."); + } +} +/** + * Get the time for the specified index at the start or end + * of a TimeRange object. + * + * @private + * @param {string} fnName + * The function name to use for logging + * + * @param {string} valueIndex + * The property that should be used to get the time. should be + * 'start' or 'end' + * + * @param {Array} ranges + * An array of time ranges + * + * @param {Array} [rangeIndex=0] + * The index to start the search at + * + * @return {number} + * The time that offset at the specified index. + * + * @deprecated rangeIndex must be set to a value, in the future this will throw an error. + * @throws {Error} if rangeIndex is more than the length of ranges + */ + + +function getRange(fnName, valueIndex, ranges, rangeIndex) { + rangeCheck(fnName, rangeIndex, ranges.length - 1); + return ranges[rangeIndex][valueIndex]; +} +/** + * Create a time range object given ranges of time. + * + * @private + * @param {Array} [ranges] + * An array of time ranges. + */ + + +function createTimeRangesObj(ranges) { + if (ranges === undefined || ranges.length === 0) { + return { + length: 0, + start: function start() { + throw new Error('This TimeRanges object is empty'); + }, + end: function end() { + throw new Error('This TimeRanges object is empty'); + } + }; + } + + return { + length: ranges.length, + start: getRange.bind(null, 'start', 0, ranges), + end: getRange.bind(null, 'end', 1, ranges) + }; +} +/** + * Create a `TimeRange` object which mimics an + * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}. + * + * @param {number|Array[]} start + * The start of a single range (a number) or an array of ranges (an + * array of arrays of two numbers each). + * + * @param {number} end + * The end of a single range. Cannot be used with the array form of + * the `start` argument. + */ + + +function createTimeRanges(start, end) { + if (Array.isArray(start)) { + return createTimeRangesObj(start); + } else if (start === undefined || end === undefined) { + return createTimeRangesObj(); + } + + return createTimeRangesObj([[start, end]]); +} + +/** + * @file buffer.js + * @module buffer + */ +/** + * Compute the percentage of the media that has been buffered. + * + * @param {TimeRange} buffered + * The current `TimeRange` object representing buffered time ranges + * + * @param {number} duration + * Total duration of the media + * + * @return {number} + * Percent buffered of the total duration in decimal form. + */ + +function bufferedPercent(buffered, duration) { + var bufferedDuration = 0; + var start; + var end; + + if (!duration) { + return 0; + } + + if (!buffered || !buffered.length) { + buffered = createTimeRanges(0, 0); + } + + for (var i = 0; i < buffered.length; i++) { + start = buffered.start(i); + end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction + + if (end > duration) { + end = duration; + } + + bufferedDuration += end - start; + } + + return bufferedDuration / duration; +} + +/** + * @file fullscreen-api.js + * @module fullscreen-api + * @private + */ +/** + * Store the browser-specific methods for the fullscreen API. + * + * @type {Object} + * @see [Specification]{@link https://fullscreen.spec.whatwg.org} + * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js} + */ + +var FullscreenApi = {}; // browser API methods + +var apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror'], // WebKit +['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Old WebKit (Safari 5.1) +['webkitRequestFullScreen', 'webkitCancelFullScreen', 'webkitCurrentFullScreenElement', 'webkitCancelFullScreen', 'webkitfullscreenchange', 'webkitfullscreenerror'], // Mozilla +['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror'], // Microsoft +['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError']]; +var specApi = apiMap[0]; +var browserApi; +var prefixedAPI = true; // determine the supported set of functions + +for (var i = 0; i < apiMap.length; i++) { + // check for exitFullscreen function + if (apiMap[i][1] in document) { + browserApi = apiMap[i]; + break; + } +} // map the browser API names to the spec API names + + +if (browserApi) { + for (var _i = 0; _i < browserApi.length; _i++) { + FullscreenApi[specApi[_i]] = browserApi[_i]; + } + + prefixedAPI = browserApi[0] !== specApi[0]; +} + +/** + * @file media-error.js + */ +/** + * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class. + * + * @param {number|string|Object|MediaError} value + * This can be of multiple types: + * - number: should be a standard error code + * - string: an error message (the code will be 0) + * - Object: arbitrary properties + * - `MediaError` (native): used to populate a video.js `MediaError` object + * - `MediaError` (video.js): will return itself if it's already a + * video.js `MediaError` object. + * + * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror} + * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes} + * + * @class MediaError + */ + +function MediaError(value) { + // Allow redundant calls to this constructor to avoid having `instanceof` + // checks peppered around the code. + if (value instanceof MediaError) { + return value; + } + + if (typeof value === 'number') { + this.code = value; + } else if (typeof value === 'string') { + // default code is zero, so this is a custom error + this.message = value; + } else if (isObject(value)) { + // We assign the `code` property manually because native `MediaError` objects + // do not expose it as an own/enumerable property of the object. + if (typeof value.code === 'number') { + this.code = value.code; + } + + assign(this, value); + } + + if (!this.message) { + this.message = MediaError.defaultMessages[this.code] || ''; + } +} +/** + * The error code that refers two one of the defined `MediaError` types + * + * @type {Number} + */ + + +MediaError.prototype.code = 0; +/** + * An optional message that to show with the error. Message is not part of the HTML5 + * video spec but allows for more informative custom errors. + * + * @type {String} + */ + +MediaError.prototype.message = ''; +/** + * An optional status code that can be set by plugins to allow even more detail about + * the error. For example a plugin might provide a specific HTTP status code and an + * error message for that code. Then when the plugin gets that error this class will + * know how to display an error message for it. This allows a custom message to show + * up on the `Player` error overlay. + * + * @type {Array} + */ + +MediaError.prototype.status = null; +/** + * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the + * specification listed under {@link MediaError} for more information. + * + * @enum {array} + * @readonly + * @property {string} 0 - MEDIA_ERR_CUSTOM + * @property {string} 1 - MEDIA_ERR_ABORTED + * @property {string} 2 - MEDIA_ERR_NETWORK + * @property {string} 3 - MEDIA_ERR_DECODE + * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED + * @property {string} 5 - MEDIA_ERR_ENCRYPTED + */ + +MediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED']; +/** + * The default `MediaError` messages based on the {@link MediaError.errorTypes}. + * + * @type {Array} + * @constant + */ + +MediaError.defaultMessages = { + 1: 'You aborted the media playback', + 2: 'A network error caused the media download to fail part-way.', + 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.', + 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.', + 5: 'The media is encrypted and we do not have the keys to decrypt it.' +}; // Add types as properties on MediaError +// e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4; + +for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) { + MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance + + MediaError.prototype[MediaError.errorTypes[errNum]] = errNum; +} // jsdocs for instance/static members added above + +/** + * Returns whether an object is `Promise`-like (i.e. has a `then` method). + * + * @param {Object} value + * An object that may or may not be `Promise`-like. + * + * @return {boolean} + * Whether or not the object is `Promise`-like. + */ +function isPromise(value) { + return value !== undefined && value !== null && typeof value.then === 'function'; +} +/** + * Silence a Promise-like object. + * + * This is useful for avoiding non-harmful, but potentially confusing "uncaught + * play promise" rejection error messages. + * + * @param {Object} value + * An object that may or may not be `Promise`-like. + */ + +function silencePromise(value) { + if (isPromise(value)) { + value.then(null, function (e) {}); + } +} + +/** + * @file text-track-list-converter.js Utilities for capturing text track state and + * re-creating tracks based on a capture. + * + * @module text-track-list-converter + */ + +/** + * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that + * represents the {@link TextTrack}'s state. + * + * @param {TextTrack} track + * The text track to query. + * + * @return {Object} + * A serializable javascript representation of the TextTrack. + * @private + */ +var trackToJson_ = function trackToJson_(track) { + var ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(function (acc, prop, i) { + if (track[prop]) { + acc[prop] = track[prop]; + } + + return acc; + }, { + cues: track.cues && Array.prototype.map.call(track.cues, function (cue) { + return { + startTime: cue.startTime, + endTime: cue.endTime, + text: cue.text, + id: cue.id + }; + }) + }); + return ret; +}; +/** + * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the + * state of all {@link TextTrack}s currently configured. The return array is compatible with + * {@link text-track-list-converter:jsonToTextTracks}. + * + * @param {Tech} tech + * The tech object to query + * + * @return {Array} + * A serializable javascript representation of the {@link Tech}s + * {@link TextTrackList}. + */ + + +var textTracksToJson = function textTracksToJson(tech) { + var trackEls = tech.$$('track'); + var trackObjs = Array.prototype.map.call(trackEls, function (t) { + return t.track; + }); + var tracks = Array.prototype.map.call(trackEls, function (trackEl) { + var json = trackToJson_(trackEl.track); + + if (trackEl.src) { + json.src = trackEl.src; + } + + return json; + }); + return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) { + return trackObjs.indexOf(track) === -1; + }).map(trackToJson_)); +}; +/** + * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript + * object {@link TextTrack} representations. + * + * @param {Array} json + * An array of `TextTrack` representation objects, like those that would be + * produced by `textTracksToJson`. + * + * @param {Tech} tech + * The `Tech` to create the `TextTrack`s on. + */ + + +var jsonToTextTracks = function jsonToTextTracks(json, tech) { + json.forEach(function (track) { + var addedTrack = tech.addRemoteTextTrack(track).track; + + if (!track.src && track.cues) { + track.cues.forEach(function (cue) { + return addedTrack.addCue(cue); + }); + } + }); + return tech.textTracks(); +}; + +var textTrackConverter = { + textTracksToJson: textTracksToJson, + jsonToTextTracks: jsonToTextTracks, + trackToJson_: trackToJson_ +}; + +var MODAL_CLASS_NAME = 'vjs-modal-dialog'; +var ESC = 27; +/** + * The `ModalDialog` displays over the video and its controls, which blocks + * interaction with the player until it is closed. + * + * Modal dialogs include a "Close" button and will close when that button + * is activated - or when ESC is pressed anywhere. + * + * @extends Component + */ + +var ModalDialog = +/*#__PURE__*/ +function (_Component) { + _inheritsLoose(ModalDialog, _Component); + + /** + * Create an instance of this class. + * + * @param {Player} player + * The `Player` that this class should be attached to. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Mixed} [options.content=undefined] + * Provide customized content for this modal. + * + * @param {string} [options.description] + * A text description for the modal, primarily for accessibility. + * + * @param {boolean} [options.fillAlways=false] + * Normally, modals are automatically filled only the first time + * they open. This tells the modal to refresh its content + * every time it opens. + * + * @param {string} [options.label] + * A text label for the modal, primarily for accessibility. + * + * @param {boolean} [options.temporary=true] + * If `true`, the modal can only be opened once; it will be + * disposed as soon as it's closed. + * + * @param {boolean} [options.uncloseable=false] + * If `true`, the user will not be able to close the modal + * through the UI in the normal ways. Programmatic closing is + * still possible. + */ + function ModalDialog(player, options) { + var _this; + + _this = _Component.call(this, player, options) || this; + _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false; + + _this.closeable(!_this.options_.uncloseable); + + _this.content(_this.options_.content); // Make sure the contentEl is defined AFTER any children are initialized + // because we only want the contents of the modal in the contentEl + // (not the UI elements like the close button). + + + _this.contentEl_ = createEl('div', { + className: MODAL_CLASS_NAME + "-content" + }, { + role: 'document' + }); + _this.descEl_ = createEl('p', { + className: MODAL_CLASS_NAME + "-description vjs-control-text", + id: _this.el().getAttribute('aria-describedby') + }); + textContent(_this.descEl_, _this.description()); + + _this.el_.appendChild(_this.descEl_); + + _this.el_.appendChild(_this.contentEl_); + + return _this; + } + /** + * Create the `ModalDialog`'s DOM element + * + * @return {Element} + * The DOM element that gets created. + */ + + + var _proto = ModalDialog.prototype; + + _proto.createEl = function createEl$$1() { + return _Component.prototype.createEl.call(this, 'div', { + className: this.buildCSSClass(), + tabIndex: -1 + }, { + 'aria-describedby': this.id() + "_description", + 'aria-hidden': 'true', + 'aria-label': this.label(), + 'role': 'dialog' + }); + }; + + _proto.dispose = function dispose() { + this.contentEl_ = null; + this.descEl_ = null; + this.previouslyActiveEl_ = null; + + _Component.prototype.dispose.call(this); + }; + /** + * Builds the default DOM `className`. + * + * @return {string} + * The DOM `className` for this object. + */ + + + _proto.buildCSSClass = function buildCSSClass() { + return MODAL_CLASS_NAME + " vjs-hidden " + _Component.prototype.buildCSSClass.call(this); + }; + /** + * Handles `keydown` events on the document, looking for ESC, which closes + * the modal. + * + * @param {EventTarget~Event} e + * The keypress that triggered this event. + * + * @listens keydown + */ + + + _proto.handleKeyPress = function handleKeyPress(e) { + if (e.which === ESC && this.closeable()) { + this.close(); + } + }; + /** + * Returns the label string for this modal. Primarily used for accessibility. + * + * @return {string} + * the localized or raw label of this modal. + */ + + + _proto.label = function label() { + return this.localize(this.options_.label || 'Modal Window'); + }; + /** + * Returns the description string for this modal. Primarily used for + * accessibility. + * + * @return {string} + * The localized or raw description of this modal. + */ + + + _proto.description = function description() { + var desc = this.options_.description || this.localize('This is a modal window.'); // Append a universal closeability message if the modal is closeable. + + if (this.closeable()) { + desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.'); + } + + return desc; + }; + /** + * Opens the modal. + * + * @fires ModalDialog#beforemodalopen + * @fires ModalDialog#modalopen + */ + + + _proto.open = function open() { + if (!this.opened_) { + var player = this.player(); + /** + * Fired just before a `ModalDialog` is opened. + * + * @event ModalDialog#beforemodalopen + * @type {EventTarget~Event} + */ + + this.trigger('beforemodalopen'); + this.opened_ = true; // Fill content if the modal has never opened before and + // never been filled. + + if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) { + this.fill(); + } // If the player was playing, pause it and take note of its previously + // playing state. + + + this.wasPlaying_ = !player.paused(); + + if (this.options_.pauseOnOpen && this.wasPlaying_) { + player.pause(); + } + + if (this.closeable()) { + this.on(this.el_.ownerDocument, 'keydown', bind(this, this.handleKeyPress)); + } // Hide controls and note if they were enabled. + + + this.hadControls_ = player.controls(); + player.controls(false); + this.show(); + this.conditionalFocus_(); + this.el().setAttribute('aria-hidden', 'false'); + /** + * Fired just after a `ModalDialog` is opened. + * + * @event ModalDialog#modalopen + * @type {EventTarget~Event} + */ + + this.trigger('modalopen'); + this.hasBeenOpened_ = true; + } + }; + /** + * If the `ModalDialog` is currently open or closed. + * + * @param {boolean} [value] + * If given, it will open (`true`) or close (`false`) the modal. + * + * @return {boolean} + * the current open state of the modaldialog + */ + + + _proto.opened = function opened(value) { + if (typeof value === 'boolean') { + this[value ? 'open' : 'close'](); + } + + return this.opened_; + }; + /** + * Closes the modal, does nothing if the `ModalDialog` is + * not open. + * + * @fires ModalDialog#beforemodalclose + * @fires ModalDialog#modalclose + */ + + + _proto.close = function close() { + if (!this.opened_) { + return; + } + + var player = this.player(); + /** + * Fired just before a `ModalDialog` is closed. + * + * @event ModalDialog#beforemodalclose + * @type {EventTarget~Event} + */ + + this.trigger('beforemodalclose'); + this.opened_ = false; + + if (this.wasPlaying_ && this.options_.pauseOnOpen) { + player.play(); + } + + if (this.closeable()) { + this.off(this.el_.ownerDocument, 'keydown', bind(this, this.handleKeyPress)); + } + + if (this.hadControls_) { + player.controls(true); + } + + this.hide(); + this.el().setAttribute('aria-hidden', 'true'); + /** + * Fired just after a `ModalDialog` is closed. + * + * @event ModalDialog#modalclose + * @type {EventTarget~Event} + */ + + this.trigger('modalclose'); + this.conditionalBlur_(); + + if (this.options_.temporary) { + this.dispose(); + } + }; + /** + * Check to see if the `ModalDialog` is closeable via the UI. + * + * @param {boolean} [value] + * If given as a boolean, it will set the `closeable` option. + * + * @return {boolean} + * Returns the final value of the closable option. + */ + + + _proto.closeable = function closeable(value) { + if (typeof value === 'boolean') { + var closeable = this.closeable_ = !!value; + var close = this.getChild('closeButton'); // If this is being made closeable and has no close button, add one. + + if (closeable && !close) { + // The close button should be a child of the modal - not its + // content element, so temporarily change the content element. + var temp = this.contentEl_; + this.contentEl_ = this.el_; + close = this.addChild('closeButton', { + controlText: 'Close Modal Dialog' + }); + this.contentEl_ = temp; + this.on(close, 'close', this.close); + } // If this is being made uncloseable and has a close button, remove it. + + + if (!closeable && close) { + this.off(close, 'close', this.close); + this.removeChild(close); + close.dispose(); + } + } + + return this.closeable_; + }; + /** + * Fill the modal's content element with the modal's "content" option. + * The content element will be emptied before this change takes place. + */ + + + _proto.fill = function fill() { + this.fillWith(this.content()); + }; + /** + * Fill the modal's content element with arbitrary content. + * The content element will be emptied before this change takes place. + * + * @fires ModalDialog#beforemodalfill + * @fires ModalDialog#modalfill + * + * @param {Mixed} [content] + * The same rules apply to this as apply to the `content` option. + */ + + + _proto.fillWith = function fillWith(content) { + var contentEl = this.contentEl(); + var parentEl = contentEl.parentNode; + var nextSiblingEl = contentEl.nextSibling; + /** + * Fired just before a `ModalDialog` is filled with content. + * + * @event ModalDialog#beforemodalfill + * @type {EventTarget~Event} + */ + + this.trigger('beforemodalfill'); + this.hasBeenFilled_ = true; // Detach the content element from the DOM before performing + // manipulation to avoid modifying the live DOM multiple times. + + parentEl.removeChild(contentEl); + this.empty(); + insertContent(contentEl, content); + /** + * Fired just after a `ModalDialog` is filled with content. + * + * @event ModalDialog#modalfill + * @type {EventTarget~Event} + */ + + this.trigger('modalfill'); // Re-inject the re-filled content element. + + if (nextSiblingEl) { + parentEl.insertBefore(contentEl, nextSiblingEl); + } else { + parentEl.appendChild(contentEl); + } // make sure that the close button is last in the dialog DOM + + + var closeButton = this.getChild('closeButton'); + + if (closeButton) { + parentEl.appendChild(closeButton.el_); + } + }; + /** + * Empties the content element. This happens anytime the modal is filled. + * + * @fires ModalDialog#beforemodalempty + * @fires ModalDialog#modalempty + */ + + + _proto.empty = function empty() { + /** + * Fired just before a `ModalDialog` is emptied. + * + * @event ModalDialog#beforemodalempty + * @type {EventTarget~Event} + */ + this.trigger('beforemodalempty'); + emptyEl(this.contentEl()); + /** + * Fired just after a `ModalDialog` is emptied. + * + * @event ModalDialog#modalempty + * @type {EventTarget~Event} + */ + + this.trigger('modalempty'); + }; + /** + * Gets or sets the modal content, which gets normalized before being + * rendered into the DOM. + * + * This does not update the DOM or fill the modal, but it is called during + * that process. + * + * @param {Mixed} [value] + * If defined, sets the internal content value to be used on the + * next call(s) to `fill`. This value is normalized before being + * inserted. To "clear" the internal content value, pass `null`. + * + * @return {Mixed} + * The current content of the modal dialog + */ + + + _proto.content = function content(value) { + if (typeof value !== 'undefined') { + this.content_ = value; + } + + return this.content_; + }; + /** + * conditionally focus the modal dialog if focus was previously on the player. + * + * @private + */ + + + _proto.conditionalFocus_ = function conditionalFocus_() { + var activeEl = document.activeElement; + var playerEl = this.player_.el_; + this.previouslyActiveEl_ = null; + + if (playerEl.contains(activeEl) || playerEl === activeEl) { + this.previouslyActiveEl_ = activeEl; + this.focus(); + this.on(document, 'keydown', this.handleKeyDown); + } + }; + /** + * conditionally blur the element and refocus the last focused element + * + * @private + */ + + + _proto.conditionalBlur_ = function conditionalBlur_() { + if (this.previouslyActiveEl_) { + this.previouslyActiveEl_.focus(); + this.previouslyActiveEl_ = null; + } + + this.off(document, 'keydown', this.handleKeyDown); + }; + /** + * Keydown handler. Attached when modal is focused. + * + * @listens keydown + */ + + + _proto.handleKeyDown = function handleKeyDown(event) { + // exit early if it isn't a tab key + if (event.which !== 9) { + return; + } + + var focusableEls = this.focusableEls_(); + var activeEl = this.el_.querySelector(':focus'); + var focusIndex; + + for (var i = 0; i < focusableEls.length; i++) { + if (activeEl === focusableEls[i]) { + focusIndex = i; + break; + } + } + + if (document.activeElement === this.el_) { + focusIndex = 0; + } + + if (event.shiftKey && focusIndex === 0) { + focusableEls[focusableEls.length - 1].focus(); + event.preventDefault(); + } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) { + focusableEls[0].focus(); + event.preventDefault(); + } + }; + /** + * get all focusable elements + * + * @private + */ + + + _proto.focusableEls_ = function focusableEls_() { + var allChildren = this.el_.querySelectorAll('*'); + return Array.prototype.filter.call(allChildren, function (child) { + return (child instanceof window$1.HTMLAnchorElement || child instanceof window$1.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$1.HTMLInputElement || child instanceof window$1.HTMLSelectElement || child instanceof window$1.HTMLTextAreaElement || child instanceof window$1.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$1.HTMLIFrameElement || child instanceof window$1.HTMLObjectElement || child instanceof window$1.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable'); + }); + }; + + return ModalDialog; +}(Component); +/** + * Default options for `ModalDialog` default options. + * + * @type {Object} + * @private + */ + + +ModalDialog.prototype.options_ = { + pauseOnOpen: true, + temporary: true +}; +Component.registerComponent('ModalDialog', ModalDialog); + +/** + * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and + * {@link VideoTrackList} + * + * @extends EventTarget + */ + +var TrackList = +/*#__PURE__*/ +function (_EventTarget) { + _inheritsLoose(TrackList, _EventTarget); + + /** + * Create an instance of this class + * + * @param {Track[]} tracks + * A list of tracks to initialize the list with. + * + * @abstract + */ + function TrackList(tracks) { + var _this; + + if (tracks === void 0) { + tracks = []; + } + + _this = _EventTarget.call(this) || this; + _this.tracks_ = []; + /** + * @memberof TrackList + * @member {number} length + * The current number of `Track`s in the this Trackist. + * @instance + */ + + Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'length', { + get: function get() { + return this.tracks_.length; + } + }); + + for (var i = 0; i < tracks.length; i++) { + _this.addTrack(tracks[i]); + } + + return _this; + } + /** + * Add a {@link Track} to the `TrackList` + * + * @param {Track} track + * The audio, video, or text track to add to the list. + * + * @fires TrackList#addtrack + */ + + + var _proto = TrackList.prototype; + + _proto.addTrack = function addTrack(track) { + var index = this.tracks_.length; + + if (!('' + index in this)) { + Object.defineProperty(this, index, { + get: function get() { + return this.tracks_[index]; + } + }); + } // Do not add duplicate tracks + + + if (this.tracks_.indexOf(track) === -1) { + this.tracks_.push(track); + /** + * Triggered when a track is added to a track list. + * + * @event TrackList#addtrack + * @type {EventTarget~Event} + * @property {Track} track + * A reference to track that was added. + */ + + this.trigger({ + track: track, + type: 'addtrack' + }); + } + }; + /** + * Remove a {@link Track} from the `TrackList` + * + * @param {Track} rtrack + * The audio, video, or text track to remove from the list. + * + * @fires TrackList#removetrack + */ + + + _proto.removeTrack = function removeTrack(rtrack) { + var track; + + for (var i = 0, l = this.length; i < l; i++) { + if (this[i] === rtrack) { + track = this[i]; + + if (track.off) { + track.off(); + } + + this.tracks_.splice(i, 1); + break; + } + } + + if (!track) { + return; + } + /** + * Triggered when a track is removed from track list. + * + * @event TrackList#removetrack + * @type {EventTarget~Event} + * @property {Track} track + * A reference to track that was removed. + */ + + + this.trigger({ + track: track, + type: 'removetrack' + }); + }; + /** + * Get a Track from the TrackList by a tracks id + * + * @param {string} id - the id of the track to get + * @method getTrackById + * @return {Track} + * @private + */ + + + _proto.getTrackById = function getTrackById(id) { + var result = null; + + for (var i = 0, l = this.length; i < l; i++) { + var track = this[i]; + + if (track.id === id) { + result = track; + break; + } + } + + return result; + }; + + return TrackList; +}(EventTarget); +/** + * Triggered when a different track is selected/enabled. + * + * @event TrackList#change + * @type {EventTarget~Event} + */ + +/** + * Events that can be called with on + eventName. See {@link EventHandler}. + * + * @property {Object} TrackList#allowedEvents_ + * @private + */ + + +TrackList.prototype.allowedEvents_ = { + change: 'change', + addtrack: 'addtrack', + removetrack: 'removetrack' +}; // emulate attribute EventHandler support to allow for feature detection + +for (var event in TrackList.prototype.allowedEvents_) { + TrackList.prototype['on' + event] = null; +} + +/** + * Anywhere we call this function we diverge from the spec + * as we only support one enabled audiotrack at a time + * + * @param {AudioTrackList} list + * list to work on + * + * @param {AudioTrack} track + * The track to skip + * + * @private + */ + +var disableOthers = function disableOthers(list, track) { + for (var i = 0; i < list.length; i++) { + if (!Object.keys(list[i]).length || track.id === list[i].id) { + continue; + } // another audio track is enabled, disable it + + + list[i].enabled = false; + } +}; +/** + * The current list of {@link AudioTrack} for a media file. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist} + * @extends TrackList + */ + + +var AudioTrackList = +/*#__PURE__*/ +function (_TrackList) { + _inheritsLoose(AudioTrackList, _TrackList); + + /** + * Create an instance of this class. + * + * @param {AudioTrack[]} [tracks=[]] + * A list of `AudioTrack` to instantiate the list with. + */ + function AudioTrackList(tracks) { + var _this; + + if (tracks === void 0) { + tracks = []; + } + + // make sure only 1 track is enabled + // sorted from last index to first index + for (var i = tracks.length - 1; i >= 0; i--) { + if (tracks[i].enabled) { + disableOthers(tracks, tracks[i]); + break; + } + } + + _this = _TrackList.call(this, tracks) || this; + _this.changing_ = false; + return _this; + } + /** + * Add an {@link AudioTrack} to the `AudioTrackList`. + * + * @param {AudioTrack} track + * The AudioTrack to add to the list + * + * @fires TrackList#addtrack + */ + + + var _proto = AudioTrackList.prototype; + + _proto.addTrack = function addTrack(track) { + var _this2 = this; + + if (track.enabled) { + disableOthers(this, track); + } + + _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this + + + if (!track.addEventListener) { + return; + } + /** + * @listens AudioTrack#enabledchange + * @fires TrackList#change + */ + + + track.addEventListener('enabledchange', function () { + // when we are disabling other tracks (since we don't support + // more than one track at a time) we will set changing_ + // to true so that we don't trigger additional change events + if (_this2.changing_) { + return; + } + + _this2.changing_ = true; + disableOthers(_this2, track); + _this2.changing_ = false; + + _this2.trigger('change'); + }); + }; + + return AudioTrackList; +}(TrackList); + +/** + * Un-select all other {@link VideoTrack}s that are selected. + * + * @param {VideoTrackList} list + * list to work on + * + * @param {VideoTrack} track + * The track to skip + * + * @private + */ + +var disableOthers$1 = function disableOthers(list, track) { + for (var i = 0; i < list.length; i++) { + if (!Object.keys(list[i]).length || track.id === list[i].id) { + continue; + } // another video track is enabled, disable it + + + list[i].selected = false; + } +}; +/** + * The current list of {@link VideoTrack} for a video. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist} + * @extends TrackList + */ + + +var VideoTrackList = +/*#__PURE__*/ +function (_TrackList) { + _inheritsLoose(VideoTrackList, _TrackList); + + /** + * Create an instance of this class. + * + * @param {VideoTrack[]} [tracks=[]] + * A list of `VideoTrack` to instantiate the list with. + */ + function VideoTrackList(tracks) { + var _this; + + if (tracks === void 0) { + tracks = []; + } + + // make sure only 1 track is enabled + // sorted from last index to first index + for (var i = tracks.length - 1; i >= 0; i--) { + if (tracks[i].selected) { + disableOthers$1(tracks, tracks[i]); + break; + } + } + + _this = _TrackList.call(this, tracks) || this; + _this.changing_ = false; + /** + * @member {number} VideoTrackList#selectedIndex + * The current index of the selected {@link VideoTrack`}. + */ + + Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'selectedIndex', { + get: function get() { + for (var _i = 0; _i < this.length; _i++) { + if (this[_i].selected) { + return _i; + } + } + + return -1; + }, + set: function set() {} + }); + return _this; + } + /** + * Add a {@link VideoTrack} to the `VideoTrackList`. + * + * @param {VideoTrack} track + * The VideoTrack to add to the list + * + * @fires TrackList#addtrack + */ + + + var _proto = VideoTrackList.prototype; + + _proto.addTrack = function addTrack(track) { + var _this2 = this; + + if (track.selected) { + disableOthers$1(this, track); + } + + _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this + + + if (!track.addEventListener) { + return; + } + /** + * @listens VideoTrack#selectedchange + * @fires TrackList#change + */ + + + track.addEventListener('selectedchange', function () { + if (_this2.changing_) { + return; + } + + _this2.changing_ = true; + disableOthers$1(_this2, track); + _this2.changing_ = false; + + _this2.trigger('change'); + }); + }; + + return VideoTrackList; +}(TrackList); + +/** + * The current list of {@link TextTrack} for a media file. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist} + * @extends TrackList + */ + +var TextTrackList = +/*#__PURE__*/ +function (_TrackList) { + _inheritsLoose(TextTrackList, _TrackList); + + function TextTrackList() { + return _TrackList.apply(this, arguments) || this; + } + + var _proto = TextTrackList.prototype; + + /** + * Add a {@link TextTrack} to the `TextTrackList` + * + * @param {TextTrack} track + * The text track to add to the list. + * + * @fires TrackList#addtrack + */ + _proto.addTrack = function addTrack(track) { + _TrackList.prototype.addTrack.call(this, track); + /** + * @listens TextTrack#modechange + * @fires TrackList#change + */ + + + track.addEventListener('modechange', bind(this, function () { + this.queueTrigger('change'); + })); + var nonLanguageTextTrackKind = ['metadata', 'chapters']; + + if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) { + track.addEventListener('modechange', bind(this, function () { + this.trigger('selectedlanguagechange'); + })); + } + }; + + return TextTrackList; +}(TrackList); + +/** + * @file html-track-element-list.js + */ + +/** + * The current list of {@link HtmlTrackElement}s. + */ +var HtmlTrackElementList = +/*#__PURE__*/ +function () { + /** + * Create an instance of this class. + * + * @param {HtmlTrackElement[]} [tracks=[]] + * A list of `HtmlTrackElement` to instantiate the list with. + */ + function HtmlTrackElementList(trackElements) { + if (trackElements === void 0) { + trackElements = []; + } + + this.trackElements_ = []; + /** + * @memberof HtmlTrackElementList + * @member {number} length + * The current number of `Track`s in the this Trackist. + * @instance + */ + + Object.defineProperty(this, 'length', { + get: function get() { + return this.trackElements_.length; + } + }); + + for (var i = 0, length = trackElements.length; i < length; i++) { + this.addTrackElement_(trackElements[i]); + } + } + /** + * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList` + * + * @param {HtmlTrackElement} trackElement + * The track element to add to the list. + * + * @private + */ + + + var _proto = HtmlTrackElementList.prototype; + + _proto.addTrackElement_ = function addTrackElement_(trackElement) { + var index = this.trackElements_.length; + + if (!('' + index in this)) { + Object.defineProperty(this, index, { + get: function get() { + return this.trackElements_[index]; + } + }); + } // Do not add duplicate elements + + + if (this.trackElements_.indexOf(trackElement) === -1) { + this.trackElements_.push(trackElement); + } + }; + /** + * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an + * {@link TextTrack}. + * + * @param {TextTrack} track + * The track associated with a track element. + * + * @return {HtmlTrackElement|undefined} + * The track element that was found or undefined. + * + * @private + */ + + + _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) { + var trackElement_; + + for (var i = 0, length = this.trackElements_.length; i < length; i++) { + if (track === this.trackElements_[i].track) { + trackElement_ = this.trackElements_[i]; + break; + } + } + + return trackElement_; + }; + /** + * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList` + * + * @param {HtmlTrackElement} trackElement + * The track element to remove from the list. + * + * @private + */ + + + _proto.removeTrackElement_ = function removeTrackElement_(trackElement) { + for (var i = 0, length = this.trackElements_.length; i < length; i++) { + if (trackElement === this.trackElements_[i]) { + this.trackElements_.splice(i, 1); + break; + } + } + }; + + return HtmlTrackElementList; +}(); + +/** + * @file text-track-cue-list.js + */ + +/** + * @typedef {Object} TextTrackCueList~TextTrackCue + * + * @property {string} id + * The unique id for this text track cue + * + * @property {number} startTime + * The start time for this text track cue + * + * @property {number} endTime + * The end time for this text track cue + * + * @property {boolean} pauseOnExit + * Pause when the end time is reached if true. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue} + */ + +/** + * A List of TextTrackCues. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist} + */ +var TextTrackCueList = +/*#__PURE__*/ +function () { + /** + * Create an instance of this class.. + * + * @param {Array} cues + * A list of cues to be initialized with + */ + function TextTrackCueList(cues) { + TextTrackCueList.prototype.setCues_.call(this, cues); + /** + * @memberof TextTrackCueList + * @member {number} length + * The current number of `TextTrackCue`s in the TextTrackCueList. + * @instance + */ + + Object.defineProperty(this, 'length', { + get: function get() { + return this.length_; + } + }); + } + /** + * A setter for cues in this list. Creates getters + * an an index for the cues. + * + * @param {Array} cues + * An array of cues to set + * + * @private + */ + + + var _proto = TextTrackCueList.prototype; + + _proto.setCues_ = function setCues_(cues) { + var oldLength = this.length || 0; + var i = 0; + var l = cues.length; + this.cues_ = cues; + this.length_ = cues.length; + + var defineProp = function defineProp(index) { + if (!('' + index in this)) { + Object.defineProperty(this, '' + index, { + get: function get() { + return this.cues_[index]; + } + }); + } + }; + + if (oldLength < l) { + i = oldLength; + + for (; i < l; i++) { + defineProp.call(this, i); + } + } + }; + /** + * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id. + * + * @param {string} id + * The id of the cue that should be searched for. + * + * @return {TextTrackCueList~TextTrackCue|null} + * A single cue or null if none was found. + */ + + + _proto.getCueById = function getCueById(id) { + var result = null; + + for (var i = 0, l = this.length; i < l; i++) { + var cue = this[i]; + + if (cue.id === id) { + result = cue; + break; + } + } + + return result; + }; + + return TextTrackCueList; +}(); + +/** + * @file track-kinds.js + */ + +/** + * All possible `VideoTrackKind`s + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind + * @typedef VideoTrack~Kind + * @enum + */ +var VideoTrackKind = { + alternative: 'alternative', + captions: 'captions', + main: 'main', + sign: 'sign', + subtitles: 'subtitles', + commentary: 'commentary' +}; +/** + * All possible `AudioTrackKind`s + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind + * @typedef AudioTrack~Kind + * @enum + */ + +var AudioTrackKind = { + 'alternative': 'alternative', + 'descriptions': 'descriptions', + 'main': 'main', + 'main-desc': 'main-desc', + 'translation': 'translation', + 'commentary': 'commentary' +}; +/** + * All possible `TextTrackKind`s + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind + * @typedef TextTrack~Kind + * @enum + */ + +var TextTrackKind = { + subtitles: 'subtitles', + captions: 'captions', + descriptions: 'descriptions', + chapters: 'chapters', + metadata: 'metadata' +}; +/** + * All possible `TextTrackMode`s + * + * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode + * @typedef TextTrack~Mode + * @enum + */ + +var TextTrackMode = { + disabled: 'disabled', + hidden: 'hidden', + showing: 'showing' +}; + +/** + * A Track class that contains all of the common functionality for {@link AudioTrack}, + * {@link VideoTrack}, and {@link TextTrack}. + * + * > Note: This class should not be used directly + * + * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html} + * @extends EventTarget + * @abstract + */ + +var Track = +/*#__PURE__*/ +function (_EventTarget) { + _inheritsLoose(Track, _EventTarget); + + /** + * Create an instance of this class. + * + * @param {Object} [options={}] + * Object of option names and values + * + * @param {string} [options.kind=''] + * A valid kind for the track type you are creating. + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this AudioTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @abstract + */ + function Track(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + _this = _EventTarget.call(this) || this; + var trackProps = { + id: options.id || 'vjs_track_' + newGUID(), + kind: options.kind || '', + label: options.label || '', + language: options.language || '' + }; + /** + * @memberof Track + * @member {string} id + * The id of this track. Cannot be changed after creation. + * @instance + * + * @readonly + */ + + /** + * @memberof Track + * @member {string} kind + * The kind of track that this is. Cannot be changed after creation. + * @instance + * + * @readonly + */ + + /** + * @memberof Track + * @member {string} label + * The label of this track. Cannot be changed after creation. + * @instance + * + * @readonly + */ + + /** + * @memberof Track + * @member {string} language + * The two letter language code for this track. Cannot be changed after + * creation. + * @instance + * + * @readonly + */ + + var _loop = function _loop(key) { + Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), key, { + get: function get() { + return trackProps[key]; + }, + set: function set() {} + }); + }; + + for (var key in trackProps) { + _loop(key); + } + + return _this; + } + + return Track; +}(EventTarget); + +/** + * @file url.js + * @module url + */ +/** + * @typedef {Object} url:URLObject + * + * @property {string} protocol + * The protocol of the url that was parsed. + * + * @property {string} hostname + * The hostname of the url that was parsed. + * + * @property {string} port + * The port of the url that was parsed. + * + * @property {string} pathname + * The pathname of the url that was parsed. + * + * @property {string} search + * The search query of the url that was parsed. + * + * @property {string} hash + * The hash of the url that was parsed. + * + * @property {string} host + * The host of the url that was parsed. + */ + +/** + * Resolve and parse the elements of a URL. + * + * @function + * @param {String} url + * The url to parse + * + * @return {url:URLObject} + * An object of url details + */ + +var parseUrl = function parseUrl(url) { + var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL + + var a = document.createElement('a'); + a.href = url; // IE8 (and 9?) Fix + // ie8 doesn't parse the URL correctly until the anchor is actually + // added to the body, and an innerHTML is needed to trigger the parsing + + var addToBody = a.host === '' && a.protocol !== 'file:'; + var div; + + if (addToBody) { + div = document.createElement('div'); + div.innerHTML = ""; + a = div.firstChild; // prevent the div from affecting layout + + div.setAttribute('style', 'display:none; position:absolute;'); + document.body.appendChild(div); + } // Copy the specific URL properties to a new object + // This is also needed for IE8 because the anchor loses its + // properties when it's removed from the dom + + + var details = {}; + + for (var i = 0; i < props.length; i++) { + details[props[i]] = a[props[i]]; + } // IE9 adds the port to the host property unlike everyone else. If + // a port identifier is added for standard ports, strip it. + + + if (details.protocol === 'http:') { + details.host = details.host.replace(/:80$/, ''); + } + + if (details.protocol === 'https:') { + details.host = details.host.replace(/:443$/, ''); + } + + if (!details.protocol) { + details.protocol = window$1.location.protocol; + } + + if (addToBody) { + document.body.removeChild(div); + } + + return details; +}; +/** + * Get absolute version of relative URL. Used to tell Flash the correct URL. + * + * @function + * @param {string} url + * URL to make absolute + * + * @return {string} + * Absolute URL + * + * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue + */ + +var getAbsoluteURL = function getAbsoluteURL(url) { + // Check if absolute URL + if (!url.match(/^https?:\/\//)) { + // Convert to absolute URL. Flash hosted off-site needs an absolute URL. + var div = document.createElement('div'); + div.innerHTML = "x"; + url = div.firstChild.href; + } + + return url; +}; +/** + * Returns the extension of the passed file name. It will return an empty string + * if passed an invalid path. + * + * @function + * @param {string} path + * The fileName path like '/path/to/file.mp4' + * + * @return {string} + * The extension in lower case or an empty string if no + * extension could be found. + */ + +var getFileExtension = function getFileExtension(path) { + if (typeof path === 'string') { + var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i; + var pathParts = splitPathRe.exec(path); + + if (pathParts) { + return pathParts.pop().toLowerCase(); + } + } + + return ''; +}; +/** + * Returns whether the url passed is a cross domain request or not. + * + * @function + * @param {string} url + * The url to check. + * + * @return {boolean} + * Whether it is a cross domain request or not. + */ + +var isCrossOrigin = function isCrossOrigin(url) { + var winLoc = window$1.location; + var urlInfo = parseUrl(url); // IE8 protocol relative urls will return ':' for protocol + + var srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol; // Check if url is for another domain/origin + // IE8 doesn't know location.origin, so we won't rely on it here + + var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host; + return crossOrigin; +}; + +var Url = /*#__PURE__*/Object.freeze({ + parseUrl: parseUrl, + getAbsoluteURL: getAbsoluteURL, + getFileExtension: getFileExtension, + isCrossOrigin: isCrossOrigin +}); + +/** + * Takes a webvtt file contents and parses it into cues + * + * @param {string} srcContent + * webVTT file contents + * + * @param {TextTrack} track + * TextTrack to add cues to. Cues come from the srcContent. + * + * @private + */ + +var parseCues = function parseCues(srcContent, track) { + var parser = new window$1.WebVTT.Parser(window$1, window$1.vttjs, window$1.WebVTT.StringDecoder()); + var errors = []; + + parser.oncue = function (cue) { + track.addCue(cue); + }; + + parser.onparsingerror = function (error) { + errors.push(error); + }; + + parser.onflush = function () { + track.trigger({ + type: 'loadeddata', + target: track + }); + }; + + parser.parse(srcContent); + + if (errors.length > 0) { + if (window$1.console && window$1.console.groupCollapsed) { + window$1.console.groupCollapsed("Text Track parsing errors for " + track.src); + } + + errors.forEach(function (error) { + return log.error(error); + }); + + if (window$1.console && window$1.console.groupEnd) { + window$1.console.groupEnd(); + } + } + + parser.flush(); +}; +/** + * Load a `TextTrack` from a specified url. + * + * @param {string} src + * Url to load track from. + * + * @param {TextTrack} track + * Track to add cues to. Comes from the content at the end of `url`. + * + * @private + */ + + +var loadTrack = function loadTrack(src, track) { + var opts = { + uri: src + }; + var crossOrigin = isCrossOrigin(src); + + if (crossOrigin) { + opts.cors = crossOrigin; + } + + xhr(opts, bind(this, function (err, response, responseBody) { + if (err) { + return log.error(err, response); + } + + track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading + // NOTE: this is only used for the alt/video.novtt.js build + + if (typeof window$1.WebVTT !== 'function') { + if (track.tech_) { + var loadHandler = function loadHandler() { + return parseCues(responseBody, track); + }; + + track.tech_.on('vttjsloaded', loadHandler); + track.tech_.on('vttjserror', function () { + log.error("vttjs failed to load, stopping trying to process " + track.src); + track.tech_.off('vttjsloaded', loadHandler); + }); + } + } else { + parseCues(responseBody, track); + } + })); +}; +/** + * A representation of a single `TextTrack`. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack} + * @extends Track + */ + + +var TextTrack = +/*#__PURE__*/ +function (_Track) { + _inheritsLoose(TextTrack, _Track); + + /** + * Create an instance of this class. + * + * @param {Object} options={} + * Object of option names and values + * + * @param {Tech} options.tech + * A reference to the tech that owns this TextTrack. + * + * @param {TextTrack~Kind} [options.kind='subtitles'] + * A valid text track kind. + * + * @param {TextTrack~Mode} [options.mode='disabled'] + * A valid text track mode. + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this TextTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @param {string} [options.srclang=''] + * A valid two character language code. An alternative, but deprioritized + * version of `options.language` + * + * @param {string} [options.src] + * A url to TextTrack cues. + * + * @param {boolean} [options.default] + * If this track should default to on or off. + */ + function TextTrack(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + if (!options.tech) { + throw new Error('A tech was not provided.'); + } + + var settings = mergeOptions(options, { + kind: TextTrackKind[options.kind] || 'subtitles', + language: options.language || options.srclang || '' + }); + var mode = TextTrackMode[settings.mode] || 'disabled'; + var default_ = settings.default; + + if (settings.kind === 'metadata' || settings.kind === 'chapters') { + mode = 'hidden'; + } + + _this = _Track.call(this, settings) || this; + _this.tech_ = settings.tech; + _this.cues_ = []; + _this.activeCues_ = []; + var cues = new TextTrackCueList(_this.cues_); + var activeCues = new TextTrackCueList(_this.activeCues_); + var changed = false; + var timeupdateHandler = bind(_assertThisInitialized(_assertThisInitialized(_this)), function () { + // Accessing this.activeCues for the side-effects of updating itself + // due to it's nature as a getter function. Do not remove or cues will + // stop updating! + // Use the setter to prevent deletion from uglify (pure_getters rule) + this.activeCues = this.activeCues; + + if (changed) { + this.trigger('cuechange'); + changed = false; + } + }); + + if (mode !== 'disabled') { + _this.tech_.ready(function () { + _this.tech_.on('timeupdate', timeupdateHandler); + }, true); + } + + Object.defineProperties(_assertThisInitialized(_assertThisInitialized(_this)), { + /** + * @memberof TextTrack + * @member {boolean} default + * If this track was set to be on or off by default. Cannot be changed after + * creation. + * @instance + * + * @readonly + */ + default: { + get: function get() { + return default_; + }, + set: function set() {} + }, + + /** + * @memberof TextTrack + * @member {string} mode + * Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will + * not be set if setting to an invalid mode. + * @instance + * + * @fires TextTrack#modechange + */ + mode: { + get: function get() { + return mode; + }, + set: function set(newMode) { + var _this2 = this; + + if (!TextTrackMode[newMode]) { + return; + } + + mode = newMode; + + if (mode !== 'disabled') { + this.tech_.ready(function () { + _this2.tech_.on('timeupdate', timeupdateHandler); + }, true); + } else { + this.tech_.off('timeupdate', timeupdateHandler); + } + /** + * An event that fires when mode changes on this track. This allows + * the TextTrackList that holds this track to act accordingly. + * + * > Note: This is not part of the spec! + * + * @event TextTrack#modechange + * @type {EventTarget~Event} + */ + + + this.trigger('modechange'); + } + }, + + /** + * @memberof TextTrack + * @member {TextTrackCueList} cues + * The text track cue list for this TextTrack. + * @instance + */ + cues: { + get: function get() { + if (!this.loaded_) { + return null; + } + + return cues; + }, + set: function set() {} + }, + + /** + * @memberof TextTrack + * @member {TextTrackCueList} activeCues + * The list text track cues that are currently active for this TextTrack. + * @instance + */ + activeCues: { + get: function get() { + if (!this.loaded_) { + return null; + } // nothing to do + + + if (this.cues.length === 0) { + return activeCues; + } + + var ct = this.tech_.currentTime(); + var active = []; + + for (var i = 0, l = this.cues.length; i < l; i++) { + var cue = this.cues[i]; + + if (cue.startTime <= ct && cue.endTime >= ct) { + active.push(cue); + } else if (cue.startTime === cue.endTime && cue.startTime <= ct && cue.startTime + 0.5 >= ct) { + active.push(cue); + } + } + + changed = false; + + if (active.length !== this.activeCues_.length) { + changed = true; + } else { + for (var _i = 0; _i < active.length; _i++) { + if (this.activeCues_.indexOf(active[_i]) === -1) { + changed = true; + } + } + } + + this.activeCues_ = active; + activeCues.setCues_(this.activeCues_); + return activeCues; + }, + // /!\ Keep this setter empty (see the timeupdate handler above) + set: function set() {} + } + }); + + if (settings.src) { + _this.src = settings.src; + loadTrack(settings.src, _assertThisInitialized(_assertThisInitialized(_this))); + } else { + _this.loaded_ = true; + } + + return _this; + } + /** + * Add a cue to the internal list of cues. + * + * @param {TextTrack~Cue} cue + * The cue to add to our internal list + */ + + + var _proto = TextTrack.prototype; + + _proto.addCue = function addCue(originalCue) { + var cue = originalCue; + + if (window$1.vttjs && !(originalCue instanceof window$1.vttjs.VTTCue)) { + cue = new window$1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text); + + for (var prop in originalCue) { + if (!(prop in cue)) { + cue[prop] = originalCue[prop]; + } + } // make sure that `id` is copied over + + + cue.id = originalCue.id; + cue.originalCue_ = originalCue; + } + + var tracks = this.tech_.textTracks(); + + for (var i = 0; i < tracks.length; i++) { + if (tracks[i] !== this) { + tracks[i].removeCue(cue); + } + } + + this.cues_.push(cue); + this.cues.setCues_(this.cues_); + }; + /** + * Remove a cue from our internal list + * + * @param {TextTrack~Cue} removeCue + * The cue to remove from our internal list + */ + + + _proto.removeCue = function removeCue(_removeCue) { + var i = this.cues_.length; + + while (i--) { + var cue = this.cues_[i]; + + if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) { + this.cues_.splice(i, 1); + this.cues.setCues_(this.cues_); + break; + } + } + }; + + return TextTrack; +}(Track); +/** + * cuechange - One or more cues in the track have become active or stopped being active. + */ + + +TextTrack.prototype.allowedEvents_ = { + cuechange: 'cuechange' +}; + +/** + * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList} + * only one `AudioTrack` in the list will be enabled at a time. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack} + * @extends Track + */ + +var AudioTrack = +/*#__PURE__*/ +function (_Track) { + _inheritsLoose(AudioTrack, _Track); + + /** + * Create an instance of this class. + * + * @param {Object} [options={}] + * Object of option names and values + * + * @param {AudioTrack~Kind} [options.kind=''] + * A valid audio track kind + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this AudioTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @param {boolean} [options.enabled] + * If this track is the one that is currently playing. If this track is part of + * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled. + */ + function AudioTrack(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + var settings = mergeOptions(options, { + kind: AudioTrackKind[options.kind] || '' + }); + _this = _Track.call(this, settings) || this; + var enabled = false; + /** + * @memberof AudioTrack + * @member {boolean} enabled + * If this `AudioTrack` is enabled or not. When setting this will + * fire {@link AudioTrack#enabledchange} if the state of enabled is changed. + * @instance + * + * @fires VideoTrack#selectedchange + */ + + Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'enabled', { + get: function get() { + return enabled; + }, + set: function set(newEnabled) { + // an invalid or unchanged value + if (typeof newEnabled !== 'boolean' || newEnabled === enabled) { + return; + } + + enabled = newEnabled; + /** + * An event that fires when enabled changes on this track. This allows + * the AudioTrackList that holds this track to act accordingly. + * + * > Note: This is not part of the spec! Native tracks will do + * this internally without an event. + * + * @event AudioTrack#enabledchange + * @type {EventTarget~Event} + */ + + this.trigger('enabledchange'); + } + }); // if the user sets this track to selected then + // set selected to that true value otherwise + // we keep it false + + if (settings.enabled) { + _this.enabled = settings.enabled; + } + + _this.loaded_ = true; + return _this; + } + + return AudioTrack; +}(Track); + +/** + * A representation of a single `VideoTrack`. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack} + * @extends Track + */ + +var VideoTrack = +/*#__PURE__*/ +function (_Track) { + _inheritsLoose(VideoTrack, _Track); + + /** + * Create an instance of this class. + * + * @param {Object} [options={}] + * Object of option names and values + * + * @param {string} [options.kind=''] + * A valid {@link VideoTrack~Kind} + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this AudioTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @param {boolean} [options.selected] + * If this track is the one that is currently playing. + */ + function VideoTrack(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + var settings = mergeOptions(options, { + kind: VideoTrackKind[options.kind] || '' + }); + _this = _Track.call(this, settings) || this; + var selected = false; + /** + * @memberof VideoTrack + * @member {boolean} selected + * If this `VideoTrack` is selected or not. When setting this will + * fire {@link VideoTrack#selectedchange} if the state of selected changed. + * @instance + * + * @fires VideoTrack#selectedchange + */ + + Object.defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), 'selected', { + get: function get() { + return selected; + }, + set: function set(newSelected) { + // an invalid or unchanged value + if (typeof newSelected !== 'boolean' || newSelected === selected) { + return; + } + + selected = newSelected; + /** + * An event that fires when selected changes on this track. This allows + * the VideoTrackList that holds this track to act accordingly. + * + * > Note: This is not part of the spec! Native tracks will do + * this internally without an event. + * + * @event VideoTrack#selectedchange + * @type {EventTarget~Event} + */ + + this.trigger('selectedchange'); + } + }); // if the user sets this track to selected then + // set selected to that true value otherwise + // we keep it false + + if (settings.selected) { + _this.selected = settings.selected; + } + + return _this; + } + + return VideoTrack; +}(Track); + +/** + * @memberof HTMLTrackElement + * @typedef {HTMLTrackElement~ReadyState} + * @enum {number} + */ + +var NONE = 0; +var LOADING = 1; +var LOADED = 2; +var ERROR = 3; +/** + * A single track represented in the DOM. + * + * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement} + * @extends EventTarget + */ + +var HTMLTrackElement = +/*#__PURE__*/ +function (_EventTarget) { + _inheritsLoose(HTMLTrackElement, _EventTarget); + + /** + * Create an instance of this class. + * + * @param {Object} options={} + * Object of option names and values + * + * @param {Tech} options.tech + * A reference to the tech that owns this HTMLTrackElement. + * + * @param {TextTrack~Kind} [options.kind='subtitles'] + * A valid text track kind. + * + * @param {TextTrack~Mode} [options.mode='disabled'] + * A valid text track mode. + * + * @param {string} [options.id='vjs_track_' + Guid.newGUID()] + * A unique id for this TextTrack. + * + * @param {string} [options.label=''] + * The menu label for this track. + * + * @param {string} [options.language=''] + * A valid two character language code. + * + * @param {string} [options.srclang=''] + * A valid two character language code. An alternative, but deprioritized + * vesion of `options.language` + * + * @param {string} [options.src] + * A url to TextTrack cues. + * + * @param {boolean} [options.default] + * If this track should default to on or off. + */ + function HTMLTrackElement(options) { + var _this; + + if (options === void 0) { + options = {}; + } + + _this = _EventTarget.call(this) || this; + var readyState; + var track = new TextTrack(options); + _this.kind = track.kind; + _this.src = track.src; + _this.srclang = track.language; + _this.label = track.label; + _this.default = track.default; + Object.defineProperties(_assertThisInitialized(_assertThisInitialized(_this)), { + /** + * @memberof HTMLTrackElement + * @member {HTMLTrackElement~ReadyState} readyState + * The current ready state of the track element. + * @instance + */ + readyState: { + get: function get() { + return readyState; + } + }, + + /** + * @memberof HTMLTrackElement + * @member {TextTrack} track + * The underlying TextTrack object. + * @instance + * + */ + track: { + get: function get() { + return track; + } + } + }); + readyState = NONE; + /** + * @listens TextTrack#loadeddata + * @fires HTMLTrackElement#load + */ + + track.addEventListener('loadeddata', function () { + readyState = LOADED; + + _this.trigger({ + type: 'load', + target: _assertThisInitialized(_assertThisInitialized(_this)) + }); + }); + return _this; + } + + return HTMLTrackElement; +}(EventTarget); + +HTMLTrackElement.prototype.allowedEvents_ = { + load: 'load' +}; +HTMLTrackElement.NONE = NONE; +HTMLTrackElement.LOADING = LOADING; +HTMLTrackElement.LOADED = LOADED; +HTMLTrackElement.ERROR = ERROR; + +/* + * This file contains all track properties that are used in + * player.js, tech.js, html5.js and possibly other techs in the future. + */ + +var NORMAL = { + audio: { + ListClass: AudioTrackList, + TrackClass: AudioTrack, + capitalName: 'Audio' + }, + video: { + ListClass: VideoTrackList, + TrackClass: VideoTrack, + capitalName: 'Video' + }, + text: { + ListClass: TextTrackList, + TrackClass: TextTrack, + capitalName: 'Text' + } +}; +Object.keys(NORMAL).forEach(function (type) { + NORMAL[type].getterName = type + "Tracks"; + NORMAL[type].privateName = type + "Tracks_"; +}); +var REMOTE = { + remoteText: { + ListClass: TextTrackList, + TrackClass: TextTrack, + capitalName: 'RemoteText', + getterName: 'remoteTextTracks', + privateName: 'remoteTextTracks_' + }, + remoteTextEl: { + ListClass: HtmlTrackElementList, + TrackClass: HTMLTrackElement, + capitalName: 'RemoteTextTrackEls', + getterName: 'remoteTextTrackEls', + privateName: 'remoteTextTrackEls_' + } +}; +var ALL = mergeOptions(NORMAL, REMOTE); +REMOTE.names = Object.keys(REMOTE); +NORMAL.names = Object.keys(NORMAL); +ALL.names = [].concat(REMOTE.names).concat(NORMAL.names); + +/** + * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string + * that just contains the src url alone. + * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};` + * `var SourceString = 'http://example.com/some-video.mp4';` + * + * @typedef {Object|string} Tech~SourceObject + * + * @property {string} src + * The url to the source + * + * @property {string} type + * The mime type of the source + */ + +/** + * A function used by {@link Tech} to create a new {@link TextTrack}. + * + * @private + * + * @param {Tech} self + * An instance of the Tech class. + * + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @param {Object} [options={}] + * An object with additional text track options + * + * @return {TextTrack} + * The text track that was created. + */ + +function createTrackHelper(self, kind, label, language, options) { + if (options === void 0) { + options = {}; + } + + var tracks = self.textTracks(); + options.kind = kind; + + if (label) { + options.label = label; + } + + if (language) { + options.language = language; + } + + options.tech = self; + var track = new ALL.text.TrackClass(options); + tracks.addTrack(track); + return track; +} +/** + * This is the base class for media playback technology controllers, such as + * {@link Flash} and {@link HTML5} + * + * @extends Component + */ + + +var Tech = +/*#__PURE__*/ +function (_Component) { + _inheritsLoose(Tech, _Component); + + /** + * Create an instance of this Tech. + * + * @param {Object} [options] + * The key/value store of player options. + * + * @param {Component~ReadyCallback} ready + * Callback function to call when the `HTML5` Tech is ready. + */ + function Tech(options, ready) { + var _this; + + if (options === void 0) { + options = {}; + } + + if (ready === void 0) { + ready = function ready() {}; + } + + // we don't want the tech to report user activity automatically. + // This is done manually in addControlsListeners + options.reportTouchActivity = false; + _this = _Component.call(this, null, options, ready) || this; // keep track of whether the current source has played at all to + // implement a very limited played() + + _this.hasStarted_ = false; + + _this.on('playing', function () { + this.hasStarted_ = true; + }); + + _this.on('loadstart', function () { + this.hasStarted_ = false; + }); + + ALL.names.forEach(function (name) { + var props = ALL[name]; + + if (options && options[props.getterName]) { + _this[props.privateName] = options[props.getterName]; + } + }); // Manually track progress in cases where the browser/flash player doesn't report it. + + if (!_this.featuresProgressEvents) { + _this.manualProgressOn(); + } // Manually track timeupdates in cases where the browser/flash player doesn't report it. + + + if (!_this.featuresTimeupdateEvents) { + _this.manualTimeUpdatesOn(); + } + + ['Text', 'Audio', 'Video'].forEach(function (track) { + if (options["native" + track + "Tracks"] === false) { + _this["featuresNative" + track + "Tracks"] = false; + } + }); + + if (options.nativeCaptions === false || options.nativeTextTracks === false) { + _this.featuresNativeTextTracks = false; + } else if (options.nativeCaptions === true || options.nativeTextTracks === true) { + _this.featuresNativeTextTracks = true; + } + + if (!_this.featuresNativeTextTracks) { + _this.emulateTextTracks(); + } + + _this.autoRemoteTextTracks_ = new ALL.text.ListClass(); + + _this.initTrackListeners(); // Turn on component tap events only if not using native controls + + + if (!options.nativeControlsForTouch) { + _this.emitTapEvents(); + } + + if (_this.constructor) { + _this.name_ = _this.constructor.name || 'Unknown Tech'; + } + + return _this; + } + /** + * A special function to trigger source set in a way that will allow player + * to re-trigger if the player or tech are not ready yet. + * + * @fires Tech#sourceset + * @param {string} src The source string at the time of the source changing. + */ + + + var _proto = Tech.prototype; + + _proto.triggerSourceset = function triggerSourceset(src) { + var _this2 = this; + + if (!this.isReady_) { + // on initial ready we have to trigger source set + // 1ms after ready so that player can watch for it. + this.one('ready', function () { + return _this2.setTimeout(function () { + return _this2.triggerSourceset(src); + }, 1); + }); + } + /** + * Fired when the source is set on the tech causing the media element + * to reload. + * + * @see {@link Player#event:sourceset} + * @event Tech#sourceset + * @type {EventTarget~Event} + */ + + + this.trigger({ + src: src, + type: 'sourceset' + }); + }; + /* Fallbacks for unsupported event types + ================================================================================ */ + + /** + * Polyfill the `progress` event for browsers that don't support it natively. + * + * @see {@link Tech#trackProgress} + */ + + + _proto.manualProgressOn = function manualProgressOn() { + this.on('durationchange', this.onDurationChange); + this.manualProgress = true; // Trigger progress watching when a source begins loading + + this.one('ready', this.trackProgress); + }; + /** + * Turn off the polyfill for `progress` events that was created in + * {@link Tech#manualProgressOn} + */ + + + _proto.manualProgressOff = function manualProgressOff() { + this.manualProgress = false; + this.stopTrackingProgress(); + this.off('durationchange', this.onDurationChange); + }; + /** + * This is used to trigger a `progress` event when the buffered percent changes. It + * sets an interval function that will be called every 500 milliseconds to check if the + * buffer end percent has changed. + * + * > This function is called by {@link Tech#manualProgressOn} + * + * @param {EventTarget~Event} event + * The `ready` event that caused this to run. + * + * @listens Tech#ready + * @fires Tech#progress + */ + + + _proto.trackProgress = function trackProgress(event) { + this.stopTrackingProgress(); + this.progressInterval = this.setInterval(bind(this, function () { + // Don't trigger unless buffered amount is greater than last time + var numBufferedPercent = this.bufferedPercent(); + + if (this.bufferedPercent_ !== numBufferedPercent) { + /** + * See {@link Player#progress} + * + * @event Tech#progress + * @type {EventTarget~Event} + */ + this.trigger('progress'); + } + + this.bufferedPercent_ = numBufferedPercent; + + if (numBufferedPercent === 1) { + this.stopTrackingProgress(); + } + }), 500); + }; + /** + * Update our internal duration on a `durationchange` event by calling + * {@link Tech#duration}. + * + * @param {EventTarget~Event} event + * The `durationchange` event that caused this to run. + * + * @listens Tech#durationchange + */ + + + _proto.onDurationChange = function onDurationChange(event) { + this.duration_ = this.duration(); + }; + /** + * Get and create a `TimeRange` object for buffering. + * + * @return {TimeRange} + * The time range object that was created. + */ + + + _proto.buffered = function buffered() { + return createTimeRanges(0, 0); + }; + /** + * Get the percentage of the current video that is currently buffered. + * + * @return {number} + * A number from 0 to 1 that represents the decimal percentage of the + * video that is buffered. + * + */ + + + _proto.bufferedPercent = function bufferedPercent$$1() { + return bufferedPercent(this.buffered(), this.duration_); + }; + /** + * Turn off the polyfill for `progress` events that was created in + * {@link Tech#manualProgressOn} + * Stop manually tracking progress events by clearing the interval that was set in + * {@link Tech#trackProgress}. + */ + + + _proto.stopTrackingProgress = function stopTrackingProgress() { + this.clearInterval(this.progressInterval); + }; + /** + * Polyfill the `timeupdate` event for browsers that don't support it. + * + * @see {@link Tech#trackCurrentTime} + */ + + + _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() { + this.manualTimeUpdates = true; + this.on('play', this.trackCurrentTime); + this.on('pause', this.stopTrackingCurrentTime); + }; + /** + * Turn off the polyfill for `timeupdate` events that was created in + * {@link Tech#manualTimeUpdatesOn} + */ + + + _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() { + this.manualTimeUpdates = false; + this.stopTrackingCurrentTime(); + this.off('play', this.trackCurrentTime); + this.off('pause', this.stopTrackingCurrentTime); + }; + /** + * Sets up an interval function to track current time and trigger `timeupdate` every + * 250 milliseconds. + * + * @listens Tech#play + * @triggers Tech#timeupdate + */ + + + _proto.trackCurrentTime = function trackCurrentTime() { + if (this.currentTimeInterval) { + this.stopTrackingCurrentTime(); + } + + this.currentTimeInterval = this.setInterval(function () { + /** + * Triggered at an interval of 250ms to indicated that time is passing in the video. + * + * @event Tech#timeupdate + * @type {EventTarget~Event} + */ + this.trigger({ + type: 'timeupdate', + target: this, + manuallyTriggered: true + }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15 + }, 250); + }; + /** + * Stop the interval function created in {@link Tech#trackCurrentTime} so that the + * `timeupdate` event is no longer triggered. + * + * @listens {Tech#pause} + */ + + + _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() { + this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen, + // the progress bar won't make it all the way to the end + + this.trigger({ + type: 'timeupdate', + target: this, + manuallyTriggered: true + }); + }; + /** + * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList}, + * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech. + * + * @fires Component#dispose + */ + + + _proto.dispose = function dispose() { + // clear out all tracks because we can't reuse them between techs + this.clearTracks(NORMAL.names); // Turn off any manual progress or timeupdate tracking + + if (this.manualProgress) { + this.manualProgressOff(); + } + + if (this.manualTimeUpdates) { + this.manualTimeUpdatesOff(); + } + + _Component.prototype.dispose.call(this); + }; + /** + * Clear out a single `TrackList` or an array of `TrackLists` given their names. + * + * > Note: Techs without source handlers should call this between sources for `video` + * & `audio` tracks. You don't want to use them between tracks! + * + * @param {string[]|string} types + * TrackList names to clear, valid names are `video`, `audio`, and + * `text`. + */ + + + _proto.clearTracks = function clearTracks(types) { + var _this3 = this; + + types = [].concat(types); // clear out all tracks because we can't reuse them between techs + + types.forEach(function (type) { + var list = _this3[type + "Tracks"]() || []; + var i = list.length; + + while (i--) { + var track = list[i]; + + if (type === 'text') { + _this3.removeRemoteTextTrack(track); + } + + list.removeTrack(track); + } + }); + }; + /** + * Remove any TextTracks added via addRemoteTextTrack that are + * flagged for automatic garbage collection + */ + + + _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() { + var list = this.autoRemoteTextTracks_ || []; + var i = list.length; + + while (i--) { + var track = list[i]; + this.removeRemoteTextTrack(track); + } + }; + /** + * Reset the tech, which will removes all sources and reset the internal readyState. + * + * @abstract + */ + + + _proto.reset = function reset() {}; + /** + * Get or set an error on the Tech. + * + * @param {MediaError} [err] + * Error to set on the Tech + * + * @return {MediaError|null} + * The current error object on the tech, or null if there isn't one. + */ + + + _proto.error = function error(err) { + if (err !== undefined) { + this.error_ = new MediaError(err); + this.trigger('error'); + } + + return this.error_; + }; + /** + * Returns the `TimeRange`s that have been played through for the current source. + * + * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`. + * It only checks whether the source has played at all or not. + * + * @return {TimeRange} + * - A single time range if this video has played + * - An empty set of ranges if not. + */ + + + _proto.played = function played() { + if (this.hasStarted_) { + return createTimeRanges(0, 0); + } + + return createTimeRanges(); + }; + /** + * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was + * previously called. + * + * @fires Tech#timeupdate + */ + + + _proto.setCurrentTime = function setCurrentTime() { + // improve the accuracy of manual timeupdates + if (this.manualTimeUpdates) { + /** + * A manual `timeupdate` event. + * + * @event Tech#timeupdate + * @type {EventTarget~Event} + */ + this.trigger({ + type: 'timeupdate', + target: this, + manuallyTriggered: true + }); + } + }; + /** + * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and + * {@link TextTrackList} events. + * + * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`. + * + * @fires Tech#audiotrackchange + * @fires Tech#videotrackchange + * @fires Tech#texttrackchange + */ + + + _proto.initTrackListeners = function initTrackListeners() { + var _this4 = this; + + /** + * Triggered when tracks are added or removed on the Tech {@link AudioTrackList} + * + * @event Tech#audiotrackchange + * @type {EventTarget~Event} + */ + + /** + * Triggered when tracks are added or removed on the Tech {@link VideoTrackList} + * + * @event Tech#videotrackchange + * @type {EventTarget~Event} + */ + + /** + * Triggered when tracks are added or removed on the Tech {@link TextTrackList} + * + * @event Tech#texttrackchange + * @type {EventTarget~Event} + */ + NORMAL.names.forEach(function (name) { + var props = NORMAL[name]; + + var trackListChanges = function trackListChanges() { + _this4.trigger(name + "trackchange"); + }; + + var tracks = _this4[props.getterName](); + + tracks.addEventListener('removetrack', trackListChanges); + tracks.addEventListener('addtrack', trackListChanges); + + _this4.on('dispose', function () { + tracks.removeEventListener('removetrack', trackListChanges); + tracks.removeEventListener('addtrack', trackListChanges); + }); + }); + }; + /** + * Emulate TextTracks using vtt.js if necessary + * + * @fires Tech#vttjsloaded + * @fires Tech#vttjserror + */ + + + _proto.addWebVttScript_ = function addWebVttScript_() { + var _this5 = this; + + if (window$1.WebVTT) { + return; + } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system + // signals that the Tech is ready at which point Tech.el_ is part of the DOM + // before inserting the WebVTT script + + + if (document.body.contains(this.el())) { + // load via require if available and vtt.js script location was not passed in + // as an option. novtt builds will turn the above require call into an empty object + // which will cause this if check to always fail. + if (!this.options_['vtt.js'] && isPlain(vtt) && Object.keys(vtt).length > 0) { + this.trigger('vttjsloaded'); + return; + } // load vtt.js via the script location option or the cdn of no location was + // passed in + + + var script = document.createElement('script'); + script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js'; + + script.onload = function () { + /** + * Fired when vtt.js is loaded. + * + * @event Tech#vttjsloaded + * @type {EventTarget~Event} + */ + _this5.trigger('vttjsloaded'); + }; + + script.onerror = function () { + /** + * Fired when vtt.js was not loaded due to an error + * + * @event Tech#vttjsloaded + * @type {EventTarget~Event} + */ + _this5.trigger('vttjserror'); + }; + + this.on('dispose', function () { + script.onload = null; + script.onerror = null; + }); // but have not loaded yet and we set it to true before the inject so that + // we don't overwrite the injected window.WebVTT if it loads right away + + window$1.WebVTT = true; + this.el().parentNode.appendChild(script); + } else { + this.ready(this.addWebVttScript_); + } + }; + /** + * Emulate texttracks + * + */ + + + _proto.emulateTextTracks = function emulateTextTracks() { + var _this6 = this; + + var tracks = this.textTracks(); + var remoteTracks = this.remoteTextTracks(); + + var handleAddTrack = function handleAddTrack(e) { + return tracks.addTrack(e.track); + }; + + var handleRemoveTrack = function handleRemoveTrack(e) { + return tracks.removeTrack(e.track); + }; + + remoteTracks.on('addtrack', handleAddTrack); + remoteTracks.on('removetrack', handleRemoveTrack); + this.addWebVttScript_(); + + var updateDisplay = function updateDisplay() { + return _this6.trigger('texttrackchange'); + }; + + var textTracksChanges = function textTracksChanges() { + updateDisplay(); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + track.removeEventListener('cuechange', updateDisplay); + + if (track.mode === 'showing') { + track.addEventListener('cuechange', updateDisplay); + } + } + }; + + textTracksChanges(); + tracks.addEventListener('change', textTracksChanges); + tracks.addEventListener('addtrack', textTracksChanges); + tracks.addEventListener('removetrack', textTracksChanges); + this.on('dispose', function () { + remoteTracks.off('addtrack', handleAddTrack); + remoteTracks.off('removetrack', handleRemoveTrack); + tracks.removeEventListener('change', textTracksChanges); + tracks.removeEventListener('addtrack', textTracksChanges); + tracks.removeEventListener('removetrack', textTracksChanges); + + for (var i = 0; i < tracks.length; i++) { + var track = tracks[i]; + track.removeEventListener('cuechange', updateDisplay); + } + }); + }; + /** + * Create and returns a remote {@link TextTrack} object. + * + * @param {string} kind + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata) + * + * @param {string} [label] + * Label to identify the text track + * + * @param {string} [language] + * Two letter language abbreviation + * + * @return {TextTrack} + * The TextTrack that gets created. + */ + + + _proto.addTextTrack = function addTextTrack(kind, label, language) { + if (!kind) { + throw new Error('TextTrack kind is required but was not provided'); + } + + return createTrackHelper(this, kind, label, language); + }; + /** + * Create an emulated TextTrack for use by addRemoteTextTrack + * + * This is intended to be overridden by classes that inherit from + * Tech in order to create native or custom TextTracks. + * + * @param {Object} options + * The object should contain the options to initialize the TextTrack with. + * + * @param {string} [options.kind] + * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata). + * + * @param {string} [options.label]. + * Label to identify the text track + * + * @param {string} [options.language] + * Two letter language abbreviation. + * + * @return {HTMLTrackElement} + * The track element that gets created. + */ + + + _proto.createRemoteTextTrack = function createRemoteTextTrack(options) { + var track = mergeOptions(options, { + tech: this + }); + return new REMOTE.remoteTextEl.TrackClass(track); + }; + /** + * Creates a remote text track object and returns an html track element. + * + * > Note: This can be an emulated {@link HTMLTrackElement} or a native one. + * + * @param {Object} options + * See {@link Tech#createRemoteTextTrack} for more detailed properties. + * + * @param {boolean} [manualCleanup=true] + * - When false: the TextTrack will be automatically removed from the video + * element whenever the source changes + * - When True: The TextTrack will have to be cleaned up manually + * + * @return {HTMLTrackElement} + * An Html Track Element. + * + * @deprecated The default functionality for this function will be equivalent + * to "manualCleanup=false" in the future. The manualCleanup parameter will + * also be removed. + */ + + + _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) { + var _this7 = this; + + if (options === void 0) { + options = {}; + } + + var htmlTrackElement = this.createRemoteTextTrack(options); + + if (manualCleanup !== true && manualCleanup !== false) { + // deprecation warning + log.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'); + manualCleanup = true; + } // store HTMLTrackElement and TextTrack to remote list + + + this.remoteTextTrackEls().addTrackElement_(htmlTrackElement); + this.remoteTextTracks().addTrack(htmlTrackElement.track); + + if (manualCleanup !== true) { + // create the TextTrackList if it doesn't exist + this.ready(function () { + return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track); + }); + } + + return htmlTrackElement; + }; + /** + * Remove a remote text track from the remote `TextTrackList`. + * + * @param {TextTrack} track + * `TextTrack` to remove from the `TextTrackList` + */ + + + _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) { + var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list + + this.remoteTextTrackEls().removeTrackElement_(trackElement); + this.remoteTextTracks().removeTrack(track); + this.autoRemoteTextTracks_.removeTrack(track); + }; + /** + * Gets available media playback quality metrics as specified by the W3C's Media + * Playback Quality API. + * + * @see [Spec]{@link https://wicg.github.io/media-playback-quality} + * + * @return {Object} + * An object with supported media playback quality metrics + * + * @abstract + */ + + + _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() { + return {}; + }; + /** + * A method to set a poster from a `Tech`. + * + * @abstract + */ + + + _proto.setPoster = function setPoster() {}; + /** + * A method to check for the presence of the 'playsinline'