This commit is contained in:
afornerot 2019-04-02 11:26:41 +02:00
parent 4183712317
commit f2d86288d9
170 changed files with 10782 additions and 721 deletions

View File

@ -27,6 +27,7 @@ class AppKernel extends Kernel
new Ivory\CKEditorBundle\IvoryCKEditorBundle(), new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new LightSaml\SymfonyBridgeBundle\LightSamlSymfonyBridgeBundle(), new LightSaml\SymfonyBridgeBundle\LightSamlSymfonyBridgeBundle(),
new LightSaml\SpBundle\LightSamlSpBundle(), new LightSaml\SpBundle\LightSamlSpBundle(),
new Debril\RssAtomBundle\DebrilRssAtomBundle(),
new AppBundle\AppBundle(), new AppBundle\AppBundle(),

View File

@ -12,6 +12,14 @@ imports:
parameters: parameters:
locale: fr locale: fr
monolog:
handlers:
main:
type: rotating_file
path: '%kernel.logs_dir%/%kernel.environment%.log'
level: debug
max_files: 10
framework: framework:
#esi: ~ #esi: ~
#translator: { fallbacks: ['%locale%'] } #translator: { fallbacks: ['%locale%'] }
@ -80,6 +88,13 @@ oneup_uploader:
frontend: dropzone # or any uploader you use in the frontend frontend: dropzone # or any uploader you use in the frontend
icon: icon:
frontend: dropzone # or any uploader you use in the frontend frontend: dropzone # or any uploader you use in the frontend
slide:
frontend: dropzone # or any uploader you use in the frontend
file:
frontend: dropzone # or any uploader you use in the frontend
namer: cadoles.core.upload.namer.same
storage:
directory: "%kernel.root_dir%/../uploads/file"
# gregwar captcha configuration # gregwar captcha configuration
gregwar_captcha: ~ gregwar_captcha: ~

View File

@ -17,14 +17,14 @@ parameters:
# none = désactivation de l'inscription mais reset de password possible # none = désactivation de l'inscription mais reset de password possible
# byuser = aucune validation par un administrateur, l'utilisateur valide son inscription par lui-même # byuser = aucune validation par un administrateur, l'utilisateur valide son inscription par lui-même
# byadmin = validation de l'inscription par un administrateur, sauf si domaine de messagerie dans la liste blanche # byadmin = validation de l'inscription par un administrateur, sauf si domaine de messagerie dans la liste blanche
moderegistration: byadmin moderegistration: none
# Activation module # Activation module
cron_activate: true cron_activate: true
portal_activate: true portal_activate: true
# Information de base de l'annuaire # Information de base de l'annuaire
ldap_host: 172.27.7.61 ldap_host: 127.0.0.1
ldap_port: 389 ldap_port: 389
ldap_user: cn=admin,o=gouv,c=fr ldap_user: cn=admin,o=gouv,c=fr
ldap_password: eole ldap_password: eole

View File

@ -15,6 +15,7 @@
}, },
"require": { "require": {
"php": ">=7", "php": ">=7",
"debril/rss-atom-bundle": "^4.0",
"doctrine/doctrine-bundle": "^1.6", "doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2", "doctrine/doctrine-cache-bundle": "^1.2",
"doctrine/doctrine-fixtures-bundle": "^2.3", "doctrine/doctrine-fixtures-bundle": "^2.3",

View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "d4a96daf4f90dcf6a4600e1c27ff55a9", "hash": "2a3f597051554e40aa4b6ba10405d656",
"content-hash": "9f299842b28bb339e4fc9422b33fc2ec", "content-hash": "04339c394373f4030131258933c232ea",
"packages": [ "packages": [
{ {
"name": "composer/ca-bundle", "name": "composer/ca-bundle",
@ -63,6 +63,122 @@
], ],
"time": "2019-01-28 09:30:10" "time": "2019-01-28 09:30:10"
}, },
{
"name": "debril/feed-io",
"version": "v3.1.3",
"source": {
"type": "git",
"url": "https://github.com/alexdebril/feed-io.git",
"reference": "a0035d9bfe7c9ac1333242447fab781ae89fe8af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alexdebril/feed-io/zipball/a0035d9bfe7c9ac1333242447fab781ae89fe8af",
"reference": "a0035d9bfe7c9ac1333242447fab781ae89fe8af",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "~6.2",
"php": ">=5.6.0",
"psr/log": "~1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.4",
"monolog/monolog": "1.*",
"phpunit/phpunit": "~5.6.0"
},
"suggest": {
"monolog/monolog": "Allows to handle logs",
"symfony/console": "Allows to use the command line interface"
},
"bin": [
"bin/feedio"
],
"type": "library",
"autoload": {
"psr-4": {
"FeedIo\\": "src/FeedIo"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alexandre Debril",
"email": "alex.debril@gmail.com"
}
],
"description": "PHP library built to consume and serve JSONFeed / RSS / Atom feeds",
"homepage": "https://feed-io.net",
"keywords": [
"atom",
"cli",
"client",
"feed",
"jsonfeed",
"news",
"rss"
],
"time": "2019-03-11 15:08:14"
},
{
"name": "debril/rss-atom-bundle",
"version": "v4.1.1",
"target-dir": "Debril/RssAtomBundle",
"source": {
"type": "git",
"url": "https://github.com/alexdebril/rss-atom-bundle.git",
"reference": "49bcc3e5f2baef47374bf07c7535dc4aca6573ef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alexdebril/rss-atom-bundle/zipball/49bcc3e5f2baef47374bf07c7535dc4aca6573ef",
"reference": "49bcc3e5f2baef47374bf07c7535dc4aca6573ef",
"shasum": ""
},
"require": {
"debril/feed-io": "~3.0|~4.0",
"php": ">=5.6",
"symfony/config": "~3.4|~4.0",
"symfony/dependency-injection": "~3.4|~4.0",
"symfony/framework-bundle": "~3.4|~4.0",
"symfony/http-foundation": "~3.4|~4.0",
"symfony/http-kernel": "~3.4|~4.0"
},
"require-dev": {
"doctrine/common": "~2.3",
"doctrine/doctrine-bundle": "~1.2",
"phpunit/phpunit": "~5.5",
"symfony/browser-kit": ">3.0",
"symfony/finder": ">3.0",
"symfony/validator": ">3.0"
},
"suggest": {
"doctrine/doctrine-bundle": "allow to provide feeds' content from database"
},
"type": "symfony-bundle",
"autoload": {
"psr-0": {
"Debril\\RssAtomBundle": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "RSS / Atom and JSONFeed support for Symfony",
"homepage": "http://debril.org/category/rss-atom-bundle/",
"keywords": [
"Syndication",
"atom",
"feed",
"jsonfeed",
"rss"
],
"time": "2018-01-12 23:30:55"
},
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
"version": "v1.4.0", "version": "v1.4.0",
@ -1373,6 +1489,189 @@
], ],
"time": "2018-11-20 10:41:34" "time": "2018-11-20 10:41:34"
}, },
{
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba",
"shasum": ""
},
"require": {
"guzzlehttp/promises": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php": ">=5.5"
},
"require-dev": {
"ext-curl": "*",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"psr/log": "^1.0"
},
"suggest": {
"psr/log": "Required for using the Log middleware"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.3-dev"
}
},
"autoload": {
"files": [
"src/functions_include.php"
],
"psr-4": {
"GuzzleHttp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle is a PHP HTTP client library",
"homepage": "http://guzzlephp.org/",
"keywords": [
"client",
"curl",
"framework",
"http",
"http client",
"rest",
"web service"
],
"time": "2018-04-22 15:46:56"
},
{
"name": "guzzlehttp/promises",
"version": "v1.3.1",
"source": {
"type": "git",
"url": "https://github.com/guzzle/promises.git",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646",
"shasum": ""
},
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Promise\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle promises library",
"keywords": [
"promise"
],
"time": "2016-12-20 10:07:11"
},
{
"name": "guzzlehttp/psr7",
"version": "1.5.2",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "9f83dded91781a01c63574e387eaa769be769115"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/9f83dded91781a01c63574e387eaa769be769115",
"reference": "9f83dded91781a01c63574e387eaa769be769115",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0",
"ralouphie/getallheaders": "^2.0.5"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Schultze",
"homepage": "https://github.com/Tobion"
}
],
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": [
"http",
"message",
"psr-7",
"request",
"response",
"stream",
"uri",
"url"
],
"time": "2018-12-04 20:46:45"
},
{ {
"name": "incenteev/composer-parameter-handler", "name": "incenteev/composer-parameter-handler",
"version": "v2.1.3", "version": "v2.1.3",
@ -2183,6 +2482,56 @@
], ],
"time": "2017-02-14 16:28:37" "time": "2017-02-14 16:28:37"
}, },
{
"name": "psr/http-message",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP messages",
"homepage": "https://github.com/php-fig/http-message",
"keywords": [
"http",
"http-message",
"psr",
"psr-7",
"request",
"response"
],
"time": "2016-08-06 14:39:51"
},
{ {
"name": "psr/link", "name": "psr/link",
"version": "1.0.0", "version": "1.0.0",
@ -2327,6 +2676,46 @@
], ],
"time": "2017-10-23 01:57:42" "time": "2017-10-23 01:57:42"
}, },
{
"name": "ralouphie/getallheaders",
"version": "2.0.5",
"source": {
"type": "git",
"url": "https://github.com/ralouphie/getallheaders.git",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "~3.7.0",
"satooshi/php-coveralls": ">=1.0"
},
"type": "library",
"autoload": {
"files": [
"src/getallheaders.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ralph Khattar",
"email": "ralph.khattar@gmail.com"
}
],
"description": "A polyfill for getallheaders.",
"time": "2016-02-11 07:05:27"
},
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
"version": "3.8.0", "version": "3.8.0",
@ -2833,16 +3222,16 @@
}, },
{ {
"name": "symfony/polyfill-apcu", "name": "symfony/polyfill-apcu",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-apcu.git", "url": "https://github.com/symfony/polyfill-apcu.git",
"reference": "19e1b73bf255265ad0b568f81766ae2a3266d8d2" "reference": "a502face1da6a53289480166f24de2c3c68e5c3c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/19e1b73bf255265ad0b568f81766ae2a3266d8d2", "url": "https://api.github.com/repos/symfony/polyfill-apcu/zipball/a502face1da6a53289480166f24de2c3c68e5c3c",
"reference": "19e1b73bf255265ad0b568f81766ae2a3266d8d2", "reference": "a502face1da6a53289480166f24de2c3c68e5c3c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2851,7 +3240,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -2885,20 +3274,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-08-06 14:22:27" "time": "2019-02-06 07:57:58"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19" "reference": "82ebae02209c21113908c229e9883c419720738a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a",
"reference": "e3d826245268269cd66f8326bd8bc066687b4a19", "reference": "82ebae02209c21113908c229e9883c419720738a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2910,7 +3299,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -2932,7 +3321,7 @@
}, },
{ {
"name": "Gert de Pagter", "name": "Gert de Pagter",
"email": "BackEndTea@gmail.com" "email": "backendtea@gmail.com"
} }
], ],
"description": "Symfony polyfill for ctype functions", "description": "Symfony polyfill for ctype functions",
@ -2943,20 +3332,20 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"time": "2018-08-06 14:22:27" "time": "2019-02-06 07:57:58"
}, },
{ {
"name": "symfony/polyfill-intl-icu", "name": "symfony/polyfill-intl-icu",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-intl-icu.git", "url": "https://github.com/symfony/polyfill-intl-icu.git",
"reference": "f22a90256d577c7ef7efad8df1f0201663d57644" "reference": "999878a3a09d73cae157b0cf89bb6fb2cc073057"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/f22a90256d577c7ef7efad8df1f0201663d57644", "url": "https://api.github.com/repos/symfony/polyfill-intl-icu/zipball/999878a3a09d73cae157b0cf89bb6fb2cc073057",
"reference": "f22a90256d577c7ef7efad8df1f0201663d57644", "reference": "999878a3a09d73cae157b0cf89bb6fb2cc073057",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3001,20 +3390,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-08-06 14:22:27" "time": "2019-01-07 19:39:47"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git", "url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494" "reference": "fe5e94c604826c35a32fa832f35bd036b6799609"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fe5e94c604826c35a32fa832f35bd036b6799609",
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "reference": "fe5e94c604826c35a32fa832f35bd036b6799609",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3026,7 +3415,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -3060,20 +3449,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-09-21 13:07:52" "time": "2019-02-06 07:57:58"
}, },
{ {
"name": "symfony/polyfill-php56", "name": "symfony/polyfill-php56",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php56.git", "url": "https://github.com/symfony/polyfill-php56.git",
"reference": "ff208829fe1aa48ab9af356992bb7199fed551af" "reference": "f4dddbc5c3471e1b700a147a20ae17cdb72dbe42"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ff208829fe1aa48ab9af356992bb7199fed551af", "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/f4dddbc5c3471e1b700a147a20ae17cdb72dbe42",
"reference": "ff208829fe1aa48ab9af356992bb7199fed551af", "reference": "f4dddbc5c3471e1b700a147a20ae17cdb72dbe42",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3083,7 +3472,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -3116,20 +3505,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-09-21 06:26:08" "time": "2019-02-06 07:57:58"
}, },
{ {
"name": "symfony/polyfill-php70", "name": "symfony/polyfill-php70",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php70.git", "url": "https://github.com/symfony/polyfill-php70.git",
"reference": "6b88000cdd431cd2e940caa2cb569201f3f84224" "reference": "bc4858fb611bda58719124ca079baff854149c89"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224", "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/bc4858fb611bda58719124ca079baff854149c89",
"reference": "6b88000cdd431cd2e940caa2cb569201f3f84224", "reference": "bc4858fb611bda58719124ca079baff854149c89",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3139,7 +3528,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -3175,20 +3564,20 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2018-09-21 06:26:08" "time": "2019-02-06 07:57:58"
}, },
{ {
"name": "symfony/polyfill-util", "name": "symfony/polyfill-util",
"version": "v1.10.0", "version": "v1.11.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-util.git", "url": "https://github.com/symfony/polyfill-util.git",
"reference": "3b58903eae668d348a7126f999b0da0f2f93611c" "reference": "b46c6cae28a3106735323f00a0c38eccf2328897"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-util/zipball/3b58903eae668d348a7126f999b0da0f2f93611c", "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/b46c6cae28a3106735323f00a0c38eccf2328897",
"reference": "3b58903eae668d348a7126f999b0da0f2f93611c", "reference": "b46c6cae28a3106735323f00a0c38eccf2328897",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3197,7 +3586,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.9-dev" "dev-master": "1.11-dev"
} }
}, },
"autoload": { "autoload": {
@ -3227,7 +3616,7 @@
"polyfill", "polyfill",
"shim" "shim"
], ],
"time": "2018-09-30 16:36:12" "time": "2019-02-08 14:16:39"
}, },
{ {
"name": "symfony/swiftmailer-bundle", "name": "symfony/swiftmailer-bundle",
@ -3492,16 +3881,16 @@
}, },
{ {
"name": "twig/twig", "name": "twig/twig",
"version": "v2.7.3", "version": "v2.7.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/twigphp/Twig.git", "url": "https://github.com/twigphp/Twig.git",
"reference": "52b9a5bd41c8c53a1d784f90ca25e33bf558a6b3" "reference": "ed9c49220e09bfaeb1ba4d48077c08a7b09908dd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/52b9a5bd41c8c53a1d784f90ca25e33bf558a6b3", "url": "https://api.github.com/repos/twigphp/Twig/zipball/ed9c49220e09bfaeb1ba4d48077c08a7b09908dd",
"reference": "52b9a5bd41c8c53a1d784f90ca25e33bf558a6b3", "reference": "ed9c49220e09bfaeb1ba4d48077c08a7b09908dd",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -3555,7 +3944,7 @@
"keywords": [ "keywords": [
"templating" "templating"
], ],
"time": "2019-03-21 14:53:02" "time": "2019-03-23 14:28:58"
}, },
{ {
"name": "zendframework/zend-code", "name": "zendframework/zend-code",

View File

@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Doctrine\DBAL\Connection as DBALConnection; use Doctrine\DBAL\Connection as DBALConnection;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
@ -18,6 +19,8 @@ class PurgeRegistrationCommand extends Command
private $container; private $container;
private $em; private $em;
private $output; private $output;
private $filesystem;
private $rootlog;
protected function configure() protected function configure()
{ {
@ -35,15 +38,17 @@ class PurgeRegistrationCommand extends Command
$this->container = $this->getApplication()->getKernel()->getContainer(); $this->container = $this->getApplication()->getKernel()->getContainer();
$this->em = $this->container->get('doctrine')->getEntityManager(); $this->em = $this->container->get('doctrine')->getEntityManager();
$this->output = $output; $this->output = $output;
$this->filesystem = new Filesystem();
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
$this->writelnred(''); $this->writelnred('');
$this->writelnred('== Core:PurgeRegistration'); $this->writelnred('== Core:PurgeRegistration');
$this->writelnred('====================================================='); $this->writelnred('==========================================================================================================');
$now=new \DateTime('now'); $now=new \DateTime('now');
$output->writeln(''); $this->writeln('');
$output->writeln('== PURGE OBSOLETE REGISTRATION ======================'); $this->writeln('== PURGE OBSOLETE REGISTRATION ======================');
$datas = $this->em $datas = $this->em
->createQueryBuilder() ->createQueryBuilder()
@ -61,8 +66,15 @@ class PurgeRegistrationCommand extends Command
$this->writeln(''); $this->writeln('');
return 1;
} }
private function writelnred($string) { $this->output->writeln('<fg=red>'.$string.'</>'); } private function writelnred($string) {
private function writeln($string) { $this->output->writeln($string); } $this->output->writeln('<fg=red>'.$string.'</>');
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
}
private function writeln($string) {
$this->output->writeln($string);
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
}
} }

View File

@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Doctrine\DBAL\Connection as DBALConnection; use Doctrine\DBAL\Connection as DBALConnection;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManager;
@ -24,6 +25,8 @@ class SynchroCommand extends Command
private $container; private $container;
private $em; private $em;
private $output; private $output;
private $filesystem;
private $rootlog;
protected function configure() protected function configure()
{ {
@ -42,10 +45,12 @@ class SynchroCommand extends Command
$this->container = $this->getApplication()->getKernel()->getContainer(); $this->container = $this->getApplication()->getKernel()->getContainer();
$this->em = $this->container->get('doctrine')->getEntityManager(); $this->em = $this->container->get('doctrine')->getEntityManager();
$this->output = $output; $this->output = $output;
$this->filesystem = new Filesystem();
$this->rootlog = $this->container->get('kernel')->getRootDir()."/../var/logs/";
$this->writelnred(''); $this->writelnred('');
$this->writelnred('== Core:Synchro'); $this->writelnred('== Core:Synchro');
$this->writelnred('====================================================='); $this->writelnred('==========================================================================================================');
setlocale( LC_CTYPE, 'fr_FR' ); setlocale( LC_CTYPE, 'fr_FR' );
$labelniveau01 = mb_strtoupper($this->container->getParameter('labelniveau01')); $labelniveau01 = mb_strtoupper($this->container->getParameter('labelniveau01'));
@ -606,11 +611,17 @@ class SynchroCommand extends Command
} }
$this->writeln(''); $this->writeln('');
$this->writeln(''); return 1;
} }
private function writelnred($string) { $this->output->writeln('<fg=red>'.$string.'</>'); } private function writelnred($string) {
private function writeln($string) { $this->output->writeln($string); } $this->output->writeln('<fg=red>'.$string.'</>');
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
}
private function writeln($string) {
$this->output->writeln($string);
$this->filesystem->appendToFile($this->rootlog.'cron.log', $string."\n");
}
protected function addmodGroup($label,$ldapfilter) { protected function addmodGroup($label,$ldapfilter) {

View File

@ -14,25 +14,24 @@ INSERT IGNORE INTO `user` (`id`, `niveau01_id`, `username`, `firstname`, `lastna
TRUNCATE TABLE sidebar; TRUNCATE TABLE sidebar;
INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES
(1000, NULL, 1000, 'CONFIGIRATION', '', 'fa-gear', 'ROLE_ADMIN,ROLE_MODO',''), (1000, NULL, 1000, 'CONFIGIRATION', '', 'fa-gear', 'ROLE_ADMIN,ROLE_MODO', ''),
(1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN',''), (1010, 1000, 1010, 'Générale', 'cadoles_core_config_commun', 'fa-table', 'ROLE_ADMIN', ''),
(1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO',''), (1200, NULL, 1200, 'ORGANISATION', NULL, 'fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''),
(1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN',''), (1210, 1200, 1210, 'Listes Blanche', 'cadoles_core_config_whitelist', 'fa-tasks', 'ROLE_ADMIN', ''),
(1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN',''), (1220, 1200, 1220, 'Niveau 01', 'cadoles_core_config_niveau01', 'fa-building', 'ROLE_ADMIN', ''),
(1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO',''), (1240, 1200, 1240, 'Groupes', 'cadoles_core_config_group', 'fa-users', 'ROLE_ADMIN,ROLE_MODO', ''),
(1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO',''), (1250, 1200, 1250, 'Inscriptions', 'cadoles_core_config_registration', 'fa-pencil-square-o', 'ROLE_ADMIN,ROLE_MODO', ''),
(1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO',''), (1260, 1200, 1260, 'Utilisateurs', 'cadoles_core_config_user', 'fa-child', 'ROLE_ADMIN,ROLE_MODO', ''),
(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO','portal_activate'),
(1510, 1500, 1510, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO','portal_activate'),
(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO','portal_activate'),
(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO','portal_activate'),
(1540, 1500, 1540, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO','portal_activate'),
(7000, NULL, 7000, 'CRON', NULL, 'fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'),
(7010, 7000, 7010, 'Jobs', 'cadoles_cron_config', 'fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate');
(1500, NULL, 1500, 'PORTAIL', NULL, 'fa-cubes', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'),
(1510, 1500, 1510, 'Icônes', 'cadoles_portal_config_icon', 'fa-bug', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'),
(1520, 1500, 1520, 'Items', 'cadoles_portal_config_item', 'fa-desktop', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'),
(1530, 1500, 1530, 'Annonces', 'cadoles_portal_config_alert', 'fa-bell', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'),
(1540, 1500, 1540, 'Pages', 'cadoles_portal_config_page', 'fa-file', 'ROLE_ADMIN,ROLE_MODO', 'portal_activate'),
(7000, NULL, 7000, 'CRON', NULL, 'fa-bolt', 'ROLE_ADMIN', 'cron_activate'),
(7010, 7000, 7010, 'Jobs', 'cadoles_cron_config', 'fa-bullseye', 'ROLE_ADMIN', 'cron_activate'),
(7020, 7000, 7020, 'Logs', 'cadoles_cron_config_log', 'fa-list-alt', 'ROLE_ADMIN', 'cron_activate');

View File

@ -6,15 +6,53 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Cadoles\PortalBundle\Entity\Page;
class CoreController extends Controller class CoreController extends Controller
{ {
public function homeAction(Request $request) public function homeAction(Request $request)
{ {
$framed=$request->query->get('framed'); $portal_activate=$this->getParameter("portal_activate");
if(!$portal_activate) {
return $this->render('CadolesCoreBundle:Core:home.html.twig',[ return $this->render('CadolesCoreBundle:Core:home.html.twig',[
'useheader' => true, 'useheader' => true,
'usemenu' => false, 'usemenu' => false,
'usesidebar' => false, 'usesidebar' => false,
]); ]);
} }
else {
$em = $this->getDoctrine()->getManager();
// Récupération de la page encours
$id = $request->query->get('id');
// L'utilisateur en cours
$user=$this->getUser();
// Calcul des pages de l'utilisateur
$this->getDoctrine()->getRepository("CadolesPortalBundle:Page")->getPagesUser($user,$id,$entity,$pagesuser,$pagesadmin,$pagesshared);
// si aucune page = page par défaut
if(!$entity) {
return $this->render('CadolesPortalBundle:Page:default.html.twig',[
'useheader' => true,
'usemenu' => false,
'usesidebar' => false,
]);
}
return $this->render('CadolesPortalBundle:Page:pages.html.twig', [
'useheader' => true,
'usemenu' => true,
'usesidebar' => false,
'entity' => $entity,
'access' => "user",
'pagesadmin' => $pagesadmin,
'pagesuser' => $pagesuser,
'canadd' => ($user),
'widgets' => $this->getDoctrine()->getRepository("CadolesPortalBundle:Widget")->findAll()
]);
}
}
} }

View File

@ -0,0 +1,186 @@
<?php
namespace Cadoles\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\File;
class FileController extends Controller
{
public function uploadAction($id,$type,$access="config")
{
return $this->render('CadolesCoreBundle:File:upload.html.twig',[
'useheader' => false,
'usemenu' => false,
'usesidebar' => false,
'access' => $access,
'id' => $id,
'type' => $type,
]);
}
public function deleteAction(Request $request,$access="config")
{
// S'assurer que c'est un appel ajax
if (!$request->isXmlHttpRequest()) {
return new JsonResponse(array('message' => 'Interdit'), 400);
}
$output=array();
$directory=$request->request->get('directory');
$filename=$request->request->get('filename');
$this->getPermission($access,$directory);
$fs = new Filesystem();
$url=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory."/".$filename;
if($fs->exists($url)) {
$fs->remove($url);
}
$response = new Response(json_encode($output));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
public function viewAction($directory,$filename,Request $request,$access="config")
{
$this->getPermission($access,$directory);
$navigation = $request->query->get('navigation');
$tbprev=[];
$tbnext=[];
$url=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory."/".$filename;
$file = new file($url);
$minetype=$file->getMimeType();
$minefamily=explode("/",$minetype)[0];
if($minefamily=="text" || $minefamily=="image" || $minetype == "application/pdf") {
$image="";
if($minefamily=="image") {
$image = "data:image/" . $file->getExtension() . ";base64," . base64_encode(file_get_contents($url));
if($navigation) {
$dir=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory;
$files=[];
$fs = new Filesystem();
if($fs->exists($dir)) {
$finder = new Finder();
$finder->sortByName()->in($dir)->exclude('thumb');
$i=-1;
foreach ($finder as $key => $file) {
$i++;
if($file->getRelativePathname()==$filename) {
$keyprev=$i-1;
$keynext=$i+1;
}
$tmp=[];
$tmp["name"]=$file->getRelativePathname();
$tmp["extension"]=$file->getExtension();
$fileinfo = new file($file->getPathname());
$tmp["minetype"]=$fileinfo->getMimeType();
$tmp["minefamily"]=explode("/",$tmp["minetype"])[0];
$tmp["thumb"]="";
if($fs->exists($dir."/thumb/".$tmp["name"])) {
$data = file_get_contents($dir."/thumb/".$tmp["name"]);
$tmp["thumb"]="data:image/" . $tmp["extension"] . ";base64," . base64_encode($data);
}
array_push($files,$tmp);
}
if(array_key_exists($keyprev,$files))
$tbprev=$files[$keyprev];
if(array_key_exists($keynext,$files))
$tbnext=$files[$keynext];
}
}
}
return $this->render('CadolesCoreBundle:File:view.html.twig',[
'useheader' => false,
'usemenu' => false,
'usesidebar' => false,
'access' => $access,
'directory' => $directory,
'minefamily' => $minefamily,
'minetype' => $minetype,
'filename' => $filename,
'image' => $image,
'prev' => $tbprev,
'next' => $tbnext
]);
}
else {
// normalement le widget ne fait jamais passer par là
$response = new BinaryFileResponse($file);
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE);
return $response;
}
}
public function showAction($directory,$filename,$access="config")
{
$this->getPermission($access,$directory);
$file=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory."/".$filename;
$response = new BinaryFileResponse($file);
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE);
return $response;
}
public function downloadAction($directory,$filename,$access="config")
{
$this->getPermission($access,$directory);
$file=$this->get('kernel')->getRootDir()."/../uploads/file/".$directory."/".$filename;
$response = new BinaryFileResponse($file);
$response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT);
return $response;
}
public function getPermission($access, $directory) {
if($access=="user") {
$em = $this->getDoctrine()->getManager();
$type=explode("-",$directory)[0];
$id=explode("-",$directory)[1];
switch($type) {
case "widget":
// Récupération du widget
$widget=$em->getRepository("CadolesPortalBundle:Pagewidget")->find($id);
if (!$widget) throw $this->createNotFoundException('Unable to find entity.');
// On s'assure que l'utilisateur à la permission de voir
$page=$widget->getPage();
$em->getRepository("CadolesPortalBundle:Page")->getPermission($this->getUser(),$page,$cansee,$canupdate);
if(!$cansee) throw $this->createNotFoundException('Permission denied');
break;
}
}
}
}

View File

@ -62,6 +62,11 @@ class Group
*/ */
private $users; private $users;
/**
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Page", mappedBy="groups")
*/
protected $pages;
/** /**
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Item", mappedBy="groups") * @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Item", mappedBy="groups")
*/ */
@ -72,13 +77,23 @@ class Group
*/ */
protected $alerts; protected $alerts;
/**
* @ORM\ManyToMany(targetEntity="Cadoles\PortalBundle\Entity\Flux", mappedBy="groups")
*/
protected $fluxs;
/** /**
* Constructor * Constructor
*/ */
public function __construct() public function __construct()
{ {
$this->users = new \Doctrine\Common\Collections\ArrayCollection(); $this->users = new \Doctrine\Common\Collections\ArrayCollection();
$this->pages = new \Doctrine\Common\Collections\ArrayCollection();
$this->items = new \Doctrine\Common\Collections\ArrayCollection(); $this->items = new \Doctrine\Common\Collections\ArrayCollection();
$this->alerts = new \Doctrine\Common\Collections\ArrayCollection();
$this->fluxs = new \Doctrine\Common\Collections\ArrayCollection();
} }
/** /**
@ -269,6 +284,40 @@ class Group
return $this->users; return $this->users;
} }
/**
* Add page
*
* @param \Cadoles\PortalBundle\Entity\Alert $page
*
* @return Group
*/
public function addPage(\Cadoles\PortalBundle\Entity\Alert $page)
{
$this->pages[] = $page;
return $this;
}
/**
* Remove page
*
* @param \Cadoles\PortalBundle\Entity\Alert $page
*/
public function removePage(\Cadoles\PortalBundle\Entity\Alert $page)
{
$this->pages->removeElement($page);
}
/**
* Get pages
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPages()
{
return $this->pages;
}
/** /**
* Add item * Add item
* *
@ -336,4 +385,38 @@ class Group
{ {
return $this->alerts; return $this->alerts;
} }
/**
* Add flux
*
* @param \Cadoles\PortalBundle\Entity\Flux $flux
*
* @return Group
*/
public function addFlux(\Cadoles\PortalBundle\Entity\Flux $flux)
{
$this->fluxs[] = $flux;
return $this;
}
/**
* Remove flux
*
* @param \Cadoles\PortalBundle\Entity\Flux $flux
*/
public function removeFlux(\Cadoles\PortalBundle\Entity\Flux $flux)
{
$this->fluxs->removeElement($flux);
}
/**
* Get fluxs
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getFluxs()
{
return $this->fluxs;
}
} }

View File

@ -187,6 +187,21 @@ class User implements UserInterface, \Serializable
*/ */
private $modos; private $modos;
/**
* @var ArrayCollection $page
* @var Page
*
* @ORM\OneToMany(targetEntity="Cadoles\PortalBundle\Entity\Page", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/
private $pages;
/**
* @var ArrayCollection $bookmark
* @var Bookmark
*
* @ORM\OneToMany(targetEntity="Cadoles\PortalBundle\Entity\Bookmark", mappedBy="user", cascade={"persist"}, orphanRemoval=true)
*/
private $bookmarks;
//== CODE A NE PAS REGENERER //== CODE A NE PAS REGENERER
/** /**
@ -721,6 +736,54 @@ class User implements UserInterface, \Serializable
return $this->position; return $this->position;
} }
/**
* Set keyexpire
*
* @param \DateTime $keyexpire
*
* @return User
*/
public function setKeyexpire($keyexpire)
{
$this->keyexpire = $keyexpire;
return $this;
}
/**
* Get keyexpire
*
* @return \DateTime
*/
public function getKeyexpire()
{
return $this->keyexpire;
}
/**
* Set keyvalue
*
* @param string $keyvalue
*
* @return User
*/
public function setKeyvalue($keyvalue)
{
$this->keyvalue = $keyvalue;
return $this;
}
/**
* Get keyvalue
*
* @return string
*/
public function getKeyvalue()
{
return $this->keyvalue;
}
/** /**
* Set belongingpopulation * Set belongingpopulation
* *
@ -910,50 +973,70 @@ class User implements UserInterface, \Serializable
} }
/** /**
* Set keyexpire * Add page
* *
* @param \DateTime $keyexpire * @param \Cadoles\PortalBundle\Entity\Page $page
* *
* @return User * @return User
*/ */
public function setKeyexpire($keyexpire) public function addPage(\Cadoles\PortalBundle\Entity\Page $page)
{ {
$this->keyexpire = $keyexpire; $this->pages[] = $page;
return $this; return $this;
} }
/** /**
* Get keyexpire * Remove page
* *
* @return \DateTime * @param \Cadoles\PortalBundle\Entity\Page $page
*/ */
public function getKeyexpire() public function removePage(\Cadoles\PortalBundle\Entity\Page $page)
{ {
return $this->keyexpire; $this->pages->removeElement($page);
} }
/** /**
* Set keyvalue * Get pages
* *
* @param string $keyvalue * @return \Doctrine\Common\Collections\Collection
*/
public function getPages()
{
return $this->pages;
}
/**
* Add bookmark
*
* @param \Cadoles\PortalBundle\Entity\Bookmark $bookmark
* *
* @return User * @return User
*/ */
public function setKeyvalue($keyvalue) public function addBookmark(\Cadoles\PortalBundle\Entity\Bookmark $bookmark)
{ {
$this->keyvalue = $keyvalue; $this->bookmarks[] = $bookmark;
return $this; return $this;
} }
/** /**
* Get keyvalue * Remove bookmark
* *
* @return string * @param \Cadoles\PortalBundle\Entity\Bookmark $bookmark
*/ */
public function getKeyvalue() public function removeBookmark(\Cadoles\PortalBundle\Entity\Bookmark $bookmark)
{ {
return $this->keyvalue; $this->bookmarks->removeElement($bookmark);
}
/**
* Get bookmarks
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getBookmarks()
{
return $this->bookmarks;
} }
} }

View File

@ -90,7 +90,32 @@ class uploadListener
$session = new Session(); $session = new Session();
$session->set('uploadavatar', $filename); $session->set('uploadavatar', $filename);
break; break;
case "file":
$file=$event->getFile();
$filename=$file->getFilename();
$pathname=$file->getPath();
// Déplacer le fichier dans la cible
$request = $event->getRequest();
$directory = $request->get('directory');
$file->move($pathname."/".$directory, $filename);
// Création d'un thumb dans le cas d'un fichier de type imapge
if (in_array(strtolower($file->GetExtension()), array('jpg', 'jpeg', 'jpe', 'png', 'gif', 'bmp'))) {
$fs = new Filesystem();
$fs->copy($pathname."/".$directory."/".$filename,$pathname."/".$directory."/thumb/".$filename);
$max_width=350;
$width = $this->getWidth($pathname."/".$directory."/thumb/".$filename);
$height = $this->getHeight($pathname."/".$directory."/thumb/".$filename);
$scale = $max_width/$width;
$this->resizeImage($pathname."/".$directory."/thumb/".$filename,$width,$height,$scale);
}
$response = $event->getResponse();
$response['file'] = $filename;
break;
default: default:
$file=$event->getFile(); $file=$event->getFile();
$filename=$file->getFilename(); $filename=$file->getFilename();

View File

@ -25,6 +25,49 @@ cadoles_core_crop02:
path: /crop02 path: /crop02
defaults: { _controller: CadolesCoreBundle:Crop:crop02 } defaults: { _controller: CadolesCoreBundle:Crop:crop02 }
#== File =================================================================================================================
#-- Access config
cadoles_core_config_file_upload:
path: /config/file/upload/{id}/{type}
defaults: { _controller: CadolesCoreBundle:File:upload, access: config }
cadoles_core_config_file_delete:
path: /config/file/delete/
defaults: { _controller: CadolesCoreBundle:File:delete, access: config }
cadoles_core_config_file_view:
path: /config/file/view/{directory}/{filename}
defaults: { _controller: CadolesCoreBundle:File:view, access: config }
cadoles_core_config_file_show:
path: /config/file/show/{directory}/{filename}
defaults: { _controller: CadolesCoreBundle:File:show, access: config }
cadoles_core_config_file_download:
path: /config/file/download/{directory}/{filename}
defaults: { _controller: CadolesCoreBundle:File:download, access: config }
#-- Access user
cadoles_core_user_file_upload:
path: /user/config/file/upload/{id}/{type}
defaults: { _controller: CadolesCoreBundle:File:upload, access: user }
cadoles_core_user_file_delete:
path: /user/file/delete
defaults: { _controller: CadolesCoreBundle:File:delete, access: user }
cadoles_core_user_file_view:
path: file/view/{directory}/{filename}
defaults: { _controller: CadolesCoreBundle:File:view, access: user }
cadoles_core_user_file_download:
path: file/download/{directory}/{filename}
defaults: { _controller: CadolesCoreBundle:File:download, access: user }
cadoles_core_user_file_show:
path: file/show/{directory}/{filename}
defaults: { _controller: CadolesCoreBundle:File:show, access: user }
#== Ajax ================================================================================================================= #== Ajax =================================================================================================================
cadoles_core_ajax_country_list: cadoles_core_ajax_country_list:
path: /ajax/country/list path: /ajax/country/list

View File

@ -11,6 +11,9 @@ services:
tags: tags:
- { name: kernel.event_listener, event: oneup_uploader.post_persist, method: onUpload } - { name: kernel.event_listener, event: oneup_uploader.post_persist, method: onUpload }
cadoles.core.upload.namer.same:
class: Cadoles\CoreBundle\Service\uploadSameNamer
cadoles.core.password.encoder: cadoles.core.password.encoder:
class: Cadoles\CoreBundle\Service\passwordEncoder class: Cadoles\CoreBundle\Service\passwordEncoder

View File

@ -0,0 +1,50 @@
.rapClock{
#background:radial-gradient(#fff 10%,#ccc 60%,#000 61%,#a00 70%,black 100%);
font-family:'Comic Sans MS',cursive,sans-serif;
position:relative;
border-radius:50%;
#box-shadow:inset -2px -2px 4px rgba(0,0,0,8),inset 2px 2px 4px rgba(255,255,255,8),2px 2px 4px rgba(0,0,0,8),0px 0px 4px black;
text-align:center;
text-shadow:0 0 2px #fff;
}
.rapClockCaption{
padding-top:25%;
}
.rapClockHours{
top:50%;
left:50%;
width:2%;
height:8%;
position:absolute;
background-color:#000;
}
.rapClockNumbers{
top:50%;
left:50%;
position:absolute;
}
.rapClockHands{
top:50%;
left:50%;
position:absolute;
border-radius:50% 50% 50% 50% / 90% 90% 10% 10%;
}
.rapClockS{
width:2%;
height:46%;
z-index:3;
background-color:#a00;
}
.rapClockM{
width:3%;
height:34%;
z-index: 2;
background-color:#222;
}
.rapClockH{
width:5%;
height:25%;
z-index:1;
background-color:#222;
}

View File

@ -0,0 +1,206 @@
@charset 'UTF-8';
/* Slider */
.slick-loading .slick-list
{
background: #fff url('../bundles/cadolescore/images/loading.gif') center center no-repeat;
}
/* Icons */
@font-face
{
font-family: 'slick';
font-weight: normal;
font-style: normal;
src: url('../fonts/slick.eot');
src: url('../fonts/slick.eot?#iefix') format('embedded-opentype'), url('../fonts/slick.woff') format('woff'), url('../fonts/slick.ttf') format('truetype'), url('../fonts/slick.svg#slick') format('svg');
}
/* Arrows */
.slick-prev,
.slick-next
{
font-size: 0;
line-height: 0;
position: absolute;
top: 50%;
display: block;
width: 40px;
height: 40px;
padding: 0;
-webkit-transform: translate(0, -50%);
-ms-transform: translate(0, -50%);
transform: translate(0, -50%);
cursor: pointer;
color: transparent;
border: none;
outline: none;
background: transparent;
z-index: 10000;
}
.slick-prev:hover,
.slick-prev:focus,
.slick-next:hover,
.slick-next:focus
{
color: transparent;
outline: none;
background: transparent;
}
.slick-prev:hover:before,
.slick-prev:focus:before,
.slick-next:hover:before,
.slick-next:focus:before
{
opacity: 1;
}
.slick-prev.slick-disabled:before,
.slick-next.slick-disabled:before
{
opacity: .25;
}
.slick-prev:before,
.slick-next:before
{
font-family: 'slick';
font-size: 40px;
line-height: 1;
opacity: .75;
color: white;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-prev
{
left: 10px;
}
[dir='rtl'] .slick-prev
{
right: 10px;
left: auto;
}
.slick-prev:before
{
content: '←';
}
[dir='rtl'] .slick-prev:before
{
content: '→';
}
.slick-next
{
right: 10px;
}
[dir='rtl'] .slick-next
{
right: auto;
left: 10px;
}
.slick-next:before
{
content: '→';
}
[dir='rtl'] .slick-next:before
{
content: '←';
}
/* Dots */
.slick-dotted.slick-slider
{
margin-bottom: 30px;
}
.slick-dots
{
position: absolute;
bottom: -25px;
display: block;
width: 100%;
padding: 0;
margin: 0;
list-style: none;
text-align: center;
}
.slick-dots li
{
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button
{
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus
{
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before
{
opacity: 1;
}
.slick-dots li button:before
{
font-family: 'slick';
font-size: 6px;
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 20px;
height: 20px;
content: '•';
text-align: center;
opacity: .25;
color: black;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.slick-dots li.slick-active button:before
{
opacity: .75;
color: black;
}

View File

@ -0,0 +1,119 @@
/* Slider */
.slick-slider
{
position: relative;
display: block;
box-sizing: border-box;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-khtml-user-select: none;
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-tap-highlight-color: transparent;
}
.slick-list
{
position: relative;
display: block;
overflow: hidden;
margin: 0;
padding: 0;
}
.slick-list:focus
{
outline: none;
}
.slick-list.dragging
{
cursor: pointer;
cursor: hand;
}
.slick-slider .slick-track,
.slick-slider .slick-list
{
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.slick-track
{
position: relative;
top: 0;
left: 0;
display: block;
margin-left: auto;
margin-right: auto;
}
.slick-track:before,
.slick-track:after
{
display: table;
content: '';
}
.slick-track:after
{
clear: both;
}
.slick-loading .slick-track
{
visibility: hidden;
}
.slick-slide
{
display: none;
float: left;
height: 100%;
min-height: 1px;
}
[dir='rtl'] .slick-slide
{
float: right;
}
.slick-slide img
{
display: block;
}
.slick-slide.slick-loading img
{
display: none;
}
.slick-slide.dragging img
{
pointer-events: none;
}
.slick-initialized .slick-slide
{
display: block;
}
.slick-loading .slick-slide
{
visibility: hidden;
}
.slick-vertical .slick-slide
{
display: block;
height: auto;
border: 1px solid transparent;
}
.slick-arrow.slick-hidden {
display: none;
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by Fontastic.me</metadata>
<defs>
<font id="slick" horiz-adv-x="512">
<font-face font-family="slick" units-per-em="512" ascent="480" descent="-32"/>
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#8594;" d="M241 113l130 130c4 4 6 8 6 13 0 5-2 9-6 13l-130 130c-3 3-7 5-12 5-5 0-10-2-13-5l-29-30c-4-3-6-7-6-12 0-5 2-10 6-13l87-88-87-88c-4-3-6-8-6-13 0-5 2-9 6-12l29-30c3-3 8-5 13-5 5 0 9 2 12 5z m234 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
<glyph unicode="&#8592;" d="M296 113l29 30c4 3 6 7 6 12 0 5-2 10-6 13l-87 88 87 88c4 3 6 8 6 13 0 5-2 9-6 12l-29 30c-3 3-8 5-13 5-5 0-9-2-12-5l-130-130c-4-4-6-8-6-13 0-5 2-9 6-13l130-130c3-3 7-5 12-5 5 0 10 2 13 5z m179 143c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
<glyph unicode="&#8226;" d="M475 256c0-40-9-77-29-110-20-34-46-60-80-80-33-20-70-29-110-29-40 0-77 9-110 29-34 20-60 46-80 80-20 33-29 70-29 110 0 40 9 77 29 110 20 34 46 60 80 80 33 20 70 29 110 29 40 0 77-9 110-29 34-20 60-46 80-80 20-33 29-70 29-110z"/>
<glyph unicode="&#97;" d="M475 439l0-128c0-5-1-9-5-13-4-4-8-5-13-5l-128 0c-8 0-13 3-17 11-3 7-2 14 4 20l40 39c-28 26-62 39-100 39-20 0-39-4-57-11-18-8-33-18-46-32-14-13-24-28-32-46-7-18-11-37-11-57 0-20 4-39 11-57 8-18 18-33 32-46 13-14 28-24 46-32 18-7 37-11 57-11 23 0 44 5 64 15 20 9 38 23 51 42 2 1 4 3 7 3 3 0 5-1 7-3l39-39c2-2 3-3 3-6 0-2-1-4-2-6-21-25-46-45-76-59-29-14-60-20-93-20-30 0-58 5-85 17-27 12-51 27-70 47-20 19-35 43-47 70-12 27-17 55-17 85 0 30 5 58 17 85 12 27 27 51 47 70 19 20 43 35 70 47 27 12 55 17 85 17 28 0 55-5 81-15 26-11 50-26 70-45l37 37c6 6 12 7 20 4 8-4 11-9 11-17z"/>
</font></defs></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,53 @@
$(window).resize(function(){
$('.rapClock').each(function(){
this.Render();
});
});
(function($){
$.fn.jsRapClock = function(options){
return this.each(function(){
this.opt = $.extend({
caption:'',
clockNumbers:true,
shiftH:0,
shiftM:0,
shiftS:0
},options);
var base = this;
this.Render = function(){
$(this).empty();
var w = $(this).width();
$(this).addClass('rapClock').height(w);
if(this.opt.caption)
$('<div>').addClass('rapClockCaption').text(this.opt.caption).appendTo(this);
for(var n = 0;n < 12;n++)
if(this.opt.clockNumbers)
$('<div>').text((n + 5) % 12 + 1).addClass('rapClockNumbers').css({'font-size':(w * 0.1)+ 'px',transform:'translate(-50%,-50%) rotate(' + (n * 30) + 'deg) translate(0,' + (w * 0.36) + 'px) rotate(-' + (n * 30) + 'deg)'}).appendTo(this);
else
$('<div>').addClass('rapClockHours').css('transform','translate(-50%,-50%) rotate(' + (n * 30) + 'deg) translate(0,460%)').appendTo(this);
$('<div>').addClass('rapClockHands rapClockH').appendTo(this);
$('<div>').addClass('rapClockHands rapClockM').appendTo(this);
$('<div>').addClass('rapClockHands rapClockS').appendTo(this);
this.ShowTime();
}
this.ShowTime = function(){
var d = new Date();
var h = d.getHours() + this.opt.shiftH;
var m = d.getMinutes() + this.opt.shiftM;
var s = d.getSeconds() + this.opt.shiftS;
$('.rapClockH',this).css('transform','translate(-50%,-50%) rotate(' + (h * 30 + m / 2) + 'deg) translate(0,-40%)');
$('.rapClockM',this).css('transform','translate(-50%,-50%) rotate(' + (m * 6) + 'deg) translate(0,-45%)');
$('.rapClockS',this).css('transform','translate(-50%,-50%) rotate(' + (s * 6) + 'deg) translate(0,-30%)');
}
this.Render();
setInterval( function(){
base.ShowTime();
},1000 );
});
}})(jQuery);

View File

@ -0,0 +1,3011 @@
/*
_ _ _ _
___| (_) ___| | __ (_)___
/ __| | |/ __| |/ / | / __|
\__ \ | | (__| < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
|__/
Version: 1.8.0
Author: Ken Wheeler
Website: http://kenwheeler.github.io
Docs: http://kenwheeler.github.io/slick
Repo: http://github.com/kenwheeler/slick
Issues: http://github.com/kenwheeler/slick/issues
*/
/* global window, document, define, jQuery, setInterval, clearInterval */
;(function(factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof exports !== 'undefined') {
module.exports = factory(require('jquery'));
} else {
factory(jQuery);
}
}(function($) {
'use strict';
var Slick = window.Slick || {};
Slick = (function() {
var instanceUid = 0;
function Slick(element, settings) {
var _ = this, dataSettings;
_.defaults = {
accessibility: true,
adaptiveHeight: false,
appendArrows: $(element),
appendDots: $(element),
arrows: true,
asNavFor: null,
prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',
nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>',
autoplay: false,
autoplaySpeed: 3000,
centerMode: false,
centerPadding: '50px',
cssEase: 'ease',
customPaging: function(slider, i) {
return $('<button type="button" />').text(i + 1);
},
dots: false,
dotsClass: 'slick-dots',
draggable: true,
easing: 'linear',
edgeFriction: 0.35,
fade: false,
focusOnSelect: false,
focusOnChange: false,
infinite: true,
initialSlide: 0,
lazyLoad: 'ondemand',
mobileFirst: false,
pauseOnHover: true,
pauseOnFocus: true,
pauseOnDotsHover: false,
respondTo: 'window',
responsive: null,
rows: 1,
rtl: false,
slide: '',
slidesPerRow: 1,
slidesToShow: 1,
slidesToScroll: 1,
speed: 500,
swipe: true,
swipeToSlide: false,
touchMove: true,
touchThreshold: 5,
useCSS: true,
useTransform: true,
variableWidth: false,
vertical: false,
verticalSwiping: false,
waitForAnimate: true,
zIndex: 1000
};
_.initials = {
animating: false,
dragging: false,
autoPlayTimer: null,
currentDirection: 0,
currentLeft: null,
currentSlide: 0,
direction: 1,
$dots: null,
listWidth: null,
listHeight: null,
loadIndex: 0,
$nextArrow: null,
$prevArrow: null,
scrolling: false,
slideCount: null,
slideWidth: null,
$slideTrack: null,
$slides: null,
sliding: false,
slideOffset: 0,
swipeLeft: null,
swiping: false,
$list: null,
touchObject: {},
transformsEnabled: false,
unslicked: false
};
$.extend(_, _.initials);
_.activeBreakpoint = null;
_.animType = null;
_.animProp = null;
_.breakpoints = [];
_.breakpointSettings = [];
_.cssTransitions = false;
_.focussed = false;
_.interrupted = false;
_.hidden = 'hidden';
_.paused = true;
_.positionProp = null;
_.respondTo = null;
_.rowCount = 1;
_.shouldClick = true;
_.$slider = $(element);
_.$slidesCache = null;
_.transformType = null;
_.transitionType = null;
_.visibilityChange = 'visibilitychange';
_.windowWidth = 0;
_.windowTimer = null;
dataSettings = $(element).data('slick') || {};
_.options = $.extend({}, _.defaults, settings, dataSettings);
_.currentSlide = _.options.initialSlide;
_.originalSettings = _.options;
if (typeof document.mozHidden !== 'undefined') {
_.hidden = 'mozHidden';
_.visibilityChange = 'mozvisibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') {
_.hidden = 'webkitHidden';
_.visibilityChange = 'webkitvisibilitychange';
}
_.autoPlay = $.proxy(_.autoPlay, _);
_.autoPlayClear = $.proxy(_.autoPlayClear, _);
_.autoPlayIterator = $.proxy(_.autoPlayIterator, _);
_.changeSlide = $.proxy(_.changeSlide, _);
_.clickHandler = $.proxy(_.clickHandler, _);
_.selectHandler = $.proxy(_.selectHandler, _);
_.setPosition = $.proxy(_.setPosition, _);
_.swipeHandler = $.proxy(_.swipeHandler, _);
_.dragHandler = $.proxy(_.dragHandler, _);
_.keyHandler = $.proxy(_.keyHandler, _);
_.instanceUid = instanceUid++;
// A simple way to check for HTML strings
// Strict HTML recognition (must start with <)
// Extracted from jQuery v1.11 source
_.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/;
_.registerBreakpoints();
_.init(true);
}
return Slick;
}());
Slick.prototype.activateADA = function() {
var _ = this;
_.$slideTrack.find('.slick-active').attr({
'aria-hidden': 'false'
}).find('a, input, button, select').attr({
'tabindex': '0'
});
};
Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) {
var _ = this;
if (typeof(index) === 'boolean') {
addBefore = index;
index = null;
} else if (index < 0 || (index >= _.slideCount)) {
return false;
}
_.unload();
if (typeof(index) === 'number') {
if (index === 0 && _.$slides.length === 0) {
$(markup).appendTo(_.$slideTrack);
} else if (addBefore) {
$(markup).insertBefore(_.$slides.eq(index));
} else {
$(markup).insertAfter(_.$slides.eq(index));
}
} else {
if (addBefore === true) {
$(markup).prependTo(_.$slideTrack);
} else {
$(markup).appendTo(_.$slideTrack);
}
}
_.$slides = _.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slides.each(function(index, element) {
$(element).attr('data-slick-index', index);
});
_.$slidesCache = _.$slides;
_.reinit();
};
Slick.prototype.animateHeight = function() {
var _ = this;
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.animate({
height: targetHeight
}, _.options.speed);
}
};
Slick.prototype.animateSlide = function(targetLeft, callback) {
var animProps = {},
_ = this;
_.animateHeight();
if (_.options.rtl === true && _.options.vertical === false) {
targetLeft = -targetLeft;
}
if (_.transformsEnabled === false) {
if (_.options.vertical === false) {
_.$slideTrack.animate({
left: targetLeft
}, _.options.speed, _.options.easing, callback);
} else {
_.$slideTrack.animate({
top: targetLeft
}, _.options.speed, _.options.easing, callback);
}
} else {
if (_.cssTransitions === false) {
if (_.options.rtl === true) {
_.currentLeft = -(_.currentLeft);
}
$({
animStart: _.currentLeft
}).animate({
animStart: targetLeft
}, {
duration: _.options.speed,
easing: _.options.easing,
step: function(now) {
now = Math.ceil(now);
if (_.options.vertical === false) {
animProps[_.animType] = 'translate(' +
now + 'px, 0px)';
_.$slideTrack.css(animProps);
} else {
animProps[_.animType] = 'translate(0px,' +
now + 'px)';
_.$slideTrack.css(animProps);
}
},
complete: function() {
if (callback) {
callback.call();
}
}
});
} else {
_.applyTransition();
targetLeft = Math.ceil(targetLeft);
if (_.options.vertical === false) {
animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)';
} else {
animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)';
}
_.$slideTrack.css(animProps);
if (callback) {
setTimeout(function() {
_.disableTransition();
callback.call();
}, _.options.speed);
}
}
}
};
Slick.prototype.getNavTarget = function() {
var _ = this,
asNavFor = _.options.asNavFor;
if ( asNavFor && asNavFor !== null ) {
asNavFor = $(asNavFor).not(_.$slider);
}
return asNavFor;
};
Slick.prototype.asNavFor = function(index) {
var _ = this,
asNavFor = _.getNavTarget();
if ( asNavFor !== null && typeof asNavFor === 'object' ) {
asNavFor.each(function() {
var target = $(this).slick('getSlick');
if(!target.unslicked) {
target.slideHandler(index, true);
}
});
}
};
Slick.prototype.applyTransition = function(slide) {
var _ = this,
transition = {};
if (_.options.fade === false) {
transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase;
} else {
transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase;
}
if (_.options.fade === false) {
_.$slideTrack.css(transition);
} else {
_.$slides.eq(slide).css(transition);
}
};
Slick.prototype.autoPlay = function() {
var _ = this;
_.autoPlayClear();
if ( _.slideCount > _.options.slidesToShow ) {
_.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed );
}
};
Slick.prototype.autoPlayClear = function() {
var _ = this;
if (_.autoPlayTimer) {
clearInterval(_.autoPlayTimer);
}
};
Slick.prototype.autoPlayIterator = function() {
var _ = this,
slideTo = _.currentSlide + _.options.slidesToScroll;
if ( !_.paused && !_.interrupted && !_.focussed ) {
if ( _.options.infinite === false ) {
if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) {
_.direction = 0;
}
else if ( _.direction === 0 ) {
slideTo = _.currentSlide - _.options.slidesToScroll;
if ( _.currentSlide - 1 === 0 ) {
_.direction = 1;
}
}
}
_.slideHandler( slideTo );
}
};
Slick.prototype.buildArrows = function() {
var _ = this;
if (_.options.arrows === true ) {
_.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow');
_.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow');
if( _.slideCount > _.options.slidesToShow ) {
_.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
_.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex');
if (_.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.prependTo(_.options.appendArrows);
}
if (_.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.appendTo(_.options.appendArrows);
}
if (_.options.infinite !== true) {
_.$prevArrow
.addClass('slick-disabled')
.attr('aria-disabled', 'true');
}
} else {
_.$prevArrow.add( _.$nextArrow )
.addClass('slick-hidden')
.attr({
'aria-disabled': 'true',
'tabindex': '-1'
});
}
}
};
Slick.prototype.buildDots = function() {
var _ = this,
i, dot;
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
_.$slider.addClass('slick-dotted');
dot = $('<ul />').addClass(_.options.dotsClass);
for (i = 0; i <= _.getDotCount(); i += 1) {
dot.append($('<li />').append(_.options.customPaging.call(this, _, i)));
}
_.$dots = dot.appendTo(_.options.appendDots);
_.$dots.find('li').first().addClass('slick-active');
}
};
Slick.prototype.buildOut = function() {
var _ = this;
_.$slides =
_.$slider
.children( _.options.slide + ':not(.slick-cloned)')
.addClass('slick-slide');
_.slideCount = _.$slides.length;
_.$slides.each(function(index, element) {
$(element)
.attr('data-slick-index', index)
.data('originalStyling', $(element).attr('style') || '');
});
_.$slider.addClass('slick-slider');
_.$slideTrack = (_.slideCount === 0) ?
$('<div class="slick-track"/>').appendTo(_.$slider) :
_.$slides.wrapAll('<div class="slick-track"/>').parent();
_.$list = _.$slideTrack.wrap(
'<div class="slick-list"/>').parent();
_.$slideTrack.css('opacity', 0);
if (_.options.centerMode === true || _.options.swipeToSlide === true) {
_.options.slidesToScroll = 1;
}
$('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading');
_.setupInfinite();
_.buildArrows();
_.buildDots();
_.updateDots();
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
if (_.options.draggable === true) {
_.$list.addClass('draggable');
}
};
Slick.prototype.buildRows = function() {
var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection;
newSlides = document.createDocumentFragment();
originalSlides = _.$slider.children();
if(_.options.rows > 0) {
slidesPerSection = _.options.slidesPerRow * _.options.rows;
numOfSlides = Math.ceil(
originalSlides.length / slidesPerSection
);
for(a = 0; a < numOfSlides; a++){
var slide = document.createElement('div');
for(b = 0; b < _.options.rows; b++) {
var row = document.createElement('div');
for(c = 0; c < _.options.slidesPerRow; c++) {
var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c));
if (originalSlides.get(target)) {
row.appendChild(originalSlides.get(target));
}
}
slide.appendChild(row);
}
newSlides.appendChild(slide);
}
_.$slider.empty().append(newSlides);
_.$slider.children().children().children()
.css({
'width':(100 / _.options.slidesPerRow) + '%',
'display': 'inline-block'
});
}
};
Slick.prototype.checkResponsive = function(initial, forceUpdate) {
var _ = this,
breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false;
var sliderWidth = _.$slider.width();
var windowWidth = window.innerWidth || $(window).width();
if (_.respondTo === 'window') {
respondToWidth = windowWidth;
} else if (_.respondTo === 'slider') {
respondToWidth = sliderWidth;
} else if (_.respondTo === 'min') {
respondToWidth = Math.min(windowWidth, sliderWidth);
}
if ( _.options.responsive &&
_.options.responsive.length &&
_.options.responsive !== null) {
targetBreakpoint = null;
for (breakpoint in _.breakpoints) {
if (_.breakpoints.hasOwnProperty(breakpoint)) {
if (_.originalSettings.mobileFirst === false) {
if (respondToWidth < _.breakpoints[breakpoint]) {
targetBreakpoint = _.breakpoints[breakpoint];
}
} else {
if (respondToWidth > _.breakpoints[breakpoint]) {
targetBreakpoint = _.breakpoints[breakpoint];
}
}
}
}
if (targetBreakpoint !== null) {
if (_.activeBreakpoint !== null) {
if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) {
_.activeBreakpoint =
targetBreakpoint;
if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
_.unslick(targetBreakpoint);
} else {
_.options = $.extend({}, _.originalSettings,
_.breakpointSettings[
targetBreakpoint]);
if (initial === true) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint = targetBreakpoint;
}
} else {
_.activeBreakpoint = targetBreakpoint;
if (_.breakpointSettings[targetBreakpoint] === 'unslick') {
_.unslick(targetBreakpoint);
} else {
_.options = $.extend({}, _.originalSettings,
_.breakpointSettings[
targetBreakpoint]);
if (initial === true) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
}
triggerBreakpoint = targetBreakpoint;
}
} else {
if (_.activeBreakpoint !== null) {
_.activeBreakpoint = null;
_.options = _.originalSettings;
if (initial === true) {
_.currentSlide = _.options.initialSlide;
}
_.refresh(initial);
triggerBreakpoint = targetBreakpoint;
}
}
// only trigger breakpoints during an actual break. not on initialize.
if( !initial && triggerBreakpoint !== false ) {
_.$slider.trigger('breakpoint', [_, triggerBreakpoint]);
}
}
};
Slick.prototype.changeSlide = function(event, dontAnimate) {
var _ = this,
$target = $(event.currentTarget),
indexOffset, slideOffset, unevenOffset;
// If target is a link, prevent default action.
if($target.is('a')) {
event.preventDefault();
}
// If target is not the <li> element (ie: a child), find the <li>.
if(!$target.is('li')) {
$target = $target.closest('li');
}
unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0);
indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll;
switch (event.data.message) {
case 'previous':
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset;
if (_.slideCount > _.options.slidesToShow) {
_.slideHandler(_.currentSlide - slideOffset, false, dontAnimate);
}
break;
case 'next':
slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset;
if (_.slideCount > _.options.slidesToShow) {
_.slideHandler(_.currentSlide + slideOffset, false, dontAnimate);
}
break;
case 'index':
var index = event.data.index === 0 ? 0 :
event.data.index || $target.index() * _.options.slidesToScroll;
_.slideHandler(_.checkNavigable(index), false, dontAnimate);
$target.children().trigger('focus');
break;
default:
return;
}
};
Slick.prototype.checkNavigable = function(index) {
var _ = this,
navigables, prevNavigable;
navigables = _.getNavigableIndexes();
prevNavigable = 0;
if (index > navigables[navigables.length - 1]) {
index = navigables[navigables.length - 1];
} else {
for (var n in navigables) {
if (index < navigables[n]) {
index = prevNavigable;
break;
}
prevNavigable = navigables[n];
}
}
return index;
};
Slick.prototype.cleanUpEvents = function() {
var _ = this;
if (_.options.dots && _.$dots !== null) {
$('li', _.$dots)
.off('click.slick', _.changeSlide)
.off('mouseenter.slick', $.proxy(_.interrupt, _, true))
.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
if (_.options.accessibility === true) {
_.$dots.off('keydown.slick', _.keyHandler);
}
}
_.$slider.off('focus.slick blur.slick');
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide);
_.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide);
if (_.options.accessibility === true) {
_.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler);
_.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler);
}
}
_.$list.off('touchstart.slick mousedown.slick', _.swipeHandler);
_.$list.off('touchmove.slick mousemove.slick', _.swipeHandler);
_.$list.off('touchend.slick mouseup.slick', _.swipeHandler);
_.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler);
_.$list.off('click.slick', _.clickHandler);
$(document).off(_.visibilityChange, _.visibility);
_.cleanUpSlideEvents();
if (_.options.accessibility === true) {
_.$list.off('keydown.slick', _.keyHandler);
}
if (_.options.focusOnSelect === true) {
$(_.$slideTrack).children().off('click.slick', _.selectHandler);
}
$(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange);
$(window).off('resize.slick.slick-' + _.instanceUid, _.resize);
$('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault);
$(window).off('load.slick.slick-' + _.instanceUid, _.setPosition);
};
Slick.prototype.cleanUpSlideEvents = function() {
var _ = this;
_.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true));
_.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false));
};
Slick.prototype.cleanUpRows = function() {
var _ = this, originalSlides;
if(_.options.rows > 0) {
originalSlides = _.$slides.children().children();
originalSlides.removeAttr('style');
_.$slider.empty().append(originalSlides);
}
};
Slick.prototype.clickHandler = function(event) {
var _ = this;
if (_.shouldClick === false) {
event.stopImmediatePropagation();
event.stopPropagation();
event.preventDefault();
}
};
Slick.prototype.destroy = function(refresh) {
var _ = this;
_.autoPlayClear();
_.touchObject = {};
_.cleanUpEvents();
$('.slick-cloned', _.$slider).detach();
if (_.$dots) {
_.$dots.remove();
}
if ( _.$prevArrow && _.$prevArrow.length ) {
_.$prevArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css('display','');
if ( _.htmlExpr.test( _.options.prevArrow )) {
_.$prevArrow.remove();
}
}
if ( _.$nextArrow && _.$nextArrow.length ) {
_.$nextArrow
.removeClass('slick-disabled slick-arrow slick-hidden')
.removeAttr('aria-hidden aria-disabled tabindex')
.css('display','');
if ( _.htmlExpr.test( _.options.nextArrow )) {
_.$nextArrow.remove();
}
}
if (_.$slides) {
_.$slides
.removeClass('slick-slide slick-active slick-center slick-visible slick-current')
.removeAttr('aria-hidden')
.removeAttr('data-slick-index')
.each(function(){
$(this).attr('style', $(this).data('originalStyling'));
});
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.detach();
_.$list.detach();
_.$slider.append(_.$slides);
}
_.cleanUpRows();
_.$slider.removeClass('slick-slider');
_.$slider.removeClass('slick-initialized');
_.$slider.removeClass('slick-dotted');
_.unslicked = true;
if(!refresh) {
_.$slider.trigger('destroy', [_]);
}
};
Slick.prototype.disableTransition = function(slide) {
var _ = this,
transition = {};
transition[_.transitionType] = '';
if (_.options.fade === false) {
_.$slideTrack.css(transition);
} else {
_.$slides.eq(slide).css(transition);
}
};
Slick.prototype.fadeSlide = function(slideIndex, callback) {
var _ = this;
if (_.cssTransitions === false) {
_.$slides.eq(slideIndex).css({
zIndex: _.options.zIndex
});
_.$slides.eq(slideIndex).animate({
opacity: 1
}, _.options.speed, _.options.easing, callback);
} else {
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity: 1,
zIndex: _.options.zIndex
});
if (callback) {
setTimeout(function() {
_.disableTransition(slideIndex);
callback.call();
}, _.options.speed);
}
}
};
Slick.prototype.fadeSlideOut = function(slideIndex) {
var _ = this;
if (_.cssTransitions === false) {
_.$slides.eq(slideIndex).animate({
opacity: 0,
zIndex: _.options.zIndex - 2
}, _.options.speed, _.options.easing);
} else {
_.applyTransition(slideIndex);
_.$slides.eq(slideIndex).css({
opacity: 0,
zIndex: _.options.zIndex - 2
});
}
};
Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) {
var _ = this;
if (filter !== null) {
_.$slidesCache = _.$slides;
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.filter(filter).appendTo(_.$slideTrack);
_.reinit();
}
};
Slick.prototype.focusHandler = function() {
var _ = this;
_.$slider
.off('focus.slick blur.slick')
.on('focus.slick blur.slick', '*', function(event) {
event.stopImmediatePropagation();
var $sf = $(this);
setTimeout(function() {
if( _.options.pauseOnFocus ) {
_.focussed = $sf.is(':focus');
_.autoPlay();
}
}, 0);
});
};
Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() {
var _ = this;
return _.currentSlide;
};
Slick.prototype.getDotCount = function() {
var _ = this;
var breakPoint = 0;
var counter = 0;
var pagerQty = 0;
if (_.options.infinite === true) {
if (_.slideCount <= _.options.slidesToShow) {
++pagerQty;
} else {
while (breakPoint < _.slideCount) {
++pagerQty;
breakPoint = counter + _.options.slidesToScroll;
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
}
}
} else if (_.options.centerMode === true) {
pagerQty = _.slideCount;
} else if(!_.options.asNavFor) {
pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll);
}else {
while (breakPoint < _.slideCount) {
++pagerQty;
breakPoint = counter + _.options.slidesToScroll;
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
}
}
return pagerQty - 1;
};
Slick.prototype.getLeft = function(slideIndex) {
var _ = this,
targetLeft,
verticalHeight,
verticalOffset = 0,
targetSlide,
coef;
_.slideOffset = 0;
verticalHeight = _.$slides.first().outerHeight(true);
if (_.options.infinite === true) {
if (_.slideCount > _.options.slidesToShow) {
_.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1;
coef = -1
if (_.options.vertical === true && _.options.centerMode === true) {
if (_.options.slidesToShow === 2) {
coef = -1.5;
} else if (_.options.slidesToShow === 1) {
coef = -2
}
}
verticalOffset = (verticalHeight * _.options.slidesToShow) * coef;
}
if (_.slideCount % _.options.slidesToScroll !== 0) {
if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) {
if (slideIndex > _.slideCount) {
_.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1;
verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1;
} else {
_.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1;
verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1;
}
}
}
} else {
if (slideIndex + _.options.slidesToShow > _.slideCount) {
_.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth;
verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight;
}
}
if (_.slideCount <= _.options.slidesToShow) {
_.slideOffset = 0;
verticalOffset = 0;
}
if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) {
_.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2);
} else if (_.options.centerMode === true && _.options.infinite === true) {
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth;
} else if (_.options.centerMode === true) {
_.slideOffset = 0;
_.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2);
}
if (_.options.vertical === false) {
targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset;
} else {
targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset;
}
if (_.options.variableWidth === true) {
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
} else {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow);
}
if (_.options.rtl === true) {
if (targetSlide[0]) {
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
} else {
targetLeft = 0;
}
} else {
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
}
if (_.options.centerMode === true) {
if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex);
} else {
targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1);
}
if (_.options.rtl === true) {
if (targetSlide[0]) {
targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1;
} else {
targetLeft = 0;
}
} else {
targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0;
}
targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2;
}
}
return targetLeft;
};
Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) {
var _ = this;
return _.options[option];
};
Slick.prototype.getNavigableIndexes = function() {
var _ = this,
breakPoint = 0,
counter = 0,
indexes = [],
max;
if (_.options.infinite === false) {
max = _.slideCount;
} else {
breakPoint = _.options.slidesToScroll * -1;
counter = _.options.slidesToScroll * -1;
max = _.slideCount * 2;
}
while (breakPoint < max) {
indexes.push(breakPoint);
breakPoint = counter + _.options.slidesToScroll;
counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow;
}
return indexes;
};
Slick.prototype.getSlick = function() {
return this;
};
Slick.prototype.getSlideCount = function() {
var _ = this,
slidesTraversed, swipedSlide, centerOffset;
centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0;
if (_.options.swipeToSlide === true) {
_.$slideTrack.find('.slick-slide').each(function(index, slide) {
if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) {
swipedSlide = slide;
return false;
}
});
slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1;
return slidesTraversed;
} else {
return _.options.slidesToScroll;
}
};
Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) {
var _ = this;
_.changeSlide({
data: {
message: 'index',
index: parseInt(slide)
}
}, dontAnimate);
};
Slick.prototype.init = function(creation) {
var _ = this;
if (!$(_.$slider).hasClass('slick-initialized')) {
$(_.$slider).addClass('slick-initialized');
_.buildRows();
_.buildOut();
_.setProps();
_.startLoad();
_.loadSlider();
_.initializeEvents();
_.updateArrows();
_.updateDots();
_.checkResponsive(true);
_.focusHandler();
}
if (creation) {
_.$slider.trigger('init', [_]);
}
if (_.options.accessibility === true) {
_.initADA();
}
if ( _.options.autoplay ) {
_.paused = false;
_.autoPlay();
}
};
Slick.prototype.initADA = function() {
var _ = this,
numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow),
tabControlIndexes = _.getNavigableIndexes().filter(function(val) {
return (val >= 0) && (val < _.slideCount);
});
_.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({
'aria-hidden': 'true',
'tabindex': '-1'
}).find('a, input, button, select').attr({
'tabindex': '-1'
});
if (_.$dots !== null) {
_.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) {
var slideControlIndex = tabControlIndexes.indexOf(i);
$(this).attr({
'role': 'tabpanel',
'id': 'slick-slide' + _.instanceUid + i,
'tabindex': -1
});
if (slideControlIndex !== -1) {
var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex
if ($('#' + ariaButtonControl).length) {
$(this).attr({
'aria-describedby': ariaButtonControl
});
}
}
});
_.$dots.attr('role', 'tablist').find('li').each(function(i) {
var mappedSlideIndex = tabControlIndexes[i];
$(this).attr({
'role': 'presentation'
});
$(this).find('button').first().attr({
'role': 'tab',
'id': 'slick-slide-control' + _.instanceUid + i,
'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex,
'aria-label': (i + 1) + ' of ' + numDotGroups,
'aria-selected': null,
'tabindex': '-1'
});
}).eq(_.currentSlide).find('button').attr({
'aria-selected': 'true',
'tabindex': '0'
}).end();
}
for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) {
if (_.options.focusOnChange) {
_.$slides.eq(i).attr({'tabindex': '0'});
} else {
_.$slides.eq(i).removeAttr('tabindex');
}
}
_.activateADA();
};
Slick.prototype.initArrowEvents = function() {
var _ = this;
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow
.off('click.slick')
.on('click.slick', {
message: 'previous'
}, _.changeSlide);
_.$nextArrow
.off('click.slick')
.on('click.slick', {
message: 'next'
}, _.changeSlide);
if (_.options.accessibility === true) {
_.$prevArrow.on('keydown.slick', _.keyHandler);
_.$nextArrow.on('keydown.slick', _.keyHandler);
}
}
};
Slick.prototype.initDotEvents = function() {
var _ = this;
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
$('li', _.$dots).on('click.slick', {
message: 'index'
}, _.changeSlide);
if (_.options.accessibility === true) {
_.$dots.on('keydown.slick', _.keyHandler);
}
}
if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) {
$('li', _.$dots)
.on('mouseenter.slick', $.proxy(_.interrupt, _, true))
.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
}
};
Slick.prototype.initSlideEvents = function() {
var _ = this;
if ( _.options.pauseOnHover ) {
_.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true));
_.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false));
}
};
Slick.prototype.initializeEvents = function() {
var _ = this;
_.initArrowEvents();
_.initDotEvents();
_.initSlideEvents();
_.$list.on('touchstart.slick mousedown.slick', {
action: 'start'
}, _.swipeHandler);
_.$list.on('touchmove.slick mousemove.slick', {
action: 'move'
}, _.swipeHandler);
_.$list.on('touchend.slick mouseup.slick', {
action: 'end'
}, _.swipeHandler);
_.$list.on('touchcancel.slick mouseleave.slick', {
action: 'end'
}, _.swipeHandler);
_.$list.on('click.slick', _.clickHandler);
$(document).on(_.visibilityChange, $.proxy(_.visibility, _));
if (_.options.accessibility === true) {
_.$list.on('keydown.slick', _.keyHandler);
}
if (_.options.focusOnSelect === true) {
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
}
$(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _));
$(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _));
$('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault);
$(window).on('load.slick.slick-' + _.instanceUid, _.setPosition);
$(_.setPosition);
};
Slick.prototype.initUI = function() {
var _ = this;
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.show();
_.$nextArrow.show();
}
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
_.$dots.show();
}
};
Slick.prototype.keyHandler = function(event) {
var _ = this;
//Dont slide if the cursor is inside the form fields and arrow keys are pressed
if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) {
if (event.keyCode === 37 && _.options.accessibility === true) {
_.changeSlide({
data: {
message: _.options.rtl === true ? 'next' : 'previous'
}
});
} else if (event.keyCode === 39 && _.options.accessibility === true) {
_.changeSlide({
data: {
message: _.options.rtl === true ? 'previous' : 'next'
}
});
}
}
};
Slick.prototype.lazyLoad = function() {
var _ = this,
loadRange, cloneRange, rangeStart, rangeEnd;
function loadImages(imagesScope) {
$('img[data-lazy]', imagesScope).each(function() {
var image = $(this),
imageSource = $(this).attr('data-lazy'),
imageSrcSet = $(this).attr('data-srcset'),
imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'),
imageToLoad = document.createElement('img');
imageToLoad.onload = function() {
image
.animate({ opacity: 0 }, 100, function() {
if (imageSrcSet) {
image
.attr('srcset', imageSrcSet );
if (imageSizes) {
image
.attr('sizes', imageSizes );
}
}
image
.attr('src', imageSource)
.animate({ opacity: 1 }, 200, function() {
image
.removeAttr('data-lazy data-srcset data-sizes')
.removeClass('slick-loading');
});
_.$slider.trigger('lazyLoaded', [_, image, imageSource]);
});
};
imageToLoad.onerror = function() {
image
.removeAttr( 'data-lazy' )
.removeClass( 'slick-loading' )
.addClass( 'slick-lazyload-error' );
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
};
imageToLoad.src = imageSource;
});
}
if (_.options.centerMode === true) {
if (_.options.infinite === true) {
rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1);
rangeEnd = rangeStart + _.options.slidesToShow + 2;
} else {
rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1));
rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide;
}
} else {
rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide;
rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow);
if (_.options.fade === true) {
if (rangeStart > 0) rangeStart--;
if (rangeEnd <= _.slideCount) rangeEnd++;
}
}
loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd);
if (_.options.lazyLoad === 'anticipated') {
var prevSlide = rangeStart - 1,
nextSlide = rangeEnd,
$slides = _.$slider.find('.slick-slide');
for (var i = 0; i < _.options.slidesToScroll; i++) {
if (prevSlide < 0) prevSlide = _.slideCount - 1;
loadRange = loadRange.add($slides.eq(prevSlide));
loadRange = loadRange.add($slides.eq(nextSlide));
prevSlide--;
nextSlide++;
}
}
loadImages(loadRange);
if (_.slideCount <= _.options.slidesToShow) {
cloneRange = _.$slider.find('.slick-slide');
loadImages(cloneRange);
} else
if (_.currentSlide >= _.slideCount - _.options.slidesToShow) {
cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow);
loadImages(cloneRange);
} else if (_.currentSlide === 0) {
cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1);
loadImages(cloneRange);
}
};
Slick.prototype.loadSlider = function() {
var _ = this;
_.setPosition();
_.$slideTrack.css({
opacity: 1
});
_.$slider.removeClass('slick-loading');
_.initUI();
if (_.options.lazyLoad === 'progressive') {
_.progressiveLazyLoad();
}
};
Slick.prototype.next = Slick.prototype.slickNext = function() {
var _ = this;
_.changeSlide({
data: {
message: 'next'
}
});
};
Slick.prototype.orientationChange = function() {
var _ = this;
_.checkResponsive();
_.setPosition();
};
Slick.prototype.pause = Slick.prototype.slickPause = function() {
var _ = this;
_.autoPlayClear();
_.paused = true;
};
Slick.prototype.play = Slick.prototype.slickPlay = function() {
var _ = this;
_.autoPlay();
_.options.autoplay = true;
_.paused = false;
_.focussed = false;
_.interrupted = false;
};
Slick.prototype.postSlide = function(index) {
var _ = this;
if( !_.unslicked ) {
_.$slider.trigger('afterChange', [_, index]);
_.animating = false;
if (_.slideCount > _.options.slidesToShow) {
_.setPosition();
}
_.swipeLeft = null;
if ( _.options.autoplay ) {
_.autoPlay();
}
if (_.options.accessibility === true) {
_.initADA();
if (_.options.focusOnChange) {
var $currentSlide = $(_.$slides.get(_.currentSlide));
$currentSlide.attr('tabindex', 0).focus();
}
}
}
};
Slick.prototype.prev = Slick.prototype.slickPrev = function() {
var _ = this;
_.changeSlide({
data: {
message: 'previous'
}
});
};
Slick.prototype.preventDefault = function(event) {
event.preventDefault();
};
Slick.prototype.progressiveLazyLoad = function( tryCount ) {
tryCount = tryCount || 1;
var _ = this,
$imgsToLoad = $( 'img[data-lazy]', _.$slider ),
image,
imageSource,
imageSrcSet,
imageSizes,
imageToLoad;
if ( $imgsToLoad.length ) {
image = $imgsToLoad.first();
imageSource = image.attr('data-lazy');
imageSrcSet = image.attr('data-srcset');
imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes');
imageToLoad = document.createElement('img');
imageToLoad.onload = function() {
if (imageSrcSet) {
image
.attr('srcset', imageSrcSet );
if (imageSizes) {
image
.attr('sizes', imageSizes );
}
}
image
.attr( 'src', imageSource )
.removeAttr('data-lazy data-srcset data-sizes')
.removeClass('slick-loading');
if ( _.options.adaptiveHeight === true ) {
_.setPosition();
}
_.$slider.trigger('lazyLoaded', [ _, image, imageSource ]);
_.progressiveLazyLoad();
};
imageToLoad.onerror = function() {
if ( tryCount < 3 ) {
/**
* try to load the image 3 times,
* leave a slight delay so we don't get
* servers blocking the request.
*/
setTimeout( function() {
_.progressiveLazyLoad( tryCount + 1 );
}, 500 );
} else {
image
.removeAttr( 'data-lazy' )
.removeClass( 'slick-loading' )
.addClass( 'slick-lazyload-error' );
_.$slider.trigger('lazyLoadError', [ _, image, imageSource ]);
_.progressiveLazyLoad();
}
};
imageToLoad.src = imageSource;
} else {
_.$slider.trigger('allImagesLoaded', [ _ ]);
}
};
Slick.prototype.refresh = function( initializing ) {
var _ = this, currentSlide, lastVisibleIndex;
lastVisibleIndex = _.slideCount - _.options.slidesToShow;
// in non-infinite sliders, we don't want to go past the
// last visible index.
if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) {
_.currentSlide = lastVisibleIndex;
}
// if less slides than to show, go to start.
if ( _.slideCount <= _.options.slidesToShow ) {
_.currentSlide = 0;
}
currentSlide = _.currentSlide;
_.destroy(true);
$.extend(_, _.initials, { currentSlide: currentSlide });
_.init();
if( !initializing ) {
_.changeSlide({
data: {
message: 'index',
index: currentSlide
}
}, false);
}
};
Slick.prototype.registerBreakpoints = function() {
var _ = this, breakpoint, currentBreakpoint, l,
responsiveSettings = _.options.responsive || null;
if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) {
_.respondTo = _.options.respondTo || 'window';
for ( breakpoint in responsiveSettings ) {
l = _.breakpoints.length-1;
if (responsiveSettings.hasOwnProperty(breakpoint)) {
currentBreakpoint = responsiveSettings[breakpoint].breakpoint;
// loop through the breakpoints and cut out any existing
// ones with the same breakpoint number, we don't want dupes.
while( l >= 0 ) {
if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) {
_.breakpoints.splice(l,1);
}
l--;
}
_.breakpoints.push(currentBreakpoint);
_.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings;
}
}
_.breakpoints.sort(function(a, b) {
return ( _.options.mobileFirst ) ? a-b : b-a;
});
}
};
Slick.prototype.reinit = function() {
var _ = this;
_.$slides =
_.$slideTrack
.children(_.options.slide)
.addClass('slick-slide');
_.slideCount = _.$slides.length;
if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) {
_.currentSlide = _.currentSlide - _.options.slidesToScroll;
}
if (_.slideCount <= _.options.slidesToShow) {
_.currentSlide = 0;
}
_.registerBreakpoints();
_.setProps();
_.setupInfinite();
_.buildArrows();
_.updateArrows();
_.initArrowEvents();
_.buildDots();
_.updateDots();
_.initDotEvents();
_.cleanUpSlideEvents();
_.initSlideEvents();
_.checkResponsive(false, true);
if (_.options.focusOnSelect === true) {
$(_.$slideTrack).children().on('click.slick', _.selectHandler);
}
_.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0);
_.setPosition();
_.focusHandler();
_.paused = !_.options.autoplay;
_.autoPlay();
_.$slider.trigger('reInit', [_]);
};
Slick.prototype.resize = function() {
var _ = this;
if ($(window).width() !== _.windowWidth) {
clearTimeout(_.windowDelay);
_.windowDelay = window.setTimeout(function() {
_.windowWidth = $(window).width();
_.checkResponsive();
if( !_.unslicked ) { _.setPosition(); }
}, 50);
}
};
Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) {
var _ = this;
if (typeof(index) === 'boolean') {
removeBefore = index;
index = removeBefore === true ? 0 : _.slideCount - 1;
} else {
index = removeBefore === true ? --index : index;
}
if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) {
return false;
}
_.unload();
if (removeAll === true) {
_.$slideTrack.children().remove();
} else {
_.$slideTrack.children(this.options.slide).eq(index).remove();
}
_.$slides = _.$slideTrack.children(this.options.slide);
_.$slideTrack.children(this.options.slide).detach();
_.$slideTrack.append(_.$slides);
_.$slidesCache = _.$slides;
_.reinit();
};
Slick.prototype.setCSS = function(position) {
var _ = this,
positionProps = {},
x, y;
if (_.options.rtl === true) {
position = -position;
}
x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px';
y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px';
positionProps[_.positionProp] = position;
if (_.transformsEnabled === false) {
_.$slideTrack.css(positionProps);
} else {
positionProps = {};
if (_.cssTransitions === false) {
positionProps[_.animType] = 'translate(' + x + ', ' + y + ')';
_.$slideTrack.css(positionProps);
} else {
positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)';
_.$slideTrack.css(positionProps);
}
}
};
Slick.prototype.setDimensions = function() {
var _ = this;
if (_.options.vertical === false) {
if (_.options.centerMode === true) {
_.$list.css({
padding: ('0px ' + _.options.centerPadding)
});
}
} else {
_.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow);
if (_.options.centerMode === true) {
_.$list.css({
padding: (_.options.centerPadding + ' 0px')
});
}
}
_.listWidth = _.$list.width();
_.listHeight = _.$list.height();
if (_.options.vertical === false && _.options.variableWidth === false) {
_.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow);
_.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length)));
} else if (_.options.variableWidth === true) {
_.$slideTrack.width(5000 * _.slideCount);
} else {
_.slideWidth = Math.ceil(_.listWidth);
_.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length)));
}
var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width();
if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset);
};
Slick.prototype.setFade = function() {
var _ = this,
targetLeft;
_.$slides.each(function(index, element) {
targetLeft = (_.slideWidth * index) * -1;
if (_.options.rtl === true) {
$(element).css({
position: 'relative',
right: targetLeft,
top: 0,
zIndex: _.options.zIndex - 2,
opacity: 0
});
} else {
$(element).css({
position: 'relative',
left: targetLeft,
top: 0,
zIndex: _.options.zIndex - 2,
opacity: 0
});
}
});
_.$slides.eq(_.currentSlide).css({
zIndex: _.options.zIndex - 1,
opacity: 1
});
};
Slick.prototype.setHeight = function() {
var _ = this;
if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) {
var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true);
_.$list.css('height', targetHeight);
}
};
Slick.prototype.setOption =
Slick.prototype.slickSetOption = function() {
/**
* accepts arguments in format of:
*
* - for changing a single option's value:
* .slick("setOption", option, value, refresh )
*
* - for changing a set of responsive options:
* .slick("setOption", 'responsive', [{}, ...], refresh )
*
* - for updating multiple values at once (not responsive)
* .slick("setOption", { 'option': value, ... }, refresh )
*/
var _ = this, l, item, option, value, refresh = false, type;
if( $.type( arguments[0] ) === 'object' ) {
option = arguments[0];
refresh = arguments[1];
type = 'multiple';
} else if ( $.type( arguments[0] ) === 'string' ) {
option = arguments[0];
value = arguments[1];
refresh = arguments[2];
if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) {
type = 'responsive';
} else if ( typeof arguments[1] !== 'undefined' ) {
type = 'single';
}
}
if ( type === 'single' ) {
_.options[option] = value;
} else if ( type === 'multiple' ) {
$.each( option , function( opt, val ) {
_.options[opt] = val;
});
} else if ( type === 'responsive' ) {
for ( item in value ) {
if( $.type( _.options.responsive ) !== 'array' ) {
_.options.responsive = [ value[item] ];
} else {
l = _.options.responsive.length-1;
// loop through the responsive object and splice out duplicates.
while( l >= 0 ) {
if( _.options.responsive[l].breakpoint === value[item].breakpoint ) {
_.options.responsive.splice(l,1);
}
l--;
}
_.options.responsive.push( value[item] );
}
}
}
if ( refresh ) {
_.unload();
_.reinit();
}
};
Slick.prototype.setPosition = function() {
var _ = this;
_.setDimensions();
_.setHeight();
if (_.options.fade === false) {
_.setCSS(_.getLeft(_.currentSlide));
} else {
_.setFade();
}
_.$slider.trigger('setPosition', [_]);
};
Slick.prototype.setProps = function() {
var _ = this,
bodyStyle = document.body.style;
_.positionProp = _.options.vertical === true ? 'top' : 'left';
if (_.positionProp === 'top') {
_.$slider.addClass('slick-vertical');
} else {
_.$slider.removeClass('slick-vertical');
}
if (bodyStyle.WebkitTransition !== undefined ||
bodyStyle.MozTransition !== undefined ||
bodyStyle.msTransition !== undefined) {
if (_.options.useCSS === true) {
_.cssTransitions = true;
}
}
if ( _.options.fade ) {
if ( typeof _.options.zIndex === 'number' ) {
if( _.options.zIndex < 3 ) {
_.options.zIndex = 3;
}
} else {
_.options.zIndex = _.defaults.zIndex;
}
}
if (bodyStyle.OTransform !== undefined) {
_.animType = 'OTransform';
_.transformType = '-o-transform';
_.transitionType = 'OTransition';
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
}
if (bodyStyle.MozTransform !== undefined) {
_.animType = 'MozTransform';
_.transformType = '-moz-transform';
_.transitionType = 'MozTransition';
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false;
}
if (bodyStyle.webkitTransform !== undefined) {
_.animType = 'webkitTransform';
_.transformType = '-webkit-transform';
_.transitionType = 'webkitTransition';
if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false;
}
if (bodyStyle.msTransform !== undefined) {
_.animType = 'msTransform';
_.transformType = '-ms-transform';
_.transitionType = 'msTransition';
if (bodyStyle.msTransform === undefined) _.animType = false;
}
if (bodyStyle.transform !== undefined && _.animType !== false) {
_.animType = 'transform';
_.transformType = 'transform';
_.transitionType = 'transition';
}
_.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false);
};
Slick.prototype.setSlideClasses = function(index) {
var _ = this,
centerOffset, allSlides, indexOffset, remainder;
allSlides = _.$slider
.find('.slick-slide')
.removeClass('slick-active slick-center slick-current')
.attr('aria-hidden', 'true');
_.$slides
.eq(index)
.addClass('slick-current');
if (_.options.centerMode === true) {
var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0;
centerOffset = Math.floor(_.options.slidesToShow / 2);
if (_.options.infinite === true) {
if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) {
_.$slides
.slice(index - centerOffset + evenCoef, index + centerOffset + 1)
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else {
indexOffset = _.options.slidesToShow + index;
allSlides
.slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}
if (index === 0) {
allSlides
.eq(allSlides.length - 1 - _.options.slidesToShow)
.addClass('slick-center');
} else if (index === _.slideCount - 1) {
allSlides
.eq(_.options.slidesToShow)
.addClass('slick-center');
}
}
_.$slides
.eq(index)
.addClass('slick-center');
} else {
if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) {
_.$slides
.slice(index, index + _.options.slidesToShow)
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else if (allSlides.length <= _.options.slidesToShow) {
allSlides
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else {
remainder = _.slideCount % _.options.slidesToShow;
indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index;
if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) {
allSlides
.slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder)
.addClass('slick-active')
.attr('aria-hidden', 'false');
} else {
allSlides
.slice(indexOffset, indexOffset + _.options.slidesToShow)
.addClass('slick-active')
.attr('aria-hidden', 'false');
}
}
}
if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') {
_.lazyLoad();
}
};
Slick.prototype.setupInfinite = function() {
var _ = this,
i, slideIndex, infiniteCount;
if (_.options.fade === true) {
_.options.centerMode = false;
}
if (_.options.infinite === true && _.options.fade === false) {
slideIndex = null;
if (_.slideCount > _.options.slidesToShow) {
if (_.options.centerMode === true) {
infiniteCount = _.options.slidesToShow + 1;
} else {
infiniteCount = _.options.slidesToShow;
}
for (i = _.slideCount; i > (_.slideCount -
infiniteCount); i -= 1) {
slideIndex = i - 1;
$(_.$slides[slideIndex]).clone(true).attr('id', '')
.attr('data-slick-index', slideIndex - _.slideCount)
.prependTo(_.$slideTrack).addClass('slick-cloned');
}
for (i = 0; i < infiniteCount + _.slideCount; i += 1) {
slideIndex = i;
$(_.$slides[slideIndex]).clone(true).attr('id', '')
.attr('data-slick-index', slideIndex + _.slideCount)
.appendTo(_.$slideTrack).addClass('slick-cloned');
}
_.$slideTrack.find('.slick-cloned').find('[id]').each(function() {
$(this).attr('id', '');
});
}
}
};
Slick.prototype.interrupt = function( toggle ) {
var _ = this;
if( !toggle ) {
_.autoPlay();
}
_.interrupted = toggle;
};
Slick.prototype.selectHandler = function(event) {
var _ = this;
var targetElement =
$(event.target).is('.slick-slide') ?
$(event.target) :
$(event.target).parents('.slick-slide');
var index = parseInt(targetElement.attr('data-slick-index'));
if (!index) index = 0;
if (_.slideCount <= _.options.slidesToShow) {
_.slideHandler(index, false, true);
return;
}
_.slideHandler(index);
};
Slick.prototype.slideHandler = function(index, sync, dontAnimate) {
var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null,
_ = this, navTarget;
sync = sync || false;
if (_.animating === true && _.options.waitForAnimate === true) {
return;
}
if (_.options.fade === true && _.currentSlide === index) {
return;
}
if (sync === false) {
_.asNavFor(index);
}
targetSlide = index;
targetLeft = _.getLeft(targetSlide);
slideLeft = _.getLeft(_.currentSlide);
_.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft;
if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
if (_.options.fade === false) {
targetSlide = _.currentSlide;
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
} else {
_.postSlide(targetSlide);
}
}
return;
} else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
if (_.options.fade === false) {
targetSlide = _.currentSlide;
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
} else {
_.postSlide(targetSlide);
}
}
return;
}
if ( _.options.autoplay ) {
clearInterval(_.autoPlayTimer);
}
if (targetSlide < 0) {
if (_.slideCount % _.options.slidesToScroll !== 0) {
animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll);
} else {
animSlide = _.slideCount + targetSlide;
}
} else if (targetSlide >= _.slideCount) {
if (_.slideCount % _.options.slidesToScroll !== 0) {
animSlide = 0;
} else {
animSlide = targetSlide - _.slideCount;
}
} else {
animSlide = targetSlide;
}
_.animating = true;
_.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]);
oldSlide = _.currentSlide;
_.currentSlide = animSlide;
_.setSlideClasses(_.currentSlide);
if ( _.options.asNavFor ) {
navTarget = _.getNavTarget();
navTarget = navTarget.slick('getSlick');
if ( navTarget.slideCount <= navTarget.options.slidesToShow ) {
navTarget.setSlideClasses(_.currentSlide);
}
}
_.updateDots();
_.updateArrows();
if (_.options.fade === true) {
if (dontAnimate !== true) {
_.fadeSlideOut(oldSlide);
_.fadeSlide(animSlide, function() {
_.postSlide(animSlide);
});
} else {
_.postSlide(animSlide);
}
_.animateHeight();
return;
}
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
_.animateSlide(targetLeft, function() {
_.postSlide(animSlide);
});
} else {
_.postSlide(animSlide);
}
};
Slick.prototype.startLoad = function() {
var _ = this;
if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) {
_.$prevArrow.hide();
_.$nextArrow.hide();
}
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
_.$dots.hide();
}
_.$slider.addClass('slick-loading');
};
Slick.prototype.swipeDirection = function() {
var xDist, yDist, r, swipeAngle, _ = this;
xDist = _.touchObject.startX - _.touchObject.curX;
yDist = _.touchObject.startY - _.touchObject.curY;
r = Math.atan2(yDist, xDist);
swipeAngle = Math.round(r * 180 / Math.PI);
if (swipeAngle < 0) {
swipeAngle = 360 - Math.abs(swipeAngle);
}
if ((swipeAngle <= 45) && (swipeAngle >= 0)) {
return (_.options.rtl === false ? 'left' : 'right');
}
if ((swipeAngle <= 360) && (swipeAngle >= 315)) {
return (_.options.rtl === false ? 'left' : 'right');
}
if ((swipeAngle >= 135) && (swipeAngle <= 225)) {
return (_.options.rtl === false ? 'right' : 'left');
}
if (_.options.verticalSwiping === true) {
if ((swipeAngle >= 35) && (swipeAngle <= 135)) {
return 'down';
} else {
return 'up';
}
}
return 'vertical';
};
Slick.prototype.swipeEnd = function(event) {
var _ = this,
slideCount,
direction;
_.dragging = false;
_.swiping = false;
if (_.scrolling) {
_.scrolling = false;
return false;
}
_.interrupted = false;
_.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true;
if ( _.touchObject.curX === undefined ) {
return false;
}
if ( _.touchObject.edgeHit === true ) {
_.$slider.trigger('edge', [_, _.swipeDirection() ]);
}
if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) {
direction = _.swipeDirection();
switch ( direction ) {
case 'left':
case 'down':
slideCount =
_.options.swipeToSlide ?
_.checkNavigable( _.currentSlide + _.getSlideCount() ) :
_.currentSlide + _.getSlideCount();
_.currentDirection = 0;
break;
case 'right':
case 'up':
slideCount =
_.options.swipeToSlide ?
_.checkNavigable( _.currentSlide - _.getSlideCount() ) :
_.currentSlide - _.getSlideCount();
_.currentDirection = 1;
break;
default:
}
if( direction != 'vertical' ) {
_.slideHandler( slideCount );
_.touchObject = {};
_.$slider.trigger('swipe', [_, direction ]);
}
} else {
if ( _.touchObject.startX !== _.touchObject.curX ) {
_.slideHandler( _.currentSlide );
_.touchObject = {};
}
}
};
Slick.prototype.swipeHandler = function(event) {
var _ = this;
if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) {
return;
} else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) {
return;
}
_.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ?
event.originalEvent.touches.length : 1;
_.touchObject.minSwipe = _.listWidth / _.options
.touchThreshold;
if (_.options.verticalSwiping === true) {
_.touchObject.minSwipe = _.listHeight / _.options
.touchThreshold;
}
switch (event.data.action) {
case 'start':
_.swipeStart(event);
break;
case 'move':
_.swipeMove(event);
break;
case 'end':
_.swipeEnd(event);
break;
}
};
Slick.prototype.swipeMove = function(event) {
var _ = this,
edgeWasHit = false,
curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength;
touches = event.originalEvent !== undefined ? event.originalEvent.touches : null;
if (!_.dragging || _.scrolling || touches && touches.length !== 1) {
return false;
}
curLeft = _.getLeft(_.currentSlide);
_.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX;
_.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY;
_.touchObject.swipeLength = Math.round(Math.sqrt(
Math.pow(_.touchObject.curX - _.touchObject.startX, 2)));
verticalSwipeLength = Math.round(Math.sqrt(
Math.pow(_.touchObject.curY - _.touchObject.startY, 2)));
if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) {
_.scrolling = true;
return false;
}
if (_.options.verticalSwiping === true) {
_.touchObject.swipeLength = verticalSwipeLength;
}
swipeDirection = _.swipeDirection();
if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) {
_.swiping = true;
event.preventDefault();
}
positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1);
if (_.options.verticalSwiping === true) {
positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1;
}
swipeLength = _.touchObject.swipeLength;
_.touchObject.edgeHit = false;
if (_.options.infinite === false) {
if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) {
swipeLength = _.touchObject.swipeLength * _.options.edgeFriction;
_.touchObject.edgeHit = true;
}
}
if (_.options.vertical === false) {
_.swipeLeft = curLeft + swipeLength * positionOffset;
} else {
_.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset;
}
if (_.options.verticalSwiping === true) {
_.swipeLeft = curLeft + swipeLength * positionOffset;
}
if (_.options.fade === true || _.options.touchMove === false) {
return false;
}
if (_.animating === true) {
_.swipeLeft = null;
return false;
}
_.setCSS(_.swipeLeft);
};
Slick.prototype.swipeStart = function(event) {
var _ = this,
touches;
_.interrupted = true;
if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) {
_.touchObject = {};
return false;
}
if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) {
touches = event.originalEvent.touches[0];
}
_.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX;
_.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY;
_.dragging = true;
};
Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() {
var _ = this;
if (_.$slidesCache !== null) {
_.unload();
_.$slideTrack.children(this.options.slide).detach();
_.$slidesCache.appendTo(_.$slideTrack);
_.reinit();
}
};
Slick.prototype.unload = function() {
var _ = this;
$('.slick-cloned', _.$slider).remove();
if (_.$dots) {
_.$dots.remove();
}
if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) {
_.$prevArrow.remove();
}
if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) {
_.$nextArrow.remove();
}
_.$slides
.removeClass('slick-slide slick-active slick-visible slick-current')
.attr('aria-hidden', 'true')
.css('width', '');
};
Slick.prototype.unslick = function(fromBreakpoint) {
var _ = this;
_.$slider.trigger('unslick', [_, fromBreakpoint]);
_.destroy();
};
Slick.prototype.updateArrows = function() {
var _ = this,
centerOffset;
centerOffset = Math.floor(_.options.slidesToShow / 2);
if ( _.options.arrows === true &&
_.slideCount > _.options.slidesToShow &&
!_.options.infinite ) {
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
if (_.currentSlide === 0) {
_.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
} else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) {
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
} else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) {
_.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true');
_.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false');
}
}
};
Slick.prototype.updateDots = function() {
var _ = this;
if (_.$dots !== null) {
_.$dots
.find('li')
.removeClass('slick-active')
.end();
_.$dots
.find('li')
.eq(Math.floor(_.currentSlide / _.options.slidesToScroll))
.addClass('slick-active');
}
};
Slick.prototype.visibility = function() {
var _ = this;
if ( _.options.autoplay ) {
if ( document[_.hidden] ) {
_.interrupted = true;
} else {
_.interrupted = false;
}
}
};
$.fn.slick = function() {
var _ = this,
opt = arguments[0],
args = Array.prototype.slice.call(arguments, 1),
l = _.length,
i,
ret;
for (i = 0; i < l; i++) {
if (typeof opt == 'object' || typeof opt == 'undefined')
_[i].slick = new Slick(_[i], opt);
else
ret = _[i].slick[opt].apply(_[i].slick, args);
if (typeof ret != 'undefined') return ret;
}
return _;
};
}));

View File

@ -0,0 +1,53 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
<h3 class="page-header">Téléchargez vos Fichiers</h3>
<a class="btn btn-default" onClick="closeModal();">Annuler</a>
<form action="{{ oneup_uploader_endpoint('file') }}" name="formfile" class="dropzone" id="MyDropZone" style="margin-top:10px">
</form>
{% endblock %}
{% block localjavascript %}
Dropzone.options.MyDropZone = {
{% if type=="image" %}
acceptedMimeTypes: 'image/*',
{% endif %}
init: function() {
this.on("sending", function(file, xhr, formData) {
formData.append("directory", "{{ id }}");
});
var totalFiles = 0;
var completeFiles = 0;
this.on("addedfile", function (file) {
totalFiles += 1;
});
this.on("removed file", function (file) {
totalFiles -= 1;
});
this.on("complete", function (file) {
completeFiles += 1;
if (completeFiles === totalFiles) {
parent.document.location.reload();
}
});
},
success: function( file, response ){
}
}
function closeModal() {
window.parent.$("#mymodal").modal('hide');
}
$(window).load(function () {
// On vérifie que l'execution se fait bien dans le cadre d'une modal
if(!window.parent.$("#mymodal #framemodal").length) {
$(location).attr('href',"{{ path('cadoles_core_home') }}");
}
});
{% endblock %}

View File

@ -0,0 +1,82 @@
{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
<div class="nav navbar-default" style="margin: 10px 0px">
<ul class="nav navbar-top-links navbar-left">
<li><a>{{ filename }}</a></li>
</ul>
<ul class="nav navbar-top-links navbar-right">
<li><a href="{{ path('cadoles_core_'~access~'_file_download',{'directory':directory,'filename':filename }) }}" style="cursor:pointer"><i class="fa fa-download"></i></a></li>
</ul>
</div>
{% if minefamily == "image" %}
{% if prev is not empty %}
<a href="{{ path('cadoles_core_'~access~'_file_view',{'directory':directory,'filename':prev.name,'navigation':true }) }}">
<div style="background: url({{ prev.thumb }}); background-size:cover; background-position:center; width: 90px; height:90px;float:left;margin-bottom:5px;text-align:center; line-height:90px; color:#fff">
<i class="fa fa-arrow-circle-left fa-4x" style="padding-top:15px"></i>
</div>
</a>
{% endif %}
{% if next is not empty %}
<a href="{{ path('cadoles_core_'~access~'_file_view',{'directory':directory,'filename':next.name,'navigation':true }) }}">
<div style="background: url({{ next.thumb }}); background-size:cover; background-position:center; width: 90px; height:90px;float:right;margin-bottom:5px;text-align:center; line-height:90px; color:#fff">
<i class="fa fa-arrow-circle-right fa-4x" style="padding-top:15px"></i>
</div>
</a>
{% endif %}
<img id="image" src="{{image}}" style="display:block; margin:auto; max-width:100%;">
{% else %}
<iframe id="frameviewfile" src="{{ path('cadoles_core_'~access~'_file_show',{'directory':directory,'filename':filename }) }}"
style="width:100%; height:100%">
</iframe>
{% endif %}
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
$(window).resize(function() {
AjustFrame();
});
AjustFrame();
});
// Ajustement des frames
function AjustFrame() {
var heightbody = $('html').height();
var heightheader = $('.nav').height();
var heightframe = heightbody-heightheader-50;
var widthbody = $('body').width();
if($("#frameviewfile").length>0) {
$("#frameviewfile").height(heightframe);
}
if($("#image").length>0) {
widthbody=widthbody-250;
if(widthbody<950) widthbody="100%";
console.log("euhe"+widthbody);
//$("#image").css({});
$("#image").css("height","auto");
$("#image").css("max-width",widthbody);
if($("#image").height()>heightframe)
$("#image").css({height:heightframe});
}
}
{% endblock %}

View File

@ -66,6 +66,8 @@
'@CadolesCoreBundle/Resources/public/js/jquery.browser.js' '@CadolesCoreBundle/Resources/public/js/jquery.browser.js'
'@CadolesCoreBundle/Resources/public/js/select2.js' '@CadolesCoreBundle/Resources/public/js/select2.js'
'@CadolesCoreBundle/Resources/public/js/select2-fr.js' '@CadolesCoreBundle/Resources/public/js/select2-fr.js'
'@CadolesCoreBundle/Resources/public/js/slick.js'
'@CadolesCoreBundle/Resources/public/js/jsRapClock.js'
'@Tetranz\Select2EntityBundle//Resources/public/js/select2entity.js' '@Tetranz\Select2EntityBundle//Resources/public/js/select2entity.js'
'@CadolesCoreBundle/Resources/public/js/local.js' '@CadolesCoreBundle/Resources/public/js/local.js'
@ -85,6 +87,14 @@
} }
} }
function showHome() {
if($("#appmenu ul:first-child li.active").length)
$("#appmenu ul:first-child li.active a").click();
else
$(location).attr('href',"/{{ alias }}");
}
$(document).ready(function() { $(document).ready(function() {
$(".js-datepicker").datepicker({ $(".js-datepicker").datepicker({
format: "dd/mm/yyyy", format: "dd/mm/yyyy",
@ -118,4 +128,37 @@
$("#page-wrapper").css("border-left","none"); $("#page-wrapper").css("border-left","none");
} }
}); });
// Cacher afficher le menu des widgets
$( ".widget").hover(function() {
if($(this).children(".widgetmenu").length) {
var widthwidget=$(this).width();
var widthtitle=$(this).children(".widgetheader").children(".title").width();
var widthmenu=$(this).children(".widgetmenu").width();
if(widthtitle+widthmenu+10>widthwidget) $(this).children(".widgetheader").children(".title").hide();
$(this).children(".widgetmenu").show();
}
});
$( ".widget" ).mouseleave(function() {
$(this).children(".widgetmenu").hide();
$(this).children(".widgetheader").children(".title").show();
});
$( ".grid-item-content").hover(function() {
$(this).children(".item-heart").show();
$(this).children(".item-delete").show();
$(this).children(".item-update").show();
$(this).children(".item-preview").show();
});
$( ".grid-item-content" ).mouseleave(function() {
$(this).children(".item-heart").hide();
$(this).children(".item-delete").hide();
$(this).children(".item-update").hide();
$(this).children(".item-preview").hide();
});
</script> </script>

View File

@ -29,6 +29,9 @@
'@CadolesCoreBundle/Resources/public/css/bootstrap-slider.css' '@CadolesCoreBundle/Resources/public/css/bootstrap-slider.css'
'@CadolesCoreBundle/Resources/public/css/bootstrap-iconpicker.min.css' '@CadolesCoreBundle/Resources/public/css/bootstrap-iconpicker.min.css'
'@CadolesCoreBundle/Resources/public/css/select2.min.css' '@CadolesCoreBundle/Resources/public/css/select2.min.css'
'@CadolesCoreBundle/Resources/public/css/slick.css'
'@CadolesCoreBundle/Resources/public/css/slick-theme.css'
'@CadolesCoreBundle/Resources/public/css/jsRapClock.css'
'@CadolesCoreBundle/Resources/public/css/font.css' '@CadolesCoreBundle/Resources/public/css/font.css'
'@CadolesCoreBundle/Resources/public/css/style.css' '@CadolesCoreBundle/Resources/public/css/style.css'
@ -64,13 +67,23 @@
float:left; float:left;
} }
.navbar {
min-height: 40px;
}
.navbar-top-links li a {
padding: 5px 10px;
font-size: 18px;
min-height: 40px;
}
@media (max-width: 767px) { @media (max-width: 767px) {
.header { display: none } .header { display: none }
.navbarheader { display: none } .navbarheader { display: none }
.navbarsmall { display: block !important} .navbarsmall { display: block !important}
} }
.navbar-top-links li a { .navbar-right li a {
padding: 0px; padding: 0px;
font-size: 35px; font-size: 35px;
} }
@ -100,23 +113,28 @@
border: 2px dotted #3498db; border: 2px dotted #3498db;
} }
.alert-list-item { .cat-list-item {
min-height: 50px; display: inline-block;
margin-top: 5px; padding: 8px;
margin-top: 10px;
margin-right: 5px;
cursor:pointer;
} }
.alert-list-item-placeholder { .list-item {
min-height: 50px;
margin-top: 10px;
color:#ffffff;
border-radius: 0px;
margin-bottom: 0px;
}
.list-item-placeholder {
border: 2px dotted #3498db; border: 2px dotted #3498db;
} }
.portalalert { .list-item .panel-heading,
color:#ffffff; .list-item .panel-heading a{
border-radius: 0px;
margin-bottom: 5px;
}
.portalalert .panel-heading,
.portalalert .panel-heading a{
color:#ffffff; color:#ffffff;
font-size: 22px; font-size: 22px;
padding-bottom: 0px; padding-bottom: 0px;
@ -142,6 +160,7 @@
background: transparent; background: transparent;
cursor: pointer; cursor: pointer;
padding-top: 10px; padding-top: 10px;
margin:0px;
} }
.grid { .grid {
@ -151,7 +170,6 @@
width: 100%; width: 100%;
min-height: 30px; min-height: 30px;
background: transparent; background: transparent;
margin-bottom: 20px;
} }
.grid .grid-item, .grid .grid-item,
@ -227,6 +245,7 @@
margin-bottom: 5px; margin-bottom: 5px;
text-transform: uppercase; text-transform: uppercase;
color: #fff; color: #fff;
word-wrap: break-word;
} }
.grid-item-placeholder { .grid-item-placeholder {
@ -234,13 +253,37 @@
} }
a.item-preview { a.item-preview {
display: block; display: none;
position: absolute; position: absolute;
right: 5px; right: 5px;
top: 2px; top: 2px;
z-index: 1000; z-index: 1000;
} }
a.item-update {
display: none;
position: absolute;
right: 5px;
top: 2px;
z-index: 1000;
}
a.item-delete {
display: none;
position: absolute;
right: 5px;
top: 2px;
z-index: 1000;
}
a.item-heart {
display: none;
position: absolute;
left: 5px;
top: 2px;
z-index: 1000;
}
.grid-item-body { .grid-item-body {
height:200px; height:200px;
overflow-y:auto; overflow-y:auto;
@ -307,20 +350,36 @@
.grid .grid-small .grid-item-title h2 { font-size:10px; border-bottom: none; } .grid .grid-small .grid-item-title h2 { font-size:10px; border-bottom: none; }
.grid .grid-small .grid-item-title span { display: none } .grid .grid-small .grid-item-title span { display: none }
.grid .grid-image {
.pagemenu { width:20%;
margin: 0px -30px; height:auto;
padding: 0px 30px;
font-size:20px;
line-height: 40px;
display:none
} }
.navpagemenu { .grid .grid-image .item-link {
height:auto;
}
.grid .grid-image .grid-item-logo {
display: block;
height:auto;
width:auto;
padding:0px; padding:0px;
} }
.grid .grid-image .grid-item-logo img {
height: auto;
width: 100%;
margin: auto;
max-height:none;
}
#menupageaction {
float: right;
font-size: 20px;
margin: 5px 15px 0px 0px
}
@media (min-width: 768px) {
.pagemenu { .pagemenu {
display: block; display: block;
margin: 0px -30px; margin: 0px -30px;
@ -330,28 +389,6 @@
line-height: 40px; line-height: 40px;
} }
.navpagemenu {
float: left;
list-style: none;
margin: 0px 15px 0px 0px;
padding:0px;
list-style: none;
}
.navpagemenu li {
float: left;
list-style: none;
margin: 0px;
padding:0px 10px;
list-style: none;
}
.navpagemenu li a:hover {
text-decoration:none;
}
}
.widgetplacehorder { .widgetplacehorder {
height:50px; height:50px;
border: 2px dotted #3498db; border: 2px dotted #3498db;
@ -367,8 +404,11 @@
} }
.widgetmenu { .widgetmenu {
float: right; right: 20px;
padding: 10px; position: absolute;
margin-top: 10px;
display:none;
z-index: 10000000;
} }
.widgetmenu i { .widgetmenu i {
@ -376,12 +416,27 @@
} }
.widgetheader { .widgetheader {
padding:10px; font-size: 30px;
font-size:20px; height: 50px;
font-weight: bold; line-height: 50px;
height:50px; text-transform: uppercase;
cursor: move;
} }
.widgetheader .logo {
position: absolute;
height:40px;
width:40px;
border-radius: 100%;
margin: 5px;
}
.widgetheader .title {
position: absolute;
margin-left:50px;
}
.widgetheader iframe,
.widgetbody iframe { .widgetbody iframe {
width:100%; width:100%;
border:0px; border:0px;
@ -395,6 +450,69 @@
border:0px; border:0px;
height:100%; height:100%;
} }
.feed{
height:200px;
padding: 10px;
overflow: hidden;
}
.feed h1 {
margin:0px;
font-size: 20px;
color: #fff;
background-color: rgba(0, 0, 0, 0.6);
padding:10px;
}
.feed .description {
width: 70%;
float: right;
margin-top: 5px;
background: rgb(0,0,0,0.6);
padding: 10px;
font-size: 11px;
max-height: 110px;
overflow-y: hidden;
}
/* slick */
.slick {
width:100%;
height:100%;
position:relative;
}
.slick div{
width:100%;
height:100%;
background-size: cover;
background-position: center;
color:#fff;
}
.slick .slicktitle {
text-align: left;
margin: 30px 0px 0px 50px;
padding: 15px;
background-color: rgb(0,0,0,0.4);
display: inline-block;
float: left;
}
.slick .slicksubtitle,
.slick .slicklink
{
margin: 5px 0px 0px 50px;
padding: 15px;
background-color: rgb(0,0,0,0.4);
font-size: 15px;
text-transform: initial;
float: left;
clear: both;
line-height: 15px;
}
</style> </style>
<style> <style>
@ -409,7 +527,7 @@
.pagination>.active>span:hover, .pagination>.active>span:hover,
.herotitle img, .herotitle img,
.avatar, .avatar,
#pagemenu .pagemenu
{ {
background-color: #{{ color['main'] }} background-color: #{{ color['main'] }}
} }
@ -443,8 +561,7 @@
.nav>li>a:hover, .nav>li>a:hover,
.nav .open>a, .nav .open>a:focus, .nav .open>a:hover, .nav .open>a, .nav .open>a:focus, .nav .open>a:hover,
.sidebar ul li a.active, .sidebar ul li a.active,
.navpagemenu li:hover, .navbar-top-links li.active a
.navpagemenu li.active
{ {
background-color: #{{ color['dark'] }} background-color: #{{ color['dark'] }}
} }
@ -469,7 +586,7 @@
.navbar-default .navbar-brand, .navbar-default .navbar-brand,
.navbar-default a, .navbar-default a,
.sidebar a, .sidebar a,
#pagemenu a { .pagemenu a {
color: #{{ color['fontcolorhover'] }} color: #{{ color['fontcolorhover'] }}
} }
@ -477,7 +594,7 @@
.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:focus,
.navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:hover,
.navbar-default a:hover, .navbar-default a:hover,
#pagemenu a:hover { .pagemenu a:hover {
color: #{{ color['fontcolorhoverdark'] }} color: #{{ color['fontcolorhoverdark'] }}
} }
@ -485,11 +602,14 @@
.header .title, .header .title,
.panel-heading, .panel-heading,
.widgetheader,
h1 { h1 {
font-family: {{ app.session.get('fontfacetitle') }}; font-family: {{ app.session.get('fontfacetitle') }};
} }
body { body,
.slick .slicksubtitle,
.slick .slicklink {
font-family: {{ app.session.get('fontfacebody') }}; font-family: {{ app.session.get('fontfacebody') }};
} }
</style> </style>

View File

@ -1,71 +0,0 @@
{% if app.session.get('fgheader') %}
<!-- Header -->
{% set color = app.session.get('color') %}
{% if useheader %}
<div class="header" style="height:{{ app.session.get('heightheader') }}px; background-image: linear-gradient(90deg,rgba({{ color['mainrgb']['r'] }},{{ color['mainrgb']['g'] }},{{ color['mainrgb']['b'] }},1),rgba({{ color['mainrgb']['r'] }},{{ color['mainrgb']['g'] }},{{ color['mainrgb']['b'] }},0.1)),url(/{{ alias }}/{{ app.session.get('header') }});">
<a class="title" href="{{ path("cadoles_core_home") }}">
<img id="logo" src="/{{ alias }}/{{ app.session.get('logo') }}" style="height:{{ app.session.get('heightheader')-20 }}px;">
<span style="height:{{ app.session.get('heightheader')}}px; line-height:{{ app.session.get('heightheader')}}px;">{{ app.session.get('appname') }}</span>
</a>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<ul class="nav navbar-top-links navbar-right">
{{ include('@CadolesCore/Include/menu.html.twig') }}
</ul>
</div>
{% endif %}
{% if usemenu %}
<nav class="navbarheader navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<ul class="nav navbar-top-links navbar-left">
</ul>
</nav>
{% endif %}
{% endif %}
<!-- Navigation -->
<nav class="navbarsmall navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0;{% if app.session.get('fgheader') %} display:none; {% endif %}">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ path("cadoles_core_home") }}">
<img id="logo" src="/{{ alias }}/{{ app.session.get('logo') }}">
{{ app.session.get('appname') }}
</a>
</div>
<ul class="nav navbar-top-links navbar-right">
{{ include('@CadolesCore/Include/menu.html.twig') }}
</ul>
</nav>
{% if usesidebar %}
<nav>
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav in" id="side-menu">
{% block sidebar %}
{{ include('@CadolesCore/Include/sidebar.html.twig') }}
{% endblock %}
</ul>
</div>
</div>
</nav>
{% endif %}

View File

@ -1,3 +1,5 @@
{% set color = app.session.get('color') %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -5,27 +7,99 @@
<style> <style>
{% block localstyle %} {% block localstyle %}
{% endblock %} {% endblock %}
</style> </style>
<body class="{% if useheader %}body{% else %}simple{% endif %}"> <body class="{% if useheader %}body{% else %}simple{% endif %}">
<div id="wrapper"> <div id="wrapper">
{{ include('@CadolesCore/Include/hero.html.twig') }} {% if app.session.get('fgheader') %}
{% if useheader %} {% if useheader %}
<div class="header" style="height:{{ app.session.get('heightheader') }}px; background-image: linear-gradient(90deg,rgba({{ color['mainrgb']['r'] }},{{ color['mainrgb']['g'] }},{{ color['mainrgb']['b'] }},1),rgba({{ color['mainrgb']['r'] }},{{ color['mainrgb']['g'] }},{{ color['mainrgb']['b'] }},0.1)),url(/{{ alias }}/{{ app.session.get('header') }});">
<a class="title" style="cursor: pointer" onClick="showHome()"">
<img id="logo" src="/{{ alias }}/{{ app.session.get('logo') }}" style="height:{{ app.session.get('heightheader')-20 }}px;">
<span style="height:{{ app.session.get('heightheader')}}px; line-height:{{ app.session.get('heightheader')}}px;">{{ app.session.get('appname') }}</span>
</a>
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<ul class="nav navbar-top-links navbar-right">
{{ include('@CadolesCore/Include/menu.html.twig') }}
</ul>
</div>
{% endif %}
{% endif %}
<!-- Navigation -->
{% if useheader %}
<nav class="navbarsmall navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0;{% if app.session.get('fgheader') %} display:none; {% endif %}">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ path("cadoles_core_home") }}">
<img id="logo" src="/{{ alias }}/{{ app.session.get('logo') }}">
{{ app.session.get('appname') }}
</a>
</div>
<ul class="nav navbar-top-links navbar-right">
{{ include('@CadolesCore/Include/menu.html.twig') }}
</ul>
</nav>
{% endif %}
{% if usemenu %}
<nav id="appmenu" class="navbarheader navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
{% block appmenu %}
{% endblock %}
</nav>
{% endif %}
{% if usesidebar %}
<nav>
<div class="navbar-default sidebar" role="navigation">
<div class="sidebar-nav navbar-collapse">
<ul class="nav in" id="side-menu">
{% block sidebar %}
{{ include('@CadolesCore/Include/sidebar.html.twig') }}
{% endblock %}
</ul>
</div>
</div>
</nav>
{% endif %}
<div id="page-wrapper" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %}"> <div id="page-wrapper" style="min-height:1200px; {% if not usesidebar %} margin:0px; {% endif %}">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
{% endif %}
{% block pagewrapper %} {% block pagewrapper %}
{% endblock %} {% endblock %}
{% if useheader %}
</div> </div>
</div> </div>
</div> </div>
{% endif %}
</div> </div>
{{ include('@CadolesCore/Include/footer.html.twig') }} {{ include('@CadolesCore/Include/footer.html.twig') }}

View File

@ -1,37 +0,0 @@
<!DOCTYPE html>
<html>
{{ include('@CadolesCore/Include/head.html.twig') }}
<style>
{% block localstyle %}
{% endblock %}
</style>
<body class="body">
<div id="wrapper">
{% set usesidebar = false %}
{{ include('@CadolesCore/Include/hero.html.twig') }}
<div id="page-wrapper" style="min-height:1200px; margin:0px; ">
<div class="container-fluid">
<div class="row">
{% block pagewrapper %}
{% endblock %}
</div>
</div>
</div>
</div>
{{ include('@CadolesCore/Include/footer.html.twig') }}
<script>
{% block localjavascript %}
{% endblock %}
</script>
</body>
</html>

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